Home » Modeling » TMF (Xtext) » [TCS] custom separators in KM3.tcs
|
Re: [TCS] custom separators in KM3.tcs [message #12292 is a reply to message #12281] |
Thu, 17 April 2008 15:41 |
Frédéric Jouault Messages: 572 Registered: July 2009 |
Senior Member |
|
|
Hi,
> I noticed in KM3.tcs, there are custom separators declared in template
> Package and Context:
> "before_block_bracket" and "after_supertypes_coma"
>
> however, in class org.eclipse.gmt.tcs.extractor.prettyPrinter in
> serializeSeqElem(Object, Object), it seems these custom separators are
> never considered. Are they obsolete?
By definition, they are custom. So, you can define your own.
However, they need to be mapped to an implementation. For instance, you
can have a refining transformation that would transform
<before_block_bracket> into <space>. In this way, you separate the
presentation from the contents.
Note that we never actually experimented with this, but such a
transformation could be written quite quickly.
Regards,
Frédéric Jouault
|
|
| |
Re: [TCS] custom separators in KM3.tcs [message #12352 is a reply to message #12343] |
Mon, 21 April 2008 12:40 |
Frédéric Jouault Messages: 572 Registered: July 2009 |
Senior Member |
|
|
Hi,
>>> I noticed in KM3.tcs, there are custom separators declared in
>>> template Package and Context:
>>> "before_block_bracket" and "after_supertypes_coma"
>>
>> By definition, they are custom. So, you can define your own.
>
> Okay, but where are these defined? I mean, how does the extractor know
> what to do with "after_supertypes_coma", if this is not specified in the
> TCS, where else?
The extractor ignores custom separators it does not know. So,
"after_supertypes_coma" actually means "nothing" if you do not transform
it to a supported separator.
If you want to give a different meaning than "nothing" to a custom
separator, you can for instance do this in an ATL transformation.
If you do not feel that separating the definition of a custom separator
from its actual implementation is necessary for a specific TCS model,
then you may directly use the predefined custom separator.
At the current time, "after_supertypes_coma" is defined as being
"nothing", which is the default, and does not require any additional
specification.
Regards,
Frédéric Jouault
|
|
|
Goto Forum:
Current Time: Sat Dec 21 14:53:19 GMT 2024
Powered by FUDForum. Page generated in 0.03825 seconds
|