Commit af6046b5 authored by Sebastian Nickels's avatar Sebastian Nickels
Browse files

Fixed compilation errors

parent e25a213e
Pipeline #151396 failed with stages
...@@ -37,7 +37,7 @@ public class ArchitectureSymbol extends CommonScopeSpanningSymbol { ...@@ -37,7 +37,7 @@ public class ArchitectureSymbol extends CommonScopeSpanningSymbol {
public static final ArchitectureKind KIND = new ArchitectureKind(); public static final ArchitectureKind KIND = new ArchitectureKind();
private List<SerialCompositeElementSymbol> streams; private List<SerialCompositeElementSymbol> streams = new ArrayList<>();
private List<IOSymbol> inputs = new ArrayList<>(); private List<IOSymbol> inputs = new ArrayList<>();
private List<IOSymbol> outputs = new ArrayList<>(); private List<IOSymbol> outputs = new ArrayList<>();
private Map<String, IODeclarationSymbol> ioDeclarationMap = new HashMap<>(); private Map<String, IODeclarationSymbol> ioDeclarationMap = new HashMap<>();
...@@ -52,6 +52,26 @@ public class ArchitectureSymbol extends CommonScopeSpanningSymbol { ...@@ -52,6 +52,26 @@ public class ArchitectureSymbol extends CommonScopeSpanningSymbol {
return streams; return streams;
} }
public List<SerialCompositeElementSymbol> getNetworkStreams() {
List<SerialCompositeElementSymbol> networkStreams = new ArrayList<>();
for (SerialCompositeElementSymbol stream : streams) {
if (stream.isNetwork()) {
networkStreams.add(stream);
}
}
return networkStreams;
}
public List<SerialCompositeElementSymbol> getNonNetworkStreams() {
List<SerialCompositeElementSymbol> nonNetworkStreams = new ArrayList<>();
for (SerialCompositeElementSymbol stream : streams) {
if (!stream.isNetwork()) {
nonNetworkStreams.add(stream);
}
}
return nonNetworkStreams;
}
public void setStreams(List<SerialCompositeElementSymbol> streams) { public void setStreams(List<SerialCompositeElementSymbol> streams) {
this.streams = streams; this.streams = streams;
} }
......
...@@ -251,8 +251,7 @@ public class CNNArchSymbolTableCreator extends de.monticore.symboltable.CommonSy ...@@ -251,8 +251,7 @@ public class CNNArchSymbolTableCreator extends de.monticore.symboltable.CommonSy
@Override @Override
public void endVisit(ASTUnrollDeclaration ast) { public void endVisit(ASTUnrollDeclaration ast) {
UnrollDeclarationSymbol unrollDeclaration = (UnrollDeclarationSymbol) ast.getSymbolOpt().get(); UnrollDeclarationSymbol unrollDeclaration = (UnrollDeclarationSymbol) ast.getSymbolOpt().get();
unrollDeclaration.setBody((CompositeElementSymbol) ast.getBody().getSymbolOpt().get()); unrollDeclaration.setBody((SerialCompositeElementSymbol) ast.getBody().getSymbolOpt().get());
List<VariableSymbol> parameters = new ArrayList<>(4); List<VariableSymbol> parameters = new ArrayList<>(4);
for (ASTLayerParameter astParam : ast.getParametersList()){ for (ASTLayerParameter astParam : ast.getParametersList()){
......
...@@ -47,8 +47,7 @@ public abstract class CompositeElementSymbol extends ArchitectureElementSymbol { ...@@ -47,8 +47,7 @@ public abstract class CompositeElementSymbol extends ArchitectureElementSymbol {
if (element instanceof CompositeElementSymbol) { if (element instanceof CompositeElementSymbol) {
isNetwork |= ((CompositeElementSymbol) element).isNetwork(); isNetwork |= ((CompositeElementSymbol) element).isNetwork();
} }
else if (element instanceof LayerSymbol) else if (element instanceof LayerSymbol) {
{
isNetwork |= ((LayerSymbol) element).getDeclaration().isNetworkLayer(); isNetwork |= ((LayerSymbol) element).getDeclaration().isNetworkLayer();
} }
} }
......
...@@ -35,7 +35,7 @@ public class UnrollDeclarationSymbol extends CommonScopeSpanningSymbol { ...@@ -35,7 +35,7 @@ public class UnrollDeclarationSymbol extends CommonScopeSpanningSymbol {
public static final UnrollDeclarationKind KIND = new UnrollDeclarationKind(); public static final UnrollDeclarationKind KIND = new UnrollDeclarationKind();
private List<VariableSymbol> parameters; private List<VariableSymbol> parameters;
private CompositeElementSymbol body; private SerialCompositeElementSymbol body;
protected UnrollDeclarationSymbol(String name) { protected UnrollDeclarationSymbol(String name) {
...@@ -75,11 +75,11 @@ public class UnrollDeclarationSymbol extends CommonScopeSpanningSymbol { ...@@ -75,11 +75,11 @@ public class UnrollDeclarationSymbol extends CommonScopeSpanningSymbol {
} }
} }
public CompositeElementSymbol getBody() { public SerialCompositeElementSymbol getBody() {
return body; return body;
} }
protected void setBody(CompositeElementSymbol body) { protected void setBody(SerialCompositeElementSymbol body) {
this.body = body; this.body = body;
} }
...@@ -109,7 +109,7 @@ public class UnrollDeclarationSymbol extends CommonScopeSpanningSymbol { ...@@ -109,7 +109,7 @@ public class UnrollDeclarationSymbol extends CommonScopeSpanningSymbol {
reset(); reset();
set(layer.getArguments()); set(layer.getArguments());
CompositeElementSymbol copy = getBody().preResolveDeepCopy(); SerialCompositeElementSymbol copy = getBody().preResolveDeepCopy();
copy.putInScope(getSpannedScope()); copy.putInScope(getSpannedScope());
copy.resolveOrError(); copy.resolveOrError();
getSpannedScope().remove(copy); getSpannedScope().remove(copy);
......
...@@ -142,7 +142,7 @@ public class UnrollSymbol extends ArchitectureElementSymbol { ...@@ -142,7 +142,7 @@ public class UnrollSymbol extends ArchitectureElementSymbol {
if (!isActive() || maxSerialLength == 0) { if (!isActive() || maxSerialLength == 0) {
//set resolvedThis to empty composite to remove the layer. //set resolvedThis to empty composite to remove the layer.
setResolvedThis(new CompositeElementSymbol.Builder().build()); setResolvedThis(new SerialCompositeElementSymbol());
} }
else if (parallelLength == 1 && maxSerialLength == 1) { else if (parallelLength == 1 && maxSerialLength == 1) {
//resolve the layer call //resolve the layer call
...@@ -186,10 +186,8 @@ public class UnrollSymbol extends ArchitectureElementSymbol { ...@@ -186,10 +186,8 @@ public class UnrollSymbol extends ArchitectureElementSymbol {
for (List<ArchitectureElementSymbol> serialElements : elements) { for (List<ArchitectureElementSymbol> serialElements : elements) {
serialComposites.add(createSerialSequencePart(serialElements)); serialComposites.add(createSerialSequencePart(serialElements));
} }
CompositeElementSymbol parallelElement = new CompositeElementSymbol.Builder() ParallelCompositeElementSymbol parallelElement = new ParallelCompositeElementSymbol();
.parallel(true) parallelElement.setElements(serialComposites);
.elements(serialComposites)
.build();
if (getAstNode().isPresent()) { if (getAstNode().isPresent()) {
parallelElement.setAstNode(getAstNode().get()); parallelElement.setAstNode(getAstNode().get());
...@@ -203,10 +201,8 @@ public class UnrollSymbol extends ArchitectureElementSymbol { ...@@ -203,10 +201,8 @@ public class UnrollSymbol extends ArchitectureElementSymbol {
return elements.get(0); return elements.get(0);
} }
else { else {
CompositeElementSymbol serialComposite = new CompositeElementSymbol.Builder() SerialCompositeElementSymbol serialComposite = new SerialCompositeElementSymbol();
.parallel(false) serialComposite.setElements(elements);
.elements(elements)
.build();
if (getAstNode().isPresent()){ if (getAstNode().isPresent()){
serialComposite.setAstNode(getAstNode().get()); serialComposite.setAstNode(getAstNode().get());
......
Supports Markdown
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