char *cp, location_t location);
static void handle_at (braced_code_t code_kind,
char *cp, location_t location);
+static void handle_syncline (char *args, location_t *location);
static int convert_ucn_to_byte (char const *hex_text);
%}
YY_STEP;
}
+ ^"#line "{int}" \""[^\"]*"\"\n" handle_syncline (yytext + strlen ("#line "), yylloc); YY_STEP;
+
"=" return EQUAL;
":" rule_length = 0; return COLON;
"|" rule_length = 0; return PIPE;
}
+/*----------------------------------------------------------------.
+| Handle `#line INT "FILE"'. ARGS has already skipped `#line '. |
+`----------------------------------------------------------------*/
+
+static void
+handle_syncline (char *args, location_t *location)
+{
+ int lineno = strtol (args, &args, 10);
+ const char *file = NULL;
+ file = strchr (args, '"') + 1;
+ *strchr (file, '"') = 0;
+ /* FIXME: Leaking... Can't free, as some locations are still
+ pointing to the old file name. */
+ infile = xstrdup (file);
+ location->file = infile;
+ location->last_line = lineno;
+}
+
/*-------------------------.
| Initialize the scanner. |
`-------------------------*/