Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Library of keywords, function, and method signatures
Library of keywords, function, and method signatures [message #1020181] Sun, 17 March 2013 13:15 Go to next message
Steve Kallestad is currently offline Steve KallestadFriend
Messages: 62
Registered: March 2013
Member
I have what I think is a pretty common task in front of me.

My language has a variety of built-in functions or methods. End users can build their own.

I want to accomplish a few things:

1) validate parameters (right number of params, right data types)
2) templated function completion.

I want to know what strategies are generally used as a best practice.

The way java works, the libraries on the end users machine are searched and a dynamic template proposal is offered.

That seems like the road I should be going down, but I thought I'd ask if there was a built-in way or barring that if anyone has an implementation example or tutorial to share. (My google-fu is not strong this morning)

Also, there could potentially be a lot of data to go through, and I obviously don't want to be reading a bunch of files with every keystroke, so a cache is in order. Is there a built-in cache for storing this kind of data (either from XText or within Eclipse), or am I left to do that on my own?

If I'm on my own, where (within what class) do you generally instantiate your cache so that it can be leveraged in validation/syntax highlighting/template proposals, etc.
Re: Library of keywords, function, and method signatures [message #1020254 is a reply to message #1020181] Sun, 17 March 2013 18:25 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

a proposed way for providing built-in functions is hinted at here http://blogs.itemis.de/stundzig/archives/795

Validation and code completion should be implemented for the language in general. It then works out of the box for the libraries.

Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Library of keywords, function, and method signatures [message #1021382 is a reply to message #1020254] Wed, 20 March 2013 00:54 Go to previous message
Steve Kallestad is currently offline Steve KallestadFriend
Messages: 62
Registered: March 2013
Member
Alexander - I wanted to say a quick thank you.

It took me a while before I had the time to absorb that series of articles, but eventually it clicked. For an XText/EMF veteran it's probably a simple set of concepts, but for someone who hadn't referenced terms like Abstract Syntax Tree in twenty years...

Anyhow, that solved most of my question. The other part was checking parameter counts/types. That was simply a matter of implementing a Validator and once I had the cross reference in place, comparing the cross referenced parameters to the user parameters.
Previous Topic:Attaching keywords to variables within Xbase expressions
Next Topic:Query the model of a Document
Goto Forum:
  


Current Time: Fri Apr 19 21:13:57 GMT 2024

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

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

Back to the top