-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStack.h
More file actions
80 lines (67 loc) · 1.46 KB
/
Stack.h
File metadata and controls
80 lines (67 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#pragma once
#include <list>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cmath>
#include <limits>
#include <QString>
#include <QLocale>
#include <QColor>
#include "Error.h"
#include "Convert.h"
#include "DataElement.h"
#include "Settings.h"
class Stack
{
public:
Stack(Convert *);
~Stack();
Convert *convert;
void pushDE(DataElement*);
void pushBool(bool);
void pushQString(QString);
void pushInt(int);
void pushUInt(unsigned int);
void pushLong(long);
void pushRef(int, int);
void pushDouble(double);
void pushUnassigned();
void swap();
void swap2();
void topto2();
void dup();
void dup2();
int peekType();
int peekType(int);
DataElement *popDE();
int popInt();
unsigned int popUInt();
int popBool();
QColor popQColor();
long popLong();
double popDouble();
double popMusicalNote();
QString popQString();
QString debug();
int height();
void drop(int);
static int getError() {
return getError(false);
}
static int getError(int clear) {
int olde = e;
if (clear) e = ERROR_NONE;
return olde;
}
private:
std::vector<DataElement*> stackdata;
int stackpointer; //faster than unsigned int and is quite enough as size
int stacksize;
void stackGrow();
static int e; // error number thrown - will be 0 if no error
};