18 using System.Collections.Generic;
21 namespace Deveel.Data.Sql.Parser {
34 public bool IsAll {
get;
private set; }
40 public bool IsDistinct {
get;
private set; }
48 public IEnumerable<SelectItemNode> SelectItems {
get;
private set; }
75 if (node.
NodeName ==
"select_restrict_opt") {
77 }
else if (node.
NodeName ==
"select_set") {
79 }
else if (node.
NodeName ==
"from_clause_opt") {
83 }
else if (node.
NodeName ==
"where_clause_opt") {
85 }
else if (node.
NodeName ==
"group_by_opt") {
87 }
else if (node.
NodeName ==
"query_composite_opt") {
88 var composite = node.
ChildNodes.FirstOrDefault();
89 if (composite != null)
91 }
else if (node.
NodeName ==
"select_into_opt") {
95 return base.OnChildNode(node);
99 foreach (var childNode
in node.ChildNodes) {
101 WhereExpression = childNode as IExpressionNode;
108 foreach (var childNode
in node.ChildNodes) {
110 var value = ((SqlKeyNode) childNode).Text;
111 if (value ==
"ALL") {
113 }
else if (value ==
"DISTINCT") {
121 foreach (var childNode
in node.ChildNodes) {
125 }
else if (childNode.
NodeName ==
"select_item_list") {
126 GetSelectItems(childNode);
132 var items =
new List<SelectItemNode>();
133 foreach (var childNode
in node.ChildNodes) {
135 items.Add((SelectItemNode)childNode);
138 SelectItems = items.ToArray();
Defines the contract for nodes in an AST model for a SQL grammar analysis and parsing.
Represents a keyword found during the compilation of a source text.
string ISqlNode. NodeName
string NodeName
Gets the name of the node analyzed from the parser.
The node in an SQL query that defines the sources from which to retrieve the data queried...
The root node of an expression used to select a set of items from a set of sources defined...
An expression node that references an object within the database context (such as a table...
void GetRestrict(ISqlNode node)
IEnumerable< ISqlNode > ChildNodes
Gets a read-only enumeration of the children nodes, if any.
A single item selected within a query node tree.
void GetSelectItems(ISqlNode node)
void GetSelectSet(ISqlNode node)
A node that describes the GROUP BY clause in a SQL query.
Composes two queries to obtain a set that is the result of a given composition function.
This interface acts like a marker that indicates if a ISqlNode represents a SQL expression.
override ISqlNode OnChildNode(ISqlNode node)
During the initialization of the node from the parser, this method is called for every child node add...
The default implementation of ISqlNode, that is a node in the text analysis parsing of SQL commands...
void GetWhereClause(ISqlNode node)