If an implementation applies Libmarpa’s step instructions literally, using a physical stack, it must make sure the stack is large enough. Specifically, the application must do the following
MARPA_STEP_TOKENsteps, ensure that location
MARPA_STEP_NULLING_SYMBOLsteps, ensure that location
MARPA_STEP_RULEsteps, ensure that stack locations from
Three aspects of these requirements deserve special mention.
note that the requirement for a
MARPA_STEP_RULE is that the application
size the stack to include the arguments to be
Because stack writes may be optimized away,
that the stack was
sized appropriately by a prior write.
The first access to a new stack location may be
note that there is no explicit requirement that
the application size the stack to include the
location for the result of the
An application is allowed to assume that
result will go into one of the locations
that were read.
Third, special note should be made of the requirement that location 0 exist. By convention, the parse result resides in location 0 of the stack. Because of potential optimizations, an application cannot assume that it will receive a Libmarpa step instruction that either reads from or writes to location 0.