Click or drag to resize

BaseRecognizerGetMissingSymbol Method

Conjure up a missing token during error recovery.

Namespace:  Stimulsoft.Data.Expressions.Antlr.Runtime
Assembly:  Stimulsoft.Data (in Stimulsoft.Data.dll) Version: 2019.3.1.0
Syntax
protected virtual Object GetMissingSymbol(
	IIntStream input,
	RecognitionException e,
	int expectedTokenType,
	BitSet follow
)

Parameters

input
Type: Stimulsoft.Data.Expressions.Antlr.RuntimeIIntStream

[Missing <param name="input"/> documentation for "M:Stimulsoft.Data.Expressions.Antlr.Runtime.BaseRecognizer.GetMissingSymbol(Stimulsoft.Data.Expressions.Antlr.Runtime.IIntStream,Stimulsoft.Data.Expressions.Antlr.Runtime.RecognitionException,System.Int32,Stimulsoft.Data.Expressions.Antlr.Runtime.BitSet)"]

e
Type: Stimulsoft.Data.Expressions.Antlr.RuntimeRecognitionException

[Missing <param name="e"/> documentation for "M:Stimulsoft.Data.Expressions.Antlr.Runtime.BaseRecognizer.GetMissingSymbol(Stimulsoft.Data.Expressions.Antlr.Runtime.IIntStream,Stimulsoft.Data.Expressions.Antlr.Runtime.RecognitionException,System.Int32,Stimulsoft.Data.Expressions.Antlr.Runtime.BitSet)"]

expectedTokenType
Type: SystemInt32

[Missing <param name="expectedTokenType"/> documentation for "M:Stimulsoft.Data.Expressions.Antlr.Runtime.BaseRecognizer.GetMissingSymbol(Stimulsoft.Data.Expressions.Antlr.Runtime.IIntStream,Stimulsoft.Data.Expressions.Antlr.Runtime.RecognitionException,System.Int32,Stimulsoft.Data.Expressions.Antlr.Runtime.BitSet)"]

follow
Type: Stimulsoft.Data.Expressions.Antlr.RuntimeBitSet

[Missing <param name="follow"/> documentation for "M:Stimulsoft.Data.Expressions.Antlr.Runtime.BaseRecognizer.GetMissingSymbol(Stimulsoft.Data.Expressions.Antlr.Runtime.IIntStream,Stimulsoft.Data.Expressions.Antlr.Runtime.RecognitionException,System.Int32,Stimulsoft.Data.Expressions.Antlr.Runtime.BitSet)"]

Return Value

Type: Object

[Missing <returns> documentation for "M:Stimulsoft.Data.Expressions.Antlr.Runtime.BaseRecognizer.GetMissingSymbol(Stimulsoft.Data.Expressions.Antlr.Runtime.IIntStream,Stimulsoft.Data.Expressions.Antlr.Runtime.RecognitionException,System.Int32,Stimulsoft.Data.Expressions.Antlr.Runtime.BitSet)"]

Remarks
The recognizer attempts to recover from single missing symbols. But, actions might refer to that missing symbol. For example, x=ID {f($x);}. The action clearly assumes that there has been an identifier matched previously and that $x points at that token. If that token is missing, but the next token in the stream is what we want we assume that this token is missing and we keep going. Because we have to return some token to replace the missing token, we have to conjure one up. This method gives the user control over the tokens returned for missing tokens. Mostly, you will want to create something special for identifier tokens. For literals such as '{' and ',', the default action in the parser or tree parser works. It simply creates a CommonToken of the appropriate type. The text will be the token. If you change what tokens must be created by the lexer, override this method to create the appropriate tokens.
See Also