diff -r ad4265253528 -r 76c87fdb5fc8 stage1_2/iec_bison.yy --- a/stage1_2/iec_bison.yy Tue Nov 20 00:01:57 2012 +0100 +++ b/stage1_2/iec_bison.yy Tue Nov 20 20:55:44 2012 +0100 @@ -8354,6 +8354,7 @@ return 0; } +/* Create a tmp file from a char buffer. */ FILE *ftmpopen (void *buf, size_t size, const char *opentype) { FILE *f; @@ -8363,7 +8364,11 @@ return f; } - +/* sstage2__ function allow to parse a ST code inside a string. + * We use this function to add into AST auto generated code like enum conversion functions. + * This appoach allow us to write future changes code indipendetly and to check generate code + * during developing. + */ int sstage2__(const char *text, symbol_c **tree_root_ref, bool full_token_loc_ /* error messages specify full token location */ @@ -8372,7 +8377,7 @@ FILE *in_file = NULL; if((in_file = ftmpopen((void *)text, strlen(text), "r")) == NULL) { - perror("Error temp file."); + perror("Error creating temp file."); return -1; } @@ -8381,6 +8386,12 @@ yydebug = 1; #endif yyin = in_file; + + /* We turn on "allow_function_overloading" flag to disable some checks. + * In detail when we add to symboltable a symbol already processed we + * don't want to get any error. + */ + allow_function_overloading = true; allow_extensible_function_parameters = false; full_token_loc = full_token_loc_;