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

qualifiedIdentifier in dgrammar.d is not defined #297

Open
mw66 opened this issue Oct 15, 2020 · 2 comments
Open

qualifiedIdentifier in dgrammar.d is not defined #297

mw66 opened this issue Oct 15, 2020 · 2 comments

Comments

@mw66
Copy link
Contributor

mw66 commented Oct 15, 2020

https://github.com/PhilippeSigaud/Pegged/blob/master/examples/dgrammar/src/pegged/examples/dgrammar.d#L60

ModuleDeclaration < "module" qualifiedIdentifier ";"

How Pegged detect / report such issue? I didn't see any error message.

Can problem like this (missing definition) contribute to the performance issue #294

@mw66
Copy link
Contributor Author

mw66 commented Oct 15, 2020

BTW, is the Pegged syntax custom build?

e.g.

https://github.com/erikrose/parsimonious

the grammar are defined using =, while here in Pegged it's using < <- etc.

Maybe one way to debug the dgrammar.d is to make it work with parsimonious, e.g. after I change all < etc to =, I have problems using parsimonious, (after remove MacroDeclaration), I got:

parsimonious.exceptions.IncompleteParseError: Rule 'rules' matched in its entirety, but it didn't consume all the text. The non-matching portion of the text begins with '/ "static" "import" ' (line 35, column 45).

@veelo
Copy link
Collaborator

veelo commented Oct 19, 2020

qualifiedIdentifier is a predefined parser, defined on https://github.com/PhilippeSigaud/Pegged/blob/master/pegged/peg.d#L3513. Make sure you include that file.

BTW, is the Pegged syntax custom build?

PEG has no standardised syntax as far as I know, so different parser generators may use slightly different syntaxes. Pegged provides several extensions, including <.

Rule 'rules' matched in its entirety

There is no rules in dgrammar.d, so that must be specific to Parsimonious. I would guess that your translation to Parsimonious does not comply with the requirements of Parsimonious. I cannot help you there, as it's the first time I have heard of the program.

As explained in #294 (comment), dgrammar is not a very good example. I appreciate your interest in getting it to work, but its value is quite limited IMHO.

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

2 participants