Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Built in types for non Xbase based language
Built in types for non Xbase based language [message #1079568] Sun, 04 August 2013 20:16 Go to next message
Rodrigo Watanabe is currently offline Rodrigo WatanabeFriend
Messages: 2
Registered: August 2013
Junior Member
Im developing a DSL that cross-compiles to Javascript, but I am having some difficulty to figure out how to "Overlay" the native types like String, Math, Number and so on.

Here what I've came up so far...

I have a couple of files written in my DSL located at the plugins main package ex: String.mydsl, Number.mydsl...

I've already overridden ImportedNamespaceAwareLocalScopeProvider.getImplicitImports(), it work's, but only when I have the files on the DSL project.

How to put this files on my DSLs projects scope, so that my scope provider can show the built in types?
Re: Built in types for non Xbase based language [message #1080886 is a reply to message #1079568] Tue, 06 August 2013 13:48 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
Are your DSL projects plug-in projects? Then you could add the plug-in
containing your library types to the dependencies. This should work even
if the library plug-in is installed. Make sure the models containing the
library types are exported in the build.properties.

Otherwise you have to put the library models on the global scope
somehow, e.g. by hooking into your IGlobalScopeProvider or defining a
org.eclipse.xtext.resource.IContainer that contains the
IResourceDescriptions for the library models.

Am 05.08.13 14:10, schrieb Rodrigo Watanabe:
> Im developing a DSL that cross-compiles to Javascript, but I am having
> some difficulty to figure out how to "Overlay" the native types like
> String, Math, Number and so on.
>
> Here what I've came up so far...
>
> I have a couple of files written in my DSL located at the plugins main
> package ex: String.mydsl, Number.mydsl...
>
> I've already overridden
> ImportedNamespaceAwareLocalScopeProvider.getImplicitImports(), it
> work's, but only when I have the files on the DSL project.
>
> How to put this files on my DSLs projects scope, so that my scope
> provider can show the built in types?


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Re: Built in types for non Xbase based language [message #1081712 is a reply to message #1080886] Wed, 07 August 2013 15:37 Go to previous message
Rodrigo Watanabe is currently offline Rodrigo WatanabeFriend
Messages: 2
Registered: August 2013
Junior Member
Hi Jan, thanks for replying!

The plugin dependency approach seems to work only with Java projects, now I'm trying to extend the class org.eclipse.xtext.resource.containers.StateBasedContainerManager and create my library IContainer in the "getVisibleContainers" method to make it visible to all containers, but it's not working, do you have any example or documentation that I could use as reference?
Previous Topic:Registering EMF EPackage for Xtext
Next Topic:Generating default XText from XCore/Genmodel
Goto Forum:
  


Current Time: Fri Apr 19 12:11:06 GMT 2024

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

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

Back to the top