Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Captured feature values for Case Insensitive Keywords are not Case Insensitive during serialization
Captured feature values for Case Insensitive Keywords are not Case Insensitive during serialization [message #995749] Sun, 30 December 2012 21:34 Go to previous message
Barrie Treloar is currently offline Barrie Treloar
Messages: 52
Registered: July 2009
Member
I'm oversimplifying the example, but here is an excerpt from my grammar

Edit:
    "EDIT" type="Time" |
    "EDIT" type="ListOf"
;


And here is an excerpt from my xtend junit test.

val input = '''EDIT LISTOF'''

val expectedFormed = '''EDIT ListOf"

assertEquals(expectedFormat, input.parse.serialize(SaveOptions::newBuilder.format().getOptions()))


Where I am expecting that I should be able to use a different case for "ListOf" than what is specified in the grammar.

Instead of getting an assertion failure I get an error:

java.lang.RuntimeException: Could not serialize EObject via backtracking.
Constraint: null (type='Time' | type='ListOf') null
Values: type(1)
Semantic Object: ...->Edit


If I keep everything the same as the grammar, then I dont get this exception.

If I keep everything the same as the grammar and change EDIT to any other case, I dont get this exception.

If I keep everything the same as the grammar and change ListOf to any other case then I get this exception.

I've tried attaching a IValueConverter for the Edit rule (hoping I could normalize the input to the grammar values) but it is not being invoked for serialization.

Note the failure only occurs on serialization.
Parsing and formatting work fine with any case for the ListOf. (i.e I can run this in a the IDE and it recognizes the tokens correctly and will format the text editor).

What is special about capturing the string in a feature that causes it to fail during serialization?
 
Read Message
Read Message
Previous Topic:PDF Doc does not open or download.
Next Topic:Using xText with existing model and Resource
Goto Forum:
  


Current Time: Fri May 24 09:15:40 EDT 2013

Powered by FUDForum. Page generated in 0.01637 seconds