|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.tools.javac.tree.JCTree
public abstract class JCTree
Root class for abstract syntax tree nodes. It provides definitions for specific tree nodes as subclasses nested inside.
Each subclass is highly standardized. It generally contains only tree fields for the syntactic subcomponents of the node. Some classes that represent identifier uses or definitions also define a Symbol field that denotes the represented identifier. Classes for non-local jumps also carry the jump target as a field. The root class Tree itself defines fields for the tree's type and position. No other fields are kept in a tree node; instead parameters are passed to methods accessing the node.
Except for the methods defined by com.sun.source, the only method defined in subclasses is `visit' which applies a given visitor to the tree. The actual tree processing is done by visitor classes in other packages. The abstract class Visitor, as well as an Factory interface for trees, are defined as inner classes in Tree.
To avoid ambiguities with the Tree API in com.sun.source all sub classes should, by convention, start with JC (javac).
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.
TreeMaker,
TreeInfo,
TreeTranslator,
Pretty| Nested Class Summary | |
|---|---|
static interface |
JCTree.Factory
An interface for tree factories |
static class |
JCTree.JCAnnotation
|
static class |
JCTree.JCArrayAccess
An array selection |
static class |
JCTree.JCArrayTypeTree
An array type, A[] |
static class |
JCTree.JCAssert
An assert statement. |
static class |
JCTree.JCAssign
A assignment with "=". |
static class |
JCTree.JCAssignOp
An assignment with "+=", "|=" ... |
static class |
JCTree.JCBinary
A binary operation. |
static class |
JCTree.JCBlock
A statement block. |
static class |
JCTree.JCBracketExpr
A bracket expression containing an expression. |
static class |
JCTree.JCBracketStat
A bracket expression containing statements. |
static class |
JCTree.JCBreak
A break from a loop or switch. |
static class |
JCTree.JCCase
A "case :" of a switch. |
static class |
JCTree.JCCatch
A catch block. |
static class |
JCTree.JCClassDecl
A class definition. |
static class |
JCTree.JCCompilationUnit
Everything in one source file is kept in a TopLevel structure. |
static class |
JCTree.JCConditional
A ( ) ? ( ) : ( ) conditional expression |
static class |
JCTree.JCContinue
A continue of a loop. |
static class |
JCTree.JCDoWhileLoop
A do loop |
static class |
JCTree.JCEnhancedForLoop
The enhanced for loop. |
static class |
JCTree.JCErroneous
|
static class |
JCTree.JCEscapeExpr
A escape expression |
static class |
JCTree.JCEscapeStat
An escape statement |
static class |
JCTree.JCExpression
|
static class |
JCTree.JCExpressionStatement
an expression statement |
static class |
JCTree.JCFieldAccess
Selects through packages and classes |
static class |
JCTree.JCForLoop
A for loop. |
static class |
JCTree.JCIdent
An identifier |
static class |
JCTree.JCIf
An "if ( ) { } else { }" block |
static class |
JCTree.JCImport
An import clause. |
static class |
JCTree.JCInstanceOf
A type test. |
static class |
JCTree.JCLabeledStatement
A labelled expression or statement. |
static class |
JCTree.JCLiteral
A constant value given literally. |
static class |
JCTree.JCMethodDecl
A method definition. |
static class |
JCTree.JCMethodInvocation
A method invocation |
static class |
JCTree.JCModifiers
|
static class |
JCTree.JCNewArray
A new[...] operation. |
static class |
JCTree.JCNewClass
A new(...) operation. |
static class |
JCTree.JCParens
A parenthesized subexpression ( ... |
static class |
JCTree.JCPrimitiveTypeTree
Identifies a basic type. |
static class |
JCTree.JCReturn
A return statement. |
static class |
JCTree.JCSkip
A no-op statement ";". |
static class |
JCTree.JCStatement
|
static class |
JCTree.JCSwitch
A "switch ( ) { }" construction. |
static class |
JCTree.JCSynchronized
A synchronized block. |
static class |
JCTree.JCThrow
A throw statement. |
static class |
JCTree.JCTry
A "try { } catch ( ) { } finally { }" block. |
static class |
JCTree.JCTypeApply
A parameterized type, T<...> |
static class |
JCTree.JCTypeCast
A type cast. |
static class |
JCTree.JCTypeParameter
A formal class parameter. |
static class |
JCTree.JCUnary
A unary operation. |
static class |
JCTree.JCVariableDecl
A variable definition. |
static class |
JCTree.JCWhileLoop
A while loop |
static class |
JCTree.JCWildcard
|
static class |
JCTree.LetExpr
(let int x = 3; in x+2) |
static class |
JCTree.TypeBoundKind
|
static class |
JCTree.Visitor
A generic visitor class for trees. |
| Field Summary | |
|---|---|
static int |
AND
|
static int |
ANNOTATION
metadata: Annotation. |
static int |
APPLY
Method invocation expressions, of type Apply. |
static int |
ASGOffset
The offset between assignment operators and normal operators. |
static int |
ASSERT
Assert statements, of type Assert. |
static int |
ASSIGN
Assignment expressions, of type Assign. |
static int |
BITAND
|
static int |
BITAND_ASG
|
static int |
BITOR
|
static int |
BITOR_ASG
Assignment operators, of type Assignop. |
static int |
BITXOR
|
static int |
BITXOR_ASG
|
static int |
BLOCK
Blocks, of type Block. |
static int |
BRACKET_EXPR
emw4: staging additions |
static int |
BRACKET_STAT
|
static int |
BREAK
Break statements, of type Break. |
static int |
CASE
Case parts in switch statements, of type Case. |
static int |
CATCH
Catch clauses in try statements, of type Catch. |
static int |
CLASSDEF
Class definitions, of type ClassDef. |
static int |
COMPL
|
static int |
CONDEXPR
Conditional expressions, of type Conditional. |
static int |
CONTINUE
Continue statements, of type Continue. |
static int |
DIV
|
static int |
DIV_ASG
|
static int |
DOLOOP
Do-while loops, of type DoLoop. |
static int |
EQ
|
static int |
ERRONEOUS
Error trees, of type Erroneous. |
static int |
ESCAPE_EXPR
|
static int |
ESCAPE_STAT
|
static int |
EXEC
Expression statements, of type Exec. |
static int |
FOREACHLOOP
Foreach-loops, of type ForeachLoop. |
static int |
FORLOOP
For-loops, of type ForLoop. |
static int |
GE
|
static int |
GT
|
static int |
IDENT
Simple identifiers, of type Ident. |
static int |
IF
Conditional statements, of type If. |
static int |
IMPORT
Import clauses, of type Import. |
static int |
INDEXED
Indexed array expressions, of type Indexed. |
static int |
LABELLED
Labelled statements, of type Labelled. |
static int |
LE
|
static int |
LETEXPR
A synthetic let expression, of type LetExpr. |
static int |
LITERAL
Literals, of type Literal. |
static int |
LT
|
static int |
METHODDEF
Method definitions, of type MethodDef. |
static int |
MINUS
|
static int |
MINUS_ASG
|
static int |
MOD
|
static int |
MOD_ASG
|
static int |
MODIFIERS
metadata: Modifiers |
static int |
MUL
|
static int |
MUL_ASG
|
static int |
NE
|
static int |
NEG
|
static int |
NEWARRAY
Array creation expressions, of type NewArray. |
static int |
NEWCLASS
Class instance creation expressions, of type NewClass. |
static int |
NOT
|
static int |
NULLCHK
unary operator for null reference checks, only used internally. |
static int |
OR
Binary operators, of type Binary. |
static int |
PARENS
Parenthesized subexpressions, of type Parens. |
static int |
PLUS
|
static int |
PLUS_ASG
|
int |
pos
|
static int |
POS
Unary operators, of type Unary. |
static int |
POSTDEC
|
static int |
POSTINC
|
static int |
PREDEC
|
static int |
PREINC
|
static int |
RETURN
Return statements, of type Return. |
static int |
SELECT
Selections, of type Select. |
static int |
SKIP
The no-op statement ";", of type Skip |
static int |
SL
|
static int |
SL_ASG
|
static int |
SR
|
static int |
SR_ASG
|
static int |
SWITCH
Switch statements, of type Switch. |
static int |
SYNCHRONIZED
Synchronized statements, of type Synchonized. |
static int |
THROW
Throw statements, of type Throw. |
static int |
TOPLEVEL
Toplevel nodes, of type TopLevel, representing entire source files. |
static int |
TRY
Try statements, of type Try. |
Type |
type
|
static int |
TYPEAPPLY
Parameterized types, of type TypeApply. |
static int |
TYPEARRAY
Array types, of type TypeArray. |
static int |
TYPEBOUNDKIND
Bound kind: extends, super, exact, or unbound |
static int |
TYPECAST
Type cast expressions, of type TypeCast. |
static int |
TYPEIDENT
Basic type identifiers, of type TypeIdent. |
static int |
TYPEPARAMETER
Formal type parameters, of type TypeParameter. |
static int |
TYPETEST
Type test expressions, of type TypeTest. |
static int |
USR
|
static int |
USR_ASG
|
static int |
VARDEF
Variable definitions, of type VarDef. |
static int |
WHILELOOP
While-loops, of type WhileLoop. |
static int |
WILDCARD
Type argument. |
| Constructor Summary | |
|---|---|
JCTree()
|
|
| Method Summary | ||
|---|---|---|
abstract void |
accept(JCTree.Visitor v)
Visit this tree with a given visitor. |
|
abstract
|
accept(TreeVisitor<R,D> v,
D d)
|
|
java.lang.Object |
clone()
Return a shallow copy of this tree. |
|
int |
getEndPosition(java.util.Map<JCTree,java.lang.Integer> endPosTable)
If there is a tree node, and if endPositions are available, get the end position of the tree node. |
|
int |
getPreferredPosition()
Get the position within the file that most accurately defines the location for the diagnostic. |
|
int |
getStartPosition()
If there is a tree node, get the start position of the tree node. |
|
abstract int |
getTag()
|
|
JCTree |
getTree()
Gets the tree node, if any, to which the diagnostic applies. |
|
JCDiagnostic.DiagnosticPosition |
pos()
Get a default position for this tree node. |
|
JCTree |
setPos(int pos)
Set position field and return this tree. |
|
JCTree |
setType(Type type)
Set type field and return this tree. |
|
java.lang.String |
toString()
Convert a tree to a pretty-printed string. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int TOPLEVEL
public static final int IMPORT
public static final int CLASSDEF
public static final int METHODDEF
public static final int VARDEF
public static final int SKIP
public static final int BLOCK
public static final int DOLOOP
public static final int WHILELOOP
public static final int FORLOOP
public static final int FOREACHLOOP
public static final int LABELLED
public static final int SWITCH
public static final int CASE
public static final int SYNCHRONIZED
public static final int TRY
public static final int CATCH
public static final int CONDEXPR
public static final int IF
public static final int EXEC
public static final int BREAK
public static final int CONTINUE
public static final int RETURN
public static final int THROW
public static final int ASSERT
public static final int APPLY
public static final int NEWCLASS
public static final int NEWARRAY
public static final int PARENS
public static final int ASSIGN
public static final int TYPECAST
public static final int TYPETEST
public static final int INDEXED
public static final int SELECT
public static final int IDENT
public static final int LITERAL
public static final int TYPEIDENT
public static final int TYPEARRAY
public static final int TYPEAPPLY
public static final int TYPEPARAMETER
public static final int WILDCARD
public static final int TYPEBOUNDKIND
public static final int ANNOTATION
public static final int MODIFIERS
public static final int ERRONEOUS
public static final int POS
public static final int NEG
public static final int NOT
public static final int COMPL
public static final int PREINC
public static final int PREDEC
public static final int POSTINC
public static final int POSTDEC
public static final int NULLCHK
public static final int OR
public static final int AND
public static final int BITOR
public static final int BITXOR
public static final int BITAND
public static final int EQ
public static final int NE
public static final int LT
public static final int GT
public static final int LE
public static final int GE
public static final int SL
public static final int SR
public static final int USR
public static final int PLUS
public static final int MINUS
public static final int MUL
public static final int DIV
public static final int MOD
public static final int BITOR_ASG
public static final int BITXOR_ASG
public static final int BITAND_ASG
public static final int SL_ASG
public static final int SR_ASG
public static final int USR_ASG
public static final int PLUS_ASG
public static final int MINUS_ASG
public static final int MUL_ASG
public static final int DIV_ASG
public static final int MOD_ASG
public static final int BRACKET_EXPR
public static final int BRACKET_STAT
public static final int ESCAPE_EXPR
public static final int ESCAPE_STAT
public static final int LETEXPR
public static final int ASGOffset
public int pos
public Type type
| Constructor Detail |
|---|
public JCTree()
| Method Detail |
|---|
public abstract int getTag()
public java.lang.String toString()
toString in class java.lang.Objectpublic JCTree setPos(int pos)
public JCTree setType(Type type)
public abstract void accept(JCTree.Visitor v)
public abstract <R,D> R accept(TreeVisitor<R,D> v,
D d)
public java.lang.Object clone()
clone in class java.lang.Objectpublic JCDiagnostic.DiagnosticPosition pos()
public JCTree getTree()
JCDiagnostic.DiagnosticPosition
getTree in interface JCDiagnostic.DiagnosticPositionpublic int getStartPosition()
JCDiagnostic.DiagnosticPosition
getStartPosition in interface JCDiagnostic.DiagnosticPositionpublic int getPreferredPosition()
JCDiagnostic.DiagnosticPosition
getPreferredPosition in interface JCDiagnostic.DiagnosticPositionpublic int getEndPosition(java.util.Map<JCTree,java.lang.Integer> endPosTable)
JCDiagnostic.DiagnosticPosition
getEndPosition in interface JCDiagnostic.DiagnosticPosition
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||