RuntimeTable

halotukozak.alpaca.internal.parser.RuntimeTable
final class RuntimeTable[Ctx <: ParserCtx]

The parse table as the parser runs it, built by the code ParseTable.toRuntime generates.

Type parameters

Ctx

the parser context type

Value parameters

rows

one per state (dense, consecutive, starting at 0), each a symbol -> action map

Attributes

Source
RuntimeTable.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def expectedTerminals(stateStack: IndexedSeq[Int]): List[Terminal]

The terminals the input may continue with on stateStack (bottom first), sorted by name, with the end of the input ahead of a token named $.

The terminals the input may continue with on stateStack (bottom first), sorted by name, with the end of the input ahead of a token named $.

LALR(1) merges lookaheads of states with the same core, so a state may reduce on a terminal that cannot follow there. Each candidate is kept only if replaying the reductions on it reaches a shift or the accept.

Attributes

Source
RuntimeTable.scala
def get(state: Int, symbol: Symbol): RuntimeAction[Ctx] | Null

The action for a given state and symbol, or null if the grammar accepts no such symbol there.

The action for a given state and symbol, or null if the grammar accepts no such symbol there.

Attributes

Source
RuntimeTable.scala
def goto(state: Int, nonTerminal: NonTerminal): Int

The state the parser moves to after reducing to nonTerminal with state uncovered on top of the stack.

The state the parser moves to after reducing to nonTerminal with state uncovered on top of the stack.

Attributes

Source
RuntimeTable.scala