ECPG is not supposed to allow and output nested comments in C. These comments
are only allowed in the SQL parts and must not be written into the C file.
Also the different handling of different comments is documented.
These statements syntactically take the place of a C statement.
Depending on the particular statement, they can appear at the
global level or within a function. Embedded
-
SQL statements follow the case-sensitivity rules
- of normal
SQL code, and not those of C.
+
SQL statements follow the case-sensitivity rules of
+ normal
SQL code, and not those of C. Also they allow nested
+ C-style comments that are part of the SQL standard. The C part of the
+ program, however, follows the C standard of not accepting nested comments.
xcdepth++;
/* Put back any characters past slash-star; see above */
yyless(2);
- fputs("/*", yyout);
+ fputs("/_*", yyout);
}
{xcstop} {
- ECHO;
if (xcdepth <= 0)
{
+ ECHO;
BEGIN(state_before);
token_start = NULL;
}
else
+ {
xcdepth--;
+ fputs("*_/", yyout);
+ }
}
{xcstop} {
ECHO;
}
}
}
+{xcstop} { mmerror(PARSE_ERROR, ET_ERROR, "nested /* ... */ comments"); }
":" { return(':'); }
";" { return(';'); }
"," { return(','); }