Open eclipse-ocl-bot opened 1 month ago
By Ed Willink on Jan 30, 2022 09:54
(In reply to Ed Willink from comment #0)
Similarly AS2CG could create the CGTexts directly as CGLetExps
Easier to let the LocalContext accumulate the need-a-XXX-variable from AS2CG and/or CG2JavaPre and to synthesize the CGLetExp wrappers when the local context is popped in the CG2JavaPreVisitor.
using a much more disciplined CGJavaCall comprising regulare CGValueElement source and arguments; only the operation name need be a magic Java string
The CGNativeOperationCallExp can be repurposed with its method argument compil-checking the operatuin spellings.
CGParameter can introduce a name such as "this" and if an orphan avoid a reified paameter.
The LocalContext exexecutorVariable nicely polymorphises as a passed CGParameter or initialized CGVariable.
Just need to use CGValuedElement.setValueName to enforcce the exact spelling bypassing spurious collision avoidance.\
Once CGText has gone the owns can be eliminated and dependencies simplified..
CGText gone and certainly simplified, but owns is still used for shared global types etc.
By Ed Willink on Feb 17, 2022 15:26
With CGText gone the CG moddel is much closer to a pure model. The pragmatic allocation of names such as 'this', 'self', 'executor' inituialized by CGText is fragile. idResolver can now use a CGNativeOperationcallExp as its init.
We need to hard reserve Java names, soft reserve gloabl names, hierachically reserve locals.
Introducing NameResolution as a name future, with selective eager declaration up to CG2JavaPre and the residual declaration followed by hierarchical name assignment ensures that all names are available clash-free for CG2Java.
Nov 09, 2022 08:17
New Gerrit change created: https://git.eclipse.org/r/c/ocl/org.eclipse.ocl/+/196695
Nov 09, 2022 08:17
New Gerrit change created: https://git.eclipse.org/r/c/ocl/org.eclipse.ocl/+/196696
Nov 09, 2022 08:17
New Gerrit change created: https://git.eclipse.org/r/c/ocl/org.eclipse.ocl/+/196698
Nov 09, 2022 08:17
New Gerrit change created: https://git.eclipse.org/r/c/ocl/org.eclipse.ocl/+/196699
| --- | --- | | Bugzilla Link | 578443 | | Status | NEW | | Importance | P3 normal | | Reported | Jan 29, 2022 09:25 EDT | | Modified | Nov 09, 2022 08:17 EDT | | Blocks | 534421 | | See also | Gerrit change 196695, Gerrit change 196696, Gerrit change 196698, Gerrit change 196699 | | Reporter | Ed Willink |
Description
CGText is a horrible bodge that was introduced to support too-hard-to-generate preformatted text infills. AS such it requires a variety of irregular treatments to support ownership, sharing, dependencies.
The foreign operation work for Bug 534421 struggles to correctly place the exeutor variable when the if initialization-needed is expressed in CG2Java. If instead AS2CG csynthesizes the true functionality CG2Java can be much simpler and subject to better optimization. Similarly AS2CG could create the CGTexts directlu as CgLetExps using a much more disciplined CGJavaCall comprising regulare CGValueElement source and arguments; only the operation name need be a magic Java string.
Once CGText has gone the owns can be eliminated and dependencies simplified..