C# Class Antlr.Runtime.LegacyCommonTokenStream

Inheritance: ITokenStream
Afficher le fichier Open project: antlr/antlrcs

Protected Properties

Свойство Type Description
channel int
channelOverrideMap int>.IDictionary
discardOffChannelTokens bool
discardSet List
lastMarker int
p int
tokens List

Méthodes publiques

Méthode Description
Consume ( ) : void

* Move the input pointer to the next incoming token. The stream * must become active with LT(1) available. consume() simply * moves the input pointer so that LT(1) points at the next * input symbol. Consume at least one token. *

* Walk past any token not on the channel the parser is listening to. *

DiscardTokenType ( int ttype ) : void
FillBuffer ( ) : void

* Load all tokens from the token source and put in tokens. * This is done upon first LT request because you might want to * set some token type / channel overrides before filling buffer. *

Get ( int i ) : IToken

* Return absolute token i; ignore which channel the tokens are on; * that is, count all tokens not just on-channel tokens. *

Get ( int start, int count ) : List
GetTokens ( ) : IList
GetTokens ( int start, int stop ) : IList
GetTokens ( int start, int stop, BitSet types ) : IList

* Given a start and stop index, return a List of all tokens in * the token type BitSet. Return null if no tokens were found. This * method looks at both on and off channel tokens. *

GetTokens ( int start, int stop, IList types ) : IList
GetTokens ( int start, int stop, int ttype ) : IList
LA ( int i ) : int
LT ( int k ) : IToken

* Get the ith token from the current position 1..n where k=1 is the * first symbol of lookahead. *

LegacyCommonTokenStream ( ) : System.Collections.Generic
LegacyCommonTokenStream ( ITokenSource tokenSource ) : System.Collections.Generic
LegacyCommonTokenStream ( ITokenSource tokenSource, int channel ) : System.Collections.Generic
Mark ( ) : int
Release ( int marker ) : void
Reset ( ) : void
Rewind ( ) : void
Rewind ( int marker ) : void
Seek ( int index ) : void
SetDiscardOffChannelTokens ( bool discardOffChannelTokens ) : void
SetTokenSource ( ITokenSource tokenSource ) : void

Reset this token stream by setting its token source.

SetTokenTypeChannel ( int ttype, int channel ) : void

* A simple filter mechanism whereby you can tell this token stream * to force all tokens of type ttype to be on channel. For example, * when interpreting, we cannot exec actions so we need to tell * the stream to force all WS and NEWLINE to be a different, ignored * channel. *

ToString ( ) : string
ToString ( IToken start, IToken stop ) : string
ToString ( int start, int stop ) : string

Méthodes protégées

Méthode Description
LB ( int k ) : IToken

Look backwards k tokens on-channel tokens

SkipOffTokenChannels ( int i ) : int

Given a starting index, return the index of the first on-channel token.

SkipOffTokenChannelsReverse ( int i ) : int

Method Details

Consume() public méthode

* Move the input pointer to the next incoming token. The stream * must become active with LT(1) available. consume() simply * moves the input pointer so that LT(1) points at the next * input symbol. Consume at least one token. *
* Walk past any token not on the channel the parser is listening to. *
public Consume ( ) : void
Résultat void

DiscardTokenType() public méthode

public DiscardTokenType ( int ttype ) : void
ttype int
Résultat void

FillBuffer() public méthode

* Load all tokens from the token source and put in tokens. * This is done upon first LT request because you might want to * set some token type / channel overrides before filling buffer. *
public FillBuffer ( ) : void
Résultat void

Get() public méthode

* Return absolute token i; ignore which channel the tokens are on; * that is, count all tokens not just on-channel tokens. *
public Get ( int i ) : IToken
i int
Résultat IToken

Get() public méthode

public Get ( int start, int count ) : List
start int
count int
Résultat List

GetTokens() public méthode

public GetTokens ( ) : IList
Résultat IList

GetTokens() public méthode

public GetTokens ( int start, int stop ) : IList
start int
stop int
Résultat IList

GetTokens() public méthode

* Given a start and stop index, return a List of all tokens in * the token type BitSet. Return null if no tokens were found. This * method looks at both on and off channel tokens. *
public GetTokens ( int start, int stop, BitSet types ) : IList
start int
stop int
types BitSet
Résultat IList

GetTokens() public méthode

public GetTokens ( int start, int stop, IList types ) : IList
start int
stop int
types IList
Résultat IList

GetTokens() public méthode

public GetTokens ( int start, int stop, int ttype ) : IList
start int
stop int
ttype int
Résultat IList

LA() public méthode

public LA ( int i ) : int
i int
Résultat int

LB() protected méthode

Look backwards k tokens on-channel tokens
protected LB ( int k ) : IToken
k int
Résultat IToken

LT() public méthode

* Get the ith token from the current position 1..n where k=1 is the * first symbol of lookahead. *
public LT ( int k ) : IToken
k int
Résultat IToken

LegacyCommonTokenStream() public méthode

public LegacyCommonTokenStream ( ) : System.Collections.Generic
Résultat System.Collections.Generic

LegacyCommonTokenStream() public méthode

public LegacyCommonTokenStream ( ITokenSource tokenSource ) : System.Collections.Generic
tokenSource ITokenSource
Résultat System.Collections.Generic

LegacyCommonTokenStream() public méthode

public LegacyCommonTokenStream ( ITokenSource tokenSource, int channel ) : System.Collections.Generic
tokenSource ITokenSource
channel int
Résultat System.Collections.Generic

Mark() public méthode

public Mark ( ) : int
Résultat int

Release() public méthode

public Release ( int marker ) : void
marker int
Résultat void

Reset() public méthode

public Reset ( ) : void
Résultat void

Rewind() public méthode

public Rewind ( ) : void
Résultat void

Rewind() public méthode

public Rewind ( int marker ) : void
marker int
Résultat void

Seek() public méthode

public Seek ( int index ) : void
index int
Résultat void

SetDiscardOffChannelTokens() public méthode

public SetDiscardOffChannelTokens ( bool discardOffChannelTokens ) : void
discardOffChannelTokens bool
Résultat void

SetTokenSource() public méthode

Reset this token stream by setting its token source.
public SetTokenSource ( ITokenSource tokenSource ) : void
tokenSource ITokenSource
Résultat void

SetTokenTypeChannel() public méthode

* A simple filter mechanism whereby you can tell this token stream * to force all tokens of type ttype to be on channel. For example, * when interpreting, we cannot exec actions so we need to tell * the stream to force all WS and NEWLINE to be a different, ignored * channel. *
public SetTokenTypeChannel ( int ttype, int channel ) : void
ttype int
channel int
Résultat void

SkipOffTokenChannels() protected méthode

Given a starting index, return the index of the first on-channel token.
protected SkipOffTokenChannels ( int i ) : int
i int
Résultat int

SkipOffTokenChannelsReverse() protected méthode

protected SkipOffTokenChannelsReverse ( int i ) : int
i int
Résultat int

ToString() public méthode

public ToString ( ) : string
Résultat string

ToString() public méthode

public ToString ( IToken start, IToken stop ) : string
start IToken
stop IToken
Résultat string

ToString() public méthode

public ToString ( int start, int stop ) : string
start int
stop int
Résultat string

Property Details

channel protected_oe property

Skip tokens on any channel but this one; this is how we skip whitespace...
protected int channel
Résultat int

channelOverrideMap protected_oe property

Map from token type to channel to override some Tokens' channel numbers
protected IDictionary channelOverrideMap
Résultat int>.IDictionary

discardOffChannelTokens protected_oe property

By default, track all incoming tokens
protected bool discardOffChannelTokens
Résultat bool

discardSet protected_oe property

Set of token types; discard any tokens with this type
protected List discardSet
Résultat List

lastMarker protected_oe property

Track the last mark() call result value for use in rewind().
protected int lastMarker
Résultat int

p protected_oe property

* The index into the tokens list of the current token (next token * to consume). p==-1 indicates that the tokens list is empty *
protected int p
Résultat int

tokens protected_oe property

* Record every single token pulled from the source so we can reproduce * chunks of it later. *
protected List tokens
Résultat List