/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This interface defines constant that are used
* throughout the compiler. It inherits from RuntimeConstants,
* which is an autogenerated class that contains contstants
* defined in the interpreter.
*
* WARNING: The contents of this source file are not part of any
* supported API. Code that depends on them does so at its own risk:
* they are subject to change or removal without notice.
*
* @author Arthur van Hoff
*/
public
/*
* compiler. When included, the tracing code may be selectively
* Should normally be 'false' for a release version.
*/
public static final boolean tracing = true;
/*
* Frequently used identifiers
*/
// JCOV
// end JCOV
/* methods we need to know about */
/* This is not a real signature marker, since it is also
* an identifier constituent character.
*/
/*
* Flags
*/
// The meaning of -g has changed, so F_DEBUG flag is removed.
// public static final int F_DEBUG = 1 << 3;
// The meaning of -O has changed, so F_OPTIMIZE flag is removed.
// public static final int F_OPTIMIZE = 1 << 4;
// JCOV
// end JCOV
/*
* Modifiers.
*
* There has been much confusion regarding modifiers. There
* are a number of distinct usages:
*
* - in classfiles to annotate classes, as per JVM pg. 102.
* - in classfiles to annotate methods, as per JVM pg. 104.
* - in classfiles to annotate InnerClass attributes, as per
* - in the compiler to record java source level modifiers,
* as per JLS pg. 157 et al., plus misc. info such as whether
* a method is deprecated
* - in the JVM to record misc. info, such as whether a method has
* has been compiled
*
* To make matters worse, the terms "access flags" and "modifiers"
* are often used interchangably, and some information that might
* make sense as a flag is expressed using attributes (ie. Synthetic).
*
* The constants defined herein have been divided by whether they
* make sense only within the compiler (M_* and MM_*) or whether
* they only make sense to the JVM (ACC_* and ACCM_*). At an earlier
* time these were all lumped together. Future maintenance should
* strive to keep the distinction clear.
*
* Note that modifier M_STRICTFP is not in general recoverable from
* the ACC_STRICT bit in classfiles.
*
* Note also that the modifiers M_LOCAL and M_ANONYMOUS do not appear
* in the InnerClass attribute, as they are above the first 16 bits.
*/
// Modifiers meaningful to both Java source and the JVM. These
// have been kept the same bit in the M_* and ACC_* forms
// to avoid destabilizing the compiler.
// Modifiers not meaningful to the JVM. The JVM only allows 16 bits
// for modifiers, so keeping these in the unusable bits after the first
// 16 is a good idea.
// Masks for modifiers that apply to Java source code
| M_FINAL
| M_STRICTFP;
| M_FINAL
| M_STATIC;
| M_VOLATILE;
| M_NATIVE
| M_STRICTFP;
// Masks for modifiers that apply to class files.
// Note that the M_SYNTHETIC modifier is never written out to a class file.
// Synthetic members are indicated using the "Synthetic" attribute.
| ACC_STRICT;
| ACC_STATIC;
// The M_ANONYMOUS and M_LOCAL modifiers are not mentioned in the
// inner classes specification and are never written to classfiles.
// Also note that ACC_SUPER should never be set in an InnerClass
// attribute.
| ACC_STRICT;
| ACC_VOLATILE;
| ACC_STRICT;
/*
* Type codes
*/
// JCOV
/*
* Cover's types
*/
// end JCOV
/*
* Type Masks
*/
/*
* Class status
*/
/*
* Attributes
*/
/*
* Number of bits used in file offsets. The line number and
* file offset are concatenated into a long, with enough room
* for other information to be added later if desired (such as
* token lengths). For the moment explicit bit manipulations
* are used to modify the fields. This makes sense for efficiency
* but at some point these ought to be better encapsulated.
*/
/*
* Operators
*/
/*
* Value tokens
*/
/*
* Type keywords
*/
/*
* Expression keywords
*/
/*
* Statement keywords
*/
/*
* Declaration keywords
*/
/*
* Modifier keywords
*/
/*
* Punctuation
*/
/*
* Special tokens
*/
/*
* Operator precedence
*/
int opPrecedence[] = {
10, 11, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 12, 13, 14, 15, 16, 17, 18,
18, 19, 19, 19, 19, 19, 20, 20, 20, 21,
21, 22, 22, 22, 23, 24, 24, 24, 24, 24,
24, 25, 25, 26, 26, 26, 26, 26, 26
};
/*
* Operator names
*/
",", "=", "*=", "/=", "%=",
"+=", "-=", "<<=", ">>=", ">>>=",
"&=", "|=", "^=", "?:", "||",
"&&", "|", "^", "&", "!=",
"==", ">=", ">", "<=", "<",
"instanceof", "<<", ">>", ">>>", "+",
"-", "/", "%", "*", "cast",
"+", "-", "!", "~", "++",
"--", "new", "new", "new", "++",
"--", "field","method","[]", "new",
"Identifier", "boolean", "byte", "char", "short",
"int", "long", "float", "double", "string",
"byte", "char", "short", "int", "long",
"true", "false", "this", "super", "null",
"if", "else", "for", "while","do",
"switch", "case", "default", "break", "continue",
"return", "try", "catch", "finally", "throw",
"import", "class", "extends", "implements", "interface",
"private", "public", "protected", "const", "static",
"transient", "synchronized", "native", "final", "volatile",
";", ":", "?", "{", "}",
"(", ")", "[", "]", "throws",
"error", "comment", "type", "length", "inline-return",
"inline-method", "inline-new"
};
}