-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparse.h
34 lines (24 loc) · 961 Bytes
/
parse.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
#ifndef BF_PARSE_H_INCLUDED
#define BF_PARSE_H_INCLUDED
/* Parse commands for BrainF>>k Interpreter */
#include "common.h"
#define PARSE_SUCCESS 0
#define PARSE_MEMORY 1
#define PARSE_BRACKETS 2
typedef bf_command* (*ParseFunction) (const char* file, int* num, int* read, int* error);
typedef void (*PrintFunction) (const char* file, bf_command* prgm);
/* Connect brackets parsed (optionally used by parse functions)
Parse.c
*/
extern int matchBrackets(bf_command* prgm);
/* Master language list X-Macro (id, name) */
#define X_LANGUAGES X(BF, "BF") \
X(QQQ, "???") \
X(TBF, "TinyBF")
/* Declare print and parse functions for the language list */
#define X(id, name) \
extern bf_command* Parse##id(const char* file, int* num, int* read, int* error); \
extern void Print##id(const char* file, bf_command* prgrm);
X_LANGUAGES
#undef X
#endif