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 03:09  |
Eclipse User |
|
|
|
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
|
|
| |
Re: [TCS] Problem with serializer 2 [model to text] [message #381964 is a reply to message #381958] |
Tue, 29 April 2008 05:13  |
Eclipse User |
|
|
|
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
|
|
| |
Re: [TCS] Problem with serializer 2 [model to text] [message #615796 is a reply to message #381958] |
Tue, 29 April 2008 05:13  |
Eclipse User |
|
|
|
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
|
|
|
Goto Forum:
Current Time: Mon Mar 24 23:41:03 EDT 2025
Powered by FUDForum. Page generated in 0.03779 seconds
|