Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split up grammar spec to multiple files #12

Open
sebastianriese opened this issue Feb 23, 2013 · 0 comments
Open

Split up grammar spec to multiple files #12

sebastianriese opened this issue Feb 23, 2013 · 0 comments

Comments

@sebastianriese
Copy link
Owner

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant