![]() |
Spicy
|
#include <while.h>
Public Member Functions | |
While (const std::string &symbol, Expression e, Production body, const Location &l=location::None) | |
While (const std::string &symbol, Production body, const Location &l=location::None) | |
const auto & | expression () const |
const auto & | body () const |
void | preprocessLookAhead (Grammar *grammar) |
const production::LookAhead & | lookAheadProduction () const |
std::vector< std::vector< Production > > | rhss () const |
std::optional< spicy::Type > | type () const |
bool | nullable () const |
bool | eodOk () const |
bool | atomic () const |
bool | supportsSynchronize () const |
std::string | render () const |
![]() | |
ProductionBase (std::string symbol, Location l=location::None) | |
bool | hasSize () const |
bool | maySynchronize () const |
const Location & | location () const |
const std::string & | symbol () const |
void | setSymbol (const std::string &s) |
std::optional< Expression > | filter () const |
void | setFilter (const Expression &filter) |
std::optional< Expression > | sink () const |
void | setSink (const Expression &sink) |
const production::Meta & | meta () const |
void | setMeta (production::Meta m) |
std::shared_ptr< production::Meta > | _metaInstance () const |
void | _setMetaInstance (std::shared_ptr< production::Meta > m) |
A production executing as long as either a given boolean expression evaluates to true, or, if no expression is provided, as determined by look-ahead symbols.
|
inline |
Constructor for a while-loop using an expression as the condition for termination.
production::While::While | ( | const std::string & | symbol, |
Production | body, | ||
const Location & | l = location::None |
||
) |
Constructor for a while-loop using look-ahead as the condition for termination. When using this constructor, preprocessLookAhead()
must later be called with the grammar that the production has been inserted into.
|
inline |
Returns the body production as passed into any of the constructors.
|
inline |
Returns the loop expression if passed into the corresponding constructor.
|
inline |
For a look-ahead loop, returns the internally generated LookAhead
production that's being used for generating the code to terminate the loop. The production's 1st alternative corresponds to the case of terminating the loop, the 2nd alternative corresponds to executing the loop body. This method must be called only after preprocessLookAhead()
.
void production::While::preprocessLookAhead | ( | Grammar * | grammar | ) |
Prepares the internal grammar representation for a look-ahead based loop. Must be called (only) when the corresponding constructor was used.
grammar | grammar that while-production is being part of. |