Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Can't instantiate byte/long due to"Bad" conversion by ValueConverter
Can't instantiate byte/long due to"Bad" conversion by ValueConverter [message #1794609] Mon, 03 September 2018 17:36 Go to next message
Rohit Verma is currently offline Rohit VermaFriend
Messages: 21
Registered: August 2017
Junior Member
Hi,
Please refer to the attached grammar where I am facing an issue with defining byte and long datatypes. When I try to specify an input like '1L' or '1b', Xtext fails validation and I get an error that says "[ERROR:For input string: "1b" (synthetic:/example.expression line : 1 column : 1)]". I suspect this has to do with a "Bad" conversion being done by one of the ValueConverters supplied by Xtext and this bug report cites the same

Am I correct regarding my error diagnosis? Should I be trying to wrap my head around implementing a custom value converter like here?

Thanks,
Rohit
  • Attachment: grammar.xtext
    (Size: 2.43KB, Downloaded 7 times)
  • Attachment: RAM.ecore
    (Size: 54.34KB, Downloaded 4 times)

[Updated on: Mon, 03 September 2018 17:37]

Report message to a moderator

Re: Can't instantiate byte/long due to"Bad" conversion by ValueConverter [message #1794610 is a reply to message #1794609] Mon, 03 September 2018 17:37 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12237
Registered: July 2009
Senior Member
Yes you need a value Converter that can handle These literals correctly

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Can't instantiate byte/long due to"Bad" conversion by ValueConverter [message #1794707 is a reply to message #1794610] Wed, 05 September 2018 09:41 Go to previous message
Rohit Verma is currently offline Rohit VermaFriend
Messages: 21
Registered: August 2017
Junior Member
Thanks Christian. That was very helpful!
Previous Topic:XText Web - assist cancels validation
Next Topic:Stopping Xtext from replacing generated files/methods
Goto Forum:
  


Current Time: Mon Sep 24 05:14:04 GMT 2018

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

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

Back to the top