added rule for branches
This commit is contained in:
parent
b8c9bfb4e7
commit
98c60aef16
|
@ -56,7 +56,7 @@
|
|||
%token FunExtsupport
|
||||
|
||||
%%
|
||||
program: statement;
|
||||
program: statementlist;
|
||||
|
||||
|
||||
expr: ValFloat
|
||||
|
@ -65,9 +65,23 @@ expr: ValFloat
|
|||
| ValStr
|
||||
| Ident;
|
||||
|
||||
statementlist: statementlist statement
|
||||
| ;
|
||||
|
||||
statement: assign
|
||||
| decl
|
||||
| definition;
|
||||
| definition
|
||||
| branch;
|
||||
|
||||
branchif: KeyIf expr '{' statementlist '}' { DEBUG("if"); };
|
||||
branchelse: KeyElse '{' statementlist '}' { DEBUG("if-else"); };
|
||||
branchelseif: KeyElse KeyIf expr '{' statementlist '}' { DEBUG("else-if"); };
|
||||
|
||||
branchelseifs: branchelseifs branchelseif
|
||||
| ;
|
||||
|
||||
branch: branchif branchelseifs
|
||||
| branchif branchelseifs branchelse;
|
||||
|
||||
identlist: Ident ',' identlist
|
||||
| Ident
|
||||
|
|
Loading…
Reference in New Issue