|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.brics.xsugar.stylesheet.TraversalVisitor
public class TraversalVisitor
In-order, left-to-right traversal visitor.
Field Summary | |
---|---|
boolean |
in_attribute
True if currently processing an attribute. |
boolean |
in_name
True if currently processing an element/attribute name. |
boolean |
in_toplevel_singleton_content
True if currently processing an item at top-level of element content of size 1. |
boolean |
in_xml
True if currently processing XML side of a production. |
Constructor Summary | |
---|---|
TraversalVisitor()
Constructs a new traversal visitor. |
Method Summary | |
---|---|
void |
mid1Element(Element x)
Invoked after processing the name of an Element . |
void |
mid2Element(Element x)
Invoked after processing the attributes of an Element . |
void |
midAttribute(Attribute x)
Invoked after processing the name of an Attribute . |
boolean |
midUnifyingProduction(UnifyingProduction x)
Invoked between processing of left and right side of a UnifyingProduction . |
void |
postAttribute(Attribute x)
Invoked after processing an Attribute . |
void |
postElement(Element x)
Invoked after processing an Element . |
void |
postStylesheet(Stylesheet x)
Invoked after processing a Stylesheet . |
void |
postUnifyingProduction(UnifyingProduction x)
Invoked after processing a UnifyingProduction . |
void |
preAttribute(Attribute x)
Invoked before processing an Attribute . |
void |
preElement(Element x)
Invoked before processing an Element . |
void |
preStylesheet(Stylesheet x)
Invoked before processing a Stylesheet . |
boolean |
preUnifyingProduction(UnifyingProduction x)
Invoked before processing a UnifyingProduction . |
protected void |
processAttributes(Element x)
Processes the attributes of the given element. |
protected void |
processContents(Element x)
Processes the contents of the given element. |
protected void |
processName(Name n)
Processes the given element/attribute name. |
void |
visitAttribute(Attribute x)
Invokes preAttribute , then processes the attribute name,
invokes midAttribute , then processes the attribute value,
and finally invokes postAttribute . |
void |
visitElement(Element x)
Invokes preElement , then processes the element name,
invokes mid1Element , processes all attributes,
invokes mid2Element , processes the contents,
and finally invokes postElement/code>. |
void |
visitNonterminal(Nonterminal x)
Processes a nonterminal. |
void |
visitQName(QName x)
Processes a QName. |
void |
visitRegexpTerminal(RegexpTerminal x)
Processes a regexp terminal. |
void |
visitStringTerminal(StringTerminal x)
Processes a string terminal. |
void |
visitStylesheet(Stylesheet x)
Invokes preStylesheet , then processes all productions, and finally invokes postStylesheet . |
void |
visitUnifyingProduction(UnifyingProduction x)
Invokes preUnifyingProduction , then processes all left items,
invokes midUnifyingProduction , then processes all right items,
and finally invokes postUnifyingProduction . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean in_attribute
public boolean in_name
public boolean in_toplevel_singleton_content
public boolean in_xml
Constructor Detail |
---|
public TraversalVisitor()
Method Detail |
---|
public void mid1Element(Element x)
Element
.
Does nothing by default.
public void mid2Element(Element x)
Element
.
Does nothing by default.
public void midAttribute(Attribute x)
Attribute
.
Does nothing by default.
public boolean midUnifyingProduction(UnifyingProduction x)
UnifyingProduction
.
Returns true by default.
public void postAttribute(Attribute x)
Attribute
.
Does nothing by default.
public void postElement(Element x)
Element
.
Does nothing by default.
public void postStylesheet(Stylesheet x)
Stylesheet
.
Does nothing by default.
public void postUnifyingProduction(UnifyingProduction x)
UnifyingProduction
.
Does nothing by default.
public void preAttribute(Attribute x)
Attribute
.
Does nothing by default.
public void preElement(Element x)
Element
.
Does nothing by default.
public void preStylesheet(Stylesheet x)
Stylesheet
.
Does nothing by default.
public boolean preUnifyingProduction(UnifyingProduction x)
UnifyingProduction
.
Returns true by default.
protected void processAttributes(Element x)
x
- elementprotected void processContents(Element x)
x
- elementprotected void processName(Name n)
n
- element/attribute namepublic void visitAttribute(Attribute x)
preAttribute
, then processes the attribute name,
invokes midAttribute
, then processes the attribute value,
and finally invokes postAttribute
.
visitAttribute
in interface Visitor
public void visitElement(Element x)
preElement
, then processes the element name,
invokes mid1Element
, processes all attributes,
invokes mid2Element
, processes the contents,
and finally invokes postElement/code>.
- Specified by:
visitElement
in interface Visitor
public void visitNonterminal(Nonterminal x)
visitNonterminal
in interface Visitor
public void visitQName(QName x)
visitQName
in interface Visitor
public void visitRegexpTerminal(RegexpTerminal x)
visitRegexpTerminal
in interface Visitor
public void visitStringTerminal(StringTerminal x)
visitStringTerminal
in interface Visitor
public void visitStylesheet(Stylesheet x)
preStylesheet
, then processes all productions, and finally invokes postStylesheet
.
visitStylesheet
in interface Visitor
public void visitUnifyingProduction(UnifyingProduction x)
preUnifyingProduction
, then processes all left items,
invokes midUnifyingProduction
, then processes all right items,
and finally invokes postUnifyingProduction
.
visitUnifyingProduction
in interface Visitor
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |