12 virtual void visit(
struct prod *p) = 0;
35 virtual void out(std::ostream &
out) = 0;
43 virtual void fail(
const char *reason);
49 inline std::ostream& operator<<(std::ostream& s,
prod& p)
Base class for walking the AST.
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.
struct prod * pprod
Parent production that instanciated this one.
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...
virtual void accept(prod_visitor *v)
Visitor pattern for walking the AST.