Package: org.codehaus.groovy.antlr

## [Java] Class AntlrParserPlugin

- org.codehaus.groovy.antlr.AntlrParserPlugin

- All Implemented Interfaces and Traits:
    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

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected antlr.collections.AST` | `ast` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class ASTHelper` | `output, resolutions`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected boolean` | `addArgumentExpression(antlr.collections.AST node, List<Expression> 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 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, ClassLoader classLoader, Reduction cst)`
    `` | `protected ClassNode` | `buildName(antlr.collections.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(antlr.collections.AST node, List cases)`
    `` | `protected Expression` | `castExpression(antlr.collections.AST castNode)`
    `` | `protected List<CatchStatement>` | `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 Expression` | `enumArguments(antlr.collections.AST elist)`
    `` | `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 String` | `getFirstChildText(antlr.collections.AST node)`
    `` | `protected Expression` | `gstring(antlr.collections.AST gstringNode)`
    `` | `protected boolean` | `hasVisibility(int modifiers)` Returns true if the modifiers flags contain a visibility modifier
    `` | `protected String` | `identifier(antlr.collections.AST node)` Extracts an identifier from the Antlr AST
    `` | `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 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, Object value)`
    `` | `protected GenericsType[]` | `makeGenericsType(antlr.collections.AST rootNode)`
    `` | `protected static Token` | `makeToken(int typeCode, antlr.collections.AST node)`
    `` | `protected ClassNode` | `makeType(antlr.collections.AST typeNode)`
    `` | `protected ClassNode` | `makeTypeWithArguments(antlr.collections.AST rootNode)`
    `` | `protected MapEntryExpression` | `mapEntryExpression(antlr.collections.AST node)`
    `` | `protected Expression` | `mapExpression(antlr.collections.AST mapNode)` Typically only used for map constructors I think?
    `` | `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, List<AnnotationNode> 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, Reader reader)`
    `` | `protected Expression` | `postfixExpression(antlr.collections.AST node, int token)`
    `` | `protected Expression` | `prefixExpression(antlr.collections.AST node, int token)`
    `` | `protected void` | `processAST()`
    `` | `static 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, List<ClassNode> list)`
    `` | `protected void` | `transformCSTIntoAST(SourceUnit sourceUnit, 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)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class ASTHelper` | `addImport, addImport, addStarImport, addStarImport, addStaticImport, addStaticImport, addStaticStarImport, addStaticStarImport, dot, dot, getClassLoader, getController, getPackageName, makeModule, setClassLoader, setController, setPackage, setPackageName`
    `class Object` | `equals, toString, hashCode, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### protected antlr.collections.AST ast

  - ### Method Detail

    - #### protected boolean addArgumentExpression(antlr.collections.AST node, List<Expression> 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 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)

    - #### public ModuleNode buildAST(SourceUnit sourceUnit, ClassLoader classLoader, Reduction cst)

    - #### protected ClassNode buildName(antlr.collections.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(antlr.collections.AST node, List cases)

    - #### protected Expression castExpression(antlr.collections.AST castNode)

    - #### protected List<CatchStatement> 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 Expression enumArguments(antlr.collections.AST elist)

    - #### 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 String getFirstChildText(antlr.collections.AST node)

    - #### protected Expression gstring(antlr.collections.AST gstringNode)

    - #### protected boolean hasVisibility(int modifiers)

      Returns true if the modifiers flags contain a visibility modifier

    - #### protected String identifier(antlr.collections.AST node)

      Extracts an identifier from the Antlr AST

    - #### 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)

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

    - #### protected 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, Object value)

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

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

    - #### protected ClassNode makeType(antlr.collections.AST typeNode)

    - #### protected ClassNode makeTypeWithArguments(antlr.collections.AST rootNode)

    - #### protected MapEntryExpression mapEntryExpression(antlr.collections.AST node)

    - #### protected Expression mapExpression(antlr.collections.AST mapNode)

      Typically only used for map constructors I think?

    - #### 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, List<AnnotationNode> annotations, int defaultModifiers)

    - #### protected void notImplementedYet(antlr.collections.AST node)

    - #### protected void objectBlock(antlr.collections.AST objectBlock)

    - #### protected void objectInit(antlr.collections.AST init)

    - #### public 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)

    - #### public Reduction parseCST(SourceUnit sourceUnit, Reader reader)

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

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

    - #### protected void processAST()

    - #### public static 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, List<ClassNode> list)

    - #### protected void transformCSTIntoAST(SourceUnit sourceUnit, 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)