Examples of Printer


Examples of org.objectweb.asm.util.Printer

public class Dumper {
    public static void main(final String[] args) throws Exception {
        ClassReader cr;
        cr = new ClassReader("org.fotap.heysync.ABImpl");
        Printer printer = new ASMifier();
//        Printer printer = new Textifier();
        cr.accept(new TraceClassVisitor(null, printer, new PrintWriter(System.out)), ClassReader.SKIP_DEBUG);
    }
View Full Code Here

Examples of soot.Printer

            try {
                streamOut = new FileOutputStream(fileName);
                writerOut = new PrintWriter(new EscapedWriter(
                        new OutputStreamWriter(streamOut)));

                Printer printer = Printer.v();
                printer.setOption(Integer.MAX_VALUE);
                printer.printTo(theClass, new java.io.PrintWriter(writerOut));

                //                theClass.printJimpleStyleTo(writerOut, 0);
            } catch (Exception e) {
                System.out.println("JimpleWriter.internalTransform(): "
                        + "Failed to output jimple for file '" + fileName
View Full Code Here

Examples of steal.examples.expression.visitor.Printer

    Expr expr=new Expr(f);
    Expression e=expr.expression();
   
    Main.get().m();
   
    new Printer().scan(e);

    Main.get().m();

  }
View Full Code Here

Examples of steal.visitor.Printer

import steal.visitor.Printer;

public abstract class ElementImpl implements Element {

  public String toString() {
    Printer p=new Printer();
    this.accept(p);
    return p.toString();
  }
View Full Code Here

Examples of test.Printer

public class Starter
{
 
  public static void main(String[] args)
  {
    Printer printer = new Printer();
    printer.print(new Parent());
    printer.print(new Child());
  }
View Full Code Here

Examples of tree.utils.Printer

        eProvider.visit(currentAST);       
    }
   
    private void printAST()
    {
        Printer printer = new Printer();
        printer.visit(currentAST);
    }
View Full Code Here

Examples of xtc.tree.Printer

     
     
      //write type checker file
      File    dir  = runtime.getFile(Runtime.OUTPUT_DIRECTORY);
      File    file = new File(dir, output + "Analyzer.java" );
      Printer out;
      // Write the xxxAnalyzer.java file
      if (!runtime.test("optionTypesOnly")) {
        try {     
          out = new
            Printer(new PrintWriter(new BufferedWriter(new FileWriter(file))));
        } catch (IOException x) {
          if (null == x.getMessage()) {
            runtime.error(file.toString() + ": I/O error");
          } else {
            runtime.error(file.toString() + ": " + x.getMessage());
          }
          return;
        }     
        printHeader(out);
        new JavaPrinter(out).dispatch(result_ast);
        out.flush();
      }

      // Write the xxxTypes.java
      file = new File(dir, output + "Types.java" );
      try {     
        out = new
          Printer(new PrintWriter(new BufferedWriter(new FileWriter(file))));
      } catch (IOException x) {
        if (null == x.getMessage()) {
          runtime.error(file.toString() + ": I/O error");
        } else {
          runtime.error(file.toString() + ": " + x.getMessage());
        }
        return;
      }     
      printHeader(out);
      new JavaPrinter(out).dispatch(types_ast);
      out.flush();
     
      // Write the xxxSupport.java
      file = new File(dir, output + "Support.java" );
      try {     
        out = new
          Printer(new PrintWriter(new BufferedWriter(new FileWriter(file))));
      } catch (IOException x) {
        if (null == x.getMessage()) {
          runtime.error(file.toString() + ": I/O error");
        } else {
          runtime.error(file.toString() + ": " + x.getMessage());
        }
        return;
      }     
      printHeader(out);
      new JavaPrinter(out).dispatch(support_ast);
      out.flush();
    }

    if (runtime.test("printSource")) {
      new JavaPrinter(runtime.console()).dispatch(result_ast);
      runtime.console().flush();
View Full Code Here

Examples of xtc.tree.Printer

    // Process the productions.
    for (Production p : m.productions) analyzer.process(p);

    // Print the header.
    final Printer printer = runtime.console();

    printer.sep();
    printer.indent().p("// Generated by Rats!, version ").p(Constants.VERSION).
      p(", ").p(Constants.COPY).pln('.');
    printer.sep();
    printer.pln();

    printer.indent().p("/** AST structure for grammar ").p(m.name.name).
      pln(". */");

    // Ensure that all tuples are concrete and then print the result.
    if (! runtime.test("optionVariant")) {
      // Flat AST definition.
      final VariantT node = ast.toVariant("Node", false);

      ast.concretizeTuples(node, UnitT.TYPE);
      printer.indent().p("module ").p(m.name.name).p("Tree").pln(';');
      printer.pln();
      ast.print(node, printer, true, false, null);
      printer.pln();

    } else {
      // Hierarchical AST definition.
      final VariantT     root      =
        analyzer.lookup((NonTerminal)m.getProperty(Properties.ROOT)).
        type.resolve().toVariant();
      final AST.MetaData meta      = ast.getMetaData(root);
      final Set<String>  processed = new HashSet<String>();

      // Concretize variants.
      for (Production p : m.productions) {
        if (AST.isStaticNode(p.type)) {
          final VariantT variant = p.type.resolve().toVariant();
          final String   name    = variant.getName();

          if (meta.reachable.contains(name) && ! processed.contains(name)) {
            processed.add(name);
            ast.concretizeTuples(variant, UnitT.TYPE);
          }
        }
      }
      processed.clear();

      // Print variants...
      if (! meta.modularize) {
        // ... in a single module.
        printer.indent().p("module ").p(m.name.name).p("Tree").pln(';');
        printer.pln();

        for (Production p : m.productions) {
          if (AST.isStaticNode(p.type)) {
            final VariantT variant = p.type.resolve().toVariant();
            final String   name    = variant.getName();
           
            if (meta.reachable.contains(name) && ! processed.contains(name)) {
              processed.add(name);
              ast.print(variant, printer, true, false, null);
              printer.pln();
            }
          }
        }

      } else {
        // ... across several modules.
        boolean first = true;
        String  module;

        do {
          module = null;

          for (Production p : m.productions) {
            if (AST.isStaticNode(p.type)) {
              final VariantT variant = p.type.resolve().toVariant();
              final String   name    = variant.getName();

              if (meta.reachable.contains(name) && ! processed.contains(name)) {
                final String qualifier = variant.getQualifier();
               
                if (null == module) {
                  module = qualifier;
                 
                  if (first) {
                    first = false;
                  } else {
                    printer.sep().pln();
                  }
                  printer.indent().p("module ").p(module).pln(';');
                  printer.pln();
                 
                } else if (! module.equals(qualifier)) {
                  continue;
                }
               
                processed.add(name);
                ast.print(variant, printer, true, true, module);
                printer.pln();
              }
            }
          }
        } while (null != module);
      }
    }

    printer.sep().flush();
  }
View Full Code Here

Examples of xtc.tree.Printer

   *
   * @param name The file name.
   */
  protected void open(String name) throws IOException {
    File file = new File(runtime.getOutputDirectory(), name);
    printer   = new Printer(new PrintWriter(runtime.getWriter(file)));
  }
View Full Code Here

Examples of xtc.tree.Printer

   * Create a new runtime.  Note that the list of input directories is
   * empty, while the output directory is initialized to the current
   * directory.
   */
  public Runtime() {
    console     = new
      Printer(new BufferedWriter(new OutputStreamWriter(System.out)));
    errConsole  = new
      Printer(new BufferedWriter(new OutputStreamWriter(System.err)));
    optionList  = new ArrayList<Option>();
    externalMap = new HashMap<String, Option>();
    internalMap = new HashMap<String, Option>();
    options     = new HashMap<String, Object>();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.