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
Modifier and TypeFieldDescriptionprotected int
protected int
protected int
protected int
protected String
Fields inherited from class antlr.Token
badToken, EOF_TYPE, INVALID_TYPE, MIN_USER_TYPE, NULL_TREE_LOOKAHEAD, SKIP, type
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
get starting columnint
get ending columnint
getLine()
get start lineint
get ending linegetText()
get the source token textvoid
setColumn
(int c) set start columnvoid
setColumnLast
(int colLast) set ending columnvoid
setLine
(int l) set start linevoid
setLineLast
(int lineLast) set ending linevoid
set 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:SourceInfo
get start line- Specified by:
getLine
in interfaceSourceInfo
- Overrides:
getLine
in classantlr.Token
- Returns:
- the starting line
-
getText
get the source token text- Overrides:
getText
in classantlr.Token
- Returns:
- the source token text
-
setLine
public void setLine(int l) Description copied from interface:SourceInfo
set start line- Specified by:
setLine
in interfaceSourceInfo
- Overrides:
setLine
in classantlr.Token
- Parameters:
l
- the line
-
setText
set the source token text- Overrides:
setText
in classantlr.Token
- Parameters:
s
- the text
-
toString
- Overrides:
toString
in classantlr.Token
-
getColumn
public int getColumn()Description copied from interface:SourceInfo
get starting column- Specified by:
getColumn
in interfaceSourceInfo
- Overrides:
getColumn
in classantlr.Token
- Returns:
- the starting column
-
setColumn
public void setColumn(int c) Description copied from interface:SourceInfo
set start column- Specified by:
setColumn
in interfaceSourceInfo
- Overrides:
setColumn
in classantlr.Token
- Parameters:
c
- the column
-
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
-