MCPcopy Create free account
hub / github.com/apache/cloudberry / orafce_sql_yyerror

Function orafce_sql_yyerror

gpcontrib/orafce/sqlscan.c:3199–3218  ·  view source on GitHub ↗

* yyerror * Report a lexer or grammar error. * * The message's cursor position identifies the most recently lexed token. * This is OK for syntax error messages from the Bison parser, because Bison * parsers report error as soon as the first unparsable token is reached. * Beware of using yyerror for other purposes, as the cursor position might * be misleading! */

Source from the content-addressed store, hash-verified

3197 * be misleading!
3198 */
3199void
3200orafce_sql_yyerror(List **result, const char *message)
3201{
3202 const char *loc = scanbuf + orafce_sql_yylval.val.lloc;
3203
3204 if (*loc == YY_END_OF_BUFFER_CHAR)
3205 {
3206 ereport(ERROR,
3207 (errcode(ERRCODE_SYNTAX_ERROR),
3208 errmsg("%s at end of input", message),
3209 lexer_errposition()));
3210 }
3211 else
3212 {
3213 ereport(ERROR,
3214 (errcode(ERRCODE_SYNTAX_ERROR),
3215 errmsg("%s at or near \"%s\"", message, loc),
3216 lexer_errposition()));
3217 }
3218}
3219
3220
3221/*

Callers 1

plvlex_tokensFunction · 0.85

Calls 3

lexer_errpositionFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by

no test coverage detected