/* %Z%%M% %I% %E% */

/*
 * Copyright (c) 1990, 1991, 1992, 1995 by Wayne C. Gramlich.
 * All rights reserved.
 *
 * Permission to use, copy, modify, distribute, and sell this software
 * for any purpose is hereby granted without fee provided that the above
 * copyright notice and this permission are retained.  The author makes
 * no representations about the suitability of this software for any purpose.
 * It is provided "as is" without express or implied warranty.
 */

/*
 * This file contains code for converting modules from expression tree format
 * into call tree format:
 */

#ifndef CALL_DEFS_H
#include "call_defs.h"
#endif

#ifndef MODULE_DEFS_H
#include "module_defs.h"
#endif

#ifndef OBJECT_EXPORTS_H
#include "object_exports.h"
#endif

#ifndef ROUTINE_DEFS_H
#include "routine_defs.h"
#endif

#ifndef TYPE_EXPORTS_H
#include "type_exports.h"
#endif

#ifndef VECTOR_DEFS_H
#include "vector_defs.h"
#endif

/*
 * module_convert(module, convert)
 *	This routine will convert all expressions to call trees in
 *	type check "module" using "convert".
 */
void
module_convert(
	Module		module,
	Convert		convert)
{
	Routine		routine;
	Vec(Routine)	routines;

	type_defs_convert(module->type_defs, convert);

	routines = module->routines;
	VEC_LOOP(Routine, routines, routine) {
		convert->var_table = routine->var_table;
		convert->routine = routine;
		routine_convert(routine, convert);
	}

	object_table_convert(module->object_table, convert);
}
