|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.tools.javac.parser.JavacParser
public class JavacParser
The parser maps a token sequence into an abstract syntax tree. It operates by recursive descent, with code derived systematically from an LL(1) grammar. For efficiency reasons, an operator precedence scheme is used for parsing binary operation expressions.
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.
Field Summary | |
---|---|
(package private) boolean |
allowAnnotations
Switch: should we recognize annotations? |
(package private) boolean |
allowAsserts
Switch: should we recognize assert statements, or just give a warning? |
(package private) boolean |
allowEnums
Switch: should we recognize enums, or just give a warning? |
(package private) boolean |
allowForeach
Switch: should we recognize foreach? |
(package private) boolean |
allowGenerics
Switch: Should generics be recognized? |
(package private) boolean |
allowStaticImport
Switch: should we recognize foreach? |
(package private) boolean |
allowVarargs
Switch: Should varargs be recognized? |
(package private) java.util.Map<JCTree,java.lang.String> |
docComments
A hashtable to store all documentation comments indexed by the tree nodes they refer to. |
private int |
errorEndPos
|
private int |
errorPos
|
private JCTree.JCErroneous |
errorTree
|
(package private) static int |
EXPR
When terms are parsed, the mode determines which is expected: mode = EXPR : an expression mode = TYPE : a type mode = NOPARAMS : no parameters allowed for type mode = TYPEARG : type argument |
protected TreeMaker |
F
The factory to be used for abstract syntax tree construction. |
private static int |
infixPrecedenceLevels
The number of precedence levels of infix operators. |
(package private) boolean |
keepDocComments
Switch: should we keep docComments? |
(package private) boolean |
keepLineMap
Switch: should we keep line table? |
private Keywords |
keywords
The keyword table. |
private int |
lastmode
The mode of the term that was parsed last. |
private Log |
log
The log to be used for error diagnostics. |
private int |
mode
The current mode. |
private Names |
names
The name table. |
(package private) static int |
NOPARAMS
|
(package private) ListBuffer<JCTree.JCExpression[]> |
odStackSupply
optimization: To save allocating a new operand/operator stack for every binary operation, we use supplys. |
(package private) ListBuffer<Token[]> |
opStackSupply
|
private Lexer |
S
The scanner used for lexical analysis. |
private Source |
source
The Source language setting. |
(package private) static int |
TYPE
|
(package private) static int |
TYPEARG
|
Constructor Summary | |
---|---|
protected |
JavacParser(ParserFactory fac,
Lexer S,
boolean keepDocComments,
boolean keepLineMap)
Construct a parser from a given scanner, tree factory and log. |
Method Summary | ||
---|---|---|
void |
accept(Token token)
If next input token matches given token, skip it, otherwise report an error. |
|
(package private) JCTree.JCAnnotation |
annotation(int pos)
Annotation = "@" Qualident [ "(" AnnotationFieldValues ")" ] |
|
(package private) JCTree.JCExpression |
annotationFieldValue()
AnnotationFieldValue = AnnotationValue | Identifier "=" AnnotationValue |
|
(package private) List<JCTree.JCExpression> |
annotationFieldValues()
AnnotationFieldValues = "(" [ AnnotationFieldValue { "," AnnotationFieldValue } ] ")" |
|
(package private) List<JCTree.JCExpression> |
annotationFieldValuesOpt()
|
|
(package private) List<JCTree.JCAnnotation> |
annotationsOpt()
AnnotationsOpt = { '@' Annotation } |
|
(package private) JCTree.JCExpression |
annotationValue()
|
|
(package private) List<JCTree.JCExpression> |
arguments()
Arguments = "(" [Expression { COMMA Expression }] ")" |
|
(package private) JCTree.JCMethodInvocation |
arguments(List<JCTree.JCExpression> typeArgs,
JCTree.JCExpression t)
|
|
(package private) JCTree.JCExpression |
argumentsOpt(List<JCTree.JCExpression> typeArgs,
JCTree.JCExpression t)
ArgumentsOpt = [ Arguments ] |
|
(package private) JCTree.JCExpression |
arrayCreatorRest(int newpos,
JCTree.JCExpression elemtype)
ArrayCreatorRest = "[" ( "]" BracketsOpt ArrayInitializer | Expression "]" {"[" Expression "]"} BracketsOpt ) |
|
(package private) JCTree.JCExpression |
arrayInitializer(int newpos,
JCTree.JCExpression t)
ArrayInitializer = "{" [VariableInitializer {"," VariableInitializer}] [","] "}" |
|
(package private) void |
attach(JCTree tree,
java.lang.String dc)
Make an entry into docComments hashtable, provided flag keepDocComments is set and given doc comment is non-null. |
|
(package private) JCTree.JCPrimitiveTypeTree |
basicType()
BasicType = BYTE | SHORT | CHAR | INT | LONG | FLOAT | DOUBLE | BOOLEAN |
|
JCTree.JCBlock |
block()
|
|
(package private) JCTree.JCBlock |
block(int pos,
long flags)
Block = "{" BlockStatements "}" |
|
(package private) List<JCTree.JCStatement> |
blockStatements()
BlockStatements = { BlockStatement } BlockStatement = LocalVariableDeclarationStatement | ClassOrInterfaceOrEnumDeclaration | [Ident ":"] Statement LocalVariableDeclarationStatement = { FINAL | '@' Annotation } Type VariableDeclarators ";" |
|
private JCTree.JCExpression |
bracketsOpt(JCTree.JCExpression t)
BracketsOpt = {"[" "]"} |
|
private JCTree.JCArrayTypeTree |
bracketsOptCont(JCTree.JCExpression t,
int pos)
|
|
(package private) JCTree.JCExpression |
bracketsSuffix(JCTree.JCExpression t)
BracketsSuffixExpr = "." CLASS BracketsSuffixType = |
|
(package private) JCTree.JCCatch |
catchClause()
CatchClause = CATCH "(" FormalParameter ")" Block |
|
(package private) void |
checkAnnotations()
|
|
protected JCTree.JCExpression |
checkExprStat(JCTree.JCExpression t)
Check that given tree is a legal expression statement. |
|
(package private) void |
checkForeach()
|
|
(package private) void |
checkGenerics()
|
|
(package private) void |
checkNoMods(long mods)
Diagnose a modifier flag from the set, if any. |
|
(package private) void |
checkStaticImports()
|
|
(package private) void |
checkVarargs()
|
|
(package private) JCTree.JCExpression |
classCreatorRest(int newpos,
JCTree.JCExpression encl,
List<JCTree.JCExpression> typeArgs,
JCTree.JCExpression t)
ClassCreatorRest = Arguments [ClassBody] |
|
(package private) JCTree.JCClassDecl |
classDeclaration(JCTree.JCModifiers mods,
java.lang.String dc)
ClassDeclaration = CLASS Ident TypeParametersOpt [EXTENDS Type] [IMPLEMENTS TypeList] ClassBody |
|
(package private) List<JCTree> |
classOrInterfaceBody(Name className,
boolean isInterface)
ClassBody = "{" {ClassBodyDeclaration} "}" InterfaceBody = "{" {InterfaceBodyDeclaration} "}" |
|
(package private) List<JCTree> |
classOrInterfaceBodyDeclaration(Name className,
boolean isInterface)
ClassBodyDeclaration = ";" | [STATIC] Block | ModifiersOpt ( Type Ident ( VariableDeclaratorsRest ";" | MethodDeclaratorRest ) | VOID Ident MethodDeclaratorRest | TypeParameters (Type | VOID) Ident MethodDeclaratorRest | Ident ConstructorDeclaratorRest | TypeParameters Ident ConstructorDeclaratorRest | ClassOrInterfaceOrEnumDeclaration ) InterfaceBodyDeclaration = ";" | ModifiersOpt Type Ident ( ConstantDeclaratorsRest | InterfaceMethodDeclaratorRest ";" ) |
|
(package private) JCTree.JCStatement |
classOrInterfaceOrEnumDeclaration(JCTree.JCModifiers mods,
java.lang.String dc)
ClassOrInterfaceOrEnumDeclaration = ModifiersOpt (ClassDeclaration | InterfaceDeclaration | EnumDeclaration) |
|
(package private) JCTree.JCExpression |
creator(int newpos,
List<JCTree.JCExpression> typeArgs)
Creator = Qualident [TypeArguments] ( ArrayCreatorRest | ClassCreatorRest ) |
|
(package private) List<JCTree> |
enumBody(Name enumName)
EnumBody = "{" { EnumeratorDeclarationList } [","] [ ";" {ClassBodyDeclaration} ] "}" |
|
(package private) JCTree.JCClassDecl |
enumDeclaration(JCTree.JCModifiers mods,
java.lang.String dc)
EnumDeclaration = ENUM Ident [IMPLEMENTS TypeList] EnumBody |
|
(package private) JCTree |
enumeratorDeclaration(Name enumName)
EnumeratorDeclaration = AnnotationsOpt [TypeArguments] IDENTIFIER [ Arguments ] [ "{" ClassBody "}" ] |
|
protected java.lang.StringBuffer |
foldStrings(JCTree tree)
If tree is a concatenation of string literals, replace it by a single literal representing the concatenated string. |
|
(package private) List<JCTree.JCStatement> |
forInit()
ForInit = StatementExpression MoreStatementExpressions | { FINAL | '@' Annotation } Type VariableDeclarators |
|
(package private) JCTree.JCVariableDecl |
formalParameter()
FormalParameter = { FINAL | '@' Annotation } Type VariableDeclaratorId LastFormalParameter = { FINAL | '@' Annotation } Type '...' Ident | FormalParameter |
|
(package private) List<JCTree.JCVariableDecl> |
formalParameters()
FormalParameters = "(" [ FormalParameterList ] ")" FormalParameterList = [ FormalParameterListNovarargs , ] LastFormalParameter FormalParameterListNovarargs = [ FormalParameterListNovarargs , ] FormalParameter |
|
(package private) List<JCTree.JCExpressionStatement> |
forUpdate()
ForUpdate = StatementExpression MoreStatementExpressions |
|
int |
getEndPos(JCTree tree)
Get the end position for a tree node. |
|
protected int |
getErrorEndPos()
|
|
int |
getStartPos(JCTree tree)
Get the start position for a tree node. |
|
(package private) Name |
ident()
Ident = IDENTIFIER |
|
(package private) JCTree.JCExpression |
illegal()
Report an illegal start of expression/type error at current position. |
|
(package private) JCTree.JCExpression |
illegal(int pos)
Report an illegal start of expression/type error at given position. |
|
(package private) JCTree |
importDeclaration()
ImportDeclaration = IMPORT [ STATIC ] Ident { "." Ident } [ "." "*" ] ";" |
|
(package private) JCTree.JCExpression |
innerCreator(int newpos,
List<JCTree.JCExpression> typeArgs,
JCTree.JCExpression encl)
InnerCreator = Ident [TypeArguments] ClassCreatorRest |
|
(package private) JCTree.JCClassDecl |
interfaceDeclaration(JCTree.JCModifiers mods,
java.lang.String dc)
InterfaceDeclaration = INTERFACE Ident TypeParametersOpt [EXTENDS TypeList] InterfaceBody |
|
(package private) boolean |
isZero(java.lang.String s)
|
|
(package private) JCTree.JCExpression |
literal(Name prefix)
Literal = INTLITERAL | LONGLITERAL | FLOATLITERAL | DOUBLELITERAL | CHARLITERAL | STRINGLITERAL | TRUE | FALSE | NULL |
|
private JCTree.JCExpression |
makeOp(int pos,
Token topOp,
JCTree.JCExpression od1,
JCTree.JCExpression od2)
Construct a binary or type test node. |
|
(package private) JCTree |
methodDeclaratorRest(int pos,
JCTree.JCModifiers mods,
JCTree.JCExpression type,
Name name,
List<JCTree.JCTypeParameter> typarams,
boolean isInterface,
boolean isVoid,
java.lang.String dc)
MethodDeclaratorRest = FormalParameters BracketsOpt [Throws TypeList] ( MethodBody | [DEFAULT AnnotationValue] ";") VoidMethodDeclaratorRest = FormalParameters [Throws TypeList] ( MethodBody | ";") InterfaceMethodDeclaratorRest = FormalParameters BracketsOpt [THROWS TypeList] ";" VoidInterfaceMethodDeclaratorRest = FormalParameters [THROWS TypeList] ";" ConstructorDeclaratorRest = "(" FormalParameterListOpt ")" [THROWS TypeList] MethodBody |
|
(package private) JCTree.JCModifiers |
modifiersOpt()
ModifiersOpt = { Modifier } Modifier = PUBLIC | PROTECTED | PRIVATE | STATIC | ABSTRACT | FINAL | NATIVE | SYNCHRONIZED | TRANSIENT | VOLATILE | "@" | "@" Annotation |
|
(package private) JCTree.JCModifiers |
modifiersOpt(JCTree.JCModifiers partial)
|
|
(package private)
|
moreStatementExpressions(int pos,
JCTree.JCExpression first,
T stats)
MoreStatementExpressions = { COMMA StatementExpression } |
|
private JCTree.JCExpression[] |
newOdStack()
|
|
private Token[] |
newOpStack()
|
|
(package private) static int |
optag(Token token)
Return operation tag of binary operator represented by token, -1 if token is not a binary operator. |
|
(package private) JCTree.JCModifiers |
optFinal(long flags)
|
|
(package private) JCTree.JCExpression |
parExpression()
ParExpression = "(" Expression ")" |
|
JCTree.JCCompilationUnit |
parseCompilationUnit()
CompilationUnit = [ { "@" Annotation } PACKAGE Qualident ";"] {ImportDeclaration} {TypeDeclaration} |
|
JCTree.JCExpression |
parseExpression()
terms can be either expressions or types. |
|
JCTree.JCStatement |
parseStatement()
Statement = Block | IF ParExpression Statement [ELSE Statement] | FOR "(" ForInitOpt ";" [Expression] ";" ForUpdateOpt ")" Statement | FOR "(" FormalParameter : Expression ")" Statement | WHILE ParExpression Statement | DO Statement WHILE ParExpression ";" | TRY Block ( Catches | [Catches] FinallyPart ) | SWITCH ParExpression "{" SwitchBlockStatementGroups "}" | SYNCHRONIZED ParExpression Block | RETURN [Expression] ";" | THROW Expression ";" | BREAK [Ident] ";" | CONTINUE [Ident] ";" | ASSERT Expression [ ":" Expression ] ";" | ";" | ExpressionStatement | Ident ":" Statement emw4: staging additions | "`" Expression |
|
JCTree.JCExpression |
parseType()
Parse a type. |
|
(package private) static int |
prec(Token token)
Return precedence of operator represented by token, -1 if token is not a binary operator. |
|
JCTree.JCExpression |
qualident()
Qualident = Ident { DOT Ident } |
|
(package private) List<JCTree.JCExpression> |
qualidentList()
QualidentList = Qualident {"," Qualident} |
|
private void |
reportSyntaxError(int pos,
java.lang.String key,
java.lang.Object... args)
Report a syntax error at given position using the given argument unless one was already reported at the same position. |
|
private void |
setErrorEndPos(int errPos)
|
|
private void |
skip(boolean stopAtImport,
boolean stopAtMemberDecl,
boolean stopAtIdentifier,
boolean stopAtStatement)
Skip forward until a suitable stop token is found. |
|
protected void |
storeEnd(JCTree tree,
int endpos)
Store ending position for a tree. |
|
(package private) java.lang.String |
strval(Name prefix)
|
|
(package private) JCTree.JCExpression |
superSuffix(List<JCTree.JCExpression> typeArgs,
JCTree.JCExpression t)
SuperSuffix = Arguments | "." [TypeArguments] Ident [Arguments] |
|
(package private) List<JCTree.JCCase> |
switchBlockStatementGroups()
SwitchBlockStatementGroups = { SwitchBlockStatementGroup } SwitchBlockStatementGroup = SwitchLabel BlockStatements SwitchLabel = CASE ConstantExpression ":" | DEFAULT ":" |
|
private JCTree.JCErroneous |
syntaxError(int pos,
List<JCTree> errs,
java.lang.String key,
Token... args)
|
|
private JCTree.JCErroneous |
syntaxError(int pos,
java.lang.String key,
Token... args)
|
|
private JCTree.JCErroneous |
syntaxError(java.lang.String key)
Generate a syntax error at current position unless one was already reported at the same position. |
|
private JCTree.JCErroneous |
syntaxError(java.lang.String key,
Token arg)
Generate a syntax error at current position unless one was already reported at the same position. |
|
(package private) JCTree.JCExpression |
term()
Expression = Expression1 [ExpressionRest] ExpressionRest = [AssignmentOperator Expression1] AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "&=" | "|=" | "^=" | "%=" | "<<=" | ">>=" | ">>>=" Type = Type1 TypeNoParams = TypeNoParams1 StatementExpression = Expression ConstantExpression = Expression |
|
(package private) JCTree.JCExpression |
term(int newmode)
|
|
(package private) JCTree.JCExpression |
term1()
Expression1 = Expression2 [Expression1Rest] Type1 = Type2 TypeNoParams1 = TypeNoParams2 |
|
(package private) JCTree.JCExpression |
term1Rest(JCTree.JCExpression t)
Expression1Rest = ["?" Expression ":" Expression1] |
|
(package private) JCTree.JCExpression |
term2()
Expression2 = Expression3 [Expression2Rest] Type2 = Type3 TypeNoParams2 = TypeNoParams3 |
|
(package private) JCTree.JCExpression |
term2Rest(JCTree.JCExpression t,
int minprec)
|
|
protected JCTree.JCExpression |
term3()
Expression3 = PrefixOp Expression3 | "(" Expr | TypeNoParams ")" Expression3 | Primary {Selector} {PostfixOp} mgr: added let expression | LET VarDecls IN Expression emw4: staging additions // * | "<|" Statement | Expression "|>" | "<|" { BlockStatements } | Expression "|>" | "`" Expression Primary = "(" Expression ")" | Literal | [TypeArguments] THIS [Arguments] | [TypeArguments] SUPER SuperSuffix | NEW [TypeArguments] Creator | Ident { "." Ident } [ "[" ( "]" BracketsOpt "." CLASS | Expression "]" ) | Arguments | "." ( CLASS | THIS | [TypeArguments] SUPER Arguments | NEW [TypeArguments] InnerCreator ) ] | BasicType BracketsOpt "." CLASS PrefixOp = "++" | "--" | "!" | "~" | "+" | "-" PostfixOp = "++" | "--" Type3 = Ident { "." Ident } [TypeArguments] {TypeSelector} BracketsOpt | BasicType TypeNoParams3 = Ident { "." Ident } BracketsOpt Selector = "." [TypeArguments] Ident [Arguments] | "." THIS | "." [TypeArguments] SUPER SuperSuffix | "." NEW [TypeArguments] InnerCreator | "[" Expression "]" TypeSelector = "." Ident [TypeArguments] SuperSuffix = Arguments | "." Ident [Arguments] |
|
(package private) JCTree.JCExpression |
termRest(JCTree.JCExpression t)
|
|
protected
|
to(T t)
Store ending position for a tree. |
|
protected
|
toP(T t)
Store ending position for a tree. |
|
(package private) JCTree.JCExpression |
typeArgument()
TypeArgument = Type | "?" | "?" EXTENDS Type {"&" Type} | "?" SUPER Type |
|
(package private) List<JCTree.JCExpression> |
typeArguments()
TypeArguments = "<" TypeArgument {"," TypeArgument} ">" |
|
(package private) JCTree.JCTypeApply |
typeArguments(JCTree.JCExpression t)
|
|
(package private) List<JCTree.JCExpression> |
typeArgumentsOpt()
|
|
(package private) List<JCTree.JCExpression> |
typeArgumentsOpt(int useMode)
|
|
(package private) JCTree.JCExpression |
typeArgumentsOpt(JCTree.JCExpression t)
TypeArgumentsOpt = [ TypeArguments ] |
|
(package private) JCTree |
typeDeclaration(JCTree.JCModifiers mods)
TypeDeclaration = ClassOrInterfaceOrEnumDeclaration | ";" |
|
(package private) List<JCTree.JCExpression> |
typeList()
TypeList = Type {"," Type} |
|
(package private) JCTree.JCTypeParameter |
typeParameter()
TypeParameter = TypeVariable [TypeParameterBound] TypeParameterBound = EXTENDS Type {"&" Type} TypeVariable = Ident |
|
(package private) List<JCTree.JCTypeParameter> |
typeParametersOpt()
TypeParametersOpt = ["<" TypeParameter {"," TypeParameter} ">"] |
|
(package private) static int |
typetag(Token token)
Return type tag of basic type represented by token, -1 if token is not a basic type identifier. |
|
(package private) static int |
unoptag(Token token)
Return operation tag of unary operator represented by token, -1 if token is not a binary operator. |
|
(package private) JCTree.JCVariableDecl |
variableDeclarator(JCTree.JCModifiers mods,
JCTree.JCExpression type,
boolean reqInit,
java.lang.String dc)
VariableDeclarator = Ident VariableDeclaratorRest ConstantDeclarator = Ident ConstantDeclaratorRest |
|
(package private) JCTree.JCVariableDecl |
variableDeclaratorId(JCTree.JCModifiers mods,
JCTree.JCExpression type)
VariableDeclaratorId = Ident BracketsOpt |
|
(package private) JCTree.JCVariableDecl |
variableDeclaratorRest(int pos,
JCTree.JCModifiers mods,
JCTree.JCExpression type,
Name name,
boolean reqInit,
java.lang.String dc)
VariableDeclaratorRest = BracketsOpt ["=" VariableInitializer] ConstantDeclaratorRest = BracketsOpt "=" VariableInitializer |
|
|
variableDeclarators(JCTree.JCModifiers mods,
JCTree.JCExpression type,
T vdefs)
VariableDeclarators = VariableDeclarator { "," VariableDeclarator } |
|
(package private)
|
variableDeclaratorsRest(int pos,
JCTree.JCModifiers mods,
JCTree.JCExpression type,
Name name,
boolean reqInit,
java.lang.String dc,
T vdefs)
VariableDeclaratorsRest = VariableDeclaratorRest { "," VariableDeclarator } ConstantDeclaratorsRest = ConstantDeclaratorRest { "," ConstantDeclarator } |
|
JCTree.JCExpression |
variableInitializer()
VariableInitializer = ArrayInitializer | Expression |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int infixPrecedenceLevels
private Lexer S
protected TreeMaker F
private Log log
private Keywords keywords
private Source source
private Names names
boolean allowGenerics
boolean allowVarargs
boolean allowAsserts
boolean allowEnums
boolean allowForeach
boolean allowStaticImport
boolean allowAnnotations
boolean keepDocComments
boolean keepLineMap
static final int EXPR
static final int TYPE
static final int NOPARAMS
static final int TYPEARG
private int mode
private int lastmode
private JCTree.JCErroneous errorTree
private int errorPos
java.util.Map<JCTree,java.lang.String> docComments
private int errorEndPos
ListBuffer<JCTree.JCExpression[]> odStackSupply
ListBuffer<Token[]> opStackSupply
Constructor Detail |
---|
protected JavacParser(ParserFactory fac, Lexer S, boolean keepDocComments, boolean keepLineMap)
Method Detail |
---|
private void skip(boolean stopAtImport, boolean stopAtMemberDecl, boolean stopAtIdentifier, boolean stopAtStatement)
private JCTree.JCErroneous syntaxError(int pos, java.lang.String key, Token... args)
private JCTree.JCErroneous syntaxError(int pos, List<JCTree> errs, java.lang.String key, Token... args)
private void reportSyntaxError(int pos, java.lang.String key, java.lang.Object... args)
private JCTree.JCErroneous syntaxError(java.lang.String key)
private JCTree.JCErroneous syntaxError(java.lang.String key, Token arg)
public void accept(Token token)
JCTree.JCExpression illegal(int pos)
JCTree.JCExpression illegal()
void checkNoMods(long mods)
void attach(JCTree tree, java.lang.String dc)
tree
- The tree to be used as index in the hashtabledc
- The doc comment to associate with the tree, or null.private void setErrorEndPos(int errPos)
protected int getErrorEndPos()
protected void storeEnd(JCTree tree, int endpos)
tree
- The tree.endpos
- The ending position to associate with the tree.protected <T extends JCTree> T to(T t)
t
- The tree.protected <T extends JCTree> T toP(T t)
t
- The tree.public int getStartPos(JCTree tree)
tree
- The tree nodepublic int getEndPos(JCTree tree)
tree
- The tree nodeName ident()
public JCTree.JCExpression qualident()
JCTree.JCExpression literal(Name prefix)
boolean isZero(java.lang.String s)
java.lang.String strval(Name prefix)
public JCTree.JCExpression parseExpression()
parseExpression
in interface Parser
public JCTree.JCExpression parseType()
Parser
parseType
in interface Parser
JCTree.JCExpression term(int newmode)
JCTree.JCExpression term()
JCTree.JCExpression termRest(JCTree.JCExpression t)
JCTree.JCExpression term1()
JCTree.JCExpression term1Rest(JCTree.JCExpression t)
JCTree.JCExpression term2()
JCTree.JCExpression term2Rest(JCTree.JCExpression t, int minprec)
private JCTree.JCExpression makeOp(int pos, Token topOp, JCTree.JCExpression od1, JCTree.JCExpression od2)
protected java.lang.StringBuffer foldStrings(JCTree tree)
private JCTree.JCExpression[] newOdStack()
private Token[] newOpStack()
protected JCTree.JCExpression term3()
JCTree.JCExpression superSuffix(List<JCTree.JCExpression> typeArgs, JCTree.JCExpression t)
JCTree.JCPrimitiveTypeTree basicType()
JCTree.JCExpression argumentsOpt(List<JCTree.JCExpression> typeArgs, JCTree.JCExpression t)
List<JCTree.JCExpression> arguments()
JCTree.JCMethodInvocation arguments(List<JCTree.JCExpression> typeArgs, JCTree.JCExpression t)
JCTree.JCExpression typeArgumentsOpt(JCTree.JCExpression t)
List<JCTree.JCExpression> typeArgumentsOpt()
List<JCTree.JCExpression> typeArgumentsOpt(int useMode)
List<JCTree.JCExpression> typeArguments()
JCTree.JCExpression typeArgument()
JCTree.JCTypeApply typeArguments(JCTree.JCExpression t)
private JCTree.JCExpression bracketsOpt(JCTree.JCExpression t)
private JCTree.JCArrayTypeTree bracketsOptCont(JCTree.JCExpression t, int pos)
JCTree.JCExpression bracketsSuffix(JCTree.JCExpression t)
JCTree.JCExpression creator(int newpos, List<JCTree.JCExpression> typeArgs)
JCTree.JCExpression innerCreator(int newpos, List<JCTree.JCExpression> typeArgs, JCTree.JCExpression encl)
JCTree.JCExpression arrayCreatorRest(int newpos, JCTree.JCExpression elemtype)
JCTree.JCExpression classCreatorRest(int newpos, JCTree.JCExpression encl, List<JCTree.JCExpression> typeArgs, JCTree.JCExpression t)
JCTree.JCExpression arrayInitializer(int newpos, JCTree.JCExpression t)
public JCTree.JCExpression variableInitializer()
JCTree.JCExpression parExpression()
JCTree.JCBlock block(int pos, long flags)
public JCTree.JCBlock block()
List<JCTree.JCStatement> blockStatements()
public JCTree.JCStatement parseStatement()
parseStatement
in interface Parser
JCTree.JCCatch catchClause()
List<JCTree.JCCase> switchBlockStatementGroups()
<T extends ListBuffer<? super JCTree.JCExpressionStatement>> T moreStatementExpressions(int pos, JCTree.JCExpression first, T stats)
List<JCTree.JCStatement> forInit()
List<JCTree.JCExpressionStatement> forUpdate()
List<JCTree.JCAnnotation> annotationsOpt()
JCTree.JCModifiers modifiersOpt()
JCTree.JCModifiers modifiersOpt(JCTree.JCModifiers partial)
JCTree.JCAnnotation annotation(int pos)
pos
- position of "@" tokenList<JCTree.JCExpression> annotationFieldValuesOpt()
List<JCTree.JCExpression> annotationFieldValues()
JCTree.JCExpression annotationFieldValue()
JCTree.JCExpression annotationValue()
public <T extends ListBuffer<? super JCTree.JCVariableDecl>> T variableDeclarators(JCTree.JCModifiers mods, JCTree.JCExpression type, T vdefs)
<T extends ListBuffer<? super JCTree.JCVariableDecl>> T variableDeclaratorsRest(int pos, JCTree.JCModifiers mods, JCTree.JCExpression type, Name name, boolean reqInit, java.lang.String dc, T vdefs)
reqInit
- Is an initializer always required?dc
- The documentation comment for the variable declarations, or null.JCTree.JCVariableDecl variableDeclarator(JCTree.JCModifiers mods, JCTree.JCExpression type, boolean reqInit, java.lang.String dc)
JCTree.JCVariableDecl variableDeclaratorRest(int pos, JCTree.JCModifiers mods, JCTree.JCExpression type, Name name, boolean reqInit, java.lang.String dc)
reqInit
- Is an initializer always required?dc
- The documentation comment for the variable declarations, or null.JCTree.JCVariableDecl variableDeclaratorId(JCTree.JCModifiers mods, JCTree.JCExpression type)
public JCTree.JCCompilationUnit parseCompilationUnit()
parseCompilationUnit
in interface Parser
JCTree importDeclaration()
JCTree typeDeclaration(JCTree.JCModifiers mods)
JCTree.JCStatement classOrInterfaceOrEnumDeclaration(JCTree.JCModifiers mods, java.lang.String dc)
mods
- Any modifiers starting the class or interface declarationdc
- The documentation comment for the class, or null.JCTree.JCClassDecl classDeclaration(JCTree.JCModifiers mods, java.lang.String dc)
mods
- The modifiers starting the class declarationdc
- The documentation comment for the class, or null.JCTree.JCClassDecl interfaceDeclaration(JCTree.JCModifiers mods, java.lang.String dc)
mods
- The modifiers starting the interface declarationdc
- The documentation comment for the interface, or null.JCTree.JCClassDecl enumDeclaration(JCTree.JCModifiers mods, java.lang.String dc)
mods
- The modifiers starting the enum declarationdc
- The documentation comment for the enum, or null.List<JCTree> enumBody(Name enumName)
JCTree enumeratorDeclaration(Name enumName)
List<JCTree.JCExpression> typeList()
List<JCTree> classOrInterfaceBody(Name className, boolean isInterface)
List<JCTree> classOrInterfaceBodyDeclaration(Name className, boolean isInterface)
JCTree methodDeclaratorRest(int pos, JCTree.JCModifiers mods, JCTree.JCExpression type, Name name, List<JCTree.JCTypeParameter> typarams, boolean isInterface, boolean isVoid, java.lang.String dc)
List<JCTree.JCExpression> qualidentList()
List<JCTree.JCTypeParameter> typeParametersOpt()
JCTree.JCTypeParameter typeParameter()
List<JCTree.JCVariableDecl> formalParameters()
JCTree.JCModifiers optFinal(long flags)
JCTree.JCVariableDecl formalParameter()
protected JCTree.JCExpression checkExprStat(JCTree.JCExpression t)
static int prec(Token token)
static int optag(Token token)
static int unoptag(Token token)
static int typetag(Token token)
void checkGenerics()
void checkVarargs()
void checkForeach()
void checkStaticImports()
void checkAnnotations()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |