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