/// <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); } }
/// <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); } }
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); }
/// <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; }
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; }
/// <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; }