From 12ab402746e5327f8272cd57e8659d48b0aa8e6e Mon Sep 17 00:00:00 2001 From: Purplumbi504 Date: Sun, 16 Jun 2024 13:15:39 +0200 Subject: [PATCH 1/6] Fix errors in if Statments. For and Do While loop as While loop. --- .idea/ANTLRv4ToolGrammarProperties.xml | 19 +++ src/main/java/ast/ASTNode.java | 17 ++- src/main/java/ast/ClassNode.java | 7 +- .../AssignableExpressionNode.java | 2 +- .../ExpressionNode.java | 2 +- .../{member => members}/ConstructorNode.java | 10 +- .../ast/{member => members}/FieldNode.java | 2 +- .../ast/{member => members}/MemberNode.java | 2 +- .../ast/{member => members}/MethodNode.java | 2 +- .../ParameterNode.java | 2 +- .../java/ast/statement/ForStatementNode.java | 23 ---- .../java/ast/statement/StatementNode.java | 2 - .../ast/statement/WhileStatementNode.java | 15 --- .../ifstatement/ElseStatementNode.java | 12 -- .../ifstatement/IfElseStatementNode.java | 20 --- .../ifstatement/IfStatementNode.java | 15 --- .../TargetNode.java | 7 -- .../AssignStatementExpressionNode.java | 6 +- ...mentExpressionStatementExpressionNode.java | 4 +- ...NewDeclarationStatementExpressionNode.java | 4 +- .../ChainedMethodNode.java | 4 +- .../MethodCallStatementExpressionNode.java | 4 +- .../TargetNode.java | 7 ++ .../BlockStatementNode.java} | 7 +- .../ast/statements/ElseStatementNode.java | 13 ++ .../ast/statements/IfElseStatementNode.java | 22 ++++ .../java/ast/statements/IfStatementNode.java | 14 +++ .../LocalVariableDeclarationNode.java | 4 +- .../ReturnStatementNode.java | 8 +- .../java/ast/statements/StatementNode.java | 2 + .../ast/statements/WhileStatementNode.java | 14 +++ src/main/java/bytecode/ClassCodeGen.java | 6 +- src/main/java/bytecode/Mapper.java | 2 +- src/main/java/bytecode/MethodCodeGen.java | 6 +- .../java/bytecode/visitor/ClassVisitor.java | 2 +- .../java/bytecode/visitor/MethodVisitor.java | 4 +- .../java/parser/astBuilder/ASTBuilder.java | 115 +++++++++++++----- src/main/java/parser/grammar/SimpleJava.g4 | 22 ++-- src/main/java/semantic/SemanticVisitor.java | 20 +-- 39 files changed, 255 insertions(+), 194 deletions(-) create mode 100644 .idea/ANTLRv4ToolGrammarProperties.xml rename src/main/java/ast/{expression => expressions}/AssignableExpressionNode.java (63%) rename src/main/java/ast/{expression => expressions}/ExpressionNode.java (56%) rename src/main/java/ast/{member => members}/ConstructorNode.java (82%) rename src/main/java/ast/{member => members}/FieldNode.java (97%) rename src/main/java/ast/{member => members}/MemberNode.java (96%) rename src/main/java/ast/{member => members}/MethodNode.java (98%) rename src/main/java/ast/{parameter => parameters}/ParameterNode.java (91%) delete mode 100644 src/main/java/ast/statement/ForStatementNode.java delete mode 100644 src/main/java/ast/statement/StatementNode.java delete mode 100644 src/main/java/ast/statement/WhileStatementNode.java delete mode 100644 src/main/java/ast/statement/ifstatement/ElseStatementNode.java delete mode 100644 src/main/java/ast/statement/ifstatement/IfElseStatementNode.java delete mode 100644 src/main/java/ast/statement/ifstatement/IfStatementNode.java delete mode 100644 src/main/java/ast/statement/statementexpression/methodcallstatementnexpression/TargetNode.java rename src/main/java/ast/{statement/statementexpression => statementexpressions}/AssignStatementExpressionNode.java (73%) rename src/main/java/ast/{statement/statementexpression => statementexpressions}/CrementExpressionStatementExpressionNode.java (84%) rename src/main/java/ast/{statement/statementexpression => statementexpressions}/NewDeclarationStatementExpressionNode.java (84%) rename src/main/java/ast/{statement/statementexpression => statementexpressions}/methodcallstatementnexpression/ChainedMethodNode.java (78%) rename src/main/java/ast/{statement/statementexpression => statementexpressions}/methodcallstatementnexpression/MethodCallStatementExpressionNode.java (86%) create mode 100644 src/main/java/ast/statementexpressions/methodcallstatementnexpression/TargetNode.java rename src/main/java/ast/{block/BlockNode.java => statements/BlockStatementNode.java} (65%) create mode 100644 src/main/java/ast/statements/ElseStatementNode.java create mode 100644 src/main/java/ast/statements/IfElseStatementNode.java create mode 100644 src/main/java/ast/statements/IfStatementNode.java rename src/main/java/ast/{statement => statements}/LocalVariableDeclarationNode.java (88%) rename src/main/java/ast/{statement => statements}/ReturnStatementNode.java (61%) create mode 100644 src/main/java/ast/statements/StatementNode.java create mode 100644 src/main/java/ast/statements/WhileStatementNode.java diff --git a/.idea/ANTLRv4ToolGrammarProperties.xml b/.idea/ANTLRv4ToolGrammarProperties.xml new file mode 100644 index 0000000..1acd0a2 --- /dev/null +++ b/.idea/ANTLRv4ToolGrammarProperties.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/ast/ASTNode.java b/src/main/java/ast/ASTNode.java index b899ea2..1b666e2 100644 --- a/src/main/java/ast/ASTNode.java +++ b/src/main/java/ast/ASTNode.java @@ -1,5 +1,20 @@ package ast; -public interface ASTNode { } +import bytecode.visitor.ClassVisitor; +import semantic.SemanticVisitor; +import typechecker.TypeCheckResult; + +public interface ASTNode { + + //Todo: @BruderJohn & @i22007 Interface anwenden + geeignetetn Methodename. + + /* + Typecheck: + public TypeCheckResult acceptType(SemanticVisitor visitor); + + Bytecode: + public void accepByteCode(ClassVisitor classVisitor); + */ +} diff --git a/src/main/java/ast/ClassNode.java b/src/main/java/ast/ClassNode.java index 5914d4b..573aef8 100644 --- a/src/main/java/ast/ClassNode.java +++ b/src/main/java/ast/ClassNode.java @@ -1,11 +1,10 @@ package ast; import ast.type.AccessModifierNode; -import ast.type.EnumAccessModifierNode; import bytecode.visitor.ClassVisitor; -import ast.member.ConstructorNode; -import ast.member.MemberNode; -import ast.member.MethodNode; +import ast.members.ConstructorNode; +import ast.members.MemberNode; +import ast.members.MethodNode; import semantic.SemanticVisitor; import typechecker.TypeCheckResult; import visitor.Visitable; diff --git a/src/main/java/ast/expression/AssignableExpressionNode.java b/src/main/java/ast/expressions/AssignableExpressionNode.java similarity index 63% rename from src/main/java/ast/expression/AssignableExpressionNode.java rename to src/main/java/ast/expressions/AssignableExpressionNode.java index 6a65d10..bc702cc 100644 --- a/src/main/java/ast/expression/AssignableExpressionNode.java +++ b/src/main/java/ast/expressions/AssignableExpressionNode.java @@ -1,4 +1,4 @@ -package ast.expression; +package ast.expressions; public class AssignableExpressionNode { } diff --git a/src/main/java/ast/expression/ExpressionNode.java b/src/main/java/ast/expressions/ExpressionNode.java similarity index 56% rename from src/main/java/ast/expression/ExpressionNode.java rename to src/main/java/ast/expressions/ExpressionNode.java index 1566f3b..2d2e86c 100644 --- a/src/main/java/ast/expression/ExpressionNode.java +++ b/src/main/java/ast/expressions/ExpressionNode.java @@ -1,4 +1,4 @@ -package ast.expression; +package ast.expressions; public class ExpressionNode { } diff --git a/src/main/java/ast/member/ConstructorNode.java b/src/main/java/ast/members/ConstructorNode.java similarity index 82% rename from src/main/java/ast/member/ConstructorNode.java rename to src/main/java/ast/members/ConstructorNode.java index 7a7472f..9df3dba 100644 --- a/src/main/java/ast/member/ConstructorNode.java +++ b/src/main/java/ast/members/ConstructorNode.java @@ -1,7 +1,7 @@ -package ast.member; +package ast.members; -import ast.block.BlockNode; -import ast.parameter.ParameterNode; +import ast.statements.BlockStatementNode; +import ast.parameters.ParameterNode; import ast.type.AccessModifierNode; import bytecode.visitor.MethodVisitor; import visitor.Visitable; @@ -13,9 +13,9 @@ public class ConstructorNode extends MethodNode implements Visitable { public AccessModifierNode accessType; public String identifier; public List parameters = new ArrayList<>(); - public BlockNode body; + public BlockStatementNode body; - public ConstructorNode(String accessType, String identifier, BlockNode body) { + public ConstructorNode(String accessType, String identifier, BlockStatementNode body) { this.accessType = new AccessModifierNode(accessType); this.identifier = identifier; this.body = body; diff --git a/src/main/java/ast/member/FieldNode.java b/src/main/java/ast/members/FieldNode.java similarity index 97% rename from src/main/java/ast/member/FieldNode.java rename to src/main/java/ast/members/FieldNode.java index 3ffd751..f04e3f5 100644 --- a/src/main/java/ast/member/FieldNode.java +++ b/src/main/java/ast/members/FieldNode.java @@ -1,4 +1,4 @@ -package ast.member; +package ast.members; import ast.type.AccessModifierNode; import ast.type.TypeNode; diff --git a/src/main/java/ast/member/MemberNode.java b/src/main/java/ast/members/MemberNode.java similarity index 96% rename from src/main/java/ast/member/MemberNode.java rename to src/main/java/ast/members/MemberNode.java index dd02551..1319c03 100644 --- a/src/main/java/ast/member/MemberNode.java +++ b/src/main/java/ast/members/MemberNode.java @@ -1,4 +1,4 @@ -package ast.member; +package ast.members; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/src/main/java/ast/member/MethodNode.java b/src/main/java/ast/members/MethodNode.java similarity index 98% rename from src/main/java/ast/member/MethodNode.java rename to src/main/java/ast/members/MethodNode.java index df50365..3983f28 100644 --- a/src/main/java/ast/member/MethodNode.java +++ b/src/main/java/ast/members/MethodNode.java @@ -1,4 +1,4 @@ -package ast.member; +package ast.members; import bytecode.visitor.MethodVisitor; import semantic.SemanticVisitor; diff --git a/src/main/java/ast/parameter/ParameterNode.java b/src/main/java/ast/parameters/ParameterNode.java similarity index 91% rename from src/main/java/ast/parameter/ParameterNode.java rename to src/main/java/ast/parameters/ParameterNode.java index 3a6b5ec..ba12aab 100644 --- a/src/main/java/ast/parameter/ParameterNode.java +++ b/src/main/java/ast/parameters/ParameterNode.java @@ -1,4 +1,4 @@ -package ast.parameter; +package ast.parameters; import ast.ASTNode; import ast.type.TypeNode; diff --git a/src/main/java/ast/statement/ForStatementNode.java b/src/main/java/ast/statement/ForStatementNode.java deleted file mode 100644 index 5a4b442..0000000 --- a/src/main/java/ast/statement/ForStatementNode.java +++ /dev/null @@ -1,23 +0,0 @@ -package ast.statement; - -import ast.ASTNode; -import ast.expression.ExpressionNode; - -public class ForStatementNode implements ASTNode { - ExpressionNode statementExpressionInit; - StatementNode localVariableDeclarationInit; - ExpressionNode expression; - ExpressionNode statementExpression; - - public ForStatementNode(ExpressionNode statementExpressionInit, ExpressionNode expression, ExpressionNode statementExpression) { - this.statementExpressionInit = statementExpressionInit; - this.expression = expression; - this.statementExpression = statementExpression; - } - - public ForStatementNode(StatementNode localVariableDeclarationInit, ExpressionNode expression, ExpressionNode statementExpression) { - this.localVariableDeclarationInit = localVariableDeclarationInit; - this.expression = expression; - this.statementExpression = statementExpression; - } -} diff --git a/src/main/java/ast/statement/StatementNode.java b/src/main/java/ast/statement/StatementNode.java deleted file mode 100644 index c47d30c..0000000 --- a/src/main/java/ast/statement/StatementNode.java +++ /dev/null @@ -1,2 +0,0 @@ -package ast.statement;public class StatementNode { -} diff --git a/src/main/java/ast/statement/WhileStatementNode.java b/src/main/java/ast/statement/WhileStatementNode.java deleted file mode 100644 index 72d017d..0000000 --- a/src/main/java/ast/statement/WhileStatementNode.java +++ /dev/null @@ -1,15 +0,0 @@ -package ast.statement; - -import ast.ASTNode; -import ast.block.BlockNode; -import ast.expression.ExpressionNode; - -public class WhileStatementNode implements ASTNode { - ExpressionNode expression; - BlockNode block; - - public WhileStatementNode(ExpressionNode expression, BlockNode block) { - this.expression = expression; - this.block = block; - } -} diff --git a/src/main/java/ast/statement/ifstatement/ElseStatementNode.java b/src/main/java/ast/statement/ifstatement/ElseStatementNode.java deleted file mode 100644 index cedfefc..0000000 --- a/src/main/java/ast/statement/ifstatement/ElseStatementNode.java +++ /dev/null @@ -1,12 +0,0 @@ -package ast.statement.ifstatement; - -import ast.ASTNode; -import ast.block.BlockNode; - -public class ElseStatementNode implements ASTNode { - BlockNode block; - - public ElseStatementNode(BlockNode block) { - this.block = block; - } -} diff --git a/src/main/java/ast/statement/ifstatement/IfElseStatementNode.java b/src/main/java/ast/statement/ifstatement/IfElseStatementNode.java deleted file mode 100644 index dcdc6ca..0000000 --- a/src/main/java/ast/statement/ifstatement/IfElseStatementNode.java +++ /dev/null @@ -1,20 +0,0 @@ -package ast.statement.ifstatement; - -import ast.ASTNode; - -import java.util.ArrayList; -import java.util.List; - -public class IfElseStatementNode implements ASTNode { - IfStatementNode ifStatement; - List elseStatements = new ArrayList<>(); - - public IfElseStatementNode(IfStatementNode ifStatement) { - this.ifStatement = ifStatement; - } - - public void addElseStatement(ElseStatementNode elseStatement) { - elseStatements.add(elseStatement); - } - -} diff --git a/src/main/java/ast/statement/ifstatement/IfStatementNode.java b/src/main/java/ast/statement/ifstatement/IfStatementNode.java deleted file mode 100644 index 4731758..0000000 --- a/src/main/java/ast/statement/ifstatement/IfStatementNode.java +++ /dev/null @@ -1,15 +0,0 @@ -package ast.statement.ifstatement; - -import ast.ASTNode; -import ast.block.BlockNode; -import ast.expression.ExpressionNode; - -public class IfStatementNode implements ASTNode { - ExpressionNode expression; - BlockNode block; - - public IfStatementNode(ExpressionNode expression, BlockNode block) { - this.expression = expression; - this.block = block; - } -} diff --git a/src/main/java/ast/statement/statementexpression/methodcallstatementnexpression/TargetNode.java b/src/main/java/ast/statement/statementexpression/methodcallstatementnexpression/TargetNode.java deleted file mode 100644 index 68f4526..0000000 --- a/src/main/java/ast/statement/statementexpression/methodcallstatementnexpression/TargetNode.java +++ /dev/null @@ -1,7 +0,0 @@ -package ast.statement.statementexpression.methodcallstatementnexpression; - -public class TargetNode { - String thisTarget; - - -} diff --git a/src/main/java/ast/statement/statementexpression/AssignStatementExpressionNode.java b/src/main/java/ast/statementexpressions/AssignStatementExpressionNode.java similarity index 73% rename from src/main/java/ast/statement/statementexpression/AssignStatementExpressionNode.java rename to src/main/java/ast/statementexpressions/AssignStatementExpressionNode.java index 007f240..3c63e81 100644 --- a/src/main/java/ast/statement/statementexpression/AssignStatementExpressionNode.java +++ b/src/main/java/ast/statementexpressions/AssignStatementExpressionNode.java @@ -1,8 +1,8 @@ -package ast.statement.statementexpression; +package ast.statementexpressions; import ast.ASTNode; -import ast.expression.AssignableExpressionNode; -import ast.expression.ExpressionNode; +import ast.expressions.AssignableExpressionNode; +import ast.expressions.ExpressionNode; public class AssignStatementExpressionNode implements ASTNode { AssignableExpressionNode assignable; diff --git a/src/main/java/ast/statement/statementexpression/CrementExpressionStatementExpressionNode.java b/src/main/java/ast/statementexpressions/CrementExpressionStatementExpressionNode.java similarity index 84% rename from src/main/java/ast/statement/statementexpression/CrementExpressionStatementExpressionNode.java rename to src/main/java/ast/statementexpressions/CrementExpressionStatementExpressionNode.java index de68102..e3292d5 100644 --- a/src/main/java/ast/statement/statementexpression/CrementExpressionStatementExpressionNode.java +++ b/src/main/java/ast/statementexpressions/CrementExpressionStatementExpressionNode.java @@ -1,7 +1,7 @@ -package ast.statement.statementexpression; +package ast.statementexpressions; import ast.ASTNode; -import ast.expression.ExpressionNode; +import ast.expressions.ExpressionNode; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/ast/statement/statementexpression/NewDeclarationStatementExpressionNode.java b/src/main/java/ast/statementexpressions/NewDeclarationStatementExpressionNode.java similarity index 84% rename from src/main/java/ast/statement/statementexpression/NewDeclarationStatementExpressionNode.java rename to src/main/java/ast/statementexpressions/NewDeclarationStatementExpressionNode.java index 6683b46..0ea4a35 100644 --- a/src/main/java/ast/statement/statementexpression/NewDeclarationStatementExpressionNode.java +++ b/src/main/java/ast/statementexpressions/NewDeclarationStatementExpressionNode.java @@ -1,7 +1,7 @@ -package ast.statement.statementexpression; +package ast.statementexpressions; import ast.ASTNode; -import ast.expression.ExpressionNode; +import ast.expressions.ExpressionNode; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/ast/statement/statementexpression/methodcallstatementnexpression/ChainedMethodNode.java b/src/main/java/ast/statementexpressions/methodcallstatementnexpression/ChainedMethodNode.java similarity index 78% rename from src/main/java/ast/statement/statementexpression/methodcallstatementnexpression/ChainedMethodNode.java rename to src/main/java/ast/statementexpressions/methodcallstatementnexpression/ChainedMethodNode.java index 759f197..9f6919d 100644 --- a/src/main/java/ast/statement/statementexpression/methodcallstatementnexpression/ChainedMethodNode.java +++ b/src/main/java/ast/statementexpressions/methodcallstatementnexpression/ChainedMethodNode.java @@ -1,7 +1,7 @@ -package ast.statement.statementexpression.methodcallstatementnexpression; +package ast.statementexpressions.methodcallstatementnexpression; import ast.ASTNode; -import ast.expression.ExpressionNode; +import ast.expressions.ExpressionNode; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/ast/statement/statementexpression/methodcallstatementnexpression/MethodCallStatementExpressionNode.java b/src/main/java/ast/statementexpressions/methodcallstatementnexpression/MethodCallStatementExpressionNode.java similarity index 86% rename from src/main/java/ast/statement/statementexpression/methodcallstatementnexpression/MethodCallStatementExpressionNode.java rename to src/main/java/ast/statementexpressions/methodcallstatementnexpression/MethodCallStatementExpressionNode.java index 5fcaba1..e92ad1c 100644 --- a/src/main/java/ast/statement/statementexpression/methodcallstatementnexpression/MethodCallStatementExpressionNode.java +++ b/src/main/java/ast/statementexpressions/methodcallstatementnexpression/MethodCallStatementExpressionNode.java @@ -1,7 +1,7 @@ -package ast.statement.statementexpression.methodcallstatementnexpression; +package ast.statementexpressions.methodcallstatementnexpression; import ast.ASTNode; -import ast.expression.ExpressionNode; +import ast.expressions.ExpressionNode; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/ast/statementexpressions/methodcallstatementnexpression/TargetNode.java b/src/main/java/ast/statementexpressions/methodcallstatementnexpression/TargetNode.java new file mode 100644 index 0000000..3621f3d --- /dev/null +++ b/src/main/java/ast/statementexpressions/methodcallstatementnexpression/TargetNode.java @@ -0,0 +1,7 @@ +package ast.statementexpressions.methodcallstatementnexpression; + +public class TargetNode { + String thisTarget; + + +} diff --git a/src/main/java/ast/block/BlockNode.java b/src/main/java/ast/statements/BlockStatementNode.java similarity index 65% rename from src/main/java/ast/block/BlockNode.java rename to src/main/java/ast/statements/BlockStatementNode.java index a5ff3f7..49b2b86 100644 --- a/src/main/java/ast/block/BlockNode.java +++ b/src/main/java/ast/statements/BlockStatementNode.java @@ -1,16 +1,13 @@ -package ast.block; +package ast.statements; import ast.ASTNode; -import ast.statement.StatementNode; import java.util.ArrayList; import java.util.List; -public class BlockNode implements ASTNode { +public class BlockStatementNode extends StatementNode implements ASTNode { public List statements = new ArrayList<>(); - public BlockNode() {} - public void addStatement(StatementNode statement) { statements.add(statement); } diff --git a/src/main/java/ast/statements/ElseStatementNode.java b/src/main/java/ast/statements/ElseStatementNode.java new file mode 100644 index 0000000..70d0243 --- /dev/null +++ b/src/main/java/ast/statements/ElseStatementNode.java @@ -0,0 +1,13 @@ +package ast.statements; + +import ast.ASTNode; + +public class ElseStatementNode implements ASTNode { + BlockStatementNode block; + + public ElseStatementNode(BlockStatementNode block) { + this.block = block; + } + + +} diff --git a/src/main/java/ast/statements/IfElseStatementNode.java b/src/main/java/ast/statements/IfElseStatementNode.java new file mode 100644 index 0000000..8b24274 --- /dev/null +++ b/src/main/java/ast/statements/IfElseStatementNode.java @@ -0,0 +1,22 @@ +package ast.statements; + +import ast.ASTNode; + +import java.util.ArrayList; +import java.util.List; + +public class IfElseStatementNode implements ASTNode { + IfStatementNode ifStatement; + List elseIfStatements = new ArrayList<>(); + ElseStatementNode elseStatement; + + public IfElseStatementNode(IfStatementNode ifStatement, ElseStatementNode elseStatementNode) { + this.ifStatement = ifStatement; + this.elseStatement = elseStatementNode; + } + + public void addElseIfStatement(IfStatementNode elseIfStament) { + elseIfStatements.add(elseIfStament); + } + +} diff --git a/src/main/java/ast/statements/IfStatementNode.java b/src/main/java/ast/statements/IfStatementNode.java new file mode 100644 index 0000000..bf09272 --- /dev/null +++ b/src/main/java/ast/statements/IfStatementNode.java @@ -0,0 +1,14 @@ +package ast.statements; + +import ast.ASTNode; +import ast.expressions.ExpressionNode; + +public class IfStatementNode implements ASTNode { + ExpressionNode expression; + BlockStatementNode block; + + public IfStatementNode(ExpressionNode expression, BlockStatementNode block) { + this.expression = expression; + this.block = block; + } +} diff --git a/src/main/java/ast/statement/LocalVariableDeclarationNode.java b/src/main/java/ast/statements/LocalVariableDeclarationNode.java similarity index 88% rename from src/main/java/ast/statement/LocalVariableDeclarationNode.java rename to src/main/java/ast/statements/LocalVariableDeclarationNode.java index 5b3900f..0e46684 100644 --- a/src/main/java/ast/statement/LocalVariableDeclarationNode.java +++ b/src/main/java/ast/statements/LocalVariableDeclarationNode.java @@ -1,7 +1,7 @@ -package ast.statement; +package ast.statements; import ast.ASTNode; -import ast.expression.ExpressionNode; +import ast.expressions.ExpressionNode; import ast.type.TypeNode; public class LocalVariableDeclarationNode implements ASTNode { diff --git a/src/main/java/ast/statement/ReturnStatementNode.java b/src/main/java/ast/statements/ReturnStatementNode.java similarity index 61% rename from src/main/java/ast/statement/ReturnStatementNode.java rename to src/main/java/ast/statements/ReturnStatementNode.java index ab111c5..25a0e01 100644 --- a/src/main/java/ast/statement/ReturnStatementNode.java +++ b/src/main/java/ast/statements/ReturnStatementNode.java @@ -1,11 +1,7 @@ -package ast.statement; +package ast.statements; import ast.ASTNode; -import ast.expression.ExpressionNode; -import ast.type.TypeNode; - -import java.util.ArrayList; -import java.util.List; +import ast.expressions.ExpressionNode; public class ReturnStatementNode implements ASTNode { public ExpressionNode expression; diff --git a/src/main/java/ast/statements/StatementNode.java b/src/main/java/ast/statements/StatementNode.java new file mode 100644 index 0000000..24985c1 --- /dev/null +++ b/src/main/java/ast/statements/StatementNode.java @@ -0,0 +1,2 @@ +package ast.statements;public class StatementNode { +} diff --git a/src/main/java/ast/statements/WhileStatementNode.java b/src/main/java/ast/statements/WhileStatementNode.java new file mode 100644 index 0000000..e5fadfd --- /dev/null +++ b/src/main/java/ast/statements/WhileStatementNode.java @@ -0,0 +1,14 @@ +package ast.statements; + +import ast.ASTNode; +import ast.expressions.ExpressionNode; + +public class WhileStatementNode extends StatementNode implements ASTNode { + ExpressionNode expression; + BlockStatementNode block; + + public WhileStatementNode(ExpressionNode expression, BlockStatementNode block) { + this.expression = expression; + this.block = block; + } +} diff --git a/src/main/java/bytecode/ClassCodeGen.java b/src/main/java/bytecode/ClassCodeGen.java index b0afa69..a11034c 100644 --- a/src/main/java/bytecode/ClassCodeGen.java +++ b/src/main/java/bytecode/ClassCodeGen.java @@ -1,9 +1,9 @@ package bytecode; import ast.ClassNode; -import ast.member.FieldNode; -import ast.member.MemberNode; -import ast.member.MethodNode; +import ast.members.FieldNode; +import ast.members.MemberNode; +import ast.members.MethodNode; import ast.type.BaseTypeNode; import bytecode.visitor.ClassVisitor; import java.io.File; diff --git a/src/main/java/bytecode/Mapper.java b/src/main/java/bytecode/Mapper.java index faa4a67..54e9daa 100644 --- a/src/main/java/bytecode/Mapper.java +++ b/src/main/java/bytecode/Mapper.java @@ -1,6 +1,6 @@ package bytecode; -import ast.parameter.ParameterNode; +import ast.parameters.ParameterNode; import ast.type.*; import org.objectweb.asm.Opcodes; import ast.type.BaseTypeNode; diff --git a/src/main/java/bytecode/MethodCodeGen.java b/src/main/java/bytecode/MethodCodeGen.java index 1cdf1e2..40bb745 100644 --- a/src/main/java/bytecode/MethodCodeGen.java +++ b/src/main/java/bytecode/MethodCodeGen.java @@ -1,8 +1,8 @@ package bytecode; -import ast.member.ConstructorNode; -import ast.member.MethodNode; -import ast.parameter.ParameterNode; +import ast.members.ConstructorNode; +import ast.members.MethodNode; +import ast.parameters.ParameterNode; import ast.type.BaseTypeNode; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.Label; diff --git a/src/main/java/bytecode/visitor/ClassVisitor.java b/src/main/java/bytecode/visitor/ClassVisitor.java index 903775a..a6167dd 100644 --- a/src/main/java/bytecode/visitor/ClassVisitor.java +++ b/src/main/java/bytecode/visitor/ClassVisitor.java @@ -1,7 +1,7 @@ package bytecode.visitor; import ast.ClassNode; -import ast.member.FieldNode; +import ast.members.FieldNode; public interface ClassVisitor { void visit(ClassNode classNode); diff --git a/src/main/java/bytecode/visitor/MethodVisitor.java b/src/main/java/bytecode/visitor/MethodVisitor.java index 70177ce..150a13d 100644 --- a/src/main/java/bytecode/visitor/MethodVisitor.java +++ b/src/main/java/bytecode/visitor/MethodVisitor.java @@ -1,7 +1,7 @@ package bytecode.visitor; -import ast.member.ConstructorNode; -import ast.member.MethodNode; +import ast.members.ConstructorNode; +import ast.members.MethodNode; public interface MethodVisitor { void visit(ConstructorNode constructorNode); diff --git a/src/main/java/parser/astBuilder/ASTBuilder.java b/src/main/java/parser/astBuilder/ASTBuilder.java index cc54059..3a7eb43 100644 --- a/src/main/java/parser/astBuilder/ASTBuilder.java +++ b/src/main/java/parser/astBuilder/ASTBuilder.java @@ -1,24 +1,27 @@ package parser.astBuilder; import ast.*; -import ast.block.BlockNode; -import ast.expression.AssignableExpressionNode; -import ast.expression.ExpressionNode; -import ast.statement.ifstatement.ElseStatementNode; -import ast.statement.ifstatement.IfElseStatementNode; -import ast.member.ConstructorNode; -import ast.member.MemberNode; -import ast.parameter.ParameterNode; -import ast.statement.*; -import ast.statement.ifstatement.IfStatementNode; -import ast.statement.statementexpression.AssignStatementExpressionNode; -import ast.statement.statementexpression.CrementExpressionStatementExpressionNode; -import ast.statement.statementexpression.methodcallstatementnexpression.ChainedMethodNode; -import ast.statement.statementexpression.methodcallstatementnexpression.MethodCallStatementExpressionNode; -import ast.statement.statementexpression.methodcallstatementnexpression.TargetNode; +import ast.statements.BlockStatementNode; +import ast.expressions.AssignableExpressionNode; +import ast.expressions.ExpressionNode; +import ast.statements.ElseStatementNode; +import ast.statements.IfElseStatementNode; +import ast.members.ConstructorNode; +import ast.members.MemberNode; +import ast.parameters.ParameterNode; +import ast.statements.*; +import ast.statements.IfStatementNode; +import ast.statementexpressions.AssignStatementExpressionNode; +import ast.statementexpressions.CrementExpressionStatementExpressionNode; +import ast.statementexpressions.methodcallstatementnexpression.ChainedMethodNode; +import ast.statementexpressions.methodcallstatementnexpression.MethodCallStatementExpressionNode; +import ast.statementexpressions.methodcallstatementnexpression.TargetNode; import ast.type.*; import parser.generated.*; +import java.util.ArrayList; +import java.util.List; + public class ASTBuilder extends SimpleJavaBaseVisitor { @Override public ASTNode visitProgram(SimpleJavaParser.ProgramContext ctx) { @@ -41,7 +44,7 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { @Override public ASTNode visitConstructorDeclaration(SimpleJavaParser.ConstructorDeclarationContext ctx) { - ConstructorNode constructorNode = new ConstructorNode(ctx.AccessModifier().getText(), ctx.Identifier().getText(), (BlockNode) visit(ctx.block())); + ConstructorNode constructorNode = new ConstructorNode(ctx.AccessModifier().getText(), ctx.Identifier().getText(), (BlockStatementNode) visit(ctx.block())); for(SimpleJavaParser.ParameterContext parameter : ctx.parameterList().parameter()) { constructorNode.addParameter((ParameterNode) visit(parameter)); } @@ -59,8 +62,8 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { return visitReturnStatement(ctx.returnStatement()); } else if(ctx.localVariableDeclaration() != null) { return visitLocalVariableDeclaration(ctx.localVariableDeclaration()); - } else if(ctx.block() != null) { - return visitBlock(ctx.block()); + } else if(ctx.blockStatement() != null) { + return visitBlockStatement(ctx.blockStatement()); } else if(ctx.whileStatement() != null) { return visitWhileStatement(ctx.whileStatement()); } else if(ctx.forStatement() != null) { @@ -84,8 +87,8 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { } @Override - public ASTNode visitBlock(SimpleJavaParser.BlockContext ctx) { - BlockNode blockNode = new BlockNode(); + public ASTNode visitBlockStatement(SimpleJavaParser.BlockStatementContext ctx) { + BlockStatementNode blockNode = new BlockStatementNode(); for(SimpleJavaParser.StatementContext statement : ctx.statement()) { blockNode.addStatement((StatementNode) visit(statement)); } @@ -94,36 +97,86 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { @Override public ASTNode visitWhileStatement(SimpleJavaParser.WhileStatementContext ctx) { - return new WhileStatementNode((ExpressionNode) visit(ctx.expression()), (BlockNode) visit(ctx.block())); + return new WhileStatementNode((ExpressionNode) visit(ctx.expression()), (BlockStatementNode) visit(ctx.blockStatement())); + } + + @Override + public ASTNode visitDoWhileStatement(SimpleJavaParser.DoWhileStatementContext ctx) { + ExpressionNode condition = (ExpressionNode) visit(ctx.expression()); + BlockStatementNode doBlock = (BlockStatementNode) visit(ctx.blockStatement()); + + WhileStatementNode whileStatement = new WhileStatementNode(condition, doBlock); + BlockStatementNode resultBlock = new BlockStatementNode(); + resultBlock.addStatement(doBlock); + resultBlock.addStatement(whileStatement); + + return resultBlock; } @Override public ASTNode visitForStatement(SimpleJavaParser.ForStatementContext ctx) { - if(ctx.statementExpression(0) != null) { - return new ForStatementNode((ExpressionNode) visit(ctx.statementExpression(0)), (ExpressionNode) visit(ctx.expression()), (ExpressionNode) visit(ctx.statementExpression(1))); - } else if(ctx.localVariableDeclaration() != null) { - return new ForStatementNode((StatementNode) visit(ctx.localVariableDeclaration()), (ExpressionNode) visit(ctx.expression()), (ExpressionNode) visit(ctx.statementExpression(1))); + + List statements = new ArrayList<>(); + + //init + if(ctx.statementExpression(0) != null){ + statements.add((StatementNode) visit(ctx.statementExpression(0))); + } else if (ctx.localVariableDeclaration() != null) { + statements.add((StatementNode) visit(ctx.localVariableDeclaration())); } - return null; + + //condition + ExpressionNode condition = (ExpressionNode) visit(ctx.expression()); + + //ink + StatementNode increment = null; + if(ctx.statementExpression(1) != null){ + increment = (StatementNode) visit(ctx.statementExpression(1)); + } + + BlockStatementNode forBlock = (BlockStatementNode) visit(ctx.blockStatement()); + + if(increment != null){ + forBlock.addStatement((increment)); + } + + WhileStatementNode whileStatement = new WhileStatementNode(condition, forBlock); + + statements.add(whileStatement); + + BlockStatementNode resultBlock = new BlockStatementNode(); + for(StatementNode statement : statements) { + resultBlock.addStatement(statement); + } + + return resultBlock; } @Override public ASTNode visitIfElseStatement(SimpleJavaParser.IfElseStatementContext ctx) { - IfElseStatementNode ifElseStatementNode = new IfElseStatementNode((IfStatementNode) visit(ctx.ifStatement())); - for(SimpleJavaParser.ElseStatementContext elseStatement : ctx.elseStatement()) { - ifElseStatementNode.addElseStatement((ElseStatementNode) visit(elseStatement)); + IfElseStatementNode ifElseStatementNode = new IfElseStatementNode((IfStatementNode) visit(ctx.ifStatement()), + (ElseStatementNode) visit(ctx.elseStatement())); + + for (SimpleJavaParser.ElseIfStatementContext elseIfStatement : ctx.elseIfStatement()){ + ifElseStatementNode.addElseIfStatement(((IfStatementNode) visit(elseIfStatement))); } + return ifElseStatementNode; } @Override public ASTNode visitIfStatement(SimpleJavaParser.IfStatementContext ctx) { - return new IfStatementNode((ExpressionNode) visit(ctx.expression()), (BlockNode) visit(ctx.block())); + return new IfStatementNode((ExpressionNode) visit(ctx.expression()), (BlockStatementNode) visit(ctx.blockStatement())); + } + + @Override + public ASTNode visitElseIfStatement(SimpleJavaParser.ElseIfStatementContext ctx) { + return new IfStatementNode((ExpressionNode) visit(ctx.expression()), (BlockStatementNode) visit(ctx.blockStatement())); } @Override public ASTNode visitElseStatement(SimpleJavaParser.ElseStatementContext ctx) { - return new ElseStatementNode((BlockNode) visit(ctx.block())); + return new ElseStatementNode((BlockStatementNode) visit(ctx.blockStatement())); } @Override diff --git a/src/main/java/parser/grammar/SimpleJava.g4 b/src/main/java/parser/grammar/SimpleJava.g4 index 333142f..51b7bc1 100644 --- a/src/main/java/parser/grammar/SimpleJava.g4 +++ b/src/main/java/parser/grammar/SimpleJava.g4 @@ -6,9 +6,9 @@ program: classDeclaration+; classDeclaration: AccessModifier? 'class' Identifier OpenCurlyBracket memberDeclaration* ClosedCurlyBracket; memberDeclaration: constructorDeclaration | fieldDeclaration | methodDeclaration; -constructorDeclaration: AccessModifier? Identifier OpenRoundBracket parameterList? ClosedRoundBracket block; +constructorDeclaration: AccessModifier? Identifier OpenRoundBracket parameterList? ClosedRoundBracket blockStatement; fieldDeclaration: AccessModifier? type Identifier Semicolon; -methodDeclaration: MainMethodDeclaration block | AccessModifier? (type | Void) Identifier OpenRoundBracket parameterList? ClosedRoundBracket block; +methodDeclaration: MainMethodDeclaration blockStatement | AccessModifier? (type | Void) Identifier OpenRoundBracket parameterList? ClosedRoundBracket blockStatement; parameterList: parameter (Comma parameter)*; parameter: type Identifier; @@ -17,23 +17,26 @@ argumentList: (expression (Comma expression)*)?; // Anweisungen statement: returnStatement Semicolon | localVariableDeclaration Semicolon - | block + | blockStatement | whileStatement + | doWhileStatement | forStatement | ifElseStatement | statementExpression Semicolon; -block: OpenCurlyBracket statement* ClosedCurlyBracket; +blockStatement: OpenCurlyBracket statement* ClosedCurlyBracket; returnStatement: Return (expression)?; localVariableDeclaration: type Identifier (Assign expression)?; -whileStatement: While OpenRoundBracket expression ClosedRoundBracket block; -forStatement: For OpenRoundBracket (statementExpression | localVariableDeclaration) Semicolon (expression)? Semicolon (statementExpression)? ClosedRoundBracket block; +whileStatement: While OpenRoundBracket expression ClosedRoundBracket blockStatement; +doWhileStatement: Do blockStatement While OpenRoundBracket expression ClosedRoundBracket Semicolon; +forStatement: For OpenRoundBracket (statementExpression | localVariableDeclaration) Semicolon (expression)? Semicolon (statementExpression)? ClosedRoundBracket blockStatement; -ifElseStatement: ifStatement elseStatement*; -ifStatement: If OpenRoundBracket expression ClosedRoundBracket block; -elseStatement: Else block; +ifElseStatement: ifStatement elseIfStatement* elseStatement?; +ifStatement: If OpenRoundBracket expression ClosedRoundBracket blockStatement; +elseIfStatement: Else If OpenRoundBracket expression ClosedRoundBracket blockStatement; +elseStatement: Else blockStatement; statementExpression: assign | newDeclaration | methodCall | crementExpression; assign: assignableExpression Assign expression; @@ -144,6 +147,7 @@ Comma: ','; Class: 'class'; This: 'this'; While: 'while'; +Do: 'do'; If: 'if'; Else: 'else'; For: 'for'; diff --git a/src/main/java/semantic/SemanticVisitor.java b/src/main/java/semantic/SemanticVisitor.java index 8878777..bdb6538 100644 --- a/src/main/java/semantic/SemanticVisitor.java +++ b/src/main/java/semantic/SemanticVisitor.java @@ -2,17 +2,17 @@ package semantic; import ast.ClassNode; -import ast.expression.LiteralNode; +import ast.expressions.LiteralNode; import ast.ProgramNode; -import ast.expression.BinaryExpressionNode; -import ast.expression.IdentifierExpressionNode; -import ast.expression.InstVar; -import ast.expression.UnaryExpressionNode; -import ast.member.FieldNode; -import ast.member.MethodNode; -import ast.statement.*; -import ast.expression.This; -import ast.statement.ifstatement.IfStatementNode; +import ast.expressions.BinaryExpressionNode; +import ast.expressions.IdentifierExpressionNode; +import ast.expressions.InstVar; +import ast.expressions.UnaryExpressionNode; +import ast.members.FieldNode; +import ast.members.MethodNode; +import ast.statements.*; +import ast.expressions.This; +import ast.statements.IfStatementNode; import typechecker.TypeCheckResult; public interface SemanticVisitor { From 864ddbaeeecd343c81bbff6219f7036ccedb896a Mon Sep 17 00:00:00 2001 From: Purplumbi504 Date: Sun, 23 Jun 2024 10:57:25 +0200 Subject: [PATCH 2/6] Fix errors in if Statments. For and Do While loop as While loop. --- .../java/parser/generated/SimpleJava.interp | 159 + .../java/parser/generated/SimpleJava.tokens | 90 + .../generated/SimpleJavaBaseListener.java | 592 +++ .../generated/SimpleJavaBaseVisitor.java | 337 ++ .../parser/generated/SimpleJavaLexer.interp | 173 + .../parser/generated/SimpleJavaLexer.java | 397 ++ .../parser/generated/SimpleJavaLexer.tokens | 90 + .../parser/generated/SimpleJavaListener.java | 470 +++ .../parser/generated/SimpleJavaParser.java | 3628 +++++++++++++++++ .../parser/generated/SimpleJavaVisitor.java | 289 ++ 10 files changed, 6225 insertions(+) create mode 100644 src/main/java/parser/generated/SimpleJava.interp create mode 100644 src/main/java/parser/generated/SimpleJava.tokens create mode 100644 src/main/java/parser/generated/SimpleJavaBaseListener.java create mode 100644 src/main/java/parser/generated/SimpleJavaBaseVisitor.java create mode 100644 src/main/java/parser/generated/SimpleJavaLexer.interp create mode 100644 src/main/java/parser/generated/SimpleJavaLexer.java create mode 100644 src/main/java/parser/generated/SimpleJavaLexer.tokens create mode 100644 src/main/java/parser/generated/SimpleJavaListener.java create mode 100644 src/main/java/parser/generated/SimpleJavaParser.java create mode 100644 src/main/java/parser/generated/SimpleJavaVisitor.java diff --git a/src/main/java/parser/generated/SimpleJava.interp b/src/main/java/parser/generated/SimpleJava.interp new file mode 100644 index 0000000..aca42bf --- /dev/null +++ b/src/main/java/parser/generated/SimpleJava.interp @@ -0,0 +1,159 @@ +token literal names: +null +'++' +'--' +'void' +'boolean' +'char' +'int' +null +'public static void main(String[] args)' +null +null +null +null +'=' +'+' +'-' +'*' +'%' +'/' +'>' +'<' +'>=' +'<=' +'==' +'!=' +'!' +'&&' +'||' +'.' +'(' +')' +'{' +'}' +';' +',' +'class' +'this' +'while' +'do' +'if' +'else' +'for' +'return' +'new' +null +null +null +'null' +null +null +null +null + +token symbolic names: +null +null +null +Void +Boolean +Char +Int +AccessModifier +MainMethodDeclaration +DotOperator +LineOperator +ComparisonOperator +LogicalOperator +Assign +Plus +Minus +Mult +Modulo +Div +Greater +Less +GreaterEqual +LessEqual +Equal +NotEqual +Not +And +Or +Dot +OpenRoundBracket +ClosedRoundBracket +OpenCurlyBracket +ClosedCurlyBracket +Semicolon +Comma +Class +This +While +Do +If +Else +For +Return +New +CharValue +IntValue +BooleanValue +NullValue +Identifier +WS +InlineComment +MultilineComment + +rule names: +program +classDeclaration +memberDeclaration +constructorDeclaration +fieldDeclaration +methodDeclaration +parameterList +parameter +argumentList +statement +blockStatement +returnStatement +localVariableDeclaration +whileStatement +doWhileStatement +forStatement +ifElseStatement +ifStatement +elseIfStatement +elseStatement +statementExpression +assign +newDeclaration +expression +unaryExpression +notExpression +crementExpression +incrementExpression +prefixIncrementExpression +suffixIncrementExpression +decrementExpression +prefixDecrementExpression +suffixDecrementExpression +assignableExpression +memberAccess +binaryExpression +calculationExpression +dotExpression +dotSubtractionExpression +nonCalculationExpression +methodCall +target +chainedMethod +type +value +nonCalculationOperator + + +atn: +[4, 1, 51, 419, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 1, 0, 4, 0, 94, 8, 0, 11, 0, 12, 0, 95, 1, 1, 3, 1, 99, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 105, 8, 1, 10, 1, 12, 1, 108, 9, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 3, 2, 115, 8, 2, 1, 3, 3, 3, 118, 8, 3, 1, 3, 1, 3, 1, 3, 3, 3, 123, 8, 3, 1, 3, 1, 3, 1, 3, 1, 4, 3, 4, 129, 8, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 3, 5, 138, 8, 5, 1, 5, 1, 5, 3, 5, 142, 8, 5, 1, 5, 1, 5, 1, 5, 3, 5, 147, 8, 5, 1, 5, 1, 5, 3, 5, 151, 8, 5, 1, 6, 1, 6, 1, 6, 5, 6, 156, 8, 6, 10, 6, 12, 6, 159, 9, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 5, 8, 167, 8, 8, 10, 8, 12, 8, 170, 9, 8, 3, 8, 172, 8, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 188, 8, 9, 1, 10, 1, 10, 5, 10, 192, 8, 10, 10, 10, 12, 10, 195, 9, 10, 1, 10, 1, 10, 1, 11, 1, 11, 3, 11, 201, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 207, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 227, 8, 15, 1, 15, 1, 15, 3, 15, 231, 8, 15, 1, 15, 1, 15, 3, 15, 235, 8, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 5, 16, 242, 8, 16, 10, 16, 12, 16, 245, 9, 16, 1, 16, 3, 16, 248, 8, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 3, 20, 270, 8, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 3, 23, 284, 8, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 3, 24, 296, 8, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 3, 26, 303, 8, 26, 1, 27, 1, 27, 3, 27, 307, 8, 27, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 3, 30, 317, 8, 30, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32, 1, 33, 1, 33, 3, 33, 327, 8, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 3, 34, 334, 8, 34, 1, 34, 1, 34, 4, 34, 338, 8, 34, 11, 34, 12, 34, 339, 1, 34, 3, 34, 343, 8, 34, 1, 35, 1, 35, 3, 35, 347, 8, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 5, 36, 355, 8, 36, 10, 36, 12, 36, 358, 9, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 5, 37, 366, 8, 37, 10, 37, 12, 37, 369, 9, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 3, 38, 379, 8, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 3, 40, 386, 8, 40, 1, 40, 5, 40, 389, 8, 40, 10, 40, 12, 40, 392, 9, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 3, 41, 403, 8, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 0, 2, 72, 74, 46, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 0, 3, 2, 0, 4, 6, 48, 48, 1, 0, 44, 47, 1, 0, 11, 12, 430, 0, 93, 1, 0, 0, 0, 2, 98, 1, 0, 0, 0, 4, 114, 1, 0, 0, 0, 6, 117, 1, 0, 0, 0, 8, 128, 1, 0, 0, 0, 10, 150, 1, 0, 0, 0, 12, 152, 1, 0, 0, 0, 14, 160, 1, 0, 0, 0, 16, 171, 1, 0, 0, 0, 18, 187, 1, 0, 0, 0, 20, 189, 1, 0, 0, 0, 22, 198, 1, 0, 0, 0, 24, 202, 1, 0, 0, 0, 26, 208, 1, 0, 0, 0, 28, 214, 1, 0, 0, 0, 30, 222, 1, 0, 0, 0, 32, 239, 1, 0, 0, 0, 34, 249, 1, 0, 0, 0, 36, 255, 1, 0, 0, 0, 38, 262, 1, 0, 0, 0, 40, 269, 1, 0, 0, 0, 42, 271, 1, 0, 0, 0, 44, 275, 1, 0, 0, 0, 46, 283, 1, 0, 0, 0, 48, 295, 1, 0, 0, 0, 50, 297, 1, 0, 0, 0, 52, 302, 1, 0, 0, 0, 54, 306, 1, 0, 0, 0, 56, 308, 1, 0, 0, 0, 58, 311, 1, 0, 0, 0, 60, 316, 1, 0, 0, 0, 62, 318, 1, 0, 0, 0, 64, 321, 1, 0, 0, 0, 66, 326, 1, 0, 0, 0, 68, 342, 1, 0, 0, 0, 70, 346, 1, 0, 0, 0, 72, 348, 1, 0, 0, 0, 74, 359, 1, 0, 0, 0, 76, 378, 1, 0, 0, 0, 78, 380, 1, 0, 0, 0, 80, 385, 1, 0, 0, 0, 82, 402, 1, 0, 0, 0, 84, 406, 1, 0, 0, 0, 86, 412, 1, 0, 0, 0, 88, 414, 1, 0, 0, 0, 90, 416, 1, 0, 0, 0, 92, 94, 3, 2, 1, 0, 93, 92, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 93, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 1, 1, 0, 0, 0, 97, 99, 5, 7, 0, 0, 98, 97, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 101, 5, 35, 0, 0, 101, 102, 5, 48, 0, 0, 102, 106, 5, 31, 0, 0, 103, 105, 3, 4, 2, 0, 104, 103, 1, 0, 0, 0, 105, 108, 1, 0, 0, 0, 106, 104, 1, 0, 0, 0, 106, 107, 1, 0, 0, 0, 107, 109, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 109, 110, 5, 32, 0, 0, 110, 3, 1, 0, 0, 0, 111, 115, 3, 6, 3, 0, 112, 115, 3, 8, 4, 0, 113, 115, 3, 10, 5, 0, 114, 111, 1, 0, 0, 0, 114, 112, 1, 0, 0, 0, 114, 113, 1, 0, 0, 0, 115, 5, 1, 0, 0, 0, 116, 118, 5, 7, 0, 0, 117, 116, 1, 0, 0, 0, 117, 118, 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 119, 120, 5, 48, 0, 0, 120, 122, 5, 29, 0, 0, 121, 123, 3, 12, 6, 0, 122, 121, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 125, 5, 30, 0, 0, 125, 126, 3, 20, 10, 0, 126, 7, 1, 0, 0, 0, 127, 129, 5, 7, 0, 0, 128, 127, 1, 0, 0, 0, 128, 129, 1, 0, 0, 0, 129, 130, 1, 0, 0, 0, 130, 131, 3, 86, 43, 0, 131, 132, 5, 48, 0, 0, 132, 133, 5, 33, 0, 0, 133, 9, 1, 0, 0, 0, 134, 135, 5, 8, 0, 0, 135, 151, 3, 20, 10, 0, 136, 138, 5, 7, 0, 0, 137, 136, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 141, 1, 0, 0, 0, 139, 142, 3, 86, 43, 0, 140, 142, 5, 3, 0, 0, 141, 139, 1, 0, 0, 0, 141, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 144, 5, 48, 0, 0, 144, 146, 5, 29, 0, 0, 145, 147, 3, 12, 6, 0, 146, 145, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 148, 1, 0, 0, 0, 148, 149, 5, 30, 0, 0, 149, 151, 3, 20, 10, 0, 150, 134, 1, 0, 0, 0, 150, 137, 1, 0, 0, 0, 151, 11, 1, 0, 0, 0, 152, 157, 3, 14, 7, 0, 153, 154, 5, 34, 0, 0, 154, 156, 3, 14, 7, 0, 155, 153, 1, 0, 0, 0, 156, 159, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 13, 1, 0, 0, 0, 159, 157, 1, 0, 0, 0, 160, 161, 3, 86, 43, 0, 161, 162, 5, 48, 0, 0, 162, 15, 1, 0, 0, 0, 163, 168, 3, 46, 23, 0, 164, 165, 5, 34, 0, 0, 165, 167, 3, 46, 23, 0, 166, 164, 1, 0, 0, 0, 167, 170, 1, 0, 0, 0, 168, 166, 1, 0, 0, 0, 168, 169, 1, 0, 0, 0, 169, 172, 1, 0, 0, 0, 170, 168, 1, 0, 0, 0, 171, 163, 1, 0, 0, 0, 171, 172, 1, 0, 0, 0, 172, 17, 1, 0, 0, 0, 173, 174, 3, 22, 11, 0, 174, 175, 5, 33, 0, 0, 175, 188, 1, 0, 0, 0, 176, 177, 3, 24, 12, 0, 177, 178, 5, 33, 0, 0, 178, 188, 1, 0, 0, 0, 179, 188, 3, 20, 10, 0, 180, 188, 3, 26, 13, 0, 181, 188, 3, 28, 14, 0, 182, 188, 3, 30, 15, 0, 183, 188, 3, 32, 16, 0, 184, 185, 3, 40, 20, 0, 185, 186, 5, 33, 0, 0, 186, 188, 1, 0, 0, 0, 187, 173, 1, 0, 0, 0, 187, 176, 1, 0, 0, 0, 187, 179, 1, 0, 0, 0, 187, 180, 1, 0, 0, 0, 187, 181, 1, 0, 0, 0, 187, 182, 1, 0, 0, 0, 187, 183, 1, 0, 0, 0, 187, 184, 1, 0, 0, 0, 188, 19, 1, 0, 0, 0, 189, 193, 5, 31, 0, 0, 190, 192, 3, 18, 9, 0, 191, 190, 1, 0, 0, 0, 192, 195, 1, 0, 0, 0, 193, 191, 1, 0, 0, 0, 193, 194, 1, 0, 0, 0, 194, 196, 1, 0, 0, 0, 195, 193, 1, 0, 0, 0, 196, 197, 5, 32, 0, 0, 197, 21, 1, 0, 0, 0, 198, 200, 5, 42, 0, 0, 199, 201, 3, 46, 23, 0, 200, 199, 1, 0, 0, 0, 200, 201, 1, 0, 0, 0, 201, 23, 1, 0, 0, 0, 202, 203, 3, 86, 43, 0, 203, 206, 5, 48, 0, 0, 204, 205, 5, 13, 0, 0, 205, 207, 3, 46, 23, 0, 206, 204, 1, 0, 0, 0, 206, 207, 1, 0, 0, 0, 207, 25, 1, 0, 0, 0, 208, 209, 5, 37, 0, 0, 209, 210, 5, 29, 0, 0, 210, 211, 3, 46, 23, 0, 211, 212, 5, 30, 0, 0, 212, 213, 3, 20, 10, 0, 213, 27, 1, 0, 0, 0, 214, 215, 5, 38, 0, 0, 215, 216, 3, 20, 10, 0, 216, 217, 5, 37, 0, 0, 217, 218, 5, 29, 0, 0, 218, 219, 3, 46, 23, 0, 219, 220, 5, 30, 0, 0, 220, 221, 5, 33, 0, 0, 221, 29, 1, 0, 0, 0, 222, 223, 5, 41, 0, 0, 223, 226, 5, 29, 0, 0, 224, 227, 3, 40, 20, 0, 225, 227, 3, 24, 12, 0, 226, 224, 1, 0, 0, 0, 226, 225, 1, 0, 0, 0, 227, 228, 1, 0, 0, 0, 228, 230, 5, 33, 0, 0, 229, 231, 3, 46, 23, 0, 230, 229, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 232, 1, 0, 0, 0, 232, 234, 5, 33, 0, 0, 233, 235, 3, 40, 20, 0, 234, 233, 1, 0, 0, 0, 234, 235, 1, 0, 0, 0, 235, 236, 1, 0, 0, 0, 236, 237, 5, 30, 0, 0, 237, 238, 3, 20, 10, 0, 238, 31, 1, 0, 0, 0, 239, 243, 3, 34, 17, 0, 240, 242, 3, 36, 18, 0, 241, 240, 1, 0, 0, 0, 242, 245, 1, 0, 0, 0, 243, 241, 1, 0, 0, 0, 243, 244, 1, 0, 0, 0, 244, 247, 1, 0, 0, 0, 245, 243, 1, 0, 0, 0, 246, 248, 3, 38, 19, 0, 247, 246, 1, 0, 0, 0, 247, 248, 1, 0, 0, 0, 248, 33, 1, 0, 0, 0, 249, 250, 5, 39, 0, 0, 250, 251, 5, 29, 0, 0, 251, 252, 3, 46, 23, 0, 252, 253, 5, 30, 0, 0, 253, 254, 3, 20, 10, 0, 254, 35, 1, 0, 0, 0, 255, 256, 5, 40, 0, 0, 256, 257, 5, 39, 0, 0, 257, 258, 5, 29, 0, 0, 258, 259, 3, 46, 23, 0, 259, 260, 5, 30, 0, 0, 260, 261, 3, 20, 10, 0, 261, 37, 1, 0, 0, 0, 262, 263, 5, 40, 0, 0, 263, 264, 3, 20, 10, 0, 264, 39, 1, 0, 0, 0, 265, 270, 3, 42, 21, 0, 266, 270, 3, 44, 22, 0, 267, 270, 3, 80, 40, 0, 268, 270, 3, 52, 26, 0, 269, 265, 1, 0, 0, 0, 269, 266, 1, 0, 0, 0, 269, 267, 1, 0, 0, 0, 269, 268, 1, 0, 0, 0, 270, 41, 1, 0, 0, 0, 271, 272, 3, 66, 33, 0, 272, 273, 5, 13, 0, 0, 273, 274, 3, 46, 23, 0, 274, 43, 1, 0, 0, 0, 275, 276, 5, 43, 0, 0, 276, 277, 5, 48, 0, 0, 277, 278, 5, 29, 0, 0, 278, 279, 3, 16, 8, 0, 279, 280, 5, 30, 0, 0, 280, 45, 1, 0, 0, 0, 281, 284, 3, 48, 24, 0, 282, 284, 3, 70, 35, 0, 283, 281, 1, 0, 0, 0, 283, 282, 1, 0, 0, 0, 284, 47, 1, 0, 0, 0, 285, 296, 5, 36, 0, 0, 286, 296, 5, 48, 0, 0, 287, 296, 3, 68, 34, 0, 288, 296, 3, 88, 44, 0, 289, 296, 3, 50, 25, 0, 290, 296, 3, 40, 20, 0, 291, 292, 5, 29, 0, 0, 292, 293, 3, 46, 23, 0, 293, 294, 5, 30, 0, 0, 294, 296, 1, 0, 0, 0, 295, 285, 1, 0, 0, 0, 295, 286, 1, 0, 0, 0, 295, 287, 1, 0, 0, 0, 295, 288, 1, 0, 0, 0, 295, 289, 1, 0, 0, 0, 295, 290, 1, 0, 0, 0, 295, 291, 1, 0, 0, 0, 296, 49, 1, 0, 0, 0, 297, 298, 5, 25, 0, 0, 298, 299, 3, 46, 23, 0, 299, 51, 1, 0, 0, 0, 300, 303, 3, 54, 27, 0, 301, 303, 3, 60, 30, 0, 302, 300, 1, 0, 0, 0, 302, 301, 1, 0, 0, 0, 303, 53, 1, 0, 0, 0, 304, 307, 3, 56, 28, 0, 305, 307, 3, 58, 29, 0, 306, 304, 1, 0, 0, 0, 306, 305, 1, 0, 0, 0, 307, 55, 1, 0, 0, 0, 308, 309, 5, 1, 0, 0, 309, 310, 3, 66, 33, 0, 310, 57, 1, 0, 0, 0, 311, 312, 3, 66, 33, 0, 312, 313, 5, 1, 0, 0, 313, 59, 1, 0, 0, 0, 314, 317, 3, 62, 31, 0, 315, 317, 3, 64, 32, 0, 316, 314, 1, 0, 0, 0, 316, 315, 1, 0, 0, 0, 317, 61, 1, 0, 0, 0, 318, 319, 5, 2, 0, 0, 319, 320, 3, 66, 33, 0, 320, 63, 1, 0, 0, 0, 321, 322, 3, 66, 33, 0, 322, 323, 5, 2, 0, 0, 323, 65, 1, 0, 0, 0, 324, 327, 5, 48, 0, 0, 325, 327, 3, 68, 34, 0, 326, 324, 1, 0, 0, 0, 326, 325, 1, 0, 0, 0, 327, 67, 1, 0, 0, 0, 328, 329, 5, 36, 0, 0, 329, 330, 5, 28, 0, 0, 330, 343, 5, 48, 0, 0, 331, 332, 5, 36, 0, 0, 332, 334, 5, 28, 0, 0, 333, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 337, 1, 0, 0, 0, 335, 336, 5, 48, 0, 0, 336, 338, 5, 28, 0, 0, 337, 335, 1, 0, 0, 0, 338, 339, 1, 0, 0, 0, 339, 337, 1, 0, 0, 0, 339, 340, 1, 0, 0, 0, 340, 341, 1, 0, 0, 0, 341, 343, 5, 48, 0, 0, 342, 328, 1, 0, 0, 0, 342, 333, 1, 0, 0, 0, 343, 69, 1, 0, 0, 0, 344, 347, 3, 72, 36, 0, 345, 347, 3, 78, 39, 0, 346, 344, 1, 0, 0, 0, 346, 345, 1, 0, 0, 0, 347, 71, 1, 0, 0, 0, 348, 349, 6, 36, -1, 0, 349, 350, 3, 74, 37, 0, 350, 356, 1, 0, 0, 0, 351, 352, 10, 2, 0, 0, 352, 353, 5, 10, 0, 0, 353, 355, 3, 74, 37, 0, 354, 351, 1, 0, 0, 0, 355, 358, 1, 0, 0, 0, 356, 354, 1, 0, 0, 0, 356, 357, 1, 0, 0, 0, 357, 73, 1, 0, 0, 0, 358, 356, 1, 0, 0, 0, 359, 360, 6, 37, -1, 0, 360, 361, 3, 76, 38, 0, 361, 367, 1, 0, 0, 0, 362, 363, 10, 2, 0, 0, 363, 364, 5, 9, 0, 0, 364, 366, 3, 76, 38, 0, 365, 362, 1, 0, 0, 0, 366, 369, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 367, 368, 1, 0, 0, 0, 368, 75, 1, 0, 0, 0, 369, 367, 1, 0, 0, 0, 370, 379, 5, 45, 0, 0, 371, 379, 5, 48, 0, 0, 372, 379, 3, 68, 34, 0, 373, 374, 3, 80, 40, 0, 374, 375, 5, 29, 0, 0, 375, 376, 3, 72, 36, 0, 376, 377, 5, 30, 0, 0, 377, 379, 1, 0, 0, 0, 378, 370, 1, 0, 0, 0, 378, 371, 1, 0, 0, 0, 378, 372, 1, 0, 0, 0, 378, 373, 1, 0, 0, 0, 379, 77, 1, 0, 0, 0, 380, 381, 3, 48, 24, 0, 381, 382, 3, 90, 45, 0, 382, 383, 3, 46, 23, 0, 383, 79, 1, 0, 0, 0, 384, 386, 3, 82, 41, 0, 385, 384, 1, 0, 0, 0, 385, 386, 1, 0, 0, 0, 386, 390, 1, 0, 0, 0, 387, 389, 3, 84, 42, 0, 388, 387, 1, 0, 0, 0, 389, 392, 1, 0, 0, 0, 390, 388, 1, 0, 0, 0, 390, 391, 1, 0, 0, 0, 391, 393, 1, 0, 0, 0, 392, 390, 1, 0, 0, 0, 393, 394, 5, 48, 0, 0, 394, 395, 5, 29, 0, 0, 395, 396, 3, 16, 8, 0, 396, 397, 5, 30, 0, 0, 397, 81, 1, 0, 0, 0, 398, 403, 5, 36, 0, 0, 399, 403, 3, 68, 34, 0, 400, 403, 3, 44, 22, 0, 401, 403, 5, 48, 0, 0, 402, 398, 1, 0, 0, 0, 402, 399, 1, 0, 0, 0, 402, 400, 1, 0, 0, 0, 402, 401, 1, 0, 0, 0, 403, 404, 1, 0, 0, 0, 404, 405, 5, 28, 0, 0, 405, 83, 1, 0, 0, 0, 406, 407, 5, 48, 0, 0, 407, 408, 5, 29, 0, 0, 408, 409, 3, 16, 8, 0, 409, 410, 5, 30, 0, 0, 410, 411, 5, 28, 0, 0, 411, 85, 1, 0, 0, 0, 412, 413, 7, 0, 0, 0, 413, 87, 1, 0, 0, 0, 414, 415, 7, 1, 0, 0, 415, 89, 1, 0, 0, 0, 416, 417, 7, 2, 0, 0, 417, 91, 1, 0, 0, 0, 40, 95, 98, 106, 114, 117, 122, 128, 137, 141, 146, 150, 157, 168, 171, 187, 193, 200, 206, 226, 230, 234, 243, 247, 269, 283, 295, 302, 306, 316, 326, 333, 339, 342, 346, 356, 367, 378, 385, 390, 402] \ No newline at end of file diff --git a/src/main/java/parser/generated/SimpleJava.tokens b/src/main/java/parser/generated/SimpleJava.tokens new file mode 100644 index 0000000..71246c8 --- /dev/null +++ b/src/main/java/parser/generated/SimpleJava.tokens @@ -0,0 +1,90 @@ +T__0=1 +T__1=2 +Void=3 +Boolean=4 +Char=5 +Int=6 +AccessModifier=7 +MainMethodDeclaration=8 +DotOperator=9 +LineOperator=10 +ComparisonOperator=11 +LogicalOperator=12 +Assign=13 +Plus=14 +Minus=15 +Mult=16 +Modulo=17 +Div=18 +Greater=19 +Less=20 +GreaterEqual=21 +LessEqual=22 +Equal=23 +NotEqual=24 +Not=25 +And=26 +Or=27 +Dot=28 +OpenRoundBracket=29 +ClosedRoundBracket=30 +OpenCurlyBracket=31 +ClosedCurlyBracket=32 +Semicolon=33 +Comma=34 +Class=35 +This=36 +While=37 +Do=38 +If=39 +Else=40 +For=41 +Return=42 +New=43 +CharValue=44 +IntValue=45 +BooleanValue=46 +NullValue=47 +Identifier=48 +WS=49 +InlineComment=50 +MultilineComment=51 +'++'=1 +'--'=2 +'void'=3 +'boolean'=4 +'char'=5 +'int'=6 +'public static void main(String[] args)'=8 +'='=13 +'+'=14 +'-'=15 +'*'=16 +'%'=17 +'/'=18 +'>'=19 +'<'=20 +'>='=21 +'<='=22 +'=='=23 +'!='=24 +'!'=25 +'&&'=26 +'||'=27 +'.'=28 +'('=29 +')'=30 +'{'=31 +'}'=32 +';'=33 +','=34 +'class'=35 +'this'=36 +'while'=37 +'do'=38 +'if'=39 +'else'=40 +'for'=41 +'return'=42 +'new'=43 +'null'=47 diff --git a/src/main/java/parser/generated/SimpleJavaBaseListener.java b/src/main/java/parser/generated/SimpleJavaBaseListener.java new file mode 100644 index 0000000..eecc12f --- /dev/null +++ b/src/main/java/parser/generated/SimpleJavaBaseListener.java @@ -0,0 +1,592 @@ +// Generated from C:/Users/janni/Desktop/NichtHaskell2.0/src/main/java/parser/grammar/SimpleJava.g4 by ANTLR 4.13.1 +package parser.generated; + +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.tree.ErrorNode; +import org.antlr.v4.runtime.tree.TerminalNode; + +/** + * This class provides an empty implementation of {@link SimpleJavaListener}, + * which can be extended to create a listener which only needs to handle a subset + * of the available methods. + */ +@SuppressWarnings("CheckReturnValue") +public class SimpleJavaBaseListener implements SimpleJavaListener { + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterProgram(SimpleJavaParser.ProgramContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitProgram(SimpleJavaParser.ProgramContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterClassDeclaration(SimpleJavaParser.ClassDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitClassDeclaration(SimpleJavaParser.ClassDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMemberDeclaration(SimpleJavaParser.MemberDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMemberDeclaration(SimpleJavaParser.MemberDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterConstructorDeclaration(SimpleJavaParser.ConstructorDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitConstructorDeclaration(SimpleJavaParser.ConstructorDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterFieldDeclaration(SimpleJavaParser.FieldDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitFieldDeclaration(SimpleJavaParser.FieldDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMethodDeclaration(SimpleJavaParser.MethodDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMethodDeclaration(SimpleJavaParser.MethodDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterParameterList(SimpleJavaParser.ParameterListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitParameterList(SimpleJavaParser.ParameterListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterParameter(SimpleJavaParser.ParameterContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitParameter(SimpleJavaParser.ParameterContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterArgumentList(SimpleJavaParser.ArgumentListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitArgumentList(SimpleJavaParser.ArgumentListContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterStatement(SimpleJavaParser.StatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitStatement(SimpleJavaParser.StatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterBlockStatement(SimpleJavaParser.BlockStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitBlockStatement(SimpleJavaParser.BlockStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterReturnStatement(SimpleJavaParser.ReturnStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitReturnStatement(SimpleJavaParser.ReturnStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterLocalVariableDeclaration(SimpleJavaParser.LocalVariableDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitLocalVariableDeclaration(SimpleJavaParser.LocalVariableDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterWhileStatement(SimpleJavaParser.WhileStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitWhileStatement(SimpleJavaParser.WhileStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterDoWhileStatement(SimpleJavaParser.DoWhileStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitDoWhileStatement(SimpleJavaParser.DoWhileStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterForStatement(SimpleJavaParser.ForStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitForStatement(SimpleJavaParser.ForStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIfElseStatement(SimpleJavaParser.IfElseStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIfElseStatement(SimpleJavaParser.IfElseStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIfStatement(SimpleJavaParser.IfStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIfStatement(SimpleJavaParser.IfStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterElseIfStatement(SimpleJavaParser.ElseIfStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitElseIfStatement(SimpleJavaParser.ElseIfStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterElseStatement(SimpleJavaParser.ElseStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitElseStatement(SimpleJavaParser.ElseStatementContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterStatementExpression(SimpleJavaParser.StatementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitStatementExpression(SimpleJavaParser.StatementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAssign(SimpleJavaParser.AssignContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAssign(SimpleJavaParser.AssignContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterNewDeclaration(SimpleJavaParser.NewDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitNewDeclaration(SimpleJavaParser.NewDeclarationContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterExpression(SimpleJavaParser.ExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitExpression(SimpleJavaParser.ExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterUnaryExpression(SimpleJavaParser.UnaryExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitUnaryExpression(SimpleJavaParser.UnaryExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterNotExpression(SimpleJavaParser.NotExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitNotExpression(SimpleJavaParser.NotExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterCrementExpression(SimpleJavaParser.CrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitCrementExpression(SimpleJavaParser.CrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterIncrementExpression(SimpleJavaParser.IncrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitIncrementExpression(SimpleJavaParser.IncrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPrefixIncrementExpression(SimpleJavaParser.PrefixIncrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPrefixIncrementExpression(SimpleJavaParser.PrefixIncrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSuffixIncrementExpression(SimpleJavaParser.SuffixIncrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSuffixIncrementExpression(SimpleJavaParser.SuffixIncrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterDecrementExpression(SimpleJavaParser.DecrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitDecrementExpression(SimpleJavaParser.DecrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterPrefixDecrementExpression(SimpleJavaParser.PrefixDecrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitPrefixDecrementExpression(SimpleJavaParser.PrefixDecrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterSuffixDecrementExpression(SimpleJavaParser.SuffixDecrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitSuffixDecrementExpression(SimpleJavaParser.SuffixDecrementExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterAssignableExpression(SimpleJavaParser.AssignableExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitAssignableExpression(SimpleJavaParser.AssignableExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMemberAccess(SimpleJavaParser.MemberAccessContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMemberAccess(SimpleJavaParser.MemberAccessContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterBinaryExpression(SimpleJavaParser.BinaryExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitBinaryExpression(SimpleJavaParser.BinaryExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterCalculationExpression(SimpleJavaParser.CalculationExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitCalculationExpression(SimpleJavaParser.CalculationExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterDotExpression(SimpleJavaParser.DotExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitDotExpression(SimpleJavaParser.DotExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterDotSubtractionExpression(SimpleJavaParser.DotSubtractionExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitDotSubtractionExpression(SimpleJavaParser.DotSubtractionExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterNonCalculationExpression(SimpleJavaParser.NonCalculationExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitNonCalculationExpression(SimpleJavaParser.NonCalculationExpressionContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterMethodCall(SimpleJavaParser.MethodCallContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitMethodCall(SimpleJavaParser.MethodCallContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterTarget(SimpleJavaParser.TargetContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitTarget(SimpleJavaParser.TargetContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterChainedMethod(SimpleJavaParser.ChainedMethodContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitChainedMethod(SimpleJavaParser.ChainedMethodContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterType(SimpleJavaParser.TypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitType(SimpleJavaParser.TypeContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterValue(SimpleJavaParser.ValueContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitValue(SimpleJavaParser.ValueContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterNonCalculationOperator(SimpleJavaParser.NonCalculationOperatorContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitNonCalculationOperator(SimpleJavaParser.NonCalculationOperatorContext ctx) { } + + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void enterEveryRule(ParserRuleContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void exitEveryRule(ParserRuleContext ctx) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void visitTerminal(TerminalNode node) { } + /** + * {@inheritDoc} + * + *

The default implementation does nothing.

+ */ + @Override public void visitErrorNode(ErrorNode node) { } +} \ No newline at end of file diff --git a/src/main/java/parser/generated/SimpleJavaBaseVisitor.java b/src/main/java/parser/generated/SimpleJavaBaseVisitor.java new file mode 100644 index 0000000..b3a6029 --- /dev/null +++ b/src/main/java/parser/generated/SimpleJavaBaseVisitor.java @@ -0,0 +1,337 @@ +// Generated from C:/Users/janni/Desktop/NichtHaskell2.0/src/main/java/parser/grammar/SimpleJava.g4 by ANTLR 4.13.1 +package parser.generated; +import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; + +/** + * This class provides an empty implementation of {@link SimpleJavaVisitor}, + * which can be extended to create a visitor which only needs to handle a subset + * of the available methods. + * + * @param The return type of the visit operation. Use {@link Void} for + * operations with no return type. + */ +@SuppressWarnings("CheckReturnValue") +public class SimpleJavaBaseVisitor extends AbstractParseTreeVisitor implements SimpleJavaVisitor { + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitProgram(SimpleJavaParser.ProgramContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitClassDeclaration(SimpleJavaParser.ClassDeclarationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitMemberDeclaration(SimpleJavaParser.MemberDeclarationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitConstructorDeclaration(SimpleJavaParser.ConstructorDeclarationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitFieldDeclaration(SimpleJavaParser.FieldDeclarationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitMethodDeclaration(SimpleJavaParser.MethodDeclarationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitParameterList(SimpleJavaParser.ParameterListContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitParameter(SimpleJavaParser.ParameterContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitArgumentList(SimpleJavaParser.ArgumentListContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitStatement(SimpleJavaParser.StatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitBlockStatement(SimpleJavaParser.BlockStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitReturnStatement(SimpleJavaParser.ReturnStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitLocalVariableDeclaration(SimpleJavaParser.LocalVariableDeclarationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitWhileStatement(SimpleJavaParser.WhileStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitDoWhileStatement(SimpleJavaParser.DoWhileStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitForStatement(SimpleJavaParser.ForStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitIfElseStatement(SimpleJavaParser.IfElseStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitIfStatement(SimpleJavaParser.IfStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitElseIfStatement(SimpleJavaParser.ElseIfStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitElseStatement(SimpleJavaParser.ElseStatementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitStatementExpression(SimpleJavaParser.StatementExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitAssign(SimpleJavaParser.AssignContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitNewDeclaration(SimpleJavaParser.NewDeclarationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitExpression(SimpleJavaParser.ExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitUnaryExpression(SimpleJavaParser.UnaryExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitNotExpression(SimpleJavaParser.NotExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitCrementExpression(SimpleJavaParser.CrementExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitIncrementExpression(SimpleJavaParser.IncrementExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitPrefixIncrementExpression(SimpleJavaParser.PrefixIncrementExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitSuffixIncrementExpression(SimpleJavaParser.SuffixIncrementExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitDecrementExpression(SimpleJavaParser.DecrementExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitPrefixDecrementExpression(SimpleJavaParser.PrefixDecrementExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitSuffixDecrementExpression(SimpleJavaParser.SuffixDecrementExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitAssignableExpression(SimpleJavaParser.AssignableExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitMemberAccess(SimpleJavaParser.MemberAccessContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitBinaryExpression(SimpleJavaParser.BinaryExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitCalculationExpression(SimpleJavaParser.CalculationExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitDotExpression(SimpleJavaParser.DotExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitDotSubtractionExpression(SimpleJavaParser.DotSubtractionExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitNonCalculationExpression(SimpleJavaParser.NonCalculationExpressionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitMethodCall(SimpleJavaParser.MethodCallContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitTarget(SimpleJavaParser.TargetContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitChainedMethod(SimpleJavaParser.ChainedMethodContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitType(SimpleJavaParser.TypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitValue(SimpleJavaParser.ValueContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ */ + @Override public T visitNonCalculationOperator(SimpleJavaParser.NonCalculationOperatorContext ctx) { return visitChildren(ctx); } +} \ No newline at end of file diff --git a/src/main/java/parser/generated/SimpleJavaLexer.interp b/src/main/java/parser/generated/SimpleJavaLexer.interp new file mode 100644 index 0000000..61f0ce5 --- /dev/null +++ b/src/main/java/parser/generated/SimpleJavaLexer.interp @@ -0,0 +1,173 @@ +token literal names: +null +'++' +'--' +'void' +'boolean' +'char' +'int' +null +'public static void main(String[] args)' +null +null +null +null +'=' +'+' +'-' +'*' +'%' +'/' +'>' +'<' +'>=' +'<=' +'==' +'!=' +'!' +'&&' +'||' +'.' +'(' +')' +'{' +'}' +';' +',' +'class' +'this' +'while' +'do' +'if' +'else' +'for' +'return' +'new' +null +null +null +'null' +null +null +null +null + +token symbolic names: +null +null +null +Void +Boolean +Char +Int +AccessModifier +MainMethodDeclaration +DotOperator +LineOperator +ComparisonOperator +LogicalOperator +Assign +Plus +Minus +Mult +Modulo +Div +Greater +Less +GreaterEqual +LessEqual +Equal +NotEqual +Not +And +Or +Dot +OpenRoundBracket +ClosedRoundBracket +OpenCurlyBracket +ClosedCurlyBracket +Semicolon +Comma +Class +This +While +Do +If +Else +For +Return +New +CharValue +IntValue +BooleanValue +NullValue +Identifier +WS +InlineComment +MultilineComment + +rule names: +T__0 +T__1 +Void +Boolean +Char +Int +AccessModifier +MainMethodDeclaration +DotOperator +LineOperator +ComparisonOperator +LogicalOperator +Assign +Plus +Minus +Mult +Modulo +Div +Greater +Less +GreaterEqual +LessEqual +Equal +NotEqual +Not +And +Or +Dot +OpenRoundBracket +ClosedRoundBracket +OpenCurlyBracket +ClosedCurlyBracket +Semicolon +Comma +Class +This +While +Do +If +Else +For +Return +New +CharValue +IntValue +BooleanValue +NullValue +Alphabetic +Numeric +ValidIdentSymbols +Identifier +WS +InlineComment +MultilineComment + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[4, 0, 51, 413, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 178, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 3, 8, 222, 8, 8, 1, 9, 1, 9, 3, 9, 226, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 234, 8, 10, 1, 11, 1, 11, 3, 11, 238, 8, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 5, 43, 335, 8, 43, 10, 43, 12, 43, 338, 9, 43, 1, 43, 1, 43, 1, 44, 3, 44, 343, 8, 44, 1, 44, 4, 44, 346, 8, 44, 11, 44, 12, 44, 347, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 3, 45, 359, 8, 45, 1, 46, 1, 46, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 3, 49, 373, 8, 49, 1, 50, 1, 50, 5, 50, 377, 8, 50, 10, 50, 12, 50, 380, 9, 50, 1, 51, 4, 51, 383, 8, 51, 11, 51, 12, 51, 384, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 393, 8, 52, 10, 52, 12, 52, 396, 9, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 5, 53, 404, 8, 53, 10, 53, 12, 53, 407, 9, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 53, 1, 405, 0, 54, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 0, 97, 0, 99, 0, 101, 48, 103, 49, 105, 50, 107, 51, 1, 0, 5, 2, 0, 10, 10, 13, 13, 2, 0, 65, 90, 97, 122, 1, 0, 48, 57, 2, 0, 36, 36, 95, 95, 3, 0, 9, 10, 13, 13, 32, 32, 431, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 1, 109, 1, 0, 0, 0, 3, 112, 1, 0, 0, 0, 5, 115, 1, 0, 0, 0, 7, 120, 1, 0, 0, 0, 9, 128, 1, 0, 0, 0, 11, 133, 1, 0, 0, 0, 13, 177, 1, 0, 0, 0, 15, 179, 1, 0, 0, 0, 17, 221, 1, 0, 0, 0, 19, 225, 1, 0, 0, 0, 21, 233, 1, 0, 0, 0, 23, 237, 1, 0, 0, 0, 25, 239, 1, 0, 0, 0, 27, 241, 1, 0, 0, 0, 29, 243, 1, 0, 0, 0, 31, 245, 1, 0, 0, 0, 33, 247, 1, 0, 0, 0, 35, 249, 1, 0, 0, 0, 37, 251, 1, 0, 0, 0, 39, 253, 1, 0, 0, 0, 41, 255, 1, 0, 0, 0, 43, 258, 1, 0, 0, 0, 45, 261, 1, 0, 0, 0, 47, 264, 1, 0, 0, 0, 49, 267, 1, 0, 0, 0, 51, 269, 1, 0, 0, 0, 53, 272, 1, 0, 0, 0, 55, 275, 1, 0, 0, 0, 57, 277, 1, 0, 0, 0, 59, 279, 1, 0, 0, 0, 61, 281, 1, 0, 0, 0, 63, 283, 1, 0, 0, 0, 65, 285, 1, 0, 0, 0, 67, 287, 1, 0, 0, 0, 69, 289, 1, 0, 0, 0, 71, 295, 1, 0, 0, 0, 73, 300, 1, 0, 0, 0, 75, 306, 1, 0, 0, 0, 77, 309, 1, 0, 0, 0, 79, 312, 1, 0, 0, 0, 81, 317, 1, 0, 0, 0, 83, 321, 1, 0, 0, 0, 85, 328, 1, 0, 0, 0, 87, 332, 1, 0, 0, 0, 89, 342, 1, 0, 0, 0, 91, 358, 1, 0, 0, 0, 93, 360, 1, 0, 0, 0, 95, 365, 1, 0, 0, 0, 97, 367, 1, 0, 0, 0, 99, 372, 1, 0, 0, 0, 101, 374, 1, 0, 0, 0, 103, 382, 1, 0, 0, 0, 105, 388, 1, 0, 0, 0, 107, 399, 1, 0, 0, 0, 109, 110, 5, 43, 0, 0, 110, 111, 5, 43, 0, 0, 111, 2, 1, 0, 0, 0, 112, 113, 5, 45, 0, 0, 113, 114, 5, 45, 0, 0, 114, 4, 1, 0, 0, 0, 115, 116, 5, 118, 0, 0, 116, 117, 5, 111, 0, 0, 117, 118, 5, 105, 0, 0, 118, 119, 5, 100, 0, 0, 119, 6, 1, 0, 0, 0, 120, 121, 5, 98, 0, 0, 121, 122, 5, 111, 0, 0, 122, 123, 5, 111, 0, 0, 123, 124, 5, 108, 0, 0, 124, 125, 5, 101, 0, 0, 125, 126, 5, 97, 0, 0, 126, 127, 5, 110, 0, 0, 127, 8, 1, 0, 0, 0, 128, 129, 5, 99, 0, 0, 129, 130, 5, 104, 0, 0, 130, 131, 5, 97, 0, 0, 131, 132, 5, 114, 0, 0, 132, 10, 1, 0, 0, 0, 133, 134, 5, 105, 0, 0, 134, 135, 5, 110, 0, 0, 135, 136, 5, 116, 0, 0, 136, 12, 1, 0, 0, 0, 137, 138, 5, 112, 0, 0, 138, 139, 5, 117, 0, 0, 139, 140, 5, 98, 0, 0, 140, 141, 5, 108, 0, 0, 141, 142, 5, 105, 0, 0, 142, 178, 5, 99, 0, 0, 143, 144, 5, 112, 0, 0, 144, 145, 5, 114, 0, 0, 145, 146, 5, 105, 0, 0, 146, 147, 5, 118, 0, 0, 147, 148, 5, 97, 0, 0, 148, 149, 5, 116, 0, 0, 149, 178, 5, 101, 0, 0, 150, 151, 5, 112, 0, 0, 151, 152, 5, 117, 0, 0, 152, 153, 5, 98, 0, 0, 153, 154, 5, 108, 0, 0, 154, 155, 5, 105, 0, 0, 155, 156, 5, 99, 0, 0, 156, 157, 5, 32, 0, 0, 157, 158, 5, 115, 0, 0, 158, 159, 5, 116, 0, 0, 159, 160, 5, 97, 0, 0, 160, 161, 5, 116, 0, 0, 161, 162, 5, 105, 0, 0, 162, 178, 5, 99, 0, 0, 163, 164, 5, 112, 0, 0, 164, 165, 5, 114, 0, 0, 165, 166, 5, 105, 0, 0, 166, 167, 5, 118, 0, 0, 167, 168, 5, 97, 0, 0, 168, 169, 5, 116, 0, 0, 169, 170, 5, 101, 0, 0, 170, 171, 5, 32, 0, 0, 171, 172, 5, 115, 0, 0, 172, 173, 5, 116, 0, 0, 173, 174, 5, 97, 0, 0, 174, 175, 5, 116, 0, 0, 175, 176, 5, 105, 0, 0, 176, 178, 5, 99, 0, 0, 177, 137, 1, 0, 0, 0, 177, 143, 1, 0, 0, 0, 177, 150, 1, 0, 0, 0, 177, 163, 1, 0, 0, 0, 178, 14, 1, 0, 0, 0, 179, 180, 5, 112, 0, 0, 180, 181, 5, 117, 0, 0, 181, 182, 5, 98, 0, 0, 182, 183, 5, 108, 0, 0, 183, 184, 5, 105, 0, 0, 184, 185, 5, 99, 0, 0, 185, 186, 5, 32, 0, 0, 186, 187, 5, 115, 0, 0, 187, 188, 5, 116, 0, 0, 188, 189, 5, 97, 0, 0, 189, 190, 5, 116, 0, 0, 190, 191, 5, 105, 0, 0, 191, 192, 5, 99, 0, 0, 192, 193, 5, 32, 0, 0, 193, 194, 5, 118, 0, 0, 194, 195, 5, 111, 0, 0, 195, 196, 5, 105, 0, 0, 196, 197, 5, 100, 0, 0, 197, 198, 5, 32, 0, 0, 198, 199, 5, 109, 0, 0, 199, 200, 5, 97, 0, 0, 200, 201, 5, 105, 0, 0, 201, 202, 5, 110, 0, 0, 202, 203, 5, 40, 0, 0, 203, 204, 5, 83, 0, 0, 204, 205, 5, 116, 0, 0, 205, 206, 5, 114, 0, 0, 206, 207, 5, 105, 0, 0, 207, 208, 5, 110, 0, 0, 208, 209, 5, 103, 0, 0, 209, 210, 5, 91, 0, 0, 210, 211, 5, 93, 0, 0, 211, 212, 5, 32, 0, 0, 212, 213, 5, 97, 0, 0, 213, 214, 5, 114, 0, 0, 214, 215, 5, 103, 0, 0, 215, 216, 5, 115, 0, 0, 216, 217, 5, 41, 0, 0, 217, 16, 1, 0, 0, 0, 218, 222, 3, 31, 15, 0, 219, 222, 3, 35, 17, 0, 220, 222, 3, 33, 16, 0, 221, 218, 1, 0, 0, 0, 221, 219, 1, 0, 0, 0, 221, 220, 1, 0, 0, 0, 222, 18, 1, 0, 0, 0, 223, 226, 3, 27, 13, 0, 224, 226, 3, 29, 14, 0, 225, 223, 1, 0, 0, 0, 225, 224, 1, 0, 0, 0, 226, 20, 1, 0, 0, 0, 227, 234, 3, 37, 18, 0, 228, 234, 3, 39, 19, 0, 229, 234, 3, 41, 20, 0, 230, 234, 3, 43, 21, 0, 231, 234, 3, 45, 22, 0, 232, 234, 3, 47, 23, 0, 233, 227, 1, 0, 0, 0, 233, 228, 1, 0, 0, 0, 233, 229, 1, 0, 0, 0, 233, 230, 1, 0, 0, 0, 233, 231, 1, 0, 0, 0, 233, 232, 1, 0, 0, 0, 234, 22, 1, 0, 0, 0, 235, 238, 3, 51, 25, 0, 236, 238, 3, 53, 26, 0, 237, 235, 1, 0, 0, 0, 237, 236, 1, 0, 0, 0, 238, 24, 1, 0, 0, 0, 239, 240, 5, 61, 0, 0, 240, 26, 1, 0, 0, 0, 241, 242, 5, 43, 0, 0, 242, 28, 1, 0, 0, 0, 243, 244, 5, 45, 0, 0, 244, 30, 1, 0, 0, 0, 245, 246, 5, 42, 0, 0, 246, 32, 1, 0, 0, 0, 247, 248, 5, 37, 0, 0, 248, 34, 1, 0, 0, 0, 249, 250, 5, 47, 0, 0, 250, 36, 1, 0, 0, 0, 251, 252, 5, 62, 0, 0, 252, 38, 1, 0, 0, 0, 253, 254, 5, 60, 0, 0, 254, 40, 1, 0, 0, 0, 255, 256, 5, 62, 0, 0, 256, 257, 5, 61, 0, 0, 257, 42, 1, 0, 0, 0, 258, 259, 5, 60, 0, 0, 259, 260, 5, 61, 0, 0, 260, 44, 1, 0, 0, 0, 261, 262, 5, 61, 0, 0, 262, 263, 5, 61, 0, 0, 263, 46, 1, 0, 0, 0, 264, 265, 5, 33, 0, 0, 265, 266, 5, 61, 0, 0, 266, 48, 1, 0, 0, 0, 267, 268, 5, 33, 0, 0, 268, 50, 1, 0, 0, 0, 269, 270, 5, 38, 0, 0, 270, 271, 5, 38, 0, 0, 271, 52, 1, 0, 0, 0, 272, 273, 5, 124, 0, 0, 273, 274, 5, 124, 0, 0, 274, 54, 1, 0, 0, 0, 275, 276, 5, 46, 0, 0, 276, 56, 1, 0, 0, 0, 277, 278, 5, 40, 0, 0, 278, 58, 1, 0, 0, 0, 279, 280, 5, 41, 0, 0, 280, 60, 1, 0, 0, 0, 281, 282, 5, 123, 0, 0, 282, 62, 1, 0, 0, 0, 283, 284, 5, 125, 0, 0, 284, 64, 1, 0, 0, 0, 285, 286, 5, 59, 0, 0, 286, 66, 1, 0, 0, 0, 287, 288, 5, 44, 0, 0, 288, 68, 1, 0, 0, 0, 289, 290, 5, 99, 0, 0, 290, 291, 5, 108, 0, 0, 291, 292, 5, 97, 0, 0, 292, 293, 5, 115, 0, 0, 293, 294, 5, 115, 0, 0, 294, 70, 1, 0, 0, 0, 295, 296, 5, 116, 0, 0, 296, 297, 5, 104, 0, 0, 297, 298, 5, 105, 0, 0, 298, 299, 5, 115, 0, 0, 299, 72, 1, 0, 0, 0, 300, 301, 5, 119, 0, 0, 301, 302, 5, 104, 0, 0, 302, 303, 5, 105, 0, 0, 303, 304, 5, 108, 0, 0, 304, 305, 5, 101, 0, 0, 305, 74, 1, 0, 0, 0, 306, 307, 5, 100, 0, 0, 307, 308, 5, 111, 0, 0, 308, 76, 1, 0, 0, 0, 309, 310, 5, 105, 0, 0, 310, 311, 5, 102, 0, 0, 311, 78, 1, 0, 0, 0, 312, 313, 5, 101, 0, 0, 313, 314, 5, 108, 0, 0, 314, 315, 5, 115, 0, 0, 315, 316, 5, 101, 0, 0, 316, 80, 1, 0, 0, 0, 317, 318, 5, 102, 0, 0, 318, 319, 5, 111, 0, 0, 319, 320, 5, 114, 0, 0, 320, 82, 1, 0, 0, 0, 321, 322, 5, 114, 0, 0, 322, 323, 5, 101, 0, 0, 323, 324, 5, 116, 0, 0, 324, 325, 5, 117, 0, 0, 325, 326, 5, 114, 0, 0, 326, 327, 5, 110, 0, 0, 327, 84, 1, 0, 0, 0, 328, 329, 5, 110, 0, 0, 329, 330, 5, 101, 0, 0, 330, 331, 5, 119, 0, 0, 331, 86, 1, 0, 0, 0, 332, 336, 5, 39, 0, 0, 333, 335, 8, 0, 0, 0, 334, 333, 1, 0, 0, 0, 335, 338, 1, 0, 0, 0, 336, 334, 1, 0, 0, 0, 336, 337, 1, 0, 0, 0, 337, 339, 1, 0, 0, 0, 338, 336, 1, 0, 0, 0, 339, 340, 5, 39, 0, 0, 340, 88, 1, 0, 0, 0, 341, 343, 3, 29, 14, 0, 342, 341, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 345, 1, 0, 0, 0, 344, 346, 3, 97, 48, 0, 345, 344, 1, 0, 0, 0, 346, 347, 1, 0, 0, 0, 347, 345, 1, 0, 0, 0, 347, 348, 1, 0, 0, 0, 348, 90, 1, 0, 0, 0, 349, 350, 5, 116, 0, 0, 350, 351, 5, 114, 0, 0, 351, 352, 5, 117, 0, 0, 352, 359, 5, 101, 0, 0, 353, 354, 5, 102, 0, 0, 354, 355, 5, 97, 0, 0, 355, 356, 5, 108, 0, 0, 356, 357, 5, 115, 0, 0, 357, 359, 5, 101, 0, 0, 358, 349, 1, 0, 0, 0, 358, 353, 1, 0, 0, 0, 359, 92, 1, 0, 0, 0, 360, 361, 5, 110, 0, 0, 361, 362, 5, 117, 0, 0, 362, 363, 5, 108, 0, 0, 363, 364, 5, 108, 0, 0, 364, 94, 1, 0, 0, 0, 365, 366, 7, 1, 0, 0, 366, 96, 1, 0, 0, 0, 367, 368, 7, 2, 0, 0, 368, 98, 1, 0, 0, 0, 369, 373, 3, 95, 47, 0, 370, 373, 3, 97, 48, 0, 371, 373, 7, 3, 0, 0, 372, 369, 1, 0, 0, 0, 372, 370, 1, 0, 0, 0, 372, 371, 1, 0, 0, 0, 373, 100, 1, 0, 0, 0, 374, 378, 3, 95, 47, 0, 375, 377, 3, 99, 49, 0, 376, 375, 1, 0, 0, 0, 377, 380, 1, 0, 0, 0, 378, 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 102, 1, 0, 0, 0, 380, 378, 1, 0, 0, 0, 381, 383, 7, 4, 0, 0, 382, 381, 1, 0, 0, 0, 383, 384, 1, 0, 0, 0, 384, 382, 1, 0, 0, 0, 384, 385, 1, 0, 0, 0, 385, 386, 1, 0, 0, 0, 386, 387, 6, 51, 0, 0, 387, 104, 1, 0, 0, 0, 388, 389, 5, 47, 0, 0, 389, 390, 5, 47, 0, 0, 390, 394, 1, 0, 0, 0, 391, 393, 8, 0, 0, 0, 392, 391, 1, 0, 0, 0, 393, 396, 1, 0, 0, 0, 394, 392, 1, 0, 0, 0, 394, 395, 1, 0, 0, 0, 395, 397, 1, 0, 0, 0, 396, 394, 1, 0, 0, 0, 397, 398, 6, 52, 0, 0, 398, 106, 1, 0, 0, 0, 399, 400, 5, 47, 0, 0, 400, 401, 5, 42, 0, 0, 401, 405, 1, 0, 0, 0, 402, 404, 9, 0, 0, 0, 403, 402, 1, 0, 0, 0, 404, 407, 1, 0, 0, 0, 405, 406, 1, 0, 0, 0, 405, 403, 1, 0, 0, 0, 406, 408, 1, 0, 0, 0, 407, 405, 1, 0, 0, 0, 408, 409, 5, 42, 0, 0, 409, 410, 5, 47, 0, 0, 410, 411, 1, 0, 0, 0, 411, 412, 6, 53, 0, 0, 412, 108, 1, 0, 0, 0, 15, 0, 177, 221, 225, 233, 237, 336, 342, 347, 358, 372, 378, 384, 394, 405, 1, 6, 0, 0] \ No newline at end of file diff --git a/src/main/java/parser/generated/SimpleJavaLexer.java b/src/main/java/parser/generated/SimpleJavaLexer.java new file mode 100644 index 0000000..23296ee --- /dev/null +++ b/src/main/java/parser/generated/SimpleJavaLexer.java @@ -0,0 +1,397 @@ +// Generated from C:/Users/janni/Desktop/NichtHaskell2.0/src/main/java/parser/grammar/SimpleJava.g4 by ANTLR 4.13.1 +package parser.generated; +import org.antlr.v4.runtime.Lexer; +import org.antlr.v4.runtime.CharStream; +import org.antlr.v4.runtime.Token; +import org.antlr.v4.runtime.TokenStream; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.misc.*; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue", "this-escape"}) +public class SimpleJavaLexer extends Lexer { + static { RuntimeMetaData.checkVersion("4.13.1", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + T__0=1, T__1=2, Void=3, Boolean=4, Char=5, Int=6, AccessModifier=7, MainMethodDeclaration=8, + DotOperator=9, LineOperator=10, ComparisonOperator=11, LogicalOperator=12, + Assign=13, Plus=14, Minus=15, Mult=16, Modulo=17, Div=18, Greater=19, + Less=20, GreaterEqual=21, LessEqual=22, Equal=23, NotEqual=24, Not=25, + And=26, Or=27, Dot=28, OpenRoundBracket=29, ClosedRoundBracket=30, OpenCurlyBracket=31, + ClosedCurlyBracket=32, Semicolon=33, Comma=34, Class=35, This=36, While=37, + Do=38, If=39, Else=40, For=41, Return=42, New=43, CharValue=44, IntValue=45, + BooleanValue=46, NullValue=47, Identifier=48, WS=49, InlineComment=50, + MultilineComment=51; + public static String[] channelNames = { + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" + }; + + public static String[] modeNames = { + "DEFAULT_MODE" + }; + + private static String[] makeRuleNames() { + return new String[] { + "T__0", "T__1", "Void", "Boolean", "Char", "Int", "AccessModifier", "MainMethodDeclaration", + "DotOperator", "LineOperator", "ComparisonOperator", "LogicalOperator", + "Assign", "Plus", "Minus", "Mult", "Modulo", "Div", "Greater", "Less", + "GreaterEqual", "LessEqual", "Equal", "NotEqual", "Not", "And", "Or", + "Dot", "OpenRoundBracket", "ClosedRoundBracket", "OpenCurlyBracket", + "ClosedCurlyBracket", "Semicolon", "Comma", "Class", "This", "While", + "Do", "If", "Else", "For", "Return", "New", "CharValue", "IntValue", + "BooleanValue", "NullValue", "Alphabetic", "Numeric", "ValidIdentSymbols", + "Identifier", "WS", "InlineComment", "MultilineComment" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, "'++'", "'--'", "'void'", "'boolean'", "'char'", "'int'", null, + "'public static void main(String[] args)'", null, null, null, null, "'='", + "'+'", "'-'", "'*'", "'%'", "'/'", "'>'", "'<'", "'>='", "'<='", "'=='", + "'!='", "'!'", "'&&'", "'||'", "'.'", "'('", "')'", "'{'", "'}'", "';'", + "','", "'class'", "'this'", "'while'", "'do'", "'if'", "'else'", "'for'", + "'return'", "'new'", null, null, null, "'null'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, null, null, "Void", "Boolean", "Char", "Int", "AccessModifier", + "MainMethodDeclaration", "DotOperator", "LineOperator", "ComparisonOperator", + "LogicalOperator", "Assign", "Plus", "Minus", "Mult", "Modulo", "Div", + "Greater", "Less", "GreaterEqual", "LessEqual", "Equal", "NotEqual", + "Not", "And", "Or", "Dot", "OpenRoundBracket", "ClosedRoundBracket", + "OpenCurlyBracket", "ClosedCurlyBracket", "Semicolon", "Comma", "Class", + "This", "While", "Do", "If", "Else", "For", "Return", "New", "CharValue", + "IntValue", "BooleanValue", "NullValue", "Identifier", "WS", "InlineComment", + "MultilineComment" + }; + } + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + + public SimpleJavaLexer(CharStream input) { + super(input); + _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + @Override + public String getGrammarFileName() { return "SimpleJava.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public String[] getChannelNames() { return channelNames; } + + @Override + public String[] getModeNames() { return modeNames; } + + @Override + public ATN getATN() { return _ATN; } + + public static final String _serializedATN = + "\u0004\u00003\u019d\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002\u0001"+ + "\u0007\u0001\u0002\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004"+ + "\u0007\u0004\u0002\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007"+ + "\u0007\u0007\u0002\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b"+ + "\u0007\u000b\u0002\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0002"+ + "\u000f\u0007\u000f\u0002\u0010\u0007\u0010\u0002\u0011\u0007\u0011\u0002"+ + "\u0012\u0007\u0012\u0002\u0013\u0007\u0013\u0002\u0014\u0007\u0014\u0002"+ + "\u0015\u0007\u0015\u0002\u0016\u0007\u0016\u0002\u0017\u0007\u0017\u0002"+ + "\u0018\u0007\u0018\u0002\u0019\u0007\u0019\u0002\u001a\u0007\u001a\u0002"+ + "\u001b\u0007\u001b\u0002\u001c\u0007\u001c\u0002\u001d\u0007\u001d\u0002"+ + "\u001e\u0007\u001e\u0002\u001f\u0007\u001f\u0002 \u0007 \u0002!\u0007"+ + "!\u0002\"\u0007\"\u0002#\u0007#\u0002$\u0007$\u0002%\u0007%\u0002&\u0007"+ + "&\u0002\'\u0007\'\u0002(\u0007(\u0002)\u0007)\u0002*\u0007*\u0002+\u0007"+ + "+\u0002,\u0007,\u0002-\u0007-\u0002.\u0007.\u0002/\u0007/\u00020\u0007"+ + "0\u00021\u00071\u00022\u00072\u00023\u00073\u00024\u00074\u00025\u0007"+ + "5\u0001\u0000\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001\u0001\u0001"+ + "\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0003"+ + "\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003"+ + "\u0001\u0003\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004"+ + "\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0006\u0001\u0006"+ + "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+ + "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+ + "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+ + "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+ + "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+ + "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+ + "\u0001\u0006\u0001\u0006\u0003\u0006\u00b2\b\u0006\u0001\u0007\u0001\u0007"+ + "\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007"+ + "\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007"+ + "\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007"+ + "\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007"+ + "\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007"+ + "\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007"+ + "\u0001\u0007\u0001\b\u0001\b\u0001\b\u0003\b\u00de\b\b\u0001\t\u0001\t"+ + "\u0003\t\u00e2\b\t\u0001\n\u0001\n\u0001\n\u0001\n\u0001\n\u0001\n\u0003"+ + "\n\u00ea\b\n\u0001\u000b\u0001\u000b\u0003\u000b\u00ee\b\u000b\u0001\f"+ + "\u0001\f\u0001\r\u0001\r\u0001\u000e\u0001\u000e\u0001\u000f\u0001\u000f"+ + "\u0001\u0010\u0001\u0010\u0001\u0011\u0001\u0011\u0001\u0012\u0001\u0012"+ + "\u0001\u0013\u0001\u0013\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0015"+ + "\u0001\u0015\u0001\u0015\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0017"+ + "\u0001\u0017\u0001\u0017\u0001\u0018\u0001\u0018\u0001\u0019\u0001\u0019"+ + "\u0001\u0019\u0001\u001a\u0001\u001a\u0001\u001a\u0001\u001b\u0001\u001b"+ + "\u0001\u001c\u0001\u001c\u0001\u001d\u0001\u001d\u0001\u001e\u0001\u001e"+ + "\u0001\u001f\u0001\u001f\u0001 \u0001 \u0001!\u0001!\u0001\"\u0001\"\u0001"+ + "\"\u0001\"\u0001\"\u0001\"\u0001#\u0001#\u0001#\u0001#\u0001#\u0001$\u0001"+ + "$\u0001$\u0001$\u0001$\u0001$\u0001%\u0001%\u0001%\u0001&\u0001&\u0001"+ + "&\u0001\'\u0001\'\u0001\'\u0001\'\u0001\'\u0001(\u0001(\u0001(\u0001("+ + "\u0001)\u0001)\u0001)\u0001)\u0001)\u0001)\u0001)\u0001*\u0001*\u0001"+ + "*\u0001*\u0001+\u0001+\u0005+\u014f\b+\n+\f+\u0152\t+\u0001+\u0001+\u0001"+ + ",\u0003,\u0157\b,\u0001,\u0004,\u015a\b,\u000b,\f,\u015b\u0001-\u0001"+ + "-\u0001-\u0001-\u0001-\u0001-\u0001-\u0001-\u0001-\u0003-\u0167\b-\u0001"+ + ".\u0001.\u0001.\u0001.\u0001.\u0001/\u0001/\u00010\u00010\u00011\u0001"+ + "1\u00011\u00031\u0175\b1\u00012\u00012\u00052\u0179\b2\n2\f2\u017c\t2"+ + "\u00013\u00043\u017f\b3\u000b3\f3\u0180\u00013\u00013\u00014\u00014\u0001"+ + "4\u00014\u00054\u0189\b4\n4\f4\u018c\t4\u00014\u00014\u00015\u00015\u0001"+ + "5\u00015\u00055\u0194\b5\n5\f5\u0197\t5\u00015\u00015\u00015\u00015\u0001"+ + "5\u0001\u0195\u00006\u0001\u0001\u0003\u0002\u0005\u0003\u0007\u0004\t"+ + "\u0005\u000b\u0006\r\u0007\u000f\b\u0011\t\u0013\n\u0015\u000b\u0017\f"+ + "\u0019\r\u001b\u000e\u001d\u000f\u001f\u0010!\u0011#\u0012%\u0013\'\u0014"+ + ")\u0015+\u0016-\u0017/\u00181\u00193\u001a5\u001b7\u001c9\u001d;\u001e"+ + "=\u001f? A!C\"E#G$I%K&M\'O(Q)S*U+W,Y-[.]/_\u0000a\u0000c\u0000e0g1i2k"+ + "3\u0001\u0000\u0005\u0002\u0000\n\n\r\r\u0002\u0000AZaz\u0001\u000009"+ + "\u0002\u0000$$__\u0003\u0000\t\n\r\r \u01af\u0000\u0001\u0001\u0000\u0000"+ + "\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0005\u0001\u0000\u0000"+ + "\u0000\u0000\u0007\u0001\u0000\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000"+ + "\u0000\u000b\u0001\u0000\u0000\u0000\u0000\r\u0001\u0000\u0000\u0000\u0000"+ + "\u000f\u0001\u0000\u0000\u0000\u0000\u0011\u0001\u0000\u0000\u0000\u0000"+ + "\u0013\u0001\u0000\u0000\u0000\u0000\u0015\u0001\u0000\u0000\u0000\u0000"+ + "\u0017\u0001\u0000\u0000\u0000\u0000\u0019\u0001\u0000\u0000\u0000\u0000"+ + "\u001b\u0001\u0000\u0000\u0000\u0000\u001d\u0001\u0000\u0000\u0000\u0000"+ + "\u001f\u0001\u0000\u0000\u0000\u0000!\u0001\u0000\u0000\u0000\u0000#\u0001"+ + "\u0000\u0000\u0000\u0000%\u0001\u0000\u0000\u0000\u0000\'\u0001\u0000"+ + "\u0000\u0000\u0000)\u0001\u0000\u0000\u0000\u0000+\u0001\u0000\u0000\u0000"+ + "\u0000-\u0001\u0000\u0000\u0000\u0000/\u0001\u0000\u0000\u0000\u00001"+ + "\u0001\u0000\u0000\u0000\u00003\u0001\u0000\u0000\u0000\u00005\u0001\u0000"+ + "\u0000\u0000\u00007\u0001\u0000\u0000\u0000\u00009\u0001\u0000\u0000\u0000"+ + "\u0000;\u0001\u0000\u0000\u0000\u0000=\u0001\u0000\u0000\u0000\u0000?"+ + "\u0001\u0000\u0000\u0000\u0000A\u0001\u0000\u0000\u0000\u0000C\u0001\u0000"+ + "\u0000\u0000\u0000E\u0001\u0000\u0000\u0000\u0000G\u0001\u0000\u0000\u0000"+ + "\u0000I\u0001\u0000\u0000\u0000\u0000K\u0001\u0000\u0000\u0000\u0000M"+ + "\u0001\u0000\u0000\u0000\u0000O\u0001\u0000\u0000\u0000\u0000Q\u0001\u0000"+ + "\u0000\u0000\u0000S\u0001\u0000\u0000\u0000\u0000U\u0001\u0000\u0000\u0000"+ + "\u0000W\u0001\u0000\u0000\u0000\u0000Y\u0001\u0000\u0000\u0000\u0000["+ + "\u0001\u0000\u0000\u0000\u0000]\u0001\u0000\u0000\u0000\u0000e\u0001\u0000"+ + "\u0000\u0000\u0000g\u0001\u0000\u0000\u0000\u0000i\u0001\u0000\u0000\u0000"+ + "\u0000k\u0001\u0000\u0000\u0000\u0001m\u0001\u0000\u0000\u0000\u0003p"+ + "\u0001\u0000\u0000\u0000\u0005s\u0001\u0000\u0000\u0000\u0007x\u0001\u0000"+ + "\u0000\u0000\t\u0080\u0001\u0000\u0000\u0000\u000b\u0085\u0001\u0000\u0000"+ + "\u0000\r\u00b1\u0001\u0000\u0000\u0000\u000f\u00b3\u0001\u0000\u0000\u0000"+ + "\u0011\u00dd\u0001\u0000\u0000\u0000\u0013\u00e1\u0001\u0000\u0000\u0000"+ + "\u0015\u00e9\u0001\u0000\u0000\u0000\u0017\u00ed\u0001\u0000\u0000\u0000"+ + "\u0019\u00ef\u0001\u0000\u0000\u0000\u001b\u00f1\u0001\u0000\u0000\u0000"+ + "\u001d\u00f3\u0001\u0000\u0000\u0000\u001f\u00f5\u0001\u0000\u0000\u0000"+ + "!\u00f7\u0001\u0000\u0000\u0000#\u00f9\u0001\u0000\u0000\u0000%\u00fb"+ + "\u0001\u0000\u0000\u0000\'\u00fd\u0001\u0000\u0000\u0000)\u00ff\u0001"+ + "\u0000\u0000\u0000+\u0102\u0001\u0000\u0000\u0000-\u0105\u0001\u0000\u0000"+ + "\u0000/\u0108\u0001\u0000\u0000\u00001\u010b\u0001\u0000\u0000\u00003"+ + "\u010d\u0001\u0000\u0000\u00005\u0110\u0001\u0000\u0000\u00007\u0113\u0001"+ + "\u0000\u0000\u00009\u0115\u0001\u0000\u0000\u0000;\u0117\u0001\u0000\u0000"+ + "\u0000=\u0119\u0001\u0000\u0000\u0000?\u011b\u0001\u0000\u0000\u0000A"+ + "\u011d\u0001\u0000\u0000\u0000C\u011f\u0001\u0000\u0000\u0000E\u0121\u0001"+ + "\u0000\u0000\u0000G\u0127\u0001\u0000\u0000\u0000I\u012c\u0001\u0000\u0000"+ + "\u0000K\u0132\u0001\u0000\u0000\u0000M\u0135\u0001\u0000\u0000\u0000O"+ + "\u0138\u0001\u0000\u0000\u0000Q\u013d\u0001\u0000\u0000\u0000S\u0141\u0001"+ + "\u0000\u0000\u0000U\u0148\u0001\u0000\u0000\u0000W\u014c\u0001\u0000\u0000"+ + "\u0000Y\u0156\u0001\u0000\u0000\u0000[\u0166\u0001\u0000\u0000\u0000]"+ + "\u0168\u0001\u0000\u0000\u0000_\u016d\u0001\u0000\u0000\u0000a\u016f\u0001"+ + "\u0000\u0000\u0000c\u0174\u0001\u0000\u0000\u0000e\u0176\u0001\u0000\u0000"+ + "\u0000g\u017e\u0001\u0000\u0000\u0000i\u0184\u0001\u0000\u0000\u0000k"+ + "\u018f\u0001\u0000\u0000\u0000mn\u0005+\u0000\u0000no\u0005+\u0000\u0000"+ + "o\u0002\u0001\u0000\u0000\u0000pq\u0005-\u0000\u0000qr\u0005-\u0000\u0000"+ + "r\u0004\u0001\u0000\u0000\u0000st\u0005v\u0000\u0000tu\u0005o\u0000\u0000"+ + "uv\u0005i\u0000\u0000vw\u0005d\u0000\u0000w\u0006\u0001\u0000\u0000\u0000"+ + "xy\u0005b\u0000\u0000yz\u0005o\u0000\u0000z{\u0005o\u0000\u0000{|\u0005"+ + "l\u0000\u0000|}\u0005e\u0000\u0000}~\u0005a\u0000\u0000~\u007f\u0005n"+ + "\u0000\u0000\u007f\b\u0001\u0000\u0000\u0000\u0080\u0081\u0005c\u0000"+ + "\u0000\u0081\u0082\u0005h\u0000\u0000\u0082\u0083\u0005a\u0000\u0000\u0083"+ + "\u0084\u0005r\u0000\u0000\u0084\n\u0001\u0000\u0000\u0000\u0085\u0086"+ + "\u0005i\u0000\u0000\u0086\u0087\u0005n\u0000\u0000\u0087\u0088\u0005t"+ + "\u0000\u0000\u0088\f\u0001\u0000\u0000\u0000\u0089\u008a\u0005p\u0000"+ + "\u0000\u008a\u008b\u0005u\u0000\u0000\u008b\u008c\u0005b\u0000\u0000\u008c"+ + "\u008d\u0005l\u0000\u0000\u008d\u008e\u0005i\u0000\u0000\u008e\u00b2\u0005"+ + "c\u0000\u0000\u008f\u0090\u0005p\u0000\u0000\u0090\u0091\u0005r\u0000"+ + "\u0000\u0091\u0092\u0005i\u0000\u0000\u0092\u0093\u0005v\u0000\u0000\u0093"+ + "\u0094\u0005a\u0000\u0000\u0094\u0095\u0005t\u0000\u0000\u0095\u00b2\u0005"+ + "e\u0000\u0000\u0096\u0097\u0005p\u0000\u0000\u0097\u0098\u0005u\u0000"+ + "\u0000\u0098\u0099\u0005b\u0000\u0000\u0099\u009a\u0005l\u0000\u0000\u009a"+ + "\u009b\u0005i\u0000\u0000\u009b\u009c\u0005c\u0000\u0000\u009c\u009d\u0005"+ + " \u0000\u0000\u009d\u009e\u0005s\u0000\u0000\u009e\u009f\u0005t\u0000"+ + "\u0000\u009f\u00a0\u0005a\u0000\u0000\u00a0\u00a1\u0005t\u0000\u0000\u00a1"+ + "\u00a2\u0005i\u0000\u0000\u00a2\u00b2\u0005c\u0000\u0000\u00a3\u00a4\u0005"+ + "p\u0000\u0000\u00a4\u00a5\u0005r\u0000\u0000\u00a5\u00a6\u0005i\u0000"+ + "\u0000\u00a6\u00a7\u0005v\u0000\u0000\u00a7\u00a8\u0005a\u0000\u0000\u00a8"+ + "\u00a9\u0005t\u0000\u0000\u00a9\u00aa\u0005e\u0000\u0000\u00aa\u00ab\u0005"+ + " \u0000\u0000\u00ab\u00ac\u0005s\u0000\u0000\u00ac\u00ad\u0005t\u0000"+ + "\u0000\u00ad\u00ae\u0005a\u0000\u0000\u00ae\u00af\u0005t\u0000\u0000\u00af"+ + "\u00b0\u0005i\u0000\u0000\u00b0\u00b2\u0005c\u0000\u0000\u00b1\u0089\u0001"+ + "\u0000\u0000\u0000\u00b1\u008f\u0001\u0000\u0000\u0000\u00b1\u0096\u0001"+ + "\u0000\u0000\u0000\u00b1\u00a3\u0001\u0000\u0000\u0000\u00b2\u000e\u0001"+ + "\u0000\u0000\u0000\u00b3\u00b4\u0005p\u0000\u0000\u00b4\u00b5\u0005u\u0000"+ + "\u0000\u00b5\u00b6\u0005b\u0000\u0000\u00b6\u00b7\u0005l\u0000\u0000\u00b7"+ + "\u00b8\u0005i\u0000\u0000\u00b8\u00b9\u0005c\u0000\u0000\u00b9\u00ba\u0005"+ + " \u0000\u0000\u00ba\u00bb\u0005s\u0000\u0000\u00bb\u00bc\u0005t\u0000"+ + "\u0000\u00bc\u00bd\u0005a\u0000\u0000\u00bd\u00be\u0005t\u0000\u0000\u00be"+ + "\u00bf\u0005i\u0000\u0000\u00bf\u00c0\u0005c\u0000\u0000\u00c0\u00c1\u0005"+ + " \u0000\u0000\u00c1\u00c2\u0005v\u0000\u0000\u00c2\u00c3\u0005o\u0000"+ + "\u0000\u00c3\u00c4\u0005i\u0000\u0000\u00c4\u00c5\u0005d\u0000\u0000\u00c5"+ + "\u00c6\u0005 \u0000\u0000\u00c6\u00c7\u0005m\u0000\u0000\u00c7\u00c8\u0005"+ + "a\u0000\u0000\u00c8\u00c9\u0005i\u0000\u0000\u00c9\u00ca\u0005n\u0000"+ + "\u0000\u00ca\u00cb\u0005(\u0000\u0000\u00cb\u00cc\u0005S\u0000\u0000\u00cc"+ + "\u00cd\u0005t\u0000\u0000\u00cd\u00ce\u0005r\u0000\u0000\u00ce\u00cf\u0005"+ + "i\u0000\u0000\u00cf\u00d0\u0005n\u0000\u0000\u00d0\u00d1\u0005g\u0000"+ + "\u0000\u00d1\u00d2\u0005[\u0000\u0000\u00d2\u00d3\u0005]\u0000\u0000\u00d3"+ + "\u00d4\u0005 \u0000\u0000\u00d4\u00d5\u0005a\u0000\u0000\u00d5\u00d6\u0005"+ + "r\u0000\u0000\u00d6\u00d7\u0005g\u0000\u0000\u00d7\u00d8\u0005s\u0000"+ + "\u0000\u00d8\u00d9\u0005)\u0000\u0000\u00d9\u0010\u0001\u0000\u0000\u0000"+ + "\u00da\u00de\u0003\u001f\u000f\u0000\u00db\u00de\u0003#\u0011\u0000\u00dc"+ + "\u00de\u0003!\u0010\u0000\u00dd\u00da\u0001\u0000\u0000\u0000\u00dd\u00db"+ + "\u0001\u0000\u0000\u0000\u00dd\u00dc\u0001\u0000\u0000\u0000\u00de\u0012"+ + "\u0001\u0000\u0000\u0000\u00df\u00e2\u0003\u001b\r\u0000\u00e0\u00e2\u0003"+ + "\u001d\u000e\u0000\u00e1\u00df\u0001\u0000\u0000\u0000\u00e1\u00e0\u0001"+ + "\u0000\u0000\u0000\u00e2\u0014\u0001\u0000\u0000\u0000\u00e3\u00ea\u0003"+ + "%\u0012\u0000\u00e4\u00ea\u0003\'\u0013\u0000\u00e5\u00ea\u0003)\u0014"+ + "\u0000\u00e6\u00ea\u0003+\u0015\u0000\u00e7\u00ea\u0003-\u0016\u0000\u00e8"+ + "\u00ea\u0003/\u0017\u0000\u00e9\u00e3\u0001\u0000\u0000\u0000\u00e9\u00e4"+ + "\u0001\u0000\u0000\u0000\u00e9\u00e5\u0001\u0000\u0000\u0000\u00e9\u00e6"+ + "\u0001\u0000\u0000\u0000\u00e9\u00e7\u0001\u0000\u0000\u0000\u00e9\u00e8"+ + "\u0001\u0000\u0000\u0000\u00ea\u0016\u0001\u0000\u0000\u0000\u00eb\u00ee"+ + "\u00033\u0019\u0000\u00ec\u00ee\u00035\u001a\u0000\u00ed\u00eb\u0001\u0000"+ + "\u0000\u0000\u00ed\u00ec\u0001\u0000\u0000\u0000\u00ee\u0018\u0001\u0000"+ + "\u0000\u0000\u00ef\u00f0\u0005=\u0000\u0000\u00f0\u001a\u0001\u0000\u0000"+ + "\u0000\u00f1\u00f2\u0005+\u0000\u0000\u00f2\u001c\u0001\u0000\u0000\u0000"+ + "\u00f3\u00f4\u0005-\u0000\u0000\u00f4\u001e\u0001\u0000\u0000\u0000\u00f5"+ + "\u00f6\u0005*\u0000\u0000\u00f6 \u0001\u0000\u0000\u0000\u00f7\u00f8\u0005"+ + "%\u0000\u0000\u00f8\"\u0001\u0000\u0000\u0000\u00f9\u00fa\u0005/\u0000"+ + "\u0000\u00fa$\u0001\u0000\u0000\u0000\u00fb\u00fc\u0005>\u0000\u0000\u00fc"+ + "&\u0001\u0000\u0000\u0000\u00fd\u00fe\u0005<\u0000\u0000\u00fe(\u0001"+ + "\u0000\u0000\u0000\u00ff\u0100\u0005>\u0000\u0000\u0100\u0101\u0005=\u0000"+ + "\u0000\u0101*\u0001\u0000\u0000\u0000\u0102\u0103\u0005<\u0000\u0000\u0103"+ + "\u0104\u0005=\u0000\u0000\u0104,\u0001\u0000\u0000\u0000\u0105\u0106\u0005"+ + "=\u0000\u0000\u0106\u0107\u0005=\u0000\u0000\u0107.\u0001\u0000\u0000"+ + "\u0000\u0108\u0109\u0005!\u0000\u0000\u0109\u010a\u0005=\u0000\u0000\u010a"+ + "0\u0001\u0000\u0000\u0000\u010b\u010c\u0005!\u0000\u0000\u010c2\u0001"+ + "\u0000\u0000\u0000\u010d\u010e\u0005&\u0000\u0000\u010e\u010f\u0005&\u0000"+ + "\u0000\u010f4\u0001\u0000\u0000\u0000\u0110\u0111\u0005|\u0000\u0000\u0111"+ + "\u0112\u0005|\u0000\u0000\u01126\u0001\u0000\u0000\u0000\u0113\u0114\u0005"+ + ".\u0000\u0000\u01148\u0001\u0000\u0000\u0000\u0115\u0116\u0005(\u0000"+ + "\u0000\u0116:\u0001\u0000\u0000\u0000\u0117\u0118\u0005)\u0000\u0000\u0118"+ + "<\u0001\u0000\u0000\u0000\u0119\u011a\u0005{\u0000\u0000\u011a>\u0001"+ + "\u0000\u0000\u0000\u011b\u011c\u0005}\u0000\u0000\u011c@\u0001\u0000\u0000"+ + "\u0000\u011d\u011e\u0005;\u0000\u0000\u011eB\u0001\u0000\u0000\u0000\u011f"+ + "\u0120\u0005,\u0000\u0000\u0120D\u0001\u0000\u0000\u0000\u0121\u0122\u0005"+ + "c\u0000\u0000\u0122\u0123\u0005l\u0000\u0000\u0123\u0124\u0005a\u0000"+ + "\u0000\u0124\u0125\u0005s\u0000\u0000\u0125\u0126\u0005s\u0000\u0000\u0126"+ + "F\u0001\u0000\u0000\u0000\u0127\u0128\u0005t\u0000\u0000\u0128\u0129\u0005"+ + "h\u0000\u0000\u0129\u012a\u0005i\u0000\u0000\u012a\u012b\u0005s\u0000"+ + "\u0000\u012bH\u0001\u0000\u0000\u0000\u012c\u012d\u0005w\u0000\u0000\u012d"+ + "\u012e\u0005h\u0000\u0000\u012e\u012f\u0005i\u0000\u0000\u012f\u0130\u0005"+ + "l\u0000\u0000\u0130\u0131\u0005e\u0000\u0000\u0131J\u0001\u0000\u0000"+ + "\u0000\u0132\u0133\u0005d\u0000\u0000\u0133\u0134\u0005o\u0000\u0000\u0134"+ + "L\u0001\u0000\u0000\u0000\u0135\u0136\u0005i\u0000\u0000\u0136\u0137\u0005"+ + "f\u0000\u0000\u0137N\u0001\u0000\u0000\u0000\u0138\u0139\u0005e\u0000"+ + "\u0000\u0139\u013a\u0005l\u0000\u0000\u013a\u013b\u0005s\u0000\u0000\u013b"+ + "\u013c\u0005e\u0000\u0000\u013cP\u0001\u0000\u0000\u0000\u013d\u013e\u0005"+ + "f\u0000\u0000\u013e\u013f\u0005o\u0000\u0000\u013f\u0140\u0005r\u0000"+ + "\u0000\u0140R\u0001\u0000\u0000\u0000\u0141\u0142\u0005r\u0000\u0000\u0142"+ + "\u0143\u0005e\u0000\u0000\u0143\u0144\u0005t\u0000\u0000\u0144\u0145\u0005"+ + "u\u0000\u0000\u0145\u0146\u0005r\u0000\u0000\u0146\u0147\u0005n\u0000"+ + "\u0000\u0147T\u0001\u0000\u0000\u0000\u0148\u0149\u0005n\u0000\u0000\u0149"+ + "\u014a\u0005e\u0000\u0000\u014a\u014b\u0005w\u0000\u0000\u014bV\u0001"+ + "\u0000\u0000\u0000\u014c\u0150\u0005\'\u0000\u0000\u014d\u014f\b\u0000"+ + "\u0000\u0000\u014e\u014d\u0001\u0000\u0000\u0000\u014f\u0152\u0001\u0000"+ + "\u0000\u0000\u0150\u014e\u0001\u0000\u0000\u0000\u0150\u0151\u0001\u0000"+ + "\u0000\u0000\u0151\u0153\u0001\u0000\u0000\u0000\u0152\u0150\u0001\u0000"+ + "\u0000\u0000\u0153\u0154\u0005\'\u0000\u0000\u0154X\u0001\u0000\u0000"+ + "\u0000\u0155\u0157\u0003\u001d\u000e\u0000\u0156\u0155\u0001\u0000\u0000"+ + "\u0000\u0156\u0157\u0001\u0000\u0000\u0000\u0157\u0159\u0001\u0000\u0000"+ + "\u0000\u0158\u015a\u0003a0\u0000\u0159\u0158\u0001\u0000\u0000\u0000\u015a"+ + "\u015b\u0001\u0000\u0000\u0000\u015b\u0159\u0001\u0000\u0000\u0000\u015b"+ + "\u015c\u0001\u0000\u0000\u0000\u015cZ\u0001\u0000\u0000\u0000\u015d\u015e"+ + "\u0005t\u0000\u0000\u015e\u015f\u0005r\u0000\u0000\u015f\u0160\u0005u"+ + "\u0000\u0000\u0160\u0167\u0005e\u0000\u0000\u0161\u0162\u0005f\u0000\u0000"+ + "\u0162\u0163\u0005a\u0000\u0000\u0163\u0164\u0005l\u0000\u0000\u0164\u0165"+ + "\u0005s\u0000\u0000\u0165\u0167\u0005e\u0000\u0000\u0166\u015d\u0001\u0000"+ + "\u0000\u0000\u0166\u0161\u0001\u0000\u0000\u0000\u0167\\\u0001\u0000\u0000"+ + "\u0000\u0168\u0169\u0005n\u0000\u0000\u0169\u016a\u0005u\u0000\u0000\u016a"+ + "\u016b\u0005l\u0000\u0000\u016b\u016c\u0005l\u0000\u0000\u016c^\u0001"+ + "\u0000\u0000\u0000\u016d\u016e\u0007\u0001\u0000\u0000\u016e`\u0001\u0000"+ + "\u0000\u0000\u016f\u0170\u0007\u0002\u0000\u0000\u0170b\u0001\u0000\u0000"+ + "\u0000\u0171\u0175\u0003_/\u0000\u0172\u0175\u0003a0\u0000\u0173\u0175"+ + "\u0007\u0003\u0000\u0000\u0174\u0171\u0001\u0000\u0000\u0000\u0174\u0172"+ + "\u0001\u0000\u0000\u0000\u0174\u0173\u0001\u0000\u0000\u0000\u0175d\u0001"+ + "\u0000\u0000\u0000\u0176\u017a\u0003_/\u0000\u0177\u0179\u0003c1\u0000"+ + "\u0178\u0177\u0001\u0000\u0000\u0000\u0179\u017c\u0001\u0000\u0000\u0000"+ + "\u017a\u0178\u0001\u0000\u0000\u0000\u017a\u017b\u0001\u0000\u0000\u0000"+ + "\u017bf\u0001\u0000\u0000\u0000\u017c\u017a\u0001\u0000\u0000\u0000\u017d"+ + "\u017f\u0007\u0004\u0000\u0000\u017e\u017d\u0001\u0000\u0000\u0000\u017f"+ + "\u0180\u0001\u0000\u0000\u0000\u0180\u017e\u0001\u0000\u0000\u0000\u0180"+ + "\u0181\u0001\u0000\u0000\u0000\u0181\u0182\u0001\u0000\u0000\u0000\u0182"+ + "\u0183\u00063\u0000\u0000\u0183h\u0001\u0000\u0000\u0000\u0184\u0185\u0005"+ + "/\u0000\u0000\u0185\u0186\u0005/\u0000\u0000\u0186\u018a\u0001\u0000\u0000"+ + "\u0000\u0187\u0189\b\u0000\u0000\u0000\u0188\u0187\u0001\u0000\u0000\u0000"+ + "\u0189\u018c\u0001\u0000\u0000\u0000\u018a\u0188\u0001\u0000\u0000\u0000"+ + "\u018a\u018b\u0001\u0000\u0000\u0000\u018b\u018d\u0001\u0000\u0000\u0000"+ + "\u018c\u018a\u0001\u0000\u0000\u0000\u018d\u018e\u00064\u0000\u0000\u018e"+ + "j\u0001\u0000\u0000\u0000\u018f\u0190\u0005/\u0000\u0000\u0190\u0191\u0005"+ + "*\u0000\u0000\u0191\u0195\u0001\u0000\u0000\u0000\u0192\u0194\t\u0000"+ + "\u0000\u0000\u0193\u0192\u0001\u0000\u0000\u0000\u0194\u0197\u0001\u0000"+ + "\u0000\u0000\u0195\u0196\u0001\u0000\u0000\u0000\u0195\u0193\u0001\u0000"+ + "\u0000\u0000\u0196\u0198\u0001\u0000\u0000\u0000\u0197\u0195\u0001\u0000"+ + "\u0000\u0000\u0198\u0199\u0005*\u0000\u0000\u0199\u019a\u0005/\u0000\u0000"+ + "\u019a\u019b\u0001\u0000\u0000\u0000\u019b\u019c\u00065\u0000\u0000\u019c"+ + "l\u0001\u0000\u0000\u0000\u000f\u0000\u00b1\u00dd\u00e1\u00e9\u00ed\u0150"+ + "\u0156\u015b\u0166\u0174\u017a\u0180\u018a\u0195\u0001\u0006\u0000\u0000"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/src/main/java/parser/generated/SimpleJavaLexer.tokens b/src/main/java/parser/generated/SimpleJavaLexer.tokens new file mode 100644 index 0000000..71246c8 --- /dev/null +++ b/src/main/java/parser/generated/SimpleJavaLexer.tokens @@ -0,0 +1,90 @@ +T__0=1 +T__1=2 +Void=3 +Boolean=4 +Char=5 +Int=6 +AccessModifier=7 +MainMethodDeclaration=8 +DotOperator=9 +LineOperator=10 +ComparisonOperator=11 +LogicalOperator=12 +Assign=13 +Plus=14 +Minus=15 +Mult=16 +Modulo=17 +Div=18 +Greater=19 +Less=20 +GreaterEqual=21 +LessEqual=22 +Equal=23 +NotEqual=24 +Not=25 +And=26 +Or=27 +Dot=28 +OpenRoundBracket=29 +ClosedRoundBracket=30 +OpenCurlyBracket=31 +ClosedCurlyBracket=32 +Semicolon=33 +Comma=34 +Class=35 +This=36 +While=37 +Do=38 +If=39 +Else=40 +For=41 +Return=42 +New=43 +CharValue=44 +IntValue=45 +BooleanValue=46 +NullValue=47 +Identifier=48 +WS=49 +InlineComment=50 +MultilineComment=51 +'++'=1 +'--'=2 +'void'=3 +'boolean'=4 +'char'=5 +'int'=6 +'public static void main(String[] args)'=8 +'='=13 +'+'=14 +'-'=15 +'*'=16 +'%'=17 +'/'=18 +'>'=19 +'<'=20 +'>='=21 +'<='=22 +'=='=23 +'!='=24 +'!'=25 +'&&'=26 +'||'=27 +'.'=28 +'('=29 +')'=30 +'{'=31 +'}'=32 +';'=33 +','=34 +'class'=35 +'this'=36 +'while'=37 +'do'=38 +'if'=39 +'else'=40 +'for'=41 +'return'=42 +'new'=43 +'null'=47 diff --git a/src/main/java/parser/generated/SimpleJavaListener.java b/src/main/java/parser/generated/SimpleJavaListener.java new file mode 100644 index 0000000..580bfe1 --- /dev/null +++ b/src/main/java/parser/generated/SimpleJavaListener.java @@ -0,0 +1,470 @@ +// Generated from C:/Users/janni/Desktop/NichtHaskell2.0/src/main/java/parser/grammar/SimpleJava.g4 by ANTLR 4.13.1 +package parser.generated; +import org.antlr.v4.runtime.tree.ParseTreeListener; + +/** + * This interface defines a complete listener for a parse tree produced by + * {@link SimpleJavaParser}. + */ +public interface SimpleJavaListener extends ParseTreeListener { + /** + * Enter a parse tree produced by {@link SimpleJavaParser#program}. + * @param ctx the parse tree + */ + void enterProgram(SimpleJavaParser.ProgramContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#program}. + * @param ctx the parse tree + */ + void exitProgram(SimpleJavaParser.ProgramContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#classDeclaration}. + * @param ctx the parse tree + */ + void enterClassDeclaration(SimpleJavaParser.ClassDeclarationContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#classDeclaration}. + * @param ctx the parse tree + */ + void exitClassDeclaration(SimpleJavaParser.ClassDeclarationContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#memberDeclaration}. + * @param ctx the parse tree + */ + void enterMemberDeclaration(SimpleJavaParser.MemberDeclarationContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#memberDeclaration}. + * @param ctx the parse tree + */ + void exitMemberDeclaration(SimpleJavaParser.MemberDeclarationContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#constructorDeclaration}. + * @param ctx the parse tree + */ + void enterConstructorDeclaration(SimpleJavaParser.ConstructorDeclarationContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#constructorDeclaration}. + * @param ctx the parse tree + */ + void exitConstructorDeclaration(SimpleJavaParser.ConstructorDeclarationContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#fieldDeclaration}. + * @param ctx the parse tree + */ + void enterFieldDeclaration(SimpleJavaParser.FieldDeclarationContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#fieldDeclaration}. + * @param ctx the parse tree + */ + void exitFieldDeclaration(SimpleJavaParser.FieldDeclarationContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#methodDeclaration}. + * @param ctx the parse tree + */ + void enterMethodDeclaration(SimpleJavaParser.MethodDeclarationContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#methodDeclaration}. + * @param ctx the parse tree + */ + void exitMethodDeclaration(SimpleJavaParser.MethodDeclarationContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#parameterList}. + * @param ctx the parse tree + */ + void enterParameterList(SimpleJavaParser.ParameterListContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#parameterList}. + * @param ctx the parse tree + */ + void exitParameterList(SimpleJavaParser.ParameterListContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#parameter}. + * @param ctx the parse tree + */ + void enterParameter(SimpleJavaParser.ParameterContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#parameter}. + * @param ctx the parse tree + */ + void exitParameter(SimpleJavaParser.ParameterContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#argumentList}. + * @param ctx the parse tree + */ + void enterArgumentList(SimpleJavaParser.ArgumentListContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#argumentList}. + * @param ctx the parse tree + */ + void exitArgumentList(SimpleJavaParser.ArgumentListContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#statement}. + * @param ctx the parse tree + */ + void enterStatement(SimpleJavaParser.StatementContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#statement}. + * @param ctx the parse tree + */ + void exitStatement(SimpleJavaParser.StatementContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#blockStatement}. + * @param ctx the parse tree + */ + void enterBlockStatement(SimpleJavaParser.BlockStatementContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#blockStatement}. + * @param ctx the parse tree + */ + void exitBlockStatement(SimpleJavaParser.BlockStatementContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#returnStatement}. + * @param ctx the parse tree + */ + void enterReturnStatement(SimpleJavaParser.ReturnStatementContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#returnStatement}. + * @param ctx the parse tree + */ + void exitReturnStatement(SimpleJavaParser.ReturnStatementContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#localVariableDeclaration}. + * @param ctx the parse tree + */ + void enterLocalVariableDeclaration(SimpleJavaParser.LocalVariableDeclarationContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#localVariableDeclaration}. + * @param ctx the parse tree + */ + void exitLocalVariableDeclaration(SimpleJavaParser.LocalVariableDeclarationContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#whileStatement}. + * @param ctx the parse tree + */ + void enterWhileStatement(SimpleJavaParser.WhileStatementContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#whileStatement}. + * @param ctx the parse tree + */ + void exitWhileStatement(SimpleJavaParser.WhileStatementContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#doWhileStatement}. + * @param ctx the parse tree + */ + void enterDoWhileStatement(SimpleJavaParser.DoWhileStatementContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#doWhileStatement}. + * @param ctx the parse tree + */ + void exitDoWhileStatement(SimpleJavaParser.DoWhileStatementContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#forStatement}. + * @param ctx the parse tree + */ + void enterForStatement(SimpleJavaParser.ForStatementContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#forStatement}. + * @param ctx the parse tree + */ + void exitForStatement(SimpleJavaParser.ForStatementContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#ifElseStatement}. + * @param ctx the parse tree + */ + void enterIfElseStatement(SimpleJavaParser.IfElseStatementContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#ifElseStatement}. + * @param ctx the parse tree + */ + void exitIfElseStatement(SimpleJavaParser.IfElseStatementContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#ifStatement}. + * @param ctx the parse tree + */ + void enterIfStatement(SimpleJavaParser.IfStatementContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#ifStatement}. + * @param ctx the parse tree + */ + void exitIfStatement(SimpleJavaParser.IfStatementContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#elseIfStatement}. + * @param ctx the parse tree + */ + void enterElseIfStatement(SimpleJavaParser.ElseIfStatementContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#elseIfStatement}. + * @param ctx the parse tree + */ + void exitElseIfStatement(SimpleJavaParser.ElseIfStatementContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#elseStatement}. + * @param ctx the parse tree + */ + void enterElseStatement(SimpleJavaParser.ElseStatementContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#elseStatement}. + * @param ctx the parse tree + */ + void exitElseStatement(SimpleJavaParser.ElseStatementContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#statementExpression}. + * @param ctx the parse tree + */ + void enterStatementExpression(SimpleJavaParser.StatementExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#statementExpression}. + * @param ctx the parse tree + */ + void exitStatementExpression(SimpleJavaParser.StatementExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#assign}. + * @param ctx the parse tree + */ + void enterAssign(SimpleJavaParser.AssignContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#assign}. + * @param ctx the parse tree + */ + void exitAssign(SimpleJavaParser.AssignContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#newDeclaration}. + * @param ctx the parse tree + */ + void enterNewDeclaration(SimpleJavaParser.NewDeclarationContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#newDeclaration}. + * @param ctx the parse tree + */ + void exitNewDeclaration(SimpleJavaParser.NewDeclarationContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#expression}. + * @param ctx the parse tree + */ + void enterExpression(SimpleJavaParser.ExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#expression}. + * @param ctx the parse tree + */ + void exitExpression(SimpleJavaParser.ExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#unaryExpression}. + * @param ctx the parse tree + */ + void enterUnaryExpression(SimpleJavaParser.UnaryExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#unaryExpression}. + * @param ctx the parse tree + */ + void exitUnaryExpression(SimpleJavaParser.UnaryExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#notExpression}. + * @param ctx the parse tree + */ + void enterNotExpression(SimpleJavaParser.NotExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#notExpression}. + * @param ctx the parse tree + */ + void exitNotExpression(SimpleJavaParser.NotExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#crementExpression}. + * @param ctx the parse tree + */ + void enterCrementExpression(SimpleJavaParser.CrementExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#crementExpression}. + * @param ctx the parse tree + */ + void exitCrementExpression(SimpleJavaParser.CrementExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#incrementExpression}. + * @param ctx the parse tree + */ + void enterIncrementExpression(SimpleJavaParser.IncrementExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#incrementExpression}. + * @param ctx the parse tree + */ + void exitIncrementExpression(SimpleJavaParser.IncrementExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#prefixIncrementExpression}. + * @param ctx the parse tree + */ + void enterPrefixIncrementExpression(SimpleJavaParser.PrefixIncrementExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#prefixIncrementExpression}. + * @param ctx the parse tree + */ + void exitPrefixIncrementExpression(SimpleJavaParser.PrefixIncrementExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#suffixIncrementExpression}. + * @param ctx the parse tree + */ + void enterSuffixIncrementExpression(SimpleJavaParser.SuffixIncrementExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#suffixIncrementExpression}. + * @param ctx the parse tree + */ + void exitSuffixIncrementExpression(SimpleJavaParser.SuffixIncrementExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#decrementExpression}. + * @param ctx the parse tree + */ + void enterDecrementExpression(SimpleJavaParser.DecrementExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#decrementExpression}. + * @param ctx the parse tree + */ + void exitDecrementExpression(SimpleJavaParser.DecrementExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#prefixDecrementExpression}. + * @param ctx the parse tree + */ + void enterPrefixDecrementExpression(SimpleJavaParser.PrefixDecrementExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#prefixDecrementExpression}. + * @param ctx the parse tree + */ + void exitPrefixDecrementExpression(SimpleJavaParser.PrefixDecrementExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#suffixDecrementExpression}. + * @param ctx the parse tree + */ + void enterSuffixDecrementExpression(SimpleJavaParser.SuffixDecrementExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#suffixDecrementExpression}. + * @param ctx the parse tree + */ + void exitSuffixDecrementExpression(SimpleJavaParser.SuffixDecrementExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#assignableExpression}. + * @param ctx the parse tree + */ + void enterAssignableExpression(SimpleJavaParser.AssignableExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#assignableExpression}. + * @param ctx the parse tree + */ + void exitAssignableExpression(SimpleJavaParser.AssignableExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#memberAccess}. + * @param ctx the parse tree + */ + void enterMemberAccess(SimpleJavaParser.MemberAccessContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#memberAccess}. + * @param ctx the parse tree + */ + void exitMemberAccess(SimpleJavaParser.MemberAccessContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#binaryExpression}. + * @param ctx the parse tree + */ + void enterBinaryExpression(SimpleJavaParser.BinaryExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#binaryExpression}. + * @param ctx the parse tree + */ + void exitBinaryExpression(SimpleJavaParser.BinaryExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#calculationExpression}. + * @param ctx the parse tree + */ + void enterCalculationExpression(SimpleJavaParser.CalculationExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#calculationExpression}. + * @param ctx the parse tree + */ + void exitCalculationExpression(SimpleJavaParser.CalculationExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#dotExpression}. + * @param ctx the parse tree + */ + void enterDotExpression(SimpleJavaParser.DotExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#dotExpression}. + * @param ctx the parse tree + */ + void exitDotExpression(SimpleJavaParser.DotExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#dotSubtractionExpression}. + * @param ctx the parse tree + */ + void enterDotSubtractionExpression(SimpleJavaParser.DotSubtractionExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#dotSubtractionExpression}. + * @param ctx the parse tree + */ + void exitDotSubtractionExpression(SimpleJavaParser.DotSubtractionExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#nonCalculationExpression}. + * @param ctx the parse tree + */ + void enterNonCalculationExpression(SimpleJavaParser.NonCalculationExpressionContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#nonCalculationExpression}. + * @param ctx the parse tree + */ + void exitNonCalculationExpression(SimpleJavaParser.NonCalculationExpressionContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#methodCall}. + * @param ctx the parse tree + */ + void enterMethodCall(SimpleJavaParser.MethodCallContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#methodCall}. + * @param ctx the parse tree + */ + void exitMethodCall(SimpleJavaParser.MethodCallContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#target}. + * @param ctx the parse tree + */ + void enterTarget(SimpleJavaParser.TargetContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#target}. + * @param ctx the parse tree + */ + void exitTarget(SimpleJavaParser.TargetContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#chainedMethod}. + * @param ctx the parse tree + */ + void enterChainedMethod(SimpleJavaParser.ChainedMethodContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#chainedMethod}. + * @param ctx the parse tree + */ + void exitChainedMethod(SimpleJavaParser.ChainedMethodContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#type}. + * @param ctx the parse tree + */ + void enterType(SimpleJavaParser.TypeContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#type}. + * @param ctx the parse tree + */ + void exitType(SimpleJavaParser.TypeContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#value}. + * @param ctx the parse tree + */ + void enterValue(SimpleJavaParser.ValueContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#value}. + * @param ctx the parse tree + */ + void exitValue(SimpleJavaParser.ValueContext ctx); + /** + * Enter a parse tree produced by {@link SimpleJavaParser#nonCalculationOperator}. + * @param ctx the parse tree + */ + void enterNonCalculationOperator(SimpleJavaParser.NonCalculationOperatorContext ctx); + /** + * Exit a parse tree produced by {@link SimpleJavaParser#nonCalculationOperator}. + * @param ctx the parse tree + */ + void exitNonCalculationOperator(SimpleJavaParser.NonCalculationOperatorContext ctx); +} \ No newline at end of file diff --git a/src/main/java/parser/generated/SimpleJavaParser.java b/src/main/java/parser/generated/SimpleJavaParser.java new file mode 100644 index 0000000..3a80a6a --- /dev/null +++ b/src/main/java/parser/generated/SimpleJavaParser.java @@ -0,0 +1,3628 @@ +// Generated from C:/Users/janni/Desktop/NichtHaskell2.0/src/main/java/parser/grammar/SimpleJava.g4 by ANTLR 4.13.1 +package parser.generated; +import org.antlr.v4.runtime.atn.*; +import org.antlr.v4.runtime.dfa.DFA; +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.misc.*; +import org.antlr.v4.runtime.tree.*; +import java.util.List; +import java.util.Iterator; +import java.util.ArrayList; + +@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue"}) +public class SimpleJavaParser extends Parser { + static { RuntimeMetaData.checkVersion("4.13.1", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + T__0=1, T__1=2, Void=3, Boolean=4, Char=5, Int=6, AccessModifier=7, MainMethodDeclaration=8, + DotOperator=9, LineOperator=10, ComparisonOperator=11, LogicalOperator=12, + Assign=13, Plus=14, Minus=15, Mult=16, Modulo=17, Div=18, Greater=19, + Less=20, GreaterEqual=21, LessEqual=22, Equal=23, NotEqual=24, Not=25, + And=26, Or=27, Dot=28, OpenRoundBracket=29, ClosedRoundBracket=30, OpenCurlyBracket=31, + ClosedCurlyBracket=32, Semicolon=33, Comma=34, Class=35, This=36, While=37, + Do=38, If=39, Else=40, For=41, Return=42, New=43, CharValue=44, IntValue=45, + BooleanValue=46, NullValue=47, Identifier=48, WS=49, InlineComment=50, + MultilineComment=51; + public static final int + RULE_program = 0, RULE_classDeclaration = 1, RULE_memberDeclaration = 2, + RULE_constructorDeclaration = 3, RULE_fieldDeclaration = 4, RULE_methodDeclaration = 5, + RULE_parameterList = 6, RULE_parameter = 7, RULE_argumentList = 8, RULE_statement = 9, + RULE_blockStatement = 10, RULE_returnStatement = 11, RULE_localVariableDeclaration = 12, + RULE_whileStatement = 13, RULE_doWhileStatement = 14, RULE_forStatement = 15, + RULE_ifElseStatement = 16, RULE_ifStatement = 17, RULE_elseIfStatement = 18, + RULE_elseStatement = 19, RULE_statementExpression = 20, RULE_assign = 21, + RULE_newDeclaration = 22, RULE_expression = 23, RULE_unaryExpression = 24, + RULE_notExpression = 25, RULE_crementExpression = 26, RULE_incrementExpression = 27, + RULE_prefixIncrementExpression = 28, RULE_suffixIncrementExpression = 29, + RULE_decrementExpression = 30, RULE_prefixDecrementExpression = 31, RULE_suffixDecrementExpression = 32, + RULE_assignableExpression = 33, RULE_memberAccess = 34, RULE_binaryExpression = 35, + RULE_calculationExpression = 36, RULE_dotExpression = 37, RULE_dotSubtractionExpression = 38, + RULE_nonCalculationExpression = 39, RULE_methodCall = 40, RULE_target = 41, + RULE_chainedMethod = 42, RULE_type = 43, RULE_value = 44, RULE_nonCalculationOperator = 45; + private static String[] makeRuleNames() { + return new String[] { + "program", "classDeclaration", "memberDeclaration", "constructorDeclaration", + "fieldDeclaration", "methodDeclaration", "parameterList", "parameter", + "argumentList", "statement", "blockStatement", "returnStatement", "localVariableDeclaration", + "whileStatement", "doWhileStatement", "forStatement", "ifElseStatement", + "ifStatement", "elseIfStatement", "elseStatement", "statementExpression", + "assign", "newDeclaration", "expression", "unaryExpression", "notExpression", + "crementExpression", "incrementExpression", "prefixIncrementExpression", + "suffixIncrementExpression", "decrementExpression", "prefixDecrementExpression", + "suffixDecrementExpression", "assignableExpression", "memberAccess", + "binaryExpression", "calculationExpression", "dotExpression", "dotSubtractionExpression", + "nonCalculationExpression", "methodCall", "target", "chainedMethod", + "type", "value", "nonCalculationOperator" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, "'++'", "'--'", "'void'", "'boolean'", "'char'", "'int'", null, + "'public static void main(String[] args)'", null, null, null, null, "'='", + "'+'", "'-'", "'*'", "'%'", "'/'", "'>'", "'<'", "'>='", "'<='", "'=='", + "'!='", "'!'", "'&&'", "'||'", "'.'", "'('", "')'", "'{'", "'}'", "';'", + "','", "'class'", "'this'", "'while'", "'do'", "'if'", "'else'", "'for'", + "'return'", "'new'", null, null, null, "'null'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, null, null, "Void", "Boolean", "Char", "Int", "AccessModifier", + "MainMethodDeclaration", "DotOperator", "LineOperator", "ComparisonOperator", + "LogicalOperator", "Assign", "Plus", "Minus", "Mult", "Modulo", "Div", + "Greater", "Less", "GreaterEqual", "LessEqual", "Equal", "NotEqual", + "Not", "And", "Or", "Dot", "OpenRoundBracket", "ClosedRoundBracket", + "OpenCurlyBracket", "ClosedCurlyBracket", "Semicolon", "Comma", "Class", + "This", "While", "Do", "If", "Else", "For", "Return", "New", "CharValue", + "IntValue", "BooleanValue", "NullValue", "Identifier", "WS", "InlineComment", + "MultilineComment" + }; + } + private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); + public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); + + /** + * @deprecated Use {@link #VOCABULARY} instead. + */ + @Deprecated + public static final String[] tokenNames; + static { + tokenNames = new String[_SYMBOLIC_NAMES.length]; + for (int i = 0; i < tokenNames.length; i++) { + tokenNames[i] = VOCABULARY.getLiteralName(i); + if (tokenNames[i] == null) { + tokenNames[i] = VOCABULARY.getSymbolicName(i); + } + + if (tokenNames[i] == null) { + tokenNames[i] = ""; + } + } + } + + @Override + @Deprecated + public String[] getTokenNames() { + return tokenNames; + } + + @Override + + public Vocabulary getVocabulary() { + return VOCABULARY; + } + + @Override + public String getGrammarFileName() { return "SimpleJava.g4"; } + + @Override + public String[] getRuleNames() { return ruleNames; } + + @Override + public String getSerializedATN() { return _serializedATN; } + + @Override + public ATN getATN() { return _ATN; } + + public SimpleJavaParser(TokenStream input) { + super(input); + _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); + } + + @SuppressWarnings("CheckReturnValue") + public static class ProgramContext extends ParserRuleContext { + public List classDeclaration() { + return getRuleContexts(ClassDeclarationContext.class); + } + public ClassDeclarationContext classDeclaration(int i) { + return getRuleContext(ClassDeclarationContext.class,i); + } + public ProgramContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_program; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterProgram(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitProgram(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitProgram(this); + else return visitor.visitChildren(this); + } + } + + public final ProgramContext program() throws RecognitionException { + ProgramContext _localctx = new ProgramContext(_ctx, getState()); + enterRule(_localctx, 0, RULE_program); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(93); + _errHandler.sync(this); + _la = _input.LA(1); + do { + { + { + setState(92); + classDeclaration(); + } + } + setState(95); + _errHandler.sync(this); + _la = _input.LA(1); + } while ( _la==AccessModifier || _la==Class ); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ClassDeclarationContext extends ParserRuleContext { + public TerminalNode Class() { return getToken(SimpleJavaParser.Class, 0); } + public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } + public TerminalNode OpenCurlyBracket() { return getToken(SimpleJavaParser.OpenCurlyBracket, 0); } + public TerminalNode ClosedCurlyBracket() { return getToken(SimpleJavaParser.ClosedCurlyBracket, 0); } + public TerminalNode AccessModifier() { return getToken(SimpleJavaParser.AccessModifier, 0); } + public List memberDeclaration() { + return getRuleContexts(MemberDeclarationContext.class); + } + public MemberDeclarationContext memberDeclaration(int i) { + return getRuleContext(MemberDeclarationContext.class,i); + } + public ClassDeclarationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_classDeclaration; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterClassDeclaration(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitClassDeclaration(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitClassDeclaration(this); + else return visitor.visitChildren(this); + } + } + + public final ClassDeclarationContext classDeclaration() throws RecognitionException { + ClassDeclarationContext _localctx = new ClassDeclarationContext(_ctx, getState()); + enterRule(_localctx, 2, RULE_classDeclaration); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(98); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==AccessModifier) { + { + setState(97); + match(AccessModifier); + } + } + + setState(100); + match(Class); + setState(101); + match(Identifier); + setState(102); + match(OpenCurlyBracket); + setState(106); + _errHandler.sync(this); + _la = _input.LA(1); + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 281474976711160L) != 0)) { + { + { + setState(103); + memberDeclaration(); + } + } + setState(108); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(109); + match(ClosedCurlyBracket); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class MemberDeclarationContext extends ParserRuleContext { + public ConstructorDeclarationContext constructorDeclaration() { + return getRuleContext(ConstructorDeclarationContext.class,0); + } + public FieldDeclarationContext fieldDeclaration() { + return getRuleContext(FieldDeclarationContext.class,0); + } + public MethodDeclarationContext methodDeclaration() { + return getRuleContext(MethodDeclarationContext.class,0); + } + public MemberDeclarationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_memberDeclaration; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterMemberDeclaration(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitMemberDeclaration(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitMemberDeclaration(this); + else return visitor.visitChildren(this); + } + } + + public final MemberDeclarationContext memberDeclaration() throws RecognitionException { + MemberDeclarationContext _localctx = new MemberDeclarationContext(_ctx, getState()); + enterRule(_localctx, 4, RULE_memberDeclaration); + try { + setState(114); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(111); + constructorDeclaration(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(112); + fieldDeclaration(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(113); + methodDeclaration(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ConstructorDeclarationContext extends ParserRuleContext { + public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } + public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } + public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } + public BlockStatementContext blockStatement() { + return getRuleContext(BlockStatementContext.class,0); + } + public TerminalNode AccessModifier() { return getToken(SimpleJavaParser.AccessModifier, 0); } + public ParameterListContext parameterList() { + return getRuleContext(ParameterListContext.class,0); + } + public ConstructorDeclarationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_constructorDeclaration; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterConstructorDeclaration(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitConstructorDeclaration(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitConstructorDeclaration(this); + else return visitor.visitChildren(this); + } + } + + public final ConstructorDeclarationContext constructorDeclaration() throws RecognitionException { + ConstructorDeclarationContext _localctx = new ConstructorDeclarationContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_constructorDeclaration); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(117); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==AccessModifier) { + { + setState(116); + match(AccessModifier); + } + } + + setState(119); + match(Identifier); + setState(120); + match(OpenRoundBracket); + setState(122); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 281474976710768L) != 0)) { + { + setState(121); + parameterList(); + } + } + + setState(124); + match(ClosedRoundBracket); + setState(125); + blockStatement(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class FieldDeclarationContext extends ParserRuleContext { + public TypeContext type() { + return getRuleContext(TypeContext.class,0); + } + public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } + public TerminalNode Semicolon() { return getToken(SimpleJavaParser.Semicolon, 0); } + public TerminalNode AccessModifier() { return getToken(SimpleJavaParser.AccessModifier, 0); } + public FieldDeclarationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_fieldDeclaration; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterFieldDeclaration(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitFieldDeclaration(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitFieldDeclaration(this); + else return visitor.visitChildren(this); + } + } + + public final FieldDeclarationContext fieldDeclaration() throws RecognitionException { + FieldDeclarationContext _localctx = new FieldDeclarationContext(_ctx, getState()); + enterRule(_localctx, 8, RULE_fieldDeclaration); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(128); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==AccessModifier) { + { + setState(127); + match(AccessModifier); + } + } + + setState(130); + type(); + setState(131); + match(Identifier); + setState(132); + match(Semicolon); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class MethodDeclarationContext extends ParserRuleContext { + public TerminalNode MainMethodDeclaration() { return getToken(SimpleJavaParser.MainMethodDeclaration, 0); } + public BlockStatementContext blockStatement() { + return getRuleContext(BlockStatementContext.class,0); + } + public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } + public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } + public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } + public TypeContext type() { + return getRuleContext(TypeContext.class,0); + } + public TerminalNode Void() { return getToken(SimpleJavaParser.Void, 0); } + public TerminalNode AccessModifier() { return getToken(SimpleJavaParser.AccessModifier, 0); } + public ParameterListContext parameterList() { + return getRuleContext(ParameterListContext.class,0); + } + public MethodDeclarationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_methodDeclaration; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterMethodDeclaration(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitMethodDeclaration(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitMethodDeclaration(this); + else return visitor.visitChildren(this); + } + } + + public final MethodDeclarationContext methodDeclaration() throws RecognitionException { + MethodDeclarationContext _localctx = new MethodDeclarationContext(_ctx, getState()); + enterRule(_localctx, 10, RULE_methodDeclaration); + int _la; + try { + setState(150); + _errHandler.sync(this); + switch (_input.LA(1)) { + case MainMethodDeclaration: + enterOuterAlt(_localctx, 1); + { + setState(134); + match(MainMethodDeclaration); + setState(135); + blockStatement(); + } + break; + case Void: + case Boolean: + case Char: + case Int: + case AccessModifier: + case Identifier: + enterOuterAlt(_localctx, 2); + { + setState(137); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==AccessModifier) { + { + setState(136); + match(AccessModifier); + } + } + + setState(141); + _errHandler.sync(this); + switch (_input.LA(1)) { + case Boolean: + case Char: + case Int: + case Identifier: + { + setState(139); + type(); + } + break; + case Void: + { + setState(140); + match(Void); + } + break; + default: + throw new NoViableAltException(this); + } + setState(143); + match(Identifier); + setState(144); + match(OpenRoundBracket); + setState(146); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 281474976710768L) != 0)) { + { + setState(145); + parameterList(); + } + } + + setState(148); + match(ClosedRoundBracket); + setState(149); + blockStatement(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ParameterListContext extends ParserRuleContext { + public List parameter() { + return getRuleContexts(ParameterContext.class); + } + public ParameterContext parameter(int i) { + return getRuleContext(ParameterContext.class,i); + } + public List Comma() { return getTokens(SimpleJavaParser.Comma); } + public TerminalNode Comma(int i) { + return getToken(SimpleJavaParser.Comma, i); + } + public ParameterListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_parameterList; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterParameterList(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitParameterList(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitParameterList(this); + else return visitor.visitChildren(this); + } + } + + public final ParameterListContext parameterList() throws RecognitionException { + ParameterListContext _localctx = new ParameterListContext(_ctx, getState()); + enterRule(_localctx, 12, RULE_parameterList); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(152); + parameter(); + setState(157); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==Comma) { + { + { + setState(153); + match(Comma); + setState(154); + parameter(); + } + } + setState(159); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ParameterContext extends ParserRuleContext { + public TypeContext type() { + return getRuleContext(TypeContext.class,0); + } + public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } + public ParameterContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_parameter; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterParameter(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitParameter(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitParameter(this); + else return visitor.visitChildren(this); + } + } + + public final ParameterContext parameter() throws RecognitionException { + ParameterContext _localctx = new ParameterContext(_ctx, getState()); + enterRule(_localctx, 14, RULE_parameter); + try { + enterOuterAlt(_localctx, 1); + { + setState(160); + type(); + setState(161); + match(Identifier); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ArgumentListContext extends ParserRuleContext { + public List expression() { + return getRuleContexts(ExpressionContext.class); + } + public ExpressionContext expression(int i) { + return getRuleContext(ExpressionContext.class,i); + } + public List Comma() { return getTokens(SimpleJavaParser.Comma); } + public TerminalNode Comma(int i) { + return getToken(SimpleJavaParser.Comma, i); + } + public ArgumentListContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_argumentList; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterArgumentList(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitArgumentList(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitArgumentList(this); + else return visitor.visitChildren(this); + } + } + + public final ArgumentListContext argumentList() throws RecognitionException { + ArgumentListContext _localctx = new ArgumentListContext(_ctx, getState()); + enterRule(_localctx, 16, RULE_argumentList); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(171); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 554223150301190L) != 0)) { + { + setState(163); + expression(); + setState(168); + _errHandler.sync(this); + _la = _input.LA(1); + while (_la==Comma) { + { + { + setState(164); + match(Comma); + setState(165); + expression(); + } + } + setState(170); + _errHandler.sync(this); + _la = _input.LA(1); + } + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class StatementContext extends ParserRuleContext { + public ReturnStatementContext returnStatement() { + return getRuleContext(ReturnStatementContext.class,0); + } + public TerminalNode Semicolon() { return getToken(SimpleJavaParser.Semicolon, 0); } + public LocalVariableDeclarationContext localVariableDeclaration() { + return getRuleContext(LocalVariableDeclarationContext.class,0); + } + public BlockStatementContext blockStatement() { + return getRuleContext(BlockStatementContext.class,0); + } + public WhileStatementContext whileStatement() { + return getRuleContext(WhileStatementContext.class,0); + } + public DoWhileStatementContext doWhileStatement() { + return getRuleContext(DoWhileStatementContext.class,0); + } + public ForStatementContext forStatement() { + return getRuleContext(ForStatementContext.class,0); + } + public IfElseStatementContext ifElseStatement() { + return getRuleContext(IfElseStatementContext.class,0); + } + public StatementExpressionContext statementExpression() { + return getRuleContext(StatementExpressionContext.class,0); + } + public StatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_statement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitStatement(this); + else return visitor.visitChildren(this); + } + } + + public final StatementContext statement() throws RecognitionException { + StatementContext _localctx = new StatementContext(_ctx, getState()); + enterRule(_localctx, 18, RULE_statement); + try { + setState(187); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,14,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(173); + returnStatement(); + setState(174); + match(Semicolon); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(176); + localVariableDeclaration(); + setState(177); + match(Semicolon); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(179); + blockStatement(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(180); + whileStatement(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(181); + doWhileStatement(); + } + break; + case 6: + enterOuterAlt(_localctx, 6); + { + setState(182); + forStatement(); + } + break; + case 7: + enterOuterAlt(_localctx, 7); + { + setState(183); + ifElseStatement(); + } + break; + case 8: + enterOuterAlt(_localctx, 8); + { + setState(184); + statementExpression(); + setState(185); + match(Semicolon); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class BlockStatementContext extends ParserRuleContext { + public TerminalNode OpenCurlyBracket() { return getToken(SimpleJavaParser.OpenCurlyBracket, 0); } + public TerminalNode ClosedCurlyBracket() { return getToken(SimpleJavaParser.ClosedCurlyBracket, 0); } + public List statement() { + return getRuleContexts(StatementContext.class); + } + public StatementContext statement(int i) { + return getRuleContext(StatementContext.class,i); + } + public BlockStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_blockStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterBlockStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitBlockStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitBlockStatement(this); + else return visitor.visitChildren(this); + } + } + + public final BlockStatementContext blockStatement() throws RecognitionException { + BlockStatementContext _localctx = new BlockStatementContext(_ctx, getState()); + enterRule(_localctx, 20, RULE_blockStatement); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(189); + match(OpenCurlyBracket); + setState(193); + _errHandler.sync(this); + _la = _input.LA(1); + while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 297901079134326L) != 0)) { + { + { + setState(190); + statement(); + } + } + setState(195); + _errHandler.sync(this); + _la = _input.LA(1); + } + setState(196); + match(ClosedCurlyBracket); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ReturnStatementContext extends ParserRuleContext { + public TerminalNode Return() { return getToken(SimpleJavaParser.Return, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public ReturnStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_returnStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterReturnStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitReturnStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitReturnStatement(this); + else return visitor.visitChildren(this); + } + } + + public final ReturnStatementContext returnStatement() throws RecognitionException { + ReturnStatementContext _localctx = new ReturnStatementContext(_ctx, getState()); + enterRule(_localctx, 22, RULE_returnStatement); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(198); + match(Return); + setState(200); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 554223150301190L) != 0)) { + { + setState(199); + expression(); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class LocalVariableDeclarationContext extends ParserRuleContext { + public TypeContext type() { + return getRuleContext(TypeContext.class,0); + } + public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } + public TerminalNode Assign() { return getToken(SimpleJavaParser.Assign, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public LocalVariableDeclarationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_localVariableDeclaration; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterLocalVariableDeclaration(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitLocalVariableDeclaration(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitLocalVariableDeclaration(this); + else return visitor.visitChildren(this); + } + } + + public final LocalVariableDeclarationContext localVariableDeclaration() throws RecognitionException { + LocalVariableDeclarationContext _localctx = new LocalVariableDeclarationContext(_ctx, getState()); + enterRule(_localctx, 24, RULE_localVariableDeclaration); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(202); + type(); + setState(203); + match(Identifier); + setState(206); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==Assign) { + { + setState(204); + match(Assign); + setState(205); + expression(); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class WhileStatementContext extends ParserRuleContext { + public TerminalNode While() { return getToken(SimpleJavaParser.While, 0); } + public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } + public BlockStatementContext blockStatement() { + return getRuleContext(BlockStatementContext.class,0); + } + public WhileStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_whileStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterWhileStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitWhileStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitWhileStatement(this); + else return visitor.visitChildren(this); + } + } + + public final WhileStatementContext whileStatement() throws RecognitionException { + WhileStatementContext _localctx = new WhileStatementContext(_ctx, getState()); + enterRule(_localctx, 26, RULE_whileStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(208); + match(While); + setState(209); + match(OpenRoundBracket); + setState(210); + expression(); + setState(211); + match(ClosedRoundBracket); + setState(212); + blockStatement(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class DoWhileStatementContext extends ParserRuleContext { + public TerminalNode Do() { return getToken(SimpleJavaParser.Do, 0); } + public BlockStatementContext blockStatement() { + return getRuleContext(BlockStatementContext.class,0); + } + public TerminalNode While() { return getToken(SimpleJavaParser.While, 0); } + public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } + public TerminalNode Semicolon() { return getToken(SimpleJavaParser.Semicolon, 0); } + public DoWhileStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_doWhileStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterDoWhileStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitDoWhileStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitDoWhileStatement(this); + else return visitor.visitChildren(this); + } + } + + public final DoWhileStatementContext doWhileStatement() throws RecognitionException { + DoWhileStatementContext _localctx = new DoWhileStatementContext(_ctx, getState()); + enterRule(_localctx, 28, RULE_doWhileStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(214); + match(Do); + setState(215); + blockStatement(); + setState(216); + match(While); + setState(217); + match(OpenRoundBracket); + setState(218); + expression(); + setState(219); + match(ClosedRoundBracket); + setState(220); + match(Semicolon); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ForStatementContext extends ParserRuleContext { + public TerminalNode For() { return getToken(SimpleJavaParser.For, 0); } + public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } + public List Semicolon() { return getTokens(SimpleJavaParser.Semicolon); } + public TerminalNode Semicolon(int i) { + return getToken(SimpleJavaParser.Semicolon, i); + } + public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } + public BlockStatementContext blockStatement() { + return getRuleContext(BlockStatementContext.class,0); + } + public List statementExpression() { + return getRuleContexts(StatementExpressionContext.class); + } + public StatementExpressionContext statementExpression(int i) { + return getRuleContext(StatementExpressionContext.class,i); + } + public LocalVariableDeclarationContext localVariableDeclaration() { + return getRuleContext(LocalVariableDeclarationContext.class,0); + } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public ForStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_forStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterForStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitForStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitForStatement(this); + else return visitor.visitChildren(this); + } + } + + public final ForStatementContext forStatement() throws RecognitionException { + ForStatementContext _localctx = new ForStatementContext(_ctx, getState()); + enterRule(_localctx, 30, RULE_forStatement); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(222); + match(For); + setState(223); + match(OpenRoundBracket); + setState(226); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) { + case 1: + { + setState(224); + statementExpression(); + } + break; + case 2: + { + setState(225); + localVariableDeclaration(); + } + break; + } + setState(228); + match(Semicolon); + setState(230); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 554223150301190L) != 0)) { + { + setState(229); + expression(); + } + } + + setState(232); + match(Semicolon); + setState(234); + _errHandler.sync(this); + _la = _input.LA(1); + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 290339789209606L) != 0)) { + { + setState(233); + statementExpression(); + } + } + + setState(236); + match(ClosedRoundBracket); + setState(237); + blockStatement(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class IfElseStatementContext extends ParserRuleContext { + public IfStatementContext ifStatement() { + return getRuleContext(IfStatementContext.class,0); + } + public List elseIfStatement() { + return getRuleContexts(ElseIfStatementContext.class); + } + public ElseIfStatementContext elseIfStatement(int i) { + return getRuleContext(ElseIfStatementContext.class,i); + } + public ElseStatementContext elseStatement() { + return getRuleContext(ElseStatementContext.class,0); + } + public IfElseStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_ifElseStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterIfElseStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitIfElseStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitIfElseStatement(this); + else return visitor.visitChildren(this); + } + } + + public final IfElseStatementContext ifElseStatement() throws RecognitionException { + IfElseStatementContext _localctx = new IfElseStatementContext(_ctx, getState()); + enterRule(_localctx, 32, RULE_ifElseStatement); + int _la; + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(239); + ifStatement(); + setState(243); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,21,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(240); + elseIfStatement(); + } + } + } + setState(245); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,21,_ctx); + } + setState(247); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==Else) { + { + setState(246); + elseStatement(); + } + } + + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class IfStatementContext extends ParserRuleContext { + public TerminalNode If() { return getToken(SimpleJavaParser.If, 0); } + public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } + public BlockStatementContext blockStatement() { + return getRuleContext(BlockStatementContext.class,0); + } + public IfStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_ifStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterIfStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitIfStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitIfStatement(this); + else return visitor.visitChildren(this); + } + } + + public final IfStatementContext ifStatement() throws RecognitionException { + IfStatementContext _localctx = new IfStatementContext(_ctx, getState()); + enterRule(_localctx, 34, RULE_ifStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(249); + match(If); + setState(250); + match(OpenRoundBracket); + setState(251); + expression(); + setState(252); + match(ClosedRoundBracket); + setState(253); + blockStatement(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ElseIfStatementContext extends ParserRuleContext { + public TerminalNode Else() { return getToken(SimpleJavaParser.Else, 0); } + public TerminalNode If() { return getToken(SimpleJavaParser.If, 0); } + public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } + public BlockStatementContext blockStatement() { + return getRuleContext(BlockStatementContext.class,0); + } + public ElseIfStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_elseIfStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterElseIfStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitElseIfStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitElseIfStatement(this); + else return visitor.visitChildren(this); + } + } + + public final ElseIfStatementContext elseIfStatement() throws RecognitionException { + ElseIfStatementContext _localctx = new ElseIfStatementContext(_ctx, getState()); + enterRule(_localctx, 36, RULE_elseIfStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(255); + match(Else); + setState(256); + match(If); + setState(257); + match(OpenRoundBracket); + setState(258); + expression(); + setState(259); + match(ClosedRoundBracket); + setState(260); + blockStatement(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ElseStatementContext extends ParserRuleContext { + public TerminalNode Else() { return getToken(SimpleJavaParser.Else, 0); } + public BlockStatementContext blockStatement() { + return getRuleContext(BlockStatementContext.class,0); + } + public ElseStatementContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_elseStatement; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterElseStatement(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitElseStatement(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitElseStatement(this); + else return visitor.visitChildren(this); + } + } + + public final ElseStatementContext elseStatement() throws RecognitionException { + ElseStatementContext _localctx = new ElseStatementContext(_ctx, getState()); + enterRule(_localctx, 38, RULE_elseStatement); + try { + enterOuterAlt(_localctx, 1); + { + setState(262); + match(Else); + setState(263); + blockStatement(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class StatementExpressionContext extends ParserRuleContext { + public AssignContext assign() { + return getRuleContext(AssignContext.class,0); + } + public NewDeclarationContext newDeclaration() { + return getRuleContext(NewDeclarationContext.class,0); + } + public MethodCallContext methodCall() { + return getRuleContext(MethodCallContext.class,0); + } + public CrementExpressionContext crementExpression() { + return getRuleContext(CrementExpressionContext.class,0); + } + public StatementExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_statementExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterStatementExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitStatementExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitStatementExpression(this); + else return visitor.visitChildren(this); + } + } + + public final StatementExpressionContext statementExpression() throws RecognitionException { + StatementExpressionContext _localctx = new StatementExpressionContext(_ctx, getState()); + enterRule(_localctx, 40, RULE_statementExpression); + try { + setState(269); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(265); + assign(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(266); + newDeclaration(); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(267); + methodCall(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(268); + crementExpression(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class AssignContext extends ParserRuleContext { + public AssignableExpressionContext assignableExpression() { + return getRuleContext(AssignableExpressionContext.class,0); + } + public TerminalNode Assign() { return getToken(SimpleJavaParser.Assign, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public AssignContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_assign; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterAssign(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitAssign(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitAssign(this); + else return visitor.visitChildren(this); + } + } + + public final AssignContext assign() throws RecognitionException { + AssignContext _localctx = new AssignContext(_ctx, getState()); + enterRule(_localctx, 42, RULE_assign); + try { + enterOuterAlt(_localctx, 1); + { + setState(271); + assignableExpression(); + setState(272); + match(Assign); + setState(273); + expression(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class NewDeclarationContext extends ParserRuleContext { + public TerminalNode New() { return getToken(SimpleJavaParser.New, 0); } + public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } + public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } + public ArgumentListContext argumentList() { + return getRuleContext(ArgumentListContext.class,0); + } + public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } + public NewDeclarationContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_newDeclaration; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterNewDeclaration(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitNewDeclaration(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitNewDeclaration(this); + else return visitor.visitChildren(this); + } + } + + public final NewDeclarationContext newDeclaration() throws RecognitionException { + NewDeclarationContext _localctx = new NewDeclarationContext(_ctx, getState()); + enterRule(_localctx, 44, RULE_newDeclaration); + try { + enterOuterAlt(_localctx, 1); + { + setState(275); + match(New); + setState(276); + match(Identifier); + setState(277); + match(OpenRoundBracket); + setState(278); + argumentList(); + setState(279); + match(ClosedRoundBracket); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ExpressionContext extends ParserRuleContext { + public UnaryExpressionContext unaryExpression() { + return getRuleContext(UnaryExpressionContext.class,0); + } + public BinaryExpressionContext binaryExpression() { + return getRuleContext(BinaryExpressionContext.class,0); + } + public ExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_expression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitExpression(this); + else return visitor.visitChildren(this); + } + } + + public final ExpressionContext expression() throws RecognitionException { + ExpressionContext _localctx = new ExpressionContext(_ctx, getState()); + enterRule(_localctx, 46, RULE_expression); + try { + setState(283); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(281); + unaryExpression(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(282); + binaryExpression(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class UnaryExpressionContext extends ParserRuleContext { + public TerminalNode This() { return getToken(SimpleJavaParser.This, 0); } + public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } + public MemberAccessContext memberAccess() { + return getRuleContext(MemberAccessContext.class,0); + } + public ValueContext value() { + return getRuleContext(ValueContext.class,0); + } + public NotExpressionContext notExpression() { + return getRuleContext(NotExpressionContext.class,0); + } + public StatementExpressionContext statementExpression() { + return getRuleContext(StatementExpressionContext.class,0); + } + public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } + public UnaryExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_unaryExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterUnaryExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitUnaryExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitUnaryExpression(this); + else return visitor.visitChildren(this); + } + } + + public final UnaryExpressionContext unaryExpression() throws RecognitionException { + UnaryExpressionContext _localctx = new UnaryExpressionContext(_ctx, getState()); + enterRule(_localctx, 48, RULE_unaryExpression); + try { + setState(295); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,25,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(285); + match(This); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(286); + match(Identifier); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(287); + memberAccess(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(288); + value(); + } + break; + case 5: + enterOuterAlt(_localctx, 5); + { + setState(289); + notExpression(); + } + break; + case 6: + enterOuterAlt(_localctx, 6); + { + setState(290); + statementExpression(); + } + break; + case 7: + enterOuterAlt(_localctx, 7); + { + setState(291); + match(OpenRoundBracket); + setState(292); + expression(); + setState(293); + match(ClosedRoundBracket); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class NotExpressionContext extends ParserRuleContext { + public TerminalNode Not() { return getToken(SimpleJavaParser.Not, 0); } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public NotExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_notExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterNotExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitNotExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitNotExpression(this); + else return visitor.visitChildren(this); + } + } + + public final NotExpressionContext notExpression() throws RecognitionException { + NotExpressionContext _localctx = new NotExpressionContext(_ctx, getState()); + enterRule(_localctx, 50, RULE_notExpression); + try { + enterOuterAlt(_localctx, 1); + { + setState(297); + match(Not); + setState(298); + expression(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class CrementExpressionContext extends ParserRuleContext { + public IncrementExpressionContext incrementExpression() { + return getRuleContext(IncrementExpressionContext.class,0); + } + public DecrementExpressionContext decrementExpression() { + return getRuleContext(DecrementExpressionContext.class,0); + } + public CrementExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_crementExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterCrementExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitCrementExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitCrementExpression(this); + else return visitor.visitChildren(this); + } + } + + public final CrementExpressionContext crementExpression() throws RecognitionException { + CrementExpressionContext _localctx = new CrementExpressionContext(_ctx, getState()); + enterRule(_localctx, 52, RULE_crementExpression); + try { + setState(302); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,26,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(300); + incrementExpression(); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(301); + decrementExpression(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class IncrementExpressionContext extends ParserRuleContext { + public PrefixIncrementExpressionContext prefixIncrementExpression() { + return getRuleContext(PrefixIncrementExpressionContext.class,0); + } + public SuffixIncrementExpressionContext suffixIncrementExpression() { + return getRuleContext(SuffixIncrementExpressionContext.class,0); + } + public IncrementExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_incrementExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterIncrementExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitIncrementExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitIncrementExpression(this); + else return visitor.visitChildren(this); + } + } + + public final IncrementExpressionContext incrementExpression() throws RecognitionException { + IncrementExpressionContext _localctx = new IncrementExpressionContext(_ctx, getState()); + enterRule(_localctx, 54, RULE_incrementExpression); + try { + setState(306); + _errHandler.sync(this); + switch (_input.LA(1)) { + case T__0: + enterOuterAlt(_localctx, 1); + { + setState(304); + prefixIncrementExpression(); + } + break; + case This: + case Identifier: + enterOuterAlt(_localctx, 2); + { + setState(305); + suffixIncrementExpression(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class PrefixIncrementExpressionContext extends ParserRuleContext { + public AssignableExpressionContext assignableExpression() { + return getRuleContext(AssignableExpressionContext.class,0); + } + public PrefixIncrementExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_prefixIncrementExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterPrefixIncrementExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitPrefixIncrementExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitPrefixIncrementExpression(this); + else return visitor.visitChildren(this); + } + } + + public final PrefixIncrementExpressionContext prefixIncrementExpression() throws RecognitionException { + PrefixIncrementExpressionContext _localctx = new PrefixIncrementExpressionContext(_ctx, getState()); + enterRule(_localctx, 56, RULE_prefixIncrementExpression); + try { + enterOuterAlt(_localctx, 1); + { + setState(308); + match(T__0); + setState(309); + assignableExpression(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class SuffixIncrementExpressionContext extends ParserRuleContext { + public AssignableExpressionContext assignableExpression() { + return getRuleContext(AssignableExpressionContext.class,0); + } + public SuffixIncrementExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_suffixIncrementExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterSuffixIncrementExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitSuffixIncrementExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitSuffixIncrementExpression(this); + else return visitor.visitChildren(this); + } + } + + public final SuffixIncrementExpressionContext suffixIncrementExpression() throws RecognitionException { + SuffixIncrementExpressionContext _localctx = new SuffixIncrementExpressionContext(_ctx, getState()); + enterRule(_localctx, 58, RULE_suffixIncrementExpression); + try { + enterOuterAlt(_localctx, 1); + { + setState(311); + assignableExpression(); + setState(312); + match(T__0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class DecrementExpressionContext extends ParserRuleContext { + public PrefixDecrementExpressionContext prefixDecrementExpression() { + return getRuleContext(PrefixDecrementExpressionContext.class,0); + } + public SuffixDecrementExpressionContext suffixDecrementExpression() { + return getRuleContext(SuffixDecrementExpressionContext.class,0); + } + public DecrementExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_decrementExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterDecrementExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitDecrementExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitDecrementExpression(this); + else return visitor.visitChildren(this); + } + } + + public final DecrementExpressionContext decrementExpression() throws RecognitionException { + DecrementExpressionContext _localctx = new DecrementExpressionContext(_ctx, getState()); + enterRule(_localctx, 60, RULE_decrementExpression); + try { + setState(316); + _errHandler.sync(this); + switch (_input.LA(1)) { + case T__1: + enterOuterAlt(_localctx, 1); + { + setState(314); + prefixDecrementExpression(); + } + break; + case This: + case Identifier: + enterOuterAlt(_localctx, 2); + { + setState(315); + suffixDecrementExpression(); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class PrefixDecrementExpressionContext extends ParserRuleContext { + public AssignableExpressionContext assignableExpression() { + return getRuleContext(AssignableExpressionContext.class,0); + } + public PrefixDecrementExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_prefixDecrementExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterPrefixDecrementExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitPrefixDecrementExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitPrefixDecrementExpression(this); + else return visitor.visitChildren(this); + } + } + + public final PrefixDecrementExpressionContext prefixDecrementExpression() throws RecognitionException { + PrefixDecrementExpressionContext _localctx = new PrefixDecrementExpressionContext(_ctx, getState()); + enterRule(_localctx, 62, RULE_prefixDecrementExpression); + try { + enterOuterAlt(_localctx, 1); + { + setState(318); + match(T__1); + setState(319); + assignableExpression(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class SuffixDecrementExpressionContext extends ParserRuleContext { + public AssignableExpressionContext assignableExpression() { + return getRuleContext(AssignableExpressionContext.class,0); + } + public SuffixDecrementExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_suffixDecrementExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterSuffixDecrementExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitSuffixDecrementExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitSuffixDecrementExpression(this); + else return visitor.visitChildren(this); + } + } + + public final SuffixDecrementExpressionContext suffixDecrementExpression() throws RecognitionException { + SuffixDecrementExpressionContext _localctx = new SuffixDecrementExpressionContext(_ctx, getState()); + enterRule(_localctx, 64, RULE_suffixDecrementExpression); + try { + enterOuterAlt(_localctx, 1); + { + setState(321); + assignableExpression(); + setState(322); + match(T__1); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class AssignableExpressionContext extends ParserRuleContext { + public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } + public MemberAccessContext memberAccess() { + return getRuleContext(MemberAccessContext.class,0); + } + public AssignableExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_assignableExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterAssignableExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitAssignableExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitAssignableExpression(this); + else return visitor.visitChildren(this); + } + } + + public final AssignableExpressionContext assignableExpression() throws RecognitionException { + AssignableExpressionContext _localctx = new AssignableExpressionContext(_ctx, getState()); + enterRule(_localctx, 66, RULE_assignableExpression); + try { + setState(326); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,29,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(324); + match(Identifier); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(325); + memberAccess(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class MemberAccessContext extends ParserRuleContext { + public TerminalNode This() { return getToken(SimpleJavaParser.This, 0); } + public List Dot() { return getTokens(SimpleJavaParser.Dot); } + public TerminalNode Dot(int i) { + return getToken(SimpleJavaParser.Dot, i); + } + public List Identifier() { return getTokens(SimpleJavaParser.Identifier); } + public TerminalNode Identifier(int i) { + return getToken(SimpleJavaParser.Identifier, i); + } + public MemberAccessContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_memberAccess; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterMemberAccess(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitMemberAccess(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitMemberAccess(this); + else return visitor.visitChildren(this); + } + } + + public final MemberAccessContext memberAccess() throws RecognitionException { + MemberAccessContext _localctx = new MemberAccessContext(_ctx, getState()); + enterRule(_localctx, 68, RULE_memberAccess); + int _la; + try { + int _alt; + setState(342); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,32,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(328); + match(This); + setState(329); + match(Dot); + setState(330); + match(Identifier); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(333); + _errHandler.sync(this); + _la = _input.LA(1); + if (_la==This) { + { + setState(331); + match(This); + setState(332); + match(Dot); + } + } + + setState(337); + _errHandler.sync(this); + _alt = 1; + do { + switch (_alt) { + case 1: + { + { + setState(335); + match(Identifier); + setState(336); + match(Dot); + } + } + break; + default: + throw new NoViableAltException(this); + } + setState(339); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,31,_ctx); + } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); + setState(341); + match(Identifier); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class BinaryExpressionContext extends ParserRuleContext { + public CalculationExpressionContext calculationExpression() { + return getRuleContext(CalculationExpressionContext.class,0); + } + public NonCalculationExpressionContext nonCalculationExpression() { + return getRuleContext(NonCalculationExpressionContext.class,0); + } + public BinaryExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_binaryExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterBinaryExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitBinaryExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitBinaryExpression(this); + else return visitor.visitChildren(this); + } + } + + public final BinaryExpressionContext binaryExpression() throws RecognitionException { + BinaryExpressionContext _localctx = new BinaryExpressionContext(_ctx, getState()); + enterRule(_localctx, 70, RULE_binaryExpression); + try { + setState(346); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,33,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(344); + calculationExpression(0); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(345); + nonCalculationExpression(); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class CalculationExpressionContext extends ParserRuleContext { + public DotExpressionContext dotExpression() { + return getRuleContext(DotExpressionContext.class,0); + } + public CalculationExpressionContext calculationExpression() { + return getRuleContext(CalculationExpressionContext.class,0); + } + public TerminalNode LineOperator() { return getToken(SimpleJavaParser.LineOperator, 0); } + public CalculationExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_calculationExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterCalculationExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitCalculationExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitCalculationExpression(this); + else return visitor.visitChildren(this); + } + } + + public final CalculationExpressionContext calculationExpression() throws RecognitionException { + return calculationExpression(0); + } + + private CalculationExpressionContext calculationExpression(int _p) throws RecognitionException { + ParserRuleContext _parentctx = _ctx; + int _parentState = getState(); + CalculationExpressionContext _localctx = new CalculationExpressionContext(_ctx, _parentState); + CalculationExpressionContext _prevctx = _localctx; + int _startState = 72; + enterRecursionRule(_localctx, 72, RULE_calculationExpression, _p); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + { + setState(349); + dotExpression(0); + } + _ctx.stop = _input.LT(-1); + setState(356); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,34,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + if ( _parseListeners!=null ) triggerExitRuleEvent(); + _prevctx = _localctx; + { + { + _localctx = new CalculationExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_calculationExpression); + setState(351); + if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); + setState(352); + match(LineOperator); + setState(353); + dotExpression(0); + } + } + } + setState(358); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,34,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + unrollRecursionContexts(_parentctx); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class DotExpressionContext extends ParserRuleContext { + public DotSubtractionExpressionContext dotSubtractionExpression() { + return getRuleContext(DotSubtractionExpressionContext.class,0); + } + public DotExpressionContext dotExpression() { + return getRuleContext(DotExpressionContext.class,0); + } + public TerminalNode DotOperator() { return getToken(SimpleJavaParser.DotOperator, 0); } + public DotExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_dotExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterDotExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitDotExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitDotExpression(this); + else return visitor.visitChildren(this); + } + } + + public final DotExpressionContext dotExpression() throws RecognitionException { + return dotExpression(0); + } + + private DotExpressionContext dotExpression(int _p) throws RecognitionException { + ParserRuleContext _parentctx = _ctx; + int _parentState = getState(); + DotExpressionContext _localctx = new DotExpressionContext(_ctx, _parentState); + DotExpressionContext _prevctx = _localctx; + int _startState = 74; + enterRecursionRule(_localctx, 74, RULE_dotExpression, _p); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + { + setState(360); + dotSubtractionExpression(); + } + _ctx.stop = _input.LT(-1); + setState(367); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,35,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + if ( _parseListeners!=null ) triggerExitRuleEvent(); + _prevctx = _localctx; + { + { + _localctx = new DotExpressionContext(_parentctx, _parentState); + pushNewRecursionContext(_localctx, _startState, RULE_dotExpression); + setState(362); + if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); + setState(363); + match(DotOperator); + setState(364); + dotSubtractionExpression(); + } + } + } + setState(369); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,35,_ctx); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + unrollRecursionContexts(_parentctx); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class DotSubtractionExpressionContext extends ParserRuleContext { + public TerminalNode IntValue() { return getToken(SimpleJavaParser.IntValue, 0); } + public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } + public MemberAccessContext memberAccess() { + return getRuleContext(MemberAccessContext.class,0); + } + public MethodCallContext methodCall() { + return getRuleContext(MethodCallContext.class,0); + } + public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } + public CalculationExpressionContext calculationExpression() { + return getRuleContext(CalculationExpressionContext.class,0); + } + public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } + public DotSubtractionExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_dotSubtractionExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterDotSubtractionExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitDotSubtractionExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitDotSubtractionExpression(this); + else return visitor.visitChildren(this); + } + } + + public final DotSubtractionExpressionContext dotSubtractionExpression() throws RecognitionException { + DotSubtractionExpressionContext _localctx = new DotSubtractionExpressionContext(_ctx, getState()); + enterRule(_localctx, 76, RULE_dotSubtractionExpression); + try { + setState(378); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,36,_ctx) ) { + case 1: + enterOuterAlt(_localctx, 1); + { + setState(370); + match(IntValue); + } + break; + case 2: + enterOuterAlt(_localctx, 2); + { + setState(371); + match(Identifier); + } + break; + case 3: + enterOuterAlt(_localctx, 3); + { + setState(372); + memberAccess(); + } + break; + case 4: + enterOuterAlt(_localctx, 4); + { + setState(373); + methodCall(); + setState(374); + match(OpenRoundBracket); + setState(375); + calculationExpression(0); + setState(376); + match(ClosedRoundBracket); + } + break; + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class NonCalculationExpressionContext extends ParserRuleContext { + public UnaryExpressionContext unaryExpression() { + return getRuleContext(UnaryExpressionContext.class,0); + } + public NonCalculationOperatorContext nonCalculationOperator() { + return getRuleContext(NonCalculationOperatorContext.class,0); + } + public ExpressionContext expression() { + return getRuleContext(ExpressionContext.class,0); + } + public NonCalculationExpressionContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_nonCalculationExpression; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterNonCalculationExpression(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitNonCalculationExpression(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitNonCalculationExpression(this); + else return visitor.visitChildren(this); + } + } + + public final NonCalculationExpressionContext nonCalculationExpression() throws RecognitionException { + NonCalculationExpressionContext _localctx = new NonCalculationExpressionContext(_ctx, getState()); + enterRule(_localctx, 78, RULE_nonCalculationExpression); + try { + enterOuterAlt(_localctx, 1); + { + setState(380); + unaryExpression(); + setState(381); + nonCalculationOperator(); + setState(382); + expression(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class MethodCallContext extends ParserRuleContext { + public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } + public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } + public ArgumentListContext argumentList() { + return getRuleContext(ArgumentListContext.class,0); + } + public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } + public TargetContext target() { + return getRuleContext(TargetContext.class,0); + } + public List chainedMethod() { + return getRuleContexts(ChainedMethodContext.class); + } + public ChainedMethodContext chainedMethod(int i) { + return getRuleContext(ChainedMethodContext.class,i); + } + public MethodCallContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_methodCall; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterMethodCall(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitMethodCall(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitMethodCall(this); + else return visitor.visitChildren(this); + } + } + + public final MethodCallContext methodCall() throws RecognitionException { + MethodCallContext _localctx = new MethodCallContext(_ctx, getState()); + enterRule(_localctx, 80, RULE_methodCall); + try { + int _alt; + enterOuterAlt(_localctx, 1); + { + setState(385); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,37,_ctx) ) { + case 1: + { + setState(384); + target(); + } + break; + } + setState(390); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,38,_ctx); + while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + setState(387); + chainedMethod(); + } + } + } + setState(392); + _errHandler.sync(this); + _alt = getInterpreter().adaptivePredict(_input,38,_ctx); + } + setState(393); + match(Identifier); + setState(394); + match(OpenRoundBracket); + setState(395); + argumentList(); + setState(396); + match(ClosedRoundBracket); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class TargetContext extends ParserRuleContext { + public TerminalNode Dot() { return getToken(SimpleJavaParser.Dot, 0); } + public TerminalNode This() { return getToken(SimpleJavaParser.This, 0); } + public MemberAccessContext memberAccess() { + return getRuleContext(MemberAccessContext.class,0); + } + public NewDeclarationContext newDeclaration() { + return getRuleContext(NewDeclarationContext.class,0); + } + public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } + public TargetContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_target; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterTarget(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitTarget(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitTarget(this); + else return visitor.visitChildren(this); + } + } + + public final TargetContext target() throws RecognitionException { + TargetContext _localctx = new TargetContext(_ctx, getState()); + enterRule(_localctx, 82, RULE_target); + try { + enterOuterAlt(_localctx, 1); + { + setState(402); + _errHandler.sync(this); + switch ( getInterpreter().adaptivePredict(_input,39,_ctx) ) { + case 1: + { + setState(398); + match(This); + } + break; + case 2: + { + setState(399); + memberAccess(); + } + break; + case 3: + { + setState(400); + newDeclaration(); + } + break; + case 4: + { + setState(401); + match(Identifier); + } + break; + } + setState(404); + match(Dot); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ChainedMethodContext extends ParserRuleContext { + public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } + public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } + public ArgumentListContext argumentList() { + return getRuleContext(ArgumentListContext.class,0); + } + public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } + public TerminalNode Dot() { return getToken(SimpleJavaParser.Dot, 0); } + public ChainedMethodContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_chainedMethod; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterChainedMethod(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitChainedMethod(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitChainedMethod(this); + else return visitor.visitChildren(this); + } + } + + public final ChainedMethodContext chainedMethod() throws RecognitionException { + ChainedMethodContext _localctx = new ChainedMethodContext(_ctx, getState()); + enterRule(_localctx, 84, RULE_chainedMethod); + try { + enterOuterAlt(_localctx, 1); + { + setState(406); + match(Identifier); + setState(407); + match(OpenRoundBracket); + setState(408); + argumentList(); + setState(409); + match(ClosedRoundBracket); + setState(410); + match(Dot); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class TypeContext extends ParserRuleContext { + public TerminalNode Int() { return getToken(SimpleJavaParser.Int, 0); } + public TerminalNode Boolean() { return getToken(SimpleJavaParser.Boolean, 0); } + public TerminalNode Char() { return getToken(SimpleJavaParser.Char, 0); } + public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } + public TypeContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_type; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterType(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitType(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitType(this); + else return visitor.visitChildren(this); + } + } + + public final TypeContext type() throws RecognitionException { + TypeContext _localctx = new TypeContext(_ctx, getState()); + enterRule(_localctx, 86, RULE_type); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(412); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 281474976710768L) != 0)) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class ValueContext extends ParserRuleContext { + public TerminalNode IntValue() { return getToken(SimpleJavaParser.IntValue, 0); } + public TerminalNode BooleanValue() { return getToken(SimpleJavaParser.BooleanValue, 0); } + public TerminalNode CharValue() { return getToken(SimpleJavaParser.CharValue, 0); } + public TerminalNode NullValue() { return getToken(SimpleJavaParser.NullValue, 0); } + public ValueContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_value; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterValue(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitValue(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitValue(this); + else return visitor.visitChildren(this); + } + } + + public final ValueContext value() throws RecognitionException { + ValueContext _localctx = new ValueContext(_ctx, getState()); + enterRule(_localctx, 88, RULE_value); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(414); + _la = _input.LA(1); + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 263882790666240L) != 0)) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + @SuppressWarnings("CheckReturnValue") + public static class NonCalculationOperatorContext extends ParserRuleContext { + public TerminalNode LogicalOperator() { return getToken(SimpleJavaParser.LogicalOperator, 0); } + public TerminalNode ComparisonOperator() { return getToken(SimpleJavaParser.ComparisonOperator, 0); } + public NonCalculationOperatorContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_nonCalculationOperator; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterNonCalculationOperator(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitNonCalculationOperator(this); + } + @Override + public T accept(ParseTreeVisitor visitor) { + if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitNonCalculationOperator(this); + else return visitor.visitChildren(this); + } + } + + public final NonCalculationOperatorContext nonCalculationOperator() throws RecognitionException { + NonCalculationOperatorContext _localctx = new NonCalculationOperatorContext(_ctx, getState()); + enterRule(_localctx, 90, RULE_nonCalculationOperator); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(416); + _la = _input.LA(1); + if ( !(_la==ComparisonOperator || _la==LogicalOperator) ) { + _errHandler.recoverInline(this); + } + else { + if ( _input.LA(1)==Token.EOF ) matchedEOF = true; + _errHandler.reportMatch(this); + consume(); + } + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { + switch (ruleIndex) { + case 36: + return calculationExpression_sempred((CalculationExpressionContext)_localctx, predIndex); + case 37: + return dotExpression_sempred((DotExpressionContext)_localctx, predIndex); + } + return true; + } + private boolean calculationExpression_sempred(CalculationExpressionContext _localctx, int predIndex) { + switch (predIndex) { + case 0: + return precpred(_ctx, 2); + } + return true; + } + private boolean dotExpression_sempred(DotExpressionContext _localctx, int predIndex) { + switch (predIndex) { + case 1: + return precpred(_ctx, 2); + } + return true; + } + + public static final String _serializedATN = + "\u0004\u00013\u01a3\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ + "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ + "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+ + "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+ + "\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0002\u000f\u0007\u000f"+ + "\u0002\u0010\u0007\u0010\u0002\u0011\u0007\u0011\u0002\u0012\u0007\u0012"+ + "\u0002\u0013\u0007\u0013\u0002\u0014\u0007\u0014\u0002\u0015\u0007\u0015"+ + "\u0002\u0016\u0007\u0016\u0002\u0017\u0007\u0017\u0002\u0018\u0007\u0018"+ + "\u0002\u0019\u0007\u0019\u0002\u001a\u0007\u001a\u0002\u001b\u0007\u001b"+ + "\u0002\u001c\u0007\u001c\u0002\u001d\u0007\u001d\u0002\u001e\u0007\u001e"+ + "\u0002\u001f\u0007\u001f\u0002 \u0007 \u0002!\u0007!\u0002\"\u0007\"\u0002"+ + "#\u0007#\u0002$\u0007$\u0002%\u0007%\u0002&\u0007&\u0002\'\u0007\'\u0002"+ + "(\u0007(\u0002)\u0007)\u0002*\u0007*\u0002+\u0007+\u0002,\u0007,\u0002"+ + "-\u0007-\u0001\u0000\u0004\u0000^\b\u0000\u000b\u0000\f\u0000_\u0001\u0001"+ + "\u0003\u0001c\b\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001"+ + "\u0005\u0001i\b\u0001\n\u0001\f\u0001l\t\u0001\u0001\u0001\u0001\u0001"+ + "\u0001\u0002\u0001\u0002\u0001\u0002\u0003\u0002s\b\u0002\u0001\u0003"+ + "\u0003\u0003v\b\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0003\u0003"+ + "{\b\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0004\u0003\u0004"+ + "\u0081\b\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0005"+ + "\u0001\u0005\u0001\u0005\u0003\u0005\u008a\b\u0005\u0001\u0005\u0001\u0005"+ + "\u0003\u0005\u008e\b\u0005\u0001\u0005\u0001\u0005\u0001\u0005\u0003\u0005"+ + "\u0093\b\u0005\u0001\u0005\u0001\u0005\u0003\u0005\u0097\b\u0005\u0001"+ + "\u0006\u0001\u0006\u0001\u0006\u0005\u0006\u009c\b\u0006\n\u0006\f\u0006"+ + "\u009f\t\u0006\u0001\u0007\u0001\u0007\u0001\u0007\u0001\b\u0001\b\u0001"+ + "\b\u0005\b\u00a7\b\b\n\b\f\b\u00aa\t\b\u0003\b\u00ac\b\b\u0001\t\u0001"+ + "\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001"+ + "\t\u0001\t\u0001\t\u0001\t\u0003\t\u00bc\b\t\u0001\n\u0001\n\u0005\n\u00c0"+ + "\b\n\n\n\f\n\u00c3\t\n\u0001\n\u0001\n\u0001\u000b\u0001\u000b\u0003\u000b"+ + "\u00c9\b\u000b\u0001\f\u0001\f\u0001\f\u0001\f\u0003\f\u00cf\b\f\u0001"+ + "\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\u000e\u0001\u000e\u0001"+ + "\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001"+ + "\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0003\u000f\u00e3\b\u000f\u0001"+ + "\u000f\u0001\u000f\u0003\u000f\u00e7\b\u000f\u0001\u000f\u0001\u000f\u0003"+ + "\u000f\u00eb\b\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u0010\u0001"+ + "\u0010\u0005\u0010\u00f2\b\u0010\n\u0010\f\u0010\u00f5\t\u0010\u0001\u0010"+ + "\u0003\u0010\u00f8\b\u0010\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0011"+ + "\u0001\u0011\u0001\u0011\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012"+ + "\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0013\u0001\u0013\u0001\u0013"+ + "\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0003\u0014\u010e\b\u0014"+ + "\u0001\u0015\u0001\u0015\u0001\u0015\u0001\u0015\u0001\u0016\u0001\u0016"+ + "\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0017\u0001\u0017"+ + "\u0003\u0017\u011c\b\u0017\u0001\u0018\u0001\u0018\u0001\u0018\u0001\u0018"+ + "\u0001\u0018\u0001\u0018\u0001\u0018\u0001\u0018\u0001\u0018\u0001\u0018"+ + "\u0003\u0018\u0128\b\u0018\u0001\u0019\u0001\u0019\u0001\u0019\u0001\u001a"+ + "\u0001\u001a\u0003\u001a\u012f\b\u001a\u0001\u001b\u0001\u001b\u0003\u001b"+ + "\u0133\b\u001b\u0001\u001c\u0001\u001c\u0001\u001c\u0001\u001d\u0001\u001d"+ + "\u0001\u001d\u0001\u001e\u0001\u001e\u0003\u001e\u013d\b\u001e\u0001\u001f"+ + "\u0001\u001f\u0001\u001f\u0001 \u0001 \u0001 \u0001!\u0001!\u0003!\u0147"+ + "\b!\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0003\"\u014e\b\"\u0001\""+ + "\u0001\"\u0004\"\u0152\b\"\u000b\"\f\"\u0153\u0001\"\u0003\"\u0157\b\""+ + "\u0001#\u0001#\u0003#\u015b\b#\u0001$\u0001$\u0001$\u0001$\u0001$\u0001"+ + "$\u0005$\u0163\b$\n$\f$\u0166\t$\u0001%\u0001%\u0001%\u0001%\u0001%\u0001"+ + "%\u0005%\u016e\b%\n%\f%\u0171\t%\u0001&\u0001&\u0001&\u0001&\u0001&\u0001"+ + "&\u0001&\u0001&\u0003&\u017b\b&\u0001\'\u0001\'\u0001\'\u0001\'\u0001"+ + "(\u0003(\u0182\b(\u0001(\u0005(\u0185\b(\n(\f(\u0188\t(\u0001(\u0001("+ + "\u0001(\u0001(\u0001(\u0001)\u0001)\u0001)\u0001)\u0003)\u0193\b)\u0001"+ + ")\u0001)\u0001*\u0001*\u0001*\u0001*\u0001*\u0001*\u0001+\u0001+\u0001"+ + ",\u0001,\u0001-\u0001-\u0001-\u0000\u0002HJ.\u0000\u0002\u0004\u0006\b"+ + "\n\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u001c\u001e \"$&(*,.02"+ + "468:<>@BDFHJLNPRTVXZ\u0000\u0003\u0002\u0000\u0004\u000600\u0001\u0000"+ + ",/\u0001\u0000\u000b\f\u01ae\u0000]\u0001\u0000\u0000\u0000\u0002b\u0001"+ + "\u0000\u0000\u0000\u0004r\u0001\u0000\u0000\u0000\u0006u\u0001\u0000\u0000"+ + "\u0000\b\u0080\u0001\u0000\u0000\u0000\n\u0096\u0001\u0000\u0000\u0000"+ + "\f\u0098\u0001\u0000\u0000\u0000\u000e\u00a0\u0001\u0000\u0000\u0000\u0010"+ + "\u00ab\u0001\u0000\u0000\u0000\u0012\u00bb\u0001\u0000\u0000\u0000\u0014"+ + "\u00bd\u0001\u0000\u0000\u0000\u0016\u00c6\u0001\u0000\u0000\u0000\u0018"+ + "\u00ca\u0001\u0000\u0000\u0000\u001a\u00d0\u0001\u0000\u0000\u0000\u001c"+ + "\u00d6\u0001\u0000\u0000\u0000\u001e\u00de\u0001\u0000\u0000\u0000 \u00ef"+ + "\u0001\u0000\u0000\u0000\"\u00f9\u0001\u0000\u0000\u0000$\u00ff\u0001"+ + "\u0000\u0000\u0000&\u0106\u0001\u0000\u0000\u0000(\u010d\u0001\u0000\u0000"+ + "\u0000*\u010f\u0001\u0000\u0000\u0000,\u0113\u0001\u0000\u0000\u0000."+ + "\u011b\u0001\u0000\u0000\u00000\u0127\u0001\u0000\u0000\u00002\u0129\u0001"+ + "\u0000\u0000\u00004\u012e\u0001\u0000\u0000\u00006\u0132\u0001\u0000\u0000"+ + "\u00008\u0134\u0001\u0000\u0000\u0000:\u0137\u0001\u0000\u0000\u0000<"+ + "\u013c\u0001\u0000\u0000\u0000>\u013e\u0001\u0000\u0000\u0000@\u0141\u0001"+ + "\u0000\u0000\u0000B\u0146\u0001\u0000\u0000\u0000D\u0156\u0001\u0000\u0000"+ + "\u0000F\u015a\u0001\u0000\u0000\u0000H\u015c\u0001\u0000\u0000\u0000J"+ + "\u0167\u0001\u0000\u0000\u0000L\u017a\u0001\u0000\u0000\u0000N\u017c\u0001"+ + "\u0000\u0000\u0000P\u0181\u0001\u0000\u0000\u0000R\u0192\u0001\u0000\u0000"+ + "\u0000T\u0196\u0001\u0000\u0000\u0000V\u019c\u0001\u0000\u0000\u0000X"+ + "\u019e\u0001\u0000\u0000\u0000Z\u01a0\u0001\u0000\u0000\u0000\\^\u0003"+ + "\u0002\u0001\u0000]\\\u0001\u0000\u0000\u0000^_\u0001\u0000\u0000\u0000"+ + "_]\u0001\u0000\u0000\u0000_`\u0001\u0000\u0000\u0000`\u0001\u0001\u0000"+ + "\u0000\u0000ac\u0005\u0007\u0000\u0000ba\u0001\u0000\u0000\u0000bc\u0001"+ + "\u0000\u0000\u0000cd\u0001\u0000\u0000\u0000de\u0005#\u0000\u0000ef\u0005"+ + "0\u0000\u0000fj\u0005\u001f\u0000\u0000gi\u0003\u0004\u0002\u0000hg\u0001"+ + "\u0000\u0000\u0000il\u0001\u0000\u0000\u0000jh\u0001\u0000\u0000\u0000"+ + "jk\u0001\u0000\u0000\u0000km\u0001\u0000\u0000\u0000lj\u0001\u0000\u0000"+ + "\u0000mn\u0005 \u0000\u0000n\u0003\u0001\u0000\u0000\u0000os\u0003\u0006"+ + "\u0003\u0000ps\u0003\b\u0004\u0000qs\u0003\n\u0005\u0000ro\u0001\u0000"+ + "\u0000\u0000rp\u0001\u0000\u0000\u0000rq\u0001\u0000\u0000\u0000s\u0005"+ + "\u0001\u0000\u0000\u0000tv\u0005\u0007\u0000\u0000ut\u0001\u0000\u0000"+ + "\u0000uv\u0001\u0000\u0000\u0000vw\u0001\u0000\u0000\u0000wx\u00050\u0000"+ + "\u0000xz\u0005\u001d\u0000\u0000y{\u0003\f\u0006\u0000zy\u0001\u0000\u0000"+ + "\u0000z{\u0001\u0000\u0000\u0000{|\u0001\u0000\u0000\u0000|}\u0005\u001e"+ + "\u0000\u0000}~\u0003\u0014\n\u0000~\u0007\u0001\u0000\u0000\u0000\u007f"+ + "\u0081\u0005\u0007\u0000\u0000\u0080\u007f\u0001\u0000\u0000\u0000\u0080"+ + "\u0081\u0001\u0000\u0000\u0000\u0081\u0082\u0001\u0000\u0000\u0000\u0082"+ + "\u0083\u0003V+\u0000\u0083\u0084\u00050\u0000\u0000\u0084\u0085\u0005"+ + "!\u0000\u0000\u0085\t\u0001\u0000\u0000\u0000\u0086\u0087\u0005\b\u0000"+ + "\u0000\u0087\u0097\u0003\u0014\n\u0000\u0088\u008a\u0005\u0007\u0000\u0000"+ + "\u0089\u0088\u0001\u0000\u0000\u0000\u0089\u008a\u0001\u0000\u0000\u0000"+ + "\u008a\u008d\u0001\u0000\u0000\u0000\u008b\u008e\u0003V+\u0000\u008c\u008e"+ + "\u0005\u0003\u0000\u0000\u008d\u008b\u0001\u0000\u0000\u0000\u008d\u008c"+ + "\u0001\u0000\u0000\u0000\u008e\u008f\u0001\u0000\u0000\u0000\u008f\u0090"+ + "\u00050\u0000\u0000\u0090\u0092\u0005\u001d\u0000\u0000\u0091\u0093\u0003"+ + "\f\u0006\u0000\u0092\u0091\u0001\u0000\u0000\u0000\u0092\u0093\u0001\u0000"+ + "\u0000\u0000\u0093\u0094\u0001\u0000\u0000\u0000\u0094\u0095\u0005\u001e"+ + "\u0000\u0000\u0095\u0097\u0003\u0014\n\u0000\u0096\u0086\u0001\u0000\u0000"+ + "\u0000\u0096\u0089\u0001\u0000\u0000\u0000\u0097\u000b\u0001\u0000\u0000"+ + "\u0000\u0098\u009d\u0003\u000e\u0007\u0000\u0099\u009a\u0005\"\u0000\u0000"+ + "\u009a\u009c\u0003\u000e\u0007\u0000\u009b\u0099\u0001\u0000\u0000\u0000"+ + "\u009c\u009f\u0001\u0000\u0000\u0000\u009d\u009b\u0001\u0000\u0000\u0000"+ + "\u009d\u009e\u0001\u0000\u0000\u0000\u009e\r\u0001\u0000\u0000\u0000\u009f"+ + "\u009d\u0001\u0000\u0000\u0000\u00a0\u00a1\u0003V+\u0000\u00a1\u00a2\u0005"+ + "0\u0000\u0000\u00a2\u000f\u0001\u0000\u0000\u0000\u00a3\u00a8\u0003.\u0017"+ + "\u0000\u00a4\u00a5\u0005\"\u0000\u0000\u00a5\u00a7\u0003.\u0017\u0000"+ + "\u00a6\u00a4\u0001\u0000\u0000\u0000\u00a7\u00aa\u0001\u0000\u0000\u0000"+ + "\u00a8\u00a6\u0001\u0000\u0000\u0000\u00a8\u00a9\u0001\u0000\u0000\u0000"+ + "\u00a9\u00ac\u0001\u0000\u0000\u0000\u00aa\u00a8\u0001\u0000\u0000\u0000"+ + "\u00ab\u00a3\u0001\u0000\u0000\u0000\u00ab\u00ac\u0001\u0000\u0000\u0000"+ + "\u00ac\u0011\u0001\u0000\u0000\u0000\u00ad\u00ae\u0003\u0016\u000b\u0000"+ + "\u00ae\u00af\u0005!\u0000\u0000\u00af\u00bc\u0001\u0000\u0000\u0000\u00b0"+ + "\u00b1\u0003\u0018\f\u0000\u00b1\u00b2\u0005!\u0000\u0000\u00b2\u00bc"+ + "\u0001\u0000\u0000\u0000\u00b3\u00bc\u0003\u0014\n\u0000\u00b4\u00bc\u0003"+ + "\u001a\r\u0000\u00b5\u00bc\u0003\u001c\u000e\u0000\u00b6\u00bc\u0003\u001e"+ + "\u000f\u0000\u00b7\u00bc\u0003 \u0010\u0000\u00b8\u00b9\u0003(\u0014\u0000"+ + "\u00b9\u00ba\u0005!\u0000\u0000\u00ba\u00bc\u0001\u0000\u0000\u0000\u00bb"+ + "\u00ad\u0001\u0000\u0000\u0000\u00bb\u00b0\u0001\u0000\u0000\u0000\u00bb"+ + "\u00b3\u0001\u0000\u0000\u0000\u00bb\u00b4\u0001\u0000\u0000\u0000\u00bb"+ + "\u00b5\u0001\u0000\u0000\u0000\u00bb\u00b6\u0001\u0000\u0000\u0000\u00bb"+ + "\u00b7\u0001\u0000\u0000\u0000\u00bb\u00b8\u0001\u0000\u0000\u0000\u00bc"+ + "\u0013\u0001\u0000\u0000\u0000\u00bd\u00c1\u0005\u001f\u0000\u0000\u00be"+ + "\u00c0\u0003\u0012\t\u0000\u00bf\u00be\u0001\u0000\u0000\u0000\u00c0\u00c3"+ + "\u0001\u0000\u0000\u0000\u00c1\u00bf\u0001\u0000\u0000\u0000\u00c1\u00c2"+ + "\u0001\u0000\u0000\u0000\u00c2\u00c4\u0001\u0000\u0000\u0000\u00c3\u00c1"+ + "\u0001\u0000\u0000\u0000\u00c4\u00c5\u0005 \u0000\u0000\u00c5\u0015\u0001"+ + "\u0000\u0000\u0000\u00c6\u00c8\u0005*\u0000\u0000\u00c7\u00c9\u0003.\u0017"+ + "\u0000\u00c8\u00c7\u0001\u0000\u0000\u0000\u00c8\u00c9\u0001\u0000\u0000"+ + "\u0000\u00c9\u0017\u0001\u0000\u0000\u0000\u00ca\u00cb\u0003V+\u0000\u00cb"+ + "\u00ce\u00050\u0000\u0000\u00cc\u00cd\u0005\r\u0000\u0000\u00cd\u00cf"+ + "\u0003.\u0017\u0000\u00ce\u00cc\u0001\u0000\u0000\u0000\u00ce\u00cf\u0001"+ + "\u0000\u0000\u0000\u00cf\u0019\u0001\u0000\u0000\u0000\u00d0\u00d1\u0005"+ + "%\u0000\u0000\u00d1\u00d2\u0005\u001d\u0000\u0000\u00d2\u00d3\u0003.\u0017"+ + "\u0000\u00d3\u00d4\u0005\u001e\u0000\u0000\u00d4\u00d5\u0003\u0014\n\u0000"+ + "\u00d5\u001b\u0001\u0000\u0000\u0000\u00d6\u00d7\u0005&\u0000\u0000\u00d7"+ + "\u00d8\u0003\u0014\n\u0000\u00d8\u00d9\u0005%\u0000\u0000\u00d9\u00da"+ + "\u0005\u001d\u0000\u0000\u00da\u00db\u0003.\u0017\u0000\u00db\u00dc\u0005"+ + "\u001e\u0000\u0000\u00dc\u00dd\u0005!\u0000\u0000\u00dd\u001d\u0001\u0000"+ + "\u0000\u0000\u00de\u00df\u0005)\u0000\u0000\u00df\u00e2\u0005\u001d\u0000"+ + "\u0000\u00e0\u00e3\u0003(\u0014\u0000\u00e1\u00e3\u0003\u0018\f\u0000"+ + "\u00e2\u00e0\u0001\u0000\u0000\u0000\u00e2\u00e1\u0001\u0000\u0000\u0000"+ + "\u00e3\u00e4\u0001\u0000\u0000\u0000\u00e4\u00e6\u0005!\u0000\u0000\u00e5"+ + "\u00e7\u0003.\u0017\u0000\u00e6\u00e5\u0001\u0000\u0000\u0000\u00e6\u00e7"+ + "\u0001\u0000\u0000\u0000\u00e7\u00e8\u0001\u0000\u0000\u0000\u00e8\u00ea"+ + "\u0005!\u0000\u0000\u00e9\u00eb\u0003(\u0014\u0000\u00ea\u00e9\u0001\u0000"+ + "\u0000\u0000\u00ea\u00eb\u0001\u0000\u0000\u0000\u00eb\u00ec\u0001\u0000"+ + "\u0000\u0000\u00ec\u00ed\u0005\u001e\u0000\u0000\u00ed\u00ee\u0003\u0014"+ + "\n\u0000\u00ee\u001f\u0001\u0000\u0000\u0000\u00ef\u00f3\u0003\"\u0011"+ + "\u0000\u00f0\u00f2\u0003$\u0012\u0000\u00f1\u00f0\u0001\u0000\u0000\u0000"+ + "\u00f2\u00f5\u0001\u0000\u0000\u0000\u00f3\u00f1\u0001\u0000\u0000\u0000"+ + "\u00f3\u00f4\u0001\u0000\u0000\u0000\u00f4\u00f7\u0001\u0000\u0000\u0000"+ + "\u00f5\u00f3\u0001\u0000\u0000\u0000\u00f6\u00f8\u0003&\u0013\u0000\u00f7"+ + "\u00f6\u0001\u0000\u0000\u0000\u00f7\u00f8\u0001\u0000\u0000\u0000\u00f8"+ + "!\u0001\u0000\u0000\u0000\u00f9\u00fa\u0005\'\u0000\u0000\u00fa\u00fb"+ + "\u0005\u001d\u0000\u0000\u00fb\u00fc\u0003.\u0017\u0000\u00fc\u00fd\u0005"+ + "\u001e\u0000\u0000\u00fd\u00fe\u0003\u0014\n\u0000\u00fe#\u0001\u0000"+ + "\u0000\u0000\u00ff\u0100\u0005(\u0000\u0000\u0100\u0101\u0005\'\u0000"+ + "\u0000\u0101\u0102\u0005\u001d\u0000\u0000\u0102\u0103\u0003.\u0017\u0000"+ + "\u0103\u0104\u0005\u001e\u0000\u0000\u0104\u0105\u0003\u0014\n\u0000\u0105"+ + "%\u0001\u0000\u0000\u0000\u0106\u0107\u0005(\u0000\u0000\u0107\u0108\u0003"+ + "\u0014\n\u0000\u0108\'\u0001\u0000\u0000\u0000\u0109\u010e\u0003*\u0015"+ + "\u0000\u010a\u010e\u0003,\u0016\u0000\u010b\u010e\u0003P(\u0000\u010c"+ + "\u010e\u00034\u001a\u0000\u010d\u0109\u0001\u0000\u0000\u0000\u010d\u010a"+ + "\u0001\u0000\u0000\u0000\u010d\u010b\u0001\u0000\u0000\u0000\u010d\u010c"+ + "\u0001\u0000\u0000\u0000\u010e)\u0001\u0000\u0000\u0000\u010f\u0110\u0003"+ + "B!\u0000\u0110\u0111\u0005\r\u0000\u0000\u0111\u0112\u0003.\u0017\u0000"+ + "\u0112+\u0001\u0000\u0000\u0000\u0113\u0114\u0005+\u0000\u0000\u0114\u0115"+ + "\u00050\u0000\u0000\u0115\u0116\u0005\u001d\u0000\u0000\u0116\u0117\u0003"+ + "\u0010\b\u0000\u0117\u0118\u0005\u001e\u0000\u0000\u0118-\u0001\u0000"+ + "\u0000\u0000\u0119\u011c\u00030\u0018\u0000\u011a\u011c\u0003F#\u0000"+ + "\u011b\u0119\u0001\u0000\u0000\u0000\u011b\u011a\u0001\u0000\u0000\u0000"+ + "\u011c/\u0001\u0000\u0000\u0000\u011d\u0128\u0005$\u0000\u0000\u011e\u0128"+ + "\u00050\u0000\u0000\u011f\u0128\u0003D\"\u0000\u0120\u0128\u0003X,\u0000"+ + "\u0121\u0128\u00032\u0019\u0000\u0122\u0128\u0003(\u0014\u0000\u0123\u0124"+ + "\u0005\u001d\u0000\u0000\u0124\u0125\u0003.\u0017\u0000\u0125\u0126\u0005"+ + "\u001e\u0000\u0000\u0126\u0128\u0001\u0000\u0000\u0000\u0127\u011d\u0001"+ + "\u0000\u0000\u0000\u0127\u011e\u0001\u0000\u0000\u0000\u0127\u011f\u0001"+ + "\u0000\u0000\u0000\u0127\u0120\u0001\u0000\u0000\u0000\u0127\u0121\u0001"+ + "\u0000\u0000\u0000\u0127\u0122\u0001\u0000\u0000\u0000\u0127\u0123\u0001"+ + "\u0000\u0000\u0000\u01281\u0001\u0000\u0000\u0000\u0129\u012a\u0005\u0019"+ + "\u0000\u0000\u012a\u012b\u0003.\u0017\u0000\u012b3\u0001\u0000\u0000\u0000"+ + "\u012c\u012f\u00036\u001b\u0000\u012d\u012f\u0003<\u001e\u0000\u012e\u012c"+ + "\u0001\u0000\u0000\u0000\u012e\u012d\u0001\u0000\u0000\u0000\u012f5\u0001"+ + "\u0000\u0000\u0000\u0130\u0133\u00038\u001c\u0000\u0131\u0133\u0003:\u001d"+ + "\u0000\u0132\u0130\u0001\u0000\u0000\u0000\u0132\u0131\u0001\u0000\u0000"+ + "\u0000\u01337\u0001\u0000\u0000\u0000\u0134\u0135\u0005\u0001\u0000\u0000"+ + "\u0135\u0136\u0003B!\u0000\u01369\u0001\u0000\u0000\u0000\u0137\u0138"+ + "\u0003B!\u0000\u0138\u0139\u0005\u0001\u0000\u0000\u0139;\u0001\u0000"+ + "\u0000\u0000\u013a\u013d\u0003>\u001f\u0000\u013b\u013d\u0003@ \u0000"+ + "\u013c\u013a\u0001\u0000\u0000\u0000\u013c\u013b\u0001\u0000\u0000\u0000"+ + "\u013d=\u0001\u0000\u0000\u0000\u013e\u013f\u0005\u0002\u0000\u0000\u013f"+ + "\u0140\u0003B!\u0000\u0140?\u0001\u0000\u0000\u0000\u0141\u0142\u0003"+ + "B!\u0000\u0142\u0143\u0005\u0002\u0000\u0000\u0143A\u0001\u0000\u0000"+ + "\u0000\u0144\u0147\u00050\u0000\u0000\u0145\u0147\u0003D\"\u0000\u0146"+ + "\u0144\u0001\u0000\u0000\u0000\u0146\u0145\u0001\u0000\u0000\u0000\u0147"+ + "C\u0001\u0000\u0000\u0000\u0148\u0149\u0005$\u0000\u0000\u0149\u014a\u0005"+ + "\u001c\u0000\u0000\u014a\u0157\u00050\u0000\u0000\u014b\u014c\u0005$\u0000"+ + "\u0000\u014c\u014e\u0005\u001c\u0000\u0000\u014d\u014b\u0001\u0000\u0000"+ + "\u0000\u014d\u014e\u0001\u0000\u0000\u0000\u014e\u0151\u0001\u0000\u0000"+ + "\u0000\u014f\u0150\u00050\u0000\u0000\u0150\u0152\u0005\u001c\u0000\u0000"+ + "\u0151\u014f\u0001\u0000\u0000\u0000\u0152\u0153\u0001\u0000\u0000\u0000"+ + "\u0153\u0151\u0001\u0000\u0000\u0000\u0153\u0154\u0001\u0000\u0000\u0000"+ + "\u0154\u0155\u0001\u0000\u0000\u0000\u0155\u0157\u00050\u0000\u0000\u0156"+ + "\u0148\u0001\u0000\u0000\u0000\u0156\u014d\u0001\u0000\u0000\u0000\u0157"+ + "E\u0001\u0000\u0000\u0000\u0158\u015b\u0003H$\u0000\u0159\u015b\u0003"+ + "N\'\u0000\u015a\u0158\u0001\u0000\u0000\u0000\u015a\u0159\u0001\u0000"+ + "\u0000\u0000\u015bG\u0001\u0000\u0000\u0000\u015c\u015d\u0006$\uffff\uffff"+ + "\u0000\u015d\u015e\u0003J%\u0000\u015e\u0164\u0001\u0000\u0000\u0000\u015f"+ + "\u0160\n\u0002\u0000\u0000\u0160\u0161\u0005\n\u0000\u0000\u0161\u0163"+ + "\u0003J%\u0000\u0162\u015f\u0001\u0000\u0000\u0000\u0163\u0166\u0001\u0000"+ + "\u0000\u0000\u0164\u0162\u0001\u0000\u0000\u0000\u0164\u0165\u0001\u0000"+ + "\u0000\u0000\u0165I\u0001\u0000\u0000\u0000\u0166\u0164\u0001\u0000\u0000"+ + "\u0000\u0167\u0168\u0006%\uffff\uffff\u0000\u0168\u0169\u0003L&\u0000"+ + "\u0169\u016f\u0001\u0000\u0000\u0000\u016a\u016b\n\u0002\u0000\u0000\u016b"+ + "\u016c\u0005\t\u0000\u0000\u016c\u016e\u0003L&\u0000\u016d\u016a\u0001"+ + "\u0000\u0000\u0000\u016e\u0171\u0001\u0000\u0000\u0000\u016f\u016d\u0001"+ + "\u0000\u0000\u0000\u016f\u0170\u0001\u0000\u0000\u0000\u0170K\u0001\u0000"+ + "\u0000\u0000\u0171\u016f\u0001\u0000\u0000\u0000\u0172\u017b\u0005-\u0000"+ + "\u0000\u0173\u017b\u00050\u0000\u0000\u0174\u017b\u0003D\"\u0000\u0175"+ + "\u0176\u0003P(\u0000\u0176\u0177\u0005\u001d\u0000\u0000\u0177\u0178\u0003"+ + "H$\u0000\u0178\u0179\u0005\u001e\u0000\u0000\u0179\u017b\u0001\u0000\u0000"+ + "\u0000\u017a\u0172\u0001\u0000\u0000\u0000\u017a\u0173\u0001\u0000\u0000"+ + "\u0000\u017a\u0174\u0001\u0000\u0000\u0000\u017a\u0175\u0001\u0000\u0000"+ + "\u0000\u017bM\u0001\u0000\u0000\u0000\u017c\u017d\u00030\u0018\u0000\u017d"+ + "\u017e\u0003Z-\u0000\u017e\u017f\u0003.\u0017\u0000\u017fO\u0001\u0000"+ + "\u0000\u0000\u0180\u0182\u0003R)\u0000\u0181\u0180\u0001\u0000\u0000\u0000"+ + "\u0181\u0182\u0001\u0000\u0000\u0000\u0182\u0186\u0001\u0000\u0000\u0000"+ + "\u0183\u0185\u0003T*\u0000\u0184\u0183\u0001\u0000\u0000\u0000\u0185\u0188"+ + "\u0001\u0000\u0000\u0000\u0186\u0184\u0001\u0000\u0000\u0000\u0186\u0187"+ + "\u0001\u0000\u0000\u0000\u0187\u0189\u0001\u0000\u0000\u0000\u0188\u0186"+ + "\u0001\u0000\u0000\u0000\u0189\u018a\u00050\u0000\u0000\u018a\u018b\u0005"+ + "\u001d\u0000\u0000\u018b\u018c\u0003\u0010\b\u0000\u018c\u018d\u0005\u001e"+ + "\u0000\u0000\u018dQ\u0001\u0000\u0000\u0000\u018e\u0193\u0005$\u0000\u0000"+ + "\u018f\u0193\u0003D\"\u0000\u0190\u0193\u0003,\u0016\u0000\u0191\u0193"+ + "\u00050\u0000\u0000\u0192\u018e\u0001\u0000\u0000\u0000\u0192\u018f\u0001"+ + "\u0000\u0000\u0000\u0192\u0190\u0001\u0000\u0000\u0000\u0192\u0191\u0001"+ + "\u0000\u0000\u0000\u0193\u0194\u0001\u0000\u0000\u0000\u0194\u0195\u0005"+ + "\u001c\u0000\u0000\u0195S\u0001\u0000\u0000\u0000\u0196\u0197\u00050\u0000"+ + "\u0000\u0197\u0198\u0005\u001d\u0000\u0000\u0198\u0199\u0003\u0010\b\u0000"+ + "\u0199\u019a\u0005\u001e\u0000\u0000\u019a\u019b\u0005\u001c\u0000\u0000"+ + "\u019bU\u0001\u0000\u0000\u0000\u019c\u019d\u0007\u0000\u0000\u0000\u019d"+ + "W\u0001\u0000\u0000\u0000\u019e\u019f\u0007\u0001\u0000\u0000\u019fY\u0001"+ + "\u0000\u0000\u0000\u01a0\u01a1\u0007\u0002\u0000\u0000\u01a1[\u0001\u0000"+ + "\u0000\u0000(_bjruz\u0080\u0089\u008d\u0092\u0096\u009d\u00a8\u00ab\u00bb"+ + "\u00c1\u00c8\u00ce\u00e2\u00e6\u00ea\u00f3\u00f7\u010d\u011b\u0127\u012e"+ + "\u0132\u013c\u0146\u014d\u0153\u0156\u015a\u0164\u016f\u017a\u0181\u0186"+ + "\u0192"; + public static final ATN _ATN = + new ATNDeserializer().deserialize(_serializedATN.toCharArray()); + static { + _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; + for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { + _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); + } + } +} \ No newline at end of file diff --git a/src/main/java/parser/generated/SimpleJavaVisitor.java b/src/main/java/parser/generated/SimpleJavaVisitor.java new file mode 100644 index 0000000..beefef9 --- /dev/null +++ b/src/main/java/parser/generated/SimpleJavaVisitor.java @@ -0,0 +1,289 @@ +// Generated from C:/Users/janni/Desktop/NichtHaskell2.0/src/main/java/parser/grammar/SimpleJava.g4 by ANTLR 4.13.1 +package parser.generated; +import org.antlr.v4.runtime.tree.ParseTreeVisitor; + +/** + * This interface defines a complete generic visitor for a parse tree produced + * by {@link SimpleJavaParser}. + * + * @param The return type of the visit operation. Use {@link Void} for + * operations with no return type. + */ +public interface SimpleJavaVisitor extends ParseTreeVisitor { + /** + * Visit a parse tree produced by {@link SimpleJavaParser#program}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitProgram(SimpleJavaParser.ProgramContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#classDeclaration}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitClassDeclaration(SimpleJavaParser.ClassDeclarationContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#memberDeclaration}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMemberDeclaration(SimpleJavaParser.MemberDeclarationContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#constructorDeclaration}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitConstructorDeclaration(SimpleJavaParser.ConstructorDeclarationContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#fieldDeclaration}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitFieldDeclaration(SimpleJavaParser.FieldDeclarationContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#methodDeclaration}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMethodDeclaration(SimpleJavaParser.MethodDeclarationContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#parameterList}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitParameterList(SimpleJavaParser.ParameterListContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#parameter}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitParameter(SimpleJavaParser.ParameterContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#argumentList}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitArgumentList(SimpleJavaParser.ArgumentListContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#statement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitStatement(SimpleJavaParser.StatementContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#blockStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBlockStatement(SimpleJavaParser.BlockStatementContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#returnStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitReturnStatement(SimpleJavaParser.ReturnStatementContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#localVariableDeclaration}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitLocalVariableDeclaration(SimpleJavaParser.LocalVariableDeclarationContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#whileStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitWhileStatement(SimpleJavaParser.WhileStatementContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#doWhileStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitDoWhileStatement(SimpleJavaParser.DoWhileStatementContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#forStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitForStatement(SimpleJavaParser.ForStatementContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#ifElseStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIfElseStatement(SimpleJavaParser.IfElseStatementContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#ifStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIfStatement(SimpleJavaParser.IfStatementContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#elseIfStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitElseIfStatement(SimpleJavaParser.ElseIfStatementContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#elseStatement}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitElseStatement(SimpleJavaParser.ElseStatementContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#statementExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitStatementExpression(SimpleJavaParser.StatementExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#assign}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAssign(SimpleJavaParser.AssignContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#newDeclaration}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitNewDeclaration(SimpleJavaParser.NewDeclarationContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#expression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitExpression(SimpleJavaParser.ExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#unaryExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitUnaryExpression(SimpleJavaParser.UnaryExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#notExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitNotExpression(SimpleJavaParser.NotExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#crementExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitCrementExpression(SimpleJavaParser.CrementExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#incrementExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitIncrementExpression(SimpleJavaParser.IncrementExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#prefixIncrementExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPrefixIncrementExpression(SimpleJavaParser.PrefixIncrementExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#suffixIncrementExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSuffixIncrementExpression(SimpleJavaParser.SuffixIncrementExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#decrementExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitDecrementExpression(SimpleJavaParser.DecrementExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#prefixDecrementExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitPrefixDecrementExpression(SimpleJavaParser.PrefixDecrementExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#suffixDecrementExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitSuffixDecrementExpression(SimpleJavaParser.SuffixDecrementExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#assignableExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitAssignableExpression(SimpleJavaParser.AssignableExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#memberAccess}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMemberAccess(SimpleJavaParser.MemberAccessContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#binaryExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitBinaryExpression(SimpleJavaParser.BinaryExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#calculationExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitCalculationExpression(SimpleJavaParser.CalculationExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#dotExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitDotExpression(SimpleJavaParser.DotExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#dotSubtractionExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitDotSubtractionExpression(SimpleJavaParser.DotSubtractionExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#nonCalculationExpression}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitNonCalculationExpression(SimpleJavaParser.NonCalculationExpressionContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#methodCall}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitMethodCall(SimpleJavaParser.MethodCallContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#target}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitTarget(SimpleJavaParser.TargetContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#chainedMethod}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitChainedMethod(SimpleJavaParser.ChainedMethodContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#type}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitType(SimpleJavaParser.TypeContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#value}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitValue(SimpleJavaParser.ValueContext ctx); + /** + * Visit a parse tree produced by {@link SimpleJavaParser#nonCalculationOperator}. + * @param ctx the parse tree + * @return the visitor result + */ + T visitNonCalculationOperator(SimpleJavaParser.NonCalculationOperatorContext ctx); +} \ No newline at end of file From 8d3602eda3fe28746c80835b668214efe0581351 Mon Sep 17 00:00:00 2001 From: Purplumbi504 Date: Sun, 23 Jun 2024 13:59:06 +0200 Subject: [PATCH 3/6] Renaiming packages --- src/main/java/ast/ClassNode.java | 6 +- .../java/ast/expressions/IExpressionNode.java | 2 +- .../DotSubstractionExpressionNode.java | 44 - .../BinaryNode.java} | 6 +- .../CalculationNode.java} | 12 +- .../DotNode.java} | 12 +- .../DotSubstractionNode.java | 43 + .../EnumDotOperator.java | 2 +- .../EnumLineOperator.java | 2 +- .../EnumNonCalculationOperator.java | 2 +- .../NonCalculationNode.java} | 12 +- .../unaryexpression/NotExpressionNode.java | 13 - .../MemberAccessNode.java | 2 +- .../expressions/unaryexpressions/NotNode.java | 13 + .../UnaryNode.java} | 22 +- .../java/ast/members/ConstructorNode.java | 9 +- src/main/java/ast/members/MainMethodNode.java | 4 +- src/main/java/ast/members/MethodNode.java | 4 +- .../java/ast/statement/ForStatementNode.java | 31 - .../ast/statement/WhileStatementNode.java | 23 - .../ifstatement/ElseStatementNode.java | 21 - .../ifstatement/IfElseStatementNode.java | 28 - .../ifstatement/IfStatementNode.java | 24 - .../ast/statementexpressions/AssignNode.java | 21 + .../AssignStatementExpressionNode.java | 21 - ...xpressionNode.java => AssignableNode.java} | 10 +- .../IStatementExpressionNode.java | 4 +- ...ssionNode.java => NewDeclarationNode.java} | 9 +- .../crementExpression/CrementType.java | 5 - .../DecrementExpressionNode.java | 22 - .../IncrementExpressionNode.java | 22 - .../crementexpressions/CrementType.java | 5 + .../crementexpressions/DecrementNode.java | 21 + .../crementexpressions/IncrementNode.java | 21 + .../TargetNode.java | 7 - .../ChainedMethodNode.java | 4 +- .../MethodCallNode.java} | 11 +- .../TargetNode.java | 12 +- ...BlockStatementNode.java => BlockNode.java} | 5 +- src/main/java/ast/statements/ElseNode.java | 13 + .../ast/statements/ElseStatementNode.java | 13 - .../java/ast/statements/IStatementNode.java | 2 +- src/main/java/ast/statements/IfElseNode.java | 22 + .../ast/statements/IfElseStatementNode.java | 22 - src/main/java/ast/statements/IfNode.java | 14 + .../java/ast/statements/IfStatementNode.java | 14 - .../LocalVariableDeclarationNode.java | 4 +- ...turnStatementNode.java => ReturnNode.java} | 8 +- src/main/java/ast/statements/WhileNode.java | 14 + .../ast/statements/WhileStatementNode.java | 14 - src/main/java/ast/type/type/BaseType.java | 2 - src/main/java/bytecode/ClassCodeGen.java | 6 +- src/main/java/bytecode/MethodCodeGen.java | 4 +- .../java/parser/astBuilder/ASTBuilder.java | 354 +- .../java/parser/generated/SimpleJava.interp | 155 - .../java/parser/generated/SimpleJava.tokens | 88 - .../generated/SimpleJavaBaseListener.java | 568 --- .../generated/SimpleJavaBaseVisitor.java | 323 -- .../parser/generated/SimpleJavaLexer.interp | 170 - .../parser/generated/SimpleJavaLexer.java | 394 -- .../parser/generated/SimpleJavaLexer.tokens | 88 - .../parser/generated/SimpleJavaListener.java | 450 --- .../parser/generated/SimpleJavaParser.java | 3457 ----------------- .../parser/generated/SimpleJavaVisitor.java | 277 -- src/main/java/semantic/SemanticAnalyzer.java | 55 +- src/main/java/semantic/SemanticVisitor.java | 50 +- .../java/semantic/context/ClassContext.java | 2 +- .../java/semantic/context/FieldContext.java | 2 +- src/test/java/semantic/Mocker.java | 17 +- 69 files changed, 418 insertions(+), 6721 deletions(-) delete mode 100644 src/main/java/ast/expressions/binaryexpression/DotSubstractionExpressionNode.java rename src/main/java/ast/expressions/{binaryexpression/BinaryExpressionNode.java => binaryexpressions/BinaryNode.java} (67%) rename src/main/java/ast/expressions/{binaryexpression/CalculationExpressionNode.java => binaryexpressions/CalculationNode.java} (64%) rename src/main/java/ast/expressions/{binaryexpression/DotExpressionNode.java => binaryexpressions/DotNode.java} (66%) create mode 100644 src/main/java/ast/expressions/binaryexpressions/DotSubstractionNode.java rename src/main/java/ast/expressions/{binaryexpression => binaryexpressions}/EnumDotOperator.java (54%) rename src/main/java/ast/expressions/{binaryexpression => binaryexpressions}/EnumLineOperator.java (53%) rename src/main/java/ast/expressions/{binaryexpression => binaryexpressions}/EnumNonCalculationOperator.java (72%) rename src/main/java/ast/expressions/{binaryexpression/NonCalculationExpressionNode.java => binaryexpressions/NonCalculationNode.java} (78%) delete mode 100644 src/main/java/ast/expressions/unaryexpression/NotExpressionNode.java rename src/main/java/ast/expressions/{unaryexpression => unaryexpressions}/MemberAccessNode.java (90%) create mode 100644 src/main/java/ast/expressions/unaryexpressions/NotNode.java rename src/main/java/ast/expressions/{unaryexpression/UnaryExpressionNode.java => unaryexpressions/UnaryNode.java} (64%) delete mode 100644 src/main/java/ast/statement/ForStatementNode.java delete mode 100644 src/main/java/ast/statement/WhileStatementNode.java delete mode 100644 src/main/java/ast/statement/ifstatement/ElseStatementNode.java delete mode 100644 src/main/java/ast/statement/ifstatement/IfElseStatementNode.java delete mode 100644 src/main/java/ast/statement/ifstatement/IfStatementNode.java create mode 100644 src/main/java/ast/statementexpressions/AssignNode.java delete mode 100644 src/main/java/ast/statementexpressions/AssignStatementExpressionNode.java rename src/main/java/ast/statementexpressions/{AssignableExpressionNode.java => AssignableNode.java} (54%) rename src/main/java/ast/statementexpressions/{NewDeclarationStatementExpressionNode.java => NewDeclarationNode.java} (65%) delete mode 100644 src/main/java/ast/statementexpressions/crementExpression/CrementType.java delete mode 100644 src/main/java/ast/statementexpressions/crementExpression/DecrementExpressionNode.java delete mode 100644 src/main/java/ast/statementexpressions/crementExpression/IncrementExpressionNode.java create mode 100644 src/main/java/ast/statementexpressions/crementexpressions/CrementType.java create mode 100644 src/main/java/ast/statementexpressions/crementexpressions/DecrementNode.java create mode 100644 src/main/java/ast/statementexpressions/crementexpressions/IncrementNode.java delete mode 100644 src/main/java/ast/statementexpressions/methodcallstatementnexpression/TargetNode.java rename src/main/java/ast/statementexpressions/{methodcallstatementnexpression => methodcallstatementnexpressions}/ChainedMethodNode.java (78%) rename src/main/java/ast/statementexpressions/{methodcallstatementnexpression/MethodCallStatementExpressionNode.java => methodcallstatementnexpressions/MethodCallNode.java} (66%) rename src/main/java/ast/{statement/statementexpression/methodcallstatementnexpression => statementexpressions/methodcallstatementnexpressions}/TargetNode.java (58%) rename src/main/java/ast/statements/{BlockStatementNode.java => BlockNode.java} (82%) create mode 100644 src/main/java/ast/statements/ElseNode.java delete mode 100644 src/main/java/ast/statements/ElseStatementNode.java create mode 100644 src/main/java/ast/statements/IfElseNode.java delete mode 100644 src/main/java/ast/statements/IfElseStatementNode.java create mode 100644 src/main/java/ast/statements/IfNode.java delete mode 100644 src/main/java/ast/statements/IfStatementNode.java rename src/main/java/ast/statements/{ReturnStatementNode.java => ReturnNode.java} (69%) create mode 100644 src/main/java/ast/statements/WhileNode.java delete mode 100644 src/main/java/ast/statements/WhileStatementNode.java delete mode 100644 src/main/java/parser/generated/SimpleJava.interp delete mode 100644 src/main/java/parser/generated/SimpleJava.tokens delete mode 100644 src/main/java/parser/generated/SimpleJavaBaseListener.java delete mode 100644 src/main/java/parser/generated/SimpleJavaBaseVisitor.java delete mode 100644 src/main/java/parser/generated/SimpleJavaLexer.interp delete mode 100644 src/main/java/parser/generated/SimpleJavaLexer.java delete mode 100644 src/main/java/parser/generated/SimpleJavaLexer.tokens delete mode 100644 src/main/java/parser/generated/SimpleJavaListener.java delete mode 100644 src/main/java/parser/generated/SimpleJavaParser.java delete mode 100644 src/main/java/parser/generated/SimpleJavaVisitor.java diff --git a/src/main/java/ast/ClassNode.java b/src/main/java/ast/ClassNode.java index 75f92b1..63dfed2 100644 --- a/src/main/java/ast/ClassNode.java +++ b/src/main/java/ast/ClassNode.java @@ -1,9 +1,9 @@ package ast; import ast.type.AccessModifierNode; -import ast.member.ConstructorNode; -import ast.member.MemberNode; -import ast.member.MethodNode; +import ast.members.ConstructorNode; +import ast.members.MemberNode; +import ast.members.MethodNode; import semantic.SemanticVisitor; import typechecker.TypeCheckResult; import visitor.Visitable; diff --git a/src/main/java/ast/expressions/IExpressionNode.java b/src/main/java/ast/expressions/IExpressionNode.java index 28b45e3..d1d380b 100644 --- a/src/main/java/ast/expressions/IExpressionNode.java +++ b/src/main/java/ast/expressions/IExpressionNode.java @@ -1,4 +1,4 @@ -package ast.expression; +package ast.expressions; import ast.ASTNode; import ast.type.type.ITypeNode; diff --git a/src/main/java/ast/expressions/binaryexpression/DotSubstractionExpressionNode.java b/src/main/java/ast/expressions/binaryexpression/DotSubstractionExpressionNode.java deleted file mode 100644 index 1b43a9f..0000000 --- a/src/main/java/ast/expressions/binaryexpression/DotSubstractionExpressionNode.java +++ /dev/null @@ -1,44 +0,0 @@ -package ast.expression.binaryexpression; - -import ast.expression.unaryexpression.MemberAccessNode; -import ast.statement.statementexpression.methodcallstatementnexpression.MethodCallStatementExpressionNode; -import ast.type.type.*; -import ast.type.ValueNode; -import semantic.SemanticVisitor; -import typechecker.TypeCheckResult; - -public class DotSubstractionExpressionNode extends BinaryExpressionNode { - public ValueNode value; - public String identifier; - public MemberAccessNode memberAccess; - public MethodCallStatementExpressionNode methodCall; - public CalculationExpressionNode calculationExpression; - - public DotSubstractionExpressionNode(ValueNode value) { - this.value = value; - } - - public DotSubstractionExpressionNode(String identifier) { - this.identifier = identifier; - } - - public DotSubstractionExpressionNode(MemberAccessNode memberAccess) { - this.memberAccess = memberAccess; - } - - public DotSubstractionExpressionNode(MethodCallStatementExpressionNode methodCall, CalculationExpressionNode calculationExpression) { - this.methodCall = methodCall; - this.calculationExpression = calculationExpression; - } - - @Override - public TypeCheckResult accept(SemanticVisitor visitor) { - return visitor.analyze(this); - } - - @Override - public ITypeNode getType() { - return null; - } - -} diff --git a/src/main/java/ast/expressions/binaryexpression/BinaryExpressionNode.java b/src/main/java/ast/expressions/binaryexpressions/BinaryNode.java similarity index 67% rename from src/main/java/ast/expressions/binaryexpression/BinaryExpressionNode.java rename to src/main/java/ast/expressions/binaryexpressions/BinaryNode.java index 655a3f5..9bfe8c2 100644 --- a/src/main/java/ast/expressions/binaryexpression/BinaryExpressionNode.java +++ b/src/main/java/ast/expressions/binaryexpressions/BinaryNode.java @@ -1,11 +1,11 @@ -package ast.expression.binaryexpression; +package ast.expressions.binaryexpressions; -import ast.expression.IExpressionNode; +import ast.expressions.IExpressionNode; import ast.type.type.*; import semantic.SemanticVisitor; import typechecker.TypeCheckResult; -public class BinaryExpressionNode implements IExpressionNode { +public class BinaryNode implements IExpressionNode { @Override public TypeCheckResult accept(SemanticVisitor visitor) { diff --git a/src/main/java/ast/expressions/binaryexpression/CalculationExpressionNode.java b/src/main/java/ast/expressions/binaryexpressions/CalculationNode.java similarity index 64% rename from src/main/java/ast/expressions/binaryexpression/CalculationExpressionNode.java rename to src/main/java/ast/expressions/binaryexpressions/CalculationNode.java index b594502..4dec81a 100644 --- a/src/main/java/ast/expressions/binaryexpression/CalculationExpressionNode.java +++ b/src/main/java/ast/expressions/binaryexpressions/CalculationNode.java @@ -1,21 +1,21 @@ -package ast.expression.binaryexpression; +package ast.expressions.binaryexpressions; import ast.type.type.*; import semantic.SemanticVisitor; import typechecker.TypeCheckResult; -public class CalculationExpressionNode extends BinaryExpressionNode { - public CalculationExpressionNode calculationExpression; +public class CalculationNode extends BinaryNode { + public CalculationNode calculationExpression; public EnumLineOperator operator; - public DotExpressionNode dotExpression; + public DotNode dotExpression; - public CalculationExpressionNode(CalculationExpressionNode calculationExpression, String operator, DotExpressionNode dotExpression) { + public CalculationNode(CalculationNode calculationExpression, String operator, DotNode dotExpression) { this.calculationExpression = calculationExpression; setOperator(operator); this.dotExpression = dotExpression; } - public CalculationExpressionNode(DotExpressionNode dotExpression) { + public CalculationNode(DotNode dotExpression) { this.dotExpression = dotExpression; } diff --git a/src/main/java/ast/expressions/binaryexpression/DotExpressionNode.java b/src/main/java/ast/expressions/binaryexpressions/DotNode.java similarity index 66% rename from src/main/java/ast/expressions/binaryexpression/DotExpressionNode.java rename to src/main/java/ast/expressions/binaryexpressions/DotNode.java index 2d56221..4cad9ec 100644 --- a/src/main/java/ast/expressions/binaryexpression/DotExpressionNode.java +++ b/src/main/java/ast/expressions/binaryexpressions/DotNode.java @@ -1,21 +1,21 @@ -package ast.expression.binaryexpression; +package ast.expressions.binaryexpressions; import ast.type.type.*; import semantic.SemanticVisitor; import typechecker.TypeCheckResult; -public class DotExpressionNode extends BinaryExpressionNode { - public DotExpressionNode dotExpression; +public class DotNode extends BinaryNode { + public DotNode dotExpression; public EnumDotOperator operator; - public DotSubstractionExpressionNode dotSubstractionExpression; + public DotSubstractionNode dotSubstractionExpression; - public DotExpressionNode(DotExpressionNode dotExpression, String operator, DotSubstractionExpressionNode dotSubstractionExpression) { + public DotNode(DotNode dotExpression, String operator, DotSubstractionNode dotSubstractionExpression) { this.dotExpression = dotExpression; setOperator(operator); this.dotSubstractionExpression = dotSubstractionExpression; } - public DotExpressionNode(DotSubstractionExpressionNode dotSubstractionExpression) { + public DotNode(DotSubstractionNode dotSubstractionExpression) { this.dotSubstractionExpression = dotSubstractionExpression; } diff --git a/src/main/java/ast/expressions/binaryexpressions/DotSubstractionNode.java b/src/main/java/ast/expressions/binaryexpressions/DotSubstractionNode.java new file mode 100644 index 0000000..6d4a71e --- /dev/null +++ b/src/main/java/ast/expressions/binaryexpressions/DotSubstractionNode.java @@ -0,0 +1,43 @@ +package ast.expressions.binaryexpressions; + +import ast.expressions.unaryexpressions.MemberAccessNode; +import ast.type.type.*; +import ast.type.ValueNode; +import semantic.SemanticVisitor; +import typechecker.TypeCheckResult; + +public class DotSubstractionNode extends BinaryNode { + public ValueNode value; + public String identifier; + public MemberAccessNode memberAccess; + public ast.statements.statementexpression.methodcallstatementnexpression.MethodCallStatementNode methodCall; + public CalculationNode calculationExpression; + + public DotSubstractionNode(ValueNode value) { + this.value = value; + } + + public DotSubstractionNode(String identifier) { + this.identifier = identifier; + } + + public DotSubstractionNode(MemberAccessNode memberAccess) { + this.memberAccess = memberAccess; + } + + public DotSubstractionNode(ast.statements.statementexpression.methodcallstatementnexpression.MethodCallStatementNode methodCall, CalculationNode calculationExpression) { + this.methodCall = methodCall; + this.calculationExpression = calculationExpression; + } + + @Override + public TypeCheckResult accept(SemanticVisitor visitor) { + return visitor.analyze(this); + } + + @Override + public ITypeNode getType() { + return null; + } + +} diff --git a/src/main/java/ast/expressions/binaryexpression/EnumDotOperator.java b/src/main/java/ast/expressions/binaryexpressions/EnumDotOperator.java similarity index 54% rename from src/main/java/ast/expressions/binaryexpression/EnumDotOperator.java rename to src/main/java/ast/expressions/binaryexpressions/EnumDotOperator.java index 3525266..78723aa 100644 --- a/src/main/java/ast/expressions/binaryexpression/EnumDotOperator.java +++ b/src/main/java/ast/expressions/binaryexpressions/EnumDotOperator.java @@ -1,4 +1,4 @@ -package ast.expression.binaryexpression; +package ast.expressions.binaryexpressions; public enum EnumDotOperator { MULT, DIV, MOD diff --git a/src/main/java/ast/expressions/binaryexpression/EnumLineOperator.java b/src/main/java/ast/expressions/binaryexpressions/EnumLineOperator.java similarity index 53% rename from src/main/java/ast/expressions/binaryexpression/EnumLineOperator.java rename to src/main/java/ast/expressions/binaryexpressions/EnumLineOperator.java index 27389ec..916b102 100644 --- a/src/main/java/ast/expressions/binaryexpression/EnumLineOperator.java +++ b/src/main/java/ast/expressions/binaryexpressions/EnumLineOperator.java @@ -1,4 +1,4 @@ -package ast.expression.binaryexpression; +package ast.expressions.binaryexpressions; public enum EnumLineOperator { PLUS, MINUS diff --git a/src/main/java/ast/expressions/binaryexpression/EnumNonCalculationOperator.java b/src/main/java/ast/expressions/binaryexpressions/EnumNonCalculationOperator.java similarity index 72% rename from src/main/java/ast/expressions/binaryexpression/EnumNonCalculationOperator.java rename to src/main/java/ast/expressions/binaryexpressions/EnumNonCalculationOperator.java index 40c3dfd..b7523eb 100644 --- a/src/main/java/ast/expressions/binaryexpression/EnumNonCalculationOperator.java +++ b/src/main/java/ast/expressions/binaryexpressions/EnumNonCalculationOperator.java @@ -1,4 +1,4 @@ -package ast.expression.binaryexpression; +package ast.expressions.binaryexpressions; public enum EnumNonCalculationOperator { AND, OR, GREATER, LESS, GREATER_EQUAL, LESS_EQUAL, EQUAL, NOT_EQUAL diff --git a/src/main/java/ast/expressions/binaryexpression/NonCalculationExpressionNode.java b/src/main/java/ast/expressions/binaryexpressions/NonCalculationNode.java similarity index 78% rename from src/main/java/ast/expressions/binaryexpression/NonCalculationExpressionNode.java rename to src/main/java/ast/expressions/binaryexpressions/NonCalculationNode.java index f89fdf8..d07a5f6 100644 --- a/src/main/java/ast/expressions/binaryexpression/NonCalculationExpressionNode.java +++ b/src/main/java/ast/expressions/binaryexpressions/NonCalculationNode.java @@ -1,17 +1,17 @@ -package ast.expression.binaryexpression; +package ast.expressions.binaryexpressions; -import ast.expression.IExpressionNode; -import ast.expression.unaryexpression.UnaryExpressionNode; +import ast.expressions.IExpressionNode; +import ast.expressions.unaryexpressions.UnaryNode; import ast.type.type.*; import semantic.SemanticVisitor; import typechecker.TypeCheckResult; -public class NonCalculationExpressionNode extends BinaryExpressionNode { - public UnaryExpressionNode unaryExpression; +public class NonCalculationNode extends BinaryNode { + public UnaryNode unaryExpression; public EnumNonCalculationOperator operator; public IExpressionNode expression; - public NonCalculationExpressionNode(UnaryExpressionNode unaryExpression, String operator, IExpressionNode expression) { + public NonCalculationNode(UnaryNode unaryExpression, String operator, IExpressionNode expression) { this.unaryExpression = unaryExpression; setOperator(operator); this.expression = expression; diff --git a/src/main/java/ast/expressions/unaryexpression/NotExpressionNode.java b/src/main/java/ast/expressions/unaryexpression/NotExpressionNode.java deleted file mode 100644 index f225f39..0000000 --- a/src/main/java/ast/expressions/unaryexpression/NotExpressionNode.java +++ /dev/null @@ -1,13 +0,0 @@ -package ast.expression.unaryexpression; - -import ast.ASTNode; -import ast.expression.IExpressionNode; - -public class NotExpressionNode implements ASTNode { - public IExpressionNode expression; - - public NotExpressionNode(IExpressionNode expression) { - this.expression = expression; - } - -} diff --git a/src/main/java/ast/expressions/unaryexpression/MemberAccessNode.java b/src/main/java/ast/expressions/unaryexpressions/MemberAccessNode.java similarity index 90% rename from src/main/java/ast/expressions/unaryexpression/MemberAccessNode.java rename to src/main/java/ast/expressions/unaryexpressions/MemberAccessNode.java index f5f7090..aa85286 100644 --- a/src/main/java/ast/expressions/unaryexpression/MemberAccessNode.java +++ b/src/main/java/ast/expressions/unaryexpressions/MemberAccessNode.java @@ -1,4 +1,4 @@ -package ast.expression.unaryexpression; +package ast.expressions.unaryexpressions; import ast.ASTNode; diff --git a/src/main/java/ast/expressions/unaryexpressions/NotNode.java b/src/main/java/ast/expressions/unaryexpressions/NotNode.java new file mode 100644 index 0000000..017dfe1 --- /dev/null +++ b/src/main/java/ast/expressions/unaryexpressions/NotNode.java @@ -0,0 +1,13 @@ +package ast.expressions.unaryexpressions; + +import ast.ASTNode; +import ast.expressions.IExpressionNode; + +public class NotNode implements ASTNode { + public IExpressionNode expression; + + public NotNode(IExpressionNode expression) { + this.expression = expression; + } + +} diff --git a/src/main/java/ast/expressions/unaryexpression/UnaryExpressionNode.java b/src/main/java/ast/expressions/unaryexpressions/UnaryNode.java similarity index 64% rename from src/main/java/ast/expressions/unaryexpression/UnaryExpressionNode.java rename to src/main/java/ast/expressions/unaryexpressions/UnaryNode.java index 4393e84..1baa842 100644 --- a/src/main/java/ast/expressions/unaryexpression/UnaryExpressionNode.java +++ b/src/main/java/ast/expressions/unaryexpressions/UnaryNode.java @@ -1,7 +1,7 @@ -package ast.expression.unaryexpression; +package ast.expressions.unaryexpressions; -import ast.expression.IExpressionNode; -import ast.statement.IStatementNode; +import ast.expressions.IExpressionNode; +import ast.statements.IStatementNode; import ast.type.type.*; import ast.type.ValueNode; import semantic.SemanticVisitor; @@ -9,17 +9,17 @@ import typechecker.TypeCheckResult; import java.util.Objects; -public class UnaryExpressionNode implements IExpressionNode { +public class UnaryNode implements IExpressionNode { public String thisExp; public String identifier; public MemberAccessNode memberAccess; public ValueNode value; - public NotExpressionNode notExpression; + public NotNode notExpression; public IStatementNode statement; public IExpressionNode expression; private ITypeNode type; - public UnaryExpressionNode(String value) { + public UnaryNode(String value) { if(Objects.equals(value, "this")) { this.thisExp = "this"; } else { @@ -27,23 +27,23 @@ public class UnaryExpressionNode implements IExpressionNode { } } - public UnaryExpressionNode(MemberAccessNode memberAccess) { + public UnaryNode(MemberAccessNode memberAccess) { this.memberAccess = memberAccess; } - public UnaryExpressionNode(ValueNode value) { + public UnaryNode(ValueNode value) { this.value = value; } - public UnaryExpressionNode(NotExpressionNode notExpression) { + public UnaryNode(NotNode notExpression) { this.notExpression = notExpression; } - public UnaryExpressionNode(IStatementNode statement) { + public UnaryNode(IStatementNode statement) { this.statement = statement; } - public UnaryExpressionNode(IExpressionNode expression) { + public UnaryNode(IExpressionNode expression) { this.expression = expression; } diff --git a/src/main/java/ast/members/ConstructorNode.java b/src/main/java/ast/members/ConstructorNode.java index 52d7604..0030ae2 100644 --- a/src/main/java/ast/members/ConstructorNode.java +++ b/src/main/java/ast/members/ConstructorNode.java @@ -1,11 +1,8 @@ -package ast.member; +package ast.members; -import ast.block.BlockNode; -import ast.parameter.ParameterNode; +import ast.parameters.ParameterNode; +import ast.statements.BlockNode; import ast.type.AccessModifierNode; -import semantic.SemanticVisitor; -import typechecker.TypeCheckResult; -import visitor.Visitable; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/ast/members/MainMethodNode.java b/src/main/java/ast/members/MainMethodNode.java index e50cc4f..3ae01a2 100644 --- a/src/main/java/ast/members/MainMethodNode.java +++ b/src/main/java/ast/members/MainMethodNode.java @@ -1,6 +1,6 @@ -package ast.member; +package ast.members; -import ast.block.BlockNode; +import ast.statements.BlockNode; public class MainMethodNode extends MethodNode { public BlockNode block; diff --git a/src/main/java/ast/members/MethodNode.java b/src/main/java/ast/members/MethodNode.java index caa585d..5e10d48 100644 --- a/src/main/java/ast/members/MethodNode.java +++ b/src/main/java/ast/members/MethodNode.java @@ -1,7 +1,7 @@ package ast.members; -import ast.block.BlockNode; -import ast.parameter.ParameterNode; +import ast.parameters.ParameterNode; +import ast.statements.BlockNode; import ast.type.AccessModifierNode; import ast.type.type.*; import bytecode.visitor.MethodVisitor; diff --git a/src/main/java/ast/statement/ForStatementNode.java b/src/main/java/ast/statement/ForStatementNode.java deleted file mode 100644 index 3d4ad16..0000000 --- a/src/main/java/ast/statement/ForStatementNode.java +++ /dev/null @@ -1,31 +0,0 @@ -package ast.statement; - -import ast.ASTNode; -import ast.expression.IExpressionNode; -import semantic.SemanticVisitor; -import typechecker.TypeCheckResult; - -public class ForStatementNode implements IStatementNode { - public IExpressionNode statementExpressionInit; - public IStatementNode localVariableDeclarationInit; - public IExpressionNode expression; - public IExpressionNode statementExpression; - - public ForStatementNode(IExpressionNode statementExpressionInit, IExpressionNode expression, IExpressionNode statementExpression) { - this.statementExpressionInit = statementExpressionInit; - this.expression = expression; - this.statementExpression = statementExpression; - } - - public ForStatementNode(IStatementNode localVariableDeclarationInit, IExpressionNode expression, IExpressionNode statementExpression) { - this.localVariableDeclarationInit = localVariableDeclarationInit; - this.expression = expression; - this.statementExpression = statementExpression; - } - - @Override - public TypeCheckResult accept(SemanticVisitor visitor) { - return visitor.analyze(this); - } - -} diff --git a/src/main/java/ast/statement/WhileStatementNode.java b/src/main/java/ast/statement/WhileStatementNode.java deleted file mode 100644 index 3aabb73..0000000 --- a/src/main/java/ast/statement/WhileStatementNode.java +++ /dev/null @@ -1,23 +0,0 @@ -package ast.statement; - -import ast.ASTNode; -import ast.block.BlockNode; -import ast.expression.IExpressionNode; -import semantic.SemanticVisitor; -import typechecker.TypeCheckResult; - -public class WhileStatementNode implements IStatementNode { - public IExpressionNode expression; - public BlockNode block; - - public WhileStatementNode(IExpressionNode expression, BlockNode block) { - this.expression = expression; - this.block = block; - } - - @Override - public TypeCheckResult accept(SemanticVisitor visitor) { - return visitor.analyze(this); - } - -} diff --git a/src/main/java/ast/statement/ifstatement/ElseStatementNode.java b/src/main/java/ast/statement/ifstatement/ElseStatementNode.java deleted file mode 100644 index 709fe2f..0000000 --- a/src/main/java/ast/statement/ifstatement/ElseStatementNode.java +++ /dev/null @@ -1,21 +0,0 @@ -package ast.statement.ifstatement; - -import ast.ASTNode; -import ast.block.BlockNode; -import ast.statement.IStatementNode; -import semantic.SemanticVisitor; -import typechecker.TypeCheckResult; - -public class ElseStatementNode implements IStatementNode { - public BlockNode block; - - public ElseStatementNode(BlockNode block) { - this.block = block; - } - - @Override - public TypeCheckResult accept(SemanticVisitor visitor) { - return visitor.analyze(this); - } - -} diff --git a/src/main/java/ast/statement/ifstatement/IfElseStatementNode.java b/src/main/java/ast/statement/ifstatement/IfElseStatementNode.java deleted file mode 100644 index 6967f75..0000000 --- a/src/main/java/ast/statement/ifstatement/IfElseStatementNode.java +++ /dev/null @@ -1,28 +0,0 @@ -package ast.statement.ifstatement; - -import ast.ASTNode; -import ast.statement.IStatementNode; -import semantic.SemanticVisitor; -import typechecker.TypeCheckResult; - -import java.util.ArrayList; -import java.util.List; - -public class IfElseStatementNode implements IStatementNode { - public IfStatementNode ifStatement; - public List elseStatements = new ArrayList<>(); - - public IfElseStatementNode(IfStatementNode ifStatement) { - this.ifStatement = ifStatement; - } - - public void addElseStatement(ElseStatementNode elseStatement) { - elseStatements.add(elseStatement); - } - - @Override - public TypeCheckResult accept(SemanticVisitor visitor) { - return visitor.analyze(this); - } - -} diff --git a/src/main/java/ast/statement/ifstatement/IfStatementNode.java b/src/main/java/ast/statement/ifstatement/IfStatementNode.java deleted file mode 100644 index 7bcbabf..0000000 --- a/src/main/java/ast/statement/ifstatement/IfStatementNode.java +++ /dev/null @@ -1,24 +0,0 @@ -package ast.statement.ifstatement; - -import ast.ASTNode; -import ast.block.BlockNode; -import ast.expression.IExpressionNode; -import ast.statement.IStatementNode; -import semantic.SemanticVisitor; -import typechecker.TypeCheckResult; - -public class IfStatementNode implements IStatementNode { - public IExpressionNode expression; - public BlockNode block; - - public IfStatementNode(IExpressionNode expression, BlockNode block) { - this.expression = expression; - this.block = block; - } - - @Override - public TypeCheckResult accept(SemanticVisitor visitor) { - return visitor.analyze(this); - } - -} diff --git a/src/main/java/ast/statementexpressions/AssignNode.java b/src/main/java/ast/statementexpressions/AssignNode.java new file mode 100644 index 0000000..4a5022f --- /dev/null +++ b/src/main/java/ast/statementexpressions/AssignNode.java @@ -0,0 +1,21 @@ +package ast.statementexpressions; + +import ast.expressions.IExpressionNode; +import semantic.SemanticVisitor; +import typechecker.TypeCheckResult; + +public class AssignNode implements IStatementExpressionNode { + public AssignableNode assignable; + public IExpressionNode expression; + + public AssignNode(AssignableNode assignable, IExpressionNode expression) { + this.assignable = assignable; + this.expression = expression; + } + + @Override + public TypeCheckResult accept(SemanticVisitor visitor) { + return visitor.analyze(this); + } + +} diff --git a/src/main/java/ast/statementexpressions/AssignStatementExpressionNode.java b/src/main/java/ast/statementexpressions/AssignStatementExpressionNode.java deleted file mode 100644 index df8fe79..0000000 --- a/src/main/java/ast/statementexpressions/AssignStatementExpressionNode.java +++ /dev/null @@ -1,21 +0,0 @@ -package ast.statement.statementexpression; - -import ast.expression.IExpressionNode; -import semantic.SemanticVisitor; -import typechecker.TypeCheckResult; - -public class AssignStatementExpressionNode implements IStatementExpressionNode { - public AssignableExpressionNode assignable; - public IExpressionNode expression; - - public AssignStatementExpressionNode(AssignableExpressionNode assignable, IExpressionNode expression) { - this.assignable = assignable; - this.expression = expression; - } - - @Override - public TypeCheckResult accept(SemanticVisitor visitor) { - return visitor.analyze(this); - } - -} diff --git a/src/main/java/ast/statementexpressions/AssignableExpressionNode.java b/src/main/java/ast/statementexpressions/AssignableNode.java similarity index 54% rename from src/main/java/ast/statementexpressions/AssignableExpressionNode.java rename to src/main/java/ast/statementexpressions/AssignableNode.java index 0fb9fa9..d3a1677 100644 --- a/src/main/java/ast/statementexpressions/AssignableExpressionNode.java +++ b/src/main/java/ast/statementexpressions/AssignableNode.java @@ -1,19 +1,19 @@ -package ast.statement.statementexpression; +package ast.statementexpressions; -import ast.expression.unaryexpression.MemberAccessNode; +import ast.expressions.unaryexpressions.MemberAccessNode; import semantic.SemanticVisitor; import typechecker.TypeCheckResult; -public class AssignableExpressionNode implements IStatementExpressionNode { +public class AssignableNode implements IStatementExpressionNode { public String identifier; public MemberAccessNode memberAccess; - public AssignableExpressionNode(String identifier) { + public AssignableNode(String identifier) { this.identifier = identifier; } - public AssignableExpressionNode(MemberAccessNode memberAccess) { + public AssignableNode(MemberAccessNode memberAccess) { this.memberAccess = memberAccess; } diff --git a/src/main/java/ast/statementexpressions/IStatementExpressionNode.java b/src/main/java/ast/statementexpressions/IStatementExpressionNode.java index 30998f6..7458848 100644 --- a/src/main/java/ast/statementexpressions/IStatementExpressionNode.java +++ b/src/main/java/ast/statementexpressions/IStatementExpressionNode.java @@ -1,5 +1,5 @@ -package ast.statement.statementexpression; +package ast.statementexpressions; -import ast.statement.IStatementNode; +import ast.statements.IStatementNode; public interface IStatementExpressionNode extends IStatementNode {} diff --git a/src/main/java/ast/statementexpressions/NewDeclarationStatementExpressionNode.java b/src/main/java/ast/statementexpressions/NewDeclarationNode.java similarity index 65% rename from src/main/java/ast/statementexpressions/NewDeclarationStatementExpressionNode.java rename to src/main/java/ast/statementexpressions/NewDeclarationNode.java index 20541bb..d7a37bc 100644 --- a/src/main/java/ast/statementexpressions/NewDeclarationStatementExpressionNode.java +++ b/src/main/java/ast/statementexpressions/NewDeclarationNode.java @@ -1,18 +1,17 @@ -package ast.statement.statementexpression; +package ast.statementexpressions; -import ast.ASTNode; -import ast.expression.IExpressionNode; +import ast.expressions.IExpressionNode; import semantic.SemanticVisitor; import typechecker.TypeCheckResult; import java.util.ArrayList; import java.util.List; -public class NewDeclarationStatementExpressionNode implements IStatementExpressionNode { +public class NewDeclarationNode implements IStatementExpressionNode { public String identifier; public List expressions = new ArrayList<>(); - public NewDeclarationStatementExpressionNode(String identifier) { + public NewDeclarationNode(String identifier) { this.identifier = identifier; } diff --git a/src/main/java/ast/statementexpressions/crementExpression/CrementType.java b/src/main/java/ast/statementexpressions/crementExpression/CrementType.java deleted file mode 100644 index d300bfb..0000000 --- a/src/main/java/ast/statementexpressions/crementExpression/CrementType.java +++ /dev/null @@ -1,5 +0,0 @@ -package ast.statement.statementexpression.crementExpression; - -public enum CrementType { - PREFIX, SUFFIX -} diff --git a/src/main/java/ast/statementexpressions/crementExpression/DecrementExpressionNode.java b/src/main/java/ast/statementexpressions/crementExpression/DecrementExpressionNode.java deleted file mode 100644 index 372b4ea..0000000 --- a/src/main/java/ast/statementexpressions/crementExpression/DecrementExpressionNode.java +++ /dev/null @@ -1,22 +0,0 @@ -package ast.statement.statementexpression.crementExpression; - -import ast.ASTNode; -import ast.statement.statementexpression.AssignableExpressionNode; -import ast.statement.statementexpression.IStatementExpressionNode; -import semantic.SemanticVisitor; -import typechecker.TypeCheckResult; - -public class DecrementExpressionNode implements IStatementExpressionNode { - public CrementType crementType; - public AssignableExpressionNode assignableExpression; - - public DecrementExpressionNode(CrementType crementType, AssignableExpressionNode assignableExpression) { - this.assignableExpression = assignableExpression; - } - - @Override - public TypeCheckResult accept(SemanticVisitor visitor) { - return visitor.analyze(this); - } - -} diff --git a/src/main/java/ast/statementexpressions/crementExpression/IncrementExpressionNode.java b/src/main/java/ast/statementexpressions/crementExpression/IncrementExpressionNode.java deleted file mode 100644 index a87934d..0000000 --- a/src/main/java/ast/statementexpressions/crementExpression/IncrementExpressionNode.java +++ /dev/null @@ -1,22 +0,0 @@ -package ast.statement.statementexpression.crementExpression; - -import ast.ASTNode; -import ast.statement.statementexpression.AssignableExpressionNode; -import ast.statement.statementexpression.IStatementExpressionNode; -import semantic.SemanticVisitor; -import typechecker.TypeCheckResult; - -public class IncrementExpressionNode implements IStatementExpressionNode { - public CrementType crementType; - public AssignableExpressionNode assignableExpression; - - public IncrementExpressionNode(CrementType crementType, AssignableExpressionNode assignableExpression) { - this.assignableExpression = assignableExpression; - } - - @Override - public TypeCheckResult accept(SemanticVisitor visitor) { - return visitor.analyze(this); - } - -} diff --git a/src/main/java/ast/statementexpressions/crementexpressions/CrementType.java b/src/main/java/ast/statementexpressions/crementexpressions/CrementType.java new file mode 100644 index 0000000..122b69f --- /dev/null +++ b/src/main/java/ast/statementexpressions/crementexpressions/CrementType.java @@ -0,0 +1,5 @@ +package ast.statementexpressions.crementexpressions; + +public enum CrementType { + PREFIX, SUFFIX +} diff --git a/src/main/java/ast/statementexpressions/crementexpressions/DecrementNode.java b/src/main/java/ast/statementexpressions/crementexpressions/DecrementNode.java new file mode 100644 index 0000000..48cb82c --- /dev/null +++ b/src/main/java/ast/statementexpressions/crementexpressions/DecrementNode.java @@ -0,0 +1,21 @@ +package ast.statementexpressions.crementexpressions; + +import ast.statementexpressions.AssignableNode; +import ast.statementexpressions.IStatementExpressionNode; +import semantic.SemanticVisitor; +import typechecker.TypeCheckResult; + +public class DecrementNode implements IStatementExpressionNode { + public CrementType crementType; + public AssignableNode assignableExpression; + + public DecrementNode(CrementType crementType, AssignableNode assignableExpression) { + this.assignableExpression = assignableExpression; + } + + @Override + public TypeCheckResult accept(SemanticVisitor visitor) { + return visitor.analyze(this); + } + +} diff --git a/src/main/java/ast/statementexpressions/crementexpressions/IncrementNode.java b/src/main/java/ast/statementexpressions/crementexpressions/IncrementNode.java new file mode 100644 index 0000000..f283db4 --- /dev/null +++ b/src/main/java/ast/statementexpressions/crementexpressions/IncrementNode.java @@ -0,0 +1,21 @@ +package ast.statementexpressions.crementexpressions; + +import ast.statementexpressions.AssignableNode; +import ast.statementexpressions.IStatementExpressionNode; +import semantic.SemanticVisitor; +import typechecker.TypeCheckResult; + +public class IncrementNode implements IStatementExpressionNode { + public CrementType crementType; + public AssignableNode assignableExpression; + + public IncrementNode(CrementType crementType, AssignableNode assignableExpression) { + this.assignableExpression = assignableExpression; + } + + @Override + public TypeCheckResult accept(SemanticVisitor visitor) { + return visitor.analyze(this); + } + +} diff --git a/src/main/java/ast/statementexpressions/methodcallstatementnexpression/TargetNode.java b/src/main/java/ast/statementexpressions/methodcallstatementnexpression/TargetNode.java deleted file mode 100644 index 3621f3d..0000000 --- a/src/main/java/ast/statementexpressions/methodcallstatementnexpression/TargetNode.java +++ /dev/null @@ -1,7 +0,0 @@ -package ast.statementexpressions.methodcallstatementnexpression; - -public class TargetNode { - String thisTarget; - - -} diff --git a/src/main/java/ast/statementexpressions/methodcallstatementnexpression/ChainedMethodNode.java b/src/main/java/ast/statementexpressions/methodcallstatementnexpressions/ChainedMethodNode.java similarity index 78% rename from src/main/java/ast/statementexpressions/methodcallstatementnexpression/ChainedMethodNode.java rename to src/main/java/ast/statementexpressions/methodcallstatementnexpressions/ChainedMethodNode.java index c20e9bc..b9fa8e4 100644 --- a/src/main/java/ast/statementexpressions/methodcallstatementnexpression/ChainedMethodNode.java +++ b/src/main/java/ast/statementexpressions/methodcallstatementnexpressions/ChainedMethodNode.java @@ -1,7 +1,7 @@ -package ast.statement.statementexpression.methodcallstatementnexpression; +package ast.statementexpressions.methodcallstatementnexpressions; import ast.ASTNode; -import ast.expression.IExpressionNode; +import ast.expressions.IExpressionNode; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/ast/statementexpressions/methodcallstatementnexpression/MethodCallStatementExpressionNode.java b/src/main/java/ast/statementexpressions/methodcallstatementnexpressions/MethodCallNode.java similarity index 66% rename from src/main/java/ast/statementexpressions/methodcallstatementnexpression/MethodCallStatementExpressionNode.java rename to src/main/java/ast/statementexpressions/methodcallstatementnexpressions/MethodCallNode.java index 6a2f69b..5228ed2 100644 --- a/src/main/java/ast/statementexpressions/methodcallstatementnexpression/MethodCallStatementExpressionNode.java +++ b/src/main/java/ast/statementexpressions/methodcallstatementnexpressions/MethodCallNode.java @@ -1,21 +1,20 @@ -package ast.statement.statementexpression.methodcallstatementnexpression; +package ast.statementexpressions.methodcallstatementnexpressions; -import ast.ASTNode; -import ast.expression.IExpressionNode; -import ast.statement.statementexpression.IStatementExpressionNode; +import ast.expressions.IExpressionNode; +import ast.statements.IStatementNode; import semantic.SemanticVisitor; import typechecker.TypeCheckResult; import java.util.ArrayList; import java.util.List; -public class MethodCallStatementExpressionNode implements IStatementExpressionNode { +public class MethodCallNode implements IStatementNode { public TargetNode target; public List chainedMethods = new ArrayList<>(); public String identifier; public List expressions = new ArrayList<>(); - public MethodCallStatementExpressionNode(TargetNode target, String identifier) { + public MethodCallNode(TargetNode target, String identifier) { this.target = target; this.identifier = identifier; } diff --git a/src/main/java/ast/statement/statementexpression/methodcallstatementnexpression/TargetNode.java b/src/main/java/ast/statementexpressions/methodcallstatementnexpressions/TargetNode.java similarity index 58% rename from src/main/java/ast/statement/statementexpression/methodcallstatementnexpression/TargetNode.java rename to src/main/java/ast/statementexpressions/methodcallstatementnexpressions/TargetNode.java index 7a18125..01e2344 100644 --- a/src/main/java/ast/statement/statementexpression/methodcallstatementnexpression/TargetNode.java +++ b/src/main/java/ast/statementexpressions/methodcallstatementnexpressions/TargetNode.java @@ -1,13 +1,13 @@ -package ast.statement.statementexpression.methodcallstatementnexpression; +package ast.statementexpressions.methodcallstatementnexpressions; import ast.ASTNode; -import ast.expression.unaryexpression.MemberAccessNode; -import ast.statement.statementexpression.NewDeclarationStatementExpressionNode; +import ast.expressions.unaryexpressions.MemberAccessNode; +import ast.statementexpressions.NewDeclarationNode; public class TargetNode implements ASTNode { public Boolean thisTar; public MemberAccessNode memberAccess; - public NewDeclarationStatementExpressionNode newDeclaration; + public NewDeclarationNode newDeclaration; public String identifier; public TargetNode(Boolean thisTar) { @@ -18,11 +18,11 @@ public class TargetNode implements ASTNode { this.memberAccess = memberAccess; } - public TargetNode(NewDeclarationStatementExpressionNode newDeclaration) { + public TargetNode(NewDeclarationNode newDeclaration) { this.newDeclaration = newDeclaration; } public TargetNode(String identifier) { this.identifier = identifier; } -} +} \ No newline at end of file diff --git a/src/main/java/ast/statements/BlockStatementNode.java b/src/main/java/ast/statements/BlockNode.java similarity index 82% rename from src/main/java/ast/statements/BlockStatementNode.java rename to src/main/java/ast/statements/BlockNode.java index ab2d70b..9790f8d 100644 --- a/src/main/java/ast/statements/BlockStatementNode.java +++ b/src/main/java/ast/statements/BlockNode.java @@ -1,13 +1,10 @@ -package ast.block; +package ast.statements; import ast.ASTNode; -import ast.statement.IStatementNode; -import ast.statement.ReturnStatementNode; import semantic.SemanticVisitor; import typechecker.TypeCheckResult; import visitor.Visitable; -import java.beans.Visibility; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/ast/statements/ElseNode.java b/src/main/java/ast/statements/ElseNode.java new file mode 100644 index 0000000..5b498cf --- /dev/null +++ b/src/main/java/ast/statements/ElseNode.java @@ -0,0 +1,13 @@ +package ast.statements; + +import ast.ASTNode; + +public class ElseNode implements ASTNode { + BlockNode block; + + public ElseNode(BlockNode block) { + this.block = block; + } + + +} diff --git a/src/main/java/ast/statements/ElseStatementNode.java b/src/main/java/ast/statements/ElseStatementNode.java deleted file mode 100644 index 70d0243..0000000 --- a/src/main/java/ast/statements/ElseStatementNode.java +++ /dev/null @@ -1,13 +0,0 @@ -package ast.statements; - -import ast.ASTNode; - -public class ElseStatementNode implements ASTNode { - BlockStatementNode block; - - public ElseStatementNode(BlockStatementNode block) { - this.block = block; - } - - -} diff --git a/src/main/java/ast/statements/IStatementNode.java b/src/main/java/ast/statements/IStatementNode.java index c726bb3..c1eb9fa 100644 --- a/src/main/java/ast/statements/IStatementNode.java +++ b/src/main/java/ast/statements/IStatementNode.java @@ -1,4 +1,4 @@ -package ast.statement; +package ast.statements; import ast.ASTNode; import visitor.Visitable; diff --git a/src/main/java/ast/statements/IfElseNode.java b/src/main/java/ast/statements/IfElseNode.java new file mode 100644 index 0000000..9d25390 --- /dev/null +++ b/src/main/java/ast/statements/IfElseNode.java @@ -0,0 +1,22 @@ +package ast.statements; + +import ast.ASTNode; + +import java.util.ArrayList; +import java.util.List; + +public class IfElseNode implements ASTNode { + IfNode ifStatement; + List elseIfStatements = new ArrayList<>(); + ElseNode elseStatement; + + public IfElseNode(IfNode ifStatement, ElseNode elseNode) { + this.ifStatement = ifStatement; + this.elseStatement = elseNode; + } + + public void addElseIfStatement(IfNode elseIfStament) { + elseIfStatements.add(elseIfStament); + } + +} diff --git a/src/main/java/ast/statements/IfElseStatementNode.java b/src/main/java/ast/statements/IfElseStatementNode.java deleted file mode 100644 index 8b24274..0000000 --- a/src/main/java/ast/statements/IfElseStatementNode.java +++ /dev/null @@ -1,22 +0,0 @@ -package ast.statements; - -import ast.ASTNode; - -import java.util.ArrayList; -import java.util.List; - -public class IfElseStatementNode implements ASTNode { - IfStatementNode ifStatement; - List elseIfStatements = new ArrayList<>(); - ElseStatementNode elseStatement; - - public IfElseStatementNode(IfStatementNode ifStatement, ElseStatementNode elseStatementNode) { - this.ifStatement = ifStatement; - this.elseStatement = elseStatementNode; - } - - public void addElseIfStatement(IfStatementNode elseIfStament) { - elseIfStatements.add(elseIfStament); - } - -} diff --git a/src/main/java/ast/statements/IfNode.java b/src/main/java/ast/statements/IfNode.java new file mode 100644 index 0000000..3292a10 --- /dev/null +++ b/src/main/java/ast/statements/IfNode.java @@ -0,0 +1,14 @@ +package ast.statements; + +import ast.ASTNode; +import ast.expressions.IExpressionNode; + +public class IfNode implements ASTNode { + IExpressionNode expression; + BlockNode block; + + public IfNode(IExpressionNode expression, BlockNode block) { + this.expression = expression; + this.block = block; + } +} diff --git a/src/main/java/ast/statements/IfStatementNode.java b/src/main/java/ast/statements/IfStatementNode.java deleted file mode 100644 index bf09272..0000000 --- a/src/main/java/ast/statements/IfStatementNode.java +++ /dev/null @@ -1,14 +0,0 @@ -package ast.statements; - -import ast.ASTNode; -import ast.expressions.ExpressionNode; - -public class IfStatementNode implements ASTNode { - ExpressionNode expression; - BlockStatementNode block; - - public IfStatementNode(ExpressionNode expression, BlockStatementNode block) { - this.expression = expression; - this.block = block; - } -} diff --git a/src/main/java/ast/statements/LocalVariableDeclarationNode.java b/src/main/java/ast/statements/LocalVariableDeclarationNode.java index 3ab54e0..881c437 100644 --- a/src/main/java/ast/statements/LocalVariableDeclarationNode.java +++ b/src/main/java/ast/statements/LocalVariableDeclarationNode.java @@ -1,6 +1,6 @@ -package ast.statement; +package ast.statements; -import ast.expression.IExpressionNode; +import ast.expressions.IExpressionNode; import ast.type.type.*; import semantic.SemanticVisitor; import typechecker.TypeCheckResult; diff --git a/src/main/java/ast/statements/ReturnStatementNode.java b/src/main/java/ast/statements/ReturnNode.java similarity index 69% rename from src/main/java/ast/statements/ReturnStatementNode.java rename to src/main/java/ast/statements/ReturnNode.java index e525c3f..e25cf6f 100644 --- a/src/main/java/ast/statements/ReturnStatementNode.java +++ b/src/main/java/ast/statements/ReturnNode.java @@ -1,14 +1,14 @@ -package ast.statement; +package ast.statements; -import ast.expression.IExpressionNode; +import ast.expressions.IExpressionNode; import semantic.SemanticVisitor; import typechecker.TypeCheckResult; -public class ReturnStatementNode implements IStatementNode { +public class ReturnNode implements IStatementNode { public IExpressionNode expression; public Boolean voidReturn = false; - public ReturnStatementNode(IExpressionNode expression) { + public ReturnNode(IExpressionNode expression) { if(expression != null) { this.expression = expression; } else { diff --git a/src/main/java/ast/statements/WhileNode.java b/src/main/java/ast/statements/WhileNode.java new file mode 100644 index 0000000..fe9bfd2 --- /dev/null +++ b/src/main/java/ast/statements/WhileNode.java @@ -0,0 +1,14 @@ +package ast.statements; + +import ast.ASTNode; +import ast.expressions.IExpressionNode; + +public class WhileNode extends StatementNode implements ASTNode { + IExpressionNode expression; + BlockNode block; + + public WhileNode(IExpressionNode expression, BlockNode block) { + this.expression = expression; + this.block = block; + } +} diff --git a/src/main/java/ast/statements/WhileStatementNode.java b/src/main/java/ast/statements/WhileStatementNode.java deleted file mode 100644 index e5fadfd..0000000 --- a/src/main/java/ast/statements/WhileStatementNode.java +++ /dev/null @@ -1,14 +0,0 @@ -package ast.statements; - -import ast.ASTNode; -import ast.expressions.ExpressionNode; - -public class WhileStatementNode extends StatementNode implements ASTNode { - ExpressionNode expression; - BlockStatementNode block; - - public WhileStatementNode(ExpressionNode expression, BlockStatementNode block) { - this.expression = expression; - this.block = block; - } -} diff --git a/src/main/java/ast/type/type/BaseType.java b/src/main/java/ast/type/type/BaseType.java index fdfb293..0563b64 100644 --- a/src/main/java/ast/type/type/BaseType.java +++ b/src/main/java/ast/type/type/BaseType.java @@ -25,6 +25,4 @@ public class BaseType implements ITypeNode { return false; return true; } - - } diff --git a/src/main/java/bytecode/ClassCodeGen.java b/src/main/java/bytecode/ClassCodeGen.java index c911199..b6517b1 100644 --- a/src/main/java/bytecode/ClassCodeGen.java +++ b/src/main/java/bytecode/ClassCodeGen.java @@ -1,9 +1,9 @@ package bytecode; import ast.ClassNode; -import ast.member.FieldNode; -import ast.member.MemberNode; -import ast.member.MethodNode; +import ast.members.FieldNode; +import ast.members.MemberNode; +import ast.members.MethodNode; import ast.type.type.BaseType; import bytecode.visitor.ClassVisitor; import java.io.File; diff --git a/src/main/java/bytecode/MethodCodeGen.java b/src/main/java/bytecode/MethodCodeGen.java index 358d540..704d9a6 100644 --- a/src/main/java/bytecode/MethodCodeGen.java +++ b/src/main/java/bytecode/MethodCodeGen.java @@ -1,7 +1,7 @@ package bytecode; -import ast.member.ConstructorNode; -import ast.member.MethodNode; +import ast.members.ConstructorNode; +import ast.members.MethodNode; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.MethodVisitor; diff --git a/src/main/java/parser/astBuilder/ASTBuilder.java b/src/main/java/parser/astBuilder/ASTBuilder.java index 95ac93c..5761d12 100644 --- a/src/main/java/parser/astBuilder/ASTBuilder.java +++ b/src/main/java/parser/astBuilder/ASTBuilder.java @@ -1,35 +1,24 @@ package parser.astBuilder; import ast.*; -import ast.block.BlockNode; -import ast.expression.*; -import ast.expression.binaryexpression.CalculationExpressionNode; -import ast.expression.binaryexpression.DotExpressionNode; -import ast.expression.binaryexpression.DotSubstractionExpressionNode; -import ast.expression.binaryexpression.NonCalculationExpressionNode; -import ast.expression.unaryexpression.MemberAccessNode; -import ast.expression.unaryexpression.NotExpressionNode; -import ast.expression.unaryexpression.UnaryExpressionNode; -import ast.member.*; -import ast.statement.ifstatement.ElseStatementNode; -import ast.statement.ifstatement.IfElseStatementNode; -import ast.parameter.ParameterNode; -import ast.statement.*; -import ast.statement.ifstatement.IfStatementNode; -import ast.statement.statementexpression.AssignStatementExpressionNode; -import ast.statement.statementexpression.AssignableExpressionNode; -import ast.statement.statementexpression.NewDeclarationStatementExpressionNode; -import ast.statement.statementexpression.crementExpression.CrementType; -import ast.statement.statementexpression.crementExpression.DecrementExpressionNode; -import ast.statement.statementexpression.crementExpression.IncrementExpressionNode; -import ast.statement.statementexpression.methodcallstatementnexpression.ChainedMethodNode; -import ast.statement.statementexpression.methodcallstatementnexpression.MethodCallStatementExpressionNode; -import ast.statement.statementexpression.methodcallstatementnexpression.TargetNode; -import ast.type.*; -import ast.type.type.*; -import org.antlr.v4.runtime.tree.TerminalNode; + +import ast.expressions.IExpressionNode; +import ast.expressions.unaryexpressions.MemberAccessNode; +import ast.members.ConstructorNode; +import ast.members.MemberNode; +import ast.parameters.ParameterNode; +import ast.statementexpressions.AssignNode; +import ast.statementexpressions.AssignableNode; +import ast.statementexpressions.NewDeclarationNode; +import ast.statementexpressions.methodcallstatementnexpressions.ChainedMethodNode; +import ast.statementexpressions.methodcallstatementnexpressions.MethodCallNode; +import ast.statementexpressions.methodcallstatementnexpressions.TargetNode; +import ast.statements.*; import parser.generated.*; +import java.util.ArrayList; +import java.util.List; + public class ASTBuilder extends SimpleJavaBaseVisitor { @Override public ASTNode visitProgram(SimpleJavaParser.ProgramContext ctx) { @@ -52,42 +41,16 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { @Override public ASTNode visitConstructorDeclaration(SimpleJavaParser.ConstructorDeclarationContext ctx) { - ConstructorNode constructorNode = new ConstructorNode(ctx.AccessModifier().getText(), ctx.Identifier().getText(), (BlockNode) visit(ctx.block())); + ConstructorNode constructorNode = new ConstructorNode(ctx.AccessModifier().getText(), ctx.Identifier().getText(), (BlockNode) visit(ctx.blockStatement())); for(SimpleJavaParser.ParameterContext parameter : ctx.parameterList().parameter()) { constructorNode.addParameter((ParameterNode) visit(parameter)); } return constructorNode; } - @Override - public ASTNode visitMethodDeclaration(SimpleJavaParser.MethodDeclarationContext ctx) { - if(ctx.MainMethodDeclaration() != null) { - return new MainMethodNode((BlockNode) visit(ctx.block())); - } else { - if(ctx.type() != null) { - MethodNode methodNode = new MethodNode(ctx.AccessModifier().getText(), createTypeNode(ctx.type().getText()), false, ctx.Identifier().getText(), (BlockNode) visit(ctx.block())); - for(SimpleJavaParser.ParameterContext parameter : ctx.parameterList().parameter()) { - methodNode.addParameter((ParameterNode) visit(parameter)); - } - return methodNode; - } else { - MethodNode methodNode = new MethodNode(ctx.AccessModifier().getText(), null, true, ctx.Identifier().getText(), (BlockNode) visit(ctx.block())); - for(SimpleJavaParser.ParameterContext parameter : ctx.parameterList().parameter()) { - methodNode.addParameter((ParameterNode) visit(parameter)); - } - return methodNode; - } - } - } - - @Override - public ASTNode visitFieldDeclaration(SimpleJavaParser.FieldDeclarationContext ctx) { - return new FieldNode(new AccessModifierNode(ctx.AccessModifier().getText()), createTypeNode(ctx.type().getText()), ctx.Identifier().getText()); - } - @Override public ASTNode visitParameter(SimpleJavaParser.ParameterContext ctx) { - return new ParameterNode(createTypeNode(ctx.type().getText()), ctx.Identifier().getText()); + return new ParameterNode(new TypeNode(ctx.type().getText()), ctx.Identifier().getText()); } @Override @@ -96,8 +59,8 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { return visitReturnStatement(ctx.returnStatement()); } else if(ctx.localVariableDeclaration() != null) { return visitLocalVariableDeclaration(ctx.localVariableDeclaration()); - } else if(ctx.block() != null) { - return visitBlock(ctx.block()); + } else if(ctx.blockStatement() != null) { + return visitBlockStatement(ctx.blockStatement()); } else if(ctx.whileStatement() != null) { return visitWhileStatement(ctx.whileStatement()); } else if(ctx.forStatement() != null) { @@ -112,58 +75,105 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { @Override public ASTNode visitReturnStatement(SimpleJavaParser.ReturnStatementContext ctx) { - return new ReturnStatementNode((IExpressionNode) visit(ctx.expression())); + return new ReturnNode((IExpressionNode) visit(ctx.expression())); } @Override public ASTNode visitLocalVariableDeclaration(SimpleJavaParser.LocalVariableDeclarationContext ctx) { - return new LocalVariableDeclarationNode(createTypeNode(ctx.type().getText()), ctx.Identifier().getText(), ctx.Assign().getText(), (IExpressionNode) visit(ctx.expression())); + return new LocalVariableDeclarationNode(new TypeNode(ctx.type().getText()), ctx.Identifier().getText(), ctx.Assign().getText(), (ExpressionNode) visit(ctx.expression())); } @Override - public ASTNode visitBlock(SimpleJavaParser.BlockContext ctx) { + public ASTNode visitBlockStatement(SimpleJavaParser.BlockStatementContext ctx) { BlockNode blockNode = new BlockNode(); for(SimpleJavaParser.StatementContext statement : ctx.statement()) { blockNode.addStatement((IStatementNode) visit(statement)); } - if(!blockNode.hasReturnStatement) { - blockNode.addStatement(new ReturnStatementNode(null)); - } return blockNode; } @Override public ASTNode visitWhileStatement(SimpleJavaParser.WhileStatementContext ctx) { - return new WhileStatementNode((IExpressionNode) visit(ctx.expression()), (BlockNode) visit(ctx.block())); + return new WhileNode((IExpressionNode) visit(ctx.expression()), (BlockNode) visit(ctx.blockStatement())); + } + + @Override + public ASTNode visitDoWhileStatement(SimpleJavaParser.DoWhileStatementContext ctx) { + IExpressionNode condition = (IExpressionNode) visit(ctx.expression()); + BlockNode doBlock = (BlockNode) visit(ctx.blockStatement()); + + WhileNode While = new WhileNode(condition, doBlock); + BlockNode resultBlock = new BlockNode(); + resultBlock.addStatement((IStatementNode) doBlock); + resultBlock.addStatement((IStatementNode) While); + + return resultBlock; } @Override public ASTNode visitForStatement(SimpleJavaParser.ForStatementContext ctx) { - if(ctx.statementExpression(0) != null) { - return new ForStatementNode((IExpressionNode) visit(ctx.statementExpression(0)), (IExpressionNode) visit(ctx.expression()), (IExpressionNode) visit(ctx.statementExpression(1))); - } else if(ctx.localVariableDeclaration() != null) { - return new ForStatementNode((IStatementNode) visit(ctx.localVariableDeclaration()), (IExpressionNode) visit(ctx.expression()), (IExpressionNode) visit(ctx.statementExpression(1))); + + List statements = new ArrayList<>(); + + //init + if(ctx.statementExpression(0) != null){ + statements.add((StatementNode) visit(ctx.statementExpression(0))); + } else if (ctx.localVariableDeclaration() != null) { + statements.add((StatementNode) visit(ctx.localVariableDeclaration())); } - return null; + + //condition + IExpressionNode condition = (IExpressionNode) visit(ctx.expression()); + + //ink + IStatementNode increment = null; + if(ctx.statementExpression(1) != null){ + increment = (IStatementNode) visit(ctx.statementExpression(1)); + } + + BlockNode forBlock = (BlockNode) visit(ctx.blockStatement()); + + if(increment != null){ + forBlock.addStatement((increment)); + } + + WhileNode While = new WhileNode(condition, forBlock); + + statements.add(While); + + BlockNode resultBlock = new BlockNode(); + for(StatementNode statement : statements) { + resultBlock.addStatement((IStatementNode) statement); + } + + return resultBlock; } @Override public ASTNode visitIfElseStatement(SimpleJavaParser.IfElseStatementContext ctx) { - IfElseStatementNode ifElseStatementNode = new IfElseStatementNode((IfStatementNode) visit(ctx.ifStatement())); - for(SimpleJavaParser.ElseStatementContext elseStatement : ctx.elseStatement()) { - ifElseStatementNode.addElseStatement((ElseStatementNode) visit(elseStatement)); + IfElseNode ifElseStatementNode = new IfElseNode((IfNode) visit(ctx.ifStatement()), + (ElseNode) visit(ctx.elseStatement())); + + for (SimpleJavaParser.ElseIfStatementContext elseIf : ctx.elseIfStatement()){ + ifElseStatementNode.addElseIfStatement(((IfNode) visit(elseIf))); } + return ifElseStatementNode; } @Override public ASTNode visitIfStatement(SimpleJavaParser.IfStatementContext ctx) { - return new IfStatementNode((IExpressionNode) visit(ctx.expression()), (BlockNode) visit(ctx.block())); + return new IfNode((IExpressionNode) visit(ctx.expression()), (BlockNode) visit(ctx.blockStatement())); + } + + @Override + public ASTNode visitElseIfStatement(SimpleJavaParser.ElseIfStatementContext ctx) { + return new IfNode((IExpressionNode) visit(ctx.expression()), (BlockNode) visit(ctx.blockStatement())); } @Override public ASTNode visitElseStatement(SimpleJavaParser.ElseStatementContext ctx) { - return new ElseStatementNode((BlockNode) visit(ctx.block())); + return new ElseNode((BlockNode) visit(ctx.blockStatement())); } @Override @@ -182,21 +192,21 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { @Override public ASTNode visitAssign(SimpleJavaParser.AssignContext ctx) { - return new AssignStatementExpressionNode((AssignableExpressionNode) visit(ctx.assignableExpression()), (IExpressionNode) visit(ctx.expression())); + return new AssignNode((AssignableNode) visit(ctx.assignableExpression()), (IExpressionNode) visit(ctx.expression())); } @Override public ASTNode visitNewDeclaration(SimpleJavaParser.NewDeclarationContext ctx) { - NewDeclarationStatementExpressionNode newDeclarationStatementExpressionNode = new NewDeclarationStatementExpressionNode(ctx.Identifier().getText()); + NewDeclarationNode newDeclarationNode = new NewDeclarationNode(ctx.Identifier().getText()); for(SimpleJavaParser.ExpressionContext expression : ctx.argumentList().expression()) { - newDeclarationStatementExpressionNode.addExpression((IExpressionNode) visit(expression)); + newDeclarationNode.addExpression((IExpressionNode) visit(expression)); } - return newDeclarationStatementExpressionNode; + return newDeclarationNode; } @Override public ASTNode visitMethodCall(SimpleJavaParser.MethodCallContext ctx) { - MethodCallStatementExpressionNode methodCallStatementExpressionNode = new MethodCallStatementExpressionNode((TargetNode) visit(ctx.target()), ctx.Identifier().getText()); + MethodCallNode methodCallStatementExpressionNode = new MethodCallNode((TargetNode) visit(ctx.target()), ctx.Identifier().getText()); for(SimpleJavaParser.ChainedMethodContext chainedMethod : ctx.chainedMethod()) { methodCallStatementExpressionNode.addChainedMethod((ChainedMethodNode) visit(chainedMethod)); } @@ -213,7 +223,7 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { } else if(ctx.memberAccess() != null) { return new TargetNode((MemberAccessNode) visit(ctx.memberAccess())); } else if(ctx.newDeclaration() != null) { - return new TargetNode((NewDeclarationStatementExpressionNode) visit(ctx.newDeclaration())); + return new TargetNode((NewDeclarationNode) visit(ctx.newDeclaration())); } else if(ctx.Identifier() != null) { return new TargetNode(ctx.Identifier().getText()); } @@ -228,188 +238,4 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { } return chainedMethodNode; } - - @Override - public ASTNode visitCrementExpression(SimpleJavaParser.CrementExpressionContext ctx) { - if(ctx.incrementExpression() != null) { - return visitIncrementExpression(ctx.incrementExpression()); - } else if(ctx.decrementExpression() != null) { - return visitDecrementExpression(ctx.decrementExpression()); - } - return null; - } - - @Override - public ASTNode visitIncrementExpression(SimpleJavaParser.IncrementExpressionContext ctx) { - if(ctx.prefixIncrementExpression() != null) { - return visitPrefixIncrementExpression(ctx.prefixIncrementExpression()); - } else if(ctx.suffixIncrementExpression() != null) { - return visitSuffixIncrementExpression(ctx.suffixIncrementExpression()); - } - return null; - } - - @Override - public ASTNode visitPrefixIncrementExpression(SimpleJavaParser.PrefixIncrementExpressionContext ctx) { - return new IncrementExpressionNode(CrementType.PREFIX, (AssignableExpressionNode) visit(ctx.assignableExpression())); - } - - @Override - public ASTNode visitSuffixIncrementExpression(SimpleJavaParser.SuffixIncrementExpressionContext ctx) { - return new IncrementExpressionNode(CrementType.SUFFIX, (AssignableExpressionNode) visit(ctx.assignableExpression())); - } - - @Override - public ASTNode visitDecrementExpression(SimpleJavaParser.DecrementExpressionContext ctx) { - if(ctx.prefixDecrementExpression() != null) { - return visitPrefixDecrementExpression(ctx.prefixDecrementExpression()); - } else if(ctx.suffixDecrementExpression() != null) { - return visitSuffixDecrementExpression(ctx.suffixDecrementExpression()); - } - return null; - } - - @Override - public ASTNode visitPrefixDecrementExpression(SimpleJavaParser.PrefixDecrementExpressionContext ctx) { - return new DecrementExpressionNode(CrementType.PREFIX, (AssignableExpressionNode) visit(ctx.assignableExpression())); - } - - @Override - public ASTNode visitSuffixDecrementExpression(SimpleJavaParser.SuffixDecrementExpressionContext ctx) { - return new DecrementExpressionNode(CrementType.SUFFIX, (AssignableExpressionNode) visit(ctx.assignableExpression())); - } - - @Override - public ASTNode visitExpression(SimpleJavaParser.ExpressionContext ctx) { - if(ctx.unaryExpression() != null) { - return visit(ctx.unaryExpression()); - } else if(ctx.binaryExpression() != null) { - return visit(ctx.binaryExpression()); - } - return null; - } - - @Override - public ASTNode visitUnaryExpression(SimpleJavaParser.UnaryExpressionContext ctx) { - if(ctx.This() != null) { - return new UnaryExpressionNode(ctx.This().getText()); - } else if(ctx.Identifier() != null) { - return new UnaryExpressionNode(ctx.Identifier().getText()); - } else if(ctx.memberAccess() != null) { - return new UnaryExpressionNode((MemberAccessNode) visitMemberAccess(ctx.memberAccess())); - } else if(ctx.value() != null) { - return new UnaryExpressionNode((ValueNode) visitValue(ctx.value())); - } else if(ctx.notExpression() != null) { - return new UnaryExpressionNode((NotExpressionNode) visitNotExpression(ctx.notExpression())); - } else if(ctx.statementExpression() != null) { - return new UnaryExpressionNode((IStatementNode) visitStatementExpression(ctx.statementExpression())); - } else if(ctx.expression() != null) { - return new UnaryExpressionNode((IExpressionNode) visitExpression(ctx.expression())); - } - return null; - } - - @Override - public ASTNode visitMemberAccess(SimpleJavaParser.MemberAccessContext ctx) { - MemberAccessNode memberAccessNode; - if(ctx.This() != null) { - memberAccessNode = new MemberAccessNode(true); - } else { - memberAccessNode = new MemberAccessNode(false); - } - for (TerminalNode identifierNode : ctx.Identifier()) { - memberAccessNode.addIdentifier(identifierNode.getText()); - } - return memberAccessNode; - } - - @Override - public ASTNode visitValue(SimpleJavaParser.ValueContext ctx) { - if(ctx.IntValue() != null) { - return new ValueNode(EnumValueNode.INT_VALUE, ctx.IntValue().getText()); - } else if(ctx.BooleanValue() != null) { - return new ValueNode(EnumValueNode.BOOLEAN_VALUE, ctx.BooleanValue().getText()); - } else if(ctx.CharValue() != null) { - return new ValueNode(EnumValueNode.CHAR_VALUE, ctx.CharValue().getText()); - } else if(ctx.NullValue() != null) { - return new ValueNode(EnumValueNode.NULL_VALUE, ctx.NullValue().getText()); - } - return null; - } - - @Override - public ASTNode visitNotExpression(SimpleJavaParser.NotExpressionContext ctx) { - return new NotExpressionNode((IExpressionNode) visitExpression(ctx.expression())); - } - - - @Override - public ASTNode visitBinaryExpression(SimpleJavaParser.BinaryExpressionContext ctx) { - if(ctx.calculationExpression() != null) { - return visit(ctx.calculationExpression()); - } else if(ctx.nonCalculationExpression() != null) { - return visit(ctx.nonCalculationExpression()); - } - return null; - } - - @Override - public ASTNode visitCalculationExpression(SimpleJavaParser.CalculationExpressionContext ctx) { - if(ctx.calculationExpression() != null) { - return new CalculationExpressionNode((CalculationExpressionNode) visit(ctx.calculationExpression()), ctx.LineOperator().getText(), (DotExpressionNode) visit(ctx.dotExpression())); - } else if(ctx.dotExpression() != null) { - return new CalculationExpressionNode((DotExpressionNode) visit(ctx.dotExpression())); - } - return null; - } - - @Override - public ASTNode visitDotExpression(SimpleJavaParser.DotExpressionContext ctx) { - if(ctx.dotExpression() != null) { - return new DotExpressionNode((DotExpressionNode) visit(ctx.dotExpression()), ctx.DotOperator().getText(), (DotSubstractionExpressionNode) visit(ctx.dotSubtractionExpression())); - } else if(ctx.dotSubtractionExpression() != null) { - return new DotExpressionNode((DotSubstractionExpressionNode) visit(ctx.dotSubtractionExpression())); - } - return null; - } - - @Override - public ASTNode visitDotSubtractionExpression(SimpleJavaParser.DotSubtractionExpressionContext ctx) { - if(ctx.IntValue() != null) { - return new DotSubstractionExpressionNode(new ValueNode(EnumValueNode.INT_VALUE, ctx.IntValue().getText())); - } else if(ctx.Identifier() != null) { - return new DotSubstractionExpressionNode(ctx.Identifier().getText()); - } else if(ctx.memberAccess() != null) { - return new DotSubstractionExpressionNode((MemberAccessNode) visit(ctx.memberAccess())); - } else if(ctx.methodCall() != null && ctx.calculationExpression() != null) { - return new DotSubstractionExpressionNode((MethodCallStatementExpressionNode) visit(ctx.methodCall()), (CalculationExpressionNode) visit(ctx.calculationExpression())); - } - return null; - } - - @Override - public ASTNode visitNonCalculationExpression(SimpleJavaParser.NonCalculationExpressionContext ctx) { - return new NonCalculationExpressionNode((UnaryExpressionNode) visit(ctx.unaryExpression()), ctx.nonCalculationOperator().getText(), (IExpressionNode) visit(ctx.expression())); - } - - @Override - public ASTNode visitAssignableExpression(SimpleJavaParser.AssignableExpressionContext ctx) { - if(ctx.Identifier() != null) { - return new AssignableExpressionNode(ctx.Identifier().getText()); - } else if(ctx.memberAccess() != null) { - return new AssignableExpressionNode((MemberAccessNode) visit(ctx.memberAccess())); - } - return null; - } - - public ITypeNode createTypeNode(String identifier){ - return switch (identifier) { - case "int" -> new BaseType(TypeEnum.INT); - case "boolean" -> new BaseType(TypeEnum.BOOL); - case "char" -> new BaseType(TypeEnum.CHAR); - case "void" -> new BaseType(TypeEnum.VOID); - default -> new ReferenceType(identifier); - }; - } - } diff --git a/src/main/java/parser/generated/SimpleJava.interp b/src/main/java/parser/generated/SimpleJava.interp deleted file mode 100644 index c21e97d..0000000 --- a/src/main/java/parser/generated/SimpleJava.interp +++ /dev/null @@ -1,155 +0,0 @@ -token literal names: -null -'++' -'--' -'void' -'boolean' -'char' -'int' -null -'public static void main(String[] args)' -null -null -null -null -'=' -'+' -'-' -'*' -'%' -'/' -'>' -'<' -'>=' -'<=' -'==' -'!=' -'!' -'&&' -'||' -'.' -'(' -')' -'{' -'}' -';' -',' -'class' -'this' -'while' -'if' -'else' -'for' -'return' -'new' -null -null -null -'null' -null -null -null -null - -token symbolic names: -null -null -null -Void -Boolean -Char -Int -AccessModifier -MainMethodDeclaration -DotOperator -LineOperator -ComparisonOperator -LogicalOperator -Assign -Plus -Minus -Mult -Modulo -Div -Greater -Less -GreaterEqual -LessEqual -Equal -NotEqual -Not -And -Or -Dot -OpenRoundBracket -ClosedRoundBracket -OpenCurlyBracket -ClosedCurlyBracket -Semicolon -Comma -Class -This -While -If -Else -For -Return -New -CharValue -IntValue -BooleanValue -NullValue -Identifier -WS -InlineComment -MultilineComment - -rule names: -program -classDeclaration -memberDeclaration -constructorDeclaration -fieldDeclaration -methodDeclaration -parameterList -parameter -argumentList -statement -block -returnStatement -localVariableDeclaration -whileStatement -forStatement -ifElseStatement -ifStatement -elseStatement -statementExpression -assign -newDeclaration -expression -unaryExpression -notExpression -crementExpression -incrementExpression -prefixIncrementExpression -suffixIncrementExpression -decrementExpression -prefixDecrementExpression -suffixDecrementExpression -assignableExpression -memberAccess -binaryExpression -calculationExpression -dotExpression -dotSubtractionExpression -nonCalculationExpression -methodCall -target -chainedMethod -type -value -nonCalculationOperator - - -atn: -[4, 1, 50, 396, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 1, 0, 4, 0, 90, 8, 0, 11, 0, 12, 0, 91, 1, 1, 3, 1, 95, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 101, 8, 1, 10, 1, 12, 1, 104, 9, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 3, 2, 111, 8, 2, 1, 3, 3, 3, 114, 8, 3, 1, 3, 1, 3, 1, 3, 3, 3, 119, 8, 3, 1, 3, 1, 3, 1, 3, 1, 4, 3, 4, 125, 8, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 3, 5, 134, 8, 5, 1, 5, 1, 5, 3, 5, 138, 8, 5, 1, 5, 1, 5, 1, 5, 3, 5, 143, 8, 5, 1, 5, 1, 5, 3, 5, 147, 8, 5, 1, 6, 1, 6, 1, 6, 5, 6, 152, 8, 6, 10, 6, 12, 6, 155, 9, 6, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 5, 8, 163, 8, 8, 10, 8, 12, 8, 166, 9, 8, 3, 8, 168, 8, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 183, 8, 9, 1, 10, 1, 10, 5, 10, 187, 8, 10, 10, 10, 12, 10, 190, 9, 10, 1, 10, 1, 10, 1, 11, 1, 11, 3, 11, 196, 8, 11, 1, 12, 1, 12, 1, 12, 1, 12, 3, 12, 202, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 214, 8, 14, 1, 14, 1, 14, 3, 14, 218, 8, 14, 1, 14, 1, 14, 3, 14, 222, 8, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 5, 15, 229, 8, 15, 10, 15, 12, 15, 232, 9, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 247, 8, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 3, 21, 261, 8, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 3, 22, 273, 8, 22, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 3, 24, 280, 8, 24, 1, 25, 1, 25, 3, 25, 284, 8, 25, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 3, 28, 294, 8, 28, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 3, 31, 304, 8, 31, 1, 32, 1, 32, 1, 32, 1, 32, 1, 32, 3, 32, 311, 8, 32, 1, 32, 1, 32, 4, 32, 315, 8, 32, 11, 32, 12, 32, 316, 1, 32, 3, 32, 320, 8, 32, 1, 33, 1, 33, 3, 33, 324, 8, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 5, 34, 332, 8, 34, 10, 34, 12, 34, 335, 9, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 5, 35, 343, 8, 35, 10, 35, 12, 35, 346, 9, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 3, 36, 356, 8, 36, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 3, 38, 363, 8, 38, 1, 38, 5, 38, 366, 8, 38, 10, 38, 12, 38, 369, 9, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 3, 39, 380, 8, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 0, 2, 68, 70, 44, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 0, 3, 2, 0, 4, 6, 47, 47, 1, 0, 43, 46, 1, 0, 11, 12, 407, 0, 89, 1, 0, 0, 0, 2, 94, 1, 0, 0, 0, 4, 110, 1, 0, 0, 0, 6, 113, 1, 0, 0, 0, 8, 124, 1, 0, 0, 0, 10, 146, 1, 0, 0, 0, 12, 148, 1, 0, 0, 0, 14, 156, 1, 0, 0, 0, 16, 167, 1, 0, 0, 0, 18, 182, 1, 0, 0, 0, 20, 184, 1, 0, 0, 0, 22, 193, 1, 0, 0, 0, 24, 197, 1, 0, 0, 0, 26, 203, 1, 0, 0, 0, 28, 209, 1, 0, 0, 0, 30, 226, 1, 0, 0, 0, 32, 233, 1, 0, 0, 0, 34, 239, 1, 0, 0, 0, 36, 246, 1, 0, 0, 0, 38, 248, 1, 0, 0, 0, 40, 252, 1, 0, 0, 0, 42, 260, 1, 0, 0, 0, 44, 272, 1, 0, 0, 0, 46, 274, 1, 0, 0, 0, 48, 279, 1, 0, 0, 0, 50, 283, 1, 0, 0, 0, 52, 285, 1, 0, 0, 0, 54, 288, 1, 0, 0, 0, 56, 293, 1, 0, 0, 0, 58, 295, 1, 0, 0, 0, 60, 298, 1, 0, 0, 0, 62, 303, 1, 0, 0, 0, 64, 319, 1, 0, 0, 0, 66, 323, 1, 0, 0, 0, 68, 325, 1, 0, 0, 0, 70, 336, 1, 0, 0, 0, 72, 355, 1, 0, 0, 0, 74, 357, 1, 0, 0, 0, 76, 362, 1, 0, 0, 0, 78, 379, 1, 0, 0, 0, 80, 383, 1, 0, 0, 0, 82, 389, 1, 0, 0, 0, 84, 391, 1, 0, 0, 0, 86, 393, 1, 0, 0, 0, 88, 90, 3, 2, 1, 0, 89, 88, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 89, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 1, 1, 0, 0, 0, 93, 95, 5, 7, 0, 0, 94, 93, 1, 0, 0, 0, 94, 95, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 97, 5, 35, 0, 0, 97, 98, 5, 47, 0, 0, 98, 102, 5, 31, 0, 0, 99, 101, 3, 4, 2, 0, 100, 99, 1, 0, 0, 0, 101, 104, 1, 0, 0, 0, 102, 100, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 105, 1, 0, 0, 0, 104, 102, 1, 0, 0, 0, 105, 106, 5, 32, 0, 0, 106, 3, 1, 0, 0, 0, 107, 111, 3, 6, 3, 0, 108, 111, 3, 8, 4, 0, 109, 111, 3, 10, 5, 0, 110, 107, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 110, 109, 1, 0, 0, 0, 111, 5, 1, 0, 0, 0, 112, 114, 5, 7, 0, 0, 113, 112, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 116, 5, 47, 0, 0, 116, 118, 5, 29, 0, 0, 117, 119, 3, 12, 6, 0, 118, 117, 1, 0, 0, 0, 118, 119, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 121, 5, 30, 0, 0, 121, 122, 3, 20, 10, 0, 122, 7, 1, 0, 0, 0, 123, 125, 5, 7, 0, 0, 124, 123, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 126, 127, 3, 82, 41, 0, 127, 128, 5, 47, 0, 0, 128, 129, 5, 33, 0, 0, 129, 9, 1, 0, 0, 0, 130, 131, 5, 8, 0, 0, 131, 147, 3, 20, 10, 0, 132, 134, 5, 7, 0, 0, 133, 132, 1, 0, 0, 0, 133, 134, 1, 0, 0, 0, 134, 137, 1, 0, 0, 0, 135, 138, 3, 82, 41, 0, 136, 138, 5, 3, 0, 0, 137, 135, 1, 0, 0, 0, 137, 136, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 139, 140, 5, 47, 0, 0, 140, 142, 5, 29, 0, 0, 141, 143, 3, 12, 6, 0, 142, 141, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 145, 5, 30, 0, 0, 145, 147, 3, 20, 10, 0, 146, 130, 1, 0, 0, 0, 146, 133, 1, 0, 0, 0, 147, 11, 1, 0, 0, 0, 148, 153, 3, 14, 7, 0, 149, 150, 5, 34, 0, 0, 150, 152, 3, 14, 7, 0, 151, 149, 1, 0, 0, 0, 152, 155, 1, 0, 0, 0, 153, 151, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 13, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 156, 157, 3, 82, 41, 0, 157, 158, 5, 47, 0, 0, 158, 15, 1, 0, 0, 0, 159, 164, 3, 42, 21, 0, 160, 161, 5, 34, 0, 0, 161, 163, 3, 42, 21, 0, 162, 160, 1, 0, 0, 0, 163, 166, 1, 0, 0, 0, 164, 162, 1, 0, 0, 0, 164, 165, 1, 0, 0, 0, 165, 168, 1, 0, 0, 0, 166, 164, 1, 0, 0, 0, 167, 159, 1, 0, 0, 0, 167, 168, 1, 0, 0, 0, 168, 17, 1, 0, 0, 0, 169, 170, 3, 22, 11, 0, 170, 171, 5, 33, 0, 0, 171, 183, 1, 0, 0, 0, 172, 173, 3, 24, 12, 0, 173, 174, 5, 33, 0, 0, 174, 183, 1, 0, 0, 0, 175, 183, 3, 20, 10, 0, 176, 183, 3, 26, 13, 0, 177, 183, 3, 28, 14, 0, 178, 183, 3, 30, 15, 0, 179, 180, 3, 36, 18, 0, 180, 181, 5, 33, 0, 0, 181, 183, 1, 0, 0, 0, 182, 169, 1, 0, 0, 0, 182, 172, 1, 0, 0, 0, 182, 175, 1, 0, 0, 0, 182, 176, 1, 0, 0, 0, 182, 177, 1, 0, 0, 0, 182, 178, 1, 0, 0, 0, 182, 179, 1, 0, 0, 0, 183, 19, 1, 0, 0, 0, 184, 188, 5, 31, 0, 0, 185, 187, 3, 18, 9, 0, 186, 185, 1, 0, 0, 0, 187, 190, 1, 0, 0, 0, 188, 186, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 191, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 191, 192, 5, 32, 0, 0, 192, 21, 1, 0, 0, 0, 193, 195, 5, 41, 0, 0, 194, 196, 3, 42, 21, 0, 195, 194, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 23, 1, 0, 0, 0, 197, 198, 3, 82, 41, 0, 198, 201, 5, 47, 0, 0, 199, 200, 5, 13, 0, 0, 200, 202, 3, 42, 21, 0, 201, 199, 1, 0, 0, 0, 201, 202, 1, 0, 0, 0, 202, 25, 1, 0, 0, 0, 203, 204, 5, 37, 0, 0, 204, 205, 5, 29, 0, 0, 205, 206, 3, 42, 21, 0, 206, 207, 5, 30, 0, 0, 207, 208, 3, 20, 10, 0, 208, 27, 1, 0, 0, 0, 209, 210, 5, 40, 0, 0, 210, 213, 5, 29, 0, 0, 211, 214, 3, 36, 18, 0, 212, 214, 3, 24, 12, 0, 213, 211, 1, 0, 0, 0, 213, 212, 1, 0, 0, 0, 214, 215, 1, 0, 0, 0, 215, 217, 5, 33, 0, 0, 216, 218, 3, 42, 21, 0, 217, 216, 1, 0, 0, 0, 217, 218, 1, 0, 0, 0, 218, 219, 1, 0, 0, 0, 219, 221, 5, 33, 0, 0, 220, 222, 3, 36, 18, 0, 221, 220, 1, 0, 0, 0, 221, 222, 1, 0, 0, 0, 222, 223, 1, 0, 0, 0, 223, 224, 5, 30, 0, 0, 224, 225, 3, 20, 10, 0, 225, 29, 1, 0, 0, 0, 226, 230, 3, 32, 16, 0, 227, 229, 3, 34, 17, 0, 228, 227, 1, 0, 0, 0, 229, 232, 1, 0, 0, 0, 230, 228, 1, 0, 0, 0, 230, 231, 1, 0, 0, 0, 231, 31, 1, 0, 0, 0, 232, 230, 1, 0, 0, 0, 233, 234, 5, 38, 0, 0, 234, 235, 5, 29, 0, 0, 235, 236, 3, 42, 21, 0, 236, 237, 5, 30, 0, 0, 237, 238, 3, 20, 10, 0, 238, 33, 1, 0, 0, 0, 239, 240, 5, 39, 0, 0, 240, 241, 3, 20, 10, 0, 241, 35, 1, 0, 0, 0, 242, 247, 3, 38, 19, 0, 243, 247, 3, 40, 20, 0, 244, 247, 3, 76, 38, 0, 245, 247, 3, 48, 24, 0, 246, 242, 1, 0, 0, 0, 246, 243, 1, 0, 0, 0, 246, 244, 1, 0, 0, 0, 246, 245, 1, 0, 0, 0, 247, 37, 1, 0, 0, 0, 248, 249, 3, 62, 31, 0, 249, 250, 5, 13, 0, 0, 250, 251, 3, 42, 21, 0, 251, 39, 1, 0, 0, 0, 252, 253, 5, 42, 0, 0, 253, 254, 5, 47, 0, 0, 254, 255, 5, 29, 0, 0, 255, 256, 3, 16, 8, 0, 256, 257, 5, 30, 0, 0, 257, 41, 1, 0, 0, 0, 258, 261, 3, 44, 22, 0, 259, 261, 3, 66, 33, 0, 260, 258, 1, 0, 0, 0, 260, 259, 1, 0, 0, 0, 261, 43, 1, 0, 0, 0, 262, 273, 5, 36, 0, 0, 263, 273, 5, 47, 0, 0, 264, 273, 3, 64, 32, 0, 265, 273, 3, 84, 42, 0, 266, 273, 3, 46, 23, 0, 267, 273, 3, 36, 18, 0, 268, 269, 5, 29, 0, 0, 269, 270, 3, 42, 21, 0, 270, 271, 5, 30, 0, 0, 271, 273, 1, 0, 0, 0, 272, 262, 1, 0, 0, 0, 272, 263, 1, 0, 0, 0, 272, 264, 1, 0, 0, 0, 272, 265, 1, 0, 0, 0, 272, 266, 1, 0, 0, 0, 272, 267, 1, 0, 0, 0, 272, 268, 1, 0, 0, 0, 273, 45, 1, 0, 0, 0, 274, 275, 5, 25, 0, 0, 275, 276, 3, 42, 21, 0, 276, 47, 1, 0, 0, 0, 277, 280, 3, 50, 25, 0, 278, 280, 3, 56, 28, 0, 279, 277, 1, 0, 0, 0, 279, 278, 1, 0, 0, 0, 280, 49, 1, 0, 0, 0, 281, 284, 3, 52, 26, 0, 282, 284, 3, 54, 27, 0, 283, 281, 1, 0, 0, 0, 283, 282, 1, 0, 0, 0, 284, 51, 1, 0, 0, 0, 285, 286, 5, 1, 0, 0, 286, 287, 3, 62, 31, 0, 287, 53, 1, 0, 0, 0, 288, 289, 3, 62, 31, 0, 289, 290, 5, 1, 0, 0, 290, 55, 1, 0, 0, 0, 291, 294, 3, 58, 29, 0, 292, 294, 3, 60, 30, 0, 293, 291, 1, 0, 0, 0, 293, 292, 1, 0, 0, 0, 294, 57, 1, 0, 0, 0, 295, 296, 5, 2, 0, 0, 296, 297, 3, 62, 31, 0, 297, 59, 1, 0, 0, 0, 298, 299, 3, 62, 31, 0, 299, 300, 5, 2, 0, 0, 300, 61, 1, 0, 0, 0, 301, 304, 5, 47, 0, 0, 302, 304, 3, 64, 32, 0, 303, 301, 1, 0, 0, 0, 303, 302, 1, 0, 0, 0, 304, 63, 1, 0, 0, 0, 305, 306, 5, 36, 0, 0, 306, 307, 5, 28, 0, 0, 307, 320, 5, 47, 0, 0, 308, 309, 5, 36, 0, 0, 309, 311, 5, 28, 0, 0, 310, 308, 1, 0, 0, 0, 310, 311, 1, 0, 0, 0, 311, 314, 1, 0, 0, 0, 312, 313, 5, 47, 0, 0, 313, 315, 5, 28, 0, 0, 314, 312, 1, 0, 0, 0, 315, 316, 1, 0, 0, 0, 316, 314, 1, 0, 0, 0, 316, 317, 1, 0, 0, 0, 317, 318, 1, 0, 0, 0, 318, 320, 5, 47, 0, 0, 319, 305, 1, 0, 0, 0, 319, 310, 1, 0, 0, 0, 320, 65, 1, 0, 0, 0, 321, 324, 3, 68, 34, 0, 322, 324, 3, 74, 37, 0, 323, 321, 1, 0, 0, 0, 323, 322, 1, 0, 0, 0, 324, 67, 1, 0, 0, 0, 325, 326, 6, 34, -1, 0, 326, 327, 3, 70, 35, 0, 327, 333, 1, 0, 0, 0, 328, 329, 10, 2, 0, 0, 329, 330, 5, 10, 0, 0, 330, 332, 3, 70, 35, 0, 331, 328, 1, 0, 0, 0, 332, 335, 1, 0, 0, 0, 333, 331, 1, 0, 0, 0, 333, 334, 1, 0, 0, 0, 334, 69, 1, 0, 0, 0, 335, 333, 1, 0, 0, 0, 336, 337, 6, 35, -1, 0, 337, 338, 3, 72, 36, 0, 338, 344, 1, 0, 0, 0, 339, 340, 10, 2, 0, 0, 340, 341, 5, 9, 0, 0, 341, 343, 3, 72, 36, 0, 342, 339, 1, 0, 0, 0, 343, 346, 1, 0, 0, 0, 344, 342, 1, 0, 0, 0, 344, 345, 1, 0, 0, 0, 345, 71, 1, 0, 0, 0, 346, 344, 1, 0, 0, 0, 347, 356, 5, 44, 0, 0, 348, 356, 5, 47, 0, 0, 349, 356, 3, 64, 32, 0, 350, 351, 3, 76, 38, 0, 351, 352, 5, 29, 0, 0, 352, 353, 3, 68, 34, 0, 353, 354, 5, 30, 0, 0, 354, 356, 1, 0, 0, 0, 355, 347, 1, 0, 0, 0, 355, 348, 1, 0, 0, 0, 355, 349, 1, 0, 0, 0, 355, 350, 1, 0, 0, 0, 356, 73, 1, 0, 0, 0, 357, 358, 3, 44, 22, 0, 358, 359, 3, 86, 43, 0, 359, 360, 3, 42, 21, 0, 360, 75, 1, 0, 0, 0, 361, 363, 3, 78, 39, 0, 362, 361, 1, 0, 0, 0, 362, 363, 1, 0, 0, 0, 363, 367, 1, 0, 0, 0, 364, 366, 3, 80, 40, 0, 365, 364, 1, 0, 0, 0, 366, 369, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 367, 368, 1, 0, 0, 0, 368, 370, 1, 0, 0, 0, 369, 367, 1, 0, 0, 0, 370, 371, 5, 47, 0, 0, 371, 372, 5, 29, 0, 0, 372, 373, 3, 16, 8, 0, 373, 374, 5, 30, 0, 0, 374, 77, 1, 0, 0, 0, 375, 380, 5, 36, 0, 0, 376, 380, 3, 64, 32, 0, 377, 380, 3, 40, 20, 0, 378, 380, 5, 47, 0, 0, 379, 375, 1, 0, 0, 0, 379, 376, 1, 0, 0, 0, 379, 377, 1, 0, 0, 0, 379, 378, 1, 0, 0, 0, 380, 381, 1, 0, 0, 0, 381, 382, 5, 28, 0, 0, 382, 79, 1, 0, 0, 0, 383, 384, 5, 47, 0, 0, 384, 385, 5, 29, 0, 0, 385, 386, 3, 16, 8, 0, 386, 387, 5, 30, 0, 0, 387, 388, 5, 28, 0, 0, 388, 81, 1, 0, 0, 0, 389, 390, 7, 0, 0, 0, 390, 83, 1, 0, 0, 0, 391, 392, 7, 1, 0, 0, 392, 85, 1, 0, 0, 0, 393, 394, 7, 2, 0, 0, 394, 87, 1, 0, 0, 0, 39, 91, 94, 102, 110, 113, 118, 124, 133, 137, 142, 146, 153, 164, 167, 182, 188, 195, 201, 213, 217, 221, 230, 246, 260, 272, 279, 283, 293, 303, 310, 316, 319, 323, 333, 344, 355, 362, 367, 379] \ No newline at end of file diff --git a/src/main/java/parser/generated/SimpleJava.tokens b/src/main/java/parser/generated/SimpleJava.tokens deleted file mode 100644 index bed7437..0000000 --- a/src/main/java/parser/generated/SimpleJava.tokens +++ /dev/null @@ -1,88 +0,0 @@ -T__0=1 -T__1=2 -Void=3 -Boolean=4 -Char=5 -Int=6 -AccessModifier=7 -MainMethodDeclaration=8 -DotOperator=9 -LineOperator=10 -ComparisonOperator=11 -LogicalOperator=12 -Assign=13 -Plus=14 -Minus=15 -Mult=16 -Modulo=17 -Div=18 -Greater=19 -Less=20 -GreaterEqual=21 -LessEqual=22 -Equal=23 -NotEqual=24 -Not=25 -And=26 -Or=27 -Dot=28 -OpenRoundBracket=29 -ClosedRoundBracket=30 -OpenCurlyBracket=31 -ClosedCurlyBracket=32 -Semicolon=33 -Comma=34 -Class=35 -This=36 -While=37 -If=38 -Else=39 -For=40 -Return=41 -New=42 -CharValue=43 -IntValue=44 -BooleanValue=45 -NullValue=46 -Identifier=47 -WS=48 -InlineComment=49 -MultilineComment=50 -'++'=1 -'--'=2 -'void'=3 -'boolean'=4 -'char'=5 -'int'=6 -'public static void main(String[] args)'=8 -'='=13 -'+'=14 -'-'=15 -'*'=16 -'%'=17 -'/'=18 -'>'=19 -'<'=20 -'>='=21 -'<='=22 -'=='=23 -'!='=24 -'!'=25 -'&&'=26 -'||'=27 -'.'=28 -'('=29 -')'=30 -'{'=31 -'}'=32 -';'=33 -','=34 -'class'=35 -'this'=36 -'while'=37 -'if'=38 -'else'=39 -'for'=40 -'return'=41 -'new'=42 -'null'=46 diff --git a/src/main/java/parser/generated/SimpleJavaBaseListener.java b/src/main/java/parser/generated/SimpleJavaBaseListener.java deleted file mode 100644 index 2bf9ddd..0000000 --- a/src/main/java/parser/generated/SimpleJavaBaseListener.java +++ /dev/null @@ -1,568 +0,0 @@ -// Generated from C:/Users/Maxi/Documents/DHBW/Compilerbau/NichtHaskell2.0/src/main/java/parser/grammar/SimpleJava.g4 by ANTLR 4.13.1 -package parser.generated; - -import org.antlr.v4.runtime.ParserRuleContext; -import org.antlr.v4.runtime.tree.ErrorNode; -import org.antlr.v4.runtime.tree.TerminalNode; - -/** - * This class provides an empty implementation of {@link SimpleJavaListener}, - * which can be extended to create a listener which only needs to handle a subset - * of the available methods. - */ -@SuppressWarnings("CheckReturnValue") -public class SimpleJavaBaseListener implements SimpleJavaListener { - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterProgram(SimpleJavaParser.ProgramContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitProgram(SimpleJavaParser.ProgramContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterClassDeclaration(SimpleJavaParser.ClassDeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitClassDeclaration(SimpleJavaParser.ClassDeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterMemberDeclaration(SimpleJavaParser.MemberDeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitMemberDeclaration(SimpleJavaParser.MemberDeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterConstructorDeclaration(SimpleJavaParser.ConstructorDeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitConstructorDeclaration(SimpleJavaParser.ConstructorDeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterFieldDeclaration(SimpleJavaParser.FieldDeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitFieldDeclaration(SimpleJavaParser.FieldDeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterMethodDeclaration(SimpleJavaParser.MethodDeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitMethodDeclaration(SimpleJavaParser.MethodDeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterParameterList(SimpleJavaParser.ParameterListContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitParameterList(SimpleJavaParser.ParameterListContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterParameter(SimpleJavaParser.ParameterContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitParameter(SimpleJavaParser.ParameterContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterArgumentList(SimpleJavaParser.ArgumentListContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitArgumentList(SimpleJavaParser.ArgumentListContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterStatement(SimpleJavaParser.StatementContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitStatement(SimpleJavaParser.StatementContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterBlock(SimpleJavaParser.BlockContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitBlock(SimpleJavaParser.BlockContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterReturnStatement(SimpleJavaParser.ReturnStatementContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitReturnStatement(SimpleJavaParser.ReturnStatementContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterLocalVariableDeclaration(SimpleJavaParser.LocalVariableDeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitLocalVariableDeclaration(SimpleJavaParser.LocalVariableDeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterWhileStatement(SimpleJavaParser.WhileStatementContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitWhileStatement(SimpleJavaParser.WhileStatementContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterForStatement(SimpleJavaParser.ForStatementContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitForStatement(SimpleJavaParser.ForStatementContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterIfElseStatement(SimpleJavaParser.IfElseStatementContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitIfElseStatement(SimpleJavaParser.IfElseStatementContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterIfStatement(SimpleJavaParser.IfStatementContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitIfStatement(SimpleJavaParser.IfStatementContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterElseStatement(SimpleJavaParser.ElseStatementContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitElseStatement(SimpleJavaParser.ElseStatementContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterStatementExpression(SimpleJavaParser.StatementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitStatementExpression(SimpleJavaParser.StatementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterAssign(SimpleJavaParser.AssignContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitAssign(SimpleJavaParser.AssignContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterNewDeclaration(SimpleJavaParser.NewDeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitNewDeclaration(SimpleJavaParser.NewDeclarationContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterExpression(SimpleJavaParser.ExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitExpression(SimpleJavaParser.ExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterUnaryExpression(SimpleJavaParser.UnaryExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitUnaryExpression(SimpleJavaParser.UnaryExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterNotExpression(SimpleJavaParser.NotExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitNotExpression(SimpleJavaParser.NotExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterCrementExpression(SimpleJavaParser.CrementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitCrementExpression(SimpleJavaParser.CrementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterIncrementExpression(SimpleJavaParser.IncrementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitIncrementExpression(SimpleJavaParser.IncrementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterPrefixIncrementExpression(SimpleJavaParser.PrefixIncrementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitPrefixIncrementExpression(SimpleJavaParser.PrefixIncrementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterSuffixIncrementExpression(SimpleJavaParser.SuffixIncrementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitSuffixIncrementExpression(SimpleJavaParser.SuffixIncrementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterDecrementExpression(SimpleJavaParser.DecrementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitDecrementExpression(SimpleJavaParser.DecrementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterPrefixDecrementExpression(SimpleJavaParser.PrefixDecrementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitPrefixDecrementExpression(SimpleJavaParser.PrefixDecrementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterSuffixDecrementExpression(SimpleJavaParser.SuffixDecrementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitSuffixDecrementExpression(SimpleJavaParser.SuffixDecrementExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterAssignableExpression(SimpleJavaParser.AssignableExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitAssignableExpression(SimpleJavaParser.AssignableExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterMemberAccess(SimpleJavaParser.MemberAccessContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitMemberAccess(SimpleJavaParser.MemberAccessContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterBinaryExpression(SimpleJavaParser.BinaryExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitBinaryExpression(SimpleJavaParser.BinaryExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterCalculationExpression(SimpleJavaParser.CalculationExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitCalculationExpression(SimpleJavaParser.CalculationExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterDotExpression(SimpleJavaParser.DotExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitDotExpression(SimpleJavaParser.DotExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterDotSubtractionExpression(SimpleJavaParser.DotSubtractionExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitDotSubtractionExpression(SimpleJavaParser.DotSubtractionExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterNonCalculationExpression(SimpleJavaParser.NonCalculationExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitNonCalculationExpression(SimpleJavaParser.NonCalculationExpressionContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterMethodCall(SimpleJavaParser.MethodCallContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitMethodCall(SimpleJavaParser.MethodCallContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterTarget(SimpleJavaParser.TargetContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitTarget(SimpleJavaParser.TargetContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterChainedMethod(SimpleJavaParser.ChainedMethodContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitChainedMethod(SimpleJavaParser.ChainedMethodContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterType(SimpleJavaParser.TypeContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitType(SimpleJavaParser.TypeContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterValue(SimpleJavaParser.ValueContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitValue(SimpleJavaParser.ValueContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterNonCalculationOperator(SimpleJavaParser.NonCalculationOperatorContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitNonCalculationOperator(SimpleJavaParser.NonCalculationOperatorContext ctx) { } - - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void enterEveryRule(ParserRuleContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void exitEveryRule(ParserRuleContext ctx) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void visitTerminal(TerminalNode node) { } - /** - * {@inheritDoc} - * - *

The default implementation does nothing.

- */ - @Override public void visitErrorNode(ErrorNode node) { } -} \ No newline at end of file diff --git a/src/main/java/parser/generated/SimpleJavaBaseVisitor.java b/src/main/java/parser/generated/SimpleJavaBaseVisitor.java deleted file mode 100644 index 92fb64c..0000000 --- a/src/main/java/parser/generated/SimpleJavaBaseVisitor.java +++ /dev/null @@ -1,323 +0,0 @@ -// Generated from C:/Users/Maxi/Documents/DHBW/Compilerbau/NichtHaskell2.0/src/main/java/parser/grammar/SimpleJava.g4 by ANTLR 4.13.1 -package parser.generated; -import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; - -/** - * This class provides an empty implementation of {@link SimpleJavaVisitor}, - * which can be extended to create a visitor which only needs to handle a subset - * of the available methods. - * - * @param The return type of the visit operation. Use {@link Void} for - * operations with no return type. - */ -@SuppressWarnings("CheckReturnValue") -public class SimpleJavaBaseVisitor extends AbstractParseTreeVisitor implements SimpleJavaVisitor { - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitProgram(SimpleJavaParser.ProgramContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitClassDeclaration(SimpleJavaParser.ClassDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitMemberDeclaration(SimpleJavaParser.MemberDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitConstructorDeclaration(SimpleJavaParser.ConstructorDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitFieldDeclaration(SimpleJavaParser.FieldDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitMethodDeclaration(SimpleJavaParser.MethodDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitParameterList(SimpleJavaParser.ParameterListContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitParameter(SimpleJavaParser.ParameterContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitArgumentList(SimpleJavaParser.ArgumentListContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitStatement(SimpleJavaParser.StatementContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitBlock(SimpleJavaParser.BlockContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitReturnStatement(SimpleJavaParser.ReturnStatementContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitLocalVariableDeclaration(SimpleJavaParser.LocalVariableDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitWhileStatement(SimpleJavaParser.WhileStatementContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitForStatement(SimpleJavaParser.ForStatementContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitIfElseStatement(SimpleJavaParser.IfElseStatementContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitIfStatement(SimpleJavaParser.IfStatementContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitElseStatement(SimpleJavaParser.ElseStatementContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitStatementExpression(SimpleJavaParser.StatementExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitAssign(SimpleJavaParser.AssignContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitNewDeclaration(SimpleJavaParser.NewDeclarationContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitExpression(SimpleJavaParser.ExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitUnaryExpression(SimpleJavaParser.UnaryExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitNotExpression(SimpleJavaParser.NotExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitCrementExpression(SimpleJavaParser.CrementExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitIncrementExpression(SimpleJavaParser.IncrementExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitPrefixIncrementExpression(SimpleJavaParser.PrefixIncrementExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitSuffixIncrementExpression(SimpleJavaParser.SuffixIncrementExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitDecrementExpression(SimpleJavaParser.DecrementExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitPrefixDecrementExpression(SimpleJavaParser.PrefixDecrementExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitSuffixDecrementExpression(SimpleJavaParser.SuffixDecrementExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitAssignableExpression(SimpleJavaParser.AssignableExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitMemberAccess(SimpleJavaParser.MemberAccessContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitBinaryExpression(SimpleJavaParser.BinaryExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitCalculationExpression(SimpleJavaParser.CalculationExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitDotExpression(SimpleJavaParser.DotExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitDotSubtractionExpression(SimpleJavaParser.DotSubtractionExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitNonCalculationExpression(SimpleJavaParser.NonCalculationExpressionContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitMethodCall(SimpleJavaParser.MethodCallContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitTarget(SimpleJavaParser.TargetContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitChainedMethod(SimpleJavaParser.ChainedMethodContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitType(SimpleJavaParser.TypeContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitValue(SimpleJavaParser.ValueContext ctx) { return visitChildren(ctx); } - /** - * {@inheritDoc} - * - *

The default implementation returns the result of calling - * {@link #visitChildren} on {@code ctx}.

- */ - @Override public T visitNonCalculationOperator(SimpleJavaParser.NonCalculationOperatorContext ctx) { return visitChildren(ctx); } -} \ No newline at end of file diff --git a/src/main/java/parser/generated/SimpleJavaLexer.interp b/src/main/java/parser/generated/SimpleJavaLexer.interp deleted file mode 100644 index 919e1fd..0000000 --- a/src/main/java/parser/generated/SimpleJavaLexer.interp +++ /dev/null @@ -1,170 +0,0 @@ -token literal names: -null -'++' -'--' -'void' -'boolean' -'char' -'int' -null -'public static void main(String[] args)' -null -null -null -null -'=' -'+' -'-' -'*' -'%' -'/' -'>' -'<' -'>=' -'<=' -'==' -'!=' -'!' -'&&' -'||' -'.' -'(' -')' -'{' -'}' -';' -',' -'class' -'this' -'while' -'if' -'else' -'for' -'return' -'new' -null -null -null -'null' -null -null -null -null - -token symbolic names: -null -null -null -Void -Boolean -Char -Int -AccessModifier -MainMethodDeclaration -DotOperator -LineOperator -ComparisonOperator -LogicalOperator -Assign -Plus -Minus -Mult -Modulo -Div -Greater -Less -GreaterEqual -LessEqual -Equal -NotEqual -Not -And -Or -Dot -OpenRoundBracket -ClosedRoundBracket -OpenCurlyBracket -ClosedCurlyBracket -Semicolon -Comma -Class -This -While -If -Else -For -Return -New -CharValue -IntValue -BooleanValue -NullValue -Identifier -WS -InlineComment -MultilineComment - -rule names: -T__0 -T__1 -Void -Boolean -Char -Int -AccessModifier -MainMethodDeclaration -DotOperator -LineOperator -ComparisonOperator -LogicalOperator -Assign -Plus -Minus -Mult -Modulo -Div -Greater -Less -GreaterEqual -LessEqual -Equal -NotEqual -Not -And -Or -Dot -OpenRoundBracket -ClosedRoundBracket -OpenCurlyBracket -ClosedCurlyBracket -Semicolon -Comma -Class -This -While -If -Else -For -Return -New -CharValue -IntValue -BooleanValue -NullValue -Alphabetic -Numeric -ValidIdentSymbols -Identifier -WS -InlineComment -MultilineComment - -channel names: -DEFAULT_TOKEN_CHANNEL -HIDDEN - -mode names: -DEFAULT_MODE - -atn: -[4, 0, 50, 408, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 3, 6, 176, 8, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 3, 8, 220, 8, 8, 1, 9, 1, 9, 3, 9, 224, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 232, 8, 10, 1, 11, 1, 11, 3, 11, 236, 8, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 34, 1, 35, 1, 35, 1, 35, 1, 35, 1, 35, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 36, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 1, 38, 1, 38, 1, 38, 1, 39, 1, 39, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 5, 42, 330, 8, 42, 10, 42, 12, 42, 333, 9, 42, 1, 42, 1, 42, 1, 43, 3, 43, 338, 8, 43, 1, 43, 4, 43, 341, 8, 43, 11, 43, 12, 43, 342, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 3, 44, 354, 8, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 3, 48, 368, 8, 48, 1, 49, 1, 49, 5, 49, 372, 8, 49, 10, 49, 12, 49, 375, 9, 49, 1, 50, 4, 50, 378, 8, 50, 11, 50, 12, 50, 379, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 5, 51, 388, 8, 51, 10, 51, 12, 51, 391, 9, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 5, 52, 399, 8, 52, 10, 52, 12, 52, 402, 9, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 400, 0, 53, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28, 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39, 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 0, 95, 0, 97, 0, 99, 47, 101, 48, 103, 49, 105, 50, 1, 0, 5, 2, 0, 10, 10, 13, 13, 2, 0, 65, 90, 97, 122, 1, 0, 48, 57, 2, 0, 36, 36, 95, 95, 3, 0, 9, 10, 13, 13, 32, 32, 426, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 1, 107, 1, 0, 0, 0, 3, 110, 1, 0, 0, 0, 5, 113, 1, 0, 0, 0, 7, 118, 1, 0, 0, 0, 9, 126, 1, 0, 0, 0, 11, 131, 1, 0, 0, 0, 13, 175, 1, 0, 0, 0, 15, 177, 1, 0, 0, 0, 17, 219, 1, 0, 0, 0, 19, 223, 1, 0, 0, 0, 21, 231, 1, 0, 0, 0, 23, 235, 1, 0, 0, 0, 25, 237, 1, 0, 0, 0, 27, 239, 1, 0, 0, 0, 29, 241, 1, 0, 0, 0, 31, 243, 1, 0, 0, 0, 33, 245, 1, 0, 0, 0, 35, 247, 1, 0, 0, 0, 37, 249, 1, 0, 0, 0, 39, 251, 1, 0, 0, 0, 41, 253, 1, 0, 0, 0, 43, 256, 1, 0, 0, 0, 45, 259, 1, 0, 0, 0, 47, 262, 1, 0, 0, 0, 49, 265, 1, 0, 0, 0, 51, 267, 1, 0, 0, 0, 53, 270, 1, 0, 0, 0, 55, 273, 1, 0, 0, 0, 57, 275, 1, 0, 0, 0, 59, 277, 1, 0, 0, 0, 61, 279, 1, 0, 0, 0, 63, 281, 1, 0, 0, 0, 65, 283, 1, 0, 0, 0, 67, 285, 1, 0, 0, 0, 69, 287, 1, 0, 0, 0, 71, 293, 1, 0, 0, 0, 73, 298, 1, 0, 0, 0, 75, 304, 1, 0, 0, 0, 77, 307, 1, 0, 0, 0, 79, 312, 1, 0, 0, 0, 81, 316, 1, 0, 0, 0, 83, 323, 1, 0, 0, 0, 85, 327, 1, 0, 0, 0, 87, 337, 1, 0, 0, 0, 89, 353, 1, 0, 0, 0, 91, 355, 1, 0, 0, 0, 93, 360, 1, 0, 0, 0, 95, 362, 1, 0, 0, 0, 97, 367, 1, 0, 0, 0, 99, 369, 1, 0, 0, 0, 101, 377, 1, 0, 0, 0, 103, 383, 1, 0, 0, 0, 105, 394, 1, 0, 0, 0, 107, 108, 5, 43, 0, 0, 108, 109, 5, 43, 0, 0, 109, 2, 1, 0, 0, 0, 110, 111, 5, 45, 0, 0, 111, 112, 5, 45, 0, 0, 112, 4, 1, 0, 0, 0, 113, 114, 5, 118, 0, 0, 114, 115, 5, 111, 0, 0, 115, 116, 5, 105, 0, 0, 116, 117, 5, 100, 0, 0, 117, 6, 1, 0, 0, 0, 118, 119, 5, 98, 0, 0, 119, 120, 5, 111, 0, 0, 120, 121, 5, 111, 0, 0, 121, 122, 5, 108, 0, 0, 122, 123, 5, 101, 0, 0, 123, 124, 5, 97, 0, 0, 124, 125, 5, 110, 0, 0, 125, 8, 1, 0, 0, 0, 126, 127, 5, 99, 0, 0, 127, 128, 5, 104, 0, 0, 128, 129, 5, 97, 0, 0, 129, 130, 5, 114, 0, 0, 130, 10, 1, 0, 0, 0, 131, 132, 5, 105, 0, 0, 132, 133, 5, 110, 0, 0, 133, 134, 5, 116, 0, 0, 134, 12, 1, 0, 0, 0, 135, 136, 5, 112, 0, 0, 136, 137, 5, 117, 0, 0, 137, 138, 5, 98, 0, 0, 138, 139, 5, 108, 0, 0, 139, 140, 5, 105, 0, 0, 140, 176, 5, 99, 0, 0, 141, 142, 5, 112, 0, 0, 142, 143, 5, 114, 0, 0, 143, 144, 5, 105, 0, 0, 144, 145, 5, 118, 0, 0, 145, 146, 5, 97, 0, 0, 146, 147, 5, 116, 0, 0, 147, 176, 5, 101, 0, 0, 148, 149, 5, 112, 0, 0, 149, 150, 5, 117, 0, 0, 150, 151, 5, 98, 0, 0, 151, 152, 5, 108, 0, 0, 152, 153, 5, 105, 0, 0, 153, 154, 5, 99, 0, 0, 154, 155, 5, 32, 0, 0, 155, 156, 5, 115, 0, 0, 156, 157, 5, 116, 0, 0, 157, 158, 5, 97, 0, 0, 158, 159, 5, 116, 0, 0, 159, 160, 5, 105, 0, 0, 160, 176, 5, 99, 0, 0, 161, 162, 5, 112, 0, 0, 162, 163, 5, 114, 0, 0, 163, 164, 5, 105, 0, 0, 164, 165, 5, 118, 0, 0, 165, 166, 5, 97, 0, 0, 166, 167, 5, 116, 0, 0, 167, 168, 5, 101, 0, 0, 168, 169, 5, 32, 0, 0, 169, 170, 5, 115, 0, 0, 170, 171, 5, 116, 0, 0, 171, 172, 5, 97, 0, 0, 172, 173, 5, 116, 0, 0, 173, 174, 5, 105, 0, 0, 174, 176, 5, 99, 0, 0, 175, 135, 1, 0, 0, 0, 175, 141, 1, 0, 0, 0, 175, 148, 1, 0, 0, 0, 175, 161, 1, 0, 0, 0, 176, 14, 1, 0, 0, 0, 177, 178, 5, 112, 0, 0, 178, 179, 5, 117, 0, 0, 179, 180, 5, 98, 0, 0, 180, 181, 5, 108, 0, 0, 181, 182, 5, 105, 0, 0, 182, 183, 5, 99, 0, 0, 183, 184, 5, 32, 0, 0, 184, 185, 5, 115, 0, 0, 185, 186, 5, 116, 0, 0, 186, 187, 5, 97, 0, 0, 187, 188, 5, 116, 0, 0, 188, 189, 5, 105, 0, 0, 189, 190, 5, 99, 0, 0, 190, 191, 5, 32, 0, 0, 191, 192, 5, 118, 0, 0, 192, 193, 5, 111, 0, 0, 193, 194, 5, 105, 0, 0, 194, 195, 5, 100, 0, 0, 195, 196, 5, 32, 0, 0, 196, 197, 5, 109, 0, 0, 197, 198, 5, 97, 0, 0, 198, 199, 5, 105, 0, 0, 199, 200, 5, 110, 0, 0, 200, 201, 5, 40, 0, 0, 201, 202, 5, 83, 0, 0, 202, 203, 5, 116, 0, 0, 203, 204, 5, 114, 0, 0, 204, 205, 5, 105, 0, 0, 205, 206, 5, 110, 0, 0, 206, 207, 5, 103, 0, 0, 207, 208, 5, 91, 0, 0, 208, 209, 5, 93, 0, 0, 209, 210, 5, 32, 0, 0, 210, 211, 5, 97, 0, 0, 211, 212, 5, 114, 0, 0, 212, 213, 5, 103, 0, 0, 213, 214, 5, 115, 0, 0, 214, 215, 5, 41, 0, 0, 215, 16, 1, 0, 0, 0, 216, 220, 3, 31, 15, 0, 217, 220, 3, 35, 17, 0, 218, 220, 3, 33, 16, 0, 219, 216, 1, 0, 0, 0, 219, 217, 1, 0, 0, 0, 219, 218, 1, 0, 0, 0, 220, 18, 1, 0, 0, 0, 221, 224, 3, 27, 13, 0, 222, 224, 3, 29, 14, 0, 223, 221, 1, 0, 0, 0, 223, 222, 1, 0, 0, 0, 224, 20, 1, 0, 0, 0, 225, 232, 3, 37, 18, 0, 226, 232, 3, 39, 19, 0, 227, 232, 3, 41, 20, 0, 228, 232, 3, 43, 21, 0, 229, 232, 3, 45, 22, 0, 230, 232, 3, 47, 23, 0, 231, 225, 1, 0, 0, 0, 231, 226, 1, 0, 0, 0, 231, 227, 1, 0, 0, 0, 231, 228, 1, 0, 0, 0, 231, 229, 1, 0, 0, 0, 231, 230, 1, 0, 0, 0, 232, 22, 1, 0, 0, 0, 233, 236, 3, 51, 25, 0, 234, 236, 3, 53, 26, 0, 235, 233, 1, 0, 0, 0, 235, 234, 1, 0, 0, 0, 236, 24, 1, 0, 0, 0, 237, 238, 5, 61, 0, 0, 238, 26, 1, 0, 0, 0, 239, 240, 5, 43, 0, 0, 240, 28, 1, 0, 0, 0, 241, 242, 5, 45, 0, 0, 242, 30, 1, 0, 0, 0, 243, 244, 5, 42, 0, 0, 244, 32, 1, 0, 0, 0, 245, 246, 5, 37, 0, 0, 246, 34, 1, 0, 0, 0, 247, 248, 5, 47, 0, 0, 248, 36, 1, 0, 0, 0, 249, 250, 5, 62, 0, 0, 250, 38, 1, 0, 0, 0, 251, 252, 5, 60, 0, 0, 252, 40, 1, 0, 0, 0, 253, 254, 5, 62, 0, 0, 254, 255, 5, 61, 0, 0, 255, 42, 1, 0, 0, 0, 256, 257, 5, 60, 0, 0, 257, 258, 5, 61, 0, 0, 258, 44, 1, 0, 0, 0, 259, 260, 5, 61, 0, 0, 260, 261, 5, 61, 0, 0, 261, 46, 1, 0, 0, 0, 262, 263, 5, 33, 0, 0, 263, 264, 5, 61, 0, 0, 264, 48, 1, 0, 0, 0, 265, 266, 5, 33, 0, 0, 266, 50, 1, 0, 0, 0, 267, 268, 5, 38, 0, 0, 268, 269, 5, 38, 0, 0, 269, 52, 1, 0, 0, 0, 270, 271, 5, 124, 0, 0, 271, 272, 5, 124, 0, 0, 272, 54, 1, 0, 0, 0, 273, 274, 5, 46, 0, 0, 274, 56, 1, 0, 0, 0, 275, 276, 5, 40, 0, 0, 276, 58, 1, 0, 0, 0, 277, 278, 5, 41, 0, 0, 278, 60, 1, 0, 0, 0, 279, 280, 5, 123, 0, 0, 280, 62, 1, 0, 0, 0, 281, 282, 5, 125, 0, 0, 282, 64, 1, 0, 0, 0, 283, 284, 5, 59, 0, 0, 284, 66, 1, 0, 0, 0, 285, 286, 5, 44, 0, 0, 286, 68, 1, 0, 0, 0, 287, 288, 5, 99, 0, 0, 288, 289, 5, 108, 0, 0, 289, 290, 5, 97, 0, 0, 290, 291, 5, 115, 0, 0, 291, 292, 5, 115, 0, 0, 292, 70, 1, 0, 0, 0, 293, 294, 5, 116, 0, 0, 294, 295, 5, 104, 0, 0, 295, 296, 5, 105, 0, 0, 296, 297, 5, 115, 0, 0, 297, 72, 1, 0, 0, 0, 298, 299, 5, 119, 0, 0, 299, 300, 5, 104, 0, 0, 300, 301, 5, 105, 0, 0, 301, 302, 5, 108, 0, 0, 302, 303, 5, 101, 0, 0, 303, 74, 1, 0, 0, 0, 304, 305, 5, 105, 0, 0, 305, 306, 5, 102, 0, 0, 306, 76, 1, 0, 0, 0, 307, 308, 5, 101, 0, 0, 308, 309, 5, 108, 0, 0, 309, 310, 5, 115, 0, 0, 310, 311, 5, 101, 0, 0, 311, 78, 1, 0, 0, 0, 312, 313, 5, 102, 0, 0, 313, 314, 5, 111, 0, 0, 314, 315, 5, 114, 0, 0, 315, 80, 1, 0, 0, 0, 316, 317, 5, 114, 0, 0, 317, 318, 5, 101, 0, 0, 318, 319, 5, 116, 0, 0, 319, 320, 5, 117, 0, 0, 320, 321, 5, 114, 0, 0, 321, 322, 5, 110, 0, 0, 322, 82, 1, 0, 0, 0, 323, 324, 5, 110, 0, 0, 324, 325, 5, 101, 0, 0, 325, 326, 5, 119, 0, 0, 326, 84, 1, 0, 0, 0, 327, 331, 5, 39, 0, 0, 328, 330, 8, 0, 0, 0, 329, 328, 1, 0, 0, 0, 330, 333, 1, 0, 0, 0, 331, 329, 1, 0, 0, 0, 331, 332, 1, 0, 0, 0, 332, 334, 1, 0, 0, 0, 333, 331, 1, 0, 0, 0, 334, 335, 5, 39, 0, 0, 335, 86, 1, 0, 0, 0, 336, 338, 3, 29, 14, 0, 337, 336, 1, 0, 0, 0, 337, 338, 1, 0, 0, 0, 338, 340, 1, 0, 0, 0, 339, 341, 3, 95, 47, 0, 340, 339, 1, 0, 0, 0, 341, 342, 1, 0, 0, 0, 342, 340, 1, 0, 0, 0, 342, 343, 1, 0, 0, 0, 343, 88, 1, 0, 0, 0, 344, 345, 5, 116, 0, 0, 345, 346, 5, 114, 0, 0, 346, 347, 5, 117, 0, 0, 347, 354, 5, 101, 0, 0, 348, 349, 5, 102, 0, 0, 349, 350, 5, 97, 0, 0, 350, 351, 5, 108, 0, 0, 351, 352, 5, 115, 0, 0, 352, 354, 5, 101, 0, 0, 353, 344, 1, 0, 0, 0, 353, 348, 1, 0, 0, 0, 354, 90, 1, 0, 0, 0, 355, 356, 5, 110, 0, 0, 356, 357, 5, 117, 0, 0, 357, 358, 5, 108, 0, 0, 358, 359, 5, 108, 0, 0, 359, 92, 1, 0, 0, 0, 360, 361, 7, 1, 0, 0, 361, 94, 1, 0, 0, 0, 362, 363, 7, 2, 0, 0, 363, 96, 1, 0, 0, 0, 364, 368, 3, 93, 46, 0, 365, 368, 3, 95, 47, 0, 366, 368, 7, 3, 0, 0, 367, 364, 1, 0, 0, 0, 367, 365, 1, 0, 0, 0, 367, 366, 1, 0, 0, 0, 368, 98, 1, 0, 0, 0, 369, 373, 3, 93, 46, 0, 370, 372, 3, 97, 48, 0, 371, 370, 1, 0, 0, 0, 372, 375, 1, 0, 0, 0, 373, 371, 1, 0, 0, 0, 373, 374, 1, 0, 0, 0, 374, 100, 1, 0, 0, 0, 375, 373, 1, 0, 0, 0, 376, 378, 7, 4, 0, 0, 377, 376, 1, 0, 0, 0, 378, 379, 1, 0, 0, 0, 379, 377, 1, 0, 0, 0, 379, 380, 1, 0, 0, 0, 380, 381, 1, 0, 0, 0, 381, 382, 6, 50, 0, 0, 382, 102, 1, 0, 0, 0, 383, 384, 5, 47, 0, 0, 384, 385, 5, 47, 0, 0, 385, 389, 1, 0, 0, 0, 386, 388, 8, 0, 0, 0, 387, 386, 1, 0, 0, 0, 388, 391, 1, 0, 0, 0, 389, 387, 1, 0, 0, 0, 389, 390, 1, 0, 0, 0, 390, 392, 1, 0, 0, 0, 391, 389, 1, 0, 0, 0, 392, 393, 6, 51, 0, 0, 393, 104, 1, 0, 0, 0, 394, 395, 5, 47, 0, 0, 395, 396, 5, 42, 0, 0, 396, 400, 1, 0, 0, 0, 397, 399, 9, 0, 0, 0, 398, 397, 1, 0, 0, 0, 399, 402, 1, 0, 0, 0, 400, 401, 1, 0, 0, 0, 400, 398, 1, 0, 0, 0, 401, 403, 1, 0, 0, 0, 402, 400, 1, 0, 0, 0, 403, 404, 5, 42, 0, 0, 404, 405, 5, 47, 0, 0, 405, 406, 1, 0, 0, 0, 406, 407, 6, 52, 0, 0, 407, 106, 1, 0, 0, 0, 15, 0, 175, 219, 223, 231, 235, 331, 337, 342, 353, 367, 373, 379, 389, 400, 1, 6, 0, 0] \ No newline at end of file diff --git a/src/main/java/parser/generated/SimpleJavaLexer.java b/src/main/java/parser/generated/SimpleJavaLexer.java deleted file mode 100644 index cb01452..0000000 --- a/src/main/java/parser/generated/SimpleJavaLexer.java +++ /dev/null @@ -1,394 +0,0 @@ -// Generated from C:/Users/Maxi/Documents/DHBW/Compilerbau/NichtHaskell2.0/src/main/java/parser/grammar/SimpleJava.g4 by ANTLR 4.13.1 -package parser.generated; -import org.antlr.v4.runtime.Lexer; -import org.antlr.v4.runtime.CharStream; -import org.antlr.v4.runtime.Token; -import org.antlr.v4.runtime.TokenStream; -import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.atn.*; -import org.antlr.v4.runtime.dfa.DFA; -import org.antlr.v4.runtime.misc.*; - -@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue", "this-escape"}) -public class SimpleJavaLexer extends Lexer { - static { RuntimeMetaData.checkVersion("4.13.1", RuntimeMetaData.VERSION); } - - protected static final DFA[] _decisionToDFA; - protected static final PredictionContextCache _sharedContextCache = - new PredictionContextCache(); - public static final int - T__0=1, T__1=2, Void=3, Boolean=4, Char=5, Int=6, AccessModifier=7, MainMethodDeclaration=8, - DotOperator=9, LineOperator=10, ComparisonOperator=11, LogicalOperator=12, - Assign=13, Plus=14, Minus=15, Mult=16, Modulo=17, Div=18, Greater=19, - Less=20, GreaterEqual=21, LessEqual=22, Equal=23, NotEqual=24, Not=25, - And=26, Or=27, Dot=28, OpenRoundBracket=29, ClosedRoundBracket=30, OpenCurlyBracket=31, - ClosedCurlyBracket=32, Semicolon=33, Comma=34, Class=35, This=36, While=37, - If=38, Else=39, For=40, Return=41, New=42, CharValue=43, IntValue=44, - BooleanValue=45, NullValue=46, Identifier=47, WS=48, InlineComment=49, - MultilineComment=50; - public static String[] channelNames = { - "DEFAULT_TOKEN_CHANNEL", "HIDDEN" - }; - - public static String[] modeNames = { - "DEFAULT_MODE" - }; - - private static String[] makeRuleNames() { - return new String[] { - "T__0", "T__1", "Void", "Boolean", "Char", "Int", "AccessModifier", "MainMethodDeclaration", - "DotOperator", "LineOperator", "ComparisonOperator", "LogicalOperator", - "Assign", "Plus", "Minus", "Mult", "Modulo", "Div", "Greater", "Less", - "GreaterEqual", "LessEqual", "Equal", "NotEqual", "Not", "And", "Or", - "Dot", "OpenRoundBracket", "ClosedRoundBracket", "OpenCurlyBracket", - "ClosedCurlyBracket", "Semicolon", "Comma", "Class", "This", "While", - "If", "Else", "For", "Return", "New", "CharValue", "IntValue", "BooleanValue", - "NullValue", "Alphabetic", "Numeric", "ValidIdentSymbols", "Identifier", - "WS", "InlineComment", "MultilineComment" - }; - } - public static final String[] ruleNames = makeRuleNames(); - - private static String[] makeLiteralNames() { - return new String[] { - null, "'++'", "'--'", "'void'", "'boolean'", "'char'", "'int'", null, - "'public static void main(String[] args)'", null, null, null, null, "'='", - "'+'", "'-'", "'*'", "'%'", "'/'", "'>'", "'<'", "'>='", "'<='", "'=='", - "'!='", "'!'", "'&&'", "'||'", "'.'", "'('", "')'", "'{'", "'}'", "';'", - "','", "'class'", "'this'", "'while'", "'if'", "'else'", "'for'", "'return'", - "'new'", null, null, null, "'null'" - }; - } - private static final String[] _LITERAL_NAMES = makeLiteralNames(); - private static String[] makeSymbolicNames() { - return new String[] { - null, null, null, "Void", "Boolean", "Char", "Int", "AccessModifier", - "MainMethodDeclaration", "DotOperator", "LineOperator", "ComparisonOperator", - "LogicalOperator", "Assign", "Plus", "Minus", "Mult", "Modulo", "Div", - "Greater", "Less", "GreaterEqual", "LessEqual", "Equal", "NotEqual", - "Not", "And", "Or", "Dot", "OpenRoundBracket", "ClosedRoundBracket", - "OpenCurlyBracket", "ClosedCurlyBracket", "Semicolon", "Comma", "Class", - "This", "While", "If", "Else", "For", "Return", "New", "CharValue", "IntValue", - "BooleanValue", "NullValue", "Identifier", "WS", "InlineComment", "MultilineComment" - }; - } - private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); - public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); - - /** - * @deprecated Use {@link #VOCABULARY} instead. - */ - @Deprecated - public static final String[] tokenNames; - static { - tokenNames = new String[_SYMBOLIC_NAMES.length]; - for (int i = 0; i < tokenNames.length; i++) { - tokenNames[i] = VOCABULARY.getLiteralName(i); - if (tokenNames[i] == null) { - tokenNames[i] = VOCABULARY.getSymbolicName(i); - } - - if (tokenNames[i] == null) { - tokenNames[i] = ""; - } - } - } - - @Override - @Deprecated - public String[] getTokenNames() { - return tokenNames; - } - - @Override - - public Vocabulary getVocabulary() { - return VOCABULARY; - } - - - public SimpleJavaLexer(CharStream input) { - super(input); - _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); - } - - @Override - public String getGrammarFileName() { return "SimpleJava.g4"; } - - @Override - public String[] getRuleNames() { return ruleNames; } - - @Override - public String getSerializedATN() { return _serializedATN; } - - @Override - public String[] getChannelNames() { return channelNames; } - - @Override - public String[] getModeNames() { return modeNames; } - - @Override - public ATN getATN() { return _ATN; } - - public static final String _serializedATN = - "\u0004\u00002\u0198\u0006\uffff\uffff\u0002\u0000\u0007\u0000\u0002\u0001"+ - "\u0007\u0001\u0002\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004"+ - "\u0007\u0004\u0002\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007"+ - "\u0007\u0007\u0002\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b"+ - "\u0007\u000b\u0002\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0002"+ - "\u000f\u0007\u000f\u0002\u0010\u0007\u0010\u0002\u0011\u0007\u0011\u0002"+ - "\u0012\u0007\u0012\u0002\u0013\u0007\u0013\u0002\u0014\u0007\u0014\u0002"+ - "\u0015\u0007\u0015\u0002\u0016\u0007\u0016\u0002\u0017\u0007\u0017\u0002"+ - "\u0018\u0007\u0018\u0002\u0019\u0007\u0019\u0002\u001a\u0007\u001a\u0002"+ - "\u001b\u0007\u001b\u0002\u001c\u0007\u001c\u0002\u001d\u0007\u001d\u0002"+ - "\u001e\u0007\u001e\u0002\u001f\u0007\u001f\u0002 \u0007 \u0002!\u0007"+ - "!\u0002\"\u0007\"\u0002#\u0007#\u0002$\u0007$\u0002%\u0007%\u0002&\u0007"+ - "&\u0002\'\u0007\'\u0002(\u0007(\u0002)\u0007)\u0002*\u0007*\u0002+\u0007"+ - "+\u0002,\u0007,\u0002-\u0007-\u0002.\u0007.\u0002/\u0007/\u00020\u0007"+ - "0\u00021\u00071\u00022\u00072\u00023\u00073\u00024\u00074\u0001\u0000"+ - "\u0001\u0000\u0001\u0000\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0002"+ - "\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0002\u0001\u0003\u0001\u0003"+ - "\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003\u0001\u0003"+ - "\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0004\u0001\u0005"+ - "\u0001\u0005\u0001\u0005\u0001\u0005\u0001\u0006\u0001\u0006\u0001\u0006"+ - "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+ - "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+ - "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+ - "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+ - "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+ - "\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006"+ - "\u0001\u0006\u0003\u0006\u00b0\b\u0006\u0001\u0007\u0001\u0007\u0001\u0007"+ - "\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007"+ - "\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007"+ - "\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007"+ - "\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007"+ - "\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007"+ - "\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\u0007"+ - "\u0001\b\u0001\b\u0001\b\u0003\b\u00dc\b\b\u0001\t\u0001\t\u0003\t\u00e0"+ - "\b\t\u0001\n\u0001\n\u0001\n\u0001\n\u0001\n\u0001\n\u0003\n\u00e8\b\n"+ - "\u0001\u000b\u0001\u000b\u0003\u000b\u00ec\b\u000b\u0001\f\u0001\f\u0001"+ - "\r\u0001\r\u0001\u000e\u0001\u000e\u0001\u000f\u0001\u000f\u0001\u0010"+ - "\u0001\u0010\u0001\u0011\u0001\u0011\u0001\u0012\u0001\u0012\u0001\u0013"+ - "\u0001\u0013\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0015\u0001\u0015"+ - "\u0001\u0015\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0017\u0001\u0017"+ - "\u0001\u0017\u0001\u0018\u0001\u0018\u0001\u0019\u0001\u0019\u0001\u0019"+ - "\u0001\u001a\u0001\u001a\u0001\u001a\u0001\u001b\u0001\u001b\u0001\u001c"+ - "\u0001\u001c\u0001\u001d\u0001\u001d\u0001\u001e\u0001\u001e\u0001\u001f"+ - "\u0001\u001f\u0001 \u0001 \u0001!\u0001!\u0001\"\u0001\"\u0001\"\u0001"+ - "\"\u0001\"\u0001\"\u0001#\u0001#\u0001#\u0001#\u0001#\u0001$\u0001$\u0001"+ - "$\u0001$\u0001$\u0001$\u0001%\u0001%\u0001%\u0001&\u0001&\u0001&\u0001"+ - "&\u0001&\u0001\'\u0001\'\u0001\'\u0001\'\u0001(\u0001(\u0001(\u0001(\u0001"+ - "(\u0001(\u0001(\u0001)\u0001)\u0001)\u0001)\u0001*\u0001*\u0005*\u014a"+ - "\b*\n*\f*\u014d\t*\u0001*\u0001*\u0001+\u0003+\u0152\b+\u0001+\u0004+"+ - "\u0155\b+\u000b+\f+\u0156\u0001,\u0001,\u0001,\u0001,\u0001,\u0001,\u0001"+ - ",\u0001,\u0001,\u0003,\u0162\b,\u0001-\u0001-\u0001-\u0001-\u0001-\u0001"+ - ".\u0001.\u0001/\u0001/\u00010\u00010\u00010\u00030\u0170\b0\u00011\u0001"+ - "1\u00051\u0174\b1\n1\f1\u0177\t1\u00012\u00042\u017a\b2\u000b2\f2\u017b"+ - "\u00012\u00012\u00013\u00013\u00013\u00013\u00053\u0184\b3\n3\f3\u0187"+ - "\t3\u00013\u00013\u00014\u00014\u00014\u00014\u00054\u018f\b4\n4\f4\u0192"+ - "\t4\u00014\u00014\u00014\u00014\u00014\u0001\u0190\u00005\u0001\u0001"+ - "\u0003\u0002\u0005\u0003\u0007\u0004\t\u0005\u000b\u0006\r\u0007\u000f"+ - "\b\u0011\t\u0013\n\u0015\u000b\u0017\f\u0019\r\u001b\u000e\u001d\u000f"+ - "\u001f\u0010!\u0011#\u0012%\u0013\'\u0014)\u0015+\u0016-\u0017/\u0018"+ - "1\u00193\u001a5\u001b7\u001c9\u001d;\u001e=\u001f? A!C\"E#G$I%K&M\'O("+ - "Q)S*U+W,Y-[.]\u0000_\u0000a\u0000c/e0g1i2\u0001\u0000\u0005\u0002\u0000"+ - "\n\n\r\r\u0002\u0000AZaz\u0001\u000009\u0002\u0000$$__\u0003\u0000\t\n"+ - "\r\r \u01aa\u0000\u0001\u0001\u0000\u0000\u0000\u0000\u0003\u0001\u0000"+ - "\u0000\u0000\u0000\u0005\u0001\u0000\u0000\u0000\u0000\u0007\u0001\u0000"+ - "\u0000\u0000\u0000\t\u0001\u0000\u0000\u0000\u0000\u000b\u0001\u0000\u0000"+ - "\u0000\u0000\r\u0001\u0000\u0000\u0000\u0000\u000f\u0001\u0000\u0000\u0000"+ - "\u0000\u0011\u0001\u0000\u0000\u0000\u0000\u0013\u0001\u0000\u0000\u0000"+ - "\u0000\u0015\u0001\u0000\u0000\u0000\u0000\u0017\u0001\u0000\u0000\u0000"+ - "\u0000\u0019\u0001\u0000\u0000\u0000\u0000\u001b\u0001\u0000\u0000\u0000"+ - "\u0000\u001d\u0001\u0000\u0000\u0000\u0000\u001f\u0001\u0000\u0000\u0000"+ - "\u0000!\u0001\u0000\u0000\u0000\u0000#\u0001\u0000\u0000\u0000\u0000%"+ - "\u0001\u0000\u0000\u0000\u0000\'\u0001\u0000\u0000\u0000\u0000)\u0001"+ - "\u0000\u0000\u0000\u0000+\u0001\u0000\u0000\u0000\u0000-\u0001\u0000\u0000"+ - "\u0000\u0000/\u0001\u0000\u0000\u0000\u00001\u0001\u0000\u0000\u0000\u0000"+ - "3\u0001\u0000\u0000\u0000\u00005\u0001\u0000\u0000\u0000\u00007\u0001"+ - "\u0000\u0000\u0000\u00009\u0001\u0000\u0000\u0000\u0000;\u0001\u0000\u0000"+ - "\u0000\u0000=\u0001\u0000\u0000\u0000\u0000?\u0001\u0000\u0000\u0000\u0000"+ - "A\u0001\u0000\u0000\u0000\u0000C\u0001\u0000\u0000\u0000\u0000E\u0001"+ - "\u0000\u0000\u0000\u0000G\u0001\u0000\u0000\u0000\u0000I\u0001\u0000\u0000"+ - "\u0000\u0000K\u0001\u0000\u0000\u0000\u0000M\u0001\u0000\u0000\u0000\u0000"+ - "O\u0001\u0000\u0000\u0000\u0000Q\u0001\u0000\u0000\u0000\u0000S\u0001"+ - "\u0000\u0000\u0000\u0000U\u0001\u0000\u0000\u0000\u0000W\u0001\u0000\u0000"+ - "\u0000\u0000Y\u0001\u0000\u0000\u0000\u0000[\u0001\u0000\u0000\u0000\u0000"+ - "c\u0001\u0000\u0000\u0000\u0000e\u0001\u0000\u0000\u0000\u0000g\u0001"+ - "\u0000\u0000\u0000\u0000i\u0001\u0000\u0000\u0000\u0001k\u0001\u0000\u0000"+ - "\u0000\u0003n\u0001\u0000\u0000\u0000\u0005q\u0001\u0000\u0000\u0000\u0007"+ - "v\u0001\u0000\u0000\u0000\t~\u0001\u0000\u0000\u0000\u000b\u0083\u0001"+ - "\u0000\u0000\u0000\r\u00af\u0001\u0000\u0000\u0000\u000f\u00b1\u0001\u0000"+ - "\u0000\u0000\u0011\u00db\u0001\u0000\u0000\u0000\u0013\u00df\u0001\u0000"+ - "\u0000\u0000\u0015\u00e7\u0001\u0000\u0000\u0000\u0017\u00eb\u0001\u0000"+ - "\u0000\u0000\u0019\u00ed\u0001\u0000\u0000\u0000\u001b\u00ef\u0001\u0000"+ - "\u0000\u0000\u001d\u00f1\u0001\u0000\u0000\u0000\u001f\u00f3\u0001\u0000"+ - "\u0000\u0000!\u00f5\u0001\u0000\u0000\u0000#\u00f7\u0001\u0000\u0000\u0000"+ - "%\u00f9\u0001\u0000\u0000\u0000\'\u00fb\u0001\u0000\u0000\u0000)\u00fd"+ - "\u0001\u0000\u0000\u0000+\u0100\u0001\u0000\u0000\u0000-\u0103\u0001\u0000"+ - "\u0000\u0000/\u0106\u0001\u0000\u0000\u00001\u0109\u0001\u0000\u0000\u0000"+ - "3\u010b\u0001\u0000\u0000\u00005\u010e\u0001\u0000\u0000\u00007\u0111"+ - "\u0001\u0000\u0000\u00009\u0113\u0001\u0000\u0000\u0000;\u0115\u0001\u0000"+ - "\u0000\u0000=\u0117\u0001\u0000\u0000\u0000?\u0119\u0001\u0000\u0000\u0000"+ - "A\u011b\u0001\u0000\u0000\u0000C\u011d\u0001\u0000\u0000\u0000E\u011f"+ - "\u0001\u0000\u0000\u0000G\u0125\u0001\u0000\u0000\u0000I\u012a\u0001\u0000"+ - "\u0000\u0000K\u0130\u0001\u0000\u0000\u0000M\u0133\u0001\u0000\u0000\u0000"+ - "O\u0138\u0001\u0000\u0000\u0000Q\u013c\u0001\u0000\u0000\u0000S\u0143"+ - "\u0001\u0000\u0000\u0000U\u0147\u0001\u0000\u0000\u0000W\u0151\u0001\u0000"+ - "\u0000\u0000Y\u0161\u0001\u0000\u0000\u0000[\u0163\u0001\u0000\u0000\u0000"+ - "]\u0168\u0001\u0000\u0000\u0000_\u016a\u0001\u0000\u0000\u0000a\u016f"+ - "\u0001\u0000\u0000\u0000c\u0171\u0001\u0000\u0000\u0000e\u0179\u0001\u0000"+ - "\u0000\u0000g\u017f\u0001\u0000\u0000\u0000i\u018a\u0001\u0000\u0000\u0000"+ - "kl\u0005+\u0000\u0000lm\u0005+\u0000\u0000m\u0002\u0001\u0000\u0000\u0000"+ - "no\u0005-\u0000\u0000op\u0005-\u0000\u0000p\u0004\u0001\u0000\u0000\u0000"+ - "qr\u0005v\u0000\u0000rs\u0005o\u0000\u0000st\u0005i\u0000\u0000tu\u0005"+ - "d\u0000\u0000u\u0006\u0001\u0000\u0000\u0000vw\u0005b\u0000\u0000wx\u0005"+ - "o\u0000\u0000xy\u0005o\u0000\u0000yz\u0005l\u0000\u0000z{\u0005e\u0000"+ - "\u0000{|\u0005a\u0000\u0000|}\u0005n\u0000\u0000}\b\u0001\u0000\u0000"+ - "\u0000~\u007f\u0005c\u0000\u0000\u007f\u0080\u0005h\u0000\u0000\u0080"+ - "\u0081\u0005a\u0000\u0000\u0081\u0082\u0005r\u0000\u0000\u0082\n\u0001"+ - "\u0000\u0000\u0000\u0083\u0084\u0005i\u0000\u0000\u0084\u0085\u0005n\u0000"+ - "\u0000\u0085\u0086\u0005t\u0000\u0000\u0086\f\u0001\u0000\u0000\u0000"+ - "\u0087\u0088\u0005p\u0000\u0000\u0088\u0089\u0005u\u0000\u0000\u0089\u008a"+ - "\u0005b\u0000\u0000\u008a\u008b\u0005l\u0000\u0000\u008b\u008c\u0005i"+ - "\u0000\u0000\u008c\u00b0\u0005c\u0000\u0000\u008d\u008e\u0005p\u0000\u0000"+ - "\u008e\u008f\u0005r\u0000\u0000\u008f\u0090\u0005i\u0000\u0000\u0090\u0091"+ - "\u0005v\u0000\u0000\u0091\u0092\u0005a\u0000\u0000\u0092\u0093\u0005t"+ - "\u0000\u0000\u0093\u00b0\u0005e\u0000\u0000\u0094\u0095\u0005p\u0000\u0000"+ - "\u0095\u0096\u0005u\u0000\u0000\u0096\u0097\u0005b\u0000\u0000\u0097\u0098"+ - "\u0005l\u0000\u0000\u0098\u0099\u0005i\u0000\u0000\u0099\u009a\u0005c"+ - "\u0000\u0000\u009a\u009b\u0005 \u0000\u0000\u009b\u009c\u0005s\u0000\u0000"+ - "\u009c\u009d\u0005t\u0000\u0000\u009d\u009e\u0005a\u0000\u0000\u009e\u009f"+ - "\u0005t\u0000\u0000\u009f\u00a0\u0005i\u0000\u0000\u00a0\u00b0\u0005c"+ - "\u0000\u0000\u00a1\u00a2\u0005p\u0000\u0000\u00a2\u00a3\u0005r\u0000\u0000"+ - "\u00a3\u00a4\u0005i\u0000\u0000\u00a4\u00a5\u0005v\u0000\u0000\u00a5\u00a6"+ - "\u0005a\u0000\u0000\u00a6\u00a7\u0005t\u0000\u0000\u00a7\u00a8\u0005e"+ - "\u0000\u0000\u00a8\u00a9\u0005 \u0000\u0000\u00a9\u00aa\u0005s\u0000\u0000"+ - "\u00aa\u00ab\u0005t\u0000\u0000\u00ab\u00ac\u0005a\u0000\u0000\u00ac\u00ad"+ - "\u0005t\u0000\u0000\u00ad\u00ae\u0005i\u0000\u0000\u00ae\u00b0\u0005c"+ - "\u0000\u0000\u00af\u0087\u0001\u0000\u0000\u0000\u00af\u008d\u0001\u0000"+ - "\u0000\u0000\u00af\u0094\u0001\u0000\u0000\u0000\u00af\u00a1\u0001\u0000"+ - "\u0000\u0000\u00b0\u000e\u0001\u0000\u0000\u0000\u00b1\u00b2\u0005p\u0000"+ - "\u0000\u00b2\u00b3\u0005u\u0000\u0000\u00b3\u00b4\u0005b\u0000\u0000\u00b4"+ - "\u00b5\u0005l\u0000\u0000\u00b5\u00b6\u0005i\u0000\u0000\u00b6\u00b7\u0005"+ - "c\u0000\u0000\u00b7\u00b8\u0005 \u0000\u0000\u00b8\u00b9\u0005s\u0000"+ - "\u0000\u00b9\u00ba\u0005t\u0000\u0000\u00ba\u00bb\u0005a\u0000\u0000\u00bb"+ - "\u00bc\u0005t\u0000\u0000\u00bc\u00bd\u0005i\u0000\u0000\u00bd\u00be\u0005"+ - "c\u0000\u0000\u00be\u00bf\u0005 \u0000\u0000\u00bf\u00c0\u0005v\u0000"+ - "\u0000\u00c0\u00c1\u0005o\u0000\u0000\u00c1\u00c2\u0005i\u0000\u0000\u00c2"+ - "\u00c3\u0005d\u0000\u0000\u00c3\u00c4\u0005 \u0000\u0000\u00c4\u00c5\u0005"+ - "m\u0000\u0000\u00c5\u00c6\u0005a\u0000\u0000\u00c6\u00c7\u0005i\u0000"+ - "\u0000\u00c7\u00c8\u0005n\u0000\u0000\u00c8\u00c9\u0005(\u0000\u0000\u00c9"+ - "\u00ca\u0005S\u0000\u0000\u00ca\u00cb\u0005t\u0000\u0000\u00cb\u00cc\u0005"+ - "r\u0000\u0000\u00cc\u00cd\u0005i\u0000\u0000\u00cd\u00ce\u0005n\u0000"+ - "\u0000\u00ce\u00cf\u0005g\u0000\u0000\u00cf\u00d0\u0005[\u0000\u0000\u00d0"+ - "\u00d1\u0005]\u0000\u0000\u00d1\u00d2\u0005 \u0000\u0000\u00d2\u00d3\u0005"+ - "a\u0000\u0000\u00d3\u00d4\u0005r\u0000\u0000\u00d4\u00d5\u0005g\u0000"+ - "\u0000\u00d5\u00d6\u0005s\u0000\u0000\u00d6\u00d7\u0005)\u0000\u0000\u00d7"+ - "\u0010\u0001\u0000\u0000\u0000\u00d8\u00dc\u0003\u001f\u000f\u0000\u00d9"+ - "\u00dc\u0003#\u0011\u0000\u00da\u00dc\u0003!\u0010\u0000\u00db\u00d8\u0001"+ - "\u0000\u0000\u0000\u00db\u00d9\u0001\u0000\u0000\u0000\u00db\u00da\u0001"+ - "\u0000\u0000\u0000\u00dc\u0012\u0001\u0000\u0000\u0000\u00dd\u00e0\u0003"+ - "\u001b\r\u0000\u00de\u00e0\u0003\u001d\u000e\u0000\u00df\u00dd\u0001\u0000"+ - "\u0000\u0000\u00df\u00de\u0001\u0000\u0000\u0000\u00e0\u0014\u0001\u0000"+ - "\u0000\u0000\u00e1\u00e8\u0003%\u0012\u0000\u00e2\u00e8\u0003\'\u0013"+ - "\u0000\u00e3\u00e8\u0003)\u0014\u0000\u00e4\u00e8\u0003+\u0015\u0000\u00e5"+ - "\u00e8\u0003-\u0016\u0000\u00e6\u00e8\u0003/\u0017\u0000\u00e7\u00e1\u0001"+ - "\u0000\u0000\u0000\u00e7\u00e2\u0001\u0000\u0000\u0000\u00e7\u00e3\u0001"+ - "\u0000\u0000\u0000\u00e7\u00e4\u0001\u0000\u0000\u0000\u00e7\u00e5\u0001"+ - "\u0000\u0000\u0000\u00e7\u00e6\u0001\u0000\u0000\u0000\u00e8\u0016\u0001"+ - "\u0000\u0000\u0000\u00e9\u00ec\u00033\u0019\u0000\u00ea\u00ec\u00035\u001a"+ - "\u0000\u00eb\u00e9\u0001\u0000\u0000\u0000\u00eb\u00ea\u0001\u0000\u0000"+ - "\u0000\u00ec\u0018\u0001\u0000\u0000\u0000\u00ed\u00ee\u0005=\u0000\u0000"+ - "\u00ee\u001a\u0001\u0000\u0000\u0000\u00ef\u00f0\u0005+\u0000\u0000\u00f0"+ - "\u001c\u0001\u0000\u0000\u0000\u00f1\u00f2\u0005-\u0000\u0000\u00f2\u001e"+ - "\u0001\u0000\u0000\u0000\u00f3\u00f4\u0005*\u0000\u0000\u00f4 \u0001\u0000"+ - "\u0000\u0000\u00f5\u00f6\u0005%\u0000\u0000\u00f6\"\u0001\u0000\u0000"+ - "\u0000\u00f7\u00f8\u0005/\u0000\u0000\u00f8$\u0001\u0000\u0000\u0000\u00f9"+ - "\u00fa\u0005>\u0000\u0000\u00fa&\u0001\u0000\u0000\u0000\u00fb\u00fc\u0005"+ - "<\u0000\u0000\u00fc(\u0001\u0000\u0000\u0000\u00fd\u00fe\u0005>\u0000"+ - "\u0000\u00fe\u00ff\u0005=\u0000\u0000\u00ff*\u0001\u0000\u0000\u0000\u0100"+ - "\u0101\u0005<\u0000\u0000\u0101\u0102\u0005=\u0000\u0000\u0102,\u0001"+ - "\u0000\u0000\u0000\u0103\u0104\u0005=\u0000\u0000\u0104\u0105\u0005=\u0000"+ - "\u0000\u0105.\u0001\u0000\u0000\u0000\u0106\u0107\u0005!\u0000\u0000\u0107"+ - "\u0108\u0005=\u0000\u0000\u01080\u0001\u0000\u0000\u0000\u0109\u010a\u0005"+ - "!\u0000\u0000\u010a2\u0001\u0000\u0000\u0000\u010b\u010c\u0005&\u0000"+ - "\u0000\u010c\u010d\u0005&\u0000\u0000\u010d4\u0001\u0000\u0000\u0000\u010e"+ - "\u010f\u0005|\u0000\u0000\u010f\u0110\u0005|\u0000\u0000\u01106\u0001"+ - "\u0000\u0000\u0000\u0111\u0112\u0005.\u0000\u0000\u01128\u0001\u0000\u0000"+ - "\u0000\u0113\u0114\u0005(\u0000\u0000\u0114:\u0001\u0000\u0000\u0000\u0115"+ - "\u0116\u0005)\u0000\u0000\u0116<\u0001\u0000\u0000\u0000\u0117\u0118\u0005"+ - "{\u0000\u0000\u0118>\u0001\u0000\u0000\u0000\u0119\u011a\u0005}\u0000"+ - "\u0000\u011a@\u0001\u0000\u0000\u0000\u011b\u011c\u0005;\u0000\u0000\u011c"+ - "B\u0001\u0000\u0000\u0000\u011d\u011e\u0005,\u0000\u0000\u011eD\u0001"+ - "\u0000\u0000\u0000\u011f\u0120\u0005c\u0000\u0000\u0120\u0121\u0005l\u0000"+ - "\u0000\u0121\u0122\u0005a\u0000\u0000\u0122\u0123\u0005s\u0000\u0000\u0123"+ - "\u0124\u0005s\u0000\u0000\u0124F\u0001\u0000\u0000\u0000\u0125\u0126\u0005"+ - "t\u0000\u0000\u0126\u0127\u0005h\u0000\u0000\u0127\u0128\u0005i\u0000"+ - "\u0000\u0128\u0129\u0005s\u0000\u0000\u0129H\u0001\u0000\u0000\u0000\u012a"+ - "\u012b\u0005w\u0000\u0000\u012b\u012c\u0005h\u0000\u0000\u012c\u012d\u0005"+ - "i\u0000\u0000\u012d\u012e\u0005l\u0000\u0000\u012e\u012f\u0005e\u0000"+ - "\u0000\u012fJ\u0001\u0000\u0000\u0000\u0130\u0131\u0005i\u0000\u0000\u0131"+ - "\u0132\u0005f\u0000\u0000\u0132L\u0001\u0000\u0000\u0000\u0133\u0134\u0005"+ - "e\u0000\u0000\u0134\u0135\u0005l\u0000\u0000\u0135\u0136\u0005s\u0000"+ - "\u0000\u0136\u0137\u0005e\u0000\u0000\u0137N\u0001\u0000\u0000\u0000\u0138"+ - "\u0139\u0005f\u0000\u0000\u0139\u013a\u0005o\u0000\u0000\u013a\u013b\u0005"+ - "r\u0000\u0000\u013bP\u0001\u0000\u0000\u0000\u013c\u013d\u0005r\u0000"+ - "\u0000\u013d\u013e\u0005e\u0000\u0000\u013e\u013f\u0005t\u0000\u0000\u013f"+ - "\u0140\u0005u\u0000\u0000\u0140\u0141\u0005r\u0000\u0000\u0141\u0142\u0005"+ - "n\u0000\u0000\u0142R\u0001\u0000\u0000\u0000\u0143\u0144\u0005n\u0000"+ - "\u0000\u0144\u0145\u0005e\u0000\u0000\u0145\u0146\u0005w\u0000\u0000\u0146"+ - "T\u0001\u0000\u0000\u0000\u0147\u014b\u0005\'\u0000\u0000\u0148\u014a"+ - "\b\u0000\u0000\u0000\u0149\u0148\u0001\u0000\u0000\u0000\u014a\u014d\u0001"+ - "\u0000\u0000\u0000\u014b\u0149\u0001\u0000\u0000\u0000\u014b\u014c\u0001"+ - "\u0000\u0000\u0000\u014c\u014e\u0001\u0000\u0000\u0000\u014d\u014b\u0001"+ - "\u0000\u0000\u0000\u014e\u014f\u0005\'\u0000\u0000\u014fV\u0001\u0000"+ - "\u0000\u0000\u0150\u0152\u0003\u001d\u000e\u0000\u0151\u0150\u0001\u0000"+ - "\u0000\u0000\u0151\u0152\u0001\u0000\u0000\u0000\u0152\u0154\u0001\u0000"+ - "\u0000\u0000\u0153\u0155\u0003_/\u0000\u0154\u0153\u0001\u0000\u0000\u0000"+ - "\u0155\u0156\u0001\u0000\u0000\u0000\u0156\u0154\u0001\u0000\u0000\u0000"+ - "\u0156\u0157\u0001\u0000\u0000\u0000\u0157X\u0001\u0000\u0000\u0000\u0158"+ - "\u0159\u0005t\u0000\u0000\u0159\u015a\u0005r\u0000\u0000\u015a\u015b\u0005"+ - "u\u0000\u0000\u015b\u0162\u0005e\u0000\u0000\u015c\u015d\u0005f\u0000"+ - "\u0000\u015d\u015e\u0005a\u0000\u0000\u015e\u015f\u0005l\u0000\u0000\u015f"+ - "\u0160\u0005s\u0000\u0000\u0160\u0162\u0005e\u0000\u0000\u0161\u0158\u0001"+ - "\u0000\u0000\u0000\u0161\u015c\u0001\u0000\u0000\u0000\u0162Z\u0001\u0000"+ - "\u0000\u0000\u0163\u0164\u0005n\u0000\u0000\u0164\u0165\u0005u\u0000\u0000"+ - "\u0165\u0166\u0005l\u0000\u0000\u0166\u0167\u0005l\u0000\u0000\u0167\\"+ - "\u0001\u0000\u0000\u0000\u0168\u0169\u0007\u0001\u0000\u0000\u0169^\u0001"+ - "\u0000\u0000\u0000\u016a\u016b\u0007\u0002\u0000\u0000\u016b`\u0001\u0000"+ - "\u0000\u0000\u016c\u0170\u0003].\u0000\u016d\u0170\u0003_/\u0000\u016e"+ - "\u0170\u0007\u0003\u0000\u0000\u016f\u016c\u0001\u0000\u0000\u0000\u016f"+ - "\u016d\u0001\u0000\u0000\u0000\u016f\u016e\u0001\u0000\u0000\u0000\u0170"+ - "b\u0001\u0000\u0000\u0000\u0171\u0175\u0003].\u0000\u0172\u0174\u0003"+ - "a0\u0000\u0173\u0172\u0001\u0000\u0000\u0000\u0174\u0177\u0001\u0000\u0000"+ - "\u0000\u0175\u0173\u0001\u0000\u0000\u0000\u0175\u0176\u0001\u0000\u0000"+ - "\u0000\u0176d\u0001\u0000\u0000\u0000\u0177\u0175\u0001\u0000\u0000\u0000"+ - "\u0178\u017a\u0007\u0004\u0000\u0000\u0179\u0178\u0001\u0000\u0000\u0000"+ - "\u017a\u017b\u0001\u0000\u0000\u0000\u017b\u0179\u0001\u0000\u0000\u0000"+ - "\u017b\u017c\u0001\u0000\u0000\u0000\u017c\u017d\u0001\u0000\u0000\u0000"+ - "\u017d\u017e\u00062\u0000\u0000\u017ef\u0001\u0000\u0000\u0000\u017f\u0180"+ - "\u0005/\u0000\u0000\u0180\u0181\u0005/\u0000\u0000\u0181\u0185\u0001\u0000"+ - "\u0000\u0000\u0182\u0184\b\u0000\u0000\u0000\u0183\u0182\u0001\u0000\u0000"+ - "\u0000\u0184\u0187\u0001\u0000\u0000\u0000\u0185\u0183\u0001\u0000\u0000"+ - "\u0000\u0185\u0186\u0001\u0000\u0000\u0000\u0186\u0188\u0001\u0000\u0000"+ - "\u0000\u0187\u0185\u0001\u0000\u0000\u0000\u0188\u0189\u00063\u0000\u0000"+ - "\u0189h\u0001\u0000\u0000\u0000\u018a\u018b\u0005/\u0000\u0000\u018b\u018c"+ - "\u0005*\u0000\u0000\u018c\u0190\u0001\u0000\u0000\u0000\u018d\u018f\t"+ - "\u0000\u0000\u0000\u018e\u018d\u0001\u0000\u0000\u0000\u018f\u0192\u0001"+ - "\u0000\u0000\u0000\u0190\u0191\u0001\u0000\u0000\u0000\u0190\u018e\u0001"+ - "\u0000\u0000\u0000\u0191\u0193\u0001\u0000\u0000\u0000\u0192\u0190\u0001"+ - "\u0000\u0000\u0000\u0193\u0194\u0005*\u0000\u0000\u0194\u0195\u0005/\u0000"+ - "\u0000\u0195\u0196\u0001\u0000\u0000\u0000\u0196\u0197\u00064\u0000\u0000"+ - "\u0197j\u0001\u0000\u0000\u0000\u000f\u0000\u00af\u00db\u00df\u00e7\u00eb"+ - "\u014b\u0151\u0156\u0161\u016f\u0175\u017b\u0185\u0190\u0001\u0006\u0000"+ - "\u0000"; - public static final ATN _ATN = - new ATNDeserializer().deserialize(_serializedATN.toCharArray()); - static { - _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; - for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { - _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); - } - } -} \ No newline at end of file diff --git a/src/main/java/parser/generated/SimpleJavaLexer.tokens b/src/main/java/parser/generated/SimpleJavaLexer.tokens deleted file mode 100644 index bed7437..0000000 --- a/src/main/java/parser/generated/SimpleJavaLexer.tokens +++ /dev/null @@ -1,88 +0,0 @@ -T__0=1 -T__1=2 -Void=3 -Boolean=4 -Char=5 -Int=6 -AccessModifier=7 -MainMethodDeclaration=8 -DotOperator=9 -LineOperator=10 -ComparisonOperator=11 -LogicalOperator=12 -Assign=13 -Plus=14 -Minus=15 -Mult=16 -Modulo=17 -Div=18 -Greater=19 -Less=20 -GreaterEqual=21 -LessEqual=22 -Equal=23 -NotEqual=24 -Not=25 -And=26 -Or=27 -Dot=28 -OpenRoundBracket=29 -ClosedRoundBracket=30 -OpenCurlyBracket=31 -ClosedCurlyBracket=32 -Semicolon=33 -Comma=34 -Class=35 -This=36 -While=37 -If=38 -Else=39 -For=40 -Return=41 -New=42 -CharValue=43 -IntValue=44 -BooleanValue=45 -NullValue=46 -Identifier=47 -WS=48 -InlineComment=49 -MultilineComment=50 -'++'=1 -'--'=2 -'void'=3 -'boolean'=4 -'char'=5 -'int'=6 -'public static void main(String[] args)'=8 -'='=13 -'+'=14 -'-'=15 -'*'=16 -'%'=17 -'/'=18 -'>'=19 -'<'=20 -'>='=21 -'<='=22 -'=='=23 -'!='=24 -'!'=25 -'&&'=26 -'||'=27 -'.'=28 -'('=29 -')'=30 -'{'=31 -'}'=32 -';'=33 -','=34 -'class'=35 -'this'=36 -'while'=37 -'if'=38 -'else'=39 -'for'=40 -'return'=41 -'new'=42 -'null'=46 diff --git a/src/main/java/parser/generated/SimpleJavaListener.java b/src/main/java/parser/generated/SimpleJavaListener.java deleted file mode 100644 index 7b22466..0000000 --- a/src/main/java/parser/generated/SimpleJavaListener.java +++ /dev/null @@ -1,450 +0,0 @@ -// Generated from C:/Users/Maxi/Documents/DHBW/Compilerbau/NichtHaskell2.0/src/main/java/parser/grammar/SimpleJava.g4 by ANTLR 4.13.1 -package parser.generated; -import org.antlr.v4.runtime.tree.ParseTreeListener; - -/** - * This interface defines a complete listener for a parse tree produced by - * {@link SimpleJavaParser}. - */ -public interface SimpleJavaListener extends ParseTreeListener { - /** - * Enter a parse tree produced by {@link SimpleJavaParser#program}. - * @param ctx the parse tree - */ - void enterProgram(SimpleJavaParser.ProgramContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#program}. - * @param ctx the parse tree - */ - void exitProgram(SimpleJavaParser.ProgramContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#classDeclaration}. - * @param ctx the parse tree - */ - void enterClassDeclaration(SimpleJavaParser.ClassDeclarationContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#classDeclaration}. - * @param ctx the parse tree - */ - void exitClassDeclaration(SimpleJavaParser.ClassDeclarationContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#memberDeclaration}. - * @param ctx the parse tree - */ - void enterMemberDeclaration(SimpleJavaParser.MemberDeclarationContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#memberDeclaration}. - * @param ctx the parse tree - */ - void exitMemberDeclaration(SimpleJavaParser.MemberDeclarationContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#constructorDeclaration}. - * @param ctx the parse tree - */ - void enterConstructorDeclaration(SimpleJavaParser.ConstructorDeclarationContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#constructorDeclaration}. - * @param ctx the parse tree - */ - void exitConstructorDeclaration(SimpleJavaParser.ConstructorDeclarationContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#fieldDeclaration}. - * @param ctx the parse tree - */ - void enterFieldDeclaration(SimpleJavaParser.FieldDeclarationContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#fieldDeclaration}. - * @param ctx the parse tree - */ - void exitFieldDeclaration(SimpleJavaParser.FieldDeclarationContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#methodDeclaration}. - * @param ctx the parse tree - */ - void enterMethodDeclaration(SimpleJavaParser.MethodDeclarationContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#methodDeclaration}. - * @param ctx the parse tree - */ - void exitMethodDeclaration(SimpleJavaParser.MethodDeclarationContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#parameterList}. - * @param ctx the parse tree - */ - void enterParameterList(SimpleJavaParser.ParameterListContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#parameterList}. - * @param ctx the parse tree - */ - void exitParameterList(SimpleJavaParser.ParameterListContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#parameter}. - * @param ctx the parse tree - */ - void enterParameter(SimpleJavaParser.ParameterContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#parameter}. - * @param ctx the parse tree - */ - void exitParameter(SimpleJavaParser.ParameterContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#argumentList}. - * @param ctx the parse tree - */ - void enterArgumentList(SimpleJavaParser.ArgumentListContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#argumentList}. - * @param ctx the parse tree - */ - void exitArgumentList(SimpleJavaParser.ArgumentListContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#statement}. - * @param ctx the parse tree - */ - void enterStatement(SimpleJavaParser.StatementContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#statement}. - * @param ctx the parse tree - */ - void exitStatement(SimpleJavaParser.StatementContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#block}. - * @param ctx the parse tree - */ - void enterBlock(SimpleJavaParser.BlockContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#block}. - * @param ctx the parse tree - */ - void exitBlock(SimpleJavaParser.BlockContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#returnStatement}. - * @param ctx the parse tree - */ - void enterReturnStatement(SimpleJavaParser.ReturnStatementContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#returnStatement}. - * @param ctx the parse tree - */ - void exitReturnStatement(SimpleJavaParser.ReturnStatementContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#localVariableDeclaration}. - * @param ctx the parse tree - */ - void enterLocalVariableDeclaration(SimpleJavaParser.LocalVariableDeclarationContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#localVariableDeclaration}. - * @param ctx the parse tree - */ - void exitLocalVariableDeclaration(SimpleJavaParser.LocalVariableDeclarationContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#whileStatement}. - * @param ctx the parse tree - */ - void enterWhileStatement(SimpleJavaParser.WhileStatementContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#whileStatement}. - * @param ctx the parse tree - */ - void exitWhileStatement(SimpleJavaParser.WhileStatementContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#forStatement}. - * @param ctx the parse tree - */ - void enterForStatement(SimpleJavaParser.ForStatementContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#forStatement}. - * @param ctx the parse tree - */ - void exitForStatement(SimpleJavaParser.ForStatementContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#ifElseStatement}. - * @param ctx the parse tree - */ - void enterIfElseStatement(SimpleJavaParser.IfElseStatementContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#ifElseStatement}. - * @param ctx the parse tree - */ - void exitIfElseStatement(SimpleJavaParser.IfElseStatementContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#ifStatement}. - * @param ctx the parse tree - */ - void enterIfStatement(SimpleJavaParser.IfStatementContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#ifStatement}. - * @param ctx the parse tree - */ - void exitIfStatement(SimpleJavaParser.IfStatementContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#elseStatement}. - * @param ctx the parse tree - */ - void enterElseStatement(SimpleJavaParser.ElseStatementContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#elseStatement}. - * @param ctx the parse tree - */ - void exitElseStatement(SimpleJavaParser.ElseStatementContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#statementExpression}. - * @param ctx the parse tree - */ - void enterStatementExpression(SimpleJavaParser.StatementExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#statementExpression}. - * @param ctx the parse tree - */ - void exitStatementExpression(SimpleJavaParser.StatementExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#assign}. - * @param ctx the parse tree - */ - void enterAssign(SimpleJavaParser.AssignContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#assign}. - * @param ctx the parse tree - */ - void exitAssign(SimpleJavaParser.AssignContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#newDeclaration}. - * @param ctx the parse tree - */ - void enterNewDeclaration(SimpleJavaParser.NewDeclarationContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#newDeclaration}. - * @param ctx the parse tree - */ - void exitNewDeclaration(SimpleJavaParser.NewDeclarationContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#expression}. - * @param ctx the parse tree - */ - void enterExpression(SimpleJavaParser.ExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#expression}. - * @param ctx the parse tree - */ - void exitExpression(SimpleJavaParser.ExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#unaryExpression}. - * @param ctx the parse tree - */ - void enterUnaryExpression(SimpleJavaParser.UnaryExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#unaryExpression}. - * @param ctx the parse tree - */ - void exitUnaryExpression(SimpleJavaParser.UnaryExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#notExpression}. - * @param ctx the parse tree - */ - void enterNotExpression(SimpleJavaParser.NotExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#notExpression}. - * @param ctx the parse tree - */ - void exitNotExpression(SimpleJavaParser.NotExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#crementExpression}. - * @param ctx the parse tree - */ - void enterCrementExpression(SimpleJavaParser.CrementExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#crementExpression}. - * @param ctx the parse tree - */ - void exitCrementExpression(SimpleJavaParser.CrementExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#incrementExpression}. - * @param ctx the parse tree - */ - void enterIncrementExpression(SimpleJavaParser.IncrementExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#incrementExpression}. - * @param ctx the parse tree - */ - void exitIncrementExpression(SimpleJavaParser.IncrementExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#prefixIncrementExpression}. - * @param ctx the parse tree - */ - void enterPrefixIncrementExpression(SimpleJavaParser.PrefixIncrementExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#prefixIncrementExpression}. - * @param ctx the parse tree - */ - void exitPrefixIncrementExpression(SimpleJavaParser.PrefixIncrementExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#suffixIncrementExpression}. - * @param ctx the parse tree - */ - void enterSuffixIncrementExpression(SimpleJavaParser.SuffixIncrementExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#suffixIncrementExpression}. - * @param ctx the parse tree - */ - void exitSuffixIncrementExpression(SimpleJavaParser.SuffixIncrementExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#decrementExpression}. - * @param ctx the parse tree - */ - void enterDecrementExpression(SimpleJavaParser.DecrementExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#decrementExpression}. - * @param ctx the parse tree - */ - void exitDecrementExpression(SimpleJavaParser.DecrementExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#prefixDecrementExpression}. - * @param ctx the parse tree - */ - void enterPrefixDecrementExpression(SimpleJavaParser.PrefixDecrementExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#prefixDecrementExpression}. - * @param ctx the parse tree - */ - void exitPrefixDecrementExpression(SimpleJavaParser.PrefixDecrementExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#suffixDecrementExpression}. - * @param ctx the parse tree - */ - void enterSuffixDecrementExpression(SimpleJavaParser.SuffixDecrementExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#suffixDecrementExpression}. - * @param ctx the parse tree - */ - void exitSuffixDecrementExpression(SimpleJavaParser.SuffixDecrementExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#assignableExpression}. - * @param ctx the parse tree - */ - void enterAssignableExpression(SimpleJavaParser.AssignableExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#assignableExpression}. - * @param ctx the parse tree - */ - void exitAssignableExpression(SimpleJavaParser.AssignableExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#memberAccess}. - * @param ctx the parse tree - */ - void enterMemberAccess(SimpleJavaParser.MemberAccessContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#memberAccess}. - * @param ctx the parse tree - */ - void exitMemberAccess(SimpleJavaParser.MemberAccessContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#binaryExpression}. - * @param ctx the parse tree - */ - void enterBinaryExpression(SimpleJavaParser.BinaryExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#binaryExpression}. - * @param ctx the parse tree - */ - void exitBinaryExpression(SimpleJavaParser.BinaryExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#calculationExpression}. - * @param ctx the parse tree - */ - void enterCalculationExpression(SimpleJavaParser.CalculationExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#calculationExpression}. - * @param ctx the parse tree - */ - void exitCalculationExpression(SimpleJavaParser.CalculationExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#dotExpression}. - * @param ctx the parse tree - */ - void enterDotExpression(SimpleJavaParser.DotExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#dotExpression}. - * @param ctx the parse tree - */ - void exitDotExpression(SimpleJavaParser.DotExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#dotSubtractionExpression}. - * @param ctx the parse tree - */ - void enterDotSubtractionExpression(SimpleJavaParser.DotSubtractionExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#dotSubtractionExpression}. - * @param ctx the parse tree - */ - void exitDotSubtractionExpression(SimpleJavaParser.DotSubtractionExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#nonCalculationExpression}. - * @param ctx the parse tree - */ - void enterNonCalculationExpression(SimpleJavaParser.NonCalculationExpressionContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#nonCalculationExpression}. - * @param ctx the parse tree - */ - void exitNonCalculationExpression(SimpleJavaParser.NonCalculationExpressionContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#methodCall}. - * @param ctx the parse tree - */ - void enterMethodCall(SimpleJavaParser.MethodCallContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#methodCall}. - * @param ctx the parse tree - */ - void exitMethodCall(SimpleJavaParser.MethodCallContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#target}. - * @param ctx the parse tree - */ - void enterTarget(SimpleJavaParser.TargetContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#target}. - * @param ctx the parse tree - */ - void exitTarget(SimpleJavaParser.TargetContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#chainedMethod}. - * @param ctx the parse tree - */ - void enterChainedMethod(SimpleJavaParser.ChainedMethodContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#chainedMethod}. - * @param ctx the parse tree - */ - void exitChainedMethod(SimpleJavaParser.ChainedMethodContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#type}. - * @param ctx the parse tree - */ - void enterType(SimpleJavaParser.TypeContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#type}. - * @param ctx the parse tree - */ - void exitType(SimpleJavaParser.TypeContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#value}. - * @param ctx the parse tree - */ - void enterValue(SimpleJavaParser.ValueContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#value}. - * @param ctx the parse tree - */ - void exitValue(SimpleJavaParser.ValueContext ctx); - /** - * Enter a parse tree produced by {@link SimpleJavaParser#nonCalculationOperator}. - * @param ctx the parse tree - */ - void enterNonCalculationOperator(SimpleJavaParser.NonCalculationOperatorContext ctx); - /** - * Exit a parse tree produced by {@link SimpleJavaParser#nonCalculationOperator}. - * @param ctx the parse tree - */ - void exitNonCalculationOperator(SimpleJavaParser.NonCalculationOperatorContext ctx); -} \ No newline at end of file diff --git a/src/main/java/parser/generated/SimpleJavaParser.java b/src/main/java/parser/generated/SimpleJavaParser.java deleted file mode 100644 index 0c2fa56..0000000 --- a/src/main/java/parser/generated/SimpleJavaParser.java +++ /dev/null @@ -1,3457 +0,0 @@ -// Generated from C:/Users/Maxi/Documents/DHBW/Compilerbau/NichtHaskell2.0/src/main/java/parser/grammar/SimpleJava.g4 by ANTLR 4.13.1 -package parser.generated; -import org.antlr.v4.runtime.atn.*; -import org.antlr.v4.runtime.dfa.DFA; -import org.antlr.v4.runtime.*; -import org.antlr.v4.runtime.misc.*; -import org.antlr.v4.runtime.tree.*; -import java.util.List; -import java.util.Iterator; -import java.util.ArrayList; - -@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast", "CheckReturnValue"}) -public class SimpleJavaParser extends Parser { - static { RuntimeMetaData.checkVersion("4.13.1", RuntimeMetaData.VERSION); } - - protected static final DFA[] _decisionToDFA; - protected static final PredictionContextCache _sharedContextCache = - new PredictionContextCache(); - public static final int - T__0=1, T__1=2, Void=3, Boolean=4, Char=5, Int=6, AccessModifier=7, MainMethodDeclaration=8, - DotOperator=9, LineOperator=10, ComparisonOperator=11, LogicalOperator=12, - Assign=13, Plus=14, Minus=15, Mult=16, Modulo=17, Div=18, Greater=19, - Less=20, GreaterEqual=21, LessEqual=22, Equal=23, NotEqual=24, Not=25, - And=26, Or=27, Dot=28, OpenRoundBracket=29, ClosedRoundBracket=30, OpenCurlyBracket=31, - ClosedCurlyBracket=32, Semicolon=33, Comma=34, Class=35, This=36, While=37, - If=38, Else=39, For=40, Return=41, New=42, CharValue=43, IntValue=44, - BooleanValue=45, NullValue=46, Identifier=47, WS=48, InlineComment=49, - MultilineComment=50; - public static final int - RULE_program = 0, RULE_classDeclaration = 1, RULE_memberDeclaration = 2, - RULE_constructorDeclaration = 3, RULE_fieldDeclaration = 4, RULE_methodDeclaration = 5, - RULE_parameterList = 6, RULE_parameter = 7, RULE_argumentList = 8, RULE_statement = 9, - RULE_block = 10, RULE_returnStatement = 11, RULE_localVariableDeclaration = 12, - RULE_whileStatement = 13, RULE_forStatement = 14, RULE_ifElseStatement = 15, - RULE_ifStatement = 16, RULE_elseStatement = 17, RULE_statementExpression = 18, - RULE_assign = 19, RULE_newDeclaration = 20, RULE_expression = 21, RULE_unaryExpression = 22, - RULE_notExpression = 23, RULE_crementExpression = 24, RULE_incrementExpression = 25, - RULE_prefixIncrementExpression = 26, RULE_suffixIncrementExpression = 27, - RULE_decrementExpression = 28, RULE_prefixDecrementExpression = 29, RULE_suffixDecrementExpression = 30, - RULE_assignableExpression = 31, RULE_memberAccess = 32, RULE_binaryExpression = 33, - RULE_calculationExpression = 34, RULE_dotExpression = 35, RULE_dotSubtractionExpression = 36, - RULE_nonCalculationExpression = 37, RULE_methodCall = 38, RULE_target = 39, - RULE_chainedMethod = 40, RULE_type = 41, RULE_value = 42, RULE_nonCalculationOperator = 43; - private static String[] makeRuleNames() { - return new String[] { - "program", "classDeclaration", "memberDeclaration", "constructorDeclaration", - "fieldDeclaration", "methodDeclaration", "parameterList", "parameter", - "argumentList", "statement", "block", "returnStatement", "localVariableDeclaration", - "whileStatement", "forStatement", "ifElseStatement", "ifStatement", "elseStatement", - "statementExpression", "assign", "newDeclaration", "expression", "unaryExpression", - "notExpression", "crementExpression", "incrementExpression", "prefixIncrementExpression", - "suffixIncrementExpression", "decrementExpression", "prefixDecrementExpression", - "suffixDecrementExpression", "assignableExpression", "memberAccess", - "binaryExpression", "calculationExpression", "dotExpression", "dotSubtractionExpression", - "nonCalculationExpression", "methodCall", "target", "chainedMethod", - "type", "value", "nonCalculationOperator" - }; - } - public static final String[] ruleNames = makeRuleNames(); - - private static String[] makeLiteralNames() { - return new String[] { - null, "'++'", "'--'", "'void'", "'boolean'", "'char'", "'int'", null, - "'public static void main(String[] args)'", null, null, null, null, "'='", - "'+'", "'-'", "'*'", "'%'", "'/'", "'>'", "'<'", "'>='", "'<='", "'=='", - "'!='", "'!'", "'&&'", "'||'", "'.'", "'('", "')'", "'{'", "'}'", "';'", - "','", "'class'", "'this'", "'while'", "'if'", "'else'", "'for'", "'return'", - "'new'", null, null, null, "'null'" - }; - } - private static final String[] _LITERAL_NAMES = makeLiteralNames(); - private static String[] makeSymbolicNames() { - return new String[] { - null, null, null, "Void", "Boolean", "Char", "Int", "AccessModifier", - "MainMethodDeclaration", "DotOperator", "LineOperator", "ComparisonOperator", - "LogicalOperator", "Assign", "Plus", "Minus", "Mult", "Modulo", "Div", - "Greater", "Less", "GreaterEqual", "LessEqual", "Equal", "NotEqual", - "Not", "And", "Or", "Dot", "OpenRoundBracket", "ClosedRoundBracket", - "OpenCurlyBracket", "ClosedCurlyBracket", "Semicolon", "Comma", "Class", - "This", "While", "If", "Else", "For", "Return", "New", "CharValue", "IntValue", - "BooleanValue", "NullValue", "Identifier", "WS", "InlineComment", "MultilineComment" - }; - } - private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); - public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); - - /** - * @deprecated Use {@link #VOCABULARY} instead. - */ - @Deprecated - public static final String[] tokenNames; - static { - tokenNames = new String[_SYMBOLIC_NAMES.length]; - for (int i = 0; i < tokenNames.length; i++) { - tokenNames[i] = VOCABULARY.getLiteralName(i); - if (tokenNames[i] == null) { - tokenNames[i] = VOCABULARY.getSymbolicName(i); - } - - if (tokenNames[i] == null) { - tokenNames[i] = ""; - } - } - } - - @Override - @Deprecated - public String[] getTokenNames() { - return tokenNames; - } - - @Override - - public Vocabulary getVocabulary() { - return VOCABULARY; - } - - @Override - public String getGrammarFileName() { return "SimpleJava.g4"; } - - @Override - public String[] getRuleNames() { return ruleNames; } - - @Override - public String getSerializedATN() { return _serializedATN; } - - @Override - public ATN getATN() { return _ATN; } - - public SimpleJavaParser(TokenStream input) { - super(input); - _interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); - } - - @SuppressWarnings("CheckReturnValue") - public static class ProgramContext extends ParserRuleContext { - public List classDeclaration() { - return getRuleContexts(ClassDeclarationContext.class); - } - public ClassDeclarationContext classDeclaration(int i) { - return getRuleContext(ClassDeclarationContext.class,i); - } - public ProgramContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_program; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterProgram(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitProgram(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitProgram(this); - else return visitor.visitChildren(this); - } - } - - public final ProgramContext program() throws RecognitionException { - ProgramContext _localctx = new ProgramContext(_ctx, getState()); - enterRule(_localctx, 0, RULE_program); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(89); - _errHandler.sync(this); - _la = _input.LA(1); - do { - { - { - setState(88); - classDeclaration(); - } - } - setState(91); - _errHandler.sync(this); - _la = _input.LA(1); - } while ( _la==AccessModifier || _la==Class ); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ClassDeclarationContext extends ParserRuleContext { - public TerminalNode Class() { return getToken(SimpleJavaParser.Class, 0); } - public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } - public TerminalNode OpenCurlyBracket() { return getToken(SimpleJavaParser.OpenCurlyBracket, 0); } - public TerminalNode ClosedCurlyBracket() { return getToken(SimpleJavaParser.ClosedCurlyBracket, 0); } - public TerminalNode AccessModifier() { return getToken(SimpleJavaParser.AccessModifier, 0); } - public List memberDeclaration() { - return getRuleContexts(MemberDeclarationContext.class); - } - public MemberDeclarationContext memberDeclaration(int i) { - return getRuleContext(MemberDeclarationContext.class,i); - } - public ClassDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_classDeclaration; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterClassDeclaration(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitClassDeclaration(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitClassDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final ClassDeclarationContext classDeclaration() throws RecognitionException { - ClassDeclarationContext _localctx = new ClassDeclarationContext(_ctx, getState()); - enterRule(_localctx, 2, RULE_classDeclaration); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(94); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==AccessModifier) { - { - setState(93); - match(AccessModifier); - } - } - - setState(96); - match(Class); - setState(97); - match(Identifier); - setState(98); - match(OpenCurlyBracket); - setState(102); - _errHandler.sync(this); - _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 140737488355832L) != 0)) { - { - { - setState(99); - memberDeclaration(); - } - } - setState(104); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(105); - match(ClosedCurlyBracket); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class MemberDeclarationContext extends ParserRuleContext { - public ConstructorDeclarationContext constructorDeclaration() { - return getRuleContext(ConstructorDeclarationContext.class,0); - } - public FieldDeclarationContext fieldDeclaration() { - return getRuleContext(FieldDeclarationContext.class,0); - } - public MethodDeclarationContext methodDeclaration() { - return getRuleContext(MethodDeclarationContext.class,0); - } - public MemberDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_memberDeclaration; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterMemberDeclaration(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitMemberDeclaration(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitMemberDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final MemberDeclarationContext memberDeclaration() throws RecognitionException { - MemberDeclarationContext _localctx = new MemberDeclarationContext(_ctx, getState()); - enterRule(_localctx, 4, RULE_memberDeclaration); - try { - setState(110); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(107); - constructorDeclaration(); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(108); - fieldDeclaration(); - } - break; - case 3: - enterOuterAlt(_localctx, 3); - { - setState(109); - methodDeclaration(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ConstructorDeclarationContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } - public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } - public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } - public BlockContext block() { - return getRuleContext(BlockContext.class,0); - } - public TerminalNode AccessModifier() { return getToken(SimpleJavaParser.AccessModifier, 0); } - public ParameterListContext parameterList() { - return getRuleContext(ParameterListContext.class,0); - } - public ConstructorDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_constructorDeclaration; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterConstructorDeclaration(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitConstructorDeclaration(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitConstructorDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final ConstructorDeclarationContext constructorDeclaration() throws RecognitionException { - ConstructorDeclarationContext _localctx = new ConstructorDeclarationContext(_ctx, getState()); - enterRule(_localctx, 6, RULE_constructorDeclaration); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(113); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==AccessModifier) { - { - setState(112); - match(AccessModifier); - } - } - - setState(115); - match(Identifier); - setState(116); - match(OpenRoundBracket); - setState(118); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 140737488355440L) != 0)) { - { - setState(117); - parameterList(); - } - } - - setState(120); - match(ClosedRoundBracket); - setState(121); - block(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class FieldDeclarationContext extends ParserRuleContext { - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } - public TerminalNode Semicolon() { return getToken(SimpleJavaParser.Semicolon, 0); } - public TerminalNode AccessModifier() { return getToken(SimpleJavaParser.AccessModifier, 0); } - public FieldDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_fieldDeclaration; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterFieldDeclaration(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitFieldDeclaration(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitFieldDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final FieldDeclarationContext fieldDeclaration() throws RecognitionException { - FieldDeclarationContext _localctx = new FieldDeclarationContext(_ctx, getState()); - enterRule(_localctx, 8, RULE_fieldDeclaration); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(124); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==AccessModifier) { - { - setState(123); - match(AccessModifier); - } - } - - setState(126); - type(); - setState(127); - match(Identifier); - setState(128); - match(Semicolon); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class MethodDeclarationContext extends ParserRuleContext { - public TerminalNode MainMethodDeclaration() { return getToken(SimpleJavaParser.MainMethodDeclaration, 0); } - public BlockContext block() { - return getRuleContext(BlockContext.class,0); - } - public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } - public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } - public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public TerminalNode Void() { return getToken(SimpleJavaParser.Void, 0); } - public TerminalNode AccessModifier() { return getToken(SimpleJavaParser.AccessModifier, 0); } - public ParameterListContext parameterList() { - return getRuleContext(ParameterListContext.class,0); - } - public MethodDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_methodDeclaration; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterMethodDeclaration(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitMethodDeclaration(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitMethodDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final MethodDeclarationContext methodDeclaration() throws RecognitionException { - MethodDeclarationContext _localctx = new MethodDeclarationContext(_ctx, getState()); - enterRule(_localctx, 10, RULE_methodDeclaration); - int _la; - try { - setState(146); - _errHandler.sync(this); - switch (_input.LA(1)) { - case MainMethodDeclaration: - enterOuterAlt(_localctx, 1); - { - setState(130); - match(MainMethodDeclaration); - setState(131); - block(); - } - break; - case Void: - case Boolean: - case Char: - case Int: - case AccessModifier: - case Identifier: - enterOuterAlt(_localctx, 2); - { - setState(133); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==AccessModifier) { - { - setState(132); - match(AccessModifier); - } - } - - setState(137); - _errHandler.sync(this); - switch (_input.LA(1)) { - case Boolean: - case Char: - case Int: - case Identifier: - { - setState(135); - type(); - } - break; - case Void: - { - setState(136); - match(Void); - } - break; - default: - throw new NoViableAltException(this); - } - setState(139); - match(Identifier); - setState(140); - match(OpenRoundBracket); - setState(142); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 140737488355440L) != 0)) { - { - setState(141); - parameterList(); - } - } - - setState(144); - match(ClosedRoundBracket); - setState(145); - block(); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ParameterListContext extends ParserRuleContext { - public List parameter() { - return getRuleContexts(ParameterContext.class); - } - public ParameterContext parameter(int i) { - return getRuleContext(ParameterContext.class,i); - } - public List Comma() { return getTokens(SimpleJavaParser.Comma); } - public TerminalNode Comma(int i) { - return getToken(SimpleJavaParser.Comma, i); - } - public ParameterListContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_parameterList; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterParameterList(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitParameterList(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitParameterList(this); - else return visitor.visitChildren(this); - } - } - - public final ParameterListContext parameterList() throws RecognitionException { - ParameterListContext _localctx = new ParameterListContext(_ctx, getState()); - enterRule(_localctx, 12, RULE_parameterList); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(148); - parameter(); - setState(153); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==Comma) { - { - { - setState(149); - match(Comma); - setState(150); - parameter(); - } - } - setState(155); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ParameterContext extends ParserRuleContext { - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } - public ParameterContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_parameter; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterParameter(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitParameter(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitParameter(this); - else return visitor.visitChildren(this); - } - } - - public final ParameterContext parameter() throws RecognitionException { - ParameterContext _localctx = new ParameterContext(_ctx, getState()); - enterRule(_localctx, 14, RULE_parameter); - try { - enterOuterAlt(_localctx, 1); - { - setState(156); - type(); - setState(157); - match(Identifier); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ArgumentListContext extends ParserRuleContext { - public List expression() { - return getRuleContexts(ExpressionContext.class); - } - public ExpressionContext expression(int i) { - return getRuleContext(ExpressionContext.class,i); - } - public List Comma() { return getTokens(SimpleJavaParser.Comma); } - public TerminalNode Comma(int i) { - return getToken(SimpleJavaParser.Comma, i); - } - public ArgumentListContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_argumentList; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterArgumentList(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitArgumentList(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitArgumentList(this); - else return visitor.visitChildren(this); - } - } - - public final ArgumentListContext argumentList() throws RecognitionException { - ArgumentListContext _localctx = new ArgumentListContext(_ctx, getState()); - enterRule(_localctx, 16, RULE_argumentList); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(167); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 277146220101638L) != 0)) { - { - setState(159); - expression(); - setState(164); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==Comma) { - { - { - setState(160); - match(Comma); - setState(161); - expression(); - } - } - setState(166); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class StatementContext extends ParserRuleContext { - public ReturnStatementContext returnStatement() { - return getRuleContext(ReturnStatementContext.class,0); - } - public TerminalNode Semicolon() { return getToken(SimpleJavaParser.Semicolon, 0); } - public LocalVariableDeclarationContext localVariableDeclaration() { - return getRuleContext(LocalVariableDeclarationContext.class,0); - } - public BlockContext block() { - return getRuleContext(BlockContext.class,0); - } - public WhileStatementContext whileStatement() { - return getRuleContext(WhileStatementContext.class,0); - } - public ForStatementContext forStatement() { - return getRuleContext(ForStatementContext.class,0); - } - public IfElseStatementContext ifElseStatement() { - return getRuleContext(IfElseStatementContext.class,0); - } - public StatementExpressionContext statementExpression() { - return getRuleContext(StatementExpressionContext.class,0); - } - public StatementContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_statement; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterStatement(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitStatement(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitStatement(this); - else return visitor.visitChildren(this); - } - } - - public final StatementContext statement() throws RecognitionException { - StatementContext _localctx = new StatementContext(_ctx, getState()); - enterRule(_localctx, 18, RULE_statement); - try { - setState(182); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,14,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(169); - returnStatement(); - setState(170); - match(Semicolon); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(172); - localVariableDeclaration(); - setState(173); - match(Semicolon); - } - break; - case 3: - enterOuterAlt(_localctx, 3); - { - setState(175); - block(); - } - break; - case 4: - enterOuterAlt(_localctx, 4); - { - setState(176); - whileStatement(); - } - break; - case 5: - enterOuterAlt(_localctx, 5); - { - setState(177); - forStatement(); - } - break; - case 6: - enterOuterAlt(_localctx, 6); - { - setState(178); - ifElseStatement(); - } - break; - case 7: - enterOuterAlt(_localctx, 7); - { - setState(179); - statementExpression(); - setState(180); - match(Semicolon); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class BlockContext extends ParserRuleContext { - public TerminalNode OpenCurlyBracket() { return getToken(SimpleJavaParser.OpenCurlyBracket, 0); } - public TerminalNode ClosedCurlyBracket() { return getToken(SimpleJavaParser.ClosedCurlyBracket, 0); } - public List statement() { - return getRuleContexts(StatementContext.class); - } - public StatementContext statement(int i) { - return getRuleContext(StatementContext.class,i); - } - public BlockContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_block; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterBlock(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitBlock(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitBlock(this); - else return visitor.visitChildren(this); - } - } - - public final BlockContext block() throws RecognitionException { - BlockContext _localctx = new BlockContext(_ctx, getState()); - enterRule(_localctx, 20, RULE_block); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(184); - match(OpenCurlyBracket); - setState(188); - _errHandler.sync(this); - _la = _input.LA(1); - while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 148917253570678L) != 0)) { - { - { - setState(185); - statement(); - } - } - setState(190); - _errHandler.sync(this); - _la = _input.LA(1); - } - setState(191); - match(ClosedCurlyBracket); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ReturnStatementContext extends ParserRuleContext { - public TerminalNode Return() { return getToken(SimpleJavaParser.Return, 0); } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public ReturnStatementContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_returnStatement; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterReturnStatement(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitReturnStatement(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitReturnStatement(this); - else return visitor.visitChildren(this); - } - } - - public final ReturnStatementContext returnStatement() throws RecognitionException { - ReturnStatementContext _localctx = new ReturnStatementContext(_ctx, getState()); - enterRule(_localctx, 22, RULE_returnStatement); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(193); - match(Return); - setState(195); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 277146220101638L) != 0)) { - { - setState(194); - expression(); - } - } - - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class LocalVariableDeclarationContext extends ParserRuleContext { - public TypeContext type() { - return getRuleContext(TypeContext.class,0); - } - public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } - public TerminalNode Assign() { return getToken(SimpleJavaParser.Assign, 0); } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public LocalVariableDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_localVariableDeclaration; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterLocalVariableDeclaration(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitLocalVariableDeclaration(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitLocalVariableDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final LocalVariableDeclarationContext localVariableDeclaration() throws RecognitionException { - LocalVariableDeclarationContext _localctx = new LocalVariableDeclarationContext(_ctx, getState()); - enterRule(_localctx, 24, RULE_localVariableDeclaration); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(197); - type(); - setState(198); - match(Identifier); - setState(201); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==Assign) { - { - setState(199); - match(Assign); - setState(200); - expression(); - } - } - - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class WhileStatementContext extends ParserRuleContext { - public TerminalNode While() { return getToken(SimpleJavaParser.While, 0); } - public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } - public BlockContext block() { - return getRuleContext(BlockContext.class,0); - } - public WhileStatementContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_whileStatement; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterWhileStatement(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitWhileStatement(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitWhileStatement(this); - else return visitor.visitChildren(this); - } - } - - public final WhileStatementContext whileStatement() throws RecognitionException { - WhileStatementContext _localctx = new WhileStatementContext(_ctx, getState()); - enterRule(_localctx, 26, RULE_whileStatement); - try { - enterOuterAlt(_localctx, 1); - { - setState(203); - match(While); - setState(204); - match(OpenRoundBracket); - setState(205); - expression(); - setState(206); - match(ClosedRoundBracket); - setState(207); - block(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ForStatementContext extends ParserRuleContext { - public TerminalNode For() { return getToken(SimpleJavaParser.For, 0); } - public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } - public List Semicolon() { return getTokens(SimpleJavaParser.Semicolon); } - public TerminalNode Semicolon(int i) { - return getToken(SimpleJavaParser.Semicolon, i); - } - public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } - public BlockContext block() { - return getRuleContext(BlockContext.class,0); - } - public List statementExpression() { - return getRuleContexts(StatementExpressionContext.class); - } - public StatementExpressionContext statementExpression(int i) { - return getRuleContext(StatementExpressionContext.class,i); - } - public LocalVariableDeclarationContext localVariableDeclaration() { - return getRuleContext(LocalVariableDeclarationContext.class,0); - } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public ForStatementContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_forStatement; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterForStatement(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitForStatement(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitForStatement(this); - else return visitor.visitChildren(this); - } - } - - public final ForStatementContext forStatement() throws RecognitionException { - ForStatementContext _localctx = new ForStatementContext(_ctx, getState()); - enterRule(_localctx, 28, RULE_forStatement); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(209); - match(For); - setState(210); - match(OpenRoundBracket); - setState(213); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,18,_ctx) ) { - case 1: - { - setState(211); - statementExpression(); - } - break; - case 2: - { - setState(212); - localVariableDeclaration(); - } - break; - } - setState(215); - match(Semicolon); - setState(217); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 277146220101638L) != 0)) { - { - setState(216); - expression(); - } - } - - setState(219); - match(Semicolon); - setState(221); - _errHandler.sync(this); - _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 145204254343174L) != 0)) { - { - setState(220); - statementExpression(); - } - } - - setState(223); - match(ClosedRoundBracket); - setState(224); - block(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class IfElseStatementContext extends ParserRuleContext { - public IfStatementContext ifStatement() { - return getRuleContext(IfStatementContext.class,0); - } - public List elseStatement() { - return getRuleContexts(ElseStatementContext.class); - } - public ElseStatementContext elseStatement(int i) { - return getRuleContext(ElseStatementContext.class,i); - } - public IfElseStatementContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_ifElseStatement; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterIfElseStatement(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitIfElseStatement(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitIfElseStatement(this); - else return visitor.visitChildren(this); - } - } - - public final IfElseStatementContext ifElseStatement() throws RecognitionException { - IfElseStatementContext _localctx = new IfElseStatementContext(_ctx, getState()); - enterRule(_localctx, 30, RULE_ifElseStatement); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(226); - ifStatement(); - setState(230); - _errHandler.sync(this); - _la = _input.LA(1); - while (_la==Else) { - { - { - setState(227); - elseStatement(); - } - } - setState(232); - _errHandler.sync(this); - _la = _input.LA(1); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class IfStatementContext extends ParserRuleContext { - public TerminalNode If() { return getToken(SimpleJavaParser.If, 0); } - public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } - public BlockContext block() { - return getRuleContext(BlockContext.class,0); - } - public IfStatementContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_ifStatement; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterIfStatement(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitIfStatement(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitIfStatement(this); - else return visitor.visitChildren(this); - } - } - - public final IfStatementContext ifStatement() throws RecognitionException { - IfStatementContext _localctx = new IfStatementContext(_ctx, getState()); - enterRule(_localctx, 32, RULE_ifStatement); - try { - enterOuterAlt(_localctx, 1); - { - setState(233); - match(If); - setState(234); - match(OpenRoundBracket); - setState(235); - expression(); - setState(236); - match(ClosedRoundBracket); - setState(237); - block(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ElseStatementContext extends ParserRuleContext { - public TerminalNode Else() { return getToken(SimpleJavaParser.Else, 0); } - public BlockContext block() { - return getRuleContext(BlockContext.class,0); - } - public ElseStatementContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_elseStatement; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterElseStatement(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitElseStatement(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitElseStatement(this); - else return visitor.visitChildren(this); - } - } - - public final ElseStatementContext elseStatement() throws RecognitionException { - ElseStatementContext _localctx = new ElseStatementContext(_ctx, getState()); - enterRule(_localctx, 34, RULE_elseStatement); - try { - enterOuterAlt(_localctx, 1); - { - setState(239); - match(Else); - setState(240); - block(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class StatementExpressionContext extends ParserRuleContext { - public AssignContext assign() { - return getRuleContext(AssignContext.class,0); - } - public NewDeclarationContext newDeclaration() { - return getRuleContext(NewDeclarationContext.class,0); - } - public MethodCallContext methodCall() { - return getRuleContext(MethodCallContext.class,0); - } - public CrementExpressionContext crementExpression() { - return getRuleContext(CrementExpressionContext.class,0); - } - public StatementExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_statementExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterStatementExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitStatementExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitStatementExpression(this); - else return visitor.visitChildren(this); - } - } - - public final StatementExpressionContext statementExpression() throws RecognitionException { - StatementExpressionContext _localctx = new StatementExpressionContext(_ctx, getState()); - enterRule(_localctx, 36, RULE_statementExpression); - try { - setState(246); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,22,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(242); - assign(); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(243); - newDeclaration(); - } - break; - case 3: - enterOuterAlt(_localctx, 3); - { - setState(244); - methodCall(); - } - break; - case 4: - enterOuterAlt(_localctx, 4); - { - setState(245); - crementExpression(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class AssignContext extends ParserRuleContext { - public AssignableExpressionContext assignableExpression() { - return getRuleContext(AssignableExpressionContext.class,0); - } - public TerminalNode Assign() { return getToken(SimpleJavaParser.Assign, 0); } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public AssignContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_assign; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterAssign(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitAssign(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitAssign(this); - else return visitor.visitChildren(this); - } - } - - public final AssignContext assign() throws RecognitionException { - AssignContext _localctx = new AssignContext(_ctx, getState()); - enterRule(_localctx, 38, RULE_assign); - try { - enterOuterAlt(_localctx, 1); - { - setState(248); - assignableExpression(); - setState(249); - match(Assign); - setState(250); - expression(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class NewDeclarationContext extends ParserRuleContext { - public TerminalNode New() { return getToken(SimpleJavaParser.New, 0); } - public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } - public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } - public ArgumentListContext argumentList() { - return getRuleContext(ArgumentListContext.class,0); - } - public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } - public NewDeclarationContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_newDeclaration; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterNewDeclaration(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitNewDeclaration(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitNewDeclaration(this); - else return visitor.visitChildren(this); - } - } - - public final NewDeclarationContext newDeclaration() throws RecognitionException { - NewDeclarationContext _localctx = new NewDeclarationContext(_ctx, getState()); - enterRule(_localctx, 40, RULE_newDeclaration); - try { - enterOuterAlt(_localctx, 1); - { - setState(252); - match(New); - setState(253); - match(Identifier); - setState(254); - match(OpenRoundBracket); - setState(255); - argumentList(); - setState(256); - match(ClosedRoundBracket); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ExpressionContext extends ParserRuleContext { - public UnaryExpressionContext unaryExpression() { - return getRuleContext(UnaryExpressionContext.class,0); - } - public BinaryExpressionContext binaryExpression() { - return getRuleContext(BinaryExpressionContext.class,0); - } - public ExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_expression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitExpression(this); - else return visitor.visitChildren(this); - } - } - - public final ExpressionContext expression() throws RecognitionException { - ExpressionContext _localctx = new ExpressionContext(_ctx, getState()); - enterRule(_localctx, 42, RULE_expression); - try { - setState(260); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(258); - unaryExpression(); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(259); - binaryExpression(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class UnaryExpressionContext extends ParserRuleContext { - public TerminalNode This() { return getToken(SimpleJavaParser.This, 0); } - public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } - public MemberAccessContext memberAccess() { - return getRuleContext(MemberAccessContext.class,0); - } - public ValueContext value() { - return getRuleContext(ValueContext.class,0); - } - public NotExpressionContext notExpression() { - return getRuleContext(NotExpressionContext.class,0); - } - public StatementExpressionContext statementExpression() { - return getRuleContext(StatementExpressionContext.class,0); - } - public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } - public UnaryExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_unaryExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterUnaryExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitUnaryExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitUnaryExpression(this); - else return visitor.visitChildren(this); - } - } - - public final UnaryExpressionContext unaryExpression() throws RecognitionException { - UnaryExpressionContext _localctx = new UnaryExpressionContext(_ctx, getState()); - enterRule(_localctx, 44, RULE_unaryExpression); - try { - setState(272); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,24,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(262); - match(This); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(263); - match(Identifier); - } - break; - case 3: - enterOuterAlt(_localctx, 3); - { - setState(264); - memberAccess(); - } - break; - case 4: - enterOuterAlt(_localctx, 4); - { - setState(265); - value(); - } - break; - case 5: - enterOuterAlt(_localctx, 5); - { - setState(266); - notExpression(); - } - break; - case 6: - enterOuterAlt(_localctx, 6); - { - setState(267); - statementExpression(); - } - break; - case 7: - enterOuterAlt(_localctx, 7); - { - setState(268); - match(OpenRoundBracket); - setState(269); - expression(); - setState(270); - match(ClosedRoundBracket); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class NotExpressionContext extends ParserRuleContext { - public TerminalNode Not() { return getToken(SimpleJavaParser.Not, 0); } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public NotExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_notExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterNotExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitNotExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitNotExpression(this); - else return visitor.visitChildren(this); - } - } - - public final NotExpressionContext notExpression() throws RecognitionException { - NotExpressionContext _localctx = new NotExpressionContext(_ctx, getState()); - enterRule(_localctx, 46, RULE_notExpression); - try { - enterOuterAlt(_localctx, 1); - { - setState(274); - match(Not); - setState(275); - expression(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class CrementExpressionContext extends ParserRuleContext { - public IncrementExpressionContext incrementExpression() { - return getRuleContext(IncrementExpressionContext.class,0); - } - public DecrementExpressionContext decrementExpression() { - return getRuleContext(DecrementExpressionContext.class,0); - } - public CrementExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_crementExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterCrementExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitCrementExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitCrementExpression(this); - else return visitor.visitChildren(this); - } - } - - public final CrementExpressionContext crementExpression() throws RecognitionException { - CrementExpressionContext _localctx = new CrementExpressionContext(_ctx, getState()); - enterRule(_localctx, 48, RULE_crementExpression); - try { - setState(279); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,25,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(277); - incrementExpression(); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(278); - decrementExpression(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class IncrementExpressionContext extends ParserRuleContext { - public PrefixIncrementExpressionContext prefixIncrementExpression() { - return getRuleContext(PrefixIncrementExpressionContext.class,0); - } - public SuffixIncrementExpressionContext suffixIncrementExpression() { - return getRuleContext(SuffixIncrementExpressionContext.class,0); - } - public IncrementExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_incrementExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterIncrementExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitIncrementExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitIncrementExpression(this); - else return visitor.visitChildren(this); - } - } - - public final IncrementExpressionContext incrementExpression() throws RecognitionException { - IncrementExpressionContext _localctx = new IncrementExpressionContext(_ctx, getState()); - enterRule(_localctx, 50, RULE_incrementExpression); - try { - setState(283); - _errHandler.sync(this); - switch (_input.LA(1)) { - case T__0: - enterOuterAlt(_localctx, 1); - { - setState(281); - prefixIncrementExpression(); - } - break; - case This: - case Identifier: - enterOuterAlt(_localctx, 2); - { - setState(282); - suffixIncrementExpression(); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class PrefixIncrementExpressionContext extends ParserRuleContext { - public AssignableExpressionContext assignableExpression() { - return getRuleContext(AssignableExpressionContext.class,0); - } - public PrefixIncrementExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_prefixIncrementExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterPrefixIncrementExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitPrefixIncrementExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitPrefixIncrementExpression(this); - else return visitor.visitChildren(this); - } - } - - public final PrefixIncrementExpressionContext prefixIncrementExpression() throws RecognitionException { - PrefixIncrementExpressionContext _localctx = new PrefixIncrementExpressionContext(_ctx, getState()); - enterRule(_localctx, 52, RULE_prefixIncrementExpression); - try { - enterOuterAlt(_localctx, 1); - { - setState(285); - match(T__0); - setState(286); - assignableExpression(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class SuffixIncrementExpressionContext extends ParserRuleContext { - public AssignableExpressionContext assignableExpression() { - return getRuleContext(AssignableExpressionContext.class,0); - } - public SuffixIncrementExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_suffixIncrementExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterSuffixIncrementExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitSuffixIncrementExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitSuffixIncrementExpression(this); - else return visitor.visitChildren(this); - } - } - - public final SuffixIncrementExpressionContext suffixIncrementExpression() throws RecognitionException { - SuffixIncrementExpressionContext _localctx = new SuffixIncrementExpressionContext(_ctx, getState()); - enterRule(_localctx, 54, RULE_suffixIncrementExpression); - try { - enterOuterAlt(_localctx, 1); - { - setState(288); - assignableExpression(); - setState(289); - match(T__0); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class DecrementExpressionContext extends ParserRuleContext { - public PrefixDecrementExpressionContext prefixDecrementExpression() { - return getRuleContext(PrefixDecrementExpressionContext.class,0); - } - public SuffixDecrementExpressionContext suffixDecrementExpression() { - return getRuleContext(SuffixDecrementExpressionContext.class,0); - } - public DecrementExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_decrementExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterDecrementExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitDecrementExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitDecrementExpression(this); - else return visitor.visitChildren(this); - } - } - - public final DecrementExpressionContext decrementExpression() throws RecognitionException { - DecrementExpressionContext _localctx = new DecrementExpressionContext(_ctx, getState()); - enterRule(_localctx, 56, RULE_decrementExpression); - try { - setState(293); - _errHandler.sync(this); - switch (_input.LA(1)) { - case T__1: - enterOuterAlt(_localctx, 1); - { - setState(291); - prefixDecrementExpression(); - } - break; - case This: - case Identifier: - enterOuterAlt(_localctx, 2); - { - setState(292); - suffixDecrementExpression(); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class PrefixDecrementExpressionContext extends ParserRuleContext { - public AssignableExpressionContext assignableExpression() { - return getRuleContext(AssignableExpressionContext.class,0); - } - public PrefixDecrementExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_prefixDecrementExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterPrefixDecrementExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitPrefixDecrementExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitPrefixDecrementExpression(this); - else return visitor.visitChildren(this); - } - } - - public final PrefixDecrementExpressionContext prefixDecrementExpression() throws RecognitionException { - PrefixDecrementExpressionContext _localctx = new PrefixDecrementExpressionContext(_ctx, getState()); - enterRule(_localctx, 58, RULE_prefixDecrementExpression); - try { - enterOuterAlt(_localctx, 1); - { - setState(295); - match(T__1); - setState(296); - assignableExpression(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class SuffixDecrementExpressionContext extends ParserRuleContext { - public AssignableExpressionContext assignableExpression() { - return getRuleContext(AssignableExpressionContext.class,0); - } - public SuffixDecrementExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_suffixDecrementExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterSuffixDecrementExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitSuffixDecrementExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitSuffixDecrementExpression(this); - else return visitor.visitChildren(this); - } - } - - public final SuffixDecrementExpressionContext suffixDecrementExpression() throws RecognitionException { - SuffixDecrementExpressionContext _localctx = new SuffixDecrementExpressionContext(_ctx, getState()); - enterRule(_localctx, 60, RULE_suffixDecrementExpression); - try { - enterOuterAlt(_localctx, 1); - { - setState(298); - assignableExpression(); - setState(299); - match(T__1); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class AssignableExpressionContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } - public MemberAccessContext memberAccess() { - return getRuleContext(MemberAccessContext.class,0); - } - public AssignableExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_assignableExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterAssignableExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitAssignableExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitAssignableExpression(this); - else return visitor.visitChildren(this); - } - } - - public final AssignableExpressionContext assignableExpression() throws RecognitionException { - AssignableExpressionContext _localctx = new AssignableExpressionContext(_ctx, getState()); - enterRule(_localctx, 62, RULE_assignableExpression); - try { - setState(303); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(301); - match(Identifier); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(302); - memberAccess(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class MemberAccessContext extends ParserRuleContext { - public TerminalNode This() { return getToken(SimpleJavaParser.This, 0); } - public List Dot() { return getTokens(SimpleJavaParser.Dot); } - public TerminalNode Dot(int i) { - return getToken(SimpleJavaParser.Dot, i); - } - public List Identifier() { return getTokens(SimpleJavaParser.Identifier); } - public TerminalNode Identifier(int i) { - return getToken(SimpleJavaParser.Identifier, i); - } - public MemberAccessContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_memberAccess; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterMemberAccess(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitMemberAccess(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitMemberAccess(this); - else return visitor.visitChildren(this); - } - } - - public final MemberAccessContext memberAccess() throws RecognitionException { - MemberAccessContext _localctx = new MemberAccessContext(_ctx, getState()); - enterRule(_localctx, 64, RULE_memberAccess); - int _la; - try { - int _alt; - setState(319); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,31,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(305); - match(This); - setState(306); - match(Dot); - setState(307); - match(Identifier); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(310); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==This) { - { - setState(308); - match(This); - setState(309); - match(Dot); - } - } - - setState(314); - _errHandler.sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - setState(312); - match(Identifier); - setState(313); - match(Dot); - } - } - break; - default: - throw new NoViableAltException(this); - } - setState(316); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,30,_ctx); - } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); - setState(318); - match(Identifier); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class BinaryExpressionContext extends ParserRuleContext { - public CalculationExpressionContext calculationExpression() { - return getRuleContext(CalculationExpressionContext.class,0); - } - public NonCalculationExpressionContext nonCalculationExpression() { - return getRuleContext(NonCalculationExpressionContext.class,0); - } - public BinaryExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_binaryExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterBinaryExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitBinaryExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitBinaryExpression(this); - else return visitor.visitChildren(this); - } - } - - public final BinaryExpressionContext binaryExpression() throws RecognitionException { - BinaryExpressionContext _localctx = new BinaryExpressionContext(_ctx, getState()); - enterRule(_localctx, 66, RULE_binaryExpression); - try { - setState(323); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,32,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(321); - calculationExpression(0); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(322); - nonCalculationExpression(); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class CalculationExpressionContext extends ParserRuleContext { - public DotExpressionContext dotExpression() { - return getRuleContext(DotExpressionContext.class,0); - } - public CalculationExpressionContext calculationExpression() { - return getRuleContext(CalculationExpressionContext.class,0); - } - public TerminalNode LineOperator() { return getToken(SimpleJavaParser.LineOperator, 0); } - public CalculationExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_calculationExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterCalculationExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitCalculationExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitCalculationExpression(this); - else return visitor.visitChildren(this); - } - } - - public final CalculationExpressionContext calculationExpression() throws RecognitionException { - return calculationExpression(0); - } - - private CalculationExpressionContext calculationExpression(int _p) throws RecognitionException { - ParserRuleContext _parentctx = _ctx; - int _parentState = getState(); - CalculationExpressionContext _localctx = new CalculationExpressionContext(_ctx, _parentState); - CalculationExpressionContext _prevctx = _localctx; - int _startState = 68; - enterRecursionRule(_localctx, 68, RULE_calculationExpression, _p); - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - { - setState(326); - dotExpression(0); - } - _ctx.stop = _input.LT(-1); - setState(333); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,33,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - if ( _parseListeners!=null ) triggerExitRuleEvent(); - _prevctx = _localctx; - { - { - _localctx = new CalculationExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_calculationExpression); - setState(328); - if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(329); - match(LineOperator); - setState(330); - dotExpression(0); - } - } - } - setState(335); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,33,_ctx); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - unrollRecursionContexts(_parentctx); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class DotExpressionContext extends ParserRuleContext { - public DotSubtractionExpressionContext dotSubtractionExpression() { - return getRuleContext(DotSubtractionExpressionContext.class,0); - } - public DotExpressionContext dotExpression() { - return getRuleContext(DotExpressionContext.class,0); - } - public TerminalNode DotOperator() { return getToken(SimpleJavaParser.DotOperator, 0); } - public DotExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_dotExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterDotExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitDotExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitDotExpression(this); - else return visitor.visitChildren(this); - } - } - - public final DotExpressionContext dotExpression() throws RecognitionException { - return dotExpression(0); - } - - private DotExpressionContext dotExpression(int _p) throws RecognitionException { - ParserRuleContext _parentctx = _ctx; - int _parentState = getState(); - DotExpressionContext _localctx = new DotExpressionContext(_ctx, _parentState); - DotExpressionContext _prevctx = _localctx; - int _startState = 70; - enterRecursionRule(_localctx, 70, RULE_dotExpression, _p); - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - { - setState(337); - dotSubtractionExpression(); - } - _ctx.stop = _input.LT(-1); - setState(344); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,34,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - if ( _parseListeners!=null ) triggerExitRuleEvent(); - _prevctx = _localctx; - { - { - _localctx = new DotExpressionContext(_parentctx, _parentState); - pushNewRecursionContext(_localctx, _startState, RULE_dotExpression); - setState(339); - if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(340); - match(DotOperator); - setState(341); - dotSubtractionExpression(); - } - } - } - setState(346); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,34,_ctx); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - unrollRecursionContexts(_parentctx); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class DotSubtractionExpressionContext extends ParserRuleContext { - public TerminalNode IntValue() { return getToken(SimpleJavaParser.IntValue, 0); } - public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } - public MemberAccessContext memberAccess() { - return getRuleContext(MemberAccessContext.class,0); - } - public MethodCallContext methodCall() { - return getRuleContext(MethodCallContext.class,0); - } - public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } - public CalculationExpressionContext calculationExpression() { - return getRuleContext(CalculationExpressionContext.class,0); - } - public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } - public DotSubtractionExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_dotSubtractionExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterDotSubtractionExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitDotSubtractionExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitDotSubtractionExpression(this); - else return visitor.visitChildren(this); - } - } - - public final DotSubtractionExpressionContext dotSubtractionExpression() throws RecognitionException { - DotSubtractionExpressionContext _localctx = new DotSubtractionExpressionContext(_ctx, getState()); - enterRule(_localctx, 72, RULE_dotSubtractionExpression); - try { - setState(355); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,35,_ctx) ) { - case 1: - enterOuterAlt(_localctx, 1); - { - setState(347); - match(IntValue); - } - break; - case 2: - enterOuterAlt(_localctx, 2); - { - setState(348); - match(Identifier); - } - break; - case 3: - enterOuterAlt(_localctx, 3); - { - setState(349); - memberAccess(); - } - break; - case 4: - enterOuterAlt(_localctx, 4); - { - setState(350); - methodCall(); - setState(351); - match(OpenRoundBracket); - setState(352); - calculationExpression(0); - setState(353); - match(ClosedRoundBracket); - } - break; - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class NonCalculationExpressionContext extends ParserRuleContext { - public UnaryExpressionContext unaryExpression() { - return getRuleContext(UnaryExpressionContext.class,0); - } - public NonCalculationOperatorContext nonCalculationOperator() { - return getRuleContext(NonCalculationOperatorContext.class,0); - } - public ExpressionContext expression() { - return getRuleContext(ExpressionContext.class,0); - } - public NonCalculationExpressionContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_nonCalculationExpression; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterNonCalculationExpression(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitNonCalculationExpression(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitNonCalculationExpression(this); - else return visitor.visitChildren(this); - } - } - - public final NonCalculationExpressionContext nonCalculationExpression() throws RecognitionException { - NonCalculationExpressionContext _localctx = new NonCalculationExpressionContext(_ctx, getState()); - enterRule(_localctx, 74, RULE_nonCalculationExpression); - try { - enterOuterAlt(_localctx, 1); - { - setState(357); - unaryExpression(); - setState(358); - nonCalculationOperator(); - setState(359); - expression(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class MethodCallContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } - public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } - public ArgumentListContext argumentList() { - return getRuleContext(ArgumentListContext.class,0); - } - public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } - public TargetContext target() { - return getRuleContext(TargetContext.class,0); - } - public List chainedMethod() { - return getRuleContexts(ChainedMethodContext.class); - } - public ChainedMethodContext chainedMethod(int i) { - return getRuleContext(ChainedMethodContext.class,i); - } - public MethodCallContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_methodCall; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterMethodCall(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitMethodCall(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitMethodCall(this); - else return visitor.visitChildren(this); - } - } - - public final MethodCallContext methodCall() throws RecognitionException { - MethodCallContext _localctx = new MethodCallContext(_ctx, getState()); - enterRule(_localctx, 76, RULE_methodCall); - try { - int _alt; - enterOuterAlt(_localctx, 1); - { - setState(362); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,36,_ctx) ) { - case 1: - { - setState(361); - target(); - } - break; - } - setState(367); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,37,_ctx); - while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { - if ( _alt==1 ) { - { - { - setState(364); - chainedMethod(); - } - } - } - setState(369); - _errHandler.sync(this); - _alt = getInterpreter().adaptivePredict(_input,37,_ctx); - } - setState(370); - match(Identifier); - setState(371); - match(OpenRoundBracket); - setState(372); - argumentList(); - setState(373); - match(ClosedRoundBracket); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class TargetContext extends ParserRuleContext { - public TerminalNode Dot() { return getToken(SimpleJavaParser.Dot, 0); } - public TerminalNode This() { return getToken(SimpleJavaParser.This, 0); } - public MemberAccessContext memberAccess() { - return getRuleContext(MemberAccessContext.class,0); - } - public NewDeclarationContext newDeclaration() { - return getRuleContext(NewDeclarationContext.class,0); - } - public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } - public TargetContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_target; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterTarget(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitTarget(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitTarget(this); - else return visitor.visitChildren(this); - } - } - - public final TargetContext target() throws RecognitionException { - TargetContext _localctx = new TargetContext(_ctx, getState()); - enterRule(_localctx, 78, RULE_target); - try { - enterOuterAlt(_localctx, 1); - { - setState(379); - _errHandler.sync(this); - switch ( getInterpreter().adaptivePredict(_input,38,_ctx) ) { - case 1: - { - setState(375); - match(This); - } - break; - case 2: - { - setState(376); - memberAccess(); - } - break; - case 3: - { - setState(377); - newDeclaration(); - } - break; - case 4: - { - setState(378); - match(Identifier); - } - break; - } - setState(381); - match(Dot); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ChainedMethodContext extends ParserRuleContext { - public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } - public TerminalNode OpenRoundBracket() { return getToken(SimpleJavaParser.OpenRoundBracket, 0); } - public ArgumentListContext argumentList() { - return getRuleContext(ArgumentListContext.class,0); - } - public TerminalNode ClosedRoundBracket() { return getToken(SimpleJavaParser.ClosedRoundBracket, 0); } - public TerminalNode Dot() { return getToken(SimpleJavaParser.Dot, 0); } - public ChainedMethodContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_chainedMethod; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterChainedMethod(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitChainedMethod(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitChainedMethod(this); - else return visitor.visitChildren(this); - } - } - - public final ChainedMethodContext chainedMethod() throws RecognitionException { - ChainedMethodContext _localctx = new ChainedMethodContext(_ctx, getState()); - enterRule(_localctx, 80, RULE_chainedMethod); - try { - enterOuterAlt(_localctx, 1); - { - setState(383); - match(Identifier); - setState(384); - match(OpenRoundBracket); - setState(385); - argumentList(); - setState(386); - match(ClosedRoundBracket); - setState(387); - match(Dot); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class TypeContext extends ParserRuleContext { - public TerminalNode Int() { return getToken(SimpleJavaParser.Int, 0); } - public TerminalNode Boolean() { return getToken(SimpleJavaParser.Boolean, 0); } - public TerminalNode Char() { return getToken(SimpleJavaParser.Char, 0); } - public TerminalNode Identifier() { return getToken(SimpleJavaParser.Identifier, 0); } - public TypeContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_type; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterType(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitType(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitType(this); - else return visitor.visitChildren(this); - } - } - - public final TypeContext type() throws RecognitionException { - TypeContext _localctx = new TypeContext(_ctx, getState()); - enterRule(_localctx, 82, RULE_type); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(389); - _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 140737488355440L) != 0)) ) { - _errHandler.recoverInline(this); - } - else { - if ( _input.LA(1)==Token.EOF ) matchedEOF = true; - _errHandler.reportMatch(this); - consume(); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class ValueContext extends ParserRuleContext { - public TerminalNode IntValue() { return getToken(SimpleJavaParser.IntValue, 0); } - public TerminalNode BooleanValue() { return getToken(SimpleJavaParser.BooleanValue, 0); } - public TerminalNode CharValue() { return getToken(SimpleJavaParser.CharValue, 0); } - public TerminalNode NullValue() { return getToken(SimpleJavaParser.NullValue, 0); } - public ValueContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_value; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterValue(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitValue(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitValue(this); - else return visitor.visitChildren(this); - } - } - - public final ValueContext value() throws RecognitionException { - ValueContext _localctx = new ValueContext(_ctx, getState()); - enterRule(_localctx, 84, RULE_value); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(391); - _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 131941395333120L) != 0)) ) { - _errHandler.recoverInline(this); - } - else { - if ( _input.LA(1)==Token.EOF ) matchedEOF = true; - _errHandler.reportMatch(this); - consume(); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - @SuppressWarnings("CheckReturnValue") - public static class NonCalculationOperatorContext extends ParserRuleContext { - public TerminalNode LogicalOperator() { return getToken(SimpleJavaParser.LogicalOperator, 0); } - public TerminalNode ComparisonOperator() { return getToken(SimpleJavaParser.ComparisonOperator, 0); } - public NonCalculationOperatorContext(ParserRuleContext parent, int invokingState) { - super(parent, invokingState); - } - @Override public int getRuleIndex() { return RULE_nonCalculationOperator; } - @Override - public void enterRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).enterNonCalculationOperator(this); - } - @Override - public void exitRule(ParseTreeListener listener) { - if ( listener instanceof SimpleJavaListener ) ((SimpleJavaListener)listener).exitNonCalculationOperator(this); - } - @Override - public T accept(ParseTreeVisitor visitor) { - if ( visitor instanceof SimpleJavaVisitor ) return ((SimpleJavaVisitor)visitor).visitNonCalculationOperator(this); - else return visitor.visitChildren(this); - } - } - - public final NonCalculationOperatorContext nonCalculationOperator() throws RecognitionException { - NonCalculationOperatorContext _localctx = new NonCalculationOperatorContext(_ctx, getState()); - enterRule(_localctx, 86, RULE_nonCalculationOperator); - int _la; - try { - enterOuterAlt(_localctx, 1); - { - setState(393); - _la = _input.LA(1); - if ( !(_la==ComparisonOperator || _la==LogicalOperator) ) { - _errHandler.recoverInline(this); - } - else { - if ( _input.LA(1)==Token.EOF ) matchedEOF = true; - _errHandler.reportMatch(this); - consume(); - } - } - } - catch (RecognitionException re) { - _localctx.exception = re; - _errHandler.reportError(this, re); - _errHandler.recover(this, re); - } - finally { - exitRule(); - } - return _localctx; - } - - public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { - switch (ruleIndex) { - case 34: - return calculationExpression_sempred((CalculationExpressionContext)_localctx, predIndex); - case 35: - return dotExpression_sempred((DotExpressionContext)_localctx, predIndex); - } - return true; - } - private boolean calculationExpression_sempred(CalculationExpressionContext _localctx, int predIndex) { - switch (predIndex) { - case 0: - return precpred(_ctx, 2); - } - return true; - } - private boolean dotExpression_sempred(DotExpressionContext _localctx, int predIndex) { - switch (predIndex) { - case 1: - return precpred(_ctx, 2); - } - return true; - } - - public static final String _serializedATN = - "\u0004\u00012\u018c\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ - "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ - "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+ - "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+ - "\f\u0007\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0002\u000f\u0007\u000f"+ - "\u0002\u0010\u0007\u0010\u0002\u0011\u0007\u0011\u0002\u0012\u0007\u0012"+ - "\u0002\u0013\u0007\u0013\u0002\u0014\u0007\u0014\u0002\u0015\u0007\u0015"+ - "\u0002\u0016\u0007\u0016\u0002\u0017\u0007\u0017\u0002\u0018\u0007\u0018"+ - "\u0002\u0019\u0007\u0019\u0002\u001a\u0007\u001a\u0002\u001b\u0007\u001b"+ - "\u0002\u001c\u0007\u001c\u0002\u001d\u0007\u001d\u0002\u001e\u0007\u001e"+ - "\u0002\u001f\u0007\u001f\u0002 \u0007 \u0002!\u0007!\u0002\"\u0007\"\u0002"+ - "#\u0007#\u0002$\u0007$\u0002%\u0007%\u0002&\u0007&\u0002\'\u0007\'\u0002"+ - "(\u0007(\u0002)\u0007)\u0002*\u0007*\u0002+\u0007+\u0001\u0000\u0004\u0000"+ - "Z\b\u0000\u000b\u0000\f\u0000[\u0001\u0001\u0003\u0001_\b\u0001\u0001"+ - "\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0005\u0001e\b\u0001\n\u0001"+ - "\f\u0001h\t\u0001\u0001\u0001\u0001\u0001\u0001\u0002\u0001\u0002\u0001"+ - "\u0002\u0003\u0002o\b\u0002\u0001\u0003\u0003\u0003r\b\u0003\u0001\u0003"+ - "\u0001\u0003\u0001\u0003\u0003\u0003w\b\u0003\u0001\u0003\u0001\u0003"+ - "\u0001\u0003\u0001\u0004\u0003\u0004}\b\u0004\u0001\u0004\u0001\u0004"+ - "\u0001\u0004\u0001\u0004\u0001\u0005\u0001\u0005\u0001\u0005\u0003\u0005"+ - "\u0086\b\u0005\u0001\u0005\u0001\u0005\u0003\u0005\u008a\b\u0005\u0001"+ - "\u0005\u0001\u0005\u0001\u0005\u0003\u0005\u008f\b\u0005\u0001\u0005\u0001"+ - "\u0005\u0003\u0005\u0093\b\u0005\u0001\u0006\u0001\u0006\u0001\u0006\u0005"+ - "\u0006\u0098\b\u0006\n\u0006\f\u0006\u009b\t\u0006\u0001\u0007\u0001\u0007"+ - "\u0001\u0007\u0001\b\u0001\b\u0001\b\u0005\b\u00a3\b\b\n\b\f\b\u00a6\t"+ - "\b\u0003\b\u00a8\b\b\u0001\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001"+ - "\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001\t\u0003\t\u00b7\b\t\u0001"+ - "\n\u0001\n\u0005\n\u00bb\b\n\n\n\f\n\u00be\t\n\u0001\n\u0001\n\u0001\u000b"+ - "\u0001\u000b\u0003\u000b\u00c4\b\u000b\u0001\f\u0001\f\u0001\f\u0001\f"+ - "\u0003\f\u00ca\b\f\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001"+ - "\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0003\u000e\u00d6\b\u000e\u0001"+ - "\u000e\u0001\u000e\u0003\u000e\u00da\b\u000e\u0001\u000e\u0001\u000e\u0003"+ - "\u000e\u00de\b\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000f\u0001"+ - "\u000f\u0005\u000f\u00e5\b\u000f\n\u000f\f\u000f\u00e8\t\u000f\u0001\u0010"+ - "\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0011"+ - "\u0001\u0011\u0001\u0011\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012"+ - "\u0003\u0012\u00f7\b\u0012\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013"+ - "\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014\u0001\u0014"+ - "\u0001\u0015\u0001\u0015\u0003\u0015\u0105\b\u0015\u0001\u0016\u0001\u0016"+ - "\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0016"+ - "\u0001\u0016\u0001\u0016\u0003\u0016\u0111\b\u0016\u0001\u0017\u0001\u0017"+ - "\u0001\u0017\u0001\u0018\u0001\u0018\u0003\u0018\u0118\b\u0018\u0001\u0019"+ - "\u0001\u0019\u0003\u0019\u011c\b\u0019\u0001\u001a\u0001\u001a\u0001\u001a"+ - "\u0001\u001b\u0001\u001b\u0001\u001b\u0001\u001c\u0001\u001c\u0003\u001c"+ - "\u0126\b\u001c\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001e\u0001\u001e"+ - "\u0001\u001e\u0001\u001f\u0001\u001f\u0003\u001f\u0130\b\u001f\u0001 "+ - "\u0001 \u0001 \u0001 \u0001 \u0003 \u0137\b \u0001 \u0001 \u0004 \u013b"+ - "\b \u000b \f \u013c\u0001 \u0003 \u0140\b \u0001!\u0001!\u0003!\u0144"+ - "\b!\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0005\"\u014c\b\""+ - "\n\"\f\"\u014f\t\"\u0001#\u0001#\u0001#\u0001#\u0001#\u0001#\u0005#\u0157"+ - "\b#\n#\f#\u015a\t#\u0001$\u0001$\u0001$\u0001$\u0001$\u0001$\u0001$\u0001"+ - "$\u0003$\u0164\b$\u0001%\u0001%\u0001%\u0001%\u0001&\u0003&\u016b\b&\u0001"+ - "&\u0005&\u016e\b&\n&\f&\u0171\t&\u0001&\u0001&\u0001&\u0001&\u0001&\u0001"+ - "\'\u0001\'\u0001\'\u0001\'\u0003\'\u017c\b\'\u0001\'\u0001\'\u0001(\u0001"+ - "(\u0001(\u0001(\u0001(\u0001(\u0001)\u0001)\u0001*\u0001*\u0001+\u0001"+ - "+\u0001+\u0000\u0002DF,\u0000\u0002\u0004\u0006\b\n\f\u000e\u0010\u0012"+ - "\u0014\u0016\u0018\u001a\u001c\u001e \"$&(*,.02468:<>@BDFHJLNPRTV\u0000"+ - "\u0003\u0002\u0000\u0004\u0006//\u0001\u0000+.\u0001\u0000\u000b\f\u0197"+ - "\u0000Y\u0001\u0000\u0000\u0000\u0002^\u0001\u0000\u0000\u0000\u0004n"+ - "\u0001\u0000\u0000\u0000\u0006q\u0001\u0000\u0000\u0000\b|\u0001\u0000"+ - "\u0000\u0000\n\u0092\u0001\u0000\u0000\u0000\f\u0094\u0001\u0000\u0000"+ - "\u0000\u000e\u009c\u0001\u0000\u0000\u0000\u0010\u00a7\u0001\u0000\u0000"+ - "\u0000\u0012\u00b6\u0001\u0000\u0000\u0000\u0014\u00b8\u0001\u0000\u0000"+ - "\u0000\u0016\u00c1\u0001\u0000\u0000\u0000\u0018\u00c5\u0001\u0000\u0000"+ - "\u0000\u001a\u00cb\u0001\u0000\u0000\u0000\u001c\u00d1\u0001\u0000\u0000"+ - "\u0000\u001e\u00e2\u0001\u0000\u0000\u0000 \u00e9\u0001\u0000\u0000\u0000"+ - "\"\u00ef\u0001\u0000\u0000\u0000$\u00f6\u0001\u0000\u0000\u0000&\u00f8"+ - "\u0001\u0000\u0000\u0000(\u00fc\u0001\u0000\u0000\u0000*\u0104\u0001\u0000"+ - "\u0000\u0000,\u0110\u0001\u0000\u0000\u0000.\u0112\u0001\u0000\u0000\u0000"+ - "0\u0117\u0001\u0000\u0000\u00002\u011b\u0001\u0000\u0000\u00004\u011d"+ - "\u0001\u0000\u0000\u00006\u0120\u0001\u0000\u0000\u00008\u0125\u0001\u0000"+ - "\u0000\u0000:\u0127\u0001\u0000\u0000\u0000<\u012a\u0001\u0000\u0000\u0000"+ - ">\u012f\u0001\u0000\u0000\u0000@\u013f\u0001\u0000\u0000\u0000B\u0143"+ - "\u0001\u0000\u0000\u0000D\u0145\u0001\u0000\u0000\u0000F\u0150\u0001\u0000"+ - "\u0000\u0000H\u0163\u0001\u0000\u0000\u0000J\u0165\u0001\u0000\u0000\u0000"+ - "L\u016a\u0001\u0000\u0000\u0000N\u017b\u0001\u0000\u0000\u0000P\u017f"+ - "\u0001\u0000\u0000\u0000R\u0185\u0001\u0000\u0000\u0000T\u0187\u0001\u0000"+ - "\u0000\u0000V\u0189\u0001\u0000\u0000\u0000XZ\u0003\u0002\u0001\u0000"+ - "YX\u0001\u0000\u0000\u0000Z[\u0001\u0000\u0000\u0000[Y\u0001\u0000\u0000"+ - "\u0000[\\\u0001\u0000\u0000\u0000\\\u0001\u0001\u0000\u0000\u0000]_\u0005"+ - "\u0007\u0000\u0000^]\u0001\u0000\u0000\u0000^_\u0001\u0000\u0000\u0000"+ - "_`\u0001\u0000\u0000\u0000`a\u0005#\u0000\u0000ab\u0005/\u0000\u0000b"+ - "f\u0005\u001f\u0000\u0000ce\u0003\u0004\u0002\u0000dc\u0001\u0000\u0000"+ - "\u0000eh\u0001\u0000\u0000\u0000fd\u0001\u0000\u0000\u0000fg\u0001\u0000"+ - "\u0000\u0000gi\u0001\u0000\u0000\u0000hf\u0001\u0000\u0000\u0000ij\u0005"+ - " \u0000\u0000j\u0003\u0001\u0000\u0000\u0000ko\u0003\u0006\u0003\u0000"+ - "lo\u0003\b\u0004\u0000mo\u0003\n\u0005\u0000nk\u0001\u0000\u0000\u0000"+ - "nl\u0001\u0000\u0000\u0000nm\u0001\u0000\u0000\u0000o\u0005\u0001\u0000"+ - "\u0000\u0000pr\u0005\u0007\u0000\u0000qp\u0001\u0000\u0000\u0000qr\u0001"+ - "\u0000\u0000\u0000rs\u0001\u0000\u0000\u0000st\u0005/\u0000\u0000tv\u0005"+ - "\u001d\u0000\u0000uw\u0003\f\u0006\u0000vu\u0001\u0000\u0000\u0000vw\u0001"+ - "\u0000\u0000\u0000wx\u0001\u0000\u0000\u0000xy\u0005\u001e\u0000\u0000"+ - "yz\u0003\u0014\n\u0000z\u0007\u0001\u0000\u0000\u0000{}\u0005\u0007\u0000"+ - "\u0000|{\u0001\u0000\u0000\u0000|}\u0001\u0000\u0000\u0000}~\u0001\u0000"+ - "\u0000\u0000~\u007f\u0003R)\u0000\u007f\u0080\u0005/\u0000\u0000\u0080"+ - "\u0081\u0005!\u0000\u0000\u0081\t\u0001\u0000\u0000\u0000\u0082\u0083"+ - "\u0005\b\u0000\u0000\u0083\u0093\u0003\u0014\n\u0000\u0084\u0086\u0005"+ - "\u0007\u0000\u0000\u0085\u0084\u0001\u0000\u0000\u0000\u0085\u0086\u0001"+ - "\u0000\u0000\u0000\u0086\u0089\u0001\u0000\u0000\u0000\u0087\u008a\u0003"+ - "R)\u0000\u0088\u008a\u0005\u0003\u0000\u0000\u0089\u0087\u0001\u0000\u0000"+ - "\u0000\u0089\u0088\u0001\u0000\u0000\u0000\u008a\u008b\u0001\u0000\u0000"+ - "\u0000\u008b\u008c\u0005/\u0000\u0000\u008c\u008e\u0005\u001d\u0000\u0000"+ - "\u008d\u008f\u0003\f\u0006\u0000\u008e\u008d\u0001\u0000\u0000\u0000\u008e"+ - "\u008f\u0001\u0000\u0000\u0000\u008f\u0090\u0001\u0000\u0000\u0000\u0090"+ - "\u0091\u0005\u001e\u0000\u0000\u0091\u0093\u0003\u0014\n\u0000\u0092\u0082"+ - "\u0001\u0000\u0000\u0000\u0092\u0085\u0001\u0000\u0000\u0000\u0093\u000b"+ - "\u0001\u0000\u0000\u0000\u0094\u0099\u0003\u000e\u0007\u0000\u0095\u0096"+ - "\u0005\"\u0000\u0000\u0096\u0098\u0003\u000e\u0007\u0000\u0097\u0095\u0001"+ - "\u0000\u0000\u0000\u0098\u009b\u0001\u0000\u0000\u0000\u0099\u0097\u0001"+ - "\u0000\u0000\u0000\u0099\u009a\u0001\u0000\u0000\u0000\u009a\r\u0001\u0000"+ - "\u0000\u0000\u009b\u0099\u0001\u0000\u0000\u0000\u009c\u009d\u0003R)\u0000"+ - "\u009d\u009e\u0005/\u0000\u0000\u009e\u000f\u0001\u0000\u0000\u0000\u009f"+ - "\u00a4\u0003*\u0015\u0000\u00a0\u00a1\u0005\"\u0000\u0000\u00a1\u00a3"+ - "\u0003*\u0015\u0000\u00a2\u00a0\u0001\u0000\u0000\u0000\u00a3\u00a6\u0001"+ - "\u0000\u0000\u0000\u00a4\u00a2\u0001\u0000\u0000\u0000\u00a4\u00a5\u0001"+ - "\u0000\u0000\u0000\u00a5\u00a8\u0001\u0000\u0000\u0000\u00a6\u00a4\u0001"+ - "\u0000\u0000\u0000\u00a7\u009f\u0001\u0000\u0000\u0000\u00a7\u00a8\u0001"+ - "\u0000\u0000\u0000\u00a8\u0011\u0001\u0000\u0000\u0000\u00a9\u00aa\u0003"+ - "\u0016\u000b\u0000\u00aa\u00ab\u0005!\u0000\u0000\u00ab\u00b7\u0001\u0000"+ - "\u0000\u0000\u00ac\u00ad\u0003\u0018\f\u0000\u00ad\u00ae\u0005!\u0000"+ - "\u0000\u00ae\u00b7\u0001\u0000\u0000\u0000\u00af\u00b7\u0003\u0014\n\u0000"+ - "\u00b0\u00b7\u0003\u001a\r\u0000\u00b1\u00b7\u0003\u001c\u000e\u0000\u00b2"+ - "\u00b7\u0003\u001e\u000f\u0000\u00b3\u00b4\u0003$\u0012\u0000\u00b4\u00b5"+ - "\u0005!\u0000\u0000\u00b5\u00b7\u0001\u0000\u0000\u0000\u00b6\u00a9\u0001"+ - "\u0000\u0000\u0000\u00b6\u00ac\u0001\u0000\u0000\u0000\u00b6\u00af\u0001"+ - "\u0000\u0000\u0000\u00b6\u00b0\u0001\u0000\u0000\u0000\u00b6\u00b1\u0001"+ - "\u0000\u0000\u0000\u00b6\u00b2\u0001\u0000\u0000\u0000\u00b6\u00b3\u0001"+ - "\u0000\u0000\u0000\u00b7\u0013\u0001\u0000\u0000\u0000\u00b8\u00bc\u0005"+ - "\u001f\u0000\u0000\u00b9\u00bb\u0003\u0012\t\u0000\u00ba\u00b9\u0001\u0000"+ - "\u0000\u0000\u00bb\u00be\u0001\u0000\u0000\u0000\u00bc\u00ba\u0001\u0000"+ - "\u0000\u0000\u00bc\u00bd\u0001\u0000\u0000\u0000\u00bd\u00bf\u0001\u0000"+ - "\u0000\u0000\u00be\u00bc\u0001\u0000\u0000\u0000\u00bf\u00c0\u0005 \u0000"+ - "\u0000\u00c0\u0015\u0001\u0000\u0000\u0000\u00c1\u00c3\u0005)\u0000\u0000"+ - "\u00c2\u00c4\u0003*\u0015\u0000\u00c3\u00c2\u0001\u0000\u0000\u0000\u00c3"+ - "\u00c4\u0001\u0000\u0000\u0000\u00c4\u0017\u0001\u0000\u0000\u0000\u00c5"+ - "\u00c6\u0003R)\u0000\u00c6\u00c9\u0005/\u0000\u0000\u00c7\u00c8\u0005"+ - "\r\u0000\u0000\u00c8\u00ca\u0003*\u0015\u0000\u00c9\u00c7\u0001\u0000"+ - "\u0000\u0000\u00c9\u00ca\u0001\u0000\u0000\u0000\u00ca\u0019\u0001\u0000"+ - "\u0000\u0000\u00cb\u00cc\u0005%\u0000\u0000\u00cc\u00cd\u0005\u001d\u0000"+ - "\u0000\u00cd\u00ce\u0003*\u0015\u0000\u00ce\u00cf\u0005\u001e\u0000\u0000"+ - "\u00cf\u00d0\u0003\u0014\n\u0000\u00d0\u001b\u0001\u0000\u0000\u0000\u00d1"+ - "\u00d2\u0005(\u0000\u0000\u00d2\u00d5\u0005\u001d\u0000\u0000\u00d3\u00d6"+ - "\u0003$\u0012\u0000\u00d4\u00d6\u0003\u0018\f\u0000\u00d5\u00d3\u0001"+ - "\u0000\u0000\u0000\u00d5\u00d4\u0001\u0000\u0000\u0000\u00d6\u00d7\u0001"+ - "\u0000\u0000\u0000\u00d7\u00d9\u0005!\u0000\u0000\u00d8\u00da\u0003*\u0015"+ - "\u0000\u00d9\u00d8\u0001\u0000\u0000\u0000\u00d9\u00da\u0001\u0000\u0000"+ - "\u0000\u00da\u00db\u0001\u0000\u0000\u0000\u00db\u00dd\u0005!\u0000\u0000"+ - "\u00dc\u00de\u0003$\u0012\u0000\u00dd\u00dc\u0001\u0000\u0000\u0000\u00dd"+ - "\u00de\u0001\u0000\u0000\u0000\u00de\u00df\u0001\u0000\u0000\u0000\u00df"+ - "\u00e0\u0005\u001e\u0000\u0000\u00e0\u00e1\u0003\u0014\n\u0000\u00e1\u001d"+ - "\u0001\u0000\u0000\u0000\u00e2\u00e6\u0003 \u0010\u0000\u00e3\u00e5\u0003"+ - "\"\u0011\u0000\u00e4\u00e3\u0001\u0000\u0000\u0000\u00e5\u00e8\u0001\u0000"+ - "\u0000\u0000\u00e6\u00e4\u0001\u0000\u0000\u0000\u00e6\u00e7\u0001\u0000"+ - "\u0000\u0000\u00e7\u001f\u0001\u0000\u0000\u0000\u00e8\u00e6\u0001\u0000"+ - "\u0000\u0000\u00e9\u00ea\u0005&\u0000\u0000\u00ea\u00eb\u0005\u001d\u0000"+ - "\u0000\u00eb\u00ec\u0003*\u0015\u0000\u00ec\u00ed\u0005\u001e\u0000\u0000"+ - "\u00ed\u00ee\u0003\u0014\n\u0000\u00ee!\u0001\u0000\u0000\u0000\u00ef"+ - "\u00f0\u0005\'\u0000\u0000\u00f0\u00f1\u0003\u0014\n\u0000\u00f1#\u0001"+ - "\u0000\u0000\u0000\u00f2\u00f7\u0003&\u0013\u0000\u00f3\u00f7\u0003(\u0014"+ - "\u0000\u00f4\u00f7\u0003L&\u0000\u00f5\u00f7\u00030\u0018\u0000\u00f6"+ - "\u00f2\u0001\u0000\u0000\u0000\u00f6\u00f3\u0001\u0000\u0000\u0000\u00f6"+ - "\u00f4\u0001\u0000\u0000\u0000\u00f6\u00f5\u0001\u0000\u0000\u0000\u00f7"+ - "%\u0001\u0000\u0000\u0000\u00f8\u00f9\u0003>\u001f\u0000\u00f9\u00fa\u0005"+ - "\r\u0000\u0000\u00fa\u00fb\u0003*\u0015\u0000\u00fb\'\u0001\u0000\u0000"+ - "\u0000\u00fc\u00fd\u0005*\u0000\u0000\u00fd\u00fe\u0005/\u0000\u0000\u00fe"+ - "\u00ff\u0005\u001d\u0000\u0000\u00ff\u0100\u0003\u0010\b\u0000\u0100\u0101"+ - "\u0005\u001e\u0000\u0000\u0101)\u0001\u0000\u0000\u0000\u0102\u0105\u0003"+ - ",\u0016\u0000\u0103\u0105\u0003B!\u0000\u0104\u0102\u0001\u0000\u0000"+ - "\u0000\u0104\u0103\u0001\u0000\u0000\u0000\u0105+\u0001\u0000\u0000\u0000"+ - "\u0106\u0111\u0005$\u0000\u0000\u0107\u0111\u0005/\u0000\u0000\u0108\u0111"+ - "\u0003@ \u0000\u0109\u0111\u0003T*\u0000\u010a\u0111\u0003.\u0017\u0000"+ - "\u010b\u0111\u0003$\u0012\u0000\u010c\u010d\u0005\u001d\u0000\u0000\u010d"+ - "\u010e\u0003*\u0015\u0000\u010e\u010f\u0005\u001e\u0000\u0000\u010f\u0111"+ - "\u0001\u0000\u0000\u0000\u0110\u0106\u0001\u0000\u0000\u0000\u0110\u0107"+ - "\u0001\u0000\u0000\u0000\u0110\u0108\u0001\u0000\u0000\u0000\u0110\u0109"+ - "\u0001\u0000\u0000\u0000\u0110\u010a\u0001\u0000\u0000\u0000\u0110\u010b"+ - "\u0001\u0000\u0000\u0000\u0110\u010c\u0001\u0000\u0000\u0000\u0111-\u0001"+ - "\u0000\u0000\u0000\u0112\u0113\u0005\u0019\u0000\u0000\u0113\u0114\u0003"+ - "*\u0015\u0000\u0114/\u0001\u0000\u0000\u0000\u0115\u0118\u00032\u0019"+ - "\u0000\u0116\u0118\u00038\u001c\u0000\u0117\u0115\u0001\u0000\u0000\u0000"+ - "\u0117\u0116\u0001\u0000\u0000\u0000\u01181\u0001\u0000\u0000\u0000\u0119"+ - "\u011c\u00034\u001a\u0000\u011a\u011c\u00036\u001b\u0000\u011b\u0119\u0001"+ - "\u0000\u0000\u0000\u011b\u011a\u0001\u0000\u0000\u0000\u011c3\u0001\u0000"+ - "\u0000\u0000\u011d\u011e\u0005\u0001\u0000\u0000\u011e\u011f\u0003>\u001f"+ - "\u0000\u011f5\u0001\u0000\u0000\u0000\u0120\u0121\u0003>\u001f\u0000\u0121"+ - "\u0122\u0005\u0001\u0000\u0000\u01227\u0001\u0000\u0000\u0000\u0123\u0126"+ - "\u0003:\u001d\u0000\u0124\u0126\u0003<\u001e\u0000\u0125\u0123\u0001\u0000"+ - "\u0000\u0000\u0125\u0124\u0001\u0000\u0000\u0000\u01269\u0001\u0000\u0000"+ - "\u0000\u0127\u0128\u0005\u0002\u0000\u0000\u0128\u0129\u0003>\u001f\u0000"+ - "\u0129;\u0001\u0000\u0000\u0000\u012a\u012b\u0003>\u001f\u0000\u012b\u012c"+ - "\u0005\u0002\u0000\u0000\u012c=\u0001\u0000\u0000\u0000\u012d\u0130\u0005"+ - "/\u0000\u0000\u012e\u0130\u0003@ \u0000\u012f\u012d\u0001\u0000\u0000"+ - "\u0000\u012f\u012e\u0001\u0000\u0000\u0000\u0130?\u0001\u0000\u0000\u0000"+ - "\u0131\u0132\u0005$\u0000\u0000\u0132\u0133\u0005\u001c\u0000\u0000\u0133"+ - "\u0140\u0005/\u0000\u0000\u0134\u0135\u0005$\u0000\u0000\u0135\u0137\u0005"+ - "\u001c\u0000\u0000\u0136\u0134\u0001\u0000\u0000\u0000\u0136\u0137\u0001"+ - "\u0000\u0000\u0000\u0137\u013a\u0001\u0000\u0000\u0000\u0138\u0139\u0005"+ - "/\u0000\u0000\u0139\u013b\u0005\u001c\u0000\u0000\u013a\u0138\u0001\u0000"+ - "\u0000\u0000\u013b\u013c\u0001\u0000\u0000\u0000\u013c\u013a\u0001\u0000"+ - "\u0000\u0000\u013c\u013d\u0001\u0000\u0000\u0000\u013d\u013e\u0001\u0000"+ - "\u0000\u0000\u013e\u0140\u0005/\u0000\u0000\u013f\u0131\u0001\u0000\u0000"+ - "\u0000\u013f\u0136\u0001\u0000\u0000\u0000\u0140A\u0001\u0000\u0000\u0000"+ - "\u0141\u0144\u0003D\"\u0000\u0142\u0144\u0003J%\u0000\u0143\u0141\u0001"+ - "\u0000\u0000\u0000\u0143\u0142\u0001\u0000\u0000\u0000\u0144C\u0001\u0000"+ - "\u0000\u0000\u0145\u0146\u0006\"\uffff\uffff\u0000\u0146\u0147\u0003F"+ - "#\u0000\u0147\u014d\u0001\u0000\u0000\u0000\u0148\u0149\n\u0002\u0000"+ - "\u0000\u0149\u014a\u0005\n\u0000\u0000\u014a\u014c\u0003F#\u0000\u014b"+ - "\u0148\u0001\u0000\u0000\u0000\u014c\u014f\u0001\u0000\u0000\u0000\u014d"+ - "\u014b\u0001\u0000\u0000\u0000\u014d\u014e\u0001\u0000\u0000\u0000\u014e"+ - "E\u0001\u0000\u0000\u0000\u014f\u014d\u0001\u0000\u0000\u0000\u0150\u0151"+ - "\u0006#\uffff\uffff\u0000\u0151\u0152\u0003H$\u0000\u0152\u0158\u0001"+ - "\u0000\u0000\u0000\u0153\u0154\n\u0002\u0000\u0000\u0154\u0155\u0005\t"+ - "\u0000\u0000\u0155\u0157\u0003H$\u0000\u0156\u0153\u0001\u0000\u0000\u0000"+ - "\u0157\u015a\u0001\u0000\u0000\u0000\u0158\u0156\u0001\u0000\u0000\u0000"+ - "\u0158\u0159\u0001\u0000\u0000\u0000\u0159G\u0001\u0000\u0000\u0000\u015a"+ - "\u0158\u0001\u0000\u0000\u0000\u015b\u0164\u0005,\u0000\u0000\u015c\u0164"+ - "\u0005/\u0000\u0000\u015d\u0164\u0003@ \u0000\u015e\u015f\u0003L&\u0000"+ - "\u015f\u0160\u0005\u001d\u0000\u0000\u0160\u0161\u0003D\"\u0000\u0161"+ - "\u0162\u0005\u001e\u0000\u0000\u0162\u0164\u0001\u0000\u0000\u0000\u0163"+ - "\u015b\u0001\u0000\u0000\u0000\u0163\u015c\u0001\u0000\u0000\u0000\u0163"+ - "\u015d\u0001\u0000\u0000\u0000\u0163\u015e\u0001\u0000\u0000\u0000\u0164"+ - "I\u0001\u0000\u0000\u0000\u0165\u0166\u0003,\u0016\u0000\u0166\u0167\u0003"+ - "V+\u0000\u0167\u0168\u0003*\u0015\u0000\u0168K\u0001\u0000\u0000\u0000"+ - "\u0169\u016b\u0003N\'\u0000\u016a\u0169\u0001\u0000\u0000\u0000\u016a"+ - "\u016b\u0001\u0000\u0000\u0000\u016b\u016f\u0001\u0000\u0000\u0000\u016c"+ - "\u016e\u0003P(\u0000\u016d\u016c\u0001\u0000\u0000\u0000\u016e\u0171\u0001"+ - "\u0000\u0000\u0000\u016f\u016d\u0001\u0000\u0000\u0000\u016f\u0170\u0001"+ - "\u0000\u0000\u0000\u0170\u0172\u0001\u0000\u0000\u0000\u0171\u016f\u0001"+ - "\u0000\u0000\u0000\u0172\u0173\u0005/\u0000\u0000\u0173\u0174\u0005\u001d"+ - "\u0000\u0000\u0174\u0175\u0003\u0010\b\u0000\u0175\u0176\u0005\u001e\u0000"+ - "\u0000\u0176M\u0001\u0000\u0000\u0000\u0177\u017c\u0005$\u0000\u0000\u0178"+ - "\u017c\u0003@ \u0000\u0179\u017c\u0003(\u0014\u0000\u017a\u017c\u0005"+ - "/\u0000\u0000\u017b\u0177\u0001\u0000\u0000\u0000\u017b\u0178\u0001\u0000"+ - "\u0000\u0000\u017b\u0179\u0001\u0000\u0000\u0000\u017b\u017a\u0001\u0000"+ - "\u0000\u0000\u017c\u017d\u0001\u0000\u0000\u0000\u017d\u017e\u0005\u001c"+ - "\u0000\u0000\u017eO\u0001\u0000\u0000\u0000\u017f\u0180\u0005/\u0000\u0000"+ - "\u0180\u0181\u0005\u001d\u0000\u0000\u0181\u0182\u0003\u0010\b\u0000\u0182"+ - "\u0183\u0005\u001e\u0000\u0000\u0183\u0184\u0005\u001c\u0000\u0000\u0184"+ - "Q\u0001\u0000\u0000\u0000\u0185\u0186\u0007\u0000\u0000\u0000\u0186S\u0001"+ - "\u0000\u0000\u0000\u0187\u0188\u0007\u0001\u0000\u0000\u0188U\u0001\u0000"+ - "\u0000\u0000\u0189\u018a\u0007\u0002\u0000\u0000\u018aW\u0001\u0000\u0000"+ - "\u0000\'[^fnqv|\u0085\u0089\u008e\u0092\u0099\u00a4\u00a7\u00b6\u00bc"+ - "\u00c3\u00c9\u00d5\u00d9\u00dd\u00e6\u00f6\u0104\u0110\u0117\u011b\u0125"+ - "\u012f\u0136\u013c\u013f\u0143\u014d\u0158\u0163\u016a\u016f\u017b"; - public static final ATN _ATN = - new ATNDeserializer().deserialize(_serializedATN.toCharArray()); - static { - _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; - for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { - _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); - } - } -} \ No newline at end of file diff --git a/src/main/java/parser/generated/SimpleJavaVisitor.java b/src/main/java/parser/generated/SimpleJavaVisitor.java deleted file mode 100644 index 3b31f92..0000000 --- a/src/main/java/parser/generated/SimpleJavaVisitor.java +++ /dev/null @@ -1,277 +0,0 @@ -// Generated from C:/Users/Maxi/Documents/DHBW/Compilerbau/NichtHaskell2.0/src/main/java/parser/grammar/SimpleJava.g4 by ANTLR 4.13.1 -package parser.generated; -import org.antlr.v4.runtime.tree.ParseTreeVisitor; - -/** - * This interface defines a complete generic visitor for a parse tree produced - * by {@link SimpleJavaParser}. - * - * @param The return type of the visit operation. Use {@link Void} for - * operations with no return type. - */ -public interface SimpleJavaVisitor extends ParseTreeVisitor { - /** - * Visit a parse tree produced by {@link SimpleJavaParser#program}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitProgram(SimpleJavaParser.ProgramContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#classDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitClassDeclaration(SimpleJavaParser.ClassDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#memberDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitMemberDeclaration(SimpleJavaParser.MemberDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#constructorDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitConstructorDeclaration(SimpleJavaParser.ConstructorDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#fieldDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitFieldDeclaration(SimpleJavaParser.FieldDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#methodDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitMethodDeclaration(SimpleJavaParser.MethodDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#parameterList}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitParameterList(SimpleJavaParser.ParameterListContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#parameter}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitParameter(SimpleJavaParser.ParameterContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#argumentList}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitArgumentList(SimpleJavaParser.ArgumentListContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#statement}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitStatement(SimpleJavaParser.StatementContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#block}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitBlock(SimpleJavaParser.BlockContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#returnStatement}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitReturnStatement(SimpleJavaParser.ReturnStatementContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#localVariableDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitLocalVariableDeclaration(SimpleJavaParser.LocalVariableDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#whileStatement}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitWhileStatement(SimpleJavaParser.WhileStatementContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#forStatement}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitForStatement(SimpleJavaParser.ForStatementContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#ifElseStatement}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitIfElseStatement(SimpleJavaParser.IfElseStatementContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#ifStatement}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitIfStatement(SimpleJavaParser.IfStatementContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#elseStatement}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitElseStatement(SimpleJavaParser.ElseStatementContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#statementExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitStatementExpression(SimpleJavaParser.StatementExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#assign}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitAssign(SimpleJavaParser.AssignContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#newDeclaration}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitNewDeclaration(SimpleJavaParser.NewDeclarationContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#expression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitExpression(SimpleJavaParser.ExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#unaryExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitUnaryExpression(SimpleJavaParser.UnaryExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#notExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitNotExpression(SimpleJavaParser.NotExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#crementExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitCrementExpression(SimpleJavaParser.CrementExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#incrementExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitIncrementExpression(SimpleJavaParser.IncrementExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#prefixIncrementExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitPrefixIncrementExpression(SimpleJavaParser.PrefixIncrementExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#suffixIncrementExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitSuffixIncrementExpression(SimpleJavaParser.SuffixIncrementExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#decrementExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitDecrementExpression(SimpleJavaParser.DecrementExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#prefixDecrementExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitPrefixDecrementExpression(SimpleJavaParser.PrefixDecrementExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#suffixDecrementExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitSuffixDecrementExpression(SimpleJavaParser.SuffixDecrementExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#assignableExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitAssignableExpression(SimpleJavaParser.AssignableExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#memberAccess}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitMemberAccess(SimpleJavaParser.MemberAccessContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#binaryExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitBinaryExpression(SimpleJavaParser.BinaryExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#calculationExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitCalculationExpression(SimpleJavaParser.CalculationExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#dotExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitDotExpression(SimpleJavaParser.DotExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#dotSubtractionExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitDotSubtractionExpression(SimpleJavaParser.DotSubtractionExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#nonCalculationExpression}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitNonCalculationExpression(SimpleJavaParser.NonCalculationExpressionContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#methodCall}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitMethodCall(SimpleJavaParser.MethodCallContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#target}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitTarget(SimpleJavaParser.TargetContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#chainedMethod}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitChainedMethod(SimpleJavaParser.ChainedMethodContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#type}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitType(SimpleJavaParser.TypeContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#value}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitValue(SimpleJavaParser.ValueContext ctx); - /** - * Visit a parse tree produced by {@link SimpleJavaParser#nonCalculationOperator}. - * @param ctx the parse tree - * @return the visitor result - */ - T visitNonCalculationOperator(SimpleJavaParser.NonCalculationOperatorContext ctx); -} \ No newline at end of file diff --git a/src/main/java/semantic/SemanticAnalyzer.java b/src/main/java/semantic/SemanticAnalyzer.java index 191e3a9..87fcd33 100644 --- a/src/main/java/semantic/SemanticAnalyzer.java +++ b/src/main/java/semantic/SemanticAnalyzer.java @@ -7,22 +7,13 @@ import java.util.List; import java.util.Objects; import ast.*; -import ast.block.BlockNode; -import ast.expression.IExpressionNode; -import ast.expression.binaryexpression.*; -import ast.expression.unaryexpression.UnaryExpressionNode; -import ast.member.*; -import ast.parameter.ParameterNode; -import ast.statement.*; -import ast.statement.ifstatement.ElseStatementNode; -import ast.statement.ifstatement.IfElseStatementNode; -import ast.statement.ifstatement.IfStatementNode; -import ast.statement.statementexpression.AssignStatementExpressionNode; -import ast.statement.statementexpression.AssignableExpressionNode; -import ast.statement.statementexpression.NewDeclarationStatementExpressionNode; -import ast.statement.statementexpression.crementExpression.DecrementExpressionNode; -import ast.statement.statementexpression.crementExpression.IncrementExpressionNode; -import ast.statement.statementexpression.methodcallstatementnexpression.MethodCallStatementExpressionNode; +import ast.expressions.IExpressionNode; +import ast.expressions.binaryexpressions.*; +import ast.expressions.unaryexpressions.UnaryNode; +import ast.members.*; +import ast.parameters.ParameterNode; +import ast.statementexpressions.AssignableNode; +import ast.statements.*; import ast.type.type.*; import semantic.context.Context; import semantic.exeptions.*; @@ -174,19 +165,19 @@ public class SemanticAnalyzer implements SemanticVisitor { } @Override - public TypeCheckResult analyze(IfStatementNode toCheck) { + public TypeCheckResult analyze(IfNode toCheck) { return null; } @Override - public TypeCheckResult analyze(ReturnStatementNode toCheck) { + public TypeCheckResult analyze(ReturnNode toCheck) { var result = toCheck.expression.accept(this); return new TypeCheckResult(true, result.getType()); } @Override - public TypeCheckResult analyze(WhileStatementNode toCheck) { + public TypeCheckResult analyze(WhileNode toCheck) { return null; } @@ -198,9 +189,9 @@ public class SemanticAnalyzer implements SemanticVisitor { } @Override - public TypeCheckResult analyze(BlockNode blockNode) { + public TypeCheckResult analyze(BlockNode blockStatementNode) { ITypeNode blockReturnType = null; - for (IStatementNode statementNode : blockNode.statements) { + for (IStatementNode statementNode : blockStatementNode.statements) { var result = statementNode.accept(this); if(result.getType() != null){ if(blockReturnType == null){ @@ -214,18 +205,18 @@ public class SemanticAnalyzer implements SemanticVisitor { } @Override - public TypeCheckResult analyze(AssignableExpressionNode toCheck) { + public TypeCheckResult analyze(AssignableNode toCheck) { return new TypeCheckResult(true, currentFields.get(toCheck.identifier)); } @Override - public TypeCheckResult analyze(ElseStatementNode toCheck) { + public TypeCheckResult analyze(ElseNode toCheck) { return null; } @Override - public TypeCheckResult analyze(ForStatementNode toCheck) { + public TypeCheckResult analyze(ForNode toCheck) { return null; } @@ -274,12 +265,12 @@ public class SemanticAnalyzer implements SemanticVisitor { } @Override - public TypeCheckResult analyze(IfElseStatementNode toCheck) { + public TypeCheckResult analyze(IfElseNode toCheck) { return null; } @Override - public TypeCheckResult analyze(MethodCallStatementExpressionNode toCheck) { + public TypeCheckResult analyze(ast.statements.statementexpression.methodcallstatementnexpression.MethodCallStatementNode toCheck) { return null; } @@ -321,12 +312,12 @@ public class SemanticAnalyzer implements SemanticVisitor { } @Override - public TypeCheckResult analyze(BinaryExpressionNode toCheck) { + public TypeCheckResult analyze(BinaryNode toCheck) { return null; } @Override - public TypeCheckResult analyze(CalculationExpressionNode calcNode) { + public TypeCheckResult analyze(CalculationNode calcNode) { if (calcNode.calculationExpression != null) { calcNode.calculationExpression.accept(this); } @@ -334,22 +325,22 @@ public class SemanticAnalyzer implements SemanticVisitor { } @Override - public TypeCheckResult analyze(DotExpressionNode toCheck) { + public TypeCheckResult analyze(DotNode toCheck) { return null; } @Override - public TypeCheckResult analyze(DotSubstractionExpressionNode toCheck) { + public TypeCheckResult analyze(DotSubstractionNode toCheck) { return null; } @Override - public TypeCheckResult analyze(NonCalculationExpressionNode toCheck) { + public TypeCheckResult analyze(NonCalculationNode toCheck) { return null; } @Override - public TypeCheckResult analyze(UnaryExpressionNode unary) { + public TypeCheckResult analyze(UnaryNode unary) { var valid = true; if (currentScope.contains(unary.identifier)) { diff --git a/src/main/java/semantic/SemanticVisitor.java b/src/main/java/semantic/SemanticVisitor.java index 6b6942f..9104de0 100644 --- a/src/main/java/semantic/SemanticVisitor.java +++ b/src/main/java/semantic/SemanticVisitor.java @@ -2,19 +2,17 @@ package semantic; import ast.*; -import ast.block.BlockNode; -import ast.expression.binaryexpression.*; -import ast.expression.unaryexpression.UnaryExpressionNode; -import ast.member.*; -import ast.parameter.ParameterNode; -import ast.statement.*; -import ast.statement.ifstatement.*; -import ast.statement.statementexpression.AssignStatementExpressionNode; -import ast.statement.statementexpression.AssignableExpressionNode; -import ast.statement.statementexpression.NewDeclarationStatementExpressionNode; -import ast.statement.statementexpression.crementExpression.DecrementExpressionNode; -import ast.statement.statementexpression.crementExpression.IncrementExpressionNode; -import ast.statement.statementexpression.methodcallstatementnexpression.MethodCallStatementExpressionNode; +import ast.expressions.binaryexpressions.*; +import ast.expressions.unaryexpressions.UnaryNode; +import ast.members.*; +import ast.parameters.ParameterNode; +import ast.statements.*; +import ast.statements.ifstatement.*; +import ast.statements.statementexpression.AssignStatementExpressionNode; +import ast.statements.statementexpression.AssignableExpressionNode; +import ast.statements.statementexpression.NewDeclarationStatementExpressionNode; +import ast.statements.statementexpression.crementExpression.DecrementExpressionNode; +import ast.statements.statementexpression.crementExpression.IncrementExpressionNode; import typechecker.TypeCheckResult; public interface SemanticVisitor { @@ -27,19 +25,19 @@ public interface SemanticVisitor { TypeCheckResult analyze(FieldNode toCheck); - TypeCheckResult analyze(IfStatementNode toCheck); + TypeCheckResult analyze(IfNode toCheck); - TypeCheckResult analyze(ReturnStatementNode toCheck); + TypeCheckResult analyze(ReturnNode toCheck); - TypeCheckResult analyze(WhileStatementNode toCheck); + TypeCheckResult analyze(WhileNode toCheck); TypeCheckResult analyze(ParameterNode toCheck); - TypeCheckResult analyze(BlockNode toCheck); + TypeCheckResult analyze(ast.block.BlockStatementNode toCheck); TypeCheckResult analyze(AssignableExpressionNode toCheck); - TypeCheckResult analyze(ElseStatementNode toCheck); + TypeCheckResult analyze(ElseNode toCheck); TypeCheckResult analyze(ForStatementNode toCheck); @@ -47,9 +45,9 @@ public interface SemanticVisitor { TypeCheckResult analyze(DecrementExpressionNode toCheck); - TypeCheckResult analyze(IfElseStatementNode toCheck); + TypeCheckResult analyze(IfElseNode toCheck); - TypeCheckResult analyze(MethodCallStatementExpressionNode toCheck); + TypeCheckResult analyze(ast.statements.statementexpression.methodcallstatementnexpression.MethodCallStatementNode toCheck); TypeCheckResult analyze(LocalVariableDeclarationNode toCheck); @@ -57,16 +55,16 @@ public interface SemanticVisitor { TypeCheckResult analyze(IncrementExpressionNode toCheck); - TypeCheckResult analyze(BinaryExpressionNode toCheck); + TypeCheckResult analyze(BinaryNode toCheck); - TypeCheckResult analyze(CalculationExpressionNode toCheck); + TypeCheckResult analyze(CalculationNode toCheck); - TypeCheckResult analyze(DotExpressionNode toCheck); + TypeCheckResult analyze(DotNode toCheck); - TypeCheckResult analyze(DotSubstractionExpressionNode toCheck); + TypeCheckResult analyze(DotSubstractionNode toCheck); - TypeCheckResult analyze(NonCalculationExpressionNode toCheck); + TypeCheckResult analyze(NonCalculationNode toCheck); - TypeCheckResult analyze(UnaryExpressionNode toCheck); + TypeCheckResult analyze(UnaryNode toCheck); } \ No newline at end of file diff --git a/src/main/java/semantic/context/ClassContext.java b/src/main/java/semantic/context/ClassContext.java index 982866f..1a79fc4 100644 --- a/src/main/java/semantic/context/ClassContext.java +++ b/src/main/java/semantic/context/ClassContext.java @@ -1,7 +1,7 @@ package semantic.context; import ast.ClassNode; -import ast.member.FieldNode; +import ast.members.FieldNode; import java.util.HashMap; public class ClassContext { diff --git a/src/main/java/semantic/context/FieldContext.java b/src/main/java/semantic/context/FieldContext.java index 18e8cf7..8443520 100644 --- a/src/main/java/semantic/context/FieldContext.java +++ b/src/main/java/semantic/context/FieldContext.java @@ -1,6 +1,6 @@ package semantic.context; -import ast.member.FieldNode; +import ast.members.FieldNode; import ast.type.*; import ast.type.type.*; diff --git a/src/test/java/semantic/Mocker.java b/src/test/java/semantic/Mocker.java index 1e404af..f061efa 100644 --- a/src/test/java/semantic/Mocker.java +++ b/src/test/java/semantic/Mocker.java @@ -1,10 +1,9 @@ package semantic; import ast.*; -import ast.block.BlockNode; -import ast.member.FieldNode; -import ast.member.MethodNode; -import ast.parameter.ParameterNode; +import ast.members.FieldNode; +import ast.members.MethodNode; +import ast.parameters.ParameterNode; import ast.type.AccessModifierNode; import ast.type.type.*; @@ -43,7 +42,7 @@ public class Mocker { //Statements //Block - methodNode.block = new BlockNode(); + methodNode.block = new ast.block.BlockStatementNode(); c.members.add(methodNode); @@ -58,7 +57,7 @@ public class Mocker { ClassNode c = new ClassNode(); MethodNode methodNode = new MethodNode(); - methodNode.block = new BlockNode(); + methodNode.block = new ast.block.BlockStatementNode(); methodNode.setType(new BaseType(TypeEnum.INT)); methodNode.setIdentifier("testMethod"); @@ -66,7 +65,7 @@ public class Mocker { c.members.add(methodNode); MethodNode methodNode1 = new MethodNode(); - methodNode1.block = new BlockNode(); + methodNode1.block = new ast.block.BlockStatementNode(); methodNode1.setType(new BaseType(TypeEnum.INT)); methodNode1.setIdentifier("testMethod"); @@ -84,13 +83,13 @@ public class Mocker { ClassNode c = new ClassNode(); MethodNode methodNode = new MethodNode(); - methodNode.block = new BlockNode(); + methodNode.block = new ast.block.BlockStatementNode(); methodNode.setIdentifier("testMethod"); c.members.add(methodNode); MethodNode methodNode1 = new MethodNode(); - methodNode1.block = new BlockNode(); + methodNode1.block = new ast.block.BlockStatementNode(); methodNode1.setIdentifier("testMethod1"); c.members.add(methodNode1); From b562a789a04d23a611406f3bb3a9ab65dc42fe36 Mon Sep 17 00:00:00 2001 From: i22035 Date: Tue, 25 Jun 2024 22:35:28 +0200 Subject: [PATCH 4/6] Fixed Merge Conflicts and Bugs --- .../java/ast/members/ConstructorNode.java | 6 +-- .../crementexpressions/DecrementNode.java | 1 + .../crementexpressions/IncrementNode.java | 1 + .../MethodCallNode.java | 6 +-- src/main/java/ast/statements/BlockNode.java | 3 ++ .../java/parser/astBuilder/ASTBuilder.java | 47 ++++++++++++++++--- src/main/java/semantic/SemanticAnalyzer.java | 4 +- src/main/java/semantic/SemanticVisitor.java | 2 +- src/test/java/semantic/Mocker.java | 10 ++-- src/test/java/semantic/SemanticTest.java | 8 ++-- 10 files changed, 64 insertions(+), 24 deletions(-) diff --git a/src/main/java/ast/members/ConstructorNode.java b/src/main/java/ast/members/ConstructorNode.java index 0030ae2..a70ac85 100644 --- a/src/main/java/ast/members/ConstructorNode.java +++ b/src/main/java/ast/members/ConstructorNode.java @@ -11,17 +11,17 @@ public class ConstructorNode extends MethodNode { public AccessModifierNode accessType; public String identifier; public List parameters = new ArrayList<>(); - public BlockNode body; + public BlockNode block; public ConstructorNode(AccessModifierNode accessType, String identifier) { this.accessType = accessType; this.identifier = identifier; } - public ConstructorNode(String accessType, String identifier, BlockNode body) { + public ConstructorNode(String accessType, String identifier, BlockNode block) { this.accessType = new AccessModifierNode(accessType); this.identifier = identifier; - this.body = body; + this.block = block; } public void addParameter(ParameterNode parameterNode) { diff --git a/src/main/java/ast/statementexpressions/crementexpressions/DecrementNode.java b/src/main/java/ast/statementexpressions/crementexpressions/DecrementNode.java index 48cb82c..86adfce 100644 --- a/src/main/java/ast/statementexpressions/crementexpressions/DecrementNode.java +++ b/src/main/java/ast/statementexpressions/crementexpressions/DecrementNode.java @@ -10,6 +10,7 @@ public class DecrementNode implements IStatementExpressionNode { public AssignableNode assignableExpression; public DecrementNode(CrementType crementType, AssignableNode assignableExpression) { + this.crementType = crementType; this.assignableExpression = assignableExpression; } diff --git a/src/main/java/ast/statementexpressions/crementexpressions/IncrementNode.java b/src/main/java/ast/statementexpressions/crementexpressions/IncrementNode.java index f283db4..e826824 100644 --- a/src/main/java/ast/statementexpressions/crementexpressions/IncrementNode.java +++ b/src/main/java/ast/statementexpressions/crementexpressions/IncrementNode.java @@ -10,6 +10,7 @@ public class IncrementNode implements IStatementExpressionNode { public AssignableNode assignableExpression; public IncrementNode(CrementType crementType, AssignableNode assignableExpression) { + this.crementType = crementType; this.assignableExpression = assignableExpression; } diff --git a/src/main/java/ast/statementexpressions/methodcallstatementnexpressions/MethodCallNode.java b/src/main/java/ast/statementexpressions/methodcallstatementnexpressions/MethodCallNode.java index 5228ed2..b8b7bd3 100644 --- a/src/main/java/ast/statementexpressions/methodcallstatementnexpressions/MethodCallNode.java +++ b/src/main/java/ast/statementexpressions/methodcallstatementnexpressions/MethodCallNode.java @@ -12,7 +12,7 @@ public class MethodCallNode implements IStatementNode { public TargetNode target; public List chainedMethods = new ArrayList<>(); public String identifier; - public List expressions = new ArrayList<>(); + public List parameters = new ArrayList<>(); public MethodCallNode(TargetNode target, String identifier) { this.target = target; @@ -23,8 +23,8 @@ public class MethodCallNode implements IStatementNode { chainedMethods.add(chainedMethode); } - public void addExpression(IExpressionNode expression) { - expressions.add(expression); + public void addExpression(IExpressionNode parameter) { + parameters.add(parameter); } @Override diff --git a/src/main/java/ast/statements/BlockNode.java b/src/main/java/ast/statements/BlockNode.java index 9790f8d..ca14404 100644 --- a/src/main/java/ast/statements/BlockNode.java +++ b/src/main/java/ast/statements/BlockNode.java @@ -16,6 +16,9 @@ public class BlockNode implements ASTNode, Visitable { public void addStatement(IStatementNode statement) { statements.add(statement); + if(statement instanceof ReturnNode) { + hasReturnStatement = true; + } } @Override diff --git a/src/main/java/parser/astBuilder/ASTBuilder.java b/src/main/java/parser/astBuilder/ASTBuilder.java index bb1ba6c..224b59d 100644 --- a/src/main/java/parser/astBuilder/ASTBuilder.java +++ b/src/main/java/parser/astBuilder/ASTBuilder.java @@ -10,8 +10,7 @@ import ast.expressions.binaryexpressions.NonCalculationNode; import ast.expressions.unaryexpressions.MemberAccessNode; import ast.expressions.unaryexpressions.NotNode; import ast.expressions.unaryexpressions.UnaryNode; -import ast.members.ConstructorNode; -import ast.members.MemberNode; +import ast.members.*; import ast.parameters.ParameterNode; import ast.statementexpressions.AssignNode; import ast.statementexpressions.AssignableNode; @@ -23,6 +22,7 @@ import ast.statementexpressions.methodcallstatementnexpressions.ChainedMethodNod import ast.statementexpressions.methodcallstatementnexpressions.MethodCallNode; import ast.statementexpressions.methodcallstatementnexpressions.TargetNode; import ast.statements.*; +import ast.type.AccessModifierNode; import ast.type.type.*; import ast.type.EnumValueNode; import ast.type.ValueNode; @@ -55,15 +55,47 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { @Override public ASTNode visitConstructorDeclaration(SimpleJavaParser.ConstructorDeclarationContext ctx) { ConstructorNode constructorNode = new ConstructorNode(ctx.AccessModifier().getText(), ctx.Identifier().getText(), (BlockNode) visit(ctx.blockStatement())); - for(SimpleJavaParser.ParameterContext parameter : ctx.parameterList().parameter()) { - constructorNode.addParameter((ParameterNode) visit(parameter)); + if(ctx.parameterList() != null) { + for(SimpleJavaParser.ParameterContext parameter : ctx.parameterList().parameter()) { + constructorNode.addParameter((ParameterNode) visit(parameter)); + } } return constructorNode; } + @Override + public ASTNode visitMethodDeclaration(SimpleJavaParser.MethodDeclarationContext ctx) { + if(ctx.MainMethodDeclaration() != null) { + return new MainMethodNode((BlockNode) visit(ctx.blockStatement())); + } else { + if(ctx.type() != null) { + MethodNode methodNode = new MethodNode(ctx.AccessModifier().getText(), createTypeNode(ctx.type().getText()), false, ctx.Identifier().getText(), (BlockNode) visit(ctx.blockStatement())); + if(ctx.parameterList() != null) { + for(SimpleJavaParser.ParameterContext parameter : ctx.parameterList().parameter()) { + methodNode.addParameter((ParameterNode) visit(parameter)); + } + } + return methodNode; + } else { + MethodNode methodNode = new MethodNode(ctx.AccessModifier().getText(), null, true, ctx.Identifier().getText(), (BlockNode) visit(ctx.blockStatement())); + if(ctx.parameterList() != null) { + for(SimpleJavaParser.ParameterContext parameter : ctx.parameterList().parameter()) { + methodNode.addParameter((ParameterNode) visit(parameter)); + } + } + return methodNode; + } + } + } + + @Override + public ASTNode visitFieldDeclaration(SimpleJavaParser.FieldDeclarationContext ctx) { + return new FieldNode(new AccessModifierNode(ctx.AccessModifier().getText()), createTypeNode(ctx.type().getText()), ctx.Identifier().getText()); + } + @Override public ASTNode visitParameter(SimpleJavaParser.ParameterContext ctx) { - return new ParameterNode(new TypeNode(ctx.type().getText()), ctx.Identifier().getText()); + return new ParameterNode(createTypeNode(ctx.type().getText()), ctx.Identifier().getText()); } @Override @@ -93,7 +125,7 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { @Override public ASTNode visitLocalVariableDeclaration(SimpleJavaParser.LocalVariableDeclarationContext ctx) { - return new LocalVariableDeclarationNode(new TypeNode(ctx.type().getText()), ctx.Identifier().getText(), ctx.Assign().getText(), (IExpressionNode) visit(ctx.expression())); + return new LocalVariableDeclarationNode(createTypeNode(ctx.type().getText()), ctx.Identifier().getText(), ctx.Assign().getText(), (IExpressionNode) visit(ctx.expression())); } @Override @@ -102,6 +134,9 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { for(SimpleJavaParser.StatementContext statement : ctx.statement()) { blockNode.addStatement((IStatementNode) visit(statement)); } + if(!blockNode.hasReturnStatement) { + blockNode.addStatement(new ReturnNode(null)); + } return blockNode; } diff --git a/src/main/java/semantic/SemanticAnalyzer.java b/src/main/java/semantic/SemanticAnalyzer.java index 78d660d..4fc169a 100644 --- a/src/main/java/semantic/SemanticAnalyzer.java +++ b/src/main/java/semantic/SemanticAnalyzer.java @@ -228,10 +228,10 @@ public class SemanticAnalyzer implements SemanticVisitor { return null; } - @Override + /*@Override public TypeCheckResult analyze(ForNode toCheck) { return null; - } + }*/ @Override public TypeCheckResult analyze(AssignNode toCheck) { diff --git a/src/main/java/semantic/SemanticVisitor.java b/src/main/java/semantic/SemanticVisitor.java index 3119265..974d1de 100644 --- a/src/main/java/semantic/SemanticVisitor.java +++ b/src/main/java/semantic/SemanticVisitor.java @@ -38,7 +38,7 @@ public interface SemanticVisitor { TypeCheckResult analyze(ElseNode toCheck); - TypeCheckResult analyze(ForNode toCheck); + //TypeCheckResult analyze(ForNode toCheck); TypeCheckResult analyze(AssignNode toCheck); diff --git a/src/test/java/semantic/Mocker.java b/src/test/java/semantic/Mocker.java index f061efa..683b385 100644 --- a/src/test/java/semantic/Mocker.java +++ b/src/test/java/semantic/Mocker.java @@ -42,7 +42,7 @@ public class Mocker { //Statements //Block - methodNode.block = new ast.block.BlockStatementNode(); + methodNode.block = new ast.statements.BlockNode(); c.members.add(methodNode); @@ -57,7 +57,7 @@ public class Mocker { ClassNode c = new ClassNode(); MethodNode methodNode = new MethodNode(); - methodNode.block = new ast.block.BlockStatementNode(); + methodNode.block = new ast.statements.BlockNode(); methodNode.setType(new BaseType(TypeEnum.INT)); methodNode.setIdentifier("testMethod"); @@ -65,7 +65,7 @@ public class Mocker { c.members.add(methodNode); MethodNode methodNode1 = new MethodNode(); - methodNode1.block = new ast.block.BlockStatementNode(); + methodNode1.block = new ast.statements.BlockNode(); methodNode1.setType(new BaseType(TypeEnum.INT)); methodNode1.setIdentifier("testMethod"); @@ -83,13 +83,13 @@ public class Mocker { ClassNode c = new ClassNode(); MethodNode methodNode = new MethodNode(); - methodNode.block = new ast.block.BlockStatementNode(); + methodNode.block = new ast.statements.BlockNode(); methodNode.setIdentifier("testMethod"); c.members.add(methodNode); MethodNode methodNode1 = new MethodNode(); - methodNode1.block = new ast.block.BlockStatementNode(); + methodNode1.block = new ast.statements.BlockNode(); methodNode1.setIdentifier("testMethod1"); c.members.add(methodNode1); diff --git a/src/test/java/semantic/SemanticTest.java b/src/test/java/semantic/SemanticTest.java index 04fda3d..7b8ad6a 100644 --- a/src/test/java/semantic/SemanticTest.java +++ b/src/test/java/semantic/SemanticTest.java @@ -1,10 +1,10 @@ package semantic; import ast.*; -import ast.member.FieldNode; -import ast.member.MemberNode; -import ast.member.MethodNode; -import ast.parameter.ParameterNode; +import ast.members.FieldNode; +import ast.members.MemberNode; +import ast.members.MethodNode; +import ast.parameters.ParameterNode; import org.junit.jupiter.api.Test; import semantic.exeptions.AlreadyDeclearedException; From 88a25207e981a9c00be7486bc26f04f298bf4a3d Mon Sep 17 00:00:00 2001 From: Maximilian Stahl Date: Wed, 26 Jun 2024 17:34:40 +0200 Subject: [PATCH 5/6] Added Interface and fixed bugs --- src/main/java/ast/statements/BlockNode.java | 6 +--- src/main/java/ast/statements/ElseNode.java | 8 ++++- src/main/java/ast/statements/IfElseNode.java | 8 ++++- src/main/java/ast/statements/IfNode.java | 9 ++++- .../java/ast/statements/StatementNode.java | 2 -- src/main/java/ast/statements/WhileNode.java | 14 +++++++- .../java/parser/astBuilder/ASTBuilder.java | 35 ++++++++++++------- src/main/resources/input/CompilerInput.java | 24 ++++++------- 8 files changed, 69 insertions(+), 37 deletions(-) delete mode 100644 src/main/java/ast/statements/StatementNode.java diff --git a/src/main/java/ast/statements/BlockNode.java b/src/main/java/ast/statements/BlockNode.java index ca14404..7a5a2ea 100644 --- a/src/main/java/ast/statements/BlockNode.java +++ b/src/main/java/ast/statements/BlockNode.java @@ -8,17 +8,13 @@ import visitor.Visitable; import java.util.ArrayList; import java.util.List; -public class BlockNode implements ASTNode, Visitable { +public class BlockNode implements IStatementNode, Visitable { public List statements = new ArrayList<>(); - public Boolean hasReturnStatement = false; public BlockNode() {} public void addStatement(IStatementNode statement) { statements.add(statement); - if(statement instanceof ReturnNode) { - hasReturnStatement = true; - } } @Override diff --git a/src/main/java/ast/statements/ElseNode.java b/src/main/java/ast/statements/ElseNode.java index 5b498cf..78b62f1 100644 --- a/src/main/java/ast/statements/ElseNode.java +++ b/src/main/java/ast/statements/ElseNode.java @@ -1,8 +1,10 @@ package ast.statements; import ast.ASTNode; +import semantic.SemanticVisitor; +import typechecker.TypeCheckResult; -public class ElseNode implements ASTNode { +public class ElseNode implements IStatementNode { BlockNode block; public ElseNode(BlockNode block) { @@ -10,4 +12,8 @@ public class ElseNode implements ASTNode { } + @Override + public TypeCheckResult accept(SemanticVisitor visitor) { + return null; + } } diff --git a/src/main/java/ast/statements/IfElseNode.java b/src/main/java/ast/statements/IfElseNode.java index 9d25390..34d40f3 100644 --- a/src/main/java/ast/statements/IfElseNode.java +++ b/src/main/java/ast/statements/IfElseNode.java @@ -1,11 +1,13 @@ package ast.statements; import ast.ASTNode; +import semantic.SemanticVisitor; +import typechecker.TypeCheckResult; import java.util.ArrayList; import java.util.List; -public class IfElseNode implements ASTNode { +public class IfElseNode implements IStatementNode { IfNode ifStatement; List elseIfStatements = new ArrayList<>(); ElseNode elseStatement; @@ -19,4 +21,8 @@ public class IfElseNode implements ASTNode { elseIfStatements.add(elseIfStament); } + @Override + public TypeCheckResult accept(SemanticVisitor visitor) { + return null; + } } diff --git a/src/main/java/ast/statements/IfNode.java b/src/main/java/ast/statements/IfNode.java index 3292a10..2f30788 100644 --- a/src/main/java/ast/statements/IfNode.java +++ b/src/main/java/ast/statements/IfNode.java @@ -2,8 +2,10 @@ package ast.statements; import ast.ASTNode; import ast.expressions.IExpressionNode; +import semantic.SemanticVisitor; +import typechecker.TypeCheckResult; -public class IfNode implements ASTNode { +public class IfNode implements IStatementNode { IExpressionNode expression; BlockNode block; @@ -11,4 +13,9 @@ public class IfNode implements ASTNode { this.expression = expression; this.block = block; } + + @Override + public TypeCheckResult accept(SemanticVisitor visitor) { + return null; + } } diff --git a/src/main/java/ast/statements/StatementNode.java b/src/main/java/ast/statements/StatementNode.java deleted file mode 100644 index 24985c1..0000000 --- a/src/main/java/ast/statements/StatementNode.java +++ /dev/null @@ -1,2 +0,0 @@ -package ast.statements;public class StatementNode { -} diff --git a/src/main/java/ast/statements/WhileNode.java b/src/main/java/ast/statements/WhileNode.java index fe9bfd2..01c1160 100644 --- a/src/main/java/ast/statements/WhileNode.java +++ b/src/main/java/ast/statements/WhileNode.java @@ -2,8 +2,10 @@ package ast.statements; import ast.ASTNode; import ast.expressions.IExpressionNode; +import semantic.SemanticVisitor; +import typechecker.TypeCheckResult; -public class WhileNode extends StatementNode implements ASTNode { +public class WhileNode implements IStatementNode { IExpressionNode expression; BlockNode block; @@ -11,4 +13,14 @@ public class WhileNode extends StatementNode implements ASTNode { this.expression = expression; this.block = block; } + + public void test() { + return; + + } + + @Override + public TypeCheckResult accept(SemanticVisitor visitor) { + return null; + } } diff --git a/src/main/java/parser/astBuilder/ASTBuilder.java b/src/main/java/parser/astBuilder/ASTBuilder.java index 224b59d..bf84fd4 100644 --- a/src/main/java/parser/astBuilder/ASTBuilder.java +++ b/src/main/java/parser/astBuilder/ASTBuilder.java @@ -108,6 +108,8 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { return visitBlockStatement(ctx.blockStatement()); } else if(ctx.whileStatement() != null) { return visitWhileStatement(ctx.whileStatement()); + } else if(ctx.doWhileStatement() != null) { + return visitDoWhileStatement(ctx.doWhileStatement()); } else if(ctx.forStatement() != null) { return visitForStatement(ctx.forStatement()); } else if(ctx.ifElseStatement() != null) { @@ -131,10 +133,15 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { @Override public ASTNode visitBlockStatement(SimpleJavaParser.BlockStatementContext ctx) { BlockNode blockNode = new BlockNode(); + boolean hasReturnStatement = false; for(SimpleJavaParser.StatementContext statement : ctx.statement()) { - blockNode.addStatement((IStatementNode) visit(statement)); + IStatementNode statementNode = (IStatementNode) visit(statement); + if(statementNode instanceof ReturnNode) { + hasReturnStatement = true; + } + blockNode.addStatement(statementNode); } - if(!blockNode.hasReturnStatement) { + if(!hasReturnStatement) { blockNode.addStatement(new ReturnNode(null)); } return blockNode; @@ -161,28 +168,30 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { @Override public ASTNode visitForStatement(SimpleJavaParser.ForStatementContext ctx) { - List statements = new ArrayList<>(); + List statements = new ArrayList<>(); //init - if(ctx.statementExpression(0) != null){ - statements.add((StatementNode) visit(ctx.statementExpression(0))); - } else if (ctx.localVariableDeclaration() != null) { - statements.add((StatementNode) visit(ctx.localVariableDeclaration())); + int i = 0; + if(ctx.localVariableDeclaration() != null) { + statements.add((IStatementNode) visit(ctx.localVariableDeclaration())); + } else if(ctx.statementExpression(i) != null){ + statements.add((IStatementNode) visit(ctx.statementExpression(i))); + i++; } //condition IExpressionNode condition = (IExpressionNode) visit(ctx.expression()); //ink - IStatementNode increment = null; - if(ctx.statementExpression(1) != null){ - increment = (IStatementNode) visit(ctx.statementExpression(1)); + IStatementNode crement = null; + if(ctx.statementExpression(i) != null){ + crement = (IStatementNode) visit(ctx.statementExpression(i)); } BlockNode forBlock = (BlockNode) visit(ctx.blockStatement()); - if(increment != null){ - forBlock.addStatement((increment)); + if(crement != null){ + forBlock.addStatement((crement)); } WhileNode While = new WhileNode(condition, forBlock); @@ -190,7 +199,7 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { statements.add(While); BlockNode resultBlock = new BlockNode(); - for(StatementNode statement : statements) { + for(IStatementNode statement : statements) { resultBlock.addStatement((IStatementNode) statement); } diff --git a/src/main/resources/input/CompilerInput.java b/src/main/resources/input/CompilerInput.java index d850a3e..825490d 100644 --- a/src/main/resources/input/CompilerInput.java +++ b/src/main/resources/input/CompilerInput.java @@ -1,16 +1,14 @@ -public class CompilerInput { - - public int a; - - public static int testMethod(char x){ - return 0; - } - - public class Test { - - public static int testMethod(char x, int a){ - return 0; - } +public class Compiler { + public int add(int i, int j) { + return i+j; + } +} + +public class Node { + public void main() { + Compiler compiler = new Compiler(); + int i = compiler.add(5, 8); + return i; } } From 85ae06048cd6b69bf545208c118dbcd16161eb2d Mon Sep 17 00:00:00 2001 From: i22035 Date: Thu, 27 Jun 2024 18:55:28 +0200 Subject: [PATCH 6/6] Add Return if Returntype is Void --- src/main/java/parser/astBuilder/ASTBuilder.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/parser/astBuilder/ASTBuilder.java b/src/main/java/parser/astBuilder/ASTBuilder.java index bf84fd4..b6d8283 100644 --- a/src/main/java/parser/astBuilder/ASTBuilder.java +++ b/src/main/java/parser/astBuilder/ASTBuilder.java @@ -60,13 +60,16 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { constructorNode.addParameter((ParameterNode) visit(parameter)); } } + constructorNode.block.addStatement(new ReturnNode(null)); return constructorNode; } @Override public ASTNode visitMethodDeclaration(SimpleJavaParser.MethodDeclarationContext ctx) { if(ctx.MainMethodDeclaration() != null) { - return new MainMethodNode((BlockNode) visit(ctx.blockStatement())); + MainMethodNode mainMethod = new MainMethodNode((BlockNode) visit(ctx.blockStatement())); + mainMethod.block.addStatement(new ReturnNode(null)); + return mainMethod; } else { if(ctx.type() != null) { MethodNode methodNode = new MethodNode(ctx.AccessModifier().getText(), createTypeNode(ctx.type().getText()), false, ctx.Identifier().getText(), (BlockNode) visit(ctx.blockStatement())); @@ -83,6 +86,7 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { methodNode.addParameter((ParameterNode) visit(parameter)); } } + methodNode.block.addStatement(new ReturnNode(null)); return methodNode; } } @@ -133,16 +137,8 @@ public class ASTBuilder extends SimpleJavaBaseVisitor { @Override public ASTNode visitBlockStatement(SimpleJavaParser.BlockStatementContext ctx) { BlockNode blockNode = new BlockNode(); - boolean hasReturnStatement = false; for(SimpleJavaParser.StatementContext statement : ctx.statement()) { - IStatementNode statementNode = (IStatementNode) visit(statement); - if(statementNode instanceof ReturnNode) { - hasReturnStatement = true; - } - blockNode.addStatement(statementNode); - } - if(!hasReturnStatement) { - blockNode.addStatement(new ReturnNode(null)); + blockNode.addStatement((IStatementNode) visit(statement)); } return blockNode; }