The classes in this package pose the core of the Janino JavaTM compiler.
See: Description
Interface Summary | |
---|---|
AstCompilationUnitGenerator | |
CodeContext.FixUp | A throw-in interface that marks Offsets as "fix-ups": During the execution of CodeContext, all "fix-ups" are invoked and can do last touches to the code attribute. |
IClass.IMember | |
JavaSourceClassLoader.ProtectionDomainFactory | |
Java.ArrayInitializerOrRvalue | |
Java.BlockStatement | Base of all statements that can appear in a block. |
Java.DocCommentable | |
Java.Locatable | This interface is implemented by objects which are associated with a location in the source code. |
Java.MemberTypeDeclaration | Represents a class or interface declaration where the immediately enclosing scope is another class or interface declaration. |
Java.NamedTypeDeclaration | Represents the declaration of a class or an interface that has a name. |
Java.PackageMemberTypeDeclaration | Represents a class or interface declaration on compilation unit level. |
Java.Scope | |
Java.TypeBodyDeclaration | Representation of a "ClassBodyDeclaration" or an "InterfaceMemberDeclaration". |
Java.TypeDeclaration | |
UnitCompiler.ErrorHandler | Interface type for UnitCompiler. |
Visitor.AtomVisitor | |
Visitor.BlockStatementVisitor | |
Visitor.ComprehensiveVisitor | |
Visitor.ImportVisitor | |
Visitor.LvalueVisitor | |
Visitor.RvalueVisitor | |
Visitor.TypeBodyDeclarationVisitor | |
Visitor.TypeDeclarationVisitor | |
Visitor.TypeVisitor | |
WarningHandler | Interface type for setWarningHandler. |
Class Summary | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Access | Return value for IMember. | ||||||||||||||||||
AntCompilerAdapter | A simple org.apache.tools.ant.taskdefs.compilers.CompilerAdapter for the "ant" tool that silently ignores most of the configuration parameters and attempts to compile all given source files into class files. | ||||||||||||||||||
ByteArrayClassLoader | This ClassLoader allows for the loading of a set of JavaTM classes provided in class file format. | ||||||||||||||||||
CachingJavaSourceClassLoader | A JavaSourceClassLoader that uses a resource storage provided by the application to cache compiled classes and thus saving unnecessary recompilations. | ||||||||||||||||||
ClassBodyEvaluator | Parses a class body and returns it as a java.lang.Class object ready for use with java.lang.reflect. | ||||||||||||||||||
ClassFileIClass | A wrapper object that turns a ClassFile object into a IClass. | ||||||||||||||||||
ClassLoaderIClassLoader | An IClassLoader that loads IClasses through a reflection ClassLoader. | ||||||||||||||||||
CodeContext | The context of the compilation of a function (constructor or method). | ||||||||||||||||||
CodeContext.Inserter | A class that implements an insertion point into a "Code" attribute. | ||||||||||||||||||
CodeContext.LineNumberOffset | |||||||||||||||||||
CodeContext.Offset | A class that represents an offset within a "Code" attribute. | ||||||||||||||||||
CompileException | An exception that reflects an error during compilation. | ||||||||||||||||||
Compiler | A simplified substitute for the javac tool. | ||||||||||||||||||
Compiler.SimpleWarningHandler | |||||||||||||||||||
Cookable | "Cooking" means scanning a sequence of JavaTM tokens with a Scanner and turning them into some artifact. | ||||||||||||||||||
DebuggingInformation | |||||||||||||||||||
Descriptor |
Helper class that defines useful methods for handling "field descriptors"
(JVMS 4.3.2) and "method descriptors" (JVMS 4.3.3). Typical descriptors are:
| ||||||||||||||||||
ExpressionEvaluator | An engine that evaluates expressions in JavaTM bytecode. | ||||||||||||||||||
FilterWarningHandler | |||||||||||||||||||
IClass | A simplified equivalent to "java.lang.reflect". | ||||||||||||||||||
IClassLoader | Loads an IClass by type name. | ||||||||||||||||||
IClass.IConstructor | |||||||||||||||||||
IClass.IField | |||||||||||||||||||
IClass.IInvocable | |||||||||||||||||||
IClass.IMethod | |||||||||||||||||||
Java | This wrapper class defines classes that represent the elements of the JavaTM programming language. | ||||||||||||||||||
JavaSourceClassLoader | A ClassLoader that, unlike usual ClassLoaders, does not load byte code, but reads JavaTM source code and then scans, parses, compiles and loads it into the virtual machine. | ||||||||||||||||||
JavaSourceIClassLoader | This IClassLoader finds, scans and parses compilation units. | ||||||||||||||||||
Java.AbstractTypeBodyDeclaration | |||||||||||||||||||
Java.AbstractTypeDeclaration | |||||||||||||||||||
Java.AlternateConstructorInvocation | |||||||||||||||||||
Java.AmbiguousName | This class is special: It does not extend/implement the Atom subclasses, but overrides Atom's "to...()" methods. | ||||||||||||||||||
Java.AnonymousClassDeclaration | |||||||||||||||||||
Java.ArrayAccessExpression | This class implements an array access. | ||||||||||||||||||
Java.ArrayInitializer | Represents a JavaTM array initializer (JLS 10.6). | ||||||||||||||||||
Java.ArrayLength | |||||||||||||||||||
Java.ArrayType | Representation of a JavaTM array type (JLS 10.1). | ||||||||||||||||||
Java.Assignment | |||||||||||||||||||
Java.Atom | Abstract base class for Type, Rvalue and Lvalue. | ||||||||||||||||||
Java.BasicType | Representation of a JavaTM "basic type" (obviously equaivalent to a "primitive type") (JLS 4.2). | ||||||||||||||||||
Java.BinaryOperation | Representation of all non-operand-modifying JavaTM binary operations. | ||||||||||||||||||
Java.Block | Representation of a JavaTM "block" (JLS 14.2). | ||||||||||||||||||
Java.BooleanRvalue | Base class for Rvalues that compile better as conditional branches. | ||||||||||||||||||
Java.BreakableStatement | Base class for statements that can be terminated abnormally with a "break" statement. | ||||||||||||||||||
Java.BreakStatement | Representation of the JavaTM "break" statement (JLS 14.14). | ||||||||||||||||||
Java.Cast | |||||||||||||||||||
Java.CatchClause | |||||||||||||||||||
Java.ClassDeclaration | |||||||||||||||||||
Java.ClassLiteral | |||||||||||||||||||
Java.CompilationUnit | Holds the result of Parser. | ||||||||||||||||||
Java.CompilationUnit.ImportDeclaration | |||||||||||||||||||
Java.CompilationUnit.SingleStaticImportDeclaration |
Represents a single static import declaration likeimport java.util.Collections.EMPTY_MAP; | ||||||||||||||||||
Java.CompilationUnit.SingleTypeImportDeclaration |
Represents a single type import declaration likeimport java.util.Map; | ||||||||||||||||||
Java.CompilationUnit.StaticImportOnDemandDeclaration |
Represents a static-import-on-demand declaration likeimport java.util.Collections.*; | ||||||||||||||||||
Java.CompilationUnit.TypeImportOnDemandDeclaration |
Represents a type-import-on-demand declaration likeimport java.util.*; | ||||||||||||||||||
Java.ConditionalExpression | |||||||||||||||||||
Java.ConstructorDeclarator | |||||||||||||||||||
Java.ConstructorInvocation | |||||||||||||||||||
Java.ContinuableStatement | |||||||||||||||||||
Java.ContinueStatement | Representation of the JavaTM "continue" statement (JLS 14.15). | ||||||||||||||||||
Java.Crement | Objects of this class represent represent one pre- or post-increment or decrement. | ||||||||||||||||||
Java.DoStatement | |||||||||||||||||||
Java.EmptyStatement | Represents the "empty statement", i.e. the blank semicolon. | ||||||||||||||||||
Java.EnclosingScopeOfTypeDeclaration | Lazily determines and returns the enclosing Scope of the given TypeDeclaration. | ||||||||||||||||||
Java.ExpressionStatement | |||||||||||||||||||
Java.FieldAccess | Representation of an access to a field of a class or an interface. | ||||||||||||||||||
Java.FieldAccessExpression | This class implements class or interface field access, and also the "array length" expression "xy.length". | ||||||||||||||||||
Java.FieldDeclaration | This class is derived from "Statement", because it provides for the initialization of the field. | ||||||||||||||||||
Java.ForStatement | |||||||||||||||||||
Java.FunctionDeclarator | Abstract base class for ConstructorDeclarator and MethodDeclarator. | ||||||||||||||||||
Java.FunctionDeclarator.FormalParameter | |||||||||||||||||||
Java.IfStatement | |||||||||||||||||||
Java.Initializer | Representation of an instance (JLS2 8.6) or static initializer (JLS2 8.7). | ||||||||||||||||||
Java.Instanceof | |||||||||||||||||||
Java.InterfaceDeclaration | |||||||||||||||||||
Java.Invocation | |||||||||||||||||||
Java.LabeledStatement | |||||||||||||||||||
Java.Literal | |||||||||||||||||||
Java.LocalClassDeclaration | |||||||||||||||||||
Java.LocalClassDeclarationStatement | |||||||||||||||||||
Java.LocalVariable | Used during resolution. | ||||||||||||||||||
Java.LocalVariableAccess | Representation of a local variable access -- used during compilation. | ||||||||||||||||||
Java.LocalVariableDeclarationStatement | |||||||||||||||||||
Java.Located | |||||||||||||||||||
Java.Lvalue | Representation of an "lvalue", i.e. an expression that has a type and a value, and can be assigned to: An expression that can be the left-hand-side of an assignment. | ||||||||||||||||||
Java.MemberClassDeclaration | |||||||||||||||||||
Java.MemberInterfaceDeclaration | |||||||||||||||||||
Java.MethodDeclarator | |||||||||||||||||||
Java.MethodInvocation | |||||||||||||||||||
Java.NamedClassDeclaration | |||||||||||||||||||
Java.NewAnonymousClassInstance | |||||||||||||||||||
Java.NewArray | |||||||||||||||||||
Java.NewClassInstance | |||||||||||||||||||
Java.NewInitializedArray | |||||||||||||||||||
Java.Package | |||||||||||||||||||
Java.PackageDeclaration |
Represents a package declaration likepackage com.acme.tools; | ||||||||||||||||||
Java.PackageMemberClassDeclaration | |||||||||||||||||||
Java.PackageMemberInterfaceDeclaration | |||||||||||||||||||
Java.ParameterAccess | |||||||||||||||||||
Java.ParenthesizedExpression | |||||||||||||||||||
Java.QualifiedThisReference | Representation of an access to the current object or an enclosing instance. | ||||||||||||||||||
Java.ReferenceType | |||||||||||||||||||
Java.ReturnStatement | |||||||||||||||||||
Java.Rvalue | Representation of an "rvalue", i.e. an expression that has a type and a value, but cannot be assigned to: An expression that can be the right-hand-side of an assignment. | ||||||||||||||||||
Java.RvalueMemberType | |||||||||||||||||||
Java.SimpleType | |||||||||||||||||||
Java.Statement | |||||||||||||||||||
Java.SuperclassFieldAccessExpression | Representation of "super.fld" and "Type.super.fld". | ||||||||||||||||||
Java.SuperclassMethodInvocation | |||||||||||||||||||
Java.SuperConstructorInvocation | |||||||||||||||||||
Java.SwitchStatement | 14.10 The "switch" Statement | ||||||||||||||||||
Java.SwitchStatement.SwitchBlockStatementGroup | |||||||||||||||||||
Java.SynchronizedStatement | |||||||||||||||||||
Java.ThisReference | Representation of an access to the innermost enclosing instance. | ||||||||||||||||||
Java.ThrowStatement | |||||||||||||||||||
Java.TryStatement | |||||||||||||||||||
Java.Type | Representation of a JavaTM type. | ||||||||||||||||||
Java.UnaryOperation | This class implements the unary operators "+", "-", "~" and "! | ||||||||||||||||||
Java.VariableDeclarator | |||||||||||||||||||
Java.WhileStatement | |||||||||||||||||||
Location | Represents the location of a character in a file, as defined by file name, line number and column number. | ||||||||||||||||||
MethodDescriptor | Representation of a "method descriptor" (JVMS 4.3.3). | ||||||||||||||||||
Mod | This class defines constants and convenience methods for the handling of modifiers as defined by the JVM. | ||||||||||||||||||
Parser | A parser for the JavaTM programming language. | ||||||||||||||||||
Parser.ClassDeclarationContext | |||||||||||||||||||
Parser.InterfaceDeclarationContext | |||||||||||||||||||
Parser.ParseException | An exception that reflects an error during parsing. | ||||||||||||||||||
ResourceFinderIClassLoader | This IClassLoader loads IClasses through a a ResourceFinder that designates ClassFiles. | ||||||||||||||||||
Scanner |
Splits up a character stream into tokens and returns them as
java.lang.String String objects.
| ||||||||||||||||||
Scanner.EOFToken | |||||||||||||||||||
Scanner.IdentifierToken | |||||||||||||||||||
Scanner.KeywordToken | |||||||||||||||||||
Scanner.LiteralToken |
The type of the value parameter determines the type of the literal
token:
| ||||||||||||||||||
Scanner.OperatorToken | |||||||||||||||||||
Scanner.ScanException | An exception that reflects an error during parsing. | ||||||||||||||||||
Scanner.Token | |||||||||||||||||||
ScriptEvaluator | An engine that executes a script in JavaTM bytecode. | ||||||||||||||||||
SimpleCompiler | A simplified version of Compiler that can compile only a single compilation unit. | ||||||||||||||||||
UnicodeUnescapeException | Represents a problem that occurred while unescaping a unicode escape sequence through a UnicodeUnescapeReader. | ||||||||||||||||||
UnicodeUnescapeReader | A FilterReader that unescapes the "Unicode Escapes" as described in the Java Language Specification, 2nd edition. | ||||||||||||||||||
UnitCompiler | This class actually implements the JavaTM compiler. | ||||||||||||||||||
UnitCompiler.SimpleIField | Short-hand implementation of IField that implements a non-constant, non-static, package-accessible field. | ||||||||||||||||||
UnparseVisitor | A visitor that unparses (un-compiles) an AST to a Writer. | ||||||||||||||||||
Visitor | Basis for the "visitor" pattern as described in "Gamma, Helm, Johnson, Vlissides: Design Patterns". |
The package comprises a scanner (Scanner, a parser (Parser) and a class file library. The parser builds a syntax tree from the "Java.*" classes that represents the parsed code. The UnitCompiler method compiles this syntax tree into a ClassFile object, which can write JavaTM bytecode to an "OutputStream".