MCPcopy Create free account
hub / github.com/Gecode/gecode / yyunput

Function yyunput

gecode/flatzinc/lexer.yy.cpp:1665–1705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1663#ifndef YY_NO_UNPUT
1664
1665 static void yyunput (int c, char * yy_bp , yyscan_t yyscanner)
1666{
1667 char *yy_cp;
1668 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1669
1670 yy_cp = yyg->yy_c_buf_p;
1671
1672 /* undo effects of setting up yytext */
1673 *yy_cp = yyg->yy_hold_char;
1674
1675 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1676 { /* need to shift things up to make room */
1677 /* +2 for EOB chars. */
1678 int number_to_move = yyg->yy_n_chars + 2;
1679 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1680 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1681 char *source =
1682 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1683
1684 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1685 *--dest = *--source;
1686
1687 yy_cp += (int) (dest - source);
1688 yy_bp += (int) (dest - source);
1689 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1690 yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1691
1692 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1693 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1694 }
1695
1696 *--yy_cp = (char) c;
1697
1698 if ( c == '\n' ){
1699 --yylineno;
1700 }
1701
1702 yyg->yytext_ptr = yy_bp;
1703 yyg->yy_hold_char = *yy_cp;
1704 yyg->yy_c_buf_p = yy_cp;
1705}
1706
1707#endif
1708

Callers 1

yy_input_procFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected