|
|
|
|
Re: Old vs new serializer [message #1117220 is a reply to message #1116526] |
Thu, 26 September 2013 08:01 |
Fabian G. Messages: 60 Registered: May 2010 Location: Christchurch (NZ) |
Member |
|
|
thanks, the new serializer is actually easier to use and I found another way than extending it for my purpose.
the order is almost respected now, but I still have a couple of lines that are joined and one block of comment is ignored (any idea?).
Any idea to have the model elements printed in the same order and having them on different lines (separated in the source model and grammar rules are the same "kind" as the other ones)?
thanks again!
[Updated on: Thu, 26 September 2013 08:45] Report message to a moderator
|
|
|
|
Re: Old vs new serializer [message #1117350 is a reply to message #1117294] |
Thu, 26 September 2013 10:47 |
Fabian G. Messages: 60 Registered: May 2010 Location: Christchurch (NZ) |
Member |
|
|
Hi Moritz,
I did not touch to the formatter. It seems the serializer follows the order defined in the grammar and if two dsl elements are interchanged, the serialization produces a strange behaviour. An example grammar (did not test with this example, but have the same pattern in my language with a bigger abstract rule) :
ASampleRule :
(sub1+=SubRule1 | sub2+=SubRule2)*;
SubRule1 :
'subrule1' name=ID ';';
SubRule2 :
'subrule2' name=ID ';';
The model:
subrule1 id1;
// a comment
subrule2 id2;
will be serialized correctly, but the model:
// a comment
subrule2 id2;
// a comment
subrule1 id1;
will produce
subrule2 id2; subrule1 id1;
In other words, when a couple of rules can be present in multiple instances and interchanged, it seems the serializer does not produce the expected result. For the order, this is no big deal, but the comments defined upper and in between are lost which is more problematic.
Thanks for your help,
Regards,
Fabian
[Updated on: Thu, 26 September 2013 10:58] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05607 seconds