示例#1
0
        private OperatorExpressionToken ParseOperator(PermissionExpressionToken lhs)
        {
            Lexeme l = lexer.ReadNext();
            var opLex = l as OperatorLexeme;
            if (!(l is OperatorLexeme))
            {
                throw new SyntaxErrorException("Expecting an Operator (& or |), not '" + l.Value + "'");
            }

            OperatorExpressionToken opToken;
            if (opLex == OperatorLexeme.And)
            {
                opToken = new AndExpressionToken();
            }
            else
            {
                opToken = new OrExpressionToken();
            }
            opToken.Left = lhs;
            opToken.Right = Parse();
            return opToken;
        }
 private Expression<Func<bool>> BuildPermissionExpression(PermissionExpressionToken token)
 {
     return () => verifyFunction(token.PermissionName);
 }