-
Notifications
You must be signed in to change notification settings - Fork 0
AST
Program :: ClassDeclaration+
ClassDeclaration :: ClassMember+
ClassMember = FieldDeclaration | MethodDeclaration
FieldDeclaration :: Type Symbol
MethodDeclaration :: Type Symbol Parameter+ Block
ParameterDefinition :: Type Symbol
Type = ArrayType | BasicType | ClassType
ArrayType :: Type
BasicType :: value
ClassType :: Symbol
Block = Statement+
Statement = IfStatement | LocalVariableDeclaration | WhileStatement | Expression
IfStatement :: Expression Statement Statement
WhileStatement :: Expression Statement
Expression :: AssignmentExpression | LogicalOrExpression | LogicalAndExpression | EqualityExpression | RelationalExpression | AdditiveExpression | MultiplicativeExpression | UnaryExpression
AssignmentExpression :: Expression Expression
LogicalOrExpression :: Expression Expression
usw.
UnaryExpression = LogicalNotExpression | NegateExpression | PostfixExpression
LogicalNotExpression :: Expression
NegateExpression :: Expression
PostfixExpression = PrimaryExpression | ArrayAccessExpression | MethodInvovationExpression | VariableAccessExpression
ArrayAccessExpression :: Expression Expression
MethodInvovationExpression :: Expression Symbol (Expression)*
VariableAccessExpression :: Expression Symbol
Symbol ::
Symbol
PrimaryExpression = BooleanConstantExpression | IntegerConstantExpression | NullExpression | ThisExpression | NewArrayExpression | NewObjectExpression
BooleanConstantExpression ::
value
IntegerConstantExpression ::
value
NullExpression ::
ThisExpression ::
NewArrayExpression :: Type Expression
NewObjectExpression :: Symbol