public class ProductionFormatter<ELEMENT,TOKEN> extends Object implements com.google.common.base.Function<Production<ELEMENT,TOKEN>,String>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ProductionFormatter.ObjToStrFunction<TOKEN> |
| Modifier and Type | Field and Description |
|---|---|
protected int |
autoWrapChars |
protected int |
autoWrapChildren |
protected String |
indent |
protected com.google.common.base.Function<TOKEN,String> |
tokenToString |
| Constructor and Description |
|---|
ProductionFormatter() |
| Modifier and Type | Method and Description |
|---|---|
String |
apply(Production<ELEMENT,TOKEN> from) |
String |
format(Production<ELEMENT,TOKEN> adapter) |
String |
format(Production<ELEMENT,TOKEN> adapter,
ELEMENT grammarElement) |
String |
format(Production<ELEMENT,TOKEN> adapter,
ELEMENT grammarElement,
boolean needParenthesis) |
protected String |
format(Production<ELEMENT,TOKEN> adapter,
ELEMENT element,
Iterable<ELEMENT> children,
String separator,
boolean needWrap,
boolean needParenthesis) |
protected String |
getCardinality(Production<ELEMENT,TOKEN> adapter,
ELEMENT ele) |
ProductionFormatter<ELEMENT,TOKEN> |
setAutoWrapChars(int autoWrapChars) |
ProductionFormatter<ELEMENT,TOKEN> |
setAutoWrapChildren(int autoWrapChildren) |
ProductionFormatter<ELEMENT,TOKEN> |
setIndent(String indent) |
ProductionFormatter<ELEMENT,TOKEN> |
setTokenToString(com.google.common.base.Function<TOKEN,String> tokenToString) |
protected int autoWrapChars
protected int autoWrapChildren
protected String indent
public String apply(Production<ELEMENT,TOKEN> from)
apply in interface com.google.common.base.Function<Production<ELEMENT,TOKEN>,String>public String format(Production<ELEMENT,TOKEN> adapter)
public String format(Production<ELEMENT,TOKEN> adapter, ELEMENT grammarElement)
public String format(Production<ELEMENT,TOKEN> adapter, ELEMENT grammarElement, boolean needParenthesis)
protected String format(Production<ELEMENT,TOKEN> adapter, ELEMENT element, Iterable<ELEMENT> children, String separator, boolean needWrap, boolean needParenthesis)
protected String getCardinality(Production<ELEMENT,TOKEN> adapter, ELEMENT ele)
public ProductionFormatter<ELEMENT,TOKEN> setAutoWrapChars(int autoWrapChars)
public ProductionFormatter<ELEMENT,TOKEN> setAutoWrapChildren(int autoWrapChildren)
public ProductionFormatter<ELEMENT,TOKEN> setIndent(String indent)
public ProductionFormatter<ELEMENT,TOKEN> setTokenToString(com.google.common.base.Function<TOKEN,String> tokenToString)
Copyright © 2015. All Rights Reserved.