Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » xtext with xcore as meta model
xtext with xcore as meta model [message #1081418] Wed, 07 August 2013 07:57 Go to next message
Arshad Adavani is currently offline Arshad AdavaniFriend
Messages: 163
Registered: July 2013
Location: Bangalore
Senior Member
Hi,
I am using .xcore file as meta model for my grammar, which looks something like this,

class Sample{
Integer bit
....
.....
....
}

And my grammar:
Sample:
'Sample'....
....

('BIT' | 'BYTE') bit=INT

This "bit=INT" I am referring from my xcore model.
MY PROBLEM IS THAT I WANT TO EITHER TYPE "BIT AND THEN BIT VALUE" OR "BYTE AND THEN BYTE VALUE" IN MY LANGUAGE.
BUT WHEN I WRITE "BYTE AND BYTE VALUE" , I AM CONVERTING BITS INTO BYTES AND THEN STORING IT IN SAME METAMODEL FIELD "bit".
SO LATER WHEN I READ THE "RESOURCE" I WILL GET THE BIT VALUE BUT I AM UNAWARE WHETHER IT IS "BIT OR BYTE"...
"I DON'T WANT TO STORE ONE MORE VARIABLE FOR BYTE IN XCORE".
CAN ANYONE HELP ME OUT WITH THIS PROBLEM ? OR ANY BETTER SUGGESTIONS FOR THIS ??
Thanks in advance ! Smile

I tried with this also
('BIT' bit=INT | 'BYTE' bit=BYTE ) ;
BYTE: INT;

But it gives me:
"Cannot find compatible feature bit in sealed EClass Sample from imported package http://somepath: The existing feature 'bit' has an incompatible type 'EIntegerObject' [java.lang.Integer]. The expected type is 'Byte'."

Any suggestions from anyone?
Thanks in advance!


Arshad
Re: xtext with xcore as meta model [message #1081431 is a reply to message #1081418] Wed, 07 August 2013 08:12 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Arshad,

This is an Xtext question that you've already asked before. Why are you
posting the same question again to newcomer?

On 07/08/2013 9:57 AM, Arshad Adavani wrote:
> Hi,
> I am using .xcore file as meta model for my grammar, which looks
> something like this,
>
> class Sample{
> Integer bit
> ....
> .....
> ....
> }
>
> And my grammar:
> Sample:
> 'Sample'....
> ....
>
> ('BIT' | 'BYTE') bit=INT
> This "bit=INT" I am referring from my xcore model.
> MY PROBLEM IS THAT I WANT TO EITHER TYPE "BIT AND THEN BIT VALUE" OR
> "BYTE AND THEN BYTE VALUE" IN MY LANGUAGE.
> BUT WHEN I WRITE "BYTE AND BYTE VALUE" , I AM CONVERTING BITS INTO
> BYTES AND THEN STORING IT IN SAME METAMODEL FIELD "bit".
> SO LATER WHEN I READ THE "RESOURCE" I WILL GET THE BIT VALUE BUT I AM
> UNAWARE WHETHER IT IS "BIT OR BYTE"...
> "I DON'T WANT TO STORE ONE MORE VARIABLE FOR BYTE IN XCORE".
> CAN ANYONE HELP ME OUT WITH THIS PROBLEM ? OR ANY BETTER SUGGESTIONS
> FOR THIS ??
> Thanks in advance ! :)
>
> I tried with this also
> ('BIT' bit=INT | 'BYTE' bit=BYTE ) ;
> BYTE: INT;
>
> But it gives me: "Cannot find compatible feature bit in sealed EClass
> Sample from imported package http://somepath: The existing feature
> 'bit' has an incompatible type 'EIntegerObject' [java.lang.Integer].
> The expected type is 'Byte'."
>
> Any suggestions from anyone?
> Thanks in advance!


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: xtext with xcore as meta model [message #1081682 is a reply to message #1081431] Wed, 07 August 2013 14:47 Go to previous messageGo to next message
Arshad Adavani is currently offline Arshad AdavaniFriend
Messages: 163
Registered: July 2013
Location: Bangalore
Senior Member
Hi Ed,
I am sorry.. I am actually not getting any xtext specific forums.. When i google it, its giving me this link only.


Arshad
Re: xtext with xcore as meta model [message #1081692 is a reply to message #1081682] Wed, 07 August 2013 15:01 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
When I google, the first thing that comes up is
http://www.eclipse.org/forums/index.php?t=thread&frm_id=27 and their
home page has a community link: http://www.eclipse.org/Xtext/community.html

On 07/08/2013 4:47 PM, Arshad Adavani wrote:
> Hi Ed,
> I am sorry.. I am actually not getting any xtext specific forums..
> When i google it, its giving me this link only.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Error Configuring Tomcat 7.0
Next Topic:automate preferences for projects in Eclipse Ganymade
Goto Forum:
  


Current Time: Thu Apr 18 11:47:37 GMT 2024

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

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

Back to the top