|
|
Re: Override GMF source code to change diagram <-> text parsing [message #842393 is a reply to message #841665] |
Thu, 12 April 2012 08:55 |
Heinz Huber Messages: 45 Registered: February 2012 |
Member |
|
|
Hi Guillaume,
first of all thanks for your quick reply!
The "combine Xtext and GMF" link helped me a bit, but i still got a question.
In the article is a part with the following text:
Quote:In an Xtext editor, changes in the text are transfered to the underlying XtextResource (src) by a call to the method XtextResource.update(int, int, String) (src), which will trigger a partial parsing of the dirty text region and a replacement of the corresponding subtree in the AST model (semantic model).
So is it possible to change the way of parsing by overwriting some functions? I checked the API and found the following interface:
http://download.eclipse.org/modeling/tmf/xtext/javadoc/2.0.0/org/eclipse/xtext/resource/XtextResource.html
My first idea is to overwrite the doLoad(java.io.InputStream inputStream, java.util.Map<?,?> options), doSave(java.io.OutputStream outputStream, java.util.Map<?,?> options) and the update(int, int, String) function. Am i right, that these functions are doing the parser things if one resource (text or graphic) is changed?
Is my first idea the right one? Or is there another way to solve this?
Best Regards,
Heinz
[Updated on: Thu, 12 April 2012 09:35] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03067 seconds