Exemple #1
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);
        }
Exemple #2
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);
        }
Exemple #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);
        }
Exemple #4
0
        public Tuple <List <AbstractSyntaxTreeNode>, Dictionary <string, AbstractSyntaxTreeNode> > 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 <AbstractSyntaxTreeNode>, Dictionary <string, AbstractSyntaxTreeNode> >(AbstractSyntaxTreeNodeList, symbolTable));
        }