| Summary: | MWE2 does not allow to specify int properties | ||
|---|---|---|---|
| Product: | [Modeling] EMFT | Reporter: | Philipp Salvisberg <philipp.salvisberg> |
| Component: | MWE | Assignee: | Project Inbox <emft-mwe-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | abm221617, christian.dietrich.opensource, sebastian.zarnekow, sven.efftinge |
| Version: | 1.0.1 | Flags: | sebastian.zarnekow:
juno+
|
| Target Milestone: | --- | ||
| Hardware: | Macintosh | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
As a workaround you should subclass the org.eclipse.xtext.generator.parser.antlr.AntlrOptions and add a method setKAsString(String s) and do the conversion in Java.
You can instantiate the subtype like this:
options = MyWorkaroundAntlrOptions {kAsString="1"}
(In reply to comment #1) > As a workaround you should subclass the > org.eclipse.xtext.generator.parser.antlr.AntlrOptions and add a method > setKAsString(String s) and do the conversion in Java. Thanks, works! - I've created a subclass named AntLrOptionsWithKAsString and used the following variant in MWE successfully: ... var kAsString = "7" ... fragment = parser.antlr.ex.rt.AntlrGeneratorFragment { options = AntLrOptionsWithKAsString auto-inject { } } ... I've changed importance to P4 since a workaround is available now. Any chance that this might be fixed in the next service release? It'd be great to use this DSL the way you intended. Having to use the workaround is a step back from XML. I'm sold on the idea of using DSLs to write DSLs; that's why it's disappointing to see this bug as a minor with no plan to fix it. we support int now (some 2.11.x version) |
Build Identifier: I20100608-0911 cannot define a var of type int nor pass an int value as parameter. E.g the following does not work: a) causing error in editor "no viable alternative at input '1'" var k=1 ... fragment = parser.antlr.ex.rt.AntlrGeneratorFragment { options = auto-inject { } } b) causing runtime error "argument type mismatch" var k="1" ... fragment = parser.antlr.ex.rt.AntlrGeneratorFragment { options = auto-inject { } } c) causing error in editor "no viable alternative at input '1'" fragment = parser.antlr.ex.rt.AntlrGeneratorFragment { options = {k=1} } d) causing error in editor "no viable alternative at input '1'" fragment = parser.antlr.ex.rt.AntlrGeneratorFragment { options = {k=1;} } Reproducible: Always