diff --git a/contrib/nitcc/tests/amb_repeat.input b/contrib/nitcc/tests/amb_repeat.input new file mode 100644 index 0000000000..192dc07e71 --- /dev/null +++ b/contrib/nitcc/tests/amb_repeat.input @@ -0,0 +1 @@ +c x diff --git a/contrib/nitcc/tests/amb_repeat.sablecc b/contrib/nitcc/tests/amb_repeat.sablecc new file mode 100644 index 0000000000..06f09c058f --- /dev/null +++ b/contrib/nitcc/tests/amb_repeat.sablecc @@ -0,0 +1,6 @@ +Grammar amb; +Parser +Ignored #10, #32; +s = a | a 'x' ; +a = b | b 'x' ; +b = 'c' ; diff --git a/contrib/nitcc/tests/amb_repeat0.input b/contrib/nitcc/tests/amb_repeat0.input new file mode 100644 index 0000000000..ce01362503 --- /dev/null +++ b/contrib/nitcc/tests/amb_repeat0.input @@ -0,0 +1 @@ +hello diff --git a/contrib/nitcc/tests/amb_repeat0.sablecc b/contrib/nitcc/tests/amb_repeat0.sablecc new file mode 100644 index 0000000000..87f69183c4 --- /dev/null +++ b/contrib/nitcc/tests/amb_repeat0.sablecc @@ -0,0 +1,4 @@ +Grammar amb; +Parser +Ignored #10, #32; +s = 'hello' | 'hello' ; diff --git a/contrib/nitcc/tests/amb_repeat2.input b/contrib/nitcc/tests/amb_repeat2.input new file mode 100644 index 0000000000..e69de29bb2 diff --git a/contrib/nitcc/tests/amb_repeat2.sablecc b/contrib/nitcc/tests/amb_repeat2.sablecc new file mode 100644 index 0000000000..8ad8d096c7 --- /dev/null +++ b/contrib/nitcc/tests/amb_repeat2.sablecc @@ -0,0 +1,6 @@ +Grammar amb; +Parser +Ignored #10, #32; +s = a | Empty ; +a = b | Empty ; +b = 'c' ; diff --git a/contrib/nitcc/tests/calc1.sablecc b/contrib/nitcc/tests/calc1.sablecc new file mode 100644 index 0000000000..6e61381370 --- /dev/null +++ b/contrib/nitcc/tests/calc1.sablecc @@ -0,0 +1,13 @@ +Grammar calc; +Lexer +n = ('0'..'9')+ ; +Parser +Ignored #10, #32; +e + = e '+' a + | e '-' a + ; +a = + | '(' e ')' + | n + ; diff --git a/contrib/nitcc/tests/dangling_else.input b/contrib/nitcc/tests/dangling_else.input new file mode 100644 index 0000000000..a9735477ac --- /dev/null +++ b/contrib/nitcc/tests/dangling_else.input @@ -0,0 +1 @@ +i a i a e a diff --git a/contrib/nitcc/tests/dangling_else.sablecc b/contrib/nitcc/tests/dangling_else.sablecc new file mode 100644 index 0000000000..1909e82efa --- /dev/null +++ b/contrib/nitcc/tests/dangling_else.sablecc @@ -0,0 +1,9 @@ +Grammar dangling; +Parser +Ignored #10, #32; +ss = s*; +s + = 'i' s 'e' s + | 'i' s + | 'a' + ; diff --git a/contrib/nitcc/tests/dangling_else2.input b/contrib/nitcc/tests/dangling_else2.input new file mode 100644 index 0000000000..a9735477ac --- /dev/null +++ b/contrib/nitcc/tests/dangling_else2.input @@ -0,0 +1 @@ +i a i a e a diff --git a/contrib/nitcc/tests/dangling_else2.sablecc b/contrib/nitcc/tests/dangling_else2.sablecc new file mode 100644 index 0000000000..dc4be1210e --- /dev/null +++ b/contrib/nitcc/tests/dangling_else2.sablecc @@ -0,0 +1,14 @@ +Grammar dangling; +Parser +Ignored #10, #32; +ss = s*; + +s + = 'a' + | 'i' se 'e' s + | 'i' s + ; +se + = 'a' + | 'i' se 'e' se + ; diff --git a/contrib/nitcc/tests/dangling_end.input b/contrib/nitcc/tests/dangling_end.input new file mode 100644 index 0000000000..c355025fe1 --- /dev/null +++ b/contrib/nitcc/tests/dangling_end.input @@ -0,0 +1,5 @@ +a id +a id end +a a id end end +a a id end +a a id diff --git a/contrib/nitcc/tests/dangling_end.sablecc b/contrib/nitcc/tests/dangling_end.sablecc new file mode 100644 index 0000000000..fe3db41a50 --- /dev/null +++ b/contrib/nitcc/tests/dangling_end.sablecc @@ -0,0 +1,9 @@ +Grammar dangling; +Parser +Ignored #10, #32; +es = e*; +e + = 'a' e 'end' + | 'a' e + | 'id' + ; diff --git a/contrib/nitcc/tests/dragon_4-55.input b/contrib/nitcc/tests/dragon_4-55.input new file mode 100644 index 0000000000..3c19c181b0 --- /dev/null +++ b/contrib/nitcc/tests/dragon_4-55.input @@ -0,0 +1 @@ +ccdd diff --git a/contrib/nitcc/tests/dragon_4-55.sablecc b/contrib/nitcc/tests/dragon_4-55.sablecc new file mode 100644 index 0000000000..89bbdd016e --- /dev/null +++ b/contrib/nitcc/tests/dragon_4-55.sablecc @@ -0,0 +1,5 @@ +Grammar dragon; +Parser +Ignored #10, #32; +s = c c ; +c = 'c' c | 'd' ; diff --git a/contrib/nitcc/tests/oneliner.input b/contrib/nitcc/tests/oneliner.input new file mode 100644 index 0000000000..ef3a7434cd --- /dev/null +++ b/contrib/nitcc/tests/oneliner.input @@ -0,0 +1,4 @@ +if id then id +if id then id end +if if id then id then id end +if id then if id then id end diff --git a/contrib/nitcc/tests/oneliner.sablecc b/contrib/nitcc/tests/oneliner.sablecc new file mode 100644 index 0000000000..35b0c44df6 --- /dev/null +++ b/contrib/nitcc/tests/oneliner.sablecc @@ -0,0 +1,34 @@ +Grammar oneliner; +Lexer +eol = #10 | #13 ; + +Parser +Ignored #32; + +prog + = stmts + ; +stmt + = if_block stmt_or_end + | if_block stmt_else stmt_or_end + | 'id' + ; +if_block + = 'if' n? stmt no 'then' + ; +stmt_or_end + = stmt 'end'? + | n stmts no 'end' + | no 'end' + ; +stmt_else + = stmt 'else' + | n stmts no 'else' + | 'else' + ; +stmts + = stmts n stmt + | stmt + ; +no = n?; +n = eol+; diff --git a/contrib/nitcc/tests/oneliner2.sablecc b/contrib/nitcc/tests/oneliner2.sablecc new file mode 100644 index 0000000000..5a555c00f4 --- /dev/null +++ b/contrib/nitcc/tests/oneliner2.sablecc @@ -0,0 +1,42 @@ +Grammar oneliner; +Lexer +eol = #10 | #13 ; + +Parser +Ignored #32; + +prog + = stmts + ; +stmt + = if_block stmt_or_end + | if_block stmt_else stmt_or_end + | 'id' + ; +stmt_with_else + = if_block stmt_else stmt_or_end + | 'id' + ; +if_block + = 'if' n? stmt no 'then' + ; +stmt_or_end + = stmt 'end'? + | n stmts no 'end' + | no 'end' + ; +stmt_end + = stmt 'else' + | n stmts no 'else' + | 'else' + ; +stmts_with_else + = stmts_with_else n stmt_with_else + | stmt_with_else + ; +stmts + = stmts n stmt + | stmt + ; +no = n?; +n = eol+; diff --git a/contrib/nitcc/tests/regex0.input b/contrib/nitcc/tests/regex0.input new file mode 100644 index 0000000000..27680d50a4 --- /dev/null +++ b/contrib/nitcc/tests/regex0.input @@ -0,0 +1 @@ +aa|aa* diff --git a/contrib/nitcc/tests/regex0.sablecc b/contrib/nitcc/tests/regex0.sablecc new file mode 100644 index 0000000000..95b7d0fbcc --- /dev/null +++ b/contrib/nitcc/tests/regex0.sablecc @@ -0,0 +1,5 @@ +Grammar regex; +Parser +Ignored #10, #32; +e = a | e '|' e | e e | e '*' ; +a = 'a' ; diff --git a/contrib/nitcc/tests/regex1.input b/contrib/nitcc/tests/regex1.input new file mode 100644 index 0000000000..27680d50a4 --- /dev/null +++ b/contrib/nitcc/tests/regex1.input @@ -0,0 +1 @@ +aa|aa* diff --git a/contrib/nitcc/tests/regex1.sablecc b/contrib/nitcc/tests/regex1.sablecc new file mode 100644 index 0000000000..df85db613f --- /dev/null +++ b/contrib/nitcc/tests/regex1.sablecc @@ -0,0 +1,13 @@ +Grammar regex; +Parser +Ignored #10, #32; +e + = a +Unary + e '*' +Left + e e +Left + e '|' e + ; +a = 'a' ; diff --git a/contrib/nitcc/tests/regex2.input b/contrib/nitcc/tests/regex2.input new file mode 100644 index 0000000000..27680d50a4 --- /dev/null +++ b/contrib/nitcc/tests/regex2.input @@ -0,0 +1 @@ +aa|aa* diff --git a/contrib/nitcc/tests/regex2.sablecc b/contrib/nitcc/tests/regex2.sablecc new file mode 100644 index 0000000000..34f3c98f3e --- /dev/null +++ b/contrib/nitcc/tests/regex2.sablecc @@ -0,0 +1,7 @@ +Grammar regex; +Parser +Ignored #10, #32; +e = e '|' e2 | e2; +e2 = e2 e3 | e3 ; +e3 = e4 '*' | e4 ; +e4 = 'a' ; diff --git a/contrib/nitcc/tests/sav/amb_repeat.input.res b/contrib/nitcc/tests/sav/amb_repeat.input.res new file mode 100644 index 0000000000..46f44847c3 --- /dev/null +++ b/contrib/nitcc/tests/sav/amb_repeat.input.res @@ -0,0 +1,7 @@ +Start + s_0 + a_1 + b + 'c'@(1:1-1:2) + 'x'@(1:3-1:4) + Eof@(2:1-2:1)='' diff --git a/contrib/nitcc/tests/sav/amb_repeat.res b/contrib/nitcc/tests/sav/amb_repeat.res new file mode 100644 index 0000000000..5e4532fd4b --- /dev/null +++ b/contrib/nitcc/tests/sav/amb_repeat.res @@ -0,0 +1,4 @@ +SHIFT/REDUCE Conflict on state 3 b for token 'x': +SHIFT on item: a→ b·'x', Eof/'x' +REDUCE on item: a→ b·, Eof/'x' +Error: there is conflicts diff --git a/contrib/nitcc/tests/sav/amb_repeat0.input.res b/contrib/nitcc/tests/sav/amb_repeat0.input.res new file mode 100644 index 0000000000..2d7766489f --- /dev/null +++ b/contrib/nitcc/tests/sav/amb_repeat0.input.res @@ -0,0 +1,4 @@ +Start + s_0 + 'hello'@(1:1-1:6) + Eof@(2:1-2:1)='' diff --git a/contrib/nitcc/tests/sav/amb_repeat0.res b/contrib/nitcc/tests/sav/amb_repeat0.res new file mode 100644 index 0000000000..2ea68e8967 --- /dev/null +++ b/contrib/nitcc/tests/sav/amb_repeat0.res @@ -0,0 +1,4 @@ +REDUCE/REDUCE Conflict on state 2 'hello' for token Eof: +REDUCE on item: s→ 'hello'·, Eof +REDUCE on item: s→ 'hello'·, Eof +Error: there is conflicts diff --git a/contrib/nitcc/tests/sav/amb_repeat2.input.res b/contrib/nitcc/tests/sav/amb_repeat2.input.res new file mode 100644 index 0000000000..79888666d8 --- /dev/null +++ b/contrib/nitcc/tests/sav/amb_repeat2.input.res @@ -0,0 +1,4 @@ +Start + s_0 + a_1 + Eof@(1:1-1:1)='' diff --git a/contrib/nitcc/tests/sav/amb_repeat2.res b/contrib/nitcc/tests/sav/amb_repeat2.res new file mode 100644 index 0000000000..b4991cbf7d --- /dev/null +++ b/contrib/nitcc/tests/sav/amb_repeat2.res @@ -0,0 +1,4 @@ +REDUCE/REDUCE Conflict on state 0 for token Eof: +REDUCE on item: a→·, Eof +REDUCE on item: s→·, Eof +Error: there is conflicts diff --git a/contrib/nitcc/tests/sav/calc0.res b/contrib/nitcc/tests/sav/calc0.res new file mode 100644 index 0000000000..677252ef7e --- /dev/null +++ b/contrib/nitcc/tests/sav/calc0.res @@ -0,0 +1,12 @@ +Automatic Dangling SHIFT/REDUCE on state 8 e '+' e for token '+': + reduce: e→ e '+' e·, Eof/'+'/'*'/')' + shift: e→ e·'+' e +Automatic Dangling SHIFT/REDUCE on state 8 e '+' e for token '*': + reduce: e→ e '+' e·, Eof/'+'/'*'/')' + shift: e→ e·'*' e +Automatic Dangling SHIFT/REDUCE on state 9 e '*' e for token '+': + reduce: e→ e '*' e·, '+'/'*'/Eof/')' + shift: e→ e·'+' e +Automatic Dangling SHIFT/REDUCE on state 9 e '*' e for token '*': + reduce: e→ e '*' e·, '+'/'*'/Eof/')' + shift: e→ e·'*' e diff --git a/contrib/nitcc/tests/sav/calc1.res b/contrib/nitcc/tests/sav/calc1.res new file mode 100644 index 0000000000..9841662c3f --- /dev/null +++ b/contrib/nitcc/tests/sav/calc1.res @@ -0,0 +1 @@ +Runtime error: Aborted (./lrautomaton.nit:507) diff --git a/contrib/nitcc/tests/sav/dangling_else.input.res b/contrib/nitcc/tests/sav/dangling_else.input.res new file mode 100644 index 0000000000..05d5d9768b --- /dev/null +++ b/contrib/nitcc/tests/sav/dangling_else.input.res @@ -0,0 +1,15 @@ +Start + ss + Nodes[Ns] + s_1 + 'i'@(1:1-1:2) + s_2 + 'a'@(1:3-1:4) + s_0 + 'i'@(1:5-1:6) + s_2 + 'a'@(1:7-1:8) + 'e'@(1:9-1:10) + s_2 + 'a'@(1:11-1:12) + Eof@(2:1-2:1)='' diff --git a/contrib/nitcc/tests/sav/dangling_else.res b/contrib/nitcc/tests/sav/dangling_else.res new file mode 100644 index 0000000000..1bf9a258fa --- /dev/null +++ b/contrib/nitcc/tests/sav/dangling_else.res @@ -0,0 +1,3 @@ +Automatic Dangling SHIFT/REDUCE on state 8 'i' s for token 'e': + reduce: s→ 'i' s·, Eof/'i'/'a'/'e' + shift: s→ 'i' s·'e' s diff --git a/contrib/nitcc/tests/sav/dangling_else2.input.res b/contrib/nitcc/tests/sav/dangling_else2.input.res new file mode 100644 index 0000000000..dfd9952ba4 --- /dev/null +++ b/contrib/nitcc/tests/sav/dangling_else2.input.res @@ -0,0 +1,15 @@ +Start + ss + Nodes[Ns] + s_2 + 'i'@(1:1-1:2) + s_0 + 'a'@(1:3-1:4) + s_1 + 'i'@(1:5-1:6) + se_0 + 'a'@(1:7-1:8) + 'e'@(1:9-1:10) + s_0 + 'a'@(1:11-1:12) + Eof@(2:1-2:1)='' diff --git a/contrib/nitcc/tests/sav/dangling_end.input.res b/contrib/nitcc/tests/sav/dangling_end.input.res new file mode 100644 index 0000000000..0d7a3c2957 --- /dev/null +++ b/contrib/nitcc/tests/sav/dangling_end.input.res @@ -0,0 +1,34 @@ +Start + es + Nodes[Ne] + e_1 + 'a'@(1:1-1:2) + e_2 + 'id'@(1:3-1:5) + e_0 + 'a'@(2:1-2:2) + e_2 + 'id'@(2:3-2:5) + 'end'@(2:6-2:9) + e_0 + 'a'@(3:1-3:2) + e_0 + 'a'@(3:3-3:4) + e_2 + 'id'@(3:5-3:7) + 'end'@(3:8-3:11) + 'end'@(3:12-3:15) + e_1 + 'a'@(4:1-4:2) + e_0 + 'a'@(4:3-4:4) + e_2 + 'id'@(4:5-4:7) + 'end'@(4:8-4:11) + e_1 + 'a'@(5:1-5:2) + e_1 + 'a'@(5:3-5:4) + e_2 + 'id'@(5:5-5:7) + Eof@(6:1-6:1)='' diff --git a/contrib/nitcc/tests/sav/dangling_end.res b/contrib/nitcc/tests/sav/dangling_end.res new file mode 100644 index 0000000000..79743ba0cb --- /dev/null +++ b/contrib/nitcc/tests/sav/dangling_end.res @@ -0,0 +1,3 @@ +Automatic Dangling SHIFT/REDUCE on state 8 'a' e for token 'end': + reduce: e→ 'a' e·, Eof/'a'/'id'/'end' + shift: e→ 'a' e·'end' diff --git a/contrib/nitcc/tests/sav/dragon_4-55.input.res b/contrib/nitcc/tests/sav/dragon_4-55.input.res new file mode 100644 index 0000000000..9aa242890e --- /dev/null +++ b/contrib/nitcc/tests/sav/dragon_4-55.input.res @@ -0,0 +1,11 @@ +Start + s + c_0 + 'c'@(1:1-1:2) + c_0 + 'c'@(1:2-1:3) + c_1 + 'd'@(1:3-1:4) + c_1 + 'd'@(1:4-1:5) + Eof@(2:1-2:1)='' diff --git a/contrib/nitcc/tests/sav/eq.res b/contrib/nitcc/tests/sav/eq.res index 05b05f7966..e69de29bb2 100644 --- a/contrib/nitcc/tests/sav/eq.res +++ b/contrib/nitcc/tests/sav/eq.res @@ -1 +0,0 @@ -Error: there is conflicts diff --git a/contrib/nitcc/tests/sav/not_slr.res b/contrib/nitcc/tests/sav/not_slr.res index 05b05f7966..e69de29bb2 100644 --- a/contrib/nitcc/tests/sav/not_slr.res +++ b/contrib/nitcc/tests/sav/not_slr.res @@ -1 +0,0 @@ -Error: there is conflicts diff --git a/contrib/nitcc/tests/sav/oneliner.input.res b/contrib/nitcc/tests/sav/oneliner.input.res new file mode 100644 index 0000000000..83d628a8d3 --- /dev/null +++ b/contrib/nitcc/tests/sav/oneliner.input.res @@ -0,0 +1,78 @@ +NParserError@(5:1-5:1)='' +Nodes[Node] + stmts_0 + stmts_0 + stmts_0 + stmts_1 + stmt_0 + if_block + 'if'@(1:1-1:3) + stmt_2 + 'id'@(1:4-1:6) + no + 'then'@(1:7-1:11) + stmt_or_end_0 + stmt_2 + 'id'@(1:12-1:14) + n + Nodes[Neol] + eol@(1:14-2:1)='\n' + stmt_0 + if_block + 'if'@(2:1-2:3) + stmt_2 + 'id'@(2:4-2:6) + no + 'then'@(2:7-2:11) + stmt_or_end_0 + stmt_2 + 'id'@(2:12-2:14) + 'end'@(2:15-2:18) + n + Nodes[Neol] + eol@(2:18-3:1)='\n' + stmt_0 + if_block + 'if'@(3:1-3:3) + stmt_0 + if_block + 'if'@(3:4-3:6) + stmt_2 + 'id'@(3:7-3:9) + no + 'then'@(3:10-3:14) + stmt_or_end_0 + stmt_2 + 'id'@(3:15-3:17) + no + 'then'@(3:18-3:22) + stmt_or_end_0 + stmt_2 + 'id'@(3:23-3:25) + 'end'@(3:26-3:29) + n + Nodes[Neol] + eol@(3:29-4:1)='\n' + stmt_0 + if_block + 'if'@(4:1-4:3) + stmt_2 + 'id'@(4:4-4:6) + no + 'then'@(4:7-4:11) + stmt_or_end_0 + stmt_0 + if_block + 'if'@(4:12-4:14) + stmt_2 + 'id'@(4:15-4:17) + no + 'then'@(4:18-4:22) + stmt_or_end_0 + stmt_2 + 'id'@(4:23-4:25) + 'end'@(4:26-4:29) + n + Nodes[Neol] + eol@(4:29-5:1)='\n' + Eof@(5:1-5:1)='' diff --git a/contrib/nitcc/tests/sav/oneliner.res b/contrib/nitcc/tests/sav/oneliner.res new file mode 100644 index 0000000000..935bf37d51 --- /dev/null +++ b/contrib/nitcc/tests/sav/oneliner.res @@ -0,0 +1,10 @@ +SHIFT/REDUCE Conflict on state 15 if_block stmt for token 'end': +SHIFT on item: stmt_or_end→ stmt·'end', eol/Eof/'end'/'else'/'then' +REDUCE on item: stmt_or_end→ stmt·, eol/Eof/'end'/'else'/'then' +SHIFT/REDUCE Conflict on state 15 if_block stmt for token 'else': +SHIFT on item: stmt_else→ stmt·'else', 'end'/'id'/'if'/eol/Eof/'else'/'then' +REDUCE on item: stmt_or_end→ stmt·, eol/Eof/'end'/'else'/'then' +SHIFT/REDUCE Conflict on state 23 if_block stmt_else stmt for token 'end': +SHIFT on item: stmt_or_end→ stmt·'end', eol/Eof/'end'/'else'/'then' +REDUCE on item: stmt_or_end→ stmt·, eol/Eof/'end'/'else'/'then' +Error: there is conflicts diff --git a/contrib/nitcc/tests/sav/oneliner2.res b/contrib/nitcc/tests/sav/oneliner2.res new file mode 100644 index 0000000000..11461b905b --- /dev/null +++ b/contrib/nitcc/tests/sav/oneliner2.res @@ -0,0 +1 @@ +13:13-13:22 Error: unknown name stmt_else diff --git a/contrib/nitcc/tests/sav/regex0.input.res b/contrib/nitcc/tests/sav/regex0.input.res new file mode 100644 index 0000000000..8fa8ca2802 --- /dev/null +++ b/contrib/nitcc/tests/sav/regex0.input.res @@ -0,0 +1,20 @@ +Start + e_2 + e_0 + a + 'a'@(1:1-1:2) + e_1 + e_0 + a + 'a'@(1:2-1:3) + '|'@(1:3-1:4) + e_2 + e_0 + a + 'a'@(1:4-1:5) + e_3 + e_0 + a + 'a'@(1:5-1:6) + '*'@(1:6-1:7) + Eof@(2:1-2:1)='' diff --git a/contrib/nitcc/tests/sav/regex0.res b/contrib/nitcc/tests/sav/regex0.res new file mode 100644 index 0000000000..33d06a4324 --- /dev/null +++ b/contrib/nitcc/tests/sav/regex0.res @@ -0,0 +1,20 @@ +Automatic Dangling SHIFT/REDUCE on state 6 e e for token '|': + reduce: e→ e e·, '|'/'*'/'a'/Eof + shift: e→ e·'|' e +Automatic Dangling SHIFT/REDUCE on state 6 e e for token '*': + reduce: e→ e e·, '|'/'*'/'a'/Eof + shift: e→ e·'*' +Automatic Dangling SHIFT/REDUCE on state 6 e e for token 'a': + reduce: e→ e e·, '|'/'*'/'a'/Eof + shift: a→·'a' + core shift: e→·a, '|'/'a'/'*'/Eof +Automatic Dangling SHIFT/REDUCE on state 8 e '|' e for token '|': + reduce: e→ e '|' e·, Eof/'|'/'a'/'*' + shift: e→ e·'|' e +Automatic Dangling SHIFT/REDUCE on state 8 e '|' e for token 'a': + reduce: e→ e '|' e·, Eof/'|'/'a'/'*' + shift: a→·'a' + core shift: e→·a, '|'/'a'/'*'/Eof +Automatic Dangling SHIFT/REDUCE on state 8 e '|' e for token '*': + reduce: e→ e '|' e·, Eof/'|'/'a'/'*' + shift: e→ e·'*' diff --git a/contrib/nitcc/tests/sav/regex1.input.res b/contrib/nitcc/tests/sav/regex1.input.res new file mode 100644 index 0000000000..b6f6996368 --- /dev/null +++ b/contrib/nitcc/tests/sav/regex1.input.res @@ -0,0 +1,20 @@ +Start + e_0 + e$1_0 + e$0_0 + a + 'a'@(1:1-1:2) + e$0_0 + a + 'a'@(1:2-1:3) + '|'@(1:3-1:4) + e$1_0 + e$0_0 + a + 'a'@(1:4-1:5) + e$2_0 + e$0_0 + a + 'a'@(1:5-1:6) + '*'@(1:6-1:7) + Eof@(2:1-2:1)='' diff --git a/contrib/nitcc/tests/sav/regex2.input.res b/contrib/nitcc/tests/sav/regex2.input.res new file mode 100644 index 0000000000..378cce4128 --- /dev/null +++ b/contrib/nitcc/tests/sav/regex2.input.res @@ -0,0 +1,22 @@ +Start + e_0 + e_1 + e2_0 + e2_1 + e3_1 + e4 + 'a'@(1:1-1:2) + e3_1 + e4 + 'a'@(1:2-1:3) + '|'@(1:3-1:4) + e2_0 + e2_1 + e3_1 + e4 + 'a'@(1:4-1:5) + e3_0 + e4 + 'a'@(1:5-1:6) + '*'@(1:6-1:7) + Eof@(2:1-2:1)='' diff --git a/contrib/nitcc/tests/sav/unary.input.res b/contrib/nitcc/tests/sav/unary.input.res new file mode 100644 index 0000000000..be17f96445 --- /dev/null +++ b/contrib/nitcc/tests/sav/unary.input.res @@ -0,0 +1,12 @@ +Start + e_0 + '-'@(1:1-1:2) + e_0 + '-'@(1:2-1:3) + e_1 + e_1 + e_2 + '0'@(1:3-1:4) + '+'@(1:4-1:5) + '+'@(1:5-1:6) + Eof@(2:1-2:1)='' diff --git a/contrib/nitcc/tests/sav/unary.res b/contrib/nitcc/tests/sav/unary.res new file mode 100644 index 0000000000..5e7e20e3b0 --- /dev/null +++ b/contrib/nitcc/tests/sav/unary.res @@ -0,0 +1,3 @@ +Automatic Dangling SHIFT/REDUCE on state 6 '-' e for token '+': + reduce: e→ '-' e·, Eof/'+' + shift: e→ e·'+' diff --git a/contrib/nitcc/tests/unary.input b/contrib/nitcc/tests/unary.input new file mode 100644 index 0000000000..d1a3e546f8 --- /dev/null +++ b/contrib/nitcc/tests/unary.input @@ -0,0 +1 @@ +--0++ diff --git a/contrib/nitcc/tests/unary.sablecc b/contrib/nitcc/tests/unary.sablecc new file mode 100644 index 0000000000..97b7b24478 --- /dev/null +++ b/contrib/nitcc/tests/unary.sablecc @@ -0,0 +1,8 @@ +Grammar unary; +Parser +Ignored #10, #32; +e + = '-' e + | e '+' + | '0' + ;