Class VBBinaryOperatorExpressionNode
- Namespace
- RDCore.SDK.Model.AST.Expressions
- Assembly
- RDCore.SDK.dll
An infix VBOperatorExpression (bound) that accepts a left and a right operand on either of its sides.
public record VBBinaryOperatorExpressionNode : VBOperatorExpression, IEquatable<SyntaxNode>, IExecutableNode, IEquatable<ExpressionNode>, IEquatable<VBOperatorExpression>, IEquatable<VBBinaryOperatorExpressionNode>
- Inheritance
-
VBBinaryOperatorExpressionNode
- Implements
- Inherited Members
- Extension Methods
Remarks
Unless specified otherwise in a derived node type, MS-VBAL 5.6.9 Operator Expressions defines the static and run-time semantics of this node.
Constructors
VBBinaryOperatorExpressionNode(string, SyntaxNodeId, SourceLocation, ExpressionNode, ExpressionNode)
Deserialization path: Left/Right are what the JSON actually carries now (see
SyntaxNodeJson) — Children is redundant with them and gets omitted on write, so it
can't be relied on to arrive from the wire.
[JsonConstructor]
public VBBinaryOperatorExpressionNode(string token, SyntaxNodeId identity, SourceLocation location, ExpressionNode left, ExpressionNode right)
Parameters
tokenstringidentitySyntaxNodeIdlocationSourceLocationleftExpressionNoderightExpressionNode
VBBinaryOperatorExpressionNode(string, SyntaxNodeId, SourceLocation, ImmutableArray<SyntaxNode>)
public VBBinaryOperatorExpressionNode(string token, SyntaxNodeId identity, SourceLocation location, ImmutableArray<SyntaxNode> children)
Parameters
tokenstringThe operator token (e.g.
+,And).identitySyntaxNodeIdA unique identifier for this specific syntax node.
locationSourceLocationThe
Location(holds the documentUriand aRange) of the bound expression.childrenImmutableArray<SyntaxNode>The left and right operands, in that order.
Exceptions
- ArgumentException
childrenis not exactly two ExpressionNode operands: the grammar guarantees a binary operator has two, so this signals a parse-listener desync.
Properties
Left
The left-hand side operand: Children[0].
public ExpressionNode Left { get; }
Property Value
OperatorLocation
Where in the document the operator token is written: the + of a + b, where Location is the whole operation.
public SourceLocation? OperatorLocation { get; init; }
Property Value
Remarks
A diagnostic about the operator is located here, so that each operator of a chain (a + b + c, whose two operations begin at the same
position) has a location of its own. A run-time error of the operation is located at the operation itself. null for an operation
the code does not write (one a statement makes of its own operands) and for a node created without one.
Right
The right-hand side operand: Children[1].
public ExpressionNode Right { get; }
Property Value
Token
public string Token { get; }
Property Value
Methods
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder