Class FileLockStatementNode
- Namespace
- RDCore.SDK.Model.AST.Statements
- Assembly
- RDCore.SDK.dll
MS-VBAL 5.4.5.4/5.4.5.5 the Lock and Unlock statements.
public record FileLockStatementNode : StatementNode, IEquatable<SyntaxNode>, IExecutableNode, IEquatable<StatementNode>, IEquatable<FileLockStatementNode>
- Inheritance
-
FileLockStatementNode
- Implements
- Inherited Members
Remarks
Their record-range is start-record-number / ([start-record-number] "To" end-record-number) —
three shapes, and a flat list of expressions can only tell two of them apart: Lock #1, 5 locks
record 5 alone and Lock #1, To 5 locks records 1 through 5, and both carry one expression. So which
end of the range an expression is has to be part of the node rather than inferred from its
position, which is the same reason OpenStatementNode has a shape of its own.
👉 The absent start-record-number of the To-only form stays absent here. The specification's
"the effect is as if start-record-number consisted of the integer number token 1" is a runtime
semantic, and a node that carried a synthesized 1 would claim the program had written one.
Constructors
FileLockStatementNode(SyntaxNodeId, SourceLocation, string, ExpressionNode, ExpressionNode?, ExpressionNode?)
MS-VBAL 5.4.5.4/5.4.5.5 the Lock and Unlock statements.
public FileLockStatementNode(SyntaxNodeId Identity, SourceLocation SourceLocation, string Token, ExpressionNode FileNumber, ExpressionNode? StartRecord, ExpressionNode? EndRecord)
Parameters
IdentitySyntaxNodeIdA unique identifier for this specific syntax node.
SourceLocationSourceLocationThe document location (
Uri+Range) of the statement.TokenstringWhich of the two statements this is —
LockorUnlock.FileNumberExpressionNodeThe file number whose file is locked or unlocked.
StartRecordExpressionNodeThe
start-record-number, ornullwhen the statement declares none.EndRecordExpressionNodeThe
end-record-numberafterTo, ornullwhen there is noToclause — in which case StartRecord is the whole range, one record or byte wide.
Remarks
Their record-range is start-record-number / ([start-record-number] "To" end-record-number) —
three shapes, and a flat list of expressions can only tell two of them apart: Lock #1, 5 locks
record 5 alone and Lock #1, To 5 locks records 1 through 5, and both carry one expression. So which
end of the range an expression is has to be part of the node rather than inferred from its
position, which is the same reason OpenStatementNode has a shape of its own.
👉 The absent start-record-number of the To-only form stays absent here. The specification's
"the effect is as if start-record-number consisted of the integer number token 1" is a runtime
semantic, and a node that carried a synthesized 1 would claim the program had written one.
Properties
EndRecord
The end-record-number after To, or null when there is no
To clause — in which case StartRecord is the whole range, one record or byte wide.
public ExpressionNode? EndRecord { get; init; }
Property Value
FileNumber
The file number whose file is locked or unlocked.
public ExpressionNode FileNumber { get; init; }
Property Value
IsEntireFile
Whether the statement declared no record-range at all, which applies it to the entire file.
public bool IsEntireFile { get; }
Property Value
StartRecord
The start-record-number, or null when the statement declares none.
public ExpressionNode? StartRecord { get; init; }
Property Value
Token
Which of the two statements this is — Lock or Unlock.
public string Token { get; init; }