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