8 prod::prod(
struct prod *parent)
12 level = parent->
level + 1;
23 for (
int i = 0; i <
level; i++)
29 impedance::retry(
this);
33 impedance::limit(
this);
34 throw std::runtime_error(std::string(
"excessive retries in ")
35 +
typeid(*this).name());
40 if (!impedance::matched(
this))
41 throw std::runtime_error(
"impedance mismatch");
46 impedance::fail(
this);
47 throw std::runtime_error(reason);
feedback to the grammar about failed productions
Base class for grammar productions.
Base class for AST nodes.
virtual void indent(std::ostream &out)
Newline and indent according to tree level.
void retry()
Increase the retry count and throw an exception when retry_limit is exceeded.
struct scope * scope
Scope object to model column/table reference visibility.
long retry_limit
Maximum number of retries allowed before reporting a failure to the Parent prod.
int level
Level of this production in the AST. 0 for root node.
virtual void out(std::ostream &out)=0
Emit SQL for this production.
virtual void fail(const char *reason)
Report a "failed to generate" error.
long retries
Number of retries in this production.
virtual void match()
Check with the impedance matching code whether this production has been blacklisted and throw an exce...