Package ast

Examples of ast.Program


    Parser parser = new Parser();
    try {
      List<Module> modules = new List<Module>();
      for(String src : srcs)
        modules.add((Module)parser.parse(new Lexer(new StringReader(src))));
      Program prog = new Program(modules);
      prog.namecheck();
      if(!prog.hasErrors()) prog.typecheck();
      if(succeed) {
        if(prog.hasErrors()) {
          StringBuffer errors = new StringBuffer();
          for(CompilerError err : prog.getErrors())
            errors.append("\n" + err);
          fail("Program was expected to pass semantic checks, but the following " +
             "errors were reported:" + errors);
        }
      } else if(!prog.hasErrors()) {
        fail("Program was expected to fail semantic checks, but passed.");
      }
    } catch (Throwable e) {
      if(e instanceof AssertionError) {
        throw (AssertionError)e;
View Full Code Here


      for(String module_src : modules_src) {
        Parser parser = new Parser();
        Module module = (Module)parser.parse(new Lexer(new StringReader(module_src)));
        modules.add(module);
      }
      Program prog = new Program(modules);
     
      prog.namecheck();
      prog.typecheck();
      prog.flowcheck();
      if(prog.hasErrors()) {
        Assert.fail(prog.getErrors().iterator().next().toString());
      }
     
      CompiledClassLoader loader = new CompiledClassLoader();
      try {
        for(SootClass klass : new ProgramCodeGenerator().generate(prog)) {
View Full Code Here

TOP

Related Classes of ast.Program

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.