Commit c65d6cc2 authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Synching

parent 632b07e9
...@@ -142,6 +142,7 @@ aspect GenPrettyPrinter { ...@@ -142,6 +142,7 @@ aspect GenPrettyPrinter {
pStream.println(" syn String Attribute.id() = \"\";"); pStream.println(" syn String Attribute.id() = \"\";");
pStream.println(" eq RdfId.id() = \"Rdf:ID\";"); pStream.println(" eq RdfId.id() = \"Rdf:ID\";");
pStream.println(" eq RdfDatatype.id() = \"Rdf:datatype\";"); pStream.println(" eq RdfDatatype.id() = \"Rdf:datatype\";");
pStream.println(" eq RdfResource.id() = \"Rdf:resource\";");
pStream.println(" public void Attribute.prettyPrint(String indent, PrintStream pStream) {"); pStream.println(" public void Attribute.prettyPrint(String indent, PrintStream pStream) {");
pStream.println(" System.out.print(\" \"+id()+\"=\"+getValue().getSTRING_LITERAL());"); pStream.println(" System.out.print(\" \"+id()+\"=\"+getValue().getSTRING_LITERAL());");
pStream.println(" }\n"); pStream.println(" }\n");
...@@ -176,18 +177,18 @@ aspect GenPrettyPrinter { ...@@ -176,18 +177,18 @@ aspect GenPrettyPrinter {
pStream.println(ind(2)+"}"); pStream.println(ind(2)+"}");
pStream.println("System.out.println(\">\");"); pStream.println("System.out.println(\">\");");
pStream.println(ind(2)+"String childIndent = indent + \" \";"); pStream.println(ind(2)+"String childIndent = indent + \" \";");
Restrictions restr = getRestrictions(); // Restrictions restr = getRestrictions();
for (int i=0; i<restr.getNumOwlRestriction(); i++) { // for (int i=0; i<restr.getNumOwlRestriction(); i++) {
OwlRestriction r = restr.getOwlRestriction(i); // OwlRestriction r = restr.getOwlRestriction(i);
pStream.println(ind(2)+"System.out.println(childIndent+\"<has"+ // pStream.println(ind(2)+"System.out.println(childIndent+\"<has"+
r.name()+">\");"); // r.name()+">\");");
pStream.println(ind(2)+"for (int i=0; i<getNum"+r.name()+"(); i++) {"); // pStream.println(ind(2)+"for (int i=0; i<getNum"+r.name()+"(); i++) {");
pStream.println(ind(3)+"get"+r.name()+ // pStream.println(ind(3)+"get"+r.name()+
"(i).prettyPrint(childIndent+\" \",pStream);"); // "(i).prettyPrint(childIndent+\" \",pStream);");
pStream.println(ind(2)+"}"); // pStream.println(ind(2)+"}");
pStream.println(ind(2)+"System.out.println(childIndent+\"</has"+ // pStream.println(ind(2)+"System.out.println(childIndent+\"</has"+
r.name()+">\");"); // r.name()+">\");");
} // }
pStream.println(ind(2)+"for (int i=0; i<getNumElement(); i++) {"); pStream.println(ind(2)+"for (int i=0; i<getNumElement(); i++) {");
pStream.println(ind(3)+"getElement(i).prettyPrint(childIndent,pStream);"); pStream.println(ind(3)+"getElement(i).prettyPrint(childIndent,pStream);");
pStream.println(ind(2)+"}"); pStream.println(ind(2)+"}");
...@@ -217,6 +218,22 @@ aspect GenRewrites { ...@@ -217,6 +218,22 @@ aspect GenRewrites {
pStream.println(ind(3)+"return node;"); pStream.println(ind(3)+"return node;");
pStream.println(ind(2)+"}"); pStream.println(ind(2)+"}");
pStream.println(ind(1)+"}"); pStream.println(ind(1)+"}");
// TEMPORARY!!!!!
// Rewrite isSkillOf to ClassUse
// pStream.println(ind(1)+"rewrite ComplexElement {");
// pStream.println(ind(2)+"when ("+name()+")");
// pStream.println(ind(2)+"to ClassUse {");
// pStream.println(ind(3)+"ClassUse use = new ClassUse();");
// pStream.println(ind(3)+"use.setOwlIdentifier(new OwlIdentifier(\""+name()+"\"));");
// pStream.println(ind(3)+"use.setAttributeList(new List().add(new RdfResource(getAttribute(0).getValue())));");
// pStream.println(ind(3)+"use.setElementList(new List());");
// pStream.println(ind(3)+"getStart().addElement(this);");
// pStream.println(ind(3)+"return use;");
// pStream.println(ind(2)+"}");
// pStream.println(ind(1)+"}");
super.genRewrites(pStream); super.genRewrites(pStream);
pStream.println("}"); pStream.println("}");
} }
......
...@@ -37,9 +37,9 @@ aspect Statistics { ...@@ -37,9 +37,9 @@ aspect Statistics {
public void ASTNode.getSensors(PrintStream pStream) { public void ASTNode.getSensors(PrintStream pStream) {
// for (int i=0; i<getNumChild(); i++) { for (int i=0; i<getNumChild(); i++) {
// getChild(i).getSensors(pStream); getChild(i).getSensors(pStream);
// } }
} }
public void Start.getSensors(PrintStream pStream) { public void Start.getSensors(PrintStream pStream) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment