Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
XMLSchemaCompiler
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Nilsson
XMLSchemaCompiler
Commits
9b0bb4bd
Commit
9b0bb4bd
authored
May 7, 2009
by
Anders Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
Can now print a _very_ simple schedule
parent
fd5a73da
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/actors/SSRAnalysis.java
+14
-2
14 additions, 2 deletions
examples/actors/SSRAnalysis.java
examples/actors/xdf/SSR.jrag
+24
-19
24 additions, 19 deletions
examples/actors/xdf/SSR.jrag
with
38 additions
and
21 deletions
examples/actors/SSRAnalysis.java
+
14
−
2
View file @
9b0bb4bd
...
@@ -8,14 +8,15 @@
...
@@ -8,14 +8,15 @@
import
xdfAST.Start
;
import
xdfAST.Start
;
import
xdfAST.Instance
;
import
xdfAST.Instance
;
import
java.util.
LinkedLis
t
;
import
java.util.
HashSe
t
;
public
class
SSRAnalysis
extends
XdfParser
{
public
class
SSRAnalysis
extends
XdfParser
{
public
static
void
main
(
String
args
[])
{
public
static
void
main
(
String
args
[])
{
Start
ast
=
parse
(
args
);
Start
ast
=
parse
(
args
);
ast
.
genSSR
(
System
.
out
);
ast
.
genSSR
(
System
.
out
);
LinkedList
<
Instance
>
l
=
ast
.
genStaticSchedule
(
new
LinkedList
<
Instance
>());
HashSet
<
Instance
>
l
=
ast
.
genStaticSchedule
(
new
HashSet
<
Instance
>());
System
.
out
.
println
(
"\n\n"
);
for
(
Instance
i:
l
){
for
(
Instance
i:
l
){
do
{
do
{
...
@@ -24,6 +25,17 @@ public class SSRAnalysis extends XdfParser {
...
@@ -24,6 +25,17 @@ public class SSRAnalysis extends XdfParser {
}
while
(
i
!=
null
);
}
while
(
i
!=
null
);
System
.
out
.
println
();
System
.
out
.
println
();
}
}
String
s
=
genScheduleXML
(
l
);
}
static
String
genScheduleXML
(
HashSet
<
Instance
>
set
)
{
StringBuffer
sb
=
new
StringBuffer
();
sb
.
append
(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
);
sb
.
append
(
"<Schedule>\n"
);
return
sb
.
toString
();
}
}
}
}
This diff is collapsed.
Click to expand it.
examples/actors/xdf/SSR.jrag
+
24
−
19
View file @
9b0bb4bd
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
import java.io.PrintStream;
import java.io.PrintStream;
import java.io.FileReader;
import java.io.FileReader;
import java.util.
LinkedLis
t;
import java.util.
HashSe
t;
aspect SSR {
aspect SSR {
...
@@ -28,14 +28,15 @@ aspect SSR {
...
@@ -28,14 +28,15 @@ aspect SSR {
}
}
aspect SDF {
aspect SDF {
syn boolean Instance.isSDF() = xlim().isSDF();
syn boolean Instance.isSDF() {
syn xlimAST.Start Instance.xlim() {
try {
try {
xlimAST.XmlParser parser = new xlimAST.XmlParser(new FileReader(name()));
System.out.println("Trying to open: "+name());
return parser.Start();
xlimAST.XmlParser parser = new xlimAST.XmlParser(new FileReader(name()+".xlim"));
return parser.Start().isSDF();
} catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
System.out.println( name()+".xlim not found");
return null;
// e.printStackTrace();
return false;
}
}
}
}
}
}
...
@@ -45,31 +46,35 @@ aspect StaticSchedule {
...
@@ -45,31 +46,35 @@ aspect StaticSchedule {
public Instance Instance.prev;
public Instance Instance.prev;
syn
LinkedLis
t<Instance> ASTNode.genStaticSchedule(
LinkedLis
t<Instance> l) = l;
syn
HashSe
t<Instance> ASTNode.genStaticSchedule(
HashSe
t<Instance> l) = l;
eq Start.genStaticSchedule(
LinkedLis
t<Instance> l) = getSpecification().genStaticSchedule(l);
eq Start.genStaticSchedule(
HashSe
t<Instance> l) = getSpecification().genStaticSchedule(l);
eq Specification.genStaticSchedule(
LinkedLis
t<Instance> l) {
eq Specification.genStaticSchedule(
HashSe
t<Instance> l) {
for (int i=0; i<getNumElement(); i++) {
for (int i=0; i<getNumElement(); i++) {
l = getElement(i).genStaticSchedule(l);
l = getElement(i).genStaticSchedule(l);
}
}
return l;
return l;
}
}
eq XDF.genStaticSchedule(
LinkedLis
t<Instance> l) {
eq XDF.genStaticSchedule(
HashSe
t<Instance> l) {
for (int i=0; i<getNumElement(); i++) {
for (int i=0; i<getNumElement(); i++) {
l = getElement(i).genStaticSchedule(l);
l = getElement(i).genStaticSchedule(l);
}
}
return l;
return l;
}
}
eq Connection.genStaticSchedule(
LinkedLis
t<Instance> l) {
eq Connection.genStaticSchedule(
HashSe
t<Instance> l) {
Instance src = getSource();
Instance src = getSource();
Instance dest = getDest();
Instance dest = getDest();
if (
src
.isSDF() &&
dest
.isSDF()) {
if (
dest
.isSDF() &&
src
.isSDF()) {
src.next = dest;
src.next = dest;
dest.prev = src;
dest.prev = src;
l.remove(dest);
}
}
if (src.prev == null) {
if (src.prev == null) {
l.add(src);
l.add(src);
}
}
// System.out.println(src.name());
if (dest.prev == null) {
l.add(dest);
}
System.out.println(src.name());
return l;
return l;
// Instance dest = getDest();
// Instance dest = getDest();
}
}
...
@@ -129,9 +134,9 @@ aspect misc {
...
@@ -129,9 +134,9 @@ aspect misc {
Note Instance.getUIDNote() {
Note Instance.getUIDNote() {
for (Element e : getElements()) {
for (Element e : getElements()) {
if (e instanceof Note) {
if (e instanceof Note) {
System.out.println("Checking "+e.kind());
//
System.out.println("Checking "+e.kind());
if (e.kind().equals("UID")) {
if (e.kind().equals("UID")) {
System.out.println(" Yes");
//
System.out.println(" Yes");
return (Note) e;
return (Note) e;
}
}
}
}
...
@@ -142,10 +147,10 @@ aspect misc {
...
@@ -142,10 +147,10 @@ aspect misc {
syn String Element.kind() = "";
syn String Element.kind() = "";
eq Note.kind() {
eq Note.kind() {
for (Attribute a : getAttributes()) {
for (Attribute a : getAttributes()) {
System.out.println(" checking: "+a);
//
System.out.println(" checking: "+a);
if (a.isKind()) {
if (a.isKind()) {
System.out.println(" found "+
value(
));
//
System.out.println(" found "+
fix(a.getAttrValue().getLITERAL()
));
return
value(
);
return
fix(a.getAttrValue().getLITERAL()
);
}
}
}
}
return "";
return "";
...
...
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