Make tl_yylex hookable (default is tl_lex)
This allows replacing the lexer when using libltl2ba.la.
This commit is contained in:
parent
f277db6c7e
commit
2e9e1a61dd
11
lex.c
11
lex.c
|
@ -36,9 +36,10 @@
|
|||
|
||||
static Symbol *symtab[Nhash+1];
|
||||
static int tl_lex(void);
|
||||
int (*tl_yylex)() = tl_lex;
|
||||
|
||||
extern YYSTYPE tl_yylval;
|
||||
char yytext[2048];
|
||||
static char yytext[2048];
|
||||
|
||||
#define Token(y) tl_yylval = tl_nn(y,ZN,ZN); return y
|
||||
|
||||
|
@ -86,14 +87,6 @@ follow(int tok, int ifyes, int ifno)
|
|||
return ifno;
|
||||
}
|
||||
|
||||
int
|
||||
tl_yylex(void)
|
||||
{ int c = tl_lex();
|
||||
#if 0
|
||||
printf("c = %d\n", c);
|
||||
#endif
|
||||
return c;
|
||||
}
|
||||
|
||||
static int
|
||||
tl_lex(void)
|
||||
|
|
2
ltl2ba.h
2
ltl2ba.h
|
@ -260,6 +260,8 @@ extern int tl_verbose;
|
|||
extern int tl_terse;
|
||||
extern unsigned long All_Mem;
|
||||
|
||||
extern int (*tl_yylex)(); /* hook for lexer */
|
||||
|
||||
int ltl2ba_init();
|
||||
int set_uform(const char *str);
|
||||
void append_uform(const char *str);
|
||||
|
|
Loading…
Reference in a new issue