Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
monticore
EmbeddedMontiArc
languages
Tagging
Commits
89c2b073
Commit
89c2b073
authored
Dec 03, 2019
by
Sascha Niklas Schneiders
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated to MC 6.0.0
parent
a323ab76
Pipeline
#214392
failed with stage
in 4 minutes and 27 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
23 deletions
+22
-23
pom.xml
pom.xml
+2
-2
src/main/grammars/de/monticore/lang/Tagging.mc4
src/main/grammars/de/monticore/lang/Tagging.mc4
+5
-6
src/main/java/de/monticore/lang/tagging/_symboltable/TagResolver.java
...a/de/monticore/lang/tagging/_symboltable/TagResolver.java
+2
-2
src/main/java/de/monticore/lang/tagging/_symboltable/TaggingSymbolTableCreator.java
.../lang/tagging/_symboltable/TaggingSymbolTableCreator.java
+1
-1
src/main/java/de/monticore/lang/tagging/generator/TagSchemaGenerator.java
.../monticore/lang/tagging/generator/TagSchemaGenerator.java
+8
-8
src/main/java/de/monticore/lang/tagging/helper/RangeFixer.java
...ain/java/de/monticore/lang/tagging/helper/RangeFixer.java
+4
-4
No files found.
pom.xml
View file @
89c2b073
...
...
@@ -34,7 +34,7 @@
<properties>
<Common-MontiCar.version>
0.1.0-SNAPSHOT
</Common-MontiCar.version>
<!-- .. SE-Libraries .................................................. -->
<monticore.version>
5.3
.0
</monticore.version>
<monticore.version>
6.0
.0
</monticore.version>
<se-commons.version>
1.7.7
</se-commons.version>
<mc.grammars.assembly.version>
0.0.8
</mc.grammars.assembly.version>
...
...
@@ -45,7 +45,7 @@
<jscience.version>
4.3.1
</jscience.version>
<!-- .. Plugins ....................................................... -->
<monticore.plugin>
5.3
.0
</monticore.plugin>
<monticore.plugin>
6.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 @
89c2b073
...
...
@@ -35,13 +35,12 @@ grammar Tagging extends external1.Common0 {
NameWithArray
=
(
Name
(
"["
start
:
IntLiteral
((
":"
step
:
IntLiteral
)?
":"
end
:
IntLiteral
)?
"]"
)?);
astrule
NameWithArray
=
method
public
String
toString
(){
String
arrayPart
=
""
;
arrayPart
+=
getStartOpt
().
isPresent
()
?
""
+
getStartOpt
().
get
().
getValue
()
:
""
;
arrayPart
+=
getStepOpt
().
isPresent
()
?
"
:
"
+
getSt
epOpt
().
ge
t
().
getValue
()
:
""
;
arrayPart
+=
getEndOpt
().
isPresent
()
?
":"
+
get
EndOpt
().
get
().
getValue
()
:
""
;
return
name
+
(
arrayPart
.
equals
(
""
)
?
""
:
"["
+
arrayPart
+
"]"
);
String
arrayPart
=
""
;
arrayPart
+=
isPresent
Start
()
?
""
+
getSt
ar
t
().
getValue
()
:
""
;
arrayPart
+=
isPresent
Step
()
?
":"
+
get
Step
().
getValue
()
:
""
;
arrayPart
+=
isPresentEnd
()
?
":"
+
getEnd
().
getValue
()
:
""
;
return
name
+
(
arrayPart
.
equals
(
""
)
?
""
:
"["
+
arrayPart
+
"]"
);
};
QualifiedNameWithArray
=
parts
:(
NameWithArray
||
"."
)+;
...
...
src/main/java/de/monticore/lang/tagging/_symboltable/TagResolver.java
View file @
89c2b073
...
...
@@ -45,7 +45,7 @@ public class TagResolver {
public
void
loadTagModels
(
ITaggingGlobalScope
globalScope
,
String
...
modelPath
)
{
ArrayList
<
String
>
list
=
new
ArrayList
();
list
.
addAll
(
Arrays
.
asList
(
modelPath
));
loadTagModels
(
list
,
new
TaggingLanguage
().
getSymbolTableCreator
(
globalScope
).
taggingSTC
);
loadTagModels
(
list
,
new
TaggingLanguage
().
getSymbolTableCreator
(
globalScope
).
symbolTable
);
}
public
void
loadTagModels
(
TaggingSymbolTableCreator
taggingSymbolTableCreator
,
String
...
modelPath
)
{
...
...
@@ -55,7 +55,7 @@ public class TagResolver {
}
public
void
loadTagModels
(
Collection
<
String
>
modelPaths
,
ITaggingGlobalScope
globalScope
)
{
loadTagModels
(
modelPaths
,
new
TaggingLanguage
().
getSymbolTableCreator
(
globalScope
).
taggingSTC
);
loadTagModels
(
modelPaths
,
new
TaggingLanguage
().
getSymbolTableCreator
(
globalScope
).
symbolTable
);
}
public
void
loadTagModels
(
Collection
<
String
>
modelPaths
,
...
...
src/main/java/de/monticore/lang/tagging/_symboltable/TaggingSymbolTableCreator.java
View file @
89c2b073
...
...
@@ -78,7 +78,7 @@ public class TaggingSymbolTableCreator extends TaggingSymbolTableCreatorTOP {
@Override
public
void
visit
(
ASTTag
node
)
{
super
.
visit
(
node
);
if
(
node
.
ge
tTargetModel
Opt
().
isPresent
())
if
(
node
.
isPresen
tTargetModel
())
node
.
getSymbol
().
setTaggedSymbolName
(
node
.
getTargetModel
().
getQualifiedNameString
());
tagResolver
.
allCreatedTagSymbols
.
add
(
node
.
getSymbol
());
}
...
...
src/main/java/de/monticore/lang/tagging/generator/TagSchemaGenerator.java
View file @
89c2b073
...
...
@@ -184,7 +184,7 @@ public class TagSchemaGenerator extends GeneratorEngine {
if
(
importStatement
.
isStar
())
importString
+=
".*"
;
imports
.
add
(
importString
);
}
String
scopeSymbol
=
complexTagType
.
getScope
Opt
().
get
().
getScopeIdentifierList
().
get
(
0
).
getScopeName
();
String
scopeSymbol
=
complexTagType
.
getScope
().
getScopeIdentifierList
().
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.ComplexTagTypeCreator"
,
Paths
.
get
(
createPackagePath
(
packageName
).
toString
(),
tagSchemaUnit
.
getName
(),
complexTagTypeName
+
"SymbolCreator.java"
),
...
...
@@ -201,18 +201,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
.
getBooleanOpt
().
isPresent
())
{
if
(
valuedTagType
.
isPresent
Boolean
())
{
dataType
=
"Boolean"
;
}
else
if
(
valuedTagType
.
getNumberOpt
().
isPresent
())
{
else
if
(
valuedTagType
.
isPresent
Number
())
{
dataType
=
"Number"
;
}
else
if
(
valuedTagType
.
getStringOpt
().
isPresent
())
{
else
if
(
valuedTagType
.
isPresent
String
())
{
dataType
=
"String"
;
}
else
if
(
valuedTagType
.
ge
tUnitKind
Opt
().
isPresent
())
{
else
if
(
valuedTagType
.
isPresen
tUnitKind
())
{
isUnit
=
true
;
dataType
=
valuedTagType
.
getUnitKind
Opt
().
get
();
dataType
=
valuedTagType
.
getUnitKind
();
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
());
...
...
@@ -230,7 +230,7 @@ public class TagSchemaGenerator extends GeneratorEngine {
if
(
importStatement
.
isStar
())
importString
+=
".*"
;
imports
.
add
(
importString
);
}
String
scopeSymbol
=
valuedTagType
.
getScope
Opt
().
get
().
getScopeIdentifierList
().
get
(
0
).
getScopeName
();
String
scopeSymbol
=
valuedTagType
.
getScope
().
getScopeIdentifierList
().
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"
),
...
...
@@ -257,7 +257,7 @@ public class TagSchemaGenerator extends GeneratorEngine {
String
importString
=
Joiners
.
DOT
.
join
(
importStatement
.
getImportList
());
if
(
importStatement
.
isStar
())
importString
+=
".*"
;
imports
.
add
(
importString
);
}
String
scopeSymbol
=
simpleTagType
.
getScope
Opt
().
get
().
getScopeIdentifierList
().
get
(
0
).
getScopeName
();
}
String
scopeSymbol
=
simpleTagType
.
getScope
().
getScopeIdentifierList
().
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 @
89c2b073
...
...
@@ -75,15 +75,15 @@ public class RangeFixer {
public
static
List
<
ASTNameWithArray
>
expandRangeInPart
(
ASTNameWithArray
part
)
{
//Not a range
if
(!
part
.
getStartOpt
().
isPresent
()
||
!
part
.
getEndOpt
().
isPresent
())
{
if
(!
part
.
isPresent
Start
()
||
!
part
.
isPresent
End
())
{
return
Lists
.
newArrayList
(
part
);
}
List
<
ASTNameWithArray
>
result
=
new
ArrayList
<>();
int
step
=
part
.
getStepOpt
().
isPresent
()
?
part
.
getStep
Opt
().
get
().
getValue
()
:
1
;
int
start
=
part
.
getStart
Opt
().
get
().
getValue
();
int
end
=
part
.
getEnd
Opt
().
get
().
getValue
();
int
step
=
part
.
isPresent
Step
()
?
part
.
getStep
().
getValue
()
:
1
;
int
start
=
part
.
getStart
().
getValue
();
int
end
=
part
.
getEnd
().
getValue
();
for
(
int
i
=
start
;
i
<=
end
;
i
+=
step
)
{
ASTNameWithArray
tmpNameWithArray
=
TaggingMill
.
nameWithArrayBuilder
()
...
...
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