Skip to content
Snippets Groups Projects
Commit c76d1a5a authored by Reiner Jung's avatar Reiner Jung
Browse files

Merge branch 'rju-main-patch-25130' into 'main'

Added variable support

See merge request oceandsl/antlr4-python!1
parents b1f9f4f6 968d4c9e
No related branches found
No related tags found
1 merge request!1Added variable support
grammar Math; grammar Math;
compileUnit compileUnit
: expr EOF : variable '=' expr EOF
; ;
expr expr
...@@ -11,6 +11,11 @@ expr ...@@ -11,6 +11,11 @@ expr
| left=expr op=('+'|'-') right=expr # infixExpr | left=expr op=('+'|'-') right=expr # infixExpr
| func=ID '(' expr ')' # funcExpr | func=ID '(' expr ')' # funcExpr
| value=NUM # numberExpr | value=NUM # numberExpr
| varname=ID # reference
;
variable:
'var' varname=ID
; ;
OP_ADD: '+'; OP_ADD: '+';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment