Hi,
Alberto encountered this when he worked on the Java parser. The solution is to split the
parser into multiple classes that inherit from each other.
For example, in the mentioned example we have:
PPJavaLexicon
PPJavaSyntax
PPJavaParser
Cheers,
Doru
On 7 Jun 2011, at 12:02, Norbert Hartl wrote:
I learned something today. While talking about the
maximum number of instance variabes I always thought it is a limit per class. But now I
know it is a limit on an object. As I reached 230 instance variables I started to split
the parser into two. But now I reached the limit and cannot add instance variables.
I need some ideas about how to structure the parser. I think it will be too hard to find
parts of the grammar that are distinct so it would be possible to separate them into
different classes. Another way would be to access some of the parser via method calls
instead of accessing the instVar parsers.
So does anybody has some experience in how to structure parsers?
thanks,
Norbert
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"In a world where everything is moving ever faster,
one might have better chances to win by moving slower."