public void TestForm(string input, int exprectedErrorCount, string failureMessage)
        {
            var result           = new Result();
            var SemanticAnalyzer = new SemanticAnalyzer(result);
            var node             = ASTFactory.BuildForm(input);

            SemanticAnalyzer.AnalyzeForm(node);

            Assert.AreEqual(exprectedErrorCount, result.Events.Count, failureMessage);
        }
Example #2
0
        private void AnalyzeFormAST(Result result, Form formAST)
        {
            if (result.ContainsErrors())
            {
                return;
            }

            var semanticAnalyzer = new SemanticAnalyzer(result);

            semanticAnalyzer.AnalyzeForm(formAST);

            if (result.ContainsErrors())
            {
                throw new ParseException();
            }
        }