[antlr-interest] Writing a new backend for v3

Ric Klaren ric.klaren at gmail.com
Thu May 10 11:34:58 PDT 2007


Hi,

On 5/9/07, Luke A. Guest <laguest at archangeli.demon.co.uk> wrote:
> Just how hard is it to add new backend for an unsupported language in v3
> of ANTLR? Where would somebody start?

AFAIK there's no docs on how things exactly work. Usually one would
start with the java templates (or the ones of a language that already
has been made and are more similar to your intended target). Then move
from there.

The starting point is in the source tree in org/antlr/codegen. You
need to create an adequate subclass of the Target class there (look at
the examples of the other targets)

In the templates subdir create a copy of a target that's most similar
to yours. ANTLRCore.sti gives an 'interface' of what minimally should
be implemented. It's probably best to concentrate on getting a lexer
going, then add the parser and extend from there on. I guess I'd study
the other runtimes/codegens before starting though.

Cheers,

Ric


More information about the antlr-interest mailing list