|
Leonardus
|
The context of execution. More...
#include <context.h>
Inheritance diagram for Context:
Collaboration diagram for Context:Public Member Functions | |
| Context (const std::string &p_inf_name) | |
| Ctor. | |
| Context (const Context &)=delete | |
| Context (Context &&)=delete | |
| Context & | operator= (const Context &)=delete |
| Context & | operator= (Context &&)=delete |
| virtual | ~Context () |
| Dtor. | |
| SOK & | opst () |
| Access to the operand stack. | |
| SOK & | exst () |
| Access to the execution stack. | |
| SOK & | dist () |
| Access to the dictionary stack. | |
| size_t | getProclevel () const |
| Getter for procedure level. | |
| size_t | getLoadlevel () const |
| Getter for load level. | |
| size_t | getArraynesting () const |
| Getter for nesting level. | |
| size_t | getMaxloadlevel () const |
| Getter for maximum load level. | |
| bool | getInterpreterLoop () const |
| Getter for interpreter loop control variable run_. | |
| void | stopInterpreterLoop () |
| Sets run_ to false. | |
| void | setSnapLeonline (const std::string &p_line) |
| Setter for snapLeonline_. | |
| auto | getAngularUnit () const |
| Getter for angularunit_. | |
| void | setAngularUnit (AngularUnit p_unit) |
| Setter for angularunit_. | |
| uint32_t | getSeed () const |
| Getter for seed_. | |
| void | setSeed (uint32_t p_seed) |
| Setter for seed_. | |
| void | incProclevel () |
| Increments the procedure level. | |
| void | decProclevel () |
| Decrements the procedure level. | |
| void | incLoadlevel () |
| Increments load level. | |
| void | decLoadlevel () |
| Decrements load level. | |
| void | incArraynesting () |
| Increments array nesting. | |
| void | decArraynesting () |
| Decrements array nesting. | |
| void | print (const std::string &p_line) const |
| Wrapper around SOF writestring(). | |
| void | print (std::string_view p_line) const |
| Wrapper around SOF writestring(). | |
| void | print (const char *p_line) const |
| Wrapper around SOF writestring(). | |
| void | flushoutfile () const |
| Wrapper around SOF flush(). | |
| bool | readLeonLine (std::string &p_line) const |
| Wrapper around SOF readLeonLine(). | |
| void | status_statistics () const |
| Dumps a snapshot of the Context state to the output file. | |
| void | property_statistics () const |
| Dumps a snapshot of the Context properties to the output file. | |
| void | stack_statistics () const |
| Dumps a snapshot of stacks to the output file. | |
| void | pstackdump (const SOK &p_stack) const |
| A dump of a single stack. | |
Public Member Functions inherited from Counter< Context > | |
| Counter (Counter< Context > &&)=delete | |
| Counter< Context > & | operator= (const Counter< Context > &)=delete |
| Counter< Context > & | operator= (Counter< Context > &&)=delete |
Static Public Attributes | |
| static constexpr size_t | mindictstack_ = 3 |
| Corresponds with the setup in the ctor. | |
Protected Member Functions | |
| bool | invariant () const noexcept override |
| Checks class invariants. | |
Protected Member Functions inherited from Counter< Context > | |
| Counter () | |
| Ctor. | |
| Counter (const Counter< Context > &) | |
| Copy ctor. | |
| ~Counter () | |
| Dtor. | |
Protected Member Functions inherited from DbC | |
| ~DbC ()=default | |
| Protected dtor. | |
Private Attributes | |
| bool | run_ = true |
| Control variable for the interpreter loop. | |
| SOK | os_ {} |
| The operand stack. | |
| SOK | es_ {} |
| The execution stack. | |
| SOK | ds_ {} |
| The dictionary stack. | |
| std::string | snapLeonline_ {} |
| For debugging purposes a copy of the current leon-format line. | |
| int | proclevel_ = 0 |
| The process level is incremented for every '{' on input. | |
| int | loadlevel_ = 0 |
| The load level is incemented for ever load_exec() call. | |
| int | arraynesting_ = 0 |
| The nesting level is incemented for every array within an array for the bind operator. | |
| SOF * | inf_ |
| Context Property. | |
| SOF * | outf_ |
| Context Property. | |
| AngularUnit | angularunit_ = AngularUnit::DEG |
| Context Property. | |
| size_t | maxloadlevel_ = 1000 |
| Context Property. | |
| uint32_t | seed_ = 0 |
| Context Property. | |
Static Private Attributes | |
| static const std::map< const char *, core_t * > | systemdictmap_ |
| Maps SON data to SOO data for the systemdict. | |
| static const std::map< const char *, core_t * > | leodictmap_ |
| Maps SON data to SOO data for the leodict. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Counter< Context > | |
| static size_t | getTotalCounter () |
| Static getter for totaly created objects. | |
| static size_t | getAliveCounter () |
| Static getter for objects alive. | |
| static size_t | getWatermarkCounter () |
| Static getter for the object counter watermark. | |
The context of execution.
|
explicit |
Ctor.
Pushes and initializes a user dictionary, a leo dictionary, and a system dictionary onto the dictionary stack.
Sets up empty stacks and all Context parameters.
Opens files for rading and writing.
| [in] | p_inf_name | The file to read from or "-" for standard input. |
|
virtual |
Dtor.
Frees all resources to enable a comprehensive memory leak analysis upon program exit.
|
inline |
Access to the dictionary stack.
|
inline |
Access to the execution stack.
|
inlineoverrideprotectedvirtualnoexcept |
Checks class invariants.
Reimplemented from DbC.
|
inline |
Access to the operand stack.
|
inline |
Wrapper around SOF writestring().
| [in] | p_line | The text to write. |
|
inline |
Wrapper around SOF writestring().
| [in] | p_line | The text to write. |
|
inline |
Wrapper around SOF writestring().
| [in] | p_line | The text to write. |
| void Context::pstackdump | ( | const SOK & | p_stack | ) | const |
A dump of a single stack.
| [in] | p_stack | The stack to dump. |
|
inline |
Wrapper around SOF readLeonLine().
| [out] | p_line | The text read. |
|
private |
Context Property.
The angular unit for trigonometric functions.
|
private |
The nesting level is incemented for every array within an array for the bind operator.
within the class it is an int and a size_t on the interface.
|
staticprivate |
|
private |
The load level is incemented for ever load_exec() call.
within the class it is an int and a size_t on the interface.
|
private |
Context Property.
A maximum of nesting load of name objects.
|
private |
The process level is incremented for every '{' on input.
within the class it is an int and a size_t on the interface.
|
private |
Context Property.
Seed for operator "rand".