Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jan 2008 10:33:02 +0100
From:      Ulf Lilleengen <lulf@stud.ntnu.no>
To:        freebsd-hackers@freebsd.org
Subject:   Csup cvsmode build discussion
Message-ID:  <20080116093302.GA13632@carrot.studby.ntnu.no>

next in thread | raw e-mail | index | archive | help
Hello hackers,

As some might know, I've been implementing CVSMode for csup over the last couple
of months. Right now, I'm quite close to have it work (does not mean it will
work perfect :)), but I encountered some issues regarding the inclusion of my
lex and yacc files that I would like to discuss. It is assumed that the reader
know what lex and yacc is.

First of all, I implemented the RCS parser required to operate on RCS files
using lex and yacc. Those are in FreeBSD userland, but the problem is they are
wayy to outdated for csups need.  The reason is mainly because they don't
support: 
1) reentrancy (needed since csup uses two threads, one to send information
to the server regarding it's files, and one to recieve information on how a file
is to be updated).

2) prefixing of lex/yacc output. Not a big deal, but easy if one doesn't need to
have to work around it.

3) parameter passing. Part of the reentrancy requirement but useful if one would
extend the arguments to a parser.

Because of this, I've been compiling the parser and tokenizer with the help of bison
and flex from ports.

Now, the base system already have flex, but the flex version in base is heavily
outdated (version 2.5.4 versus 2.5.34 in ports) and does not support reentrancy.
Is there a reason why it's outdated? What I can think of is that it is either
unmaintained, or that developers want it to disappear from base.

The yacc version in base is pretty old too and does not support reentrancy. I
would like to not have to hack it up to support this to avoid using bison, (And
I suspect importing bison into base is going to happen over someones dead
body :)).

So, I'm asking you, how should I best deal with this? Should I
a) Just include the _generated_ parser and tokenizer (e.g the output from bison
and flex) and just include the yacc and lex files in case someone wants to work
more on it?

b) Modify parser to be non-reentrant and solve my issues with locks.

c) Import bison into base and update flex version.

d) <Insert your fantastic idea here>

Alternative 'a' is my favorite, and seems to be the easiest way to avoid a heavy
inpact on the base system, but again it will complicate procedure of
modifying the parser since one have to use the correct build tools etc. 'b'
would lead to performance loss and I would very much like to avoid it. 'c'
would take a lot of work and I think many would protest on importing bison
(including me if I were not biased with needing it and all :))

What I ask of you is comments on these alternatives as well as inserting your
fantastic idea if you happen to have one :)

-- 
Ulf Lilleengen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080116093302.GA13632>