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.ExceptionHandlerNode Class Reference
Inheritance diagram for Deveel.Data.Sql.Parser.ExceptionHandlerNode:
Deveel.Data.Sql.Parser.SqlNode 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...
 
- 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

bool HandlesOthers [get, private set]
 
IEnumerable< string > HandledExceptionNames [get, private set]
 
IEnumerable< IStatementNodeStatements [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 GetStatements (ISqlNode node)
 
void GetHandledExceptions (ISqlNode node)
 

Additional Inherited Members

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

Detailed Description

Definition at line 22 of file ExceptionHandlerNode.cs.

Member Function Documentation

void Deveel.Data.Sql.Parser.ExceptionHandlerNode.GetHandledExceptions ( ISqlNode  node)
inlineprivate

Definition at line 50 of file ExceptionHandlerNode.cs.

50  {
51  var exceptionNames = new List<string>();
52 
53  foreach (var childNode in node.ChildNodes) {
54  if (HandlesOthers)
55  throw new SqlParseException("Multiple exception names found when OTHERS clause was specified.");
56 
57  if (childNode is SqlKeyNode &&
58  ((SqlKeyNode) childNode).Text.Equals("OTHERS", StringComparison.OrdinalIgnoreCase)) {
59  HandlesOthers = true;
60  } else if (childNode is IdentifierNode) {
61  exceptionNames.Add(((IdentifierNode)childNode).Text);
62  }
63  }
64 
65  if (!HandlesOthers)
66  HandledExceptionNames = exceptionNames.ToArray();
67  }
void Deveel.Data.Sql.Parser.ExceptionHandlerNode.GetStatements ( ISqlNode  node)
inlineprivate

Definition at line 39 of file ExceptionHandlerNode.cs.

39  {
40  var statements = new List<IStatementNode>();
41  foreach (var childNode in node.ChildNodes) {
42  if (childNode.NodeName.Equals("plsql_statement")) {
43  statements.AddRange(childNode.ChildNodes.OfType<IStatementNode>());
44  }
45  }
46 
47  Statements = statements.ToArray();
48  }
override ISqlNode Deveel.Data.Sql.Parser.ExceptionHandlerNode.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 29 of file ExceptionHandlerNode.cs.

29  {
30  if (node.NodeName.Equals("handled_exceptions")) {
32  } else if (node.NodeName.Equals("plsql_statement_list")) {
33  GetStatements(node);
34  }
35 
36  return base.OnChildNode(node);
37  }

Property Documentation

IEnumerable<string> Deveel.Data.Sql.Parser.ExceptionHandlerNode.HandledExceptionNames
getprivate set

Definition at line 25 of file ExceptionHandlerNode.cs.

bool Deveel.Data.Sql.Parser.ExceptionHandlerNode.HandlesOthers
getprivate set

Definition at line 23 of file ExceptionHandlerNode.cs.

IEnumerable<IStatementNode> Deveel.Data.Sql.Parser.ExceptionHandlerNode.Statements
getprivate set

Definition at line 27 of file ExceptionHandlerNode.cs.


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