Table of Contents

Class TSourceTokenList

Namespace
gudusoft.gsqlparser
Assembly
gudusoft.gsqlparser.dll

List of source token.

public class TSourceTokenList : IEnumerable
Inheritance
TSourceTokenList
Implements
Inherited Members

Constructors

TSourceTokenList()

public TSourceTokenList()

Properties

Count

public int Count { get; }

Property Value

int

this[int]

public TSourceToken this[int pos] { get; }

Parameters

pos int

Property Value

TSourceToken

Methods

add(int, TSourceToken)

public virtual void add(int index, TSourceToken st)

Parameters

index int
st TSourceToken

add(TSourceToken)

public virtual void add(TSourceToken st)

Parameters

st TSourceToken

clear()

public virtual void clear()

get(int)

public virtual TSourceToken get(int index)

Parameters

index int

Returns

TSourceToken

hasNext()

public virtual bool hasNext()

Returns

bool

indexOf(TSourceToken)

public virtual int indexOf(TSourceToken pst)

Parameters

pst TSourceToken

Returns

int

next()

public virtual TSourceToken next()

Returns

TSourceToken

nextObjectNameToken(int, int, bool)

Search token of the next/previous object

public virtual int nextObjectNameToken(int ptokenpos, int pstep, bool pcmtissolidtoken)

Parameters

ptokenpos int

, search from this token, not included.

pstep int

pstep > 0 means search forward, < 0 means search backward

pcmtissolidtoken bool

, treat comment as solid token if it's true.

Returns

int

-1 means not found. If search next, then return position of the last token of qualified object name, if search previous, then return position of the first token of qualified object name.

nextsolidtoken(int, int, bool)

Find solid token start from ptoken, distance is pstep.

public virtual TSourceToken nextsolidtoken(int ptokenpos, int pstep, bool pcmtissolidtoken)

Parameters

ptokenpos int

Search start from this position, not include this token

pstep int

If pstep >0 then find solid token after ptoken, if pstep < 0 then find solid token before ptoken.

pcmtissolidtoken bool

If it's true then treat comment as solid token. @return

Returns

TSourceToken

nextsolidtoken(TSourceToken, int, bool)

Find solid token start from ptoken, distance is pstep.

public virtual TSourceToken nextsolidtoken(TSourceToken ptoken, int pstep, bool pcmtissolidtoken)

Parameters

ptoken TSourceToken

Search start from this token.

pstep int

If pstep >0 then find solid token after ptoken, if pstep < 0 then find solid token before ptoken.

pcmtissolidtoken bool

If it's true then treat comment as solid token. @return

Returns

TSourceToken

remove()

Not supportted yet.

public virtual void remove()

remove(int)

public virtual void remove(int index)

Parameters

index int

remove(TSourceToken)

public virtual void remove(TSourceToken st)

Parameters

st TSourceToken

resetiterator()

public virtual void resetiterator()

returnaftercurtoken(bool)

Is there linebreak after current token.

public virtual bool returnaftercurtoken(bool ignorecmt)

Parameters

ignorecmt bool

If it's true, ignore comment while searching linebreak. @return

Returns

bool

returnbeforecurtoken(bool)

Is there a linebreak before current token, comment is not ignored if ignorecomment is true, space is ignored. @return

public virtual bool returnbeforecurtoken(bool ignorecomment)

Parameters

ignorecomment bool

Returns

bool

searchLastTokenAtTheSameLine(int)

public int searchLastTokenAtTheSameLine(int pStart)

Parameters

pStart int

Returns

int

searchToken(int, string, TSourceToken, int)

public virtual TSourceToken searchToken(int targetTokenCode, string targetTokenText, TSourceToken startToken, int range)

Parameters

targetTokenCode int

, >0, search target token by token code; = 0, search target token by token text

targetTokenText string
startToken TSourceToken
range int

, > 0, search token after startToken = 0, just compare with this startToken, < 0, search token before startToken @return

Returns

TSourceToken

setTokenStatus(ETokenStatus, int, int)

public virtual void setTokenStatus(ETokenStatus ps, int pstart, int pend)

Parameters

ps ETokenStatus
pstart int
pend int

size()

public virtual int size()

Returns

int

solidtokenafterpos(int, int, int, string)

Search token by token code, start from pStart within range pSteps, and ignore pIngoreThisString if any during searching. Ingore non-solid token while searching.

public virtual int solidtokenafterpos(int pStart, int pTokenCode, int pSteps, string pIgnoreThisString)

Parameters

pStart int

Start from this position.

pTokenCode int

TokenCode that search for.

pSteps int

Must > 0.

pIgnoreThisString string

String to be ignored.

Returns

int

0 if no token found, otherwise, return position in sourcetoken list.

solidtokenbefore(int)

Search solid token before pStart.

public virtual TSourceToken solidtokenbefore(int pStart)

Parameters

pStart int

Returns

TSourceToken

return null if no token found.

sqlplusaftercurtoken()

public virtual bool sqlplusaftercurtoken()

Returns

bool