Uses of Class
org.codehaus.commons.compiler.CompileException
Packages that use CompileException
Package
Description
This package declares interfaces for the implementation of an
IExpressionEvaluator
, an IScriptEvaluator
, an
IClassBodyEvaluator
and an ISimpleCompiler
.An implementation of the
org.codehaus.commons.compiler
API that uses the "JAVAC" Java compiler that is
part of the "Java Development Kit" (JDK).The core of the Janino Java compiler.
Sample applications for the Janino Java compiler.
Application-independent helper classes.
-
Uses of CompileException in org.codehaus.commons.compiler
Methods in org.codehaus.commons.compiler that throw CompileExceptionModifier and TypeMethodDescriptionfinal boolean
boolean
Reads a set of Java compilation units (a.k.a.void
final void
Cookable.cook
(InputStream is) final void
Cookable.cook
(InputStream is, String encoding) final void
final void
final void
Cookable.cook
(String fileName, InputStream is) final void
Cookable.cook
(String fileName, InputStream is, String encoding) abstract void
final void
void
ICookable.cook
(InputStream is) Reads, scans, parses and compiles Java tokens from the givenInputStream
, encoded in the "platform default encoding".void
ICookable.cook
(InputStream is, String encoding) Reads, scans, parses and compiles Java tokens from the givenInputStream
with the givenencoding
.void
Reads, scans, parses and compiles Java tokens from the givenReader
.void
Reads, scans, parses and compiles Java tokens from the givenString
.void
ICookable.cook
(String fileName, InputStream is) Reads, scans, parses and compiles Java tokens from the givenInputStream
, encoded in the "platform default encoding".void
ICookable.cook
(String fileName, InputStream is, String encoding) Reads, scans, parses and compiles Java tokens from the givenInputStream
with the givenencoding
.void
Reads, scans, parses and compiles Java tokens from the givenReader
.void
Reads, scans, parses and compiles Java tokens from the givenString
.void
IMultiCookable.cook
(InputStream... inputStreams) Same asCookable.cook(InputStream)
, but cooks a set of documents into one class.void
IMultiCookable.cook
(InputStream[] inputStreams, String[] encodings) Same asCookable.cook(InputStream, String)
, but cooks a set of documents into one class.void
Same asCookable.cook(Reader)
, but cooks a set of documents into one class.void
Same asCookable.cook(String)
, but cooks a set of documents into one class.void
IMultiCookable.cook
(String[] fileNames, InputStream[] inputStreams) Same asCookable.cook(String, InputStream)
, but cooks a set of documents into one class.void
IMultiCookable.cook
(String[] fileNames, InputStream[] inputStreams, String[] encodings) Same asCookable.cook(String, InputStream, String)
, but cooks a set of documents into one class.void
Same asCookable.cook(String, Reader)
, but cooks a set of documents into one class.void
Same asCookable.cook(String, String)
, but cooks a set of documents into one class.void
Same asICookable.cook(Reader)
, but for multiple scripts.void
Same asICookable.cook(String)
, but for multiple scripts.void
Same asICookable.cook(String, Reader)
, but cooks a set of scripts into one class.void
Same asICookable.cook(String, String)
, but for multiple scripts.final void
MultiCookable.cook
(InputStream... inputStreams) final void
MultiCookable.cook
(InputStream[] inputStreams, String[] encodings) final void
final void
final void
MultiCookable.cook
(String[] fileNames, InputStream[] inputStreams) final void
MultiCookable.cook
(String[] fileNames, InputStream[] inputStreams, String[] encodings) abstract void
final void
final void
final void
final void
final void
void
Reads, scans, parses and compiles Java tokens from the givenFile
, encoded in the "platform default encoding".void
Reads, scans, parses and compiles Java tokens from the givenFile
with the givenencoding
.void
Reads, scans, parses and compiles Java tokens from the named file, encoded in the "platform default encoding".void
Reads, scans, parses and compiles Java tokens from the named file with the given encoding.void
Same asCookable.cookFile(File)
, but cooks a set of documents into one class.void
Same asCookable.cookFile(File, String)
, but cooks a set of documents into one class.void
Same asCookable.cookFile(String)
, but cooks a set of documents into one class.void
Same asCookable.cookFile(String, String)
, but cooks a set of documents into one class.final void
final void
final void
final void
<T> T
IExpressionEvaluator.createFastEvaluator
(Reader reader, Class<? extends T> interfaceToImplement, String... parameterNames) <T> T
IExpressionEvaluator.createFastEvaluator
(String expression, Class<? extends T> interfaceToImplement, String... parameterNames) If the parameter and return types of the expression are known at compile time, then a "fast" expression evaluator can be instantiated throughIExpressionEvaluator.createFastEvaluator(String, Class, String[])
.<T> T
IScriptEvaluator.createFastEvaluator
(Reader reader, Class<T> interfaceToImplement, String[] parameterNames) If the parameter and return types of the expression are known at compile time, then a "fast" script evaluator can be instantiated through this method.<T> T
IScriptEvaluator.createFastEvaluator
(String script, Class<T> interfaceToImplement, String[] parameterNames) IClassBodyEvaluator.createInstance
(Reader reader) Scans, parses and compiles a class body from the tokens delivered by the the givenReader
, then creates and returns an instance of that class.void
ErrorHandler.handleError
(String message, Location location) May or may not choose to throw aCompileException
.void
WarningHandler.handleWarning
(String handle, String message, Location location) May or may not choose to throw aCompileException
. -
Uses of CompileException in org.codehaus.commons.compiler.jdk
Methods in org.codehaus.commons.compiler.jdk that throw CompileExceptionModifier and TypeMethodDescription(package private) static void
Compiler.compile
(JavaCompiler compiler, List<String> options, Collection<JavaFileObject> sourceFileObjects, JavaFileManager fileManager, ErrorHandler compileErrorHandler, WarningHandler warningHandler, SortedSet<Location> offsets) Compiles on theJavaFileManager
/JavaFileObject
level.(package private) static void
Compiler.compile
(JavaCompiler compiler, List<String> options, ResourceFinder sourceFinder, Charset sourceFileCharset, ResourceFinder classFileFinder, ResourceCreator classFileCreator, Resource[] sourceFiles, ErrorHandler compileErrorHandler, WarningHandler warningHandler, SortedSet<Location> offsets) void
void
void
protected void
void
void
void
protected final void
void
void
<T> T
ExpressionEvaluator.createFastEvaluator
(Reader reader, Class<? extends T> interfaceToImplement, String... parameterNames) <T> T
ExpressionEvaluator.createFastEvaluator
(String expression, Class<? extends T> interfaceToImplement, String... parameterNames) <T> T
ScriptEvaluator.createFastEvaluator
(Reader r, Class<T> interfaceToImplement, String[] parameterNames) <T> T
ScriptEvaluator.createFastEvaluator
(String script, Class<T> interfaceToImplement, String[] parameterNames) ClassBodyEvaluator.createInstance
(Reader reader) Constructors in org.codehaus.commons.compiler.jdk that throw CompileExceptionModifierConstructorDescriptionExpressionEvaluator
(String expression, Class<?> expressionType, String[] parameterNames, Class<?>[] parameterTypes) Equivalent toExpressionEvaluator
(String expression, Class<?> expressionType, String[] parameterNames, Class<?>[] parameterTypes, Class<?>[] thrownExceptions, Class<?> extendedType, Class<?>[] implementedTypes, ClassLoader parentClassLoader) Equivalent toExpressionEvaluator
(String expression, Class<?> expressionType, String[] parameterNames, Class<?>[] parameterTypes, Class<?>[] thrownExceptions, ClassLoader parentClassLoader) Equivalent toScriptEvaluator
(String script) Equivalent toScriptEvaluator
(String fileName, InputStream is, Class<?> returnType, String[] parameterNames, Class<?>[] parameterTypes, Class<?>[] thrownExceptions, ClassLoader parentClassLoader) Equivalent toScriptEvaluator
(String fileName, Reader reader, Class<?> returnType, String[] parameterNames, Class<?>[] parameterTypes, Class<?>[] thrownExceptions, ClassLoader parentClassLoader) Equivalent toScriptEvaluator
(String script, Class<?> returnType) Equivalent toScriptEvaluator
(String script, Class<?> returnType, String[] parameterNames, Class<?>[] parameterTypes) Equivalent toScriptEvaluator
(String script, Class<?> returnType, String[] parameterNames, Class<?>[] parameterTypes, Class<?>[] thrownExceptions) Equivalent to -
Uses of CompileException in org.codehaus.janino
Methods in org.codehaus.janino that return CompileExceptionModifier and TypeMethodDescriptionprotected final CompileException
Parser.compileException
(String message) Convenience method for throwing aCompileException
.protected static CompileException
Parser.compileException
(String message, Location location) Convenience method for throwing aCompileException
.protected final CompileException
TokenStreamImpl.compileException
(String message) Convenience method for throwing aCompileException
.private static CompileException
UnitCompiler.compileException
(Java.Locatable locatable, String message) Methods in org.codehaus.janino that throw CompileExceptionModifier and TypeMethodDescriptionprivate short
UnitCompiler.accessFlags
(Java.Modifier[] modifiers) private void
UnitCompiler.addFields
(Java.FieldDeclaration fd, ClassFile cf) Creates and addsClassFile.FieldInfo
s to the cf for all fields declared by the fd.private static ClassFile.MethodInfo
UnitCompiler.addMethodInfo
(Java.Locatable locatable, ClassFile classFile, short accessFlags, String methodName, MethodDescriptor methodMd) private Java.Modifier[]
Parser.annotationTypeElementModifiers
(Java.Modifier[] modifiers) private void
UnitCompiler.assignmentConversion
(Java.Locatable locatable, IType sourceType, IType targetType, Object constantValue) Implements "assignment conversion" (JLS7 5.2) (more precisely: "assignment contexts".)(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.binaryNumericPromotionType
(Java.Locatable locatable, IType type1, IType type2) private void
UnitCompiler.buildLocalVariableMap
(Java.Block block, Map<String, Java.LocalVariable> localVars) private Map
<String, Java.LocalVariable> UnitCompiler.buildLocalVariableMap
(Java.BlockStatement blockStatement, Map<String, Java.LocalVariable> localVars) Computes and fills in the 'local variable map' for the given blockStatement.protected void
UnitCompiler.buildLocalVariableMap
(Java.CatchClause catchClause, Map<String, Java.LocalVariable> localVars) Adds the given localVars to the 'local variable map' of the given catchClause.private void
UnitCompiler.buildLocalVariableMap
(Java.DoStatement ds, Map<String, Java.LocalVariable> localVars) private void
UnitCompiler.buildLocalVariableMap
(Java.ForEachStatement fes, Map<String, Java.LocalVariable> localVars) private void
UnitCompiler.buildLocalVariableMap
(Java.ForStatement fs, Map<String, Java.LocalVariable> localVars) private void
UnitCompiler.buildLocalVariableMap
(Java.FunctionDeclarator fd) private void
UnitCompiler.buildLocalVariableMap
(Java.IfStatement is, Map<String, Java.LocalVariable> localVars) private void
UnitCompiler.buildLocalVariableMap
(Java.Initializer i, Map<String, Java.LocalVariable> localVars) private Map
<String, Java.LocalVariable> UnitCompiler.buildLocalVariableMap
(Java.LabeledStatement ls, Map<String, Java.LocalVariable> localVars) private Map
<String, Java.LocalVariable> UnitCompiler.buildLocalVariableMap
(Java.LocalVariableDeclarationStatement lvds, Map<String, Java.LocalVariable> localVars) private void
UnitCompiler.buildLocalVariableMap
(Java.SwitchStatement ss, Map<String, Java.LocalVariable> localVars) private void
UnitCompiler.buildLocalVariableMap
(Java.SynchronizedStatement ss, Map<String, Java.LocalVariable> localVars) private void
UnitCompiler.buildLocalVariableMap
(Java.TryStatement ts, Map<String, Java.LocalVariable> localVars) private void
UnitCompiler.buildLocalVariableMap
(Java.WhileStatement ws, Map<String, Java.LocalVariable> localVars) private void
UnitCompiler.castConversion
(Java.Locatable locatable, IType sourceType, IType targetType, Object constantValue) private void
UnitCompiler.checkAccessible
(IClass.IMember member, Java.Scope contextScope, Location location) Checks whether the givenIClass.IMember
is accessible in the given context, according to JLS7 6.6.1.BL1.B4.private void
UnitCompiler.checkAccessible
(IClass type, Java.Scope contextScope, Location location) Checks whether the givenIClass
is accessible in the given context, according to JLS7 6.6.1.2 and 6.6.1.4.private void
UnitCompiler.checkForConflictWithSingleTypeImport
(String name, Location location) private void
UnitCompiler.checkForNameConflictWithAnotherPackageMemberTypeDeclaration
(Java.PackageMemberTypeDeclaration pmtd) private void
UnitCompiler.checkMemberAccessible
(IClass iClassDeclaringMember, IClass.IMember member, Java.Scope contextScope, Location location) 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 Java.Modifier[]
Parser.checkModifiers
(Java.Modifier[] modifiers, String... allowedKeywords) Verifies that the modifiers are consistent.private void
UnitCompiler.checkThrownException
(Java.Locatable locatable, IType type, Java.Scope scope) private void
UnitCompiler.checkThrownExceptions
(Java.Invocation in, IClass.IMethod iMethod) private Java.Modifier[]
Parser.classModifiers
(Java.Modifier[] modifiers) private IType
UnitCompiler.commonSupertype
(IType t1, IType t2) private IType
UnitCompiler.commonSupertype2
(IType t1, IType t2) void
void
UnitCompiler.Compilable.compile()
boolean
UnitCompiler.Compilable2.compile()
private void
UnitCompiler.compile
(Java.ArrayInitializerOrRvalue aiorv, IType arrayType) private boolean
UnitCompiler.compile
(Java.BlockStatement bs) private void
UnitCompiler.compile
(Java.FunctionDeclarator fd, ClassFile classFile) private void
UnitCompiler.compile
(Java.Rvalue rv) SomeJava.Rvalue
s compile more efficiently when their value is not needed, e.g.private void
UnitCompiler.compile
(Java.TypeDeclaration td) private void
private void
UnitCompiler.compile2
(Java.AbstractClassDeclaration cd) 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.CompilationUnit cu) Compiles an (ordinary, not modular) compilation unitprivate 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 void
UnitCompiler.compile2
(Java.FunctionDeclarator fd, ClassFile classFile) 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.ModularCompilationUnit mcu) private void
UnitCompiler.compile2
(Java.PackageMemberClassDeclaration pmcd) Compiles a top-level class or enum declaration.private void
UnitCompiler.compile2
(Java.PackageMemberInterfaceDeclaration pmid) Compiles a top-level interface or annotation type declaration.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 void
UnitCompiler.compileAnnotations
(Java.Annotation[] annotations, Annotatable target, ClassFile cf) Converts and adds the annotations to the target.private IType
UnitCompiler.compileArithmeticBinaryOperation
(Java.Locatable locatable, IType lhsType, String operator, Java.Rvalue rhs) The LHS operand of type lhsType is expected on the stack.private IType
UnitCompiler.compileArithmeticOperation
(Java.Locatable locatable, IType firstOperandType, Iterator<Java.Rvalue> operands, String operator) Executes an arithmetic operation on a sequence of operands.private void
UnitCompiler.compileBoolean
(Java.Rvalue rv, CodeContext.Offset dst, boolean orientation) Compiles anJava.Rvalue
and branches, depending on the value.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 int
UnitCompiler.compileContext
(Java.Rvalue rv) Generates code that determines the context of theJava.Rvalue
and puts it on the operand stack.private int
UnitCompiler.compileContext2
(Java.AmbiguousName an) private int
UnitCompiler.compileContext2
(Java.ArrayAccessExpression aae) Array access expression; see JLS7 15.13 / JLS8+ 15.10.3.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) Compiles all of the types for this declarationprivate void
UnitCompiler.compileDeclaredMethods
(Java.TypeDeclaration typeDeclaration, ClassFile cf) Compiles all of the methods for this declarationprivate void
UnitCompiler.compileDeclaredMethods
(Java.TypeDeclaration typeDeclaration, ClassFile cf, int startPos) Compiles methods for this declaration starting at startPos.private ClassFile.ElementValue
UnitCompiler.compileElementValue
(Java.ElementValue elementValue, ClassFile cf, boolean compileAsArray) private void
UnitCompiler.compileError
(String message) Equivalent withUnitCompiler.compileError(String, Location)
with anull
location argument.private void
UnitCompiler.compileError
(String message, Location location) Issues a compile error with the given message.private IType
UnitCompiler.compileGet
(Java.Rvalue rv) Generates code that determines the value of theJava.Rvalue
and puts it on the operand stack.private IType
UnitCompiler.compileGet2
(Java.AmbiguousName an) private IType
UnitCompiler.compileGet2
(Java.ArrayAccessExpression aae) private IClass
UnitCompiler.compileGet2
(Java.ArrayCreationReference acr) private IType
UnitCompiler.compileGet2
(Java.Assignment a) private IType
UnitCompiler.compileGet2
(Java.BinaryOperation bo) private IClass
UnitCompiler.compileGet2
(Java.BooleanRvalue brv) private IType
UnitCompiler.compileGet2
(Java.Cast c) private IClass
UnitCompiler.compileGet2
(Java.ClassInstanceCreationReference cicr) private IClass
UnitCompiler.compileGet2
(Java.ClassLiteral cl) private IType
UnitCompiler.compileGet2
(Java.ConditionalExpression ce) private IType
UnitCompiler.compileGet2
(Java.Crement c) private IType
UnitCompiler.compileGet2
(Java.FieldAccess fa) private IType
UnitCompiler.compileGet2
(Java.FieldAccessExpression fae) private IClass
UnitCompiler.compileGet2
(Java.Instanceof io) private IClass
UnitCompiler.compileGet2
(Java.LambdaExpression le) private IClass
UnitCompiler.compileGet2
(Java.Literal l) private IClass
UnitCompiler.compileGet2
(Java.MethodInvocation mi) private IClass
UnitCompiler.compileGet2
(Java.MethodReference mr) private IClass
UnitCompiler.compileGet2
(Java.NewAnonymousClassInstance naci) private IClass
UnitCompiler.compileGet2
(Java.NewArray na) private IType
UnitCompiler.compileGet2
(Java.NewClassInstance nci) private IType
UnitCompiler.compileGet2
(Java.NewInitializedArray nia) private IType
UnitCompiler.compileGet2
(Java.ParameterAccess pa) private IType
UnitCompiler.compileGet2
(Java.ParenthesizedExpression pe) private IType
UnitCompiler.compileGet2
(Java.QualifiedThisReference qtr) private IClass
UnitCompiler.compileGet2
(Java.SimpleConstant sl) private IType
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, IType arrayType) private IType
UnitCompiler.compileGetValue
(Java.Rvalue rv) Convenience function that callsUnitCompiler.compileContext(Rvalue)
andUnitCompiler.compileGet(Rvalue)
.private void
UnitCompiler.compileSet
(Java.Lvalue lv) Generates code that stores a value in theJava.Lvalue
.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
(List<? extends Java.BlockStatement> statements) private IClass
UnitCompiler.compileStringConcatenation
(Java.Locatable locatable, IType type, Java.Rvalue secondOperand, Iterator<Java.Rvalue> operands) protected final ClassLoader
SimpleCompiler.compileToClassLoader
(Java.AbstractCompilationUnit abstractCompilationUnit) Compiles the given compilation unit.private boolean
UnitCompiler.compileTryCatch
(Java.TryStatement tryStatement, UnitCompiler.Compilable2 compileBody, CodeContext.Offset beginningOfBody, CodeContext.Offset afterStatement) Generates code for a TRY statement without resources and without a FINALLY clause.private boolean
UnitCompiler.compileTryCatchFinally
(Java.TryStatement ts, UnitCompiler.Compilable2 compileBody, Java.BlockStatement finallY) Generates code for a TRY statement without resources, but with an (optional) FINALLY clause.private boolean
UnitCompiler.compileTryCatchFinallyWithResources
(Java.TryStatement ts, List<Java.TryStatement.Resource> resources, UnitCompiler.Compilable2 compileBody, Java.Block finallY) Generates code for a TRY statement with (possibly zero) resources and an (optional) FINALLY clause.private boolean
UnitCompiler.compileUnconditionalLoop
(Java.ContinuableStatement cs, Java.BlockStatement body, Java.Rvalue[] update) private boolean
UnitCompiler.compileUnconditionalLoopWithUpdate
(Java.ContinuableStatement cs, Java.BlockStatement body, Java.Rvalue[] update) void
UnitCompiler.compileUnit
(boolean debugSource, boolean debugLines, boolean debugVars, Collection<ClassFile> generatedClassFiles) Generates a set ofClassFile
objects which represent the classes and interfaces declared in the compilation unit.void
UnitCompiler.compileUnit
(boolean debugSource, boolean debugLines, boolean debugVars, UnitCompiler.ClassFileConsumer storesClassFiles) Generates a set ofClassFile
objects which represent the classes and interfaces declared in the compilation unit.private IClass
UnitCompiler.consT
(Java.Locatable locatable, Object value) Pushes one value on the operand stack and pushes the respectiveClassFile.StackMapTableAttribute.VerificationTypeInfo
operand to the stack map.private Object
UnitCompiler.constantAssignmentConversion
(Java.Locatable locatable, Object value, IType targetType) Implements "assignment conversion" (JLS7 5.2) on a constant value.private Java.Modifier[]
Parser.constantModifiers
(Java.Modifier[] modifiers) private Java.Modifier[]
Parser.constructorModifiers
(Java.Modifier[] modifiers) private IClass
UnitCompiler.convertToPrimitiveNumericType
(Java.Locatable locatable, IType type) If the given type is a primitive type, return that type.final void
(package private) void
ClassBodyEvaluator.cook
(Java.CompilationUnit compilationUnit) void
void
void
final void
final void
final void
LikeExpressionEvaluator.cook(Scanner)
, but cooks a set of scripts into one class.final void
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
(package private) void
ScriptEvaluator.cook
(String fileName, Java.AbstractCompilationUnit.ImportDeclaration[] importDeclarations, Java.BlockStatement[][] statementss, Java.MethodDeclarator[][] localMethodss) protected void
ScriptEvaluator.cook
(Java.CompilationUnit compilationUnit) Compiles the given compilationUnit, defines it into aClassLoader
, loads the generated class, gets the script methods from that class, and makes them available throughScriptEvaluator.getMethod(int)
.final void
ScriptEvaluator.cook
(Java.CompilationUnit compilationUnit, Collection<Java.MethodDeclarator> methodDeclarators) final void
final void
Cooks a set of scripts into one class.final void
Scans, parses and compiles a given compilation unit from the givenReader
.void
SimpleCompiler.cook
(Java.AbstractCompilationUnit abstractCompilationUnit) Cooks this compilation unit directly.void
Scans, parses and compiles a given compilation unit from the given scanner.private void
private void
private void
private void
static Object
ClassBodyEvaluator.createFastClassBodyEvaluator
(Scanner scanner, Class<?> baseType, ClassLoader parentClassLoader) Deprecated.static Object
ClassBodyEvaluator.createFastClassBodyEvaluator
(Scanner scanner, String className, Class<?> extendedClass, Class<?>[] implementedInterfaces, ClassLoader parentClassLoader) Deprecated.UseClassBodyEvaluator.createInstance(Reader)
instead<T> T
ExpressionEvaluator.createFastEvaluator
(Reader reader, Class<? extends T> interfaceToImplement, String... parameterNames) <T> T
ExpressionEvaluator.createFastEvaluator
(String script, Class<? extends T> interfaceToImplement, String... parameterNames) <T> T
ExpressionEvaluator.createFastEvaluator
(Scanner scanner, Class<T> interfaceToImplement, String... parameterNames) Notice: This method is not declared inIScriptEvaluator
, and is hence only available in this implementation oforg.codehaus.commons.compiler
.<T> T
ScriptEvaluator.createFastEvaluator
(Reader reader, Class<T> interfaceToImplement, String[] parameterNames) <T> T
ScriptEvaluator.createFastEvaluator
(String script, Class<T> interfaceToImplement, String[] parameterNames) <T> T
ScriptEvaluator.createFastEvaluator
(Scanner scanner, Class<?> interfaceToImplement, String[] parameterNames) Notice: This method is not declared inIScriptEvaluator
, and is hence only available in this implementation oforg.codehaus.commons.compiler
.static Object
ExpressionEvaluator.createFastExpressionEvaluator
(String expression, Class<?> interfaceToImplement, String[] parameterNames, ClassLoader parentClassLoader) Deprecated.static Object
ExpressionEvaluator.createFastExpressionEvaluator
(Scanner scanner, String[] defaultImports, String className, Class<?> extendedType, Class<?> interfaceToImplement, String[] parameterNames, ClassLoader parentClassLoader) Deprecated.static Object
ExpressionEvaluator.createFastExpressionEvaluator
(Scanner scanner, String className, Class<?> extendedType, Class<?> interfaceToImplement, String[] parameterNames, ClassLoader parentClassLoader) Deprecated.static Object
ScriptEvaluator.createFastScriptEvaluator
(String script, Class<?> interfaceToImplement, String[] parameterNames) Deprecated.static Object
ScriptEvaluator.createFastScriptEvaluator
(Scanner scanner, Class<?> interfaceToImplement, String[] parameterNames, ClassLoader parentClassLoader) Deprecated.static Object
ScriptEvaluator.createFastScriptEvaluator
(Scanner scanner, String[] defaultImports, String className, Class<?> extendedClass, Class<?> interfaceToImplement, String[] parameterNames, ClassLoader parentClassLoader) Deprecated.static Object
ScriptEvaluator.createFastScriptEvaluator
(Scanner scanner, String className, Class<?> extendedType, Class<?> interfaceToImplement, String[] parameterNames, ClassLoader parentClassLoader) Deprecated.ClassBodyEvaluator.createInstance
(Reader reader) void
Java.AbstractClassDeclaration.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$<em>n</em>
(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 Java.Rvalue
UnitCompiler.determineValue
(Java.FieldAccessExpression fae) private Java.Rvalue
UnitCompiler.determineValue
(Java.SuperclassFieldAccessExpression scfae) "super.fld", "Type.super.fld"private Java.Modifier[]
Parser.enumConstantModifiers
(Java.Modifier[] modifiers) private boolean
UnitCompiler.fakeCompile
(Java.BlockStatement bs) Called to check whether the givenJava.BlockStatement
compiles or not.private void
UnitCompiler.fakeCompile
(Java.Rvalue rv) Called to check whether the givenJava.Rvalue
compiles or not.private void
private IClass.IMethod
UnitCompiler.fakeIMethod
(IClass targetType, String name, Java.Rvalue[] arguments) private Java.Modifier[]
Parser.fieldModifiers
(Java.Modifier[] modifiers) private ITypeVariableOrIClass
ClassFileIClass.fieldTypeSignatureToITypeVariableOrIClass
(SignatureParser.FieldTypeSignature fts) protected Java.AbstractCompilationUnit
JavaSourceIClassLoader.findCompilationUnit
(String className) Finds the Java source file for the named class through the configured 'source resource finder' and parses it.final IClass.IConstructor
IClass.findIConstructor
(IClass[] parameterTypes) private IClass.IField
UnitCompiler.findIField
(IClass iClass, String name, Location location) Finds a named field in the givenIClass
.final IClass.IMethod
IClass.findIMethod
(String methodName, IClass[] parameterTypes) private IClass.IMethod
UnitCompiler.findIMethod
(IType targetType, Java.Invocation invocation) Finds aIClass.IMethod
in the given targetType, its superclasses or superinterfaces which is applicable with the given invocation.UnitCompiler.findIMethod
(Java.MethodInvocation mi) Finds methods of the mi.
target
named mi.
methodName
, examines the argument types and chooses the most specific method.UnitCompiler.findIMethod
(Java.SuperclassMethodInvocation superclassMethodInvocation) (package private) IClass[]
IClass.findMemberType
(String name) If name isnull
, finds allIClass
es visible in the scope of the current class.private void
IClass.findMemberType
(String name, Collection<IClass> result) private IClass
UnitCompiler.findMemberType
(IType iType, String name, Java.TypeArgument[] typeArguments, Location location) Finds a named type in the givenIClass
orIParameterizedType
.UnitCompiler.findMostSpecificIInvocable
(Java.Locatable locatable, IClass.IInvocable[] iInvocables, IClass[] argumentTypes, boolean boxingPermitted, Java.Scope contextScope) Determines 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) Determines 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, String[] identifiers) Attempts to load anIClass
by fully-qualified name throughUnitCompiler.iClassLoader
.private IClass
UnitCompiler.findTypeByName
(Location location, String className) Finds the namedIClass
in this compilation unit, or through theUnitCompiler.iClassLoader
.private void
UnitCompiler.generateBridgeMethod
(ClassFile cf, IClass declaringIClass, IClass.IMethod base, IClass.IMethod override) Generates and compiles a bridge method with signature base that delegates to override.private boolean
UnitCompiler.generatesCode
(Java.BlockStatement bs) Checks whether invocation ofUnitCompiler.compile(BlockStatement)
would generate more than zero code bytes.private boolean
UnitCompiler.generatesCode2
(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) IClass.IAnnotation.getAnnotationType()
private ITypeVariableOrIClass[]
ClassFileIClass.getBounds
(SignatureParser.FormalTypeParameter ftp) ITypeVariable.getBounds()
abstract Object
IClass.IField.getConstantValue()
Returns the value of the field if it is a compile-time constant value, i.e.ReflectionIClass.ReflectionIField.getConstantValue()
This implementation ofIClass.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.final Object
UnitCompiler.getConstantValue
(Java.ArrayInitializerOrRvalue rv) Attempts to evaluate as a constant expression.final Object
UnitCompiler.getConstantValue
(Java.Rvalue rv) Attempts to evaluate as a constant expression.private Object
UnitCompiler.getConstantValue2
(Java.AmbiguousName an) private Object
UnitCompiler.getConstantValue2
(Java.BinaryOperation bo) private Object
UnitCompiler.getConstantValue2
(Java.Cast c) private char
UnitCompiler.getConstantValue2
(Java.CharacterLiteral cl) private Object
UnitCompiler.getConstantValue2
(Java.ConditionalExpression ce) private Object
UnitCompiler.getConstantValue2
(Java.FieldAccess fa) private Object
UnitCompiler.getConstantValue2
(Java.FloatingPointLiteral fpl) private Object
UnitCompiler.getConstantValue2
(Java.IntegerLiteral il) private Object
UnitCompiler.getConstantValue2
(Java.LocalVariableAccess lva) private Object
UnitCompiler.getConstantValue2
(Java.ParenthesizedExpression pe) private String
UnitCompiler.getConstantValue2
(Java.StringLiteral sl) private Object
UnitCompiler.getConstantValue2
(Java.UnaryOperation uo) final IClass[]
IClass.getDeclaredIClasses()
Returns the classes and interfaces declared as members of the class (but not inherited classes and interfaces).protected IClass[]
ClassFileIClass.getDeclaredIClasses2()
protected abstract IClass[]
IClass.getDeclaredIClasses2()
private Java.AbstractClassDeclaration
UnitCompiler.getDeclaringClass
(Java.QualifiedThisReference qtr) final IClass
IClass.getDeclaringIClass()
protected IClass
ClassFileIClass.getDeclaringIClass2()
protected abstract IClass
IClass.getDeclaringIClass2()
private Java.TypeBodyDeclaration
UnitCompiler.getDeclaringTypeBodyDeclaration
(Java.QualifiedThisReference qtr) IClass.IField.getDescriptor()
final MethodDescriptor
IClass.IInvocable.getDescriptor()
Returns the method descriptor of this constructor or method.IClass.IConstructor.getDescriptor2()
abstract MethodDescriptor
IClass.IInvocable.getDescriptor2()
Uncached implementation ofIClass.IInvocable.getDescriptor()
.IClass.IMethod.getDescriptor2()
IClass.IAnnotation.getElementValue
(String name) private void
UnitCompiler.getfield
(Java.Locatable locatable, IClass.IField iField) final IClass.IAnnotation[]
IClass.getIAnnotations()
protected IClass.IAnnotation[]
ClassFileIClass.getIAnnotations2()
protected IClass.IAnnotation[]
IClass.getIAnnotations2()
ReflectionIClass.getIAnnotations2()
private IClass
UnitCompiler.getIClass
(Java.ThisReference tr) final IClass.IMethod[]
IClass.getIMethods()
Returns all methods declared in the class or interface, its superclasses and its superinterfaces.private void
IClass.getIMethods
(List<IClass.IMethod> result) void
UnitCompiler.getIMethods
(IClass type, String methodName, List<IClass.IMethod> v) Adds all methods with the given methodName that are declared by the type, its superclasses and all their superinterfaces to the result list v.final IClass[]
IClass.getInterfaces()
Returns the interfaces implemented by the class, respectively the superinterfaces of the interface, respectively{
Cloneable
,
Serializable
}
for arrays.private static IType[]
UnitCompiler.getInterfaces
(IType t1) protected IClass[]
ClassFileIClass.getInterfaces2()
protected abstract IClass[]
IClass.getInterfaces2()
final ITypeVariable[]
IClass.getITypeVariables()
protected ITypeVariable[]
ClassFileIClass.getITypeVariables2()
protected abstract ITypeVariable[]
IClass.getITypeVariables2()
The uncached version ofIClass.getDeclaredIConstructors()
which must be implemented by derived classes.UnitCompiler.getLocalVariable
(Java.CatchParameter parameter) UnitCompiler.getLocalVariable
(Java.FunctionDeclarator.FormalParameter parameter) UnitCompiler.getLocalVariable
(Java.FunctionDeclarator.FormalParameter parameter, boolean isVariableArityParameter) UnitCompiler.getLocalVariable
(Java.LocalVariableDeclarationStatement lvds, Java.VariableDeclarator vd) (package private) Java.ArrayInitializerOrRvalue
UnitCompiler.getNonConstantFinalInitializer
(Java.FieldDeclaration fd, Java.VariableDeclarator vd) Determines the non-constant-final initializer of the givenJava.VariableDeclarator
.final 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 classesprotected IClass
ClassFileIClass.getOuterIClass2()
protected abstract IClass
IClass.getOuterIClass2()
protected IClass
ReflectionIClass.getOuterIClass2()
final IClass[]
IClass.IInvocable.getParameterTypes()
Returns the types of the parameters of this constructor or method.abstract IClass[]
IClass.IInvocable.getParameterTypes2()
Opposed to theConstructor
, there is no magic "this$0
" parameter.IClass[]
ReflectionIClass.ReflectionIConstructor.getParameterTypes2()
private IClass
UnitCompiler.getRawReferenceType
(Location location, String simpleTypeName, Java.Scope scope) private IClass
UnitCompiler.getRawType
(Java.Type t) private IType
UnitCompiler.getReferenceType
(Location location, String simpleTypeName, Java.TypeArgument[] typeArguments, Java.Scope scope) JLS7 6.5.5.1 Simple type name (single identifier)private IType
UnitCompiler.getReferenceType
(Location location, Java.Scope scope, String[] identifiers, int n, Java.TypeArgument[] typeArguments) abstract IClass
IClass.IMethod.getReturnType()
private IType
UnitCompiler.getReturnType
(Java.FunctionDeclarator fd) String[]
UnitCompiler.getSingleTypeImport
(String name, Location location) Checks if the given simple name was imported through a single type import.final IClass
IClass.getSuperclass()
Returns the superclass of the class.private static IType
UnitCompiler.getSuperclass
(IType type) protected IClass
ClassFileIClass.getSuperclass2()
protected abstract IClass
IClass.getSuperclass2()
private IType
UnitCompiler.getTargetIType
(Java.QualifiedThisReference qtr) final IClass[]
IClass.IInvocable.getThrownExceptions()
Returns the types thrown by this constructor or method.abstract IClass[]
IClass.IInvocable.getThrownExceptions2()
abstract IClass
IClass.IField.getType()
private IType
private IType
UnitCompiler.getType
(Java.Lvalue lv) private IType
UnitCompiler.getType
(Java.Rvalue rv) private IType
private IType
UnitCompiler.getType2
(Java.AmbiguousName an) private IType
UnitCompiler.getType2
(Java.ArrayAccessExpression aae) private IClass
UnitCompiler.getType2
(Java.ArrayCreationReference acr) private IClass
UnitCompiler.getType2
(Java.ArrayType at) private IType
UnitCompiler.getType2
(Java.Assignment a) private IType
UnitCompiler.getType2
(Java.BinaryOperation bo) private IType
private IClass
UnitCompiler.getType2
(Java.ClassInstanceCreationReference cicr) private IType
UnitCompiler.getType2
(Java.ConditionalExpression ce) private IClass
UnitCompiler.getType2
(Java.ConstructorInvocation ci) private IType
UnitCompiler.getType2
(Java.Crement c) private IType
UnitCompiler.getType2
(Java.FieldAccess fa) private IType
UnitCompiler.getType2
(Java.FieldAccessExpression fae) private IClass
UnitCompiler.getType2
(Java.LambdaExpression le) private IClass
UnitCompiler.getType2
(Java.MethodInvocation mi) private IClass
UnitCompiler.getType2
(Java.MethodReference mr) private IClass
UnitCompiler.getType2
(Java.NewArray na) private IType
UnitCompiler.getType2
(Java.NewClassInstance nci) private IType
UnitCompiler.getType2
(Java.NewInitializedArray nia) private IClass
UnitCompiler.getType2
(Java.Package p) private IType
UnitCompiler.getType2
(Java.ParameterAccess pa) private IType
UnitCompiler.getType2
(Java.ParenthesizedExpression pe) private IType
UnitCompiler.getType2
(Java.QualifiedThisReference qtr) private IType
UnitCompiler.getType2
(Java.ReferenceType rt) private IClass
UnitCompiler.getType2
(Java.RvalueMemberType rvmt) private IType
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) private IType[]
static String[]
ExpressionEvaluator.guessParameterNames
(Scanner scanner) Guess the names of the parameters used in the given expression.static String[]
ScriptEvaluator.guessParameterNames
(Scanner scanner) Guesses the names of the parameters used in the given expression.private static String[]
ExpressionEvaluator.guessParameterNames2
(Scanner scanner) private static String[]
ScriptEvaluator.guessParameterNames2
(Scanner scanner) void
FilterWarningHandler.handleWarning
(String handle, String message, Location location) private boolean
UnitCompiler.hasAnnotation
(Java.FunctionDeclarator fd, IClass annotationType) final boolean
IClass.hasIMethod
(String methodName, IClass[] parameterTypes) boolean
IClass.implementsInterface
(IClass that) Ifthis
represents a class: Returntrue
if this class directly or indirectly implementsthat
interface.UnitCompiler.importSingleStatic
(String simpleName) Imports a member class, member interface, static field or static method via the compilation unit's single static import declarations.private IClass
UnitCompiler.importSingleType
(String simpleTypeName, Location location) If the given name was declared in a simple type import, load that class.private void
UnitCompiler.importStatic
(IClass declaringIClass, String simpleName, Collection<Object> result, Location location) Finds all members (member classes, member interfaces, static fields and/or static methods) of the declaringIClass with the given simpleName and adds them to the result.UnitCompiler.importStaticOnDemand
(String simpleName) Imports a member class or interface, static field or static method via the compilation unit's static import on-demand declarations.UnitCompiler.importTypeOnDemand
(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.private IClass
UnitCompiler.importTypeOnDemand2
(String simpleTypeName, Location location) (package private) void
UnitCompiler.initializeInstanceVariablesAndInvokeInstanceInitializers
(Java.ConstructorDeclarator cd) Compiles the instance variable initializers and the instance initializers in their lexical order.private Java.Modifier[]
Parser.interfaceMethodModifiers
(Java.Modifier[] modifiers) private Java.Modifier[]
Parser.interfaceModifiers
(Java.Modifier[] modifiers) private String
UnitCompiler.internalCheckAccessible
(IClass iClassDeclaringMember, Access memberAccess, Java.Scope contextScope) private String
UnitCompiler.internalCheckAccessible
(IClass type, Java.Scope contextScope) private int
Scanner.internalRead()
private void
UnitCompiler.invokeConstructor
(Java.Locatable locatable, IClass.IConstructor iConstructor) Invokes the iConstructor; assumes thatthis
and the correct number and types of arguments are on the operand stack.private void
UnitCompiler.invokeConstructor
(Java.Locatable locatable, Java.Scope scope, Java.Rvalue enclosingInstance, IType targetType, Java.Rvalue[] arguments) Expects the object to initialize on the stack.private void
UnitCompiler.invokeMethod
(Java.Locatable locatable, IClass.IMethod iMethod) Invokes the iMethod; assumes thatthis
(unless iMethod is static) and the correct number and types of arguments are on the operand stack.private boolean
UnitCompiler.isAccessible
(IClass.IMember member, Java.Scope contextScope) Determines whether the givenIClass.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 givenIClass
is accessible in the given context, according to JLS7 6.6.1.2 and 6.6.1.4.boolean
IClass.isAssignableFrom
(IClass that) Determines ifthis
is assignable from that.private static boolean
UnitCompiler.isAssignableFrom
(IType targetType, IType sourceType) private boolean
UnitCompiler.isCastReferenceConvertible
(IType sourceType, IType targetType) JLS7 5.5(package private) Java.LocalVariable
UnitCompiler.isIntLv
(Java.Crement c) Checks whether the operand is anint
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
(IType sourceType, IType targetType) Checks whether "narrowing reference conversion" (JLS7 5.1.5) is possible.boolean
IClass.isSubclassOf
(IClass that) Returnstrue
if this class is an immediate or non-immediate subclass ofthat
class.private boolean
private boolean
UnitCompiler.isType2
(Java.AmbiguousName an) private boolean
UnitCompiler.isWideningReferenceConvertible
(IType sourceType, IType targetType) Checks if "widening reference conversion" (5.1.4) is possible.private void
UnitCompiler.leave
(Java.BlockStatement bs) Cleans up the statement context.private void
UnitCompiler.leave2
(Java.TryStatement ts) private void
UnitCompiler.leaveStatements
(Java.Scope from, Java.Scope to) Statements that jump out of blocks (return
,break
,continue
) must call this method to make sure that thefinally
clauses of alltry ... catch
andsynchronized
statements are executed.(package private) final Java.AbstractCompilationUnit.ImportDeclaration[]
ClassBodyEvaluator.makeImportDeclarations
(Parser parser) protected void
ScriptEvaluator.makeStatements
(int idx, Parser parser, List<Java.BlockStatement> resultStatements, List<Java.MethodDeclarator> resultMethods) Parses statements from the parser until end-of-input.private void
UnitCompiler.maybeCreateInitMethod
(Java.TypeDeclaration td, ClassFile cf, List<Java.BlockStatement> statements) Creates class/interface initialization method iff there is any initialization code.private Java.Modifier[]
Parser.methodModifiers
(Java.Modifier[] modifiers) private ClassFile
UnitCompiler.newClassFile
(short accessFlags, IClass iClass, IClass superclass, IClass[] interfaces) private boolean
UnitCompiler.overridesMethod
(IClass.IMethod method, IClass type) private boolean
UnitCompiler.overridesMethodFromSupertype
(IClass.IMethod m, IClass type) private Java.Modifier[]
Parser.packageMemberClassModifiers
(Java.Modifier[] modifiers) private Java.Modifier[]
Parser.packageMemberInterfaceModifiers
(Java.Modifier[] modifiers) private Java.Modifier[]
Parser.packageModifiers
(Java.Modifier[] modifiers) private Java.AbstractCompilationUnit
Compiler.parseAbstractCompilationUnit
(String fileName, InputStream inputStream, Charset charset) Reads one compilation unit from a file and parses it.Parser.parseAbstractCompilationUnit()
CompilationUnit := [ PackageDeclaration ] { ImportDeclaration } { TypeDeclaration }Parser.parseAdditiveExpression()
AdditiveExpression := MultiplicativeExpression { ( '+' | '-' ) MultiplicativeExpression }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 } ]Parser.parseAnnotationTypeDeclarationRest
(String docComment, Java.Modifier[] modifiers, Parser.InterfaceDeclarationContext context) AnnotationTypeDeclarationRest := Identifier AnnotationTypeBodyParser.parseArgumentList()
ArgumentList := Expression { ',' Expression }Parser.parseArguments()
Arguments := '(' [ ArgumentList ] ')'Parser.parseArrayInitializer()
ArrayInitializer := '{' [ VariableInitializer { ',' VariableInitializer } [ ',' ] '}'Parser.parseAssertStatement()
AssertStatement := 'assert' Expression [ ':' Expression ] ';'Parser.parseAssignmentExpression()
AssignmentExpression := ConditionalExpression [ AssignmentOperator AssignmentExpression ] AssignmentOperator := '=' | '*=' | '/=' | '%=' | '+=' | '-=' | '<<=' | '>>=' | '>>>=' | '&=' | '^=' | '|='Parser.parseBlock()
Block := '{' BlockStatements '}'Parser.parseBlockStatement()
BlockStatement := Statement | (1) 'class' ...Parser.parseBlockStatements()
BlockStatements := { BlockStatement }(package private) int
Parser.parseBracketsOpt()
BracketsOpt := { '[' ']' }Parser.parseBreakStatement()
BreakStatement := 'break' [ Identifier ] ';'Parser.parseCatchParameter()
CatchFormalParameter := { VariableModifier } CatchType VariableDeclaratorId CatchType := UnannClassType { '|' ClassType } VariableModifier := Annotation | 'final' VariableDeclaratorId := Identifier [ Dims ] Dims := { Annotation } '[' ']' { { Annotation } '[' ']' } UnannClassType := Identifier [ TypeArguments ] | UnannClassOrInterfaceType '.' { Annotation } Identifier [ TypeArguments ] UnannInterfaceType := UnannClassType UnannClassOrInterfaceType := UnannClassType | UnannInterfaceType ClassType := { Annotation } Identifier [ TypeArguments ] | ClassOrInterfaceType '.' { Annotation } Identifier [ TypeArguments ]void
Parser.parseClassBody
(Java.AbstractClassDeclaration classDeclaration) ClassBody := '{' { ClassBodyDeclaration } '}'void
Parser.parseClassBodyDeclaration
(Java.AbstractClassDeclaration classDeclaration) ClassBodyDeclaration := ';' | ModifiersOpt ( Block | // Instance (JLS7 8.6) or static initializer (JLS7 8.7) 'void' Identifier MethodDeclarationRest | 'class' ClassDeclarationRest | 'interface' InterfaceDeclarationRest | ConstructorDeclarator | [ TypeArguments ] Type Identifier MethodDeclarationRest | Type Identifier FieldDeclarationRest ';' )Parser.parseClassDeclarationRest
(String docComment, Java.Modifier[] modifiers, Parser.ClassDeclarationContext context) ClassDeclarationRest := Identifier [ typeParameters ] [ 'extends' ReferenceType ] [ 'implements' ReferenceTypeList ] ClassBodyParser.parseConditionalAndExpression()
ConditionalAndExpression := InclusiveOrExpression { '&&' InclusiveOrExpression }Parser.parseConditionalExpression()
ConditionalExpression := ConditionalOrExpression [ '?' Expression ':' ConditionalExpression ]Parser.parseConditionalOrExpression()
ConditionalOrExpression := ConditionalAndExpression { '||' ConditionalAndExpression ]Parser.parseConstructorDeclarator
(String docComment, Java.Modifier[] modifiers) ConstructorDeclarator := Identifier FormalParameters [ 'throws' ReferenceTypeList ] '{' [ 'this' Arguments ';' | 'super' Arguments ';' | Primary '.' 'super' Arguments ';' ] BlockStatements '}'Parser.parseContinueStatement()
ContinueStatement := 'continue' [ Identifier ] ';'Parser.parseDimExpr()
DimExpr := '[' Expression ']'Parser.parseDimExprs()
DimExprs := DimExpr { DimExpr }Parser.parseDoStatement()
DoStatement := 'do' Statement 'while' '(' Expression ')' ';'private Java.ElementValue
Parser.parseElementValue()
ElementValue := ConditionalExpression | Annotation | ElementValueArrayInitializerprivate Java.ElementValue
Parser.parseElementValueArrayInitializer()
ElementValueArrayInitializer := '{' { ElementValue | ',' } '}'private Java.ElementValuePair
Parser.parseElementValuePair()
ElementValuePair := Identifier '=' ElementValueParser.parseEmptyStatement()
EmptyStatement := ';'void
Parser.parseEnumBody
(Java.EnumDeclaration enumDeclaration) EnumBody := '{' [ EnumConstant { ',' EnumConstant } [ ',' ] [ ';' ] { ClassBodyDeclaration } '}'Parser.parseEnumConstant()
EnumConstant := [ Annotations ] Identifier [ Arguments ] [ ClassBody ]Parser.parseEnumDeclarationRest
(String docComment, Java.Modifier[] modifiers, Parser.ClassDeclarationContext context) EnumDeclarationRest := Identifier [ 'implements' ReferenceTypeList ] EnumBodyParser.parseEqualityExpression()
EqualityExpression := RelationalExpression { ( '==' | '!=' ) RelationalExpression }Parser.parseExclusiveOrExpression()
ExclusiveOrExpression := AndExpression { '^' AndExpression }Parser.parseExpression()
Expression := AssignmentExpression | LambdaExpressionParser.parseExpressionList()
ExpressionList := Expression { ',' Expression }Parser.parseExpressionOrType()
Parser.parseExpressionStatement()
ExpressionStatement := Expression ';'Parser.parseFieldDeclarationRest
(String name) FieldDeclarationRest := VariableDeclaratorRest { ',' VariableDeclarator }Parser.parseFormalParameter
(boolean[] hasEllipsis) FormalParameter := [ 'final' ] Type FormalParameterRestParser.parseFormalParameterList()
FormalParameterList := FormalParameter { ',' FormalParameter }Parser.parseFormalParameterListRest
(Java.Type firstParameterType) FormalParameterListRest := Identifier { ',' FormalParameter }Parser.parseFormalParameterRest
(Java.Modifier[] modifiers, Java.Type type, boolean[] hasEllipsis) FormalParameterRest := [ '.' '.' '.' ] Identifier BracketsOptParser.parseFormalParameters()
FormalParameters := '(' [ FormalParameterList ] ')'Parser.parseForStatement()
ForStatement := 'for' '(' [ ForInit ] ';' [ Expression ] ';' [ ExpressionList ] ')' Statement | 'for' '(' FormalParameter ':' Expression ')' Statement ForInit := Modifiers Type VariableDeclarators | ModifiersOpt PrimitiveType VariableDeclarators | Expression VariableDeclarators (1) | Expression { ',' Expression }Parser.parseIfStatement()
IfStatement := 'if' '(' Expression ')' Statement [ 'else' Statement ]Parser.parseImportDeclaration()
ImportDeclaration := 'import' ImportDeclarationBody ';'Parser.parseImportDeclarationBody()
ImportDeclarationBody := [ 'static' ] Identifier { '.' Identifier } [ '.' '*' ](package private) Java.AbstractCompilationUnit.ImportDeclaration[]
ScriptEvaluator.parseImports
(Parser parser) Parser.parseInclusiveOrExpression()
InclusiveOrExpression := ExclusiveOrExpression { '|' ExclusiveOrExpression }void
Parser.parseInterfaceBody
(Java.InterfaceDeclaration interfaceDeclaration) InterfaceBody := '{' { ';' | ModifiersOpt ( 'void' Identifier MethodDeclarationRest | 'class' ClassDeclarationRest | 'interface' InterfaceDeclarationRest | Type Identifier ( MethodDeclarationRest | FieldDeclarationRest ) ) } '}'Parser.parseInterfaceDeclarationRest
(String docComment, Java.Modifier[] modifiers, Parser.InterfaceDeclarationContext context) InterfaceDeclarationRest := Identifier [ typeParameters ] [ 'extends' ReferenceTypeList ] InterfaceBodyParser.parseLabeledStatement()
LabeledStatement := Identifier ':' Statementprivate Java.LambdaBody
Parser.parseLambdaBody()
LambdaBody :=private Java.LambdaExpression
Parser.parseLambdaExpression()
LambdaExpression := LambdaParameters '->' LambdaBodyprivate Java.LambdaParameters
Parser.parseLambdaParameters()
LambdaParameters := Identifier | '(' [ FormalParameterList ] ')' | '(' InferredFormalParameterList ')'Parser.parseLiteral()
Literal := IntegerLiteral | FloatingPointLiteral | BooleanLiteral | CharacterLiteral | StringLiteral | NullLiteralParser.parseMethodBody()
MethodBody := BlockParser.parseMethodDeclaration()
Equivalent withparseMethodDeclaration(false, MethodDeclarationContext.CLASS_DECLARATION)
.Parser.parseMethodDeclaration
(boolean allowDefaultClause, Parser.MethodDeclarationContext context) MethodDeclaration := [ DocComment ] Modifiers [ TypeParameters ] VoidOrType Identifier MethodDeclarationRestParser.parseMethodDeclarationRest
(String docComment, Java.Modifier[] modifiers, Java.TypeParameter[] typeParameters, Java.Type type, String name, boolean allowDefaultClause, Parser.MethodDeclarationContext context) MethodDeclarationRest := FormalParameters { '[' ']' } [ 'throws' ReferenceTypeList ] [ 'default' expression ] ( ';' | MethodBody )Parser.parseModifiers()
Modifiers := { Modifier }Parser.parseModuleDeclarationRest
(Java.Modifier[] modifiers) ModuleDeclarationRest := [ 'open' ] 'module' identifier { '.' identifier} '{' { ModuleDirective } '}'Parser.parseMultiplicativeExpression()
MultiplicativeExpression := UnaryExpression { ( '*' | '/' | '%' ) UnaryExpression }Parser.parseOptionalModifier()
Modifier := Annotation | 'public' | 'protected' | 'private' | 'static' | 'abstract' | 'final' | 'native' | 'synchronized' | 'transient' | 'volatile' | 'strictfp' | 'default'Parser.parsePackageDeclaration()
PackageDeclaration := 'package' QualifiedIdentifier ';'Parser.parsePackageDeclarationRest
(String docComment, Java.Modifier[] modifiers) PackageDeclaration := { PackageModifier } 'package' identifier { '.' identifier} ';'Parser.parsePackageMemberTypeDeclaration()
PackageMemberTypeDeclaration := ModifiersOpt PackageMemberTypeDeclarationRestParser.parsePackageMemberTypeDeclarationRest
(String docComment, Java.Modifier[] modifiers) PackageMemberTypeDeclarationRest := 'class' ClassDeclarationRest | 'enum' EnumDeclarationRest | 'interface' InterfaceDeclarationRest '@' 'interface' AnnotationTypeDeclarationRestParser.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 PrimitiveType { '[]' } | // Type PrimitiveType { '[]' } '.' 'class' | // ClassLiteral 15.8.2 'void' '.' 'class' | // ClassLiteral 15.8.2 MethodReference // MethodReference JLS9 15.13 Name := Identifier { '.' Identifier } CastExpression := '(' PrimitiveType { '[]' } ')' UnaryExpression | '(' Expression ')' UnaryExpression NewClassInstance := 'new' ReferenceType Arguments NewAnonymousClassInstance := 'new' ReferenceType Arguments [ ClassBody ] NewArray := 'new' Type DimExprs { '[]' } NewInitializedArray := 'new' ArrayType ArrayInitializerString[]
Parser.parseQualifiedIdentifier()
QualifiedIdentifier := Identifier { '.' Identifier }Parser.parseReferenceType()
ReferenceType := { Annotation } QualifiedIdentifier [ TypeArguments ]Parser.parseReferenceTypeList()
ReferenceTypeList := ReferenceType { ',' ReferenceType }Parser.parseRelationalExpression()
RelationalExpression := ShiftExpression { 'instanceof' ReferenceType | '<' ShiftExpression [ { ',' TypeArgument } '>' ] | '<' TypeArgument [ { ',' TypeArgument } '>' ] | ( '>' | '<=' | '>=' ) ShiftExpression }private Java.TryStatement.Resource
Parser.parseResource()
Resource := Modifiers Type VariableDeclarator | VariableAccessParser.parseReturnStatement()
ReturnStatement := 'return' [ Expression ] ';'private static void
ScriptEvaluator.parseScriptStatement
(Parser parser, List<Java.BlockStatement> mainStatements, List<Java.MethodDeclarator> localMethods) ScriptStatement := Statement (1) | 'class' ...Parser.parseSelector
(Java.Atom atom) Selector := '.' Identifier | // FieldAccess 15.11.1 '.' Identifier Arguments | // MethodInvocation '.' '<' TypeList '>' 'super' Arguments // Superconstructor invocation (?) '.' '<' TypeList '>' 'super' '.' .Parser.parseShiftExpression()
ShiftExpression := AdditiveExpression { ( '<<' | '>>' | '>>>' ) AdditiveExpression }Parser.parseStatement()
Statement := LabeledStatement | Block | IfStatement | ForStatement | WhileStatement | DoStatement | TryStatement | 'switch' ...Parser.parseSwitchStatement()
SwitchStatement := 'switch' '(' Expression ')' '{' { SwitchLabels BlockStatements } '}' SwitchLabels := SwitchLabels { SwitchLabels } SwitchLabel := 'case' Expression ':' | 'default' ':'Parser.parseSynchronizedStatement()
SynchronizedStatement := 'synchronized' '(' expression ')' BlockParser.parseThrowStatement()
ThrowStatement := 'throw' Expression ';'Parser.parseTryStatement()
TryStatement := 'try' Block Catches [ Finally ] | 'try' Block Finally Catches := CatchClause { CatchClause } CatchClause := 'catch' '(' FormalParameter ')' Block Finally := 'finally' BlockParser.parseType()
Type := ( 'byte' | 'short' | 'char' | 'int' | 'long' | 'float' | 'double' | 'boolean' | ReferenceType ) { '[' ']' }private Java.TypeArgument
Parser.parseTypeArgument()
TypeArgument := ReferenceType { '[' ']' } <= The optional brackets are missing in JLS7, section 18!? | PrimitiveType '[' ']' { '[' ']' } | '?' extends ReferenceType | '?' super ReferenceTypeprivate Java.TypeArgument[]
Parser.parseTypeArgumentsOpt()
TypeArguments := 'invalid input: '<'' [ TypeArgument { ',' TypeArgument } ] '>'private Java.TypeParameter
Parser.parseTypeParameter()
TypeParameter := identifier [ 'extends' ( identifier | ReferenceType { 'invalid input: '&'' ReferenceType }private Java.TypeParameter[]
Parser.parseTypeParametersOpt()
TypeParameters := 'invalid input: '<'' TypeParameter { ',' TypeParameter } '>'Parser.parseUnaryExpression()
UnaryExpression := { PrefixOperator } Primary { Selector } { PostfixOperator } PrefixOperator := '++' | '--' | '+' | '-' | '~' | '!' PostfixOperator := '++' | '--'Parser.parseVariableDeclarator()
VariableDeclarator := Identifier VariableDeclaratorRestParser.parseVariableDeclaratorRest
(String name) VariableDeclaratorRest := { '[' ']' } [ '=' VariableInitializer ]Parser.parseVariableDeclarators()
VariableDeclarators := VariableDeclarator { ',' VariableDeclarator }Parser.parseVariableInitializer()
VariableInitializer := ArrayInitializer | ExpressionParser.parseVoidOrType()
VoidOrType := 'void' | TypeParser.parseWhileStatement()
WhileStatement := 'while' '(' Expression ')' StatementParser.peek()
boolean
int
boolean
int
private int
Scanner.peek()
Returns the next character, but does not consume it.private boolean
Checks whether the next character is one of the expectedCharacters.TokenStream.peek()
boolean
int
Checks whether the value of the next token equals any of the suspected; does not consume the next token.boolean
int
Checks whether the type of the next token is any of the suspected; does not consume the next token.TokenStreamImpl.peek()
boolean
int
boolean
int
private int
Scanner.peekButOne()
Returns the next-but-one character, but does not consume any characters.private boolean
Parser.peekLiteral()
Parser.peekNextButOne()
boolean
Parser.peekNextButOne
(String suspected) boolean
Parser.peekNextButOne
(TokenType suspected) TokenStream.peekNextButOne()
boolean
TokenStream.peekNextButOne
(String suspected) TokenStreamImpl.peekNextButOne()
boolean
TokenStreamImpl.peekNextButOne
(String suspected) boolean
int
private boolean
Scanner.peekRead
(int expected) Consumes the next character iff it equals the expected character.private boolean
Consumes the next character iff it is one of the expectedCharactersboolean
Checks whether the value of the next token equals the suspected; if so, consumes the token.int
Checks whether the value of the next token is one of the suspected; if so, consumes the token.Checks whether the type of the next token is the suspected; if so, consumes the token.int
Checks whether the type of the next token is one of the suspected; if so, consumes the token.boolean
int
int
Scanner.produce()
Produces and returns the next token.private Token
TokenStreamImpl.produceToken()
private void
UnitCompiler.putfield
(Java.Locatable locatable, IClass.IField iField) Parser.read()
void
int
private char
Scanner.read()
Consumes and returns the next character.TokenStream.read()
void
Verifies that the value of the next token equals expected, and consumes the token.int
Verifies that the value of the next token equals one of the expected, and consumes the token.Verifies that the type of the next token is the expected, and consumes the token.int
Verifies that the type of the next token is one of the expected, and consumes the token.TokenStreamImpl.read()
void
int
int
private Java.Atom
UnitCompiler.reclassify
(Java.AmbiguousName an) private Java.Atom
UnitCompiler.reclassifyName
(Location location, Java.Scope scope, String identifier) JLS7 6.5.2.1private Java.Atom
UnitCompiler.reclassifyName
(Location location, Java.Scope scope, 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.AbstractTypeDeclaration declaringType, Java.TypeBodyDeclaration declaringTypeBodyDeclaration, IType targetIType) private IClass[]
ClassFileIClass.resolveClasses
(short[] ifs) private TokenType
Scanner.scan()
private void
Scanner.scanLiteralCharacter()
Scans the next literal character into aStringBuilder
.private TokenType
Scanner.scanNumericLiteral()
private void
UnitCompiler.stringConversion
(Java.Locatable locatable, IType sourceType) Converts object of type "sourceType" to type "String" (JLS7 15.18.1.1).void
Java.AbstractAnnotation.throwCompileException
(String message) void
Java.AbstractTypeDeclaration.throwCompileException
(String message) void
Java.Locatable.throwCompileException
(String message) Throws aCompileException
with the given message and this object's location.void
Java.Located.throwCompileException
(String message) private IClass.IAnnotation
ClassFileIClass.toIAnnotation
(ClassFile.Annotation annotation) private IClass.IAnnotation
UnitCompiler.toIAnnotation
(Java.Annotation annotation) private IClass.IAnnotation[]
ClassFileIClass.toIAnnotations
(ClassFile.Annotation[] annotations) private IClass.IAnnotation[]
UnitCompiler.toIAnnotations
(Java.Annotation[] annotations) final Java.Lvalue
Java.Atom.toLvalueOrCompileException()
private Java.Lvalue
UnitCompiler.toLvalueOrCompileException
(Java.Atom a) final Java.Rvalue
Java.Atom.toRvalueOrCompileException()
private Java.Rvalue
UnitCompiler.toRvalueOrCompileException
(Java.Atom a) final Java.Type
Java.Atom.toTypeOrCompileException()
private Java.Type
UnitCompiler.toTypeOrCompileException
(Java.Atom a) private boolean
UnitCompiler.tryAssignmentConversion
(Java.Locatable locatable, IType sourceType, IType targetType, Object constantValue) private boolean
UnitCompiler.tryCastConversion
(Java.Locatable locatable, IType sourceType, IType targetType, Object constantValue) private boolean
UnitCompiler.tryNarrowingReferenceConversion
(Java.Locatable locatable, IType sourceType, IType targetType) Implements "narrowing reference conversion" (5.1.5).private IType
UnitCompiler.typeArgumentToIType
(Java.TypeArgument ta) private IType[]
ReflectionIClass.typesToITypes
(Type[] types) private IType
ReflectionIClass.typeToIType
(Type type) private IClass
UnitCompiler.unaryNumericPromotion
(Java.Locatable locatable, IType type) Implements "unary numeric promotion" (JLS7 5.6.1).private IClass
UnitCompiler.unaryNumericPromotionType
(Java.Locatable locatable, IType type) private static String
Decodes any escape sequences like\n
, or\377
, but not\uxxxx
.private Java.Modifier[]
Parser.variableModifiers
(Java.Modifier[] modifiers) private void
Parser.verifyIdentifierIsConventionalClassOrInterfaceName
(String id, Location loc) Issues 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
(String id, Location loc) Issues 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
(String id, Location loc) Issues 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
(String id, Location loc) Issues a warning if the given identifier does not comply with the method naming conventions (JLS7 6.8.3).private void
Parser.verifyStringIsConventionalPackageName
(String s, Location loc) Issues a warning if the given string does not comply with the package naming conventions.private void
private void
Issues a warning with the given message and location and returns.private void
Issues a warning with the given message and location and returns.private void
Issues a warning with the given message an location an returns.Constructors in org.codehaus.janino that throw CompileExceptionModifierConstructorDescriptionClassBodyEvaluator
(String classBody) Equivalent toClassBodyEvaluator
(String fileName, InputStream is) Equivalent toClassBodyEvaluator
(String fileName, Reader reader) Equivalent toClassBodyEvaluator
(Scanner scanner, Class<?> extendedType, Class<?>[] implementedTypes, ClassLoader parentClassLoader) Equivalent toClassBodyEvaluator
(Scanner scanner, ClassLoader parentClassLoader) Equivalent toClassBodyEvaluator
(Scanner scanner, String className, Class<?> extendedType, Class<?>[] implementedTypes, ClassLoader parentClassLoader) Equivalent toExpressionEvaluator
(String expression, Class<?> expressionType, String[] parameterNames, Class<?>[] parameterTypes) Equivalent toExpressionEvaluator
(String expression, Class<?> expressionType, String[] parameterNames, Class<?>[] parameterTypes, Class<?>[] thrownExceptions, Class<?> extendedClass, Class<?>[] implementedTypes, ClassLoader parentClassLoader) Equivalent toExpressionEvaluator
(String expression, Class<?> expressionType, String[] parameterNames, Class<?>[] parameterTypes, Class<?>[] thrownExceptions, ClassLoader parentClassLoader) Equivalent toExpressionEvaluator
(Scanner scanner, String className, Class<?> extendedType, Class<?>[] implementedTypes, boolean staticMethod, Class<?> expressionType, String methodName, String[] parameterNames, Class<?>[] parameterTypes, Class<?>[] thrownExceptions, ClassLoader parentClassLoader) Creates an expression evaluator with the full configurability.ExpressionStatement
(Java.Rvalue rvalue) ScriptEvaluator
(String script) Equivalent toScriptEvaluator
(String fileName, InputStream is, Class<?> returnType, String[] parameterNames, Class<?>[] parameterTypes, Class<?>[] thrownExceptions, ClassLoader parentClassLoader) Equivalent toScriptEvaluator
(String fileName, Reader reader, Class<?> returnType, String[] parameterNames, Class<?>[] parameterTypes, Class<?>[] thrownExceptions, ClassLoader parentClassLoader) Equivalent toScriptEvaluator
(String script, Class<?> returnType) Equivalent toScriptEvaluator
(String script, Class<?> returnType, String[] parameterNames, Class<?>[] parameterTypes) Equivalent toScriptEvaluator
(String script, Class<?> returnType, String[] parameterNames, Class<?>[] parameterTypes, Class<?>[] thrownExceptions) Equivalent toScriptEvaluator
(Scanner scanner, Class<?> extendedType, Class<?>[] implementedTypes, Class<?> returnType, String[] parameterNames, Class<?>[] parameterTypes, Class<?>[] thrownExceptions, ClassLoader parentClassLoader) Equivalent toScriptEvaluator
(Scanner scanner, Class<?> returnType, String[] parameterNames, Class<?>[] parameterTypes, Class<?>[] thrownExceptions, ClassLoader parentClassLoader) Equivalent toScriptEvaluator
(Scanner scanner, String className, Class<?> extendedType, Class<?>[] implementedTypes, boolean staticMethod, Class<?> returnType, String methodName, String[] parameterNames, Class<?>[] parameterTypes, Class<?>[] thrownExceptions, ClassLoader parentClassLoader) Equivalent toSimpleCompiler
(String fileName) Equivalent toSimpleCompiler
(String fileName, InputStream is) Equivalent toSimpleCompiler
(String fileName, Reader in) Equivalent toSimpleCompiler
(Scanner scanner, ClassLoader parentClassLoader) Equivalent to -
Uses of CompileException in org.codehaus.janino.samples
Methods in org.codehaus.janino.samples that throw CompileException -
Uses of CompileException in org.codehaus.janino.util
Fields in org.codehaus.janino.util with type parameters of type CompileExceptionModifier and TypeFieldDescriptionDeepCopier.abstractCompilationUnitCopier
private final Visitor.AnnotationVisitor
<Java.Annotation, CompileException> DeepCopier.annotationCopier
private final Visitor.ArrayInitializerOrRvalueVisitor
<Java.ArrayInitializerOrRvalue, CompileException> DeepCopier.arrayInitializerOrRvalueCopier
private final Visitor.AtomVisitor
<Java.Atom, CompileException> DeepCopier.atomCopier
private final Visitor.BlockStatementVisitor
<Java.BlockStatement, CompileException> DeepCopier.blockStatementCopier
DeepCopier.constructorInvocationCopier
private final Visitor.ElementValueVisitor
<Java.ElementValue, CompileException> DeepCopier.elementValueCopier
private final Visitor.FieldDeclarationOrInitializerVisitor
<Java.FieldDeclarationOrInitializer, CompileException> DeepCopier.fieldDeclarationOrInitializerCopier
DeepCopier.functionDeclaratorCopier
private final Visitor.ImportVisitor
<Java.AbstractCompilationUnit.ImportDeclaration, CompileException> DeepCopier.importCopier
private final Visitor.LvalueVisitor
<Java.Lvalue, CompileException> DeepCopier.lvalueCopier
private final Visitor.ModifierVisitor
<Java.Modifier, CompileException> DeepCopier.modifierCopier
DeepCopier.resourceCopier
private final Visitor.RvalueVisitor
<Java.Rvalue, CompileException> DeepCopier.rvalueCopier
private final Visitor.TypeArgumentVisitor
<Java.TypeArgument, CompileException> DeepCopier.typeArgumentCopier
DeepCopier.typeBodyDeclarationCopier
private final Visitor.TypeVisitor
<Java.Type, CompileException> DeepCopier.typeCopier
private final Visitor.TypeDeclarationVisitor
<Java.TypeDeclaration, CompileException> DeepCopier.typeDeclarationCopier
Methods in org.codehaus.janino.util that throw CompileExceptionModifier and TypeMethodDescriptionDeepCopier.copyAbstractCompilationUnit
(Java.AbstractCompilationUnit subject) DeepCopier.copyAlternateConstructorInvocation
(Java.AlternateConstructorInvocation subject) DeepCopier.copyAmbiguousName
(Java.AmbiguousName subject) DeepCopier.copyAnnotation
(Java.Annotation subject) DeepCopier.copyAnnotations
(Java.Annotation[] subject) DeepCopier.copyAnonymousClassDeclaration
(Java.AnonymousClassDeclaration subject) DeepCopier.copyArrayAccessExpression
(Java.ArrayAccessExpression subject) DeepCopier.copyArrayCreationReference
(Java.ArrayCreationReference subject) DeepCopier.copyArrayInitializer
(Java.ArrayInitializer subject) DeepCopier.copyArrayInitializerOrRvalue
(Java.ArrayInitializerOrRvalue subject) DeepCopier.copyArrayInitializerOrRvalues
(Java.ArrayInitializerOrRvalue[] subject) DeepCopier.copyArrayLength
(Java.ArrayLength subject) DeepCopier.copyArrayType
(Java.ArrayType subject) DeepCopier.copyAssertStatement
(Java.AssertStatement subject) DeepCopier.copyAssignment
(Java.Assignment subject) DeepCopier.copyBinaryOperation
(Java.BinaryOperation subject) DeepCopier.copyBlock
(Java.Block b) DeepCopier.copyBlockStatement
(Java.BlockStatement subject) DeepCopier.copyBlockStatements
(Collection<? extends Java.BlockStatement> subject) DeepCopier.copyBooleanLiteral
(Java.BooleanLiteral subject) DeepCopier.copyBreakStatement
(Java.BreakStatement subject) DeepCopier.copyCatchClause
(Java.CatchClause subject) DeepCopier.copyCatchClauses
(Collection<? extends Java.CatchClause> subject) DeepCopier.copyCatchParameter
(Java.CatchParameter subject) DeepCopier.copyCharacterLiteral
(Java.CharacterLiteral subject) DeepCopier.copyClassInstanceCreationReference
(Java.ClassInstanceCreationReference subject) DeepCopier.copyClassLiteral
(Java.ClassLiteral subject) DeepCopier.copyCompilationUnit
(Java.CompilationUnit subject) DeepCopier.copyConditionalExpression
(Java.ConditionalExpression subject) DeepCopier.copyConstructorDeclarator
(Java.ConstructorDeclarator subject) DeepCopier.copyConstructorInvocation
(Java.ConstructorInvocation subject) DeepCopier.copyContinueStatement
(Java.ContinueStatement subject) DeepCopier.copyCrement
(Java.Crement subject) DeepCopier.copyDoStatement
(Java.DoStatement subject) DeepCopier.copyElementValue
(Java.ElementValue subject) DeepCopier.copyElementValueArrayInitializer
(Java.ElementValueArrayInitializer subject) DeepCopier.copyElementValuePair
(Java.ElementValuePair subject) DeepCopier.copyElementValuePairs
(Java.ElementValuePair[] subject) DeepCopier.copyElementValues
(Java.ElementValue[] subject) DeepCopier.copyEmptyStatement
(Java.EmptyStatement subject) DeepCopier.copyEnumConstant
(Java.EnumConstant subject) DeepCopier.copyExpressionStatement
(Java.ExpressionStatement es) DeepCopier.copyFieldAccess
(Java.FieldAccess subject) DeepCopier.copyFieldAccessExpression
(Java.FieldAccessExpression subject) DeepCopier.copyFieldDeclaration
(Java.FieldDeclaration subject) DeepCopier.copyFieldDeclarationOrInitializer
(Java.FieldDeclarationOrInitializer subject) DeepCopier.copyFloatingPointLiteral
(Java.FloatingPointLiteral subject) DeepCopier.copyForEachStatement
(Java.ForEachStatement fes) DeepCopier.copyFormalParameter
(Java.FunctionDeclarator.FormalParameter subject) DeepCopier.copyFormalParameters
(Java.FunctionDeclarator.FormalParameter[] subject) DeepCopier.copyFormalParameters
(Java.FunctionDeclarator.FormalParameters subject) DeepCopier.copyForStatement
(Java.ForStatement fs) DeepCopier.copyFunctionDeclarator
(Java.FunctionDeclarator subject) DeepCopier.copyIfStatement
(Java.IfStatement is) DeepCopier.copyImportDeclaration
(Java.AbstractCompilationUnit.ImportDeclaration subject) DeepCopier.copyImportDeclarations
(Java.AbstractCompilationUnit.ImportDeclaration[] subject) DeepCopier.copyInitializer
(Java.Initializer subject) DeepCopier.copyInstanceof
(Java.Instanceof subject) DeepCopier.copyIntegerLiteral
(Java.IntegerLiteral subject) DeepCopier.copyLabeledStatement
(Java.LabeledStatement ls) DeepCopier.copyLocalClassDeclaration
(Java.LocalClassDeclaration subject) DeepCopier.copyLocalClassDeclarationStatement
(Java.LocalClassDeclarationStatement subject) DeepCopier.copyLocalVariableAccess
(Java.LocalVariableAccess subject) DeepCopier.copyLocalVariableDeclarationStatement
(Java.LocalVariableDeclarationStatement subject) DeepCopier.copyLocalVariableDeclaratorResource
(Java.TryStatement.LocalVariableDeclaratorResource subject) DeepCopier.copyLvalue
(Java.Lvalue subject) DeepCopier.copyMarkerAnnotation
(Java.MarkerAnnotation subject) DeepCopier.copyMemberAnnotationTypeDeclaration
(Java.MemberAnnotationTypeDeclaration subject) DeepCopier.copyMemberClassDeclaration
(Java.MemberClassDeclaration subject) DeepCopier.copyMemberEnumDeclaration
(Java.MemberEnumDeclaration subject) DeepCopier.copyMemberInterfaceDeclaration
(Java.MemberInterfaceDeclaration subject) DeepCopier.copyMemberTypeDeclaration
(Java.MemberTypeDeclaration subject) DeepCopier.copyMethodDeclarator
(Java.MethodDeclarator subject) DeepCopier.copyMethodInvocation
(Java.MethodInvocation subject) DeepCopier.copyMethodReference
(Java.MethodReference subject) DeepCopier.copyModifier
(Java.Modifier modifier) DeepCopier.copyModifiers
(Java.Modifier[] subject) DeepCopier.copyModularCompilationUnit
(Java.ModularCompilationUnit subject) DeepCopier.copyNewAnonymousClassInstance
(Java.NewAnonymousClassInstance subject) DeepCopier.copyNewArray
(Java.NewArray subject) DeepCopier.copyNewClassInstance
(Java.NewClassInstance subject) DeepCopier.copyNewInitializedArray
(Java.NewInitializedArray subject) DeepCopier.copyNormalAnnotation
(Java.NormalAnnotation subject) DeepCopier.copyNullLiteral
(Java.NullLiteral subject) DeepCopier.copyOptionalArrayInitializer
(Java.ArrayInitializer subject) DeepCopier.copyOptionalArrayInitializerOrRvalue
(Java.ArrayInitializerOrRvalue subject) DeepCopier.copyOptionalArrayType
(Java.ArrayType subject) DeepCopier.copyOptionalAtom
(Java.Atom subject) DeepCopier.copyOptionalBlock
(Java.Block subject) DeepCopier.copyOptionalBlockStatement
(Java.BlockStatement subject) DeepCopier.copyOptionalConstructorInvocation
(Java.ConstructorInvocation subject) DeepCopier.copyOptionalElementValue
(Java.ElementValue subject) DeepCopier.copyOptionalPackageDeclaration
(Java.PackageDeclaration subject) DeepCopier.copyOptionalReferenceType
(Java.ReferenceType subject) DeepCopier.copyOptionalReferenceTypes
(Java.ReferenceType[] subject) DeepCopier.copyOptionalRvalue
(Java.Rvalue subject) DeepCopier.copyOptionalRvalues
(Java.Rvalue[] subject) DeepCopier.copyOptionalStatements
(Collection<? extends Java.BlockStatement> subject) DeepCopier.copyOptionalType
(Java.Type subject) DeepCopier.copyOptionalTypeArguments
(Java.TypeArgument[] subject) DeepCopier.copyOptionalTypeParameters
(Java.TypeParameter[] subject) DeepCopier.copyPackage
(Java.Package subject) DeepCopier.copyPackageDeclaration
(Java.PackageDeclaration subject) DeepCopier.copyPackageMemberAnnotationTypeDeclaration
(Java.PackageMemberAnnotationTypeDeclaration subject) DeepCopier.copyPackageMemberClassDeclaration
(Java.PackageMemberClassDeclaration subject) DeepCopier.copyPackageMemberEnumDeclaration
(Java.PackageMemberEnumDeclaration subject) DeepCopier.copyPackageMemberInterfaceDeclaration
(Java.PackageMemberInterfaceDeclaration subject) DeepCopier.copyPackageMemberTypeDeclaration
(Java.PackageMemberTypeDeclaration subject) DeepCopier.copyParameterAccess
(Java.ParameterAccess pa) DeepCopier.copyParenthesizedExpression
(Java.ParenthesizedExpression subject) DeepCopier.copyPrimitiveType
(Java.PrimitiveType bt) DeepCopier.copyQualifiedThisReference
(Java.QualifiedThisReference subject) DeepCopier.copyReferenceType
(Java.ReferenceType subject) DeepCopier.copyReferenceTypes
(Java.ReferenceType[] subject) DeepCopier.copyResource
(Java.TryStatement.Resource subject) DeepCopier.copyResources
(Collection<? extends Java.TryStatement.Resource> subject) DeepCopier.copyReturnStatement
(Java.ReturnStatement subject) DeepCopier.copyRvalue
(Java.Rvalue subject) DeepCopier.copyRvalueMemberType
(Java.RvalueMemberType subject) DeepCopier.copyRvalues
(Collection<? extends Java.Rvalue> subject) DeepCopier.copyRvalues
(Java.Rvalue[] subject) DeepCopier.copySimpleLiteral
(Java.SimpleConstant subject) DeepCopier.copySimpleType
(Java.SimpleType st) DeepCopier.copySingleElementAnnotation
(Java.SingleElementAnnotation subject) DeepCopier.copySingleStaticImportDeclaration
(Java.AbstractCompilationUnit.SingleStaticImportDeclaration stid) DeepCopier.copySingleTypeImportDeclaration
(Java.AbstractCompilationUnit.SingleTypeImportDeclaration stid) DeepCopier.copyStatement
(Java.Statement subject) DeepCopier.copyStatements
(Collection<? extends Java.BlockStatement> subject) DeepCopier.copyStaticImportOnDemandDeclaration
(Java.AbstractCompilationUnit.StaticImportOnDemandDeclaration siodd) DeepCopier.copyStringLiteral
(Java.StringLiteral subject) DeepCopier.copySuperclassFieldAccessExpression
(Java.SuperclassFieldAccessExpression subject) DeepCopier.copySuperclassMethodInvocation
(Java.SuperclassMethodInvocation subject) DeepCopier.copySuperConstructorInvocation
(Java.SuperConstructorInvocation subject) DeepCopier.copySwitchBlockStatementGroup
(Java.SwitchStatement.SwitchBlockStatementGroup subject) DeepCopier.copySwitchBlockStatementGroups
(Collection<? extends Java.SwitchStatement.SwitchBlockStatementGroup> subject) DeepCopier.copySwitchStatement
(Java.SwitchStatement subject) DeepCopier.copySynchronizedStatement
(Java.SynchronizedStatement subject) DeepCopier.copyThisReference
(Java.ThisReference subject) DeepCopier.copyThrowStatement
(Java.ThrowStatement subject) DeepCopier.copyTryStatement
(Java.TryStatement ts) DeepCopier.copyTypeArgument
(Java.TypeArgument subject) DeepCopier.copyTypeArguments
(Java.TypeArgument[] subject) DeepCopier.copyTypeBodyDeclaration
(Java.TypeBodyDeclaration subject) DeepCopier.copyTypeDeclaration
(Java.TypeDeclaration subject) DeepCopier.copyTypeImportOnDemandDeclaration
(Java.AbstractCompilationUnit.TypeImportOnDemandDeclaration tiodd) DeepCopier.copyTypeParameter
(Java.TypeParameter subject) DeepCopier.copyTypeParameters
(Java.TypeParameter[] subject) DeepCopier.copyUnaryOperation
(Java.UnaryOperation subject) DeepCopier.copyVariableAccessResource
(Java.TryStatement.VariableAccessResource subject) DeepCopier.copyVariableDeclarator
(Java.VariableDeclarator subject) DeepCopier.copyVariableDeclarators
(Java.VariableDeclarator[] subject) DeepCopier.copyWhileStatement
(Java.WhileStatement ws) DeepCopier.copyWildcard
(Java.Wildcard subject)
ClassBodyEvaluator.createInstance(Reader)
instead