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
-
-
Constructor Summary
Constructors Constructor Description GroovySourceAST()GroovySourceAST(Token t)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GroovySourceASTchildAt(int position)GroovySourceASTchildOfType(int type)java.util.List<GroovySourceAST>childrenOfType(int type)intcompareTo(java.lang.Object object)intgetColumn()get starting columnintgetColumnLast()get ending columnintgetLine()get start lineintgetLineLast()get ending linejava.lang.StringgetSnippet()voidinitialize(AST ast)voidinitialize(Token t)voidsetColumn(int column)set start columnvoidsetColumnLast(int colLast)set ending columnvoidsetLast(Token last)voidsetLine(int line)set start linevoidsetLineLast(int lineLast)set ending linevoidsetSnippet(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
-
-
-
-
Constructor Detail
-
GroovySourceAST
public GroovySourceAST()
-
GroovySourceAST
public GroovySourceAST(Token t)
-
-
Method Detail
-
initialize
public void initialize(AST ast)
- Specified by:
initializein interfaceAST- Overrides:
initializein classCommonAST
-
initialize
public void initialize(Token t)
- Specified by:
initializein interfaceAST- Overrides:
initializein classCommonAST
-
setLast
public void setLast(Token last)
-
getLineLast
public int getLineLast()
Description copied from interface:SourceInfoget ending line- Specified by:
getLineLastin interfaceSourceInfo- Returns:
- the ending line
-
setLineLast
public void setLineLast(int lineLast)
Description copied from interface:SourceInfoset ending line- Specified by:
setLineLastin interfaceSourceInfo- Parameters:
lineLast- the line
-
getColumnLast
public int getColumnLast()
Description copied from interface:SourceInfoget ending column- Specified by:
getColumnLastin interfaceSourceInfo- Returns:
- the ending column
-
setColumnLast
public void setColumnLast(int colLast)
Description copied from interface:SourceInfoset ending column- Specified by:
setColumnLastin interfaceSourceInfo- Parameters:
colLast- the column
-
setLine
public void setLine(int line)
Description copied from interface:SourceInfoset start line- Specified by:
setLinein interfaceSourceInfo- Parameters:
line- the line
-
getLine
public int getLine()
Description copied from interface:SourceInfoget start line
-
setColumn
public void setColumn(int column)
Description copied from interface:SourceInfoset start column- Specified by:
setColumnin interfaceSourceInfo- Parameters:
column- the column
-
getColumn
public int getColumn()
Description copied from interface:SourceInfoget 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:
compareToin interfacejava.lang.Comparable
-
childAt
public GroovySourceAST childAt(int position)
-
childOfType
public GroovySourceAST childOfType(int type)
-
childrenOfType
public java.util.List<GroovySourceAST> childrenOfType(int type)
-
-