javaprettyprinter.java

来自「JDK1.4编译器前端」· Java 代码 · 共 44 行

JAVA
44
字号
/* * The JastAdd Extensible Java Compiler (http://jastadd.org) is covered * by the modified BSD License. You should have received a copy of the * modified BSD license with this compiler. *  * Copyright (c) 2005-2008, Torbjorn Ekman * All rights reserved. */import AST.*;import java.util.*;import java.io.*;class JavaPrettyPrinter extends Frontend {  public static void main(String args[]) {    if(!compile(args))      System.exit(1);  }  public static boolean compile(String args[]) {    return new JavaPrettyPrinter().process(        args,        new BytecodeParser(),        new JavaParser() {          public CompilationUnit parse(InputStream is, String fileName) throws IOException, beaver.Parser.Exception {            return new parser.JavaParser().parse(is, fileName);          }        }    );  }  protected void processErrors(Collection errors, CompilationUnit unit) {    super.processErrors(errors, unit);    System.out.println(unit);  }  protected void processNoErrors(CompilationUnit unit) {    System.out.println(unit);  }  protected String name() { return "JavaPrettyPrinter"; }  protected String version() { return "R20071015"; }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?