2020-11-19 06:10:51 -05:00
|
|
|
#ifndef TRANSLATOR_H
|
|
|
|
#define TRANSLATOR_H
|
|
|
|
#include <stdbool.h>
|
2020-10-30 13:06:02 -04:00
|
|
|
#include "parser.h"
|
2020-11-21 09:25:30 -05:00
|
|
|
#include "util.h"
|
2020-10-31 21:53:11 -04:00
|
|
|
|
2020-11-19 06:10:51 -05:00
|
|
|
typedef struct {
|
|
|
|
char** items;
|
|
|
|
int count;
|
|
|
|
int size;
|
|
|
|
} STRLIST;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
STRLIST* asmlns;
|
|
|
|
STRLIST* toclean;
|
|
|
|
LINEARRAY* lns;
|
2020-11-01 08:53:20 -05:00
|
|
|
char* fname;
|
2020-11-14 10:31:57 -05:00
|
|
|
int fnamelen;
|
2020-11-17 12:12:39 -05:00
|
|
|
char* lastfun;
|
|
|
|
int lastfunlen;
|
|
|
|
int funcount;
|
|
|
|
int retind;
|
|
|
|
int cmpind;
|
2020-11-19 06:10:51 -05:00
|
|
|
bool returned;
|
2020-11-21 09:25:30 -05:00
|
|
|
|
|
|
|
LINELIST* output;
|
|
|
|
LINELIST* curln;
|
|
|
|
LINELIST* lastln;
|
|
|
|
int lncount;
|
2020-11-19 06:10:51 -05:00
|
|
|
} TRANSLATOR;
|
2020-11-01 08:53:20 -05:00
|
|
|
|
2020-11-19 06:10:51 -05:00
|
|
|
void freetranslator(TRANSLATOR* t);
|
|
|
|
void translate(TRANSLATOR* t);
|
|
|
|
TRANSLATOR* mktranslator(LINEARRAY* lns, char* fname);
|
2020-10-30 13:06:02 -04:00
|
|
|
#endif
|