Open JoanEspasa opened 5 years ago
Thanks to a user in stackoverflow, I found why this happens:
https://stackoverflow.com/questions/54163775/parsing-error-with-the-default-antlr4-grammar-for-the-pddl-language
For all the literal keywords inside parser rules (like 'at', 'begin', 'end', ...) ANTLR will create tokens for behind the scenes. So the input at
will always be tokenised as an AT token, never as a NAME token.
But there should be no restriction about the predicates or functions name, so this could be fixed by adding the literal explicitly like this:
functionSymbol
: NAME
| 'at'
;
I'm not sure though if the keywords should be added explicitly to the grammar.
Hello, I am relatively new to ANTLR so please bear with me.
I'm trying to parse a valid PDDL file and it seems the given grammar has some kind of error I cannot seem to find
A minimal input that reproduces the error:
If it is of any use, the "official" BNF can be found here: https://helios.hud.ac.uk/scommv/IPC-14/repository/kovacs-pddl-3.1-2011.pdf
I'm using the latest stable antlr4 (4.7.2). I have tried generating Java and Python code, but it outputs the same error.