help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is there this warning?


From: Akim Demaille
Subject: Re: Why is there this warning?
Date: Sat, 18 Aug 2018 14:37:17 +0200

Hi!

> Le 2 sept. 2016 à 18:42, Balaco Baco <address@hidden> a écrit :
> 
> Take the file [file.y], compile it to generate tab.[ch] files and the compile 
> it (without linking) with gcc. It gives a warning in this step. Can fix this 
> warning?
> 
> Commands used and their output:
> 
> ====
> $ bison -vd file.y
> $ gcc -Wall -c file.tab.c
> file.tab.c:1349: warning: implicit declaration of function ‘yylex’
> # A command that works, but it is out of scope for this message
> $ gcc -Wall file.tab.o [other object files] -lfl
> $
> ====
> 
> Is this warning something expected?

Yes: the user is in charge of declaring yylex.  Of course this is not so nice, 
but it’s mainly historical.

> I was thinking about adding yylex() prototype to file.y, but I do not know 
> what it is,

yylex is the name of function that the parse calls to get tokens, i.e., it is 
the caller to the scanner/lexer/tokenizer.

> and I could not find it in documentation.

That’s really surprising.

https://www.gnu.org/software/bison/manual/html_node/Lexical.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]