Yab2Cpp/runtime/runtime.h

45 lines
679 B
C
Raw Normal View History

/*
** Runtime header for Yab2Cpp
**
** by Samuel D. Crow
*/
#ifndef YAB_RUNTIME
#define YAB_RUNTIME
#include <string>
#include <cstdio>
using namespace std;
/*
This enum contains all of the error states used at runtime.
*/
enum STATES:unsigned int
{
EXIT,
UNDEFINED_STATE_ERROR,
STACK_UNDERFLOW_ERROR,
START
};
/*
This class wraps the function class and is inherited by every subroutine.
*/
class subroutine
{
subroutine *callStackNode;
2021-04-17 01:56:10 +02:00
unsigned int ret;
public:
2021-04-17 01:56:10 +02:00
static unsigned int close();
subroutine(unsigned int r);
virtual ~subroutine()
{}
};
extern subroutine *callStack;
/* function prototype */
unsigned int run();
#endif