Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Partial grammar editor(Is it possible to launch an editor that only contains a fragment of the grammar)
Partial grammar editor [message #1674054] Sat, 14 March 2015 15:44 Go to next message
Charlie Mordant is currently offline Charlie MordantFriend
Messages: 88
Registered: July 2010
Member

Hi,

Is it possible to open an editor where we can edit a part of the grammar.

Let explain a simple case (kind of java grammar).

The according xtext grammar would looks like this:
Class:
{Class} attributes+=Attr methods+=Method;

Attr:
{Attr} 'a:' (visibility=VIBILITY_KIND)? name=ID ';';
Method:
{Method} 'm:' (visibility=VIBILITY_KIND)? name=ID '(' (arg+=Class (',' arg+=Class)*)? ')'


Now, let's say that I have an EMF editor with property view made with EEF/PMF/EMFForms

When I select a Class element, I would want to be able to see the 'attr' and 'method' inputs editable with xtext (autocomplete, validation...).

Is it realizable without making an xtext grammar for each concept (which will make a lot of plugins for a fairly basic task)?

Regards,
Charlie
Re: Partial grammar editor [message #1674083 is a reply to message #1674054] Sat, 14 March 2015 16:00 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
hi, have a look at xtexts embedded editor

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Partial grammar editor [message #1674503 is a reply to message #1674054] Sat, 14 March 2015 19:48 Go to previous messageGo to next message
Charlie Mordant is currently offline Charlie MordantFriend
Messages: 88
Registered: July 2010
Member

Thanks, I already use this editor in a project.

The fact is that I want to have my 'attr' property sheet input only showing the attribute definition, idem for method definition...

e.g., my property sheet would look like this when I select my 'Class' instance on the EMF editor:
[Label] Class: MyClass
[Label] Attributes: [Input][Button]
[Label] Methods: [Input][Button]


When I click on the 'Attributes' Button, or fill its input, I want to ONLY see and fill Attributes definition (i.e. "+myAttr:ItsType" separated by commas) in my EmbeddedEditor.

When I click on the 'Methods' button, I just want to see method definitions, (i.e "+myMethod(attr1:Attr1Type):ReturnType") etc...
Re: Partial grammar editor [message #1674541 is a reply to message #1674503] Sat, 14 March 2015 20:07 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
the embedded editor class should have methods that support partial editing

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Partial grammar editor [message #1674902 is a reply to message #1674541] Sat, 14 March 2015 23:24 Go to previous message
Charlie Mordant is currently offline Charlie MordantFriend
Messages: 88
Registered: July 2010
Member

Thank you again, will try and see Wink.

Best regards
Previous Topic:Doubt about cross-references
Next Topic:create a non xtend generatorFragment (Java)
Goto Forum:
  


Current Time: Thu Apr 25 17:52:26 GMT 2024

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

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

Back to the top