Groovy Documentation

## org.codehaus.groovy.antlr
[Java] Class AntlrParserPlugin

    java.lang.Object
      org.codehaus.groovy.syntax.ASTHelper
          org.codehaus.groovy.antlr.AntlrParserPlugin

All Implemented Interfaces:
  GroovyTokenTypes, ParserPlugin

    public class AntlrParserPlugin
    extends ASTHelper

A parser plugin which adapts the JSR Antlr Parser to the Groovy runtime

Authors:
  James Strachan

Field Summary
`protected antlr.collections.AST` | `ast`

Fields inherited from class ASTHelper
output, resolutions

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

Methods inherited from class ASTHelper
addImport, addImport, addStarImport, addStarImport, addStaticImport, addStaticImport, addStaticStarImport, addStaticStarImport, dot, dot, getClassLoader, getController, getPackageName, makeModule, setClassLoader, setController, setPackage, setPackageName

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Field Detail

### ast

    protected antlr.collections.AST ast

Method Detail

### addArgumentExpression

    protected boolean addArgumentExpression(antlr.collections.AST node, java.util.List expressionList)

### annotation

    protected AnnotationNode annotation(antlr.collections.AST annotationNode)

### annotationDef

    protected void annotationDef(antlr.collections.AST classDef)

### anonymousInnerClassDef

    protected Expression anonymousInnerClassDef(antlr.collections.AST node)

### arguments

    protected Expression arguments(antlr.collections.AST elist)

### arraySizeExpression

    protected java.util.List arraySizeExpression(antlr.collections.AST node)

### asExpression

    protected Expression asExpression(antlr.collections.AST node)

### assertNodeType

    protected void assertNodeType(int type, antlr.collections.AST node)

### assertStatement

    protected Statement assertStatement(antlr.collections.AST assertNode)

### assertTypeNotNull

    protected void assertTypeNotNull(ClassNode type, antlr.collections.AST rightNode)

### binaryExpression

    protected Expression binaryExpression(int type, antlr.collections.AST node)

### blockExpression

    protected Expression blockExpression(antlr.collections.AST node)

### booleanExpression

    protected BooleanExpression booleanExpression(antlr.collections.AST node)

### breakStatement

    protected Statement breakStatement(antlr.collections.AST node)

### buildAST

    public ModuleNode buildAST(SourceUnit sourceUnit, java.lang.ClassLoader classLoader, Reduction cst)

### buildName

    protected ClassNode buildName(antlr.collections.AST node)

### caseStatements

    protected Statement caseStatements(antlr.collections.AST node, java.util.List cases)

### castExpression

    protected Expression castExpression(antlr.collections.AST castNode)

### catchStatement

    protected java.util.List catchStatement(antlr.collections.AST catchNode)

### classDef

    protected void classDef(antlr.collections.AST classDef)

### closureExpression

    protected ClosureExpression closureExpression(antlr.collections.AST node)

### configureAST

    protected void configureAST(ASTNode node, antlr.collections.AST ast)

### constructorCallExpression

    protected Expression constructorCallExpression(antlr.collections.AST node)

### constructorDef

    protected void constructorDef(antlr.collections.AST constructorDef)

### continueStatement

    protected Statement continueStatement(antlr.collections.AST node)

### convertGroovy

    protected void convertGroovy(antlr.collections.AST node)

  Converts the Antlr AST to the Groovy AST

### decimalExpression

    protected ConstantExpression decimalExpression(antlr.collections.AST node)

### declarationExpression

    protected Expression declarationExpression(antlr.collections.AST variableDef)

### dotExpression

    protected Expression dotExpression(antlr.collections.AST node)

### dump

    protected void dump(antlr.collections.AST node)

### dumpTree

    protected void dumpTree(antlr.collections.AST ast)

### dynamicMemberExpression

    protected Expression dynamicMemberExpression(antlr.collections.AST dynamicMemberNode)

### enumConstantDef

    protected void enumConstantDef(antlr.collections.AST node)

### enumDef

    protected void enumDef(antlr.collections.AST enumNode)

### expression

    protected Expression expression(antlr.collections.AST node)

### expression

    protected Expression expression(antlr.collections.AST node, boolean convertToConstant)

### expressionList

    protected Expression expressionList(antlr.collections.AST node)

### expressionSwitch

    protected Expression expressionSwitch(antlr.collections.AST node)

### fieldDef

    protected void fieldDef(antlr.collections.AST fieldDef)

### forStatement

    protected Statement forStatement(antlr.collections.AST forNode)

### getFirstChildText

    protected java.lang.String getFirstChildText(antlr.collections.AST node)

### gstring

    protected Expression gstring(antlr.collections.AST gstringNode)

### hasVisibility

    protected boolean hasVisibility(int modifiers)

### identifier

    protected java.lang.String identifier(antlr.collections.AST node)

### ifStatement

    protected Statement ifStatement(antlr.collections.AST ifNode)

### importDef

    protected void importDef(antlr.collections.AST importNode)

### indexExpression

    protected Expression indexExpression(antlr.collections.AST indexNode)

### innerClassDef

    protected void innerClassDef(antlr.collections.AST classDef)

### innerInterfaceDef

    protected void innerInterfaceDef(antlr.collections.AST classDef)

### instanceofExpression

    protected Expression instanceofExpression(antlr.collections.AST node)

### integerExpression

    protected ConstantExpression integerExpression(antlr.collections.AST node)

### interfaceDef

    protected void interfaceDef(antlr.collections.AST classDef)

### interfaces

    protected ClassNode[] interfaces(antlr.collections.AST node)

### isPrimitiveTypeLiteral

    protected boolean isPrimitiveTypeLiteral(antlr.collections.AST node)

### isType

    public static boolean isType(int typeCode, antlr.collections.AST node)

### label

    protected java.lang.String label(antlr.collections.AST labelNode)

### labelledStatement

    protected Statement labelledStatement(antlr.collections.AST labelNode)

### listExpression

    protected Expression listExpression(antlr.collections.AST listNode)

### literalExpression

    protected Expression literalExpression(antlr.collections.AST node, java.lang.Object value)

  Typically only used for map constructors I think?

### makeGenericsType

    protected GenericsType[] makeGenericsType(antlr.collections.AST rootNode)

  Extracts an identifier from the Antlr AST

### makeToken

    protected static Token makeToken(int typeCode, antlr.collections.AST node)

### makeType

    protected ClassNode makeType(antlr.collections.AST typeNode)

  Returns true if the modifiers flags contain a visibility modifier

### makeTypeWithArguments

    protected ClassNode makeTypeWithArguments(antlr.collections.AST rootNode)

  Performs a name resolution to see if the given name is a type from imports, aliases or newly created classes

### mapEntryExpression

    protected MapEntryExpression mapEntryExpression(antlr.collections.AST node)

### mapExpression

    protected Expression mapExpression(antlr.collections.AST mapNode)

### methodCall

    protected Statement methodCall(antlr.collections.AST code)

### methodCallExpression

    protected Expression methodCallExpression(antlr.collections.AST methodCallNode)

### methodDef

    protected void methodDef(antlr.collections.AST methodDef)

### methodPointerExpression

    protected Expression methodPointerExpression(antlr.collections.AST node)

### modifiers

    protected int modifiers(antlr.collections.AST modifierNode, java.util.List annotations, int defaultModifiers)

### notImplementedYet

    protected void notImplementedYet(antlr.collections.AST node)

### objectBlock

    protected void objectBlock(antlr.collections.AST objectBlock)

### objectInit

    protected void objectInit(antlr.collections.AST init)

### outputAST

    public Reduction outputAST(SourceUnit sourceUnit, SourceBuffer sourceBuffer)

### packageDef

    protected void packageDef(antlr.collections.AST packageDef)

### parameter

    protected Parameter parameter(antlr.collections.AST paramNode)

### parameters

    protected Parameter[] parameters(antlr.collections.AST parametersNode)

### parseCST

    public Reduction parseCST(SourceUnit sourceUnit, java.io.Reader reader)

### postfixExpression

    protected Expression postfixExpression(antlr.collections.AST node, int token)

### prefixExpression

    protected Expression prefixExpression(antlr.collections.AST node, int token)

### processAST

    protected void processAST()

### qualifiedName

    public static java.lang.String qualifiedName(antlr.collections.AST qualifiedNameNode)

### rangeExpression

    protected Expression rangeExpression(antlr.collections.AST rangeNode, boolean inclusive)

### returnStatement

    protected Statement returnStatement(antlr.collections.AST node)

### setAccessTrue

    protected boolean setAccessTrue(antlr.collections.AST node, boolean access)

### setModifierBit

    protected int setModifierBit(antlr.collections.AST node, int answer, int bit)

### specialConstructorCallExpression

    protected Expression specialConstructorCallExpression(antlr.collections.AST methodCallNode, ClassNode special)

### spreadExpression

    protected Expression spreadExpression(antlr.collections.AST node)

### spreadMapExpression

    protected Expression spreadMapExpression(antlr.collections.AST node)

### statement

    protected Statement statement(antlr.collections.AST node)

### statementList

    protected Statement statementList(antlr.collections.AST code)

### statementListNoChild

    protected Statement statementListNoChild(antlr.collections.AST node, antlr.collections.AST alternativeConfigureNode)

### staticInit

    protected void staticInit(antlr.collections.AST staticInit)

### switchStatement

    protected Statement switchStatement(antlr.collections.AST switchNode)

### synchronizedStatement

    protected Statement synchronizedStatement(antlr.collections.AST syncNode)

### ternaryExpression

    protected Expression ternaryExpression(antlr.collections.AST ternaryNode)

### throwStatement

    protected Statement throwStatement(antlr.collections.AST node)

### throwsList

    protected void throwsList(antlr.collections.AST node, java.util.List list)

### transformCSTIntoAST

    protected void transformCSTIntoAST(SourceUnit sourceUnit, java.io.Reader reader, SourceBuffer sourceBuffer)

### tryStatement

    protected Statement tryStatement(antlr.collections.AST tryStatementNode)

### type

    protected ClassNode type(antlr.collections.AST typeNode)

### unaryMinusExpression

    protected Expression unaryMinusExpression(antlr.collections.AST unaryMinusExpr)

### unaryPlusExpression

    protected Expression unaryPlusExpression(antlr.collections.AST unaryPlusExpr)

### unknownAST

    protected void unknownAST(antlr.collections.AST node)

### variableDef

    protected Statement variableDef(antlr.collections.AST variableDef)

### variableExpression

    protected Expression variableExpression(antlr.collections.AST node)

### whileStatement

    protected Statement whileStatement(antlr.collections.AST whileNode)

Groovy Documentation