[antlr-interest] generating cyclic state machines in Java

Jeff Barnes jbarnesweb at yahoo.com
Sat Feb 4 17:27:30 PST 2006


--- Terence Parr <parrt at cs.usfca.edu> wrote:

> When generating v3 Java code, the tiny DFA class
> objects fit easily  
> into the Java output file, but after compilation,
> you see hundreds  
> of .class files :(  Any suggestions?  The key is
> that we must handle  
> arbitrary cyclic DFA with heterogeneous states;

I had a similar problem recently. Not only are more
classes ugly (sorry for the bluntness), but public
(and protected if you will) methods on classes should
be *tested*. Sheesh that's a lot of work.

I reasoned that it was better to solve the problem in
one of the meta layers and have fewer classes (more
instances).

In this solution, the work is in the initialization.
That's where the structural heirarchy of the instances
is defined. I think its more elegant to solve the
problem at the structural level.

Thanks for letting me input .02.

Jeff




More information about the antlr-interest mailing list