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
EmbeddedMontiArc
Commits
2762c4cd
Commit
2762c4cd
authored
Aug 29, 2020
by
Malte Heithoff
Browse files
Take only streams that matches file structure
parent
6b5607b0
Pipeline
#325163
failed with stage
in 24 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/embeddedmontiarc/embeddedmontiarc/StreamScanner.java
View file @
2762c4cd
...
...
@@ -3,8 +3,11 @@ package de.monticore.lang.embeddedmontiarc.embeddedmontiarc;
import
de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol
;
import
de.monticore.lang.monticar.stream._symboltable.StreamLanguage
;
import
de.monticore.lang.monticar.streamunits._ast.ASTStreamUnitsCompilationUnit
;
import
de.monticore.lang.monticar.streamunits._parser.StreamUnitsParser
;
import
de.monticore.lang.monticar.streamunits._symboltable.ComponentStreamUnitsSymbol
;
import
de.monticore.symboltable.Scope
;
import
de.se_rwth.commons.Joiners
;
import
de.se_rwth.commons.Names
;
import
de.se_rwth.commons.logging.Log
;
...
...
@@ -15,13 +18,7 @@ import java.nio.file.Files;
import
java.nio.file.Path
;
import
java.nio.file.SimpleFileVisitor
;
import
java.nio.file.attribute.BasicFileAttributes
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.*
;
public
final
class
StreamScanner
{
...
...
@@ -67,11 +64,22 @@ public final class StreamScanner {
}
Path
relativePath
=
scanner
.
basePath
.
relativize
(
file
);
String
streamModelName
=
getStreamModelName
(
relativePath
);
ComponentStreamUnitsSymbol
s
=
scanner
.
symTab
.<
ComponentStreamUnitsSymbol
>
resolve
(
streamModelName
,
ComponentStreamUnitsSymbol
.
KIND
).
orElse
(
null
);
if
(
s
!=
null
)
{
processComponentStreamUnitsSymbol
(
s
,
f
);
Optional
<
ASTStreamUnitsCompilationUnit
>
ast
=
new
StreamUnitsParser
().
parse
(
f
.
getAbsolutePath
());
if
(
ast
.
isPresent
())
{
String
packageName
=
Joiners
.
DOT
.
join
(
ast
.
get
().
getPackageList
());
if
(
getStreamModelName
(
relativePath
.
getParent
()).
equals
(
packageName
)){
ComponentStreamUnitsSymbol
s
=
scanner
.
symTab
.<
ComponentStreamUnitsSymbol
>
resolve
(
streamModelName
,
ComponentStreamUnitsSymbol
.
KIND
).
orElse
(
null
);
if
(
s
!=
null
)
{
processComponentStreamUnitsSymbol
(
s
,
f
);
}
else
{
Log
.
warn
(
"could not resolve stream model defined in file "
+
f
.
getAbsolutePath
());
}
}
else
{
Log
.
warn
(
"package structure does not match file structure in file "
+
f
.
getAbsolutePath
());
}
}
else
{
Log
.
warn
(
"could not
resolv
e stream model defined in file "
+
f
.
getAbsolutePath
());
Log
.
warn
(
"could not
pars
e stream model defined in file "
+
f
.
getAbsolutePath
());
}
return
FileVisitResult
.
CONTINUE
;
}
...
...
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