- return w - buf;
- }
- }
-
- return s;
-}
-
-
-/* Extend *LOC to account for token TOKEN of size SIZE. */
-
-static void
-extend_location (location_t *loc, char const *token, int size)
-{
- int line = loc->last_line;
- int column = loc->last_column;
- char const *p0 = token;
- char const *p = token;
- char const *lim = token + size;
-
- for (p = token; p < lim; p++)
- switch (*p)
- {
- case '\r':
- /* \r shouldn't survive no_cr_read. */
- abort ();
-
- case '\n':
- line++;
- column = 1;
- p0 = p + 1;
- break;
-
- case '\t':
- column += mbsnwidth (p0, p - p0, 0);
- column += 8 - ((column - 1) & 7);
- p0 = p + 1;
- break;
- }
-
- loc->last_line = line;
- loc->last_column = column + mbsnwidth (p0, p - p0, 0);
-}
-
-
-/* Report an unexpected end of file at LOC. A token or comment began
- with TOKEN_START, but an end of file was encountered and the
- expected TOKEN_END was missing. */
-
-static void
-unexpected_end_of_file (location_t loc,
- char const *token_start, char const *token_end)
-{
- complain_at (loc, _("unexpected end of file in `%s ... %s'"),
- token_start, token_end);
-}
-
-
-
-/* STRING_OBSTACK -- Used to store all the characters that we need to
- keep (to construct ID, STRINGS etc.). Use the following macros to
- use it.
-
- Use YY_OBS_GROW to append what has just been matched, and
- YY_OBS_FINISH to end the string (it puts the ending 0).
- YY_OBS_FINISH also stores this string in LAST_STRING, which can be
- used, and which is used by YY_OBS_FREE to free the last string. */
-
-static struct obstack string_obstack;
-char *last_string;
-
-#define YY_OBS_GROW \
- obstack_grow (&string_obstack, yytext, yyleng)