grammar ANF; aexp : IDENT | NUMBER | aexp '+' aexp | aexp '-' aexp | aexp '*' aexp | aexp '/' aexp | '(' IDENT ':' cexp ')' ; funcall : IDENT '(' aexp (',' aexp)* ')' | aexp ; cexp : 'let' IDENT '=' funcall 'in' cexp | funcall ; IDENT: Letter (Letter | Digit)*; NUMBER: Digit+; fragment Letter: 'A' .. 'Z' | 'a' .. 'z'; fragment Digit: '0'..'9'; WS: [ \t\n\r]+ -> skip;