-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jean Privat <[email protected]>
- Loading branch information
Showing
51 changed files
with
500 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
c x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Grammar amb; | ||
Parser | ||
Ignored #10, #32; | ||
s = a | a 'x' ; | ||
a = b | b 'x' ; | ||
b = 'c' ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Grammar amb; | ||
Parser | ||
Ignored #10, #32; | ||
s = 'hello' | 'hello' ; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Grammar amb; | ||
Parser | ||
Ignored #10, #32; | ||
s = a | Empty ; | ||
a = b | Empty ; | ||
b = 'c' ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Grammar calc; | ||
Lexer | ||
n = ('0'..'9')+ ; | ||
Parser | ||
Ignored #10, #32; | ||
e | ||
= e '+' a | ||
| e '-' a | ||
; | ||
a = | ||
| '(' e ')' | ||
| n | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
i a i a e a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Grammar dangling; | ||
Parser | ||
Ignored #10, #32; | ||
ss = s*; | ||
s | ||
= 'i' s 'e' s | ||
| 'i' s | ||
| 'a' | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
i a i a e a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
a id | ||
a id end | ||
a a id end end | ||
a a id end | ||
a a id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Grammar dangling; | ||
Parser | ||
Ignored #10, #32; | ||
es = e*; | ||
e | ||
= 'a' e 'end' | ||
| 'a' e | ||
| 'id' | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ccdd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Grammar dragon; | ||
Parser | ||
Ignored #10, #32; | ||
s = c c ; | ||
c = 'c' c | 'd' ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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+; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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+; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
aa|aa* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Grammar regex; | ||
Parser | ||
Ignored #10, #32; | ||
e = a | e '|' e | e e | e '*' ; | ||
a = 'a' ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
aa|aa* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Grammar regex; | ||
Parser | ||
Ignored #10, #32; | ||
e | ||
= a | ||
Unary | ||
e '*' | ||
Left | ||
e e | ||
Left | ||
e '|' e | ||
; | ||
a = 'a' ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
aa|aa* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Grammar regex; | ||
Parser | ||
Ignored #10, #32; | ||
e = e '|' e2 | e2; | ||
e2 = e2 e3 | e3 ; | ||
e3 = e4 '*' | e4 ; | ||
e4 = 'a' ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Start | ||
s_0 | ||
'hello'@(1:1-1:6) | ||
Eof@(2:1-2:1)='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Start | ||
s_0 | ||
a_1 | ||
Eof@(1:1-1:1)='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Runtime error: Aborted (./lrautomaton.nit:507) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)='' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
Error: there is conflicts | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
Error: there is conflicts | ||
Oops, something went wrong.