Repository navigation
Merged
Conversation
Establish the semantic baseline for feature-reference, constructor and invocation results before separating consultation from materialization.
explicit model preparation
Moved result-adding code from conditional in ExpressionParserPostProcessor to new post-processor classes.
seidewitz
approved these changes
Oct 19, 2026
seidewitz
left a comment
Member
There was a problem hiding this comment.
To save time, I made the following change myself:
- Removed the code in
ExpressionParserPostProcessorthat conditionally added a result parameter. - Added
FeatureReferenceParserPostProcessorandInstantiationExpressionParserPostprocessor, which unconditionally added a rsult parameter.
All tests still pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following the same approach as PR #815 for default multiplicities, this PR separates expression result preparation from semantic consultation.
Background
The KerML grammar for expressions requires
FeatureReferenceExpressions,ConstructorExpressionsandInvocationExpressionsto parse with ownedresultparameters, satisfying the constraintsvalidateFeatureReferenceExpressionResultandvalidInstantiationExpressionResult(InstantiationExpressionis the superclass ofConstructorExpressionandInvocationExpression). Previously, this was implemented inFeatureReferenceExpressionAdapter,ConstructorExpressionAdapter, andInvocationExpressionAdapter, respectively, by creating an owned result parameter through the methodaddAdditionalMembers(). This method can be invoked by derived queries, includingExpression::result, so reading the model can modify its containment structure.Objectives
Changes
FeatureReferenceExpressionParserPostProcessorandInstantiationExpressionParserPostProcessor.ExpressionEvaluatorand associatedExpressionUtilmethods to explicitly add result parameters when programmatically constructingFeatureReferenceExpressions,ConstructorExpressionsandInvocationExpressions, since these are no longer added during transformation.