Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Support two different grammars in eclipse
Support two different grammars in eclipse [message #1731534] Fri, 06 May 2016 15:10 Go to next message
Danny Quizzo is currently offline Danny QuizzoFriend
Messages: 16
Registered: April 2016
Junior Member
Can xtext support two different grammars in one single eclipse application?
For example:
1) I create a project and write a grammar in it (say java style grammar)
2) I create another sub project and write a grammar in it (say python style grammar)
3) Can I invoke a single eclipse application with two editor windows that will support the two separate grammars? would it be by a file name (.java/.python), or would it be by something else?

Thank you for your help
Re: Support two different grammars in eclipse [message #1731538 is a reply to message #1731534] Fri, 06 May 2016 15:18 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Danny,

Yes of course that works. You can register by file extension (but also
by content type if several different types of content have the same file
extension).

On 06.05.2016 17:10, Danny Quizzo wrote:
> Can xtext support two different grammars in one single eclipse
> application?
> For example:
> 1) I create a project and write a grammar in it (say java style grammar)
> 2) I create another sub project and write a grammar in it (say python
> style grammar)
> 3) Can I invoke a single eclipse application with two editor windows
> that will support the two separate grammars? would it be by a file
> name (.java/.python), or would it be by something else?
>
> Thank you for your help


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Support two different grammars in eclipse [message #1731539 is a reply to message #1731538] Fri, 06 May 2016 15:24 Go to previous messageGo to next message
Danny Quizzo is currently offline Danny QuizzoFriend
Messages: 16
Registered: April 2016
Junior Member
How would you do that?
Re: Support two different grammars in eclipse [message #1731554 is a reply to message #1731539] Fri, 06 May 2016 18:13 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
It seems unlikely you'd need that and the answer is complex. So best to
pick a unique extension, and worry about such complexities later rather
than up front.


On 06.05.2016 17:24, Danny Quizzo wrote:
> How would you do that?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Support two different grammars in eclipse [message #1732014 is a reply to message #1731554] Wed, 11 May 2016 18:18 Go to previous messageGo to next message
Danny Quizzo is currently offline Danny QuizzoFriend
Messages: 16
Registered: April 2016
Junior Member
So as long as a I create to xtext files with different extensions, all should be well?

thanks
Re: Support two different grammars in eclipse [message #1732568 is a reply to message #1732014] Wed, 18 May 2016 10:00 Go to previous message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
Yes

---
Get professional support from the Xtext committers at www.typefox.io
Previous Topic:Context-dependent Name Resolution
Next Topic:Packages required to built-in xtext inside eclipse plugin
Goto Forum:
  


Current Time: Thu Apr 25 11:28:13 GMT 2024

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

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

Back to the top