Skip to content
Snippets Groups Projects
Verified Commit 7e186405 authored by Rico Bergmann's avatar Rico Bergmann
Browse files

Revert "Merge branch 'develop' of...

Revert "Merge branch 'develop' of https://git-st.inf.tu-dresden.de/cwerner/code_generator into develop"

This reverts commit 33e6b9b8, reversing
changes made to 98129c40.
parent 33e6b9b8
No related branches found
No related tags found
No related merge requests found
[submodule "lib/ModelSyncProvider"]
path = lib/ModelSyncProvider
url = https://git-st.inf.tu-dresden.de/cwerner/role_model_synchronization_provider.git
[submodule "src/main/asciidoc"] [submodule "src/main/asciidoc"]
path = src/main/doc path = src/main/doc
url = https://git-st.inf.tu-dresden.de/cwerner/code_generator.wiki.git url = https://git-st.inf.tu-dresden.de/cwerner/code_generator.wiki.git
[submodule "lib/ModelSUMProvider"]
path = lib/ModelSUMProvider
url = https://git-st.inf.tu-dresden.de/cwerner/single_underlying_role_model.git
...@@ -8,8 +8,9 @@ val scoptVersion = "3.7.0" ...@@ -8,8 +8,9 @@ val scoptVersion = "3.7.0"
val liftVersion = "3.3.0" val liftVersion = "3.3.0"
val gsonVersion = "2.8.5" val gsonVersion = "2.8.5"
val syncProvider = RootProject(file("lib/ModelSyncProvider")) val syncProvider = ProjectRef(uri("https://git-st.inf.tu-dresden.de/cwerner/role_model_synchronization_provider.git#develop"), "modelsyncprovider")
val rsumProvider = RootProject(file("lib/ModelSUMProvider")) val rsumProvider = ProjectRef(uri("https://git-st.inf.tu-dresden.de/cwerner/single_underlying_role_model.git#master"), "rsummodel")
val uiProvider = ProjectRef(uri("https://git-st.inf.tu-dresden.de/cwerner/role_ui_provider.git"), "uiprovider")
lazy val generator = (project in file(".")) lazy val generator = (project in file("."))
.settings( .settings(
...@@ -44,7 +45,8 @@ lazy val generator = (project in file(".")) ...@@ -44,7 +45,8 @@ lazy val generator = (project in file("."))
}, },
).dependsOn( ).dependsOn(
syncProvider, syncProvider,
rsumProvider rsumProvider,
uiProvider
).enablePlugins(Antlr4Plugin) ).enablePlugins(Antlr4Plugin)
antlr4PackageName in Antlr4 := Some("org.rosi_project.model_sync.model_join.representation.parser.antlr.generated") antlr4PackageName in Antlr4 := Some("org.rosi_project.model_sync.model_join.representation.parser.antlr.generated")
......
Subproject commit f10627a3d70d860e59c4924e3c0b0ecb93d8d0bc
Subproject commit 619bbf1efcfee406a134412275928322d9d28e05
...@@ -41,8 +41,7 @@ class ViewGeneratingVisitor extends SModelVisitor { ...@@ -41,8 +41,7 @@ class ViewGeneratingVisitor extends SModelVisitor {
} }
//add initialize method if necessary //add initialize method if necessary
if (!inner.isAbstract && !inner.isInterface) { if (!inner.isAbstract && !inner.isInterface) {
inner.addMethod(ViewMethods.getIsRelationalMethod(false)) inner.addMethod(ViewMethods.getInitializeMethod(inner))
inner.addMethod(ViewMethods.getCreationObjectMethod(inner))
} }
//add delete method //add delete method
inner.addMethod(ViewMethods.getDeleteElementNaturalMethod(inner)) inner.addMethod(ViewMethods.getDeleteElementNaturalMethod(inner))
...@@ -87,8 +86,7 @@ class ViewGeneratingVisitor extends SModelVisitor { ...@@ -87,8 +86,7 @@ class ViewGeneratingVisitor extends SModelVisitor {
val internalClass = new SInnerViewRelationalClass(r.getName + "Role", _externalClass = viewCompartment, val internalClass = new SInnerViewRelationalClass(r.getName + "Role", _externalClass = viewCompartment,
sumSource = r.asInstanceOf[SRelationalCompartmentClass], viewSource = sourceRole, viewTarget = targetRole) sumSource = r.asInstanceOf[SRelationalCompartmentClass], viewSource = sourceRole, viewTarget = targetRole)
internalClass.setAttributes(sourceAtt ++ targetAtt) internalClass.setAttributes(sourceAtt ++ targetAtt)
internalClass.addMethod(ViewMethods.getIsRelationalMethod(true)) internalClass.addMethod(ViewMethods.getInitializeMethod(internalClass))
internalClass.addMethod(ViewMethods.getCreationObjectMethod(internalClass))
internalClass.addMethod(ViewMethods.getDeleteElementRelationMethod(internalClass)) internalClass.addMethod(ViewMethods.getDeleteElementRelationMethod(internalClass))
ViewMethods.getSourceAndTargetGetter(internalClass).foreach(internalClass.addMethod(_)) ViewMethods.getSourceAndTargetGetter(internalClass).foreach(internalClass.addMethod(_))
internalClass.addParent(PredefRsumTypes.AVIEW_ROLE_STYPE) internalClass.addParent(PredefRsumTypes.AVIEW_ROLE_STYPE)
......
...@@ -60,33 +60,22 @@ object ViewMethods { ...@@ -60,33 +60,22 @@ object ViewMethods {
methods methods
} }
def getIsRelationalMethod(relational: Boolean): SMethod = { def getInitializeMethod(nat: SInnerViewNaturalClass): SMethod = {
val method = new SMethod( val method = new SMethod(
name = "isRelational", name = "initialize",
result = PredefTypes.Boolean, result = PredefTypes.Unit,
params = Seq.empty,
implementation = Seq(SMethodStatement(content = s"return ${relational}", usedTypes = Set.empty)),
true)
method.setVisibility(MethodVisibility.protectedVis)
method
}
def getCreationObjectMethod(nat: SInnerViewNaturalClass): SMethod = {
val method = new SMethod(
name = "getCreationObject",
result = PredefTypes.Object,
params = Seq.empty, params = Seq.empty,
implementation = Seq(SMethodStatement(content = s"return new ${nat.sumSource.getName}(" + implementation = Seq(SMethodStatement(content = s"initializeElement(new ${nat.sumSource.getName}(" +
s"${nat.sumSource.getAllConstructorParameters.map(m => m.getName).mkString(", ")})", usedTypes = Set.empty)), s"${nat.sumSource.getAllConstructorParameters.map(m => m.getName).mkString(", ")}), false)", usedTypes = Set.empty)),
true) true)
method.setVisibility(MethodVisibility.protectedVis) method.setVisibility(MethodVisibility.protectedVis)
method method
} }
def getCreationObjectMethod(ref: SInnerViewRelationalClass): SMethod = { def getInitializeMethod(ref: SInnerViewRelationalClass): SMethod = {
val method = new SMethod( val method = new SMethod(
name = "getCreationObject", name = "initialize",
result = PredefTypes.Object, result = PredefTypes.Unit,
params = Seq.empty, params = Seq.empty,
implementation = Seq(SMethodStatement(content = "return", usedTypes = Set.empty)), implementation = Seq(SMethodStatement(content = "return", usedTypes = Set.empty)),
true) true)
...@@ -101,7 +90,7 @@ object ViewMethods { ...@@ -101,7 +90,7 @@ object ViewMethods {
usedTypes = Set(ref.viewTarget.sumSource)), usedTypes = Set(ref.viewTarget.sumSource)),
SMethodStatement(content = s"val v: ${ref.sumSource.getName} = new ${ref.sumSource.getName}(sp, tp)", SMethodStatement(content = s"val v: ${ref.sumSource.getName} = new ${ref.sumSource.getName}(sp, tp)",
usedTypes = Set(ref.sumSource)), usedTypes = Set(ref.sumSource)),
SMethodStatement(content = s"return v", SMethodStatement(content = s"initializeElement(v, true)",
usedTypes = Set.empty)) usedTypes = Set.empty))
method.implementation = statements method.implementation = statements
method.setVisibility(MethodVisibility.protectedVis) method.setVisibility(MethodVisibility.protectedVis)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment