http://www.ics.uci.edu/~arcadia/Aflex-Ayacc/aflex-ayacc.html
However the download link on that page does not appear to work. It seems
like the host no longer exists. Most other references to ayacc point to
the same non-existent place. I was able to locate the source code for a
slightly older version of ayacc on the TenDRA site. I have not yet
located aflex at all.
Is this project completely dead and buried? Is there some other parser
generator that I should be looking at instead?
Thanks in advance for any help you might be able to give...
Peter
> http://www.ics.uci.edu/~arcadia/Aflex-Ayacc/aflex-ayacc.html
>
>However the download link on that page does not appear to work.
Try:
There's a working link there.
--
-- Dave Bryan
NOTE: Due to unrelenting spam, I regret that I have been forced to post with
an encoded address. Please ROT13 this message to obtain the reply address.
Cyrnfr ercyl gb guvf nqqerff: wqo...@npz.bet
> I have a need for a parser generator and a lexical analyzer generator
> that produce Ada.
I prefer table-driven approach to generators.
You might find a table-driven parser in simple components:
http://www.dmitry-kazakov.de/ada/components.htm#Parsers_etc
which I am use for the only complex stuff, expressions. In almost any
"normal" language the rest is just trivial, easily handled by a recursive
descent parser. (I never managed to understand what formal grammars are
good for... (:-))
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
Depending on what you are really doing, you can use ASIS.
Or use the parser from GNAT.
These don't "generate parsers", but they can be used to write programs
that generate Ada code.
--
-- Stephe
> Depending on what you are really doing, you can use ASIS.
Yes, I thought about using ASIS (which I have used before). However,
that ties my executable to a particular compiler version and would make
my program unusable with a compiler that does not support ASIS. These
are both significant disadvantages in my case it seems to me. Or do all
compilers support ASIS these days?
Peter
> Try:
>
> http://www.ics.uci.edu/~self/
>
> There's a working link there.
Cool! Thanks.
Peter
> I suggest that you should use tool from http://adagoop.martincarlisle.com
> Marek
Thanks to you and Dmitry for suggesting some alternatives. I may look
into them as well.
Peter
> If you still need ayacc & aflex, there is an improved version coming
> with the GWenerator at http://sf.net/projects/gnavi/
> Both tools compile "out of the box" with GNAT - and probably any Ada
> 95+ compiler.
Thanks. I'll take a look.
Peter
|------------------------------------------------------------------------|
|"I have a need for a parser generator and a lexical analyzer generator |
|that produce Ada. I see that there is an ayacc and aflex project. [..] |
| |
|[..] |
| |
|[..] Is there some other parser |
|generator that I should be looking at instead? |
| |
|Thanks in advance for any help you might be able to give..." |
|------------------------------------------------------------------------|
One mention of ASIS and some mentions of recursive descent parsers
have been made. I shall state advice for you in a more direct
manner. Do not write anything based on Lex and YACC. They are for
bottom-up designs. Learn how to do top-down parsing or otherwise be
damned to never write an unbuggy parser.
[1] http://www.telepath.com/~dennison/Ted/OpenToken/OpenToken.html
--
Ludovic Brenta.
I studied it some time ago and found it interesting. In particular, I
borrowed the idea of generation of a table from an Ada enumeration type. If
a table contains only legal Ada identifiers, it is a very quick way to
create it.
To the critique of OpenToken. One problem is that it really concentrates on
tokens, nothing else. A recursive descent parser should also support
higher-level constructs, like user-defined blank/comment, identifier,
literals, and more generally expressions. So that, when you see the token
"declare", you could tell the parser get me a name, and then after the
colon, the declaration expression etc.
It also pays too little attention to abstracting the sources being parsed
and links to the sources (needed for error messages and integration into
IDE).
I use its lexical-analysis functions a lot, for many different
purposes. It works quite well enough for me. However, I can
generally myself design the language to be analysed. I would not be
surprised to find some awkward problems with languages that have
been defined by others -- but that probably holds for any general
lexical-scanner tool.
I very much like the absence of any "generator" step -- a simple
"gnatmake" is enough to update the application after a change to
the token structure.
I have not used the parsing functions in OpenToken; they did not
exist when I started to use OpenToken, so I got into the habit of
writing my parsers manually.
--
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
. @ .
I too like the absence of a generator, and I'm used to writing my own
parsers by hand. Did you find that OpenToken helped a lot in doing
that? I've never used it myself because all the languages I've had to
parse were extremely simple (and purpose-built).
--
Ludovic Brenta.
It does its job: lexical analysis. The parser gets to look at the
tokens one by one; OpenToken provides a function to return the
identity of the current token (an enumeration), another function to
return the text string of the current token, and a procedure to
advance to the next token. That is what I expect of a lexical
analyser, and OpenToken gives me that (at least; I haven't really
studied it thoroughly to see what else there may be).
As far as I recall, the only wart I have found has to do with the
error reporting when the input text has a sequence of characters
that does not match any token -- I had to add a special "invalid
token" definition (Opentoken.Recognizer.Nothing.Get) to find the
line-number and column-number of the erroneous text. A minor detail.
If I try to think of what might be missing, perhaps the main thing
is context-dependent lexical analysis: the ability to say, for
example, that I expect the next token to be an identifier, so
please ignore the definitions of reserved keywords and just
consider them identifiers, too. Of course I have designed my own
languages not to need this (keywords are really reserved).
As far as I know OpenToken has no general look-ahead facility, but
it should not be too hard to build one yourself, on top of
OpenToken, if you need it.
Another good point about OpenToken and the absence of a generator
phase: one can have several instances of OpenToken in the same
application, for different languages, without any clashes of names
or data. My application needs that.
A caveat: The amounts of text that my applications scan with
OpenToken are small. I have no idea of the scanning speed; it has
been quite enough for my needs.
I use it at work, but not as recusive descent; I write a grammar using
it.
I had to fix a couple bugs, and it can be confusing getting the
grammar to be unambiguous, but I like the resulting high-level code.
As with other grammar-oriented parsers, the error messages leave a lot
to be desired. If I ever find time, I'd like to try switching to using
it in a recursive descent way; that usually gives better error messages.
--
-- Stephe
> I had to fix a couple bugs, and it can be confusing getting the
> grammar to be unambiguous, but I like the resulting high-level code.
Are your fixes included in the latest release from Ted Dennison? If
not, could you please submit your patches in a bug report on the
Debian bug tracking system? That way they will benefit anyone who
cares about OpenToken, and they can be integrated in Debian. For
instructions on how to report bugs, see http://bugs.debian.org. The
package you want is libopentoken-dev, now maintained by Reto Buerki.
(I know you don't use Debian; this is not a requirement!)
--
Ludovic Brenta.
Ok; I didn't realize OpenToken was a supported Debian package.
I actually have two slightly different versions of OpenToken; one for
GDS (my work project) and one for webcheck (a home project). I've been
waiting for an excuse to merge them; this could be it.
> (I know you don't use Debian; this is not a requirement!)
That's about to change; I'm finally fed up with Windows at home, so
I'm buying a new laptop with gNewSense (derived from Debian) on it.
And at work, the security police are making it impossible to get work
done on Windows, so we'll probably be switching to some Gnu/Linux
variant there as well; depends on what AdaCore will support.
--
-- Stephe
Great news. In fact, since OpenToken seems dead upstream, you might as
well adopt it for your own and host it on a public revision control
system. Ada-France's monotone server is yours if you want it;
otherwise you can go to SourceForge, Gna!, Berlios, Tigris or
Savannah.
> > (I know you don't use Debian; this is not a requirement!)
>
> That's about to change; I'm finally fed up with Windows at home, so
> I'm buying a new laptop with gNewSense (derived from Debian) on it.
Congratulations. I hope you enjoy the experience. Out of curiosity,
what is the difference between gNewSense and using only the main part
of Debian (as opposed to contrib and non-free)?
> And at work, the security police are making it impossible to get work
> done on Windows, so we'll probably be switching to some Gnu/Linux
> variant there as well; depends on what AdaCore will support.
I think AdaCore are quite agnostic with respect to the particular
distribution you use; what matters the most is some minimal version
glibc (2.2 I think) and, to a lesser extent, kernel (2.4 I think).
Indeed, they don't specify any distribution in their list of supported
platforms.
--
Ludovic Brenta.
> On Aug 30, 12:51 am, Stephen Leake <stephen_le...@stephe-leake.org>
> wrote:
>>
>> I actually have two slightly different versions of OpenToken; one for
>> GDS (my work project) and one for webcheck (a home project). I've been
>> waiting for an excuse to merge them; this could be it.
>
> Great news. In fact, since OpenToken seems dead upstream, you might as
> well adopt it for your own and host it on a public revision control
> system. Ada-France's monotone server is yours if you want it;
> otherwise you can go to SourceForge, Gna!, Berlios, Tigris or
> Savannah.
What are the tradeoffs between doing that, and becoming a Debian
maintainer for OpenToken? or both?
I'm familiar with SourceForge, and monotone, and I have a small public
website of my own. So it's not the mechanics of the public site I'm
concerned about. More the time it takes to respond to user queries.
I guess it depends on how popular the package becomes. Both public
sites and Debian packages are practically invisible without concerted
advertising campaigns, so I suspect there's not much difference.
I'm inclined to start with being a Debian maintainer, and only
establish a public website if there is more demand.
>> That's about to change; I'm finally fed up with Windows at home, so
>> I'm buying a new laptop with gNewSense (derived from Debian) on it.
>
> Congratulations. I hope you enjoy the experience. Out of curiosity,
> what is the difference between gNewSense and using only the main part
> of Debian (as opposed to contrib and non-free)?
Partly ignorance, partly politics.
I chose gNewSense because it is advertised as 100% Free Software (in
the GPL sense). For example, the wireless card won't work in the
laptop I'm getting, because there is no Free Software driver for it.
FSF established gNewSense because the main part of Debian is not 100%
free in this sense; see http://www.gnewsense.org/Main/Features.
The politics is supporting a laptop/Gnu/Linux vendor that offers
gNewSense; I hope that promotes the cause of 100% Free Software in
some way - they can report one more customer interested in it. In
fact, they did say they are working on a 100% free wireless solution.
I'm hoping I can just use Debian apt-get to get updates, but I'm not
clear that will filter the stuff removed by gNewSense.
Eventually, I'd like to get a Free Software BIOS. That may be the only
way to avoid DRM, if the DRM advocates get their way. The book
Rainbows End by Vernor Vinge presents a scary vision of such a thing;
you can't even order a pizza without a trust certificate, and Gnu Hurd
is illegal, but the choice of hackers. No mention of Debian :).
Explicitly supporting gNewSense is one way to encourage Free Software
BIOS development. At least I tell myself that :).
--
-- Stephe
OpenToken already has a Debian maintainer, his name is Reto Buerki[1],
so there is no requirement for you to maintain the package in Debian.
You may, of course, offer to co-maintain the package with Reto.
[1] http://packages.qa.debian.org/o/opentoken.html
The one thing that OpenToken lacks is an active upstream author and
web site. The web site should have:
- a public source code repository
- a public bug database
- optionally, a mailing list.
Since there are currently few users, I proposed the "lightest"
solution requiring near zero set-up time:
- Ada-France for the public source code repository (possibly with
mirrors, since monotone is distributed)
- the Debian bug tracking system as a public bug database
- comp.lang.ada as the mailing list (supplemented by each bug in the
Debian BTS, which is a mailing list on its own).
> I'm familiar with SourceForge, and monotone, and I have a small public
> website of my own. So it's not the mechanics of the public site I'm
> concerned about. More the time it takes to respond to user queries.
As you have witnessed, there have been no user queries in years :) I
did send a couple of patches to the original author but never received
a response. These patches are in the Debian package.
Setting up a proper "upstream" site shouldn't take too much time but
that's still more than what I proposed.
> I guess it depends on how popular the package becomes. Both public
> sites and Debian packages are practically invisible without concerted
> advertising campaigns, so I suspect there's not much difference.
Yea, except that we're doing the advertising right now :)
> I'm inclined to start with being a Debian maintainer, and only
> establish a public website if there is more demand.
I agree with that.
>>> That's about to change; I'm finally fed up with Windows at home, so
>>> I'm buying a new laptop with gNewSense (derived from Debian) on it.
>>
>> Congratulations. I hope you enjoy the experience. Out of curiosity,
>> what is the difference between gNewSense and using only the main part
>> of Debian (as opposed to contrib and non-free)?
>
> Partly ignorance, partly politics.
>
> I chose gNewSense because it is advertised as 100% Free Software (in
> the GPL sense). For example, the wireless card won't work in the
> laptop I'm getting, because there is no Free Software driver for it.
> FSF established gNewSense because the main part of Debian is not 100%
> free in this sense; see http://www.gnewsense.org/Main/Features.
I remember that time. There was opposition within Debian to removing
non-free drivers from the kernel, and even some flame wars. But the
Free Software advocates finally got their way, such that now the
kernel in Debian is split into the main, contrib and non-free sections
(i.e. they split the non-free drivers into their own packages). One
can use only the main section and get essentially what gNewSense
offers.
> The politics is supporting a laptop/Gnu/Linux vendor that offers
> gNewSense; I hope that promotes the cause of 100% Free Software in
> some way - they can report one more customer interested in it. In
> fact, they did say they are working on a 100% free wireless solution.
Could you please tell me who that vendor is? I'll be interested, come
time to replace my current laptop (which I got from HP with only
FreeDOS installed).
> I'm hoping I can just use Debian apt-get to get updates, but I'm not
> clear that will filter the stuff removed by gNewSense.
I guess you can use apt-pinning for that, but I'm not familiar enough
with the details of gNewSense to be positive.
> Eventually, I'd like to get a Free Software BIOS. That may be the only
> way to avoid DRM, if the DRM advocates get their way. The book
> Rainbows End by Vernor Vinge presents a scary vision of such a thing;
> you can't even order a pizza without a trust certificate, and Gnu Hurd
> is illegal, but the choice of hackers. No mention of Debian :).
>
> Explicitly supporting gNewSense is one way to encourage Free Software
> BIOS development. At least I tell myself that :).
Yes, at FOSDEM 2007 I attended Ronald G. Minnich's presentation of
LinuxBIOS[2]. From memory, the speaker is from Lawrence Livermore
National Laboratory or similar, and uses LinuxBIOS on supercomputers.
The part I liked the most was when he described how Intel tried to
sell them their new and improved BIOS architecture into which hardware
vendors could add their own proprietary plug-ins. Guess what the
reaction was from people who simulate nuclear weapons on said
hardware?
[2] http://archive.fosdem.org/2007/schedule/events/linuxbios
--
Ludovic Brenta.
> Stephen Leake writes:
>> Ludovic Brenta writes:
>>
>>> On Aug 30, 12:51 am, Stephen Leake <stephen_le...@stephe-leake.org>
>>> wrote:
>>>>
>>>> I actually have two slightly different versions of OpenToken; one for
>>>> GDS (my work project) and one for webcheck (a home project). I've been
>>>> waiting for an excuse to merge them; this could be it.
>>>
>>> Great news. In fact, since OpenToken seems dead upstream, you might as
>>> well adopt it for your own and host it on a public revision control
>>> system. Ada-France's monotone server is yours if you want it;
>>> otherwise you can go to SourceForge, Gna!, Berlios, Tigris or
>>> Savannah.
>>
>> What are the tradeoffs between doing that, and becoming a Debian
>> maintainer for OpenToken? or both?
>
> OpenToken already has a Debian maintainer, his name is Reto Buerki[1],
> so there is no requirement for you to maintain the package in Debian.
> You may, of course, offer to co-maintain the package with Reto.
>
> [1] http://packages.qa.debian.org/o/opentoken.html
Ok.
> The one thing that OpenToken lacks is an active upstream author and
> web site. The web site should have:
>
> - a public source code repository
> - a public bug database
> - optionally, a mailing list.
>
> Since there are currently few users, I proposed the "lightest"
> solution requiring near zero set-up time:
>
> - Ada-France for the public source code repository (possibly with
> mirrors, since monotone is distributed)
> - the Debian bug tracking system as a public bug database
> - comp.lang.ada as the mailing list (supplemented by each bug in the
> Debian BTS, which is a mailing list on its own).
Works for me. I can put a simple page on my current website stating
where things are. I can host a mailing list on my website if that
becomes necessary, like I have for Emacs Ada mode.
I'm currently focussed on adding a major new feature to monotone and
Emacs DVC, so I probably won't get to doing this for OpenToken for a
couple months. Unless I feel like taking a break :).
>> I chose gNewSense because it is advertised as 100% Free Software (in
>> the GPL sense). For example, the wireless card won't work in the
>> laptop I'm getting, because there is no Free Software driver for it.
>
>> FSF established gNewSense because the main part of Debian is not 100%
>> free in this sense; see http://www.gnewsense.org/Main/Features.
>
> I remember that time. There was opposition within Debian to removing
> non-free drivers from the kernel, and even some flame wars. But the
> Free Software advocates finally got their way, such that now the
> kernel in Debian is split into the main, contrib and non-free sections
> (i.e. they split the non-free drivers into their own packages). One
> can use only the main section and get essentially what gNewSense
> offers.
Ah, that makes sense. So http://www.gnewsense.org/Main/Features is out
of date, or at least misleading.
>> The politics is supporting a laptop/Gnu/Linux vendor that offers
>> gNewSense; I hope that promotes the cause of 100% Free Software in
>> some way - they can report one more customer interested in it. In
>> fact, they did say they are working on a 100% free wireless solution.
>
> Could you please tell me who that vendor is? I'll be interested, come
> time to replace my current laptop (which I got from HP with only
> FreeDOS installed).
Los Alamos Computers http://laclinux.com/
There are several others that offer Debian; I got the list from the
debian.org website.
>> Eventually, I'd like to get a Free Software BIOS. That may be the only
>> way to avoid DRM, if the DRM advocates get their way. The book
>> Rainbows End by Vernor Vinge presents a scary vision of such a thing;
>> you can't even order a pizza without a trust certificate, and Gnu Hurd
>> is illegal, but the choice of hackers. No mention of Debian :).
>>
>> Explicitly supporting gNewSense is one way to encourage Free Software
>> BIOS development. At least I tell myself that :).
>
> Yes, at FOSDEM 2007 I attended Ronald G. Minnich's presentation of
> LinuxBIOS[2]. From memory, the speaker is from Lawrence Livermore
> National Laboratory or similar, and uses LinuxBIOS on supercomputers.
> The part I liked the most was when he described how Intel tried to
> sell them their new and improved BIOS architecture into which hardware
> vendors could add their own proprietary plug-ins. Guess what the
> reaction was from people who simulate nuclear weapons on said
> hardware?
Sounds like the current thread on emacs-devel about adding support for
dynamically loading C modules (dlls).
> [2] http://archive.fosdem.org/2007/schedule/events/linuxbios
I had not realized this was that far along. I'll bug LAC about
supporting it for Thinkpad.
--
-- Stephe
Ludovic Brenta wrote:
> Hi Ted,
>
> Are you the author of OpenToken? There has been a discussion on
> comp.lang.ada starting at [1] about adopting it for future
> maintenance. As it turns out, Stephe Leake is willing to take it
> over. I'd like to know if you were aware of this and of the fact
> that, over the years sicne you released 3.0b, several people sent you
> patches which you never acknowledged. Do you approve of someone else
> taking over?
>
> [1] http://groups.google.com/group/comp.lang.ada/msg/ef40447ce799fba1
Ted Dennison replied:
> I'm unaware of the talk. I am quite aware that I've been sent a few
> patches that I never had time to incorporate, and that it's not being
> actively developed. The birth of my second child pretty much killed all
> the free time I had to do such things. I now have a third, so the free
> time situation is even worse.
>
> I certainly approve, heartily, of anyone taking over development of it.
> The whole point of licensing it the way I did was so that such things
> could happen.
>
> One suggestion I would make to people would be to use a public source
> code repository. Among other things, that would make it much easier to
> distribute the burden of testing and incorporating patches. If I were
> starting such a project today, I'd definitely use Git for revision
> control. It works fine in Windows now, and Git makes forking around
> developers who get busy/lazy and drop out (such as myself) nearly
> trivial. I believe Savannah supports it, as do a few other lesser-known
> public hosting sites: http://git.or.cz/gitwiki/GitHosting.
and then in a second email:
> Ludovic Brenta wrote:
>> Thanks a lot. Can I forward your reply to comp.lang.ada for the
>> benefit of all?
>
> Certainly.
>
>> The agreement is to use Ada-France's monotone server. Monotone is
>> also distributed, like git, but simpler to use, and it is written with
>> the Ada attitude whereas C is written with the C attitude :)
>
> Interesting. I'll have to look into that.
I just imported OpenToken versions 2.0 and 3.0b into the Ada-France
database under the branch name "org.opentoken". You can browse it at
http://www.ada-france.org:8081/branch/changes/org.opentoken
Stephe Leake, feel free to send me your monotone key so I can grant
you write permission on the database.
--
Ludovic Brenta.