| Summary: | [ConcreteSyntaxValidator] Actions - [...] holds y non-transient value(s), but exactly 0 are required | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Dietmar Stoll <btickets> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | moritz.eysholdt |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
This is actually a false-positive from the ConcreteSyntaxValidator. Here is another example.
Extract from IDL language:
union MyUnion_Type switch (char) {
case MY_CONSTANT:
MyType myTypeName;
case MY_OTHER_CONSTANT:
MyOtherType myOtherTypeName;
};
Parser rule for the "case"-Part which yields a similar error message as in the original bug report:
CaseLabel:
"case" constExp=ConstExp ":"
| {CaseLabel} "default" ":"
;
[...] .switchBody->SwitchBody.case[0]->Case.caseLabel[0]->CaseLabel: Feature CaseLabel.constExp must not be set.
Parser rule which works fine:
CaseLabel:
{CaseLabel} ("case" constExp=ConstExp | "default") ":"
;
won't fix due to https://github.com/eclipse/xtext-core/issues/48 |
Build Identifier: I20100608-0911 The following is a part of an interface definition language (IDL) file for which an Xtext grammar was written. It shows a method with a parameter declaration. void getFoo ( in Bar bar, in MyType type, out MyOtherType outparam, out MyType otherOutparam ); The rule "ParameterDcls" parses everything after the method name "getFoo", including the brackets. The contents of the brackets may be empty, i.e. the method may have no parameters. With the following rule, the file opens without errors in the Xtext runtime editor, but programatically reading and then serialising the file yields an error. ParameterDcls: "(" paramDcl+=ParamDcl ("," paramDcl+=ParamDcl)* ")" | {ParameterDcls} "(" ")" ; org.eclipse.xtext.validation.IConcreteSyntaxValidator$InvalidConcreteSyntaxException: These errors need to be fixed before the model can be serialized. IdlModel.definitions[7]->InterfaceDcl.body->InterfaceBody.exports[3]->OpDcl'getFoo'.parameters->ParameterDcls: Feature ParameterDcls.paramDcl holds 4 non-transient value(s), but exactly 0 are required. at org.eclipse.xtext.parsetree.reconstr.Serializer.serialize(Serializer.java:51) at org.eclipse.xtext.parsetree.reconstr.Serializer.serialize(Serializer.java:61) at org.eclipse.xtext.resource.XtextResource.doSave(XtextResource.java:287) at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1406) With the following variant of the rule, the file can be serialized fine. The two rules seem to be semantically equivalent. ParameterDcls: {ParameterDcls} "(" (paramDcl+=ParamDcl ("," paramDcl+=ParamDcl)*)? ")";. Reproducible: Always