com.sun.msv.grammar.util
Class ExpressionPrinter

java.lang.Object
  |
  +--com.sun.msv.grammar.util.ExpressionPrinter
All Implemented Interfaces:
ExpressionVisitor

public class ExpressionPrinter
extends Object
implements ExpressionVisitor

creates a string representation of the expression. useful for debug and dump.

Author:
Kohsuke KAWAGUCHI

Field Summary
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
           
static ExpressionPrinter smallestInstance
           
 
Method Summary
 Object onAnyString()
           
 Object onAttribute(AttributeExp exp)
           
 Object onChoice(ChoiceExp exp)
           
 Object onConcur(ConcurExp exp)
           
 Object onElement(ElementExp exp)
           
 Object onEpsilon()
           
 Object onInterleave(InterleaveExp exp)
           
 Object onKey(KeyExp exp)
           
 Object onList(ListExp exp)
           
 Object onMixed(MixedExp exp)
           
 Object onNullSet()
           
 Object onOneOrMore(OneOrMoreExp exp)
           
 Object onOther(OtherExp exp)
           
 Object onRef(ReferenceExp exp)
           
 Object onSequence(SequenceExp exp)
           
 Object onTypedString(TypedStringExp exp)
           
static String printContentModel(Expression exp)
           
static String printFragment(Expression exp)
           
 String printRefContainer(ReferenceContainer cont)
          dumps all the contents of ReferenceContainer.
static String printSmallest(Expression exp)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FRAGMENT

public static final int FRAGMENT
in this mode, reference to other expression is one of the terminal symbol of stringnization. Suitable to dump the entire grammar

CONTENTMODEL

public static final int CONTENTMODEL
in this mode, element declaration is one of the terminal symbol of stringnization. Suitable to dump the content model of element declarations.

fragmentInstance

public static ExpressionPrinter fragmentInstance

contentModelInstance

public static ExpressionPrinter contentModelInstance

smallestInstance

public static ExpressionPrinter smallestInstance
Method Detail

printFragment

public static String printFragment(Expression exp)

printContentModel

public static String printContentModel(Expression exp)

printSmallest

public static String printSmallest(Expression exp)

printRefContainer

public String printRefContainer(ReferenceContainer cont)
dumps all the contents of ReferenceContainer. this method is a useful piece to dump the entire grammar.

onAttribute

public Object onAttribute(AttributeExp exp)
Specified by:
onAttribute in interface ExpressionVisitor

onChoice

public Object onChoice(ChoiceExp exp)
Specified by:
onChoice in interface ExpressionVisitor

onConcur

public Object onConcur(ConcurExp exp)
Specified by:
onConcur in interface ExpressionVisitor

onInterleave

public Object onInterleave(InterleaveExp exp)
Specified by:
onInterleave in interface ExpressionVisitor

onElement

public Object onElement(ElementExp exp)
Specified by:
onElement in interface ExpressionVisitor

onOneOrMore

public Object onOneOrMore(OneOrMoreExp exp)
Specified by:
onOneOrMore in interface ExpressionVisitor

onMixed

public Object onMixed(MixedExp exp)
Specified by:
onMixed in interface ExpressionVisitor

onList

public Object onList(ListExp exp)
Specified by:
onList in interface ExpressionVisitor

onKey

public Object onKey(KeyExp exp)
Specified by:
onKey in interface ExpressionVisitor

onEpsilon

public Object onEpsilon()
Specified by:
onEpsilon in interface ExpressionVisitor

onNullSet

public Object onNullSet()
Specified by:
onNullSet in interface ExpressionVisitor

onAnyString

public Object onAnyString()
Specified by:
onAnyString in interface ExpressionVisitor

onSequence

public Object onSequence(SequenceExp exp)
Specified by:
onSequence in interface ExpressionVisitor

onTypedString

public Object onTypedString(TypedStringExp exp)
Specified by:
onTypedString in interface ExpressionVisitor

onOther

public Object onOther(OtherExp exp)
Specified by:
onOther in interface ExpressionVisitor

onRef

public Object onRef(ReferenceExp exp)
Specified by:
onRef in interface ExpressionVisitor