-
Notifications
You must be signed in to change notification settings - Fork 32
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
advice requested on implementing a language "feature" #145
Comments
I think there are two viable approaches:
I think the second option would be "less hacky". But, the problem is that parglare currently expect a slice of the input to be returned by recognizers. In this case that slice would be empty so parglare takes that to mean unrecognized token. See here. What you can try as a workaround is to inherit the list type and make it evaluate to This is just an idea, I haven't tested it. |
Description
I am trying to translate an old dialect of BCPL into a more recent version.
One of the quirks of this language is the allowed omission of certain language
elements, in certain situations. My current attempts are to try to "inject"
the missing (omitted) elements into the input stream, but that doesn't look
possible with the current implementation of Parglare custom recognizers,
as input_str is type str and thus immutable.
Is that correct?
If so, is there another way of attacking this problem?
Thanks.
Here is the relevant doc extract, edited from the old-dialect manual:
Insertion of missing symbols during parse:
Where in the above text means:
element : character_constant | string_constant | number | Identifier | "TRUE" | "FALSE" ;
The text was updated successfully, but these errors were encountered: