Top Description Fields Constructors Methods
com.github.javaparser

pack-priv abstract Class GeneratedJavaParserBase

extends Object
Class Inheritance
Known Direct Subclasses
com.github.javaparser.GeneratedJavaParser
Imports
com.github.javaparser.ast.ArrayCreationLevel, .Node, .NodeList, com.github.javaparser.ast.body.Parameter, com.github.javaparser.ast.comments.CommentsCollection, com.github.javaparser.ast.expr.*, com.github.javaparser.ast.stmt.Statement, com.github.javaparser.ast.type.ArrayType, .Type, .UnknownType, com.github.javaparser.utils.Pair, java.util.*

Base class for GeneratedJavaParser

Field Summary

Modifier and TypeField and Description
pack-priv List<Problem>
pack-priv boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv <T extends Node> NodeList<T>
add(NodeList<T> list, T obj)

Add obj to list and return it.

pack-priv <T> List<T>
add(List<T> list, T obj)

Add obj to list

pack-priv void
addProblem(String message)

pack-priv <T extends Node> NodeList<T>
addWhenNotNull(NodeList<T> list, T obj)

Add obj to list only when list is not null

pack-priv <T extends Node> NodeList<T>
emptyList()

Quickly create a new NodeList

pack-priv Expression
generateLambda(Expression ret, Statement lambdaBody)

Workaround for rather complex ambiguity that lambda's create

pack-priv CommentsCollection
pack-priv abstract Token
public List<JavaToken>

Returns:

a list of tokens
getTokens
()

Return the list of JavaParser specific tokens that have been encountered while parsing code using this parser.

pack-priv abstract GeneratedJavaParserTokenManager
pack-priv ArrayCreationExpr
juggleArrayCreation(TokenRange range, List<TokenRange> levelRanges, Type type, NodeList<Expression> dimensions, List<NodeList<AnnotationExpr>> arrayAnnotations, ArrayInitializerExpr arrayInitializerExpr)

Throws together an ArrayCreationExpr from a lot of pieces

pack-priv Type
juggleArrayType(Type partialType, List<ArrayType.ArrayBracketPair> additionalBrackets)

Throws together a Type, taking care of all the array brackets

private String
makeMessageForParseException(ParseException exception)

This is the code from ParseException.initialise, modified to be more horizontal.

pack-priv JavaToken
nodeListBegin(NodeList<?> l)

Get the token that starts the NodeList l

pack-priv JavaToken

Returns:

secondChoice if firstChoice is JavaToken.UNKNOWN, otherwise firstChoice
orIfInvalid
(JavaToken firstChoice, JavaToken secondChoice)

pack-priv JavaToken

Returns:

the begin-token secondChoice if firstChoice is JavaToken.UNKNOWN, otherwise firstChoice
orIfInvalid
(JavaToken firstChoice, Node secondChoice)

pack-priv <T extends Node> NodeList<T>
prepend(NodeList<T> list, T obj)

Add obj to list at position pos

private void
propagateRangeGrowthOnRight(Node node, Node endNode)

Propagate expansion of the range on the right to the parent.

pack-priv TokenRange
range(JavaToken begin, JavaToken end)

Return a TokenRange spanning from begin to end

pack-priv TokenRange
range(Node begin, JavaToken end)

Return a TokenRange spanning from begin to end

pack-priv TokenRange
range(JavaToken begin, Node end)

Return a TokenRange spanning from begin to end

pack-priv TokenRange
range(Node begin, Node end)

Return a TokenRange spanning from begin to end

pack-priv TokenRange
recover(int recoveryTokenType, ParseException p)

pack-priv abstract void
ReInit(Provider provider)

pack-priv void
reset(Provider provider)

pack-priv Name
scopeToName(Expression scope)

Converts a NameExpr or a FieldAccessExpr scope to a Name.

pack-priv void
setStoreTokens(boolean storeTokens)

pack-priv void
setTokenKind(int newKind)

pack-priv void
pack-priv abstract JavaToken
pack-priv TokenRange
pack-priv String
pack-priv String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

problemsback to summary
pack-priv List<Problem> problems
storeTokensback to summary
pack-priv boolean storeTokens

Constructor Detail

GeneratedJavaParserBaseback to summary
pack-priv GeneratedJavaParserBase()

Method Detail

addback to summary
pack-priv <T extends Node> NodeList<T> add(NodeList<T> list, T obj)

Add obj to list and return it. Create a new list if list is null

addback to summary
pack-priv <T> List<T> add(List<T> list, T obj)

Add obj to list

addProblemback to summary
pack-priv void addProblem(String message)
addWhenNotNullback to summary
pack-priv <T extends Node> NodeList<T> addWhenNotNull(NodeList<T> list, T obj)

Add obj to list only when list is not null

emptyListback to summary
pack-priv <T extends Node> NodeList<T> emptyList()

Quickly create a new NodeList

generateLambdaback to summary
pack-priv Expression generateLambda(Expression ret, Statement lambdaBody)

Workaround for rather complex ambiguity that lambda's create

getCommentsCollectionback to summary
pack-priv CommentsCollection getCommentsCollection()
getNextTokenback to summary
pack-priv abstract Token getNextToken()
getTokensback to summary
public List<JavaToken> getTokens()

Return the list of JavaParser specific tokens that have been encountered while parsing code using this parser.

Returns:List<JavaToken>

a list of tokens

getTokenSourceback to summary
pack-priv abstract GeneratedJavaParserTokenManager getTokenSource()
juggleArrayCreationback to summary
pack-priv ArrayCreationExpr juggleArrayCreation(TokenRange range, List<TokenRange> levelRanges, Type type, NodeList<Expression> dimensions, List<NodeList<AnnotationExpr>> arrayAnnotations, ArrayInitializerExpr arrayInitializerExpr)

Throws together an ArrayCreationExpr from a lot of pieces

juggleArrayTypeback to summary
pack-priv Type juggleArrayType(Type partialType, List<ArrayType.ArrayBracketPair> additionalBrackets)

Throws together a Type, taking care of all the array brackets

makeMessageForParseExceptionback to summary
private String makeMessageForParseException(ParseException exception)

This is the code from ParseException.initialise, modified to be more horizontal.

nodeListBeginback to summary
pack-priv JavaToken nodeListBegin(NodeList<?> l)

Get the token that starts the NodeList l

orIfInvalidback to summary
pack-priv JavaToken orIfInvalid(JavaToken firstChoice, JavaToken secondChoice)
Returns:JavaToken

secondChoice if firstChoice is JavaToken.UNKNOWN, otherwise firstChoice

orIfInvalidback to summary
pack-priv JavaToken orIfInvalid(JavaToken firstChoice, Node secondChoice)
Returns:JavaToken

the begin-token secondChoice if firstChoice is JavaToken.UNKNOWN, otherwise firstChoice

prependback to summary
pack-priv <T extends Node> NodeList<T> prepend(NodeList<T> list, T obj)

Add obj to list at position pos

propagateRangeGrowthOnRightback to summary
private void propagateRangeGrowthOnRight(Node node, Node endNode)

Propagate expansion of the range on the right to the parent. This is necessary when the right border of the child is determining the right border of the parent (i.e., the child is the last element of the parent). In this case when we "enlarge" the child we should enlarge also the parent.

rangeback to summary
pack-priv TokenRange range(JavaToken begin, JavaToken end)

Return a TokenRange spanning from begin to end

rangeback to summary
pack-priv TokenRange range(Node begin, JavaToken end)

Return a TokenRange spanning from begin to end

rangeback to summary
pack-priv TokenRange range(JavaToken begin, Node end)

Return a TokenRange spanning from begin to end

rangeback to summary
pack-priv TokenRange range(Node begin, Node end)

Return a TokenRange spanning from begin to end

recoverback to summary
pack-priv TokenRange recover(int recoveryTokenType, ParseException p)
ReInitback to summary
pack-priv abstract void ReInit(Provider provider)
resetback to summary
pack-priv void reset(Provider provider)
scopeToNameback to summary
pack-priv Name scopeToName(Expression scope)

Converts a NameExpr or a FieldAccessExpr scope to a Name.

setStoreTokensback to summary
pack-priv void setStoreTokens(boolean storeTokens)
setTokenKindback to summary
pack-priv void setTokenKind(int newKind)
setYieldSupportedback to summary
pack-priv void setYieldSupported()
tokenback to summary
pack-priv abstract JavaToken token()
tokenRangeback to summary
pack-priv TokenRange tokenRange()
unquoteback to summary
pack-priv String unquote(String s)
unTripleQuoteback to summary
pack-priv String unTripleQuote(String s)