Documentation ¶
Overview ¶
Package lexer implements a tokenizer or lexer for Aurora Lyrics Language (ALF) source files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct { Token Token Literal string Line int // Starts from 0. Col int // Starts from 0. }
Item contains a token, its literal text and its location in the source file.
type Lexer ¶
type Lexer struct {
// contains filtered or unexported fields
}
Lexer is a token generator for Aurora Lyrics Format (ALF) source files.
func New ¶
New creates and initializes a new `Lexer` and starts collecting tokens immediately using concurrency. The `r` argument must be source code in ALF format.
The first value returned is a pointer to a `Lexer` structure, provided for monitoring purposes (it currently does nothing).
The second value returned is a read-only channel on which `Item` structures are sent with the tokens found.