| Summary: | [Xtext] Unexpected ValueConverterException raised | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Johan Wannheden <johan.wannheden> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | sebastian.zarnekow, stephane |
| Version: | 0.7.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
Did you bind a subclass of AbstractLexerBasedConverter to a data type rule (which is not lexer-based)? Yes I did, and that seems to have been the problem. Thanks. see comment #2 |
Build Identifier: 20100218-1602 I have a case when an ValueConverterException is wrongly raised. Consider the following two grammars A and B, whereas B derives from A. Grammar B: SomeRule : 'some' 'rule' name=MyDataTypeRuleInA ; Grammar A: MyDataTypeRuleInA : 'a' | 'b' | OtherDataTypeRule | MY_TERMINAL_RULE ; MY_TERMINAL_RULE : ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9'|'#'|'$')* ; A simple model instance for B contains an assignment in SomeRule. When formatting is applied an exception is raised: "Format" did not complete normally... ... the value XYZ is an invalid MyDataTypeRuleInA I traced down the problem to this point: org.eclipse.xtext.conversion.impl.AbstractLexerBasedConverter#assertTokens line 67: if (!getRuleName().toUpperCase().equals(getRuleName(token))) { throw createTokenTypeMismatchException(value, escapedString, token); } In my case getRuleName() is "MyDataTypeRuleInA" and getRuleName(token) is "MY_TERMINAL_RULE". The condition looks incorrect to me. Is it a bug? Reproducible: Always