Re: Ada Interpreter using YACC or BISON (David Weller)
11 Jun 1997 00:06:32 -0400

          From comp.compilers

Related articles
Ada Interpreter using YACC or BISON (Christoph Bochsler) (1997-06-09)
Re: Ada Interpreter using YACC or BISON (1997-06-11)
| List of all articles for this month |

From: (David Weller)
Newsgroups: comp.compilers
Date: 11 Jun 1997 00:06:32 -0400
Organization: ImagiNet Communications Ltd, Arlington, Texas
References: 97-06-023
Keywords: Ada, interpreter

Christoph Bochsler <> wrote:
>Hello I try to generate an interpreter for an Ada-like language. I had
>a short look to the FLEX/BISON utilities but I actually don't know if
>it's possible to build an interpreter instead of a compiler. I need a
>program which can do the following:
>Source file example:
>a int;
>for (i==1,i<10,i++) do
> COMMAND(a+i);

BTW, you may want to crosspost to comp.lang.ada from now on with
questions like this.

Well, that looks much more C-like than Ada-like to me :-) Writing an
Ada interpreter would be a bit of a challenge, especially considering
Ada 95 features, which can be tricky. Given my limited knowledge, I'd
say it's just as easy to write a C++ interpreter as an Ada
interpreter; that is, almost impossible :-)

>[It's possible, but it's not easy. I always tell people to make one pass to
>translate to byte codes, then intepret the byte codes. -John]

For a good starting point, perhaps you should look at the sources for
the GNU Ada compiler ( There's a LOT
of good stuff in there, but none of it is FLEX/BISON based :-)

Intermetrics wrote an Ada compiler that generates Java bytecode, but
those sources aren't publicly available :-(

I also recomment ANTLR 2.00 as your parsing tool. We've been pretty
pleased with what we've seen so far. To hell with FLEX :-)
( ANTLR 2.00, by the way, is the reincarnation of

Good luck!
Booch Components Homepage: ||Ada Homepage:

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.