Next: , Previous: , Up: Value methods   [Contents]

17.8 Valuator steps by type

Macro: Marpa_Step_Type MARPA_STEP_RULE

The semantics of a rule should be performed. The application can find the value of the rule’s children in the stack locations from marpa_v_arg_0(v) to marpa_v_arg_n(v). The semantics for the rule whose ID is marpa_v_rule(v) should be executed on these child values, and the result placed in marpa_v_result(v). In the case of a MARPA_STEP_RULE step, the stack location of marpa_v_result(v) is guaranteed to be equal to marpa_v_arg_0(v).

Macro: Marpa_Step_Type MARPA_STEP_TOKEN

The semantics of a non-null token should be performed. The application’s value for the token whose ID is marpa_v_token(v) should be placed in stack location marpa_v_result(v). Its value according to Libmarpa will be in marpa_v_token_value(v).


The semantics for a nulling symbol should be performed. The ID of the symbol is marpa_v_symbol(v) and its value should be placed in stack location marpa_v_result(v).

Macro: Marpa_Step_Type MARPA_STEP_INACTIVE

The valuator has gone through all of its steps and is now inactive. The value of the parse 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.

Macro: Marpa_Step_Type MARPA_STEP_INITIAL

The valuator is new and has yet to go through any steps.

Macro: Marpa_Step_Type MARPA_STEP_INTERNAL1
Macro: Marpa_Step_Type MARPA_STEP_INTERNAL2
Macro: Marpa_Step_Type MARPA_STEP_TRACE

These step types are reserved for internal purposes.