The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitProg(JavaGrParser.ProgContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitNumeric_type(JavaGrParser.Numeric_typeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitText_type(JavaGrParser.Text_typeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitDatatype(JavaGrParser.DatatypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitBool_val(JavaGrParser.Bool_valContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitNum_val(JavaGrParser.Num_valContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitInput_vars(JavaGrParser.Input_varsContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitFunction_in(JavaGrParser.Function_inContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitInput_vars_2(JavaGrParser.Input_vars_2Context ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitFunction_in_2(JavaGrParser.Function_in_2Context ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitFunction_to_ret(JavaGrParser.Function_to_retContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitReturn_statement(JavaGrParser.Return_statementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitElif_statement(JavaGrParser.Elif_statementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitInstruction(JavaGrParser.InstructionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitInstruction_general(JavaGrParser.Instruction_generalContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitFunction_body(JavaGrParser.Function_bodyContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitFunction(JavaGrParser.FunctionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitMath_symbol(JavaGrParser.Math_symbolContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitAdd_equals(JavaGrParser.Add_equalsContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitSubtract_equals(JavaGrParser.Subtract_equalsContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitMultiply_equals(JavaGrParser.Multiply_equalsContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitDivide_equals(JavaGrParser.Divide_equalsContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitModulo_equals(JavaGrParser.Modulo_equalsContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitMath_modification(JavaGrParser.Math_modificationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitMath_expr(JavaGrParser.Math_exprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitComma_identifier(JavaGrParser.Comma_identifierContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitDeclaration(JavaGrParser.DeclarationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitAssignment(JavaGrParser.AssignmentContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitAdd_double(JavaGrParser.Add_doubleContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitEqual_double(JavaGrParser.Equal_doubleContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitSubtract_double(JavaGrParser.Subtract_doubleContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitModification(JavaGrParser.ModificationContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitComparator(JavaGrParser.ComparatorContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitComparison(JavaGrParser.ComparisonContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitLogic_statement(JavaGrParser.Logic_statementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitLogic_operator(JavaGrParser.Logic_operatorContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitLogic_condition(JavaGrParser.Logic_conditionContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitIf_statement(JavaGrParser.If_statementContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitWhile_loop(JavaGrParser.While_loopContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitDo_while_loop(JavaGrParser.Do_while_loopContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitFor_loop(JavaGrParser.For_loopContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitSout(JavaGrParser.SoutContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitSin(JavaGrParser.SinContext ctx) { return visitChildren(ctx); } +} \ No newline at end of file diff --git a/src/main/java/visitor/JavaGrLexer.interp b/src/main/java/visitor/JavaGrLexer.interp new file mode 100644 index 0000000..6d32c97 --- /dev/null +++ b/src/main/java/visitor/JavaGrLexer.interp @@ -0,0 +1,185 @@ +token literal names: +null +null +null +null +null +null +'do' +'float' +'int' +'double' +'string' +'char' +'boolean' +'public' +'class' +'true' +'false' +'=' +'!=' +'>' +'<' +'>=' +'<=' +'(' +')' +'[' +']' +'{' +'}' +'+' +'-' +'*' +'/' +'%' +null +'if' +'else' +'for' +'while' +';' +',' +'import' +'package' +'return' +'private' +'protected' +'static' +'||' +'&&' +'void' +null +null +'BufferedReader' +'System.out.print' +'new' +'InputStreamReader' +'System.in' + +token symbolic names: +null +STRING_VAL +CHAR_VAL +INT_VAL +FLOAT_VAL +DOUBLE_VAL +DO_ +FLOAT +INT +DOUBLE +STRING +CHAR +BOOL +PUBLIC +CLASS +TRUE +FALSE +EQUAL +NOT_EQUAL +GREATER +LESS +GREATER_EQUAL +LESS_EQUAL +BRACKET_L +BRACKET_R +SQ_BRACKET_L +SQ_BRACKET_R +PARENT_L +PARENT_R +ADD_ +SUBTRACT_ +MULTIPLY +DIVIDE +MODULO +COMMENT +IF +ELSE +FOR +WHILE +SEMICOLON +COMMA +IMPORT +PACKAGE +RETURN +PRIVATE_NEW_VAR +PROTECTED_NEW_VAR +STATIC_VAR +OR +AND +VOID +IDENTIFIER +WS +BUFFERED_READER +SOUT_L +NEW +INPUT_READER +SYS_IN + +rule names: +STRING_VAL +CHAR_VAL +INT_VAL +FLOAT_VAL +DOUBLE_VAL +DO_ +FLOAT +INT +DOUBLE +STRING +CHAR +BOOL +PUBLIC +CLASS +TRUE +FALSE +EQUAL +NOT_EQUAL +GREATER +LESS +GREATER_EQUAL +LESS_EQUAL +BRACKET_L +BRACKET_R +SQ_BRACKET_L +SQ_BRACKET_R +PARENT_L +PARENT_R +ADD_ +SUBTRACT_ +MULTIPLY +DIVIDE +MODULO +COMMENT +IF +ELSE +FOR +WHILE +SEMICOLON +COMMA +IMPORT +PACKAGE +RETURN +PRIVATE_NEW_VAR +PROTECTED_NEW_VAR +STATIC_VAR +OR +AND +VOID +IDENTIFIER +WS +BUFFERED_READER +SOUT_L +NEW +INPUT_READER +SYS_IN + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[4, 0, 56, 437, 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, 2, 54, 7, 54, 2, 55, 7, 55, 1, 0, 1, 0, 1, 0, 1, 0, 5, 0, 118, 8, 0, 10, 0, 12, 0, 121, 9, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 129, 8, 1, 1, 1, 1, 1, 1, 2, 1, 2, 5, 2, 135, 8, 2, 10, 2, 12, 2, 138, 9, 2, 1, 3, 5, 3, 141, 8, 3, 10, 3, 12, 3, 144, 9, 3, 1, 3, 3, 3, 147, 8, 3, 1, 3, 4, 3, 150, 8, 3, 11, 3, 12, 3, 151, 1, 3, 1, 3, 1, 4, 5, 4, 157, 8, 4, 10, 4, 12, 4, 160, 9, 4, 1, 4, 3, 4, 163, 8, 4, 1, 4, 4, 4, 166, 8, 4, 11, 4, 12, 4, 167, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 17, 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, 23, 1, 23, 1, 24, 1, 24, 1, 25, 1, 25, 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, 33, 1, 33, 5, 33, 275, 8, 33, 10, 33, 12, 33, 278, 9, 33, 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, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 37, 1, 38, 1, 38, 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, 41, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 42, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 43, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 48, 1, 48, 1, 48, 1, 49, 1, 49, 5, 49, 362, 8, 49, 10, 49, 12, 49, 365, 9, 49, 1, 50, 4, 50, 368, 8, 50, 11, 50, 12, 50, 369, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 0, 0, 56, 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, 48, 97, 49, 99, 50, 101, 51, 103, 52, 105, 53, 107, 54, 109, 55, 111, 56, 1, 0, 10, 2, 0, 34, 34, 92, 92, 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 4, 0, 10, 10, 13, 13, 39, 39, 92, 92, 1, 0, 49, 57, 1, 0, 48, 57, 1, 0, 46, 46, 2, 0, 10, 10, 13, 13, 2, 0, 65, 90, 97, 122, 3, 0, 48, 57, 65, 90, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 449, 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, 95, 1, 0, 0, 0, 0, 97, 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, 0, 107, 1, 0, 0, 0, 0, 109, 1, 0, 0, 0, 0, 111, 1, 0, 0, 0, 1, 113, 1, 0, 0, 0, 3, 124, 1, 0, 0, 0, 5, 132, 1, 0, 0, 0, 7, 146, 1, 0, 0, 0, 9, 162, 1, 0, 0, 0, 11, 169, 1, 0, 0, 0, 13, 172, 1, 0, 0, 0, 15, 178, 1, 0, 0, 0, 17, 182, 1, 0, 0, 0, 19, 189, 1, 0, 0, 0, 21, 196, 1, 0, 0, 0, 23, 201, 1, 0, 0, 0, 25, 209, 1, 0, 0, 0, 27, 216, 1, 0, 0, 0, 29, 222, 1, 0, 0, 0, 31, 227, 1, 0, 0, 0, 33, 233, 1, 0, 0, 0, 35, 235, 1, 0, 0, 0, 37, 238, 1, 0, 0, 0, 39, 240, 1, 0, 0, 0, 41, 242, 1, 0, 0, 0, 43, 245, 1, 0, 0, 0, 45, 248, 1, 0, 0, 0, 47, 250, 1, 0, 0, 0, 49, 252, 1, 0, 0, 0, 51, 254, 1, 0, 0, 0, 53, 256, 1, 0, 0, 0, 55, 258, 1, 0, 0, 0, 57, 260, 1, 0, 0, 0, 59, 262, 1, 0, 0, 0, 61, 264, 1, 0, 0, 0, 63, 266, 1, 0, 0, 0, 65, 268, 1, 0, 0, 0, 67, 270, 1, 0, 0, 0, 69, 279, 1, 0, 0, 0, 71, 282, 1, 0, 0, 0, 73, 287, 1, 0, 0, 0, 75, 291, 1, 0, 0, 0, 77, 297, 1, 0, 0, 0, 79, 299, 1, 0, 0, 0, 81, 301, 1, 0, 0, 0, 83, 308, 1, 0, 0, 0, 85, 316, 1, 0, 0, 0, 87, 323, 1, 0, 0, 0, 89, 331, 1, 0, 0, 0, 91, 341, 1, 0, 0, 0, 93, 348, 1, 0, 0, 0, 95, 351, 1, 0, 0, 0, 97, 354, 1, 0, 0, 0, 99, 359, 1, 0, 0, 0, 101, 367, 1, 0, 0, 0, 103, 373, 1, 0, 0, 0, 105, 388, 1, 0, 0, 0, 107, 405, 1, 0, 0, 0, 109, 409, 1, 0, 0, 0, 111, 427, 1, 0, 0, 0, 113, 119, 5, 34, 0, 0, 114, 115, 5, 92, 0, 0, 115, 118, 7, 0, 0, 0, 116, 118, 8, 1, 0, 0, 117, 114, 1, 0, 0, 0, 117, 116, 1, 0, 0, 0, 118, 121, 1, 0, 0, 0, 119, 117, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 122, 1, 0, 0, 0, 121, 119, 1, 0, 0, 0, 122, 123, 5, 34, 0, 0, 123, 2, 1, 0, 0, 0, 124, 128, 5, 39, 0, 0, 125, 126, 5, 92, 0, 0, 126, 129, 7, 0, 0, 0, 127, 129, 8, 2, 0, 0, 128, 125, 1, 0, 0, 0, 128, 127, 1, 0, 0, 0, 129, 130, 1, 0, 0, 0, 130, 131, 5, 39, 0, 0, 131, 4, 1, 0, 0, 0, 132, 136, 7, 3, 0, 0, 133, 135, 7, 4, 0, 0, 134, 133, 1, 0, 0, 0, 135, 138, 1, 0, 0, 0, 136, 134, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 6, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 139, 141, 7, 4, 0, 0, 140, 139, 1, 0, 0, 0, 141, 144, 1, 0, 0, 0, 142, 140, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 145, 1, 0, 0, 0, 144, 142, 1, 0, 0, 0, 145, 147, 7, 5, 0, 0, 146, 142, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 149, 1, 0, 0, 0, 148, 150, 7, 4, 0, 0, 149, 148, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 149, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 153, 1, 0, 0, 0, 153, 154, 5, 102, 0, 0, 154, 8, 1, 0, 0, 0, 155, 157, 7, 4, 0, 0, 156, 155, 1, 0, 0, 0, 157, 160, 1, 0, 0, 0, 158, 156, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 161, 1, 0, 0, 0, 160, 158, 1, 0, 0, 0, 161, 163, 7, 5, 0, 0, 162, 158, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 165, 1, 0, 0, 0, 164, 166, 7, 4, 0, 0, 165, 164, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 165, 1, 0, 0, 0, 167, 168, 1, 0, 0, 0, 168, 10, 1, 0, 0, 0, 169, 170, 5, 100, 0, 0, 170, 171, 5, 111, 0, 0, 171, 12, 1, 0, 0, 0, 172, 173, 5, 102, 0, 0, 173, 174, 5, 108, 0, 0, 174, 175, 5, 111, 0, 0, 175, 176, 5, 97, 0, 0, 176, 177, 5, 116, 0, 0, 177, 14, 1, 0, 0, 0, 178, 179, 5, 105, 0, 0, 179, 180, 5, 110, 0, 0, 180, 181, 5, 116, 0, 0, 181, 16, 1, 0, 0, 0, 182, 183, 5, 100, 0, 0, 183, 184, 5, 111, 0, 0, 184, 185, 5, 117, 0, 0, 185, 186, 5, 98, 0, 0, 186, 187, 5, 108, 0, 0, 187, 188, 5, 101, 0, 0, 188, 18, 1, 0, 0, 0, 189, 190, 5, 115, 0, 0, 190, 191, 5, 116, 0, 0, 191, 192, 5, 114, 0, 0, 192, 193, 5, 105, 0, 0, 193, 194, 5, 110, 0, 0, 194, 195, 5, 103, 0, 0, 195, 20, 1, 0, 0, 0, 196, 197, 5, 99, 0, 0, 197, 198, 5, 104, 0, 0, 198, 199, 5, 97, 0, 0, 199, 200, 5, 114, 0, 0, 200, 22, 1, 0, 0, 0, 201, 202, 5, 98, 0, 0, 202, 203, 5, 111, 0, 0, 203, 204, 5, 111, 0, 0, 204, 205, 5, 108, 0, 0, 205, 206, 5, 101, 0, 0, 206, 207, 5, 97, 0, 0, 207, 208, 5, 110, 0, 0, 208, 24, 1, 0, 0, 0, 209, 210, 5, 112, 0, 0, 210, 211, 5, 117, 0, 0, 211, 212, 5, 98, 0, 0, 212, 213, 5, 108, 0, 0, 213, 214, 5, 105, 0, 0, 214, 215, 5, 99, 0, 0, 215, 26, 1, 0, 0, 0, 216, 217, 5, 99, 0, 0, 217, 218, 5, 108, 0, 0, 218, 219, 5, 97, 0, 0, 219, 220, 5, 115, 0, 0, 220, 221, 5, 115, 0, 0, 221, 28, 1, 0, 0, 0, 222, 223, 5, 116, 0, 0, 223, 224, 5, 114, 0, 0, 224, 225, 5, 117, 0, 0, 225, 226, 5, 101, 0, 0, 226, 30, 1, 0, 0, 0, 227, 228, 5, 102, 0, 0, 228, 229, 5, 97, 0, 0, 229, 230, 5, 108, 0, 0, 230, 231, 5, 115, 0, 0, 231, 232, 5, 101, 0, 0, 232, 32, 1, 0, 0, 0, 233, 234, 5, 61, 0, 0, 234, 34, 1, 0, 0, 0, 235, 236, 5, 33, 0, 0, 236, 237, 5, 61, 0, 0, 237, 36, 1, 0, 0, 0, 238, 239, 5, 62, 0, 0, 239, 38, 1, 0, 0, 0, 240, 241, 5, 60, 0, 0, 241, 40, 1, 0, 0, 0, 242, 243, 5, 62, 0, 0, 243, 244, 5, 61, 0, 0, 244, 42, 1, 0, 0, 0, 245, 246, 5, 60, 0, 0, 246, 247, 5, 61, 0, 0, 247, 44, 1, 0, 0, 0, 248, 249, 5, 40, 0, 0, 249, 46, 1, 0, 0, 0, 250, 251, 5, 41, 0, 0, 251, 48, 1, 0, 0, 0, 252, 253, 5, 91, 0, 0, 253, 50, 1, 0, 0, 0, 254, 255, 5, 93, 0, 0, 255, 52, 1, 0, 0, 0, 256, 257, 5, 123, 0, 0, 257, 54, 1, 0, 0, 0, 258, 259, 5, 125, 0, 0, 259, 56, 1, 0, 0, 0, 260, 261, 5, 43, 0, 0, 261, 58, 1, 0, 0, 0, 262, 263, 5, 45, 0, 0, 263, 60, 1, 0, 0, 0, 264, 265, 5, 42, 0, 0, 265, 62, 1, 0, 0, 0, 266, 267, 5, 47, 0, 0, 267, 64, 1, 0, 0, 0, 268, 269, 5, 37, 0, 0, 269, 66, 1, 0, 0, 0, 270, 271, 5, 47, 0, 0, 271, 272, 5, 47, 0, 0, 272, 276, 1, 0, 0, 0, 273, 275, 8, 6, 0, 0, 274, 273, 1, 0, 0, 0, 275, 278, 1, 0, 0, 0, 276, 274, 1, 0, 0, 0, 276, 277, 1, 0, 0, 0, 277, 68, 1, 0, 0, 0, 278, 276, 1, 0, 0, 0, 279, 280, 5, 105, 0, 0, 280, 281, 5, 102, 0, 0, 281, 70, 1, 0, 0, 0, 282, 283, 5, 101, 0, 0, 283, 284, 5, 108, 0, 0, 284, 285, 5, 115, 0, 0, 285, 286, 5, 101, 0, 0, 286, 72, 1, 0, 0, 0, 287, 288, 5, 102, 0, 0, 288, 289, 5, 111, 0, 0, 289, 290, 5, 114, 0, 0, 290, 74, 1, 0, 0, 0, 291, 292, 5, 119, 0, 0, 292, 293, 5, 104, 0, 0, 293, 294, 5, 105, 0, 0, 294, 295, 5, 108, 0, 0, 295, 296, 5, 101, 0, 0, 296, 76, 1, 0, 0, 0, 297, 298, 5, 59, 0, 0, 298, 78, 1, 0, 0, 0, 299, 300, 5, 44, 0, 0, 300, 80, 1, 0, 0, 0, 301, 302, 5, 105, 0, 0, 302, 303, 5, 109, 0, 0, 303, 304, 5, 112, 0, 0, 304, 305, 5, 111, 0, 0, 305, 306, 5, 114, 0, 0, 306, 307, 5, 116, 0, 0, 307, 82, 1, 0, 0, 0, 308, 309, 5, 112, 0, 0, 309, 310, 5, 97, 0, 0, 310, 311, 5, 99, 0, 0, 311, 312, 5, 107, 0, 0, 312, 313, 5, 97, 0, 0, 313, 314, 5, 103, 0, 0, 314, 315, 5, 101, 0, 0, 315, 84, 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, 86, 1, 0, 0, 0, 323, 324, 5, 112, 0, 0, 324, 325, 5, 114, 0, 0, 325, 326, 5, 105, 0, 0, 326, 327, 5, 118, 0, 0, 327, 328, 5, 97, 0, 0, 328, 329, 5, 116, 0, 0, 329, 330, 5, 101, 0, 0, 330, 88, 1, 0, 0, 0, 331, 332, 5, 112, 0, 0, 332, 333, 5, 114, 0, 0, 333, 334, 5, 111, 0, 0, 334, 335, 5, 116, 0, 0, 335, 336, 5, 101, 0, 0, 336, 337, 5, 99, 0, 0, 337, 338, 5, 116, 0, 0, 338, 339, 5, 101, 0, 0, 339, 340, 5, 100, 0, 0, 340, 90, 1, 0, 0, 0, 341, 342, 5, 115, 0, 0, 342, 343, 5, 116, 0, 0, 343, 344, 5, 97, 0, 0, 344, 345, 5, 116, 0, 0, 345, 346, 5, 105, 0, 0, 346, 347, 5, 99, 0, 0, 347, 92, 1, 0, 0, 0, 348, 349, 5, 124, 0, 0, 349, 350, 5, 124, 0, 0, 350, 94, 1, 0, 0, 0, 351, 352, 5, 38, 0, 0, 352, 353, 5, 38, 0, 0, 353, 96, 1, 0, 0, 0, 354, 355, 5, 118, 0, 0, 355, 356, 5, 111, 0, 0, 356, 357, 5, 105, 0, 0, 357, 358, 5, 100, 0, 0, 358, 98, 1, 0, 0, 0, 359, 363, 7, 7, 0, 0, 360, 362, 7, 8, 0, 0, 361, 360, 1, 0, 0, 0, 362, 365, 1, 0, 0, 0, 363, 361, 1, 0, 0, 0, 363, 364, 1, 0, 0, 0, 364, 100, 1, 0, 0, 0, 365, 363, 1, 0, 0, 0, 366, 368, 7, 9, 0, 0, 367, 366, 1, 0, 0, 0, 368, 369, 1, 0, 0, 0, 369, 367, 1, 0, 0, 0, 369, 370, 1, 0, 0, 0, 370, 371, 1, 0, 0, 0, 371, 372, 6, 50, 0, 0, 372, 102, 1, 0, 0, 0, 373, 374, 5, 66, 0, 0, 374, 375, 5, 117, 0, 0, 375, 376, 5, 102, 0, 0, 376, 377, 5, 102, 0, 0, 377, 378, 5, 101, 0, 0, 378, 379, 5, 114, 0, 0, 379, 380, 5, 101, 0, 0, 380, 381, 5, 100, 0, 0, 381, 382, 5, 82, 0, 0, 382, 383, 5, 101, 0, 0, 383, 384, 5, 97, 0, 0, 384, 385, 5, 100, 0, 0, 385, 386, 5, 101, 0, 0, 386, 387, 5, 114, 0, 0, 387, 104, 1, 0, 0, 0, 388, 389, 5, 83, 0, 0, 389, 390, 5, 121, 0, 0, 390, 391, 5, 115, 0, 0, 391, 392, 5, 116, 0, 0, 392, 393, 5, 101, 0, 0, 393, 394, 5, 109, 0, 0, 394, 395, 5, 46, 0, 0, 395, 396, 5, 111, 0, 0, 396, 397, 5, 117, 0, 0, 397, 398, 5, 116, 0, 0, 398, 399, 5, 46, 0, 0, 399, 400, 5, 112, 0, 0, 400, 401, 5, 114, 0, 0, 401, 402, 5, 105, 0, 0, 402, 403, 5, 110, 0, 0, 403, 404, 5, 116, 0, 0, 404, 106, 1, 0, 0, 0, 405, 406, 5, 110, 0, 0, 406, 407, 5, 101, 0, 0, 407, 408, 5, 119, 0, 0, 408, 108, 1, 0, 0, 0, 409, 410, 5, 73, 0, 0, 410, 411, 5, 110, 0, 0, 411, 412, 5, 112, 0, 0, 412, 413, 5, 117, 0, 0, 413, 414, 5, 116, 0, 0, 414, 415, 5, 83, 0, 0, 415, 416, 5, 116, 0, 0, 416, 417, 5, 114, 0, 0, 417, 418, 5, 101, 0, 0, 418, 419, 5, 97, 0, 0, 419, 420, 5, 109, 0, 0, 420, 421, 5, 82, 0, 0, 421, 422, 5, 101, 0, 0, 422, 423, 5, 97, 0, 0, 423, 424, 5, 100, 0, 0, 424, 425, 5, 101, 0, 0, 425, 426, 5, 114, 0, 0, 426, 110, 1, 0, 0, 0, 427, 428, 5, 83, 0, 0, 428, 429, 5, 121, 0, 0, 429, 430, 5, 115, 0, 0, 430, 431, 5, 116, 0, 0, 431, 432, 5, 101, 0, 0, 432, 433, 5, 109, 0, 0, 433, 434, 5, 46, 0, 0, 434, 435, 5, 105, 0, 0, 435, 436, 5, 110, 0, 0, 436, 112, 1, 0, 0, 0, 14, 0, 117, 119, 128, 136, 142, 146, 151, 158, 162, 167, 276, 363, 369, 1, 6, 0, 0] \ No newline at end of file diff --git a/src/main/java/visitor/JavaGrLexer.java b/src/main/java/visitor/JavaGrLexer.java new file mode 100644 index 0000000..160a95e --- /dev/null +++ b/src/main/java/visitor/JavaGrLexer.java @@ -0,0 +1,409 @@ +// Generated from /Users/bartosz/IdeaProjects/TinyGP/src/main/java/antlr/JavaGr.g4 by ANTLR 4.10.1 +package visitor; +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"}) +public class JavaGrLexer extends Lexer { + static { RuntimeMetaData.checkVersion("4.10.1", RuntimeMetaData.VERSION); } + + protected static final DFA[] _decisionToDFA; + protected static final PredictionContextCache _sharedContextCache = + new PredictionContextCache(); + public static final int + STRING_VAL=1, CHAR_VAL=2, INT_VAL=3, FLOAT_VAL=4, DOUBLE_VAL=5, DO_=6, + FLOAT=7, INT=8, DOUBLE=9, STRING=10, CHAR=11, BOOL=12, PUBLIC=13, CLASS=14, + TRUE=15, FALSE=16, EQUAL=17, NOT_EQUAL=18, GREATER=19, LESS=20, GREATER_EQUAL=21, + LESS_EQUAL=22, BRACKET_L=23, BRACKET_R=24, SQ_BRACKET_L=25, SQ_BRACKET_R=26, + PARENT_L=27, PARENT_R=28, ADD_=29, SUBTRACT_=30, MULTIPLY=31, DIVIDE=32, + MODULO=33, COMMENT=34, IF=35, ELSE=36, FOR=37, WHILE=38, SEMICOLON=39, + COMMA=40, IMPORT=41, PACKAGE=42, RETURN=43, PRIVATE_NEW_VAR=44, PROTECTED_NEW_VAR=45, + STATIC_VAR=46, OR=47, AND=48, VOID=49, IDENTIFIER=50, WS=51, BUFFERED_READER=52, + SOUT_L=53, NEW=54, INPUT_READER=55, SYS_IN=56; + public static String[] channelNames = { + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" + }; + + public static String[] modeNames = { + "DEFAULT_MODE" + }; + + private static String[] makeRuleNames() { + return new String[] { + "STRING_VAL", "CHAR_VAL", "INT_VAL", "FLOAT_VAL", "DOUBLE_VAL", "DO_", + "FLOAT", "INT", "DOUBLE", "STRING", "CHAR", "BOOL", "PUBLIC", "CLASS", + "TRUE", "FALSE", "EQUAL", "NOT_EQUAL", "GREATER", "LESS", "GREATER_EQUAL", + "LESS_EQUAL", "BRACKET_L", "BRACKET_R", "SQ_BRACKET_L", "SQ_BRACKET_R", + "PARENT_L", "PARENT_R", "ADD_", "SUBTRACT_", "MULTIPLY", "DIVIDE", "MODULO", + "COMMENT", "IF", "ELSE", "FOR", "WHILE", "SEMICOLON", "COMMA", "IMPORT", + "PACKAGE", "RETURN", "PRIVATE_NEW_VAR", "PROTECTED_NEW_VAR", "STATIC_VAR", + "OR", "AND", "VOID", "IDENTIFIER", "WS", "BUFFERED_READER", "SOUT_L", + "NEW", "INPUT_READER", "SYS_IN" + }; + } + public static final String[] ruleNames = makeRuleNames(); + + private static String[] makeLiteralNames() { + return new String[] { + null, null, null, null, null, null, "'do'", "'float'", "'int'", "'double'", + "'string'", "'char'", "'boolean'", "'public'", "'class'", "'true'", "'false'", + "'='", "'!='", "'>'", "'<'", "'>='", "'<='", "'('", "')'", "'['", "']'", + "'{'", "'}'", "'+'", "'-'", "'*'", "'/'", "'%'", null, "'if'", "'else'", + "'for'", "'while'", "';'", "','", "'import'", "'package'", "'return'", + "'private'", "'protected'", "'static'", "'||'", "'&&'", "'void'", null, + null, "'BufferedReader'", "'System.out.print'", "'new'", "'InputStreamReader'", + "'System.in'" + }; + } + private static final String[] _LITERAL_NAMES = makeLiteralNames(); + private static String[] makeSymbolicNames() { + return new String[] { + null, "STRING_VAL", "CHAR_VAL", "INT_VAL", "FLOAT_VAL", "DOUBLE_VAL", + "DO_", "FLOAT", "INT", "DOUBLE", "STRING", "CHAR", "BOOL", "PUBLIC", + "CLASS", "TRUE", "FALSE", "EQUAL", "NOT_EQUAL", "GREATER", "LESS", "GREATER_EQUAL", + "LESS_EQUAL", "BRACKET_L", "BRACKET_R", "SQ_BRACKET_L", "SQ_BRACKET_R", + "PARENT_L", "PARENT_R", "ADD_", "SUBTRACT_", "MULTIPLY", "DIVIDE", "MODULO", + "COMMENT", "IF", "ELSE", "FOR", "WHILE", "SEMICOLON", "COMMA", "IMPORT", + "PACKAGE", "RETURN", "PRIVATE_NEW_VAR", "PROTECTED_NEW_VAR", "STATIC_VAR", + "OR", "AND", "VOID", "IDENTIFIER", "WS", "BUFFERED_READER", "SOUT_L", + "NEW", "INPUT_READER", "SYS_IN" + }; + } + 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] = "