public abstract class Doc extends Object
JavaInputAstVisitor outputs a
sequence of Ops using OpsBuilder. This linear sequence is then transformed by
DocBuilder into a tree-structured Doc. The top-level Doc is a Level, which contains a sequence of Docs, including other Levels. Leaf Docs are Doc.Tokens, representing language-level tokens; Toks, which may also
represent non-token Input.Toks, including comments and other white-space; Spaces,
representing single spaces; and Doc.Breaks, which represent optional line-breaks.| Modifier and Type | Class and Description |
|---|---|
static class |
Doc.Break
A leaf node in a
Doc for an optional break. |
static class |
Doc.FillMode
|
static class |
Doc.State
State for writing.
|
static class |
Doc.Token
A leaf
Doc for a token. |
| Constructor and Description |
|---|
Doc() |
| Modifier and Type | Method and Description |
|---|---|
abstract Doc.State |
computeBreaks(CommentsHelper commentsHelper,
int maxWidth,
Doc.State state)
Make breaking decisions for a
Doc. |
abstract void |
write(Output output)
Write a
Doc to an Output, after breaking decisions have been made. |
public abstract Doc.State computeBreaks(CommentsHelper commentsHelper, int maxWidth, Doc.State state)
Doc.maxWidth - the maximum line widthstate - the current output stateCopyright © 2015–2017 Google Inc.. All rights reserved.