diff options
-rw-r--r-- | 12/main.y | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -62,11 +62,20 @@ assignment_expr: argument ASSIGN unary_expr | |||
62 | | argument ASSIGN boolean_expr | 62 | | argument ASSIGN boolean_expr |
63 | ; | 63 | ; |
64 | 64 | ||
65 | func_call_expr: ID LPAREN expression_list RPAREN | ||
66 | | ID LPAREN RPAREN | ||
67 | ; | ||
68 | |||
65 | expression: unary_expr | 69 | expression: unary_expr |
66 | | boolean_expr | 70 | | boolean_expr |
67 | | assignment_expr | 71 | | assignment_expr |
72 | | func_call_expr | ||
68 | ; | 73 | ; |
69 | 74 | ||
75 | expression_list: expression | ||
76 | | expression COMMA expression_list | ||
77 | ; | ||
78 | |||
70 | for_expr: FOR LPAREN statement statement expression RPAREN block | 79 | for_expr: FOR LPAREN statement statement expression RPAREN block |
71 | | FOR LPAREN statement statement RPAREN block | 80 | | FOR LPAREN statement statement RPAREN block |
72 | ; | 81 | ; |
@@ -86,8 +95,12 @@ block_cont: statement block_cont | |||
86 | | RBRACE | 95 | | RBRACE |
87 | ; | 96 | ; |
88 | 97 | ||
89 | statement: RET expression ENDL | 98 | return_stmt: RET ENDL |
90 | | expression ENDL | 99 | | RET primary_expr ENDL |
100 | ; | ||
101 | |||
102 | statement: expression ENDL | ||
103 | | return_stmt | ||
91 | | block | 104 | | block |
92 | | for_expr | 105 | | for_expr |
93 | | if_expr | 106 | | if_expr |