1

How regenerate lexers and parsers in python. I am new to this and I don't know what to do. The error I got is as follows:

In 'pddlLexer.py': class pddlLexer(Lexer):

In 'pddlLexer.py': atn = ATNDeserializer().deserialize(serializedATN())

In ATNDeserializer.py: self.checkVersion()

In ATNDeserializer.py: raise Exception("Could not deserialize ATN with version " + str(version) + " (expected " + str(SERIALIZED_VERSION) + ").") Exception: Could not deserialize ATN with version (expected 4).

The last error is the one I am trying to resolve.

I was trying to parse a PDDL problem to visualize a plan using the 'planning_graph' package from this link: https://github.com/debbynirwan/planning_graph

  • 1
    I sympathize with your problem, but you really need to describe it better. The complete disconnect between the question title and anything you've written in the post suggests that you've followed some internet search into a rabbit hole which talks about regenerating the generated parser files, without giving any further details. Actually citing the page where you found this advice would help. So would describing in detail how you go to where you are: What exactly did you do to install that software (including dependencies)? Also what version of Python are you using? – rici Nov 08 '22 at 02:26
  • I am using python 3.10. That's what I meant lol I really have no idea as to what this means. I tried using Stackoverflow and Github posts to solve it but this is the best I could do. This is one of the pages I saw: https://stackoverflow.com/questions/71984269/4-10-1-python-atndeserializer-broken and this is the code for ATN(?): https://github.com/antlr/antlr4/blob/master/runtime/Python2/src/antlr4/atn/ATNDeserializer.py (from github). I'll update as I get more info. – Wolff Kaushal Nov 11 '22 at 14:44
  • @WolffKaushal "*I was trying to parse a PDDL problem to visualize a plan*", can you please add the PDDL domain and problem to your question to form a [MWE](https://stackoverflow.com/help/minimal-reproducible-example) – Bilal Nov 12 '22 at 16:55

0 Answers0