Wed, 02 Jul 2008 12:56:02 -0700
6719955: Update copyright year
Summary: Update copyright year for files that have been modified in 2008
Reviewed-by: ohair, tbell
duke@1 | 1 | /* |
duke@1 | 2 | * Copyright 2002 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 | |
duke@1 | 27 | |
duke@1 | 28 | package sun.tools.javap; |
duke@1 | 29 | |
duke@1 | 30 | /** |
duke@1 | 31 | * This interface defines constant that are used |
duke@1 | 32 | * throughout the compiler. It inherits from RuntimeConstants, |
duke@1 | 33 | * which is an autogenerated class that contains contstants |
duke@1 | 34 | * defined in the interpreter. |
duke@1 | 35 | */ |
duke@1 | 36 | |
duke@1 | 37 | public |
duke@1 | 38 | interface Constants extends RuntimeConstants { |
duke@1 | 39 | |
duke@1 | 40 | /** |
duke@1 | 41 | * End of input |
duke@1 | 42 | */ |
duke@1 | 43 | public static final int EOF = -1; |
duke@1 | 44 | |
duke@1 | 45 | /* |
duke@1 | 46 | * Flags |
duke@1 | 47 | */ |
duke@1 | 48 | public static final int F_VERBOSE = 1 << 0; |
duke@1 | 49 | public static final int F_DUMP = 1 << 1; |
duke@1 | 50 | public static final int F_WARNINGS = 1 << 2; |
duke@1 | 51 | public static final int F_DEBUG = 1 << 3; |
duke@1 | 52 | public static final int F_OPTIMIZE = 1 << 4; |
duke@1 | 53 | public static final int F_DEPENDENCIES = 1 << 5; |
duke@1 | 54 | |
duke@1 | 55 | /* |
duke@1 | 56 | * Type codes |
duke@1 | 57 | */ |
duke@1 | 58 | public static final int TC_BOOLEAN = 0; |
duke@1 | 59 | public static final int TC_BYTE = 1; |
duke@1 | 60 | public static final int TC_CHAR = 2; |
duke@1 | 61 | public static final int TC_SHORT = 3; |
duke@1 | 62 | public static final int TC_INT = 4; |
duke@1 | 63 | public static final int TC_LONG = 5; |
duke@1 | 64 | public static final int TC_FLOAT = 6; |
duke@1 | 65 | public static final int TC_DOUBLE = 7; |
duke@1 | 66 | public static final int TC_NULL = 8; |
duke@1 | 67 | public static final int TC_ARRAY = 9; |
duke@1 | 68 | public static final int TC_CLASS = 10; |
duke@1 | 69 | public static final int TC_VOID = 11; |
duke@1 | 70 | public static final int TC_METHOD = 12; |
duke@1 | 71 | public static final int TC_ERROR = 13; |
duke@1 | 72 | |
duke@1 | 73 | /* |
duke@1 | 74 | * Type Masks |
duke@1 | 75 | */ |
duke@1 | 76 | public static final int TM_NULL = 1 << TC_NULL; |
duke@1 | 77 | public static final int TM_VOID = 1 << TC_VOID; |
duke@1 | 78 | public static final int TM_BOOLEAN = 1 << TC_BOOLEAN; |
duke@1 | 79 | public static final int TM_BYTE = 1 << TC_BYTE; |
duke@1 | 80 | public static final int TM_CHAR = 1 << TC_CHAR; |
duke@1 | 81 | public static final int TM_SHORT = 1 << TC_SHORT; |
duke@1 | 82 | public static final int TM_INT = 1 << TC_INT; |
duke@1 | 83 | public static final int TM_LONG = 1 << TC_LONG; |
duke@1 | 84 | public static final int TM_FLOAT = 1 << TC_FLOAT; |
duke@1 | 85 | public static final int TM_DOUBLE = 1 << TC_DOUBLE; |
duke@1 | 86 | public static final int TM_ARRAY = 1 << TC_ARRAY; |
duke@1 | 87 | public static final int TM_CLASS = 1 << TC_CLASS; |
duke@1 | 88 | public static final int TM_METHOD = 1 << TC_METHOD; |
duke@1 | 89 | public static final int TM_ERROR = 1 << TC_ERROR; |
duke@1 | 90 | |
duke@1 | 91 | public static final int TM_INT32 = TM_BYTE | TM_SHORT | TM_CHAR | TM_INT; |
duke@1 | 92 | public static final int TM_NUM32 = TM_INT32 | TM_FLOAT; |
duke@1 | 93 | public static final int TM_NUM64 = TM_LONG | TM_DOUBLE; |
duke@1 | 94 | public static final int TM_INTEGER = TM_INT32 | TM_LONG; |
duke@1 | 95 | public static final int TM_REAL = TM_FLOAT | TM_DOUBLE; |
duke@1 | 96 | public static final int TM_NUMBER = TM_INTEGER | TM_REAL; |
duke@1 | 97 | public static final int TM_REFERENCE = TM_ARRAY | TM_CLASS | TM_NULL; |
duke@1 | 98 | |
duke@1 | 99 | /* |
duke@1 | 100 | * Class status |
duke@1 | 101 | */ |
duke@1 | 102 | public static final int CS_UNDEFINED = 0; |
duke@1 | 103 | public static final int CS_UNDECIDED = 1; |
duke@1 | 104 | public static final int CS_BINARY = 2; |
duke@1 | 105 | public static final int CS_SOURCE = 3; |
duke@1 | 106 | public static final int CS_PARSED = 4; |
duke@1 | 107 | public static final int CS_COMPILED = 5; |
duke@1 | 108 | public static final int CS_NOTFOUND = 6; |
duke@1 | 109 | |
duke@1 | 110 | /* |
duke@1 | 111 | * Attributes |
duke@1 | 112 | */ |
duke@1 | 113 | public static final int ATT_ALL = -1; |
duke@1 | 114 | public static final int ATT_CODE = 1; |
duke@1 | 115 | |
duke@1 | 116 | /* |
duke@1 | 117 | * Number of bits used in file offsets |
duke@1 | 118 | */ |
duke@1 | 119 | public static final int OFFSETBITS = 19; |
duke@1 | 120 | public static final int MAXFILESIZE = (1 << OFFSETBITS) - 1; |
duke@1 | 121 | public static final int MAXLINENUMBER = (1 << (32 - OFFSETBITS)) - 1; |
duke@1 | 122 | |
duke@1 | 123 | /* |
duke@1 | 124 | * Operators |
duke@1 | 125 | */ |
duke@1 | 126 | public final int COMMA = 0; |
duke@1 | 127 | public final int ASSIGN = 1; |
duke@1 | 128 | |
duke@1 | 129 | public final int ASGMUL = 2; |
duke@1 | 130 | public final int ASGDIV = 3; |
duke@1 | 131 | public final int ASGREM = 4; |
duke@1 | 132 | public final int ASGADD = 5; |
duke@1 | 133 | public final int ASGSUB = 6; |
duke@1 | 134 | public final int ASGLSHIFT = 7; |
duke@1 | 135 | public final int ASGRSHIFT = 8; |
duke@1 | 136 | public final int ASGURSHIFT = 9; |
duke@1 | 137 | public final int ASGBITAND = 10; |
duke@1 | 138 | public final int ASGBITOR = 11; |
duke@1 | 139 | public final int ASGBITXOR = 12; |
duke@1 | 140 | |
duke@1 | 141 | public final int COND = 13; |
duke@1 | 142 | public final int OR = 14; |
duke@1 | 143 | public final int AND = 15; |
duke@1 | 144 | public final int BITOR = 16; |
duke@1 | 145 | public final int BITXOR = 17; |
duke@1 | 146 | public final int BITAND = 18; |
duke@1 | 147 | public final int NE = 19; |
duke@1 | 148 | public final int EQ = 20; |
duke@1 | 149 | public final int GE = 21; |
duke@1 | 150 | public final int GT = 22; |
duke@1 | 151 | public final int LE = 23; |
duke@1 | 152 | public final int LT = 24; |
duke@1 | 153 | public final int INSTANCEOF = 25; |
duke@1 | 154 | public final int LSHIFT = 26; |
duke@1 | 155 | public final int RSHIFT = 27; |
duke@1 | 156 | public final int URSHIFT = 28; |
duke@1 | 157 | public final int ADD = 29; |
duke@1 | 158 | public final int SUB = 30; |
duke@1 | 159 | public final int DIV = 31; |
duke@1 | 160 | public final int REM = 32; |
duke@1 | 161 | public final int MUL = 33; |
duke@1 | 162 | public final int CAST = 34; // (x)y |
duke@1 | 163 | public final int POS = 35; // +x |
duke@1 | 164 | public final int NEG = 36; // -x |
duke@1 | 165 | public final int NOT = 37; |
duke@1 | 166 | public final int BITNOT = 38; |
duke@1 | 167 | public final int PREINC = 39; // ++x |
duke@1 | 168 | public final int PREDEC = 40; // --x |
duke@1 | 169 | public final int NEWARRAY = 41; |
duke@1 | 170 | public final int NEWINSTANCE = 42; |
duke@1 | 171 | public final int NEWFROMNAME = 43; |
duke@1 | 172 | public final int POSTINC = 44; // x++ |
duke@1 | 173 | public final int POSTDEC = 45; // x-- |
duke@1 | 174 | public final int FIELD = 46; |
duke@1 | 175 | public final int METHOD = 47; // x(y) |
duke@1 | 176 | public final int ARRAYACCESS = 48; // x[y] |
duke@1 | 177 | public final int NEW = 49; |
duke@1 | 178 | public final int INC = 50; |
duke@1 | 179 | public final int DEC = 51; |
duke@1 | 180 | |
duke@1 | 181 | public final int CONVERT = 55; // implicit conversion |
duke@1 | 182 | public final int EXPR = 56; // (x) |
duke@1 | 183 | public final int ARRAY = 57; // {x, y, ...} |
duke@1 | 184 | public final int GOTO = 58; |
duke@1 | 185 | |
duke@1 | 186 | /* |
duke@1 | 187 | * Value tokens |
duke@1 | 188 | */ |
duke@1 | 189 | public final int IDENT = 60; |
duke@1 | 190 | public final int BOOLEANVAL = 61; |
duke@1 | 191 | public final int BYTEVAL = 62; |
duke@1 | 192 | public final int CHARVAL = 63; |
duke@1 | 193 | public final int SHORTVAL = 64; |
duke@1 | 194 | public final int INTVAL = 65; |
duke@1 | 195 | public final int LONGVAL = 66; |
duke@1 | 196 | public final int FLOATVAL = 67; |
duke@1 | 197 | public final int DOUBLEVAL = 68; |
duke@1 | 198 | public final int STRINGVAL = 69; |
duke@1 | 199 | |
duke@1 | 200 | /* |
duke@1 | 201 | * Type keywords |
duke@1 | 202 | */ |
duke@1 | 203 | public final int BYTE = 70; |
duke@1 | 204 | public final int CHAR = 71; |
duke@1 | 205 | public final int SHORT = 72; |
duke@1 | 206 | public final int INT = 73; |
duke@1 | 207 | public final int LONG = 74; |
duke@1 | 208 | public final int FLOAT = 75; |
duke@1 | 209 | public final int DOUBLE = 76; |
duke@1 | 210 | public final int VOID = 77; |
duke@1 | 211 | public final int BOOLEAN = 78; |
duke@1 | 212 | |
duke@1 | 213 | /* |
duke@1 | 214 | * Expression keywords |
duke@1 | 215 | */ |
duke@1 | 216 | public final int TRUE = 80; |
duke@1 | 217 | public final int FALSE = 81; |
duke@1 | 218 | public final int THIS = 82; |
duke@1 | 219 | public final int SUPER = 83; |
duke@1 | 220 | public final int NULL = 84; |
duke@1 | 221 | |
duke@1 | 222 | /* |
duke@1 | 223 | * Statement keywords |
duke@1 | 224 | */ |
duke@1 | 225 | public final int IF = 90; |
duke@1 | 226 | public final int ELSE = 91; |
duke@1 | 227 | public final int FOR = 92; |
duke@1 | 228 | public final int WHILE = 93; |
duke@1 | 229 | public final int DO = 94; |
duke@1 | 230 | public final int SWITCH = 95; |
duke@1 | 231 | public final int CASE = 96; |
duke@1 | 232 | public final int DEFAULT = 97; |
duke@1 | 233 | public final int BREAK = 98; |
duke@1 | 234 | public final int CONTINUE = 99; |
duke@1 | 235 | public final int RETURN = 100; |
duke@1 | 236 | public final int TRY = 101; |
duke@1 | 237 | public final int CATCH = 102; |
duke@1 | 238 | public final int FINALLY = 103; |
duke@1 | 239 | public final int THROW = 104; |
duke@1 | 240 | public final int STAT = 105; |
duke@1 | 241 | public final int EXPRESSION = 106; |
duke@1 | 242 | public final int DECLARATION = 107; |
duke@1 | 243 | public final int VARDECLARATION = 108; |
duke@1 | 244 | |
duke@1 | 245 | /* |
duke@1 | 246 | * Declaration keywords |
duke@1 | 247 | */ |
duke@1 | 248 | public final int IMPORT = 110; |
duke@1 | 249 | public final int CLASS = 111; |
duke@1 | 250 | public final int EXTENDS = 112; |
duke@1 | 251 | public final int IMPLEMENTS = 113; |
duke@1 | 252 | public final int INTERFACE = 114; |
duke@1 | 253 | public final int PACKAGE = 115; |
duke@1 | 254 | |
duke@1 | 255 | /* |
duke@1 | 256 | * Modifier keywords |
duke@1 | 257 | */ |
duke@1 | 258 | public final int PRIVATE = 120; |
duke@1 | 259 | public final int PUBLIC = 121; |
duke@1 | 260 | public final int PROTECTED = 122; |
duke@1 | 261 | public final int CONST = 123; |
duke@1 | 262 | public final int STATIC = 124; |
duke@1 | 263 | public final int TRANSIENT = 125; |
duke@1 | 264 | public final int SYNCHRONIZED = 126; |
duke@1 | 265 | public final int NATIVE = 127; |
duke@1 | 266 | public final int FINAL = 128; |
duke@1 | 267 | public final int VOLATILE = 129; |
duke@1 | 268 | public final int ABSTRACT = 130; |
duke@1 | 269 | public final int STRICT = 165; |
duke@1 | 270 | |
duke@1 | 271 | /* |
duke@1 | 272 | * Punctuation |
duke@1 | 273 | */ |
duke@1 | 274 | public final int SEMICOLON = 135; |
duke@1 | 275 | public final int COLON = 136; |
duke@1 | 276 | public final int QUESTIONMARK = 137; |
duke@1 | 277 | public final int LBRACE = 138; |
duke@1 | 278 | public final int RBRACE = 139; |
duke@1 | 279 | public final int LPAREN = 140; |
duke@1 | 280 | public final int RPAREN = 141; |
duke@1 | 281 | public final int LSQBRACKET = 142; |
duke@1 | 282 | public final int RSQBRACKET = 143; |
duke@1 | 283 | public final int THROWS = 144; |
duke@1 | 284 | |
duke@1 | 285 | /* |
duke@1 | 286 | * Special tokens |
duke@1 | 287 | */ |
duke@1 | 288 | public final int ERROR = 145; // an error |
duke@1 | 289 | public final int COMMENT = 146; // not used anymore. |
duke@1 | 290 | public final int TYPE = 147; |
duke@1 | 291 | public final int LENGTH = 148; |
duke@1 | 292 | public final int INLINERETURN = 149; |
duke@1 | 293 | public final int INLINEMETHOD = 150; |
duke@1 | 294 | public final int INLINENEWINSTANCE = 151; |
duke@1 | 295 | |
duke@1 | 296 | /* |
duke@1 | 297 | * Added for jasm |
duke@1 | 298 | */ |
duke@1 | 299 | public final int METHODREF = 152; |
duke@1 | 300 | public final int FIELDREF = 153; |
duke@1 | 301 | public final int STACK = 154; |
duke@1 | 302 | public final int LOCAL = 155; |
duke@1 | 303 | public final int CPINDEX = 156; |
duke@1 | 304 | public final int CPNAME = 157; |
duke@1 | 305 | public final int SIGN = 158; |
duke@1 | 306 | public final int BITS = 159; |
duke@1 | 307 | public final int INF = 160; |
duke@1 | 308 | public final int NAN = 161; |
duke@1 | 309 | public final int INNERCLASS = 162; |
duke@1 | 310 | public final int OF = 163; |
duke@1 | 311 | public final int SYNTHETIC = 164; |
duke@1 | 312 | // last used=165; |
duke@1 | 313 | |
duke@1 | 314 | /* |
duke@1 | 315 | * Operator precedence |
duke@1 | 316 | */ |
duke@1 | 317 | public static final int opPrecedence[] = { |
duke@1 | 318 | 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, |
duke@1 | 319 | 11, 11, 11, 12, 13, 14, 15, 16, 17, 18, |
duke@1 | 320 | 18, 19, 19, 19, 19, 19, 20, 20, 20, 21, |
duke@1 | 321 | 21, 22, 22, 22, 23, 24, 24, 24, 24, 24, |
duke@1 | 322 | 24, 25, 25, 26, 26, 26, 26, 26, 26 |
duke@1 | 323 | }; |
duke@1 | 324 | |
duke@1 | 325 | /* |
duke@1 | 326 | * Operator names |
duke@1 | 327 | */ |
duke@1 | 328 | public static final String opNames[] = { |
duke@1 | 329 | ",", "=", "*=", "/=", "%=", |
duke@1 | 330 | "+=", "-=", "<<=", ">>=", "<<<=", |
duke@1 | 331 | "&=", "|=", "^=", "?:", "||", |
duke@1 | 332 | "&&", "|", "^", "&", "!=", |
duke@1 | 333 | "==", ">=", ">", "<=", "<", |
duke@1 | 334 | "instanceof", "<<", ">>", "<<<", "+", |
duke@1 | 335 | "-", "/", "%", "*", "cast", |
duke@1 | 336 | "+", "-", "!", "~", "++", |
duke@1 | 337 | "--", "new", "new", "new", "++", |
duke@1 | 338 | "--", "field", "method", "[]", "new", |
duke@1 | 339 | "++", "--", null, null, null, |
duke@1 | 340 | |
duke@1 | 341 | "convert", "expr", "array", "goto", null, |
duke@1 | 342 | |
duke@1 | 343 | "Identifier", "Boolean", "Byte", "Char", "Short", |
duke@1 | 344 | "Integer", "Long", "Float", "Double", "String", |
duke@1 | 345 | |
duke@1 | 346 | "byte", "char", "short", "int", "long", |
duke@1 | 347 | "float", "double", "void", "boolean", null, |
duke@1 | 348 | |
duke@1 | 349 | "true", "false", "this", "super", "null", |
duke@1 | 350 | null, null, null, null, null, |
duke@1 | 351 | |
duke@1 | 352 | "if", "else", "for", "while", "do", |
duke@1 | 353 | "switch", "case", "default", "break", "continue", |
duke@1 | 354 | "return", "try", "catch", "finally", "throw", |
duke@1 | 355 | "stat", "expression", "declaration", "declaration", null, |
duke@1 | 356 | |
duke@1 | 357 | "import", "class", "extends", "implements", "interface", |
duke@1 | 358 | "package", null, null, null, null, |
duke@1 | 359 | |
duke@1 | 360 | "private", "public", "protected", "const", "static", |
duke@1 | 361 | "transient", "synchronized", "native", "final", "volatile", |
duke@1 | 362 | "abstract", null, null, null, null, |
duke@1 | 363 | |
duke@1 | 364 | ";", ":", "?", "{", "}", |
duke@1 | 365 | "(", ")", "[", "]", "throws", |
duke@1 | 366 | "error", "comment", "type", "length", "inline-return", |
duke@1 | 367 | "inline-method", "inline-new", |
duke@1 | 368 | "method", "field", "stack", "locals", "CPINDEX", "CPName", "SIGN", |
duke@1 | 369 | "bits", "INF", "NaN", "InnerClass", "of", "synthetic" |
duke@1 | 370 | }; |
duke@1 | 371 | |
duke@1 | 372 | } |