|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object antlr.Parser antlr.LLkParser org.codehaus.groovy.antlr.parser.GroovyRecognizer
public class GroovyRecognizer extends antlr.LLkParser
JSR-241 Groovy Recognizer. Run 'java Main [-showtree] directory-full-of-groovy-files' [The -showtree option pops up a Swing frame that shows the AST constructed from the parser.] Contributing authors: John Mitchell johnm
Field Summary | |
---|---|
static java.lang.String[] |
_tokenNames
|
static java.util.BitSet |
_tokenSet_0
|
static java.util.BitSet |
_tokenSet_1
|
static java.util.BitSet |
_tokenSet_10
|
static java.util.BitSet |
_tokenSet_100
|
static java.util.BitSet |
_tokenSet_101
|
static java.util.BitSet |
_tokenSet_102
|
static java.util.BitSet |
_tokenSet_103
|
static java.util.BitSet |
_tokenSet_104
|
static java.util.BitSet |
_tokenSet_105
|
static java.util.BitSet |
_tokenSet_106
|
static java.util.BitSet |
_tokenSet_11
|
static java.util.BitSet |
_tokenSet_12
|
static java.util.BitSet |
_tokenSet_13
|
static java.util.BitSet |
_tokenSet_14
|
static java.util.BitSet |
_tokenSet_15
|
static java.util.BitSet |
_tokenSet_16
|
static java.util.BitSet |
_tokenSet_17
|
static java.util.BitSet |
_tokenSet_18
|
static java.util.BitSet |
_tokenSet_19
|
static java.util.BitSet |
_tokenSet_2
|
static java.util.BitSet |
_tokenSet_20
|
static java.util.BitSet |
_tokenSet_21
|
static java.util.BitSet |
_tokenSet_22
|
static java.util.BitSet |
_tokenSet_23
|
static java.util.BitSet |
_tokenSet_24
|
static java.util.BitSet |
_tokenSet_25
|
static java.util.BitSet |
_tokenSet_26
|
static java.util.BitSet |
_tokenSet_27
|
static java.util.BitSet |
_tokenSet_28
|
static java.util.BitSet |
_tokenSet_29
|
static java.util.BitSet |
_tokenSet_3
|
static java.util.BitSet |
_tokenSet_30
|
static java.util.BitSet |
_tokenSet_31
|
static java.util.BitSet |
_tokenSet_32
|
static java.util.BitSet |
_tokenSet_33
|
static java.util.BitSet |
_tokenSet_34
|
static java.util.BitSet |
_tokenSet_35
|
static java.util.BitSet |
_tokenSet_36
|
static java.util.BitSet |
_tokenSet_37
|
static java.util.BitSet |
_tokenSet_38
|
static java.util.BitSet |
_tokenSet_39
|
static java.util.BitSet |
_tokenSet_4
|
static java.util.BitSet |
_tokenSet_40
|
static java.util.BitSet |
_tokenSet_41
|
static java.util.BitSet |
_tokenSet_42
|
static java.util.BitSet |
_tokenSet_43
|
static java.util.BitSet |
_tokenSet_44
|
static java.util.BitSet |
_tokenSet_45
|
static java.util.BitSet |
_tokenSet_46
|
static java.util.BitSet |
_tokenSet_47
|
static java.util.BitSet |
_tokenSet_48
|
static java.util.BitSet |
_tokenSet_49
|
static java.util.BitSet |
_tokenSet_5
|
static java.util.BitSet |
_tokenSet_50
|
static java.util.BitSet |
_tokenSet_51
|
static java.util.BitSet |
_tokenSet_52
|
static java.util.BitSet |
_tokenSet_53
|
static java.util.BitSet |
_tokenSet_54
|
static java.util.BitSet |
_tokenSet_55
|
static java.util.BitSet |
_tokenSet_56
|
static java.util.BitSet |
_tokenSet_57
|
static java.util.BitSet |
_tokenSet_58
|
static java.util.BitSet |
_tokenSet_59
|
static java.util.BitSet |
_tokenSet_6
|
static java.util.BitSet |
_tokenSet_60
|
static java.util.BitSet |
_tokenSet_61
|
static java.util.BitSet |
_tokenSet_62
|
static java.util.BitSet |
_tokenSet_63
|
static java.util.BitSet |
_tokenSet_64
|
static java.util.BitSet |
_tokenSet_65
|
static java.util.BitSet |
_tokenSet_66
|
static java.util.BitSet |
_tokenSet_67
|
static java.util.BitSet |
_tokenSet_68
|
static java.util.BitSet |
_tokenSet_69
|
static java.util.BitSet |
_tokenSet_7
|
static java.util.BitSet |
_tokenSet_70
|
static java.util.BitSet |
_tokenSet_71
|
static java.util.BitSet |
_tokenSet_72
|
static java.util.BitSet |
_tokenSet_73
|
static java.util.BitSet |
_tokenSet_74
|
static java.util.BitSet |
_tokenSet_75
|
static java.util.BitSet |
_tokenSet_76
|
static java.util.BitSet |
_tokenSet_77
|
static java.util.BitSet |
_tokenSet_78
|
static java.util.BitSet |
_tokenSet_79
|
static java.util.BitSet |
_tokenSet_8
|
static java.util.BitSet |
_tokenSet_80
|
static java.util.BitSet |
_tokenSet_81
|
static java.util.BitSet |
_tokenSet_82
|
static java.util.BitSet |
_tokenSet_83
|
static java.util.BitSet |
_tokenSet_84
|
static java.util.BitSet |
_tokenSet_85
|
static java.util.BitSet |
_tokenSet_86
|
static java.util.BitSet |
_tokenSet_87
|
static java.util.BitSet |
_tokenSet_88
|
static java.util.BitSet |
_tokenSet_89
|
static java.util.BitSet |
_tokenSet_9
|
static java.util.BitSet |
_tokenSet_90
|
static java.util.BitSet |
_tokenSet_91
|
static java.util.BitSet |
_tokenSet_92
|
static java.util.BitSet |
_tokenSet_93
|
static java.util.BitSet |
_tokenSet_94
|
static java.util.BitSet |
_tokenSet_95
|
static java.util.BitSet |
_tokenSet_96
|
static java.util.BitSet |
_tokenSet_97
|
static java.util.BitSet |
_tokenSet_98
|
static java.util.BitSet |
_tokenSet_99
|
static boolean |
tracing
|
Constructor Summary | |
protected GroovyRecognizer(antlr.TokenBuffer tokenBuf, int k)
|
|
GroovyRecognizer(antlr.TokenBuffer tokenBuf)
|
|
protected GroovyRecognizer(antlr.TokenStream lexer, int k)
|
|
GroovyRecognizer(antlr.TokenStream lexer)
|
|
GroovyRecognizer(antlr.ParserSharedInputState state)
|
Method Summary | |
---|---|
void
|
aCase()
|
void
|
addWarning(java.lang.String warning, java.lang.String solution)
|
void
|
additiveExpression(int lc_stmt)
|
void
|
andExpression(int lc_stmt)
|
void
|
annotation()
|
void
|
annotationArguments()
|
void
|
annotationBlock()
|
void
|
annotationDefinition(antlr.collections.AST modifiers)
|
void
|
annotationField()
|
void
|
annotationIdent()
|
void
|
annotationMemberArrayValueInitializer()
|
void
|
annotationMemberValueInitializer()
|
void
|
annotationMemberValuePair()
|
void
|
annotationMemberValuePairs()
|
void
|
annotationsInternal()
|
void
|
annotationsOpt()
|
void
|
appendedBlock(antlr.collections.AST callee)
An appended block follows any expression. |
void
|
argList()
|
byte
|
argument()
A single argument in (...) or [...]. |
void
|
argumentLabel()
A label for an argument is of the form a:b, 'a':b, "a":b, (a):b, etc.. |
void
|
argumentLabelStart()
For lookahead only. |
void
|
assignmentExpression(int lc_stmt)
|
void
|
assignmentLessExpression()
In Java, "if", "while", and "for" statements can take random, non-braced statements as their bodies. |
void
|
balancedBrackets()
Fast lookahead across balanced brackets of all sorts. |
void
|
balancedTokens()
lookahead predicate for usage of generics in methods as parameter for the method. |
void
|
blockBody(int prevToken)
|
void
|
branchStatement()
In Groovy, return, break, continue, throw, and assert can be used in a parenthesized expression context. |
protected void
|
buildTokenTypeASTClassMap()
|
void
|
builtInType()
|
void
|
builtInTypeArraySpec(boolean addImagNode)
|
void
|
builtInTypeSpec(boolean addImagNode)
|
void
|
caseSList()
|
void
|
casesGroup()
|
void
|
checkSuspiciousExpressionStatement(int prevToken)
If two statements are separated by newline (not SEMI), the second had better not look like the latter half of an expression. |
void
|
classBlock()
|
void
|
classDefinition(antlr.collections.AST modifiers)
|
void
|
classField()
|
void
|
classOrInterfaceType(boolean addImagNode)
|
void
|
classTypeSpec(boolean addImagNode)
|
antlr.Token
|
cloneToken(antlr.Token t)
|
void
|
closableBlock()
A sub-block of a block can be either open or closable. |
void
|
closableBlockConstructorExpression()
A list constructor is a argument list enclosed in square brackets, without labels. |
void
|
closableBlockParam()
|
void
|
closableBlockParamsOpt(boolean addImplicit)
Closure parameters are exactly like method parameters, except that they are not enclosed in parentheses, but rather are prepended to the front of a block, just after the brace. |
void
|
closableBlockParamsStart()
|
void
|
closureList()
|
void
|
commandArgument()
|
void
|
commandArguments(antlr.collections.AST head)
|
void
|
commandArgumentsGreedy(antlr.collections.AST head)
|
void
|
compatibleBodyStatement()
|
void
|
compilationUnit()
|
void
|
compoundStatement()
I've split out constructors separately; we could maybe integrate back into variableDefinitions later on if we maybe simplified 'def' to be a type declaration? |
void
|
conditionalExpression(int lc_stmt)
|
void
|
constant()
|
void
|
constantNumber()
Numeric constant. |
void
|
constructorBody()
|
void
|
constructorDefinition(antlr.collections.AST mods)
|
void
|
constructorStart()
Used to look ahead for a constructor |
void
|
controlExpressionList()
|
antlr.collections.AST
|
create(int type, java.lang.String txt, antlr.collections.AST first)
Create an AST node with the token type and text passed in, but with the same background information as another supplied Token (e.g. |
antlr.collections.AST
|
create(int type, java.lang.String txt, antlr.Token first, antlr.Token last)
|
antlr.collections.AST
|
create(int type, java.lang.String txt, antlr.collections.AST first, antlr.Token last)
|
antlr.collections.AST
|
create(int type, java.lang.String txt, antlr.collections.AST first, antlr.collections.AST last)
Clones the token |
void
|
declaration()
|
void
|
declarationStart()
|
void
|
declaratorBrackets(antlr.collections.AST typ)
After some type names, where zero or more empty bracket pairs are allowed. |
void
|
dynamicMemberName()
|
void
|
enumBlock()
|
void
|
enumConstant()
|
void
|
enumConstantBlock()
|
void
|
enumConstantField()
|
void
|
enumConstants()
Comma-separated list of one or more enum constant definitions. |
void
|
enumConstantsStart()
Guard for enumConstants. |
void
|
enumDefinition(antlr.collections.AST modifiers)
|
void
|
equalityExpression(int lc_stmt)
|
void
|
exclusiveOrExpression(int lc_stmt)
|
void
|
explicitConstructorInvocation()
Catch obvious constructor calls, but not the expr.super(...) calls |
void
|
expression(int lc_stmt)
|
void
|
expressionStatement(int prevToken)
|
void
|
expressionStatementNoCheck()
|
void
|
finallyClause()
A member name (x.y) or element name (x[y]) can serve as a command name, which may be followed by a list of arguments. |
void
|
forCond()
|
void
|
forInClause()
|
void
|
forInit()
|
void
|
forIter()
|
void
|
forStatement()
|
void
|
genericMethod()
|
void
|
genericMethodStart()
|
org.codehaus.groovy.antlr.parser.GroovyLexer
|
getLexer()
|
java.util.List
|
getWarningList()
|
void
|
handler()
|
void
|
identifier()
|
void
|
identifierStar()
|
void
|
implementsClause()
|
void
|
implicitParameters()
A block known to be a closure, but which omits its arguments, is given this placeholder. |
void
|
importStatement()
|
void
|
inclusiveOrExpression(int lc_stmt)
|
void
|
indexPropertyArgs(antlr.collections.AST indexee)
If a dot is followed by a parenthesized or quoted expression, the member is computed dynamically, and the member selection is done only at runtime. |
void
|
interfaceBlock()
|
void
|
interfaceDefinition(antlr.collections.AST modifiers)
|
void
|
interfaceExtends()
|
void
|
interfaceField()
|
void
|
keywordPropertyNames()
|
void
|
listOfVariables(antlr.collections.AST mods, antlr.collections.AST t, antlr.Token first)
Declaration of a variable. |
void
|
listOrMapConstructorExpression()
|
void
|
logicalAndExpression(int lc_stmt)
|
void
|
logicalOrExpression(int lc_stmt)
|
static GroovyRecognizer
|
make(org.codehaus.groovy.antlr.parser.GroovyLexer lexer)
This factory is the correct way to wire together a Groovy parser and lexer. |
static GroovyRecognizer
|
make(java.io.InputStream in)
|
static GroovyRecognizer
|
make(java.io.Reader in)
|
static GroovyRecognizer
|
make(antlr.InputBuffer in)
|
static GroovyRecognizer
|
make(antlr.LexerSharedInputState in)
|
void
|
matchGenericTypeBracketsFailed(java.lang.String problem, java.lang.String solution)
|
void
|
methodCallArgs(antlr.collections.AST callee)
An expression may be followed by one or both of (...) and {...}. |
void
|
modifier()
|
void
|
modifiers()
A list of one or more modifier, annotation, or "def". |
void
|
modifiersInternal()
|
void
|
modifiersOpt()
Used only as a lookahead predicate for nested type declarations. |
void
|
multicatch()
|
void
|
multicatch_types()
|
void
|
multipleAssignment(int lc_stmt)
|
void
|
multipleAssignmentDeclaration()
|
void
|
multipleAssignmentDeclarationStart()
|
void
|
multiplicativeExpression(int lc_stmt)
|
void
|
namePart()
This is the grammar for what can follow a dot: x.a, x. |
void
|
newArrayDeclarator()
|
void
|
newExpression()
object instantiation. |
void
|
nls()
Zero or more insignificant newlines, all gobbled up and thrown away. |
void
|
nlsWarn()
Zero or more insignificant newlines, all gobbled up and thrown away, but a warning message is left for the user, if there was a newline. |
void
|
openBlock()
An open block is not allowed to have closure arguments. |
void
|
openOrClosableBlock()
A labeled statement, consisting of a vanilla identifier followed by a colon. |
void
|
packageDefinition()
A statement is an element of a block. |
void
|
parameterDeclaration()
A formal parameter for a method or closure. |
void
|
parameterDeclarationList()
A list of zero or more formal parameters. |
void
|
parameterModifiersOpt()
|
void
|
parenthesizedExpression()
|
void
|
pathChain(int lc_stmt, antlr.collections.AST prefix)
|
void
|
pathElement(antlr.collections.AST prefix)
|
void
|
pathElementStart()
|
void
|
pathExpression(int lc_stmt)
|
void
|
postfixExpression(int lc_stmt)
|
void
|
powerExpression(int lc_stmt)
|
void
|
powerExpressionNotPlusMinus(int lc_stmt)
|
void
|
primaryExpression()
|
void
|
qualifiedTypeName()
|
void
|
regexExpression(int lc_stmt)
|
void
|
relationalExpression(int lc_stmt)
|
void
|
requireFailed(java.lang.String problem, java.lang.String solution)
|
void
|
sep()
A statement separator is either a semicolon or a significant newline. |
void
|
setFilename(java.lang.String f)
|
void
|
setSourceBuffer(SourceBuffer sourceBuffer)
|
void
|
shiftExpression(int lc_stmt)
|
void
|
singleDeclaration()
|
void
|
singleDeclarationNoInit()
A declaration with one declarator and no initialization, like a parameterDeclaration. |
void
|
singleVariable(antlr.collections.AST mods, antlr.collections.AST t)
Used in cases where a declaration cannot have commas, or ends with the "in" operator instead of '='. |
void
|
snippetUnit()
A Groovy script or simple expression. |
void
|
statement(int prevToken)
|
void
|
statementLabelPrefix()
An expression statement can be any general expression. |
boolean
|
strictContextExpression(boolean allowDeclaration)
Things that can show up as expressions, but only in strict contexts like inside parentheses, argument lists, and list constructors. |
void
|
stringConstructorExpression()
|
void
|
stringConstructorValuePart()
|
void
|
superClassClause()
|
void
|
suspiciousExpressionStatementStart()
Lookahead for suspicious statement warnings and errors. |
void
|
throwsClause()
|
void
|
traceIn(java.lang.String rname)
|
void
|
traceOut(java.lang.String rname)
|
void
|
tryBlock()
|
void
|
type()
|
void
|
typeArgument()
|
void
|
typeArgumentBounds()
|
void
|
typeArgumentSpec()
|
void
|
typeArguments()
|
void
|
typeArgumentsDiamond()
|
protected void
|
typeArgumentsOrParametersEnd()
|
void
|
typeDeclarationStart()
|
protected void
|
typeDefinitionInternal(antlr.collections.AST mods)
|
void
|
typeNamePairs(antlr.collections.AST mods, antlr.Token first)
|
void
|
typeParameter()
|
void
|
typeParameterBounds()
|
void
|
typeParameters()
|
void
|
typeSpec(boolean addImagNode)
|
void
|
unaryExpression(int lc_stmt)
|
void
|
unaryExpressionNotPlusMinus(int lc_stmt)
|
void
|
upperCaseIdent()
An IDENT token whose spelling is required to start with an uppercase letter. |
void
|
varInitializer()
An assignment operator '=' followed by an expression. |
void
|
variableDeclarator(antlr.collections.AST mods, antlr.collections.AST t, antlr.Token first)
|
void
|
variableDefinitions(antlr.collections.AST mods, antlr.collections.AST t)
|
void
|
variableName()
|
void
|
wildcardType()
|
Methods inherited from class antlr.LLkParser | |
---|---|
antlr.LLkParser#LT(int), antlr.LLkParser#LA(int), antlr.LLkParser#traceIn(java.lang.String), antlr.LLkParser#traceOut(java.lang.String), antlr.LLkParser#consume(), antlr.LLkParser#getAST(), antlr.LLkParser#getTokenNames(), antlr.LLkParser#consumeUntil(int), antlr.LLkParser#consumeUntil(antlr.collections.impl.BitSet), antlr.LLkParser#getInputState(), antlr.LLkParser#setInputState(antlr.ParserSharedInputState), antlr.LLkParser#matchNot(int), antlr.LLkParser#panic(), antlr.LLkParser#reportWarning(java.lang.String), antlr.LLkParser#setFilename(java.lang.String), antlr.LLkParser#traceIndent(), antlr.LLkParser#setASTNodeClass(java.lang.String), antlr.LLkParser#getTokenTypeToASTClassMap(), antlr.LLkParser#recover(antlr.RecognitionException, antlr.collections.impl.BitSet), antlr.LLkParser#getASTFactory(), antlr.LLkParser#setTokenBuffer(antlr.TokenBuffer), antlr.LLkParser#addParserListener(antlr.debug.ParserListener), antlr.LLkParser#addParserMatchListener(antlr.debug.ParserMatchListener), antlr.LLkParser#addMessageListener(antlr.debug.MessageListener), antlr.LLkParser#getTokenName(int), antlr.LLkParser#addParserTokenListener(antlr.debug.ParserTokenListener), antlr.LLkParser#addSemanticPredicateListener(antlr.debug.SemanticPredicateListener), antlr.LLkParser#addSyntacticPredicateListener(antlr.debug.SyntacticPredicateListener), antlr.LLkParser#addTraceListener(antlr.debug.TraceListener), antlr.LLkParser#isDebugMode(), antlr.LLkParser#removeMessageListener(antlr.debug.MessageListener), antlr.LLkParser#removeParserListener(antlr.debug.ParserListener), antlr.LLkParser#removeParserMatchListener(antlr.debug.ParserMatchListener), antlr.LLkParser#removeParserTokenListener(antlr.debug.ParserTokenListener), antlr.LLkParser#removeSemanticPredicateListener(antlr.debug.SemanticPredicateListener), antlr.LLkParser#removeSyntacticPredicateListener(antlr.debug.SyntacticPredicateListener), antlr.LLkParser#removeTraceListener(antlr.debug.TraceListener), antlr.LLkParser#setASTFactory(antlr.ASTFactory), antlr.LLkParser#setASTNodeType(java.lang.String), antlr.LLkParser#setDebugMode(boolean), antlr.LLkParser#setIgnoreInvalidDebugCalls(boolean), antlr.LLkParser#getFilename(), antlr.LLkParser#mark(), antlr.LLkParser#rewind(int), antlr.LLkParser#match(int), antlr.LLkParser#match(antlr.collections.impl.BitSet), antlr.LLkParser#reportError(antlr.RecognitionException), antlr.LLkParser#reportError(java.lang.String), antlr.LLkParser#wait(long, int), antlr.LLkParser#wait(long), antlr.LLkParser#wait(), antlr.LLkParser#equals(java.lang.Object), antlr.LLkParser#toString(), antlr.LLkParser#hashCode(), antlr.LLkParser#getClass(), antlr.LLkParser#notify(), antlr.LLkParser#notifyAll() |
Methods inherited from class antlr.Parser | |
---|---|
antlr.Parser#getAST(), antlr.Parser#LT(int), antlr.Parser#getTokenNames(), antlr.Parser#consumeUntil(int), antlr.Parser#consumeUntil(antlr.collections.impl.BitSet), antlr.Parser#getInputState(), antlr.Parser#setInputState(antlr.ParserSharedInputState), antlr.Parser#LA(int), antlr.Parser#matchNot(int), antlr.Parser#panic(), antlr.Parser#reportWarning(java.lang.String), antlr.Parser#setFilename(java.lang.String), antlr.Parser#traceIndent(), antlr.Parser#traceIn(java.lang.String), antlr.Parser#traceOut(java.lang.String), antlr.Parser#setASTNodeClass(java.lang.String), antlr.Parser#getTokenTypeToASTClassMap(), antlr.Parser#recover(antlr.RecognitionException, antlr.collections.impl.BitSet), antlr.Parser#getASTFactory(), antlr.Parser#setTokenBuffer(antlr.TokenBuffer), antlr.Parser#addParserListener(antlr.debug.ParserListener), antlr.Parser#addParserMatchListener(antlr.debug.ParserMatchListener), antlr.Parser#addMessageListener(antlr.debug.MessageListener), antlr.Parser#getTokenName(int), antlr.Parser#addParserTokenListener(antlr.debug.ParserTokenListener), antlr.Parser#addSemanticPredicateListener(antlr.debug.SemanticPredicateListener), antlr.Parser#addSyntacticPredicateListener(antlr.debug.SyntacticPredicateListener), antlr.Parser#addTraceListener(antlr.debug.TraceListener), antlr.Parser#isDebugMode(), antlr.Parser#removeMessageListener(antlr.debug.MessageListener), antlr.Parser#removeParserListener(antlr.debug.ParserListener), antlr.Parser#removeParserMatchListener(antlr.debug.ParserMatchListener), antlr.Parser#removeParserTokenListener(antlr.debug.ParserTokenListener), antlr.Parser#removeSemanticPredicateListener(antlr.debug.SemanticPredicateListener), antlr.Parser#removeSyntacticPredicateListener(antlr.debug.SyntacticPredicateListener), antlr.Parser#removeTraceListener(antlr.debug.TraceListener), antlr.Parser#setASTFactory(antlr.ASTFactory), antlr.Parser#setASTNodeType(java.lang.String), antlr.Parser#setDebugMode(boolean), antlr.Parser#setIgnoreInvalidDebugCalls(boolean), antlr.Parser#getFilename(), antlr.Parser#mark(), antlr.Parser#rewind(int), antlr.Parser#match(int), antlr.Parser#match(antlr.collections.impl.BitSet), antlr.Parser#consume(), antlr.Parser#reportError(antlr.RecognitionException), antlr.Parser#reportError(java.lang.String), antlr.Parser#wait(long, int), antlr.Parser#wait(long), antlr.Parser#wait(), antlr.Parser#equals(java.lang.Object), antlr.Parser#toString(), antlr.Parser#hashCode(), antlr.Parser#getClass(), antlr.Parser#notify(), antlr.Parser#notifyAll() |
Field Detail |
---|
public static final java.lang.String[] _tokenNames
public static final java.util.BitSet _tokenSet_0
public static final java.util.BitSet _tokenSet_1
public static final java.util.BitSet _tokenSet_10
public static final java.util.BitSet _tokenSet_100
public static final java.util.BitSet _tokenSet_101
public static final java.util.BitSet _tokenSet_102
public static final java.util.BitSet _tokenSet_103
public static final java.util.BitSet _tokenSet_104
public static final java.util.BitSet _tokenSet_105
public static final java.util.BitSet _tokenSet_106
public static final java.util.BitSet _tokenSet_11
public static final java.util.BitSet _tokenSet_12
public static final java.util.BitSet _tokenSet_13
public static final java.util.BitSet _tokenSet_14
public static final java.util.BitSet _tokenSet_15
public static final java.util.BitSet _tokenSet_16
public static final java.util.BitSet _tokenSet_17
public static final java.util.BitSet _tokenSet_18
public static final java.util.BitSet _tokenSet_19
public static final java.util.BitSet _tokenSet_2
public static final java.util.BitSet _tokenSet_20
public static final java.util.BitSet _tokenSet_21
public static final java.util.BitSet _tokenSet_22
public static final java.util.BitSet _tokenSet_23
public static final java.util.BitSet _tokenSet_24
public static final java.util.BitSet _tokenSet_25
public static final java.util.BitSet _tokenSet_26
public static final java.util.BitSet _tokenSet_27
public static final java.util.BitSet _tokenSet_28
public static final java.util.BitSet _tokenSet_29
public static final java.util.BitSet _tokenSet_3
public static final java.util.BitSet _tokenSet_30
public static final java.util.BitSet _tokenSet_31
public static final java.util.BitSet _tokenSet_32
public static final java.util.BitSet _tokenSet_33
public static final java.util.BitSet _tokenSet_34
public static final java.util.BitSet _tokenSet_35
public static final java.util.BitSet _tokenSet_36
public static final java.util.BitSet _tokenSet_37
public static final java.util.BitSet _tokenSet_38
public static final java.util.BitSet _tokenSet_39
public static final java.util.BitSet _tokenSet_4
public static final java.util.BitSet _tokenSet_40
public static final java.util.BitSet _tokenSet_41
public static final java.util.BitSet _tokenSet_42
public static final java.util.BitSet _tokenSet_43
public static final java.util.BitSet _tokenSet_44
public static final java.util.BitSet _tokenSet_45
public static final java.util.BitSet _tokenSet_46
public static final java.util.BitSet _tokenSet_47
public static final java.util.BitSet _tokenSet_48
public static final java.util.BitSet _tokenSet_49
public static final java.util.BitSet _tokenSet_5
public static final java.util.BitSet _tokenSet_50
public static final java.util.BitSet _tokenSet_51
public static final java.util.BitSet _tokenSet_52
public static final java.util.BitSet _tokenSet_53
public static final java.util.BitSet _tokenSet_54
public static final java.util.BitSet _tokenSet_55
public static final java.util.BitSet _tokenSet_56
public static final java.util.BitSet _tokenSet_57
public static final java.util.BitSet _tokenSet_58
public static final java.util.BitSet _tokenSet_59
public static final java.util.BitSet _tokenSet_6
public static final java.util.BitSet _tokenSet_60
public static final java.util.BitSet _tokenSet_61
public static final java.util.BitSet _tokenSet_62
public static final java.util.BitSet _tokenSet_63
public static final java.util.BitSet _tokenSet_64
public static final java.util.BitSet _tokenSet_65
public static final java.util.BitSet _tokenSet_66
public static final java.util.BitSet _tokenSet_67
public static final java.util.BitSet _tokenSet_68
public static final java.util.BitSet _tokenSet_69
public static final java.util.BitSet _tokenSet_7
public static final java.util.BitSet _tokenSet_70
public static final java.util.BitSet _tokenSet_71
public static final java.util.BitSet _tokenSet_72
public static final java.util.BitSet _tokenSet_73
public static final java.util.BitSet _tokenSet_74
public static final java.util.BitSet _tokenSet_75
public static final java.util.BitSet _tokenSet_76
public static final java.util.BitSet _tokenSet_77
public static final java.util.BitSet _tokenSet_78
public static final java.util.BitSet _tokenSet_79
public static final java.util.BitSet _tokenSet_8
public static final java.util.BitSet _tokenSet_80
public static final java.util.BitSet _tokenSet_81
public static final java.util.BitSet _tokenSet_82
public static final java.util.BitSet _tokenSet_83
public static final java.util.BitSet _tokenSet_84
public static final java.util.BitSet _tokenSet_85
public static final java.util.BitSet _tokenSet_86
public static final java.util.BitSet _tokenSet_87
public static final java.util.BitSet _tokenSet_88
public static final java.util.BitSet _tokenSet_89
public static final java.util.BitSet _tokenSet_9
public static final java.util.BitSet _tokenSet_90
public static final java.util.BitSet _tokenSet_91
public static final java.util.BitSet _tokenSet_92
public static final java.util.BitSet _tokenSet_93
public static final java.util.BitSet _tokenSet_94
public static final java.util.BitSet _tokenSet_95
public static final java.util.BitSet _tokenSet_96
public static final java.util.BitSet _tokenSet_97
public static final java.util.BitSet _tokenSet_98
public static final java.util.BitSet _tokenSet_99
public static boolean tracing
Constructor Detail |
---|
protected GroovyRecognizer(antlr.TokenBuffer tokenBuf, int k)
public GroovyRecognizer(antlr.TokenBuffer tokenBuf)
protected GroovyRecognizer(antlr.TokenStream lexer, int k)
public GroovyRecognizer(antlr.TokenStream lexer)
public GroovyRecognizer(antlr.ParserSharedInputState state)
Method Detail |
---|
public final void aCase()
public void addWarning(java.lang.String warning, java.lang.String solution)
public final void additiveExpression(int lc_stmt)
public final void andExpression(int lc_stmt)
public final void annotation()
public final void annotationArguments()
public final void annotationBlock()
public final void annotationDefinition(antlr.collections.AST modifiers)
public final void annotationField()
public final void annotationIdent()
public final void annotationMemberArrayValueInitializer()
public final void annotationMemberValueInitializer()
public final void annotationMemberValuePair()
public final void annotationMemberValuePairs()
public final void annotationsInternal()
public final void annotationsOpt()
public final void appendedBlock(antlr.collections.AST callee)
public final void argList()
public final byte argument()
public final void argumentLabel()
public final void argumentLabelStart()
public final void assignmentExpression(int lc_stmt)
public final void assignmentLessExpression()
public final void balancedBrackets()
public final void balancedTokens()
public final void blockBody(int prevToken)
public final void branchStatement()
protected void buildTokenTypeASTClassMap()
public final void builtInType()
public final void builtInTypeArraySpec(boolean addImagNode)
public final void builtInTypeSpec(boolean addImagNode)
public final void caseSList()
public final void casesGroup()
public final void checkSuspiciousExpressionStatement(int prevToken)
Also, if the expression starts with a closure, it needs to have an explicit parameter list, in order to avoid the appearance of a compound statement. This is a hard error.
These rules are different from Java's "dumb expression" restriction. Unlike Java, Groovy blocks can end with arbitrary (even dumb) expressions, as a consequence of optional 'return' and 'continue' tokens.
To make the programmer's intention clear, a leading closure must have an explicit parameter list, and must not follow a previous statement separated only by newlines.
public final void classBlock()
public final void classDefinition(antlr.collections.AST modifiers)
public final void classField()
public final void classOrInterfaceType(boolean addImagNode)
public final void classTypeSpec(boolean addImagNode)
public antlr.Token cloneToken(antlr.Token t)
public final void closableBlock()
public final void closableBlockConstructorExpression()
A map constructor is an argument list enclosed in square brackets, with labels everywhere, except on spread arguments, which stand for whole maps spliced in. A colon alone between the brackets also forces the expression to be an empty map constructor. Examples: [:], [a:1], [a:1,b:2], [a:1,*:m1,b:2], [*:m1,*:m2] (The m1, m2 must be a map or null.) Values associated with identical keys overwrite from left to right: [a:1,a:2] === [a:2]
Some malformed constructor expressions are not detected in the parser, but in a post-pass. Bad examples: [1,b:2], [a:1,2], [:1]. (Note that method call arguments, by contrast, can be a mix of keyworded and non-keyworded arguments.)
public final void closableBlockParam()
public final void closableBlockParamsOpt(boolean addImplicit)
public final void closableBlockParamsStart()
public final void closureList()
public final void commandArgument()
public final void commandArguments(antlr.collections.AST head)
public final void commandArgumentsGreedy(antlr.collections.AST head)
public final void compatibleBodyStatement()
public final void compilationUnit()
public final void compoundStatement()
public final void conditionalExpression(int lc_stmt)
public final void constant()
public final void constantNumber()
public final void constructorBody()
public final void constructorDefinition(antlr.collections.AST mods)
public final void constructorStart()
public final void controlExpressionList()
public antlr.collections.AST create(int type, java.lang.String txt, antlr.collections.AST first)
public antlr.collections.AST create(int type, java.lang.String txt, antlr.Token first, antlr.Token last)
public antlr.collections.AST create(int type, java.lang.String txt, antlr.collections.AST first, antlr.Token last)
public antlr.collections.AST create(int type, java.lang.String txt, antlr.collections.AST first, antlr.collections.AST last)
public final void declaration()
public final void declarationStart()
public final void declaratorBrackets(antlr.collections.AST typ)
public final void dynamicMemberName()
public final void enumBlock()
public final void enumConstant()
public final void enumConstantBlock()
public final void enumConstantField()
public final void enumConstants()
public final void enumConstantsStart()
public final void enumDefinition(antlr.collections.AST modifiers)
public final void equalityExpression(int lc_stmt)
public final void exclusiveOrExpression(int lc_stmt)
public final void explicitConstructorInvocation()
public final void expression(int lc_stmt)
public final void expressionStatement(int prevToken)
public final void expressionStatementNoCheck()
public final void finallyClause()
public final void forCond()
public final void forInClause()
public final void forInit()
public final void forIter()
public final void forStatement()
public final void genericMethod()
public final void genericMethodStart()
public org.codehaus.groovy.antlr.parser.GroovyLexer getLexer()
public java.util.List getWarningList()
public final void handler()
public final void identifier()
public final void identifierStar()
public final void implementsClause()
public final void implicitParameters()
public final void importStatement()
public final void inclusiveOrExpression(int lc_stmt)
public final void indexPropertyArgs(antlr.collections.AST indexee)
public final void interfaceBlock()
public final void interfaceDefinition(antlr.collections.AST modifiers)
public final void interfaceExtends()
public final void interfaceField()
public final void keywordPropertyNames()
public final void listOfVariables(antlr.collections.AST mods, antlr.collections.AST t, antlr.Token first)
public final void listOrMapConstructorExpression()
public final void logicalAndExpression(int lc_stmt)
public final void logicalOrExpression(int lc_stmt)
public static GroovyRecognizer make(org.codehaus.groovy.antlr.parser.GroovyLexer lexer)
public static GroovyRecognizer make(java.io.InputStream in)
public static GroovyRecognizer make(java.io.Reader in)
public static GroovyRecognizer make(antlr.InputBuffer in)
public static GroovyRecognizer make(antlr.LexerSharedInputState in)
public void matchGenericTypeBracketsFailed(java.lang.String problem, java.lang.String solution)
public final void methodCallArgs(antlr.collections.AST callee)
If the methodCallArgs are absent, it is a property reference. If there is no property, it is treated as a field reference, but never a method reference.
Arguments in the (...) can be labeled, and the appended block can be labeled also. If there is a mix of unlabeled and labeled arguments, all the labeled arguments must follow the unlabeled arguments, except that the closure (labeled or not) is always a separate final argument. Labeled arguments are collected up and passed as a single argument to a formal of type Map.
Therefore, f(x,y, a:p, b:q) {s} is equivalent in all ways to f(x,y, [a:p,b:q], {s}). Spread arguments of sequence type count as unlabeled arguments, while spread arguments of map type count as labeled arguments. (This distinction must sometimes be checked dynamically.) A plain unlabeled argument is allowed to match a trailing Map or Closure argument: f(x, a:p) {s} === f(*[ x, [a:p], {s} ])
public final void modifier()
public final void modifiers()
public final void modifiersInternal()
public final void modifiersOpt()
public final void multicatch()
public final void multicatch_types()
public final void multipleAssignment(int lc_stmt)
public final void multipleAssignmentDeclaration()
public final void multipleAssignmentDeclarationStart()
public final void multiplicativeExpression(int lc_stmt)
public final void namePart()
typeArguments
is handled by the caller of namePart
.
public final void newArrayDeclarator()
public final void newExpression()
public final void nls()
public final void nlsWarn()
public final void openBlock()
public final void openOrClosableBlock()
public final void packageDefinition()
public final void parameterDeclaration()
public final void parameterDeclarationList()
public final void parameterModifiersOpt()
public final void parenthesizedExpression()
public final void pathChain(int lc_stmt, antlr.collections.AST prefix)
public final void pathElement(antlr.collections.AST prefix)
public final void pathElementStart()
public final void pathExpression(int lc_stmt)
public final void postfixExpression(int lc_stmt)
public final void powerExpression(int lc_stmt)
public final void powerExpressionNotPlusMinus(int lc_stmt)
public final void primaryExpression()
public final void qualifiedTypeName()
public final void regexExpression(int lc_stmt)
public final void relationalExpression(int lc_stmt)
public void requireFailed(java.lang.String problem, java.lang.String solution)
public final void sep()
public void setFilename(java.lang.String f)
public void setSourceBuffer(SourceBuffer sourceBuffer)
public final void shiftExpression(int lc_stmt)
public final void singleDeclaration()
public final void singleDeclarationNoInit()
for (int x in y)
(up to the in
keyword).
public final void singleVariable(antlr.collections.AST mods, antlr.collections.AST t)
public final void snippetUnit()
public final void statement(int prevToken)
public final void statementLabelPrefix()
An expression statement can also be a command, which is a simple method call in which the outermost parentheses are omitted.
Certain "suspicious" looking forms are flagged for the user to disambiguate.
public final boolean strictContextExpression(boolean allowDeclaration)
public final void stringConstructorExpression()
public final void stringConstructorValuePart()
public final void superClassClause()
public final void suspiciousExpressionStatementStart()
public final void throwsClause()
public void traceIn(java.lang.String rname)
public void traceOut(java.lang.String rname)
public final void tryBlock()
public final void type()
public final void typeArgument()
public final void typeArgumentBounds()
public final void typeArgumentSpec()
public final void typeArguments()
public final void typeArgumentsDiamond()
protected final void typeArgumentsOrParametersEnd()
public final void typeDeclarationStart()
protected final void typeDefinitionInternal(antlr.collections.AST mods)
public final void typeNamePairs(antlr.collections.AST mods, antlr.Token first)
public final void typeParameter()
public final void typeParameterBounds()
public final void typeParameters()
public final void typeSpec(boolean addImagNode)
public final void unaryExpression(int lc_stmt)
public final void unaryExpressionNotPlusMinus(int lc_stmt)
public final void upperCaseIdent()
public final void varInitializer()
public final void variableDeclarator(antlr.collections.AST mods, antlr.collections.AST t, antlr.Token first)
public final void variableDefinitions(antlr.collections.AST mods, antlr.collections.AST t)
public final void variableName()
public final void wildcardType()
Groovy Documentation