public abstract class TokenBase extends antlr.Token implements ICMToken, ISourceLocation
badToken, EOF_TYPE, INVALID_TYPE, MIN_USER_TYPE, NULL_TREE_LOOKAHEAD, SKIP, typeUNKNOWN| Constructor and Description |
|---|
TokenBase(int tokenType,
int start,
int end,
int line,
int column,
CharSequence text)
Constructor
|
TokenBase(TokenBase o)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
adjustLocation(int offsetAdjustment,
int lineAdjustment,
int columnAdjustment)
Adjust all associated offsets by the adjustment amount
|
void |
adjustOffsets(int offsetAdjustment)
Adjust all associated offsets by the adjustment amount
|
int |
getAbsoluteEnd()
Gets the absolute starting offset.
|
int |
getAbsoluteStart()
Gets the absolute starting offset.
|
CharSequence |
getCharSequence()
Returns the underlying CharSequence that represents the contents of this
token
|
int |
getColumn()
Returns the column of this token.
|
int |
getEnd()
Returns the end offset of this token
|
int |
getEndColumn()
Gets the local column number at the end.
|
int |
getEndLine()
Gets the local line number at the end.
|
int |
getLine()
Returns the line of this token..
|
int |
getLocalEnd() |
int |
getLocalStart() |
String |
getSourcePath()
Get the source file path of the node.
|
int |
getStart()
Returns the start offset of this token
|
String |
getText()
Get the text represented by this token
|
protected abstract String |
getTypeString() |
boolean |
isImplicit()
Determine whether or not this token is bogus (i.e. the start and end
offsets are the same, which implies that it was inserted from an included
file or during token fixup)
|
boolean |
isLocked()
Returns whether this token can be overwritten when it is a member of a
token pool
|
void |
lock()
Locks this token.
|
boolean |
matchesLine(TokenBase other) |
void |
reuse(int tokenType,
int start,
int end,
int line,
int column,
CharSequence text) |
void |
setColumn(int column) |
void |
setEnd(int end) |
void |
setEndColumn(int column) |
void |
setEndLine(int line) |
void |
setLine(int line) |
void |
setLocation(int start,
int end,
int line,
int column) |
void |
setSourcePath(String path) |
void |
setStart(int start) |
void |
setText(CharSequence text)
Set the CharSequence represented by this token
|
void |
setText(String text)
Set the text represented by this token
|
void |
storeLocalOffset()
Capture the current start/end offsets as this token's local offsets.
|
String |
toDumpString()
For debugging only.
|
String |
toString()
For debugging only.
|
void |
truncate(int trimLeft,
int trimRight)
Reduce the span of the token by removing characters from the beginning
and end.
|
boolean |
verify()
Verifies that this token has its type and location information set.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitchangeType, getTypepublic TokenBase(int tokenType,
int start,
int end,
int line,
int column,
CharSequence text)
tokenType - type of tokenstart - location location informationend - location location informationline - location location informationcolumn - location location informationtext - actual text represented by tokenpublic TokenBase(TokenBase o)
o - token to copyprotected abstract String getTypeString()
public final int getLocalStart()
public final int getLocalEnd()
public final void reuse(int tokenType,
int start,
int end,
int line,
int column,
CharSequence text)
public void lock()
public boolean isLocked()
public String getText()
public CharSequence getCharSequence()
CharSequence or nullpublic void setText(String text)
setText in class antlr.Tokentext - text represented by this tokenToken.setText(java.lang.String)public void setText(CharSequence text)
text - text represented by this tokenpublic void setLocation(int start,
int end,
int line,
int column)
public int getStart()
ICMTokengetStart in interface ISourceLocationgetStart in interface ICMTokenpublic void setStart(int start)
public int getEnd()
ICMTokengetEnd in interface ISourceLocationgetEnd in interface ICMTokenpublic void setEnd(int end)
public int getLine()
ICMTokengetLine in interface ISourceLocationgetLine in interface ICMTokengetLine in class antlr.Tokenpublic void setLine(int line)
setLine in class antlr.Tokenpublic final boolean matchesLine(TokenBase other)
public int getColumn()
ICMTokengetColumn in interface ISourceLocationgetColumn in interface ICMTokengetColumn in class antlr.Tokenpublic void setColumn(int column)
setColumn in class antlr.Tokenpublic int getEndLine()
ISourceLocationgetEndLine in interface ISourceLocationpublic void setEndLine(int line)
public int getEndColumn()
ISourceLocationgetEndColumn in interface ISourceLocationpublic void setEndColumn(int column)
public boolean isImplicit()
isImplicit in interface ICMTokenpublic String toString()
toString in class antlr.Tokenpublic String toDumpString()
public void truncate(int trimLeft,
int trimRight)
trimLeft - number of characters to remove from the left of the tokentrimRight - number of characters to remove from the right of the
tokenpublic void adjustOffsets(int offsetAdjustment)
offsetAdjustment - amount to add to offsetspublic void adjustLocation(int offsetAdjustment,
int lineAdjustment,
int columnAdjustment)
offsetAdjustment - amount to add to offsetslineAdjustment - amount to add to the line numbercolumnAdjustment - amount to add to the column numberpublic final void storeLocalOffset()
StreamingASTokenizer#nextTokenFromReader()
after the token is initialized, and before being updated by
IncludeHandler.onNextToken(org.apache.flex.compiler.internal.parsing.as.ASToken).public final String getSourcePath()
ICMToken
The source path will be copied to ISourceLocation.getSourcePath() during
tree construction.
getSourcePath in interface ISourceLocationgetSourcePath in interface ICMTokenpublic final void setSourcePath(String path)
public boolean verify()
This is used only in asserts.
public int getAbsoluteEnd()
ISourceLocationgetAbsoluteEnd in interface ISourceLocationpublic int getAbsoluteStart()
ISourceLocationgetAbsoluteStart in interface ISourceLocationCopyright © 2016 The Apache Software Foundation. All rights reserved.