Table of Contents

Class VBSyntaxErrorInfo

Namespace
RDCore.SDK.Model.Errors
Assembly
RDCore.SDK.dll

Encapsulates the serializable error data for a syntax error.

public record VBSyntaxErrorInfo : VBErrorInfo, IEquatable<VBErrorInfo>, IEquatable<VBSyntaxErrorInfo>
Inheritance
VBSyntaxErrorInfo
Implements
Inherited Members

Remarks

A syntax error occurs while traversing the concrete syntax tree (CST) in the parser. A single positional constructor keeps the type round-trippable through System.Text.Json.

Constructors

VBSyntaxErrorInfo(int, SourceLocation, string, string)

Encapsulates the serializable error data for a syntax error.

public VBSyntaxErrorInfo(int ErrorId, SourceLocation Location, string Description, string Verbose)

Parameters

ErrorId int

The number of the error: the number of its VBC diagnostic code.

Location SourceLocation

The document location of the faulted CST node.

Description string

An error description. "Syntax error" unless specified otherwise.

Verbose string

A detailed message identifying the faulted CST token and detailing its semantics.

Remarks

A syntax error occurs while traversing the concrete syntax tree (CST) in the parser. A single positional constructor keeps the type round-trippable through System.Text.Json.

Properties

StatementStart

Where the statement the parser was reading when it found the error begins, or null when the error is in no statement: the statement the error is in, wherever it is reported.

public SourcePosition? StatementStart { get; init; }

Property Value

SourcePosition?

Remarks

A block that is not closed is reported at the token where its end was expected, often the end of the procedure, and that token can be in another branch of a #If than the block. The parser reads every branch, and does not know which one is compiled (MS-VBAL §3.4). The branch the error belongs to is the one this position is in.