Skip to content

Commit efd05cd

Browse files
committed
antlr4: Implement error handling using the catch keyword
1 parent c405f62 commit efd05cd

File tree

7 files changed

+580
-428
lines changed

7 files changed

+580
-428
lines changed

src/main/java/org/piccode/antlr4/PiccodeScript.interp

Lines changed: 3 additions & 1 deletion
Large diffs are not rendered by default.

src/main/java/org/piccode/antlr4/PiccodeScript.tokens

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ MODULE=39
4040
DO=40
4141
USE=41
4242
RETURN_TOK=42
43-
NUMBER=43
44-
STRING=44
45-
DOT=45
46-
LINE_COMMENT=46
47-
BLOCK_COMMENT=47
48-
ID=48
49-
WS=49
43+
CATCH_TOK=43
44+
NUMBER=44
45+
STRING=45
46+
DOT=46
47+
LINE_COMMENT=47
48+
BLOCK_COMMENT=48
49+
ID=49
50+
WS=50
5051
'+'=1
5152
'-'=2
5253
'*'=3
@@ -89,4 +90,5 @@ WS=49
8990
'do'=40
9091
'use'=41
9192
'return'=42
92-
'.'=45
93+
'catch'=43
94+
'.'=46

src/main/java/org/piccode/antlr4/PiccodeScriptLexer.interp

Lines changed: 4 additions & 1 deletion
Large diffs are not rendered by default.

src/main/java/org/piccode/antlr4/PiccodeScriptLexer.java

Lines changed: 130 additions & 126 deletions
Large diffs are not rendered by default.

src/main/java/org/piccode/antlr4/PiccodeScriptLexer.tokens

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ MODULE=39
4040
DO=40
4141
USE=41
4242
RETURN_TOK=42
43-
NUMBER=43
44-
STRING=44
45-
DOT=45
46-
LINE_COMMENT=46
47-
BLOCK_COMMENT=47
48-
ID=48
49-
WS=49
43+
CATCH_TOK=43
44+
NUMBER=44
45+
STRING=45
46+
DOT=46
47+
LINE_COMMENT=47
48+
BLOCK_COMMENT=48
49+
ID=49
50+
WS=50
5051
'+'=1
5152
'-'=2
5253
'*'=3
@@ -89,4 +90,5 @@ WS=49
8990
'do'=40
9091
'use'=41
9192
'return'=42
92-
'.'=45
93+
'catch'=43
94+
'.'=46

0 commit comments

Comments
 (0)