X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=grammar%2Fgrammar.txt;h=98bb06eeaefe3c12079878228610bc37174f528a;hb=f081c2c5e248331eb6e2f090f4afe818fd8259eb;hp=f78b879ad979c0f53b7cc5671be42114e29f57ae;hpb=5d40ca411bed8014f9bf081436208d831ac5c972;p=cc1516.git diff --git a/grammar/grammar.txt b/grammar/grammar.txt index f78b879..98bb06e 100644 --- a/grammar/grammar.txt +++ b/grammar/grammar.txt @@ -1,36 +1,31 @@ - ::= * + - + ::= + ::= '(' * ')' ['::' * + '}' - ::= + '->' - | + ::= ['->' ] + | '(' ')' ::= 'if' '(' ')' '{' * '}' ['else' '{' * '}'] | 'while' '(' ')' '{' * '}' | '=' ';' | ';' | 'return' [] ';' - - ::= ( | 'var') '=' ';' + ::= '=' ';' ::= [':' ] ::= ['||' ] ::= ['&&' ] ::= [('==' | '<' | '>' | '<=' | '>=' | '!=') ] ::= (('+' | '-') )* ::= (['*' | '/' | '%'] )* - ::= - | + ::= | | | 'False' | 'True' | '(' ')' - | + | | '[]' | '(' ',' ')' - ::= ('.' ('hd'|'tl'|'fst'|'snd))* - ::= '(' [] ')' + ::= ['(' + ')'] ::= [',' ActArgs] - ::= 'Int' | 'Bool' | 'Char'