Package org.codehaus.groovy.antlr
Class GroovySourceAST
java.lang.Object
antlr.BaseAST
antlr.CommonAST
org.codehaus.groovy.antlr.GroovySourceAST
- All Implemented Interfaces:
AST
,java.io.Serializable
,java.lang.Comparable
,SourceInfo
public class GroovySourceAST extends CommonAST implements java.lang.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
-
Field Summary
-
Constructor Summary
Constructors Constructor Description GroovySourceAST()
GroovySourceAST(Token t)
-
Method Summary
Modifier and Type Method Description GroovySourceAST
childAt(int position)
GroovySourceAST
childOfType(int type)
java.util.List<GroovySourceAST>
childrenOfType(int type)
int
compareTo(java.lang.Object object)
int
getColumn()
get starting columnint
getColumnLast()
get ending columnint
getLine()
get start lineint
getLineLast()
get ending linejava.lang.String
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(java.lang.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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
GroovySourceAST
public GroovySourceAST() -
GroovySourceAST
-
-
Method Details
-
initialize
- Specified by:
initialize
in interfaceAST
- Overrides:
initialize
in classCommonAST
-
initialize
- Specified by:
initialize
in interfaceAST
- Overrides:
initialize
in classCommonAST
-
setLast
-
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(java.lang.String snippet) -
getSnippet
public java.lang.String getSnippet() -
compareTo
public int compareTo(java.lang.Object object)- Specified by:
compareTo
in interfacejava.lang.Comparable
-
childAt
-
childOfType
-
childrenOfType
-