diff --git a/CompilerGeneration.jrag b/CompilerGeneration.jrag index 8b66051b77cfc190a9e5dc3bb382629e6b6e0bfa..b6f61ecafdf307cfafcdf756e54b6913f6c6f3ae 100644 --- a/CompilerGeneration.jrag +++ b/CompilerGeneration.jrag @@ -315,7 +315,7 @@ aspect GenRewrites { 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)+"getRdfDecl().addElement(this);"); pStream.println(ind(3)+"return use;"); pStream.println(ind(2)+"}"); pStream.println(ind(1)+"}"); @@ -353,7 +353,7 @@ aspect GenMisc { // 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)+"}"); // ASTNode.getStart() @@ -364,6 +364,14 @@ aspect GenMisc { pStream.println(ind(2)+"return this;"); 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() pStream.println(ind(1)+"public String ComplexElement.name() {"); pStream.println(ind(2)+"return getOwlIdentifier().getIDENTIFIER();"); diff --git a/siaras/OntologyGeneration.jrag b/siaras/OntologyGeneration.jrag index 5f0b495250e1cb75b068938a73f26316d26b422c..c5a7c8ad4fac52758c3f7f8aa9a307bb4057fa49 100644 --- a/siaras/OntologyGeneration.jrag +++ b/siaras/OntologyGeneration.jrag @@ -1,14 +1,14 @@ /* -*-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. */ import java.io.PrintStream; -aspect Statistics { +aspect OntologyGeneration { public void ASTNode.genOntology(String ind, PrintStream pStream) { // for (int i=0; i<getNumChild(); i++) { // getChild(i).genOntology(ind, pStream); @@ -19,6 +19,14 @@ aspect Statistics { 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) { pStream.print(ind+"<"+name()); for (int i=0; i<getNumAttribute(); i++) { @@ -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) { pStream.println("<?xml version=\"1.0\"?>");