[SOLVED] Serializer Enum [message #1411842] |
Sun, 24 August 2014 11:57  |
Eclipse User |
|
|
|
Hi!
I've got a problem regarding the usage of enums.
Here's a part of my used grammar:
// boolAndExpr -> boolOrExpr (andoperation boolOrExpr)*
boolAndExpr returns BooleanExpression:
boolOrExpr ({BooleanOperatorExpression.left=current} operation=andoperation right=boolOrExpr)*
;
// andoperation -> AND
enum andoperation returns BooleanOperations:
AND
;
// boolOrExpr -> compareExpr (oroperations compareExpr)*
boolOrExpr returns BooleanExpression:
compareExpr ({BooleanOperatorExpression.left=current} operation=oroperations right=compareExpr)*
;
// oroperations -> OR|XOR
enum oroperations returns BooleanOperations:
OR | XOR
;
Parsing works pretty good, but when it comes to serializing something containing an AND this Exception comes up:
The value 'AND' is invalid for enum oroperations
Valid values are: OR, XOR
Semantic Object: BooleanOperatorExpression
I think it could be easily changed by changing the model and split up AND- and OR-Operations into two classes. But as it is a running system to which I only add the Xtext-things, I do not want to change the model that much... So any idea how to solve this?
Thanks in advance for any hints!
Jonas
[Updated on: Sun, 24 August 2014 14:18] by Moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04349 seconds