# HG changeset patch # User Ryoma SHINYA # Date 1278310988 -32400 # Node ID d40b248a526bf76a60918cc6a5d4ccc9b4513821 # Parent ec36e784df2e188d7dc74b901c987410d90e3f83 add star/union/concat rule's graph (graph/*.png). diff -r ec36e784df2e -r d40b248a526b code/graph/complex_dfa.dot --- /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 diff -r ec36e784df2e -r d40b248a526b code/graph/complex_dfa.png Binary file code/graph/complex_dfa.png has changed diff -r ec36e784df2e -r d40b248a526b code/graph/complex_nfa.dot --- /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 diff -r ec36e784df2e -r d40b248a526b code/graph/complex_nfa.png Binary file code/graph/complex_nfa.png has changed diff -r ec36e784df2e -r d40b248a526b code/graph/concat.dot --- /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 diff -r ec36e784df2e -r d40b248a526b code/graph/concat.png Binary file code/graph/concat.png has changed diff -r ec36e784df2e -r d40b248a526b code/graph/makegraph.sh diff -r ec36e784df2e -r d40b248a526b code/graph/star.dot --- /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 diff -r ec36e784df2e -r d40b248a526b code/graph/star.png Binary file code/graph/star.png has changed diff -r ec36e784df2e -r d40b248a526b code/graph/union.dot --- /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 diff -r ec36e784df2e -r d40b248a526b code/graph/union.png Binary file code/graph/union.png has changed diff -r ec36e784df2e -r d40b248a526b src/converter.py --- 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()