-
Notifications
You must be signed in to change notification settings - Fork 16
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
Cannot find rule for token #5
Comments
Hi Martijn, First, thanks for your interest in Bullwinkle! I think the problem is that your BNF file uses On a side note, I see that the grammar defines rules down to the level of single characters, for example to define the format of a valid identifier. BW was designed to parse whitespace-separated sequences of words, so I'm not sure this is a good fit for it. This could probably be better represented in Bullwinkle as a regex that defines the format of a particular word. Best! |
Thanks! Changing Now that I'm reading the instructions more thoroughly I see that Bullwinkle support only the basic BNF syntax, and not fancy things like optional elements |
Alas, not for now. However, none of these features is beyond the
expressiveness of context-free grammars, so you should be able to write
them, although in a slightly more involved way.
For example, in one of my projects, I wrote a list of elements as:
<list> := <element> | <list> , <element>
This should take care of repetition. And similarly, if I recall you can
also use the `epsilon` symbol to say that something can parse to
nothing, so this should allow you to handle optional elements.
In any case, I don't they these features would be hard to include in the
tool, as the parsing algorithm is pretty straightforward. If you or
someone you know would like to contribute, please feel free!
Best,
Sylvain
Martijn Schuemie wrote:
… Thanks! Changing |::=| to |:=| solved the error message, but now the
parser produces a null object.
Now that I'm reading the instructions more thoroughly I see that
Bullwinkle support only the basic BNF syntax, and not fancy things like
optional elements |[]| and repetition |*| like mentioned here
<https://www.w3.org/Notation.html>. I guess those are not on the
development path for Bullwinkle?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABdkiSk6KXd6X2d2-bHOmpURk9fry55Rks5rfqvagaJpZM4MDLK2>.
|
I am probably abusing Bullwinkle in several ways, but could use some guidance in how to do it right.
I've converted the ANSI SQL BNF to what I think it the correct Bullwinkle syntax: sql_bnf.txt
I then tried to parse some simple SQL:
which results in this error message:
I tried both the latest release (v1.3) as well as the current version in master, with no difference in results.
Help?
The text was updated successfully, but these errors were encountered: