Package org.codehaus.groovy.syntax
Class ASTHelper
java.lang.Object
org.codehaus.groovy.syntax.ASTHelper
- Direct Known Subclasses:
AntlrParserPlugin
public class ASTHelper extends 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 Map
resolutions
-
Constructor Summary
Constructors Constructor Description ASTHelper()
ASTHelper(SourceUnit controller, ClassLoader classLoader)
-
Method Summary
Modifier and Type Method Description protected void
addImport(ClassNode type, String name, String aliasName)
protected void
addImport(ClassNode type, String name, String aliasName, List<AnnotationNode> annotations)
protected void
addStarImport(String importPackage)
protected void
addStarImport(String importPackage, List<AnnotationNode> annotations)
protected void
addStaticImport(ClassNode type, String name, String alias)
protected void
addStaticImport(ClassNode type, String name, String alias, List<AnnotationNode> annotations)
protected void
addStaticStarImport(ClassNode type, String importClass)
protected void
addStaticStarImport(ClassNode type, String importClass, List<AnnotationNode> annotations)
protected String
dot(String base)
A synonym fordot( base, "" )
.static String
dot(String base, String name)
ClassLoader
getClassLoader()
Returns our class loader (as supplied on construction).SourceUnit
getController()
String
getPackageName()
protected void
makeModule()
void
setClassLoader(ClassLoader classLoader)
void
setController(SourceUnit controller)
PackageNode
setPackage(String packageName, List<AnnotationNode> annotations)
void
setPackageName(String packageName)
-
Field Details
-
output
-
resolutions
-
-
Constructor Details
-
ASTHelper
-
ASTHelper
public ASTHelper()
-
-
Method Details
-
getPackageName
-
setPackageName
-
setPackage
-
getClassLoader
Returns our class loader (as supplied on construction). -
setClassLoader
-
getController
-
setController
-
dot
- 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
A synonym fordot( base, "" )
. -
addImport
-
addImport
protected void addImport(ClassNode type, String name, String aliasName, List<AnnotationNode> annotations) -
addStaticImport
-
addStaticImport
protected void addStaticImport(ClassNode type, String name, String alias, List<AnnotationNode> annotations) -
addStaticStarImport
-
addStaticStarImport
protected void addStaticStarImport(ClassNode type, String importClass, List<AnnotationNode> annotations) -
addStarImport
-
addStarImport
-