Hi Abdelghani,
PPCompositeParser use reflection to initialize all the parsers stored in instance
variables.
Your problem comes from the fact that your "model" instance variable is not
intended to stores a parser as other instance variables do.
To exclude your iv from PPCompositeParser machinery you can redefine #ignoredNames on
class-side:
PPMyLanguageGenerator class>>ignoredNames
^ super ignoredNames, #(model)
But it looks like #model is supposed to be the result of your generator?
If this is the case I think that you should not store it in an instance variable.
Parsers are supposed to be stateless.
Instead each production rule should return a part of your model (using ==> [ … ]) that
you then compose progressively in other rules.
Terminal rules return the leaves of your model and non-terminal rules compose the results.
The start production rule then returns the full model.
Look at the other subclasses of PPCompositeParser for insight.
HTH,
Camille
On 03 Jul 2015, at 14:55, abdelghani ALIDRA
<alidrandco(a)yahoo.fr> wrote:
Hi everyone,
I have defined #PPMyLanguageGenerator inheriting from PPMyLanguageParser inheriting from
PPCompositeParser
In the class PPMyLanguageGenerator I have an instance variable named: model I initialize
with : model := OrderedCollection new to collect reconized elements of my language
I also define PPSplotModelGenerator>>aMethd
anElement := someCode.
model add: anElement
When I try to test my method from a PPCompositeParserTest sub subclass I have the error
message on the ligne above :
MessageNotUnderstood: PPDelegateParser >>add:
But model is not supposed to be a PPDelegateParser!!!!
Any idea about this matter and how can I acc my variable from my methods?
Regards.
Abdelghani
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev