Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [SOLVED] UnsupportedOperationException on enum
[SOLVED] UnsupportedOperationException on enum [message #1396571] Tue, 08 July 2014 13:51 Go to next message
Jonas Heinisch is currently offline Jonas HeinischFriend
Messages: 12
Registered: June 2014
Location: Germany
Junior Member
Hi!

I've written a grammar and it works fine except with one thing. There is an enum that represents basic units and every time i try to use it, the editor shows up with an UnsupportedOperationException as error.

Relevant part of grammar:

IntLiteral:
	value=DECINT (SQUARE_PAREN_L unit=BaseUnit SQUARE_PAREN_R)?
;

BaseUnit:
	uName=UnitNames
;

enum UnitNames:
	UNITLESS="_" | UNITLESS="unitless" | BYTE="B" | SECOND="s" | METER="m"
;


The grammar is based on an existing model.

Everything I write within the square-brackets (SQUARE_PAREN_X) is marked as an Error and shows UnsupportedOperationException.

Any idea why this is showing up? I have no clue here...

thanks in advance
Jonas



[Updated on: Fri, 25 July 2014 08:46]

Report message to a moderator

Re: UnsupportedOperationException on enum [message #1396693 is a reply to message #1396571] Tue, 08 July 2014 16:55 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
have you a complete error trace? can you share the definition of
DECINT SQUARE_PAREN_L SQUARE_PAREN_R


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: UnsupportedOperationException on enum [message #1403522 is a reply to message #1396693] Thu, 24 July 2014 09:40 Go to previous messageGo to next message
Jonas Heinisch is currently offline Jonas HeinischFriend
Messages: 12
Registered: June 2014
Location: Germany
Junior Member
Hi!

Sorry... I didn't notice the answer because I forgot to tick the Notification box... But problem is still there...

Here are the terminals you requested:
terminal DECINT returns ecore::EInt: 
	'0' | ('1'..'9') DIGIT*
;
terminal SQUARE_PAREN_L : '[' ;
terminal SQUARE_PAREN_R : ']' ;


And unfortunatly I can't give you a StackTrace because the exception just appears in the editor...
by the way: It might not be an error concerning enums because already the expression "4[]" is stating an "UnsupportedOperationException". Using the rule without a unit works fine.

Greetings
Jonas
Re: UnsupportedOperationException on enum [message #1403546 is a reply to message #1403522] Thu, 24 July 2014 10:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
can you give a complete reproducable grammar and example model.
+ a complete stacktrace


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: UnsupportedOperationException on enum [message #1403674 is a reply to message #1403546] Fri, 25 July 2014 08:45 Go to previous message
Jonas Heinisch is currently offline Jonas HeinischFriend
Messages: 12
Registered: June 2014
Location: Germany
Junior Member
Hi!

I solved the problem this night... It was just that EMF has not generated a default setter...

Thanks anyway!
Previous Topic:Staged translation?
Next Topic:Xbase: proposals of non-final variables in lambdas
Goto Forum:
  


Current Time: Wed Apr 24 23:58:15 GMT 2024

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

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

Back to the top