Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Nilsson
OwlCompiler
Commits
c65d6cc2
Commit
c65d6cc2
authored
Dec 11, 2006
by
Anders Nilsson
Browse files
Synching
parent
632b07e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
CompilerGeneration.jrag
View file @
c65d6cc2
...
...
@@ -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("}");
}
...
...
siaras/Statistics.jrag
View file @
c65d6cc2
...
...
@@ -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) {
...
...
Write
Preview
Supports
Markdown
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