stage1_2/iec_bison.yy
changeset 946 c012a64dc2fa
parent 945 477393b00f95
child 952 e984cfdf3b10
child 960 27063736913f
equal deleted inserted replaced
945:477393b00f95 946:c012a64dc2fa
  8485 
  8485 
  8486 extern const char *INCLUDE_DIRECTORIES[];
  8486 extern const char *INCLUDE_DIRECTORIES[];
  8487 
  8487 
  8488 
  8488 
  8489 int stage2__(const char *filename, 
  8489 int stage2__(const char *filename, 
  8490              symbol_c **tree_root_ref,
  8490              symbol_c **tree_root_ref
  8491              stage1_2_options_t options
       
  8492             ) {             
  8491             ) {             
  8493   char *libfilename = NULL;
  8492   char *libfilename = NULL;
  8494 
  8493 
  8495   if (options.includedir != NULL) {
  8494   if (runtime_options.includedir != NULL) {
  8496     INCLUDE_DIRECTORIES[0] = options.includedir;
  8495     INCLUDE_DIRECTORIES[0] = runtime_options.includedir;
  8497   }
  8496   }
  8498 
  8497 
  8499   /* first parse the standard library file... */
  8498   /* first parse the standard library file... */
  8500   /* Do not debug the standard library, even if debug flag is set! */
  8499   /* Do not debug the standard library, even if debug flag is set! */
  8501   /*
  8500   /*
  8518     return -1;
  8517     return -1;
  8519   }
  8518   }
  8520 
  8519 
  8521   allow_function_overloading           = true;
  8520   allow_function_overloading           = true;
  8522   allow_extensible_function_parameters = true;
  8521   allow_extensible_function_parameters = true;
  8523   full_token_loc                       = options.full_token_loc;
  8522   full_token_loc                       = runtime_options.full_token_loc;
  8524   conversion_functions                 = options.conversion_functions;
  8523   conversion_functions                 = runtime_options.conversion_functions;
  8525   allow_ref_dereferencing              = options.ref_standard_extensions;
  8524   allow_ref_dereferencing              = runtime_options.ref_standard_extensions;
  8526   allow_ref_to_any                     = options.ref_nonstand_extensions;
  8525   allow_ref_to_any                     = runtime_options.ref_nonstand_extensions;
  8527   allow_ref_to_in_derived_datatypes    = options.ref_nonstand_extensions;
  8526   allow_ref_to_in_derived_datatypes    = runtime_options.ref_nonstand_extensions;
  8528   if (yyparse() != 0)
  8527   if (yyparse() != 0)
  8529       ERROR;
  8528       ERROR;
  8530   fclose(libfile);
  8529   fclose(libfile);
  8531       
  8530       
  8532   if (yynerrs > 0) {
  8531   if (yynerrs > 0) {
  8555     return -1;
  8554     return -1;
  8556   }
  8555   }
  8557 
  8556 
  8558   allow_function_overloading           = false;
  8557   allow_function_overloading           = false;
  8559   allow_extensible_function_parameters = false;
  8558   allow_extensible_function_parameters = false;
  8560   full_token_loc                       = options.full_token_loc;
  8559   full_token_loc                       = runtime_options.full_token_loc;
  8561   conversion_functions                 = options.conversion_functions;
  8560   conversion_functions                 = runtime_options.conversion_functions;
  8562   allow_ref_dereferencing              = options.ref_standard_extensions;
  8561   allow_ref_dereferencing              = runtime_options.ref_standard_extensions;
  8563   allow_ref_to_any                     = options.ref_nonstand_extensions;
  8562   allow_ref_to_any                     = runtime_options.ref_nonstand_extensions;
  8564   allow_ref_to_in_derived_datatypes    = options.ref_nonstand_extensions;
  8563   allow_ref_to_in_derived_datatypes    = runtime_options.ref_nonstand_extensions;
  8565   //allow_ref_to_any = false;    /* we only allow REF_TO ANY in library functions/FBs, no matter what the user asks for in the command line */
  8564   //allow_ref_to_any = false;    /* we only allow REF_TO ANY in library functions/FBs, no matter what the user asks for in the command line */
  8566 
  8565 
  8567   if (yyparse() != 0) {
  8566   if (yyparse() != 0) {
  8568     fprintf (stderr, "\nParsing failed because of too many consecutive syntax errors. Bailing out!\n");
  8567     fprintf (stderr, "\nParsing failed because of too many consecutive syntax errors. Bailing out!\n");
  8569     exit(EXIT_FAILURE);
  8568     exit(EXIT_FAILURE);