#pragma prototyped
#ifndef _EXLIB_H
#define _EXLIB_H
#include <align.h>
#include <ast.h>
typedef struct Exinput_s
{
struct Exinput_s*next;
int close;
char* file;
Sfio_t* fp;
int line;
int nesting;
int peek;
int unit;
char* pushback;
char* bp;
char* pp;
char* sp;
} Exinput_t;
typedef struct Print_s
{
struct Print_s* next;
char* format;
struct Exnode_s*param[3];
struct Exnode_s*arg;
} Print_t;
#define _EX_DATA_PRIVATE_ \
Exnode_t* next; \
Extype_t value; \
struct \
{ \
Exid_t* procedure; \
Exnode_t* args; \
} call; \
struct \
{ \
Exnode_t* array; \
Exid_t* index; \
Exnode_t* statement; \
} generate; \
struct \
{ \
Exnode_t* descriptor; \
Print_t* args; \
} print; \
struct \
{ \
Exnode_t* base; \
Exnode_t* pat; \
Exnode_t* repl; \
} string; \
struct \
{ \
Exnode_t* args; \
Exnode_t* body; \
Dt_t* frame; \
int arity; \
} procedure;
#define _EX_NODE_PRIVATE_ \
Exshort_t subop; \
Exshort_t pad_2;
#define _EX_PROG_PRIVATE_ \
Vmalloc_t* ve; \
Vmalloc_t* vc; \
Dt_t* frame; \
Dtdisc_t symdisc; \
Exdisc_t* disc; \
Exinput_t* input; \
Expr_t* program; \
Sfio_t* tmp; \
Extype_t loopret; \
Exid_t main; \
char line[512]; \
char* linep; \
int eof; \
int errors; \
int formals; \
int linewrap; \
int loopcount; \
int loopop; \
int nesting;
#include <expr.h>
#include <ctype.h>
#include <error.h>
#include <sfstr.h>
#define cast excast
#define id_string (&exbuiltin[0])
#define exunlex(p,c) ((p)->linep--,(p)->input->peek=(c))
#define putcontext(p,c) (((p)->linep>=&(p)->line[sizeof((p)->line)]?(p)->linep=(p)->line,(p)->linewrap=1:0),*(p)->linep++=(c))
#define setcontext(p) ((p)->linep=(p)->line,(p)->linewrap=0)
typedef struct Switch_s
{
struct Switch_s*prev;
Exnode_t* firstcase;
Exnode_t* lastcase;
Exnode_t* defcase;
Extype_t** base;
Extype_t** cur;
Extype_t** last;
int def;
int type;
} Switch_t;
typedef struct
{
Dtlink_t link;
Extype_t key;
Extype_t value;
char name[1];
} Exassoc_t;
typedef struct
{
Exid_t* id;
int declare;
Exref_t* lastref;
int nolabel;
Exinput_t null;
Expr_t* program;
Exnode_t* procedure;
Exref_t* refs;
Switch_t* swstate;
} Exstate_t;
extern const char* exversion;
extern Exstate_t expr;
extern int exparse(void);
extern Sflong_t strToL (char*, char**);
#endif