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

#include <Interpreter.hh>

Public Member Functions

 Interpreter (const Interpreter &)=delete
 
Interpreteroperator= (const Interpreter &)=delete
 
 Interpreter ()
 
 ~Interpreter ()
 
void setOutput (InterpreterOutput *output_)
 
void init (const char *programName)
 
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 ()
 
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/2]

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

◆ Interpreter() [2/2]

openmsx::Interpreter::Interpreter ( )

◆ ~Interpreter()

openmsx::Interpreter::~Interpreter ( )

Definition at line 110 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 449 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 454 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 226 of file Interpreter.cc.

References zstring_view::c_str(), and TclObject.

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

◆ getCommandNames()

TclObject openmsx::Interpreter::getCommandNames ( )

Definition at line 207 of file Interpreter.cc.

References execute().

◆ hasCommand()

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

◆ init()

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

Definition at line 72 of file Interpreter.cc.

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

◆ isComplete()

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

Definition at line 212 of file Interpreter.cc.

References zstring_view::c_str().

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

◆ operator=()

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

◆ parse()

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

Definition at line 465 of file Interpreter.cc.

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

◆ poll()

void openmsx::Interpreter::poll ( )

Definition at line 459 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 27 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 259 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 268 of file Interpreter.cc.

Referenced by unregisterSetting().

◆ validCommand()

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

Definition at line 470 of file Interpreter.cc.

◆ validExpression()

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

Definition at line 478 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 74 of file Interpreter.hh.

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


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