halotukozak.alpaca.internal.parser

Members list

Type members

Classlikes

abstract class Parser[Ctx <: ParserCtx](using x$1: withDefault[Ctx, Empty])(using tables: Tables[Ctx], errorHandling: ErrorHandling[Ctx])

Base class for parsers.

Base class for parsers.

Users should extend this class and define their grammar rules as Rule instances. The parser uses an LR parsing algorithm with automatic parse table generation.

Type parameters

Ctx

the parser context type; Parser without a type argument uses ParserCtx.Empty

Attributes

Source
Parser.scala
Supertypes
class Object
trait Matchable
class Any
final class ProductionRule[-Ctx <: ParserCtx]

A production with its semantic action, which a runtime ParseAction.Reduction reduces by. There is one per production, shared by every cell of the parse table that reduces by it.

A production with its semantic action, which a runtime ParseAction.Reduction reduces by. There is one per production, shared by every cell of the parse table that reduces by it.

Type parameters

Ctx

the parser context type

Attributes

Source
ProductionRule.scala
Supertypes
class Object
trait Matchable
class Any
final class RuntimeTable[Ctx <: ParserCtx]

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

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
Supertypes
class Object
trait Matchable
class Any
object Tables

Attributes

Source
createTables.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Tables.type

Types

opaque type Tables[Ctx <: ParserCtx]

An opaque type containing the parse table for the parser, and the factory of its initial context.

An opaque type containing the parse table for the parser, and the factory of its initial context.

The parse table is used to drive the LR parsing algorithm; its reductions carry the semantic actions of their productions. It is generated at compile time by analyzing the grammar rules. The initial context is built from the default values of the context's fields.

Type parameters

Ctx

the parser context type

Attributes

Source
createTables.scala