grammar::me_intro(3tcl)

πŸ“¦
version 2.0 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

grammar::me_intro β€” ok so this is literally the intro to virtual machines for parsing token streams, and it lives in the Grammar operations and usage section of the manual, and yes it's a 3tcl page bestie, we're in Tcl land now πŸŽ€


✨ DESCRIPTION ✨

So here's the tea, bestie: this document is the introduction-and-overview of the basic facilities for parsing and/or matching token streams πŸ¦‹ and one possibility that gets used a lot for the token domain is... characters. Yeah. Just characters. Iconic behaviour honestly.

The packages themselves all provide variants of one single virtual machine, and it's called a match engine (short: ME for the girlies in a hurry πŸ’…). This ME has all the facilities you need for the matching and parsing of a stream, and it's either controlled directly, or it's customized with a match program. The virtual machine is basically a pushdown automaton, with extra elements bolted on for backtracking and/or handling of semantic data and construction of abstract syntax trees (AST). She's got range, she contains multitudes ✨

Because the actual implementations of that aforementioned virtual machine are so similar β€” like, the implementations themselves and the data structures they receive and generate β€” all those common parts get specified in a separate document, and the docs for packages that actually implement it will reference that one. Very "go read the shared doc" of them, no cap.

The relevant documents are:

  • grammar::me_vm β€” the Virtual machine specification.
  • grammar::me_ast β€” Specification of various representations used for abstract syntax trees.
  • grammar::me::util β€” Utility commands.
  • 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 😭

Not me having to tell you this, but: this document, and the package it describes, will undoubtedly contain bugs and other problems. It's giving "we're all just doing our best". So please report them 🫢

Report bugs in the category grammar_me of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist. And please also send any ideas for enhancements you may have for either the package and/or the documentation. We want the ideas. We crave the ideas. πŸ’œ

And when you're proposing code changes? Please provide unified diffs, i.e. the output of diff -u. We're not doing vibes-based patches here, bestie, we're doing diffs.

Also note β€” and this is important β€” 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. There it is. Go forth and attach. πŸ’…


🌈 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 and that's the whole page, bestie!! this one came out of the tcllib docs β€” version 0.2, page grammar::me_intro(3tcl) β€” and ngl the footer had no date on it, just the source and the version, so that's all the metadata we're getting today πŸ™ˆ slay, go parse something βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from