com.sun.msv.grammar.util

Class ExpressionPrinter

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 int
FRAGMENT
in this mode, reference to other expression is one of the terminal symbol of stringnization.
static ExpressionPrinter
contentModelInstance
static ExpressionPrinter
fragmentInstance
static ExpressionPrinter
smallestInstance

Method Summary

Object
onAnyString()
Object
onAttribute(AttributeExp exp)
Object
onChoice(ChoiceExp exp)
Object
onConcur(ConcurExp exp)
Object
onData(DataExp exp)
Object
onElement(ElementExp exp)
Object
onEpsilon()
Object
onInterleave(InterleaveExp 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
onValue(ValueExp 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)

Field Details

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.
Field Value:
2

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
Field Value:
1

contentModelInstance

public static ExpressionPrinter contentModelInstance

fragmentInstance

public static ExpressionPrinter fragmentInstance

smallestInstance

public static ExpressionPrinter smallestInstance

Method Details

onAnyString

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

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

onData

public Object onData(DataExp exp)
Specified by:
onData in interface ExpressionVisitor

onElement

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

onEpsilon

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

onInterleave

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

onList

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

onMixed

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

onNullSet

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

onOneOrMore

public Object onOneOrMore(OneOrMoreExp exp)
Specified by:
onOneOrMore 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

onSequence

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

onValue

public Object onValue(ValueExp exp)
Specified by:
onValue in interface ExpressionVisitor

printContentModel

public static String printContentModel(Expression exp)

printFragment

public static String printFragment(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.

printSmallest

public static String printSmallest(Expression exp)