diff --git a/CompilerGeneration.jrag b/CompilerGeneration.jrag index c5586db5d930b303385ae82eb19580e245b02744..3575e9721ba3040a8fd2fea3a4393b8dc2ff42c8 100644 --- a/CompilerGeneration.jrag +++ b/CompilerGeneration.jrag @@ -142,6 +142,7 @@ aspect GenPrettyPrinter { pStream.println(" syn String Attribute.id() = \"\";"); pStream.println(" eq RdfId.id() = \"Rdf:ID\";"); 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(" System.out.print(\" \"+id()+\"=\"+getValue().getSTRING_LITERAL());"); pStream.println(" }\n"); @@ -176,18 +177,18 @@ aspect GenPrettyPrinter { pStream.println(ind(2)+"}"); pStream.println("System.out.println(\">\");"); pStream.println(ind(2)+"String childIndent = indent + \" \";"); - Restrictions restr = getRestrictions(); - for (int i=0; i<restr.getNumOwlRestriction(); i++) { - OwlRestriction r = restr.getOwlRestriction(i); - pStream.println(ind(2)+"System.out.println(childIndent+\"<has"+ - r.name()+">\");"); - pStream.println(ind(2)+"for (int i=0; i<getNum"+r.name()+"(); i++) {"); - pStream.println(ind(3)+"get"+r.name()+ - "(i).prettyPrint(childIndent+\" \",pStream);"); - pStream.println(ind(2)+"}"); - pStream.println(ind(2)+"System.out.println(childIndent+\"</has"+ - r.name()+">\");"); - } +// Restrictions restr = getRestrictions(); +// for (int i=0; i<restr.getNumOwlRestriction(); i++) { +// OwlRestriction r = restr.getOwlRestriction(i); +// pStream.println(ind(2)+"System.out.println(childIndent+\"<has"+ +// r.name()+">\");"); +// pStream.println(ind(2)+"for (int i=0; i<getNum"+r.name()+"(); i++) {"); +// pStream.println(ind(3)+"get"+r.name()+ +// "(i).prettyPrint(childIndent+\" \",pStream);"); +// pStream.println(ind(2)+"}"); +// pStream.println(ind(2)+"System.out.println(childIndent+\"</has"+ +// r.name()+">\");"); +// } pStream.println(ind(2)+"for (int i=0; i<getNumElement(); i++) {"); pStream.println(ind(3)+"getElement(i).prettyPrint(childIndent,pStream);"); pStream.println(ind(2)+"}"); @@ -217,6 +218,22 @@ aspect GenRewrites { pStream.println(ind(3)+"return node;"); pStream.println(ind(2)+"}"); 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); pStream.println("}"); } diff --git a/siaras/Statistics.jrag b/siaras/Statistics.jrag index 26b6197800f849b1f0c9d2de77694451c07fd8ec..4b9928f00f3eaeb03023f96e123b78263d5612d8 100644 --- a/siaras/Statistics.jrag +++ b/siaras/Statistics.jrag @@ -37,9 +37,9 @@ aspect Statistics { public void ASTNode.getSensors(PrintStream pStream) { -// for (int i=0; i<getNumChild(); i++) { -// getChild(i).getSensors(pStream); -// } + for (int i=0; i<getNumChild(); i++) { + getChild(i).getSensors(pStream); + } } public void Start.getSensors(PrintStream pStream) {