PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ yy_syntax_error_arguments()

static int yy_syntax_error_arguments ( const yypcontext_t yyctx,
yysymbol_kind_t  yyarg[],
int  yyargn 
)
static

Definition at line 1369 of file lwin_wkt_parse.c.

1371{
1372 /* Actual size of YYARG. */
1373 int yycount = 0;
1374 /* There are many possibilities here to consider:
1375 - If this state is a consistent state with a default action, then
1376 the only way this function was invoked is if the default action
1377 is an error action. In that case, don't check for expected
1378 tokens because there are none.
1379 - The only way there can be no lookahead present (in yychar) is if
1380 this state is a consistent state with a default action. Thus,
1381 detecting the absence of a lookahead is sufficient to determine
1382 that there is no unexpected or expected token to report. In that
1383 case, just report a simple "syntax error".
1384 - Don't assume there isn't a lookahead just because this state is a
1385 consistent state with a default action. There might have been a
1386 previous inconsistent state, consistent state with a non-default
1387 action, or user semantic action that manipulated yychar.
1388 - Of course, the expected token list depends on states to have
1389 correct lookahead information, and it depends on the parser not
1390 to perform extra reductions after fetching a lookahead from the
1391 scanner and before detecting a syntax error. Thus, state merging
1392 (from LALR or IELR) and default reductions corrupt the expected
1393 token list. However, the list is correct for canonical LR with
1394 one exception: it will still contain any token that will not be
1395 accepted due to an error action in a later state.
1396 */
1397 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
1398 {
1399 int yyn;
1400 if (yyarg)
1401 yyarg[yycount] = yyctx->yytoken;
1402 ++yycount;
1403 yyn = yypcontext_expected_tokens (yyctx,
1404 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1405 if (yyn == YYENOMEM)
1406 return YYENOMEM;
1407 else
1408 yycount += yyn;
1409 }
1410 return yycount;
1411}
@ YYSYMBOL_YYEMPTY
static int yypcontext_expected_tokens(const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn)
@ YYENOMEM
yysymbol_kind_t yytoken

References YYENOMEM, yypcontext_expected_tokens(), YYSYMBOL_YYEMPTY, and yypcontext_t::yytoken.

Referenced by yysyntax_error().

Here is the call graph for this function:
Here is the caller graph for this function: