Commit 459cffd9 authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Synching

parent 0a49ff26
...@@ -315,7 +315,7 @@ aspect GenRewrites { ...@@ -315,7 +315,7 @@ aspect GenRewrites {
pStream.println(ind(3)+"use.setOwlIdentifier(new OwlIdentifier(\""+name()+"\"));"); 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.setAttributeList(new List().add(new RdfResource(getAttribute(0).getValue())));");
pStream.println(ind(3)+"use.setElementList(new List());"); pStream.println(ind(3)+"use.setElementList(new List());");
pStream.println(ind(3)+"getStart().addElement(this);"); pStream.println(ind(3)+"getRdfDecl().addElement(this);");
pStream.println(ind(3)+"return use;"); pStream.println(ind(3)+"return use;");
pStream.println(ind(2)+"}"); pStream.println(ind(2)+"}");
pStream.println(ind(1)+"}"); pStream.println(ind(1)+"}");
...@@ -353,7 +353,7 @@ aspect GenMisc { ...@@ -353,7 +353,7 @@ aspect GenMisc {
// Thing.isTopElement() // Thing.isTopElement()
pStream.println(ind(1)+"boolean Thing.isTopElement() {"); pStream.println(ind(1)+"boolean Thing.isTopElement() {");
pStream.println(ind(2)+"return getParent().getParent() instanceof Start;"); pStream.println(ind(2)+"return getParent().getParent() instanceof RdfDeclaration;");
pStream.println(ind(1)+"}"); pStream.println(ind(1)+"}");
// ASTNode.getStart() // ASTNode.getStart()
...@@ -364,6 +364,14 @@ aspect GenMisc { ...@@ -364,6 +364,14 @@ aspect GenMisc {
pStream.println(ind(2)+"return this;"); pStream.println(ind(2)+"return this;");
pStream.println(ind(1)+"}"); pStream.println(ind(1)+"}");
// ASTNode.getRdfDecl()
pStream.println(ind(1)+"Start ASTNode.getRdfDecl() {");
pStream.println(ind(2)+"return getParent().getRdfDecl();");
pStream.println(ind(1)+"}");
pStream.println(ind(1)+"RdfDeclaration RdfDeclaration.getRdfDecl() {");
pStream.println(ind(2)+"return this;");
pStream.println(ind(1)+"}");
// ComplexElement.name() // ComplexElement.name()
pStream.println(ind(1)+"public String ComplexElement.name() {"); pStream.println(ind(1)+"public String ComplexElement.name() {");
pStream.println(ind(2)+"return getOwlIdentifier().getIDENTIFIER();"); pStream.println(ind(2)+"return getOwlIdentifier().getIDENTIFIER();");
......
/* -*-Java-*- */ /* -*-Java-*- */
/* /*
* Copyright (C) 2006 Anders Nilsson <anders.nilsson@cs.lth.se> * Copyright (C) 2007 Anders Nilsson <anders.nilsson@cs.lth.se>
* *
* This file is part of OntologyCompiler. * This file is part of OntologyCompiler.
*/ */
import java.io.PrintStream; import java.io.PrintStream;
aspect Statistics { aspect OntologyGeneration {
public void ASTNode.genOntology(String ind, PrintStream pStream) { public void ASTNode.genOntology(String ind, PrintStream pStream) {
// for (int i=0; i<getNumChild(); i++) { // for (int i=0; i<getNumChild(); i++) {
// getChild(i).genOntology(ind, pStream); // getChild(i).genOntology(ind, pStream);
...@@ -19,6 +19,14 @@ aspect Statistics { ...@@ -19,6 +19,14 @@ aspect Statistics {
pStream.print(getLITERAL()); pStream.print(getLITERAL());
} }
public void IntElement.genOntology(String ind, PrintStream pStream) {
pStream.print(getLITERAL());
}
public void FloatElement.genOntology(String ind, PrintStream pStream) {
pStream.print(getLITERAL());
}
public void ComplexElement.genOntology(String ind, PrintStream pStream) { public void ComplexElement.genOntology(String ind, PrintStream pStream) {
pStream.print(ind+"<"+name()); pStream.print(ind+"<"+name());
for (int i=0; i<getNumAttribute(); i++) { for (int i=0; i<getNumAttribute(); i++) {
...@@ -36,9 +44,9 @@ aspect Statistics { ...@@ -36,9 +44,9 @@ aspect Statistics {
} }
} }
public void Thing.genOntology(String ind, PrintStream pStream) { // public void Thing.genOntology(String ind, PrintStream pStream) {
} // }
public void Start.genOntology(String ind, PrintStream pStream) { public void Start.genOntology(String ind, PrintStream pStream) {
pStream.println("<?xml version=\"1.0\"?>"); pStream.println("<?xml version=\"1.0\"?>");
......
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