DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
SqlGrammar.cs
Go to the documentation of this file.
1 //
2 // Copyright 2010-2015 Deveel
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 using System.ComponentModel;
18 
19 using Irony.Parsing;
20 
21 namespace Deveel.Data.Sql.Parser {
22  partial class SqlGrammar : SqlGrammarBase {
23  public override string Dialect {
24  get { return "SQL-99"; }
25  }
26 
27  protected override NonTerminal MakeRoot() {
28  var root = new NonTerminal("root");
29  Productions(root);
30 
31  return root;
32  }
33 
34  private void Productions(NonTerminal root) {
35  // PL/SQL
36  var block = PlSqlBlock();
37  var blockList = new NonTerminal("block_list");
38  blockList.Rule = MakePlusRule(blockList, block);
39 
40  root.Rule = SqlStatementList() + Eof |
41  blockList + Eof;
42  }
43 
44  private NonTerminal StatementEnd() {
45  var statementEnd = new NonTerminal("statement_end");
46  statementEnd.Rule = Empty | ";";
47  return statementEnd;
48  }
49 
50  private NonTerminal OrReplace() {
51  var orReplaceOpt = new NonTerminal("or_replace_opt");
52  orReplaceOpt.Rule = Empty | OR + REPLACE;
53  return orReplaceOpt;
54  }
55 
56  private NonTerminal SqlStatementList() {
57  var commandList = new NonTerminal("command_list", typeof(SequenceOfStatementsNode));
58 
59  commandList.Rule = MakePlusRule(commandList, SqlStatement());
60 
61  return commandList;
62  }
63 
64  private NonTerminal SqlStatement() {
65  var sqlStatement = new NonTerminal("sql_statement");
66 
67  var command = new NonTerminal("command");
68 
69  sqlStatement.Rule = command + StatementEnd();
70 
71  command.Rule =
72  VariableDeclaration() |
73  Create() |
74  Alter() |
75  Drop() |
76  Declare() |
77  Open() |
78  Close() |
79  Fetch() |
80  Select() |
81  CursorDeclaration() |
82  Insert() |
83  Update() |
84  Delete() |
85  Truncate() |
86  Set() |
87  Commit() |
88  Rollback() |
89  Grant() |
90  Revoke();
91 
92  return sqlStatement;
93  }
94 
95  private NonTerminal Declare() {
96  var command = new NonTerminal("declare");
97 
98  command.Rule = DeclareCursor() |
99  DeclareVariable() |
100  DeclareException();
101 
102  return command;
103  }
104 
105  private NonTerminal CursorDeclaration() {
106  var declareCursor = new NonTerminal("cursor_declaration", typeof(DeclareCursorNode));
107  var insensitiveOpt = new NonTerminal("insensitive_opt");
108  var scrollOpt = new NonTerminal("scroll_opt");
109  var cursorArgsOpt = new NonTerminal("cursor_args_opt");
110  var cursorArgs = new NonTerminal("cursor_args");
111  var cursorArg = new NonTerminal("cursor_arg", typeof(CursorParameterNode));
112  declareCursor.Rule = Key("CURSOR") + Identifier + cursorArgsOpt +
113  insensitiveOpt + scrollOpt +
114  Key("IS") + SqlQueryExpression();
115  cursorArgsOpt.Rule = Empty | "(" + cursorArgs + ")";
116  cursorArgs.Rule = MakePlusRule(cursorArgs, Comma, cursorArg);
117  cursorArg.Rule = Identifier + DataType();
118  insensitiveOpt.Rule = Empty | Key("INSENSITIVE");
119  scrollOpt.Rule = Empty | Key("SCROLL");
120  return declareCursor;
121  }
122 
123  private NonTerminal DeclareCursor() {
124  var declareCuror = new NonTerminal("declare_cursor");
125  declareCuror.Rule = Key("DECLARE") + CursorDeclaration();
126  return declareCuror;
127  }
128 
129  private NonTerminal VariableDeclaration() {
130  var declareVariable = new NonTerminal("variable_declaration", typeof(DeclareVariableNode));
131  var constantOpt = new NonTerminal("constant_opt");
132  var varNotNullOpt = new NonTerminal("var_not_null_opt");
133  var varDefaultOpt = new NonTerminal("var_default_opt");
134  var varDefaultAssign = new NonTerminal("var_default_assign");
135 
136  declareVariable.Rule = Identifier + constantOpt + DataType() + varNotNullOpt + varDefaultOpt;
137  constantOpt.Rule = Empty | Key("CONSTANT");
138  varNotNullOpt.Rule = Empty | Key("NOT") + Key("NULL");
139  varDefaultOpt.Rule = Empty | varDefaultAssign + SqlExpression();
140  varDefaultAssign.Rule = ":=" | Key("DEFAULT");
141 
142  return declareVariable;
143  }
144 
145  private NonTerminal ExceptionDeclaration() {
146  var declareException = new NonTerminal("exception_declaration", typeof(DeclareExceptionNode));
147  declareException.Rule = Identifier + Key("EXCEPTION");
148  return declareException;
149  }
150 
151  private NonTerminal DeclareException() {
152  var command = new NonTerminal("declare_exception");
153  command.Rule = Key("DECLARE") + ExceptionDeclaration();
154  return command;
155  }
156 
157  private NonTerminal DeclareVariable() {
158  var declareVariable = new NonTerminal("declare_variable");
159  declareVariable.Rule = Key("DECLARE") + VariableDeclaration();
160  return declareVariable;
161  }
162 
163  private NonTerminal Open() {
164  var openCommand = new NonTerminal("open_command", typeof(OpenCursorStatementNode));
165  var argsOpt = new NonTerminal("args_opt");
166  var argList = new NonTerminal("arg_list");
167 
168  openCommand.Rule = Key("OPEN") + Identifier + argsOpt;
169  argsOpt.Rule = Empty | "(" + argList + ")";
170  argList.Rule = MakePlusRule(argList, Comma, SqlExpression());
171  return openCommand;
172  }
173 
174  private NonTerminal Close() {
175  var closeCommand = new NonTerminal("close_command", typeof(CloseCursorStatementNode));
176  closeCommand.Rule = Key("CLOSE") + Identifier;
177  return closeCommand;
178  }
179 
180  private NonTerminal Fetch() {
181  var fetchCommand=new NonTerminal("fetch_command", typeof(FetchStatementNode));
182  var directionOpt = new NonTerminal("direction_opt");
183  var fetchDirection = new NonTerminal("fetch_direction");
184  var identOpt = new NonTerminal("ident_opt");
185  identOpt.Flags = TermFlags.IsTransient;
186  var fromOpt = new NonTerminal("from_opt");
187  var intoOpt = new NonTerminal("into_opt");
188 
189  fetchCommand.Rule = Key("FETCH") + directionOpt + fromOpt + identOpt + intoOpt;
190  directionOpt.Rule = Empty | fetchDirection;
191  identOpt.Rule = Empty | Identifier;
192  fetchDirection.Rule = Key("NEXT") |
193  Key("PRIOR") |
194  Key("FIRST") |
195  Key("LAST") |
196  Key("ABSOLUTE") + SqlExpression() |
197  Key("RELATIVE") + SqlExpression();
198  fromOpt.Rule = Empty | Key("FROM");
199  intoOpt.Rule = Empty | Key("INTO") + SqlExpression();
200  return fetchCommand;
201  }
202 
203  private NonTerminal NestedSqlStatement() {
204  var sqlStatement = new NonTerminal("sql_statement");
205 
206  sqlStatement.Rule = Select() |
207  Insert() |
208  Update() |
209  Delete() |
210  Open() |
211  Close() |
212  Fetch() |
213  Commit() |
214  Set() |
215  Rollback();
216 
217  return sqlStatement;
218  }
219 
220  private NonTerminal PlSqlBlock() {
221  var plsqlBlock = new NonTerminal("plsql_block", typeof(PlSqlBlockNode));
222  var labelStatement = new NonTerminal("plsql_label", typeof(LabelNode));
223  var labelStatementOpt = new NonTerminal("plsql_label_opt");
224  var declareStatementOpt = new NonTerminal("declare_statement_opt");
225  var declareSpec = new NonTerminal("declare_spec");
226  var declareCommand = new NonTerminal("declare_command");
227  var declareSpecList = new NonTerminal("declare_spec_list");
228  var plsqlCodeBlock = new NonTerminal("plsql_code_block", typeof(PlSqlCodeBlockNode));
229  var sqlStatementList = new NonTerminal("sql_statement_list");
230  var declarePragma = new NonTerminal("declare_pragma", typeof(DeclarePragmaNode));
231  var exceptionBlockOpt = new NonTerminal("exception_block_opt");
232  var exceptionBlock = new NonTerminal("exception_block");
233  var exceptionHandler = new NonTerminal("exception_handler", typeof(ExceptionHandlerNode));
234  var exceptionHandlerList = new NonTerminal("exception_handler_list");
235  var exceptionNames = new NonTerminal("exception_names");
236  var handledExceptions = new NonTerminal("handled_exceptions");
237  var whenOpt = new NonTerminal("when_opt");
238 
239  whenOpt.Rule = Empty | Key("WHEN") + SqlExpression();
240 
241  #region PL/SQL Statement
242 
243  var plsqlStatement = new NonTerminal("plsql_statement");
244  var plsqlCommand = new NonTerminal("plsql_command");
245 
246  var plsqlStatementList = new NonTerminal("plsql_statement_list");
247  plsqlStatementList.Rule = MakePlusRule(plsqlStatementList, plsqlStatement);
248 
249  #region Conditional
250 
251  var conditionalStatement = new NonTerminal("conditional_statement");
252  var conditionalElsifList = new NonTerminal("conditional_elsif_list");
253  var conditionalElsif = new NonTerminal("conditional_elsif");
254  var conditionalElseOpt = new NonTerminal("conditional_else_opt");
255 
256  conditionalStatement.Rule = IF + SqlExpression() + THEN + plsqlStatementList +
257  conditionalElsifList +
258  conditionalElseOpt +
259  END + IF;
260  conditionalElsifList.Rule = MakeStarRule(conditionalElsifList, conditionalElsif);
261  conditionalElsif.Rule = ELSIF + SqlExpression() + THEN + plsqlStatementList;
262  conditionalElseOpt.Rule = Empty | ELSE + plsqlStatementList;
263 
264  #endregion
265 
266  #region Loop
267 
268  var loopStatement = new NonTerminal("loop_statement");
269  var loopLabelOpt = new NonTerminal("loop_label_opt");
270  var loopHeadOpt = new NonTerminal("loop_head_opt");
271  var loopHead = new NonTerminal("loop_head");
272  var whileLoop = new NonTerminal("while_loop");
273  var forLoop = new NonTerminal("for_loop");
274  var numericLoopParam = new NonTerminal("numeric_loop_param");
275  var reverseOpt = new NonTerminal("reverse_opt");
276  var forLoopParam = new NonTerminal("for_loop_param");
277  var cursorLoopParam = new NonTerminal("cursor_loop_param");
278  var loopBodyList = new NonTerminal("loop_body_list");
279  var loopBody = new NonTerminal("loop_body");
280  var loopControlStatement = new NonTerminal("loop_control_statement");
281  var labelOpt = new NonTerminal("label_opt");
282 
283  labelOpt.Rule = Empty | Identifier;
284 
285  #region Exit
286 
287  var exitStatement = new NonTerminal("exit_statement", typeof(ExitStatementNode));
288 
289  exitStatement.Rule = Key("EXIT") + labelOpt + whenOpt + StatementEnd();
290 
291  #endregion
292 
293  #region Break
294 
295  var breakStatement = new NonTerminal("break_statement", typeof(BreakStatementNode));
296 
297  breakStatement.Rule = Key("BREAK") + labelOpt + whenOpt + StatementEnd();
298 
299  #endregion
300 
301  #region Continue
302 
303  var continueStatement = new NonTerminal("continue_statement", typeof(ContinueStatementNode));
304 
305  continueStatement.Rule = Key("CONTINUE") + labelOpt + whenOpt + StatementEnd();
306 
307  #endregion
308 
309  loopStatement.Rule = loopLabelOpt + loopHeadOpt + Key("LOOP") + loopBodyList + Key("LOOP") + Key("END");
310  loopLabelOpt.Rule = Empty | Identifier;
311  loopBody.Rule = plsqlStatement | loopControlStatement;
312  loopBodyList.Rule = MakePlusRule(loopBodyList, loopBody);
313  loopControlStatement.Rule = exitStatement |
314  breakStatement |
315  continueStatement;
316  loopHeadOpt.Rule = Empty | loopHead;
317  loopHead.Rule = whileLoop | forLoop;
318  whileLoop.Rule = Key("WHILE") + SqlExpression();
319  forLoop.Rule = Key("FOR") + forLoopParam;
320  forLoopParam.Rule = numericLoopParam | cursorLoopParam;
321  numericLoopParam.Rule = Identifier + Key("IN") + reverseOpt + SqlExpression() + ".." + SqlExpression();
322  reverseOpt.Rule = Empty | Key("REVERSE");
323  cursorLoopParam.Rule = Identifier + Key("IN") + ObjectName();
324 
325  #endregion
326 
327  #region Raise
328 
329  var raiseStatement = new NonTerminal("raise_statement", typeof(RaiseStatementNode));
330  var exceptionNameOpt = new NonTerminal("exception_name_opt");
331  raiseStatement.Rule = Key("RAISE") + exceptionNameOpt;
332  exceptionNameOpt.Rule = Empty | Identifier;
333 
334  #endregion
335 
336  #region Return
337 
338  var returnStatement = new NonTerminal("return_statement", typeof(ReturnStatementNode));
339  returnStatement.Rule = Key("RETURN") + SqlExpression();
340 
341  #endregion
342 
343  #region GoTo
344 
345  var gotoStatement = new NonTerminal("goto_statement", typeof(GotoStatementNode));
346  gotoStatement.Rule = Key("GOTO") + StringLiteral;
347 
348  #endregion
349 
350  plsqlStatement.Rule = plsqlCommand + StatementEnd();
351  plsqlCommand.Rule = NestedSqlStatement() |
352  gotoStatement |
353  returnStatement |
354  raiseStatement |
355  loopStatement |
356  conditionalStatement;
357 
358  #endregion
359 
360  plsqlBlock.Rule = labelStatementOpt + declareStatementOpt + plsqlCodeBlock;
361  labelStatementOpt.Rule = Empty | labelStatement;
362  labelStatement.Rule = "<<" + Identifier + ">>";
363  declareStatementOpt.Rule = Empty | DECLARE + declareSpecList;
364  declareSpecList.Rule = MakePlusRule(declareSpecList, declareSpec);
365  declareCommand.Rule = VariableDeclaration() |
366  ExceptionDeclaration() |
367  declarePragma |
368  CursorDeclaration();
369  declareSpec.Rule = declareCommand + StatementEnd();
370  declarePragma.Rule = Key("PRAGMA") + Key("EXCEPTION_INIT") + "(" + StringLiteral + "," + PositiveLiteral + ")";
371 
372  plsqlCodeBlock.Rule = Key("BEGIN") + plsqlStatementList + exceptionBlockOpt + Key("END");
373 
374  sqlStatementList.Rule = MakePlusRule(sqlStatementList, NestedSqlStatement());
375 
376  exceptionBlockOpt.Rule = Empty | exceptionBlock;
377  exceptionBlock.Rule = Key("EXCEPTION") + exceptionHandlerList;
378  exceptionHandlerList.Rule = MakePlusRule(exceptionHandlerList, exceptionHandler);
379  exceptionHandler.Rule = Key("WHEN") + handledExceptions + Key("THEN") + plsqlStatementList;
380  handledExceptions.Rule = Key("OTHERS") | exceptionNames;
381  exceptionNames.Rule = MakePlusRule(exceptionNames, OR, Identifier);
382 
383  return plsqlBlock;
384  }
385 
386  #region CREATE ...
387 
388  private NonTerminal Create() {
389  var createCommand = new NonTerminal("create_command");
390 
391  // -- CREATE
392  createCommand.Rule = CreateSchema() |
393  CreateTable() |
394  CreateView() |
395  CreateIndex() |
396  CreateSequence() |
397  CreateTrigger() |
398  CreateUser() |
399  CreateType();
400 
401  return createCommand;
402  }
403 
404  private NonTerminal CreateTable() {
405  var createTable = new NonTerminal("create_table", typeof(CreateTableNode));
406  var ifNotExistsOpt = new NonTerminal("if_not_exists_opt");
407  var temporaryOpt = new NonTerminal("temporary_opt");
408  var columnOrConstraintList = new NonTerminal("column_or_constraint_list");
409  var columnOrConstraint = new NonTerminal("column_or_constraint");
410  var tableColumn = new NonTerminal("table_column", typeof (TableColumnNode));
411  var columnDefaultOpt = new NonTerminal("column_default_opt");
412  var columnIdentityOpt = new NonTerminal("column_identity_opt");
413  var columnConstraintList = new NonTerminal("column_constraint_list");
414  var columnConstraint = new NonTerminal("column_constraint", typeof (ColumnConstraintNode));
415  var columnConstraintRefOpt = new NonTerminal("column_constraint_ref_opt");
416  var fkeyActionList = new NonTerminal("fkey_action_list");
417  var fkeyAction = new NonTerminal("fkey_action");
418  var fkeyActionType = new NonTerminal("fkey_action_type");
419  var tableConstraint = new NonTerminal("table_constraint", typeof (TableConstraintNode));
420  var constraintName = new NonTerminal("constraint_name");
421  var tableConstraintNameOpt = new NonTerminal("table_constraint_name_opt");
422  var defTableConstraint = new NonTerminal("def_table_constraint");
423  var columnList = new NonTerminal("column_list");
424 
425  createTable.Rule = CREATE + temporaryOpt + TABLE + ifNotExistsOpt + ObjectName() + "(" + columnOrConstraintList + ")";
426  ifNotExistsOpt.Rule = Empty | IF + NOT + EXISTS;
427  temporaryOpt.Rule = Empty | Key("TEMPORARY");
428  columnOrConstraintList.Rule = MakePlusRule(columnOrConstraintList, Comma, columnOrConstraint);
429 
430  columnOrConstraint.Rule = tableColumn | tableConstraint;
431 
432  tableColumn.Rule = Identifier + DataType() + columnConstraintList + columnDefaultOpt + columnIdentityOpt;
433 
434  columnConstraintList.Rule = MakeStarRule(columnConstraintList, columnConstraint);
435  columnConstraint.Rule = NULL |
436  NOT + NULL |
437  UNIQUE |
438  PRIMARY + KEY |
439  CHECK + SqlExpression() |
440  REFERENCES + ObjectName() + columnConstraintRefOpt + fkeyActionList;
441  columnConstraintRefOpt.Rule = Empty | "(" + Identifier + ")";
442  columnDefaultOpt.Rule = Empty | DEFAULT + SqlExpression();
443  columnIdentityOpt.Rule = Empty | IDENTITY;
444  fkeyActionList.Rule = MakeStarRule(fkeyActionList, fkeyAction);
445  fkeyAction.Rule = ON + DELETE + fkeyActionType | ON + UPDATE + fkeyActionType;
446  fkeyActionType.Rule = Key("CASCADE") |
447  Key("SET") + Key("NULL") |
448  Key("SET") + Key("DEFAULT") |
449  Key("NO") + Key("ACTION");
450 
451  tableConstraint.Rule = tableConstraintNameOpt + defTableConstraint;
452  tableConstraintNameOpt.Rule = Empty | CONSTRAINT + constraintName;
453  constraintName.Rule = Identifier;
454  defTableConstraint.Rule = PRIMARY + KEY + "(" + columnList + ")" |
455  UNIQUE + "(" + columnList + ")" |
456  CHECK + "(" + SqlExpression() + ")" |
457  FOREIGN + KEY + "(" + columnList + ")" + REFERENCES + ObjectName() + "(" + columnList +
458  ")" +
459  fkeyActionList;
460  columnList.Rule = MakePlusRule(columnList, Comma, Identifier);
461 
462  return createTable;
463  }
464 
465  private NonTerminal CreateView() {
466  var createView = new NonTerminal("create_view", typeof(CreateViewNode));
467  var columnList = new NonTerminal("column_list");
468  var columnName = new NonTerminal("column_name");
469  var columnListOpt = new NonTerminal("column_list_opt");
470 
471  columnName.Rule = Identifier;
472  columnList.Rule = MakeStarRule(columnList, Comma, columnName);
473  columnListOpt.Rule = Empty | "(" + columnList + ")";
474  createView.Rule = CREATE + OrReplace() + VIEW + ObjectName() + columnListOpt + "AS" + SqlQueryExpression();
475  return createView;
476  }
477 
478  private NonTerminal CreateUser() {
479  var createUser = new NonTerminal("create_user", typeof (CreateUserStatementNode));
480 
481  var identifiedRule = new NonTerminal("identified");
482  var identifiedByPassword = new NonTerminal("identified_by_password", typeof (IdentifiedByPasswordNode));
483  var identifiedByAuth = new NonTerminal("identified_by_auth");
484  var setAccountLockOpt = new NonTerminal("set_account_lock_opt");
485  var setGroupsOpt = new NonTerminal("set_groups_opt");
486 
487  createUser.Rule = Key("CREATE") + Key("USER") + Identifier +
488  Key("IDENTIFIED") + identifiedRule + setAccountLockOpt + setGroupsOpt;
489  identifiedRule.Rule = identifiedByPassword | identifiedByAuth;
490  identifiedByPassword.Rule = Key("BY") + Key("PASSWORD") + SqlExpression();
491  identifiedByAuth.Rule = Key("BY") + StringLiteral;
492 
493  setAccountLockOpt.Rule = Empty |
494  SET + ACCOUNT + LOCK |
495  SET + ACCOUNT + UNLOCK;
496  setGroupsOpt.Rule = Empty | SET + GROUPS + StringLiteral;
497 
498  return createUser;
499  }
500 
501  private NonTerminal CreateIndex() {
502  var createIndex = new NonTerminal("create_index");
503 
504  var columnList = new NonTerminal("column_list");
505  var columnName = new NonTerminal("column_name");
506 
507  columnName.Rule = Identifier;
508  columnList.Rule = MakePlusRule(columnList, Comma, columnName);
509 
510  createIndex.Rule = CREATE + INDEX + ObjectName() + ON + ObjectName() + "(" + columnList + ")";
511 
512  return createIndex;
513  }
514 
515  private NonTerminal CreateSequence() {
516  var createSequence = new NonTerminal("create_sequence", typeof(CreateSequenceNode));
517 
518  var incrementOpt = new NonTerminal("increment_opt");
519  var increment = new NonTerminal("increment");
520  var startOpt = new NonTerminal("start_opt");
521  var start = new NonTerminal("start");
522  var minvalueOpt = new NonTerminal("minvalue_opt");
523  var minvalue = new NonTerminal("minvalue");
524  var maxvalueOpt = new NonTerminal("maxvalue_opt");
525  var maxvalue = new NonTerminal("maxvalue");
526  var cacheOpt = new NonTerminal("cache_opt");
527  var cycleOpt = new NonTerminal("cycle_opt");
528  var cache = new NonTerminal("cache");
529 
530  createSequence.Rule = Key("CREATE") + Key("SEQUENCE") + ObjectName() +
531  incrementOpt +
532  startOpt +
533  minvalueOpt +
534  maxvalueOpt +
535  cacheOpt +
536  cycleOpt;
537  incrementOpt.Rule = Empty | increment;
538  increment.Rule = Key("INCREMENT") + Key("BY") + SqlExpression();
539  startOpt.Rule = Empty | start;
540  start.Rule = Key("START") + Key("WITH") + SqlExpression();
541  minvalueOpt.Rule = Empty | minvalue;
542  minvalue.Rule = Key("MINVALUE") + SqlExpression();
543  maxvalueOpt.Rule = Empty | maxvalue;
544  maxvalue.Rule = Key("MAXVALUE") + SqlExpression();
545  cycleOpt.Rule = Empty | Key("CYCLE");
546  cacheOpt.Rule = Empty | cache;
547  cache.Rule = Key("CACHE") + SqlExpression();
548 
549  return createSequence;
550  }
551 
552  private NonTerminal CreateSchema() {
553  var createSchema = new NonTerminal("create_schema", typeof(CreateSchemaNode));
554  createSchema.Rule = Key("CREATE") + Key("SCHEMA") + Identifier;
555 
556  return createSchema;
557  }
558 
559  private NonTerminal CreateTrigger() {
560  var createTrigger = new NonTerminal("create_trigger", typeof(CreateTriggerNode));
561  var createProcedureTrigger = new NonTerminal("create_procedure_trigger");
562  var createCallbackTrigger = new NonTerminal("create_callback_trigger");
563  var triggerSync = new NonTerminal("trigger_sync");
564  var beforeOrAfter = new NonTerminal("before_or_after");
565  var triggerEvents = new NonTerminal("trigger_events");
566  var triggerEvent = new NonTerminal("trigger_event");
567  var triggerBody = new NonTerminal("trigger_body");
568  var triggerRefOpt = new NonTerminal("trigger_ref_opt");
569  var triggerRefList = new NonTerminal("trigger_ref_list");
570  var triggerRef = new NonTerminal("trigger_ref");
571  var stateTableRef = new NonTerminal("state_table_ref");
572  var asOpt = new NonTerminal("as_opt");
573 
574  var functionCallArgsOpt = new NonTerminal("function_call_args_opt");
575  var functionCallArgsList = new NonTerminal("function_call_args_list");
576 
577  createTrigger.Rule = createProcedureTrigger | createCallbackTrigger;
578  createCallbackTrigger.Rule = CREATE + OrReplace() + CALLBACK + TRIGGER +
579  beforeOrAfter + ON + ObjectName();
580  createProcedureTrigger.Rule = CREATE + OrReplace() + TRIGGER + ObjectName() +
581  triggerSync + triggerRefOpt +
582  FOR + EACH + ROW + triggerBody;
583  triggerSync.Rule = beforeOrAfter + triggerEvents + ON + ObjectName();
584  beforeOrAfter.Rule = BEFORE | AFTER;
585  triggerEvents.Rule = MakePlusRule(triggerEvents, OR, triggerEvent);
586  triggerEvent.Rule = INSERT | UPDATE | DELETE;
587  triggerRefOpt.Rule = Empty | Key("REFERENCING") + triggerRefList;
588  triggerRefList.Rule = MakePlusRule(triggerRefList, triggerRef);
589  triggerRef.Rule = stateTableRef + asOpt + Identifier;
590  asOpt.Rule = Empty | Key("AS");
591  stateTableRef.Rule = Key("OLD") | Key("NEW");
592  triggerBody.Rule = EXECUTE + PROCEDURE + ObjectName() + "(" + functionCallArgsList + ")" |
593  PlSqlBlock();
594 
595  functionCallArgsOpt.Rule = Empty | "(" + functionCallArgsList + ")";
596  functionCallArgsList.Rule = MakeStarRule(functionCallArgsList, Comma, SqlExpression());
597 
598  return createTrigger;
599  }
600 
601  private NonTerminal CreateType() {
602  var createType = new NonTerminal("create_type");
603 
604  createType.Rule = CREATE + OrReplace() + TYPE + ObjectName();
605 
606  return createType;
607  }
608 
609  #endregion
610 
611  #region ALTER ...
612 
613  private NonTerminal Alter() {
614  var alterCommand = new NonTerminal("alter_command");
615 
616  alterCommand.Rule = AlterTable() | AlterUser();
617 
618  return alterCommand;
619  }
620 
621  private NonTerminal AlterTable() {
622  var alterTable = new NonTerminal("alter_table", typeof(AlterTableNode));
623  var alterActions = new NonTerminal("alter_actions");
624  var alterAction = new NonTerminal("alter_action");
625  var addColumn = new NonTerminal("add_column", typeof(AddColumnNode));
626  var columnOpt = new NonTerminal("column_opt");
627  var addConstraint = new NonTerminal("add_constraint", typeof(AddConstraintNode));
628  var dropColumn = new NonTerminal("drop_column", typeof(DropColumnNode));
629  var dropConstraint = new NonTerminal("drop_constraint", typeof(DropConstraintNode));
630  var dropPrimaryKey = new NonTerminal("drop_primary_key", typeof(DropPrimaryKeyNode));
631  var setDefault = new NonTerminal("set_default", typeof(SetDefaultNode));
632  var alterColumn = new NonTerminal("alter_column", typeof(AlterColumnNode));
633  var dropDefault = new NonTerminal("drop_default", typeof(DropDefaultNode));
634  var columnDef = new NonTerminal("column_def", typeof(TableColumnNode));
635  var columnConstraintList = new NonTerminal("column_constraint_lst");
636  var columnDefaultOpt = new NonTerminal("column_default_opt");
637  var columnIdentityOpt = new NonTerminal("column_identity_opt");
638  var columnConstraint = new NonTerminal("column_constraint", typeof(ColumnConstraintNode));
639  var columnConstraintRefOpt = new NonTerminal("column_constraint_ref_opt");
640  var fkeyActionList = new NonTerminal("fkey_action_list");
641  var fkeyAction = new NonTerminal("fkey_action");
642  var fkeyActionType = new NonTerminal("fkey_action_type");
643  var tableConstraint = new NonTerminal("table_constraint", typeof(TableConstraintNode));
644  var constraintName = new NonTerminal("constraint_name");
645  var tableConstraintNameOpt = new NonTerminal("table_constraint_name_opt");
646  var defTableConstraint = new NonTerminal("def_table_constraint");
647  var columnList = new NonTerminal("column_list");
648 
649  alterTable.Rule = Key("ALTER") + Key("TABLE") + ObjectName() + alterActions;
650  alterActions.Rule = MakePlusRule(alterActions, alterAction);
651  alterAction.Rule = addColumn | addConstraint | dropColumn | dropConstraint | dropPrimaryKey | setDefault | dropDefault | alterColumn;
652  addColumn.Rule = Key("ADD") + columnOpt + columnDef;
653  columnOpt.Rule = Empty | Key("COLUMN");
654  dropColumn.Rule = Key("DROP") + columnOpt + Identifier;
655  addConstraint.Rule = Key("ADD") + Key("CONSTRAINT") + tableConstraint;
656  dropConstraint.Rule = Key("DROP") + Key("CONSTRAINT") + Identifier;
657  dropPrimaryKey.Rule = Key("DROP") + Key("PRIMARY") + Key("KEY");
658  dropDefault.Rule = Key("ALTER") + columnOpt + Identifier + Key("DROP") + Key("DEFAULT");
659  setDefault.Rule = Key("ALTER") + columnOpt + Identifier + Key("SET") + Key("DEFAULT") + SqlExpression();
660  alterColumn.Rule = Key("ALTER") + columnOpt + columnDef;
661  columnDef.Rule = Identifier + DataType() + columnConstraintList + columnDefaultOpt + columnIdentityOpt;
662  columnConstraintList.Rule = MakeStarRule(columnConstraintList, columnConstraint);
663  columnConstraint.Rule = Key("NULL") |
664  Key("NOT") + Key("NULL") |
665  Key("UNIQUE") |
666  Key("PRIMARY") + Key("KEY") |
667  Key("CHECK") + SqlExpression() |
668  Key("REFERENCES") + ObjectName() + columnConstraintRefOpt + fkeyActionList;
669  columnConstraintRefOpt.Rule = Empty | "(" + Identifier + ")";
670  columnDefaultOpt.Rule = Empty | Key("DEFAULT") + SqlExpression();
671  columnIdentityOpt.Rule = Empty | Key("IDENTITY");
672  fkeyActionList.Rule = MakeStarRule(fkeyActionList, fkeyAction);
673  fkeyAction.Rule = ON + DELETE + fkeyActionType | ON + UPDATE + fkeyActionType;
674  fkeyActionType.Rule = Key("CASCADE") |
675  Key("SET") + Key("NULL") |
676  Key("SET") + Key("DEFAULT") |
677  Key("NO") + Key("ACTION");
678 
679  tableConstraint.Rule = tableConstraintNameOpt + defTableConstraint;
680  tableConstraintNameOpt.Rule = Empty | constraintName;
681  constraintName.Rule = Identifier;
682  defTableConstraint.Rule = Key("PRIMARY") + Key("KEY") + "(" + columnList + ")" |
683  Key("UNIQUE") + "(" + columnList + ")" |
684  Key("CHECK") + "(" + SqlExpression() + ")" |
685  FOREIGN + KEY + "(" + columnList + ")" + REFERENCES + ObjectName() + "(" + columnList +
686  ")" +
687  fkeyActionList;
688  columnList.Rule = MakePlusRule(columnList, Comma, Identifier);
689 
690  return alterTable;
691  }
692 
693  private NonTerminal AlterUser() {
694  var alterUser = new NonTerminal("alter_user", typeof(AlterUserStatementNode));
695  var actionList = new NonTerminal("action_list");
696  var action = new NonTerminal("action");
697  var setAccountStatus = new NonTerminal("set_account_status", typeof(SetAccountStatusNode));
698  var setPassword = new NonTerminal("set_password", typeof(SetPasswordNode));
699  var setGroups = new NonTerminal("set_groups", typeof(SetGroupsNode));
700  var accountStatus = new NonTerminal("account_status");
701 
702  alterUser.Rule = Key("ALTER") + Key("USER") + Identifier + actionList;
703  actionList.Rule = MakePlusRule(actionList, action);
704  action.Rule = setAccountStatus | setPassword | setGroups;
705  setAccountStatus.Rule = Key("SET") + Key("ACCOUNT") + accountStatus;
706  accountStatus.Rule = Key("LOCK") | Key("UNLOCK");
707  setPassword.Rule = Key("SET") + Key("PASSWORD") + SqlExpression();
708  setGroups.Rule = Key("SET") + Key("GROUPS") + SqlExpressionList();
709 
710  return alterUser;
711  }
712 
713  #endregion
714 
715  private NonTerminal Drop() {
716  var dropCommand = new NonTerminal("drop_command");
717 
718  dropCommand.Rule = DropSchema() |
719  DropTable() |
720  DropView() |
721  DropIndex() |
722  DropSequence() |
723  DropTrigger() |
724  DropUser() |
725  DropType();
726 
727  return dropCommand;
728  }
729 
730  private NonTerminal DropSchema() {
731  var dropSchema = new NonTerminal("drop_schema", typeof(DropSchemaStatementNode));
732 
733  dropSchema.Rule = Key("DROP") + Key("SCHEMA") + Identifier;
734  return dropSchema;
735  }
736 
737  private NonTerminal DropTable() {
738  var dropTable = new NonTerminal("drop_table", typeof(DropTableStatementNode));
739  var tableNameList = new NonTerminal("table_name_list");
740  var ifExistsOpt = new NonTerminal("if_exists_opt");
741 
742  dropTable.Rule = Key("DROP") + Key("TABLE") + ifExistsOpt + tableNameList;
743  tableNameList.Rule = MakePlusRule(tableNameList, Comma, ObjectName());
744  ifExistsOpt.Rule = Empty | Key("IF") + Key("EXISTS");
745 
746  return dropTable;
747  }
748 
749  private NonTerminal DropView() {
750  var dropView = new NonTerminal("drop_view", typeof(DropViewStatementNode));
751  var viewNameList = new NonTerminal("view_name_list");
752  var ifExistsOpt = new NonTerminal("if_exists_opt");
753 
754  dropView.Rule = Key("DROP") + Key("VIEW") + ifExistsOpt + viewNameList;
755  viewNameList.Rule = MakePlusRule(viewNameList, Comma, ObjectName());
756  ifExistsOpt.Rule = Empty | Key("IF") + Key("EXISTS");
757 
758  return dropView;
759  }
760 
761  private NonTerminal DropIndex() {
762  var dropIndex = new NonTerminal("drop_index");
763  dropIndex.Rule = Key("DROP") + Key("INDEX") + ObjectName();
764  return dropIndex;
765  }
766 
767  private NonTerminal DropSequence() {
768  var dropSequence = new NonTerminal("drop_index");
769  dropSequence.Rule = Key("DROP") + Key("SEQUENCE") + ObjectName();
770  return dropSequence;
771  }
772 
773  private NonTerminal DropTrigger() {
774  var dropTrigger = new NonTerminal("drop_trigger");
775  var dropProcedureTrigger = new NonTerminal("drop_procedure_trigger");
776  var dropCallbackTrigger = new NonTerminal("drop_callback_trigger");
777 
778  dropTrigger.Rule = dropProcedureTrigger | dropCallbackTrigger;
779  dropProcedureTrigger.Rule = Key("DROP") + Key("TRIGGER") + ObjectName();
780  dropCallbackTrigger.Rule = Key("DROP") + Key("CALLBACK") + Key("TRIGGER") + Key("FROM") + ObjectName();
781  return dropTrigger;
782  }
783 
784  private NonTerminal DropUser() {
785  var dropUser = new NonTerminal("drop_user");
786  dropUser.Rule = Key("DROP") + Key("USER") + Identifier;
787  return dropUser;
788  }
789 
790  private NonTerminal DropType() {
791  var dropType = new NonTerminal("drop_type");
792  dropType.Rule = Key("DROP") + Key("TYPE") + ObjectName();
793  return dropType;
794  }
795 
796  private NonTerminal Commit() {
797  var commitCommand = new NonTerminal("commit", typeof(CommitStatementNode));
798  commitCommand.Rule = Key("COMMIT");
799  return commitCommand;
800  }
801 
802  private NonTerminal Rollback() {
803  var command = new NonTerminal("rollback", typeof(RollbackStatementNode));
804  command.Rule = Key("ROLLBACK");
805  return command;
806  }
807 
808  private NonTerminal Select() {
809  var selectCommand = new NonTerminal("select_command", typeof(SelectStatementNode));
810  var orderOpt = new NonTerminal("order_opt");
811  var sortedDef = new NonTerminal("sorted_def", typeof(OrderByNode));
812  var sortedDefList = new NonTerminal("sorted_def_list");
813  var sortOrder = new NonTerminal("sort_order");
814  var limitOpt = new NonTerminal("limit_opt");
815  var limit = new NonTerminal("limit", typeof(LimitNode));
816 
817  selectCommand.Rule = SqlQueryExpression() + orderOpt + limitOpt;
818 
819  orderOpt.Rule = Empty | Key("ORDER") + Key("BY") + sortedDefList;
820  sortedDef.Rule = SqlExpression() + sortOrder;
821  sortOrder.Rule = Key("ASC") | Key("DESC");
822  sortedDefList.Rule = MakePlusRule(sortedDefList, Comma, sortedDef);
823 
824  limitOpt.Rule = Empty | limit;
825  limit.Rule = Key("LIMIT") + PositiveLiteral + "," + PositiveLiteral |
826  Key("LIMIT") + PositiveLiteral;
827 
828  return selectCommand;
829  }
830 
831  private NonTerminal Grant() {
832  var grant = new NonTerminal("grant");
833  var grantObject = new NonTerminal("grant_object", typeof(GrantStatementNode));
834  var grantPriv = new NonTerminal("grant_priv", typeof(GrantRoleStatementNode));
835  var roleList = new NonTerminal("role_list");
836  var priv = new NonTerminal("priv", typeof(PrivilegeNode));
837  var privList = new NonTerminal("priv_list");
838  var objPriv = new NonTerminal("object_priv");
839  var privilegeOpt = new NonTerminal("privilege_opt");
840  var privilegesOpt = new NonTerminal("privileges_opt");
841  var distributionList = new NonTerminal("distribution_list");
842  var withAdminOpt = new NonTerminal("with_admin_opt");
843  var withAdmin = new NonTerminal("with_admin");
844  var withGrantOpt = new NonTerminal("with_grant_opt");
845  var withGrant = new NonTerminal("with_grant");
846  var optionOpt = new NonTerminal("option_opt");
847  var columnList = new NonTerminal("column_list");
848  var columnListOpt = new NonTerminal("column_list_opt");
849  var referencePriv = new NonTerminal("reference_priv");
850  var updatePriv = new NonTerminal("update_priv");
851  var selectPriv = new NonTerminal("select_priv");
852 
853  grant.Rule = grantObject | grantPriv;
854  grantPriv.Rule = Key("GRANT") + roleList + Key("TO") + distributionList + withAdminOpt;
855  roleList.Rule = MakePlusRule(roleList, Comma, Identifier);
856  withAdminOpt.Rule = Empty | withAdmin;
857  withAdmin.Rule = Key("WITH") + Key("ADMIN") + optionOpt;
858  optionOpt.Rule = Empty | Key("OPTION");
859 
860  grantObject.Rule = Key("GRANT") + objPriv + Key("ON") + ObjectName() + Key("TO") + distributionList + withGrantOpt;
861  objPriv.Rule = Key("ALL") + privilegesOpt | privList;
862  privilegesOpt.Rule = Empty | Key("PRIVILEGES");
863  privilegeOpt.Rule = Empty | Key("PRIVILEGE");
864  privList.Rule = MakePlusRule(privList, Comma, priv);
865  priv.Rule = Key("USAGE") + privilegeOpt|
866  Key("INSERT") + privilegeOpt |
867  Key("DELETE") + privilegeOpt |
868  Key("EXECUTE") + privilegeOpt |
869  Key("ALTER") + privilegeOpt |
870  Key("INDEX") + privilegeOpt |
871  updatePriv |
872  referencePriv |
873  selectPriv;
874  updatePriv.Rule = Key("UPDATE") + privilegeOpt + columnListOpt;
875  referencePriv.Rule = Key("REFERENCES") + privilegeOpt + columnListOpt;
876  selectPriv.Rule = Key("SELECT") + columnListOpt;
877  columnListOpt.Rule = Empty | "(" + columnList + ")";
878  columnList.Rule = MakePlusRule(columnList, Comma, Identifier);
879  withGrantOpt.Rule = Empty | withGrant;
880  withGrant.Rule = Key("WITH") + Key("GRANT") + optionOpt;
881  distributionList.Rule = MakePlusRule(distributionList, Comma, Identifier);
882 
883  return grant;
884  }
885 
886  private NonTerminal Revoke() {
887  var revoke = new NonTerminal("revoke");
888  var grantObject = new NonTerminal("grant_object");
889  var grantPriv = new NonTerminal("grant_priv");
890  var roleList = new NonTerminal("role_list");
891  var priv = new NonTerminal("priv");
892  var privList = new NonTerminal("priv_list");
893  var objPriv = new NonTerminal("object_priv");
894  var privilegeOpt = new NonTerminal("privilege_opt");
895  var privilegesOpt = new NonTerminal("privileges_opt");
896  var distributionList = new NonTerminal("distribution_list");
897 
898  revoke.Rule = grantObject | grantPriv;
899  grantPriv.Rule = Key("REVOKE") + roleList + Key("FROM") + distributionList;
900  roleList.Rule = MakePlusRule(roleList, Comma, Identifier);
901 
902  grantObject.Rule = Key("REVOKE") + objPriv + Key("ON") + ObjectName() + Key("TO") + distributionList;
903  objPriv.Rule = Key("ALL") + privilegesOpt | privList;
904  privilegesOpt.Rule = Empty | Key("PRIVILEGES");
905  privilegeOpt.Rule = Empty | Key("PRIVILEGE");
906  privList.Rule = MakePlusRule(privList, Comma, priv);
907  priv.Rule = Key("USAGE") + privilegeOpt |
908  Key("INSERT") + privilegeOpt |
909  Key("DELETE") + privilegeOpt |
910  Key("EXECUTE") + privilegeOpt |
911  Key("ALTER") + privilegeOpt |
912  Key("INDEX") + privilegeOpt |
913  Key("UPDATE") + privilegeOpt |
914  Key("REFERENCES") + privilegeOpt |
915  Key("SELECT") + privilegeOpt;
916  distributionList.Rule = MakePlusRule(distributionList, Comma, Identifier);
917 
918  return revoke;
919  }
920 
921  private NonTerminal Insert() {
922  var insert = new NonTerminal("insert_command", typeof(InsertStatementNode));
923  var insertSource = new NonTerminal("insert_source");
924  var sourceWithColumns = new NonTerminal("source_with_columns");
925  var fromValues = new NonTerminal("from_values", typeof(ValuesInsertNode));
926 
927  var fromQuery = new NonTerminal("from_query", typeof(QueryInsertNode));
928  var fromSet = new NonTerminal("from_set", typeof(SetInsertNode));
929  var columnList = new NonTerminal("column_list");
930  var columnListOpt = new NonTerminal("column_list_opt");
931  var columnSet = new NonTerminal("column_set", typeof(InsertSetNode));
932  var columnSetList = new NonTerminal("column_set_list");
933  var insertTuple = new NonTerminal("insert_tuple");
934  var insertValue = new NonTerminal("insert_value", typeof(InsertValueNode));
935 
936  insert.Rule = Key("INSERT") + Key("INTO") + ObjectName() + insertSource;
937  insertSource.Rule = columnListOpt + sourceWithColumns | fromSet;
938  sourceWithColumns.Rule = fromQuery | fromValues;
939  fromValues.Rule = columnListOpt + Key("VALUES") + insertTuple;
940  fromQuery.Rule = columnListOpt + Key("FROM") + "(" + SqlQueryExpression() + ")";
941  fromSet.Rule = Key("SET") + columnSetList;
942  columnListOpt.Rule = Empty | "(" + columnList + ")";
943  columnList.Rule = MakePlusRule(columnList, Comma, Identifier);
944  fromValues.Rule = Key("VALUES") + insertTuple;
945  insertTuple.Rule = MakePlusRule(insertTuple, Comma, insertValue);
946  insertValue.Rule = "(" + SqlExpressionList() + ")";
947  columnSetList.Rule = MakePlusRule(columnSetList, Comma, columnSet);
948  columnSet.Rule = Identifier + "=" + SqlExpression();
949  return insert;
950  }
951 
952  private NonTerminal Delete() {
953  var deleteCommand = new NonTerminal("delete_command");
954  var whereOpt = new NonTerminal("where_opt");
955 
956  deleteCommand.Rule = Key("DELETE") + Key("FROM") + ObjectName() + whereOpt;
957  whereOpt.Rule = Empty | Key("WHERE") + SqlQueryExpression();
958 
959  return deleteCommand;
960  }
961 
962  private NonTerminal Update() {
963  var update = new NonTerminal("update_command", typeof(UpdateStatementNode));
964  var updateSimple = new NonTerminal("update_simple", typeof(SimpleUpdateNode));
965  var updateQuery = new NonTerminal("update_query");
966  var columnSet = new NonTerminal("column_set", typeof(UpdateColumnNode));
967  var columnSetList = new NonTerminal("column_set_list");
968  var columnList = new NonTerminal("column_list");
969  var updateWhere = new NonTerminal("update_where");
970  var limitOpt = new NonTerminal("limit_opt");
971 
972  update.Rule = updateSimple | updateQuery;
973  updateSimple.Rule = Key("UPDATE") + ObjectName() + Key("SET") + columnSetList + updateWhere + limitOpt;
974  updateQuery.Rule = Key("UPDATE") + ObjectName() + Key("SET") + "(" + columnList + ")" + "=" + SqlQueryExpression() + updateWhere + limitOpt;
975  columnSetList.Rule = MakePlusRule(columnSetList, Comma, columnSet);
976  columnSet.Rule = Identifier + "=" + SqlExpression();
977  columnList.Rule = MakePlusRule(columnList, Comma, Identifier);
978  updateWhere.Rule = Key("WHERE") + SqlExpression();
979  limitOpt.Rule = Empty | Key("LIMIT") + PositiveLiteral;
980 
981  return update;
982  }
983 
984  private NonTerminal Truncate() {
985  var truncate = new NonTerminal("truncate_command");
986  truncate.Rule = Key("TRUNCATE") + ObjectName();
987  return truncate;
988  }
989 
990  private NonTerminal Set() {
991  var set = new NonTerminal("set_command");
992  set.Rule = SetTransaction() | SetVariable();
993  return set;
994  }
995 
996  private NonTerminal SetTransaction() {
997  var set = new NonTerminal("set_transaction");
998  var access = new NonTerminal("access");
999  var accessType = new NonTerminal("access_type");
1000  var isolationLevel = new NonTerminal("isolation_level");
1001  var levelType = new NonTerminal("level_type");
1002  var defaultSchema = new NonTerminal("default_schema");
1003 
1004  set.Rule = access | isolationLevel | defaultSchema;
1005  access.Rule = Key("SET") + Key("TRANSACTION") + accessType;
1006  accessType.Rule = Key("READ") + Key("ONLY") | Key("READ") + Key("WRITE");
1007  isolationLevel.Rule = Key("SET") + Key("TRANSACTION") + Key("ISOLATION") + Key("LEVEL") + levelType;
1008  levelType.Rule = Key("SERIALIZABLE") |
1009  Key("READ") + Key("COMMITTED") |
1010  Key("READ") + Key("UNCOMMITTED") |
1011  Key("SNAPSHOT");
1012  defaultSchema.Rule = Key("SET") + Key("TRANSACTION") + Key("DEFAULT") + Key("SCHEMA") + Identifier;
1013  return set;
1014  }
1015 
1016  private NonTerminal SetVariable() {
1017  var varSet = new NonTerminal("var_set");
1018  varSet.Rule = Identifier + "=" + SqlExpression();
1019  return varSet;
1020  }
1021  }
1022 }
Within an SQL query node, this describes the ordering criteria that will be applied when returning th...
Definition: OrderByNode.cs:25
override NonTerminal MakeRoot()
Definition: SqlGrammar.cs:27
Describes the name of an object within a database.
Definition: ObjectName.cs:44
void Productions(NonTerminal root)
Definition: SqlGrammar.cs:34