| java.lang.Object com.sun.tools.javac.tree.TreeMaker
TreeMaker | public class TreeMaker implements JCTree.Factory(Code) | | Factory class for trees.
This is NOT part of any API supported by Sun Microsystems. If
you write code that depends on this, you do so at your own risk.
This code and its internal interfaces are subject to change or
deletion without notice.
|
Constructor Summary | |
protected | TreeMaker(Context context) Create a tree maker with null toplevel and NOPOS as initial position. | | TreeMaker(JCCompilationUnit toplevel, Name.Table names, Types types, Symtab syms) Create a tree maker with a given toplevel and FIRSTPOS as initial position. |
Method Summary | |
public JCAnnotation | Annotation(JCTree annotationType, List<JCExpression> args) | public JCAnnotation | Annotation(Attribute a) Create an annotation tree from an attribute. | public List<JCAnnotation> | Annotations(List<Attribute.Compound> attributes) Create annotation trees from annotations. | public JCClassDecl | AnonymousClassDef(JCModifiers mods, List<JCTree> defs) | public JCMethodInvocation | App(JCExpression meth, List<JCExpression> args) Create a method invocation from a method tree and a list of
argument trees. | public JCMethodInvocation | App(JCExpression meth) | public JCMethodInvocation | Apply(List<JCExpression> typeargs, JCExpression fn, List<JCExpression> args) | public JCAssert | Assert(JCExpression cond, JCExpression detail) | public JCAssign | Assign(JCExpression lhs, JCExpression rhs) | public JCStatement | Assignment(Symbol v, JCExpression rhs) Construct an assignment from a variable symbol and a right hand side. | public JCAssignOp | Assignop(int opcode, JCTree lhs, JCTree rhs) | public JCBinary | Binary(int opcode, JCExpression lhs, JCExpression rhs) | public JCBlock | Block(long flags, List<JCStatement> stats) | public JCBreak | Break(Name label) | public JCStatement | Call(JCExpression apply) Wrap a method invocation in an expression statement or return statement,
depending on whether the method invocation expression's type is void. | public JCCase | Case(JCExpression pat, List<JCStatement> stats) | public JCCatch | Catch(JCVariableDecl param, JCBlock body) | public JCClassDecl | ClassDef(JCModifiers mods, Name name, List<JCTypeParameter> typarams, JCTree extending, List<JCExpression> implementing, List<JCTree> defs) | public JCExpression | ClassLiteral(ClassSymbol clazz) Create a tree representing a class literal. | public JCExpression | ClassLiteral(Type t) Create a tree representing a class literal. | public JCConditional | Conditional(JCExpression cond, JCExpression thenpart, JCExpression elsepart) | public JCContinue | Continue(Name label) | public JCExpression | Create(Symbol ctor, List<JCExpression> args) Create a method invocation from a method tree and a list of argument trees. | public JCDoWhileLoop | DoLoop(JCStatement body, JCExpression cond) | public JCErroneous | Erroneous() | public JCErroneous | Erroneous(List<? extends JCTree> errs) | public JCExpressionStatement | Exec(JCExpression expr) | public JCForLoop | ForLoop(List<JCStatement> init, JCExpression cond, List<JCExpressionStatement> step, JCStatement body) | public JCEnhancedForLoop | ForeachLoop(JCVariableDecl var, JCExpression expr, JCStatement body) | public JCIdent | Ident(Name name) | public JCIdent | Ident(Symbol sym) Create an identifier from a symbol. | public JCExpression | Ident(JCVariableDecl param) Create an identifier that refers to the variable declared in given variable
declaration. | public List<JCExpression> | Idents(List<JCVariableDecl> params) Create a list of identifiers referring to the variables declared
in given list of variable declarations. | public JCIf | If(JCExpression cond, JCStatement thenpart, JCStatement elsepart) | public JCImport | Import(JCTree qualid, boolean importStatic) | public JCArrayAccess | Indexed(JCExpression indexed, JCExpression index) | public JCArrayAccess | Indexed(Symbol v, JCExpression index) Construct an index expression from a variable and an expression. | public JCLabeledStatement | Labelled(Name label, JCStatement body) | public LetExpr | LetExpr(List<JCVariableDecl> defs, JCTree expr) | public LetExpr | LetExpr(JCVariableDecl def, JCTree expr) | public JCLiteral | Literal(int tag, Object value) | public JCLiteral | Literal(Object value) | public JCMethodDecl | MethodDef(JCModifiers mods, Name name, JCExpression restype, List<JCTypeParameter> typarams, List<JCVariableDecl> params, List<JCExpression> thrown, JCBlock body, JCExpression defaultValue) | public JCMethodDecl | MethodDef(MethodSymbol m, JCBlock body) Create a method definition from a method symbol and a method body. | public JCMethodDecl | MethodDef(MethodSymbol m, Type mtype, JCBlock body) Create a method definition from a method symbol, method type
and a method body. | public JCModifiers | Modifiers(long flags, List<JCAnnotation> annotations) | public JCModifiers | Modifiers(long flags) | public JCNewArray | NewArray(JCExpression elemtype, List<JCExpression> dims, List<JCExpression> elems) | public JCNewClass | NewClass(JCExpression encl, List<JCExpression> typeargs, JCExpression clazz, List<JCExpression> args, JCClassDecl def) | public JCVariableDecl | Param(Name name, Type argtype, Symbol owner) Create a value parameter tree from its name, type, and owner. | public List<JCVariableDecl> | Params(List<Type> argtypes, Symbol owner) Create a a list of value parameter trees x0, ..., xn from a list of
their types and an their owner. | public JCParens | Parens(JCExpression expr) | public JCExpression | QualIdent(Symbol sym) Create a qualified identifier from a symbol, adding enough qualifications
to make the reference unique. | public JCReturn | Return(JCExpression expr) | public JCFieldAccess | Select(JCExpression selected, Name selector) | public JCExpression | Select(JCExpression base, Symbol sym) Create a selection node from a qualifier tree and a symbol. | public JCSkip | Skip() | public JCIdent | Super(Type t, TypeSymbol owner) Create a tree representing `super', given its type and owner. | public JCSwitch | Switch(JCExpression selector, List<JCCase> cases) | public JCSynchronized | Synchronized(JCExpression lock, JCBlock body) | public JCExpression | This(Type t) Create a tree representing `this', given its type. | public JCThrow | Throw(JCTree expr) | public JCCompilationUnit | TopLevel(List<JCAnnotation> packageAnnotations, JCExpression pid, List<JCTree> defs) Create given tree node at current position. | public JCTry | Try(JCBlock body, List<JCCatch> catchers, JCBlock finalizer) | public JCExpression | Type(Type t) Create a tree representing given type. | public JCTypeApply | TypeApply(JCExpression clazz, List<JCExpression> arguments) | public JCArrayTypeTree | TypeArray(JCExpression elemtype) | public TypeBoundKind | TypeBoundKind(BoundKind kind) | public JCTypeCast | TypeCast(JCTree clazz, JCExpression expr) | public JCTypeCast | TypeCast(Type type, JCExpression expr) Make an attributed type cast expression. | public JCPrimitiveTypeTree | TypeIdent(int typetag) | public JCTypeParameter | TypeParam(Name name, TypeVar tvar) Create a type parameter tree from its name and type. | public JCTypeParameter | TypeParameter(Name name, List<JCExpression> bounds) | public List<JCTypeParameter> | TypeParams(List<Type> typarams) Create a list of type parameter trees from a list of type variables. | public JCInstanceOf | TypeTest(JCExpression expr, JCTree clazz) | public List<JCExpression> | Types(List<Type> ts) Create a list of trees representing given list of types. | public JCUnary | Unary(int opcode, JCExpression arg) | public JCVariableDecl | VarDef(JCModifiers mods, Name name, JCExpression vartype, JCExpression init) | public JCVariableDecl | VarDef(VarSymbol v, JCExpression init) Create a variable definition from a variable symbol and an initializer
expression. | public JCWhileLoop | WhileLoop(JCExpression cond, JCStatement body) | public JCWildcard | Wildcard(TypeBoundKind kind, JCTree type) | public TreeMaker | at(int pos) Reassign current position. | public TreeMaker | at(DiagnosticPosition pos) Reassign current position. | public TreeMaker | forToplevel(JCCompilationUnit toplevel) Create a new tree maker for a given toplevel. | public static TreeMaker | instance(Context context) Get the TreeMaker instance. | boolean | isUnqualifiable(Symbol sym) | public Name | paramName(int i) The name of synthetic parameter number `i'. | public Name | typaramName(int i) The name of synthetic type parameter number `i'. |
annotationBuilder | AnnotationBuilder annotationBuilder(Code) | | |
pos | public int pos(Code) | | The position at which subsequent trees will be created.
|
toplevel | public JCCompilationUnit toplevel(Code) | | The toplevel tree to which created trees belong.
|
TreeMaker | protected TreeMaker(Context context)(Code) | | Create a tree maker with null toplevel and NOPOS as initial position.
|
TreeMaker | TreeMaker(JCCompilationUnit toplevel, Name.Table names, Types types, Symtab syms)(Code) | | Create a tree maker with a given toplevel and FIRSTPOS as initial position.
|
Annotation | public JCAnnotation Annotation(JCTree annotationType, List<JCExpression> args)(Code) | | |
Annotation | public JCAnnotation Annotation(Attribute a)(Code) | | Create an annotation tree from an attribute.
|
AnonymousClassDef | public JCClassDecl AnonymousClassDef(JCModifiers mods, List<JCTree> defs)(Code) | | |
App | public JCMethodInvocation App(JCExpression meth, List<JCExpression> args)(Code) | | Create a method invocation from a method tree and a list of
argument trees.
|
App | public JCMethodInvocation App(JCExpression meth)(Code) | | Create a no-arg method invocation from a method tree
|
Apply | public JCMethodInvocation Apply(List<JCExpression> typeargs, JCExpression fn, List<JCExpression> args)(Code) | | |
Assert | public JCAssert Assert(JCExpression cond, JCExpression detail)(Code) | | |
Assign | public JCAssign Assign(JCExpression lhs, JCExpression rhs)(Code) | | |
Assignment | public JCStatement Assignment(Symbol v, JCExpression rhs)(Code) | | Construct an assignment from a variable symbol and a right hand side.
|
Binary | public JCBinary Binary(int opcode, JCExpression lhs, JCExpression rhs)(Code) | | |
Block | public JCBlock Block(long flags, List<JCStatement> stats)(Code) | | |
Call | public JCStatement Call(JCExpression apply)(Code) | | Wrap a method invocation in an expression statement or return statement,
depending on whether the method invocation expression's type is void.
|
Case | public JCCase Case(JCExpression pat, List<JCStatement> stats)(Code) | | |
Catch | public JCCatch Catch(JCVariableDecl param, JCBlock body)(Code) | | |
ClassDef | public JCClassDecl ClassDef(JCModifiers mods, Name name, List<JCTypeParameter> typarams, JCTree extending, List<JCExpression> implementing, List<JCTree> defs)(Code) | | |
ClassLiteral | public JCExpression ClassLiteral(ClassSymbol clazz)(Code) | | Create a tree representing a class literal.
|
ClassLiteral | public JCExpression ClassLiteral(Type t)(Code) | | Create a tree representing a class literal.
|
Conditional | public JCConditional Conditional(JCExpression cond, JCExpression thenpart, JCExpression elsepart)(Code) | | |
Continue | public JCContinue Continue(Name label)(Code) | | |
Create | public JCExpression Create(Symbol ctor, List<JCExpression> args)(Code) | | Create a method invocation from a method tree and a list of argument trees.
|
DoLoop | public JCDoWhileLoop DoLoop(JCStatement body, JCExpression cond)(Code) | | |
Erroneous | public JCErroneous Erroneous()(Code) | | |
Exec | public JCExpressionStatement Exec(JCExpression expr)(Code) | | |
ForLoop | public JCForLoop ForLoop(List<JCStatement> init, JCExpression cond, List<JCExpressionStatement> step, JCStatement body)(Code) | | |
ForeachLoop | public JCEnhancedForLoop ForeachLoop(JCVariableDecl var, JCExpression expr, JCStatement body)(Code) | | |
Ident | public JCIdent Ident(Symbol sym)(Code) | | Create an identifier from a symbol.
|
Ident | public JCExpression Ident(JCVariableDecl param)(Code) | | Create an identifier that refers to the variable declared in given variable
declaration.
|
Idents | public List<JCExpression> Idents(List<JCVariableDecl> params)(Code) | | Create a list of identifiers referring to the variables declared
in given list of variable declarations.
|
If | public JCIf If(JCExpression cond, JCStatement thenpart, JCStatement elsepart)(Code) | | |
Import | public JCImport Import(JCTree qualid, boolean importStatic)(Code) | | |
Indexed | public JCArrayAccess Indexed(JCExpression indexed, JCExpression index)(Code) | | |
Indexed | public JCArrayAccess Indexed(Symbol v, JCExpression index)(Code) | | Construct an index expression from a variable and an expression.
|
Labelled | public JCLabeledStatement Labelled(Name label, JCStatement body)(Code) | | |
LetExpr | public LetExpr LetExpr(JCVariableDecl def, JCTree expr)(Code) | | |
Literal | public JCLiteral Literal(int tag, Object value)(Code) | | |
MethodDef | public JCMethodDecl MethodDef(JCModifiers mods, Name name, JCExpression restype, List<JCTypeParameter> typarams, List<JCVariableDecl> params, List<JCExpression> thrown, JCBlock body, JCExpression defaultValue)(Code) | | |
MethodDef | public JCMethodDecl MethodDef(MethodSymbol m, JCBlock body)(Code) | | Create a method definition from a method symbol and a method body.
|
MethodDef | public JCMethodDecl MethodDef(MethodSymbol m, Type mtype, JCBlock body)(Code) | | Create a method definition from a method symbol, method type
and a method body.
|
Modifiers | public JCModifiers Modifiers(long flags, List<JCAnnotation> annotations)(Code) | | |
Modifiers | public JCModifiers Modifiers(long flags)(Code) | | |
NewArray | public JCNewArray NewArray(JCExpression elemtype, List<JCExpression> dims, List<JCExpression> elems)(Code) | | |
NewClass | public JCNewClass NewClass(JCExpression encl, List<JCExpression> typeargs, JCExpression clazz, List<JCExpression> args, JCClassDecl def)(Code) | | |
Param | public JCVariableDecl Param(Name name, Type argtype, Symbol owner)(Code) | | Create a value parameter tree from its name, type, and owner.
|
Params | public List<JCVariableDecl> Params(List<Type> argtypes, Symbol owner)(Code) | | Create a a list of value parameter trees x0, ..., xn from a list of
their types and an their owner.
|
Parens | public JCParens Parens(JCExpression expr)(Code) | | |
QualIdent | public JCExpression QualIdent(Symbol sym)(Code) | | Create a qualified identifier from a symbol, adding enough qualifications
to make the reference unique.
|
Return | public JCReturn Return(JCExpression expr)(Code) | | |
Select | public JCFieldAccess Select(JCExpression selected, Name selector)(Code) | | |
Select | public JCExpression Select(JCExpression base, Symbol sym)(Code) | | Create a selection node from a qualifier tree and a symbol.
Parameters: base - The qualifier tree. |
Skip | public JCSkip Skip()(Code) | | |
Super | public JCIdent Super(Type t, TypeSymbol owner)(Code) | | Create a tree representing `super', given its type and owner.
|
Switch | public JCSwitch Switch(JCExpression selector, List<JCCase> cases)(Code) | | |
Synchronized | public JCSynchronized Synchronized(JCExpression lock, JCBlock body)(Code) | | |
This | public JCExpression This(Type t)(Code) | | Create a tree representing `this', given its type.
|
TopLevel | public JCCompilationUnit TopLevel(List<JCAnnotation> packageAnnotations, JCExpression pid, List<JCTree> defs)(Code) | | Create given tree node at current position.
Parameters: defs - a list of ClassDef, Import, and Skip |
Try | public JCTry Try(JCBlock body, List<JCCatch> catchers, JCBlock finalizer)(Code) | | |
Type | public JCExpression Type(Type t)(Code) | | Create a tree representing given type.
|
TypeApply | public JCTypeApply TypeApply(JCExpression clazz, List<JCExpression> arguments)(Code) | | |
TypeArray | public JCArrayTypeTree TypeArray(JCExpression elemtype)(Code) | | |
TypeCast | public JCTypeCast TypeCast(JCTree clazz, JCExpression expr)(Code) | | |
TypeCast | public JCTypeCast TypeCast(Type type, JCExpression expr)(Code) | | Make an attributed type cast expression.
|
TypeIdent | public JCPrimitiveTypeTree TypeIdent(int typetag)(Code) | | |
TypeParam | public JCTypeParameter TypeParam(Name name, TypeVar tvar)(Code) | | Create a type parameter tree from its name and type.
|
TypeParameter | public JCTypeParameter TypeParameter(Name name, List<JCExpression> bounds)(Code) | | |
TypeParams | public List<JCTypeParameter> TypeParams(List<Type> typarams)(Code) | | Create a list of type parameter trees from a list of type variables.
|
TypeTest | public JCInstanceOf TypeTest(JCExpression expr, JCTree clazz)(Code) | | |
Types | public List<JCExpression> Types(List<Type> ts)(Code) | | Create a list of trees representing given list of types.
|
Unary | public JCUnary Unary(int opcode, JCExpression arg)(Code) | | |
VarDef | public JCVariableDecl VarDef(JCModifiers mods, Name name, JCExpression vartype, JCExpression init)(Code) | | |
VarDef | public JCVariableDecl VarDef(VarSymbol v, JCExpression init)(Code) | | Create a variable definition from a variable symbol and an initializer
expression.
|
WhileLoop | public JCWhileLoop WhileLoop(JCExpression cond, JCStatement body)(Code) | | |
Wildcard | public JCWildcard Wildcard(TypeBoundKind kind, JCTree type)(Code) | | |
at | public TreeMaker at(DiagnosticPosition pos)(Code) | | Reassign current position.
|
forToplevel | public TreeMaker forToplevel(JCCompilationUnit toplevel)(Code) | | Create a new tree maker for a given toplevel.
|
isUnqualifiable | boolean isUnqualifiable(Symbol sym)(Code) | | Can given symbol be referred to in unqualified form?
|
paramName | public Name paramName(int i)(Code) | | The name of synthetic parameter number `i'.
|
typaramName | public Name typaramName(int i)(Code) | | The name of synthetic type parameter number `i'.
|
|
|