-
Notifications
You must be signed in to change notification settings - Fork 20
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
GnuCOBOL #27
Comments
I don't know the grammar for GnuCOBOL, but a quick google delivers these:
which imply that GnuCobol either has a custom parser or uses a non-LALR(1)/LR(1) bison parser type which resolves those problems - I don't know if today's bison supports Earley grammars and such, which might handle the issues mentioned above, but jison doesn't currently go beyond lalr(1)/lr(1) parsing, so YMMV and I guess the answer is 'no' for both jison and bison. |
Had a quick look at the gnucobol 2.2 source tar: they have two yacc grammars in there, so I have no idea how they tackled the issues mentioned while sticking with yacc/bison: I don't see special options in the yacc file nor the Makefile.am in there which would instruxt bison to do anything special. Fundamentally, from a grammar perspective, jison should be able to handle it if vanilla bison can. However, a quick initial attempt to feed the .y files to bleeding edge jison turns up a few issues:
which is something jison DOES NOT support out of the box: what you MAY do for such rules is add %epsilon rules to simulate this behaviour (that's what classic yacc/bison does too):
which is another bug in jison.
Quoting the bison manual at https://www.gnu.org/software/bison/manual/html_node/Actions.html (bold emphasis mine):
Bottom line: porting that grammar/those grammars is a non-trivial exercise. |
Wow @GerHobbelt thanks for your feedback, can I send you an email to discuss this further? |
Sorry, I get rather swamped with email, so that won't work. Besides, there's the day job to keep in mind. ;-) Second, using this channel scales better as this stuff is potentially useful for other folks who visit at some point in the future and are looking for this or similar info. Also, if others want to chime in, correct or improve on what is discussed here, that is possible. Email is for more direct address - not advised unless there are fees involved. The github issue tracker isn't exactly meant for this type of issue, but that's okay with me: it's sideways related to jison-gho and has helped uncover a few bugs already. (Also, I don't take time to visit SO (StackOVerflow) often; other matters have top priority.) Bottom line / TL;DR: let's stay in this channel... 😉 |
Closing due to age; please open a fresh issue, referencing this one for future ref on the same or similar subject. |
Hi
I want to use the jison to generate a parser for the GnuCobol grammar file, can jison do this? I have already tried however there was some errors.
Thanks
Simon
The text was updated successfully, but these errors were encountered: