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


17.9 Basic step accessors

The basic step accessors are so called because their information is basic to the stack manipulation. The basic step accessors are implemented as macros. They always succeed.

Macro: int marpa_v_arg_0 (Marpa_Value v)

For a MARPA_STEP_RULE step, returns the stack location where the value of first child can be found.

Macro: int marpa_v_arg_n (Marpa_Value v)

For a MARPA_STEP_RULE step, returns the stack location where the value of the last child can be found.

Macro: int marpa_v_result (Marpa_Value v)

For MARPA_STEP_RULE, MARPA_STEP_TOKEN, and MARPA_STEP_NULLING_SYMBOL steps, returns the stack location where the result of the semantics should be placed.

Macro: Marpa_Rule_ID marpa_v_rule (Marpa_Value v)

For the MARPA_STEP_RULE step, returns the ID of the rule.

Macro: Marpa_Step_Type marpa_v_step_type (Marpa_Value v)

Returns the current step type: MARPA_STEP_TOKEN, MARPA_STEP_RULE, etc. Usually not needed since this is also the return value of marpa_v_step().

Macro: Marpa_Symbol_ID marpa_v_symbol (Marpa_Value v)

For the MARPA_STEP_NULLING_SYMBOL step, returns the ID of the symbol. The value returned is the same as that returned by the marpa_v_token() macro.

Macro: Marpa_Symbol_ID marpa_v_token (Marpa_Value v)

For the MARPA_STEP_TOKEN step, returns the ID of the token. The value returned is the same as that returned by the marpa_v_symbol() macro.

Macro: int marpa_v_token_value (Marpa_Value v)

For the MARPA_STEP_TOKEN step, returns the integer which is (or which represents) the value of the token.