Skip to content

Commit

Permalink
gh-98831: Move DSL documentation here from ideas repo (#101629)
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanrossum authored Feb 7, 2023
1 parent 1fcc0ef commit 694e346
Show file tree
Hide file tree
Showing 2 changed files with 415 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Tools/cases_generator/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Tooling to generate interpreters

Documentation for the instruction definitions in `Python/bytecodes.c`
("the DSL") is [here](interpreter_definition.md).

What's currently here:

- `lexer.py`: lexer for C, originally written by Mark Shannon
- `plexer.py`: OO interface on top of lexer.py; main class: `PLexer`
- `parser.py`: Parser for instruction definition DSL; main class `Parser`
- `generate_cases.py`: driver script to read `Python/bytecodes.c` and
write `Python/generated_cases.c.h`
- `test_generator.py`: tests, require manual running using `pytest`

The DSL for the instruction definitions in `Python/bytecodes.c` is described
[here](https://github.com/faster-cpython/ideas/blob/main/3.12/interpreter_definition.md).
Note that there is some dummy C code at the top and bottom of the file
Note that there is some dummy C code at the top and bottom of
`Python/bytecodes.c`
to fool text editors like VS Code into believing this is valid C code.

## A bit about the parser
Expand Down
Loading

0 comments on commit 694e346

Please sign in to comment.