help-bison
[Top][All Lists]
Advanced

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

Re: #line format


From: Hans Aberg
Subject: Re: #line format
Date: Thu, 11 Apr 2002 16:29:58 +0200

At 12:08 +0200 2002/04/11, Akim Demaille wrote:
>| Can't you solve the problem by having the #line directive refer
>| instead to some template file like bison.simple, in a well-known
>| location?  That's what Bison 1.35 does.
>
>Does it?  I thought it was already changed!
>
>This approach has several problems, all related to the fact that
>bison.simple is independent from the parser file:
>
>- it may not exist
>- it may not be at the same location
>- it may belong to a different version of Bison (worst case IMO).

It seems that the C preprocessor was not designed to refer to "this file".
So it should refer to some other file.

Bison might be augmented with an option, outputting this other file as
well. This might be the skeleton file, or a special file containing the
portions one wants to refer to.

If one should work around the C preprocessor, one might attempt to split up
the output on several files: The portions that needs to refer to "this
file" are then put in a top level file without #line directives. The other
components are reached via the usual #include.

But this seems too cumbersome.

  Hans Aberg





reply via email to

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