Default

halotukozak.alpaca.LexerCtx.Default
final case class Default(column: Column = ..., line: Line = ...) extends LexerCtx

The context of a lexer block without a type parameter: the Column and Line tracking fields, updated after every match. Read them as plain Ints (ctx.line, ctx.column).

In the context they are the position after the last match; in a lexeme they are the position where its token starts.

Value parameters

column

the current column within the line (1-based, in code points)

line

the current line number (1-based)

Attributes

Source
lexer.scala
Graph
Supertypes
trait Serializable
trait LexerCtx
trait Selectable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

inline def applyDynamic(inline name: String)(inline args: Any*): Any

Not meant to be called: assigning a context field outside a lexer rule or handler is a compile error.

Not meant to be called: assigning a context field outside a lexer rule or handler is a compile error.

Attributes

Inherited from:
LexerCtx
Source
lexer.scala
final def peek(n: Int): String

A copy of at most the next n characters of the input still to be tokenized, fewer at its end.

A copy of at most the next n characters of the input still to be tokenized, fewer at its end.

Meant for a custom ErrorHandling instance to look at what failed to match any token rule, e.g. to pick a recovery strategy based on what comes next. Only the requested characters are read and copied, and the result is safe to keep after the callback returns.

Value parameters

n

the maximum number of characters to return

Attributes

Throws
IllegalArgumentException

if n is negative

Inherited from:
LexerCtx
Source
lexer.scala
def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala