Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
languages
CNNArchLang
Commits
af6046b5
Commit
af6046b5
authored
Jun 18, 2019
by
Sebastian Nickels
Browse files
Fixed compilation errors
parent
e25a213e
Pipeline
#151396
failed with stages
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/cnnarch/_symboltable/ArchitectureSymbol.java
View file @
af6046b5
...
@@ -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
;
}
}
...
...
src/main/java/de/monticore/lang/monticar/cnnarch/_symboltable/CNNArchSymbolTableCreator.java
View file @
af6046b5
...
@@ -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
()){
...
...
src/main/java/de/monticore/lang/monticar/cnnarch/_symboltable/CompositeElementSymbol.java
View file @
af6046b5
...
@@ -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
();
}
}
}
}
...
...
src/main/java/de/monticore/lang/monticar/cnnarch/_symboltable/UnrollDeclarationSymbol.java
View file @
af6046b5
...
@@ -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
Serial
CompositeElementSymbol
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
Serial
CompositeElementSymbol
getBody
()
{
return
body
;
return
body
;
}
}
protected
void
setBody
(
CompositeElementSymbol
body
)
{
protected
void
setBody
(
Serial
CompositeElementSymbol
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
();
Serial
CompositeElementSymbol
copy
=
getBody
().
preResolveDeepCopy
();
copy
.
putInScope
(
getSpannedScope
());
copy
.
putInScope
(
getSpannedScope
());
copy
.
resolveOrError
();
copy
.
resolveOrError
();
getSpannedScope
().
remove
(
copy
);
getSpannedScope
().
remove
(
copy
);
...
...
src/main/java/de/monticore/lang/monticar/cnnarch/_symboltable/UnrollSymbol.java
View file @
af6046b5
...
@@ -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
Serial
CompositeElementSymbol
());
}
}
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
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment