Le 23/10/2014 09:18, [email protected] a écrit :
On Thu, Oct 23, 2014 at 8:42 AM, Thierry Goubier <[email protected] <mailto:[email protected]>> wrote: How long is long?
900 nodes in the AST seems to be the limit for the type of method SmaCC generates (cascading ifTrue:ifFalse:).
Other limits exist (number of literals, for example). Unless you generate automatically some code, it's hard to hit them. Once you generate automatically, it's easy to hit them :P
Now, the point is to see all that as a stream, cut methods at appropriate places and compile code under a WAComponent subclass.
Yes. But then you need some kind of syntax to mark the start of a method. Change sets and dolphin packages use !! markers.
I don't know about SmaCC but I think I can do something with PetitParser and Smalltalk compile:
It's all done with RBParser. Since you're parsing Smalltalk, it's easier to do it that way (and probably a bit faster). And you're also playing with the AST, so you want to fall back to a well defined API for that AST (and visitors, and the like).
Extending RBParser with a scheme to parse multi-methods files could be convenient.
Unless you fall back on a variant of a changeset. Thierry
