updated to MC 6.0.0

parent a323ab76
Pipeline #214392 failed with stage
in 4 minutes and 27 seconds
......@@ -34,7 +34,7 @@
<properties>
<Common-MontiCar.version>0.1.0-SNAPSHOT</Common-MontiCar.version>
<!-- .. SE-Libraries .................................................. -->
<monticore.version>5.3.0</monticore.version>
<monticore.version>6.0.0</monticore.version>
<se-commons.version>1.7.7</se-commons.version>
<mc.grammars.assembly.version>0.0.8</mc.grammars.assembly.version>
......@@ -45,7 +45,7 @@
<jscience.version>4.3.1</jscience.version>
<!-- .. Plugins ....................................................... -->
<monticore.plugin>5.3.0</monticore.plugin>
<monticore.plugin>6.0.0</monticore.plugin>
<assembly.plugin>2.5.4</assembly.plugin>
<compiler.plugin>3.3</compiler.plugin>
<source.plugin>2.4</source.plugin>
......
......@@ -35,13 +35,12 @@ grammar Tagging extends external1.Common0 {
NameWithArray = (Name ("[" start:IntLiteral (( ":" step:IntLiteral )? ":" end:IntLiteral )?"]")?);
astrule 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 + "]");
String arrayPart = "";
arrayPart+=isPresentStart() ? "" + getStart().getValue() : "";
arrayPart+=isPresentStep() ? ":" + getStep().getValue() : "";
arrayPart+=isPresentEnd() ? ":" + getEnd().getValue() : "";
return name + (arrayPart.equals("") ? "" : "[" + arrayPart + "]");
};
QualifiedNameWithArray = parts:( NameWithArray || ".")+;
......
......@@ -45,7 +45,7 @@ public class TagResolver {
public void loadTagModels(ITaggingGlobalScope globalScope, String... modelPath) {
ArrayList<String> list = new ArrayList();
list.addAll(Arrays.asList(modelPath));
loadTagModels(list, new TaggingLanguage().getSymbolTableCreator(globalScope).taggingSTC);
loadTagModels(list, new TaggingLanguage().getSymbolTableCreator(globalScope).symbolTable);
}
public void loadTagModels(TaggingSymbolTableCreator taggingSymbolTableCreator, String... modelPath) {
......@@ -55,7 +55,7 @@ public class TagResolver {
}
public void loadTagModels(Collection<String> modelPaths, ITaggingGlobalScope globalScope) {
loadTagModels(modelPaths, new TaggingLanguage().getSymbolTableCreator(globalScope).taggingSTC);
loadTagModels(modelPaths, new TaggingLanguage().getSymbolTableCreator(globalScope).symbolTable);
}
public void loadTagModels(Collection<String> modelPaths,
......
......@@ -78,7 +78,7 @@ public class TaggingSymbolTableCreator extends TaggingSymbolTableCreatorTOP {
@Override
public void visit(ASTTag node) {
super.visit(node);
if (node.getTargetModelOpt().isPresent())
if (node.isPresentTargetModel())
node.getSymbol().setTaggedSymbolName(node.getTargetModel().getQualifiedNameString());
tagResolver.allCreatedTagSymbols.add(node.getSymbol());
}
......
......@@ -184,7 +184,7 @@ public class TagSchemaGenerator extends GeneratorEngine {
if(importStatement.isStar()) importString += ".*";
imports.add(importString);
}
String scopeSymbol = complexTagType.getScopeOpt().get().getScopeIdentifierList().get(0).getScopeName();
String scopeSymbol = complexTagType.getScope().getScopeIdentifierList().get(0).getScopeName();
String nameScopeType = Log.errorIfNull(symbolScopeMap.get(scopeSymbol), String.format("For the scope symbol '%s' is no scope type defined.", scopeSymbol));
generate("templates.de.monticore.lang.tagschema.ComplexTagTypeCreator",
Paths.get(createPackagePath(packageName).toString(), tagSchemaUnit.getName(), complexTagTypeName + "SymbolCreator.java"),
......@@ -201,18 +201,18 @@ public class TagSchemaGenerator extends GeneratorEngine {
protected void generateValuedTagType(ASTValuedTagType valuedTagType, ASTTagSchemaUnit tagSchemaUnit, String packageName, Map<String, String> symbolScopeMap) {
String dataType = null;
boolean isUnit = false;
if (valuedTagType.getBooleanOpt().isPresent()) {
if (valuedTagType.isPresentBoolean()) {
dataType = "Boolean";
}
else if (valuedTagType.getNumberOpt().isPresent()) {
else if (valuedTagType.isPresentNumber()) {
dataType = "Number";
}
else if (valuedTagType.getStringOpt().isPresent()) {
else if (valuedTagType.isPresentString()) {
dataType = "String";
}
else if (valuedTagType.getUnitKindOpt().isPresent()) {
else if (valuedTagType.isPresentUnitKind()) {
isUnit = true;
dataType = valuedTagType.getUnitKindOpt().get();
dataType = valuedTagType.getUnitKind();
if (!UnitKinds.contains(dataType)) {
Log.error(String.format("Unit kind '%s' is not supported. Currently the following unit kinds are available '%s'",
dataType, UnitKinds.available()), valuedTagType.get_SourcePositionStart());
......@@ -230,7 +230,7 @@ public class TagSchemaGenerator extends GeneratorEngine {
if(importStatement.isStar()) importString += ".*";
imports.add(importString);
}
String scopeSymbol = valuedTagType.getScopeOpt().get().getScopeIdentifierList().get(0).getScopeName();
String scopeSymbol = valuedTagType.getScope().getScopeIdentifierList().get(0).getScopeName();
String nameScopeType = Log.errorIfNull(symbolScopeMap.get(scopeSymbol), String.format("For the scope symbol '%s' is no scope type defined.", scopeSymbol));
generate("templates.de.monticore.lang.tagschema.ValuedTagTypeCreator",
Paths.get(createPackagePath(packageName).toString(),tagSchemaUnit.getName(), valuedTagType.getName() + "SymbolCreator.java"),
......@@ -257,7 +257,7 @@ public class TagSchemaGenerator extends GeneratorEngine {
String importString = Joiners.DOT.join(importStatement.getImportList());
if(importStatement.isStar()) importString += ".*";
imports.add(importString);
} String scopeSymbol = simpleTagType.getScopeOpt().get().getScopeIdentifierList().get(0).getScopeName();
} String scopeSymbol = simpleTagType.getScope().getScopeIdentifierList().get(0).getScopeName();
String nameScopeType = Log.errorIfNull(symbolScopeMap.get(scopeSymbol), String.format("For the scope symbol '%s' is no scope type defined.", scopeSymbol));
generate("templates.de.monticore.lang.tagschema.SimpleTagTypeCreator",
Paths.get(createPackagePath(packageName).toString(), tagSchemaUnit.getName(), simpleTagType.getName() + "SymbolCreator.java"),
......
......@@ -75,15 +75,15 @@ public class RangeFixer {
public static List<ASTNameWithArray> expandRangeInPart(ASTNameWithArray part) {
//Not a range
if (!part.getStartOpt().isPresent() || !part.getEndOpt().isPresent()) {
if (!part.isPresentStart() || !part.isPresentEnd()) {
return Lists.newArrayList(part);
}
List<ASTNameWithArray> result = new ArrayList<>();
int step = part.getStepOpt().isPresent() ? part.getStepOpt().get().getValue() : 1;
int start = part.getStartOpt().get().getValue();
int end = part.getEndOpt().get().getValue();
int step = part.isPresentStep() ? part.getStep().getValue() : 1;
int start = part.getStart().getValue();
int end = part.getEnd().getValue();
for (int i = start; i <= end; i += step) {
ASTNameWithArray tmpNameWithArray = TaggingMill.nameWithArrayBuilder()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment