openMSX
Public Member Functions | Friends | List of all members
openmsx::Interpreter Class Reference

#include <Interpreter.hh>

Public Member Functions

 Interpreter ()
 
 Interpreter (const Interpreter &)=delete
 
 Interpreter (Interpreter &&)=delete
 
Interpreteroperator= (const Interpreter &)=delete
 
Interpreteroperator= (Interpreter &&)=delete
 
 ~Interpreter ()
 
void setOutput (InterpreterOutput *output_)
 
void init (const char *programName) const
 
bool hasCommand (zstring_view name) const
 
void registerCommand (zstring_view name, Command &command)
 
void unregisterCommand (Command &command)
 
TclObject getCommandNames ()
 
bool isComplete (zstring_view command) const
 
TclObject execute (zstring_view command)
 
TclObject executeFile (zstring_view filename)
 
void setVariable (const TclObject &name, const TclObject &value)
 
void setVariable (const TclObject &arrayName, const TclObject &arrayIndex, const TclObject &value)
 
void unsetVariable (const char *name)
 
void registerSetting (BaseSetting &variable)
 
void unregisterSetting (BaseSetting &variable)
 
void createNamespace (const std::string &name)
 Create the global namespace with given name.
 
void deleteNamespace (const std::string &name)
 Delete the global namespace with given name.
 
TclParser parse (std::string_view command)
 
bool validCommand (std::string_view command)
 
bool validExpression (std::string_view expression)
 
void poll () const
 
void wrongNumArgs (unsigned argc, std::span< const TclObject > tokens, const char *message)
 

Friends

class TclObject
 

Detailed Description

Definition at line 18 of file Interpreter.hh.

Constructor & Destructor Documentation

◆ Interpreter() [1/3]

openmsx::Interpreter::Interpreter ( )

◆ Interpreter() [2/3]

openmsx::Interpreter::Interpreter ( const Interpreter )
delete

◆ Interpreter() [3/3]

openmsx::Interpreter::Interpreter ( Interpreter &&  )
delete

◆ ~Interpreter()

openmsx::Interpreter::~Interpreter ( )

Definition at line 114 of file Interpreter.cc.

References openmsx::MSXCPUInterface::cleanup().

Member Function Documentation

◆ createNamespace()

void openmsx::Interpreter::createNamespace ( const std::string &  name)

Create the global namespace with given name.

Parameters
nameName of the namespace, should not include '::' prefix.

Definition at line 451 of file Interpreter.cc.

References execute(), and tmpStrCat().

Referenced by openmsx::MSXCommandController::MSXCommandController().

◆ deleteNamespace()

void openmsx::Interpreter::deleteNamespace ( const std::string &  name)

Delete the global namespace with given name.

Parameters
nameName of the namespace, should not include '::' prefix.

Definition at line 456 of file Interpreter.cc.

References execute(), and tmpStrCat().

Referenced by openmsx::MSXCommandController::~MSXCommandController().

◆ execute()

TclObject openmsx::Interpreter::execute ( zstring_view  command)

◆ executeFile()

TclObject openmsx::Interpreter::executeFile ( zstring_view  filename)

Definition at line 228 of file Interpreter.cc.

References zstring_view::c_str(), and TclObject.

Referenced by openmsx::GlobalCommandController::source().

◆ getCommandNames()

TclObject openmsx::Interpreter::getCommandNames ( )

Definition at line 210 of file Interpreter.cc.

References execute().

◆ hasCommand()

bool openmsx::Interpreter::hasCommand ( zstring_view  name) const

◆ init()

void openmsx::Interpreter::init ( const char *  programName) const

Definition at line 76 of file Interpreter.cc.

Referenced by openmsx::CommandLineParser::parse().

◆ isComplete()

bool openmsx::Interpreter::isComplete ( zstring_view  command) const

Definition at line 215 of file Interpreter.cc.

References zstring_view::c_str().

Referenced by openmsx::GlobalCommandController::isComplete().

◆ operator=() [1/2]

Interpreter & openmsx::Interpreter::operator= ( const Interpreter )
delete

◆ operator=() [2/2]

Interpreter & openmsx::Interpreter::operator= ( Interpreter &&  )
delete

◆ parse()

TclParser openmsx::Interpreter::parse ( std::string_view  command)

Definition at line 467 of file Interpreter.cc.

Referenced by openmsx::GlobalCommandController::tabCompletion().

◆ poll()

void openmsx::Interpreter::poll ( ) const

Definition at line 461 of file Interpreter.cc.

Referenced by openmsx::EventDistributor::deliverEvents().

◆ registerCommand()

void openmsx::Interpreter::registerCommand ( zstring_view  name,
Command command 
)

◆ registerSetting()

void openmsx::Interpreter::registerSetting ( BaseSetting variable)

◆ setOutput()

void openmsx::Interpreter::setOutput ( InterpreterOutput output_)
inline

Definition at line 28 of file Interpreter.hh.

Referenced by openmsx::ImGuiConsole::ImGuiConsole().

◆ setVariable() [1/2]

void openmsx::Interpreter::setVariable ( const TclObject arrayName,
const TclObject arrayIndex,
const TclObject value 
)

Definition at line 260 of file Interpreter.cc.

References openmsx::TclObject::getTclObjectNonConst().

◆ setVariable() [2/2]

void openmsx::Interpreter::setVariable ( const TclObject name,
const TclObject value 
)

◆ unregisterCommand()

void openmsx::Interpreter::unregisterCommand ( Command command)

◆ unregisterSetting()

void openmsx::Interpreter::unregisterSetting ( BaseSetting variable)

◆ unsetVariable()

void openmsx::Interpreter::unsetVariable ( const char *  name)

Definition at line 269 of file Interpreter.cc.

Referenced by unregisterSetting().

◆ validCommand()

bool openmsx::Interpreter::validCommand ( std::string_view  command)

Definition at line 472 of file Interpreter.cc.

◆ validExpression()

bool openmsx::Interpreter::validExpression ( std::string_view  expression)

Definition at line 480 of file Interpreter.cc.

◆ wrongNumArgs()

void openmsx::Interpreter::wrongNumArgs ( unsigned  argc,
std::span< const TclObject tokens,
const char *  message 
)

Friends And Related Symbol Documentation

◆ TclObject

friend class TclObject
friend

Definition at line 75 of file Interpreter.hh.

Referenced by execute(), executeFile(), Interpreter(), and registerSetting().


The documentation for this class was generated from the following files: