18 using System.Collections.Generic;
25 namespace Deveel.Data.Sql.Parser {
29 Statements =
new List<IStatement>();
34 public ICollection<IStatement> Statements {
get;
private set; }
42 (node as ISqlVisitableNode).Accept(
this);
47 VisitSequenceOfStatements((SequenceOfStatementsNode) node);
55 foreach (var statementNode
in node.Statements) {
62 return Statements.ToArray();
66 if (
String.Equals(
"NO ACTION", actionName, StringComparison.OrdinalIgnoreCase) ||
67 String.Equals(
"NOACTION", actionName, StringComparison.OrdinalIgnoreCase))
69 if (
String.Equals(
"CASCADE", actionName, StringComparison.OrdinalIgnoreCase))
71 if (
String.Equals(
"SET DEFAULT", actionName, StringComparison.OrdinalIgnoreCase) ||
72 String.Equals(
"SETDEFAULT", actionName, StringComparison.OrdinalIgnoreCase))
74 if (
String.Equals(
"SET NULL", actionName, StringComparison.OrdinalIgnoreCase) ||
75 String.Equals(
"SETNULL", actionName, StringComparison.OrdinalIgnoreCase))
78 throw new NotSupportedException();
An interface that allows implementations of the visitor pattern on SQL compiled nodes.
A long string in the system.
void Visit(ISqlNode node)
Invoked to access the given ISqlNode.
Defines the contract for nodes in an AST model for a SQL grammar analysis and parsing.
IEnumerable< IStatement > Build(ISqlNode rootNode)
static SqlType Build(ITypeResolver resolver, ISqlNode sqlNode)
static ForeignKeyAction GetForeignKeyAction(string actionName)
ForeignKeyAction
Enumerates the foreign key referential trigger actions.
void VisitSequenceOfStatements(SequenceOfStatementsNode node)
An implementation of ISqlNode that accepts visits from a ISqlNodeVisitor
StatementBuilder(ITypeResolver typeResolver)
Defines the properties of a specific SQL Type and handles the values compatible.
void Visit(ISqlNode node)
Invoked to access the given ISqlNode.
Describes the information of a data type as found in a SQL string.
SqlType BuildDataType(DataTypeNode node)