|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.tools.xjc.reader.gbind.Expression
com.sun.tools.xjc.reader.gbind.Element
public abstract class Element
Expression
that represents an alphabet of a regular language.
Since this package is about a regular expression over element declarations,
this represents an XML element declaration (hence the name.)
Element needs to be interned, meaning one Element
per one tag name.
Implements ElementSet
to represent a self.
Field Summary | |
---|---|
(package private) Set<Element> |
backEdges
|
(package private) Set<Element> |
foreEdges
Once we build a graph from Expression ,
we represent an edge e1 -> e2 by e1.foreEdges.contains(e2)
and e2.backEdges.contains(e1) . |
(package private) Element |
prevPostOrder
Previous element in the DFS post-order traveral of the element graph. |
Fields inherited from class com.sun.tools.xjc.reader.gbind.Expression |
---|
EPSILON |
Fields inherited from interface com.sun.tools.xjc.reader.gbind.ElementSet |
---|
EMPTY_SET |
Constructor Summary | |
---|---|
protected |
Element()
|
Method Summary | |
---|---|
void |
addNext(Element element)
For each element in this set, adds an edge to the given element. |
(package private) Element |
assignDfsPostOrder(Element prev)
Traverses the Element graph with DFS
and set prevPostOrder . |
(package private) void |
buildDAG(ElementSet incoming)
Builds up a DAG among Element s in this expression. |
void |
buildStronglyConnectedComponents(List<ConnectedComponent> ccs)
Builds a set of strongly connected components and puts them all into the given set. |
(package private) boolean |
checkCutSet(ConnectedComponent cc,
Set<Element> visited)
Checks if the given ConnectedComponent forms a cut-set
of a graph. |
boolean |
contains(ElementSet rhs)
Doesn't have to be strict (it's OK for this method to return false when it's actually true) since this is used just for optimization. |
boolean |
hasSelfLoop()
|
(package private) boolean |
isNullable()
True of \epsilon \in L(exp) |
(package private) boolean |
isSink()
True if this Element is SinkNode . |
(package private) boolean |
isSource()
True if this Element is SourceNode . |
Iterator<Element> |
iterator()
Deprecated. if you statically call this method, there's something wrong. |
(package private) ElementSet |
lastSet()
Computes LAST(exp) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
final Set<Element> foreEdges
Expression
,
we represent an edge e1 -> e2 by e1.foreEdges.contains(e2)
and e2.backEdges.contains(e1)
.
final Set<Element> backEdges
Element prevPostOrder
We use prevPostOrder==null
as a check if the element is visted in DFS,
so this chain terminates by a self-reference, not by having null.
Set in assignDfsPostOrder(Element)
Constructor Detail |
---|
protected Element()
Method Detail |
---|
ElementSet lastSet()
Expression
lastSet
in class Expression
boolean isNullable()
Expression
isNullable
in class Expression
boolean isSource()
Element
is SourceNode
.
boolean isSink()
Element
is SinkNode
.
void buildDAG(ElementSet incoming)
Expression
Element
s in this expression.
buildDAG
in class Expression
public void addNext(Element element)
ElementSet
addNext
in interface ElementSet
public boolean contains(ElementSet rhs)
ElementSet
contains
in interface ElementSet
public Iterator<Element> iterator()
ElementSet
contract.
iterator
in interface Iterable<Element>
Element assignDfsPostOrder(Element prev)
Element
graph with DFS
and set prevPostOrder
.
Should be first invoked on the source node of the graph.
public void buildStronglyConnectedComponents(List<ConnectedComponent> ccs)
public boolean hasSelfLoop()
final boolean checkCutSet(ConnectedComponent cc, Set<Element> visited)
ConnectedComponent
forms a cut-set
of a graph.
visited
- Used to keep track of visited nodes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |