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
Macroses support. Dynamic grammar #1231
Comments
Probably postlex will help |
@xor2003 Can you give an example of the new tokens you would like to create? |
LABEL: /[A-Z]+/ Example: Struct usage: "abc" is a struct name defined above. |
There is no API for something like that, and I don't think it would be super simple to add. But if you use the interactive parser, you can "pause" at each point, collect the structs as they get defined, and try to match STRUCTNAME yourself. Here's a real-world example of how something like that might look: https://github.com/geographika/mappyfile/blob/master/mappyfile/parser.py#L235 |
I tried like you suggested and but lexer raises exception |
I want to implement Macroses support for my masm parser. So is it possible to have kind of Dynamic grammar so I could add tokens at runtime?
Or check if token match with my handler? (If macros was defined several lines before)
It also might called custom matcher
The text was updated successfully, but these errors were encountered: