vm-translator/parser.h

25 lines
341 B
C
Raw Normal View History

2020-11-19 06:10:51 -05:00
#ifndef PARSER_H
#define PARSER_H
typedef struct {
2020-10-29 20:22:03 -04:00
char** tokens;
int tokenscount;
int truen;
2020-11-19 06:10:51 -05:00
} LINE;
2020-10-29 20:22:03 -04:00
2020-11-19 06:10:51 -05:00
typedef struct {
LINE** lns;
2020-11-01 08:53:20 -05:00
int count;
2020-11-19 06:10:51 -05:00
} LINEARRAY;
2020-11-01 08:53:20 -05:00
2020-11-19 06:10:51 -05:00
typedef struct {
2020-11-01 08:53:20 -05:00
FILE* input;
2020-11-19 06:10:51 -05:00
LINEARRAY* lns;
2020-11-01 08:53:20 -05:00
int widestln;
int maxtokens;
2020-11-19 06:10:51 -05:00
} PARSER;
2020-11-01 08:53:20 -05:00
2020-11-19 06:10:51 -05:00
PARSER* mkparser(FILE* input);
void freeparser(PARSER* p);
void parse(PARSER* p);
2020-10-30 13:06:02 -04:00
#endif