DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Package Functions | Static Package Functions | Properties | Private Member Functions | List of all members
Deveel.Data.Sql.Parser.StatementBuilder Class Reference
Inheritance diagram for Deveel.Data.Sql.Parser.StatementBuilder:
Deveel.Data.Sql.Parser.ISqlNodeVisitor

Public Member Functions

 StatementBuilder (ITypeResolver typeResolver)
 
IEnumerable< IStatementBuild (ISqlNode rootNode)
 

Package Functions

SqlType BuildDataType (DataTypeNode node)
 

Static Package Functions

static ForeignKeyAction GetForeignKeyAction (string actionName)
 

Properties

ITypeResolver TypeResolver [get, private set]
 
ICollection< IStatementStatements [get, private set]
 

Private Member Functions

void ISqlNodeVisitor. Visit (ISqlNode node)
 Invoked to access the given ISqlNode. More...
 
void Visit (ISqlNode node)
 Invoked to access the given ISqlNode. More...
 
void VisitSequenceOfStatements (SequenceOfStatementsNode node)
 

Detailed Description

Definition at line 26 of file StatementBuilder.cs.

Constructor & Destructor Documentation

Deveel.Data.Sql.Parser.StatementBuilder.StatementBuilder ( ITypeResolver  typeResolver)
inline

Definition at line 27 of file StatementBuilder.cs.

27  {
28  TypeResolver = typeResolver;
29  Statements = new List<IStatement>();
30  }
ICollection< IStatement > Statements

Member Function Documentation

IEnumerable<IStatement> Deveel.Data.Sql.Parser.StatementBuilder.Build ( ISqlNode  rootNode)
inline

Definition at line 60 of file StatementBuilder.cs.

60  {
61  Visit(rootNode);
62  return Statements.ToArray();
63  }
void ISqlNodeVisitor. Visit(ISqlNode node)
Invoked to access the given ISqlNode.
ICollection< IStatement > Statements
SqlType Deveel.Data.Sql.Parser.StatementBuilder.BuildDataType ( DataTypeNode  node)
inlinepackage

Definition at line 50 of file StatementBuilder.cs.

50  {
51  return DataTypeBuilder.Build(TypeResolver, node);
52  }
static ForeignKeyAction Deveel.Data.Sql.Parser.StatementBuilder.GetForeignKeyAction ( string  actionName)
inlinestaticpackage

Definition at line 65 of file StatementBuilder.cs.

65  {
66  if (String.Equals("NO ACTION", actionName, StringComparison.OrdinalIgnoreCase) ||
67  String.Equals("NOACTION", actionName, StringComparison.OrdinalIgnoreCase))
68  return ForeignKeyAction.NoAction;
69  if (String.Equals("CASCADE", actionName, StringComparison.OrdinalIgnoreCase))
70  return ForeignKeyAction.Cascade;
71  if (String.Equals("SET DEFAULT", actionName, StringComparison.OrdinalIgnoreCase) ||
72  String.Equals("SETDEFAULT", actionName, StringComparison.OrdinalIgnoreCase))
73  return ForeignKeyAction.SetDefault;
74  if (String.Equals("SET NULL", actionName, StringComparison.OrdinalIgnoreCase) ||
75  String.Equals("SETNULL", actionName, StringComparison.OrdinalIgnoreCase))
76  return ForeignKeyAction.SetNull;
77 
78  throw new NotSupportedException();
79  }
A long string in the system.
ForeignKeyAction
Enumerates the foreign key referential trigger actions.
void ISqlNodeVisitor. Deveel.Data.Sql.Parser.StatementBuilder.Visit ( ISqlNode  node)
inlineprivate

Invoked to access the given ISqlNode.

Parameters
nodeThe node to visit.

Implements Deveel.Data.Sql.Parser.ISqlNodeVisitor.

Definition at line 36 of file StatementBuilder.cs.

36  {
37  Visit(node);
38  }
void ISqlNodeVisitor. Visit(ISqlNode node)
Invoked to access the given ISqlNode.
void Deveel.Data.Sql.Parser.StatementBuilder.Visit ( ISqlNode  node)
inlineprivate

Invoked to access the given ISqlNode.

Parameters
nodeThe node to visit.

Implements Deveel.Data.Sql.Parser.ISqlNodeVisitor.

Definition at line 40 of file StatementBuilder.cs.

40  {
41  if (node is ISqlVisitableNode) {
42  (node as ISqlVisitableNode).Accept(this);
43  return;
44  }
45 
46  if (node is SequenceOfStatementsNode)
47  VisitSequenceOfStatements((SequenceOfStatementsNode) node);
48  }
void VisitSequenceOfStatements(SequenceOfStatementsNode node)
void Deveel.Data.Sql.Parser.StatementBuilder.VisitSequenceOfStatements ( SequenceOfStatementsNode  node)
inlineprivate

Definition at line 54 of file StatementBuilder.cs.

54  {
55  foreach (var statementNode in node.Statements) {
56  Visit(statementNode);
57  }
58  }
void ISqlNodeVisitor. Visit(ISqlNode node)
Invoked to access the given ISqlNode.

Property Documentation

ICollection<IStatement> Deveel.Data.Sql.Parser.StatementBuilder.Statements
getprivate set

Definition at line 34 of file StatementBuilder.cs.

ITypeResolver Deveel.Data.Sql.Parser.StatementBuilder.TypeResolver
getprivate set

Definition at line 32 of file StatementBuilder.cs.


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