Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Access location of non-dsl files in workspace
Access location of non-dsl files in workspace [message #1796523] Mon, 15 October 2018 16:49 Go to next message
Alfonso de la Vega is currently offline Alfonso de la VegaFriend
Messages: 18
Registered: January 2016
Junior Member
Hello,

I am working on a DSL that queries EMF model contents.

As part of the DSL grammar, a user indicates the paths of the metamodel and model files that will be employed in the queries, such as:

    domainModel "models/dummy.ecore"
    domainModelInstance "models/dummy.model"

    <queries over the model here>


Being "models" a folder in the current project where the dsl files are defined.

I am having problems finding the absolute path or platform URI to load these resources to make them available for the dsl components (e.g. the validator would need the "dummy.ecore" metamodel to check the correctness of the query).

I do not know what is the preferred way to access these files, or if the usage of external files inside the functionality of dsl components is a supported or common feature in Xtext (or even desirable).

Thank you very much,
Alfonso
Re: Access location of non-dsl files in workspace [message #1796524 is a reply to message #1796523] Mon, 15 October 2018 16:54 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
i am not sure what you are exactly doing. but shouldn't you have actualy references to EClasses and EAttributes instead of some manual validation.
you may have a look what xtext itself does if you import a metamodel into grammar files


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Example for Semantic Refactoring
Next Topic:class can not be resolved to type
Goto Forum:
  


Current Time: Fri Apr 26 04:38:40 GMT 2024

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

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

Back to the top