Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| creating:syntax [2025/03/24 22:01] – Added preparation directions for reading first three chapters of Crafting Interpreters ahelwer | creating:syntax [2025/04/06 23:20] (current) – Deleting page ahelwer | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Parsing TLA⁺ Syntax ====== | ||
| - | TLA⁺ is a large, complicated, | ||
| - | This is assisted by [[https:// | ||
| - | This tutorial only uses a minimal subset of TLA⁺ syntax, just enough to handle [[https:// | ||
| - | While that may seem limiting, this tutorial tries to focus on the difficult & interesting parts of parsing the language instead of more mundane drudgework like handling all hundred-some user-definable operator symbols. | ||
| - | You are encouraged to extend this minimal core as you wish; language tooling is best developed incrementally! | ||
| - | Slowly filling in the details of this rough language sketch has a satisfying meditative aspect. | ||
| - | |||
| - | Here is what our minimal language subset includes: | ||
| - | * The '' | ||
| - | * Named parameterized operator definitions like '' | ||
| - | * Comments, both single-line like '' | ||
| - | * Declaration of '' | ||
| - | * The '' | ||
| - | * Finite set literals, like '' | ||
| - | * Some infix operators: '' | ||
| - | * The variable-priming suffix operator | ||
| - | * Vertically-aligned conjunction & disjunction lists | ||
| - | * The '' | ||
| - | * Natural numbers like '' | ||
| - | * Boolean values '' | ||
| - | |||
| - | Notably, the following will not be covered in this tutorial: | ||
| - | * PlusCal | ||
| - | * Declaring '' | ||
| - | * Nesting modules or importing other modules through '' | ||
| - | * Set map & set filter syntax, like '' | ||
| - | * Universal & existential quantification, | ||
| - | * The '' | ||
| - | * Functions, like '' | ||
| - | * Sequences, like ''<< | ||
| - | * The '' | ||
| - | * Temporal- or action-level operators like '' | ||
| - | * Higher-order operator parameters like '' | ||
| - | * The TLA⁺ proof language | ||
| - | |||
| - | As outlined above, you are free to add these missing features (or others) as you wish. | ||
| - | |||
| - | ===== Preparation ===== | ||
| - | |||
| - | Read the first three chapters of free online textbook // | ||
| - | We will be closely following the material in this book, modifying it to our uses. | ||
| - | The first two chapters are a nice introduction and overview of language implementation generally. | ||
| - | Chapter three specifies a toy language called Lox, to be used as an object of study for the remainder of the book. | ||
| - | Our minimal TLA⁺ subset has some similarity to Lox with regard to expressions involving integers and booleans, but also differences - you can skip the section on closures (unless you want to implement higher-order operator parameters yourself) and the section on classes. | ||
| - | What's important is that it's similar enough for all the fundamentals to still apply! | ||