Skip to content

Split up grammar spec to multiple files #12

@sebastianriese

Description

@sebastianriese

For complex grammars it may be desirable to separate the lexer and parser to multiple files.
The problem: When using stokens they are fully interdependent. So a syntax like:

# header section
%lexer("path/to/lexer.pyLR")
%parser("path/to/parser.pyLR")
%footer
# footer section

or

%include("path/to/include.pyLR")

might be the best solution. The %include version is also interesting for parsers and lexers sharing structure (sample usecase: adding support for actions in other languages to the self hosting pyLRp parser: most of it will be similar, or even the same, but the lang-blobs will have a different lexic/grammar).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions