Partial grammar editor [message #1674054] |
Sat, 14 March 2015 15:44 |
|
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 #1674503 is a reply to message #1674054] |
Sat, 14 March 2015 19:48 |
|
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...
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03651 seconds