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


24.9 Basic step accessors

This section describes the accessors that are basic to stack manipulation.

Accessor macro: int marpa_v_arg_0 (Marpa_Value v)

Return value: For a MARPA_STEP_RULE step, the stack location where the value of first child can be found. For other step types, an unspecified value. Always succeeds.

Accessor macro: int marpa_v_arg_n (Marpa_Value v)

Return value: For a MARPA_STEP_RULE step, the stack location where the value of the last child can be found. For other step types, an unspecified value. Always succeeds.

Accessor macro: int marpa_v_result (Marpa_Value v)

Return value: For MARPA_STEP_RULE, MARPA_STEP_TOKEN, and MARPA_STEP_NULLING_SYMBOL steps, the stack location where the result of the semantics should be placed. For other step types, an unspecified value. Always succeeds.

Accessor macro: Marpa_Rule_ID marpa_v_rule (Marpa_Value v)

Return value: For the MARPA_STEP_RULE step, the ID of the rule. For other step types, an unspecified value. Always succeeds.

Accessor macro: Marpa_Step_Type marpa_v_step_type (Marpa_Value v)

This macro is rarely needed since its return value is the same as the value that marpa_v_step() returns on success.

Return value: The current step type: MARPA_STEP_TOKEN, MARPA_STEP_RULE, etc. Always succeeds.

Accessor macro: Marpa_Symbol_ID marpa_v_symbol (Marpa_Value v)

Return value: For the MARPA_STEP_NULLING_SYMBOL step, the ID of the symbol. The value returned is the same as that returned by the marpa_v_token() macro. For other step types, an unspecified value. Always succeeds.

Accessor macro: Marpa_Symbol_ID marpa_v_token (Marpa_Value v)

Return value: For the MARPA_STEP_TOKEN step, the ID of the token. The value returned is the same as that returned by the marpa_v_symbol() macro. For other step types, an unspecified value. Always succeeds.

Accessor macro: int marpa_v_token_value (Marpa_Value v)

Return value: For the MARPA_STEP_TOKEN step, the “token value” that was assigned to the token by the marpa_r_alternative() method. See marpa_r_alternative(). For other step types, an unspecified value. Always succeeds.


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