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 InterpreterContext & context() const =0
virtual ~ScriptInterpreter()
virtual LineReader * lineReader() const
ScriptInterpreter(const ScriptInterpreter &)
Copying not allowed.
bool errorState_
Indicates whether we are in error state.
ScriptInterpreter & operator=(const ScriptInterpreter &)
Assignment not allowed.
virtual bool interpret(const std::string &commandLine)=0
virtual void setVariable(const std::string &interpreterVariableName, const std::string &value)
virtual bool processScriptFile(const std::string &scriptFileName)
virtual void setResultToInterpreter(const DataObject &value)=0
virtual int variableIntegerValue(const std::string &interpreterVariableName)
DataObject * result_
The latest interpreter result.
virtual void addCustomCommandToInterpreter(const CustomCommand &command)=0
std::map< std::string, CustomCommand * >::value_type ValType
val_type for map.
virtual void removeCustomCommandFromInterpreter(const CustomCommand &command)=0
virtual void removeCustomCommand(const std::string &commandName)
virtual std::string result()
virtual CustomCommand * customCommand(const std::string &commandName)
virtual void setLineReader(LineReader *reader)
std::map< std::string, CustomCommand * >::iterator MapIter
Iterator for map.
virtual void setError(bool state)
virtual void setVariableToInterpreter(const std::string &name, const DataObject &value)=0
virtual void initialize(int argc, char *argv[], InterpreterContext *context, LineReader *reader)=0
LineReader * reader_
LineReader for interpreter.
virtual std::string variableStringValue(const std::string &interpreterVariableName)
virtual void addCustomCommand(CustomCommand *command)
std::vector< std::string > customCommandsSortedByName()
virtual void setResult(DataObject *result)
std::map< std::string, CustomCommand * > commands_
Map containing all custom commands for interpreter.
virtual bool error() const
virtual DataObject variable(const std::string &name)=0
bool finalized_
True if Interpreter is finalized.