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

Function input

Source/LexerParser/cmListFileLexer.c:1772–1847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1770 static int yyinput (yyscan_t yyscanner)
1771#else
1772 static int input (yyscan_t yyscanner)
1773#endif
1774
1775{
1776 int c;
1777 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1778
1779 *yyg->yy_c_buf_p = yyg->yy_hold_char;
1780
1781 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1782 {
1783 /* yy_c_buf_p now points to the character we want to return.
1784 * If this occurs *before* the EOB characters, then it's a
1785 * valid NUL; if not, then we've hit the end of the buffer.
1786 */
1787 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
1788 /* This was really a NUL. */
1789 *yyg->yy_c_buf_p = '\0';
1790
1791 else
1792 { /* need more input */
1793 int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
1794 ++yyg->yy_c_buf_p;
1795
1796 switch ( yy_get_next_buffer( yyscanner ) )
1797 {
1798 case EOB_ACT_LAST_MATCH:
1799 /* This happens because yy_g_n_b()
1800 * sees that we've accumulated a
1801 * token and flags that we need to
1802 * try matching the token before
1803 * proceeding. But for input(),
1804 * there's no matching to consider.
1805 * So convert the EOB_ACT_LAST_MATCH
1806 * to EOB_ACT_END_OF_FILE.
1807 */
1808
1809 /* Reset buffer status. */
1810 yyrestart( yyin , yyscanner);
1811
1812 /*FALLTHROUGH*/
1813
1814 case EOB_ACT_END_OF_FILE:
1815 {
1816 if ( yywrap( yyscanner ) )
1817 return 0;
1818
1819 if ( ! yyg->yy_did_buffer_switch_on_eof )
1820 YY_NEW_FILE;
1821#ifdef __cplusplus
1822 return yyinput(yyscanner);
1823#else
1824 return input(yyscanner);
1825#endif
1826 }
1827
1828 case EOB_ACT_CONTINUE_SCAN:
1829 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;

Callers

nothing calls this directly

Calls 2

yy_get_next_bufferFunction · 0.70
yyrestartFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…