예제 #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);
     }
 }
예제 #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);
     }
 }
예제 #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);
     }
 }
예제 #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);
     }
 }
예제 #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);
        }
예제 #6
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;
 }
예제 #7
0
파일: Parser.cs 프로젝트: gpanayir/sffwk
        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;
        }
예제 #8
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;
 }
예제 #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;
 }
예제 #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;
 }