Logo Search packages:      
Sourcecode: janino version File versions  Download package

org::codehaus::janino::UnitCompiler Class Reference

List of all members.


Detailed Description

This class actually implements the JavaTM compiler. It is associated with exactly one compilation unit which it compiles.

Definition at line 51 of file UnitCompiler.java.


Public Member Functions

void compile2 (Java.InterfaceDeclaration id) throws CompileException
void compile2 (final Java.MemberClassDeclaration mcd) throws CompileException
void compile2 (Java.InnerClassDeclaration icd) throws CompileException
void compile2 (Java.LocalClassDeclaration lcd) throws CompileException
void compile2 (Java.AnonymousClassDeclaration acd) throws CompileException
void compile2 (Java.ClassDeclaration cd) throws CompileException
void compile2 (Java.PackageMemberTypeDeclaration pmtd) throws CompileException
ClassFile[] compileUnit (EnumeratorSet debuggingInformation) throws CompileException
IClass findClass (String className)
IClass.IMethod findIMethod (Java.SuperclassMethodInvocation scmi) throws CompileException
IClass.IMethod findIMethod (Java.MethodInvocation mi) throws CompileException
IClass.IInvocable findMostSpecificIInvocable (Locatable l, final IInvocable[] iInvocables, final IClass[] argumentTypes, boolean boxingPermitted) throws CompileException
boolean generatesCode2 (Java.FieldDeclaration fd) throws CompileException
boolean generatesCode2 (Java.Block b) throws CompileException
boolean generatesCode2 (Java.Initializer i) throws CompileException
boolean generatesCode2 (Java.LocalClassDeclarationStatement lcds)
boolean generatesCode2 (Java.EmptyStatement es)
boolean generatesCode2 (Java.BlockStatement bs)
final Object getConstantValue (Java.Rvalue rv) throws CompileException
void getIMethods (IClass type, String methodName, List v) throws CompileException
Java.LocalVariable getLocalVariable (Java.FunctionDeclarator.FormalParameter fp) throws CompileException
Java.LocalVariable getLocalVariable (Java.LocalVariableDeclarationStatement lvds, Java.VariableDeclarator vd) throws CompileException
String[] getSingleTypeImport (String name)
CodeContext.Offset getWhereToBreak (Java.BreakableStatement bs)
IClass importTypeOnDemand (String simpleTypeName, Location location) throws CompileException
void leave2 (Java.TryStatement ts, IClass optionalStackValueType)
void leave2 (Java.SynchronizedStatement ss, IClass optionalStackValueType)
void leave2 (Java.BlockStatement bs, IClass optionalStackValueType)
void setCompileErrorHandler (ErrorHandler optionalCompileErrorHandler)
void setWarningHandler (WarningHandler optionalWarningHandler)
IClass.IMethod toIMethod (final Java.MethodDeclarator md)
final Java.Lvalue toLvalueOrCE (final Java.Atom a) throws CompileException
 UnitCompiler (Java.CompilationUnit compilationUnit, IClassLoader iClassLoader) throws CompileException

Public Attributes

final Java.CompilationUnit compilationUnit

Package Functions

void assignSyntheticParametersToSyntheticFields (Java.ConstructorDeclarator cd) throws CompileException
IClass.IField[] getIFields (final Java.FieldDeclaration fd)
Java.ArrayInitializerOrRvalue getNonConstantFinalInitializer (Java.FieldDeclaration fd, Java.VariableDeclarator vd) throws CompileException
void initializeInstanceVariablesAndInvokeInstanceInitializers (Java.ConstructorDeclarator cd) throws CompileException
Java.LocalVariable isIntLV (Java.Crement c) throws CompileException
IClass.IConstructor toIConstructor (final Java.ConstructorDeclarator cd)

Static Package Functions

 [static initializer]
 [static initializer]
static Java.TypeDeclaration getOuterClass (Java.TypeDeclaration atd)
static int ilfd (IClass t, int opcodeInt, int opcodeLong, int opcodeFloat, int opcodeDouble)
static int ilfd (IClass t)
static int ilfdabcs (IClass t)

Private Member Functions

short addConstantFloatInfo (float value)
short addConstantIntegerInfo (int value)
short addConstantStringInfo (String value)
void addFields (Java.FieldDeclaration fd, ClassFile cf) throws CompileException
Object assignmentConversion (Locatable l, Object value, IClass targetType) throws CompileException
void assignmentConversion (Locatable l, IClass sourceType, IClass targetType, Object optionalConstantValue) throws CompileException
IClass binaryNumericPromotion (Locatable l, IClass type1, CodeContext.Inserter convertInserter1, IClass type2, CodeContext.Inserter convertInserter2) throws CompileException
IClass binaryNumericPromotion (Locatable locatable, IClass type1, CodeContext.Inserter convertInserter1, IClass type2) throws CompileException
IClass binaryNumericPromotionType (Java.Locatable locatable, IClass type1, IClass type2) throws CompileException
void boxingConversion (Locatable l, IClass sourceType, IClass targetType) throws CompileException
void checkAccessible (IClass type, Java.BlockStatement contextBlockStatement) throws CompileException
void checkAccessible (IClass iClassDeclaringMember, Access memberAccess, Java.BlockStatement contextBlockStatement) throws CompileException
void checkAccessible (IClass.IMember member, Java.BlockStatement contextBlockStatement) throws CompileException
void checkThrownException (Locatable l, IClass type, Java.Scope scope) throws CompileException
void checkThrownExceptions (Invocation in, IMethod iMethod) throws CompileException
void compile (Java.Rvalue rv) throws CompileException
void compile (Java.FunctionDeclarator fd, final ClassFile classFile) throws CompileException
boolean compile (Java.BlockStatement bs) throws CompileException
void compile (Java.TypeDeclaration td) throws CompileException
boolean compile2 (Java.SuperConstructorInvocation sci) throws CompileException
boolean compile2 (Java.AlternateConstructorInvocation aci) throws CompileException
void compile2 (Java.ParenthesizedExpression pe) throws CompileException
void compile2 (Java.Crement c) throws CompileException
void compile2 (Java.Assignment a) throws CompileException
void compile2 (Java.Rvalue rv) throws CompileException
boolean compile2 (Java.TryStatement ts) throws CompileException
boolean compile2 (Java.ThrowStatement ts) throws CompileException
boolean compile2 (Java.SynchronizedStatement ss) throws CompileException
boolean compile2 (Java.ReturnStatement rs) throws CompileException
boolean compile2 (Java.LocalVariableDeclarationStatement lvds) throws CompileException
boolean compile2 (Java.LocalClassDeclarationStatement lcds) throws CompileException
boolean compile2 (Java.IfStatement is) throws CompileException
boolean compile2 (Java.FieldDeclaration fd) throws CompileException
boolean compile2 (Java.ExpressionStatement ee) throws CompileException
boolean compile2 (Java.EmptyStatement es)
boolean compile2 (Java.ContinueStatement cs) throws CompileException
boolean compile2 (Java.BreakStatement bs) throws CompileException
boolean compile2 (Java.SwitchStatement ss) throws CompileException
final boolean compile2 (Java.LabeledStatement ls) throws CompileException
boolean compile2 (Java.WhileStatement ws) throws CompileException
boolean compile2 (Java.ForStatement fs) throws CompileException
boolean compile2 (Java.DoStatement ds) throws CompileException
boolean compile2 (Java.Block b) throws CompileException
boolean compile2 (Java.Initializer i) throws CompileException
IClass compileArithmeticBinaryOperation (Locatable l, IClass lhsType, String operator, Java.Rvalue rhs) throws CompileException
IClass compileArithmeticOperation (final Locatable l, IClass type, Iterator operands, String operator) throws CompileException
void compileBoolean (Java.Rvalue rv, final CodeContext.Offset dst, final boolean orientation) throws CompileException
void compileBoolean2 (Java.ParenthesizedExpression pe, CodeContext.Offset dst, boolean orientation) throws CompileException
void compileBoolean2 (Java.BinaryOperation bo, CodeContext.Offset dst, boolean orientation) throws CompileException
void compileBoolean2 (Java.UnaryOperation ue, CodeContext.Offset dst, boolean orientation) throws CompileException
void compileBoolean2 (Java.Rvalue rv, CodeContext.Offset dst, boolean orientation) throws CompileException
int compileContext (Java.Rvalue rv) throws CompileException
int compileContext2 (Java.ParenthesizedExpression pe) throws CompileException
int compileContext2 (Java.SuperclassFieldAccessExpression scfae) throws CompileException
int compileContext2 (Java.FieldAccessExpression fae) throws CompileException
int compileContext2 (Java.ArrayAccessExpression aae) throws CompileException
int compileContext2 (Java.ArrayLength al) throws CompileException
int compileContext2 (Java.FieldAccess fa) throws CompileException
int compileContext2 (Java.AmbiguousName an) throws CompileException
int compileContext2 (Java.Rvalue rv)
void compileError (String message, Location optionalLocation) throws CompileException
void compileError (String message) throws CompileException
IClass compileGet (Java.Rvalue rv) throws CompileException
IClass compileGet2 (Java.ConstantValue cv)
IClass compileGet2 (Java.Literal l) throws CompileException
IClass compileGet2 (Java.NewInitializedArray nia) throws CompileException
IClass compileGet2 (Java.NewArray na) throws CompileException
IClass compileGet2 (Java.ParameterAccess pa) throws CompileException
IClass compileGet2 (Java.NewAnonymousClassInstance naci) throws CompileException
IClass compileGet2 (Java.NewClassInstance nci) throws CompileException
IClass compileGet2 (Java.SuperclassMethodInvocation scmi) throws CompileException
IClass compileGet2 (Java.MethodInvocation mi) throws CompileException
IClass compileGet2 (Java.ParenthesizedExpression pe) throws CompileException
IClass compileGet2 (Java.Cast c) throws CompileException
IClass compileGet2 (Java.BinaryOperation bo) throws CompileException
IClass compileGet2 (Java.Instanceof io) throws CompileException
IClass compileGet2 (Java.UnaryOperation uo) throws CompileException
IClass compileGet2 (Java.SuperclassFieldAccessExpression scfae) throws CompileException
IClass compileGet2 (Java.FieldAccessExpression fae) throws CompileException
IClass compileGet2 (Java.ArrayAccessExpression aae) throws CompileException
IClass compileGet2 (Java.Crement c) throws CompileException
IClass compileGet2 (Java.ConditionalExpression ce) throws CompileException
IClass compileGet2 (Java.Assignment a) throws CompileException
IClass compileGet2 (Java.ClassLiteral cl) throws CompileException
IClass compileGet2 (Java.QualifiedThisReference qtr) throws CompileException
IClass compileGet2 (Java.ThisReference tr) throws CompileException
IClass compileGet2 (Java.ArrayLength al)
IClass compileGet2 (Java.FieldAccess fa) throws CompileException
IClass compileGet2 (Java.LocalVariableAccess lva)
IClass compileGet2 (Java.AmbiguousName an) throws CompileException
IClass compileGet2 (Java.BooleanRvalue brv) throws CompileException
IClass compileGetValue (Java.Rvalue rv) throws CompileException
void compileGetValue (Java.ArrayInitializer ai, IClass arrayType) throws CompileException
void compileSet (Java.Lvalue lv) throws CompileException
void compileSet2 (Java.ParenthesizedExpression pe) throws CompileException
void compileSet2 (Java.SuperclassFieldAccessExpression scfae) throws CompileException
void compileSet2 (Java.FieldAccessExpression fae) throws CompileException
void compileSet2 (Java.ArrayAccessExpression aae) throws CompileException
void compileSet2 (Java.FieldAccess fa) throws CompileException
void compileSet2 (Java.LocalVariableAccess lva)
void compileSet2 (Java.AmbiguousName an) throws CompileException
IClass compileStringConcatenation (final Locatable l, IClass type, Java.Rvalue operand, Iterator operands) throws CompileException
boolean compileUnconditionalLoop (Java.ContinuableStatement cs, Java.BlockStatement body, Java.Rvalue[] optionalUpdate) throws CompileException
boolean compileUnconditionalLoopWithUpdate (Java.ContinuableStatement cs, Java.BlockStatement body, Java.Rvalue[] update) throws CompileException
IClass convertToPrimitiveNumericType (Locatable l, IClass type) throws CompileException
CodeContext createDummyCodeContext ()
void declareClassDollarMethod (Java.ClassLiteral cl)
void determineValue (Java.SuperclassFieldAccessExpression scfae) throws CompileException
void determineValue (Java.FieldAccessExpression fae) throws CompileException
void dup (Locatable l, int n)
void dupx (Locatable l, IClass type, int x)
void fakeCompile (Java.Rvalue rv) throws CompileException
IMethod fakeIMethod (IClass targetType, final String name, Rvalue[] arguments) throws CompileException
IClass.IField findIField (IClass iClass, String name, Location location) throws CompileException
IClass.IMethod findIMethod (Locatable l, IClass targetType, String methodName, Rvalue[] arguments) throws CompileException
Java.LocalClassDeclaration findLocalClassDeclaration (Java.Scope s, String name)
Java.LocalVariable findLocalVariable (Java.LocalVariableDeclarationStatement lvds, String name) throws CompileException
Java.LocalVariable findLocalVariable (Java.BlockStatement blockStatement, String name) throws CompileException
IClass findMemberType (IClass iClass, String name, Location location) throws CompileException
IClass.IInvocable findMostSpecificIInvocable (Locatable l, final IInvocable[] iInvocables, Rvalue[] arguments) throws CompileException
boolean generatesCode (Java.BlockStatement bs) throws CompileException
CodeContext getCodeContext ()
Object getConstantValue2 (Java.ConstantValue cv)
Object getConstantValue2 (Java.Literal l) throws CompileException
Object getConstantValue2 (Java.ParenthesizedExpression pe) throws CompileException
Object getConstantValue2 (Java.Cast c) throws CompileException
Object getConstantValue2 (Java.BinaryOperation bo) throws CompileException
Object getConstantValue2 (Java.UnaryOperation uo) throws CompileException
Object getConstantValue2 (Java.FieldAccess fa) throws CompileException
Object getConstantValue2 (Java.AmbiguousName an) throws CompileException
Object getConstantValue2 (Java.Rvalue rv)
Java.ClassDeclaration getDeclaringClass (Java.QualifiedThisReference qtr) throws CompileException
Java.TypeBodyDeclaration getDeclaringTypeBodyDeclaration (Java.QualifiedThisReference qtr) throws CompileException
IClass getIClass (Java.ThisReference tr) throws CompileException
final Object getNegatedConstantValue (Java.Rvalue rv) throws CompileException
Object getNegatedConstantValue2 (Java.Literal l) throws CompileException
Object getNegatedConstantValue2 (Java.ParenthesizedExpression pe) throws CompileException
Object getNegatedConstantValue2 (Java.UnaryOperation uo) throws CompileException
Object getNegatedConstantValue2 (Java.Rvalue rv)
IClass getReturnType (Java.FunctionDeclarator fd) throws CompileException
IClass getTargetIClass (Java.QualifiedThisReference qtr) throws CompileException
IClass getType (Java.Atom a) throws CompileException
IClass getType2 (Java.ConstantValue cv)
IClass getType2 (Java.Literal l)
IClass getType2 (Java.NewInitializedArray nia) throws CompileException
IClass getType2 (Java.NewArray na) throws CompileException
IClass getType2 (Java.ParameterAccess pa) throws CompileException
IClass getType2 (Java.NewAnonymousClassInstance naci)
IClass getType2 (Java.NewClassInstance nci) throws CompileException
IClass getType2 (Java.SuperclassMethodInvocation scmi) throws CompileException
IClass getType2 (Java.MethodInvocation mi) throws CompileException
IClass getType2 (Java.ParenthesizedExpression pe) throws CompileException
IClass getType2 (Java.Cast c) throws CompileException
IClass getType2 (Java.BinaryOperation bo) throws CompileException
IClass getType2 (Java.Instanceof io)
IClass getType2 (Java.UnaryOperation uo) throws CompileException
IClass getType2 (Java.SuperclassFieldAccessExpression scfae) throws CompileException
IClass getType2 (Java.FieldAccessExpression fae) throws CompileException
IClass getType2 (Java.ArrayAccessExpression aae) throws CompileException
IClass getType2 (Java.Crement c) throws CompileException
IClass getType2 (Java.ConditionalExpression ce) throws CompileException
IClass getType2 (Java.Assignment a) throws CompileException
IClass getType2 (Java.ClassLiteral cl)
IClass getType2 (Java.QualifiedThisReference qtr) throws CompileException
IClass getType2 (Java.ThisReference tr) throws CompileException
IClass getType2 (Java.ArrayLength al)
IClass getType2 (Java.FieldAccess fa) throws CompileException
IClass getType2 (Java.LocalVariableAccess lva)
IClass getType2 (Java.Package p) throws CompileException
IClass getType2 (Java.AmbiguousName an) throws CompileException
IClass getType2 (Java.ArrayType at) throws CompileException
IClass getType2 (Java.RvalueMemberType rvmt) throws CompileException
IClass getType2 (Java.ReferenceType rt) throws CompileException
IClass getType2 (Java.BasicType bt)
IClass getType2 (Java.SimpleType st)
IClass getUnboxedType (IClass type)
int ilfda (IClass t)
void import2 (StaticImportOnDemandDeclaration siodd) throws CompileException
void import2 (SingleStaticImportDeclaration ssid) throws CompileException
void import2 (TypeImportOnDemandDeclaration tiodd)
void import2 (SingleTypeImportDeclaration stid) throws CompileException
IClass importSingleType (String simpleTypeName, Location location) throws CompileException
void invokeConstructor (Locatable l, Java.Scope scope, Java.Rvalue optionalEnclosingInstance, IClass targetClass, Java.Rvalue[] arguments) throws CompileException
IClass isBoxingConvertible (IClass sourceType)
boolean isIdentityConvertible (IClass sourceType, IClass targetType)
boolean isMethodInvocationConvertible (IClass sourceType, IClass targetType, boolean boxingPermitted) throws CompileException
boolean isNarrowingPrimitiveConvertible (IClass sourceType, IClass targetType)
boolean isNarrowingReferenceConvertible (IClass sourceType, IClass targetType) throws CompileException
boolean isType (Java.Atom a) throws CompileException
boolean isType2 (Java.AmbiguousName an) throws CompileException
boolean isType2 (Java.Atom a)
IClass isUnboxingConvertible (IClass sourceType)
boolean isWideningPrimitiveConvertible (IClass sourceType, IClass targetType)
boolean isWideningReferenceConvertible (IClass sourceType, IClass targetType) throws CompileException
void leave (Java.BlockStatement bs, final IClass optionalStackValueType)
void leaveStatements (Java.Scope from, Java.Scope to, IClass optionalStackValueType)
void load (Locatable l, IClass type, int index)
IClass load (Locatable l, Java.LocalVariable localVariable)
IClass loadFullyQualifiedClass (String[] identifiers) throws CompileException
IClass newArray (Locatable l, int dimExprCount, int dims, IClass componentType)
void numericPromotion (Locatable l, IClass sourceType, IClass targetType)
void pop (Locatable l, IClass type)
IClass pushConstant (Locatable l, Object value)
Java.Atom reclassify (Java.AmbiguousName an) throws CompileException
Java.Atom reclassifyName (Location location, Java.Scope scope, final String identifier) throws CompileException
Java.Atom reclassifyName (Location location, Java.Scope scope, final String[] identifiers, int n) throws CompileException
void referenceThis (Locatable l)
void referenceThis (Locatable l, Java.ClassDeclaration declaringClass, Java.TypeBodyDeclaration declaringTypeBodyDeclaration, IClass targetIClass) throws CompileException
CodeContext replaceCodeContext (CodeContext newCodeContext)
IClass resolve (final Java.TypeDeclaration td)
void reverseUnaryNumericPromotion (Locatable l, IClass sourceType, IClass targetType) throws CompileException
void store (Locatable l, IClass lvType, short lvIndex)
void store (Locatable l, IClass valueType, Java.LocalVariable localVariable)
void stringConversion (Locatable l, IClass sourceType)
IClass.IInvocable toIInvocable (Java.FunctionDeclarator fd)
final Java.Rvalue toRvalueOrCE (final Java.Atom a) throws CompileException
final Java.Type toTypeOrCE (Java.Atom a) throws CompileException
boolean tryBoxingConversion (Locatable l, IClass sourceType, IClass targetType) throws CompileException
boolean tryConstantAssignmentConversion (Locatable l, Object constantValue, IClass targetType) throws CompileException
boolean tryIdentityConversion (IClass sourceType, IClass targetType)
boolean tryNarrowingPrimitiveConversion (Locatable l, IClass sourceType, IClass targetType)
boolean tryNarrowingReferenceConversion (Locatable l, IClass sourceType, IClass targetType) throws CompileException
boolean tryUnboxingConversion (Locatable l, IClass sourceType, IClass targetType)
boolean tryWideningPrimitiveConversion (Locatable l, IClass sourceType, IClass targetType)
boolean tryWideningReferenceConversion (IClass sourceType, IClass targetType) throws CompileException
IClass unaryNumericPromotion (Locatable l, IClass type) throws CompileException
IClass unaryNumericPromotionType (Locatable l, IClass type) throws CompileException
void unboxingConversion (Locatable l, IClass sourceType, IClass targetType)
void warning (String handle, String message, Location optionalLocation)
void writeBranch (Java.Locatable l, int opcode, final CodeContext.Offset dst)
void writeByte (int v)
void writeConstantClassInfo (String descriptor)
void writeConstantDoubleInfo (double value)
void writeConstantFieldrefInfo (String classFD, String fieldName, String fieldFD)
void writeConstantInterfaceMethodrefInfo (String classFD, String methodName, String methodMD)
void writeConstantLongInfo (long value)
void writeConstantMethodrefInfo (String classFD, String methodName, String methodMD)
void writeInt (int v)
void writeLDC (Locatable l, short index)
void writeOffset (CodeContext.Offset src, final CodeContext.Offset dst)
void writeOpcode (Java.Locatable l, int opcode)
void writeOpcodes (Java.Locatable l, byte[] opcodes)
void writeShort (int v)

Static Private Member Functions

static String[] allButLast (String[] sa)
static String[] concat (String[] sa, String s)
static void fillConversionMap (Object[] array, HashMap map)
static List getOuterClasses (Java.TypeDeclaration inner)
static String last (String[] sa)
static String[] makeUTF8Able (String s)
static Access modifiers2Access (short modifiers)

Private Attributes

CodeContext codeContext = null
int compileErrorCount = 0
EnumeratorSet debuggingInformation
List generatedClassFiles
final IClassLoader iClassLoader
final boolean isStringBuilderAvailable
final Map onDemandImportableTypes = new HashMap()
ErrorHandler optionalCompileErrorHandler = null
WarningHandler optionalWarningHandler = null
final Map singleStaticImports = new HashMap()
final Map singleTypeImports = new HashMap()
final Collection staticImportsOnDemand = new ArrayList()
final Collection typeImportsOnDemand

Static Private Attributes

static final boolean DEBUG = false
static final HashMap PRIMITIVE_NARROWING_CONVERSIONS = new HashMap()
static final HashMap PRIMITIVE_WIDENING_CONVERSIONS = new HashMap()
static final RuntimeException STOP_COMPILING_CODE = new RuntimeException("SNO: This exception should have been caught and processed")
static final int STRING_CONCAT_LIMIT = 3

Classes

interface  Compilable
interface  ErrorHandler
class  SimpleIField

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index