pgLab/core/SqlAstNode.h

59 lines
1.1 KiB
C
Raw Normal View History

#ifndef SQLASTNODE_H
#define SQLASTNODE_H
#include <memory>
#include <string>
namespace SqlAst {
class Node {
public:
Node();
//virtual Node* Clone() const = 0;
};
class DDLNode: public Node {
};
class CreateTable: public Node {
};
// Is there a benefit for having a common base for crud operations???
class CrudNode: public Node {
};
class Insert: public CrudNode {
};
/** Class for representing an identifier.
*
* This can still be multiple things like:
* - name of alias, schema, table and or column
* - name of function
* - predefined symbol like LOCAL_TIME
*
* During parsing this cannot always be determined as an alias might be involved that hasn't been parsed yet
* so we put a Identifier in the AST a follow up pass could determine what it actually as and act appropriatly
*
* An identifier can consist of following fields
* - [[schema.]table.]column
* - [alias.]column
* - [schema.]table.function (for function taking a row of type table)
* - alias.function (for function taking a row of type table)
* - schema.function
* - sql symbol like CURRENT_DATE
*/
class Identifier: public Node {
};
}
#endif // SQLASTNODE_H