Open eclipse-qvtd-bot opened 1 day ago
By Ed Willink on Oct 21, 2016 10:08
(In reply to Adolfo Sanchez-Barbudo Herrera from comment #0)
1) Compilation:
- Download org.xtext.example.delphi and org.xtext.example.delphi.build.
Edit the hardwired path to the QVTd GIT projects.
I see some errors in the generated Delphi.qvtias transformation that need attention.
A major problem is an NPE in Iterables.size() if a type has no properties.
Lesser problems are failures to generate non-clashing names for working variables. Need to excluide all possible type names since the author may be pursuing the really bad practice of same feature/type spelling.
The above are all in AS2CS, so the generated Java should be unaffected; just harder to debug without the QVTi source visibility.
By Ed Willink on Oct 21, 2016 10:32
(In reply to Adolfo Sanchez-Barbudo Herrera from comment #0)
I'll do some investigation about what could be going wrong
At least one problem comes from
context tryStmt\ def : ast() : as::astm::TryStatement =\ as::astm::TryStatement {\ guardedStatement = stmtList.statments->first().ast(), \ finalStatement = final.statments->first().ast() \ }
where "stmtList" is interpreted as a type giving a Class in the generated code. There is already one warning on the line.
The 'PropertyCallExp::NonStaticSourceTypeIsConformant' constraint\ is violated for 'delphi::stmtList.statments'
which is perhaps not as explicit as it could be about static/non-static usage.
But the Complete OCL editor has useful validation. Ignoring it is very foolish.
By Ed Willink on Oct 21, 2016 10:49
(In reply to Ed Willink from comment #1)
A major problem is an NPE in Iterables.size() if a type has no properties.
Introduced by Bug 506228.
Lesser problems are failures to generate non-clashing names for working variables. Need to excluide all possible type names since the author may be pursuing the really bad practice of same feature/type spelling.
By Adolfo Sanchez-Barbudo Herrera on Oct 21, 2016 11:30
I've revised (and pushed) the two missing disambiguating self expressions. When assigning "incompatible" collections to shadow parts, I tend to simply ignore them, because I think the M2M engine (must) work well with them.
I'm trying to analyse/detect more issues on the source files (i.e the Complete OCL documents).
By Adolfo Sanchez-Barbudo Herrera on Oct 21, 2016 11:54
Another issue. Not sure if you experience the same, but I'm also having different issues when opening either qvtp.qvtcas nor qvtias with the reflective tree-form editor. For instance, a first error appears saying:
Validation also shows many problems.
By Ed Willink on Oct 21, 2016 12:00
(In reply to Adolfo Sanchez-Barbudo Herrera from comment #5)
- Resource '/org.xtext.example.delphi/model/delphi.qvtp.qvtcasas' does not exist
I'm looking at this right now. It seems to be a side effect of stale Problem View Markers. If you delete them, I think it goes away.
By Ed Willink on Oct 21, 2016 12:10
(In reply to Ed Willink from comment #6)
(In reply to Adolfo Sanchez-Barbudo Herrera from comment #5)
- Resource '/org.xtext.example.delphi/model/delphi.qvtp.qvtcasas' does not exist
I'm looking at this right now. It seems to be a side effect of stale Problem View Markers. If you delete them, I think it goes away.
I think it is the same problem as Bug 502289.
Stepping, I see that
String relatedURIsAttribute = marker.getAttribute(EValidator.RELATED_URIS_ATTRIBUTE, null);
is
175:platform:/resource/org.xtext.example.delphi/model/Delphi.qvtp.qvtcasas#//@ownedPackages.0/@ownedClasses.0/@rule.24/@bottomPattern/@assignment.0/@value/@ownedParts.1/@ownedInit
even though
String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
is
platform:/resource/org.xtext.example.delphi/model/Delphi.qvtp.qvtcas#//@ownedMappings.24/@ownedMiddle/@ownedBottomPattern/@ownedConstraints.0/@ownedInitExpression/@ownedCurlyBracketedClause/@ownedParts.1/@ownedInitExpression
--
"ownedMappings" is a stale feature name.
By Ed Willink on Oct 21, 2016 13:39
(In reply to Ed Willink from comment #7)
"ownedMappings" is a stale feature name.
No. An AS Feature used in a CS URI.
There are two underlying problems.
When using an AS editor, the CSResource is incorrectly named .qvtcasas rather than .qvtc. Fixing this inverts the markers problem. *.qvtc is now missing.
Validation is performed on the AS.
When using a CS editor the problem markers are re-URI-ed to replace the AS URIs by CS URIs in PivotDiagnosticConverter.getCauser(). The problem markers then refer consistently to the CS.
This re-URI-ing should not occur for an AS editor so that problem markers refer consistently to the AS.
By Ed Willink on Oct 22, 2016 06:09
Seems much better, but tidying up and making it work for OCLinEcore too and it all falls apart.....
Problem is doubly horrible code. The 'clever' Xtext overloads to enable an auto AS2CS and CS2AS to wrap a CS edit are horrible. Making the code dual purpose to support AS or CS editing pushes it beyond intelligibility.
One level of horrible can be removed by using distinct editor classes for CS and AS editing. Raised as Bug 506380.
By Ed Willink on Oct 22, 2016 10:11
(In reply to Ed Willink from comment #9)
Seems much better, but tidying up and making it work for OCLinEcore too and it all falls apart.....
Problem is that PivotResourceValidator.getCauser must return an AS element when the primary edit is of the AS, but must return a CS element when returning the location. Horrible locationInProgress status workaround added.
Hopefully "much better" again. Pushed to master for M3.
Main outstanding validation bug is Bug 412341.
By Adolfo Sanchez-Barbudo Herrera on Oct 22, 2016 10:19
Hi Ed,
How do you want to deal with the bugzilla about all the problems which arisen from the example ? I was thinking of creating more bugzillas having this one as the central (blocked) one. The repro is basically the same.
Do you prefer completely "unrelated" new bugzillas ?
Regards,\ Adolfo.
By Adolfo Sanchez-Barbudo Herrera on Oct 22, 2016 10:22
Sorry...
(In reply to comment #11)
How do you want to deal with the bugzilla about all the problems which arisen from the example ? I was thinking of creating more bugzillas having this one as the central (blocked) one. The repro is basically the same.
Do you prefer completely "unrelated" new bugzillas ?
Otherwise (third alternative), go on adding more comments in this one.
By Ed Willink on Oct 22, 2016 10:28
I think it works better if I fork off specific Bugzillas and you add observations.
I'm not aware of anything outstanding. Hopefully the recent [506328] commits make validation more useful. I-builds soon.
By Adolfo Sanchez-Barbudo Herrera on Oct 22, 2016 10:37
(In reply to comment #13)
I think it works better if I fork off specific Bugzillas and you add observations.
Ok. I think I'll take the same approach.
I'm not aware of anything outstanding. Hopefully the recent [506328] commits make validation more useful. I-builds soon.
Well, this bug is not solved as the transformation is not doing what I expected to do :P, but your fixes on the tooling wil definitelyl help me/us to more easily identify what's going on wrong. If something wrong in the transformation definition, or something in the QVTd code. I've already discovered a problem for which I'm working on a report.
| --- | --- | | Bugzilla Link | 506328 | | Status | NEW | | Importance | P3 normal | | Reported | Oct 21, 2016 07:22 EDT | | Modified | Oct 30, 2016 12:47 EDT | | Depends on | 506388, 506626, 506751 | | See also | 502289, 506380 | | Reporter | Adolfo Sanchez-Barbudo Herrera |
Description
Hi Ed,
I'm starting to execute some CS2AS transformation for the Gra2Mol Delphi example, but they are not doing what I expect. I'm raising this bugzilla to discuss and track any issue that arises during the compilation and execution of the this example.
There are two repros, one for producing the java CS2AS transformation, and another one to execute the examples. From my github repository (master branch) [1]
1) Compilation:
2) Execution:
I'll do some investigation about what could be going wrong, but for the time being, I think there is something you could look at: I see some errors in the generated Delphi.qvtias [4] transformation that need attention.
[1] https://github.com/adolfosbh/cs2as\ [2] org.xtext.example.delphi.build\src\org\xtext\example\companies\build\mwe\GenerateCS2ASTx.mwe2\ [3] org.xtext.example.delphi\src\org\xtext\example\delphi\test\DelphiTester.java\ [4] org.xtext.example.delphi\model\temp\Delphi.qvtias