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.
- Author:
- Kohsuke KAWAGUCHI
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intin this mode, element declaration is one of the terminal symbol of stringnization.static final ExpressionPrinterstatic final intin this mode, reference to other expression is one of the terminal symbol of stringnization.static final ExpressionPrinterprotected final intthis flag controls how expression will be stringnizedstatic final ExpressionPrinter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleanisComplex(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) protected StringprintBinary(BinaryExp exp, String op) static Stringstatic StringprintFragment(Expression exp) dumps all the contents of ReferenceContainer.static StringprintSmallest(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:
onAttributein interfaceExpressionVisitor
-
onChoice
- Specified by:
onChoicein interfaceExpressionVisitor
-
onConcur
- Specified by:
onConcurin interfaceExpressionVisitor
-
onInterleave
- Specified by:
onInterleavein interfaceExpressionVisitor
-
onElement
- Specified by:
onElementin interfaceExpressionVisitor
-
onOneOrMore
- Specified by:
onOneOrMorein interfaceExpressionVisitor
-
onMixed
- Specified by:
onMixedin interfaceExpressionVisitor
-
onList
- Specified by:
onListin interfaceExpressionVisitor
-
onEpsilon
- Specified by:
onEpsilonin interfaceExpressionVisitor
-
onNullSet
- Specified by:
onNullSetin interfaceExpressionVisitor
-
onAnyString
- Specified by:
onAnyStringin interfaceExpressionVisitor
-
onSequence
- Specified by:
onSequencein interfaceExpressionVisitor
-
onData
- Specified by:
onDatain interfaceExpressionVisitor
-
onValue
- Specified by:
onValuein interfaceExpressionVisitor
-
onOther
- Specified by:
onOtherin interfaceExpressionVisitor
-
onRef
- Specified by:
onRefin interfaceExpressionVisitor
-