-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathircstack.h
54 lines (47 loc) · 961 Bytes
/
ircstack.h
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
#ifndef _IRCSTACK_
#define _IRCSTACK_
#include<iostream>
#include<stdlib.h>
#include<math.h>
#include<string>
#include<sstream>
enum POSSIBLESTACKENTRIES {S_STRING, S_INT, S_FLOAT};
class stackentry
{
public:
stackentry(std::string s);
stackentry(stackentry* old); //copy constructor
stackentry(int x);
stackentry(float y);
enum POSSIBLESTACKENTRIES mytype;
std::string print();
bool isNumber();
float floatVal();
std::string s;
int i;
float f;
void* o;
stackentry* next;
private:
};
class stack
{
public:
stack();
int getSize();
void push(stackentry *s);
stackentry* pop();
stackentry* peek();
private:
int size;
stackentry* top;
};
class stackopts
{
public:
static bool inc(stack s);
static bool dec(stack s);
static bool push(stack s);
static bool pop(stack s);
};
#endif