- * The generated file will be divided into two sections: - *
The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitNullLiteral(JavaliParser.NullLiteralContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitBoolLiteral(JavaliParser.BoolLiteralContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitIntLiteral(JavaliParser.IntLiteralContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitType(JavaliParser.TypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitReferenceType(JavaliParser.ReferenceTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitArrayType(JavaliParser.ArrayTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitPrimitiveType(JavaliParser.PrimitiveTypeContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitUnit(JavaliParser.UnitContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitClassDecl(JavaliParser.ClassDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitMemberList(JavaliParser.MemberListContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitVarDecl(JavaliParser.VarDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitMethodDecl(JavaliParser.MethodDeclContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitFormalParamList(JavaliParser.FormalParamListContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitStmt(JavaliParser.StmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitStmtBlock(JavaliParser.StmtBlockContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitLocalMethodCallStmt(JavaliParser.LocalMethodCallStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitObjectMethodCallStmt(JavaliParser.ObjectMethodCallStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitAssignmentStmt(JavaliParser.AssignmentStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitWrite(JavaliParser.WriteContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitWriteLn(JavaliParser.WriteLnContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitIfStmt(JavaliParser.IfStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitWhileStmt(JavaliParser.WhileStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitReturnStmt(JavaliParser.ReturnStmtContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitNewObject(JavaliParser.NewObjectContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitNewObjectArray(JavaliParser.NewObjectArrayContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitNewPrimitiveArray(JavaliParser.NewPrimitiveArrayContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitReadExpr(JavaliParser.ReadExprContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitActualParamList(JavaliParser.ActualParamListContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitAccessThis(JavaliParser.AccessThisContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitAccessLocalField(JavaliParser.AccessLocalFieldContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitAccessObjectField(JavaliParser.AccessObjectFieldContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitAccessLocalMethod(JavaliParser.AccessLocalMethodContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitAccessArray(JavaliParser.AccessArrayContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitAccessObjectMethod(JavaliParser.AccessObjectMethodContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitExprBinary(JavaliParser.ExprBinaryContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitExprCast(JavaliParser.ExprCastContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitExprParentheses(JavaliParser.ExprParenthesesContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitExprUnary(JavaliParser.ExprUnaryContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitExprConstant(JavaliParser.ExprConstantContext ctx) { return visitChildren(ctx); } + /** + * {@inheritDoc} + * + *The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.
+ */ + @Override public T visitExprIdentAccess(JavaliParser.ExprIdentAccessContext ctx) { return visitChildren(ctx); } +} \ No newline at end of file diff --git a/src/cd/frontend/parser/JavaliLexer.interp b/src/cd/frontend/parser/JavaliLexer.interp new file mode 100644 index 0000000..6244602 --- /dev/null +++ b/src/cd/frontend/parser/JavaliLexer.interp @@ -0,0 +1,160 @@ +token literal names: +null +'null' +'[' +']' +'boolean' +'int' +'class' +'extends' +'{' +'}' +',' +';' +'void' +'(' +')' +'.' +'=' +'write' +'writeln' +'if' +'else' +'while' +'return' +'new' +'read' +'this' +'+' +'-' +'!' +'*' +'/' +'%' +'<' +'>' +'<=' +'>=' +'==' +'!=' +'&&' +'||' +null +null +null +null +null +null +null + +token symbolic names: +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +null +Integer +Boolean +Ident +COMMENT +LINE_COMMENT +WS +ErrorCharacter + +rule names: +T__0 +T__1 +T__2 +T__3 +T__4 +T__5 +T__6 +T__7 +T__8 +T__9 +T__10 +T__11 +T__12 +T__13 +T__14 +T__15 +T__16 +T__17 +T__18 +T__19 +T__20 +T__21 +T__22 +T__23 +T__24 +T__25 +T__26 +T__27 +T__28 +T__29 +T__30 +T__31 +T__32 +T__33 +T__34 +T__35 +T__36 +T__37 +T__38 +Letter +Digit +HexDigit +Decimal +Hexadecimal +Integer +Boolean +Ident +COMMENT +LINE_COMMENT +WS +ErrorCharacter + +channel names: +DEFAULT_TOKEN_CHANNEL +HIDDEN + +mode names: +DEFAULT_MODE + +atn: +[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 48, 327, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 3, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 35, 3, 36, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 42, 3, 42, 3, 43, 3, 43, 5, 43, 251, 10, 43, 3, 44, 3, 44, 3, 44, 7, 44, 256, 10, 44, 12, 44, 14, 44, 259, 11, 44, 5, 44, 261, 10, 44, 3, 45, 3, 45, 3, 45, 3, 45, 5, 45, 267, 10, 45, 3, 45, 6, 45, 270, 10, 45, 13, 45, 14, 45, 271, 3, 46, 3, 46, 5, 46, 276, 10, 46, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 3, 47, 5, 47, 287, 10, 47, 3, 48, 3, 48, 3, 48, 7, 48, 292, 10, 48, 12, 48, 14, 48, 295, 11, 48, 3, 49, 3, 49, 3, 49, 3, 49, 7, 49, 301, 10, 49, 12, 49, 14, 49, 304, 11, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 50, 7, 50, 315, 10, 50, 12, 50, 14, 50, 318, 11, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 302, 2, 53, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 2, 83, 2, 85, 2, 87, 2, 89, 2, 91, 42, 93, 43, 95, 44, 97, 45, 99, 46, 101, 47, 103, 48, 3, 2, 6, 4, 2, 67, 92, 99, 124, 4, 2, 67, 72, 99, 104, 4, 2, 12, 12, 15, 15, 5, 2, 11, 12, 15, 15, 34, 34, 2, 332, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 3, 105, 3, 2, 2, 2, 5, 110, 3, 2, 2, 2, 7, 112, 3, 2, 2, 2, 9, 114, 3, 2, 2, 2, 11, 122, 3, 2, 2, 2, 13, 126, 3, 2, 2, 2, 15, 132, 3, 2, 2, 2, 17, 140, 3, 2, 2, 2, 19, 142, 3, 2, 2, 2, 21, 144, 3, 2, 2, 2, 23, 146, 3, 2, 2, 2, 25, 148, 3, 2, 2, 2, 27, 153, 3, 2, 2, 2, 29, 155, 3, 2, 2, 2, 31, 157, 3, 2, 2, 2, 33, 159, 3, 2, 2, 2, 35, 161, 3, 2, 2, 2, 37, 167, 3, 2, 2, 2, 39, 175, 3, 2, 2, 2, 41, 178, 3, 2, 2, 2, 43, 183, 3, 2, 2, 2, 45, 189, 3, 2, 2, 2, 47, 196, 3, 2, 2, 2, 49, 200, 3, 2, 2, 2, 51, 205, 3, 2, 2, 2, 53, 210, 3, 2, 2, 2, 55, 212, 3, 2, 2, 2, 57, 214, 3, 2, 2, 2, 59, 216, 3, 2, 2, 2, 61, 218, 3, 2, 2, 2, 63, 220, 3, 2, 2, 2, 65, 222, 3, 2, 2, 2, 67, 224, 3, 2, 2, 2, 69, 226, 3, 2, 2, 2, 71, 229, 3, 2, 2, 2, 73, 232, 3, 2, 2, 2, 75, 235, 3, 2, 2, 2, 77, 238, 3, 2, 2, 2, 79, 241, 3, 2, 2, 2, 81, 244, 3, 2, 2, 2, 83, 246, 3, 2, 2, 2, 85, 250, 3, 2, 2, 2, 87, 260, 3, 2, 2, 2, 89, 266, 3, 2, 2, 2, 91, 275, 3, 2, 2, 2, 93, 286, 3, 2, 2, 2, 95, 288, 3, 2, 2, 2, 97, 296, 3, 2, 2, 2, 99, 310, 3, 2, 2, 2, 101, 321, 3, 2, 2, 2, 103, 325, 3, 2, 2, 2, 105, 106, 7, 112, 2, 2, 106, 107, 7, 119, 2, 2, 107, 108, 7, 110, 2, 2, 108, 109, 7, 110, 2, 2, 109, 4, 3, 2, 2, 2, 110, 111, 7, 93, 2, 2, 111, 6, 3, 2, 2, 2, 112, 113, 7, 95, 2, 2, 113, 8, 3, 2, 2, 2, 114, 115, 7, 100, 2, 2, 115, 116, 7, 113, 2, 2, 116, 117, 7, 113, 2, 2, 117, 118, 7, 110, 2, 2, 118, 119, 7, 103, 2, 2, 119, 120, 7, 99, 2, 2, 120, 121, 7, 112, 2, 2, 121, 10, 3, 2, 2, 2, 122, 123, 7, 107, 2, 2, 123, 124, 7, 112, 2, 2, 124, 125, 7, 118, 2, 2, 125, 12, 3, 2, 2, 2, 126, 127, 7, 101, 2, 2, 127, 128, 7, 110, 2, 2, 128, 129, 7, 99, 2, 2, 129, 130, 7, 117, 2, 2, 130, 131, 7, 117, 2, 2, 131, 14, 3, 2, 2, 2, 132, 133, 7, 103, 2, 2, 133, 134, 7, 122, 2, 2, 134, 135, 7, 118, 2, 2, 135, 136, 7, 103, 2, 2, 136, 137, 7, 112, 2, 2, 137, 138, 7, 102, 2, 2, 138, 139, 7, 117, 2, 2, 139, 16, 3, 2, 2, 2, 140, 141, 7, 125, 2, 2, 141, 18, 3, 2, 2, 2, 142, 143, 7, 127, 2, 2, 143, 20, 3, 2, 2, 2, 144, 145, 7, 46, 2, 2, 145, 22, 3, 2, 2, 2, 146, 147, 7, 61, 2, 2, 147, 24, 3, 2, 2, 2, 148, 149, 7, 120, 2, 2, 149, 150, 7, 113, 2, 2, 150, 151, 7, 107, 2, 2, 151, 152, 7, 102, 2, 2, 152, 26, 3, 2, 2, 2, 153, 154, 7, 42, 2, 2, 154, 28, 3, 2, 2, 2, 155, 156, 7, 43, 2, 2, 156, 30, 3, 2, 2, 2, 157, 158, 7, 48, 2, 2, 158, 32, 3, 2, 2, 2, 159, 160, 7, 63, 2, 2, 160, 34, 3, 2, 2, 2, 161, 162, 7, 121, 2, 2, 162, 163, 7, 116, 2, 2, 163, 164, 7, 107, 2, 2, 164, 165, 7, 118, 2, 2, 165, 166, 7, 103, 2, 2, 166, 36, 3, 2, 2, 2, 167, 168, 7, 121, 2, 2, 168, 169, 7, 116, 2, 2, 169, 170, 7, 107, 2, 2, 170, 171, 7, 118, 2, 2, 171, 172, 7, 103, 2, 2, 172, 173, 7, 110, 2, 2, 173, 174, 7, 112, 2, 2, 174, 38, 3, 2, 2, 2, 175, 176, 7, 107, 2, 2, 176, 177, 7, 104, 2, 2, 177, 40, 3, 2, 2, 2, 178, 179, 7, 103, 2, 2, 179, 180, 7, 110, 2, 2, 180, 181, 7, 117, 2, 2, 181, 182, 7, 103, 2, 2, 182, 42, 3, 2, 2, 2, 183, 184, 7, 121, 2, 2, 184, 185, 7, 106, 2, 2, 185, 186, 7, 107, 2, 2, 186, 187, 7, 110, 2, 2, 187, 188, 7, 103, 2, 2, 188, 44, 3, 2, 2, 2, 189, 190, 7, 116, 2, 2, 190, 191, 7, 103, 2, 2, 191, 192, 7, 118, 2, 2, 192, 193, 7, 119, 2, 2, 193, 194, 7, 116, 2, 2, 194, 195, 7, 112, 2, 2, 195, 46, 3, 2, 2, 2, 196, 197, 7, 112, 2, 2, 197, 198, 7, 103, 2, 2, 198, 199, 7, 121, 2, 2, 199, 48, 3, 2, 2, 2, 200, 201, 7, 116, 2, 2, 201, 202, 7, 103, 2, 2, 202, 203, 7, 99, 2, 2, 203, 204, 7, 102, 2, 2, 204, 50, 3, 2, 2, 2, 205, 206, 7, 118, 2, 2, 206, 207, 7, 106, 2, 2, 207, 208, 7, 107, 2, 2, 208, 209, 7, 117, 2, 2, 209, 52, 3, 2, 2, 2, 210, 211, 7, 45, 2, 2, 211, 54, 3, 2, 2, 2, 212, 213, 7, 47, 2, 2, 213, 56, 3, 2, 2, 2, 214, 215, 7, 35, 2, 2, 215, 58, 3, 2, 2, 2, 216, 217, 7, 44, 2, 2, 217, 60, 3, 2, 2, 2, 218, 219, 7, 49, 2, 2, 219, 62, 3, 2, 2, 2, 220, 221, 7, 39, 2, 2, 221, 64, 3, 2, 2, 2, 222, 223, 7, 62, 2, 2, 223, 66, 3, 2, 2, 2, 224, 225, 7, 64, 2, 2, 225, 68, 3, 2, 2, 2, 226, 227, 7, 62, 2, 2, 227, 228, 7, 63, 2, 2, 228, 70, 3, 2, 2, 2, 229, 230, 7, 64, 2, 2, 230, 231, 7, 63, 2, 2, 231, 72, 3, 2, 2, 2, 232, 233, 7, 63, 2, 2, 233, 234, 7, 63, 2, 2, 234, 74, 3, 2, 2, 2, 235, 236, 7, 35, 2, 2, 236, 237, 7, 63, 2, 2, 237, 76, 3, 2, 2, 2, 238, 239, 7, 40, 2, 2, 239, 240, 7, 40, 2, 2, 240, 78, 3, 2, 2, 2, 241, 242, 7, 126, 2, 2, 242, 243, 7, 126, 2, 2, 243, 80, 3, 2, 2, 2, 244, 245, 9, 2, 2, 2, 245, 82, 3, 2, 2, 2, 246, 247, 4, 50, 59, 2, 247, 84, 3, 2, 2, 2, 248, 251, 5, 83, 42, 2, 249, 251, 9, 3, 2, 2, 250, 248, 3, 2, 2, 2, 250, 249, 3, 2, 2, 2, 251, 86, 3, 2, 2, 2, 252, 261, 7, 50, 2, 2, 253, 257, 4, 51, 59, 2, 254, 256, 5, 83, 42, 2, 255, 254, 3, 2, 2, 2, 256, 259, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 261, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 260, 252, 3, 2, 2, 2, 260, 253, 3, 2, 2, 2, 261, 88, 3, 2, 2, 2, 262, 263, 7, 50, 2, 2, 263, 267, 7, 122, 2, 2, 264, 265, 7, 50, 2, 2, 265, 267, 7, 90, 2, 2, 266, 262, 3, 2, 2, 2, 266, 264, 3, 2, 2, 2, 267, 269, 3, 2, 2, 2, 268, 270, 5, 85, 43, 2, 269, 268, 3, 2, 2, 2, 270, 271, 3, 2, 2, 2, 271, 269, 3, 2, 2, 2, 271, 272, 3, 2, 2, 2, 272, 90, 3, 2, 2, 2, 273, 276, 5, 87, 44, 2, 274, 276, 5, 89, 45, 2, 275, 273, 3, 2, 2, 2, 275, 274, 3, 2, 2, 2, 276, 92, 3, 2, 2, 2, 277, 278, 7, 104, 2, 2, 278, 279, 7, 99, 2, 2, 279, 280, 7, 110, 2, 2, 280, 281, 7, 117, 2, 2, 281, 287, 7, 103, 2, 2, 282, 283, 7, 118, 2, 2, 283, 284, 7, 116, 2, 2, 284, 285, 7, 119, 2, 2, 285, 287, 7, 103, 2, 2, 286, 277, 3, 2, 2, 2, 286, 282, 3, 2, 2, 2, 287, 94, 3, 2, 2, 2, 288, 293, 5, 81, 41, 2, 289, 292, 5, 81, 41, 2, 290, 292, 5, 83, 42, 2, 291, 289, 3, 2, 2, 2, 291, 290, 3, 2, 2, 2, 292, 295, 3, 2, 2, 2, 293, 291, 3, 2, 2, 2, 293, 294, 3, 2, 2, 2, 294, 96, 3, 2, 2, 2, 295, 293, 3, 2, 2, 2, 296, 297, 7, 49, 2, 2, 297, 298, 7, 44, 2, 2, 298, 302, 3, 2, 2, 2, 299, 301, 11, 2, 2, 2, 300, 299, 3, 2, 2, 2, 301, 304, 3, 2, 2, 2, 302, 303, 3, 2, 2, 2, 302, 300, 3, 2, 2, 2, 303, 305, 3, 2, 2, 2, 304, 302, 3, 2, 2, 2, 305, 306, 7, 44, 2, 2, 306, 307, 7, 49, 2, 2, 307, 308, 3, 2, 2, 2, 308, 309, 8, 49, 2, 2, 309, 98, 3, 2, 2, 2, 310, 311, 7, 49, 2, 2, 311, 312, 7, 49, 2, 2, 312, 316, 3, 2, 2, 2, 313, 315, 10, 4, 2, 2, 314, 313, 3, 2, 2, 2, 315, 318, 3, 2, 2, 2, 316, 314, 3, 2, 2, 2, 316, 317, 3, 2, 2, 2, 317, 319, 3, 2, 2, 2, 318, 316, 3, 2, 2, 2, 319, 320, 8, 50, 2, 2, 320, 100, 3, 2, 2, 2, 321, 322, 9, 5, 2, 2, 322, 323, 3, 2, 2, 2, 323, 324, 8, 51, 2, 2, 324, 102, 3, 2, 2, 2, 325, 326, 11, 2, 2, 2, 326, 104, 3, 2, 2, 2, 14, 2, 250, 257, 260, 266, 271, 275, 286, 291, 293, 302, 316, 3, 8, 2, 2] \ No newline at end of file diff --git a/src/cd/frontend/parser/JavaliLexer.java b/src/cd/frontend/parser/JavaliLexer.java new file mode 100644 index 0000000..50aec9c --- /dev/null +++ b/src/cd/frontend/parser/JavaliLexer.java @@ -0,0 +1,232 @@ +// Generated from /home/carlos/eth/cd/nop90/HW2/src/cd/frontend/parser/Javali.g4 by ANTLR 4.7.1 + + // Java header + package cd.frontend.parser; + +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 JavaliLexer extends Lexer { + static { RuntimeMetaData.checkVersion("4.7.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, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, + T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17, + T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24, + T__24=25, T__25=26, T__26=27, T__27=28, T__28=29, T__29=30, T__30=31, + T__31=32, T__32=33, T__33=34, T__34=35, T__35=36, T__36=37, T__37=38, + T__38=39, Integer=40, Boolean=41, Ident=42, COMMENT=43, LINE_COMMENT=44, + WS=45, ErrorCharacter=46; + public static String[] channelNames = { + "DEFAULT_TOKEN_CHANNEL", "HIDDEN" + }; + + public static String[] modeNames = { + "DEFAULT_MODE" + }; + + public static final String[] ruleNames = { + "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", + "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", + "T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24", + "T__25", "T__26", "T__27", "T__28", "T__29", "T__30", "T__31", "T__32", + "T__33", "T__34", "T__35", "T__36", "T__37", "T__38", "Letter", "Digit", + "HexDigit", "Decimal", "Hexadecimal", "Integer", "Boolean", "Ident", "COMMENT", + "LINE_COMMENT", "WS", "ErrorCharacter" + }; + + private static final String[] _LITERAL_NAMES = { + null, "'null'", "'['", "']'", "'boolean'", "'int'", "'class'", "'extends'", + "'{'", "'}'", "','", "';'", "'void'", "'('", "')'", "'.'", "'='", "'write'", + "'writeln'", "'if'", "'else'", "'while'", "'return'", "'new'", "'read'", + "'this'", "'+'", "'-'", "'!'", "'*'", "'/'", "'%'", "'<'", "'>'", "'<='", + "'>='", "'=='", "'!='", "'&&'", "'||'" + }; + private static final String[] _SYMBOLIC_NAMES = { + null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, "Integer", "Boolean", "Ident", "COMMENT", "LINE_COMMENT", + "WS", "ErrorCharacter" + }; + 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] = "Note: this list may contain null pointers!
*/
public final List