Skip to main content



      Home
Home » Modeling » TMF (Xtext) » [TCS] Inferred property
[TCS] Inferred property [message #5378] Fri, 14 March 2008 06:04 Go to next message
Eclipse UserFriend
Hi,

I am trying to evaluate whether TCS currently allows to define an
expression syntax with dynamically typed variables, where the Injector
resolves the type.

Assuming I had this Metamodel:
class TypedElement
{
attribute type : String;
}

Class Variable extends Typed {
attribute name : String;
}

Class Expression extends Typed {
reference sequence container : Sequence;
}

Class Assignment {
reference var : Variable;
reference expression : Expression;
}

Can I somehow define a Syntax with TCS where
x = "Hello World"
lets the TCSInjector set property "type" of variable x to String, because
the type of "Hello World" would be String?

Or would I have to do this after Injecting as a semantical task
independent from the Syntax.
Re: [TCS] Inferred property [message #7331 is a reply to message #5378] Fri, 14 March 2008 06:39 Go to previous message
Eclipse UserFriend
Hi,

> Can I somehow define a Syntax with TCS where x = "Hello World"
> lets the TCSInjector set property "type" of variable x to String,
> because the type of "Hello World" would be String?
>
> Or would I have to do this after Injecting as a semantical task
> independent from the Syntax.

What you want to do is a kind of semantic analysis. You have to do this
after injecting. Note that you can use ATL for this purpose.


Regards,

Frédéric Jouault
Previous Topic:[TCS] NullPointerException with builder setup
Next Topic:[TCS] indexing values in list property
Goto Forum:
  


Current Time: Wed Jul 23 02:35:13 EDT 2025

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

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

Back to the top