Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » DSL with mixed form/text sintax - selecting different start rules for EmbeddedEditor instances
DSL with mixed form/text sintax - selecting different start rules for EmbeddedEditor instances [message #1228645] Tue, 07 January 2014 17:47 Go to next message
Vlad Gheorghe is currently offline Vlad GheorgheFriend
Messages: 127
Registered: May 2011
Senior Member
Hi everyone,

I have an application using a DSL for which the "upper part" of the semantic model is mapped to different sections on a form, and only the "lower part" has a textual syntax defined with an xtext grammar.

There are two kinds of text "sections". For each kind, the form contains a separate text editor. (using EmbeddedEditor).

AFAIK, the generated parser starts with the first rule of the grammar.

Is there a way to select different start rules for different instances of EmbeddedEditor ?

I suppose that a similar effect can be achieved by using the prefix/suffix parameters
on EmbeddedEditor#createPartialEditor(), and introducing the respective keywords in the grammar.

Is this the only way to do it, or the start parsing rule can be explicitly selected ?

Best regards
Vlad Gheorghe




Re: DSL with mixed form/text sintax - selecting different start rules for EmbeddedEditor instances [message #1228647 is a reply to message #1228645] Tue, 07 January 2014 17:51 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13667
Registered: July 2009
Senior Member
HI,

yes you can call

val eema = editor.createPartialEditor( true);
                                
                                eema.updateModel("usage test Person {", "", "}");


to give pre and postfix for the embedded editor


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Import and content assist
Next Topic:order of variables
Goto Forum:
  


Current Time: Thu Dec 03 08:17:03 GMT 2020

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

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

Back to the top