APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.tools.javac.parser

public Class JavacParser

extends Object
implements Parser
Class Inheritance
All Implemented Interfaces
com.sun.tools.javac.parser.Parser
Known Direct Subclasses
com.sun.tools.javac.parser.VirtualParser
Imports
java.util.*, java.util.function.Function, .Predicate, java.util.stream.Collectors, javax.lang.model.SourceVersion, com.sun.source.tree.CaseTree, .MemberReferenceTree.ReferenceMode, .ModuleTree.ModuleKind, com.sun.tools.javac.code.*, .Source.Feature, com.sun.tools.javac.file.PathFileObject, com.sun.tools.javac.parser.Tokens.*, .VirtualParser.VirtualScanner, com.sun.tools.javac.resources.CompilerProperties.Errors, .CompilerProperties.Fragments, .CompilerProperties.LintWarnings, .CompilerProperties.Warnings, com.sun.tools.javac.tree.*, com.sun.tools.javac.tree.JCTree.*, com.sun.tools.javac.util.*, .JCDiagnostic.DiagnosticFlag, .JCDiagnostic.Error, .JCDiagnostic.Fragment, .List, .JCDiagnostic.SimpleDiagnosticPosition

The parser maps a token sequence into an abstract syntax tree. The parser is a hand-written recursive-descent parser that implements the grammar described in the Java Language Specification. For efficiency reasons, an operator precedence scheme is used for parsing binary operation expressions.

This is NOT part of any supported API. 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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum
private static enum
pack-priv static interface
pack-priv class
pack-priv static enum
pack-priv static enum
private static enum

Field Summary

Modifier and TypeField and Description
pack-priv boolean
allowRecords

Switch: are records allowed in this source level?

pack-priv boolean
allowSealedTypes

Switch: are sealed types allowed in this source level?

pack-priv boolean
allowStringFolding

Switch: should we fold strings?

pack-priv boolean
allowThisIdent

Switch: is "this" allowed as an identifier?

pack-priv boolean
allowYieldStatement

Switch: is yield statement allowed in this source level?

private int
protected Map<Tokens.Comment, List<Tokens.Comment>>
danglingComments

A map associating "other nearby documentation comments" with the preferred documentation comment for a declaration.

private static final JCDiagnostic.Fragment[][]
private final DocCommentTable
docComments

A table to store all documentation comments indexed by the tree nodes they refer to.

protected int
private int
private JCTree.JCErroneous
protected static final int
EXPR

When terms are parsed, the mode determines which is expected: mode = EXPR : an expression mode = TYPE : a type mode = NOLAMBDA : lambdas are not allowed

protected TreeMaker
F

The factory to be used for abstract syntax tree construction.

private static final int
infixPrecedenceLevels

The number of precedence levels of infix operators.

pack-priv boolean
keepDocComments

Switch: should we keep docComments?

pack-priv boolean
keepLineMap

Switch: should we keep line table?

protected int
lastmode

The mode of the term that was parsed last.

protected Predicate<Tokens.TokenKind>
LAX_IDENTIFIER

Accepts all identifier-like tokens

private Log
log

The log to be used for error diagnostics.

protected int
mode

The current mode.

private Names
names

The name table.

protected static final int
pack-priv ArrayList<JCTree.JCExpression[]>
odStackSupply

optimization: To save allocating a new operand/operator stack for every binary operation, we use supplys.

pack-priv ArrayList<Tokens.Token[]>
private final boolean
parseModuleInfo

Is the parser instantiated to parse a module-info file ?

private boolean
permitTypeAnnotationsPushBack

If the parser notices extra annotations, then it either immediately issues an error (if this variable is false) or places the extra annotations in variable typeAnnotationsPushedBack (if this variable is true).

private Preview
preview

The Preview language setting.

pack-priv JCTree.JCVariableDecl
receiverParam

The type of the method receiver, as specified by a first "this" parameter.

private static final int
protected Lexer
S

The scanner used for lexical analysis.

private Source
source

The Source language setting.

protected Tokens.Token
protected static final int
private List<JCTree.JCAnnotation>
typeAnnotationsPushedBack

Type annotations that have already been read but have not yet been used.

private JCDiagnostic.Error

Constructor Summary

AccessConstructor and Description
protected
JavacParser(ParserFactory fac, Lexer S, boolean keepDocComments, boolean keepLineMap)

Construct a parser from a given scanner, tree factory and log.

protected
JavacParser(ParserFactory fac, Lexer S, boolean keepDocComments, boolean keepLineMap, boolean parseModuleInfo)

Construct a parser from a given scanner, tree factory and log.

protected
JavacParser(JavacParser parser, Lexer S)

Construct a parser from an existing parser, with minimal overhead.

Method Summary

Modifier and TypeMethod and Description
public void
accept(Tokens.TokenKind tk)

If next input token matches given token, skip it, otherwise report an error.

public void
accept(Tokens.TokenKind tk, Function<Tokens.TokenKind, JCDiagnostic.Error> errorProvider)

If next input token matches given token, skip it, otherwise report an error.

private boolean
allowedAfterSealedOrNonSealed(Tokens.Token next, boolean local, boolean currentIsNonSealed)

pack-priv JavacParser.ParensResult
analyzeParens()

If we see an identifier followed by a '<' it could be an unbound method reference or a binary expression.

pack-priv JavacParser.PatternResult
analyzePattern(int lookahead)

pack-priv JCTree.JCAnnotation
annotation(int
position of "@" token
pos
,
JCTree.Tag
Whether to parse an ANNOTATION or TYPE_ANNOTATION
kind
)

Annotation = "@" Qualident [ "(" AnnotationFieldValues ")" ]

pack-priv JCTree.JCExpression
annotationFieldValue()

AnnotationFieldValue = AnnotationValue | Identifier "=" AnnotationValue

pack-priv List<JCTree.JCExpression>
annotationFieldValues()

AnnotationFieldValues = "(" [ AnnotationFieldValue { "," AnnotationFieldValue } ] ")"

pack-priv List<JCTree.JCExpression>
protected List<JCTree.JCAnnotation>
annotationsOpt(JCTree.Tag
Whether to parse an ANNOTATION or TYPE_ANNOTATION
kind
)

AnnotationsOpt = { '@' Annotation }

pack-priv JCTree.JCExpression
pack-priv List<JCTree.JCExpression>
arguments()

Arguments = "(" [Expression { COMMA Expression }] ")"

pack-priv JCTree.JCExpression
pack-priv JCTree.JCExpression
argumentsOpt(List<JCTree.JCExpression> typeArgs, JCTree.JCExpression t)

ArgumentsOpt = [ Arguments ]

pack-priv JCTree.JCExpression
arrayCreatorRest(int newpos, JCTree.JCExpression elemtype)

ArrayCreatorRest = [Annotations] "[" ( "]" BracketsOpt ArrayInitializer | Expression "]" {[Annotations] "[" Expression "]"} BracketsOpt )

pack-priv JCTree.JCExpression
arrayInitializer(int newpos, JCTree.JCExpression t)

ArrayInitializer = "{" [VariableInitializer {"," VariableInitializer}] [","] "}"

pack-priv List<JCTree.JCExpression>
protected <T extends JCTree> T

Returns:

tree
attach
(T
The tree to be used as index in the hashtable
tree
,
Tokens.Comment
The doc comment to associate with the tree, or null.
dc
)

Make an entry into docComments hashtable, provided flag keepDocComments is set and given doc comment is non-null.

pack-priv JCTree.JCPrimitiveTypeTree
basicType()

BasicType = BYTE | SHORT | CHAR | INT | LONG | FLOAT | DOUBLE | BOOLEAN

pack-priv JCTree.JCBlock
block(int pos, long flags)

Block = "{" BlockStatements "}"

public JCTree.JCBlock
pack-priv List<JCTree.JCStatement>
blockStatement()

This method parses a statement appearing inside a block.

pack-priv List<JCTree.JCStatement>
blockStatements()

BlockStatements = { BlockStatement } BlockStatement = LocalVariableDeclarationStatement | ClassOrInterfaceOrEnumDeclaration | [Ident ":"] Statement LocalVariableDeclarationStatement = { FINAL | '@' Annotation } Type VariableDeclarators ";"

private JCTree.JCExpression
bracketsOpt(JCTree.JCExpression t, List<JCTree.JCAnnotation> annotations)

BracketsOpt = { [Annotations] "[" "]" }*

annotations is the list of annotations targeting the expression t.

private JCTree.JCExpression
bracketsOpt(JCTree.JCExpression t)

BracketsOpt = [ "[" "]" { [Annotations] "[" "]"} ]

private JCTree.JCExpression
pack-priv JCTree.JCExpression
bracketsSuffix(JCTree.JCExpression t)

BracketsSuffixExpr = "." CLASS BracketsSuffixType =

protected JCTree.JCCatch
catchClause()

CatchClause = CATCH "(" FormalParameter ")" Block

Todo

the "FormalParameter" is not correct, it uses the special "catchTypes" rule below.

pack-priv List<JCTree.JCExpression>
protected JCTree.JCExpression
checkExprStat(JCTree.JCExpression t)

Check that given tree is a legal expression statement.

protected void
checkNoMods(long mods)

Diagnose a modifier flag from the set, if any.

protected void
checkNoMods(int pos, long mods)

pack-priv void
protected void
checkSourceLevel(int pos, Source.Feature feature)

pack-priv JCTree.JCNewClass
classCreatorRest(int newpos, JCTree.JCExpression encl, List<JCTree.JCExpression> typeArgs, JCTree.JCExpression t)

ClassCreatorRest = Arguments [ClassBody]

protected JCTree.JCClassDecl
classDeclaration(JCTree.JCModifiers
The modifiers starting the class declaration
mods
,
Tokens.Comment
The documentation comment for the class, or null.
dc
)

ClassDeclaration = CLASS Ident TypeParametersOpt [EXTENDS Type] [IMPLEMENTS TypeList] ClassBody

pack-priv List<JCTree>
classInterfaceOrRecordBody(Name className, boolean isInterface, boolean isRecord)

ClassBody = "{" {ClassBodyDeclaration} "}" InterfaceBody = "{" {InterfaceBodyDeclaration} "}"

protected List<JCTree>
classOrInterfaceOrRecordBodyDeclaration(JCTree.JCModifiers mods, Name className, boolean isInterface, boolean isRecord)

ClassBodyDeclaration = ";" | [STATIC] Block | ModifiersOpt ( Type Ident ( VariableDeclaratorsRest ";" | MethodDeclaratorRest ) | VOID Ident VoidMethodDeclaratorRest | TypeParameters [Annotations] ( Type Ident MethodDeclaratorRest | VOID Ident VoidMethodDeclaratorRest ) | Ident ConstructorDeclaratorRest | TypeParameters Ident ConstructorDeclaratorRest | ClassOrInterfaceOrEnumDeclaration ) InterfaceBodyDeclaration = ";" | ModifiersOpt ( Type Ident ( ConstantDeclaratorsRest ";" | MethodDeclaratorRest ) | VOID Ident MethodDeclaratorRest | TypeParameters [Annotations] ( Type Ident MethodDeclaratorRest | VOID Ident VoidMethodDeclaratorRest ) | ClassOrInterfaceOrEnumDeclaration )

protected JCTree.JCStatement
classOrRecordOrInterfaceOrEnumDeclaration(JCTree.JCModifiers
Any modifiers starting the class or interface declaration
mods
,
Tokens.Comment
The documentation comment for the class, or null.
dc
)

ClassOrInterfaceOrEnumDeclaration = ModifiersOpt (ClassDeclaration | InterfaceDeclaration | EnumDeclaration)

private List<JCTree>
constructImplicitClass(List<JCTree> origDefs, int endPos)

private List<JCTree>
constructorOrMethodOrFieldDeclaration(JCTree.JCModifiers mods, Name className, boolean isInterface, boolean isRecord, Tokens.Comment dc)

pack-priv JCTree.JCExpression
creator(int newpos, List<JCTree.JCExpression> typeArgs)

Creator = [Annotations] Qualident [TypeArguments] ( ArrayCreatorRest | ClassCreatorRest )

private JCTree.JCStatement
pack-priv static int
earlier(int pos1, int pos2)

Return the lesser of two positions, making allowance for either one being unset.

pack-priv List<JCTree>
enumBody(Name enumName)

EnumBody = "{" { EnumeratorDeclarationList } [","] [ ";" {ClassBodyDeclaration} ] "}"

protected JCTree.JCClassDecl
enumDeclaration(JCTree.JCModifiers
The modifiers starting the enum declaration
mods
,
Tokens.Comment
The documentation comment for the enum, or null.
dc
)

EnumDeclaration = ENUM Ident [IMPLEMENTS TypeList] EnumBody

pack-priv JCTree
enumeratorDeclaration(Name enumName)

EnumeratorDeclaration = AnnotationsOpt [TypeArguments] IDENTIFIER [ Arguments ] [ "{" ClassBody "}" ]

private JavacParser.EnumeratorEstimate
private boolean
protected JCTree.JCExpression
foldStrings(JCTree.JCExpression tree)

If tree is a concatenation of string literals, replace it by a single literal representing the concatenated string.

pack-priv List<JCTree.JCStatement>
forInit()

ForInit = StatementExpression MoreStatementExpressions | { FINAL | '@' Annotation } Type VariableDeclarators

protected JCTree.JCVariableDecl
formalParameter(boolean lambdaParameter, boolean recordComponent)

FormalParameter = { FINAL | '@' Annotation } Type VariableDeclaratorId LastFormalParameter = { FINAL | '@' Annotation } Type '...' Ident | FormalParameter

pack-priv List<JCTree.JCVariableDecl>
formalParameters()

FormalParameters = "(" [ FormalParameterList ] ")" FormalParameterList = [ FormalParameterListNovarargs , ] LastFormalParameter FormalParameterListNovarargs = [ FormalParameterListNovarargs , ] FormalParameter

pack-priv List<JCTree.JCVariableDecl>
formalParameters(boolean lambdaParameters, boolean recordComponents)

pack-priv List<JCTree.JCExpressionStatement>
forUpdate()

ForUpdate = StatementExpression MoreStatementExpressions

public int
getEndPos(JCTree
The tree node
tree
)

Get the end position for a tree node.

public int
getStartPos(JCTree
The tree node
tree
)

Get the start position for a tree node.

public Name
ident()

Ident = IDENTIFIER

protected Name
ident(boolean allowClass)

protected Name
ident(boolean allowClass, boolean asVariable)

public Name
private void
ignoreDanglingComments()

Ignores any recent documentation comments found by the scanner, such as those that cannot be associated with a nearby declaration.

pack-priv JCTree.JCExpression
illegal(int pos)

Report an illegal start of expression/type error at given position.

pack-priv JCTree.JCExpression
illegal()

Report an illegal start of expression/type error at current position.

protected JCTree.JCVariableDecl
pack-priv List<JCTree.JCVariableDecl>
implicitParameters(boolean hasParens)

protected JCTree
importDeclaration()

ImportDeclaration = IMPORT [ STATIC ] Ident { "." Ident } [ "." "*" ] ";"

pack-priv JCTree.JCExpression
innerCreator(int newpos, List<JCTree.JCExpression> typeArgs, JCTree.JCExpression encl)

InnerCreator = [Annotations] Ident [TypeArguments] ClassCreatorRest

private JCTree.JCExpression
insertAnnotationsToMostInner(JCTree.JCExpression type, List<JCTree.JCAnnotation> annos, boolean createNewLevel)

Inserts the annotations (and possibly a new array level) to the left-most type in an array or nested type.

protected JCTree.JCClassDecl
interfaceDeclaration(JCTree.JCModifiers
The modifiers starting the interface declaration
mods
,
Tokens.Comment
The documentation comment for the interface, or null.
dc
)

InterfaceDeclaration = INTERFACE Ident TypeParametersOpt [EXTENDS TypeList] InterfaceBody

protected boolean
private boolean
isDeclaration(boolean allowRecords)

private boolean

Returns:

true if and only if the current token is definitelly a token that starts a statement.
isDefiniteStatementStartToken
()

Returns true if and only if the current token is definitelly a token that starts a statement.

pack-priv boolean
protected boolean
isMode(int mode)

protected boolean
isNonSealedClassStart(boolean local)

protected boolean
isNonSealedIdentifier(Tokens.Token someToken, int lookAheadOffset)

protected boolean
protected boolean
isSealedClassStart(boolean local)

pack-priv boolean
isUnboundMemberRef()

If we see an identifier followed by a '<' it could be an unbound method reference or a binary expression.

pack-priv boolean
pack-priv JCTree.JCExpression
pack-priv JCTree.JCExpression
lambdaExpressionOrStatement(boolean hasParens, boolean explicitParams, int pos)

pack-priv JCTree.JCExpression
pack-priv JCTree.JCExpression
lambdaStatement(List<JCTree.JCVariableDecl> args, int pos, int pos2)

pack-priv JCTree.JCExpression
literal(Name prefix)

pack-priv JCTree.JCExpression
literal(Name prefix, int pos)

Literal = INTLITERAL | LONGLITERAL | FLOATLITERAL | DOUBLELITERAL | CHARLITERAL | STRINGLITERAL | TRUE | FALSE | NULL

private List<JCTree.JCStatement>
pack-priv JCTree.JCExpression
memberReferenceSuffix(JCTree.JCExpression t)

MemberReferenceSuffix = "::" [TypeArguments] Ident | "::" [TypeArguments] "new"

pack-priv JCTree.JCExpression
pack-priv boolean
protected JCTree
methodDeclaratorRest(int pos, JCTree.JCModifiers mods, JCTree.JCExpression type, Name name, List<JCTree.JCTypeParameter> typarams, boolean isInterface, boolean isVoid, boolean isRecord, Tokens.Comment dc)

MethodDeclaratorRest = FormalParameters BracketsOpt [THROWS TypeList] ( MethodBody | [DEFAULT AnnotationValue] ";") VoidMethodDeclaratorRest = FormalParameters [THROWS TypeList] ( MethodBody | ";") ConstructorDeclaratorRest = "(" FormalParameterListOpt ")" [THROWS TypeList] MethodBody

protected JCTree.JCModifiers
modifiersOpt()

ModifiersOpt = { Modifier } Modifier = PUBLIC | PROTECTED | PRIVATE | STATIC | ABSTRACT | FINAL | NATIVE | SYNCHRONIZED | TRANSIENT | VOLATILE | "@" | "@" Annotation

protected JCTree.JCModifiers
pack-priv JCTree.JCModuleDecl
pack-priv List<JCTree.JCDirective>
pack-priv <T extends ListBuffer<? super JCTree.JCExpressionStatement>> T
moreStatementExpressions(int pos, JCTree.JCExpression first, T stats)

MoreStatementExpressions = { COMMA StatementExpression }

protected DocCommentTable
newDocCommentTable(boolean keepDocComments, ParserFactory fac)

private JCTree.JCExpression[]
private Tokens.Token[]
public void
private boolean

Returns:

true if and only if the following code should be parsed as a block.
openingBraceMissing
(boolean
whether there was a serious problem in the parameters list
unclosedParameterList
)

After seeing a method header, and not seeing an opening left brace, attempt to estimate if acting as if the left brace was present and parsing the upcoming code will get better results than not parsing the code as a block.

pack-priv static JCTree.Tag
optag(Tokens.TokenKind token)

Return operation tag of binary operator represented by token, No_TAG if token is not a binary operator.

pack-priv JCTree.JCModifiers
optFinal(long flags)

pack-priv JCTree.JCExpression
parExpression()

ParExpression = "(" Expression ")"

private JCTree.JCCaseLabel
parseCaseLabel(boolean allowDefault)

public JCTree.JCCompilationUnit
parseCompilationUnit()

Implements com.sun.tools.javac.parser.Parser.parseCompilationUnit.

CompilationUnit = [ { "@" Annotation } PACKAGE Qualident ";"] {ImportDeclaration} {TypeDeclaration}

public JCTree.JCExpression
parseExpression()

Implements com.sun.tools.javac.parser.Parser.parseExpression.

terms can be either expressions or types.

private JCTree.JCExpression
protected JCTree.JCExpression
public JCTree.JCPattern
parsePattern(int pos, JCTree.JCModifiers mods, JCTree.JCExpression parsedType, boolean allowVar, boolean checkGuard)

parses patterns.

public JCTree.JCStatement
parseSimpleStatement()

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 ) | TRY "(" ResourceSpecification ";"opt ")" Block [Catches] [FinallyPart] | SWITCH ParExpression "{" SwitchBlockStatementGroups "}" | SYNCHRONIZED ParExpression Block | RETURN [Expression] ";" | THROW Expression ";" | BREAK [Ident] ";" | CONTINUE [Ident] ";" | ASSERT Expression [ ":" Expression ] ";" | ";"

public JCTree.JCStatement
pack-priv JCTree.JCStatement
public JCTree.JCExpression
parseType()

Implements com.sun.tools.javac.parser.Parser.parseType.

parses (optional) type annotations followed by a type.

public JCTree.JCExpression
parseType(boolean allowVar)

public JCTree.JCExpression
parseType(boolean allowVar, List<JCTree.JCAnnotation> annotations)

protected boolean
protected boolean
peekToken(int lookahead, Predicate<Tokens.TokenKind> tk)

protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
peekToken(int lookahead, Predicate<Tokens.TokenKind>... kinds)

pack-priv List<JCTree.JCExpression>
permitsClause(JCTree.JCModifiers mods, String classOrInterface)

pack-priv static int
prec(Tokens.TokenKind token)

Return precedence of operator represented by token, -1 if token is not a binary operator.

public JCTree.JCExpression
qualident(boolean allowAnnos)

Qualident = Ident { DOT [Annotations] Ident }

pack-priv List<JCTree.JCExpression>
qualidentList(boolean allowAnnos)

QualidentList = [Annotations] Qualident {"," [Annotations] Qualident}

protected JCTree.JCClassDecl
pack-priv JCTree.JCExpression
pack-priv void
reportDanglingComments(JCTree
the tree node for the declaration
tree
,
Tokens.Comment
the primary comment for the declaration
dc
)

Reports all dangling comments associated with the primary comment for a declaration against the position of the tree node for a declaration.

pack-priv void
reportDanglingDocComment(JCTree tree, Tokens.Comment
the comment
c
)

Reports an individual dangling comment as a warning to the log.

pack-priv void
protected void
reportSyntaxError(int pos, JCDiagnostic.Error errorKey)

Report a syntax using the given the position parameter and arguments, unless one was already reported at the same position.

protected void
reportSyntaxError(JCDiagnostic.DiagnosticPosition diagPos, JCDiagnostic.Error errorKey)

Report a syntax error using the given DiagnosticPosition object and arguments, unless one was already reported at the same position.

private void
reportSyntaxError(JCDiagnostic.DiagnosticPosition diagPos, JCDiagnostic.Error errorKey, boolean noEofError)

protected JCTree
resource()

Resource = VariableModifiersOpt Type VariableDeclaratorId "=" Expression | Expression

pack-priv List<JCTree>
resources()

Resources = Resource { ";" Resources }

pack-priv Name
restrictedTypeName(JCTree.JCExpression e, boolean shouldWarn)

pack-priv Source
restrictedTypeNameStartingAtSource(Name name, int pos, boolean shouldWarn)

private void
saveDanglingDocComments(Tokens.Comment
the primary documentation comment
dc
)

Record nearby documentation comments against the primary documentation comment for a declaration.

protected void
protected void
protected void
setErrorEndPos(int errPos)

protected void
setLastMode(int mode)

protected void
setMode(int mode)

private boolean
shebang(Tokens.Comment c, JCDiagnostic.DiagnosticPosition pos)

Returns true for a comment that acts similarly to shebang in UNIX

protected void
skip(boolean stopAtImport, boolean stopAtMemberDecl, boolean stopAtIdentifier, boolean stopAtStatement)

Skip forward until a suitable stop token is found.

private int
skipAnnotation(int lookahead)

protected <T extends JCTree> T

Returns:

tree
storeEnd
(T
tree node
tree
,
int
the ending position to associate with tree
endpos
)

Store ending position for a tree, the value of which is the greater of errorEndPos and the given ending position.

private JCTree.JCLiteral
pack-priv String
strval(Name prefix)

pack-priv JCTree.JCExpression
superSuffix(List<JCTree.JCExpression> typeArgs, JCTree.JCExpression t)

SuperSuffix = Arguments | "." [TypeArguments] Ident [Arguments]

protected List<JCTree.JCCase>
pack-priv List<JCTree.JCCase>
switchBlockStatementGroups()

SwitchBlockStatementGroups = { SwitchBlockStatementGroup } SwitchBlockStatementGroup = SwitchLabel BlockStatements SwitchLabel = CASE ConstantExpression ":" | DEFAULT ":"

private List<JCTree.JCCase>
protected JCTree.JCErroneous
syntaxError(int pos, JCDiagnostic.Error errorKey)

protected JCTree.JCErroneous
syntaxError(int pos, List<? extends JCTree> errs, JCDiagnostic.Error errorKey)

private JCTree.JCErroneous
syntaxError(int pos, List<? extends JCTree> errs, JCDiagnostic.Error errorKey, boolean noEofError)

protected JCTree.JCExpression
term(int newmode)

pack-priv JCTree.JCExpression
term()

Expression = Expression1 [ExpressionRest] ExpressionRest = [AssignmentOperator Expression1] AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "&=" | "|=" | "^=" | "%=" | "<<=" | ">>=" | ">>>=" Type = Type1 TypeNoParams = TypeNoParams1 StatementExpression = Expression ConstantExpression = Expression

pack-priv JCTree.JCExpression
term1()

Expression1 = Expression2 [Expression1Rest] Type1 = Type2 TypeNoParams1 = TypeNoParams2

pack-priv JCTree.JCExpression
term1Rest(JCTree.JCExpression t)

Expression1Rest = ["?" Expression ":" Expression1]

pack-priv JCTree.JCExpression
term2()

Expression2 = Expression3 [Expression2Rest] Type2 = Type3 TypeNoParams2 = TypeNoParams3

pack-priv JCTree.JCExpression
term2Rest(JCTree.JCExpression t, int minprec)

protected JCTree.JCExpression
term3()

Expression3 = PrefixOp Expression3 | "(" Expr | TypeNoParams ")" Expression3 | Primary {Selector} {PostfixOp} Primary = "(" Expression ")" | Literal | [TypeArguments] THIS [Arguments] | [TypeArguments] SUPER SuperSuffix | NEW [TypeArguments] Creator | "(" Arguments ")" "->" ( Expression | Block ) | Ident "->" ( Expression | Block ) | [Annotations] Ident { "." [Annotations] Ident } | Expression3 MemberReferenceSuffix [ [Annotations] "[" ( "]" 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]

pack-priv JCTree.JCExpression
pack-priv JCTree.JCExpression
protected <T extends JCTree> T
to(T
tree node
tree
)

Store current token's ending position for a tree, the value of which will be the greater of errorEndPos and the ending position of the current token.

public Tokens.Token
protected <T extends JCTree> T
toP(T
tree node
tree
)

Store current token's ending position for a tree, the value of which will be the greater of errorEndPos and the ending position of the previous token.

private List<JCTree>
pack-priv List<JCTree.JCAnnotation>
pack-priv JCTree.JCTypeApply
pack-priv JCTree.JCExpression
typeApplyOpt(JCTree.JCExpression t)

TypeArgumentsOpt = [ TypeArguments ]

pack-priv JCTree.JCTypeApply
pack-priv JCTree.JCExpression
typeArgument()

TypeArgument = Type | [Annotations] "?" | [Annotations] "?" EXTENDS Type {"&" Type} | [Annotations] "?" SUPER Type

pack-priv List<JCTree.JCExpression>
typeArguments()

TypeArguments = "<" TypeArgument {"," TypeArgument} ">"

pack-priv List<JCTree.JCExpression>
pack-priv List<JCTree.JCExpression>
typeArgumentsOpt(int useMode)

pack-priv JCTree
typeDeclaration(JCTree.JCModifiers mods, Tokens.Comment docComment)

TypeDeclaration = ClassOrInterfaceOrEnumDeclaration | ";"

pack-priv List<JCTree.JCExpression>
typeList()

TypeList = Type {"," Type}

pack-priv Name
pack-priv JCTree.JCTypeParameter
typeParameter()

TypeParameter = [Annotations] TypeVariable [TypeParameterBound] TypeParameterBound = EXTENDS Type {"&" Type} TypeVariable = Ident

protected List<JCTree.JCTypeParameter>
typeParametersOpt()

TypeParametersOpt = ["<" TypeParameter {"," TypeParameter} ">"]

protected List<JCTree.JCTypeParameter>
typeParametersOpt(boolean parseEmpty)

Parses a potentially empty type parameter list if needed with `allowEmpty`.

pack-priv static TypeTag
typetag(Tokens.TokenKind token)

Return type tag of basic type represented by token, NONE if token is not a basic type identifier.

public JCTree.JCExpression
unannotatedType(boolean allowVar)

public JCTree.JCExpression
unannotatedType(boolean allowVar, int newmode)

pack-priv static JCTree.Tag
unoptag(Tokens.TokenKind token)

Return operation tag of unary operator represented by token, No_TAG if token is not a binary operator.

private void
pack-priv JCTree.JCVariableDecl
variableDeclarator(JCTree.JCModifiers mods, JCTree.JCExpression type, boolean reqInit, Tokens.Comment dc, boolean localDecl)

VariableDeclarator = Ident VariableDeclaratorRest ConstantDeclarator = Ident ConstantDeclaratorRest

pack-priv JCTree.JCVariableDecl
variableDeclaratorId(JCTree.JCModifiers mods, JCTree.JCExpression type, boolean catchParameter, boolean lambdaParameter, boolean recordComponent)

VariableDeclaratorId = Ident BracketsOpt

pack-priv JCTree.JCVariableDecl
variableDeclaratorRest(int pos, JCTree.JCModifiers mods, JCTree.JCExpression type, Name name, boolean
Is an initializer always required?
reqInit
,
Tokens.Comment
The documentation comment for the variable declarations, or null.
dc
,
boolean localDecl, boolean compound)

VariableDeclaratorRest = BracketsOpt ["=" VariableInitializer] ConstantDeclaratorRest = BracketsOpt "=" VariableInitializer

public <T extends ListBuffer<? super JCTree.JCVariableDecl>> T
variableDeclarators(JCTree.JCModifiers mods, JCTree.JCExpression type, T vdefs, boolean localDecl)

VariableDeclarators = VariableDeclarator { "," VariableDeclarator }

protected <T extends ListBuffer<? super JCTree.JCVariableDecl>> T
variableDeclaratorsRest(int pos, JCTree.JCModifiers mods, JCTree.JCExpression type, Name name, boolean
Is an initializer always required?
reqInit
,
Tokens.Comment
The documentation comment for the variable declarations, or null.
dc
,
T vdefs, boolean localDecl)

VariableDeclaratorsRest = VariableDeclaratorRest { "," VariableDeclarator } ConstantDeclaratorsRest = ConstantDeclaratorRest { "," ConstantDeclarator }

public JCTree.JCExpression
variableInitializer()

VariableInitializer = ArrayInitializer | Expression

protected boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait