DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Protected Member Functions | Properties | Private Member Functions | List of all members
Deveel.Data.Sql.Parser.DeclareVariableNode Class Reference
Inheritance diagram for Deveel.Data.Sql.Parser.DeclareVariableNode:
Deveel.Data.Sql.Parser.SqlStatementNode Deveel.Data.Sql.Parser.IDeclareNode Deveel.Data.Sql.Parser.SqlNode Deveel.Data.Sql.Parser.ISqlVisitableNode Deveel.Data.Sql.Parser.IStatementNode Deveel.Data.Sql.Parser.ISqlNode Deveel.Data.Sql.Parser.ISqlNode Deveel.Data.Sql.Parser.ISqlNode Deveel.Data.Sql.Parser.ISqlNode

Protected Member Functions

override ISqlNode OnChildNode (ISqlNode node)
 During the initialization of the node from the parser, this method is called for every child node added to ChildNodes More...
 
override void BuildStatement (StatementBuilder builder)
 
- Protected Member Functions inherited from Deveel.Data.Sql.Parser.SqlNode
virtual void OnNodeInit ()
 After the initialization of the node from the parser, this method is invoked to let the specific initialization to occur. More...
 

Properties

string VariableName [get, private set]
 
DataTypeNode Type [get, private set]
 
bool IsConstant [get, private set]
 
bool IsNotNull [get, private set]
 
IExpressionNode DefaultExpression [get, private set]
 
- Properties inherited from Deveel.Data.Sql.Parser.SqlNode
ISqlNode Parent [get, private set]
 Gets the parent of the current node. More...
 
string NodeName [get, private set]
 Gets the name of the node, as expressed in the SQL grammar. More...
 
IEnumerable< ISqlNodeChildNodes [get, private set]
 Gets an immutable list of nodes, children of the current node. More...
 
IEnumerable< TokenTokens [get, private set]
 Gets an immutable list of Token that represent the source of this node. More...
 
string ISqlNode. NodeName [get]
 
ISqlNode ISqlNode. Parent [get]
 
IEnumerable< ISqlNode > ISqlNode. ChildNodes [get]
 
IEnumerable< Token > ISqlNode. Tokens [get]
 
- Properties inherited from Deveel.Data.Sql.Parser.ISqlNode
string NodeName [get]
 Gets the name of the node analyzed from the parser. More...
 
ISqlNode Parent [get]
 Gets a reference to the parent ISqlNode, if any. More...
 
IEnumerable< ISqlNodeChildNodes [get]
 Gets a read-only enumeration of the children nodes, if any. More...
 
IEnumerable< TokenTokens [get]
 Gets an enumeration of the tokens composing the this node. More...
 

Private Member Functions

void GetDefaultExpression (ISqlNode node)
 

Additional Inherited Members

- Public Member Functions inherited from Deveel.Data.Sql.Parser.SqlNode
 SqlNode ()
 

Detailed Description

Definition at line 23 of file DeclareVariableNode.cs.

Member Function Documentation

override void Deveel.Data.Sql.Parser.DeclareVariableNode.BuildStatement ( StatementBuilder  builder)
inlineprotectedvirtual

Implements Deveel.Data.Sql.Parser.SqlStatementNode.

Definition at line 57 of file DeclareVariableNode.cs.

57  {
58  var varType = DataTypeBuilder.Build(builder.TypeResolver, Type);
59  var statement = new DeclareVariableStatement(VariableName, varType);
60  if (DefaultExpression != null)
61  statement.DefaultExpression = ExpressionBuilder.Build(DefaultExpression);
62 
63  statement.IsConstant = IsConstant;
64  statement.IsNotNull = IsConstant || IsNotNull;
65  builder.Statements.Add(statement);
66  }
void Deveel.Data.Sql.Parser.DeclareVariableNode.GetDefaultExpression ( ISqlNode  node)
inlineprivate

Definition at line 50 of file DeclareVariableNode.cs.

50  {
51  foreach (var childNode in node.ChildNodes) {
52  if (childNode is IExpressionNode)
53  DefaultExpression = (IExpressionNode) childNode;
54  }
55  }
override ISqlNode Deveel.Data.Sql.Parser.DeclareVariableNode.OnChildNode ( ISqlNode  node)
inlineprotectedvirtual

During the initialization of the node from the parser, this method is called for every child node added to ChildNodes

Parameters
nodeThe node being added to the list of children.
Returns
Returns a normalized version of the child node, or the node itself.

Reimplemented from Deveel.Data.Sql.Parser.SqlNode.

Definition at line 34 of file DeclareVariableNode.cs.

34  {
35  if (node is IdentifierNode) {
36  VariableName = ((IdentifierNode) node).Text;
37  } else if (node is DataTypeNode) {
38  Type = (DataTypeNode)node;
39  } else if (node.NodeName.Equals("constant_opt")) {
40  IsConstant = node.ChildNodes.Any();
41  } else if (node.NodeName.Equals("var_not_null_opt")) {
42  IsNotNull = node.ChildNodes.Any();
43  } else if (node.NodeName.Equals("var_default_opt")) {
45  }
46 
47  return base.OnChildNode(node);
48  }

Property Documentation

IExpressionNode Deveel.Data.Sql.Parser.DeclareVariableNode.DefaultExpression
getprivate set

Definition at line 32 of file DeclareVariableNode.cs.

bool Deveel.Data.Sql.Parser.DeclareVariableNode.IsConstant
getprivate set

Definition at line 28 of file DeclareVariableNode.cs.

bool Deveel.Data.Sql.Parser.DeclareVariableNode.IsNotNull
getprivate set

Definition at line 30 of file DeclareVariableNode.cs.

DataTypeNode Deveel.Data.Sql.Parser.DeclareVariableNode.Type
getprivate set

Definition at line 26 of file DeclareVariableNode.cs.

string Deveel.Data.Sql.Parser.DeclareVariableNode.VariableName
getprivate set

Definition at line 24 of file DeclareVariableNode.cs.


The documentation for this class was generated from the following file: