alpaca.internal.parser

Members list

Type members

Experimental classlikes

final sealed case class NonTerminal(name: String) extends AnyVal

Represents a non-terminal symbol in the grammar.

Represents a non-terminal symbol in the grammar.

Non-terminals are symbols that can be expanded into other symbols according to the grammar rules. For example, in a typical expression grammar, "expr" and "term" would be non-terminals.

Value parameters

name

the name of the non-terminal

Attributes

Companion
object
Experimental
true
Source
Symbol.scala
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all
object NonTerminal

Attributes

Companion
class
Experimental
true
Source
Symbol.scala
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class Parser[Ctx <: ParserCtx](using x$1: withDefault[Ctx, Empty])(using empty: Empty[Ctx], tables: Tables[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 global context type, defaults to EmptyGlobalCtx

Attributes

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

Attributes

Companion
class
Experimental
true
Source
Symbol.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Terminal.type
final sealed case class Terminal(name: String) extends AnyVal

Represents a terminal symbol in the grammar.

Represents a terminal symbol in the grammar.

Terminals are the basic tokens that come from the lexer and cannot be expanded further. For example, numbers, identifiers, and operators are typically terminals.

Value parameters

name

the name of the terminal (token name)

Attributes

Companion
object
Experimental
true
Source
Symbol.scala
Supertypes
trait Serializable
trait Product
trait Equals
class AnyVal
trait Matchable
class Any
Show all

Value members

Experimental methods

def productionImpl(using quotes: Quotes): Expr[ProductionSelector]

Attributes

Experimental
true
Source
Parser.scala