Revert "cleanup parser for only required rules"

This reverts commit eccf1fa914.
This commit is contained in:
Nicolas Amaya
2025-09-27 15:52:36 -06:00
parent eccf1fa914
commit 4addbee422
7 changed files with 1726 additions and 41 deletions

44
gen/syntactic.g4 Normal file
View File

@@ -0,0 +1,44 @@
parser grammar syntactic;
options {
tokenVocab=ExprLexer;
}
identifier: IDENTIFIER;
qualifiedIdentifier: identifier {'.' identifier};
literal: IntegerLiteral
| FloatingPointLiteral
| CharacterLiteral
| StringLiteral
| BooleanLiteral
| NullLiteral;
expression: expression1 [assignmentOperator expression1];
assignmentOperator: Assignment
| AddAssign
| SubtractAssign
| MultiplyAssign
| DivideAssign
| BitwiseANDAssign
| BitwiseORAssign
| BitwiseXORAssign
| RemainderAssign
| LeftShiftAssign
| SighnedRightShiftAssign
| UnsighnedRightShiftAssign;
type: identifier {'.' identifier} bracketsOpt
| basicType;
statementExpression: expression;
constantExpression: expression;
expression1: expression2 [expression1Rest];
expression1Rest: ['?' expression ':' expression1];
expression2: expression3 [expression2Rest];