18 using System.Collections.Generic;
21 namespace Deveel.Data.Sql.Parser {
33 public IEnumerable<CaseSwitchNode> CaseSwitches {
get;
private set; }
48 if (node.
NodeName ==
"case_test_expression_opt") {
52 TestExpression = (IExpressionNode) exp;
54 }
else if (node.
NodeName ==
"case_when_then_list") {
55 GetWhenThenList(node);
56 }
else if (node.
NodeName ==
"case_else_opt") {
60 return base.OnChildNode(node);
64 foreach (var childNode
in node.ChildNodes) {
66 ElseExpression = (IExpressionNode) childNode;
73 var switches =
new List<CaseSwitchNode>();
75 foreach (var childNode
in node.ChildNodes) {
77 switches.Add((CaseSwitchNode)childNode);
80 CaseSwitches = switches.ToArray();
The node that represents a switch in a CASE expression
void GetElse(ISqlNode node)
Defines the contract for nodes in an AST model for a SQL grammar analysis and parsing.
string NodeName
Gets the name of the node analyzed from the parser.
override ISqlNode OnChildNode(ISqlNode node)
During the initialization of the node from the parser, this method is called for every child node add...
IEnumerable< ISqlNode > ChildNodes
Gets a read-only enumeration of the children nodes, if any.
void GetWhenThenList(ISqlNode node)
This interface acts like a marker that indicates if a ISqlNode represents a SQL expression.
The default implementation of ISqlNode, that is a node in the text analysis parsing of SQL commands...
An SQL node describing an in-line CASE conditional expression.