|
Re: XCORE and XTEXT Grammar [message #1078612 is a reply to message #1078570] |
Sat, 03 August 2013 08:35 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Arshad,
Comments below.
On 03/08/2013 9:04 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 ??
If I understand correctly, your model has no way to record or to know
whether you've represented the value in the grammar as bit or byte. So,
given just an instance of a Sample with a field of type Integer (why not
use int?) you'd have no way to know how that should be serialized
according to your grammar as either a BIT or a BYTE. You need something
else in your model to record such information, e.g., a boolean field or
an enum field for recording the BIT verses BYTE keyword.
Thanks in advance !
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
|
|
|
Re: XCORE and XTEXT Grammar [message #1146916 is a reply to message #1146514] |
Sun, 20 October 2013 13:55 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Did you mean to post this on Xtext's eclipse.tmf forum?
On 20/10/2013 9:36 AM, Hirdesh Agrawal wrote:
> Dear All,
>
> I need your favor or suggestion regarding migrate the xtext version
> from 1.0.1 to 2.3.0 in custom application.
> I followed all following process for migrate the xtext version.
> 1. Delete the old plug-ins and update the latest plug-ins in target
> platform.
> 2. Update the Plug-in Dependencies and Import Statements.
> 3. Introduction of the Qualified Name.
> 4. Changes in the index and in find references.
> 5. Rewritten Node Model.
> 6. AutoEditStrategy.
> 7. Other Noteworthy API Changes
> To consider the above steps, I started the work with Eclipse-4.2,
> Which has a xtext-2.3.0 dependency. Successfully I completed the all
> above steps and removed the compilation error.
>
> Problem: After that I start the testing and getting below error Messages:
> [XtextLinkingDiagnostic: null:6 Couldn't resolve reference to Material
> 'MPS_RECUR'., XtextLinkingDiagnostic: null:9 Couldn't resolve
> reference to Cstic 'NUM_OF_ALLOC'., XtextLinkingDiagnostic: null:15
> Couldn't resolve reference to Cstic 'INSTANCE_NUM'.,
> XtextLinkingDiagnostic: null:14 Couldn't resolve reference to Class
> 'ALLOC'.]
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.04447 seconds