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
,Serializable
,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:
-
Field Summary
Fields inherited from class antlr.BaseAST
down, right
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionchildAt
(int position) childOfType
(int type) childrenOfType
(int type) int
int
get starting columnint
get ending columnint
getLine()
get start lineint
get ending linevoid
initialize
(antlr.collections.AST ast) void
initialize
(antlr.Token t) void
setColumn
(int column) set start columnvoid
setColumnLast
(int colLast) set ending columnvoid
setLast
(antlr.Token last) void
setLine
(int line) set start linevoid
setLineLast
(int lineLast) set ending linevoid
setSnippet
(String snippet) Methods inherited from class antlr.CommonAST
getText, getType, initialize, setText, setType
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 Details
-
GroovySourceAST
public GroovySourceAST() -
GroovySourceAST
public GroovySourceAST(antlr.Token t)
-
-
Method Details
-
initialize
public void initialize(antlr.collections.AST ast) - Specified by:
initialize
in interfaceantlr.collections.AST
- Overrides:
initialize
in classantlr.CommonAST
-
initialize
public void initialize(antlr.Token t) - Specified by:
initialize
in interfaceantlr.collections.AST
- Overrides:
initialize
in classantlr.CommonAST
-
setLast
public void setLast(antlr.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- Specified by:
getLine
in interfaceantlr.collections.AST
- Specified by:
getLine
in interfaceSourceInfo
- Overrides:
getLine
in classantlr.BaseAST
- Returns:
- the starting 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- Specified by:
getColumn
in interfaceantlr.collections.AST
- Specified by:
getColumn
in interfaceSourceInfo
- Overrides:
getColumn
in classantlr.BaseAST
- Returns:
- the starting column
-
setSnippet
-
getSnippet
-
compareTo
- Specified by:
compareTo
in interfaceComparable
-
childAt
-
childOfType
-
childrenOfType
-