dk.brics.xact.analysis.xmlgraph
Class Emptiness

java.lang.Object
  extended by dk.brics.xact.analysis.xmlgraph.BackwardsXGAnalyzer<EPresence>
      extended by dk.brics.xact.analysis.xmlgraph.Emptiness

public class Emptiness
extends BackwardsXGAnalyzer<EPresence>

May/must backwards analysis that determines which nodes in an XML graph have empty sequence unfoldings.

It can be configured to treat attributes, elements, and/or text nodes as "bottom" or "empty" elements to take advantage of additional information available outside the XML graph.

Note: The emptiness analysis is forced to treat comments and processing instructions as empty sequences because they are invisible in the XML graph. Make sure that you consider the possibility of their presence.


Field Summary
(package private)  dk.brics.xact.analysis.xmlgraph.Emptiness.Processor processor
           
 
Constructor Summary
Emptiness(XMLGraph xg, EPresence attributes, EPresence elements, EPresence texts, EPresence gaps)
          Performs emptiness analysis on the specified XML graph.
 
Method Summary
protected  EPresence bottom()
          Returns BOTTOM element.
protected  EPresence initial(Node node)
          Returns initial value for the specified node.
protected  EPresence transfer(Node node, EPresence currentValue)
          Transfer function for the specified node.
 
Methods inherited from class dk.brics.xact.analysis.xmlgraph.BackwardsXGAnalyzer
doAnalysis, get, get
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

processor

dk.brics.xact.analysis.xmlgraph.Emptiness.Processor processor
Constructor Detail

Emptiness

public Emptiness(XMLGraph xg,
                 EPresence attributes,
                 EPresence elements,
                 EPresence texts,
                 EPresence gaps)
Performs emptiness analysis on the specified XML graph.

Each of the EPresence arguments may be set to null to let Emptiness choose a sound value by itself.

Parameters:
xg - XML graph to analyze
attributes - lattice point to assign an AttributeNode; or null
elements - lattice point to assign an ElementNode; or null
texts - lattice point to assign a TextNode; or null
gaps - lattice point to assign to a ChoiceNode that is a gap; or null
Method Detail

bottom

protected EPresence bottom()
Description copied from class: BackwardsXGAnalyzer
Returns BOTTOM element.

Specified by:
bottom in class BackwardsXGAnalyzer<EPresence>

initial

protected EPresence initial(Node node)
Description copied from class: BackwardsXGAnalyzer
Returns initial value for the specified node. If node has BOTTOM as initial value, return null instead.

Specified by:
initial in class BackwardsXGAnalyzer<EPresence>

transfer

protected EPresence transfer(Node node,
                             EPresence currentValue)
Description copied from class: BackwardsXGAnalyzer
Transfer function for the specified node. The node should only read lattice data from its children and itself.

Specified by:
transfer in class BackwardsXGAnalyzer<EPresence>
Parameters:
node - in the XML graph to analyze
currentValue - current lattice point for the node. Should not be modified.
Returns:
a new instance of a lattice element


Copyright © 2005-2011 Aarhus University.