Orocos Real-Time Toolkit  2.9.0
Parser.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  tag: Peter Soetens Mon Jan 19 14:11:21 CET 2004 Parser.hpp
3 
4  Parser.hpp - description
5  -------------------
6  begin : Mon January 19 2004
7  copyright : (C) 2004 Peter Soetens
8  email : peter.soetens@mech.kuleuven.ac.be
9 
10  ***************************************************************************
11  * This library is free software; you can redistribute it and/or *
12  * modify it under the terms of the GNU General Public *
13  * License as published by the Free Software Foundation; *
14  * version 2 of the License. *
15  * *
16  * As a special exception, you may use this file as part of a free *
17  * software library without restriction. Specifically, if other files *
18  * instantiate templates or use macros or inline functions from this *
19  * file, or you compile this file and link it with other files to *
20  * produce an executable, this file does not by itself cause the *
21  * resulting executable to be covered by the GNU General Public *
22  * License. This exception does not however invalidate any other *
23  * reasons why the executable file might be covered by the GNU General *
24  * Public License. *
25  * *
26  * This library is distributed in the hope that it will be useful, *
27  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
28  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
29  * Lesser General Public License for more details. *
30  * *
31  * You should have received a copy of the GNU General Public *
32  * License along with this library; if not, write to the Free Software *
33  * Foundation, Inc., 59 Temple Place, *
34  * Suite 330, Boston, MA 02111-1307 USA *
35  * *
36  ***************************************************************************/
37 
38 #ifndef EXECUTION_PARSER_HPP
39 #define EXECUTION_PARSER_HPP
40 
41 #include <iosfwd>
42 #include <utility>
43 #include <map>
44 #include <string>
45 #include <istream>
46 #include <vector>
47 #include "parse_exception.hpp"
48 #include "../internal/DataSource.hpp"
49 #include "ProgramInterface.hpp"
50 #include "ParsedStateMachine.hpp"
51 #include "rtt-scripting-config.h"
52 #include "rtt-scripting-fwd.hpp"
53 
54 namespace RTT
55 { namespace scripting {
56 
66  {
67  ExecutionEngine* mcaller;
68  public:
75  Parser(ExecutionEngine* caller = 0);
76 
84  void runScript(std::string const& code, TaskContext* mowner, ScriptingService* service, std::string const& filename );
85 
89  typedef std::vector< ProgramInterfacePtr > ParsedFunctions;
90 
96  ParsedFunctions parseFunction( const std::string& s, TaskContext*, const std::string& filename = "stream" );
97 
101  typedef std::vector< ProgramInterfacePtr > ParsedPrograms;
102 
108  ParsedPrograms parseProgram( const std::string& s, TaskContext*, const std::string& filename = "stream" );
109 
113  typedef std::vector< ParsedStateMachinePtr > ParsedStateMachines;
114 
120  ParsedStateMachines parseStateMachine(const std::string& s, TaskContext*, const std::string& filename = "stream" );
121 
128  ConditionInterface* parseCondition(const std::string& s, TaskContext* );
129 
136  parseExpression( const std::string&s, TaskContext* );
137 
144  parseValueChange( const std::string&s, TaskContext* );
145 
153  parseValueStatement( const std::string&s, TaskContext* );
154  };
155 }}
156 #endif
This interface represents the concept of a condition which can be evaluated and return true or false...
#define RTT_SCRIPTING_API
An execution engine serialises (executes one after the other) the execution of all commands...
std::vector< ProgramInterfacePtr > ParsedPrograms
List of parsed programs.
Definition: Parser.hpp:101
This class is the public interface to the Orocos Program Parser Framework.
Definition: Parser.hpp:65
std::vector< ProgramInterfacePtr > ParsedFunctions
List of parsed functions.
Definition: Parser.hpp:89
The TaskContext is the C++ representation of an Orocos component.
Definition: TaskContext.hpp:93
std::vector< ParsedStateMachinePtr > ParsedStateMachines
List of parsed State Machines.
Definition: Parser.hpp:113
boost::intrusive_ptr< DataSourceBase > shared_ptr
Use this type to store a pointer to a DataSourceBase.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:52
This interface allows to load program scripts and state machines and allows execution of code...