Пример #1
0
        public void TestCodeGenerated()
        {
            const string expression       = "1+2+3";
            var          lexicalAnalyser  = new LexicalAnalyzer(expression, 0);
            var          syntaxAnalyzer   = new SyntaxAnalyzer(lexicalAnalyser);
            var          node             = syntaxAnalyzer.Expression(0);
            var          fileWriter       = new FileWriter("");
            var          semanticAnalyzer = new SemanticAnalyzer(syntaxAnalyzer);
            var          codeGenerator    = new CodeGenerator(semanticAnalyzer, fileWriter);

            codeGenerator.GenerateCode(node);
            Assert.True(File.Exists(path) && new FileInfo(path).Length != 0);
        }