Fawkes API  Fawkes Development Version
pddl_parser.h
1 
2 /***************************************************************************
3  * pddl_parser.h
4  *
5  * Created: Fri 19 May 2017 11:10:30 CEST
6  * Copyright 2017 Matthias Loebach
7  ****************************************************************************/
8 
9 /* This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Library General Public License for more details.
18  *
19  * Read the full text in the LICENSE.GPL file in the doc directory.
20  */
21 
22 #ifndef PLUGINS_PDDL_PARSER_H_
23 #define PLUGINS_PDDL_PARSER_H_
24 
25 #include "pddl_grammar.h"
26 
27 #include <core/exception.h>
28 
29 #include <string>
30 
31 namespace pddl_parser {
32 
33 class PddlParser
34 {
35 public:
36  static Domain parseDomain(const std::string pddl_domain);
37  static Problem parseProblem(const std::string pddl_problem);
38 
39 private:
40 };
41 
42 /** @class PddlParserException <pddl_parser/pddl_parser.h>
43  * Exception thrown by the parser if an error occurs during parsing.
44  */
45 
47 {
48 public:
49  /** Constructor.
50  * @param msg A message describing the error.
51  */
52  PddlParserException(const char *msg) : fawkes::Exception(msg)
53  {
54  }
55  /** Constructor with a string message.
56  * This wraps the constructor with a char* message for usage with std::string.
57  * @param msg A message describing the error.
58  */
59  PddlParserException(const std::string &msg) : fawkes::Exception(msg.c_str())
60  {
61  }
62 };
63 
64 } // namespace pddl_parser
65 
66 #endif
pddl_parser::Domain
Definition: pddl_ast.h:102
pddl_parser::Problem
Definition: pddl_ast.h:123
fawkes::Exception::Exception
Exception()
Constructor for subclasses.
Definition: exception.cpp:252
pddl_parser::PddlParser::parseDomain
static Domain parseDomain(const std::string pddl_domain)
Parse the PDDL domain.
Definition: pddl_parser.cpp:51
pddl_parser::PddlParserException::PddlParserException
PddlParserException(const char *msg)
Constructor.
Definition: pddl_parser.h:55
fawkes
pddl_parser::PddlParser::parseProblem
static Problem parseProblem(const std::string pddl_problem)
Parse the PDDL problem.
Definition: pddl_parser.cpp:78
pddl_parser::PddlParserException
Definition: pddl_parser.h:49
fawkes::Exception
Definition: exception.h:39