Menu
  • HOME
  • TAGS

How to process the stuctured language file in python

python,abstract-syntax-tree,parser-generator,ebnf,grako

The language seems simple enough. You should read a bit about parsing to understand what you have to do, whatever the programming language. PyParsing is popular among Python programmers. I think that Grako (I'm the author) is too complex for a beginner to parsing....

How can I express this format in EBNF?

python,grammar,ebnf,grako

It's hard to be sure what the real grammar is with just one example, but hopefully this is enough that you'll be able to finish tweaking it to deal with any weirdness. We need the Semantics class to deal with converting the key/value pairs and lists of them into dictionaries....

Link error when installing grako in Python

cython,grako

This is bug 52 against Grako. Upgrading to version 3.6.1 should solve the problem....