Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Access to xtext semantic model
Access to xtext semantic model [message #1453726] Mon, 27 October 2014 11:35 Go to next message
Eclipse UserFriend
Hi all,

As I understand xtext always has two models:

1) syntax model - grammar
2) semantic model - derived model from syntax

In my application I want to give an access to modify semantic model from different editors (properties view, custom editors, etc). All this changes should be applied on the text as well.

Here I see two ways:

1) Write transformator from semantic model to syntax (grammar model). And after each modification generate new text presentation. (how to save formatting user?)

2) Build all editors on syntax model (apply modifications on syntax) and use semantic only for view.

I think this case is very common. How everyone solves this?

---
Thanks,
Igor
Re: Access to xtext semantic model [message #1454052 is a reply to message #1453726] Mon, 27 October 2014 22:43 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Igor,

please look into IXtextDocument#readOnly and #modify. This should guide you.

Best,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: Access to xtext semantic model [message #1454248 is a reply to message #1454052] Tue, 28 October 2014 06:07 Go to previous message
Eclipse UserFriend
Thanks for reply.

I will check org.eclipse.xtext.ui.editor.model.IXtextDocument.modify. But package looks strange for me, xtextDocument will be accessible only with opened editor? Because I want modify model without xtext editor.
Previous Topic:Xtext IResourceValidator linking errors
Next Topic:How to resolve Xtext variables' names and keywords statically?
Goto Forum:
  


Current Time: Wed Apr 24 20:19:07 GMT 2024

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

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

Back to the top