Parser

halotukozak.alpaca.internal.parser.Parser
abstract class Parser[Ctx <: ParserCtx](using x$1: withDefault[Ctx, Empty])(using empty: Empty[Ctx], tables: Tables[Ctx])

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 global context type, defaults to EmptyGlobalCtx

Attributes

Experimental
true
Source
Parser.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

final inline protected def ctx: Ctx

Provides access to the parser context within rule definitions.

Provides access to the parser context within rule definitions.

This is compile-time only and can only be used inside parser rule definitions.

Attributes

Source
Parser.scala

Abstract fields

val root: Rule[_]

The root rule of the grammar.

The root rule of the grammar.

This is the starting point for parsing.

Attributes

Source
Parser.scala