Skip to content

Change the parser library #176

@Bernardo-MG

Description

@Bernardo-MG

The main problem for the project is the parsing library, which is good for small projects, and not for parsing huge files.

This article contains a list of Python parsers:
https://tomassetti.me/parsing-in-python/#parserGenerators

The library should support a BNF grammar, which should be easy to create from the CWR specification.

Note that the list includes ANTLR, which does support these grammars.

I also have experience with Ply, but does not seem like a good option for complex grammars.

These projects can be useful as references, as they are my own tests with parsers:
https://github.com/Bernardo-MG/dice-notation-java
https://github.com/Bernardo-MG/dice-notation-python

Based on all this, I think the best course of action would be:

  • Defining a BNF grammar
  • Using Antlr to generate a Python parser
  • Combining the parser with the project

This would require reworking the project, and probably dropping much of the current code.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions