Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the 
 /// <see cref="RoleExpression"/> class.
 /// </summary>
 /// <param name="roleName">The name of the role
 /// to include in the expression.</param>
 public RoleExpression(string roleName)
 {
     if (roleName == "*")
     {
         this.wordExpression = new AnyExpression();
     }
     else
     {
         this.wordExpression = new WordExpression(roleName);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="RoleExpression"/> class.
 /// </summary>
 /// <param name="roleName">The name of the role
 /// to include in the expression.</param>
 public RoleExpression(string roleName)
 {
     if (roleName == "*")
     {
         this.wordExpression = new AnyExpression();
     }
     else
     {
         this.wordExpression = new WordExpression(roleName);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="IdentityExpression"/> class with
 /// the specified identity name.
 /// </summary>
 /// <param name="identityName">The identity
 /// name that will be used to match the
 /// specified identity during evaluation.</param>
 public IdentityExpression(string identityName)
 {
     if (identityName == "?")
     {
         this.wordExpression = new AnonymousExpression();
     }
     else if (identityName == "*")
     {
         this.wordExpression = new AnyExpression();
     }
     else
     {
         this.wordExpression = new WordExpression(identityName);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the 
 /// <see cref="IdentityExpression"/> class with
 /// the specified identity name.
 /// </summary>
 /// <param name="identityName">The identity
 /// name that will be used to match the 
 /// specified identity during evaluation.</param>
 public IdentityExpression(string identityName)
 {
     if (identityName == "?")
     {
         this.wordExpression = new AnonymousExpression();
     }
     else if (identityName == "*")
     {
         this.wordExpression = new AnyExpression();
     }
     else
     {
         this.wordExpression = new WordExpression(identityName);
     }
 }
Ejemplo n.º 5
0
        private WordExpression ParseWordExpression()
        {
            if (this.token != TokenType.Word &&
                this.token != TokenType.QuotedString &&
                this.token != TokenType.Anonymous &&
                this.token != TokenType.Any)
            {
                this.AssertTokenType(TokenType.Word);
            }

            string word = this.lexer.Current;

            WordExpression wordExpression = null;

            switch (this.token)
            {
            case TokenType.Word:
                wordExpression = new WordExpression(word);
                break;

            case TokenType.QuotedString:
                string wordWithoutQuotes = word.Substring(1, word.Length - 2);
                wordExpression = new WordExpression(wordWithoutQuotes);
                break;

            case TokenType.Any:
                wordExpression = new AnyExpression();
                break;

            case TokenType.Anonymous:
                wordExpression = new AnonymousExpression();
                break;
            }

            this.MoveNext();
            return(wordExpression);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RoleExpression"/>
 /// class with the specified role name.
 /// </summary>
 /// <param name="wordExpression">The name of a role.</param>
 public RoleExpression(WordExpression wordExpression)
 {
     this.wordExpression = wordExpression;
 }
Ejemplo n.º 7
0
        private WordExpression ParseWordExpression()
        {
            if (this.token != TokenType.Word
                && this.token != TokenType.QuotedString
                && this.token != TokenType.Anonymous
                && this.token != TokenType.Any)
            {
                this.AssertTokenType(TokenType.Word);
            }

            string word = this.lexer.Current;

            WordExpression wordExpression = null;

            switch (this.token)
            {
                case TokenType.Word:
                    wordExpression = new WordExpression(word);
                    break;
                case TokenType.QuotedString:
                    string wordWithoutQuotes = word.Substring(1, word.Length - 2);
                    wordExpression = new WordExpression(wordWithoutQuotes);
                    break;
                case TokenType.Any:
                    wordExpression = new AnyExpression();
                    break;
                case TokenType.Anonymous:
                    wordExpression = new AnonymousExpression();
                    break;
            }

            this.MoveNext();
            return wordExpression;
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="IdentityExpression"/> class with
 /// the specified name.
 /// </summary>
 /// <param name="wordExpression">The name of an identity.</param>
 public IdentityExpression(WordExpression wordExpression)
 {
     this.wordExpression = wordExpression;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the 
 /// <see cref="IdentityExpression"/> class with
 /// the specified name.
 /// </summary>
 /// <param name="wordExpression">The name of an identity.</param>
 public IdentityExpression(WordExpression wordExpression)
 {
     this.wordExpression = wordExpression;
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RoleExpression"/>
 /// class with the specified role name.
 /// </summary>
 /// <param name="wordExpression">The name of a role.</param>
 public RoleExpression(WordExpression wordExpression)
 {
     this.wordExpression = wordExpression;
 }