Configuring the PDDL parser
Note that a PDDL parser is included in the VAL binaries, so if you let the PDDL extension download those when prompted, you do not need to read this.
End users can configure the PDDL extension to use their own PDDL parser to validate their PDDL input files using their own parser. Such parser may validate PDDL domain and problem files for syntactic, lexical, or even logical issues. It may generate Errors, Warnings, Information or Hint. There are two shapes of parsers supported:
- parser executables
- parsing service
To configure a parser, invoke the "Configure PDDL parser" command (using Ctrl+Shift+P) and follow the instructions.
For parser executables, your configuration will be stored in following settings:
pddlParser.executableOrService(mandatory settings pointing to the executable/command)
pddlParser.executableOptions(optional specification of command line arguments)
pddlParser.problemPattern(optional regular expression pattern for matching problems in the parser output)
For parser service, specify the url into the
pddlParser.executableOrService setting e.g. http[s]://server/parse
If you are interested to build your own service, email me at dolejsi_pddl at outlook dot com and I can share the openapi.yaml, which is a contract the extension expects such service to fulfill.
Recommended configuration for commonly used PDDL parsers
Pddl4j supports both parsing of propositional PDDL and (simple) planning. To use it as a parser, use following command (
java -javaagent:d:/tools/pddl4j/pddl4j-3.5.0.jar -server -Xms2048m -Xmx2048m fr.uga.pddl4j.parser.Parser
and command line options (
$(parser) -o $(domain) -f $(problem)
-f are the switches expected by the parser.
The VAL toolset includes a parser
Parser[.exe]. It is the same parser used inside the POPF planner. Assuming you have the location of the executable included into your
%path% environment variable, simply specify set the name of the parser executable (
and use the default command line options (
$(parser) $(domain) $(problem)
To define a custom parser, you need to configure the pattern for finding problems in the parser standard output using the
pddlParser.problemPattern setting. The syntax for that setting is as follows:
pattern part is a regular expression pattern, which must use a
$(filePaths) macro as a placeholder for the parsed file names. The macro will get replaced by something like
order part is a comma-separated list of the capturing groups inside the the regular expression pattern. This tells the extension which of the capturing group captures which part of the problem. It is a 1-based index. The numbers in the list are expected in this order:
As an example, here are the two hardcoded custom patterns that the extension is already programmed to use (first corresponds to the POPF parser and the second to pddl4j):
/^($(filePaths))\\s*:\\s*line\\s*:\\s*(\\d*)\\s*:\\s*(Error|Warning)\\s*:\\s*(.*)$/gmi/1,3,2,0,4 /(error|warning) at line (\\d+), column (\\d+), file \\(($(filePaths))\\)\\s*:\\s*(.+)/ig/4,1,2,3,5
To learn more about how exactly such settings are handled by Visual Studio Code, read this page: https://code.visualstudio.com/docs/getstarted/settings.
If you have other parsers that are not listed here and want to share a pointer to them and recommended configuration, let me know (dolejsi_pddl at outlook dot com) and I will add the description here.