Skip to content

Commit

Permalink
nitcc: add test for groupize
Browse files Browse the repository at this point in the history
Signed-off-by: Jean Privat <[email protected]>
  • Loading branch information
privat committed Jun 23, 2024
1 parent 8c08ada commit daba0bf
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
9 changes: 9 additions & 0 deletions contrib/nitcc/tests/parser-groupize.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sa
sab
sac
s
sad
sadad
t
tae
taeae
12 changes: 12 additions & 0 deletions contrib/nitcc/tests/parser-groupize.sablecc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Grammar gram;
Lexer
blank = #10 | #13 | #32;
Parser
Ignored blank;
s =
s 's' ('a' 'b') |
s 's' ('a') |
s 's' ('a' 'c')? |
s 's' ('a' 'd')+ |
s 't' ('a' 'e')* |
Empty;
51 changes: 51 additions & 0 deletions contrib/nitcc/tests/sav/parser-groupize.input.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Start
s_4
s_4
s_4
s_3
s_3
s_2
s_2
s_0
s_1
s_5
's'@(1:1-1:2)
_group1_single
'a'@(1:2-1:3)
's'@(2:1-2:2)
_group0_single
'a'@(2:2-2:3)
'b'@(2:3-2:4)
's'@(3:1-3:2)
_group2_single
'a'@(3:2-3:3)
'c'@(3:3-3:4)
's'@(4:1-4:2)
's'@(5:1-5:2)
Nodes[N_group3]
_group3_single
'a'@(5:2-5:3)
'd'@(5:3-5:4)
's'@(6:1-6:2)
Nodes[N_group3]
_group3_single
'a'@(6:2-6:3)
'd'@(6:3-6:4)
_group3_single
'a'@(6:4-6:5)
'd'@(6:5-6:6)
't'@(7:1-7:2)
't'@(8:1-8:2)
Nodes[N_group4]
_group4_single
'a'@(8:2-8:3)
'e'@(8:3-8:4)
't'@(9:1-9:2)
Nodes[N_group4]
_group4_single
'a'@(9:2-9:3)
'e'@(9:3-9:4)
_group4_single
'a'@(9:4-9:5)
'e'@(9:5-9:6)
Eof@(10:1-10:1)=''

0 comments on commit daba0bf

Please sign in to comment.