Login  Register

Maximum number of rules in PetitParser?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Maximum number of rules in PetitParser?

jgfoster
351 posts
I have a grammar with about 600 rules. With some work I’ve come up with a useful subset of 400 rules. Unfortunately this is still more than the 255 number of instance variables that Pharo allows. Is there a way to have PetitParser use something other than instance variables to cache the rules? Especially something that works with PPBrowser?

James


Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Maximum number of rules in PetitParser?

Tudor Girba-2
7411 posts
One non-ideal solution is to split the parser into several classes inheriting from each other.

Doru

On Mon, Dec 22, 2014 at 6:26 AM, James Foster <[hidden email]> wrote:
I have a grammar with about 600 rules. With some work I’ve come up with a useful subset of 400 rules. Unfortunately this is still more than the 255 number of instance variables that Pharo allows. Is there a way to have PetitParser use something other than instance variables to cache the rules? Especially something that works with PPBrowser?

James





--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Maximum number of rules in PetitParser?

Udo Schneider
667 posts
In reply to this post by jgfoster
James,

can you split the grammar into logical subgrammars? If yes PetitParser's
"dependent grammars"
(http://pharobooks.gforge.inria.fr/PharoByExampleTwo-Eng/latest/PetitParser.pdf#page=12)
might be helpful.

CU,

Udo


On 22/12/14 06:26, James Foster wrote:
> I have a grammar with about 600 rules. With some work I’ve come up with a useful subset of 400 rules. Unfortunately this is still more than the 255 number of instance variables that Pharo allows. Is there a way to have PetitParser use something other than instance variables to cache the rules? Especially something that works with PPBrowser?
>
> James
>
>
>