Sketched rough parser code construction including some SQL AST classes.
This commit is contained in:
parent
f3898599fd
commit
5b20f900fc
15 changed files with 459 additions and 4 deletions
39
core/SqlAstSelect.h
Normal file
39
core/SqlAstSelect.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#ifndef SQLASTSELECT_H
|
||||
#define SQLASTSELECT_H
|
||||
|
||||
#include "SqlAstNode.h"
|
||||
//#include "SqlAstSelectList.h"
|
||||
#include <memory>
|
||||
|
||||
class SqlParser;
|
||||
|
||||
namespace SqlAst {
|
||||
|
||||
class SelectList;
|
||||
class From;
|
||||
class Where;
|
||||
class GroupBy;
|
||||
class Having;
|
||||
class OrderBy;
|
||||
|
||||
class Select: public CrudNode {
|
||||
public:
|
||||
|
||||
void setSelectList(std::shared_ptr<SelectList> list) { select = list; }
|
||||
auto getSelectList() const { return select; }
|
||||
void setFrom(std::shared_ptr<From> f) { from = f; }
|
||||
|
||||
private:
|
||||
std::shared_ptr<SelectList> select;
|
||||
std::shared_ptr<From> from;
|
||||
std::shared_ptr<Where> where;
|
||||
std::shared_ptr<GroupBy> groupBy;
|
||||
std::shared_ptr<Having> having;
|
||||
std::shared_ptr<OrderBy> orderBy;
|
||||
};
|
||||
|
||||
std::shared_ptr<SqlAst::Select> parseSelect(SqlParser &parser);
|
||||
|
||||
}
|
||||
|
||||
#endif // SQLASTSELECT_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue