diff options
Diffstat (limited to 'frontend/parser.mly')
-rw-r--r-- | frontend/parser.mly | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/frontend/parser.mly b/frontend/parser.mly index 4301a05..4e010ec 100644 --- a/frontend/parser.mly +++ b/frontend/parser.mly @@ -61,6 +61,10 @@ primary_expr: | FALSE { AST_bool_const false } | e=ext(IDENT) LPAREN l=separated_list(COMMA,ext(expr)) RPAREN { AST_instance (e, l, fst e ^ uid ()) } +| INT LPAREN e=ext(expr) RPAREN + { AST_cast(e, AST_TINT) } +| REAL LPAREN e=ext(expr) RPAREN + { AST_cast(e, AST_TREAL) } unary_expr: | e=primary_expr { e } |