22 std::vector<sqltype *> types;
24 std::vector<table> tables;
25 std::vector<op> operators;
26 std::vector<routine> routines;
27 std::vector<routine> aggregates;
29 typedef std::tuple<sqltype *,sqltype *,sqltype *> typekey;
30 std::multimap<typekey, op> index;
31 typedef std::multimap<typekey, op>::iterator op_iterator;
33 std::multimap<sqltype*, routine*> routines_returning_type;
34 std::multimap<sqltype*, routine*> aggregates_returning_type;
35 std::multimap<sqltype*, routine*> parameterless_routines_returning_type;
36 std::multimap<sqltype*, table*> tables_with_columns_of_type;
37 std::multimap<sqltype*, op*> operators_returning_type;
38 std::multimap<sqltype*, sqltype*> concrete_type;
39 std::vector<table*> base_tables;
44 const char *true_literal =
"true";
45 const char *false_literal =
"false";
47 virtual std::string quote_name(
const std::string &
id) = 0;
50 std::cout <<
"Found " << tables.size() <<
51 " user table(s) in information schema." << std::endl;
53 void fill_scope(
struct scope &s) {
54 for (
auto &t : tables)
58 virtual void register_operator(
op& o) {
59 operators.push_back(o);
60 typekey t(o.left, o.right, o.result);
61 index.insert(std::pair<typekey,op>(t,o));
63 virtual void register_routine(
routine& r) {
64 routines.push_back(r);
66 virtual void register_aggregate(
routine& r) {
67 aggregates.push_back(r);
70 typekey t(left, right, res);
71 auto cons = index.equal_range(t);
72 if (cons.first == cons.second)
75 return random_pick<>(cons.first, cons.second);
78 void generate_indexes();
supporting classes for the grammar
vector< named_relation * > tables
available to table_ref productions