stage1_2/stage1_2.cc
changeset 756 634f476cb60f
parent 748 ad4265253528
child 757 f1fc4aa6f0e3
equal deleted inserted replaced
755:7b90dd17f0ba 756:634f476cb60f
   290              const char *includedir,     /* Include directory, where included files will be searched for... */
   290              const char *includedir,     /* Include directory, where included files will be searched for... */
   291              symbol_c **tree_root_ref,
   291              symbol_c **tree_root_ref,
   292              bool full_token_loc         /* error messages specify full token location */
   292              bool full_token_loc         /* error messages specify full token location */
   293             );
   293             );
   294 
   294 
   295 int sstage2__(const char *text,
       
   296               symbol_c **tree_root_ref,
       
   297               bool full_token_loc         /* error messages specify full token location */
       
   298              );
       
   299 
       
   300 
   295 
   301 int stage1_2(const char *filename, symbol_c **tree_root_ref, stage1_2_options_t options) {
   296 int stage1_2(const char *filename, symbol_c **tree_root_ref, stage1_2_options_t options) {
   302       /* NOTE: we only call stage2 (bison - syntax analysis) directly, as stage 2 will itself call stage1 (flex - lexical analysis)
   297       /* NOTE: we only call stage2 (bison - syntax analysis) directly, as stage 2 will itself call stage1 (flex - lexical analysis)
   303        *       automatically as needed
   298        *       automatically as needed
   304        */
   299        */
   310        *       We now set those variables...
   305        *       We now set those variables...
   311        */
   306        */
   312 
   307 
   313   safe_extensions_ = options.safe_extensions;
   308   safe_extensions_ = options.safe_extensions;
   314   conversion_functions_ = options.conversion_functions;
   309   conversion_functions_ = options.conversion_functions;
   315   int ret = stage2__(filename, options.includedir, tree_root_ref, options.full_token_loc);
   310   return stage2__(filename, options.includedir, tree_root_ref, options.full_token_loc);
   316 
   311 }
   317   if (conversion_functions_) {
   312 
   318 	  create_enumtype_conversion_functions_c create_enumtype_conversion_functions_c(*tree_root_ref);
       
   319 	  std::string source_code = create_enumtype_conversion_functions_c.get_declaration(*tree_root_ref);
       
   320 	  ret = sstage2__(source_code.c_str(), tree_root_ref, false);
       
   321   }
       
   322   return ret;
       
   323 }
       
   324