Symbole und -Tabellen

Id: symbol.tex,v 1.1 2007-11-20 08:07:45 waldmann Exp

typedef double (*func_t) (double);
typedef struct {
  char *name;  /* name of symbol */
  int type;    /* type: either VAR or FNCT */
  union
  { double var;       /* value of a VAR   */
    func_t fnctptr;   /* value of a FNCT  */
  } value;
  struct symrec *next;    /* link field */
} symrec;
extern symrec * sym_table;
Scanner muß neue Symbole eintragen und alte wiederfinden (getsym/putsym).

Bessere Implementierung durch Hashing.



Johannes Waldmann 2008-01-24