aboutsummaryrefslogtreecommitdiff
path: root/src/meta1lex.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/meta1lex.l')
-rw-r--r--src/meta1lex.l24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/meta1lex.l b/src/meta1lex.l
index 2aca914..a074a8d 100644
--- a/src/meta1lex.l
+++ b/src/meta1lex.l
@@ -33,8 +33,7 @@
#include "meta1lex.h"
static struct grecs_locus_point meta1_locus_point;
-struct obstack meta1_stk;
-int meta1_stk_init;
+static struct grecs_txtacc *meta1_txtacc;
char *meta1_queue_dir;
#define yylval meta1lval
@@ -119,7 +118,7 @@ yywrap ()
void
meta1_line_add (const char *text, size_t len)
{
- obstack_grow (&meta1_stk, text, len);
+ grecs_txtacc_grow (meta1_txtacc, text, len);
}
static char quote_transtab[] = "\\\\\"\"a\ab\bf\fn\nr\rt\tv\v";
@@ -150,13 +149,13 @@ unescape_to_line (int c)
if (t == c && t != '\\' && t != '\"')
grecs_error (&meta1lloc, 0, _("unknown escape sequence '\\%c'"), c);
}
- obstack_1grow (&meta1_stk, t);
+ grecs_txtacc_grow_char (meta1_txtacc, t);
}
void
meta1_line_add_unescape_last (const char *text, size_t len)
{
- obstack_grow (&meta1_stk, text, len - 2);
+ grecs_txtacc_grow (meta1_txtacc, text, len - 2);
unescape_to_line (text[len - 1]);
}
@@ -165,25 +164,22 @@ meta1_line_add_unescape_hex (const char *text, size_t len)
{
for (; text[len-1] != 'x' && len > 0; len--)
;
- obstack_grow (&meta1_stk, text, len - 2);
- obstack_1grow (&meta1_stk, (char) strtoul (text + len, NULL, 16));
+ grecs_txtacc_grow (meta1_txtacc, text, len - 2);
+ grecs_txtacc_grow_char (meta1_txtacc, (char) strtoul (text + len, NULL, 16));
}
void
meta1_line_begin ()
{
- if (!meta1_stk_init)
- {
- obstack_init (&meta1_stk);
- meta1_stk_init = 1;
- }
+ if (!meta1_txtacc)
+ meta1_txtacc = grecs_txtacc_create();
}
char *
meta1_line_finish ()
{
- obstack_1grow (&meta1_stk, 0);
- return obstack_finish (&meta1_stk);
+ grecs_txtacc_grow_char (meta1_txtacc, 0);
+ return grecs_txtacc_finish (meta1_txtacc, 0);
}
char *

Return to:

Send suggestions and report system problems to the System administrator.