Commit 672d1298 authored by Malte Heithoff's avatar Malte Heithoff

Update to MC 6.5

parent 90b79f11
Pipeline #347585 passed with stage
in 47 seconds
......@@ -7,14 +7,14 @@
<!-- == PROJECT COORDINATES ============================================= -->
<groupId>de.monticore.lang</groupId>
<artifactId>Tagging</artifactId>
<version>0.2.12-SNAPSHOT</version>
<version>6.5.0-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
<properties>
<!-- .. SE-Libraries .................................................. -->
<monticore.version>5.0.0</monticore.version>
<monticore.version>6.5.0-SNAPSHOT</monticore.version>
<se-commons.version>1.7.7</se-commons.version>
<mc.grammars.assembly.version>0.0.6-SNAPSHOT</mc.grammars.assembly.version>
......@@ -25,7 +25,7 @@
<jscience.version>4.3.1</jscience.version>
<!-- .. Plugins ....................................................... -->
<monticore.plugin>5.0.0</monticore.plugin>
<monticore.plugin>6.5.0-SNAPSHOT</monticore.plugin>
<assembly.plugin>2.5.4</assembly.plugin>
<compiler.plugin>3.3</compiler.plugin>
<source.plugin>2.4</source.plugin>
......@@ -45,6 +45,8 @@
<dependencies>
<!-- MontiCore Dependencies -->
<dependency>
<groupId>org.jscience</groupId>
<artifactId>jscience</artifactId>
......@@ -78,7 +80,7 @@
<!-- MontiCore Dependencies -->
<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-runtime</artifactId>
<artifactId>monticore-grammar</artifactId>
<version>${monticore.version}</version>
</dependency>
......@@ -86,14 +88,14 @@
<groupId>de.monticore</groupId>
<artifactId>monticore-grammar</artifactId>
<version>${monticore.version}</version>
<classifier>${grammars.classifier}</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-grammar</artifactId>
<artifactId>monticore-runtime</artifactId>
<version>${monticore.version}</version>
<classifier>${grammars.classifier}</classifier>
<scope>provided</scope>
</dependency>
<dependency>
......@@ -110,13 +112,13 @@
<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>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>
......@@ -144,7 +146,7 @@
<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>
......@@ -235,32 +237,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>
......
......@@ -5,17 +5,19 @@ package de.monticore.lang;
* Basic grammar to tag non-functional properties
*
*/
grammar TagSchema extends de.monticore.common.Common {
grammar TagSchema extends de.monticore.MCBasics,
de.monticore.types.MCBasicTypes,
de.monticore.literals.MCCommonLiterals {
TagSchemaUnit =
("package" package:(Name& || ".")+ ";")?
(ImportStatement)*
(MCImportStatement)*
"tagschema" Name "{" TagType+ "}";
interface TagType;
//ComplexTagType | EnumeratedTagType | ValuedTagType | SimpleTagType;
ast TagType =
astrule TagType =
method public String getName() {
return "undefined";
};
......@@ -29,7 +31,7 @@ grammar TagSchema extends de.monticore.common.Common {
connectorInstance:"ConnectorInstance" |
identifier:Name;
ast ScopeIdentifier =
astrule ScopeIdentifier =
method public String getScopeName() {
if(isPresentComponent()) return getComponent();
if(isPresentComponentInstance()) return getComponentInstance();
......@@ -43,9 +45,9 @@ grammar TagSchema extends de.monticore.common.Common {
//ScopeIdentifier = Name;
Scope = "for" (ScopeIdentifier || ",")+;
symbol SimpleTagType implements TagType = ("private")? "tagtype" Name Scope? ";" ;
// modification form ML's tagging language (replaced String by Name --> is more to Java feeling)
......@@ -57,11 +59,11 @@ grammar TagSchema extends de.monticore.common.Common {
// not supported in Symbol Table yet
// ComplexTagType implements TagType = ("private")? "tagtype" Scope? "{" (Reference || ",")+ ";" "}" ;
// ast ComplexTagType =
// astrule ComplexTagType =
// method public String getName() {
// return "undefined";
// };
// Reference = Name ":" datatype:Name ("?"|"+"|"*")? ;
......
......@@ -6,50 +6,70 @@ package de.monticore.lang;
* grammar to create only parsers for tag values
*
*/
grammar TagValue extends de.monticore.common.Common {
interface TagValue;
ast TagValue =
method public String getValueKind() {
return "undefined";
};
StringTagValue implements TagValue = String;
ast StringTagValue =
method public String getValueKind() {
return "StringValue";
};
NumericTagValue implements TagValue = NumericLiteral;
ast NumericTagValue =
method public String getValueKind() {
return "NumericValue";
};
BooleanTagValue implements TagValue = (t:"true" | f:"false"); // cannot use true or True, that's why we use t, similar for f
ast BooleanTagValue =
method public String getValueKind() {
return "BooleanValue";
};
UnitTagValue implements TagValue = NumericLiteral unit:Name;
ast UnitTagValue =
method public String getValueKind() {
return "UnitValue";
};
ComplexTag implements TagValue = Name "{" (InnerTag || ";")+ "}";
ast ComplexTag =
method public String getValueKind() {
return "ComplexTag";
};
InnerTag = Name ITagValue;
fragment token IWSS = (' ' | '\t' | '\r' | '\n');
token ITagValue = ('=' IWSS* IRecursion) | ITagToken | ('=' IWSS* String IWSS* ';');
fragment token IRecursion = '{' (~('{' | '}' | '"') | String | IRecursion)+ '}';
fragment token ITagToken = '=' (~('"' | '{' | '}' | ';'))+ ';';
grammar TagValue extends de.monticore.MCBasics,
de.monticore.types.MCBasicTypes,
de.monticore.literals.MCCommonLiterals {
interface TagValue;
astrule TagValue =
method public String getValueKind() {
return "undefined";
}
;
StringTagValue implements TagValue =
String;
astrule StringTagValue =
method public String getValueKind() {
return "StringValue";
}
;
NumericTagValue implements TagValue =
NumericLiteral;
astrule NumericTagValue =
method public String getValueKind() {
return "NumericValue";
}
;
BooleanTagValue implements TagValue =
(t:"true" | f:"false"); // cannot use true or True, that's why we use t, similar for f
astrule BooleanTagValue =
method public String getValueKind() {
return "BooleanValue";
}
;
UnitTagValue implements TagValue =
NumericLiteral unit:Name;
astrule UnitTagValue =
method public String getValueKind() {
return "UnitValue";
}
;
ComplexTag implements TagValue =
Name "{" (InnerTag || ";")+ "}";
astrule ComplexTag =
method public String getValueKind() {
return "ComplexTag";
}
;
InnerTag = Name ITagValue;
token ITagValue =
('=' IWSS* IRecursion) | ITagToken | ('=' IWSS* String IWSS* ';');
fragment token IWSS =
(' ' | '\t' | '\r' | '\n');
fragment token IRecursion =
'{' (~('{' | '}' | '"') | String | IRecursion)+ '}';
fragment token ITagToken =
'=' (~('"' | '{' | '}' | ';'))+ ';';
}
......@@ -5,93 +5,133 @@ package de.monticore.lang;
* Basic grammar to tag non-functional properties
*
*/
grammar Tagging extends de.monticore.common.Common {
TaggingUnit =
("package" package:(Name& || ".")+ ";")?
(ImportStatement)*
"conforms" "to" (QualifiedName || ",")+ ";"
TagBody;
// name should be optional, but than we need an transformation step in the parser
// b/c the symbol table needs a name
// and we need the symbol table for coco checks
// maybe later for convience we make the optional
TagBody = "tags" Name? ("for" targetModel: Scope)? "{"
Tag+ "}";
// interface TagElement;
Tag = "tag" (Scope || ",")+ "with" TagElement+;
symbol TagElement = Name (TagValue | ";");
fragment token WSS = (' ' | '\t' | '\r' | '\n');
token TagValue = '=' WSS* BasicTagValue (WSS* ';');
fragment token BasicTagValue = (Recursion | TagToken | String);
fragment token Recursion = '{' (~('{' | '}' | '"') | String | Recursion)+ '}';
fragment token TagToken = (~('"' | '{' | '}' | ';'))+;
NameWithArray = (Name ("[" start:IntLiteral (( ":" step:IntLiteral )? ":" end:IntLiteral )?"]")?);
ast NameWithArray =
method public String toString(){
String arrayPart = "";
arrayPart += getStartOpt().isPresent() ? "" + getStartOpt().get().getValue() : "";
arrayPart += getStepOpt().isPresent() ? ":" + getStepOpt().get().getValue() : "";
arrayPart += getEndOpt().isPresent() ? ":" + getEndOpt().get().getValue() : "";
return name + (arrayPart.equals("") ? "" : "[" + arrayPart + "]");
};
QualifiedNameWithArray = parts:( NameWithArray || ".")+;
ast QualifiedNameWithArray =
method public String toString(){
return de.se_rwth.commons.Joiners.DOT.join(getPartsList());
};
interface Scope;
ast Scope =
method public String getQualifiedNameString() {
return "";
}
method public String getScopeKind() {
return "undefined";
};
// this one is only defined here, to get Parser Tags
NameScope implements Scope = qualifiedName:QualifiedNameWithArray;
ast NameScope =
method public String getQualifiedNameString() {
return getQualifiedName().toString();
}
method public String getScopeKind() {
return "NameScope";
};
ConnectorScope extends NameScope = source:QualifiedNameWithArray "->" qualifiedName:QualifiedNameWithArray;
ast ConnectorScope =
method public String getQualifiedNameString() {
return getQualifiedName().toString();
}
method public String getScopeKind() {
return "ConnectorScope";
};
/* ast Scope =
method public de.monticore.types.types._ast.ASTQualifiedName getQualifiedName() {
return null;
}
method public String getQualifiedNameAsString() {
return de.se_rwth.commons.Joiners.DOT.join(getQualifiedName().getParts());
};
ast NameScope =
method public String getQualifiedNameAsString() {
return de.se_rwth.commons.Joiners.DOT.join(getQualifiedName().getParts());
};
ast ConnectorScope =
method public String getQualifiedNameAsString() {
return de.se_rwth.commons.Joiners.DOT.join(getQualifiedName().getParts());
}; */
grammar Tagging extends de.monticore.MCBasics,
de.monticore.types.MCBasicTypes,
de.monticore.literals.MCCommonLiterals {
TaggingUnit =
MCPackageDeclaration?
MCImportStatement*
"conforms" "to" (MCQualifiedName || ",")+ ";"
TagBody;
// name should be optional, but than we need an transformation step in the parser
// b/c the symbol table needs a name
// and we need the symbol table for coco checks
// maybe later for convience we make the optional
TagBody = "tags" Name? ("for" targetModel: Scope)?
"{"
Tag+
"}";
symbol Tag =
"tag" (Scope || ",")+ "with" TagElement+;
// interface TagElement;
symbol TagElement =
Name (TagValue | ";");
interface Scope;
// this one is only defined here, to get Parser Tags
NameScope implements Scope =
qualifiedName:QualifiedNameWithArray;
ConnectorScope extends NameScope =
source:QualifiedNameWithArray "->" qualifiedName:QualifiedNameWithArray;
QualifiedNameWithArray =
parts:( NameWithArray || ".")+;
NameWithArray =
(Name ("[" start:NatLiteral (( ":" step:NatLiteral )? ":" end:NatLiteral )?"]")?);
token TagValue =
'=' WSS* BasicTagValue (WSS* ';');
fragment token WSS =
(' ' | '\t' | '\r' | '\n');
fragment token BasicTagValue =
(Recursion | TagToken | String);
fragment token Recursion =
'{' (~('{' | '}' | '"') | String | Recursion)+ '}';
fragment token TagToken =
(~('"' | '{' | '}' | ';'))+;
astrule QualifiedNameWithArray =
method public String toString(){
return de.se_rwth.commons.Joiners.DOT.join(getPartsList());
}
;
astrule NameWithArray =
method public String toString(){
String arrayPart = "";
arrayPart += isPresentStart() ? "" + getStart().getValue() : "";
arrayPart += isPresentStep() ? ":" + getStep().getValue() : "";
arrayPart += isPresentEnd() ? ":" + getEnd().getValue() : "";
return name + (arrayPart.equals("") ? "" : "[" + arrayPart + "]");
}
;
astrule Scope =
method public String getQualifiedNameString() {
return "";
}
method public String getScopeKind() {
return "undefined";
}
;
astrule NameScope =
method public String getQualifiedNameString() {
return getQualifiedName().toString();
}
method public String getScopeKind() {
return "NameScope";
}
;
astrule ConnectorScope =
method public String getQualifiedNameString() {
return getQualifiedName().toString();
}
method public String getScopeKind() {
return "ConnectorScope";
}
;
/* astrule Scope =
method public de.monticore.types.types._astrule.astruleQualifiedName getQualifiedName() {
return null;
}
method public String getQualifiedNameAsString() {
return de.se_rwth.commons.Joiners.DOT.join(getQualifiedName().getParts());
}
;
astrule NameScope =
method public String getQualifiedNameAsString() {
return de.se_rwth.commons.Joiners.DOT.join(getQualifiedName().getParts());
}
;
astrule ConnectorScope =
method public String getQualifiedNameAsString() {
return de.se_rwth.commons.Joiners.DOT.join(getQualifiedName().getParts());
}
; */
}
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.tagging._ast;
public class ASTTag extends ASTTagTOP {
@Override
public String getName() {
return "";
}
}
......@@ -6,7 +6,10 @@ import java.util.Optional;
public class ASTTagElement extends ASTTagElementTOP {
protected ASTTagElement(String name, Optional<String> tagValue) {
super(name, tagValue);
super();
this.setName(name);
if (tagValue.isPresent())
this.setTagValue(tagValue.get());
}
protected ASTTagElement () {
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.tagging._symboltable;
public class TagKind implements de.monticore.symboltable.SymbolKind {
public static final TagKind INSTANCE = new TagKind();
protected TagKind() {
}