Graphite  Version 3
An experimental 3D geometry processing program
OGF::Interpreter Class Referenceabstract

Abstract base class for the GOM interpreter. More...

#include <OGF/gom/interpreter/interpreter.h>

Inheritance diagram for OGF::Interpreter:
OGF::Object GEO::Counted OGF::LuaInterpreter

Public Member Functions

 Interpreter ()
 Interpreter constructor.
 
virtual void reset ()=0
 Clears all variables, restarts from initial state.
 
virtual Any resolve (const std::string &id, bool quiet=true) const
 Finds a variable by id. More...
 
virtual void bind (const std::string &id, const Any &value)=0
 Binds a value to a variable. More...
 
virtual void list_names (std::vector< std::string > &names) const
 Lists the global variable names in this Interpreter.. More...
 
virtual Any eval (const std::string &expression, bool quiet=true) const
 Evaluates a string with an expression. More...
 
void inspect_meta_type (MetaType *meta_type)
 Outputs to the logger the methods, slots, properties of a given MetaClass. More...
 
void list_classes ()
 Outputs to the logger the names of all classes registered to GOM.
 
void bind_object (const std::string &id, Object *object)
 Binds an object to a variable. More...
 
Objectresolve_object (const std::string &id, bool quiet=true) const
 Finds an objet by id. More...
 
Objectresolve_object_by_global_id (const std::string &id, bool quiet=true) const
 Finds an objet by global id. More...
 
Objecteval_object (const std::string &expression, bool quiet=true) const
 Evaluates a string with an expression. More...
 
std::string eval_string (const std::string &expression, bool quiet=true) const
 Evaluates a string with an expression. More...
 
virtual MetaTyperesolve_meta_type (const std::string &type_name) const
 Finds a MetaType by name. More...
 
virtual bool bind_meta_type (MetaType *mtype)
 Binds a MetaType. More...
 
virtual Objectcreate (const ArgList &args)
 Creates an object. More...
 
virtual std::string get_environment_value (const std::string &name)
 Gets the value of a Geogram environment value. More...
 
virtual void set_environment_value (const std::string &name, const std::string &value)
 Sets the value of an environment variable. More...
 
virtual bool execute (const std::string &command, bool save_in_history=true, bool log=true)=0
 Executes a single line of code in the interpreted language. More...
 
virtual bool execute_file (const std::string &file_name)
 Executes commands from a given file. More...
 
virtual void out (const std::string &message, const std::string &tag="GOM")
 Displays a message in the terminal or console. More...
 
virtual void err (const std::string &message, const std::string &tag="GOM")
 Displays an error message in the terminal or console. More...
 
virtual void warn (const std::string &message, const std::string &tag="GOM")
 Displays a warning message in the terminal or console. More...
 
virtual void status (const std::string &message)
 Displays a status message. More...
 
virtual void append_dynamic_libraries_path (const std::string &path)
 Adds a path where dynamic libraries can be loaded. More...
 
virtual bool load_module (const std::string &module_name)
 Loads a plug-in. More...
 
virtual Connectionconnect (Request *from, Callable *to)
 Connects a signal to a callable. More...
 
Interpreterinterpreter (const std::string &language)
 Gets an interpreter for a given language. More...
 
Interpreterinterpreter_by_file_extension (const std::string &extension)
 Gets an interpreter for a given language by file extension. More...
 
void search (const std::string &needle, const std::string &path="")
 Displays the names of all objects that contain a substring. More...
 
const std::string & get_language () const
 Gets the name of the interpreted language. More...
 
const std::string & get_filename_extension () const
 Gets the filename extensions for the interpreted language. More...
 
Scopeget_globals () const
 Gets the Scope with the global variables. More...
 
Scopeget_meta_types () const
 Gets the Scope with the meta types. More...
 
virtual ~Interpreter ()
 Interpreter destructor.
 
Objectcreate (const std::string &classname, const ArgList &args)
 Creates an object from a classname and arguments list. More...
 
virtual void automatic_completion (const std::string &line, index_t startw, index_t endw, const std::string &cmpword, std::vector< std::string > &matches)
 Gets the possible automatic completions from a partial command entered by the user in the command line. More...
 
virtual void save_history (const std::string &file_name) const
 Saves the history to a file. More...
 
virtual void clear_history ()
 Clears the history.
 
void add_to_history (const std::string &command)
 Adds a command line to the history. More...
 
size_t history_size () const
 Gets the size of the history. More...
 
std::string history_line (unsigned int l) const
 Gets one of the commands in the history by line index. More...
 
- Public Member Functions inherited from OGF::Object
 Object (bool transient=false)
 Object constructor. More...
 
virtual ~Object ()
 Object destructor.
 
virtual MetaClassmeta_class () const
 Gets the meta class. More...
 
virtual void set_meta_class (MetaClass *mclass)
 Sets the meta class. More...
 
unsigned int id () const
 Gets the identifier of this object. More...
 
std::string string_id () const
 Gets the unique string identifier. More...
 
bool has_method (const std::string &method_name) const
 Tests whether a method is defined. More...
 
virtual bool invoke_method (const std::string &method_name, const ArgList &args, Any &ret_val)
 Invokes a method by method name and argument list, and gets the return value. More...
 
bool invoke_method (const std::string &method_name, const ArgList &args)
 Invokes a method by method name and argument list. More...
 
bool invoke_method (const std::string &method_name)
 Invokes a method by method name. More...
 
bool has_property (const std::string &prop_name) const
 Tests whether a property is defined. More...
 
virtual bool get_property (const std::string &prop_name, std::string &prop_value) const
 Gets a property. More...
 
virtual Connectionconnect_signal_to_slot (const std::string &signal_name, Object *to, const std::string &slot_name)
 Connects a signal with a slot of another object. More...
 
virtual void add_connection (Connection *connection)
 Adds a connection to this object. More...
 
virtual void remove_connection (Connection *connection)
 Removes a connection to this object. More...
 
virtual void get_element (index_t i, Any &value) const
 Gets an element by index. More...
 
virtual void set_element (index_t i, const Any &value)
 Sets an element by index. More...
 
bool get_signals_enabled () const
 Tests wheter signals are enabled. More...
 
void set_signals_enabled (bool value)
 Enables or disables signals. More...
 
bool get_slots_enabled () const
 Tests wheter slots are enabled. More...
 
void set_slots_enabled (bool value)
 Enables or disables slots. More...
 
MetaClassget_meta_class () const
 Gets the meta class. More...
 
std::string get_string_id () const
 Gets the unique string identifier. More...
 
virtual std::string get_doc () const
 Gets the documentation. More...
 
virtual Sign compare (const Object *other) const
 Compares this object with another one. More...
 
virtual bool is_a (const MetaType *type) const
 Tests whether this object inherits a given type. More...
 
void disconnect ()
 Removes all connections from signals of this objects. More...
 
void enable_signals ()
 Enables signals.
 
void disable_signals ()
 Disables signals.
 
void enable_slots ()
 Enables slots.
 
void disable_slots ()
 Disables slots.
 
void set_properties (const ArgList &args)
 Sets several properties in a single call. More...
 
virtual bool set_property (const std::string &name, const std::string &value)
 Sets an individual property. More...
 
void help () const
 Displays some help about this object. More...
 
virtual bool set_property (const std::string &name, const Any &value)
 Sets an individual property. More...
 
virtual bool get_property (const std::string &prop_name, Any &prop_value) const
 Gets a property. More...
 
- Public Member Functions inherited from GEO::Counted
void ref () const
 Increments the reference count. More...
 
void unref () const
 Decrements the reference count. More...
 
bool is_shared () const
 Check if the object is shared. More...
 
int nb_refs () const
 Gets the number of references that point to this object. More...
 

Static Public Member Functions

static Interpreterdefault_interpreter ()
 Gets the default interpreter. More...
 
static Interpreterinstance_by_language (const std::string &language)
 Gets the instance of the interpreter that interprets a given language. More...
 
static Interpreterinstance_by_file_extension (const std::string &extension)
 Gets the instance of the interpreter by file extension. More...
 
static void initialize (Interpreter *instance, const std::string &language, const std::string &extension)
 Initializes the interpreter subsystem, and defines the interpreter to be used. More...
 
static void terminate (const std::string &language, const std::string &extension)
 Terminates an interpreter and removes a given language from the list of interpreters. More...
 
static void terminate ()
 Terminates the interpreter subsystem, and deallocates the interpreter. More...
 
- Static Public Member Functions inherited from OGF::Object
static Objectid_to_object (unsigned int id)
 Gets an object from a unique object id. More...
 
- Static Public Member Functions inherited from GEO::Counted
static void ref (const Counted *counted)
 Increments the reference count. More...
 
static void unref (const Counted *counted)
 Decrements the reference count. More...
 

Public Attributes

 __pad0__: void inspect(Object* object)
 
 __pad1__: virtual std::string get_history() const
 
- Public Attributes inherited from OGF::Object
 __pad0__: virtual index_t get_nb_elements() const
 
 __pad1__: bool equals(const Object* other) const
 

Protected Member Functions

void filename_completion (const std::string &prefix, std::vector< std::string > &completions)
 Gets all possible filenames starting from a certain prefix. More...
 
void filter_completion_candidates (const std::string &prefix, std::vector< std::string > &completions)
 Keeps in a list of completion only those that start with a given prefix. More...
 
virtual void get_keys (const std::string &context, std::vector< std::string > &keys)
 Gets all possible keys in a certain context. More...
 
virtual void get_keys (Any &context, std::vector< std::string > &keys)
 Gets all possible keys in a certain context. More...
 
void inspect_method (Object *object, MetaMethod *mmethod)
 Displays the prototype of a given method of an object. More...
 
void inspect_meta_class (Object *object, MetaClass *mclass)
 Displays a meta class. More...
 
void inspect_meta_method (MetaMethod *mmethod)
 Outputs to the logger the signature of a method. More...
 
void set_language (const std::string &language)
 Sets the name of the interpreted language. More...
 
void set_filename_extension (const std::string &extension)
 Sets the filename extensions for the interpreted language. More...
 
virtual std::string stringify (const std::string &str) const
 Transforms a string into a string constant in the interpreted language. More...
 
virtual std::string name_value_pair_call (const std::string &args) const
 Transforms a list of name-value pairs arguments. More...
 
- Protected Member Functions inherited from OGF::Object
virtual bool emit_signal (const std::string &signal_name, const ArgList &args, bool called_from_slot=false)
 Emits a signal and calls the slots it is connected to. More...
 
- Protected Member Functions inherited from GEO::Counted
 Counted ()
 Creates a reference counted object. More...
 
virtual ~Counted ()
 Destroys a reference counted object. More...
 

Protected Attributes

std::vector< std::string > history_
 
std::string language_
 
std::string extension_
 

Detailed Description

Abstract base class for the GOM interpreter.

It is completely independent of the used interpreted language. It is implemented in the gel_lua (and upcoming gel_python libraries).

Definition at line 222 of file interpreter.h.

Member Function Documentation

◆ add_to_history()

void OGF::Interpreter::add_to_history ( const std::string &  command)

Adds a command line to the history.

Parameters
[in]commandthe command line to be added to the history

◆ append_dynamic_libraries_path()

virtual void OGF::Interpreter::append_dynamic_libraries_path ( const std::string &  path)
virtual

Adds a path where dynamic libraries can be loaded.

Under Windows, adds the path to the PATH environment variable. Under other OSes, does nothing.

Parameters
[in]paththe path to be added.

◆ automatic_completion()

virtual void OGF::Interpreter::automatic_completion ( const std::string &  line,
index_t  startw,
index_t  endw,
const std::string &  cmpword,
std::vector< std::string > &  matches 
)
virtual

Gets the possible automatic completions from a partial command entered by the user in the command line.

Parameters
[in]linethe command line to be completed.
[in]startw,endwthe position of the word to be completed.
[in]cmpwordthe word to be completed
[out]matchesthe possible completions.

◆ bind()

virtual void OGF::Interpreter::bind ( const std::string &  id,
const Any value 
)
pure virtual

Binds a value to a variable.

The variable is then visible from the interpreter in the global scope.

Parameters
[in]idthe name of the variable.
[in]valuethe value of the variable to be bound.

Implemented in OGF::LuaInterpreter.

◆ bind_meta_type()

virtual bool OGF::Interpreter::bind_meta_type ( MetaType mtype)
virtual

Binds a MetaType.

Parameters
[in]mtypethe MetaType to be bound
Return values
trueif the MetaType could be bound
falseotherwise. This can happen if a MetaType with the same name was already bound

◆ bind_object()

void OGF::Interpreter::bind_object ( const std::string &  id,
Object object 
)

Binds an object to a variable.

The object is then visible from the interpreter in the global scope.

Parameters
[in]idthe name of the variable.
[in]objectthe object to be bound

◆ connect()

virtual Connection* OGF::Interpreter::connect ( Request from,
Callable to 
)
virtual

Connects a signal to a callable.

Parameters
[in]froma pointer to a Request with a reference to the source object and the signal.
[out]toa pointer to a Callable.
Returns
a pointer to the new connection, or nil if the connection could not be created.

◆ create() [1/2]

virtual Object* OGF::Interpreter::create ( const ArgList args)
virtual

Creates an object.

Parameters
[in]argsthe ArgList, with at least an argument classname. The other arguments are passed to the constructor.
Returns
a pointer to the created object or nil if an error was encountered.

◆ create() [2/2]

Object* OGF::Interpreter::create ( const std::string &  classname,
const ArgList args 
)

Creates an object from a classname and arguments list.

Parameters
[in]classnamethe classname, with the 'OGF::' scope.
[in]argsthe arguments list.
Returns
a pointer to the created object or nil on error.

◆ default_interpreter()

static Interpreter* OGF::Interpreter::default_interpreter ( )
inlinestatic

Gets the default interpreter.

Returns
a pointer to the first created interpreter.

Definition at line 519 of file interpreter.h.

◆ err()

virtual void OGF::Interpreter::err ( const std::string &  message,
const std::string &  tag = "GOM" 
)
virtual

Displays an error message in the terminal or console.

Parameters
[in]messagethe message to be displayed.
[in]tagan optional tag.

◆ eval()

virtual Any OGF::Interpreter::eval ( const std::string &  expression,
bool  quiet = true 
) const
virtual

Evaluates a string with an expression.

Parameters
[in]expressiona string with an expression.
[in]quietif true, do not display error messages.
Returns
an Any with the computed value.

Reimplemented in OGF::LuaInterpreter.

◆ eval_object()

Object* OGF::Interpreter::eval_object ( const std::string &  expression,
bool  quiet = true 
) const

Evaluates a string with an expression.

Parameters
[in]expressiona string with an expression.
[in]quietif true, do not display error messages.
Returns
a pointer to the object with the result of the expression, or nil if the result is not an object.

◆ eval_string()

std::string OGF::Interpreter::eval_string ( const std::string &  expression,
bool  quiet = true 
) const

Evaluates a string with an expression.

Parameters
[in]expressiona string with an expression.
[in]quietif true, do not display error messages.
Returns
the result of the expression converted to a string.

◆ execute()

virtual bool OGF::Interpreter::execute ( const std::string &  command,
bool  save_in_history = true,
bool  log = true 
)
pure virtual

Executes a single line of code in the interpreted language.

Parameters
[in]commandthe line of code
[in]save_in_historytrue if the command should be saved in the history
[in]logtrue if the command should be displayed to the logging console
Return values
trueif the command could be sucessfully executed
falseotherwise

Implemented in OGF::LuaInterpreter.

◆ execute_file()

virtual bool OGF::Interpreter::execute_file ( const std::string &  file_name)
virtual

Executes commands from a given file.

Parameters
[in]file_namename of the file that contains the commands to be executed
Return values
trueif the file could be sucessfully executed
falseotherwise

Reimplemented in OGF::LuaInterpreter.

◆ filename_completion()

void OGF::Interpreter::filename_completion ( const std::string &  prefix,
std::vector< std::string > &  completions 
)
protected

Gets all possible filenames starting from a certain prefix.

Parameters
[in]prefixeither en empty string, or an escaped string with the beginning of a filename.
[out]completionsall the filenames that match the input prefix.

◆ filter_completion_candidates()

void OGF::Interpreter::filter_completion_candidates ( const std::string &  prefix,
std::vector< std::string > &  completions 
)
protected

Keeps in a list of completion only those that start with a given prefix.

Parameters
[in]prefixthe prefix
[in,out]completionsthe vector of strings to be filtered. On exit, only those that start with prefix are kept.

◆ get_environment_value()

virtual std::string OGF::Interpreter::get_environment_value ( const std::string &  name)
virtual

Gets the value of a Geogram environment value.

Parameters
[in]namename of the variable
Returns
the value of the variable
See also
GEO::Environment

◆ get_filename_extension()

const std::string& OGF::Interpreter::get_filename_extension ( ) const
inline

Gets the filename extensions for the interpreted language.

Returns
the extension without the dot ("lua" for Lua, "py" for Python).

Definition at line 544 of file interpreter.h.

◆ get_globals()

Scope* OGF::Interpreter::get_globals ( ) const
inline

Gets the Scope with the global variables.

Returns
a pointer to the Scope.

Definition at line 552 of file interpreter.h.

◆ get_keys() [1/2]

virtual void OGF::Interpreter::get_keys ( Any context,
std::vector< std::string > &  keys 
)
protectedvirtual

Gets all possible keys in a certain context.

Parameters
[in]contextthe name of a variable.
[out]keysthe name of all the data members and function members of the variable.

◆ get_keys() [2/2]

virtual void OGF::Interpreter::get_keys ( const std::string &  context,
std::vector< std::string > &  keys 
)
protectedvirtual

Gets all possible keys in a certain context.

Parameters
[in]contextthe name of a variable.
[out]keysthe name of all the data members and function members of the variable.

Reimplemented in OGF::LuaInterpreter.

◆ get_language()

const std::string& OGF::Interpreter::get_language ( ) const
inline

Gets the name of the interpreted language.

Returns
The name of the interpreted language ("Lua" for Lua, "Python" for Python ...).

Definition at line 535 of file interpreter.h.

◆ get_meta_types()

Scope* OGF::Interpreter::get_meta_types ( ) const
inline

Gets the Scope with the meta types.

Returns
a pointer to the Scope

Definition at line 560 of file interpreter.h.

◆ history_line()

std::string OGF::Interpreter::history_line ( unsigned int  l) const
inline

Gets one of the commands in the history by line index.

Parameters
[in]lthe index of the line in the history
Returns
the l th command in the history, as a string

Definition at line 678 of file interpreter.h.

◆ history_size()

size_t OGF::Interpreter::history_size ( ) const
inline

Gets the size of the history.

Returns
the number of command lines in the history.

Definition at line 669 of file interpreter.h.

◆ initialize()

static void OGF::Interpreter::initialize ( Interpreter instance,
const std::string &  language,
const std::string &  extension 
)
static

Initializes the interpreter subsystem, and defines the interpreter to be used.

This function is called at Graphite startup by the library that creates the interpreter (gel_python2 or gel_python3). Client code is not supposed to call this function directly.

Parameters
[in]instancethe interpreter to be used.
[in]languagethe name of the interpreted language.
[in]extensionfile extension for the interpreted language, without the point.

◆ inspect_meta_class()

void OGF::Interpreter::inspect_meta_class ( Object object,
MetaClass mclass 
)
protected

Displays a meta class.

The meta class is displayed by the Logger.

Parameters
[in]objectthe object.
[in]mclassthe meta class.

◆ inspect_meta_method()

void OGF::Interpreter::inspect_meta_method ( MetaMethod mmethod)
protected

Outputs to the logger the signature of a method.

Parameters
[in]mmethoda pointer to the MetaMethod.

◆ inspect_meta_type()

void OGF::Interpreter::inspect_meta_type ( MetaType meta_type)

Outputs to the logger the methods, slots, properties of a given MetaClass.

Parameters
[in]meta_typea pointer to the MetaType.

◆ inspect_method()

void OGF::Interpreter::inspect_method ( Object object,
MetaMethod mmethod 
)
protected

Displays the prototype of a given method of an object.

The prototype is displayed by the Logger.

Parameters
[in]objectthe object
[in]mmethodthe method

◆ instance_by_file_extension()

static Interpreter* OGF::Interpreter::instance_by_file_extension ( const std::string &  extension)
static

Gets the instance of the interpreter by file extension.

Parameters
[in]extensionfile extension without the dot.
Returns
a pointer to the instance of the interpreter.

◆ instance_by_language()

static Interpreter* OGF::Interpreter::instance_by_language ( const std::string &  language)
static

Gets the instance of the interpreter that interprets a given language.

Parameters
[in]languagethe interpreted language.
Returns
a pointer to the instance of the interpreter.

◆ interpreter()

Interpreter* OGF::Interpreter::interpreter ( const std::string &  language)
inline

Gets an interpreter for a given language.

Parameters
[in]language"Lua" for lua, "Python" for python...

Definition at line 495 of file interpreter.h.

◆ interpreter_by_file_extension()

Interpreter* OGF::Interpreter::interpreter_by_file_extension ( const std::string &  extension)
inline

Gets an interpreter for a given language by file extension.

Parameters
[in]extension"lua" for lua, "py" for python...

Definition at line 503 of file interpreter.h.

◆ list_names()

virtual void OGF::Interpreter::list_names ( std::vector< std::string > &  names) const
virtual

Lists the global variable names in this Interpreter..

Parameters
[out]namesa vector of strings with the names of the global variables.

Reimplemented in OGF::LuaInterpreter.

◆ load_module()

virtual bool OGF::Interpreter::load_module ( const std::string &  module_name)
virtual

Loads a plug-in.

Parameters
[in]module_namethe name of the plug-in.
Return values
trueif the module was successfully loaded.
falseotherwise.

◆ name_value_pair_call()

virtual std::string OGF::Interpreter::name_value_pair_call ( const std::string &  args) const
protectedvirtual

Transforms a list of name-value pairs arguments.

Some interpreters (e.g., Lua) need special syntax for name-value pair calls. Default implementation returns the input string.

Parameters
[in]argsa set of comma-separated name-value pairs.
Returns
the input args in a form that can be understood as name- value pairs by the target language.

Reimplemented in OGF::LuaInterpreter.

◆ out()

virtual void OGF::Interpreter::out ( const std::string &  message,
const std::string &  tag = "GOM" 
)
virtual

Displays a message in the terminal or console.

Parameters
[in]messagethe message to be displayed.
[in]tagan optional tag.

◆ resolve()

virtual Any OGF::Interpreter::resolve ( const std::string &  id,
bool  quiet = true 
) const
virtual

Finds a variable by id.

Parameters
[in]idthe id, can be either a previously bound id defined in the interpreter, or an id of the form "@ClassName::#instance", where ClassName is the name of a class registered to GOM, and instance an integer that refers to a specific instance of that class (the latter form of ids is used by the VCR system for recording events received by the GUI widgets).
[in]quietif true, do not display error messages.
Returns
an any with the variable attached to id in the current Scope, or nil if there is no such a variable.

Reimplemented in OGF::LuaInterpreter.

◆ resolve_meta_type()

virtual MetaType* OGF::Interpreter::resolve_meta_type ( const std::string &  type_name) const
virtual

Finds a MetaType by name.

Parameters
[in]type_namethe name of the MetaType (with 'OGF::' scope if need be).
Returns
a pointer to the MetaType or nil if there where no such MetaType.

◆ resolve_object()

Object* OGF::Interpreter::resolve_object ( const std::string &  id,
bool  quiet = true 
) const

Finds an objet by id.

Parameters
[in]idthe id, can be either a previously bound id defined in the interpreter, or an id of the form "@ClassName::#instance", where ClassName is the name of a class registered to GOM, and instance an integer that refers to a specific instance of that class.
[in]quietif true, do not display error messages.
Returns
a pointer to the Object attached to id in the current Scope, or nil if there is no such a variable.

◆ resolve_object_by_global_id()

Object* OGF::Interpreter::resolve_object_by_global_id ( const std::string &  id,
bool  quiet = true 
) const

Finds an objet by global id.

Parameters
[in]idthe id in the form "@ClassName::#instance", where ClassName is the name of a class registered to GOM, and instance an integer that refers to a specific instance of that class.
[in]quietif true, do not display error messages.
Returns
a pointer to the Object attached to id in the current Scope, or nil if there is no such a variable.

◆ save_history()

virtual void OGF::Interpreter::save_history ( const std::string &  file_name) const
virtual

Saves the history to a file.

Parameters
[in]file_namename of the file where the history should be saved.

◆ search()

void OGF::Interpreter::search ( const std::string &  needle,
const std::string &  path = "" 
)
virtual

Displays the names of all objects that contain a substring.

Parameters
[in]needlethe substring
[in]paththe path to be prepended to the names

Reimplemented from OGF::Object.

◆ set_environment_value()

virtual void OGF::Interpreter::set_environment_value ( const std::string &  name,
const std::string &  value 
)
virtual

Sets the value of an environment variable.

Parameters
[in]namename of the variable
[in]valuenew value of the environment variable

◆ set_filename_extension()

void OGF::Interpreter::set_filename_extension ( const std::string &  extension)
inlineprotected

Sets the filename extensions for the interpreted language.

Parameters
[in]extensionthe extension.

Definition at line 762 of file interpreter.h.

◆ set_language()

void OGF::Interpreter::set_language ( const std::string &  language)
inlineprotected

Sets the name of the interpreted language.

Parameters
[in]languagethe name of the interpreted language.

Definition at line 754 of file interpreter.h.

◆ status()

virtual void OGF::Interpreter::status ( const std::string &  message)
virtual

Displays a status message.

Parameters
[in]messagethe message.

◆ stringify()

virtual std::string OGF::Interpreter::stringify ( const std::string &  str) const
protectedvirtual

Transforms a string into a string constant in the interpreted language.

Default implementation adds single quotes.

Parameters
[in]strthe string to be transformed.
Returns
the string with quotes.

◆ terminate() [1/2]

static void OGF::Interpreter::terminate ( )
static

Terminates the interpreter subsystem, and deallocates the interpreter.

This function is called at Graphite shutdown. Client code is not supposed to call this function directly.

◆ terminate() [2/2]

static void OGF::Interpreter::terminate ( const std::string &  language,
const std::string &  extension 
)
static

Terminates an interpreter and removes a given language from the list of interpreters.

Parameters
[in]languagethe name of the language to be terminated.
[in]extensionfile extension for the interpreted language, without the point.

◆ warn()

virtual void OGF::Interpreter::warn ( const std::string &  message,
const std::string &  tag = "GOM" 
)
virtual

Displays a warning message in the terminal or console.

Parameters
[in]messagethe message to be displayed.
[in]tagan optional tag.

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