Notes about the original source code of the OpenJDK compiler


javac -printsource uses the pretty-printer to output a source file from a compilation

DIRECTORY STRUCTURE (that we care about): all in langtools/src/share/classes
- in com/sun/tools/javac/
  + in parser/
    - Token.java: defines the tokens
    - Lexer.java: the interface for lexers
    - Scanner.java: the lexer itself
    - Parser.java: the interface for parsers
    - JavacParser.java: the parser itself
  + in tree/
    - JCTree.java: the definition of the AST nodes, as inner classes of JCTree
    - TreeMaker.java: factory class for building JCTrees
  + in comp/
    - Attr.java: attribution phase
    - Flow.java: dataflow
    - Lower.java: lowering
    - Env.java: the "environment" during comp phases
    - AttrContext.java: the "info" used with Envs
  + in util/
    - Context.java: a mechanism for extending/overriding compiler-related classes
  + in main/
    - Main.java: option handling, etc. for javac
    - JavaCompiler.java: sequence and run the parser and four steps
- in com/sun/source/
  + in tree/
    - Tree.java: the interface for AST nodes
    - *.java: an interface for each kind of AST node
