-
Notifications
You must be signed in to change notification settings - Fork 92
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
Production separators on multiple lines #16
Comments
Wouldn't it be easiest to let regular expressions do the dirty work? I use it for a C# implementation You can have:
Additionally, the code becomes more readable as well as maintainable and it is not as error prone. Examples on parsing some of my grammars can be found here: Feel free to improve the regular expressions and give feedback.
|
Any consensus on these suggestions? James/Dave, what are your thoughts? |
Stefans seems good On Thursday, 15 September 2016, Michael Fenton notifications@github.com
|
If we can replace some manual parsing with an RE then we should. On 15 September 2016 at 17:01, Dave notifications@github.com wrote:
Dr. James McDermott |
Stefan's RegEx version is now implemented. The old system still exists under then name old_read_bnf_file(), can be removed easily. |
I have an edit of the read_bnf for production separators on multiple lines. If you want to accept it you can see if it passes test you write (works on my computer...) (I find it a lot easier to read grammars were at least each production can be on a separate line)
def read_bnf_file(self, file_name):
"""Read a grammar file in BNF format.
The text was updated successfully, but these errors were encountered: