Commit af6046b5 authored by Sebastian Nickels's avatar Sebastian Nickels

Fixed compilation errors

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