public abstract class Doc extends Object
JavaInputAstVisitor
outputs a
sequence of Op
s 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 Doc
s, including other Level
s. Leaf Doc
s are Doc.Token
s, representing language-level tokens; Tok
s, which may also
represent non-token Input.Tok
s, including comments and other white-space; Space
s,
representing single spaces; and Doc.Break
s, 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.