/* @(#)sf_space.h	1.2 2/10/93 */
/*******************************************************************************

This code was written and designed by 
Andrew Gene HALL of I.N. Services Pty. Ltd., Scarborough WA, Australia,
for the 
University of Western Australia, Crawley WA, Australia.

*******************************************************************************/
#ifndef SF_SPACE_H
#define SF_SPACE_H
typedef enum {	BOTTOM, 
		DATA_BLOCK, DATA_ITEM, NAME, GLOBAL_BLOCK, LOOP, 
		FRAME_CODE_DI, DOUBLE_QUOTED_TEXT_STRING_DI,
                NON_QUOTED_TEXT_STRING_DI, SEMI_COLON_BOUNDED_TEXT_STRING_DI,
                SINGLE_QUOTED_TEXT_STRING_DI, 
		SUB_LOOP, SAVE_BLOCK
}	Domain;

typedef struct data_item	Data_Item;
struct data_item {
   Domain	tag;
   char *	value;
};

typedef struct data_name_seq	Data_Name_Seq;
struct data_name_seq {
   Domain		tag;
   union u {
      char		*name;
      Data_Name_Seq	*sub_loop;
   }			node;
   Data_Name_Seq	*next;
};

typedef struct list_value_seq	List_Value_Seq;
struct list_value_seq {
   Domain		tag;
   union lsu {
      List_Value_Seq *	sub_loop;
      Data_Item *	data_item;
   }			element;
   List_Value_Seq	*next;
};

typedef struct looped_data	Looped_Data;
struct looped_data {
   List_Value_Seq	*values;
   Data_Name_Seq	*packet_members;
};

typedef struct data_seq	Data_Seq;
struct data_seq {
   char		*name;
   Domain	tag;
   union dsu {
      Data_Item *	data_item;
      Looped_Data	loop;
      Data_Seq *	save_block; /* actually this is Save_Data, it just looks the same */
   }		data;
   Data_Seq	*next;
};

typedef struct block_seq	Block_Seq;

typedef struct global_seq	Global_Seq;
struct global_seq {
   Block_Seq	*global_entry;	/* indirect recursive definition */
   Global_Seq	*next;
};

typedef struct data_block	Data_Block;
struct data_block {
   Data_Seq	*actual_data;
   Global_Seq	*global_data;
};

struct block_seq {
   char		*name;
   Domain	tag;
   union bsu {
      Data_Block	data_block;
      Data_Seq		*global_block;
   }		block;
   Block_Seq	*next;
};
#endif
