Skip to content

How to go about including pegen code in CPython? #7

Closed
@lysnikolaou

Description

@lysnikolaou

How would you go about moving all the pegen code into cpython? What I have done so far is the following.

  1. Copy the pegen directory into cpython/Parser (and remove all the stuff that's not needed).
  2. Move pegen.c and parse_string.c from cpython/Parser/pegen into cpython/Parser.
  3. Move pegen.h and parse_string.h from cpython/Parser/pegen into cpython/Include.
  4. Generate two new functions that call run_parser_* and can be called from C.
  5. Add a parse.h in cpython/Include that exports both the new generated functions.
  6. Generate the parser into Parser/parse.c.

All the names are just dummy names that I didn't give much thought, but do you think something like this would work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions