/* Global definitions of limits and constants */ #define MAX_LINE_LENGTH 1024 #define MAX_LINE_TOKENS 1024 typedef enum { ArrayTag, FunctionTag, HybridTag, MonadicOpTag, DyadicOpTag, BoundFunctionTag, /* Function with left arg bound */ LParTag, RParTag, LCurlTag, RCurlTag, LBracketTag, RBracketTag } datumTag; typedef enum { AtypeInt } arrayDataType; /* Data types */ typedef struct Array Array; typedef struct Datum Datum; struct Array { arrayDataType type; int rank; int *shape; union { char *rawdata; vlong *intdata; }; }; struct Datum { datumTag tag; Rune *strrep; union { Array *array; }; }; /* Function prototypes for the different source files */ /* print.c */ Rune *ppdatum(Datum); Rune *ppdatums(Datum *, int); /* lexer.c */ Datum *lexline(Rune *, int *); /* array.c */ Array *mkscalarint(vlong); /* eval.c */ Datum *eval(Datum *, int *); /* Global variables */ Rune *errormsg; /* eval.c */