22 namespace Deveel.Data.Sql.Parser {
24 public string VariableName {
get;
private set; }
28 public bool IsConstant {
get;
private set; }
30 public bool IsNotNull {
get;
private set; }
36 VariableName = ((IdentifierNode) node).Text;
38 Type = (DataTypeNode)node;
39 }
else if (node.
NodeName.Equals(
"constant_opt")) {
41 }
else if (node.
NodeName.Equals(
"var_not_null_opt")) {
43 }
else if (node.
NodeName.Equals(
"var_default_opt")) {
44 GetDefaultExpression(node);
47 return base.OnChildNode(node);
51 foreach (var childNode
in node.ChildNodes) {
53 DefaultExpression = (IExpressionNode) childNode;
60 if (DefaultExpression != null)
63 statement.IsConstant = IsConstant;
64 statement.IsNotNull = IsConstant || IsNotNull;
void GetDefaultExpression(ISqlNode node)
This is a simple identifier within a SQL grammar.
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.
static SqlExpression Build(IExpressionNode node)
static SqlType Build(ITypeResolver resolver, ISqlNode sqlNode)
override ISqlNode OnChildNode(ISqlNode node)
During the initialization of the node from the parser, this method is called for every child node add...
ICollection< IStatement > Statements
A user-defined TYPE that holds complex objects in a database column.
IEnumerable< ISqlNode > ChildNodes
Gets a read-only enumeration of the children nodes, if any.
ITypeResolver TypeResolver
override void BuildStatement(StatementBuilder builder)
Describes the information of a data type as found in a SQL string.
This interface acts like a marker that indicates if a ISqlNode represents a SQL expression.