Package org.codehaus.groovy.antlr
Class GroovySourceAST
- java.lang.Object
-
- antlr.BaseAST
-
- antlr.CommonAST
-
- org.codehaus.groovy.antlr.GroovySourceAST
-
- All Implemented Interfaces:
antlr.collections.AST,java.io.Serializable,java.lang.Comparable,SourceInfo
public class GroovySourceAST extends antlr.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(antlr.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(antlr.collections.AST ast)voidinitialize(antlr.Token t)voidsetColumn(int column)set start columnvoidsetColumnLast(int colLast)set ending columnvoidsetLast(antlr.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
-
-
-
-
Method Detail
-
initialize
public void initialize(antlr.collections.AST ast)
- Specified by:
initializein interfaceantlr.collections.AST- Overrides:
initializein classantlr.CommonAST
-
initialize
public void initialize(antlr.Token t)
- Specified by:
initializein interfaceantlr.collections.AST- Overrides:
initializein classantlr.CommonAST
-
setLast
public void setLast(antlr.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- Specified by:
getLinein interfaceantlr.collections.AST- Specified by:
getLinein interfaceSourceInfo- Overrides:
getLinein classantlr.BaseAST- Returns:
- the starting 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- Specified by:
getColumnin interfaceantlr.collections.AST- Specified by:
getColumnin interfaceSourceInfo- Overrides:
getColumnin classantlr.BaseAST- Returns:
- the 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)
-
-