Kryptostack
context.h
Go to the documentation of this file.
1
5#pragma once
6
7#include <string>
8#include <map>
9#include "counter.h"
10#include "stack.h"
11
12using namespace std;
13
14
17class Context : public Counter<Context> {
18 string snapKSNline_;
22 int proclevel_ = 0;
23 int maxopeelevel_ = 2;
24 bool run_ = true;
27 static const map<string, void(*)(Context&)> systemdictmap_,
30public:
31 constexpr static size_t mindictstack_ = 3;
36 explicit Context();
37
41 ~Context();
42
45 Stack& opst() { return os_; }
47 Stack& exst() { return es_; }
49 Stack& dist() { return ds_; }
51 int getProclevel() const { return proclevel_; }
53 int getMaxopeelevel() const { return maxopeelevel_; }
55 int getInterpreterLoop() const { return run_; }
57 void stopInterpreterLoop() { run_ = false; }
59 void setSnapKSNline( const string& p_line ) { snapKSNline_ = p_line; }
61 string getSNapKSNline() const { return snapKSNline_; }
62
66
69};
The context of execution.
Definition: context.h:17
Stack & dist()
Access to the dictionary stack.
Definition: context.h:49
void stopInterpreterLoop()
Sets run_ to false.
Definition: context.h:57
string getSNapKSNline() const
Getter for snapKSNline_.
Definition: context.h:61
Stack es_
The execution stack.
Definition: context.h:20
Stack os_
The operand stack.
Definition: context.h:19
~Context()
Dtor.
Definition: context.cpp:39
string snapKSNline_
For debugging purposes a copy of the current KSN line.
Definition: context.h:18
Stack & exst()
Access to the execution stack.
Definition: context.h:47
bool run_
Control variable for the interpreter loop.
Definition: context.h:24
int getProclevel() const
Getter for procedure level.
Definition: context.h:51
Context()
Ctor.
Definition: context.cpp:14
int getMaxopeelevel() const
Getter for maximum opee level.
Definition: context.h:53
public_other void incProclevel()
Increments the procedure level.
Definition: context.h:65
static const map< string, void(*)(Context &)> systemdictmap_
Maps SON data to SOO data for the systemdict.
Definition: context.h:27
public_accessor Stack & opst()
Access to the operational stack.
Definition: context.h:45
static constexpr size_t mindictstack_
corresponds with the setup in the Ctor
Definition: context.h:31
void setSnapKSNline(const string &p_line)
Setter for snapKSNline_.
Definition: context.h:59
static const map< string, void(*)(Context &)> kryptodictmap_
Maps SON data to SOO data for the kryptodict.
Definition: context.h:29
void decProclevel()
Decrements the procedure level.
Definition: context.h:68
int getInterpreterLoop() const
Getter for interpreter loop control variable run_.
Definition: context.h:55
int proclevel_
The process level is incremented by one for every { on input.
Definition: context.h:22
int maxopeelevel_
A maximum for the nesting level of printed SOA and SOD in the "OPerator Equal Equal".
Definition: context.h:23
Stack ds_
The dictionary stack.
Definition: context.h:21
Counter base class.
Definition: counter.h:10
Our own container adapter to build a stack.
Definition: stack.h:22
The class Counter.
#define public_other
other member functions
Definition: helper.h:16
#define public_accessor
accessor functions
Definition: helper.h:14
Class Stack.