Go to the documentation of this file.
35 #ifndef TTA_SCRIPT_INTERPRETER_HH
36 #define TTA_SCRIPT_INTERPRETER_HH
68 virtual std::string
result();
71 virtual void setError(std::string errorMessage);
72 virtual bool error()
const;
75 const std::string& interpreterVariableName,
76 const std::string& value);
78 const std::string& interpreterVariableName,
82 const std::string& interpreterVariableName);
84 const std::string& interpreterVariableName);
102 const std::string& name,
const DataObject& value) = 0;
104 virtual bool interpret(
const std::string& commandLine) = 0;
117 typedef std::map<std::string, CustomCommand*>::iterator
MapIter;
119 typedef std::map<std::string, CustomCommand*>::value_type
ValType;
virtual std::string result()
virtual DataObject variable(const std::string &name)=0
virtual int variableIntegerValue(const std::string &interpreterVariableName)
std::map< std::string, CustomCommand * > commands_
Map containing all custom commands for interpreter.
virtual void initialize(int argc, char *argv[], InterpreterContext *context, LineReader *reader)=0
LineReader * reader_
LineReader for interpreter.
virtual void setVariableToInterpreter(const std::string &name, const DataObject &value)=0
bool errorState_
Indicates whether we are in error state.
ScriptInterpreter & operator=(const ScriptInterpreter &)
Assignment not allowed.
DataObject * result_
The latest interpreter result.
virtual void addCustomCommandToInterpreter(const CustomCommand &command)=0
virtual ~ScriptInterpreter()
virtual void setLineReader(LineReader *reader)
virtual bool processScriptFile(const std::string &scriptFileName)
std::map< std::string, CustomCommand * >::value_type ValType
val_type for map.
std::vector< std::string > customCommandsSortedByName()
virtual void removeCustomCommand(const std::string &commandName)
virtual bool error() const
virtual void removeCustomCommandFromInterpreter(const CustomCommand &command)=0
virtual bool interpret(const std::string &commandLine)=0
virtual CustomCommand * customCommand(const std::string &commandName)
virtual void setResult(DataObject *result)
std::map< std::string, CustomCommand * >::iterator MapIter
Iterator for map.
virtual void setVariable(const std::string &interpreterVariableName, const std::string &value)
virtual void setError(bool state)
virtual std::string variableStringValue(const std::string &interpreterVariableName)
virtual LineReader * lineReader() const
virtual void setResultToInterpreter(const DataObject &value)=0
virtual InterpreterContext & context() const =0
virtual void addCustomCommand(CustomCommand *command)
bool finalized_
True if Interpreter is finalized.