Represents an object that tracks the current state of a ILLParser.
- Inheritance:
- object object
- Implements:
-
IParser
State
Constructors
ParserState(ILLParser, ITokenReader, IAstNodeBuilder, ITextSnapshot)
Initializes a new instance of the ParserState
class.
Parameter | Type | Description |
---|---|---|
parser | ILLParser | The ILLParser for which this state is tracking data. |
tokenReader | IToken |
The IToken |
astNodeBuilder | IAst |
The IAst |
snapshot | IText |
The IText |
Properties
AstNodeBuilder
Gets the IAst
Property Value
- IAst
Node :Builder The IAst
Node to use for constructing AST node results.Builder
CustomData
Gets or sets custom data that can be altered during a parsing operation.
Property Value
- object:
Custom data that can be altered during a parsing operation.
ParseErrors
Gets the collection of IParse
Property Value
- IEnumerable<IParse
Error >: The collection of IParse
Error objects that will be returned in the IParseData parsing result.
Parser
Gets the ILLParser for which this state is tracking data.
Snapshot
Gets the IText
Property Value
- IText
Snapshot : The IText
Snapshot used to initiate the parsing operation, if known.
TokenReader
Gets the IToken
Property Value
- IToken
Reader : The IToken
Reader that is used to read tokens during the parsing operation.
UntargetableParseErrorTokenIds
Gets or sets the collection of token IDs that should be avoided when determining where untargeted parse errors will appear.
Property Value
- IEnumerable<int>:
The collection of token IDs that should be avoided when determining where untargeted parse errors will appear.
Remarks
If a parse error is reported without a target token, the parser will normally place the parse error at the next token. If that token is one of the IDs found in this collection, the parse error will appear after the previous token instead. This property should be set to a collection of any IDs for visually-insignificant tokens that can be passed to the parser such as a line feed, line continuation, document end, etc.
Methods
ReportError(IParseError)
Reports an IParse
Parameter | Type | Description |
---|---|---|
parseError | IParse |
The IParse |
ReportError(ParseErrorLevel, string)
Reports an IParse
Parameter | Type | Description |
---|---|---|
level | Parse |
A Parse |
description | string | The description of the error, which is displayed in the user interface. |
Returns
- IParse
Error : The IParse
Error that was reported.
ReportError(ParseErrorLevel, string, IToken)
Reports an IParse
Parameter | Type | Description |
---|---|---|
level | Parse |
A Parse |
description | string | The description of the error, which is displayed in the user interface. |
token | IToken | The IToken to examine for the error range. If not passed, the look-ahead token is used. |
Returns
- IParse
Error : The IParse
Error that was reported.
ReportNonTerminalExpectedError(NonTerminal)
Reports an IParse
Parameter | Type | Description |
---|---|---|
nonTerminal | Non |
The Non |
Returns
- IParse
Error : The IParse
Error that was reported.
ReportNonTerminalExpectedError(NonTerminal, IToken)
Reports an IParse
Parameter | Type | Description |
---|---|---|
nonTerminal | Non |
The Non |
token | IToken | The IToken at which the error should be reported. |
Returns
- IParse
Error : The IParse
Error that was reported.
ReportNonTerminalExpectedError(NonTerminal, TextPositionRange)
Reports an IParse
Parameter | Type | Description |
---|---|---|
nonTerminal | Non |
The Non |
positionRange | Text |
The Text |
Returns
- IParse
Error : The IParse
Error that was reported.
ReportTerminalExpectedError(Terminal)
Reports an IParse
Parameter | Type | Description |
---|---|---|
terminal | Terminal | The Terminal that was expected. |
Returns
- IParse
Error : The IParse
Error that was reported.
ReportTerminalExpectedError(Terminal, IToken)
Reports an IParse
Parameter | Type | Description |
---|---|---|
terminal | Terminal | The Terminal that was expected. |
token | IToken | The IToken at which the error should be reported. |
Returns
- IParse
Error : The IParse
Error that was reported.
ReportTerminalExpectedError(Terminal, TextPositionRange)
Reports an IParse
Parameter | Type | Description |
---|---|---|
terminal | Terminal | The Terminal that was expected. |
positionRange | Text |
The Text |
Returns
- IParse
Error : The IParse
Error that was reported.