Module

lexie/token

src/lexie/token.pooka

The cast list: everyone who will appear in the generated Token family.

Every class the generated Token family will have, worked out from a specification. Shared by the generators and the checks.

API reference

class

Kind

src/lexie/token.pooka:15
class Kind

Where a token class comes from.

class

Keyword

src/lexie/token.pooka:17
class Keyword(text: String) is Kind
field

text

src/lexie/token.pooka:17
text: String
INFERREDString
constructor

new

src/lexie/token.pooka:17
INFERREDfn(String) -> lexie/token.Keyword
class

Literal

src/lexie/token.pooka:19
class Literal(text: String) is Kind
field

text

src/lexie/token.pooka:19
text: String
INFERREDString
constructor

new

src/lexie/token.pooka:19
INFERREDfn(String) -> lexie/token.Literal
class

Operator

src/lexie/token.pooka:21
class Operator(text: String) is Kind
field

text

src/lexie/token.pooka:21
text: String
INFERREDString
constructor

new

src/lexie/token.pooka:21
INFERREDfn(String) -> lexie/token.Operator
class

Punctuation

src/lexie/token.pooka:23
class Punctuation(text: String) is Kind
field

text

src/lexie/token.pooka:23
text: String
INFERREDString
constructor

new

src/lexie/token.pooka:23
INFERREDfn(String) -> lexie/token.Punctuation
class

IdentKind

src/lexie/token.pooka:25
class IdentKind is Kind
class

IntKind

src/lexie/token.pooka:27
class IntKind is Kind
class

FloatKind

src/lexie/token.pooka:29
class FloatKind is Kind
class

StringKind

src/lexie/token.pooka:31
class StringKind is Kind
class

CharKind

src/lexie/token.pooka:33
class CharKind is Kind
class

CommentKind

src/lexie/token.pooka:35
class CommentKind is Kind
class

DocCommentKind

src/lexie/token.pooka:37
class DocCommentKind is Kind
class

ModuleCommentKind

src/lexie/token.pooka:39
class ModuleCommentKind is Kind
class

BlockCommentKind

src/lexie/token.pooka:41
class BlockCommentKind is Kind
class

WhitespaceKind

src/lexie/token.pooka:43
class WhitespaceKind is Kind
class

ErrorKind

src/lexie/token.pooka:45
class ErrorKind is Kind
class

EndKind

src/lexie/token.pooka:47
class EndKind is Kind
class

TokenDef

src/lexie/token.pooka:50
class TokenDef(name: String, payload: Bool, kind: Kind)

One token class: its name, whether it carries text, and its kind.

field

name

src/lexie/token.pooka:50
name: String
INFERREDString
field

payload

src/lexie/token.pooka:50
payload: Bool
INFERREDBool
field

kind

src/lexie/token.pooka:50
kind: Kind
constructor

new

src/lexie/token.pooka:50
INFERREDfn(String, Bool, lexie/token.Kind) -> lexie/token.TokenDef
function

fixed_name

src/lexie/token.pooka:54
fixed_name(config: Config, text: String, section: String) -> String
INFERREDfn(lexie/config.Config, String, String) -> String

The class name for a fixed token in a section such as Keyword. Falls back to Invalid; the checks report that before anything is generated.

function

word_name

src/lexie/token.pooka:62
word_name(config: Config, text: String) -> String
INFERREDfn(lexie/config.Config, String) -> String

The class for a keyword or literal, by its text.

function

symbol_name

src/lexie/token.pooka:70
symbol_name(config: Config, text: String) -> String
INFERREDfn(lexie/config.Config, String) -> String

The class for an operator or punctuation, by its text.

function

definitions

src/lexie/token.pooka:86
definitions(config: Config) -> List(TokenDef)

Every class of the generated family, in declaration order.

Pooka
import lexie/config
import lexie/token

let definitions = token.definitions(config.default_config())
// Ident, numeric and error/end definitions follow the fixed tokens.
function

describe

src/lexie/token.pooka:170
describe(kind: Kind) -> String
INFERREDfn(lexie/token.Kind) -> String

Where a token class came from, for messages.

function

fixed_text

src/lexie/token.pooka:192
fixed_text(kind: Kind) -> Option(String)
INFERREDfn(lexie/token.Kind) -> Option(String)

The fixed text of a keyword, literal, operator or punctuation.