private bool buildProgram()
        {
            IParser parser = new MiniPLParser(new TokenReader(ScannerFactory.createMiniPLScanner(this.sampleProgram)), this.io);

            if (parser.processAndBuildAST())
            {
                this.ast = parser.getAST();
                ISemanticAnalyzer analyzer = new MiniPLSemanticAnalyzer();
                if (analyzer.analyze(this.ast, this.symbolTable))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
 public static MiniPLParser getParser(string source)
 {
     return(new MiniPLParser(new TokenReader(ScannerFactory.createMiniPLScanner(source)), new TestIO()));
 }
 public static MiniPLParser getParser(string source, IInputOutput io)
 {
     return(new MiniPLParser(new TokenReader(ScannerFactory.createMiniPLScanner(source)), io));
 }
Esempio n. 4
0
 private MiniPLParser getParser(string source)
 {
     return(new MiniPLParser(new TokenReader(ScannerFactory.createMiniPLScanner(source)), io));
 }