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
afb3db82
Commit
afb3db82
authored
Aug 17, 2019
by
Sebastian Nickels
Browse files
Allow outputs to be used as inputs
parent
e42bc2ad
Pipeline
#172953
failed with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/cnnarch/_symboltable/VariableSymbol.java
View file @
afb3db82
...
...
@@ -342,7 +342,8 @@ public class VariableSymbol extends ArchitectureElementSymbol {
public
List
<
ArchTypeSymbol
>
computeOutputTypes
()
{
if
(
isAtomic
())
{
if
(
getType
()
==
Type
.
IO
)
{
if
(
isInput
())
{
// Allow inputs and outputs to be used as input
if
(
isInput
()
||
getOutputElement
().
isPresent
())
{
return
Collections
.
singletonList
(((
IODeclarationSymbol
)
getDeclaration
()).
getType
());
}
else
{
...
...
@@ -387,9 +388,12 @@ public class VariableSymbol extends ArchitectureElementSymbol {
}
if
(
getInputTypes
().
size
()
!=
1
)
{
// Allow no input when output is used as input
if
(!(
getInputTypes
().
size
()
==
0
&&
getOutputElement
().
isPresent
()))
{
Log
.
error
(
"0"
+
ErrorCodes
.
INVALID_ELEMENT_INPUT_SHAPE
+
" Invalid number of input streams. "
+
"The number of input streams for the output '"
+
name
+
"' is "
+
getInputTypes
().
size
()
+
"."
,
getSourcePosition
());
}
}
else
{
ASTElementType
inputType
=
getInputTypes
().
get
(
0
).
getDomain
();
ASTElementType
outputType
=
ioDeclaration
.
getType
().
getDomain
();
...
...
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