diff options
Diffstat (limited to 'grammar')
-rw-r--r-- | grammar/ANF.g4 | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/grammar/ANF.g4 b/grammar/ANF.g4 index f940a20..6408f2e 100644 --- a/grammar/ANF.g4 +++ b/grammar/ANF.g4 @@ -1,5 +1,9 @@ grammar ANF; +prog: def+; + +def: 'def' IDENT '('(IDENT (',' IDENT)*)? ')' ':' cexp; + aexp : 'true' #true | 'false' # false @@ -31,6 +35,7 @@ cexp | funcall #fc ; + IDENT: Letter (Letter | Digit)*; NUMBER: Digit+; STRING: '"' ([^"]|'\\'.)* '"'; |