PetitParser instance variables

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

PetitParser instance variables

Sean P. DeNigris
Administrator
I wanted my PPCompositeParser subclass to save some values as it parses.  But when I added an instance variable, class>>parse: failed with "Error: Unable to initialize #[instVar name]"

How do I save these intermediate results?  Is it not possible to have inst vars for my own purposes?

Sean
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: PetitParser instance variables

Tudor Girba
Hi,

You need to specify these instance variables in the following method:

MyParser class>>ignoredNames
        "Answer a collection of instance-variables that should not be automatically initialized with productions, but that are used internal to the composite parser."

Cheers,
Doru

On 28 Nov 2010, at 04:51, Sean P. DeNigris wrote:

>
> I wanted my PPCompositeParser subclass to save some values as it parses.  But
> when I added an instance variable, class>>parse: failed with "Error: Unable
> to initialize #[instVar name]"
>
> How do I save these intermediate results?  Is it not possible to have inst
> vars for my own purposes?
>
> Sean
> --
> View this message in context: http://forum.world.st/PetitParser-instance-variables-tp3062129p3062129.html
> Sent from the Moose mailing list archive at Nabble.com.
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
www.tudorgirba.com

"Reasonable is what we are accustomed with."


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: PetitParser instance variables

Sean P. DeNigris
Administrator
Tudor Girba wrote
MyParser class>>ignoredNames
        "Answer a collection of instance-variables that should not be automatically initialized with productions, but that are used internal to the composite parser."
Awesome, thanks!

Sean
Cheers,
Sean