Skip to main content



      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 13:36 Go to next message
Eclipse UserFriend
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 74 times)
  • Attachment: RAM.ecore
    (Size: 54.34KB, Downloaded 155 times)

[Updated on: Mon, 03 September 2018 13:37] by 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 13:37 Go to previous messageGo to next message
Eclipse UserFriend
Yes you need a value Converter that can handle These literals correctly
Re: Can't instantiate byte/long due to"Bad" conversion by ValueConverter [message #1794707 is a reply to message #1794610] Wed, 05 September 2018 05:41 Go to previous message
Eclipse UserFriend
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: Sun Jun 22 16:40:57 EDT 2025

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

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

Back to the top