Skip to main content



      Home
Home » Modeling » TMF (Xtext) » SPL sample context for LocalFunctionDeclarations
SPL sample context for LocalFunctionDeclarations [message #16444] Tue, 01 July 2008 10:20 Go to next message
Eclipse UserFriend
Hi,

I am looking at the SPL sample from the TCS Zoo, and am a bit puzzled
about a detail concerning the contexts.

I was curious about SPL, so I tried a different sample than the one in
CVS. I got a reference setting error, so I looked at the example in more
detail.

Particularly, you'll notice that the root element is a Service, which may
contain Declarations, which may be LocalFunctionDeclarations.

None of the supertypes of LocalFunctionDeclaration is declared as context
element in the syntax:

template Declaration abstract;
template FunctionDeclaration abstract;
template LocalFunctionDeclaration addToContext : ...

Now in the example from the SPL website, there is this snippet:
service queue {
processing {
FIFO string<4> remove_element ( string call_id, FIFO string<4> list )
{
...
}
void play(string call_id, int index) {
select(index) {
case 0: rtp_play(call_id, "attendee.wav"); return;
...
}
}
}

please pay attention to the argument "call_id". In the select statement,
to resolve the call_id declaration, a lookup is done in the context. Since
the context here is the service, the lookup finds 2 arguments (Argument
being a subtype of Declaration) with the name "call_id", on in each of the
2 methods "remove_element" and "play".

Am I just missing something or is the SPL syntax missing the context
keyword somewhere to make the sample work?
I could not get Injection run because my environment is broken at this
time, so I don't know if injection right now would run or not. The example
I used is from the site:
http://phoenix.labri.fr/software/spl/
Re: SPL sample context for LocalFunctionDeclarations [message #16463 is a reply to message #16444] Tue, 01 July 2008 10:25 Go to previous messageGo to next message
Eclipse UserFriend
In case I am right, is it correct that with TCS it is only possible to
declare non-abstract templates as context, meaning I would have to declare
all non-abstract subtypes of FunctionDeclaration as context in this case?
Re: SPL sample context for LocalFunctionDeclarations [message #16549 is a reply to message #16463] Wed, 09 July 2008 11:03 Go to previous messageGo to next message
Eclipse UserFriend
> In case I am right, is it correct that with TCS it is only possible to
> declare non-abstract templates as context, meaning I would have to
> declare all non-abstract subtypes of FunctionDeclaration as context in
> this case?

You can add abstract elements to contexts, but you cannot declare
abstract elements as contexts.



Regards,

Frédéric Jouault
Re: [] SPL sample context for LocalFunctionDeclarations [message #16566 is a reply to message #16444] Wed, 09 July 2008 11:04 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Please, remember to prefix the subject of your TCS-related posts with
[TCS] as I did in this message.

Thanks.


It seems that there is indeed a missing "context".


Regards,

Frédéric Jouault


Thibault a écrit :
> Hi,
>
> I am looking at the SPL sample from the TCS Zoo, and am a bit puzzled
> about a detail concerning the contexts.
>
> I was curious about SPL, so I tried a different sample than the one in
> CVS. I got a reference setting error, so I looked at the example in more
> detail.
>
> Particularly, you'll notice that the root element is a Service, which
> may contain Declarations, which may be LocalFunctionDeclarations.
>
> None of the supertypes of LocalFunctionDeclaration is declared as
> context element in the syntax:
>
> template Declaration abstract;
> template FunctionDeclaration abstract;
> template LocalFunctionDeclaration addToContext : ...
>
> Now in the example from the SPL website, there is this snippet:
> service queue {
> processing {
> FIFO string<4> remove_element ( string call_id, FIFO string<4> list )
> { ...
> }
> void play(string call_id, int index) {
> select(index) {
> case 0: rtp_play(call_id, "attendee.wav"); return;
> ...
> }
> }
> }
>
> please pay attention to the argument "call_id". In the select statement,
> to resolve the call_id declaration, a lookup is done in the context.
> Since the context here is the service, the lookup finds 2 arguments
> (Argument being a subtype of Declaration) with the name "call_id", on in
> each of the 2 methods "remove_element" and "play".
>
> Am I just missing something or is the SPL syntax missing the context
> keyword somewhere to make the sample work? I could not get Injection run
> because my environment is broken at this time, so I don't know if
> injection right now would run or not. The example I used is from the site:
> http://phoenix.labri.fr/software/spl/
>
Re: [TCS] SPL sample context for LocalFunctionDeclarations [message #16582 is a reply to message #16566] Wed, 09 July 2008 11:05 Go to previous message
Eclipse UserFriend
It seems that I have some difficulty with the prefix today :-/.


Frédéric Jouault

Frédéric Jouault a écrit :
> Hi,
>
> Please, remember to prefix the subject of your TCS-related posts with
> [TCS] as I did in this message.
>
> Thanks.
>
>
> It seems that there is indeed a missing "context".
>
>
> Regards,
>
> Frédéric Jouault
>
>
> Thibault a écrit :
>> Hi,
>>
>> I am looking at the SPL sample from the TCS Zoo, and am a bit puzzled
>> about a detail concerning the contexts.
>>
>> I was curious about SPL, so I tried a different sample than the one in
>> CVS. I got a reference setting error, so I looked at the example in
>> more detail.
>>
>> Particularly, you'll notice that the root element is a Service, which
>> may contain Declarations, which may be LocalFunctionDeclarations.
>>
>> None of the supertypes of LocalFunctionDeclaration is declared as
>> context element in the syntax:
>>
>> template Declaration abstract;
>> template FunctionDeclaration abstract;
>> template LocalFunctionDeclaration addToContext : ...
>>
>> Now in the example from the SPL website, there is this snippet:
>> service queue {
>> processing {
>> FIFO string<4> remove_element ( string call_id, FIFO string<4> list
>> ) { ...
>> }
>> void play(string call_id, int index) {
>> select(index) {
>> case 0: rtp_play(call_id, "attendee.wav"); return;
>> ...
>> }
>> }
>> }
>>
>> please pay attention to the argument "call_id". In the select
>> statement, to resolve the call_id declaration, a lookup is done in the
>> context. Since the context here is the service, the lookup finds 2
>> arguments (Argument being a subtype of Declaration) with the name
>> "call_id", on in each of the 2 methods "remove_element" and "play".
>>
>> Am I just missing something or is the SPL syntax missing the context
>> keyword somewhere to make the sample work? I could not get Injection
>> run because my environment is broken at this time, so I don't know if
>> injection right now would run or not. The example I used is from the
>> site:
>> http://phoenix.labri.fr/software/spl/
>>
Previous Topic:Re: [TCS] Referencing
Next Topic:[TCS]propertyInit
Goto Forum:
  


Current Time: Wed Jul 09 08:09:27 EDT 2025

Powered by FUDForum. Page generated in 0.05743 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top