Multiple Lex Program Question

Dave Bloom dave at andromeda.rutgers.edu.rutgers.edu
Tue Jul 19 06:40:36 AEST 1988


Here's a question for all you lex(1) fanatics out there:

What I need to do is create several lex functions to be
called from the same program at different times... so
instead of calling yylex(), I may want to call yylex_a(),
yylex_b()... etc.

Unfortunately, lex(1) has no flag that tells it to generate
the automaton WITHOUT the supporting functions and externals
(yycrank, yyline, etc.). So, while you can use an editor to
change the name yylex() everywhere in the file, the linker
still can't cope with the multiply defined symbols at link
time.

Does anyone have an elegant solution to this problem?  I could
always apply lex, then change the names of all variables/functions
whose names are prefixed with "yy" in the resulting lex.yy.c, but
then I wind up with duplicate functions under different names.

If you have any ideas, please respond by e-mail and I will summarize
(I don't normally subscribe to this group)

Thanx.
_______________________________________________________________________________
rutgers\                                                 | Dave Bloom
 galaxy >!andromeda!dave -or- dave at andromeda.rutgers.edu | Work: (201)648-5085
pyramid/                                                 |



More information about the Comp.unix.wizards mailing list