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


24.1 Overview

The archetypal application needs a value object (or valuator) to produce the value of the parse tree. To create a valuator, use the marpa_v_new() 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.

When successful, marpa_v_step() returns the type of step. Most step types have values associated with them. See Basic step accessors, see How to use the valuator, and see Stepping through the valuator.

When a valuator is no longer in use, its memory can be freed using the marpa_v_unref() method.