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
Tagging
Commits
c74789fc
Commit
c74789fc
authored
Jun 12, 2018
by
Christoph Richter
Browse files
Upgraded to MontiCore 5.0.0
parent
82306716
Pipeline
#55142
passed with stage
in 1 minute and 2 seconds
Changes
33
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
c74789fc
...
...
@@ -34,7 +34,7 @@
<properties>
<!-- .. SE-Libraries .................................................. -->
<monticore.version>
4.5.4.08.11.2017
</monticore.version>
<monticore.version>
5.0.0
</monticore.version>
<se-commons.version>
1.7.7
</se-commons.version>
<mc.grammars.assembly.version>
0.0.6-SNAPSHOT
</mc.grammars.assembly.version>
...
...
@@ -45,7 +45,7 @@
<jscience.version>
4.3.1
</jscience.version>
<!-- .. Plugins ....................................................... -->
<monticore.plugin>
4.5.3-SNAPSHOT
</monticore.plugin>
<monticore.plugin>
5.0.0
</monticore.plugin>
<assembly.plugin>
2.5.4
</assembly.plugin>
<compiler.plugin>
3.3
</compiler.plugin>
<source.plugin>
2.4
</source.plugin>
...
...
src/main/grammars/de/monticore/lang/Tagging.mc4
View file @
c74789fc
...
...
@@ -37,9 +37,9 @@ grammar Tagging extends de.monticore.common.Common {
method
public
String
toString
(){
String
arrayPart
=
""
;
arrayPart
+=
start
.
isPresent
()
?
""
+
start
.
get
().
getValue
()
:
""
;
arrayPart
+=
step
.
isPresent
()
?
":"
+
step
.
get
().
getValue
()
:
""
;
arrayPart
+=
end
.
isPresent
()
?
":"
+
end
.
get
().
getValue
()
:
""
;
arrayPart
+=
getStartOpt
()
.
isPresent
()
?
""
+
getStartOpt
()
.
get
().
getValue
()
:
""
;
arrayPart
+=
getStepOpt
()
.
isPresent
()
?
":"
+
getStepOpt
()
.
get
().
getValue
()
:
""
;
arrayPart
+=
getEndOpt
()
.
isPresent
()
?
":"
+
getEndOpt
()
.
get
().
getValue
()
:
""
;
return
name
+
(
arrayPart
.
equals
(
""
)
?
""
:
"["
+
arrayPart
+
"]"
);
};
...
...
@@ -47,7 +47,7 @@ grammar Tagging extends de.monticore.common.Common {
QualifiedNameWithArray
=
parts
:(
NameWithArray
||
"."
)+;
ast
QualifiedNameWithArray
=
method
public
String
toString
(){
return
de
.
se_rwth
.
commons
.
Joiners
.
DOT
.
join
(
getParts
());
return
de
.
se_rwth
.
commons
.
Joiners
.
DOT
.
join
(
getParts
List
());
};
...
...
src/main/java/de/monticore/lang/tagging/_ast/ASTTagElement.java
View file @
c74789fc
...
...
@@ -20,8 +20,11 @@
*/
package
de.monticore.lang.tagging._ast
;
import
java.util.Optional
;
public
class
ASTTagElement
extends
ASTTagElementTOP
{
protected
ASTTagElement
(
String
name
,
String
tagValue
)
{
protected
ASTTagElement
(
String
name
,
Optional
<
String
>
tagValue
)
{
super
(
name
,
tagValue
);
}
...
...
src/main/java/de/monticore/lang/tagging/_symboltable/TaggingResolver.java
View file @
c74789fc
...
...
@@ -222,11 +222,6 @@ public class TaggingResolver implements Scope {
return
globalScope
.
resolveLocally
(
symbolKind
);
}
@Override
public
Optional
<?
extends
Symbol
>
resolve
(
SymbolPredicate
symbolPredicate
)
{
return
globalScope
.
resolve
(
symbolPredicate
);
}
@Override
public
<
T
extends
Symbol
>
Optional
<
T
>
resolveDown
(
String
s
,
SymbolKind
symbolKind
)
{
return
globalScope
.
resolveDown
(
s
,
symbolKind
);
...
...
@@ -262,12 +257,6 @@ public class TaggingResolver implements Scope {
return
globalScope
.
getLocalSymbols
();
}
/** @deprecated */
@Override
public
Map
<
String
,
Collection
<
Symbol
>>
getSymbols
()
{
return
globalScope
.
getSymbols
();
}
@Override
public
int
getSymbolsSize
()
{
return
globalScope
.
getSymbolsSize
();
...
...
src/main/java/de/monticore/lang/tagging/generator/TagSchemaGenerator.java
View file @
c74789fc
...
...
@@ -101,8 +101,8 @@ public class TagSchemaGenerator extends GeneratorEngine {
String
.
format
(
"Could not load tagschema '%s'"
,
tagSchemaLocation
.
toString
()));
List
<
String
>
tagTypeNames
=
new
ArrayList
<>();
String
packageName
=
Joiners
.
DOT
.
join
(
tagSchemaUnit
.
getPackage
());
List
<
ASTTagType
>
tagTypes
=
tagSchemaUnit
.
getTagType
s
();
String
packageName
=
Joiners
.
DOT
.
join
(
tagSchemaUnit
.
getPackage
List
());
List
<
ASTTagType
>
tagTypes
=
tagSchemaUnit
.
getTagType
List
();
for
(
ASTTagType
tagType
:
tagTypes
)
{
generateTagType
(
tagType
,
tagSchemaUnit
,
packageName
,
symbolScopeMap
);
tagTypeNames
.
add
(
tagType
.
getName
());
...
...
@@ -129,18 +129,18 @@ public class TagSchemaGenerator extends GeneratorEngine {
protected
void
generateValuedTagType
(
ASTValuedTagType
valuedTagType
,
ASTTagSchemaUnit
tagSchemaUnit
,
String
packageName
,
Map
<
String
,
String
>
symbolScopeMap
)
{
String
dataType
=
null
;
boolean
isUnit
=
false
;
if
(
valuedTagType
.
getBoolean
().
isPresent
())
{
if
(
valuedTagType
.
getBoolean
Opt
().
isPresent
())
{
dataType
=
"Boolean"
;
}
else
if
(
valuedTagType
.
getNumber
().
isPresent
())
{
else
if
(
valuedTagType
.
getNumber
Opt
().
isPresent
())
{
dataType
=
"Number"
;
}
else
if
(
valuedTagType
.
getString
().
isPresent
())
{
else
if
(
valuedTagType
.
getString
Opt
().
isPresent
())
{
dataType
=
"String"
;
}
else
if
(
valuedTagType
.
getUnitKind
().
isPresent
())
{
else
if
(
valuedTagType
.
getUnitKind
Opt
().
isPresent
())
{
isUnit
=
true
;
dataType
=
valuedTagType
.
getUnitKind
().
get
();
dataType
=
valuedTagType
.
getUnitKind
Opt
().
get
();
if
(!
UnitKinds
.
contains
(
dataType
))
{
Log
.
error
(
String
.
format
(
"Unit kind '%s' is not supported. Currently the following unit kinds are available '%s'"
,
dataType
,
UnitKinds
.
available
()),
valuedTagType
.
get_SourcePositionStart
());
...
...
@@ -152,7 +152,7 @@ public class TagSchemaGenerator extends GeneratorEngine {
Paths
.
get
(
createPackagePath
(
packageName
).
toString
(),
tagSchemaUnit
.
getName
(),
valuedTagType
.
getName
()
+
"Symbol.java"
),
tagSchemaUnit
,
packageName
,
tagSchemaUnit
.
getName
(),
valuedTagType
.
getName
(),
dataType
,
isUnit
);
String
importSymbols
=
"de.monticore.lang.montiarc._symboltable.*"
;
String
scopeSymbol
=
valuedTagType
.
getScope
().
get
().
getScopeIdentifier
s
().
get
(
0
).
getScopeName
();
String
scopeSymbol
=
valuedTagType
.
getScope
Opt
().
get
().
getScopeIdentifier
List
().
get
(
0
).
getScopeName
();
String
nameScopeType
=
Log
.
errorIfNull
(
symbolScopeMap
.
get
(
scopeSymbol
),
String
.
format
(
"For the scope symbol '%s' is no scope type defined."
,
scopeSymbol
));
generate
(
"templates.de.monticore.lang.tagschema.ValuedTagTypeCreator"
,
Paths
.
get
(
createPackagePath
(
packageName
).
toString
(),
tagSchemaUnit
.
getName
(),
valuedTagType
.
getName
()
+
"SymbolCreator.java"
),
...
...
@@ -174,7 +174,7 @@ public class TagSchemaGenerator extends GeneratorEngine {
Paths
.
get
(
createPackagePath
(
packageName
).
toString
(),
tagSchemaUnit
.
getName
(),
simpleTagType
.
getName
()
+
"Symbol.java"
),
tagSchemaUnit
,
packageName
,
tagSchemaUnit
.
getName
(),
simpleTagType
.
getName
());
String
importSymbols
=
"de.monticore.lang.montiarc._symboltable.*"
;
String
scopeSymbol
=
simpleTagType
.
getScope
().
get
().
getScopeIdentifier
s
().
get
(
0
).
getScopeName
();
String
scopeSymbol
=
simpleTagType
.
getScope
Opt
().
get
().
getScopeIdentifier
List
().
get
(
0
).
getScopeName
();
String
nameScopeType
=
Log
.
errorIfNull
(
symbolScopeMap
.
get
(
scopeSymbol
),
String
.
format
(
"For the scope symbol '%s' is no scope type defined."
,
scopeSymbol
));
generate
(
"templates.de.monticore.lang.tagschema.SimpleTagTypeCreator"
,
Paths
.
get
(
createPackagePath
(
packageName
).
toString
(),
tagSchemaUnit
.
getName
(),
simpleTagType
.
getName
()
+
"SymbolCreator.java"
),
...
...
src/main/java/de/monticore/lang/tagging/helper/RangeFixer.java
View file @
c74789fc
...
...
@@ -22,7 +22,6 @@ package de.monticore.lang.tagging.helper;
import
com.google.common.collect.Lists
;
import
de.monticore.lang.tagging._ast.*
;
import
de.monticore.literals.literals._ast.ASTIntLiteral
;
import
java.util.ArrayList
;
import
java.util.Collection
;
...
...
@@ -36,14 +35,14 @@ public class RangeFixer {
public
static
void
fixTaggingUnit
(
ASTTaggingUnit
astTaggingUnit
)
{
//Replace all range syntax scopes with expanded versions
astTaggingUnit
.
getTagBody
().
getTag
s
()
astTaggingUnit
.
getTagBody
().
getTag
List
()
.
forEach
(
tag
->
{
List
<
ASTScope
>
fixedScopes
=
tag
.
getScope
s
().
stream
()
List
<
ASTScope
>
fixedScopes
=
tag
.
getScope
List
().
stream
()
.
map
(
RangeFixer:
:
expandScopeWithRange
)
.
flatMap
(
Collection:
:
stream
)
.
collect
(
Collectors
.
toList
());
tag
.
setScope
s
(
fixedScopes
);
tag
.
setScope
List
(
fixedScopes
);
});
}
...
...
@@ -52,22 +51,22 @@ public class RangeFixer {
ASTNameScope
nameScope
=
(
ASTNameScope
)
scope
;
List
<
ASTQualifiedNameWithArray
>
qualifiedNames
=
new
ArrayList
<>();
//add empty start name
qualifiedNames
.
add
(
ASTQ
ualifiedNameWithArray
.
get
Builder
().
build
());
qualifiedNames
.
add
(
TaggingMill
.
q
ualifiedNameWithArrayBuilder
().
build
());
for
(
ASTNameWithArray
part
:
nameScope
.
getQualifiedName
().
getParts
())
{
for
(
ASTNameWithArray
part
:
nameScope
.
getQualifiedName
().
getParts
List
())
{
List
<
ASTNameWithArray
>
expandedParts
=
expandRangeInPart
(
part
);
List
<
ASTQualifiedNameWithArray
>
expandedNames
=
new
ArrayList
<>();
for
(
ASTNameWithArray
ep
:
expandedParts
)
{
for
(
ASTQualifiedNameWithArray
name
:
qualifiedNames
)
{
ASTQualifiedNameWithArray
tmpName
=
name
.
deepClone
();
tmpName
.
getParts
().
add
(
ep
);
tmpName
.
getParts
List
().
add
(
ep
);
expandedNames
.
add
(
tmpName
);
}
}
qualifiedNames
=
expandedNames
;
}
return
qualifiedNames
.
stream
().
map
(
name
->
ASTN
ameScope
.
get
Builder
().
q
ualifiedName
(
name
).
build
()).
collect
(
Collectors
.
toList
());
return
qualifiedNames
.
stream
().
map
(
name
->
TaggingMill
.
n
ameScopeBuilder
().
setQ
ualifiedName
(
name
).
build
()).
collect
(
Collectors
.
toList
());
}
else
{
return
Lists
.
newArrayList
(
scope
);
...
...
@@ -76,20 +75,20 @@ public class RangeFixer {
public
static
List
<
ASTNameWithArray
>
expandRangeInPart
(
ASTNameWithArray
part
)
{
//Not a range
if
(!
part
.
getStart
().
isPresent
()
||
!
part
.
getEnd
().
isPresent
())
{
if
(!
part
.
getStart
Opt
().
isPresent
()
||
!
part
.
getEnd
Opt
().
isPresent
())
{
return
Lists
.
newArrayList
(
part
);
}
List
<
ASTNameWithArray
>
result
=
new
ArrayList
<>();
int
step
=
part
.
getStep
().
isPresent
()
?
part
.
getStep
().
get
().
getValue
()
:
1
;
int
start
=
part
.
getStart
().
get
().
getValue
();
int
end
=
part
.
getEnd
().
get
().
getValue
();
int
step
=
part
.
getStep
Opt
().
isPresent
()
?
part
.
getStep
Opt
().
get
().
getValue
()
:
1
;
int
start
=
part
.
getStart
Opt
().
get
().
getValue
();
int
end
=
part
.
getEnd
Opt
().
get
().
getValue
();
for
(
int
i
=
start
;
i
<=
end
;
i
+=
step
)
{
ASTNameWithArray
tmpNameWithArray
=
ASTN
ameWithArray
.
get
Builder
()
.
n
ame
(
part
.
getName
())
.
start
(
ASTI
ntLiteral
.
get
Builder
().
source
(
""
+
i
).
build
())
ASTNameWithArray
tmpNameWithArray
=
TaggingMill
.
n
ameWithArrayBuilder
()
.
setN
ame
(
part
.
getName
())
.
s
etS
tart
(
TaggingMill
.
i
ntLiteralBuilder
().
s
etS
ource
(
""
+
i
).
build
())
.
build
();
result
.
add
(
tmpNameWithArray
);
}
...
...
src/main/java/de/monticore/lang/tagschema/_ast/ASTComplexTagType.java
View file @
c74789fc
...
...
@@ -20,6 +20,8 @@
*/
package
de.monticore.lang.tagschema._ast
;
import
java.util.Optional
;
/**
* Created by MichaelvonWenckstern on 28.06.2016.
*/
...
...
@@ -28,8 +30,8 @@ public class ASTComplexTagType extends ASTComplexTagTypeTOP {
super
();
}
public
ASTComplexTagType
(
String
name
,
ASTScope
scope
,
String
complexTag
Def
)
{
super
(
name
,
scope
,
complexTag
Def
);
public
ASTComplexTagType
(
String
name
,
Optional
<
ASTScope
>
scope
,
String
complexTag
)
{
super
(
name
,
scope
,
complexTag
);
}
public
void
setComplexTag
(
String
complexTag
)
{
...
...
src/main/java/de/monticore/lang/tagschema/_ast/ASTEnumeratedTagType.java
View file @
c74789fc
...
...
@@ -20,44 +20,44 @@
*/
package
de.monticore.lang.tagschema._ast
;
import
java.util.ArrayList
;
import
java.util.LinkedHashSet
;
import
java.util.
List
;
import
java.util.
Optional
;
import
java.util.Set
;
/**
* Created by MichaelvonWenckstern on 15.06.2016.
*/
public
class
ASTEnumeratedTagType
extends
ASTEnumeratedTagTypeTOP
{
protected
ASTEnumeratedTagType
()
{
super
();
}
protected
ASTEnumeratedTagType
()
{
super
();
}
protected
Set
<
String
>
enumValues
=
new
LinkedHashSet
<>();
protected
Set
<
String
>
enumValues
=
new
LinkedHashSet
<>();
protected
ASTEnumeratedTagType
(
String
name
,
String
enumText
,
ASTScope
scope
)
{
super
(
name
,
enumText
,
scope
);
}
protected
ASTEnumeratedTagType
(
String
name
,
String
enumText
,
Optional
<
ASTScope
>
scope
)
{
super
(
name
,
enumText
,
scope
);
this
.
enumValues
=
enumValues
;
}
public
void
setEnumText
(
String
enumText
)
{
if
(
enumText
!=
null
)
{
if
(
enumText
.
startsWith
(
"["
))
{
enumText
=
enumText
.
substring
(
1
);
}
if
(
enumText
.
endsWith
(
"]"
))
{
enumText
=
enumText
.
substring
(
0
,
enumText
.
length
()
-
1
);
}
enumText
=
enumText
.
trim
();
// TODO fix: now it also splits BC and D in A | "BC|D" | X
String
vs
[]
=
enumText
.
split
(
"\\|"
);
for
(
String
v
:
vs
)
{
enumValues
.
add
(
v
.
trim
());
}
public
void
setEnumText
(
String
enumText
)
{
if
(
enumText
!=
null
)
{
if
(
enumText
.
startsWith
(
"["
))
{
enumText
=
enumText
.
substring
(
1
);
}
if
(
enumText
.
endsWith
(
"]"
))
{
enumText
=
enumText
.
substring
(
0
,
enumText
.
length
()
-
1
);
}
enumText
=
enumText
.
trim
();
// TODO fix: now it also splits BC and D in A | "BC|D" | X
String
vs
[]
=
enumText
.
split
(
"\\|"
);
for
(
String
v
:
vs
)
{
enumValues
.
add
(
v
.
trim
());
}
}
super
.
setEnumText
(
enumText
);
}
super
.
setEnumText
(
enumText
);
}
public
Set
<
String
>
getEnumValues
()
{
return
enumValues
;
}
public
Set
<
String
>
getEnumValues
()
{
return
enumValues
;
}
}
src/main/resources/templates/de/monticore/lang/tagschema/ComplexTagTypeCreator.ftl
View file @
c74789fc
...
...
@@ -55,14 +55,14 @@ public class ${tagTypeName}SymbolCreator implements TagSymbolCreator {
.getQualifiedName
()
.toString
())
:
packageName
;
for
(
ASTT
ag
element
:
unit
.getTagBody
()
.getTag
s
())
{
for
(
ASTT
ag
element
:
unit
.getTagBody
()
.getTag
List
())
{
element
.getTagElements
()
.stream
()
.filter
(
t
->
t
.getName
()
.equals
(
"${tagTypeName}"
))
.filter
(
t
->
!
t
.getTagValue
()
.isPresent
())
.map
(
t
->
matchRegexPattern
(
t
.getTagValue
()
.get
()))
.filter
(
r
->
r
!=
null
)
.forEachOrdered
(
m
->
element
.getScope
s
()
.stream
()
element
.getScope
List
()
.stream
()
.filter
(
this
::
checkScope
)
.map
(
s
->
(
ASTN
ameScope
)
s
)
.map
(
s
->
getGlobalScope
(
gs
)
.<$
{
scopeSymbol
}
>
resolveDown
(
...
...
src/main/resources/templates/de/monticore/lang/tagschema/SimpleTagTypeCreator.ftl
View file @
c74789fc
...
...
@@ -45,12 +45,12 @@ public class ${tagTypeName}SymbolCreator implements TagSymbolCreator {
.getQualifiedName
()
.toString
())
:
packageName
;
for
(
ASTT
ag
element
:
unit
.getTagBody
()
.getTag
s
())
{
for
(
ASTT
ag
element
:
unit
.getTagBody
()
.getTag
List
())
{
element
.getTagElements
()
.stream
()
.filter
(
t
->
t
.getName
()
.equals
(
"${tagTypeName}"
))
.filter
(
t
->
!
t
.getTagValue
()
.isPresent
())
//
only
marker
tag
with
no
value
.forEachOrdered
(
t
->
element
.getScope
s
()
.stream
()
element
.getScope
List
()
.stream
()
.filter
(
this
::
checkScope
)
.map
(
s
->
(
ASTN
ameScope
)
s
)
.map
(
s
->
getGlobalScope
(
gs
)
.<
S
ymbol
>
resolveDownMany
(
...
...
src/main/resources/templates/de/monticore/lang/tagschema/ValuedTagTypeCreator.ftl
View file @
c74789fc
...
...
@@ -62,7 +62,7 @@ public class ${tagTypeName}SymbolCreator implements TagSymbolCreator {
.getQualifiedNameString
())
:
packageName
;
for
(
ASTT
ag
element
:
unit
.getTagBody
()
.getTag
s
())
{
for
(
ASTT
ag
element
:
unit
.getTagBody
()
.getTag
List
())
{
element
.getTagElements
()
.stream
()
.filter
(
t
->
t
.getName
()
.equals
(
"${tagTypeName}"
))
.filter
(
t
->
t
.getTagValue
()
.isPresent
())
...
...
@@ -72,7 +72,7 @@ public class ${tagTypeName}SymbolCreator implements TagSymbolCreator {
.filter
(
this
::
checkUnit
)
</#
if
>
.forEachOrdered
(
v
->
element
.getScope
s
()
.stream
()
element
.getScope
List
()
.stream
()
.filter
(
this
::
checkScope
)
.map
(
s
->
(
ASTN
ameScope
)
s
)
.map
(
s
->
getGlobalScope
(
gs
)
.<
S
ymbol
>
resolveDownMany
(
...
...
src/main/resources/templates/de/monticore/lang/tagschema/ValuedTagTypeCreator2.ftl
View file @
c74789fc
...
...
@@ -97,7 +97,7 @@ public class ${tagTypeName}SymbolCreator implements TagSymbolCreator {
for
(
ASTT
agElement
element
:
unit
.getTagBody
()
.getTagElements
())
{
if
(
element
instanceof
ASTT
argetElement
)
{
((
ASTT
argetElement
)
element
)
.getTag
s
()
.stream
()
((
ASTT
argetElement
)
element
)
.getTag
List
()
.stream
()
.filter
(
t
->
t
.getName
()
.equals
(
"${tagTypeName}"
))
.filter
(
this
::
checkASTTagKind
)
.map
(
t
->
(
ASTV
aluedTag
)
t
)
...
...
@@ -113,7 +113,7 @@ public class ${tagTypeName}SymbolCreator implements TagSymbolCreator {
.map
(
v
->
(
ASTN
umericTagValue
)
v
.getTagValue
())
</#
if
>
.forEachOrdered
(
v
->
((
ASTT
argetElement
)
element
)
.getScope
s
()
.stream
()
((
ASTT
argetElement
)
element
)
.getScope
List
()
.stream
()
.filter
(
this
::
checkScope
)
.map
(
s
->
(
ASTN
ameScope
)
s
)
.map
(
s
->
getGlobalScope
(
gs
)
.<$
{
scopeSymbol
}
>
resolveDown
(
...
...
src/test/java/de/monticore/lang/tagging/ParserTagValueTest.java
View file @
c74789fc
...
...
@@ -65,10 +65,10 @@ public class ParserTagValueTest {
// public void testTags() throws Exception {
// TagsParser parser = new TagsParser();
// ASTTags tags = parser.parse("C:\\Users\\MichaelvonWenckstern\\Documents\\MontiArc4\\01.code\\tagging\\src\\test\\resources\\windTurbine\\PowerConsumptionTags.tag").get();
// System.out.println(tags.getTag
s
().size());
// tags.getTag
s
().stream().filter(t -> t.getTagValue().isPresent())
// System.out.println(tags.getTag
List
().size());
// tags.getTag
List
().stream().filter(t -> t.getTagValue().isPresent())
// .forEachOrdered(t -> System.out.println(t.getTagValue().get()));
//// System.out.println(tags.getTag
s
().get(0).getTagValue().length());
//// System.out.println(tags.getTag
List
().get(0).getTagValue().length());
// }
/* @Ignore
...
...
@@ -76,8 +76,8 @@ public class ParserTagValueTest {
public void testTagschema2() throws Exception {
TaggingParser parser = new TaggingParser();
ASTTaggingUnit tags = parser.parse("C:\\Users\\MichaelvonWenckstern\\Documents\\MontiArc4\\01.code\\tagging\\src\\test\\resources\\windTurbine\\PowerConsumption.tag").get();
tags.getTagBody().getTag
s
().forEach(t -> t.getTagElements().forEach(e -> System.out.println(e.getName() + ": " + e.getTagValue().orElse(""))));
// System.out.println(tags.getTag
s
().size());
// System.out.println(tags.getTag
s
().get(0).getTagValue().length());
tags.getTagBody().getTag
List
().forEach(t -> t.getTagElements().forEach(e -> System.out.println(e.getName() + ": " + e.getTagValue().orElse(""))));
// System.out.println(tags.getTag
List
().size());
// System.out.println(tags.getTag
List
().get(0).getTagValue().length());
}*/
}
src/test/resources/de/monticore/lang/montiarc/tag/drawing/IsTraceableSymbolCreator.java
View file @
c74789fc
...
...
@@ -43,12 +43,12 @@ public class IsTraceableSymbolCreator implements TagSymbolCreator {
.
getQualifiedName
().
toString
())
:
packageName
;
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTag
s
())
{
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTag
List
())
{
element
.
getTagElements
().
stream
()
.
filter
(
t
->
t
.
getName
().
equals
(
"IsTraceable"
))
.
filter
(
t
->
!
t
.
getTagValue
().
isPresent
())
// only marker tag with no value
.
forEachOrdered
(
t
->
element
.
getScope
s
().
stream
()
element
.
getScope
List
().
stream
()
.
filter
(
this
::
checkScope
)
.
map
(
s
->
(
ASTNameScope
)
s
)
.
map
(
s
->
getGlobalScope
(
gs
).<
ComponentSymbol
>
resolveDown
(
...
...
src/test/resources/de/monticore/lang/montiarc/tag/drawing/TraceabilityTagSchema/IsTraceableSymbolCreator.java
View file @
c74789fc
...
...
@@ -46,12 +46,12 @@ public class IsTraceableSymbolCreator implements TagSymbolCreator {
.
getQualifiedName
().
toString
())
:
packageName
;
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTag
s
())
{
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTag
List
())
{
element
.
getTagElements
().
stream
()
.
filter
(
t
->
t
.
getName
().
equals
(
"IsTraceable"
))
.
filter
(
t
->
!
t
.
getTagValue
().
isPresent
())
// only marker tag with no value
.
forEachOrdered
(
t
->
element
.
getScope
s
().
stream
()
element
.
getScope
List
().
stream
()
.
filter
(
this
::
checkScope
)
.
map
(
s
->
(
ASTNameScope
)
s
)
.
map
(
s
->
getGlobalScope
(
gs
).<
Symbol
>
resolveDownMany
(
...
...
src/test/resources/de/monticore/lang/montiarc/tag/drawing/TraceabilityTagSchema/TraceableSymbolCreator.java
View file @
c74789fc
...
...
@@ -46,12 +46,12 @@ public class TraceableSymbolCreator implements TagSymbolCreator {
.
getQualifiedName
().
toString
())
:
packageName
;
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTag
s
())
{
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTag
List
())
{
element
.
getTagElements
().
stream
()
.
filter
(
t
->
t
.
getName
().
equals
(
"Traceable"
))
.
filter
(
t
->
!
t
.
getTagValue
().
isPresent
())
// only marker tag with no value
.
forEachOrdered
(
t
->
element
.
getScope
s
().
stream
()
element
.
getScope
List
().
stream
()
.
filter
(
this
::
checkScope
)
.
map
(
s
->
(
ASTNameScope
)
s
)
.
map
(
s
->
getGlobalScope
(
gs
).<
Symbol
>
resolveDownMany
(
...
...
src/test/resources/de/monticore/lang/montiarc/tag/drawing/TraceableSymbolCreator.java
View file @
c74789fc
...
...
@@ -43,12 +43,12 @@ public class TraceableSymbolCreator implements TagSymbolCreator {
.
getQualifiedName
().
toString
())
:
packageName
;
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTag
s
())
{
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTag
List
())
{
element
.
getTagElements
().
stream
()
.
filter
(
t
->
t
.
getName
().
equals
(
"Traceable"
))
.
filter
(
t
->
!
t
.
getTagValue
().
isPresent
())
// only marker tag with no value
.
forEachOrdered
(
t
->
element
.
getScope
s
().
stream
()
element
.
getScope
List
().
stream
()
.
filter
(
this
::
checkScope
)
.
map
(
s
->
(
ASTNameScope
)
s
)
.
map
(
s
->
getGlobalScope
(
gs
).<
ExpandedComponentInstanceSymbol
>
resolveDown
(
...
...
src/test/resources/generator/nfp/CompPower/CompPowerInstSymbolCreator.java
View file @
c74789fc
...
...
@@ -54,7 +54,7 @@ public class CompPowerInstSymbolCreator implements TagSymbolCreator {
.
getQualifiedNameString
())
:
packageName
;
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTag
s
())
{
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTag
List
())
{
element
.
getTagElements
().
stream
()
.
filter
(
t
->
t
.
getName
().
equals
(
"CompPowerInst"
))
.
filter
(
t
->
t
.
getTagValue
().
isPresent
())
...
...
@@ -62,7 +62,7 @@ public class CompPowerInstSymbolCreator implements TagSymbolCreator {
.
filter
(
v
->
v
!=
null
)
.
filter
(
this
::
checkUnit
)
.
forEachOrdered
(
v
->
element
.
getScope
s
().
stream
()
element
.
getScope
List
().
stream
()
.
filter
(
this
::
checkScope
)
.
map
(
s
->
(
ASTNameScope
)
s
)
.
map
(
s
->
getGlobalScope
(
gs
).<
Symbol
>
resolveDownMany
(
...
...
src/test/resources/generator/nfp/CompPower/CompPowerSymbolCreator.java
View file @
c74789fc
...
...
@@ -54,7 +54,7 @@ public class CompPowerSymbolCreator implements TagSymbolCreator {
.
getQualifiedNameString
())
:
packageName
;
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTag
s
())
{
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTag
List
())
{
element
.
getTagElements
().
stream
()
.
filter
(
t
->
t
.
getName
().
equals
(
"CompPower"
))
.
filter
(
t
->
t
.
getTagValue
().
isPresent
())
...
...
@@ -62,7 +62,7 @@ public class CompPowerSymbolCreator implements TagSymbolCreator {
.
filter
(
v
->
v
!=
null
)
.
filter
(
this
::
checkUnit
)
.
forEachOrdered
(
v
->
element
.
getScope
s
().
stream
()
element
.
getScope
List
().
stream
()
.
filter
(
this
::
checkScope
)
.
map
(
s
->
(
ASTNameScope
)
s
)
.
map
(
s
->
getGlobalScope
(
gs
).<
Symbol
>
resolveDownMany
(
...
...
src/test/resources/generator/nfp/LatencyTagSchema/LatencyCmpInstSymbolCreator.java
View file @
c74789fc
...
...
@@ -54,7 +54,7 @@ public class LatencyCmpInstSymbolCreator implements TagSymbolCreator {
.
getQualifiedNameString
())
:
packageName
;
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTag
s
())
{
for
(
ASTTag
element
:
unit
.
getTagBody
().
getTag
List
())
{
element
.
getTagElements
().
stream
()
.
filter
(
t
->
t
.
getName
().
equals
(
"LatencyCmpInst"
))
.
filter
(
t
->
t
.
getTagValue
().
isPresent
())
...
...
@@ -62,7 +62,7 @@ public class LatencyCmpInstSymbolCreator implements TagSymbolCreator {
.
filter
(
v
->
v
!=
null
)
.
filter
(
this
::
checkUnit
)
.
forEachOrdered
(
v
->
element
.
getScope
s
().
stream
()
element
.
getScope
List
().
stream
()
.
filter
(
this
::
checkScope
)
.
map
(
s
->
(
ASTNameScope
)
s
)
.
map
(
s
->
getGlobalScope
(
gs
).<
Symbol
>
resolveDownMany
(
...
...
Prev
1
2
Next
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