Cell
VFT_CELL_t Cell[TEMP_RANGE_MAXSTEPS][NUM_VFT_COLUMNS];
VFT_CELL_t Cell[TEMP_RANGE_MAXSTEPS][NUM_VFT_COLUMNS];
VFT_CELL_t Cell[NUM_VFT_COLUMNS];
VFT_CELL_t Cell[NUM_VFT_COLUMNS];
VFT_CELL_t Cell[TEMP_RANGE_MAXSTEPS][NUM_VFT_COLUMNS];
VFT_CELL_t Cell[NUM_VFT_COLUMNS];
VFT_CELL_t Cell[NUM_VFT_COLUMNS];
VFT_CELL_t Cell[NUM_VFT_COLUMNS];
VFT_CELL_t Cell[NUM_VFT_COLUMNS];
struct Cell *cnext; /* ptr to next if chained */
Cell **tab; /* hash table pointers */
extern Cell *nrloc; /* NR */
extern Cell *fnrloc; /* FNR */
extern Cell *fsloc; /* FS */
extern Cell *nfloc; /* NF */
extern Cell *ofsloc; /* OFS */
extern Cell *orsloc; /* ORS */
extern Cell *rsloc; /* RS */
extern Cell *rstartloc; /* RSTART */
extern Cell *rlengthloc; /* RLENGTH */
extern Cell *subseploc; /* SUBSEP */
extern Cell *symtabloc; /* SYMTAB */
{ infunc = false; curfname=0; defn((Cell *)$2, $4, $8); $$ = 0; }
void checkdup(Node *list, Cell *item);
Cell *cp;
void setfname(Cell *p)
return isvalue(p) && ((Cell *) (p->narg[0]))->csub == CCON;
return ((Cell *)(p->narg[0]))->sval;
void checkdup(Node *vl, Cell *cp) /* check if name already in list */
if (strcmp(s, ((Cell *)(vl->narg[0]))->nval) == 0) {
Cell *x;
extern Cell *ARGVcell;
Cell *q;
Cell *p;
Cell **fldtab; /* pointers to Cells */
Cell *p;
Cell *fieldadr(int n) /* get nth field */
s = (nf+1) * (sizeof (struct Cell *)); /* freebsd: how much do we need? */
if (s / sizeof(struct Cell *) - 1 == (size_t)nf) /* didn't overflow */
fldtab = (Cell **) realloc(fldtab, s);
static Cell dollar0 = { OCELL, CFLD, NULL, EMPTY, 0.0, REC|STR|DONTFREE, NULL, NULL };
static Cell dollar1 = { OCELL, CFLD, NULL, EMPTY, 0.0, FLD|STR|DONTFREE, NULL, NULL };
|| (fldtab = (Cell **) calloc(nfields+2, sizeof(*fldtab))) == NULL
|| (fldtab[0] = (Cell *) malloc(sizeof(**fldtab))) == NULL)
fldtab[i] = (Cell *) malloc(sizeof(**fldtab));
Node *celltonode(Cell *a, int b)
extern Cell *literal0;
Cell *cp;
cp = (Cell *) (p->narg[0]);
void defn(Cell *v, Node *vl, Node *st) /* turn on FCN bit in definition, */
if (strcmp(((Cell *)(p->narg[0]))->nval, s) == 0)
extern void freesymtab(Cell *);
extern void freeelem(Cell *, const char *);
extern Cell *setsymtab(const char *, const char *, double, unsigned int, Array *);
extern Cell *lookup(const char *, Array *);
extern double setfval(Cell *, double);
extern void funnyvar(Cell *, const char *);
extern char *setsval(Cell *, const char *);
extern double getfval(Cell *);
extern char *getsval(Cell *);
extern char *getpssval(Cell *); /* for print */
extern Cell *catstr(Cell *, Cell *);
extern Cell *fieldadr(int);
extern Cell *execute(Node *);
extern Cell *program(Node **, int);
extern Cell *call(Node **, int);
extern Cell *copycell(Cell *);
extern Cell *arg(Node **, int);
extern Cell *jump(Node **, int);
extern Cell *awkgetline(Node **, int);
extern Cell *getnf(Node **, int);
extern Cell *array(Node **, int);
extern Cell *awkdelete(Node **, int);
extern Cell *intest(Node **, int);
extern Cell *matchop(Node **, int);
extern Cell *boolop(Node **, int);
extern Cell *relop(Node **, int);
extern void tfree(Cell *);
extern Cell *gettemp(void);
extern Cell *indirect(Node **, int);
extern Cell *substr(Node **, int);
extern Cell *sindex(Node **, int);
extern Cell *awksprintf(Node **, int);
extern Cell *awkprintf(Node **, int);
extern Cell *arith(Node **, int);
extern Cell *incrdecr(Node **, int);
extern Cell *assign(Node **, int);
extern Cell *cat(Node **, int);
extern Cell *pastat(Node **, int);
extern Cell *dopa2(Node **, int);
extern Cell *split(Node **, int);
extern Cell *condexpr(Node **, int);
extern Cell *ifstat(Node **, int);
extern Cell *whilestat(Node **, int);
extern Cell *dostat(Node **, int);
extern Cell *forstat(Node **, int);
extern Cell *instat(Node **, int);
extern Cell *bltin(Node **, int);
extern Cell *printstat(Node **, int);
extern Cell *nullproc(Node **, int);
extern Cell *closefile(Node **, int);
extern Cell *dosub(Node **, int);
extern Cell *gensub(Node **, int);
extern void setfname(Cell *);
extern Node *celltonode(Cell *, int);
extern void defn(Cell *, Node *, Node *);
extern Cell *(*proctab[])(Node **, int);
static Cell tempcell ={ OCELL, CTEMP, 0, EMPTY, 0.0, NUM|STR|DONTFREE, NULL, NULL };
Cell *sindex(Node **a, int nnn) /* index(a[0], a[1]) */
Cell *x, *y, *z;
Cell *x;
Cell *awksprintf(Node **a, int n) /* sprintf(a[0]) */
Cell *x;
Cell *awkprintf(Node **a, int n) /* printf */
Cell *x;
Cell *arith(Node **a, int n) /* a[0] + a[1], etc. also -a[0] */
Cell *x, *y, *z;
Cell *execute(Node *u) /* execute a node of the parse tree */
Cell *(*proc)(Node **, int);
Cell *x;
Cell *incrdecr(Node **a, int n) /* a[0]++, etc. */
Cell *x, *z;
Cell *assign(Node **a, int n) /* a[0] = a[1], a[0] += a[1], etc. */
Cell *x, *y;
x = (Cell *) (a->narg[0]);
Cell *cat(Node **a, int q) /* a[0] cat a[1] */
Cell *x, *y, *z;
Cell *pastat(Node **a, int n) /* a[0] { a[1] } */
Cell *x;
Cell *dopa2(Node **a, int n) /* a[0], a[1] { a[2] } */
Cell *x;
Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */
Cell *x = NULL, *y, *ap;
Cell *program(Node **a, int n) /* execute an awk program */
Cell *condexpr(Node **a, int n) /* a[0] ? a[1] : a[2] */
Cell *x;
Cell *x;
Cell *ifstat(Node **a, int n) /* if (a[0]) a[1]; else a[2] */
Cell *x;
Cell *whilestat(Node **a, int n) /* while (a[0]) a[1] */
Cell *x;
Cell *dostat(Node **a, int n) /* do a[0]; while(a[1]) */
Cell *x;
Cell *forstat(Node **a, int n) /* for (a[0]; a[1]; a[2]) a[3] */
Cell *x;
Cell *instat(Node **a, int n) /* for (a[0] in a[1]) a[2] */
Cell *x, *vp, *arrayp, *cp, *ncp;
Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg list */
Cell *x, *y;
Cell *fcncell; /* pointer to Cell for function */
Cell **args; /* pointer to array of arguments after execute */
Cell *retval; /* return value */
Cell *printstat(Node **a, int n) /* print a[0] */
Cell *y;
Cell *call(Node **a, int n) /* function call. very kludgy and fragile */
Cell *nullproc(Node **a, int n)
Cell *x;
static const Cell newcopycell = { OCELL, CCOPY, 0, EMPTY, 0.0, NUM|STR|DONTFREE, NULL, NULL };
Cell *args[NARGS], *oargs[NARGS]; /* BUG: fixed size arrays */
Cell *y, *z, *fcn;
Cell *closefile(Node **a, int n)
Cell *x;
Cell *dosub(Node **a, int subop) /* sub and gsub */
Cell *x;
Cell *gensub(Node **a, int nnn) /* global selective substitute */
Cell *x, *y, *res, *h;
Cell *t = frp->args[i];
Cell *copycell(Cell *x) /* make a copy of a cell in a temp */
Cell *y;
Cell *arg(Node **a, int n) /* nth argument of a function */
Cell *jump(Node **a, int n) /* break, continue, next, nextfile, return */
Cell *y;
Cell *awkgetline(Node **a, int n) /* get next line from specific input */
Cell *r, *x;
extern Cell **fldtab;
Cell *getnf(Node **a, int n) /* get NF */
return (Cell *) a[0];
Cell *x = execute(p); /* expr */
Cell *array(Node **a, int n) /* a[0] is symtab, a[1] is list of subscripts */
Cell *x, *z;
void tempfree(Cell *p) {
Cell *awkdelete(Node **a, int n) /* a[0] is symtab, a[1] is list of subscripts */
Cell *x;
Cell *intest(Node **a, int n) /* a[0] is index (list), a[1] is symtab */
Cell *ap, *k;
Cell *matchop(Node **a, int n) /* ~ and match() */
Cell *x, *y, *z;
Cell *tmps; /* free temporary cells for execution */
static Cell truecell ={ OBOOL, BTRUE, 0, 0, 1.0, NUM, NULL, NULL };
Cell *True = &truecell;
Cell *boolop(Node **a, int n) /* a[0] || a[1], a[0] && a[1], !a[0] */
Cell *x, *y;
static Cell falsecell ={ OBOOL, BFALSE, 0, 0, 0.0, NUM, NULL, NULL };
Cell *False = &falsecell;
static Cell breakcell ={ OJUMP, JBREAK, 0, 0, 0.0, NUM, NULL, NULL };
Cell *relop(Node **a, int n) /* a[0 < a[1], etc. */
Cell *x, *y;
Cell *jbreak = &breakcell;
static Cell contcell ={ OJUMP, JCONT, 0, 0, 0.0, NUM, NULL, NULL };
Cell *jcont = &contcell;
static Cell nextcell ={ OJUMP, JNEXT, 0, 0, 0.0, NUM, NULL, NULL };
void tfree(Cell *a) /* free a tempcell */
Cell *jnext = &nextcell;
Cell *gettemp(void) /* get a tempcell */
Cell *x;
static Cell nextfilecell ={ OJUMP, JNEXTFILE, 0, 0, 0.0, NUM, NULL, NULL };
tmps = (Cell *) calloc(100, sizeof(*tmps));
Cell *jnextfile = &nextfilecell;
Cell *indirect(Node **a, int n) /* $( a[0] ) */
Cell *x;
static Cell exitcell ={ OJUMP, JEXIT, 0, 0, 0.0, NUM, NULL, NULL };
Cell *jexit = &exitcell;
Cell *substr(Node **a, int nnn) /* substr(a[0], a[1], a[2]) */
Cell *x, *y, *z = NULL;
static Cell retcell ={ OJUMP, JRET, 0, 0, 0.0, NUM, NULL, NULL };
Cell *jret = &retcell;
Cell *cp;
Cell *cp;
Cell **tp;
tp = (Cell **) calloc(n, sizeof(*tp));
void freesymtab(Cell *ap) /* free a symbol table */
Cell *cp, *temp;
void freeelem(Cell *ap, const char *s) /* free elem s from ap (i.e., ap["s"] */
Cell *p, *prev = NULL;
Cell *setsymtab(const char *n, const char *s, Awkfloat f, unsigned t, Array *tp)
Cell *p;
p = (Cell *) malloc(sizeof(*p));
Cell *cp, *op, **np;
np = (Cell **) calloc(nsz, sizeof(*np));
Cell *lookup(const char *s, Array *tp) /* look for s in tp */
Cell *p;
Awkfloat setfval(Cell *vp, Awkfloat f) /* set float val of a Cell */
void funnyvar(Cell *vp, const char *rw)
char *setsval(Cell *vp, const char *s) /* set string val of a Cell */
Awkfloat getfval(Cell *vp) /* get float val of a Cell */
static char *get_str_val(Cell *vp, char **fmt) /* get string val of a Cell */
char *getsval(Cell *vp) /* get string val of a Cell */
char *getpssval(Cell *vp) /* get string val of a Cell for print */
Cell *fsloc; /* FS */
Cell *catstr(Cell *a, Cell *b) /* concatenate a and b */
Cell *nrloc; /* NR */
Cell *c;
Cell *nfloc; /* NF */
Cell *fnrloc; /* FNR */
Cell *ofsloc; /* OFS */
Cell *orsloc; /* ORS */
Cell *rsloc; /* RS */
Cell *ARGVcell; /* cell with symbol table containing ARGV[...] */
Cell *rstartloc; /* RSTART */
Cell *rlengthloc; /* RLENGTH */
Cell *subseploc; /* SUBSEP */
Cell *symtabloc; /* SYMTAB */
Cell *nullloc; /* a guaranteed empty cell */
Cell *literal0;
extern Cell **fldtab;