Xtext serialization :help to understand the error trace [message #709546] |
Thu, 04 August 2011 02:27 |
Sébastien Gandon Messages: 184 Registered: July 2009 |
Senior Member |
|
|
Hello,
I am using Xtext 1.0.1 to serialize an EMF model and I get an error that I would like to really understand.
It has to deal with the backtracking algorithm.
Can someone describe me the principle of the algorithm, I have red carefully the documentation but I am not sure I understand everything.
It seems to trying to find routes in the gramar definition that matches the model elements and when one of this route as a rule that cannot match the model element inspected it goes back to find another route and then eventually goes back in the emf model???
Actually I'd like to understand what the possible reasons may mean
n/a ?
is not set <- for is one I guess that the is an assignment in the grammar that cannot be done cause the model feature is not set, but if the rule is optional, this should not happend ? or if I have a ITransientValueService implementation saying this feature is transient, this should not happen
All 87 values of ParametersType.elementParameter have been consumed. More are needed to continue here ???
Thanks to anyones help.
SeB
org.eclipse.xtext.parsetree.reconstr.XtextSerializationException: Serialization failed
<# of serialized tokens>: <EObject path> "<serializable fragment, starting from the end>":
-> <possible reasons for not continuing>
901:ProcessType: "defaultContext Default , ContextType { NAME: Defaul...":
-> ProcessType_ProcessTypeAction_0: n/a
893:ProcessType.context[0]->ContextType'Default': "ContextType { } addParameters { addElementParameter...":
-> ContextType_ContextTypeAction_0: n/a
892:ProcessType.context[0]->ContextType'Default': "} addParameters { addElementParameters { COMP_DEFAU...":
-> ContextType_ConfirmationNeededAssignment_4_2: ContextType.confirmationNeeded is not set.
886:ProcessType.parameters->ParametersType: ", COMP_DEFAULT_FILE_DIR : /Applications/java/eclips...":
-> ParametersType_ElementParameterAssignment_4_1: All 87 values of ParametersType.elementParameter have been consumed. More are needed to continue here.
880:ProcessType.parameters->ParametersType.elementParameter[0]->ElementParameterType'COMP_DEFAULT_FILE_DIR': "COMP_DEFAULT_FILE_DIR , PRODUCT_ROOT_DIR : /Applica...":
-> ElementParameterType_ElementParameterTypeAction_0: n/a
879:ProcessType.parameters->ParametersType.elementParameter[0]->ElementParameterType'COMP_DEFAULT_FILE_DIR': "COMP_DEFAULT_FILE_DIR , PRODUCT_ROOT_DIR : /Applica...":
-> ElementParameterType_ElementParameterTypeAction_0: n/a
876:ProcessType.parameters->ParametersType: "addElementParameters { PRODUCT_ROOT_DIR : /Applicat...":
-> ParametersType_ParametersTypeAction_0: n/a
874:ProcessType.parameters->ParametersType: ", COMP_DEFAULT_FILE_DIR : /Applications/java/eclips...":
-> ParametersType_ElementParameterAssignment_4_1: All 87 values of ParametersType.elementParameter have been consumed. More are needed to continue here.
873:ProcessType.parameters->ParametersType: "addElementParameters { COMP_DEFAULT_FILE_DIR : /App...":
-> ParametersType_ParametersTypeAction_0: n/a
871:ProcessType.parameters->ParametersType.elementParameter[1]->ElementParameterType'PRODUCT_ROOT_DIR': "PRODUCT_ROOT_DIR , COMP_DEFAULT_PROJECT_DIR : /Appl...":
-> ElementParameterType_ElementParameterTypeAction_0: n/a
[Updated on: Thu, 04 August 2011 02:28] Report message to a moderator
|
|
|
Re: Xtext serialization :help to understand the error trace [message #719928 is a reply to message #709546] |
Mon, 29 August 2011 13:39 |
Moritz Eysholdt Messages: 161 Registered: July 2009 Location: Kiel, Germany |
Senior Member |
|
|
Hi,
you ran into a conceptional problem in Xtext 1.0.1. You can avoid this
by using Xtext 2.0.1, it contains a rewritten implementation of the
serializer.
On 04.08.11 04:27, S wrote:
> Hello,
> I am using Xtext 1.0.1 to serialize an EMF model and I get an error that
> I would like o really understand.
> It has to deal with the backtracking algorithm.
> Can someone describe me the principle of the algorithm, I have red
> carefully the documentation but I am not sure I understand everything.
> It seems to trying to find routes in the gramar definition that matches
> the model elements and when one of this route as a rule that cannot
> match the model element inspected it goes back to find another route
> andthen eventually goes back in the emf model???
yes, that's basically it. The grammar is transformed to a big state
machine and the backtracking algorithm tries to find a path through this
state machine. A valid path must "consume" all non-transient values form
the model.
The problem (that you can see in the error message) is, that if no path
is found, the algorithm spits out a lot of partial paths (all dead
ends). There is no way to tell which of these partial paths should have
been successful. Therefore, the error message lists the longest partial
paths.
My experience is that it's usually easier to dump the model using
EmfFormatter.objToStr() and compare it with your grammar that it is to
understand this list of partial paths. Sorry. If you can update to Xtext
2.0.1, do it.
regards,
Moritz
> Actually I'd like to understand what the possible reasons may mean
> n/a ?
> is not set <- for is one I guess that the is an assignment in the
> grammar that cannot be done cause the model feature is not set, but if
> the rule is optional, this should not happend ? or if I have a
> ITransientValueService implementation saying this feature is transient,
> this should not happen
> All 87 values of ParametersType.elementParameter have been consumed.
> More are needed to continue here ???
>
> Thanks to anyones help.
>
> SeB
>
> org.eclipse.xtext.parsetree.reconstr.XtextSerializationException:
> Serialization failed
> <# of serialized tokens>: <EObject path> "<serializable fragment,
> starting from the end>":
> -> <possible reasons for not continuing>
> 901:ProcessType: "defaultContext Default , ContextType { NAME: Defaul...":
> -> ProcessType_ProcessTypeAction_0: n/a
> 893:ProcessType.context[0]->ContextType'Default': "ContextType { }
> addParameters { addElementParameter...":
> -> ContextType_ContextTypeAction_0: n/a
> 892:ProcessType.context[0]->ContextType'Default': "} addParameters {
> addElementParameters { COMP_DEFAU...":
> -> ContextType_ConfirmationNeededAssignment_4_2:
> ContextType.confirmationNeeded is not set.
> 886:ProcessType.parameters->ParametersType: ", COMP_DEFAULT_FILE_DIR :
> /Applications/java/eclips...":
> -> ParametersType_ElementParameterAssignment_4_1: All 87 values of
> ParametersType.elementParameter have been consumed. More are needed to
> continue here.
> 880:ProcessType.parameters->ParametersType.elementParameter[0]->ElementParameterType'COMP_DEFAULT_FILE_DIR':
> "COMP_DEFAULT_FILE_DIR , PRODUCT_ROOT_DIR : /Applica...":
> -> ElementParameterType_ElementParameterTypeAction_0: n/a
> 879:ProcessType.parameters->ParametersType.elementParameter[0]->ElementParameterType'COMP_DEFAULT_FILE_DIR':
> "COMP_DEFAULT_FILE_DIR , PRODUCT_ROOT_DIR : /Applica...":
> -> ElementParameterType_ElementParameterTypeAction_0: n/a
> 876:ProcessType.parameters->ParametersType: "addElementParameters {
> PRODUCT_ROOT_DIR : /Applicat...":
> -> ParametersType_ParametersTypeAction_0: n/a
> 874:ProcessType.parameters->ParametersType: ", COMP_DEFAULT_FILE_DIR :
> /Applications/java/eclips...":
> -> ParametersType_ElementParameterAssignment_4_1: All 87 values of
> ParametersType.elementParameter have been consumed. More are needed to
> continue here.
> 873:ProcessType.parameters->ParametersType: "addElementParameters {
> COMP_DEFAULT_FILE_DIR : /App...":
> -> ParametersType_ParametersTypeAction_0: n/a
> 871:ProcessType.parameters->ParametersType.elementParameter[1]->ElementParameterType'PRODUCT_ROOT_DIR':
> "PRODUCT_ROOT_DIR , COMP_DEFAULT_PROJECT_DIR : /Appl...":
> -> ElementParameterType_ElementParameterTypeAction_0: n/a
|
|
|
Powered by
FUDForum. Page generated in 0.02198 seconds