Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » xtextbin
xtextbin [message #1409884] Tue, 19 August 2014 08:08 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi,

I have an xtext grammar, which I use in a standalone way, I get an
exception on processing the .xtextbin. The reason is that the
BinaryGrammarResourceFactory is not registered for this extension.

In another grammar, I see this in [grammar]StandAloneSetupGenerated:

if
(!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xtextbin"))
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
"xtextbin", new
org.eclipse.xtext.resource.impl.BinaryGrammarResourceFactoryImpl());


So, my question is, what would trigger this to be included, (Pressume in
the mwe2 definition?).

Oh, en what is xtextbin ?

Thank You,
Christophe
Re: xtextbin [message #1409890 is a reply to message #1409884] Tue, 19 August 2014 08:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

xtextbin is (basically) a persisted version of the grammar


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: xtextbin [message #1409896 is a reply to message #1409890] Tue, 19 August 2014 08:41 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 19-08-14 10:26, Christian Dietrich wrote:
> Hi,
>
> xtextbin is (basically) a persisted version of the grammar
Thx Christian, do you know about my first question? What controls if the
registration of xtextbin resourcefactory happens?
Re: xtextbin [message #1409905 is a reply to message #1409896] Tue, 19 August 2014 09:10 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
btw the trigger to exclude this is a xmlVersion In GrammarAccessFragment

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: xtextbin [message #1409933 is a reply to message #1409884] Tue, 19 August 2014 10:39 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The registration is conditionally included by the lines you have quoted.

For the most past *.xtextbin just works, unless you try to backport to
Juno for which Xtext 2.3.0 had no *.xtextbin support.

If you want an Xtext 2.4/2.5/2.6 generated editor to work on Juno and
Xtext 2.3.0 have a look at

org.eclipse.ocl.examples.xtext.base.services.CompatibilityGrammarProvider.BinaryGrammarResourceFactoryImpl
and its references.

Regards

Ed Willink

On 19/08/2014 09:08, Christophe Bouhier wrote:
> Hi,
>
> I have an xtext grammar, which I use in a standalone way, I get an
> exception on processing the .xtextbin. The reason is that the
> BinaryGrammarResourceFactory is not registered for this extension.
>
> In another grammar, I see this in [grammar]StandAloneSetupGenerated:
>
> if
> (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xtextbin"))
>
>
> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
> "xtextbin", new
> org.eclipse.xtext.resource.impl.BinaryGrammarResourceFactoryImpl());
>
>
> So, my question is, what would trigger this to be included, (Pressume in
> the mwe2 definition?).
>
> Oh, en what is xtextbin ?
>
> Thank You,
> Christophe
Re: xtextbin [message #1409969 is a reply to message #1409905] Tue, 19 August 2014 12:59 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 19-08-14 11:10, Christian Dietrich wrote:
> btw the trigger to exclude this is a xmlVersion In GrammarAccessFragment
Thanks, Now I also noticed, the .ecore and .genmodel wasn't generated...
Is this default behaviour?
Re: xtextbin [message #1409984 is a reply to message #1409969] Tue, 19 August 2014 13:36 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
this is done by EcoreGeneratorFragment

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:xtext 2.6 and org.eclipse.search
Next Topic:Grammar element with cross-reference
Goto Forum:
  


Current Time: Tue Apr 16 21:55:57 GMT 2024

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

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

Back to the top