Package org.codehaus.groovy.antlr
Class GroovySourceToken
java.lang.Object
antlr.Token
org.codehaus.groovy.antlr.GroovySourceToken
- All Implemented Interfaces:
Cloneable,SourceInfo
This is a Token sub class to track line information
- Author:
- Jochen Theodorou
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected intprotected intprotected StringFields inherited from class antlr.Token
badToken, EOF_TYPE, INVALID_TYPE, MIN_USER_TYPE, NULL_TREE_LOOKAHEAD, SKIP, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintget starting columnintget ending columnintgetLine()get start lineintget ending linegetText()get the source token textvoidsetColumn(int c) set start columnvoidsetColumnLast(int colLast) set ending columnvoidsetLine(int l) set start linevoidsetLineLast(int lineLast) set ending linevoidset the source token texttoString()Methods inherited from class antlr.Token
getFilename, getType, setFilename, setType
-
Field Details
-
line
protected int line -
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 classantlr.Token- Returns:
- the starting line
-
getText
get the source token text- Overrides:
getTextin classantlr.Token- Returns:
- the source token text
-
setLine
public void setLine(int l) Description copied from interface:SourceInfoset start line- Specified by:
setLinein interfaceSourceInfo- Overrides:
setLinein classantlr.Token- Parameters:
l- the line
-
setText
set the source token text- Overrides:
setTextin classantlr.Token- Parameters:
s- the text
-
toString
- Overrides:
toStringin classantlr.Token
-
getColumn
public int getColumn()Description copied from interface:SourceInfoget starting column- Specified by:
getColumnin interfaceSourceInfo- Overrides:
getColumnin classantlr.Token- Returns:
- the starting column
-
setColumn
public void setColumn(int c) Description copied from interface:SourceInfoset start column- Specified by:
setColumnin interfaceSourceInfo- Overrides:
setColumnin classantlr.Token- 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
-