Merge branch 'create-parser' of ssh://gitea.hb.dhbw-stuttgart.de:2222/MisterChaos69/MiniJavaCompiler into bytecode
This commit is contained in:
commit
95178366a2
@ -184,7 +184,7 @@ referencetype : classorinterfacetype { $1 }
|
|||||||
variabledeclarator : variabledeclaratorid { Declarator $1 Nothing }
|
variabledeclarator : variabledeclaratorid { Declarator $1 Nothing }
|
||||||
| variabledeclaratorid ASSIGN variableinitializer { Declarator $1 (Just $3) }
|
| variabledeclaratorid ASSIGN variableinitializer { Declarator $1 (Just $3) }
|
||||||
|
|
||||||
blockstatement : localvariabledeclarationstatement { $1 }
|
blockstatement : localvariabledeclarationstatement { $1 } -- expected type statement
|
||||||
| statement { $1 }
|
| statement { $1 }
|
||||||
|
|
||||||
formalparameter : type variabledeclaratorid { ParameterDeclaration $1 $2 }
|
formalparameter : type variabledeclaratorid { ParameterDeclaration $1 $2 }
|
||||||
@ -200,8 +200,8 @@ variableinitializer : expression { $1 }
|
|||||||
|
|
||||||
localvariabledeclarationstatement : localvariabledeclaration SEMICOLON { $1 }
|
localvariabledeclarationstatement : localvariabledeclaration SEMICOLON { $1 }
|
||||||
|
|
||||||
statement : statementwithouttrailingsubstatement{ $1 }
|
statement : statementwithouttrailingsubstatement{ $1 } -- statement returns a list of statements
|
||||||
-- | ifthenstatement { }
|
| ifthenstatement { [$1] }
|
||||||
-- | ifthenelsestatement { }
|
-- | ifthenelsestatement { }
|
||||||
-- | whilestatement { }
|
-- | whilestatement { }
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ statementwithouttrailingsubstatement : block { [$1] }
|
|||||||
-- | expressionstatement { }
|
-- | expressionstatement { }
|
||||||
| returnstatement { [$1] }
|
| returnstatement { [$1] }
|
||||||
|
|
||||||
ifthenstatement : IF LBRACE expression RBRACE statement { }
|
ifthenstatement : IF LBRACE expression RBRACE statement { If $3 (Block $5) Nothing }
|
||||||
|
|
||||||
ifthenelsestatement : IF LBRACE expression RBRACE statementnoshortif ELSE statement { }
|
ifthenelsestatement : IF LBRACE expression RBRACE statementnoshortif ELSE statement { }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user