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