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

Fixed generation of ValueElement, without annoying whitespace.

parent 54c2b20f
...@@ -16,3 +16,4 @@ siaras/ontology.owl ...@@ -16,3 +16,4 @@ siaras/ontology.owl
siaras/javadoc siaras/javadoc
siaras/OntologyCompiler.jar siaras/OntologyCompiler.jar
*.repository *.repository
siaras/ontology.pprj
...@@ -393,7 +393,7 @@ String getData() { ...@@ -393,7 +393,7 @@ String getData() {
} }
s.append(t.image); s.append(t.image);
} }
return s.toString(); return s.toString().trim();
} }
// void StringElement() #StringElement : { Token t; } // void StringElement() #StringElement : { Token t; }
......
...@@ -44,6 +44,24 @@ aspect OntologyGeneration { ...@@ -44,6 +44,24 @@ aspect OntologyGeneration {
} }
} }
public void ValueElement.genOntology(String ind, PrintStream pStream) {
pStream.print(ind+"<"+name());
for (int i=0; i<getNumAttribute(); i++) {
pStream.print(" ");
getAttribute(i).genOntology(pStream);
}
if (getNumElement() > 0) {
pStream.println();
pStream.print(ind+">");
for (int i=0; i<getNumElement(); i++) {
getElement(i).genOntology(ind+" ", pStream);
}
pStream.println("</"+name()+">");
} else {
pStream.println("/>");
}
}
// public void Thing.genOntology(String ind, PrintStream pStream) { // public void Thing.genOntology(String ind, PrintStream pStream) {
// } // }
......
...@@ -378,7 +378,7 @@ String getData() { ...@@ -378,7 +378,7 @@ String getData() {
} }
s.append(t.image); s.append(t.image);
} }
return s.toString(); return s.toString().trim();
} }
......
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