Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
languages
EmbeddedMontiArc
Commits
9d1204f6
Commit
9d1204f6
authored
Oct 17, 2017
by
Sascha Niklas Schneiders
Browse files
continued refactoring
parent
0cd5855b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/embeddedmontiarc/helper/SymbolPrinter.java
View file @
9d1204f6
...
...
@@ -23,7 +23,7 @@ package de.monticore.lang.embeddedmontiarc.helper;
import
de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.*
;
import
de.monticore.lang.monticar.ValueSymbol
;
import
de.monticore.lang.montiarc.tagging._symboltable.IsTaggable
;
import
de.monticore.
prettyprint
.IndentPrinter
;
import
de.monticore.
lang.monticar.helper
.IndentPrinter
;
import
de.monticore.symboltable.types.JTypeSymbol
;
import
de.monticore.symboltable.types.TypeSymbol
;
import
de.monticore.symboltable.types.references.ActualTypeArgument
;
...
...
@@ -186,16 +186,7 @@ public class SymbolPrinter {
}
public
static
void
printComponent
(
ComponentSymbol
cmp
,
IndentPrinter
ip
,
boolean
skipPackageImport
)
{
if
(!
skipPackageImport
)
{
if
(
cmp
.
getPackageName
()
!=
null
&&
!
cmp
.
getPackageName
().
isEmpty
())
{
ip
.
print
(
"package "
);
ip
.
print
(
cmp
.
getPackageName
());
ip
.
println
(
";"
);
}
if
(
cmp
.
getImports
()
!=
null
)
{
cmp
.
getImports
().
stream
().
forEachOrdered
(
a
->
ip
.
println
(
"import "
+
a
.
getStatement
()
+
(
a
.
isStar
()
?
".*"
:
""
)
+
";"
));
}
}
printPackageInfo
(
cmp
,
ip
,
skipPackageImport
);
ip
.
print
(
"component "
+
cmp
.
getName
());
if
(
cmp
.
hasFormalTypeParameters
())
{
ip
.
print
(
printFormalTypeParameters
(
cmp
.
getFormalTypeParameters
()));
...
...
@@ -251,9 +242,8 @@ public class SymbolPrinter {
}
}
public
static
void
print
ExpandedComponentInstance
(
Expanded
Component
Instance
Symbol
inst
,
IndentPrinter
ip
,
boolean
skipPackageImport
)
{
public
static
void
print
PackageInfo
(
ComponentSymbol
cmp
,
IndentPrinter
ip
,
boolean
skipPackageImport
)
{
if
(!
skipPackageImport
)
{
ComponentSymbol
cmp
=
inst
.
getComponentType
().
getReferencedSymbol
();
if
(
cmp
.
getPackageName
()
!=
null
&&
!
cmp
.
getPackageName
().
isEmpty
())
{
ip
.
print
(
"package "
);
...
...
@@ -264,6 +254,10 @@ public class SymbolPrinter {
cmp
.
getImports
().
stream
().
forEachOrdered
(
a
->
ip
.
println
(
"import "
+
a
.
getStatement
()
+
(
a
.
isStar
()
?
".*"
:
""
)
+
";"
));
}
}
}
public
static
void
printExpandedComponentInstance
(
ExpandedComponentInstanceSymbol
inst
,
IndentPrinter
ip
,
boolean
skipPackageImport
)
{
printPackageInfo
(
inst
.
getComponentType
().
getReferencedSymbol
(),
ip
,
skipPackageImport
);
ip
.
print
(
"component /*instance*/ "
+
inst
.
getName
());
ip
.
println
(
" {"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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