Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Clipper lex & yacc

174 views
Skip to first unread message

Antonio Linares

unread,
Mar 16, 1999, 3:00:00 AM3/16/99
to
We would like to propose this thread that finally may bring a complete lex &
yacc specifications for Clipper with the cooperation of all the Clipper
users community.

Our plan is to start discussing them, step by step, so many of you could
make a start on these issues and then be able to cooperate on the project.

Are you interested ?

regards,

Antonio Linares
www.fivetech.com

Dave Pearson

unread,
Mar 16, 1999, 3:00:00 AM3/16/99
to
On Tue, 16 Mar 1999 16:22:50 +0100, Antonio Linares <alin...@fivetech.com> wrote:

> We would like to propose this thread that finally may bring a complete lex
> & yacc specifications for Clipper with the cooperation of all the Clipper
> users community.
>
> Our plan is to start discussing them, step by step, so many of you could
> make a start on these issues and then be able to cooperate on the project.
>
> Are you interested ?

Sounds of interest to me (and I know of a couple of others who would be
interested as well).

BTW, does your offer of releasing the source for Five under the GPL still
hold good? I've been meaning to mail you about this for a while.

--
Take a look in Hagbard's World: | w3ng - The WWW Norton Guide reader.
http://www.acemake.com/hagbard/ | eg - Norton Guide reader for Linux.
http://www.hagbard.demon.co.uk/ | weg - Norton Guide reader for Windows.
Free software, including........| dgscan - DGROUP scanner for Clipper.


Antonio Linares

unread,
Mar 16, 1999, 3:00:00 AM3/16/99
to
Sergey,

Lex is a lexical analizer and Yacc is a syntax analizer. What I mean is to
have the lex and yacc rules to be able to parse any clipper PRG. From that
point many tools could be generated:

* A Clipper to C language translator.
* A Clipper to other languages translator (Java, etc.)
* A Clipper compiler.
* etc.

A brief sample:

function Test

return 123

Lex should recognize: "function", "Test", one or more carriage return,
"return", "123"

Yacc should recognize:

A function is made by several tokens:

Function : FunctionHeader Statements

FunctionHeader: FUNCTION Identifier Crlf

Statements: RETURN Expression Crlf

Expression : NUMBER

etc...

Just the beginning :-)

regards,

Antonio Linares
www.fivetech.com

Antonio Linares

unread,
Mar 16, 1999, 3:00:00 AM3/16/99
to
Dave,

> Sounds of interest to me (and I know of a couple of others who would be
> interested as well).

Great.

> BTW, does your offer of releasing the source for Five under the GPL still
> hold good? I've been meaning to mail you about this for a while.

I don't like the idea of releasing a 'big thing' that very few will
understand. I am looking for help to get a 'perfect' Lex and Yacc for
Clipper and I think that if I help some other people to start on it, then
everybody will benefit.

regards,

Antonio Linares
www.fivetech.com

Antonio Linares

unread,
Mar 16, 1999, 3:00:00 AM3/16/99
to
Dave,

My proposed tools for this project are:

* Lex (I do use a ported flex to MsDos. Public domain)
* Byacc (Berkeley Yacc. Public domain).

Certainly I also would like if you could use other available lex and yacc,
as bison, etc... so we may know that what we do will work on many platforms.

If we could find an available FTP I could upload them there so we could all
start using the same tools. Phil, would you help us ?

regards,

Antonio Linares
www.fivetech.com

Antonio Linares

unread,
Mar 17, 1999, 3:00:00 AM3/17/99
to
Bambang,

> Where is the role of lex above ?

lex identifies the tokens from the input file.

> and if we compile,link and run this C
> language file. You said it will parse a Clipper PRG - what is the
> output of the parsing ?

First goal is just to parse it without errors. Then we may start defining
'production rules', that is, what to do on certain matches. We could easily
start a Clipper to C translator, a Clipper compiler, etc.

regards,

Antonio Linares
www.fivetech.com

Phil Barnett

unread,
Mar 18, 1999, 3:00:00 AM3/18/99
to
On Wed, 17 Mar 1999 09:07:25 +0100, "Antonio Linares"
<alin...@fivetech.com> wrote:

>Phil,
>
>> Sure, email them to me and I'll get them on the site.
>
>Done. Many thanks.
>
>Once you announce their availability I may start discussing how to use them,
>samples, etc.
>They are very interesting tools! The sword to atack the dragon... :-)

ftp://ftp.iag.net/pub/clipper/utils/byacc19.zip

This is the only file I got. Is there a Lex I'm supposed to get out
there?

--
Phil Barnett mailto:phi...@iag.net <-- Remove the first .
Oasis WWW http://www.iag.net/~philb/
FTP Site ftp://ftp.iag.net/pub/clipper
Clipper FAQ http://www.iag.net/~philb/clipper.html

Do unto others as you would have it done unto you,

All of our problems, all of our conflicts, all of
our difficulties in creating a life on our planet
of peace and joy are based in our failure to
understand this simple instruction and follow it.

Antonio Linares

unread,
Mar 18, 1999, 3:00:00 AM3/18/99
to
Phil,

ftp://ftp.iag.net/pub/clipper/utils/byacc19.zip

> This is the only file I got. Is there a Lex I'm supposed to get out
> there?

It is included into the bin directory: lex.exe and lex.sk.

Ok, so we are ready to go for a GNU Clipper :-)

regards,

Antonio Linares
www.fivetech.com

Adrian Boldan

unread,
Mar 18, 1999, 3:00:00 AM3/18/99
to
Scott (sc...@niia.net) wrote:
: first question: What is LEX?
: second question: What is YACC?
: A better question: Why should I care?

: P.S. I losing the fight with code blocks!

Why should you fight with the code blocks? :-)


--
*** Learn Esperanto - the International Language! ***
One language for all | Unu por chiuj,
the second for everyone! | la dua por chiu!


Phil Barnett

unread,
Mar 19, 1999, 3:00:00 AM3/19/99
to
On Thu, 18 Mar 1999 08:38:20 +0100, "Antonio Linares"
<alin...@fivetech.com> wrote:

>Phil,
>
>ftp://ftp.iag.net/pub/clipper/utils/byacc19.zip
>
>> This is the only file I got. Is there a Lex I'm supposed to get out
>> there?
>
>It is included into the bin directory: lex.exe and lex.sk.
>
>Ok, so we are ready to go for a GNU Clipper :-)

Where do we begin?

Peter Paul Jansen

unread,
Mar 21, 1999, 3:00:00 AM3/21/99
to
Scott,

Seeing that you got no answer - and I would like to know as well - I'll make
a guess and hope somebody corrects me. I've seen GNU being mentioned and I
seem to remember that that was the name of a set of tools wriiten by
Berkeley University for the Unix system (GNU Emacs the editor etc....) So I
think they ( the top notch clipperheads here) are going to try to build a
Clipper compiler for Unix.
I hope somebody will explain here in simple language if I'm writing
something very stupid here.

kind regards,
Peter Paul Jansen
The Netherlands
p...@NOSPAMburdock.com

Scott wrote in message <01be7084$0d74b960$43259ece@Scott>...


>first question: What is LEX?
>second question: What is YACC?
>A better question: Why should I care?
>
>P.S. I losing the fight with code blocks!

>--
>Scott Burke
>Sc...@niia.net
>
>


Al Acker

unread,
Mar 21, 1999, 3:00:00 AM3/21/99
to
Phil can give you the inside story on GNU...but in simple terms... what
Antonio is trying to start here is a kind of public domain Clipper
project..with an open source concept such as Linux. Most of the
examples...just as Linux...used here are for Unix..but that's not the
point.... the point is open source. I'm sure the first platform supported
would be x86 / DOS / Windows.... but that's a ways off yet.

Al


--
Al Acker, Editor
The Xbase Files Magazine
http://www.thexbasefiles.com

Peter Paul Jansen <ppj$nospam$@burdock.com> wrote in message
news:7d3qb6$45s$1...@zonnetje.NL.net...

Lulu of the Lotus-Eaters

unread,
Mar 22, 1999, 3:00:00 AM3/22/99
to
"Al Acker" <a...@thexbasefiles.com> wrote previously:

|Phil can give you the inside story on GNU...but in simple terms... what
|Antonio is trying to start here is a kind of public domain Clipper
|project..with an open source concept such as Linux.

Actually, I think of the regular contributors, Dave Pearson is the
person with the greatest experience and familiarity with GNU, and the
Free Software Foundation. Perhaps he will correct my below remarks, if
I err.

The "GNU GENERAL PUBLIC LICENSE" (GPL) is a set of terms for
copyrighting software that is promulgated by the Free Software
Foundation (FSF). Some, but not all, GPL'd software is owned by the
FSF. The GPL is one example, but not the only one, of "Open Source"
licenses. The Berkeley Sofware License is a different set of terms that
is generally considered less restrictive than GPL. Neither of these
copyrights makes the material covered under it *Public Domain*, which is
a term for otherwise copyrightable material that has been released from
copyright protection.

For GPL in particular, the intention is to let the copyright act like a
"virus" by "infecting" all derived work. The license says, in very
short summary, "This software must be made distributable in source form,
and as part of the terms you agree to in using this software, you must
make all derived works also freely distributable." Linux is covered by
these general terms, although I believe the kernel has a slightly
different license than the GPL. The ideological position behind the GPL
is to use copyrights against themselves, for the purpose of creating
cooperation rather than private for-profit ownership of software
"knowledge" (i.e. source code). Lots of debates rage on the details.

I do not know whether Antonio's idea is to use GPL, BSL, the Perl
"Artistic License", LGPL, or some other license for his "Free Clipper"
project. Or maybe he actually would prefer to make it public domain.
If it were up to me, I would probably opt for the last option... but I
have not done any work towards it, so it is obviously not up to me. It
may be that Antonio has not really thought through the differences
between these options, and just has a general notion of a "Free"
project.

It probably makes sense to come to an understanding of the terms that
will be used fairly early in this project, if it moves forward
significantly. The people who might contribute to it will have a
different set of rights depending on the terms of the whole project. An
understanding of those rights could very well influence the terms on
which those contributors would be able or willing to contribute their
own work to the project.

All IMHO.

Yours, Lulu...

--
quilty | The specter of free information is haunting the `Net! All the
@ibm. | powers of IP- and crypto-tyrrany have entered into an unholy
net | alliance...ideas have nothing to lose but their chains. Unite
| against "intellectual property" and anti-privacy regimes!
-------------------------------------------------------------------------


Dave Pearson

unread,
Mar 22, 1999, 3:00:00 AM3/22/99
to
On Mon, 22 Mar 1999 00:36:25 -0500, Lulu of the Lotus-Eaters <qui...@ibm.net> wrote:

> Actually, I think of the regular contributors, Dave Pearson is the person
> with the greatest experience and familiarity with GNU, and the Free
> Software Foundation. Perhaps he will correct my below remarks, if I err.

As you've done a good job of setting out the details and differences in the
different licensing methods I don't think I've got anything to add, but,
permit me to do a little bit of nit-picking.

> The "GNU GENERAL PUBLIC LICENSE" (GPL) is a set of terms for copyrighting
> software that is promulgated by the Free Software Foundation (FSF).

The GPL is more about the licence for use and distribution and the warranty
of a body of code. Copyright is simply a tool used (and abused, hence the
reason the document is sometimes called the "copyleft") to enforce the
licence (if you take my meaning). It's a very subtle difference but one I
think people should understand (it wouldn't hurt for people to read the
likes of the GPL).

> I do not know whether Antonio's idea is to use GPL, BSL, the Perl
> "Artistic License", LGPL, or some other license for his "Free Clipper"
> project. Or maybe he actually would prefer to make it public domain. If it
> were up to me, I would probably opt for the last option...

My own opinion right now is GPL for the grammar/parser/compiler and PD for
the library code (as per DJGPP <URL:http://www.delorie.com/djgpp/>).

> It probably makes sense to come to an understanding of the terms that will
> be used fairly early in this project, if it moves forward significantly.
> The people who might contribute to it will have a different set of rights
> depending on the terms of the whole project. An understanding of those
> rights could very well influence the terms on which those contributors
> would be able or willing to contribute their own work to the project.

[Nodding] For this reason alone I've not made much of an effort to get
involved because I'm unclear as to exactly what terms Antonio wants to
release his work (he's the one with a code "cache" hanging around in the
background) and before I think about putting time and effort into coming up
to speed with the tools and thinking about some of the problems I'd like to
know what I'm contributing to and under what terms.

As it is, Antonio has said he'd like to make this a "GNU project" so I'm
assuming that he'd like it placed under the GPL and that he'd like the
Copyright to be signed over to the FSF. Sometime today or tomorrow I'll be
composing an email to the GNU project to find out more about what sort of
support structure (mailing lists, ftp space, etc...) is available for a
project like this.

Dave Pearson

unread,
Mar 22, 1999, 3:00:00 AM3/22/99
to
On Sun, 21 Mar 1999 23:03:07 +0100, Peter Paul Jansen <ppj$nospam$@burdock.com> wrote:

> Seeing that you got no answer - and I would like to know as well - I'll
> make a guess and hope somebody corrects me. I've seen GNU being mentioned
> and I seem to remember that that was the name of a set of tools wriiten by
> Berkeley University for the Unix system (GNU Emacs the editor etc....)

Nope, see GNU project <URL:http://www.gnu.org/> for details about the GNU
project.

> So I think they ( the top notch clipperheads here) are going to try to
> build a Clipper compiler for Unix.

What Antonio is doing is he's making available a grammar that will allow
anyone to write a Clipper parser. With this grammar it will be possible to
write a number of different tools that need to grok Clipper source code. For
example, using the grammar you could write a tool to strip all static
strings from your source to make your application multi-lingual (I've done
this using a non-grammar method and take it from me, it isn't fun).

Obviously the grammar will also allow people to write a Clipper compiler,
and it doesn't have to be for Un*x either.

As to the questions about Lex and Yacc, Antonio has already explained what
they are in this thread. Anyone coming in late should consult DejaNews.

Antonio Linares

unread,
Mar 25, 1999, 3:00:00 AM3/25/99
to
There is a new build (6) of the Clipper free parser (soon to become a
compiler :-) available from:

ftp://ftp.iag.net/pub/clipper/general/cliparse.zip

Today we were able to parse a Clipper source code with 2720 lines (our
window.ppo). There was just one line giving error: EXIT from inside a IF ...
ENDIF (EXIT is actually defined into a DO WHILE ... loop and it has to
become a statement). Also #line is not supported as it should be managed by
the preprocessor.

Antonio Linares
www.fivetech.com


Antonio Linares

unread,
Mar 25, 1999, 3:00:00 AM3/25/99
to
0 new messages