looking for library defining _yylineno!

looking for library defining _yylineno!

Post by roo » Mon, 01 May 1995 04:00:00



Hello,

I'm trying to compile Rayshade.4.0 with gcc 2.5.8 (linux kernel 1.1.54) and
my progress has been thwarted by an "unknown symbol" at link time (using
gcc 2.5.8).  The unknown symbol is the function _yylineno, apparently having
to do with the yacc/bison -y parser (about which I know next to nothing).  I
have grep-ed and indexed all of my libraries and can find none *defining* a
function _yylineno.  Can anyone point me to a library available on the net which
does define this function (if it is, in fact, a function!).  Please reply by email
to the address below.

Cheers,

Dave Lane
NZ Forest Research Inst.

 
 
 

looking for library defining _yylineno!

Post by Al Longye » Mon, 01 May 1995 04:00:00



>I'm trying to compile Rayshade.4.0 with gcc 2.5.8 (linux kernel
>1.1.54) and my progress has been thwarted by an "unknown symbol" at
>link time (using gcc 2.5.8).  The unknown symbol is the function
>_yylineno, apparently having to do with the yacc/bison -y parser
>(about which I know next to nothing).  I have grep-ed and indexed all
>of my libraries and can find none *defining* a function _yylineno.
>Can anyone point me to a library available on the net which does
>define this function (if it is, in fact, a function!).

yylineno is not a function. It is a scalar variable.

The 'lex' program (original vintage, not flex), defines this as the
current line number from the input file. There is no equivalent entry
in flex.

The usual thing is to keep your own line number. You can do it in the
yyinput routine or change the lexical grammar so that when you have a
token which includes newline, you increment the yylineno.

For example, you may find a token such as:

#.*$                ;

which says that a rule which starts with "#", contains any text,
followed by end-of-line (newline) is to simply be ignored. Change the
';' to be '++yylineno;'.

If you are going to do this, I would not suggest calling it yylineno
as it will conflict with lex's variable of the same name. Call it your
own variable name and change the references in the rest of the
production from yylineno to your own name. In that manner, either flex
or lex may be used without conflict.

>Please reply by email to the address below.


Fat chance of that. If you wanted the proper mail address, you should
have included the "Reply-To:" header.
--


 
 
 

looking for library defining _yylineno!

Post by Jonathan Kame » Tue, 02 May 1995 04:00:00


|> The 'lex' program (original vintage, not flex), defines this as the
|> current line number from the input file. There is no equivalent entry
|> in flex.

Not true.  Recent versions of flex will define yylineno and maintain it if
they are run with the "-l" flag.

 
 
 

1. gcc #define #define #define

Simple. There are several standards designed to alleviate
porting pains. ANSI C, POSIX, X/Open are the major ones.
As long as your program adheres to the above standards it
is easily portable. E.g. for most Xlib and/or Motif programs
it is only required that you need a different makefile
because of various include and lib directories. In fact,
Linux is one of platforms that provide both BSD and SysV
library calls and other features. Try to write or port
something to/from SunOS to IRIX then you will see what all
those #ifdefs are all about. :)

Let me find an example to back up my point: I write a
program and I need to find a way to zero out a memory
area. I found several library functions that can do that,
bzero() and memset(). I look at the bottom of the man
pages:

bzero() CONFORMING TO BSD 4.3

memset() CONFORMING TO SVID 3, BSD 4.3, ISO 9899

Now it is obvious that it is better to use the latter.

Unless, of course, I misunderstood you. What exactly are
you dealing with where you have problems with lots of #ifdefs?
Then maybe me or someone else can provide you some more
specific assistance?

--
<vladimip at uniserve com> | Good pings come in small packets
     Vancouver, BC | SIGSIG: signature too long (core dumped)
Things are more like they are today than they ever were before -
(From a crosspost between alt.suicide and alt.destroy.microsoft)

2. PIII-instruction SHUFPS with gcc-inline-asm

3. Which library defines mstats()?

4. saving man pages (old question?)

5. What library is this symbol defined in?

6. /bin/bash is a link to /bin/ksh

7. In wich library is dlopen defined ??

8. X on 360p thinkpad

9. In which library "tgoto" is defined on Solaris 8

10. define fileysytem for optical library

11. Library to handle user defined events/states and transitions

12. defining path to include libraries

13. m4: how to define var if another defined