Package org.codehaus.groovy.antlr
Class GroovySourceAST
- java.lang.Object
-
- antlr.BaseAST
-
- antlr.CommonAST
-
- org.codehaus.groovy.antlr.GroovySourceAST
-
- All Implemented Interfaces:
AST
,Serializable
,Comparable
,SourceInfo
public class GroovySourceAST extends CommonAST implements Comparable, SourceInfo
We have an AST subclass so we can track source information. Very odd that ANTLR doesn't do this by default.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GroovySourceAST()
GroovySourceAST(Token t)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GroovySourceAST
childAt(int position)
GroovySourceAST
childOfType(int type)
List<GroovySourceAST>
childrenOfType(int type)
int
compareTo(Object object)
int
getColumn()
get starting columnint
getColumnLast()
get ending columnint
getLine()
get start lineint
getLineLast()
get ending lineString
getSnippet()
void
initialize(AST ast)
void
initialize(Token t)
void
setColumn(int column)
set start columnvoid
setColumnLast(int colLast)
set ending columnvoid
setLast(Token last)
void
setLine(int line)
set start linevoid
setLineLast(int lineLast)
set ending linevoid
setSnippet(String snippet)
-
Methods inherited from class antlr.BaseAST
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, getNumberOfChildren, getTokenNames, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toString, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
-
-
-
-
Constructor Detail
-
GroovySourceAST
public GroovySourceAST()
-
GroovySourceAST
public GroovySourceAST(Token t)
-
-
Method Detail
-
initialize
public void initialize(AST ast)
- Specified by:
initialize
in interfaceAST
- Overrides:
initialize
in classCommonAST
-
initialize
public void initialize(Token t)
- Specified by:
initialize
in interfaceAST
- Overrides:
initialize
in classCommonAST
-
setLast
public void setLast(Token last)
-
getLineLast
public int getLineLast()
Description copied from interface:SourceInfo
get ending line- Specified by:
getLineLast
in interfaceSourceInfo
- Returns:
- the ending line
-
setLineLast
public void setLineLast(int lineLast)
Description copied from interface:SourceInfo
set ending line- Specified by:
setLineLast
in interfaceSourceInfo
- Parameters:
lineLast
- the line
-
getColumnLast
public int getColumnLast()
Description copied from interface:SourceInfo
get ending column- Specified by:
getColumnLast
in interfaceSourceInfo
- Returns:
- the ending column
-
setColumnLast
public void setColumnLast(int colLast)
Description copied from interface:SourceInfo
set ending column- Specified by:
setColumnLast
in interfaceSourceInfo
- Parameters:
colLast
- the column
-
setLine
public void setLine(int line)
Description copied from interface:SourceInfo
set start line- Specified by:
setLine
in interfaceSourceInfo
- Parameters:
line
- the line
-
getLine
public int getLine()
Description copied from interface:SourceInfo
get start line
-
setColumn
public void setColumn(int column)
Description copied from interface:SourceInfo
set start column- Specified by:
setColumn
in interfaceSourceInfo
- Parameters:
column
- the column
-
getColumn
public int getColumn()
Description copied from interface:SourceInfo
get starting column
-
setSnippet
public void setSnippet(String snippet)
-
getSnippet
public String getSnippet()
-
compareTo
public int compareTo(Object object)
- Specified by:
compareTo
in interfaceComparable
-
childAt
public GroovySourceAST childAt(int position)
-
childOfType
public GroovySourceAST childOfType(int type)
-
childrenOfType
public List<GroovySourceAST> childrenOfType(int type)
-
-