grammar::me_intro(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

✨ 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 (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