18 using System.Collections.Generic;
24 namespace Deveel.Data.Sql.Parser {
28 public IEnumerable<PrivilegeNode>
Privileges {
get;
private set; }
30 public IEnumerable<string> Grantees {
get;
private set; }
32 public bool WithGrant {
get;
private set; }
37 }
else if (node.
NodeName.Equals(
"object_priv")) {
39 }
else if (node.
NodeName.Equals(
"distribution_list")) {
41 }
else if (node.
NodeName.Equals(
"with_grant_opt")) {
45 return base.OnChildNode(node);
60 foreach (var childNode
in node.ChildNodes) {
62 if (((SqlKeyNode) childNode).Text.Equals(
"ALL", StringComparison.OrdinalIgnoreCase)) {
64 }
else if (!((SqlKeyNode) childNode).Text.Equals(
"PRIVILEGES", StringComparison.OrdinalIgnoreCase)) {
65 throw new InvalidOperationException();
67 }
else if (childNode.NodeName.Equals(
"priv_list")) {
77 var objName = Sql.ObjectName.Parse(
ObjectName);
78 foreach (var grantee
in Grantees) {
80 var privilege = ParsePrivilege(privilegeNode.Privilege);
90 throw new InvalidOperationException(String.Format(
"Invalid privilege name '{0}' specified.", privName));
override void BuildStatement(StatementBuilder builder)
This is a simple identifier within a SQL grammar.
Defines the contract for nodes in an AST model for a SQL grammar analysis and parsing.
Represents a keyword found during the compilation of a source text.
void GetWithGrant(ISqlNode node)
Represents a composed name for an object within the system.
string NodeName
Gets the name of the node analyzed from the parser.
static Privileges ParsePrivilege(string privName)
void GetGrantees(ISqlNode node)
Describes the name of an object within a database.
void GetPrivileges(ISqlNode node)
IEnumerable< ISqlNode > ChildNodes
Gets a read-only enumeration of the children nodes, if any.
override ISqlNode OnChildNode(ISqlNode node)
During the initialization of the node from the parser, this method is called for every child node add...
string Name
Gets the name of the object being referenced.