Skip to content

Commit

Permalink
[#654] minor: added parser rules
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzholzbauer committed Aug 17, 2024
1 parent b151079 commit f00a62c
Show file tree
Hide file tree
Showing 8 changed files with 3,944 additions and 3,122 deletions.
5 changes: 5 additions & 0 deletions kipper/core/KipperLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ False : 'false';
// typeof operator
Typeof : 'typeof';

// try-catch-finally
Try : 'try';
Catch : 'catch';
Finally : 'finally';

// Constant undefined, void and null identifiers
Void : 'void';
Null : 'null';
Expand Down
156 changes: 0 additions & 156 deletions kipper/core/KipperLexer.tokens

This file was deleted.

7 changes: 7 additions & 0 deletions kipper/core/KipperParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ statement
| jumpStatement
| returnStatement
| compoundStatement
| tryCatchStatement
;

compoundStatement
Expand Down Expand Up @@ -191,6 +192,12 @@ returnStatement
: 'return' expression? SemiColon
;

tryCatchStatement
: 'try' compoundStatement
('catch' '(' parameterDeclaration ')' compoundStatement)*
('finally' compoundStatement)?
;

// -- Expressions

primaryExpression // Primary expressions, which build up the rest of the more complex expressions
Expand Down
156 changes: 0 additions & 156 deletions kipper/core/KipperParser.tokens

This file was deleted.

Loading

0 comments on commit f00a62c

Please sign in to comment.