The ezr² Project 0.1.1
The codebase for the ezr² programming language.
Loading...
Searching...
No Matches
EzrSquared.Syntax.ParseResult Class Reference

The type of the object that is returned as the result of parsing done by the Parser. More...

Public Member Functions

void Success (Node node)
 Sets Node as the result of successful parsing.
 
void Failure (int priority, SyntaxError error)
 Sets Error as the result of failed parsing.
 

Public Attributes

SyntaxError? Error = null
 The SyntaxError that occurred while parsing, if any.
 
Node Node = InvalidNode.s_invalidNode
 The Runtime.Nodes.Node which is the result of the parsing.
 
int AdvanceCount = 0
 The amount of times the Parser advanced.
 

Private Attributes

int _errorPriority = 0
 The priority of the error held in the ParseResult.
 

Detailed Description

The type of the object that is returned as the result of parsing done by the Parser.

Member Function Documentation

◆ Failure()

void EzrSquared.Syntax.ParseResult.Failure ( int priority,
SyntaxError error )

Sets Error as the result of failed parsing.

If priority is greater than or equal to the _errorPriority then error will override Error.

Parameters
priorityThe priority/fatality of the failure.
errorThe SyntaxError that occurred in parsing.
Returns
The same ParseResult object.

◆ Success()

void EzrSquared.Syntax.ParseResult.Success ( Node node)

Sets Node as the result of successful parsing.

Parameters
nodeThe Runtime.Nodes.Node result of the parsing.
Returns
The same ParseResult object.

The documentation for this class was generated from the following file: