public class ExpressionPrinter extends java.lang.Object implements ExpressionVisitor
| Modifier and Type | Field and Description |
|---|---|
static int |
CONTENTMODEL
in this mode, element declaration is
one of the terminal symbol of stringnization.
|
static ExpressionPrinter |
contentModelInstance |
static int |
FRAGMENT
in this mode, reference to other expression is
one of the terminal symbol of stringnization.
|
static ExpressionPrinter |
fragmentInstance |
protected int |
mode
this flag controls how expression will be stringnized
|
static ExpressionPrinter |
smallestInstance |
| Modifier | Constructor and Description |
|---|---|
protected |
ExpressionPrinter(int mode) |
| Modifier and Type | Method and Description |
|---|---|
protected static boolean |
isComplex(Expression exp)
determines whether brackets should be used to represent the pattern
|
java.lang.Object |
onAnyString() |
java.lang.Object |
onAttribute(AttributeExp exp) |
java.lang.Object |
onChoice(ChoiceExp exp) |
java.lang.Object |
onConcur(ConcurExp exp) |
java.lang.Object |
onData(DataExp exp) |
java.lang.Object |
onElement(ElementExp exp) |
java.lang.Object |
onEpsilon() |
java.lang.Object |
onInterleave(InterleaveExp exp) |
java.lang.Object |
onList(ListExp exp) |
java.lang.Object |
onMixed(MixedExp exp) |
java.lang.Object |
onNullSet() |
java.lang.Object |
onOneOrMore(OneOrMoreExp exp) |
java.lang.Object |
onOther(OtherExp exp) |
java.lang.Object |
onRef(ReferenceExp exp) |
java.lang.Object |
onSequence(SequenceExp exp) |
java.lang.Object |
onValue(ValueExp exp) |
private java.lang.Object |
optional(Expression exp) |
protected java.lang.String |
printBinary(BinaryExp exp,
java.lang.String op) |
static java.lang.String |
printContentModel(Expression exp) |
static java.lang.String |
printFragment(Expression exp) |
java.lang.String |
printRefContainer(ReferenceContainer cont)
dumps all the contents of ReferenceContainer.
|
static java.lang.String |
printSmallest(Expression exp) |
public static final int FRAGMENT
public static final int CONTENTMODEL
public static final ExpressionPrinter fragmentInstance
public static final ExpressionPrinter contentModelInstance
public static final ExpressionPrinter smallestInstance
protected final int mode
public static java.lang.String printFragment(Expression exp)
public static java.lang.String printContentModel(Expression exp)
public static java.lang.String printSmallest(Expression exp)
public java.lang.String printRefContainer(ReferenceContainer cont)
protected static boolean isComplex(Expression exp)
protected java.lang.String printBinary(BinaryExp exp, java.lang.String op)
public java.lang.Object onAttribute(AttributeExp exp)
onAttribute in interface ExpressionVisitorprivate java.lang.Object optional(Expression exp)
public java.lang.Object onChoice(ChoiceExp exp)
onChoice in interface ExpressionVisitorpublic java.lang.Object onConcur(ConcurExp exp)
onConcur in interface ExpressionVisitorpublic java.lang.Object onInterleave(InterleaveExp exp)
onInterleave in interface ExpressionVisitorpublic java.lang.Object onElement(ElementExp exp)
onElement in interface ExpressionVisitorpublic java.lang.Object onOneOrMore(OneOrMoreExp exp)
onOneOrMore in interface ExpressionVisitorpublic java.lang.Object onMixed(MixedExp exp)
onMixed in interface ExpressionVisitorpublic java.lang.Object onList(ListExp exp)
onList in interface ExpressionVisitorpublic java.lang.Object onEpsilon()
onEpsilon in interface ExpressionVisitorpublic java.lang.Object onNullSet()
onNullSet in interface ExpressionVisitorpublic java.lang.Object onAnyString()
onAnyString in interface ExpressionVisitorpublic java.lang.Object onSequence(SequenceExp exp)
onSequence in interface ExpressionVisitorpublic java.lang.Object onData(DataExp exp)
onData in interface ExpressionVisitorpublic java.lang.Object onValue(ValueExp exp)
onValue in interface ExpressionVisitorpublic java.lang.Object onOther(OtherExp exp)
onOther in interface ExpressionVisitorpublic java.lang.Object onRef(ReferenceExp exp)
onRef in interface ExpressionVisitor