#ifndef INFO_UNIT_CLASS #define INFO_UNIT_CLASS // info_unit: information that is used during the parsing of a ZENO operation // or during the parsing of a subprogram that uses a ZENO operation. by // default, everything starts up as NIL or FALSE. #include "zeno_tree.h" #include "operation.h" class info_unit : public chunk { public: info_unit(); ~info_unit(); // add_to_prefixed_declarations: adds a new subtree of information to the // simple declarations that need to be output when the ZENO operation or // ZENO operation user is created. void add_to_prefixed_declarations(zeno_tree *to_add); zeno_tree *prefixed_declarations(); // subprg_spec_seen: if this is TRUE, then it is safe to start looking for // operation names in the function mangle_possible_operation_name. if // the subprogram specification has not been seen, then the name of the // operation might be mangled. int subprg_spec_seen(); void set_subprg_spec_seen(); // current_op: the last operation whose definition has been seen and under- // stood. this is NIL if that has not occurred yet. operation *current_op(); void set_current_op(operation *to_set); // operation_application_count: keeps track of the number of ZENO operations // that have been invoked (applied to their operands) so far in this scope. // if this is greater than zero, then it means that the scope (ada operation // or zeno operation) uses a ZENO operation, but its being zero does not // definitively mean that this scope does not use ZENO; only if the parsing // of the scope has finished AND the count is zero at that point, then the // scope does not use ZENO. int operation_application_count(); void increment_operations_applied(); private: zeno_tree *declarations; operation *current_operation; int spec_seen; int operation_apply_count; }; #endif