summary refs log tree commit diff
path: root/grammar
diff options
context:
space:
mode:
Diffstat (limited to 'grammar')
-rw-r--r--grammar/ANF.g44
1 files changed, 3 insertions, 1 deletions
diff --git a/grammar/ANF.g4 b/grammar/ANF.g4
index 07e199e..f940a20 100644
--- a/grammar/ANF.g4
+++ b/grammar/ANF.g4
@@ -5,6 +5,7 @@ aexp
     | 'false' # false
     | IDENT #var
     | NUMBER #num
+    | STRING #str
     | '(' aexp '+' aexp ')' #add
     | '(' aexp '-' aexp ')' #sub
     | '(' aexp '*' aexp ')' #mul
@@ -17,7 +18,7 @@ aexp
     | '(' aexp '&&' aexp ')' #and
     | '(' aexp '||' aexp ')' #or
     | '(' aexp '^^' aexp ')' #xor
-    | '(' IDENT ':' cexp ')' #lam
+    | '(' IDENT (',' IDENT)* ':' cexp ')' #lam
     ;
 
 funcall
@@ -32,6 +33,7 @@ cexp
 
 IDENT: Letter (Letter | Digit)*;
 NUMBER: Digit+;
+STRING: '"' ([^"]|'\\'.)* '"';
 
 fragment Letter: 'A' .. 'Z' | 'a' .. 'z';
 fragment Digit: '0'..'9';