Class ExpressionBinder
Binds expressions (IR lowering §3.3): each to its declared type, as the static semantics evaluate it, and each operation to its OperationPlan, made for the declared types of its operands - final when they decide it, deferred when a value does.
public static class ExpressionBinder
- Inheritance
-
ExpressionBinder
- Inherited Members
Remarks
The binder is the static evaluation itself, with a recorder for what it evaluates (Bindings): a declared type is the one the static semantics give the expression, by construction. The run time evaluates the bound tree of each expression it is given (NodeOf(ExpressionNode)): names read through their slots, operations by their plans, calls and members resolved once.
Methods
Bind(StaticEvaluationContext, ExpressionNode, FrameLayout?)
What an expression, and each expression in it, binds to.
public static ExpressionBindings Bind(StaticEvaluationContext context, ExpressionNode expression, FrameLayout? frame = null)
Parameters
contextStaticEvaluationContextThe context the expression is evaluated in. What the evaluation would record of its facts is not recorded: binding is not analyzing.
expressionExpressionNodeThe expression.
frameFrameLayoutThe layout of the activations of the procedure the expression is written in, which binds its variables to their slots; null to bind none to a slot.
Returns
BindAssignment(StaticEvaluationContext, AssignmentStatementNode)
What an assignment binds to: the expressions of its target and of its value, and the plan of the let-coercion of the value to the target.
public static BoundAssignment BindAssignment(StaticEvaluationContext context, AssignmentStatementNode assignment)
Parameters
contextStaticEvaluationContextThe context the assignment is evaluated in.
assignmentAssignmentStatementNodeThe assignment.