18 using System.Collections.Generic;
21 namespace Deveel.Data.Sql.Parser {
23 public bool HandlesOthers {
get;
private set; }
25 public IEnumerable<string> HandledExceptionNames {
get;
private set; }
27 public IEnumerable<IStatementNode> Statements {
get;
private set; }
30 if (node.
NodeName.Equals(
"handled_exceptions")) {
31 GetHandledExceptions(node);
32 }
else if (node.
NodeName.Equals(
"plsql_statement_list")) {
36 return base.OnChildNode(node);
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>());
47 Statements = statements.ToArray();
51 var exceptionNames =
new List<string>();
53 foreach (var childNode
in node.ChildNodes) {
55 throw new SqlParseException(
"Multiple exception names found when OTHERS clause was specified.");
58 ((
SqlKeyNode) childNode).Text.Equals(
"OTHERS", StringComparison.OrdinalIgnoreCase)) {
61 exceptionNames.Add(((IdentifierNode)childNode).Text);
66 HandledExceptionNames = exceptionNames.ToArray();
This is a simple identifier within a SQL grammar.
override ISqlNode OnChildNode(ISqlNode node)
During the initialization of the node from the parser, this method is called for every child node add...
Defines the contract for nodes in an AST model for a SQL grammar analysis and parsing.
void GetStatements(ISqlNode node)
Represents a keyword found during the compilation of a source text.
string NodeName
Gets the name of the node analyzed from the parser.
void GetHandledExceptions(ISqlNode node)
An error that occurs when compiling a input string into a SQL object.
The default implementation of ISqlNode, that is a node in the text analysis parsing of SQL commands...