7.8.80: Neuer SysMLExpressionBasisTypeVisitor für NameExpressions - #205
Closed
MKZaito wants to merge 6 commits into
Hidden character warning
The head ref may contain hidden characters: "Neuer-SysMLExpressionBasisTypeVisitor-f\u00fcr-NameExpressions"
Closed
7.8.80: Neuer SysMLExpressionBasisTypeVisitor für NameExpressions #205MKZaito wants to merge 6 commits into
MKZaito wants to merge 6 commits into
Conversation
MKZaito
marked this pull request as draft
August 13, 2026 13:11
Emulate TypeCheck on Enum in Transformer
MKZaito
force-pushed
the
Neuer-SysMLExpressionBasisTypeVisitor-für-NameExpressions
branch
from
August 13, 2026 18:23
e41a19d to
e393e14
Compare
MKZaito
marked this pull request as ready for review
August 13, 2026 18:45
…or-für-NameExpressions
| return varResult; | ||
| } | ||
|
|
||
| if (enclosingScope instanceof ISysMLv2Scope) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if (enclosingScope instanceof ISysMLv2Scope) { | |
| // Dieser If-Block wurde zum vordefinierten calculateNameExpression hinzugefügt | |
| if (enclosingScope instanceof ISysMLv2Scope) { |
|
|
||
| import java.util.Optional; | ||
|
|
||
| public class SysMLExpressionBasisTypeVisitor extends ExpressionBasisTypeVisitor { |
Contributor
There was a problem hiding this comment.
Suggested change
| public class SysMLExpressionBasisTypeVisitor extends ExpressionBasisTypeVisitor { | |
| /** | |
| * SysML-spezifische Erweiterung des Typechecks für NameExpressions, einer | |
| * Produktion aus der ExpressionBasis.mc4-Grammatik | |
| */ | |
| public class SysMLExpressionBasisTypeVisitor extends ExpressionBasisTypeVisitor { |
| SysMLv2Tool tool = new SysMLv2Tool(); | ||
| tool.init(); | ||
|
|
||
| ASTSysMLModel ast = tool.parse( |
Contributor
There was a problem hiding this comment.
Suggested change
| ASTSysMLModel ast = tool.parse( | |
| var model = "enum def E { enum e; } constraint { E::e }"; | |
| var ast = SysMLv2Mill.parser().parse_String(model).get() |
| tool.completeSymbolTable(ast); | ||
| tool.finalizeSymbolTable(ast); | ||
|
|
||
| ASTNameExpression ctrlEnum = findCtrlEnumNameExpression(ast); |
Contributor
There was a problem hiding this comment.
Nicht komplizierter machen, als absolut nötig.
Suggested change
| ASTNameExpression ctrlEnum = findCtrlEnumNameExpression(ast); | |
| // extrahiere das "E" aus "enum def ...; constraint { E::e }" im Model | |
| var expr = ((ASTConstraintUsage) ast.getSysMLElement(1)).getExpression(); | |
| var E = ((ASTFieldAccessExpression)expr).getExpression(); |
| return varResult; | ||
| } | ||
|
|
||
| if (enclosingScope instanceof ISysMLv2Scope) { |
Contributor
There was a problem hiding this comment.
Wozu der Check und Cast auf ISysMLv2Scope, das vorhandene BasicSymbolsScope kann bereits nach Types resolven?
mathias-pfeiffer
marked this pull request as draft
August 14, 2026 17:26
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.
Changed
expr.getExpression(). Dabei kannexpreine ASTFieldAccessExpression sein. Wenn in diesem Fallexpr.getExpression()eineASTNameExpressionist, war der ExpressionBasisTypeVisitor nicht in der Lageexpr.getExpression()aufulösen.