SQLsmith  v1.2.1-5-gfacd7a8
A random SQL query generator
Public Member Functions | Public Attributes | List of all members
prod Struct Referenceabstract

Base class for AST nodes. More...

#include <prod.hh>

Inheritance diagram for prod:
Inheritance graph
Collaboration diagram for prod:
Collaboration graph

Public Member Functions

 prod (prod *parent)
 
virtual void indent (std::ostream &out)
 Newline and indent according to tree level.
 
virtual void out (std::ostream &out)=0
 Emit SQL for this production.
 
virtual void match ()
 Check with the impedance matching code whether this production has been blacklisted and throw an exception.
 
virtual void accept (prod_visitor *v)
 Visitor pattern for walking the AST. More...
 
virtual void fail (const char *reason)
 Report a "failed to generate" error.
 
void retry ()
 Increase the retry count and throw an exception when retry_limit is exceeded.
 

Public Attributes

struct prodpprod
 Parent production that instanciated this one. More...
 
struct scopescope
 Scope object to model column/table reference visibility.
 
int level
 Level of this production in the AST. 0 for root node.
 
long retries = 0
 Number of retries in this production. More...
 
long retry_limit = 100
 Maximum number of retries allowed before reporting a failure to the Parent prod.
 

Detailed Description

Base class for AST nodes.

Definition at line 17 of file prod.hh.

Member Function Documentation

◆ accept()

virtual void prod::accept ( prod_visitor v)
inlinevirtual

Member Data Documentation

◆ pprod

struct prod* prod::pprod

Parent production that instanciated this one.

May be NULL for top-level productions.

Definition at line 20 of file prod.hh.

◆ retries

long prod::retries = 0

Number of retries in this production.

Child productions are generated speculatively and may fail.

Definition at line 27 of file prod.hh.


The documentation for this struct was generated from the following files: