X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=grammar%2Fgrammar.txt;h=98bb06eeaefe3c12079878228610bc37174f528a;hb=39f7799760a30737f57fb2b8ccdb15074ee9ac45;hp=6e9549d7272d48f815ac54187d618dfd6835f153;hpb=df7fbaaf21817473f51525a2c8f03b0a5a37b823;p=cc1516.git diff --git a/grammar/grammar.txt b/grammar/grammar.txt index 6e9549d..98bb06e 100644 --- a/grammar/grammar.txt +++ b/grammar/grammar.txt @@ -1,36 +1,31 @@ - ::= * + - + ::= + ::= '(' * ')' ['::' * + '}' - ::= ['->' ] //in semantische analyse checken dat Void indien - //aanwezig laatste type in de rij is + ::= ['->' ] + | '(' ')' ::= 'if' '(' ')' '{' * '}' ['else' '{' * '}'] | 'while' '(' ')' '{' * '}' | '=' ';' | ';' | 'return' [] ';' - - ::= ( | 'var') '=' ';' + ::= '=' ';' ::= [':' ] ::= ['||' ] ::= ['&&' ] ::= [('==' | '<' | '>' | '<=' | '>=' | '!=') ] ::= (('+' | '-') )* ::= (['*' | '/' | '%'] )* - ::= - | + ::= | | | 'False' | 'True' | '(' ')' - | + | | '[]' | '(' ',' ')' - ::= ('.' ('hd'|'tl'|'fst'|'snd))* - ::= '(' [] ')' + ::= ['(' + ')'] ::= [',' ActArgs] - ::= 'Int' | 'Bool' | 'Char'