/* %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 the definitions for module data structures: */

#ifndef MODULE_DEFS_H
#define MODULE_DEFS_H

#ifndef MODULE_EXPORTS_H
#include "module_exports.h"
#endif

#ifndef OBJECT_TYPES_H
#include "object_types.h"
#endif

#ifndef TYPE_TYPES_H
#include "type_types.h"
#endif

#ifndef VAR_TYPES_H
#include "var_types.h"
#endif

#ifndef VECTOR_TYPES_H
#include "vector_types.h"
#endif

struct Export_struct {
	Str		comment;	/* Comment at end-of-line */
	Export_from	from;		/* Export from */
	Str		from_name;	/* From (or (char *)0) w/from tag */
	Export_to	to;		/* Export to */
	Export_to	to_name;	/* To (or (char *)0) w/to tag */
};

struct Import_struct {
	Str		comment;	/* Comment at end-of-line */
	Str		name;		/* Import module name */
	int		position;	/* Position of import */
};

struct Module_struct {
	Str		comment;	/* Comment on module def. line */
	Vec(Str)	comments;	/* Comments before module def */
	Vars		consts;		/* Constant declarations */
	Vec(Export)	exports;	/* Exports list */
	Str		identify;	/* Identify string */
	Vec(Import)	imports;	/* Imports list */
	Type_defs	import_type_defs; /* Imported type definitions */
	Str		name;		/* Module name */
	Object_table	object_table;	/* Object table */
	int		position;	/* Location in file */
	Vec(Routine)	routines;	/* Routine definition list */
	Type_defs	type_defs;	/* Type definition list */
	Str		language;	/* Language */
	Str		version;	/* Version string */
};

#endif /* MODULE_DEFS_H */
