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
bc8e037c
Commit
bc8e037c
authored
Sep 05, 2019
by
Sebastian Nickels
Browse files
Small changes to avoid endless loop when checking unresolved elements
parent
ba82c2c3
Pipeline
#180353
passed with stages
in 19 minutes and 40 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/cnnarch/_cocos/CheckIOAccessAndIOMissing.java
View file @
bc8e037c
...
...
@@ -76,7 +76,7 @@ public class CheckIOAccessAndIOMissing extends CNNArchSymbolCoCo {
boolean
isUnroll
=
false
;
for
(
UnrollSymbol
unroll
:
architecture
.
getUnrolls
())
{
isUnroll
=
contains
(
unroll
.
getBody
()
.
getFirstAtomicElements
()
,
ioElement
);
isUnroll
=
contains
(
unroll
.
getBody
(),
ioElement
);
}
// Allow invalid indices in UnrollSymbols
...
...
@@ -101,18 +101,20 @@ public class CheckIOAccessAndIOMissing extends CNNArchSymbolCoCo {
}
private
boolean
contains
(
List
<
ArchitectureElementSymbol
>
lis
t
,
ArchitectureElementSymbol
e
lement
)
{
boolean
bool
=
false
;
private
boolean
contains
(
ArchitectureElementSymbol
elemen
t
,
ArchitectureElementSymbol
containedE
lement
)
{
ArchitectureElementSymbol
resolvedElement
=
(
ArchitectureElementSymbol
)
element
.
getResolvedThis
().
get
()
;
for
(
ArchitectureElementSymbol
ele
:
list
)
{
if
(
ele
.
equals
(
element
))
{
return
true
;
}
if
(
resolvedElement
instanceof
CompositeElementSymbol
)
{
List
<
ArchitectureElementSymbol
>
constructedElements
=
((
CompositeElementSymbol
)
resolvedElement
).
getElements
();
bool
|=
contains
(
ele
.
getNext
(),
element
);
for
(
ArchitectureElementSymbol
constructedElement
:
constructedElements
)
{
if
(
contains
(
constructedElement
,
containedElement
))
{
return
true
;
}
}
}
return
bool
;
return
resolvedElement
.
equals
(
containedElement
)
;
}
}
src/main/java/de/monticore/lang/monticar/cnnarch/_cocos/CheckLayerVariableDeclarationIsUsed.java
View file @
bc8e037c
...
...
@@ -52,7 +52,10 @@ public class CheckLayerVariableDeclarationIsUsed extends CNNArchSymbolCoCo {
}
for
(
UnrollSymbol
unroll
:
layerVariableDeclaration
.
getLayer
().
getArchitecture
().
getUnrolls
())
{
for
(
ArchitectureElementSymbol
element
:
unroll
.
getBodiesForAllTimesteps
().
get
(
0
).
getElements
())
{
Collection
<
ArchitectureElementSymbol
>
elements
=
unroll
.
getBody
().
getSpannedScope
().
resolveMany
(
layerVariableDeclaration
.
getName
(),
ArchitectureElementSymbol
.
KIND
);
for
(
ArchitectureElementSymbol
element
:
elements
)
{
if
(
element
instanceof
VariableSymbol
&&
((
VariableSymbol
)
element
).
getMember
()
==
VariableSymbol
.
Member
.
NONE
)
{
isUsed
=
true
;
break
;
...
...
Write
Preview
Markdown
is supported
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