Package org.codehaus.groovy.antlr
Class GroovySourceToken
java.lang.Object
antlr.Token
org.codehaus.groovy.antlr.GroovySourceToken
- All Implemented Interfaces:
java.lang.Cloneable,SourceInfo
public class GroovySourceToken extends Token implements SourceInfo
This is a Token sub class to track line information
-
Field Summary
Fields Modifier and Type Field Description protected intcolprotected intcolLastprotected intlineprotected intlineLastprotected java.lang.StringtextFields inherited from class antlr.Token
badToken, EOF_TYPE, INVALID_TYPE, MIN_USER_TYPE, NULL_TREE_LOOKAHEAD, SKIP, type -
Constructor Summary
Constructors Constructor Description GroovySourceToken(int t)Constructor using a token type -
Method Summary
Modifier and Type Method Description intgetColumn()get starting columnintgetColumnLast()get ending columnintgetLine()get start lineintgetLineLast()get ending linejava.lang.StringgetText()get the source token textvoidsetColumn(int c)set start columnvoidsetColumnLast(int colLast)set ending columnvoidsetLine(int l)set start linevoidsetLineLast(int lineLast)set ending linevoidsetText(java.lang.String s)set the source token textjava.lang.StringtoString()Methods inherited from class antlr.Token
getFilename, getType, setFilename, setTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
line
protected int line -
text
protected java.lang.String text -
col
protected int col -
lineLast
protected int lineLast -
colLast
protected int colLast
-
-
Constructor Details
-
GroovySourceToken
public GroovySourceToken(int t)Constructor using a token type- Parameters:
t- the type
-
-
Method Details
-
getLine
public int getLine()Description copied from interface:SourceInfoget start line- Specified by:
getLinein interfaceSourceInfo- Overrides:
getLinein classToken- Returns:
- the starting line
-
getText
public java.lang.String getText()get the source token text -
setLine
public void setLine(int l)Description copied from interface:SourceInfoset start line- Specified by:
setLinein interfaceSourceInfo- Overrides:
setLinein classToken- Parameters:
l- the line
-
setText
public void setText(java.lang.String s)set the source token text -
toString
public java.lang.String toString() -
getColumn
public int getColumn()Description copied from interface:SourceInfoget starting column- Specified by:
getColumnin interfaceSourceInfo- Overrides:
getColumnin classToken- Returns:
- the starting column
-
setColumn
public void setColumn(int c)Description copied from interface:SourceInfoset start column- Specified by:
setColumnin interfaceSourceInfo- Overrides:
setColumnin classToken- Parameters:
c- the column
-
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
-