Mercurial > hg > Members > shinya > pyrect
changeset 19:d40b248a526b
add star/union/concat rule's graph (graph/*.png).
author | Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 05 Jul 2010 15:23:08 +0900 |
parents | ec36e784df2e |
children | de33e445fcc7 |
files | code/graph/complex_dfa.dot code/graph/complex_dfa.png code/graph/complex_nfa.dot code/graph/complex_nfa.png code/graph/concat.dot code/graph/concat.png code/graph/makegraph.sh code/graph/star.dot code/graph/star.png code/graph/union.dot code/graph/union.png src/converter.py |
diffstat | 11 files changed, 146 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/code/graph/complex_dfa.dot Mon Jul 05 15:23:08 2010 +0900 @@ -0,0 +1,46 @@ + +digraph G{ + d2tdocpreamble = "\usetikzlibrary{automata}"; + d2tfigpreamble = "\tikzstyle{every state}= \ + [draw=blue!50,very thick,shape=circle, fill=blue!20]"; + node [style="state"]; + edge [lblstyle="fill=blue!20", style="arrows=->", topath="bend left"]; + s9 [style="state, initial"] + s0 [style="state, accepting"] + s1 [style="state, accepting"] + s4 [style="state, accepting"] + s5 [style="state, accepting"] + s6 [style="state, accepting"] + s7 [style="state, accepting"] + s8 [style="state, accepting"] + s9 [style="state, accepting"] + s10 [style="state, accepting"] + s11 [style="state, accepting"] + s12 [style="state, accepting"] + s0 -> s8 [texlbl="1"] + s0 -> s5 [texlbl="0"] + s1 -> s7 [texlbl="1"] + s1 -> s2 [texlbl="0"] + s2 -> s11 [texlbl="1"] + s2 -> s1 [texlbl="0"] + s3 -> s11 [texlbl="1"] + s3 -> s1 [texlbl="0"] + s4 -> s7 [texlbl="1"] + s4 -> s2 [texlbl="0"] + s5 -> s3 [texlbl="1"] + s5 -> s6 [texlbl="0"] + s6 -> s4 [texlbl="1"] + s6 -> s5 [texlbl="0"] + s7 -> s4 [texlbl="1"] + s7 -> s5 [texlbl="0"] + s8 -> s0 [texlbl="1"] + s8 -> s2 [texlbl="0"] + s9 -> s8 [texlbl="1"] + s9 -> s10 [texlbl="0"] + s10 -> s3 [texlbl="1"] + s10 -> s12 [texlbl="0"] + s11 -> s3 [texlbl="1"] + s11 -> s6 [texlbl="0"] + s12 -> s4 [texlbl="1"] + s12 -> s10 [texlbl="0"] +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/code/graph/complex_nfa.dot Mon Jul 05 15:23:08 2010 +0900 @@ -0,0 +1,57 @@ + +digraph G{ + d2tdocpreamble = "\usetikzlibrary{automata}"; + d2tfigpreamble = "\tikzstyle{every state}= \ + [draw=blue!50,very thick,shape=circle, fill=blue!20]"; + node [style="state"]; + edge [lblstyle="fill=blue!20", style="arrows=->", topath="bend left"]; + s29 [style="state, initial"] + s26 [style="state, accepting"] + s27 [style="state, accepting"] + s14 [style="state, accepting"] + s28 [style="state, accepting"] + s13 [style="state, accepting"] + s12 [style="state, accepting"] + s24 -> s27 [texlbl="$\varepsilon$"] + s25 -> s26 [texlbl="0"] + s26 -> s25 [texlbl="$\varepsilon$"] + s26 -> s18 [texlbl="$\varepsilon$"] + s27 -> s25 [texlbl="$\varepsilon$"] + s27 -> s18 [texlbl="$\varepsilon$"] + s20 -> s21 [texlbl="0"] + s21 -> s20 [texlbl="$\varepsilon$"] + s21 -> s23 [texlbl="$\varepsilon$"] + s22 -> s20 [texlbl="$\varepsilon$"] + s22 -> s23 [texlbl="$\varepsilon$"] + s23 -> s24 [texlbl="1"] + s28 -> s18 [texlbl="$\varepsilon$"] + s29 -> s17 [texlbl="$\varepsilon$"] + s29 -> s3 [texlbl="$\varepsilon$"] + s1 -> s2 [texlbl="1"] + s3 -> s1 [texlbl="$\varepsilon$"] + s3 -> s14 [texlbl="$\varepsilon$"] + s2 -> s1 [texlbl="$\varepsilon$"] + s2 -> s14 [texlbl="$\varepsilon$"] + s5 -> s8 [texlbl="$\varepsilon$"] + s4 -> s5 [texlbl="0"] + s7 -> s9 [texlbl="$\varepsilon$"] + s7 -> s6 [texlbl="$\varepsilon$"] + s6 -> s7 [texlbl="1"] + s9 -> s10 [texlbl="0"] + s8 -> s9 [texlbl="$\varepsilon$"] + s8 -> s6 [texlbl="$\varepsilon$"] + s11 -> s12 [texlbl="1"] + s10 -> s13 [texlbl="$\varepsilon$"] + s13 -> s11 [texlbl="$\varepsilon$"] + s13 -> s4 [texlbl="$\varepsilon$"] + s12 -> s11 [texlbl="$\varepsilon$"] + s12 -> s4 [texlbl="$\varepsilon$"] + s15 -> s16 [texlbl="0"] + s14 -> s4 [texlbl="$\varepsilon$"] + s17 -> s28 [texlbl="$\varepsilon$"] + s17 -> s15 [texlbl="$\varepsilon$"] + s16 -> s28 [texlbl="$\varepsilon$"] + s16 -> s15 [texlbl="$\varepsilon$"] + s19 -> s22 [texlbl="$\varepsilon$"] + s18 -> s19 [texlbl="1"] +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/code/graph/concat.dot Mon Jul 05 15:23:08 2010 +0900 @@ -0,0 +1,13 @@ + +digraph G{ + d2tdocpreamble = "\usetikzlibrary{automata}"; + d2tfigpreamble = "\tikzstyle{every state}= \ + [draw=blue!50,very thick,shape=circle, fill=blue!20]"; + node [style="state"]; + edge [lblstyle="fill=blue!20", style="arrows=->", topath="bend left"]; + s1 [style="state, initial"] + s4 [style="state, accepting"] + s1 -> s2 [texlbl="0"] + s3 -> s4 [texlbl="1"] + s2 -> s3 [texlbl="$\varepsilon$"] +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/code/graph/star.dot Mon Jul 05 15:23:08 2010 +0900 @@ -0,0 +1,14 @@ + +digraph G{ + d2tdocpreamble = "\usetikzlibrary{automata}"; + d2tfigpreamble = "\tikzstyle{every state}= \ + [draw=blue!50,very thick,shape=circle, fill=blue!20]"; + node [style="state"]; + edge [lblstyle="fill=blue!20", style="arrows=->", topath="bend left"]; + s3 [style="state, initial"] + s3 [style="state, accepting"] + s2 [style="state, accepting"] + s1 -> s2 [texlbl="0"] + s3 -> s1 [texlbl="$\varepsilon$"] + s2 -> s1 [texlbl="$\varepsilon$"] +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/code/graph/union.dot Mon Jul 05 15:23:08 2010 +0900 @@ -0,0 +1,15 @@ + +digraph G{ + d2tdocpreamble = "\usetikzlibrary{automata}"; + d2tfigpreamble = "\tikzstyle{every state}= \ + [draw=blue!50,very thick,shape=circle, fill=blue!20]"; + node [style="state"]; + edge [lblstyle="fill=blue!20", style="arrows=->", topath="bend left"]; + s5 [style="state, initial"] + s2 [style="state, accepting"] + s4 [style="state, accepting"] + s1 -> s2 [texlbl="0"] + s3 -> s4 [texlbl="1"] + s5 -> s1 [texlbl="$\varepsilon$"] + s5 -> s3 [texlbl="$\varepsilon$"] +} \ No newline at end of file
--- a/src/converter.py Mon Jul 05 08:36:11 2010 +0900 +++ b/src/converter.py Mon Jul 05 15:23:08 2010 +0900 @@ -20,7 +20,7 @@ psr.add_option("-O", action="store", type="string", dest="optimize", default=False, help="do optimization (only in llvm).", metavar="FILE") psr.add_option("-L", action="store_true", dest="label", default=False, help="implement with label&goto. (only in llvm).") psr.add_option("-g", action="store_true", dest="debug", default=False, help="embed debug info") - psr.add_option("-D", action="store_true", dest="emitDot", default=False, help="emit Dot file") + psr.add_option("-D", action="store_true", dest="emit_dot", default=False, help="emit Dot file") (opts, args) = psr.parse_args(sys.argv) if len(args) == 1: psr.print_help()