MCPcopy Create free account
hub / github.com/Singular/Singular / input

Function input

Singular/libparse.cc:2841–2909  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2839static int yyinput()
2840#else
2841static int input()
2842#endif
2843 {
2844 int c;
2845
2846 *yy_c_buf_p = yy_hold_char;
2847
2848 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2849 {
2850 /* yy_c_buf_p now points to the character we want to return.
2851 * If this occurs *before* the EOB characters, then it's a
2852 * valid NUL; if not, then we've hit the end of the buffer.
2853 */
2854 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
2855 /* This was really a NUL. */
2856 *yy_c_buf_p = '\0';
2857
2858 else
2859 { /* need more input */
2860 int offset = yy_c_buf_p - yytext_ptr;
2861 ++yy_c_buf_p;
2862
2863 switch ( yy_get_next_buffer() )
2864 {
2865 case EOB_ACT_LAST_MATCH:
2866 /* This happens because yy_g_n_b()
2867 * sees that we've accumulated a
2868 * token and flags that we need to
2869 * try matching the token before
2870 * proceeding. But for input(),
2871 * there's no matching to consider.
2872 * So convert the EOB_ACT_LAST_MATCH
2873 * to EOB_ACT_END_OF_FILE.
2874 */
2875
2876 /* Reset buffer status. */
2877 yyrestart( yyin );
2878
2879 /* fall through */
2880
2881 case EOB_ACT_END_OF_FILE:
2882 {
2883 if ( yywrap() )
2884 return EOF;
2885
2886 if ( ! yy_did_buffer_switch_on_eof )
2887 YY_NEW_FILE;
2888#ifdef __cplusplus
2889 return yyinput();
2890#else
2891 return input();
2892#endif
2893 }
2894
2895 case EOB_ACT_CONTINUE_SCAN:
2896 yy_c_buf_p = yytext_ptr + offset;
2897 break;
2898 }

Callers

nothing calls this directly

Calls 2

yywrapFunction · 0.85
yy_get_next_bufferFunction · 0.70

Tested by

no test coverage detected