in scala/runtime/matching
class Matcher

class Matcher(pgram: PatternGrammar)
extends Object
with ScalaObject

this class matches input against a grammar. A call to matchesT (matchesH) returns the list of initial tree (hedge) nonterminals that generate the input.
Author:
Burak Emir

Field Summary
  val hedgeTransitions: Array[Set[HedgeRHS]]
  val treeTransitions: Array[Set[TreeRHS]]

Method Summary
  def getChildren(t: Any): Iterator[Any]
  def isApplicableHedge(initialNTs: Set[Int], it: Iterator[Any]): Set[Int]
     given set of hedge nonterms initialNTs and input hedge h, returns { H | H in initialNTs, T -> a<H> in rules, isApplicable( H, t.children )
  def isApplicableHedge1(H: Int, h: Iterator[Any]): Boolean
     top-level call
protected def isApplicableTree(initialNTs: Set[Int], t: Any): Set[Int]
     given set of tree nonterms initialNTs and input tree t, returns { T | T in initialNTs, T -> a<H> in rules, isApplicable( H, t.children ) }
  def isApplicableTree1(T: Int, t: Any): Boolean
     top-level call
  def matchesH(h: Seq[Any]): Iterator[Int]
     top-level call
  def matchesT(input: Any): Iterator[Int]
     top-level call
  def singH(H: Int): ListSet[Int]
     convenience method
  def singT(T: Int): ListSet[Int]
     convenience method

Methods inherited from java/lang/Object-class
clone, eq, equals, finalize, getClass, hashCode, notify, notifyAll, synchronized, toString, wait, wait, wait

Methods inherited from scala/Any-class
!=, ==, asInstanceOf, isInstanceOf, match

Field Detail

treeTransitions

  val treeTransitions: Array[Set[TreeRHS]]

hedgeTransitions

  val hedgeTransitions: Array[Set[HedgeRHS]]
Method Detail

singT

  def singT(T: Int): ListSet[Int]
convenience method

singH

  def singH(H: Int): ListSet[Int]
convenience method

matchesT

  def matchesT(input: Any): Iterator[Int]
top-level call
Returns:
index of the first applicable nonterminal in initials
Todo:
remove sanity check

matchesH

  def matchesH(h: Seq[Any]): Iterator[Int]
top-level call
Returns:
index of the first applicable nonterminal in initials
Todo:
remove sanity check

isApplicableTree1

  def isApplicableTree1(T: Int, t: Any): Boolean
top-level call

isApplicableHedge1

  def isApplicableHedge1(H: Int, h: Iterator[Any]): Boolean
top-level call

getChildren

  def getChildren(t: Any): Iterator[Any]

isApplicableTree

  protected def isApplicableTree(initialNTs: Set[Int], t: Any): Set[Int]
given set of tree nonterms initialNTs and input tree t, returns { T | T in initialNTs, T -> a<H> in rules, isApplicable( H, t.children ) }

isApplicableHedge

  def isApplicableHedge(initialNTs: Set[Int], it: Iterator[Any]): Set[Int]
given set of hedge nonterms initialNTs and input hedge h, returns { H | H in initialNTs, T -> a<H> in rules, isApplicable( H, t.children )