stage4/generate_c/generate_c_vardecl.cc
changeset 805 b737cfc92614
parent 793 268bf4ca5fa1
child 810 d9c48ad646f1
equal deleted inserted replaced
798:d21e598b0b75 805:b737cfc92614
  1256   s4o.print(" : BOOL ");
  1256   s4o.print(" : BOOL ");
  1257   symbol->edge->accept(*this);
  1257   symbol->edge->accept(*this);
  1258   return NULL;
  1258   return NULL;
  1259 }
  1259 }
  1260 
  1260 
       
  1261 
  1261 void *visit(en_param_declaration_c *symbol) {
  1262 void *visit(en_param_declaration_c *symbol) {
  1262   TRACE("en_declaration_c");
  1263   TRACE("en_declaration_c");
       
  1264   update_type_init(symbol->type_decl);
  1263   if (wanted_varformat == finterface_vf) {
  1265   if (wanted_varformat == finterface_vf) {
  1264     finterface_var_count++;
  1266     finterface_var_count++;
  1265   }  
  1267   }  
  1266   if ((wanted_vartype & en_vt) != 0) {
  1268   if ((wanted_vartype & en_vt) != 0) {
  1267     if (wanted_varformat == finterface_vf) {
  1269     if (wanted_varformat == finterface_vf) {
  1268       s4o.print(nv->get());
  1270       s4o.print(nv->get());
  1269       s4o.print("\n" + s4o.indent_spaces);
  1271       s4o.print("\n" + s4o.indent_spaces);
  1270       symbol->type->accept(*this);
  1272       this->current_var_type_symbol->accept(*this);
  1271       s4o.print(" ");
  1273       s4o.print(" ");
  1272       symbol->name->accept(*this);
  1274       symbol->name->accept(*this);
  1273     }
  1275     }
  1274 
  1276 
  1275     if ((wanted_varformat == local_vf) ||
  1277     if ((wanted_varformat == local_vf) ||
  1277         (wanted_varformat == localinit_vf)) {
  1279         (wanted_varformat == localinit_vf)) {
  1278       s4o.print(s4o.indent_spaces);
  1280       s4o.print(s4o.indent_spaces);
  1279       if (wanted_varformat == local_vf) {
  1281       if (wanted_varformat == local_vf) {
  1280         s4o.print(DECLARE_VAR);
  1282         s4o.print(DECLARE_VAR);
  1281         s4o.print("(");
  1283         s4o.print("(");
  1282         symbol->type->accept(*this);
  1284         this->current_var_type_symbol->accept(*this);
  1283         s4o.print(",");
  1285         s4o.print(",");
  1284       }
  1286       }
  1285       else if (wanted_varformat == localinit_vf) {
  1287       else if (wanted_varformat == localinit_vf) {
  1286         symbol->type->accept(*this);
  1288         this->current_var_type_symbol->accept(*this);
  1287         s4o.print(" ");
  1289         s4o.print(" ");
  1288       }
  1290       }
  1289       print_variable_prefix();
  1291       print_variable_prefix();
  1290       symbol->name->accept(*this);
  1292       symbol->name->accept(*this);
  1291       if (wanted_varformat == local_vf)
  1293       if (wanted_varformat == local_vf)
  1292         s4o.print(")\n");
  1294         s4o.print(")\n");
  1293       else {
  1295       else {
  1294         s4o.print(" = ");
  1296         s4o.print(" = ");
  1295         symbol->value->accept(*this);
  1297         this->current_var_init_symbol->accept(*this);
  1296         s4o.print(";\n");
  1298         s4o.print(";\n");
  1297       }
  1299       }
  1298     }
  1300     }
  1299 
  1301 
  1300     if (wanted_varformat == constructorinit_vf) {
  1302     if (wanted_varformat == constructorinit_vf) {
  1304       s4o.print("(");
  1306       s4o.print("(");
  1305       this->print_variable_prefix();
  1307       this->print_variable_prefix();
  1306       // s4o.print("EN = __BOOL_LITERAL(TRUE);");
  1308       // s4o.print("EN = __BOOL_LITERAL(TRUE);");
  1307       symbol->name->accept(*this);
  1309       symbol->name->accept(*this);
  1308       s4o.print(",");
  1310       s4o.print(",");
  1309       symbol->value->accept(*this);
  1311       this->current_var_init_symbol->accept(*this);
  1310       print_retain();
  1312       print_retain();
  1311       s4o.print(")");
  1313       s4o.print(")");
  1312     }
  1314     }
  1313   }
  1315   }
       
  1316   void_type_init();
  1314   return NULL;
  1317   return NULL;
  1315 }
  1318 }
  1316 
  1319 
  1317 
  1320 
  1318 void *visit(eno_param_declaration_c *symbol) {
  1321 void *visit(eno_param_declaration_c *symbol) {