Added noassoc to if then and else
parent
3640b61246
commit
23f2148948
|
@ -11,7 +11,11 @@
|
||||||
%nonassoc UMINUS
|
%nonassoc UMINUS
|
||||||
%right '~'
|
%right '~'
|
||||||
|
|
||||||
|
%nonassoc IF THEN
|
||||||
|
%nonassoc ELSE
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
program:
|
program:
|
||||||
global_list {
|
global_list {
|
||||||
node_init(root = malloc(sizeof(node_t)), PROGRAM, NULL, 1, $1);
|
node_init(root = malloc(sizeof(node_t)), PROGRAM, NULL, 1, $1);
|
||||||
|
@ -94,8 +98,8 @@ declaration_list:
|
||||||
declaration {
|
declaration {
|
||||||
node_init($$ = malloc(sizeof(node_t)), DECLARATION_LIST, NULL, 1, $1);
|
node_init($$ = malloc(sizeof(node_t)), DECLARATION_LIST, NULL, 1, $1);
|
||||||
}
|
}
|
||||||
| declaration_list ',' declaration {
|
| declaration_list declaration {
|
||||||
node_init($$ = malloc(sizeof(node_t)), DECLARATION_LIST, NULL, 2, $1, $3);
|
node_init($$ = malloc(sizeof(node_t)), DECLARATION_LIST, NULL, 2, $1, $2);
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue