Wed, 09 Apr 2008 13:41:45 +0100
5009937: hiding versus generics versus binary compatibility
Summary: missing implementation of JLS 8.4.8.3 (different arguments with same erasure not always triggering a compiler error)
Reviewed-by: jjg
duke@1 | 1 | /* |
duke@1 | 2 | * Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. |
duke@1 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@1 | 4 | * |
duke@1 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@1 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@1 | 7 | * published by the Free Software Foundation. Sun designates this |
duke@1 | 8 | * particular file as subject to the "Classpath" exception as provided |
duke@1 | 9 | * by Sun in the LICENSE file that accompanied this code. |
duke@1 | 10 | * |
duke@1 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@1 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@1 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@1 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@1 | 15 | * accompanied this code). |
duke@1 | 16 | * |
duke@1 | 17 | * You should have received a copy of the GNU General Public License version |
duke@1 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@1 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@1 | 20 | * |
duke@1 | 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
duke@1 | 22 | * CA 95054 USA or visit www.sun.com if you need additional information or |
duke@1 | 23 | * have any questions. |
duke@1 | 24 | */ |
duke@1 | 25 | |
duke@1 | 26 | package com.sun.tools.javac.parser; |
duke@1 | 27 | |
duke@1 | 28 | |
duke@1 | 29 | /** An interface that defines codes for Java source tokens |
duke@1 | 30 | * returned from lexical analysis. |
duke@1 | 31 | * |
duke@1 | 32 | * <p><b>This is NOT part of any API supported by Sun Microsystems. If |
duke@1 | 33 | * you write code that depends on this, you do so at your own risk. |
duke@1 | 34 | * This code and its internal interfaces are subject to change or |
duke@1 | 35 | * deletion without notice.</b> |
duke@1 | 36 | */ |
duke@1 | 37 | public enum Token { |
duke@1 | 38 | EOF, |
duke@1 | 39 | ERROR, |
duke@1 | 40 | IDENTIFIER, |
duke@1 | 41 | ABSTRACT("abstract"), |
duke@1 | 42 | ASSERT("assert"), |
duke@1 | 43 | BOOLEAN("boolean"), |
duke@1 | 44 | BREAK("break"), |
duke@1 | 45 | BYTE("byte"), |
duke@1 | 46 | CASE("case"), |
duke@1 | 47 | CATCH("catch"), |
duke@1 | 48 | CHAR("char"), |
duke@1 | 49 | CLASS("class"), |
duke@1 | 50 | CONST("const"), |
duke@1 | 51 | CONTINUE("continue"), |
duke@1 | 52 | DEFAULT("default"), |
duke@1 | 53 | DO("do"), |
duke@1 | 54 | DOUBLE("double"), |
duke@1 | 55 | ELSE("else"), |
duke@1 | 56 | ENUM("enum"), |
duke@1 | 57 | EXTENDS("extends"), |
duke@1 | 58 | FINAL("final"), |
duke@1 | 59 | FINALLY("finally"), |
duke@1 | 60 | FLOAT("float"), |
duke@1 | 61 | FOR("for"), |
duke@1 | 62 | GOTO("goto"), |
duke@1 | 63 | IF("if"), |
duke@1 | 64 | IMPLEMENTS("implements"), |
duke@1 | 65 | IMPORT("import"), |
duke@1 | 66 | INSTANCEOF("instanceof"), |
duke@1 | 67 | INT("int"), |
duke@1 | 68 | INTERFACE("interface"), |
duke@1 | 69 | LONG("long"), |
duke@1 | 70 | NATIVE("native"), |
duke@1 | 71 | NEW("new"), |
duke@1 | 72 | PACKAGE("package"), |
duke@1 | 73 | PRIVATE("private"), |
duke@1 | 74 | PROTECTED("protected"), |
duke@1 | 75 | PUBLIC("public"), |
duke@1 | 76 | RETURN("return"), |
duke@1 | 77 | SHORT("short"), |
duke@1 | 78 | STATIC("static"), |
duke@1 | 79 | STRICTFP("strictfp"), |
duke@1 | 80 | SUPER("super"), |
duke@1 | 81 | SWITCH("switch"), |
duke@1 | 82 | SYNCHRONIZED("synchronized"), |
duke@1 | 83 | THIS("this"), |
duke@1 | 84 | THROW("throw"), |
duke@1 | 85 | THROWS("throws"), |
duke@1 | 86 | TRANSIENT("transient"), |
duke@1 | 87 | TRY("try"), |
duke@1 | 88 | VOID("void"), |
duke@1 | 89 | VOLATILE("volatile"), |
duke@1 | 90 | WHILE("while"), |
duke@1 | 91 | INTLITERAL, |
duke@1 | 92 | LONGLITERAL, |
duke@1 | 93 | FLOATLITERAL, |
duke@1 | 94 | DOUBLELITERAL, |
duke@1 | 95 | CHARLITERAL, |
duke@1 | 96 | STRINGLITERAL, |
duke@1 | 97 | TRUE("true"), |
duke@1 | 98 | FALSE("false"), |
duke@1 | 99 | NULL("null"), |
duke@1 | 100 | LPAREN("("), |
duke@1 | 101 | RPAREN(")"), |
duke@1 | 102 | LBRACE("{"), |
duke@1 | 103 | RBRACE("}"), |
duke@1 | 104 | LBRACKET("["), |
duke@1 | 105 | RBRACKET("]"), |
duke@1 | 106 | SEMI(";"), |
duke@1 | 107 | COMMA(","), |
duke@1 | 108 | DOT("."), |
duke@1 | 109 | ELLIPSIS("..."), |
duke@1 | 110 | EQ("="), |
duke@1 | 111 | GT(">"), |
duke@1 | 112 | LT("<"), |
duke@1 | 113 | BANG("!"), |
duke@1 | 114 | TILDE("~"), |
duke@1 | 115 | QUES("?"), |
duke@1 | 116 | COLON(":"), |
duke@1 | 117 | EQEQ("=="), |
duke@1 | 118 | LTEQ("<="), |
duke@1 | 119 | GTEQ(">="), |
duke@1 | 120 | BANGEQ("!="), |
duke@1 | 121 | AMPAMP("&&"), |
duke@1 | 122 | BARBAR("||"), |
duke@1 | 123 | PLUSPLUS("++"), |
duke@1 | 124 | SUBSUB("--"), |
duke@1 | 125 | PLUS("+"), |
duke@1 | 126 | SUB("-"), |
duke@1 | 127 | STAR("*"), |
duke@1 | 128 | SLASH("/"), |
duke@1 | 129 | AMP("&"), |
duke@1 | 130 | BAR("|"), |
duke@1 | 131 | CARET("^"), |
duke@1 | 132 | PERCENT("%"), |
duke@1 | 133 | LTLT("<<"), |
duke@1 | 134 | GTGT(">>"), |
duke@1 | 135 | GTGTGT(">>>"), |
duke@1 | 136 | PLUSEQ("+="), |
duke@1 | 137 | SUBEQ("-="), |
duke@1 | 138 | STAREQ("*="), |
duke@1 | 139 | SLASHEQ("/="), |
duke@1 | 140 | AMPEQ("&="), |
duke@1 | 141 | BAREQ("|="), |
duke@1 | 142 | CARETEQ("^="), |
duke@1 | 143 | PERCENTEQ("%="), |
duke@1 | 144 | LTLTEQ("<<="), |
duke@1 | 145 | GTGTEQ(">>="), |
duke@1 | 146 | GTGTGTEQ(">>>="), |
duke@1 | 147 | MONKEYS_AT("@"), |
duke@1 | 148 | CUSTOM; |
duke@1 | 149 | |
duke@1 | 150 | Token() { |
duke@1 | 151 | this(null); |
duke@1 | 152 | } |
duke@1 | 153 | Token(String name) { |
duke@1 | 154 | this.name = name; |
duke@1 | 155 | } |
duke@1 | 156 | |
duke@1 | 157 | public final String name; |
duke@1 | 158 | } |