[antlr-interest] Building own interpreter

William v Doorn williamvdoorn at gmail.com
Fri Apr 9 11:59:48 PDT 2010


Andreas,

Well, I can already execute some code and evaluate it, but is this really
the way to do it? e.g. could I use this as interpreter, or do I need a fully
different approach? (see the file I attached)

Thanks

William van Doorn



2010/4/9 Andreas Stefik <stefika at gmail.com>

> William,
>
> This is a complex question to answer, and it really depends on your
> needs. For example, creating a whole compiler from scratch is
> difficult, but possible. We have our own compiler (with an ANTLR front
> end), that integrates our own custom language, called HOP, which is
> basically a novice programming language we distribute to schools for
> the blind. Our implementation is on sourceforge and is under GPL2, so
> you are welcome to look at it (Search for "Sodbeans"). We also
> integrate our custom compiler into NetBeans.
>
> On the other hand, if your needs allow it, you can also do things like
> have your antlr grammar generate java byte code or assembly directly,
> which is sometimes easier, again depending on what you need. And very
> simple interpreters for very simple languages aren't too tough, if you
> know what you are doing, and depending on your requirements.
>
> Hope that gives you some tips, at least. Short answer: Yes, it's
> definitely possible, but it depends on your goals, and it's typically
> not something you would bang out in a weekend.
>
> Andreas Stefik, Ph.D.
> Department of Computer Science
> Southern Illinois University Edwardsville
>
> On Fri, Apr 9, 2010 at 1:44 PM, William v Doorn <williamvdoorn at gmail.com>
> wrote:
> > Hello all,
> >
> > I've been reading the The definitive ANTLR book and I've made my own
> small
> > language using the AST strcuture.
> >
> > Now I was wondering, is it hard to make my own compiler/interpeter for
> this?
> > I can feed files and such to it, but how would I make my own
> > interpreter/compiler?
> >
> > Thanks,
> >
> > William van Doorn
> >
> > List: http://www.antlr.org/mailman/listinfo/antlr-interest
> > Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
> >
>


More information about the antlr-interest mailing list