net.sf.xmlmatcher.rex
Class PositionsGraph

java.lang.Object
  extended by net.sf.xmlmatcher.rex.PositionsGraph

public final class PositionsGraph
extends java.lang.Object

Represent graph of Positions in parsed regular expression.

This object is separated from Position because when we build Glushkov automata this graph may be in intermediate state that does not belong to any particular position. For example as we in the middle of processing children of some elements, or when we process 'choice' or 'group' macros there is no Position that may hold these intermediate results.

Glushkov algorithm variables: 'nullable', 'first' sets, 'last' sets. Set 'follow' is represented using Position.next().


Constructor Summary
PositionsGraph()
           
PositionsGraph(Position symb)
           
 
Method Summary
 java.util.List<Position> first()
           
 java.util.List<Position> last()
           
 void markLastAsFinal()
           
 boolean nullable()
           
 void plus()
          Plus mark (one or more repetitions)
 void star()
          Kleene star (zero or more repetitions)
 java.lang.String toString()
           
 void toStringBuffer(java.lang.StringBuffer sbuf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PositionsGraph

public PositionsGraph()

PositionsGraph

public PositionsGraph(Position symb)
Method Detail

nullable

public boolean nullable()

first

public java.util.List<Position> first()

last

public java.util.List<Position> last()

star

public void star()
Kleene star (zero or more repetitions)
     nullable(F*) = true
     first(F*) = first(F)
     last(F*) = last(F)
     follow(F*) += last(F)*first(F)
 


plus

public void plus()
Plus mark (one or more repetitions)
     nullable(F+) = nullable(F)
     first(F+) = first(F)
     last(F+) = last(F)
     follow(F+) += last(F)*first(F)
 


markLastAsFinal

public void markLastAsFinal()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toStringBuffer

public void toStringBuffer(java.lang.StringBuffer sbuf)


Copyright © 2007. All Rights Reserved.