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
61dc6ff8
Commit
61dc6ff8
authored
Aug 24, 2019
by
Christian Fuß
Browse files
put timeParameter in correct scope for use in EMADL
parent
6c7d85c5
Pipeline
#175783
passed with stages
in 20 minutes and 11 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/cnnarch/_symboltable/CNNArchSymbolTableCreator.java
View file @
61dc6ff8
...
...
@@ -355,6 +355,7 @@ public class CNNArchSymbolTableCreator extends de.monticore.symboltable.CommonSy
optArgument
.
ifPresent
(
arguments:
:
add
);
}
layer
.
setArguments
(
arguments
);
layer
.
setTimeParameter
((
ParameterSymbol
)
ast
.
getTimeParameter
().
getSymbolOpt
().
get
());
removeCurrentScope
();
}
...
...
src/main/java/de/monticore/lang/monticar/cnnarch/_symboltable/UnrollDeclarationSymbol.java
View file @
61dc6ff8
...
...
@@ -148,6 +148,7 @@ public class UnrollDeclarationSymbol extends CommonScopeSpanningSymbol {
copy
.
setAstNode
(
getAstNode
().
get
());
}
System
.
err
.
println
(
"parameters to copy: "
+
getParameters
());
List
<
ParameterSymbol
>
parameterCopies
=
new
ArrayList
<>(
getParameters
().
size
());
for
(
ParameterSymbol
parameter
:
getParameters
()){
ParameterSymbol
parameterCopy
=
parameter
.
deepCopy
();
...
...
src/main/java/de/monticore/lang/monticar/cnnarch/_symboltable/UnrollSymbol.java
View file @
61dc6ff8
...
...
@@ -137,7 +137,6 @@ public class UnrollSymbol extends CommonScopeSpanningSymbol {
getBody
().
resolveOrError
();
UnrollSymbol
resolvedUnroll
=
getDeclaration
().
call
(
this
);
setResolvedThis
(
resolvedUnroll
);
}
}
return
new
HashSet
<
ParameterSymbol
>()
;
...
...
@@ -288,9 +287,31 @@ public class UnrollSymbol extends CommonScopeSpanningSymbol {
for
(
ArgumentSymbol
argument
:
getArguments
()){
args
.
add
(
argument
.
preResolveDeepCopy
());
}
copy
.
setDeclaration
(
getDeclaration
());
List
<
ParameterSymbol
>
parameterCopies
=
new
ArrayList
<>(
getDeclaration
().
getParameters
().
size
());
for
(
ParameterSymbol
parameter
:
getDeclaration
().
getParameters
()){
ParameterSymbol
parameterCopy
=
parameter
.
deepCopy
();
parameterCopies
.
add
(
parameterCopy
);
parameterCopy
.
putInScope
(
copy
.
getSpannedScope
());
}
copy
.
getDeclaration
().
setParameters
(
parameterCopies
);
copy
.
setArguments
(
args
);
copy
.
setTimeParameter
(
getTimeParameter
().
deepCopy
());
//System.err.println("t2: " + this.getIntValue(AllPredefinedLayers.BEAMSEARCH_T_NAME));
// TODO: currently only the defaultValue for t is used, make it use the assigned value instead
((
ParameterSymbol
)((
ArrayList
<
Symbol
>)
getSpannedScope
().
getLocalSymbols
().
get
(
"t"
)).
get
(
0
)).
getExpression
().
setValue
(
this
.
getIntValue
(
AllPredefinedLayers
.
BEAMSEARCH_T_NAME
));
System
.
err
.
println
(
"t_value: "
+
((
ParameterSymbol
)((
ArrayList
<
Symbol
>)
getSpannedScope
().
getLocalSymbols
().
get
(
"t"
)).
get
(
0
)).
getValue
().
get
().
toString
());
copy
.
getTimeParameter
().
putInScope
(
getSpannedScope
());
copy
.
setBody
(
getBody
().
preResolveDeepCopy
());
copy
.
getBody
().
putInScope
(
copy
.
getSpannedScope
());
//TODO: Find a nicer way to put the timeParameter into the unroll elements' scope
for
(
ArchitectureElementSymbol
element:
copy
.
getBody
().
getElements
()){
element
.
getSpannedScope
().
add
(
copy
.
getTimeParameter
());
}
return
copy
;
}
...
...
src/main/java/de/monticore/lang/monticar/cnnarch/predefined/BeamSearchStart.java
View file @
61dc6ff8
...
...
@@ -107,6 +107,7 @@ public class BeamSearchStart extends PredefinedUnrollDeclaration {
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
BEAMSEARCH_T_NAME
)
.
constraints
(
Constraints
.
INTEGER
,
Constraints
.
NON_NEGATIVE
)
.
defaultValue
(
0
)
.
build
(),
new
ParameterSymbol
.
Builder
()
.
name
(
AllPredefinedLayers
.
BEAMSEARCH_WIDTH_NAME
)
...
...
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