From 459cffd96e5985aa90aba51e21a3607a719a47b0 Mon Sep 17 00:00:00 2001 From: Anders Nilsson <anders.nilsson@cs.lth.se> Date: Wed, 24 Jan 2007 16:12:04 +0100 Subject: [PATCH] Synching --- CompilerGeneration.jrag | 12 ++++++++++-- siaras/OntologyGeneration.jrag | 16 ++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/CompilerGeneration.jrag b/CompilerGeneration.jrag index 8b66051..b6f61ec 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 5f0b495..c5a7c8a 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\"?>"); -- GitLab