// Integer arithmetic interpreter value (avalue) // declaration. // // File: iavalue.h // Author: course // Version: 2 // // This file declares the arithmetic interpreter value // type, or avalue. // // This version of the file declares avalues to be // simple integers that are added, subtracted, etc. as // per usual arithmetic. // // Other versions of this file and its companion // avalue.cc file may be written without changing the // rest of the interpreter program. #ifndef _AVALUE_H_ #define _AVALUE_H_ #include "basic.h" // Coursewide basic declarations. // Lexeme_class are declared later, in lexeme.h, but // used here. A lexeme is a pointer to a lexeme_class: // class lexeme_class; typedef lexeme_class * lexeme; // Definition of avalue type. With this particular // definition, the operators <<, >>, +, -, *, / come // for free. // typedef long avalue; // `Zero' avalue, which becomes value of empty program. // extern avalue zero_avalue; // Functions involving avalues. // Evaluate a lexeme to produce a value. Lexeme must be // number or symbol. // avalue evaluate (lexeme l); // Assign to a lexeme. Returns the value assigned. // avalue assign (lexeme l, avalue v); // Initialize avalues. // void init_avalues (void); #endif // _AVALUE_H_