示例#1
0
        private FunctionNode readFunctionNode(SemanticNode node)
        {
            Function       function       = getFunction(node.left);
            EvaluationNode parameterRoot  = build(node.right);
            EvaluationTree evaluationTree = new EvaluationTree(parameterRoot);

            return(new FunctionNode(function, evaluationTree));
        }
示例#2
0
        public EvaluationTree parse()
        {
            ExpressionLexer lexer       = new ExpressionLexer(expression);
            TokenStream     tokenStream = lexer.lex();

            SyntaxTree syntaxTree = new SyntaxTree(tokenStream);

            syntaxTree.analyze();

            SemanticTree semanticTree = new SemanticTree(syntaxTree);

            semanticTree.analyze(declaration);

            EvaluationTree evaluationTree = new EvaluationTree(semanticTree);

            return(evaluationTree);
        }