MCPcopy Create free account
hub / github.com/Kitware/CMake / yypcontext_expected_tokens

Function yypcontext_expected_tokens

Source/LexerParser/cmDependsJavaParser.cxx:1927–1959  ·  view source on GitHub ↗

Put in YYARG at most YYARGN of the expected tokens given the current YYCTX, and return the number of tokens stored in YYARG. If YYARG is null, return the number of expected tokens (guaranteed to be less than YYNTOKENS). Return YYENOMEM on memory exhaustion. Return 0 if there are more than YYARGN expected tokens, yet fill YYARG up to YYARGN. */

Source from the content-addressed store, hash-verified

1925 Return 0 if there are more than YYARGN expected tokens, yet fill
1926 YYARG up to YYARGN. */
1927static int
1928yypcontext_expected_tokens (const yypcontext_t *yyctx,
1929 yysymbol_kind_t yyarg[], int yyargn)
1930{
1931 /* Actual size of YYARG. */
1932 int yycount = 0;
1933 int yyn = yypact[+*yyctx->yyssp];
1934 if (!yypact_value_is_default (yyn))
1935 {
1936 /* Start YYX at -YYN if negative to avoid negative indexes in
1937 YYCHECK. In other words, skip the first -YYN actions for
1938 this state because they are default actions. */
1939 int yyxbegin = yyn < 0 ? -yyn : 0;
1940 /* Stay within bounds of both yycheck and yytname. */
1941 int yychecklim = YYLAST - yyn + 1;
1942 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1943 int yyx;
1944 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1945 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
1946 && !yytable_value_is_error (yytable[yyx + yyn]))
1947 {
1948 if (!yyarg)
1949 ++yycount;
1950 else if (yycount == yyargn)
1951 return 0;
1952 else
1953 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
1954 }
1955 }
1956 if (yyarg && yycount == 0 && 0 < yyargn)
1957 yyarg[0] = YYSYMBOL_YYEMPTY;
1958 return yycount;
1959}
1960
1961
1962

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…