public class AntlrParserPlugin extends ASTHelper
A parser plugin which adapts the JSR Antlr Parser to the Groovy runtime
Type Params | Return Type | Name and description |
---|---|---|
|
protected boolean |
addArgumentExpression(AST node, List<Expression> expressionList) |
|
protected AnnotationNode |
annotation(AST annotationNode) |
|
protected void |
annotationDef(AST classDef) |
|
protected Expression |
anonymousInnerClassDef(AST node) |
|
protected Expression |
arguments(AST elist) |
|
protected List |
arraySizeExpression(AST node) |
|
protected Expression |
asExpression(AST node) |
|
protected void |
assertNodeType(int type, AST node) |
|
protected Statement |
assertStatement(AST assertNode) |
|
protected void |
assertTypeNotNull(ClassNode type, AST rightNode) |
|
protected Expression |
binaryExpression(int type, AST node) |
|
protected Expression |
blockExpression(AST node) |
|
protected BooleanExpression |
booleanExpression(AST node) |
|
protected Statement |
breakStatement(AST node) |
|
ModuleNode |
buildAST(SourceUnit sourceUnit, ClassLoader classLoader, Reduction cst) |
|
protected ClassNode |
buildName(AST node) Performs a name resolution to see if the given name is a type from imports, aliases or newly created classes |
|
protected Statement |
caseStatements(AST node, List cases) |
|
protected Expression |
castExpression(AST castNode) |
|
protected List<CatchStatement> |
catchStatement(AST catchNode) |
|
protected void |
classDef(AST classDef) |
|
protected ClosureExpression |
closureExpression(AST node) |
|
protected void |
configureAST(ASTNode node, AST ast) |
|
protected Expression |
constructorCallExpression(AST node) |
|
protected void |
constructorDef(AST constructorDef) |
|
protected Statement |
continueStatement(AST node) |
|
protected void |
convertGroovy(AST node) Converts the Antlr AST to the Groovy AST |
|
protected ConstantExpression |
decimalExpression(AST node) |
|
protected Expression |
declarationExpression(AST variableDef) |
|
protected Expression |
dotExpression(AST node) |
|
protected void |
dump(AST node) |
|
protected void |
dumpTree(AST ast) |
|
protected Expression |
dynamicMemberExpression(AST dynamicMemberNode) |
|
protected Expression |
enumArguments(AST elist) |
|
protected void |
enumConstantDef(AST node) |
|
protected void |
enumDef(AST enumNode) |
|
protected Expression |
expression(AST node) |
|
protected Expression |
expression(AST node, boolean convertToConstant) |
|
protected Expression |
expressionList(AST node) |
|
protected Expression |
expressionSwitch(AST node) |
|
protected void |
fieldDef(AST fieldDef) |
|
protected Statement |
forStatement(AST forNode) |
|
protected String |
getFirstChildText(AST node) |
|
protected Expression |
gstring(AST gstringNode) |
|
protected boolean |
hasVisibility(int modifiers) Returns true if the modifiers flags contain a visibility modifier |
|
protected String |
identifier(AST node) Extracts an identifier from the Antlr AST |
|
protected Statement |
ifStatement(AST ifNode) |
|
protected void |
importDef(AST importNode) |
|
protected Expression |
indexExpression(AST indexNode) |
|
protected void |
innerClassDef(AST classDef) |
|
protected void |
innerInterfaceDef(AST classDef) |
|
protected Expression |
instanceofExpression(AST node) |
|
protected ConstantExpression |
integerExpression(AST node) |
|
protected void |
interfaceDef(AST classDef) |
|
protected ClassNode[] |
interfaces(AST node) |
|
protected boolean |
isPrimitiveTypeLiteral(AST node) |
|
static boolean |
isType(int typeCode, AST node) |
|
protected String |
label(AST labelNode) |
|
protected Statement |
labelledStatement(AST labelNode) |
|
protected Expression |
listExpression(AST listNode) |
|
protected Expression |
literalExpression(AST node, Object value) |
|
protected GenericsType[] |
makeGenericsType(AST rootNode) |
|
protected static Token |
makeToken(int typeCode, AST node) |
|
protected ClassNode |
makeType(AST typeNode) |
|
protected ClassNode |
makeTypeWithArguments(AST rootNode) |
|
protected MapEntryExpression |
mapEntryExpression(AST node) |
|
protected Expression |
mapExpression(AST mapNode) Typically only used for map constructors I think? |
|
protected Statement |
methodCall(AST code) |
|
protected Expression |
methodCallExpression(AST methodCallNode) |
|
protected void |
methodDef(AST methodDef) |
|
protected Expression |
methodPointerExpression(AST node) |
|
protected int |
modifiers(AST modifierNode, List<AnnotationNode> annotations, int defaultModifiers) |
|
protected void |
notImplementedYet(AST node) |
|
protected void |
objectBlock(AST objectBlock) |
|
protected void |
objectInit(AST init) |
|
Reduction |
outputAST(SourceUnit sourceUnit, SourceBuffer sourceBuffer) |
|
protected void |
packageDef(AST packageDef) |
|
protected Parameter |
parameter(AST paramNode) |
|
protected Parameter[] |
parameters(AST parametersNode) |
|
Reduction |
parseCST(SourceUnit sourceUnit, Reader reader) |
|
protected Expression |
postfixExpression(AST node, int token) |
|
protected Expression |
prefixExpression(AST node, int token) |
|
protected void |
processAST() |
|
static String |
qualifiedName(AST qualifiedNameNode) |
|
protected Expression |
rangeExpression(AST rangeNode, boolean inclusive) |
|
protected Statement |
returnStatement(AST node) |
|
protected boolean |
setAccessTrue(AST node, boolean access) |
|
protected int |
setModifierBit(AST node, int answer, int bit) |
|
protected Expression |
specialConstructorCallExpression(AST methodCallNode, ClassNode special) |
|
protected Expression |
spreadExpression(AST node) |
|
protected Expression |
spreadMapExpression(AST node) |
|
protected Statement |
statement(AST node) |
|
protected Statement |
statementList(AST code) |
|
protected Statement |
statementListNoChild(AST node, AST alternativeConfigureNode) |
|
protected void |
staticInit(AST staticInit) |
|
protected Statement |
switchStatement(AST switchNode) |
|
protected Statement |
synchronizedStatement(AST syncNode) |
|
protected Expression |
ternaryExpression(AST ternaryNode) |
|
protected Statement |
throwStatement(AST node) |
|
protected void |
throwsList(AST node, List<ClassNode> list) |
|
protected void |
transformCSTIntoAST(SourceUnit sourceUnit, Reader reader, SourceBuffer sourceBuffer) |
|
protected Statement |
tryStatement(AST tryStatementNode) |
|
protected ClassNode |
type(AST typeNode) |
|
protected Expression |
unaryMinusExpression(AST unaryMinusExpr) |
|
protected Expression |
unaryPlusExpression(AST unaryPlusExpr) |
|
protected void |
unknownAST(AST node) |
|
protected Statement |
variableDef(AST variableDef) |
|
protected Expression |
variableExpression(AST node) |
|
protected Statement |
whileStatement(AST whileNode) |
Methods inherited from class | Name |
---|---|
class ASTHelper |
getClassLoader, getPackageName, dot, setClassLoader, getController, setPackage, setController, setPackageName, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Performs a name resolution to see if the given name is a type from imports, aliases or newly created classes
Converts the Antlr AST to the Groovy AST
Returns true if the modifiers flags contain a visibility modifier
Typically only used for map constructors I think?