MCPcopy Create free account
hub / github.com/KDE/kdevelop / input

Function input

plugins/cmake/parser/cmListFileLexer.c:1589–1664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1587 static int yyinput (yyscan_t yyscanner)
1588#else
1589 static int input (yyscan_t yyscanner)
1590#endif
1591
1592{
1593 int c;
1594 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1595
1596 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1597
1598 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1599 {
1600 /* yy_c_buf_p now points to the character we want to return.
1601 * If this occurs *before* the EOB characters, then it's a
1602 * valid NUL; if not, then we've hit the end of the buffer.
1603 */
1604 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1605 /* This was really a NUL. */
1606 *yyg->yy_c_buf_p = '\0';
1607
1608 else
1609 { /* need more input */
1610 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
1611 ++yyg->yy_c_buf_p;
1612
1613 switch ( yy_get_next_buffer( yyscanner ) )
1614 {
1615 case EOB_ACT_LAST_MATCH:
1616 /* This happens because yy_g_n_b()
1617 * sees that we've accumulated a
1618 * token and flags that we need to
1619 * try matching the token before
1620 * proceeding. But for input(),
1621 * there's no matching to consider.
1622 * So convert the EOB_ACT_LAST_MATCH
1623 * to EOB_ACT_END_OF_FILE.
1624 */
1625
1626 /* Reset buffer status. */
1627 cmListFileLexer_yyrestart(yyin ,yyscanner);
1628
1629 /*FALLTHROUGH*/
1630
1631 case EOB_ACT_END_OF_FILE:
1632 {
1633 if ( cmListFileLexer_yywrap(yyscanner ) )
1634 return 0;
1635
1636 if ( ! yyg->yy_did_buffer_switch_on_eof )
1637 YY_NEW_FILE;
1638#ifdef __cplusplus
1639 return yyinput(yyscanner);
1640#else
1641 return input(yyscanner);
1642#endif
1643 }
1644
1645 case EOB_ACT_CONTINUE_SCAN:
1646 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;

Callers

nothing calls this directly

Calls 2

yy_get_next_bufferFunction · 0.85

Tested by

no test coverage detected