depager 0.2.3 → 0.3.0.b20160729
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.en +4 -19
- data/README.ja +42 -79
- data/bin/depager +42 -45
- data/examples/action_pl0d/pl0d.action.dr +421 -0
- data/examples/action_pl0d/test.pl0ds +49 -0
- data/examples/c89/c89.dr +493 -496
- data/examples/c89/test.c89 +10 -10
- data/examples/extension/astdf.rb +10 -0
- data/examples/extension/atree.dr +55 -0
- data/examples/{sample_calc → extension}/calc.atree.dr +42 -43
- data/examples/extension/calc.simple_action.dr +33 -0
- data/examples/extension/paction.dr +16 -15
- data/examples/extension/pactiontest.dr +14 -14
- data/examples/extension/simple_action.rb +44 -0
- data/examples/pl0d/pl0ds.dr +337 -334
- data/examples/pl0d/test.pl0ds +33 -33
- data/examples/rie_calc/calc.rie.dr +57 -0
- data/examples/rie_calc/test.calc +4 -0
- data/examples/rie_dcuse/dcuse.rie.dr +71 -0
- data/examples/rie_dcuse/test.dcuse +1 -0
- data/examples/rie_pl0/orig_ex/exerrdg.pl0 +44 -0
- data/examples/rie_pl0/orig_ex/exerrm.pl0 +19 -0
- data/examples/rie_pl0/orig_ex/exerrmre.pl0 +20 -0
- data/examples/rie_pl0/orig_ex/exerrtok.pl0 +18 -0
- data/examples/rie_pl0/orig_ex/exmdg.pl0 +40 -0
- data/examples/rie_pl0/orig_ex/exmdgwwl.pl0 +43 -0
- data/examples/rie_pl0/orig_ex/exmrw.pl0 +22 -0
- data/examples/rie_pl0/orig_ex/exmwwl.pl0 +18 -0
- data/examples/rie_pl0/orig_ex/exnorw.pl0 +17 -0
- data/examples/rie_pl0/pl0.rie.dr +450 -0
- data/examples/rie_pl0/test.pl0 +10 -0
- data/examples/sample_calc/calc.action.dr +33 -33
- data/examples/sample_calc/calc.ast.action.dr +65 -66
- data/examples/sample_calc/calc.ast.dr +55 -55
- data/examples/sample_calc/calc.cst.dr +45 -45
- data/examples/sample_calc/calc.dr +43 -43
- data/examples/sample_calc/calc.lex.dr +29 -29
- data/examples/sample_calc/{calc_prec.nvaction.dr → calc_prec.action.dr} +31 -31
- data/examples/slex_test/divreg.slex.dr +29 -29
- data/examples/slex_test/ljoin.slex.dr +36 -36
- data/examples/slex_test/test.divreg +1 -1
- data/examples/slex_test/test.ljoin +3 -3
- data/lib/depager.rb +582 -670
- data/lib/depager/grammar.rb +256 -291
- data/lib/depager/lr.rb +574 -579
- data/lib/depager/parser.rb +282 -277
- data/lib/depager/ruby/plugins/_rie_debug.rb +35 -0
- data/lib/depager/ruby/plugins/action.rb +53 -43
- data/lib/depager/ruby/plugins/ast.dr +364 -269
- data/lib/depager/ruby/plugins/ast.rb +1367 -1308
- data/lib/depager/ruby/plugins/cst.dr +172 -180
- data/lib/depager/ruby/plugins/cst.rb +587 -626
- data/lib/depager/ruby/plugins/lex.dr +85 -89
- data/lib/depager/ruby/plugins/lex.rb +310 -336
- data/lib/depager/ruby/plugins/rie.dr +723 -0
- data/lib/depager/ruby/plugins/rie.rb +1653 -0
- data/lib/depager/ruby/plugins/slex.dr +202 -200
- data/lib/depager/ruby/plugins/slex.rb +780 -817
- data/lib/depager/ruby/plugins/srp.rb +56 -51
- data/lib/depager/ruby/templates/extension_lalr_master.erb +46 -51
- data/lib/depager/ruby/templates/extension_lalr_slave.erb +99 -107
- data/lib/depager/ruby/templates/single_lalr_parser.erb +115 -117
- data/lib/depager/utils.rb +148 -318
- data/lib/depager/version.rb +4 -3
- metadata +52 -60
- data/ChangeLog +0 -16
- data/data/depager/pre-setup.rb +0 -3
- data/examples/c89/c89.tab.rb +0 -7127
- data/examples/pl0d/pl0ds.tab.rb +0 -2698
- data/examples/sample_calc/calc.action.tab.rb +0 -457
- data/examples/sample_calc/calc.ast.action.tab.rb +0 -749
- data/examples/sample_calc/calc.ast.tab.rb +0 -665
- data/examples/sample_calc/calc.astdf.dr +0 -54
- data/examples/sample_calc/calc.astdf.tab.rb +0 -672
- data/examples/sample_calc/calc.atree.tab.rb +0 -451
- data/examples/sample_calc/calc.cst.tab.rb +0 -644
- data/examples/sample_calc/calc.lex.tab.rb +0 -374
- data/examples/sample_calc/calc.nvaction.dr +0 -33
- data/examples/sample_calc/calc.nvaction.tab.rb +0 -465
- data/examples/sample_calc/calc.tab.rb +0 -365
- data/examples/sample_calc/calc_prec.nvaction.tab.rb +0 -431
- data/examples/slex_test/divreg.slex.tab.rb +0 -303
- data/examples/slex_test/ljoin.slex.tab.rb +0 -370
- data/lib/depager/ruby/plugins/_ast_tmpl.rb +0 -73
- data/lib/depager/ruby/plugins/astdf.rb +0 -6
- data/lib/depager/ruby/plugins/atree.dr +0 -55
- data/lib/depager/ruby/plugins/atree.rb +0 -347
- data/lib/depager/ruby/plugins/nvaction.rb +0 -19
- data/lib/depager/ruby/templates/simple.erb +0 -23
- data/setup.rb +0 -1585
@@ -1,33 +1,33 @@
|
|
1
|
-
%class TinyCalc
|
2
|
-
%extend Lexer ('plugins/lex.rb')
|
3
|
-
%extend Action ('plugins/action.rb')
|
4
|
-
%decorate @Action
|
5
|
-
#%decorate ShiftReducePrinter ('plugins/srp.rb')
|
6
|
-
%%
|
7
|
-
|
8
|
-
%LEX{
|
9
|
-
/\s+/, /\#.*/ { }
|
10
|
-
/[1-9][0-9]*/ { yield token(:NUM, $&.to_i) }
|
11
|
-
/./ { yield token($&, $&) }
|
12
|
-
%}
|
13
|
-
|
14
|
-
#begin-rule
|
15
|
-
expr :
|
16
|
-
expr '+' term {
|
17
|
-
| expr '-' term {
|
18
|
-
| term {
|
19
|
-
;
|
20
|
-
term :
|
21
|
-
term '*' fact {
|
22
|
-
| term '/' fact {
|
23
|
-
| fact {
|
24
|
-
;
|
25
|
-
fact :
|
26
|
-
NUM {
|
27
|
-
| '(' expr ')' {
|
28
|
-
;
|
29
|
-
#end-rule
|
30
|
-
%%
|
31
|
-
parser = TinyCalc
|
32
|
-
r, = parser.parse(STDIN)
|
33
|
-
puts r
|
1
|
+
%class TinyCalc::Parser
|
2
|
+
%extend Depager::Lexer ('plugins/lex.rb')
|
3
|
+
%extend Depager::Action ('plugins/action.rb')
|
4
|
+
%decorate @Action
|
5
|
+
#%decorate Depager::LALR::ShiftReducePrinter ('plugins/srp.rb')
|
6
|
+
%%
|
7
|
+
|
8
|
+
%LEX{
|
9
|
+
/\s+/, /\#.*/ { }
|
10
|
+
/[1-9][0-9]*/ { yield token(:NUM, $&.to_i) }
|
11
|
+
/./ { yield token($&, $&) }
|
12
|
+
%}
|
13
|
+
|
14
|
+
#begin-rule
|
15
|
+
expr :
|
16
|
+
expr '+' term { _expr + _term }
|
17
|
+
| expr '-' term { _expr - _term }
|
18
|
+
| term { _term }
|
19
|
+
;
|
20
|
+
term :
|
21
|
+
term '*' fact { _term * _fact }
|
22
|
+
| term '/' fact { _term / _fact }
|
23
|
+
| fact { _fact }
|
24
|
+
;
|
25
|
+
fact :
|
26
|
+
NUM { _NUM.value }
|
27
|
+
| '(' expr ')' { _expr }
|
28
|
+
;
|
29
|
+
#end-rule
|
30
|
+
%%
|
31
|
+
parser = TinyCalc.create_decorated_parser
|
32
|
+
r, = parser.parse(STDIN)
|
33
|
+
puts r
|
@@ -1,66 +1,65 @@
|
|
1
|
-
%class TinyCalc
|
2
|
-
%extend Lexer ('plugins/lex.rb')
|
3
|
-
%extend ASTBuilder ('plugins/ast.rb')
|
4
|
-
%extend Action ('plugins/action.rb')
|
5
|
-
%decorate @ASTBuilder
|
6
|
-
%decorate @Action
|
7
|
-
#%decorate ShiftReducePrinter ('plugins/srp.rb')
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
expr
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
term
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
NUM
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
pp
|
65
|
-
pp t
|
66
|
-
pp t
|
1
|
+
%class TinyCalc::Parser
|
2
|
+
%extend Depager::Lexer ('plugins/lex.rb')
|
3
|
+
%extend Depager::ASTBuilder ('plugins/ast.rb')
|
4
|
+
%extend Depager::Action ('plugins/action.rb')
|
5
|
+
%decorate @ASTBuilder
|
6
|
+
%decorate @Action
|
7
|
+
#%decorate Depager::LALR::ShiftReducePrinter ('plugins/srp.rb')
|
8
|
+
%%
|
9
|
+
|
10
|
+
%LEX{
|
11
|
+
/\s+/, /\#.*/, /\n/ { }
|
12
|
+
/[1-9][0-9]*/ { yield token(:NUM, $&.to_i) }
|
13
|
+
/./ { yield token($&, $&) }
|
14
|
+
%}
|
15
|
+
|
16
|
+
%AST{
|
17
|
+
Node [value] { @value = nil }
|
18
|
+
Visitor { }
|
19
|
+
add(left, right) { $.value = visit($.left).value + visit($.right).value }
|
20
|
+
sub(left, right) { $.value = visit($.left).value - visit($.right).value }
|
21
|
+
mul(left, right) { $.value = visit($.left).value * visit($.right).value }
|
22
|
+
div(left, right) { $.value = visit($.left).value / visit($.right).value }
|
23
|
+
literal(-n) { $.value = $.n.value }
|
24
|
+
%}
|
25
|
+
|
26
|
+
#begin-rule
|
27
|
+
expr :
|
28
|
+
expr '+' term
|
29
|
+
=> add(expr, term)
|
30
|
+
{ val[0] + val[2] }
|
31
|
+
| expr '-' term
|
32
|
+
=> sub(expr, term)
|
33
|
+
{ val[0] - val[2] }
|
34
|
+
| term
|
35
|
+
=> term
|
36
|
+
{ val[0] }
|
37
|
+
;
|
38
|
+
term :
|
39
|
+
term '*' fact
|
40
|
+
=> mul(term, fact)
|
41
|
+
{ val[0] * val[2] }
|
42
|
+
| term '/' fact
|
43
|
+
=> div(term, fact)
|
44
|
+
{ val[0] / val[2] }
|
45
|
+
| fact
|
46
|
+
=> fact
|
47
|
+
{ val[0] }
|
48
|
+
;
|
49
|
+
fact :
|
50
|
+
NUM
|
51
|
+
=> literal(NUM)
|
52
|
+
{ val[0].value }
|
53
|
+
| '(' expr ')'
|
54
|
+
=> expr
|
55
|
+
{ val[1].value }
|
56
|
+
;
|
57
|
+
#end-rule
|
58
|
+
%%
|
59
|
+
require 'pp'
|
60
|
+
parser = TinyCalc.create_decorated_parser()
|
61
|
+
t, r = parser.parse(STDIN)
|
62
|
+
v = TinyCalc::Visitor.new
|
63
|
+
pp r
|
64
|
+
pp t.accept(v).value
|
65
|
+
pp t
|
@@ -1,55 +1,55 @@
|
|
1
|
-
%class TinyCalc
|
2
|
-
%extend Lexer ('plugins/lex.rb')
|
3
|
-
%extend ASTBuilder ('plugins/ast.rb')
|
4
|
-
%decorate @ASTBuilder
|
5
|
-
#%decorate ShiftReducePrinter ('plugins/srp.rb')
|
6
|
-
%%
|
7
|
-
|
8
|
-
%LEX{
|
9
|
-
/\s+/, /\#.*/ { }
|
10
|
-
/[1-9][0-9]*/ { yield token(:NUM, $&.to_i) }
|
11
|
-
/./ { yield token($&, $&) }
|
12
|
-
%}
|
13
|
-
|
14
|
-
%AST{
|
15
|
-
Node [value] { @value = nil }
|
16
|
-
Visitor { }
|
17
|
-
add(left, right) { $.value = visit($.left).value + visit($.right).value }
|
18
|
-
sub(left, right) { $.value = visit($.left).value - visit($.right).value }
|
19
|
-
mul(left, right) { $.value = visit($.left).value * visit($.right).value }
|
20
|
-
div(left, right) { $.value = visit($.left).value / visit($.right).value }
|
21
|
-
literal(-n) { $.value = $.n.value }
|
22
|
-
%}
|
23
|
-
|
24
|
-
#begin-rule
|
25
|
-
expr :
|
26
|
-
expr '+' term
|
27
|
-
=> add(expr, term)
|
28
|
-
| expr '-' term
|
29
|
-
=> sub(expr, term)
|
30
|
-
| term
|
31
|
-
=> term
|
32
|
-
;
|
33
|
-
term :
|
34
|
-
term '*' fact
|
35
|
-
=> mul(term, fact)
|
36
|
-
| term '/' fact
|
37
|
-
=> div(term, fact)
|
38
|
-
| fact
|
39
|
-
=> fact
|
40
|
-
;
|
41
|
-
fact :
|
42
|
-
NUM
|
43
|
-
=> literal(NUM)
|
44
|
-
| '(' expr ')'
|
45
|
-
=> expr
|
46
|
-
;
|
47
|
-
#end-rule
|
48
|
-
%%
|
49
|
-
require 'pp'
|
50
|
-
parser =
|
51
|
-
t, = parser.parse(STDIN)
|
52
|
-
v = Visitor.new
|
53
|
-
pp t.accept(v).value
|
54
|
-
pp t
|
55
|
-
|
1
|
+
%class TinyCalc::Parser
|
2
|
+
%extend Depager::Lexer ('plugins/lex.rb')
|
3
|
+
%extend Depager::ASTBuilder ('plugins/ast.rb')
|
4
|
+
%decorate @ASTBuilder
|
5
|
+
#%decorate Depager::LALR::ShiftReducePrinter ('plugins/srp.rb')
|
6
|
+
%%
|
7
|
+
|
8
|
+
%LEX{
|
9
|
+
/\s+/, /\#.*/ { }
|
10
|
+
/[1-9][0-9]*/ { yield token(:NUM, $&.to_i) }
|
11
|
+
/./ { yield token($&, $&) }
|
12
|
+
%}
|
13
|
+
|
14
|
+
%AST{
|
15
|
+
Node [value] { @value = nil }
|
16
|
+
Visitor { }
|
17
|
+
add(left, right) { $.value = visit($.left).value + visit($.right).value }
|
18
|
+
sub(left, right) { $.value = visit($.left).value - visit($.right).value }
|
19
|
+
mul(left, right) { $.value = visit($.left).value * visit($.right).value }
|
20
|
+
div(left, right) { $.value = visit($.left).value / visit($.right).value }
|
21
|
+
literal(-n) { $.value = $.n.value }
|
22
|
+
%}
|
23
|
+
|
24
|
+
#begin-rule
|
25
|
+
expr :
|
26
|
+
expr '+' term
|
27
|
+
=> add(expr, term)
|
28
|
+
| expr '-' term
|
29
|
+
=> sub(expr, term)
|
30
|
+
| term
|
31
|
+
=> term
|
32
|
+
;
|
33
|
+
term :
|
34
|
+
term '*' fact
|
35
|
+
=> mul(term, fact)
|
36
|
+
| term '/' fact
|
37
|
+
=> div(term, fact)
|
38
|
+
| fact
|
39
|
+
=> fact
|
40
|
+
;
|
41
|
+
fact :
|
42
|
+
NUM
|
43
|
+
=> literal(NUM)
|
44
|
+
| '(' expr ')'
|
45
|
+
=> expr
|
46
|
+
;
|
47
|
+
#end-rule
|
48
|
+
%%
|
49
|
+
require 'pp'
|
50
|
+
parser = TinyCalc.create_decorated_parser()
|
51
|
+
t, = parser.parse(STDIN)
|
52
|
+
v = TinyCalc::Visitor.new
|
53
|
+
pp t.accept(v).value
|
54
|
+
pp t
|
55
|
+
|
@@ -1,45 +1,45 @@
|
|
1
|
-
%class TinyCalc
|
2
|
-
%extend Lexer ('plugins/lex.rb')
|
3
|
-
%extend CSTBuilder ('plugins/cst.rb')
|
4
|
-
%decorate @CSTBuilder
|
5
|
-
%%
|
6
|
-
|
7
|
-
%LEX{
|
8
|
-
/\s+/, /\#.*/ { }
|
9
|
-
/[1-9][0-9]*/ { yield token(:NUM, $&.to_i) }
|
10
|
-
/./ { yield token($&, $&) }
|
11
|
-
%}
|
12
|
-
|
13
|
-
%CST{
|
14
|
-
Node {
|
15
|
-
attr_accessor :value
|
16
|
-
def initialize
|
17
|
-
@value = nil
|
18
|
-
end
|
19
|
-
}
|
20
|
-
%}
|
21
|
-
|
22
|
-
#begin-rule
|
23
|
-
expr :
|
24
|
-
expr '+' term {
|
25
|
-
| expr '-' term {
|
26
|
-
| term {
|
27
|
-
;
|
28
|
-
term :
|
29
|
-
term '*' fact {
|
30
|
-
| term '/' fact {
|
31
|
-
| fact {
|
32
|
-
;
|
33
|
-
fact :
|
34
|
-
NUM {
|
35
|
-
| '(' expr ')' {
|
36
|
-
;
|
37
|
-
#end-rule
|
38
|
-
%%
|
39
|
-
require 'pp'
|
40
|
-
parser =
|
41
|
-
r, = parser.parse(STDIN)
|
42
|
-
v = Visitor.new
|
43
|
-
r.accept(v)
|
44
|
-
pp r
|
45
|
-
puts r.value
|
1
|
+
%class TinyCalc::Parser
|
2
|
+
%extend Depager::Lexer ('plugins/lex.rb')
|
3
|
+
%extend Depager::CSTBuilder ('plugins/cst.rb')
|
4
|
+
%decorate @CSTBuilder
|
5
|
+
%%
|
6
|
+
|
7
|
+
%LEX{
|
8
|
+
/\s+/, /\#.*/ { }
|
9
|
+
/[1-9][0-9]*/ { yield token(:NUM, $&.to_i) }
|
10
|
+
/./ { yield token($&, $&) }
|
11
|
+
%}
|
12
|
+
|
13
|
+
%CST{
|
14
|
+
Node {
|
15
|
+
attr_accessor :value
|
16
|
+
def initialize
|
17
|
+
@value = nil
|
18
|
+
end
|
19
|
+
}
|
20
|
+
%}
|
21
|
+
|
22
|
+
#begin-rule
|
23
|
+
expr :
|
24
|
+
expr '+' term { $.value = $.expr.value + $.term.value }
|
25
|
+
| expr '-' term { $.value = $.expr.value + $.term.value }
|
26
|
+
| term { $.value = $.term.value }
|
27
|
+
;
|
28
|
+
term :
|
29
|
+
term '*' fact { $.value = $.term.value * $.fact.value }
|
30
|
+
| term '/' fact { $.value = $.term.value / $.fact.value }
|
31
|
+
| fact { $.value = $.fact.value }
|
32
|
+
;
|
33
|
+
fact :
|
34
|
+
NUM { $.value = $.num.value }
|
35
|
+
| '(' expr ')' { $.value = $.expr }
|
36
|
+
;
|
37
|
+
#end-rule
|
38
|
+
%%
|
39
|
+
require 'pp'
|
40
|
+
parser = TinyCalc.create_decorated_parser
|
41
|
+
r, = parser.parse(STDIN)
|
42
|
+
v = TinyCalc::Visitor.new
|
43
|
+
r.accept(v)
|
44
|
+
pp r
|
45
|
+
puts r.value
|
@@ -1,43 +1,43 @@
|
|
1
|
-
%class TinyCalc
|
2
|
-
%inner{
|
3
|
-
def lex
|
4
|
-
until @file.eof?
|
5
|
-
@line = @file.gets
|
6
|
-
until @line.empty? do
|
7
|
-
case @line
|
8
|
-
when /\A\s+/, /\A\#.*/, /\A\n/
|
9
|
-
#skip blank and comment
|
10
|
-
when /\A[0-9]+/
|
11
|
-
yield :NUM, $&
|
12
|
-
when /\A./
|
13
|
-
yield $&, $&
|
14
|
-
else
|
15
|
-
raise RuntimeError, "must not happen #{line}"
|
16
|
-
end
|
17
|
-
@line = $'
|
18
|
-
end
|
19
|
-
end
|
20
|
-
yield nil, nil
|
21
|
-
end
|
22
|
-
%}
|
23
|
-
%%
|
24
|
-
|
25
|
-
#begin-rule
|
26
|
-
expr :
|
27
|
-
expr '+' term
|
28
|
-
| expr '-' term
|
29
|
-
| term
|
30
|
-
;
|
31
|
-
term :
|
32
|
-
term '*' fact
|
33
|
-
| term '/' fact
|
34
|
-
| fact
|
35
|
-
;
|
36
|
-
fact :
|
37
|
-
NUM
|
38
|
-
| '(' expr ')'
|
39
|
-
;
|
40
|
-
#end-rule
|
41
|
-
%%
|
42
|
-
parser = TinyCalc.
|
43
|
-
parser.parse(STDIN)
|
1
|
+
%class TinyCalc::Parser
|
2
|
+
%inner{
|
3
|
+
def lex
|
4
|
+
until @file.eof?
|
5
|
+
@line = @file.gets
|
6
|
+
until @line.empty? do
|
7
|
+
case @line
|
8
|
+
when /\A\s+/, /\A\#.*/, /\A\n/
|
9
|
+
#skip blank and comment
|
10
|
+
when /\A[0-9]+/
|
11
|
+
yield :NUM, $&
|
12
|
+
when /\A./
|
13
|
+
yield $&, $&
|
14
|
+
else
|
15
|
+
raise RuntimeError, "must not happen #{line}"
|
16
|
+
end
|
17
|
+
@line = $'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
yield nil, nil
|
21
|
+
end
|
22
|
+
%}
|
23
|
+
%%
|
24
|
+
|
25
|
+
#begin-rule
|
26
|
+
expr :
|
27
|
+
expr '+' term
|
28
|
+
| expr '-' term
|
29
|
+
| term
|
30
|
+
;
|
31
|
+
term :
|
32
|
+
term '*' fact
|
33
|
+
| term '/' fact
|
34
|
+
| fact
|
35
|
+
;
|
36
|
+
fact :
|
37
|
+
NUM
|
38
|
+
| '(' expr ')'
|
39
|
+
;
|
40
|
+
#end-rule
|
41
|
+
%%
|
42
|
+
parser = TinyCalc.create_decorated_parser()
|
43
|
+
parser.parse(STDIN)
|