Commit 7736d520 authored by Evgeny Kusmenko's avatar Evgeny Kusmenko

Merge branch 'ExecutionSemantics' into 'master'

Execution semantics

See merge request !6
parents b12cb483 a91866f0
Pipeline #393045 passed with stage
in 1 minute and 5 seconds
......@@ -7,25 +7,23 @@
<!-- == PROJECT COORDINATES ============================================= -->
<groupId>de.monticore.lang</groupId>
<artifactId>Tagging</artifactId>
<version>0.2.12-SNAPSHOT</version>
<version>0.4.4-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
<properties>
<!-- .. SE-Libraries .................................................. -->
<guava.version>25.1-jre</guava.version>
<monticore.version>5.0.0</monticore.version>
<se-commons.version>1.7.7</se-commons.version>
<mc.grammars.assembly.version>0.0.6-SNAPSHOT</mc.grammars.assembly.version>
<!-- .. Libraries .................................................. -->
<guava.version>18.0</guava.version>
<junit.version>4.12</junit.version>
<logback.version>1.1.2</logback.version>
<jscience.version>4.3.1</jscience.version>
<!-- .. Plugins ....................................................... -->
<monticore.plugin>5.0.0</monticore.plugin>
<assembly.plugin>2.5.4</assembly.plugin>
<compiler.plugin>3.3</compiler.plugin>
<source.plugin>2.4</source.plugin>
......@@ -45,41 +43,16 @@
<dependencies>
<dependency>
<groupId>org.jscience</groupId>
<artifactId>jscience</artifactId>
<version>4.3.1</version>
</dependency>
<!-- <dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency> -->
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.7.1</version>
</dependency>
<dependency>
<groupId>de.se_rwth.commons</groupId>
<artifactId>se-commons-logging</artifactId>
<version>${se-commons.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<!-- MontiCore Dependencies -->
<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-runtime</artifactId>
<version>${monticore.version}</version>
<groupId>org.jscience</groupId>
<artifactId>jscience</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
......@@ -109,26 +82,6 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-runtime</artifactId>
<version>${monticore.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>org.jscience</groupId>
<artifactId>jscience</artifactId>
<version>${jscience.version}</version>
</dependency>
</dependencies>
<!-- == PROJECT BUILD SETTINGS =========================================== -->
......@@ -144,24 +97,11 @@
<plugin>
<groupId>de.monticore.mojo</groupId>
<artifactId>monticore-maven-plugin</artifactId>
<version>${monticore.plugin}</version>
<version>${monticore.version}</version>
<configuration>
<skip>false</skip>
<script>de/monticore/monticore_noemf.groovy</script>
</configuration>
<dependencies>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4</artifactId>
<version>4.7.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.antlr/antlr4-runtime -->
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.7.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
......@@ -235,32 +175,32 @@
</executions>
</plugin>
<!-- to add copyright information automatically-->
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>3.0</version>
<configuration>
<header>${project.baseUri}/src/license/se/license.txt</header>
<properties>
<owner>Michael von Wenckstern</owner>
<email>vonwenckstern@se-rwth.de</email>
</properties>
<excludes>
<exclude>**/README</exclude>
<exclude>src/test/resources/**</exclude>
<exclude>src/main/resources/**</exclude>
<exclude>src/license/**</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>format</goal>
</goals>
<phase>process-sources</phase>
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <groupId>com.mycila</groupId>-->
<!-- <artifactId>license-maven-plugin</artifactId>-->
<!-- <version>3.0</version>-->
<!-- <configuration>-->
<!-- <header>${project.baseUri}/src/license/se/license.txt</header>-->
<!-- <properties>-->
<!-- <owner>Michael von Wenckstern</owner>-->
<!-- <email>vonwenckstern@se-rwth.de</email>-->
<!-- </properties>-->
<!-- <excludes>-->
<!-- <exclude>**/README</exclude>-->
<!-- <exclude>src/test/resources/**</exclude>-->
<!-- <exclude>src/main/resources/**</exclude>-->
<!-- <exclude>src/license/**</exclude>-->
<!-- </excludes>-->
<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <goals>-->
<!-- <goal>format</goal>-->
<!-- </goals>-->
<!-- <phase>process-sources</phase>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
......
......@@ -21,13 +21,7 @@ import de.monticore.ast.ASTNode;
import de.monticore.lang.tagging._ast.*;
import de.monticore.lang.tagging._parser.TaggingParser;
import de.monticore.lang.tagging.helper.RangeFixer;
import de.monticore.symboltable.CommonScope;
import de.monticore.symboltable.MutableScope;
import de.monticore.symboltable.Scope;
import de.monticore.symboltable.ScopeSpanningSymbol;
import de.monticore.symboltable.Symbol;
import de.monticore.symboltable.SymbolKind;
import de.monticore.symboltable.SymbolPredicate;
import de.monticore.symboltable.*;
import de.monticore.symboltable.modifiers.AccessModifier;
import de.monticore.symboltable.resolving.ResolvingFilter;
import de.se_rwth.commons.logging.Log;
......@@ -277,4 +271,20 @@ public class TaggingResolver implements Scope {
public MutableScope getAsMutableScope() {
return globalScope.getAsMutableScope();
}
public void addSubScope(MutableScope subScope) {
if (!(globalScope instanceof GlobalScope)) return;
if (!globalScope.getSubScopes().contains(subScope)) {
((GlobalScope) this.globalScope).addSubScope(subScope);
subScope.setEnclosingScope((GlobalScope) this.globalScope);
}
}
public void removeSubScope(MutableScope subScope) {
if (!(globalScope instanceof GlobalScope)) return;
if (globalScope.getSubScopes().contains(subScope)) {
((GlobalScope) this.globalScope).removeSubScope(subScope);
subScope.setEnclosingScope(null);
}
}
}
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.SimpleTagType*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.SimpleTagTypeCreator*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.TagSchema*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.SimpleTagType*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.SimpleTagTypeCreator*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.TagSchema*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagType*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagTypeCreator*/
......@@ -56,7 +55,7 @@ public class CompPowerInstSymbolCreator implements TagSymbolCreator {
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("CompPowerInst"))
.filter(t -> !t.getTagValueOpt().isPresent())
.filter(t -> t.isPresentTagValue())
.map(t -> checkContent(t.getTagValueOpt().get()))
.filter(r -> r != null)
.filter(this::checkUnit)
......@@ -100,7 +99,7 @@ public class CompPowerInstSymbolCreator implements TagSymbolCreator {
Log.enableFailQuick(false);
long errorCount = Log.getErrorCount();
ast = parser.parseUnitTagValue(s);
ast = parser.parse_StringUnitTagValue(s);
Log.enableFailQuick(enableFailQuick);
if (Log.getErrorCount() > errorCount) {
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagType*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagTypeCreator*/
......@@ -56,7 +55,7 @@ public class CompPowerSymbolCreator implements TagSymbolCreator {
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("CompPower"))
.filter(t -> !t.getTagValueOpt().isPresent())
.filter(t -> t.isPresentTagValue())
.map(t -> checkContent(t.getTagValueOpt().get()))
.filter(r -> r != null)
.filter(this::checkUnit)
......@@ -100,7 +99,7 @@ public class CompPowerSymbolCreator implements TagSymbolCreator {
Log.enableFailQuick(false);
long errorCount = Log.getErrorCount();
ast = parser.parseUnitTagValue(s);
ast = parser.parse_StringUnitTagValue(s);
Log.enableFailQuick(enableFailQuick);
if (Log.getErrorCount() > errorCount) {
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagType*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagTypeCreator*/
......@@ -56,7 +55,7 @@ public class LatencyCmpInstSymbolCreator implements TagSymbolCreator {
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("LatencyCmpInst"))
.filter(t -> !t.getTagValueOpt().isPresent())
.filter(t -> t.isPresentTagValue())
.map(t -> checkContent(t.getTagValueOpt().get()))
.filter(r -> r != null)
.filter(this::checkUnit)
......@@ -100,7 +99,7 @@ public class LatencyCmpInstSymbolCreator implements TagSymbolCreator {
Log.enableFailQuick(false);
long errorCount = Log.getErrorCount();
ast = parser.parseUnitTagValue(s);
ast = parser.parse_StringUnitTagValue(s);
Log.enableFailQuick(enableFailQuick);
if (Log.getErrorCount() > errorCount) {
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagType*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagTypeCreator*/
......@@ -56,7 +55,7 @@ public class LatencyCmpSymbolCreator implements TagSymbolCreator {
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("LatencyCmp"))
.filter(t -> !t.getTagValueOpt().isPresent())
.filter(t -> t.isPresentTagValue())
.map(t -> checkContent(t.getTagValueOpt().get()))
.filter(r -> r != null)
.filter(this::checkUnit)
......@@ -100,7 +99,7 @@ public class LatencyCmpSymbolCreator implements TagSymbolCreator {
Log.enableFailQuick(false);
long errorCount = Log.getErrorCount();
ast = parser.parseUnitTagValue(s);
ast = parser.parse_StringUnitTagValue(s);
Log.enableFailQuick(enableFailQuick);
if (Log.getErrorCount() > errorCount) {
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagType*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagTypeCreator*/
......@@ -56,7 +55,7 @@ public class LatencyConnSymbolCreator implements TagSymbolCreator {
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("LatencyConn"))
.filter(t -> !t.getTagValueOpt().isPresent())
.filter(t -> t.isPresentTagValue())
.map(t -> checkContent(t.getTagValueOpt().get()))
.filter(r -> r != null)
.filter(this::checkUnit)
......@@ -100,7 +99,7 @@ public class LatencyConnSymbolCreator implements TagSymbolCreator {
Log.enableFailQuick(false);
long errorCount = Log.getErrorCount();
ast = parser.parseUnitTagValue(s);
ast = parser.parse_StringUnitTagValue(s);
Log.enableFailQuick(enableFailQuick);
if (Log.getErrorCount() > errorCount) {
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagType*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagTypeCreator*/
......@@ -56,7 +55,7 @@ public class LatencyPortSymbolCreator implements TagSymbolCreator {
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("LatencyPort"))
.filter(t -> !t.getTagValueOpt().isPresent())
.filter(t -> t.isPresentTagValue())
.map(t -> checkContent(t.getTagValueOpt().get()))
.filter(r -> r != null)
.filter(this::checkUnit)
......@@ -100,7 +99,7 @@ public class LatencyPortSymbolCreator implements TagSymbolCreator {
Log.enableFailQuick(false);
long errorCount = Log.getErrorCount();
ast = parser.parseUnitTagValue(s);
ast = parser.parse_StringUnitTagValue(s);
Log.enableFailQuick(enableFailQuick);
if (Log.getErrorCount() > errorCount) {
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.TagSchema*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.TagSchema*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagType*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagTypeCreator*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.SimpleTagType*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.SimpleTagTypeCreator*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.TagSchema*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ComplexTagType*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ComplexTagTypeCreator*/
......@@ -63,7 +62,7 @@ public class SizeSymbolCreator implements TagSymbolCreator {
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("Size"))
.filter(t -> !t.getTagValueOpt().isPresent())
.filter(t -> t.isPresentTagValue())
.map(t -> matchRegexPattern(t.getTagValueOpt().get()))
.filter(r -> r != null)
.forEachOrdered(m ->
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagType*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagTypeCreator*/
......@@ -58,7 +57,7 @@ public class WeightSymbolCreator implements TagSymbolCreator {
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("Weight"))
.filter(t -> !t.getTagValueOpt().isPresent())
.filter(t -> t.isPresentTagValue())
.map(t -> checkContent(t.getTagValueOpt().get()))
.filter(r -> r != null)
.filter(this::checkUnit)
......@@ -102,7 +101,7 @@ public class WeightSymbolCreator implements TagSymbolCreator {
Log.enableFailQuick(false);
long errorCount = Log.getErrorCount();
ast = parser.parseUnitTagValue(s);
ast = parser.parse_StringUnitTagValue(s);
Log.enableFailQuick(enableFailQuick);
if (Log.getErrorCount() > errorCount) {
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagType*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagTypeCreator*/
......@@ -53,7 +52,7 @@ public class PowerBooleanSymbolCreator implements TagSymbolCreator {
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("PowerBoolean"))
.filter(t -> !t.getTagValueOpt().isPresent())
.filter(t -> t.isPresentTagValue())
.map(t -> checkContent(t.getTagValueOpt().get()))
.filter(r -> r != null)
.forEachOrdered(v ->
......@@ -76,7 +75,7 @@ public class PowerBooleanSymbolCreator implements TagSymbolCreator {
Log.enableFailQuick(false);
long errorCount = Log.getErrorCount();
ast = parser.parseBooleanTagValue(s);
ast = parser.parse_StringBooleanTagValue(s);
Log.enableFailQuick(enableFailQuick);
if (Log.getErrorCount() > errorCount) {
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagType*/
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.ValuedTagTypeCreator*/
......@@ -56,7 +55,7 @@ public class PowerConsumptionSymbolCreator implements TagSymbolCreator {
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("PowerConsumption"))
.filter(t -> !t.getTagValueOpt().isPresent())
.filter(t -> t.isPresentTagValue())
.map(t -> checkContent(t.getTagValueOpt().get()))
.filter(r -> r != null)
.filter(this::checkUnit)
......@@ -100,7 +99,7 @@ public class PowerConsumptionSymbolCreator implements TagSymbolCreator {
Log.enableFailQuick(false);
long errorCount = Log.getErrorCount();
ast = parser.parseUnitTagValue(s);
ast = parser.parse_StringUnitTagValue(s);
Log.enableFailQuick(enableFailQuick);
if (Log.getErrorCount() > errorCount) {
......
/* (c) https://github.com/MontiCore/monticore */
/* generated by template templates.de.monticore.lang.tagschema.TagSchema*/