DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Protected Member Functions | Properties | List of all members
Deveel.Data.Sql.Parser.DeclareCursorNode Class Reference
Inheritance diagram for Deveel.Data.Sql.Parser.DeclareCursorNode:
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 CursorName [get, private set]
 
IExpressionNode QueryExpression [get, private set]
 
IEnumerable< CursorParameterNodeParameters [get, private set]
 
bool Insensitive [get, private set]
 
bool Scroll [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...
 

Additional Inherited Members

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

Detailed Description

Definition at line 26 of file DeclareCursorNode.cs.

Member Function Documentation

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

Implements Deveel.Data.Sql.Parser.SqlStatementNode.

Definition at line 53 of file DeclareCursorNode.cs.

53  {
54  var parameters = new List<CursorParameter>();
55  if (Parameters != null) {
56  foreach (var parameterNode in Parameters) {
57  var dataType = builder.BuildDataType(parameterNode.ParameterType);
58  parameters.Add(new CursorParameter(parameterNode.ParameterName, dataType));
59  }
60  }
61 
62  var flags = new CursorFlags();
63  if (Insensitive)
64  flags |= CursorFlags.Insensitive;
65  if (Scroll)
66  flags |= CursorFlags.Scroll;
67 
68  var queryExpression = (SqlQueryExpression) ExpressionBuilder.Build(QueryExpression);
69 
70  builder.Statements.Add(new DeclareCursorStatement(CursorName, parameters.ToArray(), flags, queryExpression));
71  }
IEnumerable< CursorParameterNode > Parameters
override ISqlNode Deveel.Data.Sql.Parser.DeclareCursorNode.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 37 of file DeclareCursorNode.cs.

37  {
38  if (node is IdentifierNode) {
39  CursorName = ((IdentifierNode) node).Text;
40  } else if (node.NodeName.Equals("cursor_args_opt")) {
41  Parameters = node.FindNodes<CursorParameterNode>();
42  } else if (node is IExpressionNode) {
43  QueryExpression = (SqlQueryExpressionNode) node;
44  } else if (node.NodeName.Equals("insensitive_opt")) {
45  Insensitive = node.ChildNodes.Any();
46  } else if (node.NodeName.Equals("scroll_opt")) {
47  Scroll = node.ChildNodes.Any();
48  }
49 
50  return base.OnChildNode(node);
51  }
IEnumerable< CursorParameterNode > Parameters

Property Documentation

string Deveel.Data.Sql.Parser.DeclareCursorNode.CursorName
getprivate set

Definition at line 27 of file DeclareCursorNode.cs.

bool Deveel.Data.Sql.Parser.DeclareCursorNode.Insensitive
getprivate set

Definition at line 33 of file DeclareCursorNode.cs.

IEnumerable<CursorParameterNode> Deveel.Data.Sql.Parser.DeclareCursorNode.Parameters
getprivate set

Definition at line 31 of file DeclareCursorNode.cs.

IExpressionNode Deveel.Data.Sql.Parser.DeclareCursorNode.QueryExpression
getprivate set

Definition at line 29 of file DeclareCursorNode.cs.

bool Deveel.Data.Sql.Parser.DeclareCursorNode.Scroll
getprivate set

Definition at line 35 of file DeclareCursorNode.cs.


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