From 030517f49274e5bb4ff10971a18f9229b8eaaa41 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Wed, 24 Oct 2018 21:52:24 +0300 Subject: added debug for the bison parser --- demo/bison/calc/parser.svg | 459 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 459 insertions(+) create mode 100644 demo/bison/calc/parser.svg (limited to 'demo/bison/calc/parser.svg') diff --git a/demo/bison/calc/parser.svg b/demo/bison/calc/parser.svg new file mode 100644 index 0000000..67c6535 --- /dev/null +++ b/demo/bison/calc/parser.svg @@ -0,0 +1,459 @@ + + + + + + +parser.y + + +0 + +State 0 +  0 $accept: . input $end +  1 input: . %empty  [$end] +  2      | . expr +  3 expr: . NUMBER +  4     | . '(' expr ')' +  5     | . expr PLUS expr +  6     | . expr MINUS expr +  7     | . expr MULT expr +  8     | . expr DIV expr + + +1 + +State 1 +  3 expr: NUMBER . + + +0->1 + + +NUMBER + + +2 + +State 2 +  3 expr: . NUMBER +  4     | . '(' expr ')' +  4     | '(' . expr ')' +  5     | . expr PLUS expr +  6     | . expr MINUS expr +  7     | . expr MULT expr +  8     | . expr DIV expr + + +0->2 + + +'(' + + +3 + +State 3 +  0 $accept: input . $end + + +0->3 + + +input + + +4 + +State 4 +  2 input: expr .  [$end] +  5 expr: expr . PLUS expr +  6     | expr . MINUS expr +  7     | expr . MULT expr +  8     | expr . DIV expr + + +0->4 + + +expr + + +0R1 + +R1 + + +0->0R1 + + + + +1R3 + +R3 + + +1->1R3 + + + + +2->1 + + +NUMBER + + +2->2 + + +'(' + + +5 + +State 5 +  4 expr: '(' expr . ')' +  5     | expr . PLUS expr +  6     | expr . MINUS expr +  7     | expr . MULT expr +  8     | expr . DIV expr + + +2->5 + + +expr + + +6 + +State 6 +  0 $accept: input $end . + + +3->6 + + +$end + + +7 + +State 7 +  3 expr: . NUMBER +  4     | . '(' expr ')' +  5     | . expr PLUS expr +  5     | expr PLUS . expr +  6     | . expr MINUS expr +  7     | . expr MULT expr +  8     | . expr DIV expr + + +4->7 + + +PLUS + + +8 + +State 8 +  3 expr: . NUMBER +  4     | . '(' expr ')' +  5     | . expr PLUS expr +  6     | . expr MINUS expr +  6     | expr MINUS . expr +  7     | . expr MULT expr +  8     | . expr DIV expr + + +4->8 + + +MINUS + + +9 + +State 9 +  3 expr: . NUMBER +  4     | . '(' expr ')' +  5     | . expr PLUS expr +  6     | . expr MINUS expr +  7     | . expr MULT expr +  7     | expr MULT . expr +  8     | . expr DIV expr + + +4->9 + + +MULT + + +10 + +State 10 +  3 expr: . NUMBER +  4     | . '(' expr ')' +  5     | . expr PLUS expr +  6     | . expr MINUS expr +  7     | . expr MULT expr +  8     | . expr DIV expr +  8     | expr DIV . expr + + +4->10 + + +DIV + + +4R2 + +R2 + + +4->4R2 + + + + +5->7 + + +PLUS + + +5->8 + + +MINUS + + +5->9 + + +MULT + + +5->10 + + +DIV + + +11 + +State 11 +  4 expr: '(' expr ')' . + + +5->11 + + +')' + + +6R0 + +Acc + + +6->6R0 + + + + +7->1 + + +NUMBER + + +7->2 + + +'(' + + +12 + +State 12 +  5 expr: expr . PLUS expr +  5     | expr PLUS expr .  [$end, PLUS, MINUS, ')'] +  6     | expr . MINUS expr +  7     | expr . MULT expr +  8     | expr . DIV expr + + +7->12 + + +expr + + +8->1 + + +NUMBER + + +8->2 + + +'(' + + +13 + +State 13 +  5 expr: expr . PLUS expr +  6     | expr . MINUS expr +  6     | expr MINUS expr .  [$end, PLUS, MINUS, ')'] +  7     | expr . MULT expr +  8     | expr . DIV expr + + +8->13 + + +expr + + +9->1 + + +NUMBER + + +9->2 + + +'(' + + +14 + +State 14 +  5 expr: expr . PLUS expr +  6     | expr . MINUS expr +  7     | expr . MULT expr +  7     | expr MULT expr .  [$end, PLUS, MINUS, MULT, DIV, ')'] +  8     | expr . DIV expr + + +9->14 + + +expr + + +10->1 + + +NUMBER + + +10->2 + + +'(' + + +15 + +State 15 +  5 expr: expr . PLUS expr +  6     | expr . MINUS expr +  7     | expr . MULT expr +  8     | expr . DIV expr +  8     | expr DIV expr .  [$end, PLUS, MINUS, MULT, DIV, ')'] + + +10->15 + + +expr + + +11R4 + +R4 + + +11->11R4 + + + + +12->9 + + +MULT + + +12->10 + + +DIV + + +12R5 + +R5 + + +12->12R5 + + + + +13->9 + + +MULT + + +13->10 + + +DIV + + +13R6 + +R6 + + +13->13R6 + + + + +14R7 + +R7 + + +14->14R7 + + + + +15R8 + +R8 + + +15->15R8 + + + + + -- cgit v1.3.1-26-gb76a