Package-level declarations

Types

Link copied to clipboard
object Dsl

Entry point for parsing .qkt DSL files.

Link copied to clipboard

The role each lexer keyword plays in a .qkt file, for editor tooling. Every keyword the lexer recognizes (see Lexer.keywordSpellings) maps to exactly one category; ARROW is the -> punctuation kind and is not a keyword. Grammars highlight one textMateScope per category and Vim links one vimGroup per category to a stock highlight group.

Link copied to clipboard
class Lexer(src: String)

Turns .qkt source into Tokens with line and column: identifiers and keywords, numbers and duration literals, quoted strings, and operators, skipping whitespace and --, # and block comments. Lexing errors throw with the offending position.

Link copied to clipboard
sealed interface ParsedFile

Discriminates between STRATEGY and PORTFOLIO files parsed by Dsl.parseAny.

Link copied to clipboard
data class ParseError(val line: Int, val col: Int, val message: String)

A single parse error with 1-based line + col coordinates pointing into the source.

Link copied to clipboard
class Parser(tokens: List<Token>)

Recursive-descent parser for .qkt files: turns the Lexer's tokens into a StrategyAst or a portfolio AST.

Link copied to clipboard
sealed interface ParseResult<out T>

Result of a parse: either Success with the AST or Failure with collected errors.

Link copied to clipboard
data class Token(val kind: TokenKind, val lexeme: String, val line: Int, val col: Int)
Link copied to clipboard