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


17.1 Overview

The archetypal application needs a value object (or valuator) to produce the value of the parse. To create a valuator, use the marpa_v_new() method. When a valuator is no longer in use, its memory can be freed using the marpa_v_unref() method.

The application is required to maintain the stack, and the application is also required to implement most of the semantics, including the evaluation of rules. Libmarpa’s valuator provides instructions to the application on how to manipulate the stack. To iterate through this series of instructions, use the marpa_v_step() method.

marpa_v_step() returns the type of step. Most step types have values associated with them. To access these values use the methods described in the section Basic step accessors. How to perform the steps is described in the sections How to use the valuator and Stepping through the valuator.