Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Theoretical Question(Xtext and ECore-models)
Theoretical Question [message #713925] Tue, 09 August 2011 08:01 Go to next message
Eclipse UserFriend
Hi! Sorry for this very theoretical question - the reason for asking it is not relevant and would take too much room here. Maybe it is sufficient to say, I am trying to understand whether Xtext uses the generated Ecore-models, or if they are just a helpful byproduct.
Xtext creates an Ecore-Model when generating artefacts from the defined DSL. Does Xtext internally use this Ecore model for anything directly e.g. for the editor's syntax highlighting etc. or does it use another AST representation?
Thanks!
Re: Theoretical Question [message #713935 is a reply to message #713925] Tue, 09 August 2011 08:34 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Xtext uses a "Node Model"/Parsetree too.
And there is a model for the grammar too.
In the old Xtext 1.0.x docs there was a section Working with the Parse Tree (aka Node Model)
but this somehow got lost in 2.0.x

But you can basically use NodeModelUtils to get the nodes for an EObject

~Christian

[Updated on: Tue, 09 August 2011 08:37] by Moderator

Re: Theoretical Question [message #713949 is a reply to message #713925] Tue, 09 August 2011 09:24 Go to previous message
Eclipse UserFriend
Hi,

Xtext uses the produced model internally, too. E.g. validation errors or
broken cross links are propagated from the so called semantic model
(a.k.a. Ecore model) to the offsets and position in the input document.
Other services like the outline directly show the state of the model (at
least in the default implementation).

Christian is right, the node model is another in-memory representation
of the input document that is used, too. This one contains other
information and works basically as a trace from the text to the semantic
model.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

On 09.08.11 14:01, mm wrote:
> Hi! Sorry for this very theoretical question - the reason for asking it
> is not relevant and would take too much room here. Maybe it is
> sufficient to say, I am trying to understand whether Xtext uses the
> generated Ecore-models, or if they are just a helpful byproduct.
> Xtext creates an Ecore-Model when generating artefacts from the defined
> DSL. Does Xtext internally use this Ecore model for anything directly
> e.g. for the editor's syntax highlighting etc. or does it use another
> AST representation? Thanks!
>
Previous Topic:Xtend with external templates
Next Topic:scoping function is called too late when code completion is expected
Goto Forum:
  


Current Time: Thu Jul 03 08:07:47 EDT 2025

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

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

Back to the top