コード例 #1
0
        public bool ExecuteEvaluateDynamic <T>(Tuple <List <AbstractSyntaxTree.AbstractSyntaxTreeNode>,
                                                      Dictionary <string, AbstractSyntaxTree.AbstractSyntaxTreeNode> > values, dynamic objectValue)
        {
            ExpressionEvaluatorExecutor expressionEvaluator = new ExpressionEvaluatorExecutor();
            var result = expressionEvaluator.EvaluateDynamic(values.Item1, values.Item2, objectValue);

            return(result);
        }
コード例 #2
0
        public R EvaluateNonBooleanDynamic <R>(string evaluationText, dynamic[] collection)
        {
            ExpressionEvaluatorLexer  expressionEvaluatorLexer  = new ExpressionEvaluatorLexer(evaluationText, 1);
            ExpressionEvaluatorParser expressionEvaluatorParser = new ExpressionEvaluatorParser(expressionEvaluatorLexer);
            var AbstractSyntaxTreeNodeList = expressionEvaluatorParser.BuildParseTree();
            ExpressionEvaluatorExecutor expressionEvaluator = new ExpressionEvaluatorExecutor();
            var result = expressionEvaluator.EvaluateNonBooleanDynamic <R>(AbstractSyntaxTreeNodeList, expressionEvaluatorParser.SymbolTable, collection);

            return(result);
        }
コード例 #3
0
        public R EvaluateNonBoolean <T, R>(string evaluationText, T objectValue)
        {
            ExpressionEvaluatorLexer  expressionEvaluatorLexer  = new ExpressionEvaluatorLexer(evaluationText, 1);
            ExpressionEvaluatorParser expressionEvaluatorParser = new ExpressionEvaluatorParser(expressionEvaluatorLexer);
            var AbstractSyntaxTreeNodeList = expressionEvaluatorParser.BuildParseTree();
            ExpressionEvaluatorExecutor expressionEvaluator = new ExpressionEvaluatorExecutor();
            var result = expressionEvaluator.EvaluateNonBoolean <T, R>(AbstractSyntaxTreeNodeList, expressionEvaluatorParser.SymbolTable, objectValue);

            return(result);
        }
コード例 #4
0
        public bool EvaluateDynamic(string evaluationText, DynamicBaseClass[] objectValues)
        {
            ExpressionEvaluatorLexer  expressionEvaluatorLexer  = new ExpressionEvaluatorLexer(evaluationText, 1);
            ExpressionEvaluatorParser expressionEvaluatorParser = new ExpressionEvaluatorParser(expressionEvaluatorLexer);
            var AbstractSyntaxTreeNodeList = expressionEvaluatorParser.BuildParseTree(objectValues);
            ExpressionEvaluatorExecutor expressionEvaluator = new ExpressionEvaluatorExecutor();
            var result = expressionEvaluator.EvaluateDynamicBaseClass(AbstractSyntaxTreeNodeList, expressionEvaluatorParser.SymbolTable, objectValues);

            return(result);
        }
コード例 #5
0
        PreEvaluateDynamic(string evaluationText)
        {
            ExpressionEvaluatorLexer  expressionEvaluatorLexer  = new ExpressionEvaluatorLexer(evaluationText, 1);
            ExpressionEvaluatorParser expressionEvaluatorParser = new ExpressionEvaluatorParser(expressionEvaluatorLexer);
            var AbstractSyntaxTreeNodeList = expressionEvaluatorParser.BuildParseTree();
            ExpressionEvaluatorExecutor expressionEvaluator = new ExpressionEvaluatorExecutor();
            var symbolTable = expressionEvaluatorParser.SymbolTable;

            return(new Tuple <List <AbstractSyntaxTree.AbstractSyntaxTreeNode>, Dictionary <string, AbstractSyntaxTree.AbstractSyntaxTreeNode> >(
                       AbstractSyntaxTreeNodeList, symbolTable
                       ));
        }