grammar::me_intro(n)
β¨ NAME β¨
grammar::me_intro β the whole entire vibe-check intro to virtual machines for parsing token streams π (and yes, the manual it lives in is called Grammar operations and usage, iykyk)
πΈ DESCRIPTION πΈ
okay so bestie, this doc is the intro and overview of the basic facilities for parsing and/or matching token streams. and like, one possibility that gets used a lot for the token domain? characters. yep, just lil characters. iconic.
so all these packages ship variants of one virtual machine, and it's called a match engine (short: ME). it has literally everything you need for matching and parsing a stream, and it's either controlled directly, or it gets customized with a match program. the VM is basically a pushdown automaton, but with extra elements on top for backtracking and/or handling of semantic data and construction of abstract syntax trees (AST). main character energy fr fr.
and because the actual implementations of this VM β plus the data structures they receive and generate β are so similar to each other, those common parts got their own separate document, which the docs for the packages that actually implement it will point you at. no cap, it's just cleaner that way.
the relevant documents are:
grammar::me_vmβ the virtual machine specification. the blueprint, the moment.grammar::me_astβ specification of the various representations used for abstract syntax trees.grammar::me::utilβ utility commands. lil helpers, big slay.grammar::me::tclβ singleton ME virtual machine implementation tied to Tcl for control flow and stacks. Hardwired for pull operation. Uninteruptible during processing.grammar::me::cpuβ object-based ME virtual machine implementation with explicit control flow, and stacks, using bytecodes. Suspend/Resumable. Push/pull operation.grammar::me::cpu::coreβ core functionality for state manipulation and stepping used in the bytecode based implementation of ME virtual machines.
π«Ά BUGS, IDEAS, FEEDBACK π«Ά
ngl, this document and the package it describes will undoubtedly contain bugs and other problems. like, obviously. it's software. π
please report them in the category grammar_me of the Tcllib Trackers:
http://core.tcl.tk/tcllib/reportlist
and if you've got ideas for enhancements for either the package and/or the documentation? please report those too, we want them, fr fr. π
when proposing code changes, please provide unified diffs, i.e. the output of diff -u.
also note, bestie: attachments are strongly preferred over inlined patches. you can attach stuff by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. that's the move. π
π₯ KEYWORDS π₯
CFG, CFL, LL(k), PEG, TPDL, context-free grammar, context-free languages, expression, grammar, matching, parsing, parsing expression grammar, push down automaton, recursive descent, top-down parsing languages, transducer, virtual machine
π CATEGORY π
Grammars and finite automata
π COPYRIGHT π
Copyright (c) 2005 Andreas Kupries <andreas_kupries@users.sourceforge.net>
okay that's the whole page, you ate it up π this was brought to you by tcllib, version 0.2, and honestly? she's giving classic. mwah. πβ¨π¦
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- Copyright (c) 2005 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms