Commit b5f57b27 authored by Christoph Richter's avatar Christoph Richter
Browse files

Updated to newest tagging version

parent b439c71f
......@@ -23,7 +23,7 @@
<Embedded-MontiArc-Behaviour.version>0.0.14-SNAPSHOT</Embedded-MontiArc-Behaviour.version>
<Math.version>0.0.14-SNAPSHOT</Math.version>
<Embedded-MontiArc-Math.version>0.0.14-SNAPSHOT</Embedded-MontiArc-Math.version>
<tagging.version>0.0.2</tagging.version>
<tagging.version>0.0.3-SNAPSHOT</tagging.version>
<!-- .. Libraries .................................................. -->
<guava.version>18.0</guava.version>
<junit.version>4.12</junit.version>
......
......@@ -35,17 +35,17 @@ public class TagBreakpointsSymbolCreator implements TagSymbolCreator {
}
public void create(ASTTaggingUnit unit, TaggingResolver gs) {
if (unit.getQualifiedNames().stream()
if (unit.getQualifiedNameList().stream()
.map(q -> q.toString())
.filter(n -> n.endsWith("TagBreakpointsTagSchema"))
.count() == 0) {
return; // the tagging model is not conform to the TagExecutionOrderTagSchema tagging schema
}
final String packageName = Joiners.DOT.join(unit.getPackage());
final String packageName = Joiners.DOT.join(unit.getPackageList());
final String rootCmp = // if-else does not work b/cpp of final (required by streams)
(unit.getTagBody().getTargetModel().isPresent()) ?
(unit.getTagBody().getTargetModelOpt().isPresent()) ?
Joiners.DOT.join(packageName,
unit.getTagBody().getTargetModel().get()
unit.getTagBody().getTargetModelOpt().get()
.getQualifiedNameString()) :
packageName;
......@@ -53,14 +53,14 @@ public class TagBreakpointsSymbolCreator implements TagSymbolCreator {
}
protected void handleTagElements(ASTTaggingUnit unit, TaggingResolver gs, String rootCmp) {
for (ASTTag element : unit.getTagBody().getTags()) {
element.getTagElements().stream()
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("TagBreakpoints"))
.filter(t -> t.getTagValue().isPresent())
.map(t -> checkContent(t.getTagValue().get()))
.filter(t -> t.getTagValueOpt().isPresent())
.map(t -> checkContent(t.getTagValueOpt().get()))
.filter(v -> v != null)
.forEachOrdered(v ->
element.getScopes().stream()
element.getScopeList().stream()
.filter(this::checkScope)
.map(s -> (ASTNameScope) s)
.map(s -> getGlobalScope(gs).<Symbol>resolveDownMany(
......@@ -82,13 +82,13 @@ public class TagBreakpointsSymbolCreator implements TagSymbolCreator {
long errorCount = Log.getErrorCount();
String[] parts = s.split(",");
for (String i : parts)
ast.add(parser.parseString_NumericTagValue(i));
ast.add(parser.parse_StringNumericTagValue(i));
Log.enableFailQuick(enableFailQuick);
if (Log.getErrorCount() > errorCount) {
throw new Exception("Error occured during parsing.");
}
} catch (Exception e) {
Log.error(String.format("0xT0010 Could not parse %s with TagValueParser#parseString_NumericTagValue.",
Log.error(String.format("0xT0010 Could not parse %s with TagValueParser#parse_StringNumericTagValue.",
s), e);
return null;
}
......
......@@ -35,28 +35,28 @@ public class TagDelaySymbolCreator implements TagSymbolCreator {
}
public void create(ASTTaggingUnit unit, TaggingResolver gs) {
if (unit.getQualifiedNames().stream()
if (unit.getQualifiedNameList().stream()
.map(q -> q.toString())
.filter(n -> n.endsWith("TagDelayTagSchema"))
.count() == 0) {
return; // the tagging model is not conform to the TagExecutionOrderTagSchema tagging schema
}
final String packageName = Joiners.DOT.join(unit.getPackage());
final String packageName = Joiners.DOT.join(unit.getPackageList());
final String rootCmp = // if-else does not work b/cpp of final (required by streams)
(unit.getTagBody().getTargetModel().isPresent()) ?
(unit.getTagBody().getTargetModelOpt().isPresent()) ?
Joiners.DOT.join(packageName,
unit.getTagBody().getTargetModel().get()
unit.getTagBody().getTargetModelOpt().get()
.getQualifiedNameString()) :
packageName;
for (ASTTag element : unit.getTagBody().getTags()) {
element.getTagElements().stream()
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("TagDelay"))
.filter(t -> t.getTagValue().isPresent())
.map(t -> checkContent(t.getTagValue().get()))
.filter(t -> t.getTagValueOpt().isPresent())
.map(t -> checkContent(t.getTagValueOpt().get()))
.filter(v -> v != null)
.forEachOrdered(v ->
element.getScopes().stream()
element.getScopeList().stream()
.filter(this::checkScope)
.map(s -> (ASTNameScope) s)
.map(s -> getGlobalScope(gs).<Symbol>resolveDownMany(
......@@ -80,7 +80,7 @@ public class TagDelaySymbolCreator implements TagSymbolCreator {
String[] parts = s.split(",");
for (String i : parts) {
ast.add(parser.parseString_NumericTagValue(i));
ast.add(parser.parse_StringNumericTagValue(i));
}
Log.enableFailQuick(enableFailQuick);
......@@ -88,7 +88,7 @@ public class TagDelaySymbolCreator implements TagSymbolCreator {
throw new Exception("Error occured during parsing.");
}
} catch (Exception e) {
Log.error(String.format("0xT0014 Could not parse %s with TagValueParser#parseString_NumericTagValue.",
Log.error(String.format("0xT0014 Could not parse %s with TagValueParser#parse_StringNumericTagValue.",
s), e);
return null;
}
......
......@@ -12,17 +12,17 @@ import de.se_rwth.commons.Joiners;
public class TagExecutionOrderSymbolCreator implements TagSymbolCreator {
public void create(ASTTaggingUnit unit, TaggingResolver gs) {
if (unit.getQualifiedNames().stream()
if (unit.getQualifiedNameList().stream()
.map(q -> q.toString())
.filter(n -> n.endsWith("TagExecutionOrderTagSchema"))
.count() == 0) {
return; // the tagging model is not conform to the TagExecutionOrderTagSchema tagging schema
}
final String packageName = Joiners.DOT.join(unit.getPackage());
final String packageName = Joiners.DOT.join(unit.getPackageList());
final String rootCmp = // if-else does not work b/cpp of final (required by streams)
(unit.getTagBody().getTargetModel().isPresent()) ?
(unit.getTagBody().getTargetModelOpt().isPresent()) ?
Joiners.DOT.join(packageName,
unit.getTagBody().getTargetModel().get()
unit.getTagBody().getTargetModelOpt().get()
.getQualifiedNameString()) :
packageName;
}
......
......@@ -35,28 +35,28 @@ public class TagInitSymbolCreator implements TagSymbolCreator {
}
public void create(ASTTaggingUnit unit, TaggingResolver gs) {
if (unit.getQualifiedNames().stream()
if (unit.getQualifiedNameList().stream()
.map(q -> q.toString())
.filter(n -> n.endsWith("TagInitTagSchema"))
.count() == 0) {
return; // the tagging model is not conform to the TagExecutionOrderTagSchema tagging schema
}
final String packageName = Joiners.DOT.join(unit.getPackage());
final String packageName = Joiners.DOT.join(unit.getPackageList());
final String rootCmp = // if-else does not work b/cpp of final (required by streams)
(unit.getTagBody().getTargetModel().isPresent()) ?
(unit.getTagBody().getTargetModelOpt().isPresent()) ?
Joiners.DOT.join(packageName,
unit.getTagBody().getTargetModel().get()
unit.getTagBody().getTargetModelOpt().get()
.getQualifiedNameString()) :
packageName;
for (ASTTag element : unit.getTagBody().getTags()) {
element.getTagElements().stream()
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("TagInit"))
.filter(t -> t.getTagValue().isPresent())
.map(t -> checkContent(t.getTagValue().get()))
.filter(t -> t.getTagValueOpt().isPresent())
.map(t -> checkContent(t.getTagValueOpt().get()))
.filter(v -> v != null)
.forEachOrdered(v ->
element.getScopes().stream()
element.getScopeList().stream()
.filter(this::checkScope)
.map(s -> (ASTNameScope) s)
.map(s -> getGlobalScope(gs).<Symbol>resolveDownMany(
......@@ -77,14 +77,14 @@ public class TagInitSymbolCreator implements TagSymbolCreator {
Log.enableFailQuick(false);
long errorCount = Log.getErrorCount();
ast = parser.parseString_NumericTagValue(s);
ast = parser.parse_StringNumericTagValue(s);
Log.enableFailQuick(enableFailQuick);
if (Log.getErrorCount() > errorCount) {
throw new Exception("Error occured during parsing.");
}
} catch (Exception e) {
Log.error(String.format("0xT0018 Could not parse %s with TagValueParser#parseString_NumericTagValue.",
Log.error(String.format("0xT0018 Could not parse %s with TagValueParser#parse_StringNumericTagValue.",
s), e);
return null;
}
......
......@@ -35,28 +35,28 @@ public class TagMinMaxSymbolCreator implements TagSymbolCreator {
}
public void create(ASTTaggingUnit unit, TaggingResolver gs) {
if (unit.getQualifiedNames().stream()
if (unit.getQualifiedNameList().stream()
.map(q -> q.toString())
.filter(n -> n.endsWith("TagMinMaxTagSchema"))
.count() == 0) {
return; // the tagging model is not conform to the TagExecutionOrderTagSchema tagging schema
}
final String packageName = Joiners.DOT.join(unit.getPackage());
final String packageName = Joiners.DOT.join(unit.getPackageList());
final String rootCmp = // if-else does not work b/cpp of final (required by streams)
(unit.getTagBody().getTargetModel().isPresent()) ?
(unit.getTagBody().getTargetModelOpt().isPresent()) ?
Joiners.DOT.join(packageName,
unit.getTagBody().getTargetModel().get()
unit.getTagBody().getTargetModelOpt().get()
.getQualifiedNameString()) :
packageName;
for (ASTTag element : unit.getTagBody().getTags()) {
element.getTagElements().stream()
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("TagMinMax"))
.filter(t -> t.getTagValue().isPresent())
.map(t -> checkContent(t.getTagValue().get()))
.filter(t -> t.getTagValueOpt().isPresent())
.map(t -> checkContent(t.getTagValueOpt().get()))
.filter(v -> v != null)
.forEachOrdered(v ->
element.getScopes().stream()
element.getScopeList().stream()
.filter(this::checkScope)
.map(s -> (ASTNameScope) s)
.map(s -> getGlobalScope(gs).<Symbol>resolveDownMany(
......@@ -80,7 +80,7 @@ public class TagMinMaxSymbolCreator implements TagSymbolCreator {
String[] parts = s.split(",");
for (String i : parts) {
ast.add(parser.parseString_NumericTagValue(i));
ast.add(parser.parse_StringNumericTagValue(i));
}
Log.enableFailQuick(enableFailQuick);
......@@ -88,7 +88,7 @@ public class TagMinMaxSymbolCreator implements TagSymbolCreator {
throw new Exception("Error occured during parsing.");
}
} catch (Exception e) {
Log.error(String.format("0xT0022 Could not parse %s with TagValueParser#parseString_NumericTagValue.",
Log.error(String.format("0xT0022 Could not parse %s with TagValueParser#parse_StringNumericTagValue.",
s), e);
return null;
}
......
......@@ -35,28 +35,28 @@ public class TagTableSymbolCreator implements TagSymbolCreator {
}
public void create(ASTTaggingUnit unit, TaggingResolver gs) {
if (unit.getQualifiedNames().stream()
if (unit.getQualifiedNameList().stream()
.map(q -> q.toString())
.filter(n -> n.endsWith("TagTableTagSchema"))
.count() == 0) {
return; // the tagging model is not conform to the TagExecutionOrderTagSchema tagging schema
}
final String packageName = Joiners.DOT.join(unit.getPackage());
final String packageName = Joiners.DOT.join(unit.getPackageList());
final String rootCmp = // if-else does not work b/cpp of final (required by streams)
(unit.getTagBody().getTargetModel().isPresent()) ?
(unit.getTagBody().getTargetModelOpt().isPresent()) ?
Joiners.DOT.join(packageName,
unit.getTagBody().getTargetModel().get()
unit.getTagBody().getTargetModelOpt().get()
.getQualifiedNameString()) :
packageName;
for (ASTTag element : unit.getTagBody().getTags()) {
element.getTagElements().stream()
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("TagTable"))
.filter(t -> t.getTagValue().isPresent())
.map(t -> checkContent(t.getTagValue().get()))
.filter(t -> t.getTagValueOpt().isPresent())
.map(t -> checkContent(t.getTagValueOpt().get()))
.filter(v -> v != null)
.forEachOrdered(v ->
element.getScopes().stream()
element.getScopeList().stream()
.filter(this::checkScope)
.map(s -> (ASTNameScope) s)
.map(s -> getGlobalScope(gs).<Symbol>resolveDownMany(
......@@ -79,7 +79,7 @@ public class TagTableSymbolCreator implements TagSymbolCreator {
String[] parts = s.split(",");
for (String i : parts) {
ast.add(parser.parseString_NumericTagValue(i));
ast.add(parser.parse_StringNumericTagValue(i));
}
Log.enableFailQuick(enableFailQuick);
......@@ -87,7 +87,7 @@ public class TagTableSymbolCreator implements TagSymbolCreator {
throw new Exception("Error occured during parsing.");
}
} catch (Exception e) {
Log.error(String.format("0xT0026 Could not parse %s with TagValueParser#parseString_NumericTagValue.",
Log.error(String.format("0xT0026 Could not parse %s with TagValueParser#parse_StringNumericTagValue.",
s), e);
return null;
}
......
......@@ -35,28 +35,28 @@ public class TagThresholdSymbolCreator implements TagSymbolCreator {
}
public void create(ASTTaggingUnit unit, TaggingResolver gs) {
if (unit.getQualifiedNames().stream()
if (unit.getQualifiedNameList().stream()
.map(q -> q.toString())
.filter(n -> n.endsWith("TagThresholdTagSchema"))
.count() == 0) {
return; // the tagging model is not conform to the TagExecutionOrderTagSchema tagging schema
}
final String packageName = Joiners.DOT.join(unit.getPackage());
final String packageName = Joiners.DOT.join(unit.getPackageList());
final String rootCmp = // if-else does not work b/cpp of final (required by streams)
(unit.getTagBody().getTargetModel().isPresent()) ?
(unit.getTagBody().getTargetModelOpt().isPresent()) ?
Joiners.DOT.join(packageName,
unit.getTagBody().getTargetModel().get()
unit.getTagBody().getTargetModelOpt().get()
.getQualifiedNameString()) :
packageName;
for (ASTTag element : unit.getTagBody().getTags()) {
element.getTagElements().stream()
for (ASTTag element : unit.getTagBody().getTagList()) {
element.getTagElementList().stream()
.filter(t -> t.getName().equals("TagThreshold"))
.filter(t -> t.getTagValue().isPresent())
.map(t -> checkContent(t.getTagValue().get()))
.filter(t -> t.getTagValueOpt().isPresent())
.map(t -> checkContent(t.getTagValueOpt().get()))
.filter(v -> v != null)
.forEachOrdered(v ->
element.getScopes().stream()
element.getScopeList().stream()
.filter(this::checkScope)
.map(s -> (ASTNameScope) s)
.map(s -> getGlobalScope(gs).<Symbol>resolveDownMany(
......@@ -77,14 +77,14 @@ public class TagThresholdSymbolCreator implements TagSymbolCreator {
Log.enableFailQuick(false);
long errorCount = Log.getErrorCount();
ast = parser.parseString_NumericTagValue(s);
ast = parser.parse_StringNumericTagValue(s);
Log.enableFailQuick(enableFailQuick);
if (Log.getErrorCount() > errorCount) {
throw new Exception("Error occured during parsing.");
}
} catch (Exception e) {
Log.error(String.format("0xT0030 Could not parse %s with TagValueParser#parseString_NumericTagValue.",
Log.error(String.format("0xT0030 Could not parse %s with TagValueParser#parse_StringNumericTagValue.",
s), e);
return null;
}
......
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