Package com.sun.msv.grammar.util
Class ExpressionPrinter
java.lang.Object
com.sun.msv.grammar.util.ExpressionPrinter
- All Implemented Interfaces:
ExpressionVisitor
creates a string representation of the expression.
useful for debug and dump.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
in this mode, element declaration is one of the terminal symbol of stringnization.static final ExpressionPrinter
static final int
in this mode, reference to other expression is one of the terminal symbol of stringnization.static final ExpressionPrinter
protected final int
this flag controls how expression will be stringnizedstatic final ExpressionPrinter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static boolean
isComplex
(Expression exp) determines whether brackets should be used to represent the patternonAttribute
(AttributeExp exp) onElement
(ElementExp exp) onOneOrMore
(OneOrMoreExp exp) onRef
(ReferenceExp exp) onSequence
(SequenceExp exp) private Object
optional
(Expression exp) protected String
printBinary
(BinaryExp exp, String op) static String
static String
printFragment
(Expression exp) dumps all the contents of ReferenceContainer.static String
printSmallest
(Expression exp)
-
Field Details
-
FRAGMENT
public static final int FRAGMENTin this mode, reference to other expression is one of the terminal symbol of stringnization. Suitable to dump the entire grammar- See Also:
-
CONTENTMODEL
public static final int CONTENTMODELin this mode, element declaration is one of the terminal symbol of stringnization. Suitable to dump the content model of element declarations.- See Also:
-
fragmentInstance
-
contentModelInstance
-
smallestInstance
-
mode
protected final int modethis flag controls how expression will be stringnized
-
-
Constructor Details
-
ExpressionPrinter
protected ExpressionPrinter(int mode)
-
-
Method Details
-
printFragment
-
printContentModel
-
printSmallest
-
printRefContainer
dumps all the contents of ReferenceContainer. this method is a useful piece to dump the entire grammar. -
isComplex
determines whether brackets should be used to represent the pattern -
printBinary
-
onAttribute
- Specified by:
onAttribute
in interfaceExpressionVisitor
-
optional
-
onChoice
- Specified by:
onChoice
in interfaceExpressionVisitor
-
onConcur
- Specified by:
onConcur
in interfaceExpressionVisitor
-
onInterleave
- Specified by:
onInterleave
in interfaceExpressionVisitor
-
onElement
- Specified by:
onElement
in interfaceExpressionVisitor
-
onOneOrMore
- Specified by:
onOneOrMore
in interfaceExpressionVisitor
-
onMixed
- Specified by:
onMixed
in interfaceExpressionVisitor
-
onList
- Specified by:
onList
in interfaceExpressionVisitor
-
onEpsilon
- Specified by:
onEpsilon
in interfaceExpressionVisitor
-
onNullSet
- Specified by:
onNullSet
in interfaceExpressionVisitor
-
onAnyString
- Specified by:
onAnyString
in interfaceExpressionVisitor
-
onSequence
- Specified by:
onSequence
in interfaceExpressionVisitor
-
onData
- Specified by:
onData
in interfaceExpressionVisitor
-
onValue
- Specified by:
onValue
in interfaceExpressionVisitor
-
onOther
- Specified by:
onOther
in interfaceExpressionVisitor
-
onRef
- Specified by:
onRef
in interfaceExpressionVisitor
-