new xtext [message #848597] |
Wed, 18 April 2012 11:52 |
|
HI.
XTEX ragas are again and I'm stuck.
I basically wrote my grammar and I would like to introduce within this external objects ... someone can help me I read the tutorial but I still need a little help ....
|
|
|
|
Re: new xtext [message #848715 is a reply to message #848620] |
Wed, 18 April 2012 14:05 |
|
What do you mean by that phrase in German?
Anyway the problem is one for which I had already written ..... and that is how I can bring into the grammar of my external ogetti ..... or better Coime can inject!! I want to make sure that the car appears to me a complete list of java objects created by me .... (class.java) .... ok .... I was not clear??
Thank you.
|
|
|
|
Re: new xtext [message #848780 is a reply to message #848739] |
Wed, 18 April 2012 15:11 |
|
ok
I wrote the grammar on a 'select' sql! I wish I was with the auto-complete list of proposed names attribbuti a db. Clearly the list of the names and I should give input into this thing ... I'm sure you can do but as I do not know .... I read all the documentation but I did not understand how much .... . you place the example
Select: 'select' nameAttributes=NAME;
NAME must be one of the names on the list that I will step input
I hope I was clear!
|
|
|
Re: new xtext [message #848794 is a reply to message #848780] |
Wed, 18 April 2012 15:26 |
|
Hi,
still the question?
are you talking about content assist? your grammar suggest so
are you talking about validation? the MUST indicates this
are you talking about cross refs? this would do content assist and validation, but
you need something (emf based) you can refer to. do you have something?
normally you would have a dsl that supports the definition
and the usage of the things (attibutename or whatever it is in your case)
so lets asume you want some content assist only
so let us simply fill the ProposalProvider hook for this?
public class MyDslProposalProvider extends AbstractMyDslProposalProvider {
@Override
public void completeSelect_NameAttributes(EObject model,
Assignment assignment, ContentAssistContext context,
ICompletionProposalAcceptor acceptor) {
acceptor.accept(createCompletionProposal("non", context));
acceptor.accept(createCompletionProposal("capirci", context));
acceptor.accept(createCompletionProposal("un", context));
acceptor.accept(createCompletionProposal("tubo", context));
super.completeSelect_NameAttributes(model, assignment, context, acceptor);
}
}
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
Re: new xtext [message #849544 is a reply to message #848794] |
Thu, 19 April 2012 08:40 |
|
Thank you Christian right from the guide I had a tube capiuto .... now thanks to you beginning to understand something ... I'm sorry but I must translate the English language because even if I know I'm not a veteran and often lose logical thread of a conversation .... I hope you understand me! Thanks again
|
|
|
Re: new xtext [message #849562 is a reply to message #849206] |
Thu, 19 April 2012 08:58 |
|
Henrik is just like the NAME should be a value, such as a string, contained in a list that is outside the grammar.In The my case should be a list of names of attributes.The My goal is to interface with a db and then map table names, names attributes and more. These names will be available with my grammar when I go to use the auto! I hope I was clear! Thanks so much
|
|
|
|
Re: new xtext [message #849778 is a reply to message #849666] |
Thu, 19 April 2012 12:52 |
|
Kindly explain how you do this?
For now, I did what you told me earlier and that is rewriting the methods in the class MyDslProposalProvider and everything is ok!
Now I ask you.
If instead of the name would have a get method that returns the name of an external object can do that?
example:
acceptor.accept (createCompletionProposal (Object.getName (), context));
Thanks for your patience
|
|
|
Re: new xtext [message #849838 is a reply to message #849778] |
Thu, 19 April 2012 13:48 |
|
do whatever you want in the complete method
but i ask you to have a look at following grammar, give it a try use it and you will understand what we mean when talking about cross refs
Model:
elements+=Element*
usages+=Usage*;
Element: "element" name=ID;
Usage: "use" ref=[Element];
just create a sample model with some elements
and some usages
and have a look how the contentsasst and the editor behave for the usages.
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
[Updated on: Thu, 19 April 2012 14:01] Report message to a moderator
|
|
|
Re: new xtext [message #850923 is a reply to message #849838] |
Fri, 20 April 2012 13:22 |
|
Ok I've done this kind of evidence, and I realized what a cross-reference.
Now I ask you, if it is possible that the name for Element I is returned by a get method elementValue from any interface? I need to inject in my grammar names for Element interface through which users enter!
User Name >> insert Element -> Goofy
User Name >> insert Element -> Gino
Do you understand?
thanks
|
|
|
|
|
|
|
|
Re: new xtext [message #850955 is a reply to message #850941] |
Fri, 20 April 2012 13:55 |
|
Ok I'll explain everything! I wrote the grammar for a sql editor although I'm not sure that's entirely accurate since 15 days and I are experimented.
This editor would later take input attributes names and tables names in the db. I'm trying to create a link
so it is possible that once you have entered these names are visible in my grammar so that they can use the car completed and all the resources I offer xtext! Now the point is ... in your example above cross-reference as I can assign a name obtained by a getName () element?
|
|
|
|
|
Re: new xtext [message #851033 is a reply to message #850965] |
Fri, 20 April 2012 15:28 |
|
Sorry again christian .... ok fine cross-reference!
Now I ask you.
Doing so:
Attribute:
name = [jvmType :: JvmType];
Assists with the content I get a list of Java types
... right?
And if you want to see a list of my guys ... I have to redefine what??
example
Attribute:
name = [MyTypes MyType =]
;
In a way that I return all attributes the db?
|
|
|
|
Re: new xtext [message #851062 is a reply to message #851054] |
Fri, 20 April 2012 16:02 |
|
Model:
attribbuti+=Attributo*
selects+=Select
;
Attributo: "attribbuto" name=ID;
Select: "select" ref=[Mytypes::Mytype];
so that:
select list< name
last name
age
work
>
course list <> does not appear
|
|
|
|
Re: new xtext [message #857140 is a reply to message #851070] |
Thu, 26 April 2012 09:23 |
|
Hi
I wonder if formulation can aggingere xtext interface to my project, I get the string from which to throw them into the content assist
example:
public interface NamesAttributes
{
public String getNameAttribute ();
}
and so do
MyDslProposalProvider {public class extends AbstractMyDslProposalProvider
@ Inject
NameAttributes nameAttributes
@ Override
public void completeSelect_Nomeattribbuto
(EObject model, Assignment assignment,ContentAssistContext context,
ICompletionProposalAcceptor acceptor)
{
acceptor.accept (createCompletionProposal
(nameAttributes.getNameAttribute (), context));
super.completeSelect_Nomeattribbuto (model, assignment, context, acceptor);
}
}
|
|
|
|
Re: new xtext [message #857340 is a reply to message #857258] |
Thu, 26 April 2012 13:15 |
|
Sorry Christian ... where I could implement my interface ..... I mean where I can implement it (I mean the place) for viewing. This interface is basically an external link from which I attribute names are provided!
|
|
|
|
Powered by
FUDForum. Page generated in 0.06905 seconds