Skip to content

Commit beea28f

Browse files
committed
nitcc: add AST transformation tests
Signed-off-by: Jean Privat <[email protected]>
1 parent 2042530 commit beea28f

File tree

6 files changed

+40
-0
lines changed

6 files changed

+40
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Start
2+
s_0
3+
s_0
4+
s_0
5+
s_0
6+
s_0
7+
s_1
8+
b_0
9+
'x'@(1:1-1:2)
10+
b_0
11+
'x'@(1:2-1:3)
12+
c_0
13+
'y'@(1:3-1:4)
14+
c_0
15+
'y'@(1:4-1:5)
16+
b_0
17+
'x'@(1:5-1:6)
18+
c_0
19+
'y'@(1:6-1:7)
20+
Eof@(1:7-1:7)=''
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Start
2+
p
3+
a@(1:1-1:2)='a'
4+
Eof@(1:2-1:2)=''

contrib/nitcc/tests/trans2.input

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
xxyyxy

contrib/nitcc/tests/trans2.sablecc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Grammar trans;
2+
3+
Parser
4+
5+
s = s b | b;
6+
a = ;
7+
b {-> a} = 'x' | c {->};
8+
c {-> a} = 'y';

contrib/nitcc/tests/trans_token.input

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
a
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Lexer
2+
a = 'a';
3+
4+
Parser
5+
p = q;
6+
q {-> a} = a {->};

0 commit comments

Comments
 (0)