pt_introduction(n)
πΈ pt_introduction β Introduction to Parser Tools πΈ
okay bestie, welcome to the Parser Tools β this is the pt_introduction(n) page btw, the little front door to the whole thing. It's a whole system for making parsers and for manipulating the grammars that drive them. π
β¨ SYNOPSIS β¨
package require Tcl 8.5 9
π DESCRIPTION π
Welcome to the Parser Tools, a system for the creation and manipulation of parsers and the grammars driving them. π¦
So like⦠what are your goals, bestie? Why are you even here? Let's vibe check that:
- Do you simply wish to create a parser for some language?
Then go look at our parser generator application, pt β or, if you want slightly deeper access, the package underneath it, pt::pgen. π
- Do you wish to know more about the architecture of the system?
That's all described in the section Parser Tools Architecture, down below. β¬οΈ
- Is your interest in the theoretical background upon which the packages and tools are build?
See the Introduction to Parsing Expression Grammars. no cap, it's giving academia β¨
π PARSER TOOLS ARCHITECTURE π
The system can be split into roughly three layers, as seen in the figure below
IMAGE: architecture
These layers are, from high to low:
- At the top we have the application and the packages using the packages of the layer below to implement common usecases. One example is the aforementioned
pt::pgenwhich provides a parser generator.
The list of packages belonging to this layer can be found in section User Packages
- In this layer we have the packages which provide the core of the functionality for the whole system. They are, in essence, a set of blocks which can be combined in myriad ways, like Lego (tm). The packages in the previous level are 'just' pre-fabricated combinations to cover the most important use cases. π§±
The list of packages belonging to this layer can be found in section Core Packages
- Last, but not least is the layer containing support packages providing generic functionality which not necessarily belong into the module.
The list of packages belonging to this layer can be found in section Support Packages
π USER PACKAGES π
pt::pgen
π§ CORE PACKAGES π§
This layer is further split into six sections handling the storage, import, export, transformation, and execution of grammars, plus grammar specific support packages. lowkey a lot but we move π
Storage
pt::peg::container
Export
pt::peg::exportpt::peg::export::containerpt::peg::export::jsonpt::peg::export::pegpt::peg::to::containerpt::peg::to::jsonpt::peg::to::pegpt::peg::to::parampt::peg::to::tclparampt::peg::to::cparam
Import
pt::peg::importpt::peg::import::containerpt::peg::import::jsonpt::peg::import::pegpt::peg::from::containerpt::peg::from::jsonpt::peg::from::peg
Transformation
(this one is justβ¦ vibes. nothing listed here, bestie, that's literally it π«Ά)
Execution
pt::peg::interppt::rde
Support
pt::tclparam::configuration::snitpt::tclparam::configuration::tcloopt::cparam::configuration::critclpt::astpt::pept::peg
π SUPPORT PACKAGES π
pt::peg::container::pegtext::writeconfigurationpathschar
π BUGS, IDEAS, FEEDBACK π
This document, and the package it describes, will undoubtedly contain bugs and other problems. fr fr, that's just how it goes. Please report such in the category pt of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. Please also report any ideas for enhancements you may have for either package and/or documentation. we love ideas, give us the ideas π
When proposing code changes, please provide unified diffs, i.e the output of diff -u.
Note further that attachments are strongly preferred over inlined patches. Attachments can be made 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. (yes, the left-most one, don't make me come find you π)
π₯ KEYWORDS π₯
EBNF, LL(k), PEG, TDPL, context-free languages, expression, grammar, matching, parser, parsing expression, parsing expression grammar, push down automaton, recursive descent, state, top-down parsing languages, transducer
πΈ CATEGORY πΈ
Parsing and Grammars
π COPYRIGHT π
Copyright (c) 2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
okay that's the whole thing, bestie, you ate it up π this was pt_introduction(n) from tcllib version 1.1 β mwah, go build a parser, you've got this ππ
β¨
π¦ 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) 2009 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