591 |
`-------------------------------------------------------------------*/ |
`-------------------------------------------------------------------*/ |
592 |
|
|
593 |
static void |
static void |
594 |
copy_definition (void) |
copy_definition (struct obstack *oout) |
595 |
{ |
{ |
596 |
int c; |
int c; |
597 |
/* -1 while reading a character if prev char was %. */ |
/* -1 while reading a character if prev char was %. */ |
599 |
|
|
600 |
if (!no_lines_flag) |
if (!no_lines_flag) |
601 |
{ |
{ |
602 |
obstack_fgrow2 (&attrs_obstack, muscle_find ("linef"), |
obstack_fgrow2 (oout, muscle_find ("linef"), |
603 |
lineno, quotearg_style (c_quoting_style, |
lineno, quotearg_style (c_quoting_style, |
604 |
muscle_find ("filename"))); |
muscle_find ("filename"))); |
605 |
} |
} |
613 |
switch (c) |
switch (c) |
614 |
{ |
{ |
615 |
case '\n': |
case '\n': |
616 |
obstack_1grow (&attrs_obstack, c); |
obstack_1grow (oout, c); |
617 |
++lineno; |
++lineno; |
618 |
break; |
break; |
619 |
|
|
623 |
|
|
624 |
case '\'': |
case '\'': |
625 |
case '"': |
case '"': |
626 |
copy_string (finput, &attrs_obstack, c); |
copy_string (finput, oout, c); |
627 |
break; |
break; |
628 |
|
|
629 |
case '/': |
case '/': |
630 |
copy_comment (finput, &attrs_obstack); |
copy_comment (finput, oout); |
631 |
break; |
break; |
632 |
|
|
633 |
case EOF: |
case EOF: |
634 |
fatal ("%s", _("unterminated `%{' definition")); |
fatal ("%s", _("unterminated `%{' definition")); |
635 |
|
|
636 |
default: |
default: |
637 |
obstack_1grow (&attrs_obstack, c); |
obstack_1grow (oout, c); |
638 |
} |
} |
639 |
|
|
640 |
c = getc (finput); |
c = getc (finput); |
643 |
{ |
{ |
644 |
if (c == '}') |
if (c == '}') |
645 |
return; |
return; |
646 |
obstack_1grow (&attrs_obstack, '%'); |
obstack_1grow (oout, '%'); |
647 |
} |
} |
648 |
after_percent = 0; |
after_percent = 0; |
649 |
} |
} |
1154 |
/*----------------------------------------------------------------. |
/*----------------------------------------------------------------. |
1155 |
| Read from finput until `%%' is seen. Discard the `%%'. Handle | |
| Read from finput until `%%' is seen. Discard the `%%'. Handle | |
1156 |
| any `%' declarations, and copy the contents of any `%{ ... %}' | |
| any `%' declarations, and copy the contents of any `%{ ... %}' | |
1157 |
| groups to ATTRS_OBSTACK. | |
| groups to PRE_PROLOGUE_OBSTACK or POST_PROLOGUE_OBSTACK. | |
1158 |
`----------------------------------------------------------------*/ |
`----------------------------------------------------------------*/ |
1159 |
|
|
1160 |
static void |
static void |
1174 |
return; |
return; |
1175 |
|
|
1176 |
case tok_percent_left_curly: |
case tok_percent_left_curly: |
1177 |
copy_definition (); |
if (!typed) |
1178 |
|
copy_definition (&pre_prologue_obstack); |
1179 |
|
else |
1180 |
|
copy_definition (&post_prologue_obstack); |
1181 |
break; |
break; |
1182 |
|
|
1183 |
case tok_token: |
case tok_token: |
1857 |
|
|
1858 |
/* Initialize the obstacks. */ |
/* Initialize the obstacks. */ |
1859 |
obstack_init (&action_obstack); |
obstack_init (&action_obstack); |
|
obstack_init (&attrs_obstack); |
|
1860 |
obstack_init (&output_obstack); |
obstack_init (&output_obstack); |
1861 |
|
obstack_init (&pre_prologue_obstack); |
1862 |
|
obstack_init (&post_prologue_obstack); |
1863 |
|
|
1864 |
finput = xfopen (infile, "r"); |
finput = xfopen (infile, "r"); |
1865 |
|
|