Package | Description |
---|---|
org.codehaus.commons.compiler |
This package declares interfaces for the implementation of an
IExpressionEvaluator , an IScriptEvaluator , an
IClassBodyEvaluator and an ISimpleCompiler . |
org.codehaus.janino |
The classes in this package pose the core of the Janino JavaTM compiler.
|
Modifier and Type | Field and Description |
---|---|
static Location |
Location.NOWHERE
Representation of an unspecified location.
|
private Location |
LocatedException.optionalLocation |
Modifier and Type | Method and Description |
---|---|
Location |
LocatedException.getLocation() |
Modifier and Type | Method and Description |
---|---|
void |
ErrorHandler.handleError(java.lang.String message,
Location optionalLocation)
May or may not choose to throw a
CompileException . |
void |
WarningHandler.handleWarning(java.lang.String handle,
java.lang.String message,
Location optionalLocation)
May or may not choose to throw a
CompileException . |
Constructor and Description |
---|
CompileException(java.lang.String message,
Location optionalLocation) |
CompileException(java.lang.String message,
Location optionalLocation,
java.lang.Throwable cause) |
LocatedException(java.lang.String message,
Location optionalLocation) |
LocatedException(java.lang.String message,
Location optionalLocation,
java.lang.Throwable optionalCause) |
Modifier and Type | Field and Description |
---|---|
private Location |
Scanner.Token.location |
private Location |
Java.Located.location |
private Location |
Java.AbstractTypeDeclaration.location |
Modifier and Type | Method and Description |
---|---|
Location |
Scanner.Token.getLocation() |
Location |
Java.Locatable.getLocation() |
Location |
Java.Located.getLocation() |
Location |
Java.AbstractTypeDeclaration.getLocation() |
Location |
Scanner.location() |
Location |
Parser.location() |
Modifier and Type | Method and Description |
---|---|
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
|
protected Java.Type[] |
SimpleCompiler.classesToTypes(Location location,
java.lang.Class[] classes)
Converts an array of
Class es into an array ofJava.Type s. |
protected Java.Type |
SimpleCompiler.classToType(Location location,
java.lang.Class clazz)
Wraps a reflection
Class in a Java.Type object. |
private void |
UnitCompiler.compileError(java.lang.String message,
Location optionalLocation)
Issue a compile error with the given message.
|
private IClass.IField |
UnitCompiler.findIField(IClass iClass,
java.lang.String name,
Location location)
Finds a named field in the given
IClass . |
private IClass |
UnitCompiler.findMemberType(IClass iClass,
java.lang.String name,
Location location)
Finds a named type in the given
IClass . |
private IClass |
UnitCompiler.findTypeByFullyQualifiedName(Location location,
java.lang.String[] identifiers)
Attempts to load an
IClass by fully-qualified name through UnitCompiler.iClassLoader . |
private IClass |
UnitCompiler.findTypeByName(Location location,
java.lang.String className)
Find the named
IClass in this compilation unit, or through the UnitCompiler.iClassLoader . |
private IClass |
UnitCompiler.getReferenceType(Location location,
Java.Scope scope,
java.lang.String[] identifiers,
int n) |
private IClass |
UnitCompiler.getReferenceType(Location location,
java.lang.String simpleTypeName,
Java.Scope scope)
JLS7 6.5.5.1 Simple type name (single identifier)
|
java.lang.String[] |
UnitCompiler.getSingleTypeImport(java.lang.String name,
Location location)
Check if the given simple name was imported through a single type import.
|
void |
FilterWarningHandler.handleWarning(java.lang.String handle,
java.lang.String message,
Location optionalLocation) |
void |
Compiler.SimpleWarningHandler.handleWarning(java.lang.String handle,
java.lang.String message,
Location optionalLocation) |
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. |
protected Java.MethodDeclarator |
ScriptEvaluator.makeMethodDeclaration(Location location,
Java.Annotation[] annotations,
boolean staticMethod,
java.lang.Class returnType,
java.lang.String methodName,
java.lang.Class[] parameterTypes,
java.lang.String[] parameterNames,
java.lang.Class[] thrownExceptions,
java.util.List<Java.BlockStatement> statements)
To the given
Java.ClassDeclaration , add
A public method declaration with the given return type, name, parameter
names and values and thrown exceptions
A block
|
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 |
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 |
UnitCompiler.warning(java.lang.String handle,
java.lang.String message,
Location optionalLocation)
Issues a warning with the given message an location an 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 |
Parser.warning(java.lang.String handle,
java.lang.String message,
Location optionalLocation)
Issues a warning with the given message and location and returns.
|
Constructor and Description |
---|
AbstractTypeBodyDeclaration(Location location,
boolean statiC) |
AbstractTypeDeclaration(Location location,
Java.Modifiers modifiers) |
AlternateConstructorInvocation(Location location,
Java.Rvalue[] arguments) |
AmbiguousName(Location location,
java.lang.String[] identifiers) |
AmbiguousName(Location location,
java.lang.String[] identifiers,
int n) |
AnonymousClassDeclaration(Location location,
Java.Type baseType) |
ArrayAccessExpression(Location location,
Java.Rvalue lhs,
Java.Rvalue index) |
ArrayInitializer(Location location,
Java.ArrayInitializerOrRvalue[] values) |
ArrayLength(Location location,
Java.Rvalue lhs) |
AssertStatement(Location location,
Java.Rvalue expression1,
Java.Rvalue optionalExpression2) |
Assignment(Location location,
Java.Lvalue lhs,
java.lang.String operator,
Java.Rvalue rhs) |
Atom(Location location) |
BasicType(Location location,
int index) |
BinaryOperation(Location location,
Java.Rvalue lhs,
java.lang.String op,
Java.Rvalue rhs) |
Block(Location location) |
BooleanLiteral(Location location,
java.lang.String value) |
BooleanRvalue(Location location) |
BreakableStatement(Location location) |
BreakStatement(Location location,
java.lang.String optionalLabel) |
Cast(Location location,
Java.Type targetType,
Java.Rvalue value) |
CatchClause(Location location,
Java.FunctionDeclarator.FormalParameter caughtException,
Java.Block body) |
CharacterLiteral(Location location,
java.lang.String value) |
ClassDeclaration(Location location,
Java.Modifiers modifiers) |
ClassLiteral(Location location,
Java.Type type) |
ConditionalExpression(Location location,
Java.Rvalue lhs,
Java.Rvalue mhs,
Java.Rvalue rhs) |
ConstructorDeclarator(Location location,
java.lang.String optionalDocComment,
Java.Modifiers modifiers,
Java.FunctionDeclarator.FormalParameters parameters,
Java.Type[] thrownExceptions,
Java.ConstructorInvocation optionalConstructorInvocation,
java.util.List<Java.BlockStatement> statements) |
ConstructorInvocation(Location location,
Java.Rvalue[] arguments) |
ContinuableStatement(Location location,
Java.BlockStatement body) |
ContinueStatement(Location location,
java.lang.String optionalLabel) |
Crement(Location location,
Java.Lvalue operand,
java.lang.String operator) |
Crement(Location location,
java.lang.String operator,
Java.Lvalue operand) |
DoStatement(Location location,
Java.BlockStatement body,
Java.Rvalue condition) |
EmptyStatement(Location location) |
FieldAccess(Location location,
Java.Atom lhs,
IClass.IField field) |
FieldAccessExpression(Location location,
Java.Atom lhs,
java.lang.String fieldName) |
FieldDeclaration(Location location,
java.lang.String optionalDocComment,
Java.Modifiers modifiers,
Java.Type type,
Java.VariableDeclarator[] variableDeclarators) |
FloatingPointLiteral(Location location,
java.lang.String value) |
ForEachStatement(Location location,
Java.FunctionDeclarator.FormalParameter currentElement,
Java.Rvalue expression,
Java.BlockStatement body) |
FormalParameter(Location location,
boolean finaL,
Java.Type type,
java.lang.String name) |
FormalParameters(Location location,
Java.FunctionDeclarator.FormalParameter[] parameters,
boolean variableArity) |
ForStatement(Location location,
Java.BlockStatement optionalInit,
Java.Rvalue optionalCondition,
Java.Rvalue[] optionalUpdate,
Java.BlockStatement body) |
FunctionDeclarator(Location location,
java.lang.String optionalDocComment,
Java.Modifiers modifiers,
Java.Type type,
java.lang.String name,
Java.FunctionDeclarator.FormalParameters parameters,
Java.Type[] thrownExceptions,
java.util.List<? extends Java.BlockStatement> optionalStatements) |
IfStatement(Location location,
Java.Rvalue condition,
Java.BlockStatement thenStatement,
Java.BlockStatement optionalElseStatement)
Notice that the
elseStatement is mandatory; for an if statement without
an "else" clause, a dummy Java.EmptyStatement should be passed. |
ImportDeclaration(Location location) |
Initializer(Location location,
boolean statiC,
Java.Block block) |
Instanceof(Location location,
Java.Rvalue lhs,
Java.Type rhs) |
IntegerLiteral(Location location,
java.lang.String value) |
InterfaceDeclaration(Location location,
java.lang.String optionalDocComment,
Java.Modifiers modifiers,
java.lang.String name,
Java.TypeParameter[] optionalTypeParameters,
Java.Type[] extendedTypes) |
Invocation(Location location,
java.lang.String methodName,
Java.Rvalue[] arguments) |
LabeledStatement(Location location,
java.lang.String label,
Java.Statement body) |
Literal(Location location,
java.lang.String value) |
LocalClassDeclaration(Location location,
java.lang.String optionalDocComment,
Java.Modifiers modifiers,
java.lang.String name,
Java.TypeParameter[] optionalTypeParameters,
Java.Type optionalExtendedType,
Java.Type[] implementedTypes) |
LocalVariableAccess(Location location,
Java.LocalVariable localVariable) |
LocalVariableDeclarationStatement(Location location,
Java.Modifiers modifiers,
Java.Type type,
Java.VariableDeclarator[] variableDeclarators) |
Located(Location location) |
Lvalue(Location location) |
MemberClassDeclaration(Location location,
java.lang.String optionalDocComment,
Java.Modifiers modifiers,
java.lang.String name,
Java.TypeParameter[] optionalTypeParameters,
Java.Type optionalExtendedType,
Java.Type[] implementedTypes) |
MemberInterfaceDeclaration(Location location,
java.lang.String optionalDocComment,
Java.Modifiers modifiers,
java.lang.String name,
Java.TypeParameter[] optionalTypeParameters,
Java.Type[] extendedTypes) |
MethodDeclarator(Location location,
java.lang.String optionalDocComment,
Java.Modifiers modifiers,
Java.Type type,
java.lang.String name,
Java.FunctionDeclarator.FormalParameters parameters,
Java.Type[] thrownExceptions,
java.util.List<? extends Java.BlockStatement> optionalStatements) |
MethodInvocation(Location location,
Java.Atom optionalTarget,
java.lang.String methodName,
Java.Rvalue[] arguments) |
NamedClassDeclaration(Location location,
java.lang.String optionalDocComment,
Java.Modifiers modifiers,
java.lang.String name,
Java.TypeParameter[] optionalTypeParameters,
Java.Type optionalExtendedType,
Java.Type[] implementedTypes) |
NewAnonymousClassInstance(Location location,
Java.Rvalue optionalQualification,
Java.AnonymousClassDeclaration anonymousClassDeclaration,
Java.Rvalue[] arguments) |
NewArray(Location location,
Java.Type type,
Java.Rvalue[] dimExprs,
int dims)
Create a new array with dimension dimExprs.length + dims
|
NewClassInstance(Location location,
Java.Rvalue optionalQualification,
IClass iClass,
Java.Rvalue[] arguments) |
NewClassInstance(Location location,
Java.Rvalue optionalQualification,
Java.Type type,
Java.Rvalue[] arguments) |
NewInitializedArray(Location location,
IClass arrayIClass,
Java.ArrayInitializer arrayInitializer) |
NewInitializedArray(Location location,
Java.ArrayType arrayType,
Java.ArrayInitializer arrayInitializer) |
NullLiteral(Location location,
java.lang.String value) |
Package(Location location,
java.lang.String name) |
PackageDeclaration(Location location,
java.lang.String packageName) |
PackageMemberClassDeclaration(Location location,
java.lang.String optionalDocComment,
Java.Modifiers modifiers,
java.lang.String name,
Java.TypeParameter[] optionalTypeParameters,
Java.Type optionalExtendedType,
Java.Type[] implementedTypes) |
PackageMemberInterfaceDeclaration(Location location,
java.lang.String optionalDocComment,
Java.Modifiers modifiers,
java.lang.String name,
Java.TypeParameter[] optionalTypeParameters,
Java.Type[] extendedTypes) |
ParameterAccess(Location location,
Java.FunctionDeclarator.FormalParameter formalParameter) |
ParenthesizedExpression(Location location,
Java.Rvalue value) |
QualifiedThisReference(Location location,
Java.Type qualification) |
ReferenceType(Location location,
java.lang.String[] identifiers,
Java.TypeArgument[] optionalTypeArguments) |
ReturnStatement(Location location,
Java.Rvalue optionalReturnValue) |
Rvalue(Location location) |
RvalueMemberType(Location location,
Java.Rvalue rvalue,
java.lang.String identifier)
Notice: The
rvalue is not a subordinate object! |
SimpleConstant(Location location)
Equivalent of the
null literal. |
SimpleConstant(Location location,
boolean value)
Equivalent of a
Java.BooleanLiteral . |
SimpleConstant(Location location,
byte value)
Equivalent of an literal, casted to
byte . |
SimpleConstant(Location location,
char value)
Equivalent of a
Java.CharacterLiteral . |
SimpleConstant(Location location,
double value)
Equivalent of a
Java.FloatingPointLiteral with type double . |
SimpleConstant(Location location,
float value)
Equivalent of a
Java.FloatingPointLiteral with type float . |
SimpleConstant(Location location,
int value)
Equivalent of an
Java.IntegerLiteral with type int . |
SimpleConstant(Location location,
long value)
Equivalent of an
Java.IntegerLiteral with type long . |
SimpleConstant(Location location,
short value)
Equivalent of an literal, casted to
short . |
SimpleConstant(Location location,
java.lang.String value)
|
SimpleType(Location location,
IClass iClass) |
SingleStaticImportDeclaration(Location location,
java.lang.String[] identifiers) |
SingleTypeImportDeclaration(Location location,
java.lang.String[] identifiers) |
Statement(Location location) |
StaticImportOnDemandDeclaration(Location location,
java.lang.String[] identifiers) |
StringLiteral(Location location,
java.lang.String value) |
SuperclassFieldAccessExpression(Location location,
Java.Type optionalQualification,
java.lang.String fieldName) |
SuperclassMethodInvocation(Location location,
java.lang.String methodName,
Java.Rvalue[] arguments) |
SuperConstructorInvocation(Location location,
Java.Rvalue optionalQualification,
Java.Rvalue[] arguments) |
SwitchBlockStatementGroup(Location location,
java.util.List<Java.Rvalue> caseLabels,
boolean hasDefaultLabel,
java.util.List<Java.BlockStatement> blockStatements) |
SwitchStatement(Location location,
Java.Rvalue condition,
java.util.List<Java.SwitchStatement.SwitchBlockStatementGroup> sbsgs) |
SynchronizedStatement(Location location,
Java.Rvalue expression,
Java.BlockStatement body) |
ThisReference(Location location) |
ThrowStatement(Location location,
Java.Rvalue expression) |
TryStatement(Location location,
Java.BlockStatement body,
java.util.List<Java.CatchClause> catchClauses,
Java.Block optionalFinally) |
Type(Location location) |
TypeImportOnDemandDeclaration(Location location,
java.lang.String[] identifiers) |
UnaryOperation(Location location,
java.lang.String operator,
Java.Rvalue operand) |
VariableDeclarator(Location location,
java.lang.String name,
int brackets,
Java.ArrayInitializerOrRvalue optionalInitializer) |
WhileStatement(Location location,
Java.Rvalue condition,
Java.BlockStatement body) |