eval - /* File eval.h */ /* All program by Steven V. Walstra

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
/* File eval.h */ /* All program by Steven V. Walstra (svw@cis.ufl.edu) Fri Apr 21 00:21:12 EDT 1995 This header file includes the definitions specific to eval.c/functions.c, as well as several functions which act on the many structures defined within. I should have written this in C++. . . */ /* Aug, Lambda, Gamma, YStar, and COND, COMMA, and TAU defined already */ #define GENERAL 0 /* General things which stack by CSE Rule 1 */ #define BINOPA 100 /* Arithmatic BINOP */ #define BINOPL 101 /* Logical BINOP */ #define UNOP 110 /* Unary operators */ #define BETA 200 /* The beta structure (for conditionals) */ #define ETA 300 /* The eta structure (for recursion) */ #define ENVIRO 400 /* The environment marker type */ #define TUPLE 500 /* The tuple type */ #define EMPTY -1 /* Signfies empty stack */ #define UNKNOWN -2 /* Unknown variable */ /* Instrinsic commands (also Aug) */ #define ISINTEGER 600 #define ISTRUTHVALUE 601 #define ISSTRING 602 #define ISTUPLE 603 #define ISFUNCTION 604 #define ISDUMMY 605 #define PRINT 606 #define CONC 607 #define ORDER 608 #define ITOS 609 #define STEM 610 #define STERN 611 #define XNULL 612 struct next_en { /* Used exclusively within struct environment */ struct environment *here; struct next_en *next; }; struct environment { /* Environment linked n-ary tree */ int number; struct environment *prev; /* Previous */ struct next_en *next; /* Next (can have any number of children)*/ struct item *from; /* Variable to match */ struct item *to; /* Replacement value */ }; struct leta { /* Lambda and eta */ int k; /* index */ struct environment *c; /* current environment */ struct item *x; /* variable */ }; struct beta { /* Beta structure -- simulates df dt beta */ struct delta *T; struct delta *F; };
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
struct tuple { /* Tuple type */ int number; struct item *storage; }; struct delta { /* The control-structure structure ! */ int number; struct item *structure; struct delta *next; }; struct item { /* The item structure is the CSE stacks' basic building block */ int type; struct item *next; union { struct leta *l; struct environment *epsilon; struct beta *b; struct tree *t; struct tuple *tup; int tau; } val; }; /* Find_env returns the value of the environmnent via the nearest enviroment marker*/ struct environment *find_env(s) struct item *s; { while (s->type!=ENVIRO) s=s->next; return (s->val.epsilon); }; struct item *make_cse_stack(type) /* Makes room for an item */ int type;
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/09/2011 for the course COP 5555 taught by Professor Staff during the Fall '08 term at University of Florida.

Page1 / 7

eval - /* File eval.h */ /* All program by Steven V. Walstra

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online