Skip to content

Use a proc macro for generating Rust code from GLL grammars. #23

Open
@eddyb

Description

@eddyb

At least it should be one of the provided options, alongside separate code generation.


A huge benefit is being able to use Spans from the grammar syntax, inside the generated code.

Given rust-lang/rust#51980, breakpoints should be possible at a given line + column, assuming debuggers support them (sadly, that PR left columns disabled windows).

We could them be putting breakpoints and stepping through grammar rules, in whatever syntax variant they were specified by the user!

By strategically naming some variables to e.g. input, we can also make debuggers able to show the currently remaining input to parse, potentially at zero cost to the implementation.
(But showing "current input line/column", without on-demand computation, would incur a penalty).

EDIT: @eternaleye points out that breadth-first is not ideal for debugging. We could have depth-first as part of a "debug mode", or just separately toggleable (even at runtime; not sure if "free" though).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions