diff --git a/gradle.properties b/gradle.properties index 595e1afe5..ad5ea9a07 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,4 +25,4 @@ assertj_version = 3.21.0 junit_version = 5.8.2 # Version of published artifacts -version = 7.8.97 +version = 7.8.98 diff --git a/language-server/src/main/java/de/monticore/lang/sysmlv2/_lsp/features/code_action/UpperCaseBlockName.java b/language-server/src/main/java/de/monticore/lang/sysmlv2/_lsp/features/code_action/UpperCaseBlockName.java index 72e0b8cdf..b5effa5f0 100644 --- a/language-server/src/main/java/de/monticore/lang/sysmlv2/_lsp/features/code_action/UpperCaseBlockName.java +++ b/language-server/src/main/java/de/monticore/lang/sysmlv2/_lsp/features/code_action/UpperCaseBlockName.java @@ -7,7 +7,7 @@ import de.monticore.lang.sysmlv2._lsp.LanguageServerCLI; import de.monticore.lang.sysmlbasis._symboltable.SysMLBasisScope; -import de.monticore.lang.sysmlbasis._symboltable.SysMLTypeSymbol; +import de.monticore.lang.sysmlbasis._symboltable.SysMLDefinitionSymbol; import de.monticore.lang.sysmlparts._ast.ASTPartDef; import de.monticore.lang.sysmlv2._symboltable.ISysMLv2Scope; import org.eclipse.lsp4j.*; @@ -68,10 +68,10 @@ public List createFixesFor(TextDocumentItem document, Diagnostic dia return res; } - private static void traverse(ISysMLv2Scope scope, Consumer f) { + private static void traverse(ISysMLv2Scope scope, Consumer f) { if (scope != null) { if (scope instanceof SysMLBasisScope) { - scope.getSysMLTypeSymbols().entries().forEach(entry -> f.accept(entry.getValue())); + scope.getSysMLDefinitionSymbols().entries().forEach(entry -> f.accept(entry.getValue())); } scope.getSubScopes().forEach(s -> traverse(s, f)); } diff --git a/language/src/main/grammars/de/monticore/lang/SysMLActions.mc4 b/language/src/main/grammars/de/monticore/lang/SysMLActions.mc4 index b0c9bbb1f..9e27c2fef 100644 --- a/language/src/main/grammars/de/monticore/lang/SysMLActions.mc4 +++ b/language/src/main/grammars/de/monticore/lang/SysMLActions.mc4 @@ -4,7 +4,7 @@ package de.monticore.lang; component grammar SysMLActions extends de.monticore.lang.SysMLBasis { - symbol scope ActionDef implements SysMLType = + symbol scope ActionDef implements SysMLDefinition = Modifier UserDefinedKeyword* "action" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -218,7 +218,7 @@ component grammar SysMLActions * Calculations * ================================================================================================================ */ - symbol scope CalcDef implements SysMLType = + symbol scope CalcDef implements SysMLDefinition = Modifier UserDefinedKeyword* "calc" "def" Name SysMLCardinality? Specialization* ("{" SysMLElement* diff --git a/language/src/main/grammars/de/monticore/lang/SysMLBasis.mc4 b/language/src/main/grammars/de/monticore/lang/SysMLBasis.mc4 index 01c102b4d..1f3315adc 100644 --- a/language/src/main/grammars/de/monticore/lang/SysMLBasis.mc4 +++ b/language/src/main/grammars/de/monticore/lang/SysMLBasis.mc4 @@ -22,7 +22,7 @@ component grammar SysMLBasis interface SysMLElement; /** Element mit eigenem Symbol für resolve (zB. für ReqDef) */ - interface symbol SysMLType extends SysMLElement; + interface symbol SysMLDefinition extends SysMLElement; SysMLCardinality = Cardinality (["ordered"] | ["nonunique"])* | (["ordered"] | ["nonunique"])+; diff --git a/language/src/main/grammars/de/monticore/lang/SysMLConstraints.mc4 b/language/src/main/grammars/de/monticore/lang/SysMLConstraints.mc4 index d2d42ecf2..10c200c32 100644 --- a/language/src/main/grammars/de/monticore/lang/SysMLConstraints.mc4 +++ b/language/src/main/grammars/de/monticore/lang/SysMLConstraints.mc4 @@ -5,7 +5,7 @@ component grammar SysMLConstraints extends SysMLBasis, SysMLActions { - symbol scope ConstraintDef implements SysMLType = + symbol scope ConstraintDef implements SysMLDefinition = Modifier UserDefinedKeyword* "constraint" "def" Name SysMLCardinality? Specialization* ("(" (SysMLParameter || ",")* ")")? ("{" @@ -36,7 +36,7 @@ component grammar SysMLConstraints Expression? "}" | ";") ; - symbol scope RequirementDef implements SysMLType = + symbol scope RequirementDef implements SysMLDefinition = Modifier UserDefinedKeyword* "requirement" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("(" (SysMLParameter || ",")* ")")? @@ -107,7 +107,7 @@ component grammar SysMLConstraints SysMLElement* "}" | ";") ; - symbol scope ConcernDef implements SysMLType = + symbol scope ConcernDef implements SysMLDefinition = Modifier UserDefinedKeyword* "concern" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("(" (SysMLParameter || ",")* ")")? diff --git a/language/src/main/grammars/de/monticore/lang/SysMLParts.mc4 b/language/src/main/grammars/de/monticore/lang/SysMLParts.mc4 index 91feb56d8..f03561284 100644 --- a/language/src/main/grammars/de/monticore/lang/SysMLParts.mc4 +++ b/language/src/main/grammars/de/monticore/lang/SysMLParts.mc4 @@ -19,7 +19,7 @@ component grammar SysMLParts * ################################################################## */ - symbol scope PartDef implements SysMLType = + symbol scope PartDef implements SysMLDefinition = Modifier UserDefinedKeyword* "part" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -32,14 +32,14 @@ component grammar SysMLParts directRefinements:de.monticore.types.check.SymTypeExpression* requirementType:SysMLReqType; - symbol scope AttributeDef implements SysMLType = + symbol scope AttributeDef implements SysMLDefinition = Modifier UserDefinedKeyword* "attribute" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" SysMLElement* "}" | ";") ; - symbol scope EnumDef implements SysMLType = + symbol scope EnumDef implements SysMLDefinition = Modifier UserDefinedKeyword* "enum" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -62,7 +62,7 @@ component grammar SysMLParts SysMLElement* "}" | ";") ; - symbol scope PortDef implements SysMLType = + symbol scope PortDef implements SysMLDefinition = Modifier UserDefinedKeyword* "port" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -218,7 +218,7 @@ component grammar SysMLParts SysMLElement* "}" | ";") ; - symbol scope ConnectionDef implements SysMLType = + symbol scope ConnectionDef implements SysMLDefinition = Modifier UserDefinedKeyword* "connection" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -240,7 +240,7 @@ component grammar SysMLParts * interface usage are restricted to be port usages. * ================================================================================================================ */ - symbol scope InterfaceDef implements SysMLType = + symbol scope InterfaceDef implements SysMLDefinition = Modifier UserDefinedKeyword* "interface" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("(" (SysMLParameter || ",")* ")")? @@ -259,7 +259,7 @@ component grammar SysMLParts SysMLElement* "}" | ";") ; - symbol scope FlowDef implements SysMLType = + symbol scope FlowDef implements SysMLDefinition = Modifier UserDefinedKeyword* "flow" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -271,7 +271,7 @@ component grammar SysMLParts * Allocations * ================================================================================================================ */ - symbol scope AllocationDef implements SysMLType = + symbol scope AllocationDef implements SysMLDefinition = Modifier UserDefinedKeyword* "allocation" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -307,7 +307,7 @@ component grammar SysMLParts * OCCURRENCES * ################################################################## */ - symbol scope OccurrenceDef implements SysMLType = + symbol scope OccurrenceDef implements SysMLDefinition = Modifier UserDefinedKeyword* "occurrence" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -329,7 +329,7 @@ component grammar SysMLParts "}" | ";") ; // IndividualUsages are parsed as AnonymousReferences with Modifier UserDefinedKeyword* "individual" - symbol scope IndividualDef implements SysMLType = + symbol scope IndividualDef implements SysMLDefinition = Modifier UserDefinedKeyword* "individual" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -342,7 +342,7 @@ component grammar SysMLParts * more item definitions. * ================================================================================================================ */ - symbol scope ItemDef implements SysMLType = + symbol scope ItemDef implements SysMLDefinition = Modifier UserDefinedKeyword* "item" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("(" (SysMLParameter || ",")* ")")? @@ -379,7 +379,7 @@ component grammar SysMLParts * regard (i.e., having an Expression), they are not explicitly related. */ - symbol scope AnalysisDef implements SysMLType = + symbol scope AnalysisDef implements SysMLDefinition = Modifier UserDefinedKeyword* "analysis" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -401,7 +401,7 @@ component grammar SysMLParts Expression? "}" | ";") ; - symbol scope VerificationDef implements SysMLType = + symbol scope VerificationDef implements SysMLDefinition = Modifier UserDefinedKeyword* "verification" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -417,7 +417,7 @@ component grammar SysMLParts Expression? "}" | ";") ; - symbol scope UseCaseDef implements SysMLType = + symbol scope UseCaseDef implements SysMLDefinition = Modifier UserDefinedKeyword* "use" "case" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -454,7 +454,7 @@ component grammar SysMLParts Expression? "}" | ";") ; - symbol scope CaseDef implements SysMLType = + symbol scope CaseDef implements SysMLDefinition = Modifier UserDefinedKeyword* "case" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -515,7 +515,7 @@ component grammar SysMLParts * Metadata is additional data that can be used to annotate * the elements of a model. */ - symbol scope SysMLMetaDataDefinition implements SysMLType, SysMLElement = + symbol scope SysMLMetaDataDefinition implements SysMLDefinition, SysMLElement = Modifier UserDefinedKeyword* "metadata" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -539,7 +539,7 @@ component grammar SysMLParts * Viewpoints * ======================================================================== */ - symbol scope ViewpointDef implements SysMLType = + symbol scope ViewpointDef implements SysMLDefinition = Modifier UserDefinedKeyword* "viewpoint" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -557,7 +557,7 @@ component grammar SysMLParts * Views * ======================================================================== */ - symbol scope ViewDef implements SysMLType = + symbol scope ViewDef implements SysMLDefinition = Modifier UserDefinedKeyword* "view" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" @@ -589,7 +589,7 @@ component grammar SysMLParts * Renderings * ======================================================================== */ - symbol scope RenderingDef implements SysMLType = + symbol scope RenderingDef implements SysMLDefinition = Modifier UserDefinedKeyword* "rendering" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("{" diff --git a/language/src/main/grammars/de/monticore/lang/SysMLStates.mc4 b/language/src/main/grammars/de/monticore/lang/SysMLStates.mc4 index 0289f5154..e0e337e44 100644 --- a/language/src/main/grammars/de/monticore/lang/SysMLStates.mc4 +++ b/language/src/main/grammars/de/monticore/lang/SysMLStates.mc4 @@ -3,7 +3,7 @@ package de.monticore.lang; component grammar SysMLStates extends SysMLActions { - symbol scope StateDef implements SysMLType = + symbol scope StateDef implements SysMLDefinition = Modifier UserDefinedKeyword* "state" "def" SysMLIdentifier? Name SysMLCardinality? Specialization* ("(" (SysMLParameter || ",")* ")")? ("{" diff --git a/language/src/main/grammars/de/monticore/lang/SysMLv2.mc4 b/language/src/main/grammars/de/monticore/lang/SysMLv2.mc4 index a1772059c..36316a24a 100644 --- a/language/src/main/grammars/de/monticore/lang/SysMLv2.mc4 +++ b/language/src/main/grammars/de/monticore/lang/SysMLv2.mc4 @@ -152,7 +152,7 @@ grammar SysMLv2 extends SysMLExpressions, * A user-defined keyword for semantic metadata may also be used to declare a * definition or usage without using any language-defined keyword. */ - symbol scope UserDefinedDefinition implements SysMLType = + symbol scope UserDefinedDefinition implements SysMLDefinition = Modifier UserDefinedKeyword+ "def" Name SysMLCardinality? Specialization* ("{" SysMLElement* diff --git a/language/src/main/java/de/monticore/lang/sysmlv2/cocos/RefinementCyclic.java b/language/src/main/java/de/monticore/lang/sysmlv2/cocos/RefinementCyclic.java index 4e90088f8..cd7cfe5d9 100644 --- a/language/src/main/java/de/monticore/lang/sysmlv2/cocos/RefinementCyclic.java +++ b/language/src/main/java/de/monticore/lang/sysmlv2/cocos/RefinementCyclic.java @@ -2,7 +2,7 @@ import de.monticore.ast.ASTNode; import de.monticore.lang.sysmlbasis._ast.ASTSysMLRefinement; -import de.monticore.lang.sysmlbasis._symboltable.SysMLTypeSymbol; +import de.monticore.lang.sysmlbasis._symboltable.SysMLDefinitionSymbol; import de.monticore.lang.sysmlparts._ast.ASTPartDef; import de.monticore.lang.sysmlparts._cocos.SysMLPartsASTPartDefCoCo; import de.monticore.lang.sysmlv2.SysMLv2Mill; @@ -24,7 +24,7 @@ public void check(ASTPartDef node) { var refinements = node.getSymbol().getTransitiveRefinements(); var cyclicRefinements = refiners.stream().filter(refinements::contains) - .map(SysMLTypeSymbol::getName) + .map(SysMLDefinitionSymbol::getName) .collect(Collectors.toList()); var pos = node.get_SourcePositionStart(); diff --git a/language/src/test/java/symboltable/SerializationTest.java b/language/src/test/java/symboltable/SerializationTest.java index 1573105ac..2a810651b 100644 --- a/language/src/test/java/symboltable/SerializationTest.java +++ b/language/src/test/java/symboltable/SerializationTest.java @@ -2,7 +2,7 @@ package symboltable; import de.monticore.io.paths.MCPath; -import de.monticore.lang.sysmlbasis._symboltable.SysMLTypeSymbol; +import de.monticore.lang.sysmlbasis._symboltable.SysMLDefinitionSymbol; import de.monticore.lang.sysmlparts._symboltable.PartDefSymbol; import de.monticore.lang.sysmlparts._symboltable.PortDefSymbol; import de.monticore.lang.sysmlparts._symboltable.PortUsageSymbol; @@ -158,7 +158,7 @@ public void loadSymbolTableAndResolve( // check inter-model resolution of fqn from the package scope of the reference artifact. Assertions.assertThat(artifactScope.getSubScopes()).isNotEmpty(); ISysMLv2Scope packageScope = artifactScope.getSubScopes().get(0); - Optional resolved = packageScope.resolveSysMLType(fqnSymbol); + Optional resolved = packageScope.resolveSysMLDefinition(fqnSymbol); assertThat(resolved).isPresent(); if(resolved.get() instanceof PortDefSymbol) { @@ -168,7 +168,7 @@ public void loadSymbolTableAndResolve( } // resolution of relative symbols does not work if symbol is in another artifact scope (i.e. top-down resolution is required). - Optional relativeResolved = packageScope.resolveSysMLType(relativeSymbol); + Optional relativeResolved = packageScope.resolveSysMLDefinition(relativeSymbol); assertThat(relativeResolved).isEmpty(); }