Package com.github.javaparser
Class GeneratedJavaParserBase
java.lang.Object
com.github.javaparser.GeneratedJavaParserBase
- Direct Known Subclasses:
GeneratedJavaParser
Base class for
GeneratedJavaParser
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd obj to list and return it.(package private) <T> List
<T> Add obj to list(package private) void
addProblem
(String message) addWhenNotNull
(NodeList<T> list, T obj) Add obj to list only when list is not nullQuickly create a new, empty, NodeList(package private) Expression
generateLambda
(Expression ret, Statement lambdaBody) Workaround for rather complex ambiguity that lambda's create(package private) CommentsCollection
(package private) abstract Token
(package private) abstract Token
getToken
(int index) Return the list of JavaParser specific tokens that have been encountered while parsing code using this parser.(package private) abstract GeneratedJavaParserTokenManager
(package private) 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(package private) Type
juggleArrayType
(Type partialType, List<ArrayType.ArrayBracketPair> additionalBrackets) Throws together a Type, taking care of all the array bracketsprivate String
makeMessageForParseException
(ParseException exception) This is the code from ParseException.initialise, modified to be more horizontal.(package private) JavaToken
nodeListBegin
(NodeList<?> l) Get the token that starts the NodeList l(package private) JavaToken
orIfInvalid
(JavaToken firstChoice, Node secondChoice) (package private) JavaToken
orIfInvalid
(JavaToken firstChoice, JavaToken secondChoice) Add obj to list at position posprivate void
propagateRangeGrowthOnRight
(Node node, Node endNode) Propagate expansion of the range on the right to the parent.(package private) TokenRange
Return a TokenRange spanning from begin to end(package private) TokenRange
Return a TokenRange spanning from begin to end(package private) TokenRange
Return a TokenRange spanning from begin to end(package private) TokenRange
Return a TokenRange spanning from begin to end(package private) TokenRange
recover
(int recoveryTokenType, ParseException p) (package private) TokenRange
recoverStatement
(int recoveryTokenType, int lBraceType, int rBraceType, ParseException p) (package private) abstract void
(package private) void
(package private) Name
scopeToName
(Expression scope) Converts a NameExpr or a FieldAccessExpr scope to a Name.(package private) void
setStoreTokens
(boolean storeTokens) (package private) void
setTokenKind
(int newKind) (package private) void
(package private) abstract JavaToken
token()
(package private) TokenRange
(package private) String
(package private) String
-
Field Details
-
problems
-
storeTokens
boolean storeTokens
-
-
Constructor Details
-
GeneratedJavaParserBase
GeneratedJavaParserBase()
-
-
Method Details
-
getTokenSource
-
ReInit
-
token
-
getNextToken
-
getToken
-
reset
-
getTokens
Return the list of JavaParser specific tokens that have been encountered while parsing code using this parser.- Returns:
- a list of tokens
-
getCommentsCollection
CommentsCollection getCommentsCollection() -
addProblem
-
tokenRange
TokenRange tokenRange() -
range
Return a TokenRange spanning from begin to end -
range
Return a TokenRange spanning from begin to end -
range
Return a TokenRange spanning from begin to end -
range
Return a TokenRange spanning from begin to end -
orIfInvalid
- Returns:
- secondChoice if firstChoice is JavaToken.UNKNOWN, otherwise firstChoice
-
orIfInvalid
- Returns:
- the begin-token secondChoice if firstChoice is JavaToken.UNKNOWN, otherwise firstChoice
-
nodeListBegin
Get the token that starts the NodeList l -
setTokenKind
void setTokenKind(int newKind) -
setStoreTokens
void setStoreTokens(boolean storeTokens) -
recover
-
recoverStatement
TokenRange recoverStatement(int recoveryTokenType, int lBraceType, int rBraceType, ParseException p) -
emptyNodeList
Quickly create a new, empty, NodeList -
add
Add obj to list and return it. Create a new list if list is null -
addWhenNotNull
Add obj to list only when list is not null -
prepend
Add obj to list at position pos -
add
Add obj to list -
propagateRangeGrowthOnRight
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. -
generateLambda
Workaround for rather complex ambiguity that lambda's create -
juggleArrayCreation
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 -
juggleArrayType
Throws together a Type, taking care of all the array brackets -
makeMessageForParseException
This is the code from ParseException.initialise, modified to be more horizontal. -
scopeToName
Converts a NameExpr or a FieldAccessExpr scope to a Name. -
unquote
-
unTripleQuote
-
setYieldSupported
void setYieldSupported()
-