21 namespace Deveel.Data.Sql.Parser {
42 public bool IsAll {
get;
private set; }
48 public bool IsAny {
get;
private set; }
54 public string Operator {
get;
private set; }
60 Left = (IExpressionNode) node;
63 Right = (IExpressionNode) node;
66 }
else if (node.
NodeName ==
"binary_op") {
70 return base.OnChildNode(node);
75 if (childNode.NodeName ==
"binary_op_simple") {
76 var op = childNode.ChildNodes.First();
78 }
else if (childNode.NodeName ==
"logical_op") {
79 GetLogicalOp(childNode);
80 }
else if (node.
NodeName ==
"any_op" ||
82 GetAnyAllOp(childNode);
83 }
else if (childNode.NodeName ==
"subquery_op") {
84 GetLogicalOp(childNode);
89 var sb =
new StringBuilder();
90 foreach (var childNode
in node.ChildNodes) {
92 sb.Append(((SqlKeyNode) childNode).Text);
97 Operator = sb.ToString().Trim();
101 var sb =
new StringBuilder();
102 foreach (var childNode
in node.ChildNodes) {
104 var anyOrAll = ((SqlKeyNode) childNode).Text;
105 if (String.Equals(anyOrAll,
"ALL", StringComparison.OrdinalIgnoreCase)) {
107 }
else if (String.Equals(anyOrAll,
"ANY", StringComparison.OrdinalIgnoreCase)) {
110 }
else if (childNode.NodeName ==
"binary_op_simple") {
111 var op = childNode.ChildNodes.First();
112 sb.Append(((SqlKeyNode) op).Text);
116 Operator = sb.ToString();
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 NodeName
Gets the name of the node analyzed from the parser.
void GetAnyAllOp(ISqlNode node)
void GetLogicalOp(ISqlNode node)
IEnumerable< ISqlNode > ChildNodes
Gets a read-only enumeration of the children nodes, if any.
override ISqlNode OnChildNode(ISqlNode node)
During the initialization of the node from the parser, this method is called for every child node add...
This interface acts like a marker that indicates if a ISqlNode represents a SQL expression.
Represents an expression that evaluates between two other expressions.
void GetOperator(ISqlNode node)
The default implementation of ISqlNode, that is a node in the text analysis parsing of SQL commands...