Next: Basic step accessors, Previous: Stepping through the valuator, Up: Value methods [Contents][Index]
MARPA_STEP_RULE is the step type for for a rule node. The application should perform its equivalent of rule execution.
marpa_v_arg_0(v)
to
marpa_v_arg_n(v)
.
marpa_v_rule(v)
.
marpa_v_result(v)
.
Typically, the result of this step is determined by
executing the semantics for its rule on
its child values.
marpa_v_result(v)
is guaranteed to
be equal to
marpa_v_arg_0(v)
.
MARPA_STEP_TOKEN is the step type for a token node. The application’s equivalent of the evaluation of the semantics of a non-null token should be performed.
marpa_v_token(v)
.
marpa_r_alternative()
method.
See marpa_r_alternative().
Libmarpa’s “token value” will be in
stack location marpa_v_token_value(v)
.
marpa_v_result(v)
.
Often, an application will simply copy Libmarpa’s “token value”
to stack location marpa_v_result(v)
.
MARPA_STEP_NULLING_SYMBOL is the step type for a nulled node. The application’s equivalent of the evaluation of the semantics of a nulled token should be performed.
marpa_v_symbol(v)
.
marpa_v_result(v)
.
Often, an application will assign a fixed value to each
nullable symbol,
and will simply copy this fixed value to
stack location marpa_v_result(v)
.
The use of the word “nulling” in
the step type name MARPA_STEP_NULLING_SYMBOL
is problematic.
While the node must be zero-length (nulled),
the node’s symbol need not be nulling:
it may be a proper nullable.
The name of the step type would more correctly
be “MARPA_STEP_NULLED_SYMBOL”,
but it is left as is for backward compatibility.
See Nulling versus nulled.
When this is the step type, the valuator has gone through all of its steps
and is now inactive.
The value of the parse tree will be in stack location 0.
Because of optimizations,
it is possible for valuator to immediately
became inactive — MARPA_STEP_INACTIVE
could
be both the first and last step.
Once a valuator becomes inactive, it stays inactive.
The valuator is new and has yet to go through any steps.
These step types are reserved for internal purposes.
Next: Basic step accessors, Previous: Stepping through the valuator, Up: Value methods [Contents][Index]