kiama.parsing.PackratParsers

class MemoParser

[source: kiama/parsing/PackratParsers.scala]

class MemoParser[T](body : => Parser[T])
extends Parser[T] with Rule
A typed rule is a memoising, left recursion-detecting encapsulation of a parser that returns a value of a particular type.
Value Summary
val memo : scala.collection.mutable.HashMap[scala.util.parsing.input.Reader, MemoEntry]
The section of the memo table relating to this rule.
Method Summary
override def ^^ [U](f : (T) => U) : MemoParser[U]
Construct a parser that parses what this parser parses and, if successful, applies f to the result. The starting position is attached to the result if it holds position information and doesn't already have some.
def apply (in : scala.util.parsing.input.Reader) : ParseResult[T]
Apply this rule, memoising the result.
def growlr (in : scala.util.parsing.input.Reader, m : MemoEntry, h : Head) : ParseResult[T]
Grow the current parse result according to a left recursion.
def lranswer (in : scala.util.parsing.input.Reader, m : MemoEntry) : ParseResult[T]
Process a given left recursion instance.
def recall (in : scala.util.parsing.input.Reader) : scala.Option[MemoEntry]
Look up the memoised result for this rule, taking into account that it might be participating in an active left recursion.
def setuplr (l : LR[T]) : Unit
Initialise the left recursion data for a new application of this rule.
Methods inherited from Parser
map, flatMap, append, ~, ~>, <~, >>, *, *, +, +, ?, |, ^^^, ^?, ^?, unary_+, unary_!
Methods inherited from scala.Function1
scala.Function1.toString, scala.Function1.compose, scala.Function1.andThen
Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Class Summary
case class MemoEntry (val ans : Answer[T], val in : scala.util.parsing.input.Reader) extends scala.Product
Memo table entries.
Value Details
val memo : scala.collection.mutable.HashMap[scala.util.parsing.input.Reader, MemoEntry]
The section of the memo table relating to this rule.

Method Details
def apply(in : scala.util.parsing.input.Reader) : ParseResult[T]
Apply this rule, memoising the result.
Overrides
Parser.apply

def setuplr(l : LR[T]) : Unit
Initialise the left recursion data for a new application of this rule.

def lranswer(in : scala.util.parsing.input.Reader, m : MemoEntry) : ParseResult[T]
Process a given left recursion instance.

def recall(in : scala.util.parsing.input.Reader) : scala.Option[MemoEntry]
Look up the memoised result for this rule, taking into account that it might be participating in an active left recursion.

def growlr(in : scala.util.parsing.input.Reader, m : MemoEntry, h : Head) : ParseResult[T]
Grow the current parse result according to a left recursion.

override def ^^[U](f : (T) => U) : MemoParser[U]
Construct a parser that parses what this parser parses and, if successful, applies f to the result. The starting position is attached to the result if it holds position information and doesn't already have some.
Overrides
Parser.^^