Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problem serializing valid file content with expression
Problem serializing valid file content with expression [message #753376] Wed, 26 October 2011 22:36 Go to next message
Mary Komor is currently offline Mary KomorFriend
Messages: 61
Registered: July 2009
Member
Hi,

In my DSL grammar, I have rules for expressions that is modeled after the
expression language used by the compiler for my language. It's actually
pretty standard expression language. However, the
BacktrackingSemanticSequencer seems to be having problems creating the
sequence following these rules and gets stuck when trying to create the
"backtracking failed diagnotic" when serialization fails.

Here's what I tried to do:
1. Programmatically load my resource (XtextResource) containing very minimal
content which has a very simple expression. The load and parse completes
successfully.
2. Then I call the ConcreteSyntaxValidator to make sure that there are no
validation errors.
3. Right away, I call save on the resource with validation switched off. The
save never returns. When I take a look in the debugger, it's stuck in
NfaToGrammar#<ELEMENT, STATE, TOKEN> ELEMENT nfaToGrammar(Nfa<STATE>,
Function<STATE, TOKEN>, IGrammarFactory<ELEMENT, TOKEN>)

I've let it run for a couple of hours and it has still not returned. Any
ideas why the serializer is having problems serializing valid content?

Mary
Re: Problem serializing valid file content with expression [message #753400 is a reply to message #753376] Thu, 27 October 2011 05:13 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi, there are a couple of Bugs around the Serializer.
So do you use the Old or the New experimental one? (see workflow file) If you use the Old then try the New. If the New then try the Old and
try if it works with the latest nightly build. If not please file a bug with the grammar and Test attached into bugzilla.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Problem serializing valid file content with expression [message #753618 is a reply to message #753400] Fri, 28 October 2011 05:36 Go to previous messageGo to next message
Mary Komor is currently offline Mary KomorFriend
Messages: 61
Registered: July 2009
Member
Hi Christian,

Thanks for your response.

I am using Xtext 2.0.1 and am using the new Serializer.

As per your suggestion, I switched back to using the old Serializer (using
parseTreeConstructor.ParseTreeConstructorFragment in my mwe file). I now get
a org.eclipse.xtext.parsetree.reconstr.XtextSerializationException with a
couple of things "is not set" as possible reasons for not continuing. As I
mentioned in my original post, I call validateConcreteSyntax before I
serialize and there are no errors reported back.

I have not tried the latest nightly build. Are there any 2.1 migration
considerations?

Mary


"Christian Dietrich" <forums-noreply@eclipse.org> wrote in message
news:j8aoj3$2ae$1@news.eclipse.org...
> Hi, there are a couple of Bugs around the Serializer.
> So do you use the Old or the New experimental one? (see workflow file) If
> you use the Old then try the New. If the New then try the Old and
> try if it works with the latest nightly build. If not please file a bug
> with the grammar and Test attached into bugzilla.
>
> ~Christian
Re: Problem serializing valid file content with expression [message #753624 is a reply to message #753618] Fri, 28 October 2011 06:10 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
The (new as well all the old) Serializer still have some bugs so you could help improving it by filing a bugzilla with your or a reproducable grammar, the model file and test class. i mentionen 2.1. because there are already some problems fixed. maybe yours is one of this. 2.1 will release next week.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Problem serializing valid file content with expression [message #754467 is a reply to message #753624] Wed, 02 November 2011 15:53 Go to previous message
Mary Komor is currently offline Mary KomorFriend
Messages: 61
Registered: July 2009
Member
Turns out that it was actually some problematic rules in our grammar -- the
semantic model created by the parser was not even complete because we were
missing some actions in our rules. The Serializer was having problems with
the "incomplete" model, and while preparing the backtracking diagnostics, it
ran for a long time and eventually ran out of memory. What was interesting
was that the ConcreteSyntaxValidator did not return any errors when I
validated the "incomplete" model. I haven't looked into why the validator
thought the model was good when it was not.

Thanks Christian, for looking at this.

Mary

"Christian Dietrich" <forums-noreply@eclipse.org> wrote in message
news:j8dg92$jlh$1@news.eclipse.org...
> The (new as well all the old) Serializer still have some bugs so you could
> help improving it by filing a bugzilla with your or a reproducable
> grammar, the model file and test class. i mentionen 2.1. because there are
> already some problems fixed. maybe yours is one of this. 2.1 will release
> next week.
>
> ~Christian
Previous Topic:Second GeneratorFragment
Next Topic:Name validation
Goto Forum:
  


Current Time: Thu Apr 25 01:17:06 GMT 2024

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

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

Back to the top