in scala/util/automata
class WordBerrySethi
-
abstract class WordBerrySethi[A <: Alphabet]()
- extends BaseBerrySethi
- with ScalaObject
-
this turns a regexp over A into a NondetWordAutom over A using the
celebrated position automata construction (also called Berry-Sethi or
Glushkov)
Method Summary
|
|
def automatonFrom(pat: lang.RegExp, finalTag: Int): NondetWordAutom[A]
|
protected
|
def collectTransitions(): Unit
|
protected override
|
def compFirst(r: lang.RegExp): Set[Int]
computes first( r ) where the word regexp r
|
protected override
|
def compFollow1(fol1: Set[Int], r: lang.RegExp): Set[Int]
returns the first set of an expression, setting the follow set along
the way
|
protected override
|
def compLast(r: lang.RegExp): Set[Int]
computes last( r ) where the word regexp r
|
protected
|
var defaultq: Array[List[Int]]
|
protected
|
var deltaq: Array[HashMap[A,List[Int]]]
|
protected
|
def initialize(subexpr: Seq[lang.RegExp]): Unit
|
protected
|
def initializeAutom(): Unit
|
protected
|
var initials: Set[Int]
|
protected
|
var labelAt: TreeMap[Int,A]
|
protected
|
var labels: HashSet[A]
|
protected
|
def makeTransition(src: Int, dest: Int, label: A): Unit
|
protected
|
def seenLabel(r: lang.RegExp, i: Int, label: A): Unit
called at the leaves of the regexp
|
protected
|
def seenLabel(r: lang.RegExp, label: A): Unit
|
override
|
def traverse(r: lang.RegExp): Unit
returns "Sethi-length" of a pattern, creating the set of position
along the way
|
Methods inherited from java/lang/Object-class
|
clone, eq, equals, finalize, getClass, hashCode, notify, notifyAll, synchronized, toString, wait, wait, wait |
lang
abstract override val lang: WordExp[A]
labels
protected var labels: HashSet[A]
labelAt
protected var labelAt: TreeMap[Int,A]
deltaq
protected var deltaq: Array[HashMap[A,List[Int]]]
defaultq
protected var defaultq: Array[List[Int]]
initials
protected var initials: Set[Int]
compFirst
protected override def compFirst(r: lang.RegExp): Set[Int]
-
computes first( r ) where the word regexp r
compLast
protected override def compLast(r: lang.RegExp): Set[Int]
-
computes last( r ) where the word regexp r
compFollow1
protected override def compFollow1(fol1: Set[Int], r: lang.RegExp): Set[Int]
-
returns the first set of an expression, setting the follow set along
the way
seenLabel
protected def seenLabel(r: lang.RegExp, i: Int, label: A): Unit
-
called at the leaves of the regexp
seenLabel
protected def seenLabel(r: lang.RegExp, label: A): Unit
traverse
override def traverse(r: lang.RegExp): Unit
-
returns "Sethi-length" of a pattern, creating the set of position
along the way
makeTransition
protected def makeTransition(src: Int, dest: Int, label: A): Unit
initialize
protected def initialize(subexpr: Seq[lang.RegExp]): Unit
initializeAutom
protected def initializeAutom(): Unit
collectTransitions
protected def collectTransitions(): Unit
automatonFrom
def automatonFrom(pat: lang.RegExp, finalTag: Int): NondetWordAutom[A]