- enum line_type_e
- {
- regular_line,
- sync_line, /* #line. */
- actions_line /* %% actions. */
- };
- enum line_type_e line_type = regular_line;
-
- c = getc (fskel);
-
- /* Is this line special? */
- if (c == '#')
- {
- /* See if it's a `#line' line. */
- if ((c = getc (fskel)) == 'l')
- if ((c = getc (fskel)) == 'i')
- if ((c = getc (fskel)) == 'n')
- if ((c = getc (fskel)) == 'e')
- line_type = sync_line;
- else
- obstack_grow_string (&table_obstack, "#lin");
- else
- obstack_grow_string (&table_obstack, "#li");
- else
- obstack_grow_string (&table_obstack, "#l");
- else
- obstack_grow_string (&table_obstack, "#");
- }
- else if (c == '%')
- {
- /* See if it's a `%% actions' line. */
- if ((c = getc (fskel)) == '%')
- if ((c = getc (fskel)) == ' ')
- if ((c = getc (fskel)) == 'a')
- if ((c = getc (fskel)) == 'c')
- if ((c = getc (fskel)) == 't')
- if ((c = getc (fskel)) == 'i')
- if ((c = getc (fskel)) == 'o')
- if ((c = getc (fskel)) == 'n')
- if ((c = getc (fskel)) == 's')
- line_type = actions_line;
- else
- obstack_grow_string (&table_obstack, "%% action");
- else
- obstack_grow_string (&table_obstack, "%% actio");
- else
- obstack_grow_string (&table_obstack, "%% acti");
- else
- obstack_grow_string (&table_obstack, "%% act");
- else
- obstack_grow_string (&table_obstack, "%% ac");
- else
- obstack_grow_string (&table_obstack, "%% a");
- else
- obstack_grow_string (&table_obstack, "%% ");
- else
- obstack_grow_string (&table_obstack, "%%");
- else
- obstack_grow_string (&table_obstack, "%");
- }
-
- switch (line_type)
- {
- case sync_line:
- if (!no_lines_flag)
- obstack_fgrow2 (&table_obstack, "#line %d %s\n",
- line, quotearg_style (c_quoting_style, skeleton));
-
- /* Skip the end of line. */
- for (; c != '\n' && c != EOF; c = getc (fskel))
- /* nothing */;
- break;
-
- case actions_line:
- {
- size_t size = obstack_object_size (&action_obstack);
-
- actions_dumped++;
- assert (actions_dumped == 1);
- obstack_grow (&table_obstack,
- obstack_finish (&action_obstack),
- size);
- }
-
- /* Skip the end of line. */
- for (; c != '\n' && c != EOF; c = getc (fskel))
- /* nothing */;
- break;
-
- case regular_line:
- for (; c != '\n' && c != EOF; c = getc (fskel))
- obstack_1grow (&table_obstack, c);
- }
-
- if (c == EOF)
- break;
- obstack_1grow (&table_obstack, c);
- line++;