#line 56 "noweb/implbla.nw"
class BlaReader;
class STLightItem {
friend class STLight;
protected:
	STLightItem* next;
	char* son;
	STLightItem(char* s, STLightItem* n){
		son = s; next = n;	
	}
};
class STLight {
	
#line 81 "noweb/implbla.nw"
static const int hash_size = 51;
STLightItem* hash_table[hash_size];
#line 95 "noweb/implbla.nw"
int hash_code(char* nme);
#line 68 "noweb/implbla.nw"
public:
	STLight(){
		
#line 86 "noweb/implbla.nw"
int i;
for(i = 0; i < hash_size; i++){
	hash_table[i] = (STLightItem*)NULL;
}
#line 71 "noweb/implbla.nw"
	}
	
#line 121 "noweb/implbla.nw"
char* find(char* nme);
char* add(char* nme);
#line 73 "noweb/implbla.nw"
};
#line 124 "noweb/apibla.nw"
enum BlaItem {
	
#line 150 "noweb/apibla.nw"
	BLA_EOF,
#line 158 "noweb/apibla.nw"
	BLA_INT,
#line 166 "noweb/apibla.nw"
	BLA_FLOAT,
#line 174 "noweb/apibla.nw"
	BLA_PRAGMA,
#line 182 "noweb/apibla.nw"
	BLA_END_PRAGMA,
#line 190 "noweb/apibla.nw"
	BLA_STRING,
#line 198 "noweb/apibla.nw"
	BLA_ERROR,
#line 126 "noweb/apibla.nw"
	NB_BlaItem
};
#line 6 "noweb/apibla.nw"
class BlaReader {
	
#line 13 "noweb/implbla.nw"
FILE* infile;
int (*infunction)();
#line 157 "noweb/implbla.nw"
STLight* pragmas;
#line 177 "noweb/implbla.nw"
char buffer[1024];
BlaItem curitem;
#line 189 "noweb/implbla.nw"
int cur_char;
#line 196 "noweb/implbla.nw"
int get_char_buff_cpt;
int get_char_buff[5];
#line 206 "noweb/implbla.nw"
void get_char(){
	if(get_char_buff_cpt){
		cur_char = get_char_buff[--get_char_buff_cpt];
	} else {
		cur_char = (infile)? fgetc(infile) : (*infunction)();
	}
}
#line 215 "noweb/implbla.nw"
void unget_and_restore(int c){
	get_char_buff[get_char_buff_cpt++] = cur_char;
	cur_char = c;
}
#line 240 "noweb/implbla.nw"
char* curpragma;
int par_pragma_mode;
int line_pragma_mode;
#line 487 "noweb/implbla.nw"
void ignore_line();
void ignore_comment();
#line 8 "noweb/apibla.nw"
public:
	
#line 85 "noweb/apibla.nw"
char* version(){ return "1"; }
#line 101 "noweb/apibla.nw"
BlaReader(int (*f)());
BlaReader(FILE* in);
BlaReader();
#line 132 "noweb/apibla.nw"
const char* item_name(BlaItem it);
#line 210 "noweb/apibla.nw"
char* add_pragma(char* prag);
#line 221 "noweb/apibla.nw"
BlaItem get();
#line 226 "noweb/apibla.nw"
BlaItem get(char** val);
#line 233 "noweb/apibla.nw"
BlaItem cur_item();
char* cur_string();
#line 10 "noweb/apibla.nw"
};
#line 48 "noweb/apirif.nw"
enum RifItem {
	
#line 75 "noweb/apirif.nw"
   RIF_EOF,
#line 82 "noweb/apirif.nw"
   RIF_VALUE,
#line 89 "noweb/apirif.nw"
   RIF_ERROR,
#line 157 "noweb/apirif.nw"
   RIF_PROGRAM,
#line 175 "noweb/apirif.nw"
   RIF_RESET,
#line 186 "noweb/apirif.nw"
   RIF_STEP,
#line 203 "noweb/apirif.nw"
   RIF_INPUTS,
#line 223 "noweb/apirif.nw"
   RIF_OUTPUTS,
#line 250 "noweb/apirif.nw"
   RIF_LOCALS,
#line 275 "noweb/apirif.nw"
   RIF_BEGIN_OUTS,
   RIF_END_OUTS,
   RIF_BEGIN_LOCS,
   RIF_END_LOCS,
#line 50 "noweb/apirif.nw"
	NB_RifItem
};
#line 5 "noweb/apirif.nw"
class RifReader : public BlaReader {
	
#line 24 "noweb/implrif.nw"
char* vers;
#line 40 "noweb/implrif.nw"
char error_buff[1024];
#line 134 "noweb/implrif.nw"
char* reset_pragma;
#line 147 "noweb/implrif.nw"
RifItem parse_reset_pragma();
#line 174 "noweb/implrif.nw"
char* program_pragma;
#line 187 "noweb/implrif.nw"
char* pname;
#line 203 "noweb/implrif.nw"
RifItem parse_program_pragma();
#line 238 "noweb/implrif.nw"
char* step_pragma;
#line 251 "noweb/implrif.nw"
int stepcpt;
#line 267 "noweb/implrif.nw"
RifItem parse_step_pragma();
#line 302 "noweb/implrif.nw"
STLight* idents;
#line 312 "noweb/implrif.nw"
char* inputs_pragma;
#line 325 "noweb/implrif.nw"
int nbins;
char** innames;
char** intypes;
#line 350 "noweb/implrif.nw"
RifItem parse_inputs_pragma();
#line 433 "noweb/implrif.nw"
char* outputs_pragma;
#line 446 "noweb/implrif.nw"
int nbouts;
char** outnames;
char** outtypes;
#line 471 "noweb/implrif.nw"
RifItem parse_outputs_pragma();
#line 549 "noweb/implrif.nw"
char* outs_pragma;
#line 568 "noweb/implrif.nw"
char* locals_pragma;
#line 581 "noweb/implrif.nw"
int nblocs;
char** locnames;
char** loctypes;
#line 606 "noweb/implrif.nw"
RifItem parse_locals_pragma();
#line 684 "noweb/implrif.nw"
char* locs_pragma;
#line 7 "noweb/apirif.nw"
public:
	
#line 24 "noweb/apirif.nw"
char* rif_version() { return "0"; }
char* version();
#line 33 "noweb/apirif.nw"
RifReader();
RifReader(FILE* inf);
RifReader(int (*f)() );
#line 44 "noweb/apirif.nw"
RifItem get();
#line 56 "noweb/apirif.nw"
const char* item_name(RifItem it);
#line 99 "noweb/apirif.nw"
char* error_msg();
#line 106 "noweb/apirif.nw"
char* cur_value();
#line 117 "noweb/apirif.nw"
int is_bool_value(char* v);
int is_bool_value(char* v, int* res);
#line 123 "noweb/apirif.nw"
int is_int_value(char* v);
int is_int_value(char* v, long* res);
#line 129 "noweb/apirif.nw"
int is_real_value(char* v);
int is_real_value(char* v, double* res);
#line 137 "noweb/apirif.nw"
int is_bottom_value(char* v);
#line 154 "noweb/apirif.nw"
void add_program_pragma();
#line 165 "noweb/apirif.nw"
char* program_name();
#line 172 "noweb/apirif.nw"
void add_reset_pragma();
#line 183 "noweb/apirif.nw"
void add_step_pragma();
#line 194 "noweb/apirif.nw"
int step();
#line 200 "noweb/apirif.nw"
void add_inputs_pragma();
#line 211 "noweb/apirif.nw"
int nb_inputs();
char* input_name(int i);
char* input_type(int i);
#line 219 "noweb/apirif.nw"
void add_outputs_pragma();
#line 231 "noweb/apirif.nw"
int nb_outputs();
char* output_name(int i);
char* output_type(int i);
#line 239 "noweb/apirif.nw"
void add_outs_pragma();
#line 246 "noweb/apirif.nw"
void add_locals_pragma();
#line 258 "noweb/apirif.nw"
int nb_locals();
char* local_name(int i);
char* local_type(int i);
#line 266 "noweb/apirif.nw"
void add_locs_pragma();
#line 9 "noweb/apirif.nw"
};
