Skip to content

7.8.80: Neuer SysMLExpressionBasisTypeVisitor für NameExpressions - #205

Closed
MKZaito wants to merge 6 commits into
release/7.8.xfrom
Neuer-SysMLExpressionBasisTypeVisitor-für-NameExpressions

Hidden character warning

The head ref may contain hidden characters: "Neuer-SysMLExpressionBasisTypeVisitor-f\u00fcr-NameExpressions"
Closed

7.8.80: Neuer SysMLExpressionBasisTypeVisitor für NameExpressions #205
MKZaito wants to merge 6 commits into
release/7.8.xfrom
Neuer-SysMLExpressionBasisTypeVisitor-für-NameExpressions

Conversation

@MKZaito

@MKZaito MKZaito commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Changed

  • Überschreibe calculateNameExpression da manche NameExpressions nicht aufgelöst werden konnten
TypeCheck3.typeOf(expr.getExpression())
  • Der Pre-TypeCheck des SysML-Transformers fragt unter anderem nach dem Typen von expr.getExpression(). Dabei kann expr eine ASTFieldAccessExpression sein. Wenn in diesem Fall expr.getExpression() eine ASTNameExpression ist, war der ExpressionBasisTypeVisitor nicht in der Lage expr.getExpression() aufulösen.

@MKZaito MKZaito self-assigned this Aug 13, 2026
@MKZaito MKZaito changed the title 7.8.79: Neuer SysMLExpressionBasisTypeVisitorr für NameExpressions 7.8.79: Neuer SysMLExpressionBasisTypeVisitor für NameExpressions Aug 13, 2026
@MKZaito
MKZaito marked this pull request as draft August 13, 2026 13:11
Emulate TypeCheck on Enum in Transformer
@MKZaito
MKZaito force-pushed the Neuer-SysMLExpressionBasisTypeVisitor-für-NameExpressions branch from e41a19d to e393e14 Compare August 13, 2026 18:23
@MKZaito
MKZaito marked this pull request as ready for review August 13, 2026 18:45
@MKZaito MKZaito changed the title 7.8.79: Neuer SysMLExpressionBasisTypeVisitor für NameExpressions 7.8.80: Neuer SysMLExpressionBasisTypeVisitor für NameExpressions Aug 14, 2026
return varResult;
}

if (enclosingScope instanceof ISysMLv2Scope) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

@mathias-pfeiffer mathias-pfeiffer Aug 14, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wozu der Check und Cast auf ISysMLv2Scope, das vorhandene BasicSymbolsScope kann bereits nach Types resolven?

@mathias-pfeiffer
mathias-pfeiffer marked this pull request as draft August 14, 2026 17:26
@MKZaito MKZaito closed this Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants