|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgudusoft.gsqlparser.TSourceToken
public class TSourceToken
Source token is the basic syntactical unit of SQL. A token is a sequence of one or more characters. A token can be an identifier, a constant, a special charactor or an operator. TSourceToken is the basic element of other classes such as TConstant, TObjectName.
Field Summary | |
---|---|
TSourceToken |
alternativeToken
|
java.lang.String |
astext
Text representation for current token. |
long |
columnNo
the column number of the first character for current token. |
TSourceTokenList |
container
Container for current token. |
long |
lineNo
the line number of the first character for current token. |
long |
offset
|
int |
posinlist
Position in the container, start from 0 |
TCustomSqlStatement |
stmt
position in activeTokenList, start from 0 |
int |
tag
|
int |
tokencode
Numberic code of this token used by parser internally. |
ETokenStatus |
tokenstatus
|
ETokenType |
tokentype
|
Constructor Summary | |
---|---|
TSourceToken()
|
|
TSourceToken(java.lang.String s)
|
Method Summary | |
---|---|
TSourceToken |
getAlternativeToken()
If you find a start token of parse tree node has an alternativetoken, |
int |
getDbObjType()
|
EDbVendor |
getDbvendor()
|
TGSqlParser |
getGsqlparser()
|
TParseTreeNodeList |
getNodesEndWithThisToken()
|
TParseTreeNodeList |
getNodesStartFromThisToken()
|
TSourceToken |
getReplaceToken()
|
TSourceTokenList |
getTokensAfter()
|
TSourceTokenList |
getTokensBefore()
|
boolean |
isnonsolidtoken()
Is current token a solid token or not. |
static boolean |
isnonsolidtoken(ETokenType tokentype)
Token except ttwhitespace,ttreturn,ttsimplecomment,ttbracketedcomment is solid token. |
boolean |
issolidtoken()
Is current token a non-solid token or not. |
int |
removeMyFromTokenList()
|
TSourceToken |
searchToken(int targetTokenCode,
int range)
|
TSourceToken |
searchToken(java.lang.String targetTokenText,
int range)
|
void |
setAlternativeToken(TSourceToken alternativeToken)
|
void |
setDbObjType(int dbObjType)
|
void |
setDbvendor(EDbVendor dbvendor)
|
void |
setGsqlparser(TGSqlParser gsqlparser)
|
void |
setReplaceToken(TSourceToken replaceToken)
|
void |
setString(java.lang.String str)
set new string of this token |
java.lang.String |
toString()
Original text for current token. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int tokencode
public long lineNo
public long columnNo
public long offset
public ETokenType tokentype
public TSourceTokenList container
public int posinlist
public java.lang.String astext
public ETokenStatus tokenstatus
public TCustomSqlStatement stmt
public int tag
public TSourceToken alternativeToken
Constructor Detail |
---|
public TSourceToken()
public TSourceToken(java.lang.String s)
Method Detail |
---|
public TGSqlParser getGsqlparser()
public void setGsqlparser(TGSqlParser gsqlparser)
public TParseTreeNodeList getNodesEndWithThisToken()
public TParseTreeNodeList getNodesStartFromThisToken()
public void setDbObjType(int dbObjType)
public int getDbObjType()
public void setAlternativeToken(TSourceToken alternativeToken)
public TSourceToken getAlternativeToken()
If you find a start token of parse tree node has an alternativetoken,
then text of this node should be modified by using TParseTreeNode.setString(String sqlSegment)
1. new string will be tokenized into a list of source tokens: stlist
2. link alternativetoken of start token of this node to the first token in stlist generated in step 1.
3. link back alternativetoken of last token in stlist to the last token of this node.
public void setDbvendor(EDbVendor dbvendor)
public EDbVendor getDbvendor()
public void setString(java.lang.String str)
str
- public java.lang.String toString()
toString
in class java.lang.Object
public static boolean isnonsolidtoken(ETokenType tokentype)
tokentype
-
public boolean isnonsolidtoken()
public boolean issolidtoken()
public TSourceTokenList getTokensAfter()
public TSourceTokenList getTokensBefore()
public void setReplaceToken(TSourceToken replaceToken)
public TSourceToken getReplaceToken()
public TSourceToken searchToken(int targetTokenCode, int range)
public TSourceToken searchToken(java.lang.String targetTokenText, int range)
public int removeMyFromTokenList()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |