Kryptostack
Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes | List of all members
Context Class Reference

The context of execution. More...

#include <context.h>

Inheritance diagram for Context:
Inheritance graph
[legend]
Collaboration diagram for Context:
Collaboration graph
[legend]

Public Member Functions

 Context ()
 Ctor. More...
 
 ~Context ()
 Dtor. More...
 
public_accessor Stackopst ()
 Access to the operational stack.
 
Stackexst ()
 Access to the execution stack.
 
Stackdist ()
 Access to the dictionary stack.
 
int getProclevel () const
 Getter for procedure level.
 
int getMaxopeelevel () const
 Getter for maximum opee level.
 
int getInterpreterLoop () const
 Getter for interpreter loop control variable run_.
 
void stopInterpreterLoop ()
 Sets run_ to false.
 
void setSnapKSNline (const string &p_line)
 Setter for snapKSNline_.
 
string getSNapKSNline () const
 Getter for snapKSNline_.
 
public_other void incProclevel ()
 Increments the procedure level.
 
void decProclevel ()
 Decrements the procedure level.
 
- Public Member Functions inherited from Counter< Context >
 Counter ()
 Ctor.
 

Static Public Attributes

static constexpr size_t mindictstack_ = 3
 corresponds with the setup in the Ctor
 

Private Attributes

string snapKSNline_
 For debugging purposes a copy of the current KSN line.
 
Stack os_
 The operand stack.
 
Stack es_
 The execution stack.
 
Stack ds_
 The dictionary stack.
 
int proclevel_ = 0
 The process level is incremented by one for every { on input.
 
int maxopeelevel_ = 2
 A maximum for the nesting level of printed SOA and SOD in the "OPerator Equal Equal".
 
bool run_ = true
 Control variable for the interpreter loop.
 

Static Private Attributes

static const map< string, void(*)(Context &)> systemdictmap_
 Maps SON data to SOO data for the systemdict.
 
static const map< string, void(*)(Context &)> kryptodictmap_
 Maps SON data to SOO data for the kryptodict. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Counter< Context >
static int getTotalCounter ()
 Static getter for created objects.
 
static int getAliveCounter ()
 Static getter for objects alive.
 

Detailed Description

The context of execution.

Constructor & Destructor Documentation

◆ Context()

Context::Context ( )
explicit

Ctor.

Pushes and initializes a user dictionary, a crypto dictionary, and a system dictionary onto the dictionary stack.

◆ ~Context()

Context::~Context ( )

Dtor.

Frees all resources to enable a comprehensive memory leak analysis upon program exit.

Member Data Documentation

◆ kryptodictmap_

const map< string, void(*)(Context &)> Context::kryptodictmap_
staticprivate
Initial value:
= {
{ "gcd" , &sox_gcd }, { "ggT" , &sox_gcd },
{ "lcm" , &sox_lcm }, { "kgV" , &sox_lcm },
{ "xgcd" , &sox_xgcd }, { "xggT" , &sox_xgcd }
}
void sox_xgcd(Context &k)
Extension operator xgcd.
Definition: opext.cpp:29
void sox_lcm(Context &k)
Extension operator lcm.
Definition: opext.cpp:41
void sox_gcd(Context &k)
Extension operator gcd.
Definition: opext.cpp:19

Maps SON data to SOO data for the kryptodict.


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