Package org.codehaus.groovy.syntax
Class ASTHelper
java.lang.Object
org.codehaus.groovy.syntax.ASTHelper
- Direct Known Subclasses:
AntlrParserPlugin
public class ASTHelper
extends java.lang.Object
A common base class of AST helper methods which can be shared across the classic and new parsers
-
Field Summary
Fields Modifier and Type Field Description protected ModuleNode
output
protected static java.util.Map
resolutions
-
Constructor Summary
Constructors Constructor Description ASTHelper()
ASTHelper(SourceUnit controller, java.lang.ClassLoader classLoader)
-
Method Summary
Modifier and Type Method Description protected void
addImport(ClassNode type, java.lang.String name, java.lang.String aliasName)
protected void
addImport(ClassNode type, java.lang.String name, java.lang.String aliasName, java.util.List<AnnotationNode> annotations)
protected void
addStarImport(java.lang.String importPackage)
protected void
addStarImport(java.lang.String importPackage, java.util.List<AnnotationNode> annotations)
protected void
addStaticImport(ClassNode type, java.lang.String name, java.lang.String alias)
protected void
addStaticImport(ClassNode type, java.lang.String name, java.lang.String alias, java.util.List<AnnotationNode> annotations)
protected void
addStaticStarImport(ClassNode type, java.lang.String importClass)
protected void
addStaticStarImport(ClassNode type, java.lang.String importClass, java.util.List<AnnotationNode> annotations)
protected java.lang.String
dot(java.lang.String base)
A synonym fordot( base, "" )
.static java.lang.String
dot(java.lang.String base, java.lang.String name)
java.lang.ClassLoader
getClassLoader()
Returns our class loader (as supplied on construction).SourceUnit
getController()
java.lang.String
getPackageName()
protected void
makeModule()
void
setClassLoader(java.lang.ClassLoader classLoader)
void
setController(SourceUnit controller)
PackageNode
setPackage(java.lang.String packageName, java.util.List<AnnotationNode> annotations)
void
setPackageName(java.lang.String packageName)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
output
-
resolutions
protected static final java.util.Map resolutions
-
-
Constructor Details
-
ASTHelper
-
ASTHelper
public ASTHelper()
-
-
Method Details
-
getPackageName
public java.lang.String getPackageName() -
setPackageName
public void setPackageName(java.lang.String packageName) -
setPackage
public PackageNode setPackage(java.lang.String packageName, java.util.List<AnnotationNode> annotations) -
getClassLoader
public java.lang.ClassLoader getClassLoader()Returns our class loader (as supplied on construction). -
setClassLoader
public void setClassLoader(java.lang.ClassLoader classLoader) -
getController
-
setController
-
dot
public static java.lang.String dot(java.lang.String base, java.lang.String name)- Parameters:
base
- typically a packagename
- typically a simple unqualified class name- Returns:
- Two names joined by a dot. If the base name is empty, returns the name unchanged.
-
makeModule
protected void makeModule() -
dot
protected java.lang.String dot(java.lang.String base)A synonym fordot( base, "" )
. -
addImport
-
addImport
protected void addImport(ClassNode type, java.lang.String name, java.lang.String aliasName, java.util.List<AnnotationNode> annotations) -
addStaticImport
-
addStaticImport
protected void addStaticImport(ClassNode type, java.lang.String name, java.lang.String alias, java.util.List<AnnotationNode> annotations) -
addStaticStarImport
-
addStaticStarImport
protected void addStaticStarImport(ClassNode type, java.lang.String importClass, java.util.List<AnnotationNode> annotations) -
addStarImport
protected void addStarImport(java.lang.String importPackage) -
addStarImport
protected void addStarImport(java.lang.String importPackage, java.util.List<AnnotationNode> annotations)
-