case ECPGt_unsigned_long:
case ECPGt_unsigned_long_long:
case ECPGt_const:
- fputs(name, yyout);
+ fputs(name, base_yyout);
break;
default:
mmerror(PARSE_ERROR, ET_ERROR, "variable \"%s\" must have a numeric type", name);
{
struct assignment *results;
- fprintf(yyout, "{ ECPGget_desc_header(__LINE__, %s, &(", desc_name);
+ fprintf(base_yyout, "{ ECPGget_desc_header(__LINE__, %s, &(", desc_name);
for (results = assignments; results != NULL; results = results->next)
{
if (results->value == ECPGd_count)
}
drop_assignments();
- fprintf(yyout, "));\n");
+ fprintf(base_yyout, "));\n");
whenever_action(3);
}
{
struct assignment *results;
- fprintf(yyout, "{ ECPGget_desc(__LINE__, %s, %s,", desc_name, index);
+ fprintf(base_yyout, "{ ECPGget_desc(__LINE__, %s, %s,", desc_name, index);
for (results = assignments; results != NULL; results = results->next)
{
const struct variable *v = find_variable(results->variable);
default:
break;
}
- fprintf(yyout, "%s,", get_dtype(results->value));
- ECPGdump_a_type(yyout, v->name, v->type, v->brace_level, NULL, NULL, -1, NULL, NULL, str_zero, NULL, NULL);
+ fprintf(base_yyout, "%s,", get_dtype(results->value));
+ ECPGdump_a_type(base_yyout, v->name, v->type, v->brace_level,
+ NULL, NULL, -1, NULL, NULL, str_zero, NULL, NULL);
free(str_zero);
}
drop_assignments();
- fputs("ECPGd_EODT);\n", yyout);
+ fputs("ECPGd_EODT);\n", base_yyout);
whenever_action(2 | 1);
}
{
struct assignment *results;
- fprintf(yyout, "{ ECPGset_desc_header(__LINE__, %s, (int)(", desc_name);
+ fprintf(base_yyout, "{ ECPGset_desc_header(__LINE__, %s, (int)(", desc_name);
for (results = assignments; results != NULL; results = results->next)
{
if (results->value == ECPGd_count)
}
drop_assignments();
- fprintf(yyout, "));\n");
+ fprintf(base_yyout, "));\n");
whenever_action(3);
}
{
struct assignment *results;
- fprintf(yyout, "{ ECPGset_desc(__LINE__, %s, %s,", desc_name, index);
+ fprintf(base_yyout, "{ ECPGset_desc(__LINE__, %s, %s,", desc_name, index);
for (results = assignments; results != NULL; results = results->next)
{
const struct variable *v = find_variable(results->variable);
case ECPGd_length:
case ECPGd_type:
{
- char *str_zero = mm_strdup("0");
- fprintf(yyout, "%s,", get_dtype(results->value));
- ECPGdump_a_type(yyout, v->name, v->type, v->brace_level, NULL, NULL, -1, NULL, NULL, str_zero, NULL, NULL);
+ char *str_zero = mm_strdup("0");
+
+ fprintf(base_yyout, "%s,", get_dtype(results->value));
+ ECPGdump_a_type(base_yyout, v->name, v->type, v->brace_level,
+ NULL, NULL, -1, NULL, NULL, str_zero, NULL, NULL);
free(str_zero);
}
break;
}
}
drop_assignments();
- fputs("ECPGd_EODT);\n", yyout);
+ fputs("ECPGd_EODT);\n", base_yyout);
whenever_action(2 | 1);
}
if (connection)
mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in CLOSE DATABASE statement");
- fprintf(yyout, "{ ECPGdisconnect(__LINE__, \"CURRENT\");");
+ fprintf(base_yyout, "{ ECPGdisconnect(__LINE__, \"CURRENT\");");
whenever_action(2);
free($1);
break;
}
ECPG: stmtTransactionStmt block
{
- fprintf(yyout, "{ ECPGtrans(__LINE__, %s, \"%s\");", connection ? connection : "NULL", $1);
+ fprintf(base_yyout, "{ ECPGtrans(__LINE__, %s, \"%s\");", connection ? connection : "NULL", $1);
whenever_action(2);
free($1);
}
ECPG: stmtViewStmt rule
| ECPGAllocateDescr
{
- fprintf(yyout,"ECPGallocate_desc(__LINE__, %s);",$1);
+ fprintf(base_yyout,"ECPGallocate_desc(__LINE__, %s);",$1);
whenever_action(0);
free($1);
}
if (connection)
mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in CONNECT statement");
- fprintf(yyout, "{ ECPGconnect(__LINE__, %d, %s, %d); ", compat, $1, autocommit);
+ fprintf(base_yyout, "{ ECPGconnect(__LINE__, %d, %s, %d); ", compat, $1, autocommit);
reset_variables();
whenever_action(2);
free($1);
}
| ECPGDeallocateDescr
{
- fprintf(yyout,"ECPGdeallocate_desc(__LINE__, %s);",$1);
+ fprintf(base_yyout,"ECPGdeallocate_desc(__LINE__, %s);",$1);
whenever_action(0);
free($1);
}
}
| ECPGDescribe
{
- fprintf(yyout, "{ ECPGdescribe(__LINE__, %d, %s,", compat, $1);
+ fprintf(base_yyout, "{ ECPGdescribe(__LINE__, %d, %s,", compat, $1);
dump_variables(argsresult, 1);
- fputs("ECPGt_EORT);", yyout);
- fprintf(yyout, "}");
+ fputs("ECPGt_EORT);", base_yyout);
+ fprintf(base_yyout, "}");
output_line_number();
free($1);
if (connection)
mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in DISCONNECT statement");
- fprintf(yyout, "{ ECPGdisconnect(__LINE__, %s);",
+ fprintf(base_yyout, "{ ECPGdisconnect(__LINE__, %s);",
$1 ? $1 : "\"CURRENT\"");
whenever_action(2);
free($1);
const char *con = connection ? connection : "NULL";
if (strcmp($1, "all") == 0)
- fprintf(yyout, "{ ECPGdeallocate_all(__LINE__, %d, %s);", compat, con);
+ fprintf(base_yyout, "{ ECPGdeallocate_all(__LINE__, %d, %s);", compat, con);
else if ($1[0] == ':')
- fprintf(yyout, "{ ECPGdeallocate(__LINE__, %d, %s, %s);", compat, con, $1+1);
+ fprintf(base_yyout, "{ ECPGdeallocate(__LINE__, %d, %s, %s);", compat, con, $1+1);
else
- fprintf(yyout, "{ ECPGdeallocate(__LINE__, %d, %s, \"%s\");", compat, con, $1);
+ fprintf(base_yyout, "{ ECPGdeallocate(__LINE__, %d, %s, \"%s\");", compat, con, $1);
whenever_action(2);
free($1);
}
| ECPGSetAutocommit
{
- fprintf(yyout, "{ ECPGsetcommit(__LINE__, \"%s\", %s);", $1, connection ? connection : "NULL");
+ fprintf(base_yyout, "{ ECPGsetcommit(__LINE__, \"%s\", %s);", $1, connection ? connection : "NULL");
whenever_action(2);
free($1);
}
if (connection)
mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in SET CONNECTION statement");
- fprintf(yyout, "{ ECPGsetconn(__LINE__, %s);", $1);
+ fprintf(base_yyout, "{ ECPGsetconn(__LINE__, %s);", $1);
whenever_action(2);
free($1);
}
if (connection)
mmerror(PARSE_ERROR, ET_ERROR, "AT option not allowed in TYPE statement");
- fprintf(yyout, "%s", $1);
+ fprintf(base_yyout, "%s", $1);
free($1);
output_line_number();
}
case 'o':
output_filename = optarg;
if (strcmp(output_filename, "-") == 0)
- yyout = stdout;
+ base_yyout = stdout;
else
- yyout = fopen(output_filename, PG_BINARY_W);
+ base_yyout = fopen(output_filename, PG_BINARY_W);
- if (yyout == NULL)
+ if (base_yyout == NULL)
{
fprintf(stderr, _("%s: could not open file \"%s\": %s\n"),
progname, output_filename, strerror(errno));
break;
case 'd':
#ifdef YYDEBUG
- yydebug = 1;
+ base_yydebug = 1;
#else
fprintf(stderr, _("%s: parser debug support (-d) not available\n"),
progname);
{
input_filename = mm_alloc(strlen("stdin") + 1);
strcpy(input_filename, "stdin");
- yyin = stdin;
+ base_yyin = stdin;
}
else
{
ptr2ext[4] = '\0';
}
- yyin = fopen(input_filename, PG_BINARY_R);
+ base_yyin = fopen(input_filename, PG_BINARY_R);
}
if (out_option == 0) /* calculate the output name */
{
if (strcmp(input_filename, "stdin") == 0)
- yyout = stdout;
+ base_yyout = stdout;
else
{
output_filename = strdup(input_filename);
ptr2ext[1] = (header_mode == true) ? 'h' : 'c';
ptr2ext[2] = '\0';
- yyout = fopen(output_filename, PG_BINARY_W);
- if (yyout == NULL)
+ base_yyout = fopen(output_filename, PG_BINARY_W);
+ if (base_yyout == NULL)
{
fprintf(stderr, _("%s: could not open file \"%s\": %s\n"),
progname, output_filename, strerror(errno));
}
}
- if (yyin == NULL)
+ if (base_yyin == NULL)
fprintf(stderr, _("%s: could not open file \"%s\": %s\n"),
progname, argv[fnr], strerror(errno));
else
/* we need several includes */
/* but not if we are in header mode */
if (regression_mode)
- fprintf(yyout, "/* Processed by ecpg (regression mode) */\n");
+ fprintf(base_yyout, "/* Processed by ecpg (regression mode) */\n");
else
- fprintf(yyout, "/* Processed by ecpg (%d.%d.%d) */\n", MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL);
+ fprintf(base_yyout, "/* Processed by ecpg (%d.%d.%d) */\n", MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL);
if (header_mode == false)
{
- fprintf(yyout, "/* These include files are added by the preprocessor */\n#include <ecpglib.h>\n#include <ecpgerrno.h>\n#include <sqlca.h>\n");
+ fprintf(base_yyout, "/* These include files are added by the preprocessor */\n#include <ecpglib.h>\n#include <ecpgerrno.h>\n#include <sqlca.h>\n");
/* add some compatibility headers */
if (INFORMIX_MODE)
- fprintf(yyout, "/* Needed for informix compatibility */\n#include <ecpg_informix.h>\n");
+ fprintf(base_yyout, "/* Needed for informix compatibility */\n#include <ecpg_informix.h>\n");
- fprintf(yyout, "/* End of automatic include section */\n");
+ fprintf(base_yyout, "/* End of automatic include section */\n");
}
if (regression_mode)
- fprintf(yyout, "#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))\n");
+ fprintf(base_yyout, "#define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))\n");
output_line_number();
if (!(ptr->opened))
mmerror(PARSE_ERROR, ET_WARNING, "cursor \"%s\" has been declared but not opened", ptr->name);
- if (yyin != NULL && yyin != stdin)
- fclose(yyin);
- if (out_option == 0 && yyout != stdout)
- fclose(yyout);
+ if (base_yyin != NULL && base_yyin != stdin)
+ fclose(base_yyin);
+ if (out_option == 0 && base_yyout != stdout)
+ fclose(base_yyout);
/*
* If there was an error, delete the output file.
/* internationalize the error message string */
error = _(error);
- fprintf(stderr, "%s:%d: ", input_filename, yylineno);
+ fprintf(stderr, "%s:%d: ", input_filename, base_yylineno);
switch(type)
{
ret_value = error_code;
break;
case ET_FATAL:
- if (yyin)
- fclose(yyin);
- if (yyout)
- fclose(yyout);
+ if (base_yyin)
+ fclose(base_yyin);
+ if (base_yyout)
+ fclose(base_yyout);
if (strcmp(output_filename, "-") != 0 && unlink(output_filename) != 0)
fprintf(stderr, _("could not remove output file \"%s\"\n"), output_filename);
static char *
make_name(void)
{
- return mm_strdup(yytext);
+ return mm_strdup(base_yytext);
}
static char *
| ecpgstart stmt ';'
| ecpgstart ECPGVarDeclaration
{
- fprintf(yyout, "%s", $2);
+ fprintf(base_yyout, "%s", $2);
free($2);
output_line_number();
}
| ECPGDeclaration
- | c_thing { fprintf(yyout, "%s", $1); free($1); }
- | CPP_LINE { fprintf(yyout, "%s", $1); free($1); }
- | '{' { braces_open++; fputs("{", yyout); }
+ | c_thing { fprintf(base_yyout, "%s", $1); free($1); }
+ | CPP_LINE { fprintf(base_yyout, "%s", $1); free($1); }
+ | '{' { braces_open++; fputs("{", base_yyout); }
| '}'
{
remove_typedefs(braces_open);
free(current_function);
current_function = NULL;
}
- fputs("}", yyout);
+ fputs("}", base_yyout);
}
;
* variable declaration inside exec sql declare block
*/
ECPGDeclaration: sql_startdeclare
- { fputs("/* exec sql begin declare section */", yyout); }
+ { fputs("/* exec sql begin declare section */", base_yyout); }
var_type_declarations sql_enddeclare
{
- fprintf(yyout, "%s/* exec sql end declare section */", $3);
+ fprintf(base_yyout, "%s/* exec sql end declare section */", $3);
free($3);
output_line_number();
}
{
add_typedef($5, $6.index1, $6.index2, $3.type_enum, $3.type_dimension, $3.type_index, initializer, *$4 ? 1 : 0);
- fprintf(yyout, "typedef %s %s %s %s;\n", $3.type_str, *$4 ? "*" : "", $5, $6.str);
+ fprintf(base_yyout, "typedef %s %s %s %s;\n", $3.type_str, *$4 ? "*" : "", $5, $6.str);
output_line_number();
$$ = mm_strdup("");
};
{
/* translator: %s is typically the translation of "syntax error" */
mmerror(PARSE_ERROR, ET_ERROR, "%s at or near \"%s\"",
- _(error), token_start ? token_start : yytext);
+ _(error), token_start ? token_start : base_yytext);
}
void parser_init(void)
extern char *descriptor_name;
extern char *connection;
extern char *input_filename;
-extern char *yytext,
+extern char *base_yytext,
*token_start;
#ifdef YYDEBUG
-extern int yydebug;
+extern int base_yydebug;
#endif
-extern int yylineno;
-extern FILE *yyin,
- *yyout;
+extern int base_yylineno;
+extern FILE *base_yyin,
+ *base_yyout;
extern char *output_filename;
extern struct _include_path *include_paths;
{
char *line = hashline_number();
- fprintf(yyout, "%s", line);
+ fprintf(base_yyout, "%s", line);
free(line);
}
switch (w->code)
{
case W_SQLPRINT:
- fprintf(yyout, "sqlprint();");
+ fprintf(base_yyout, "sqlprint();");
break;
case W_GOTO:
- fprintf(yyout, "goto %s;", w->command);
+ fprintf(base_yyout, "goto %s;", w->command);
break;
case W_DO:
- fprintf(yyout, "%s;", w->command);
+ fprintf(base_yyout, "%s;", w->command);
break;
case W_STOP:
- fprintf(yyout, "exit (1);");
+ fprintf(base_yyout, "exit (1);");
break;
case W_BREAK:
- fprintf(yyout, "break;");
+ fprintf(base_yyout, "break;");
break;
default:
- fprintf(yyout, "{/* %d not implemented yet */}", w->code);
+ fprintf(base_yyout, "{/* %d not implemented yet */}", w->code);
break;
}
}
if ((mode & 1) == 1 && when_nf.code != W_NOTHING)
{
output_line_number();
- fprintf(yyout, "\nif (sqlca.sqlcode == ECPG_NOT_FOUND) ");
+ fprintf(base_yyout, "\nif (sqlca.sqlcode == ECPG_NOT_FOUND) ");
print_action(&when_nf);
}
if (when_warn.code != W_NOTHING)
{
output_line_number();
- fprintf(yyout, "\nif (sqlca.sqlwarn[0] == 'W') ");
+ fprintf(base_yyout, "\nif (sqlca.sqlwarn[0] == 'W') ");
print_action(&when_warn);
}
if (when_error.code != W_NOTHING)
{
output_line_number();
- fprintf(yyout, "\nif (sqlca.sqlcode < 0) ");
+ fprintf(base_yyout, "\nif (sqlca.sqlcode < 0) ");
print_action(&when_error);
}
if ((mode & 2) == 2)
- fputc('}', yyout);
+ fputc('}', base_yyout);
output_line_number();
}
/* do not print line numbers if we are in debug mode */
if (input_filename
#ifdef YYDEBUG
- && !yydebug
+ && !base_yydebug
#endif
)
{
char *src,
*dest;
- sprintf(line, "\n#line %d \"", yylineno);
+ sprintf(line, "\n#line %d \"", base_yylineno);
src = input_filename;
dest = line + strlen(line);
while (*src)
void
output_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st)
{
- fprintf(yyout, "{ ECPGdo(__LINE__, %d, %d, %s, %d, ", compat, force_indicator, connection ? connection : "NULL", questionmarks);
+ fprintf(base_yyout, "{ ECPGdo(__LINE__, %d, %d, %s, %d, ", compat, force_indicator, connection ? connection : "NULL", questionmarks);
if (st == ECPGst_execute || st == ECPGst_exec_immediate)
{
- fprintf(yyout, "%s, %s, ", ecpg_statement_type_name[st], stmt);
+ fprintf(base_yyout, "%s, %s, ", ecpg_statement_type_name[st], stmt);
}
else
{
if (st == ECPGst_prepnormal && auto_prepare)
- fputs("ECPGst_prepnormal, \"", yyout);
+ fputs("ECPGst_prepnormal, \"", base_yyout);
else
- fputs("ECPGst_normal, \"", yyout);
+ fputs("ECPGst_normal, \"", base_yyout);
output_escaped_str(stmt, false);
- fputs("\", ", yyout);
+ fputs("\", ", base_yyout);
}
/* dump variables to C file */
dump_variables(argsinsert, 1);
- fputs("ECPGt_EOIT, ", yyout);
+ fputs("ECPGt_EOIT, ", base_yyout);
dump_variables(argsresult, 1);
- fputs("ECPGt_EORT);", yyout);
+ fputs("ECPGt_EORT);", base_yyout);
reset_variables();
whenever_action(whenever_mode | 2);
void
output_prepare_statement(char *name, char *stmt)
{
- fprintf(yyout, "{ ECPGprepare(__LINE__, %s, %d, ", connection ? connection : "NULL", questionmarks);
+ fprintf(base_yyout, "{ ECPGprepare(__LINE__, %s, %d, ", connection ? connection : "NULL", questionmarks);
output_escaped_str(name, true);
- fputs(", ", yyout);
+ fputs(", ", base_yyout);
output_escaped_str(stmt, true);
- fputs(");", yyout);
+ fputs(");", base_yyout);
whenever_action(2);
free(name);
if (connection != NULL)
if (strcmp(name, "all") != 0)
{
- fprintf(yyout, "{ ECPGdeallocate(__LINE__, %d, %s, ", compat, con);
+ fprintf(base_yyout, "{ ECPGdeallocate(__LINE__, %d, %s, ", compat, con);
output_escaped_str(name, true);
- fputs(");", yyout);
+ fputs(");", base_yyout);
}
else
- fprintf(yyout, "{ ECPGdeallocate_all(__LINE__, %d, %s);", compat, con);
+ fprintf(base_yyout, "{ ECPGdeallocate_all(__LINE__, %d, %s);", compat, con);
whenever_action(2);
free(name);
{
i = 1;
len--;
- fputs("\"", yyout);
+ fputs("\"", base_yyout);
}
/* output this char by char as we have to filter " and \n */
for (; i < len; i++)
{
if (str[i] == '"')
- fputs("\\\"", yyout);
+ fputs("\\\"", base_yyout);
else if (str[i] == '\n')
- fputs("\\\n", yyout);
+ fputs("\\\n", base_yyout);
else if (str[i] == '\\')
{
int j = i;
if ((str[j] != '\n') && (str[j] != '\r' || str[j + 1] != '\n')) /* not followed by a
* newline */
- fputs("\\\\", yyout);
+ fputs("\\\\", base_yyout);
}
else if (str[i] == '\r' && str[i + 1] == '\n')
{
- fputs("\\\r\n", yyout);
+ fputs("\\\r\n", base_yyout);
i++;
}
else
- fputc(str[i], yyout);
+ fputc(str[i], base_yyout);
}
if (quoted && str[0] == '\"' && str[len] == '\"')
- fputs("\"", yyout);
+ fputs("\"", base_yyout);
}
#include "extern.h"
#include "preproc.h"
-
-/*
- * Change symbol names as expected by preproc.y. It'd be better to do this
- * with %option prefix="base_yy", but that affects some other names that
- * various files expect *not* to be prefixed with "base_". Cleaning it up
- * is not worth the trouble right now.
- */
-#define yylex base_yylex
-#define yylval base_yylval
}
%{
-extern YYSTYPE yylval;
+extern YYSTYPE base_yylval;
static int xcdepth = 0; /* depth of nesting in slash-star comments */
static char *dolqstart = NULL; /* current $foo$ quote start string */
%option noinput
%option noyywrap
%option warn
+%option prefix="base_yy"
%option yylineno
BEGIN(SQL);
if (literalbuf[strspn(literalbuf, "01") + 1] != '\0')
mmerror(PARSE_ERROR, ET_ERROR, "invalid bit string literal");
- yylval.str = mm_strdup(literalbuf);
+ base_yylval.str = mm_strdup(literalbuf);
return BCONST;
}
<xh>{quotefail} {
yyless(1);
BEGIN(SQL);
- yylval.str = mm_strdup(literalbuf);
+ base_yylval.str = mm_strdup(literalbuf);
return XCONST;
}
<xq,xqc>{quotefail} {
yyless(1);
BEGIN(state_before);
- yylval.str = mm_strdup(literalbuf);
+ base_yylval.str = mm_strdup(literalbuf);
return SCONST;
}
<xe>{quotestop} |
<xe>{quotefail} {
yyless(1);
BEGIN(state_before);
- yylval.str = mm_strdup(literalbuf);
+ base_yylval.str = mm_strdup(literalbuf);
return ECONST;
}
<xn>{quotestop} |
<xn>{quotefail} {
yyless(1);
BEGIN(state_before);
- yylval.str = mm_strdup(literalbuf);
+ base_yylval.str = mm_strdup(literalbuf);
return NCONST;
}
<xus>{xusstop} {
addlit(yytext, yyleng);
BEGIN(state_before);
- yylval.str = mm_strdup(literalbuf);
+ base_yylval.str = mm_strdup(literalbuf);
return UCONST;
}
<xq,xe,xn,xus>{xqdouble} { addlitchar('\''); }
addlit(yytext, yyleng);
free(dolqstart);
BEGIN(SQL);
- yylval.str = mm_strdup(literalbuf);
+ base_yylval.str = mm_strdup(literalbuf);
return DOLCONST;
}
else
if (literallen == 0)
mmerror(PARSE_ERROR, ET_ERROR, "zero-length delimited identifier");
/* The backend will truncate the identifier here. We do not as it does not change the result. */
- yylval.str = mm_strdup(literalbuf);
+ base_yylval.str = mm_strdup(literalbuf);
return CSTRING;
}
<xdc>{xdstop} {
BEGIN(state_before);
- yylval.str = mm_strdup(literalbuf);
+ base_yylval.str = mm_strdup(literalbuf);
return CSTRING;
}
<xui>{xuistop} {
mmerror(PARSE_ERROR, ET_ERROR, "zero-length delimited identifier");
/* The backend will truncate the identifier here. We do not as it does not change the result. */
addlit(yytext, yyleng);
- yylval.str = mm_strdup(literalbuf);
+ base_yylval.str = mm_strdup(literalbuf);
return UIDENT;
}
<xd,xui>{xddouble} { addlitchar('"'); }
/* Convert "!=" operator to "<>" for compatibility */
if (strcmp(yytext, "!=") == 0)
- yylval.str = mm_strdup("<>");
+ base_yylval.str = mm_strdup("<>");
else
- yylval.str = mm_strdup(yytext);
+ base_yylval.str = mm_strdup(yytext);
return Op;
}
<SQL>{param} {
- yylval.ival = atol(yytext+1);
+ base_yylval.ival = atol(yytext+1);
return PARAM;
}
<C,SQL>{integer} {
)
{
errno = 0;
- yylval.str = mm_strdup(yytext);
+ base_yylval.str = mm_strdup(yytext);
return FCONST;
}
- yylval.ival = val;
+ base_yylval.ival = val;
return ICONST;
}
<SQL>{ip} {
- yylval.str = mm_strdup(yytext);
+ base_yylval.str = mm_strdup(yytext);
return IP;
}
<C,SQL>{decimal} {
- yylval.str = mm_strdup(yytext);
+ base_yylval.str = mm_strdup(yytext);
return FCONST;
}
<C,SQL>{real} {
- yylval.str = mm_strdup(yytext);
+ base_yylval.str = mm_strdup(yytext);
return FCONST;
}
<SQL>{realfail1} {
yyless(yyleng-1);
- yylval.str = mm_strdup(yytext);
+ base_yylval.str = mm_strdup(yytext);
return FCONST;
}
<SQL>{realfail2} {
yyless(yyleng-2);
- yylval.str = mm_strdup(yytext);
+ base_yylval.str = mm_strdup(yytext);
return FCONST;
}
<SQL>:{identifier}((("->"|\.){identifier})|(\[{array}\]))* {
- yylval.str = mm_strdup(yytext+1);
+ base_yylval.str = mm_strdup(yytext+1);
return(CVARIABLE);
}
<SQL>{identifier} {
* to do so; that's just another way that ecpg could get
* out of step with the backend.
*/
- yylval.str = mm_strdup(yytext);
+ base_yylval.str = mm_strdup(yytext);
return IDENT;
}
}
char* endptr;
errno = 0;
- yylval.ival = strtoul((char *)yytext,&endptr,16);
+ base_yylval.ival = strtoul((char *)yytext,&endptr,16);
if (*endptr != '\0' || errno == ERANGE)
{
errno = 0;
- yylval.str = mm_strdup(yytext);
+ base_yylval.str = mm_strdup(yytext);
return SCONST;
}
return ICONST;
}
else
{
- yylval.str = mm_strdup(yytext);
+ base_yylval.str = mm_strdup(yytext);
return(CPP_LINE);
}
}
}
else
{
- yylval.str = mm_strdup(yytext);
+ base_yylval.str = mm_strdup(yytext);
return(CPP_LINE);
}
}
<C,SQL>{cppline} {
- yylval.str = mm_strdup(yytext);
+ base_yylval.str = mm_strdup(yytext);
return(CPP_LINE);
}
<C>{identifier} {
return keyword->value;
else
{
- yylval.str = mm_strdup(yytext);
+ base_yylval.str = mm_strdup(yytext);
return IDENT;
}
}
dump_variables(list->next, mode);
/* Then the current element and its indicator */
- ECPGdump_a_type(yyout, list->variable->name, list->variable->type, list->variable->brace_level,
+ ECPGdump_a_type(base_yyout, list->variable->name, list->variable->type, list->variable->brace_level,
list->indicator->name, list->indicator->type, list->indicator->brace_level,
NULL, NULL, str_zero, NULL, NULL);