private void |
UnitCompiler.addFields(Java.FieldDeclaration fd,
ClassFile cf) |
|
protected Java.PackageMemberClassDeclaration |
ClassBodyEvaluator.addPackageMemberClassDeclaration(Location location,
Java.CompilationUnit compilationUnit) |
To the given Java.CompilationUnit , add
A class declaration with the configured name, superclass and interfaces
A method declaration with the given return type, name, parameter names and values and thrown exceptions
|
private java.lang.Object |
UnitCompiler.assignmentConversion(Java.Locatable locatable,
java.lang.Object value,
IClass targetType) |
Implements "assignment conversion" (JLS7 5.2) on a constant value.
|
private void |
UnitCompiler.assignmentConversion(Java.Locatable locatable,
IClass sourceType,
IClass targetType,
java.lang.Object optionalConstantValue) |
Implements "assignment conversion" (JLS7 5.2).
|
(package private) void |
UnitCompiler.assignSyntheticParametersToSyntheticFields(Java.ConstructorDeclarator cd) |
Copies the values of the synthetic parameters of this constructor ("this$..." and "val$...") to the synthetic
fields of the object ("this$..." and "val$...").
|
private IClass |
UnitCompiler.binaryNumericPromotion(Java.Locatable locatable,
IClass type1,
CodeContext.Inserter convertInserter1,
IClass type2) |
Implements "binary numeric promotion" (5.6.2)
|
private IClass |
UnitCompiler.binaryNumericPromotion(Java.Locatable locatable,
IClass type1,
CodeContext.Inserter convertInserter1,
IClass type2,
CodeContext.Inserter convertInserter2) |
Implements "binary numeric promotion" (5.6.2), which may perform unboxing conversion.
|
private IClass |
UnitCompiler.binaryNumericPromotionType(Java.Locatable locatable,
IClass type1,
IClass type2) |
|
private void |
UnitCompiler.boxingConversion(Java.Locatable locatable,
IClass sourceType,
IClass targetType) |
|
private void |
UnitCompiler.buildLocalVariableMap(Java.Block block,
java.util.Map<java.lang.String,Java.LocalVariable> localVars) |
|
private java.util.Map<java.lang.String,Java.LocalVariable> |
UnitCompiler.buildLocalVariableMap(Java.BlockStatement blockStatement,
java.util.Map<java.lang.String,Java.LocalVariable> localVars) |
Computes and fills in the 'local variable map' for the given blockStatement .
|
protected void |
UnitCompiler.buildLocalVariableMap(Java.CatchClause catchClause,
java.util.Map<java.lang.String,Java.LocalVariable> localVars) |
Adds the given localVars to the 'local variable map' of the given catchClause .
|
private void |
UnitCompiler.buildLocalVariableMap(Java.DoStatement ds,
java.util.Map<java.lang.String,Java.LocalVariable> localVars) |
|
private void |
UnitCompiler.buildLocalVariableMap(Java.ForEachStatement fes,
java.util.Map<java.lang.String,Java.LocalVariable> localVars) |
|
private void |
UnitCompiler.buildLocalVariableMap(Java.ForStatement fs,
java.util.Map<java.lang.String,Java.LocalVariable> localVars) |
|
private void |
UnitCompiler.buildLocalVariableMap(Java.FunctionDeclarator fd) |
|
private void |
UnitCompiler.buildLocalVariableMap(Java.IfStatement is,
java.util.Map<java.lang.String,Java.LocalVariable> localVars) |
|
private void |
UnitCompiler.buildLocalVariableMap(Java.Initializer i,
java.util.Map<java.lang.String,Java.LocalVariable> localVars) |
|
private java.util.Map<java.lang.String,Java.LocalVariable> |
UnitCompiler.buildLocalVariableMap(Java.LabeledStatement ls,
java.util.Map<java.lang.String,Java.LocalVariable> localVars) |
|
private java.util.Map<java.lang.String,Java.LocalVariable> |
UnitCompiler.buildLocalVariableMap(Java.LocalVariableDeclarationStatement lvds,
java.util.Map<java.lang.String,Java.LocalVariable> localVars) |
|
private void |
UnitCompiler.buildLocalVariableMap(Java.SwitchStatement ss,
java.util.Map<java.lang.String,Java.LocalVariable> localVars) |
|
private void |
UnitCompiler.buildLocalVariableMap(Java.SynchronizedStatement ss,
java.util.Map<java.lang.String,Java.LocalVariable> localVars) |
|
private void |
UnitCompiler.buildLocalVariableMap(Java.TryStatement ts,
java.util.Map<java.lang.String,Java.LocalVariable> localVars) |
|
private void |
UnitCompiler.buildLocalVariableMap(Java.WhileStatement ws,
java.util.Map<java.lang.String,Java.LocalVariable> localVars) |
|
private void |
UnitCompiler.checkAccessible(IClass.IMember member,
Java.BlockStatement contextBlockStatement) |
Checks whether the given IClass.IMember is accessible in the given context, according to JLS7
6.6.1.BL1.B4.
|
private void |
UnitCompiler.checkAccessible(IClass iClassDeclaringMember,
Access memberAccess,
Java.BlockStatement contextBlockStatement) |
Verifies that a member (class, interface, field or method) declared in a given class is accessible from a given
block statement context, according to JLS7 6.6.1.4.
|
private void |
UnitCompiler.checkAccessible(IClass type,
Java.BlockStatement contextBlockStatement) |
Checks whether the given IClass is accessible in the given context, according to JLS7 6.6.1.2 and
6.6.1.4.
|
private void |
UnitCompiler.checkThrownException(Java.Locatable locatable,
IClass type,
Java.Scope scope) |
|
private void |
UnitCompiler.checkThrownExceptions(Java.Invocation in,
IClass.IMethod iMethod) |
|
boolean |
Compiler.compile(java.io.File[] sourceFiles) |
Reads a set of Java™ compilation units (a.k.a.
|
boolean |
Compiler.compile(Resource[] sourceResources) |
|
void |
UnitCompiler.Compilable.compile() |
|
private boolean |
UnitCompiler.compile(Java.BlockStatement bs) |
|
private void |
UnitCompiler.compile(Java.FunctionDeclarator fd,
ClassFile classFile) |
|
private void |
UnitCompiler.compile(Java.Rvalue rv) |
Some Java.Rvalue s compile more efficiently when their value is not needed, e.g.
|
private void |
UnitCompiler.compile(Java.TypeDeclaration td) |
|
private boolean |
UnitCompiler.compile2(Java.AlternateConstructorInvocation aci) |
|
private void |
UnitCompiler.compile2(Java.AnonymousClassDeclaration acd) |
|
private boolean |
UnitCompiler.compile2(Java.AssertStatement as) |
|
private void |
UnitCompiler.compile2(Java.Assignment a) |
|
private boolean |
UnitCompiler.compile2(Java.Block b) |
|
private boolean |
UnitCompiler.compile2(Java.BreakStatement bs) |
|
private void |
UnitCompiler.compile2(Java.ClassDeclaration cd) |
|
private boolean |
UnitCompiler.compile2(Java.ContinueStatement cs) |
|
private void |
UnitCompiler.compile2(Java.Crement c) |
|
private boolean |
UnitCompiler.compile2(Java.DoStatement ds) |
|
private boolean |
UnitCompiler.compile2(Java.ExpressionStatement ee) |
|
private boolean |
UnitCompiler.compile2(Java.FieldDeclaration fd) |
|
private boolean |
UnitCompiler.compile2(Java.ForEachStatement fes) |
|
private boolean |
UnitCompiler.compile2(Java.ForStatement fs) |
|
private boolean |
UnitCompiler.compile2(Java.IfStatement is) |
|
private boolean |
UnitCompiler.compile2(Java.Initializer i) |
|
private void |
UnitCompiler.compile2(Java.InnerClassDeclaration icd) |
|
private void |
UnitCompiler.compile2(Java.InterfaceDeclaration id) |
|
private boolean |
UnitCompiler.compile2(Java.LabeledStatement ls) |
|
private void |
UnitCompiler.compile2(Java.LocalClassDeclaration lcd) |
|
private boolean |
UnitCompiler.compile2(Java.LocalClassDeclarationStatement lcds) |
|
private boolean |
UnitCompiler.compile2(Java.LocalVariableDeclarationStatement lvds) |
|
private void |
UnitCompiler.compile2(Java.MemberClassDeclaration mcd) |
|
private void |
UnitCompiler.compile2(Java.PackageMemberTypeDeclaration pmtd) |
|
private void |
UnitCompiler.compile2(Java.ParenthesizedExpression pe) |
|
private boolean |
UnitCompiler.compile2(Java.ReturnStatement rs) |
|
private void |
UnitCompiler.compile2(Java.Rvalue rv) |
|
private boolean |
UnitCompiler.compile2(Java.SuperConstructorInvocation sci) |
|
private boolean |
UnitCompiler.compile2(Java.SwitchStatement ss) |
|
private boolean |
UnitCompiler.compile2(Java.SynchronizedStatement ss) |
|
private boolean |
UnitCompiler.compile2(Java.ThrowStatement ts) |
|
private boolean |
UnitCompiler.compile2(Java.TryStatement ts) |
|
private boolean |
UnitCompiler.compile2(Java.WhileStatement ws) |
|
private IClass |
UnitCompiler.compileArithmeticBinaryOperation(Java.Locatable locatable,
IClass lhsType,
java.lang.String operator,
Java.Rvalue rhs) |
The LHS operand of type lhsType is expected on the stack.
|
private IClass |
UnitCompiler.compileArithmeticOperation(Java.Locatable locatable,
IClass type,
java.util.Iterator<Java.Rvalue> operands,
java.lang.String operator) |
Execute an arithmetic operation on a sequence of operands .
|
private void |
UnitCompiler.compileBoolean(Java.Rvalue rv,
CodeContext.Offset dst,
boolean orientation) |
Some Java.Rvalue s compile more efficiently when their value is the condition for a branch.
|
private void |
UnitCompiler.compileBoolean2(Java.BinaryOperation bo,
CodeContext.Offset dst,
boolean orientation) |
|
private void |
UnitCompiler.compileBoolean2(Java.ParenthesizedExpression pe,
CodeContext.Offset dst,
boolean orientation) |
|
private void |
UnitCompiler.compileBoolean2(Java.Rvalue rv,
CodeContext.Offset dst,
boolean orientation) |
|
private void |
UnitCompiler.compileBoolean2(Java.UnaryOperation ue,
CodeContext.Offset dst,
boolean orientation) |
|
private void |
UnitCompiler.compileBridgeMethod(ClassFile cf,
IClass.IMethod base,
IClass.IMethod override) |
Compiles a bridge method which will add a method of the signature of base that delegates to override.
|
private int |
UnitCompiler.compileContext(Java.Rvalue rv) |
Generates code that determines the context of the Java.Rvalue and puts it on the operand stack.
|
private int |
UnitCompiler.compileContext2(Java.AmbiguousName an) |
|
private int |
UnitCompiler.compileContext2(Java.ArrayAccessExpression aae) |
|
private int |
UnitCompiler.compileContext2(Java.ArrayLength al) |
|
private int |
UnitCompiler.compileContext2(Java.FieldAccess fa) |
|
private int |
UnitCompiler.compileContext2(Java.FieldAccessExpression fae) |
|
private int |
UnitCompiler.compileContext2(Java.ParenthesizedExpression pe) |
|
private int |
UnitCompiler.compileContext2(Java.SuperclassFieldAccessExpression scfae) |
|
private void |
UnitCompiler.compileDeclaredMemberTypes(Java.TypeDeclaration decl,
ClassFile cf) |
Compile all of the types for this declaration
|
private void |
UnitCompiler.compileDeclaredMethods(Java.AbstractTypeDeclaration typeDeclaration,
ClassFile cf) |
Compile all of the methods for this declaration
|
private void |
UnitCompiler.compileDeclaredMethods(Java.TypeDeclaration typeDeclaration,
ClassFile cf,
int startPos) |
Compile methods for this declaration starting at startPos .
|
private void |
UnitCompiler.compileError(java.lang.String message) |
|
private void |
UnitCompiler.compileError(java.lang.String message,
Location optionalLocation) |
Issue a compile error with the given message.
|
private IClass |
UnitCompiler.compileGet(Java.Rvalue rv) |
Generates code that determines the value of the Java.Rvalue and puts it on the operand stack.
|
private IClass |
UnitCompiler.compileGet2(Java.AmbiguousName an) |
|
private IClass |
UnitCompiler.compileGet2(Java.ArrayAccessExpression aae) |
|
private IClass |
UnitCompiler.compileGet2(Java.Assignment a) |
|
private IClass |
UnitCompiler.compileGet2(Java.BinaryOperation bo) |
|
private IClass |
UnitCompiler.compileGet2(Java.BooleanRvalue brv) |
|
private IClass |
UnitCompiler.compileGet2(Java.Cast c) |
|
private IClass |
UnitCompiler.compileGet2(Java.ClassLiteral cl) |
|
private IClass |
UnitCompiler.compileGet2(Java.ConditionalExpression ce) |
|
private IClass |
UnitCompiler.compileGet2(Java.Crement c) |
|
private IClass |
UnitCompiler.compileGet2(Java.FieldAccess fa) |
|
private IClass |
UnitCompiler.compileGet2(Java.FieldAccessExpression fae) |
|
private IClass |
UnitCompiler.compileGet2(Java.Instanceof io) |
|
private IClass |
UnitCompiler.compileGet2(Java.Literal l) |
|
private IClass |
UnitCompiler.compileGet2(Java.MethodInvocation mi) |
|
private IClass |
UnitCompiler.compileGet2(Java.NewAnonymousClassInstance naci) |
|
private IClass |
UnitCompiler.compileGet2(Java.NewArray na) |
|
private IClass |
UnitCompiler.compileGet2(Java.NewClassInstance nci) |
|
private IClass |
UnitCompiler.compileGet2(Java.NewInitializedArray nia) |
|
private IClass |
UnitCompiler.compileGet2(Java.ParameterAccess pa) |
|
private IClass |
UnitCompiler.compileGet2(Java.ParenthesizedExpression pe) |
|
private IClass |
UnitCompiler.compileGet2(Java.QualifiedThisReference qtr) |
|
private IClass |
UnitCompiler.compileGet2(Java.SimpleConstant sl) |
|
private IClass |
UnitCompiler.compileGet2(Java.SuperclassFieldAccessExpression scfae) |
|
private IClass |
UnitCompiler.compileGet2(Java.SuperclassMethodInvocation scmi) |
|
private IClass |
UnitCompiler.compileGet2(Java.ThisReference tr) |
|
private IClass |
UnitCompiler.compileGet2(Java.UnaryOperation uo) |
|
private void |
UnitCompiler.compileGetValue(Java.ArrayInitializer ai,
IClass arrayType) |
|
private IClass |
UnitCompiler.compileGetValue(Java.Rvalue rv) |
|
private void |
UnitCompiler.compileSet(Java.Lvalue lv) |
|
private void |
UnitCompiler.compileSet2(Java.AmbiguousName an) |
|
private void |
UnitCompiler.compileSet2(Java.ArrayAccessExpression aae) |
|
private void |
UnitCompiler.compileSet2(Java.FieldAccess fa) |
|
private void |
UnitCompiler.compileSet2(Java.FieldAccessExpression fae) |
|
private void |
UnitCompiler.compileSet2(Java.ParenthesizedExpression pe) |
|
private void |
UnitCompiler.compileSet2(Java.SuperclassFieldAccessExpression scfae) |
|
private boolean |
UnitCompiler.compileStatements(java.util.List<? extends Java.BlockStatement> statements) |
|
private IClass |
UnitCompiler.compileStringConcatenation(Java.Locatable locatable,
IClass type,
Java.Rvalue operand,
java.util.Iterator<Java.Rvalue> operands) |
|
protected java.lang.Class |
ClassBodyEvaluator.compileToClass(Java.CompilationUnit compilationUnit) |
Compile the given compilation unit, load all generated classes, and return the class with the given name.
|
protected java.lang.ClassLoader |
SimpleCompiler.compileToClassLoader(Java.CompilationUnit compilationUnit) |
Compile the given compilation unit.
|
private boolean |
UnitCompiler.compileUnconditionalLoop(Java.ContinuableStatement cs,
Java.BlockStatement body,
Java.Rvalue[] optionalUpdate) |
|
private boolean |
UnitCompiler.compileUnconditionalLoopWithUpdate(Java.ContinuableStatement cs,
Java.BlockStatement body,
Java.Rvalue[] update) |
|
ClassFile[] |
UnitCompiler.compileUnit(boolean debugSource,
boolean debugLines,
boolean debugVars) |
Generates an array of ClassFile objects which represent the classes and interfaces declared in the
compilation unit.
|
private IClass |
UnitCompiler.convertToPrimitiveNumericType(Java.Locatable locatable,
IClass type) |
If the given type is a primitive type, return that type.
|
void |
ClassBodyEvaluator.cook(Scanner scanner) |
|
void |
ScriptEvaluator.cook(java.io.Reader[] readers) |
|
void |
ScriptEvaluator.cook(java.lang.String[] strings) |
|
void |
ScriptEvaluator.cook(java.lang.String[] optionalFileNames,
java.io.Reader[] readers) |
On a 2 GHz Intel Pentium Core Duo under Windows XP with an IBM 1.4.2 JDK, compiling
10000 expressions "a + b" (integer) takes about 4 seconds and 56 MB of main memory.
|
void |
ScriptEvaluator.cook(java.lang.String[] optionalFileNames,
java.lang.String[] strings) |
|
void |
ScriptEvaluator.cook(Parser[] parsers) |
|
void |
ScriptEvaluator.cook(Scanner scanner) |
|
void |
ScriptEvaluator.cook(Scanner[] scanners) |
|
void |
SimpleCompiler.cook(java.lang.String optionalFileName,
java.io.Reader r) |
Scans, parses and compiles a given compilation unit from the given Reader .
|
void |
SimpleCompiler.cook(Java.CompilationUnit compilationUnit) |
Cooks this compilation unit directly.
|
void |
SimpleCompiler.cook(Scanner scanner) |
Scans, parses and ompiles a given compilation unit from the given scanner.
|
static java.lang.Object |
ClassBodyEvaluator.createFastClassBodyEvaluator(Scanner scanner,
java.lang.Class optionalBaseType,
java.lang.ClassLoader optionalParentClassLoader) |
|
static java.lang.Object |
ClassBodyEvaluator.createFastClassBodyEvaluator(Scanner scanner,
java.lang.String className,
java.lang.Class optionalExtendedClass,
java.lang.Class[] implementedInterfaces,
java.lang.ClassLoader optionalParentClassLoader) |
Deprecated.
|
java.lang.Object |
ScriptEvaluator.createFastEvaluator(java.io.Reader reader,
java.lang.Class interfaceToImplement,
java.lang.String[] parameterNames) |
|
java.lang.Object |
ScriptEvaluator.createFastEvaluator(java.lang.String script,
java.lang.Class interfaceToImplement,
java.lang.String[] parameterNames) |
|
java.lang.Object |
ScriptEvaluator.createFastEvaluator(Scanner scanner,
java.lang.Class interfaceToImplement,
java.lang.String[] parameterNames) |
Notice: This method is not declared in IScriptEvaluator , and is hence only available in this
implementation of org.codehaus.commons.compiler .
|
static java.lang.Object |
ExpressionEvaluator.createFastExpressionEvaluator(java.lang.String expression,
java.lang.Class interfaceToImplement,
java.lang.String[] parameterNames,
java.lang.ClassLoader optionalParentClassLoader) |
Deprecated.
|
static java.lang.Object |
ExpressionEvaluator.createFastExpressionEvaluator(Scanner scanner,
java.lang.String[] optionalDefaultImports,
java.lang.String className,
java.lang.Class optionalExtendedType,
java.lang.Class interfaceToImplement,
java.lang.String[] parameterNames,
java.lang.ClassLoader optionalParentClassLoader) |
Deprecated.
|
static java.lang.Object |
ExpressionEvaluator.createFastExpressionEvaluator(Scanner scanner,
java.lang.String className,
java.lang.Class optionalExtendedType,
java.lang.Class interfaceToImplement,
java.lang.String[] parameterNames,
java.lang.ClassLoader optionalParentClassLoader) |
Deprecated.
|
static java.lang.Object |
ScriptEvaluator.createFastScriptEvaluator(java.lang.String script,
java.lang.Class interfaceToImplement,
java.lang.String[] parameterNames) |
Deprecated.
|
static java.lang.Object |
ScriptEvaluator.createFastScriptEvaluator(Scanner scanner,
java.lang.Class interfaceToImplement,
java.lang.String[] parameterNames,
java.lang.ClassLoader optionalParentClassLoader) |
Deprecated.
|
static java.lang.Object |
ScriptEvaluator.createFastScriptEvaluator(Scanner scanner,
java.lang.String[] optionalDefaultImports,
java.lang.String className,
java.lang.Class optionalExtendedClass,
java.lang.Class interfaceToImplement,
java.lang.String[] parameterNames,
java.lang.ClassLoader optionalParentClassLoader) |
Deprecated.
|
static java.lang.Object |
ScriptEvaluator.createFastScriptEvaluator(Scanner scanner,
java.lang.String className,
java.lang.Class optionalExtendedType,
java.lang.Class interfaceToImplement,
java.lang.String[] parameterNames,
java.lang.ClassLoader optionalParentClassLoader) |
Deprecated.
|
java.lang.Object |
ClassBodyEvaluator.createInstance(java.io.Reader reader) |
|
void |
Java.ClassDeclaration.defineSyntheticField(IClass.IField iField) |
|
void |
Java.InnerClassDeclaration.defineSyntheticField(IClass.IField iField) |
Inner classes have zero or more synthetic fields that hold references to their enclosing
context:
this$n
(Mandatory for non-private non-static member classes; optional for private non-static
member classes, local classes in non-static context, and anonymous classes in
non-static context; forbidden for static member classes, local classes in static
context, and anonymous classes in static context)
Holds a reference to the immediately enclosing instance.
|
private void |
UnitCompiler.determineValue(Java.FieldAccessExpression fae) |
|
private void |
UnitCompiler.determineValue(Java.SuperclassFieldAccessExpression scfae) |
"super.fld", "Type.super.fld"
|
private boolean |
UnitCompiler.fakeCompile(Java.BlockStatement bs) |
Called to check whether the given Java.Rvalue compiles or not.
|
private void |
UnitCompiler.fakeCompile(Java.Rvalue rv) |
Called to check whether the given Java.Rvalue compiles or not.
|
private IClass.IMethod |
UnitCompiler.fakeIMethod(IClass targetType,
java.lang.String name,
Java.Rvalue[] arguments) |
|
protected Java.CompilationUnit |
JavaSourceIClassLoader.findCompilationUnit(java.lang.String className) |
Finds the Java™ source file for the named class through the configured 'source resource finder' and
parses it.
|
IClass.IConstructor |
IClass.findIConstructor(IClass[] parameterTypes) |
|
private IClass.IField |
UnitCompiler.findIField(IClass iClass,
java.lang.String name,
Location location) |
Finds a named field in the given IClass .
|
IClass.IMethod |
IClass.findIMethod(java.lang.String methodName,
IClass[] parameterTypes) |
|
private IClass.IMethod |
UnitCompiler.findIMethod(IClass targetType,
Java.Invocation invocation) |
Find a IClass.IMethod in the given targetType , its superclasses or superinterfaces with the
given name and for the given arguments .
|
IClass.IMethod |
UnitCompiler.findIMethod(Java.MethodInvocation mi) |
Find named methods of "targetType", examine the argument types and choose the most specific method.
|
IClass.IMethod |
UnitCompiler.findIMethod(Java.SuperclassMethodInvocation superclassMethodInvocation) |
|
(package private) IClass[] |
IClass.findMemberType(java.lang.String optionalName) |
If optionalName is null , find all IClass es visible in the
scope of the current class.
|
private void |
IClass.findMemberType(java.lang.String optionalName,
java.util.Collection<IClass> result) |
|
private IClass |
UnitCompiler.findMemberType(IClass iClass,
java.lang.String name,
Location location) |
Finds a named type in the given IClass .
|
IClass.IInvocable |
UnitCompiler.findMostSpecificIInvocable(Java.Locatable locatable,
IClass.IInvocable[] iInvocables,
IClass[] argumentTypes,
boolean boxingPermitted,
Java.Scope contextScope) |
Determine the applicable invocables and choose the most specific invocable.
|
private IClass.IInvocable |
UnitCompiler.findMostSpecificIInvocable(Java.Locatable locatable,
IClass.IInvocable[] iInvocables,
Java.Rvalue[] arguments,
Java.Scope contextScope) |
Determine the arguments' types, determine the applicable invocables and choose the most specific invocable
and adjust arguments as needed (for varargs case).
|
private IClass |
UnitCompiler.findTypeByFullyQualifiedName(Location location,
java.lang.String[] identifiers) |
|
private IClass |
UnitCompiler.findTypeByName(Location location,
java.lang.String className) |
|
private boolean |
UnitCompiler.generatesCode(Java.BlockStatement bs) |
|
private boolean |
UnitCompiler.generatesCode2(java.util.List<Java.BlockStatement> l) |
|
private boolean |
UnitCompiler.generatesCode2(Java.Block b) |
|
private boolean |
UnitCompiler.generatesCode2(Java.FieldDeclaration fd) |
|
private boolean |
UnitCompiler.generatesCode2(Java.Initializer i) |
|
abstract java.lang.Object |
IClass.IField.getConstantValue() |
Returns the value of the field if it is a compile-time constant value, i.e.
|
java.lang.Object |
ReflectionIClass.ReflectionIField.getConstantValue() |
This implementation of IClass.IField.getConstantValue() is
not completely correct:
It treats non-static fields as non-constant
Even fields with a non-constant initializer are identified
as constant.
|
java.lang.Object |
UnitCompiler.getConstantValue(Java.Rvalue rv) |
Attempts to evaluate as a constant expression.
|
private java.lang.Object |
UnitCompiler.getConstantValue2(Java.AmbiguousName an) |
|
private java.lang.Object |
UnitCompiler.getConstantValue2(Java.BinaryOperation bo) |
|
private java.lang.Object |
UnitCompiler.getConstantValue2(Java.Cast c) |
|
private java.lang.Object |
UnitCompiler.getConstantValue2(Java.ConditionalExpression ce) |
|
private java.lang.Object |
UnitCompiler.getConstantValue2(Java.FieldAccess fa) |
|
private java.lang.Object |
UnitCompiler.getConstantValue2(Java.FloatingPointLiteral fpl) |
|
private java.lang.Object |
UnitCompiler.getConstantValue2(Java.IntegerLiteral il) |
|
private java.lang.Object |
UnitCompiler.getConstantValue2(Java.ParenthesizedExpression pe) |
|
private java.lang.Object |
UnitCompiler.getConstantValue2(Java.UnaryOperation uo) |
|
IClass[] |
IClass.getDeclaredIClasses() |
Returns the classes and interfaces declared as members of the class
(but not inherited classes and interfaces).
Returns an empty array for an array, primitive type or "void".
|
protected IClass[] |
ClassFileIClass.getDeclaredIClasses2() |
|
protected abstract IClass[] |
IClass.getDeclaredIClasses2() |
|
private Java.ClassDeclaration |
UnitCompiler.getDeclaringClass(Java.QualifiedThisReference qtr) |
|
IClass |
IClass.getDeclaringIClass() |
|
protected IClass |
ClassFileIClass.getDeclaringIClass2() |
|
protected abstract IClass |
IClass.getDeclaringIClass2() |
|
private Java.TypeBodyDeclaration |
UnitCompiler.getDeclaringTypeBodyDeclaration(Java.QualifiedThisReference qtr) |
|
java.lang.String |
IClass.IField.getDescriptor() |
|
java.lang.String |
IClass.IInvocable.getDescriptor() |
Returns the method descriptor of this constructor or method.
|
java.lang.String |
IClass.IConstructor.getDescriptor2() |
|
abstract java.lang.String |
IClass.IInvocable.getDescriptor2() |
|
java.lang.String |
IClass.IMethod.getDescriptor2() |
|
private void |
UnitCompiler.getfield(Java.Locatable locatable,
IClass.IField iField) |
|
private IClass |
UnitCompiler.getIClass(Java.ThisReference tr) |
|
IClass.IMethod[] |
IClass.getIMethods() |
Returns all methods declared in the class or interface, its superclasses and its
superinterfaces.
|
private void |
IClass.getIMethods(java.util.List<IClass.IMethod> result) |
|
void |
UnitCompiler.getIMethods(IClass type,
java.lang.String methodName,
java.util.List<IClass.IMethod> v) |
Add all methods with the given methodName that are declared by the type , its superclasses and
all their superinterfaces to the result list v .
|
IClass[] |
IClass.getInterfaces() |
Returns the interfaces implemented by the class.
Returns the superinterfaces of the interface.
Returns "Cloneable" and "Serializable" for arrays.
Returns an empty array for primitive types and "void".
|
protected IClass[] |
ClassFileIClass.getInterfaces2() |
|
protected abstract IClass[] |
IClass.getInterfaces2() |
|
Java.LocalVariable |
UnitCompiler.getLocalVariable(Java.FunctionDeclarator.FormalParameter parameter) |
|
Java.LocalVariable |
UnitCompiler.getLocalVariable(Java.FunctionDeclarator.FormalParameter parameter,
boolean isVariableArityParameter) |
|
Java.LocalVariable |
UnitCompiler.getLocalVariable(Java.LocalVariableDeclarationStatement lvds,
Java.VariableDeclarator vd) |
|
private java.lang.Object |
UnitCompiler.getNegatedConstantValue(Java.Rvalue rv) |
Attempts to evaluate the negated value of a constant Java.Rvalue .
|
private java.lang.Object |
UnitCompiler.getNegatedConstantValue2(Java.IntegerLiteral il) |
|
private java.lang.Object |
UnitCompiler.getNegatedConstantValue2(Java.ParenthesizedExpression pe) |
|
private java.lang.Object |
UnitCompiler.getNegatedConstantValue2(Java.Rvalue rv) |
|
private java.lang.Object |
UnitCompiler.getNegatedConstantValue2(Java.UnaryOperation uo) |
|
(package private) Java.ArrayInitializerOrRvalue |
UnitCompiler.getNonConstantFinalInitializer(Java.FieldDeclaration fd,
Java.VariableDeclarator vd) |
|
IClass |
IClass.getOuterIClass() |
The following types have an "outer class":
Anonymous classes declared in a non-static method of a class
Local classes declared in a non-static method of a class
Non-static member classes
|
protected IClass |
ClassFileIClass.getOuterIClass2() |
|
protected abstract IClass |
IClass.getOuterIClass2() |
|
protected IClass |
ReflectionIClass.getOuterIClass2() |
|
IClass[] |
IClass.IInvocable.getParameterTypes() |
Returns the types of the parameters of this constructor or method.
|
abstract IClass[] |
IClass.IConstructor.getParameterTypes2() |
Opposed to Constructor.getParameterTypes() , the
return value of this method does not include the optionally leading "synthetic
parameters".
|
abstract IClass[] |
IClass.IInvocable.getParameterTypes2() |
|
IClass[] |
ReflectionIClass.ReflectionIConstructor.getParameterTypes2() |
|
private IClass |
UnitCompiler.getReferenceType(Location location,
java.lang.String simpleTypeName,
Java.Scope scope) |
JLS7 6.5.5.1 Simple type name (single identifier)
|
private IClass |
UnitCompiler.getReferenceType(Location location,
Java.Scope scope,
java.lang.String[] identifiers,
int n) |
|
abstract IClass |
IClass.IMethod.getReturnType() |
|
private IClass |
UnitCompiler.getReturnType(Java.FunctionDeclarator fd) |
|
java.lang.String[] |
UnitCompiler.getSingleTypeImport(java.lang.String name,
Location location) |
Check if the given simple name was imported through a single type import.
|
IClass |
IClass.getSuperclass() |
Returns the superclass of the class.
Returns "null" for class "Object", interfaces, arrays, primitive types
and "void".
|
protected IClass |
ClassFileIClass.getSuperclass2() |
|
protected abstract IClass |
IClass.getSuperclass2() |
|
private IClass |
UnitCompiler.getTargetIClass(Java.QualifiedThisReference qtr) |
|
IClass[] |
IClass.IInvocable.getThrownExceptions() |
Returns the types thrown by this constructor or method.
|
abstract IClass[] |
IClass.IInvocable.getThrownExceptions2() |
|
abstract IClass |
IClass.IField.getType() |
|
private IClass |
UnitCompiler.getType(Java.Atom a) |
|
private IClass |
UnitCompiler.getType2(Java.AmbiguousName an) |
|
private IClass |
UnitCompiler.getType2(Java.ArrayAccessExpression aae) |
|
private IClass |
UnitCompiler.getType2(Java.ArrayType at) |
|
private IClass |
UnitCompiler.getType2(Java.Assignment a) |
|
private IClass |
UnitCompiler.getType2(Java.BinaryOperation bo) |
|
private IClass |
UnitCompiler.getType2(Java.Cast c) |
|
private IClass |
UnitCompiler.getType2(Java.ConditionalExpression ce) |
|
private IClass |
UnitCompiler.getType2(Java.Crement c) |
|
private IClass |
UnitCompiler.getType2(Java.FieldAccess fa) |
|
private IClass |
UnitCompiler.getType2(Java.FieldAccessExpression fae) |
|
private IClass |
UnitCompiler.getType2(Java.MethodInvocation mi) |
|
private IClass |
UnitCompiler.getType2(Java.NewArray na) |
|
private IClass |
UnitCompiler.getType2(Java.NewClassInstance nci) |
|
private IClass |
UnitCompiler.getType2(Java.NewInitializedArray nia) |
|
private IClass |
UnitCompiler.getType2(Java.Package p) |
|
private IClass |
UnitCompiler.getType2(Java.ParameterAccess pa) |
|
private IClass |
UnitCompiler.getType2(Java.ParenthesizedExpression pe) |
|
private IClass |
UnitCompiler.getType2(Java.QualifiedThisReference qtr) |
|
private IClass |
UnitCompiler.getType2(Java.ReferenceType rt) |
|
private IClass |
UnitCompiler.getType2(Java.RvalueMemberType rvmt) |
|
private IClass |
UnitCompiler.getType2(Java.SuperclassFieldAccessExpression scfae) |
|
private IClass |
UnitCompiler.getType2(Java.SuperclassMethodInvocation scmi) |
|
private IClass |
UnitCompiler.getType2(Java.ThisReference tr) |
|
private IClass |
UnitCompiler.getType2(Java.UnaryOperation uo) |
|
static java.lang.String[] |
ExpressionEvaluator.guessParameterNames(Scanner scanner) |
Guess the names of the parameters used in the given expression.
|
static java.lang.String[] |
ScriptEvaluator.guessParameterNames(Scanner scanner) |
Guess the names of the parameters used in the given expression.
|
void |
FilterWarningHandler.handleWarning(java.lang.String handle,
java.lang.String message,
Location optionalLocation) |
|
private boolean |
UnitCompiler.hasAnnotation(Java.FunctionDeclarator fd,
IClass methodAnnotation) |
|
boolean |
IClass.hasIMethod(java.lang.String methodName,
IClass[] parameterTypes) |
|
private static int |
UnitCompiler.hex2Int(Java.Locatable locatable,
java.lang.String value) |
|
private static long |
UnitCompiler.hex2Long(Java.Locatable locatable,
java.lang.String value) |
|
boolean |
IClass.implementsInterface(IClass that) |
If this represents a class: Return true if this class
directly or indirectly implements that interface.
|
private void |
UnitCompiler.import2(Java.CompilationUnit.SingleStaticImportDeclaration ssid) |
|
private void |
UnitCompiler.import2(Java.CompilationUnit.StaticImportOnDemandDeclaration siodd) |
|
private IClass |
UnitCompiler.importSingleType(java.lang.String simpleTypeName,
Location location) |
If the given name was declared in a simple type import, load that class.
|
IClass |
UnitCompiler.importTypeOnDemand(java.lang.String simpleTypeName,
Location location) |
6.5.2.BL1.B1.B5, 6.5.2.BL1.B1.B6 Type-import-on-demand.
6.5.5.1.6 Type-import-on-demand declaration.
|
(package private) void |
UnitCompiler.initializeInstanceVariablesAndInvokeInstanceInitializers(Java.ConstructorDeclarator cd) |
Compiles the instance variable initializers and the instance initializers in their lexical order.
|
private java.lang.String |
UnitCompiler.internalCheckAccessible(IClass iClassDeclaringMember,
Access memberAccess,
Java.Scope contextScope) |
|
private java.lang.String |
UnitCompiler.internalCheckAccessible(IClass type,
Java.Scope contextScope) |
|
private void |
UnitCompiler.invoke(Java.Locatable locatable,
IClass.IConstructor iConstructor) |
|
private void |
UnitCompiler.invoke(Java.Locatable locatable,
IClass.IMethod iMethod) |
|
private void |
UnitCompiler.invokeConstructor(Java.Locatable locatable,
Java.Scope scope,
Java.Rvalue optionalEnclosingInstance,
IClass targetClass,
Java.Rvalue[] arguments) |
Expects the object to initialize on the stack.
|
private boolean |
UnitCompiler.isAccessible(IClass.IMember member,
Java.Scope contextScope) |
Determines whether the given IClass.IMember is accessible in the given context, according to
JLS7 6.6.1.BL1.B4.
|
private boolean |
UnitCompiler.isAccessible(IClass iClassDeclaringMember,
Access memberAccess,
Java.Scope contextScope) |
Determines whether a member (class, interface, field or method) declared in a given class is accessible from a
given block statement context, according to JLS7 6.6.1.4.
|
private boolean |
UnitCompiler.isAccessible(IClass type,
Java.Scope contextScope) |
Determines whether the given IClass is accessible in the given context, according to JLS7 6.6.1.2 and
6.6.1.4.
|
boolean |
IClass.isAssignableFrom(IClass that) |
Determine if "this" is assignable from "that".
|
private boolean |
UnitCompiler.isCastReferenceConvertible(IClass sourceType,
IClass targetType) |
JLS7 5.5
|
(package private) Java.LocalVariable |
UnitCompiler.isIntLv(Java.Crement c) |
Checks whether the operand is an integer-like local variable.
|
boolean |
IClass.IInvocable.isLessSpecificThan(IClass.IInvocable that) |
|
private boolean |
UnitCompiler.isMethodInvocationConvertible(IClass sourceType,
IClass targetType,
boolean boxingPermitted) |
Checks if "method invocation conversion" (5.3) is possible.
|
boolean |
IClass.IInvocable.isMoreSpecificThan(IClass.IInvocable that) |
|
private boolean |
UnitCompiler.isNarrowingReferenceConvertible(IClass sourceType,
IClass targetType) |
Check whether "narrowing reference conversion" (JLS7 5.1.5) is possible.
|
boolean |
IClass.isSubclassOf(IClass that) |
Returns true if this class is an immediate or non-immediate
subclass of that class.
|
private boolean |
UnitCompiler.isType(Java.Atom a) |
|
private boolean |
UnitCompiler.isType2(Java.AmbiguousName an) |
|
private boolean |
UnitCompiler.isWideningReferenceConvertible(IClass sourceType,
IClass targetType) |
Checks if "widening reference conversion" (5.1.4) is possible.
|
protected Java.CompilationUnit |
ClassBodyEvaluator.makeCompilationUnit(Parser optionalParser) |
|
protected java.util.List<Java.BlockStatement> |
ExpressionEvaluator.makeStatements(int idx,
Parser parser) |
|
protected java.util.List<Java.BlockStatement> |
ScriptEvaluator.makeStatements(int idx,
Parser parser) |
Fills the given block by parsing statements until EOF and adding them to the block.
|
private void |
UnitCompiler.maybeCreateInitMethod(Java.AbstractTypeDeclaration decl,
ClassFile cf,
java.util.List<Java.BlockStatement> statements) |
Create class initialization method iff there is any initialization code.
|
private static int |
UnitCompiler.oct2Int(Java.Locatable locatable,
java.lang.String value) |
|
private static long |
UnitCompiler.oct2Long(Java.Locatable locatable,
java.lang.String value) |
|
private boolean |
UnitCompiler.overridesMethod(IClass.IMethod method,
IClass type) |
|
private boolean |
UnitCompiler.overridesMethodFromSupertype(IClass.IMethod m,
IClass type) |
|
Java.Atom |
Parser.parseAdditiveExpression() |
AdditiveExpression :=
MultiplicativeExpression { ( '+' | '-' ) MultiplicativeExpression }
|
Java.Atom |
Parser.parseAndExpression() |
AndExpression :=
EqualityExpression { '&' EqualityExpression }
|
private Java.Annotation |
Parser.parseAnnotation() |
Annotation :=
MarkerAnnotation // JLS7 9.7.2
| SingleElementAnnotation // JLS7 9.7.3
| NormalAnnotation // JLS7 9.7.1
MarkerAnnotation := '@' Identifier
SingleElementAnnotation := '@' Identifier '(' ElementValue ')'
NormalAnnotation := '@' TypeName '(' ElementValuePairsOpt ')'
ElementValuePairsOpt := [ ElementValuePair { ',' ElementValuePair } ]
|
Java.Rvalue[] |
Parser.parseArgumentList() |
ArgumentList := Expression { ',' Expression }
|
Java.Rvalue[] |
Parser.parseArguments() |
Arguments := '(' [ ArgumentList ] ')'
|
Java.ArrayInitializer |
Parser.parseArrayInitializer() |
ArrayInitializer :=
'{' [ VariableInitializer { ',' VariableInitializer } [ ',' ] '}'
|
Java.Statement |
Parser.parseAssertStatement() |
AssertStatement := 'assert' Expression [ ':' Expression ] ';'
|
Java.Atom |
Parser.parseAssignmentExpression() |
AssignmentExpression :=
ConditionalExpression [ AssignmentOperator AssignmentExpression ]
AssignmentOperator :=
'=' | '*=' | '/=' | '%=' | '+=' | '-=' | '<<=' |
'>>=' | '>>>=' | '&=' | '^=' | '|='
|
Java.Block |
Parser.parseBlock() |
'{' BlockStatements '}'
|
Java.BlockStatement |
Parser.parseBlockStatement() |
BlockStatement := { Identifier ':' } (
( Modifiers Type | ModifiersOpt BasicType ) VariableDeclarators ';' |
'class' ...
|
java.util.List<Java.BlockStatement> |
Parser.parseBlockStatements() |
BlockStatements := { BlockStatement }
|
(package private) int |
Parser.parseBracketsOpt() |
BracketsOpt := { '[' ']' }
|
Java.Statement |
Parser.parseBreakStatement() |
BreakStatement := 'break' [ Identifier ] ';'
|
void |
Parser.parseClassBody(Java.ClassDeclaration classDeclaration) |
ClassBody := '{' { ClassBodyDeclaration } '}'
|
void |
Parser.parseClassBodyDeclaration(Java.ClassDeclaration classDeclaration) |
ClassBodyDeclaration :=
';' |
ModifiersOpt (
Block | // Instance (JLS7 8.6) or static initializer (JLS7 8.7)
'void' Identifier MethodDeclarationRest |
'class' ClassDeclarationRest |
'interface' InterfaceDeclarationRest |
ConstructorDeclarator |
Type Identifier (
MethodDeclarationRest |
FieldDeclarationRest ';'
)
)
|
Java.NamedClassDeclaration |
Parser.parseClassDeclarationRest(java.lang.String optionalDocComment,
Java.Modifiers modifiers,
Parser.ClassDeclarationContext context) |
ClassDeclarationRest :=
Identifier [ typeParameters ]
[ 'extends' ReferenceType ]
[ 'implements' ReferenceTypeList ]
ClassBody
|
private Java.CompilationUnit |
Compiler.parseCompilationUnit(java.lang.String fileName,
java.io.InputStream inputStream,
java.lang.String optionalCharacterEncoding) |
Read one compilation unit from a file and parse it.
|
Java.CompilationUnit |
Parser.parseCompilationUnit() |
CompilationUnit := [ PackageDeclaration ]
{ ImportDeclaration }
{ TypeDeclaration }
|
Java.Atom |
Parser.parseConditionalAndExpression() |
ConditionalAndExpression :=
InclusiveOrExpression { '&&' InclusiveOrExpression }
|
Java.Atom |
Parser.parseConditionalExpression() |
ConditionalExpression :=
ConditionalOrExpression [ '?' Expression ':' ConditionalExpression ]
|
Java.Atom |
Parser.parseConditionalOrExpression() |
ConditionalOrExpression :=
ConditionalAndExpression { '||' ConditionalAndExpression ]
|
Java.ConstructorDeclarator |
Parser.parseConstructorDeclarator(java.lang.String optionalDocComment,
Java.Modifiers modifiers) |
ConstructorDeclarator :=
Identifier
FormalParameters
[ 'throws' ReferenceTypeList ]
'{'
[ 'this' Arguments ';' | 'super' Arguments ';' | Primary '.' 'super' Arguments ';' ]
BlockStatements
'}'
|
Java.Statement |
Parser.parseContinueStatement() |
ContinueStatement := 'continue' [ Identifier ] ';'
|
Java.Rvalue |
Parser.parseDimExpr() |
DimExpr := '[' Expression ']'
|
Java.Rvalue[] |
Parser.parseDimExprs() |
DimExprs := DimExpr { DimExpr }
|
Java.Statement |
Parser.parseDoStatement() |
DoStatement := 'do' Statement 'while' '(' Expression ')' ';'
|
private Java.ElementValue |
Parser.parseElementValue() |
ElementValue :=
ConditionalExpression
| Annotation
| ElementValueArrayInitializer
|
private Java.ElementValue |
Parser.parseElementValueArrayInitializer() |
ElementValueArrayInitializer := '{' { ElementValue | ',' } '}'
|
private Java.ElementValuePair |
Parser.parseElementValuePair() |
ElementValuePair := Identifier '=' ElementValue
|
Java.Statement |
Parser.parseEmptyStatement() |
EmptyStatement := ';'
|
Java.Atom |
Parser.parseEqualityExpression() |
EqualityExpression :=
RelationalExpression { ( '==' | '!=' ) RelationalExpression }
|
Java.Atom |
Parser.parseExclusiveOrExpression() |
ExclusiveOrExpression :=
AndExpression { '^' AndExpression }
|
Java.Atom |
Parser.parseExpression() |
Expression := AssignmentExpression
|
Java.Rvalue[] |
Parser.parseExpressionList() |
ExpressionList := Expression { ',' Expression }
|
Java.Statement |
Parser.parseExpressionStatement() |
ExpressionStatement := Expression ';'
|
Java.VariableDeclarator[] |
Parser.parseFieldDeclarationRest(java.lang.String name) |
FieldDeclarationRest :=
VariableDeclaratorRest
{ ',' VariableDeclarator }
|
Java.FunctionDeclarator.FormalParameter |
Parser.parseFormalParameter(boolean[] hasEllipsis) |
FormalParameter := [ 'final' ] Type [ '.' '.' '.' ] Identifier BracketsOpt
|
Java.FunctionDeclarator.FormalParameters |
Parser.parseFormalParameters() |
FormalParameters := '(' [ FormalParameter { ',' FormalParameter } ] ')'
|
Java.Statement |
Parser.parseForStatement() |
ForStatement :=
'for' '(' [ ForInit ] ';' [ Expression ] ';' [ ExpressionList ] ')' Statement
| 'for' '(' FormalParameter ':' Expression ')' Statement
ForInit :=
Modifiers Type VariableDeclarators
| ModifiersOpt BasicType VariableDeclarators
| Expression VariableDeclarators (1)
| Expression { ',' Expression }
|
Java.Statement |
Parser.parseIfStatement() |
IfStatement := 'if' '(' Expression ')' Statement [ 'else' Statement ]
|
Java.CompilationUnit.ImportDeclaration |
Parser.parseImportDeclaration() |
ImportDeclaration := 'import' ImportDeclarationBody ';'
|
Java.CompilationUnit.ImportDeclaration |
Parser.parseImportDeclarationBody() |
ImportDeclarationBody := [ 'static' ] Identifier { '.' Identifier } [ '.' '*' ]
|
Java.Atom |
Parser.parseInclusiveOrExpression() |
InclusiveOrExpression :=
ExclusiveOrExpression { '|' ExclusiveOrExpression }
|
void |
Parser.parseInterfaceBody(Java.InterfaceDeclaration interfaceDeclaration) |
InterfaceBody := '{' {
';' |
ModifiersOpt (
'void' Identifier MethodDeclarationRest |
'class' ClassDeclarationRest |
'interface' InterfaceDeclarationRest |
Type Identifier (
MethodDeclarationRest |
FieldDeclarationRest
)
)
} '}'
|
Java.InterfaceDeclaration |
Parser.parseInterfaceDeclarationRest(java.lang.String optionalDocComment,
Java.Modifiers modifiers,
Parser.InterfaceDeclarationContext context) |
InterfaceDeclarationRest :=
Identifier [ typeParameters ]
[ 'extends' ReferenceTypeList ]
InterfaceBody
|
Java.Statement |
Parser.parseLabeledStatement() |
LabeledStatement := Identifier ':' Statement
|
Java.Rvalue |
Parser.parseLiteral() |
Literal :=
IntegerLiteral
| FloatingPointLiteral
| BooleanLiteral
| CharacterLiteral
| StringLiteral
| NullLiteral
|
Java.Block |
Parser.parseMethodBody() |
MethodBody := Block
|
Java.MethodDeclarator |
Parser.parseMethodDeclarationRest(java.lang.String optionalDocComment,
Java.Modifiers modifiers,
Java.Type type,
java.lang.String name) |
MethodDeclarationRest :=
FormalParameters
{ '[' ']' }
[ 'throws' ReferenceTypeList ]
( ';' | MethodBody )
|
Java.Modifiers |
Parser.parseModifiers() |
ModifiersAndAnnotations := { 'public' | 'protected' | 'private' | 'static' | 'abstract' | 'final' | 'native'
| 'synchronized' | 'transient' | 'volatile' | 'strictfp' | Annotation }
|
Java.Atom |
Parser.parseMultiplicativeExpression() |
MultiplicativeExpression :=
UnaryExpression { ( '*' | '/' | '%' ) UnaryExpression }
|
Java.PackageDeclaration |
Parser.parsePackageDeclaration() |
PackageDeclaration := 'package' QualifiedIdentifier ';'
|
Java.PackageMemberTypeDeclaration |
Parser.parsePackageMemberTypeDeclaration() |
PackageMemberTypeDeclaration :=
ModifiersOpt 'class' ClassDeclarationRest |
ModifiersOpt 'interface' InterfaceDeclarationRest
|
Java.Atom |
Parser.parsePrimary() |
Primary :=
CastExpression | // CastExpression 15.16
'(' Expression ')' | // ParenthesizedExpression 15.8.5
Literal | // Literal 15.8.1
Name | // AmbiguousName
Name Arguments | // MethodInvocation
Name '[]' { '[]' } | // ArrayType 10.1
Name '[]' { '[]' } '.' 'class' | // ClassLiteral 15.8.2
'this' | // This 15.8.3
'this' Arguments | // Alternate constructor invocation 8.8.5.1
'super' Arguments | // Unqualified superclass constructor invocation 8.8.5.1
'super' '.' Identifier | // SuperclassFieldAccess 15.11.2
'super' '.' Identifier Arguments | // SuperclassMethodInvocation 15.12.4.9
NewClassInstance |
NewAnonymousClassInstance | // ClassInstanceCreationExpression 15.9
NewArray | // ArrayCreationExpression 15.10
NewInitializedArray | // ArrayInitializer 10.6
BasicType { '[]' } | // Type
BasicType { '[]' } '.' 'class' | // ClassLiteral 15.8.2
'void' '.' 'class' // ClassLiteral 15.8.2
CastExpression :=
'(' PrimitiveType { '[]' } ')' UnaryExpression |
'(' Expression ')' UnaryExpression
NewClassInstance := 'new' ReferenceType Arguments
NewAnonymousClassInstance := 'new' ReferenceType Arguments [ ClassBody ]
NewArray := 'new' Type DimExprs { '[]' }
NewInitializedArray := 'new' ArrayType ArrayInitializer
|
java.lang.String[] |
Parser.parseQualifiedIdentifier() |
QualifiedIdentifier := Identifier { '.' Identifier }
|
Java.ReferenceType |
Parser.parseReferenceType() |
ReferenceType := QualifiedIdentifier [ TypeArguments ]
|
Java.ReferenceType[] |
Parser.parseReferenceTypeList() |
ReferenceTypeList := ReferenceType { ',' ReferenceType }
|
Java.Atom |
Parser.parseRelationalExpression() |
RelationalExpression :=
ShiftExpression {
'instanceof' ReferenceType
| '<' ShiftExpression [ { ',' TypeArgument } '>' ]
| '<' TypeArgument [ { ',' TypeArgument } '>' ]
| ( '>' | '<=' | '>=' ) ShiftExpression
}
|
Java.Statement |
Parser.parseReturnStatement() |
ReturnStatement := 'return' [ Expression ] ';'
|
Java.Atom |
Parser.parseSelector(Java.Atom atom) |
Selector :=
'.' Identifier | // FieldAccess 15.11.1
'.' Identifier Arguments | // MethodInvocation
'.' 'this' // QualifiedThis 15.8.4
'.' 'super' Arguments // Qualified superclass constructor invocation (JLS7 8.8.7.1)
'.' 'super' '.' Identifier | // SuperclassFieldReference (JLS7 15.11.2)
'.' 'super' '.' Identifier Arguments | // SuperclassMethodInvocation (JLS7 15.12.3)
'.' 'new' Identifier Arguments [ ClassBody ] | // QualifiedClassInstanceCreationExpression 15.9
'.' 'class'
'[' Expression ']' // ArrayAccessExpression 15.13
|
Java.Atom |
Parser.parseShiftExpression() |
ShiftExpression :=
AdditiveExpression { ( '<<' | '>>' | '>>>' ) AdditiveExpression }
|
Java.Statement |
Parser.parseStatement() |
Statement :=
LabeledStatement |
Block |
IfStatement |
ForStatement |
WhileStatement |
DoStatement |
TryStatement |
'switch' ...
|
Java.Statement |
Parser.parseSwitchStatement() |
SwitchStatement :=
'switch' '(' Expression ')' '{' { SwitchLabels BlockStatements } '}'
SwitchLabels := SwitchLabels { SwitchLabels }
SwitchLabel := 'case' Expression ':' | 'default' ':'
|
Java.Statement |
Parser.parseSynchronizedStatement() |
SynchronizedStatement :=
'synchronized' '(' expression ')' Block
|
Java.Statement |
Parser.parseThrowStatement() |
ThrowStatement := 'throw' Expression ';'
|
Java.Statement |
Parser.parseTryStatement() |
TryStatement :=
'try' Block Catches [ Finally ] |
'try' Block Finally
Catches := CatchClause { CatchClause }
CatchClause := 'catch' '(' FormalParameter ')' Block
Finally := 'finally' Block
|
Java.Type |
Parser.parseType() |
Type := (
'byte' | 'short' | 'char' | 'int' | 'long' |
'float' | 'double' | 'boolean' |
ReferenceType
) { '[' ']' }
|
private Java.TypeArgument |
Parser.parseTypeArgument() |
TypeArgument :=
ReferenceType { '[' ']' } <= The optional brackets are mising in JLS7, section 18!?
| BasicType '[' ']' { '[' ']' }
| '?' extends ReferenceType
| '?' super ReferenceType
|
private Java.TypeArgument[] |
Parser.parseTypeArgumentsOpt() |
TypeArguments := '<' TypeArgument { ',' TypeArgument } '>'
|
private Java.TypeParameter |
Parser.parseTypeParameter() |
TypeParameter := identifier [ 'extends' ( identifier | ReferenceType { '&' ReferenceType }
|
private Java.TypeParameter[] |
Parser.parseTypeParametersOpt() |
TypeParameters := '<' TypeParameter { ',' TypeParameter } '>'
|
Java.Atom |
Parser.parseUnaryExpression() |
UnaryExpression :=
{ PrefixOperator } Primary { Selector } { PostfixOperator }
PrefixOperator := '++' | '--' | '+' | '-' | '~' | '!'
PostfixOperator := '++' | '--'
|
Java.VariableDeclarator |
Parser.parseVariableDeclarator() |
VariableDeclarator := Identifier VariableDeclaratorRest
|
Java.VariableDeclarator |
Parser.parseVariableDeclaratorRest(java.lang.String name) |
VariableDeclaratorRest := { '[' ']' } [ '=' VariableInitializer ]
|
Java.VariableDeclarator[] |
Parser.parseVariableDeclarators() |
VariableDeclarators := VariableDeclarator { ',' VariableDeclarator }
|
Java.ArrayInitializerOrRvalue |
Parser.parseVariableInitializer() |
VariableInitializer :=
ArrayInitializer |
Expression
|
Java.Statement |
Parser.parseWhileStatement() |
WhileStatement := 'while' '(' Expression ')' Statement
|
Scanner.Token |
Parser.peek() |
|
int |
Parser.peek(int[] suspected) |
Checks whether the type of the next token is any of the suspected ; does not consume the next token.
|
boolean |
Parser.peek(java.lang.String suspected) |
|
int |
Parser.peek(java.lang.String[] suspected) |
Checks whether the value of the next token equals any of the suspected ; does not consume the next
token.
|
boolean |
Parser.peekEof() |
|
java.lang.String |
Parser.peekIdentifier() |
|
boolean |
Parser.peekLiteral() |
|
Scanner.Token |
Parser.peekNextButOne() |
|
boolean |
Parser.peekNextButOne(java.lang.String suspected) |
|
boolean |
Parser.peekRead(java.lang.String suspected) |
|
int |
Parser.peekRead(java.lang.String[] values) |
|
Scanner.Token |
Scanner.produce() |
Preduces and returns the next token.
|
private IClass |
UnitCompiler.pushConstant(Java.Locatable locatable,
java.lang.Object value) |
|
private void |
UnitCompiler.putfield(Java.Locatable locatable,
IClass.IField iField) |
|
Scanner.Token |
Parser.read() |
|
void |
Parser.read(java.lang.String expected) |
Verifies that the value of the next token equals expected , and consumes the token.
|
int |
Parser.read(java.lang.String[] expected) |
Verifies that the value of the next token equals one of the expected , and consumes the token.
|
java.lang.String |
Parser.readIdentifier() |
|
private void |
Scanner.readNextChar() |
|
java.lang.String |
Parser.readOperator() |
|
private Java.Atom |
UnitCompiler.reclassify(Java.AmbiguousName an) |
|
private Java.Atom |
UnitCompiler.reclassifyName(Location location,
Java.Scope scope,
java.lang.String identifier) |
JLS7 6.5.2.1
|
private Java.Atom |
UnitCompiler.reclassifyName(Location location,
Java.Scope scope,
java.lang.String[] identifiers,
int n) |
Reclassifies the ambiguous name consisting of the first n of the identifiers (JLS7 6.5.2.2).
|
private void |
UnitCompiler.referenceThis(Java.Locatable locatable,
Java.ClassDeclaration declaringClass,
Java.TypeBodyDeclaration declaringTypeBodyDeclaration,
IClass targetIClass) |
|
private IClass[] |
ClassFileIClass.resolveClasses(short[] ifs) |
|
private void |
UnitCompiler.reverseUnaryNumericPromotion(Java.Locatable locatable,
IClass sourceType,
IClass targetType) |
|
private void |
Scanner.scanLiteralCharacter(java.lang.StringBuilder sb) |
Scans the next literal character into a StringBuilder .
|
private Scanner.Token |
Scanner.scanNumericLiteral(boolean hadDecimalPoint) |
|
private void |
UnitCompiler.stringConversion(Java.Locatable locatable,
IClass sourceType) |
Converts object of type "sourceType" to type "String" (JLS7 15.18.1.1).
|
void |
Java.AbstractTypeDeclaration.throwCompileException(java.lang.String message) |
|
void |
Java.Locatable.throwCompileException(java.lang.String message) |
|
void |
Java.Located.throwCompileException(java.lang.String message) |
|
Java.Lvalue |
Java.Atom.toLvalueOrCompileException() |
|
private Java.Lvalue |
UnitCompiler.toLvalueOrCompileException(Java.Atom a) |
|
Java.Rvalue |
Java.Atom.toRvalueOrCompileException() |
|
private Java.Rvalue |
UnitCompiler.toRvalueOrCompileException(Java.Atom a) |
|
Java.Type |
Java.Atom.toTypeOrCompileException() |
|
private Java.Type |
UnitCompiler.toTypeOrCompileException(Java.Atom a) |
|
private boolean |
UnitCompiler.tryAssignmentConversion(Java.Locatable locatable,
IClass sourceType,
IClass targetType,
java.lang.Object optionalConstantValue) |
|
private boolean |
UnitCompiler.tryBoxingConversion(Java.Locatable locatable,
IClass sourceType,
IClass targetType) |
|
private boolean |
UnitCompiler.tryConstantAssignmentConversion(Java.Locatable locatable,
java.lang.Object constantValue,
IClass targetType) |
Check if "constant assignment conversion" (JLS7 5.2, paragraph 1) is possible.
|
private boolean |
UnitCompiler.tryNarrowingReferenceConversion(Java.Locatable locatable,
IClass sourceType,
IClass targetType) |
Implements "narrowing reference conversion" (5.1.5).
|
private boolean |
UnitCompiler.tryWideningReferenceConversion(IClass sourceType,
IClass targetType) |
Performs "widening reference conversion" (5.1.4) if possible.
|
private IClass |
UnitCompiler.unaryNumericPromotion(Java.Locatable locatable,
IClass type) |
Implements "unary numeric promotion" (JLS7 5.6.1).
|
private IClass |
UnitCompiler.unaryNumericPromotionType(Java.Locatable locatable,
IClass type) |
|
private void |
Parser.verifyIdentifierIsConventionalClassOrInterfaceName(java.lang.String id,
Location loc) |
Issue a warning if the given identifier does not comply with the class and interface type naming conventions
(JLS7 6.8.2).
|
private void |
Parser.verifyIdentifierIsConventionalFieldName(java.lang.String id,
Location loc) |
Issue a warning if the given identifier does not comply with the field naming conventions (JLS7 6.8.4) and
constant naming conventions (JLS7 6.8.5).
|
private void |
Parser.verifyIdentifierIsConventionalLocalVariableOrParameterName(java.lang.String id,
Location loc) |
Issue a warning if the given identifier does not comply with the local variable and parameter naming conventions
(JLS7 6.8.6).
|
private void |
Parser.verifyIdentifierIsConventionalMethodName(java.lang.String id,
Location loc) |
Issue a warning if the given identifier does not comply with the method naming conventions (JLS7 6.8.3).
|
private void |
Parser.verifyStringIsConventionalPackageName(java.lang.String s,
Location loc) |
Issue a warning if the given string does not comply with the package naming conventions.
|
private void |
Parser.warning(java.lang.String handle,
java.lang.String message,
Location optionalLocation) |
Issues a warning with the given message and location and returns.
|
private void |
Scanner.warning(java.lang.String handle,
java.lang.String message,
Location optionalLocation) |
Issues a warning with the given message and location and returns.
|
private void |
UnitCompiler.warning(java.lang.String handle,
java.lang.String message,
Location optionalLocation) |
Issues a warning with the given message an location an returns.
|