Top Description Fields Constructors Methods
org.codehaus.groovy.antlr

public Class GroovySourceAST

extends CommonAST
implements Comparable, SourceInfo
Class Inheritance
All Implemented Interfaces
org.codehaus.groovy.antlr.SourceInfo, java.lang.Comparable
Imports
antlr.CommonAST, .Token, antlr.collections.AST, java.util.ArrayList, .List

We have an AST subclass so we can track source information. Very odd that ANTLR doesn't do this by default.

Field Summary

Modifier and TypeField and Description
private int
private int
private int
private int
private static final long
private String

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public GroovySourceAST
childAt(int position)

public GroovySourceAST
childOfType(int type)

public List<GroovySourceAST>
childrenOfType(int type)

public int
compareTo(Object
the object to be compared.
object
)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.
public int
public int
public int
public int
public String
public void
public void
public void
setColumn(int
the column
column
)

Implements org.codehaus.groovy.antlr.SourceInfo.setColumn.

set start column
public void
setColumnLast(int
the column
colLast
)

Implements org.codehaus.groovy.antlr.SourceInfo.setColumnLast.

set ending column
public void
setLast(Token last)

public void
setLine(int
the line
line
)

Implements org.codehaus.groovy.antlr.SourceInfo.setLine.

set start line
public void
setLineLast(int
the line
lineLast
)

Implements org.codehaus.groovy.antlr.SourceInfo.setLineLast.

set ending line
public void
setSnippet(String snippet)

Inherited from antlr.CommonAST:
getTextgetTypeinitializesetTextsetType

Field Detail

colback to summary
private int col
colLastback to summary
private int colLast
lineback to summary
private int line
lineLastback to summary
private int lineLast
serialVersionUIDback to summary
private static final long serialVersionUID
snippetback to summary
private String snippet

Constructor Detail

GroovySourceASTback to summary
public GroovySourceAST()
GroovySourceASTback to summary
public GroovySourceAST(Token t)

Method Detail

childAtback to summary
public GroovySourceAST childAt(int position)
childOfTypeback to summary
public GroovySourceAST childOfType(int type)
childrenOfTypeback to summary
public List<GroovySourceAST> childrenOfType(int type)
compareToback to summary
public int compareTo(Object object)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
object:Object

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

getColumnback to summary
public int getColumn()

Overrides antlr.BaseAST.getColumn.

Implements org.codehaus.groovy.antlr.SourceInfo.getColumn, antlr.collections.AST.getColumn.

Doc from org.codehaus.groovy.antlr.SourceInfo.getColumn.

get starting column

Returns:int

the starting column

getColumnLastback to summary
public int getColumnLast()

Implements org.codehaus.groovy.antlr.SourceInfo.getColumnLast.

Doc from org.codehaus.groovy.antlr.SourceInfo.getColumnLast.

get ending column

Returns:int

the ending column

getLineback to summary
public int getLine()

Overrides antlr.BaseAST.getLine.

Implements org.codehaus.groovy.antlr.SourceInfo.getLine, antlr.collections.AST.getLine.

Doc from org.codehaus.groovy.antlr.SourceInfo.getLine.

get start line

Returns:int

the starting line

getLineLastback to summary
public int getLineLast()

Implements org.codehaus.groovy.antlr.SourceInfo.getLineLast.

Doc from org.codehaus.groovy.antlr.SourceInfo.getLineLast.

get ending line

Returns:int

the ending line

getSnippetback to summary
public String getSnippet()
initializeback to summary
public void initialize(AST ast)

Overrides antlr.CommonAST.initialize.

Implements antlr.collections.AST.initialize.

initializeback to summary
public void initialize(Token t)

Overrides antlr.CommonAST.initialize.

Implements antlr.collections.AST.initialize.

setColumnback to summary
public void setColumn(int column)

Implements org.codehaus.groovy.antlr.SourceInfo.setColumn.

Doc from org.codehaus.groovy.antlr.SourceInfo.setColumn.

set start column

Parameters
column:int

the column

setColumnLastback to summary
public void setColumnLast(int colLast)

Implements org.codehaus.groovy.antlr.SourceInfo.setColumnLast.

Doc from org.codehaus.groovy.antlr.SourceInfo.setColumnLast.

set ending column

Parameters
colLast:int

the column

setLastback to summary
public void setLast(Token last)
setLineback to summary
public void setLine(int line)

Implements org.codehaus.groovy.antlr.SourceInfo.setLine.

Doc from org.codehaus.groovy.antlr.SourceInfo.setLine.

set start line

Parameters
line:int

the line

setLineLastback to summary
public void setLineLast(int lineLast)

Implements org.codehaus.groovy.antlr.SourceInfo.setLineLast.

Doc from org.codehaus.groovy.antlr.SourceInfo.setLineLast.

set ending line

Parameters
lineLast:int

the line

setSnippetback to summary
public void setSnippet(String snippet)