[antlr-interest] 3.0 multiple language support

Ric Klaren klaren at cs.utwente.nl
Tue Aug 3 10:34:06 PDT 2004


On Tue, Aug 03, 2004 at 12:55:32PM -0400, Tiller, Michael (M.M.) wrote:
> Of the options I have seen so far, I prefer the one where the grammar
> just has macros and the actions themselves are specified outside the
> grammar, e.g.
> 
> some_rule
>    : a:A "," b:B << process_some_rule(a,b); >>
> 
> And then you could weave together an action file with a grammar file.
> So you might have a C++ action file:
> 
> void process_some_rule(A *a, B* b)
> {
>   /* Do something very general in this language */
> }

Problem is that this leads to really silly naming schemes when the rule
becomes complex. Separate stuff for before a closure, stuff for inside a
closure. Then add a few more closures to a rule and you'll have a nice
piece of code you'd not want to touch with a 10ft pole. You'd get lost in
the functioncalls, the rule itself and lose the overview of what it
actually does (as also happens with the one graphical grammar editor I've
seen so far).

A special editor could help but I don't see that as a real option I
*really* like plain textfiles for writing my grammars. Making a really good
editor would take an enormous effort bigger than writing just antlr3 is my
guess. So have something running that is handeditable first is a good idea.

How many people are actively using one grammar cross language? Is this
really worth the effort?

Cheers,

Ric
--
-----+++++*****************************************************+++++++++-------
    ---- Ric Klaren ----- j.klaren at utwente.nl ----- +31 53 4893755  ----
-----+++++*****************************************************+++++++++-------
  "I don't have anything against Java - it's the best damn implementation
              of UCSD Pascal ever released..." --- Larry Smith



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the antlr-interest mailing list