Added conditionals to grammar

This commit is contained in:
greg 2016-01-31 00:37:21 -08:00
parent 0e3aaa8b08
commit 5aa4c404a5

View File

@ -11,10 +11,11 @@ use tokenizer::{Token, Kw, Op};
exprlist := Expression (Comma Expression)* | e exprlist := Expression (Comma Expression)* | e
expression := primary_expression (op primary_expression)* expression := primary_expression (op primary_expression)*
primary_expression := Number | String | identifier_expr | paren_expr primary_expression := Number | String | identifier_expr | paren_expr | conditional_expr
identifier_expr := call_expression | Variable identifier_expr := call_expression | Variable
paren_expr := LParen expression RParen paren_expr := LParen expression RParen
call_expr := Identifier LParen exprlist RParen call_expr := Identifier LParen exprlist RParen
conditional_expr := IF expression THEN (expression delimiter?)* ELSE (expresion delimiter?)* END
op := '+', '-', etc. op := '+', '-', etc.
*/ */