49 lines
584 B
C
49 lines
584 B
C
#include <stdbool.h>
|
|
#include "syntax.h"
|
|
|
|
typedef enum {
|
|
|
|
REPLACE,
|
|
FUNCTION
|
|
|
|
} tProcessingType;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char* replacethis;
|
|
tSyntaxElement* replacewiththis;
|
|
|
|
} tProcessingReplace;
|
|
|
|
typedef struct {
|
|
|
|
char* name;
|
|
int argc;
|
|
char** argv;
|
|
tSyntaxElement* body;
|
|
|
|
} tProcessingFunction;
|
|
|
|
|
|
|
|
typedef union {
|
|
|
|
tProcessingReplace replace;
|
|
tProcessingFunction function;
|
|
|
|
} tuProcessingData;
|
|
|
|
typedef struct ProcessingData {
|
|
|
|
struct ProcessingData* prev;
|
|
tProcessingType type;
|
|
tuProcessingData data;
|
|
|
|
} tProcessingData;
|
|
|
|
|
|
|
|
void process(tSyntaxElement*, tProcessingData*);
|