Click or drag to resize

LegacyCommonTokenStream Class

The most common stream of tokens is one where every token is buffered up and tokens are prefiltered for a certain channel (the parser will only see these tokens and cannot change the filter channel number during the parse).
Inheritance Hierarchy
SystemObject
  Stimulsoft.Data.Expressions.Antlr.RuntimeLegacyCommonTokenStream

Namespace:  Stimulsoft.Data.Expressions.Antlr.Runtime
Assembly:  Stimulsoft.Data (in Stimulsoft.Data.dll) Version: 2019.3.1.0
Syntax
[SerializableAttribute]
public class LegacyCommonTokenStream : ITokenStream, 
	IIntStream

The LegacyCommonTokenStream type exposes the following members.

Constructors
  NameDescription
Public methodLegacyCommonTokenStream
Initializes a new instance of the LegacyCommonTokenStream class
Public methodLegacyCommonTokenStream(ITokenSource)
Initializes a new instance of the LegacyCommonTokenStream class
Public methodLegacyCommonTokenStream(ITokenSource, Int32)
Initializes a new instance of the LegacyCommonTokenStream class
Top
Properties
  NameDescription
Public propertyCount
Public propertyIndex
Public propertyRange
How deep have we gone?
Public propertySourceName
Public propertyTokenSource
Top
Methods
  NameDescription
Public methodConsume
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.
Public methodDiscardTokenType
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodFillBuffer
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.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGet
Return absolute token i; ignore which channel the tokens are on; that is, count all tokens not just on-channel tokens.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetTokens
Public methodGetTokens(Int32, Int32)
Public methodGetTokens(Int32, Int32, BitSet)
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 methodGetTokens(Int32, Int32, IListInt32)
Public methodGetTokens(Int32, Int32, Int32)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodLA
Protected methodLB
Look backwards k tokens on-channel tokens
Public methodLT
Get the ith token from the current position 1..n where k=1 is the first symbol of lookahead.
Public methodMark
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRelease
Public methodReset
Public methodRewind
Public methodRewind(Int32)
Public methodSeek
Public methodSetDiscardOffChannelTokens
Public methodSetTokenSource
Reset this token stream by setting its token source.
Public methodSetTokenTypeChannel
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.
Protected methodSkipOffTokenChannels
Given a starting index, return the index of the first on-channel token.
Protected methodSkipOffTokenChannelsReverse
Public methodToString (Overrides ObjectToString.)
Public methodToString(Int32, Int32)
Public methodToString(IToken, IToken)
Top
Fields
  NameDescription
Protected fieldchannel
Skip tokens on any channel but this one; this is how we skip whitespace...
Protected fieldchannelOverrideMap
Map from token type to channel to override some Tokens' channel numbers
Protected fielddiscardOffChannelTokens
By default, track all incoming tokens
Protected fielddiscardSet
Set of token types; discard any tokens with this type
Protected fieldlastMarker
Track the last mark() call result value for use in rewind().
Protected fieldp
The index into the tokens list of the current token (next token to consume). p==-1 indicates that the tokens list is empty
Protected fieldtokens
Record every single token pulled from the source so we can reproduce chunks of it later.
Top
Remarks
TODO: how to access the full token stream? How to track all tokens matched per rule?
See Also