Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LabComm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Blomdell
LabComm
Commits
54863675
Commit
54863675
authored
9 years ago
by
Sven Gestegård Robertz
Browse files
Options
Downloads
Patches
Plain Diff
Don't generate duplicate intentions (e.g. name) for typedefs. Updated
TypeDefParser
parent
efccdd42
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
compiler/2014/Signature.jrag
+6
-4
6 additions, 4 deletions
compiler/2014/Signature.jrag
lib/java/se/lth/control/labcomm2014/TypeDefParser.java
+10
-17
10 additions, 17 deletions
lib/java/se/lth/control/labcomm2014/TypeDefParser.java
with
16 additions
and
21 deletions
compiler/2014/Signature.jrag
+
6
−
4
View file @
54863675
...
@@ -287,10 +287,12 @@ aspect Signature {
...
@@ -287,10 +287,12 @@ aspect Signature {
eq TypeInstance.intentions() = intentionSet();
eq TypeInstance.intentions() = intentionSet();
public void TypeInstance.genSigLineForDecl(SignatureList list, boolean decl, ASTNode inst) {
public void TypeInstance.genSigLineForDecl(SignatureList list, boolean decl, ASTNode inst) {
// debugAnnotations(this.getName());
// debugAnnotations(this.getName());
// list.addString(inst.getIntentionString(), "intention string");
// list.addString(inst.getIntentionString(), "intention string");
list.addIntentions(intentionSet(), "intentions");
if(addIntentions()) {
getDataType().genSigLineForDecl(list, decl, this);
list.addIntentions(intentionSet(), "intentions");
}
getDataType().genSigLineForDecl(list, decl, this);
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/java/se/lth/control/labcomm2014/TypeDefParser.java
+
10
−
17
View file @
54863675
...
@@ -548,31 +548,30 @@ public class TypeDefParser implements TypeDef.Handler, TypeBinding.Handler {
...
@@ -548,31 +548,30 @@ public class TypeDefParser implements TypeDef.Handler, TypeBinding.Handler {
return
current
.
getName
();
return
current
.
getName
();
}
}
/** return name, (if any, or "") for now */
String
decodeIntentions
()
throws
IOException
{
String
decodeIntentions
()
throws
IOException
{
int
n
=
decodePacked32
()
&
0xffffffff
;
int
n
=
decodePacked32
()
&
0xffffffff
;
if
(
n
==
0
)
return
""
;
if
(
n
==
0
)
return
""
;
StringBuilder
sb
=
new
StringBuilder
();
String
name
=
""
;
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
for
(
int
i
=
0
;
i
<
n
;
i
++)
{
sb
.
append
(
"("
);
int
klen
=
decodePacked32
()
&
0xffffffff
;
int
klen
=
decodePacked32
()
&
0xffffffff
;
byte
[]
kchars
=
new
byte
[
klen
];
byte
[]
kchars
=
new
byte
[
klen
];
for
(
int
k
=
0
;
k
<
klen
;
k
++)
{
for
(
int
k
=
0
;
k
<
klen
;
k
++)
{
kchars
[
k
]
=
in
.
readByte
();
kchars
[
k
]
=
in
.
readByte
();
}
}
sb
.
append
(
new
String
(
kchars
));
sb
.
append
(
":"
);
int
vlen
=
decodePacked32
()
&
0xffffffff
;
int
vlen
=
decodePacked32
()
&
0xffffffff
;
byte
[]
vchars
=
new
byte
[
vlen
];
byte
[]
vchars
=
new
byte
[
vlen
];
for
(
int
j
=
0
;
j
<
vlen
;
j
++)
{
for
(
int
j
=
0
;
j
<
vlen
;
j
++)
{
vchars
[
j
]
=
in
.
readByte
();
vchars
[
j
]
=
in
.
readByte
();
}
}
sb
.
append
(
new
String
(
vchars
));
if
(
klen
==
0
)
{
sb
.
append
(
")"
);
name
=
new
String
(
vchars
);
}
}
}
return
sb
.
toString
()
;
return
name
;
}
}
String
decodeString
()
throws
IOException
{
String
decodeString
()
throws
IOException
{
...
@@ -648,13 +647,7 @@ public class TypeDefParser implements TypeDef.Handler, TypeBinding.Handler {
...
@@ -648,13 +647,7 @@ public class TypeDefParser implements TypeDef.Handler, TypeBinding.Handler {
}
}
private
ParsedField
parseParsedField
(
ParserState
in
)
throws
IOException
{
private
ParsedField
parseParsedField
(
ParserState
in
)
throws
IOException
{
String
intentions
=
in
.
decodeString
();
String
name
=
in
.
decodeIntentions
();
if
(
intentions
.
length
()>
0
)
{
System
.
out
.
println
(
"parseParsedField intentions ("
+
intentions
);
}
else
{
System
.
out
.
println
(
"no intentions"
);
}
String
name
=
in
.
decodeString
();
return
new
ParsedField
(
name
,
parseType
(
in
,
false
));
return
new
ParsedField
(
name
,
parseType
(
in
,
false
));
}
}
...
@@ -682,7 +675,7 @@ public class TypeDefParser implements TypeDef.Handler, TypeBinding.Handler {
...
@@ -682,7 +675,7 @@ public class TypeDefParser implements TypeDef.Handler, TypeBinding.Handler {
}
}
private
ParsedTypeDef
parseTypeDef
(
ParserState
in
,
boolean
parseIntentions
)
throws
IOException
{
private
ParsedTypeDef
parseTypeDef
(
ParserState
in
,
boolean
parseIntentions
)
throws
IOException
{
ParsedTypeDef
result
=
in
.
newTypeDef
();
ParsedTypeDef
result
=
in
.
newTypeDef
();
result
.
setType
(
parseType
(
in
,
parseIntentions
));
result
.
setType
(
parseType
(
in
,
false
));
return
result
;
return
result
;
}
}
...
@@ -695,7 +688,7 @@ public class TypeDefParser implements TypeDef.Handler, TypeBinding.Handler {
...
@@ -695,7 +688,7 @@ public class TypeDefParser implements TypeDef.Handler, TypeBinding.Handler {
System
.
out
.
println
(
"no intentions"
);
System
.
out
.
println
(
"no intentions"
);
}
}
}
else
{
}
else
{
System
.
out
.
println
(
"not parsing intentions"
);
//
System.out.println("not parsing intentions");
}
}
int
tag
=
in
.
decodePacked32
();
int
tag
=
in
.
decodePacked32
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment