[antlr-interest] antlr-interest Digest, Vol 36, Issue 49

Brian Todoroff brian at todoroff.com
Wed Nov 21 16:06:15 PST 2007


> > ---------- Forwarded message ----------
> > From: Johannes Luber <jaluber at gmx.de>
> > To:
> > Date: Tue, 20 Nov 2007 21:05:35 +0100
> > Subject: Re: [antlr-interest] Example C style interpreter?
> > Brian Todoroff wrote:
> > > Is there an example of a more realistic interpreter than the simple
> > > tree based interpreter in the wiki?  Would prefer a simple C style
> > > language, but really anything with multiple types, functions, and
> > > function local variables will give me the basis for learning how to
> > > get this done in ANTLR.  Thanks all for any help and the great tools.
> > >
> > > Brian
> > >
> >
> > There are the examples for Java, C and C#. They should be available on
> > the download page.
> >
> > Johannes
>
>
>
> ---------- Forwarded message ----------
> From: Johannes Luber <jaluber at gmx.de>
> To:
> Date: Wed, 21 Nov 2007 22:43:46 +0100
> Subject: Re: [antlr-interest] Example C style interpreter?
> Brian Todoroff wrote:
> > Those are great examples of parsers, but I'm hoping to find an example
> > where someone has taken it the next step to an actual interpreter.
> > Unless I'm missing something these all stop after parsing the source.
> > I need to add a scripting engine to an in house app, so looking for an
> > example interpreter to help boost me up the learning curve.
> >
> > Thanks,
> > Brian
>
> How about http://www.linguamantra.org/? As it is a complete compiler it
> may contain the required steps.
>
> Johannes

Interesting example of a compiler to java (I like the idea of the
pipeline operator), but I'm really looking for an interpreter.
Something that takes the input code, creates the AST and actually runs
the code with function calls, loops, etc.
Doesn't need to be a fancy language and I don't care what language the
final interpreter code is in (C, C++, Java, C#, etc.).  I'm just
looking to get a feel for the design patterns around ANTLR based
interpreters for doing things like building up the function lookup
table and moving that between the parse and execute phases, handling
flow control constructs such as for, do, & while loops, etc.

Thanks,
Brian


More information about the antlr-interest mailing list