Beispiel #1
0
        public ISyntaxTree GetSyntaxTree()
        {
            WriteTree        tree             = new WriteTree();
            ExpressionParser expressionParser = new ExpressionParser(Line[0].Element);
            SyntaxError      syntaxError      = expressionParser.Check();

            if (syntaxError == SyntaxError.NoError)
            {
                expressionParser.Normalize();
                tree.Childs.Add(expressionParser.GetSyntaxTree());
            }
            else
            {
                Console.WriteLine(syntaxError);
                return(null);
            }
            return(tree);
        }
Beispiel #2
0
        public SyntaxError Check()
        {
            ExpressionParser expressionParser = new ExpressionParser(Line[1].Element);

            return(expressionParser.Check());
        }