|
57 | 57 | * This is google-java-format, a new Java formatter that follows the Google Java Style Guide quite |
58 | 58 | * precisely---to the letter and to the spirit. |
59 | 59 | * |
60 | | - * <p>This formatter uses the Eclipse parser to generate an AST. Because the Eclipse AST loses |
61 | | - * information about the non-tokens in the input (including newlines, comments, etc.), and even some |
62 | | - * tokens (e.g., optional commas or semicolons), this formatter lexes the input again and follows |
63 | | - * along in the resulting list of tokens. Its lexer splits all multi-character operators (like ">>") |
64 | | - * into multiple single-character operators. Each non-token is assigned to a token---non-tokens |
65 | | - * following a token on the same line go with that token; those following go with the next token--- |
66 | | - * and there is a final EOF token to hold final comments. |
| 60 | + * <p>This formatter uses the javac parser to generate an AST. Because the AST loses information |
| 61 | + * about the non-tokens in the input (including newlines, comments, etc.), and even some tokens |
| 62 | + * (e.g., optional commas or semicolons), this formatter lexes the input again and follows along in |
| 63 | + * the resulting list of tokens. Its lexer splits all multi-character operators (like ">>") into |
| 64 | + * multiple single-character operators. Each non-token is assigned to a token---non-tokens following |
| 65 | + * a token on the same line go with that token; those following go with the next token--- and there |
| 66 | + * is a final EOF token to hold final comments. |
67 | 67 | * |
68 | 68 | * <p>The formatter walks the AST to generate a Greg Nelson/Derek Oppen-style list of formatting |
69 | 69 | * {@link Op}s [1--2] that then generates a structured {@link Doc}. Each AST node type has a visitor |
|
0 commit comments