public class JavaShallowParser extends CStyleShallowParserBase
What this parser does and does not:
OPERATORS_WITH_ALTERNATIVE_REPRESENTATION
Constructor and Description |
---|
JavaShallowParser() |
Modifier and Type | Method and Description |
---|---|
protected void |
createCaseRule()
Case statement is parsed as meta, as it is hardly a statement on its own.
|
protected void |
createClassElementsRules()
Parser rules for both attributes and methods.
|
protected void |
createMetaRules()
Creates rules for meta elements.
|
protected void |
createSubExpressionRules()
Creates rules for dealing with constructs in subexpressions, such as
anonymous classes, lambdas, etc.
|
protected void |
createTypeRules()
Parser rules for module/namespace and type creation.
|
protected java.util.EnumSet<ETokenType> |
getSimpleBlockKeywordsWithoutParentheses()
Returns the set of all keywords that start a simple block but are never
followed by parentheses (see implementers for examples).
|
protected java.util.EnumSet<ETokenType> |
getSimpleBlockKeywordsWithParentheses()
Returns the set of all keywords that start a simple block with optional
parentheses (see implementers for examples).
|
protected java.util.EnumSet<ETokenType> |
getStatementStartTokens()
Returns a set of all tokens that can start a statement, besides a type (see
CStyleShallowParserBase.typePatternInState(EGenericParserStates...) and a literal. |
protected RecognizerBase<EGenericParserStates> |
getSubExpressionRecognizer()
Returns a recognizer used for detecting sub expressions (anonymous classes,
lambdas, etc.) within expressions.
|
protected java.util.EnumSet<ETokenType> |
getTypeKeywords()
Returns the set of keywords that start a type.
|
protected java.util.EnumSet<ETokenType> |
getTypeModifier()
Returns the valid type modifiers for the language.
|
protected RecognizerBase<EGenericParserStates> |
typePattern(RecognizerBase<EGenericParserStates> currentState)
Creates a recognizer that matches all valid types.
|
completeSimpleStatement, completeSimpleStatement, contributeSimpleStatementRules, createBasicBlockRules, createBlockRuleWithContinuation, createDoWhileRule, createElseIfRule, createLambdaWithArrowRules, createSimpleStatementRule, createStatementRules, createTypedefRules, getValidIdentifiers, skipOptionalParameters, typePatternInState
createRecognizer, endWithPossibleContinuation, filterTokens, inAnyState, inState, isFilteredToken, parse, parseFragment, parseTopLevel
public JavaShallowParser()
protected void createMetaRules()
createMetaRules
in class CStyleShallowParserBase
protected void createTypeRules()
CStyleShallowParserBase
createTypeRules
in class CStyleShallowParserBase
protected java.util.EnumSet<ETokenType> getTypeModifier()
getTypeModifier
in class CStyleShallowParserBase
protected java.util.EnumSet<ETokenType> getTypeKeywords()
getTypeKeywords
in class CStyleShallowParserBase
protected void createClassElementsRules()
createClassElementsRules
in class CStyleShallowParserBase
protected java.util.EnumSet<ETokenType> getSimpleBlockKeywordsWithParentheses()
getSimpleBlockKeywordsWithParentheses
in class CStyleShallowParserBase
protected java.util.EnumSet<ETokenType> getSimpleBlockKeywordsWithoutParentheses()
getSimpleBlockKeywordsWithoutParentheses
in class CStyleShallowParserBase
protected java.util.EnumSet<ETokenType> getStatementStartTokens()
CStyleShallowParserBase.typePatternInState(EGenericParserStates...)
and a literal.getStatementStartTokens
in class CStyleShallowParserBase
protected void createCaseRule()
createCaseRule
in class CStyleShallowParserBase
protected RecognizerBase<EGenericParserStates> typePattern(RecognizerBase<EGenericParserStates> currentState)
typePattern
in class CStyleShallowParserBase
protected void createSubExpressionRules()
createSubExpressionRules
in class CStyleShallowParserBase
protected RecognizerBase<EGenericParserStates> getSubExpressionRecognizer()
getSubExpressionRecognizer
in class CStyleShallowParserBase