C:\Users\brock\Documents\CSCI 255\NetBeans\RL Solution\RLvartab.h
/* Do NOT modify this file! */

/*
 * Header file for symbol table for RL variables
 *
 * Done in a hokey abstract data type style
 *
 * Copyright J. Dean Brock, 2010
 * This file released under terms of the GNU General Public License
 *
 */

#ifndef _RLVARTAB_H
#define _RLVARTAB_H

#include "RLparse.h"
#include <stdio.h>

struct RLVariableNode {
    struct RLVariableNode *next ;          /* Link to next in chain */
    struct RLAssignmentNode *variable ;    /* Link to variable */
    double value ;                         /* Value of variable */
};

struct RLVarTable {
    int numberItems ;
    struct RLVariableNode Heads[26] ;
};

typedef struct RLVarTable *RLVariableTable ;


/* Create an emptry variable table */
RLVariableTable RLVTcreate(void) ;

/* Insert an assignment into a variable table.
 * The returned RL variable node will point to the assignment */
struct RLVariableNode *RLVTinsert(RLVariableTable t, struct RLAssignmentNode *p) ;

/* Lookup a variable by name.
 * The returned RL variable node will point to the last assignment */
struct RLVariableNode *RLVTlookup(RLVariableTable t, char *n) ;

/* Return number of items in the variable table */
int RLVTgetItemCount (RLVariableTable t) ;

#endif  /* _RLVARTAB_H */