X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=src%2Fgrammar.txt;h=ce6732b87b223a68a8ea0614cb32936730b15341;hb=3d1c57710eb0b86f13df392f03131157aec22c21;hp=697cca2099bea5c9c05d08eab52d1faeb9961056;hpb=83c1b3ef201e51264439958e1121e8b24d6b3fea;p=cc1516.git diff --git a/src/grammar.txt b/src/grammar.txt index 697cca2..ce6732b 100644 --- a/src/grammar.txt +++ b/src/grammar.txt @@ -1,35 +1,38 @@ - ::= - - - ::= '+' - - ::= ['%' ] - - ::= [('+' | '-') ] - - ::= ['*' | '/' | '%'] ] - - ::= ['hd'|'tl'|'fst'|'snd] - | - | - | - | 'False' - | 'True' - | '(' ')' - | '(' [] ')' - | '[]' - | '(' ',' ')' - - ::= '+' | '-' | '*' | '/' | '%' | '==' | '<' | '>' | '<=' | '>=' - | '!=' | '&&' | '||' | ':' - - ::= [',' ActArgs] - - ::= ( | 'var') '=' ';' - - ::= 'Int' - | 'Bool' - | 'Char' - | '(' Type ',' Type ')' - | '[' Type ']' - | + ::= '(' * ')' ['::' * + '}' + ::= + '->' + | + ::= 'if' '(' ')' '{' * '}' ['else' '{' * '}'] + | 'while' '(' ')' '{' * '}' + | '=' ';' + | ';' + | 'return' [] ';' + + ::= ( | 'var') '=' ';' + ::= [':' ] + ::= ['||' ] + ::= ['&&' ] + ::= [('==' | '<' | '>' | '<=' | '>=' | '!=') ] + ::= (('+' | '-') )* + ::= (['*' | '/' | '%'] )* + ::= + | + | + | + | 'False' + | 'True' + | '(' ')' + | + | '[]' + | '(' ',' ')' + + ::= ('.' ('hd'|'tl'|'fst'|'snd))* + ::= '(' [] ')' + ::= [',' ActArgs] + + ::= 'Int' + | 'Bool' + | 'Char' + | '(' Type ',' Type ')' + | '[' Type ']' + | + ::= 'Void' | Type