Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » GMT (Generative Modeling Technologies) » Problem with serializer 2 [model to text]
Problem with serializer 2 [model to text] [message #381958] Wed, 23 April 2008 07:09 Go to next message
Gustavo Cabral is currently offline Gustavo CabralFriend
Messages: 20
Registered: July 2009
Junior Member
Hi everyone,

I am also having problem with the serializer in two situations.

-----------------------------------------------------------
1) I am specifying the CSP hide operator syntax like this:

--
operatorTemplate Hide (operators = hideOp, source = behavior)
: channels
;

template HiddenChannels
: "{" channels {separator = ",", refersTo = name} "}"
;
--
and in the symbols and operator sections:
--
symbols {
...
hide = "\\\\": leftNone, rightNone;
...
}
operators BehaviorOp {
...
priority 4 {
hideOp = hide, 2;
}
...
}
--

The code is parsed without problem but when I serialize a model
I get "D = A21\\{ display }". That means, I get two slashes instead
of one! It should be "D = A21\{ display }"

-----------------------------------------------------------
2) The other problem is with the serialization of the CSP prefix
operator. The syntax, symbol, and operator priority are:

operatorTemplate Prefix (operators = prefixOp, source = next)
: action
;

rarrow = "->" : leftSpace, rightSpace;

priority 2, right {
prefixOp = rarrow, 1;
}

I am getting "M1 = M2 -> write" when I should get "M1 = write -> M2".
It is serializing it backwards!! It is switching the "next" and the
"action"
attributes positions.

I am using an ANT task (extractor) with the following information:

<property name="tcs-ecore" value="/CSP/Syntax/CSP.ecore" />
<am3.loadModel modelHandler="EMF" name="MM.tcs" metamodel="TCS"
path="${tcs-ecore}" />

<am3.saveModel model="M" path="${sample}-2.csp">
<extractor name="ebnf">
<param name="format" value="MM.tcs"/>
<param name="indentString" value=" "/>
<param name="serializeComments" value="true"/>
</extractor>
</am3.saveModel>

Could anyone tell me where is the implementation of this task? So I
can check its behavior? Is it a bug or am I doing something wrong? :p
I couldnt find much information about the operator template, specially
about the right or left association and the number of operators: 1 or 2,
for
instance.

best regards,
Gustavo
Tokyo University
[TCS] Problem with serializer 2 [model to text] [message #381959 is a reply to message #381958] Wed, 23 April 2008 07:10 Go to previous messageGo to next message
Gustavo Cabral is currently offline Gustavo CabralFriend
Messages: 20
Registered: July 2009
Junior Member
I forgot the [TCS] tag. Sorry!
G.
Re: [TCS] Problem with serializer 2 [model to text] [message #381964 is a reply to message #381958] Tue, 29 April 2008 09:13 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi,

> -----------------------------------------------------------
> 1) I am specifying the CSP hide operator syntax like this:
>
> --
> operatorTemplate Hide (operators = hideOp, source = behavior)
> : channels
> ;
>
> template HiddenChannels
> : "{" channels {separator = ",", refersTo = name} "}"
> ;
> --
> and in the symbols and operator sections:
> --
> symbols {
> .. hide = "\\\\": leftNone, rightNone;
> ..
> }
> operators BehaviorOp {
> ..
> priority 4 {
> hideOp = hide, 2;
> }
> ..
> }
> --

Can you try using:
hide = "\\"
?

This should work for the extraction.


> The code is parsed without problem but when I serialize a model
> I get "D = A21\\{ display }". That means, I get two slashes instead
> of one! It should be "D = A21\{ display }"

According to this, I suppose this causes a problem with injection?
If yes, then there is a bug: the grammar generator should escape it, and
you should not have to do it.
Could you please post a bug about this?
Thanks.


> 2) The other problem is with the serialization of the CSP prefix
> operator. The syntax, symbol, and operator priority are:
>
> operatorTemplate Prefix (operators = prefixOp, source = next)
> : action
> ;
>
> rarrow = "->" : leftSpace, rightSpace;
>
> priority 2, right {
> prefixOp = rarrow, 1;
> }
>
> I am getting "M1 = M2 -> write" when I should get "M1 = write -> M2".
> It is serializing it backwards!! It is switching the "next" and the
> "action"
> attributes positions.

If I understand correctly, "write" is the action, right?
If yes, then there is also a bug for this. Can you please open a bug for
this?
Thanks.


> I am using an ANT task (extractor) with the following information:
>
> <property name="tcs-ecore" value="/CSP/Syntax/CSP.ecore" />
> <am3.loadModel modelHandler="EMF" name="MM.tcs" metamodel="TCS"
> path="${tcs-ecore}" />
>
> <am3.saveModel model="M" path="${sample}-2.csp">
> <extractor name="ebnf">
> <param name="format" value="MM.tcs"/>
> <param name="indentString" value=" "/>
> <param name="serializeComments" value="true"/>
> </extractor>
> </am3.saveModel>
>
> Could anyone tell me where is the implementation of this task? So I
> can check its behavior? Is it a bug or am I doing something wrong? :p
> I couldnt find much information about the operator template, specially
> about the right or left association and the number of operators: 1 or 2,
> for
> instance.

Extraction is implemented in org.eclipse.gmt.tcs.extractor, which is in
/cvsroot/technology/org.eclipse.gmt/org.eclipse.gmt.tcs/plug ins.

Do not hesitate to contribute a patch on bugzilla as well.
Thanks.



Regards,

Frédéric Jouault
[TCS] Problem with serializer 2 [model to text] [message #615783 is a reply to message #381958] Wed, 23 April 2008 07:10 Go to previous message
Gustavo Cabral is currently offline Gustavo CabralFriend
Messages: 20
Registered: July 2009
Junior Member
I forgot the [TCS] tag. Sorry!
G.
Re: [TCS] Problem with serializer 2 [model to text] [message #615796 is a reply to message #381958] Tue, 29 April 2008 09:13 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi,

> -----------------------------------------------------------
> 1) I am specifying the CSP hide operator syntax like this:
>
> --
> operatorTemplate Hide (operators = hideOp, source = behavior)
> : channels
> ;
>
> template HiddenChannels
> : "{" channels {separator = ",", refersTo = name} "}"
> ;
> --
> and in the symbols and operator sections:
> --
> symbols {
> .. hide = "\\\\": leftNone, rightNone;
> ..
> }
> operators BehaviorOp {
> ..
> priority 4 {
> hideOp = hide, 2;
> }
> ..
> }
> --

Can you try using:
hide = "\\"
?

This should work for the extraction.


> The code is parsed without problem but when I serialize a model
> I get "D = A21\\{ display }". That means, I get two slashes instead
> of one! It should be "D = A21\{ display }"

According to this, I suppose this causes a problem with injection?
If yes, then there is a bug: the grammar generator should escape it, and
you should not have to do it.
Could you please post a bug about this?
Thanks.


> 2) The other problem is with the serialization of the CSP prefix
> operator. The syntax, symbol, and operator priority are:
>
> operatorTemplate Prefix (operators = prefixOp, source = next)
> : action
> ;
>
> rarrow = "->" : leftSpace, rightSpace;
>
> priority 2, right {
> prefixOp = rarrow, 1;
> }
>
> I am getting "M1 = M2 -> write" when I should get "M1 = write -> M2".
> It is serializing it backwards!! It is switching the "next" and the
> "action"
> attributes positions.

If I understand correctly, "write" is the action, right?
If yes, then there is also a bug for this. Can you please open a bug for
this?
Thanks.


> I am using an ANT task (extractor) with the following information:
>
> <property name="tcs-ecore" value="/CSP/Syntax/CSP.ecore" />
> <am3.loadModel modelHandler="EMF" name="MM.tcs" metamodel="TCS"
> path="${tcs-ecore}" />
>
> <am3.saveModel model="M" path="${sample}-2.csp">
> <extractor name="ebnf">
> <param name="format" value="MM.tcs"/>
> <param name="indentString" value=" "/>
> <param name="serializeComments" value="true"/>
> </extractor>
> </am3.saveModel>
>
> Could anyone tell me where is the implementation of this task? So I
> can check its behavior? Is it a bug or am I doing something wrong? :p
> I couldnt find much information about the operator template, specially
> about the right or left association and the number of operators: 1 or 2,
> for
> instance.

Extraction is implemented in org.eclipse.gmt.tcs.extractor, which is in
/cvsroot/technology/org.eclipse.gmt/org.eclipse.gmt.tcs/plug ins.

Do not hesitate to contribute a patch on bugzilla as well.
Thanks.



Regards,

Frédéric Jouault
Previous Topic:[MOFScript] Eclipse M2T ?
Next Topic:[EVL]exists and unset references
Goto Forum:
  


Current Time: Tue Apr 16 17:23:20 GMT 2024

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

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

Back to the top