Re: [HACKERS] flex
| От | Patrick Welche | 
|---|---|
| Тема | Re: [HACKERS] flex | 
| Дата | |
| Msg-id | 20000117104959.D21506@quartz.newn.cam.ac.uk обсуждение исходный текст  | 
		
| Ответ на | Re: [HACKERS] flex (Peter Eisentraut <peter_e@gmx.net>) | 
| Список | pgsql-hackers | 
On Sun, Jan 16, 2000 at 09:13:03PM +0100, Peter Eisentraut wrote:
> 
> This puzzles me a bit still, but it seems to work. GNU suggests putting
> yacc and lex files in distributions, so I can't imagine why they would do
> that if you need to have lib[f]l.a anyway.
> 
> $ nm /usr/lib/libfl.a
>  
> libmain.o:
> 00000000 t gcc2_compiled.
> 00000000 T main
>          U yylex
>  
> libyywrap.o:
> 00000000 t gcc2_compiled.
> 00000000 T yywrap
I think those are defaults for the case where you just have a lex file, but
didn't bother with defining a main() after the last %% eg:
%%
A       putchar('b');
%%
When linked with -lfl, you get an executable. In the postgresql case, life
is more complicated and the parser calls yylex rather than a fake main(), so
-lfl isn't needed.
Cheers,
Patrick
		
	В списке pgsql-hackers по дате отправления: