OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
SimulatorInterpreter Class Reference

#include <SimulatorInterpreter.hh>

Inheritance diagram for SimulatorInterpreter:
Inheritance graph
Collaboration diagram for SimulatorInterpreter:
Collaboration graph

Public Member Functions

 SimulatorInterpreter (int argc, char *argv[], SimulatorInterpreterContext &context, LineReader &reader)
 
virtual ~SimulatorInterpreter ()
 
bool isQuitCommandGiven () const
 
void setQuitCommandGiven ()
 
- Public Member Functions inherited from TclInterpreter
 TclInterpreter ()
 
virtual ~TclInterpreter ()
 
virtual void initialize (int argc, char *argv[], InterpreterContext *context, LineReader *reader)
 
virtual void setVariableToInterpreter (const std::string &name, const DataObject &value)
 
virtual DataObject variable (const std::string &name)
 
virtual bool interpret (const std::string &commandLine)
 
virtual void setResultToInterpreter (const DataObject &value)
 
virtual bool processScriptFile (const std::string &scriptFileName)
 
virtual InterpreterContextcontext () const
 
- Public Member Functions inherited from ScriptInterpreter
 ScriptInterpreter ()
 
virtual ~ScriptInterpreter ()
 
virtual void addCustomCommand (CustomCommand *command)
 
virtual void removeCustomCommand (const std::string &commandName)
 
virtual CustomCommandcustomCommand (const std::string &commandName)
 
virtual void setResult (DataObject *result)
 
virtual void setResult (const std::string &result)
 
virtual void setResult (int result)
 
virtual void setResult (double result)
 
virtual std::string result ()
 
virtual void setError (bool state)
 
virtual void setError (std::string errorMessage)
 
virtual bool error () const
 
virtual void setVariable (const std::string &interpreterVariableName, const std::string &value)
 
virtual void setVariable (const std::string &interpreterVariableName, int value)
 
virtual std::string variableStringValue (const std::string &interpreterVariableName)
 
virtual int variableIntegerValue (const std::string &interpreterVariableName)
 
virtual void finalize ()
 
virtual void setLineReader (LineReader *reader)
 
virtual LineReaderlineReader () const
 
std::vector< std::string > customCommandsSortedByName ()
 

Private Attributes

bool quitted_
 

Additional Inherited Members

- Static Public Member Functions inherited from TclInterpreter
static DataObject tclObjToDataObject (Tcl_Obj *object)
 
static Tcl_Obj * dataObjectToTclObj (const DataObject &object)
 
static int customCommandRedirector (ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
 
- Protected Member Functions inherited from TclInterpreter
virtual void addCustomCommandToInterpreter (const CustomCommand &command)
 
virtual void removeCustomCommandFromInterpreter (const CustomCommand &command)
 

Detailed Description

Implementation of the interpreter for the Simulator Control Language.

Uses TCL as the base interpreter class and adds the custom commands of the Simulator Control Language to it.

Definition at line 49 of file SimulatorInterpreter.hh.

Constructor & Destructor Documentation

◆ SimulatorInterpreter()

SimulatorInterpreter::SimulatorInterpreter ( int  argc,
char *  argv[],
SimulatorInterpreterContext context,
LineReader reader 
)

Constructor.

Initializes the interpreter. argc and argv variables are set to be visible as interpreter variables.

Parameters
argcThe number of command line arguments.
argvThe command line arguments.
contextThe context data for the interpreter.
readerLineReader used by the interpreter.

Definition at line 76 of file SimulatorInterpreter.cc.

80  : TclInterpreter(), quitted_(false) {
81 
82  initialize(argc, argv, &context, &reader);
83 
88  addCustomCommand(new QuitCommand("quit"));
89  addCustomCommand(new QuitCommand("exit"));
97  context.simulatorFrontend().isCompiledSimulation()));
112 
114 
115  context.simulatorFrontend().setOutputStream(lineReader()->outputStream());
116 }

References ScriptInterpreter::addCustomCommand(), TclInterpreter::context(), TclInterpreter::initialize(), and ScriptInterpreter::lineReader().

Here is the call graph for this function:

◆ ~SimulatorInterpreter()

SimulatorInterpreter::~SimulatorInterpreter ( )
virtual

Destructor.

Finalizes the internal structures of the interpreter.

Definition at line 123 of file SimulatorInterpreter.cc.

123  {
124  finalize();
125 }

References ScriptInterpreter::finalize().

Here is the call graph for this function:

Member Function Documentation

◆ isQuitCommandGiven()

bool SimulatorInterpreter::isQuitCommandGiven ( ) const

Returns true in case interpreter has received the quit command.

Parameters
Trueif quite command has been given.

Definition at line 134 of file SimulatorInterpreter.cc.

134  {
135  return quitted_;
136 }

References quitted_.

Referenced by SimulatorCLI::run(), and DesignSpaceExplorer::simulate().

◆ setQuitCommandGiven()

void SimulatorInterpreter::setQuitCommandGiven ( )

Sets the quit command to be given.

Definition at line 142 of file SimulatorInterpreter.cc.

142  {
143  quitted_ = true;
144 }

References quitted_.

Member Data Documentation

◆ quitted_

bool SimulatorInterpreter::quitted_
private

Definition at line 62 of file SimulatorInterpreter.hh.

Referenced by isQuitCommandGiven(), and setQuitCommandGiven().


The documentation for this class was generated from the following files:
WatchCommand
Definition: WatchCommand.hh:47
ScriptInterpreter::finalize
virtual void finalize()
Definition: ScriptInterpreter.cc:329
DisableBPCommand
Definition: DisableBPCommand.hh:47
MemDumpCommand
Definition: MemDumpCommand.hh:47
InfoCommand
Definition: InfoCommand.hh:48
TBPCommand
Definition: TBPCommand.hh:47
SimulatorInterpreter::quitted_
bool quitted_
Definition: SimulatorInterpreter.hh:62
SettingCommand
Definition: SettingCommand.hh:51
DisassembleCommand
Definition: DisassembleCommand.hh:48
MachCommand
Definition: MachCommand.hh:46
ConfCommand
Definition: ConfCommand.hh:46
RunCommand
Definition: RunCommand.hh:47
QuitCommand
Definition: QuitCommand.hh:46
NextiCommand
Definition: NextiCommand.hh:47
HelpCommand
Definition: HelpCommand.hh:45
IgnoreCommand
Definition: IgnoreCommand.hh:47
ConditionCommand
Definition: ConditionCommand.hh:47
BPCommand
Definition: BPCommand.hh:47
StepiCommand
Definition: StepiCommand.hh:47
ProgCommand
Definition: ProgCommand.hh:46
ResumeCommand
Definition: ResumeCommand.hh:47
DeleteBPCommand
Definition: DeleteBPCommand.hh:47
SymbolAddressCommand
Definition: SymbolAddressCommand.hh:48
BackTraceCommand
Definition: BackTraceCommand.hh:47
CommandsCommand
Definition: CommandsCommand.hh:47
TclInterpreter::TclInterpreter
TclInterpreter()
Definition: TclInterpreter.cc:49
TclInterpreter::context
virtual InterpreterContext & context() const
Definition: TclInterpreter.cc:298
TclInterpreter::initialize
virtual void initialize(int argc, char *argv[], InterpreterContext *context, LineReader *reader)
Definition: TclInterpreter.cc:72
KillCommand
Definition: KillCommand.hh:46
UntilCommand
Definition: UntilCommand.hh:47
EnableBPCommand
Definition: EnableBPCommand.hh:47
ScriptInterpreter::lineReader
virtual LineReader * lineReader() const
Definition: ScriptInterpreter.cc:367
ScriptInterpreter::addCustomCommand
virtual void addCustomCommand(CustomCommand *command)
Definition: ScriptInterpreter.cc:78
MemWriteCommand
Definition: MemWriteCommand.hh:48