Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Use xtext-based plugin as base for another grammar
Use xtext-based plugin as base for another grammar [message #795597] Fri, 10 February 2012 16:55
Adam Missing name is currently offline Adam Missing nameFriend
Messages: 12
Registered: December 2011
Junior Member
Hello,

I'd like to create a coffeescript plugin which can be used to extend its grammar, just like Xbase can be used to build other grammars on top of it. I understand it's more complicated than a simple plugin. My process has these steps


  1. Configure my coffeescript project to have everything needed later
  2. Create a plugin and an update site. Install it into eclipse.
  3. Configure my cake project to properly extend the coffeescript grammar.


In step 1. I register the genmodel in my mwe2 file like this
bean = StandaloneSetup {
  registerGenModelFile = "platform:/resource/csep/src-gen/csep/CoffeeScript.genmodel"
  registerGeneratedEPackage = "csep.coffeeScript.CoffeeScriptPackage"
}

I don't like the "src-gen" part, but after trying different combinations, that was the only one that worked. (I tried the text book example of "csep/model/CoffeeScript.genmodel", I don't know how the "model" part of the URI should be resolved, but it didn't for me).

Step 2. seems to be easy, the same thing as with any other plugin.

Step 3. also presents some problems. First, I had to add a reference to the coffeescript plugin, I did it like this
fragment = ecore.EcoreGeneratorFragment {           	
  referencedGenModels = "platform:/resource/csep/src-gen/csep/CoffeeScript.genmodel"
}

This is really bad. It uses a deprecated method, but I couldn't figure out how to go the recommended way. But my main problem here is, I don't know what URI to use here, it works only on my machine with an existing "src-gen" folder, but it won't if a user just installs this plugin.

The other problem in step 3. is that the generated code refers to "serializer.CoffeeScriptSemanticSequencer" in many places which it can't find. I assume it should be generated, but it's not generated into the "src-gen" folder.

Any help appreciated. I'm using xtext 2.1.0

[Updated on: Fri, 10 February 2012 17:03]

Report message to a moderator

Previous Topic:Code formatting fails
Next Topic:testing custom validator - different behaviour for assertWarning() vs assertWarningContains()?
Goto Forum:
  


Current Time: Tue Apr 23 07:35:25 GMT 2024

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

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

Back to the top