From 29019af5b0b37fcde9fe61a8faffb0631939ba3f Mon Sep 17 00:00:00 2001
From: Anders Nilsson <anders.nilsson@cs.lth.se>
Date: Fri, 15 Dec 2006 15:24:21 +0100
Subject: [PATCH] Synching

---
 CompilerGeneration.jrag | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/CompilerGeneration.jrag b/CompilerGeneration.jrag
index eeb8bc7..4547493 100644
--- a/CompilerGeneration.jrag
+++ b/CompilerGeneration.jrag
@@ -220,10 +220,22 @@ aspect GenRewrites {
 		pStream.println(ind(1)+"}");
 
 		// TEMPORARY!!!!!
-		// Rewrite isSkillOf/hasSkill/hasProperty/isPropertyOf to ClassUse
+		// Rewrite isSkillOf/hasSkill/hasProperty/isPropertyOf to ClassUse.
+		// Should probably be auto-generated instead.
 		pStream.println(ind(1)+"rewrite ComplexElement {");
 		pStream.println(ind(2)+"when ((name().equals(\"hasSkill\")");
-		pStream.println(ind(2)+"|| name().equals(\"isSkillOf\"))");
+		pStream.println(ind(2)+"|| name().equals(\"hasProperty\"))");
+		pStream.println("&& getNumAttribute() > 0 && getAttribute(0) instanceof RdfResource)");
+		pStream.println(ind(2)+"to ClassUse {");
+		pStream.println(ind(3)+"ClassUse use = new ClassUse();");
+		pStream.println(ind(3)+"String att = getAttribute(0).name();");
+		pStream.println(ind(3)+"use.setOwlIdentifier(new OwlIdentifier(att.substring(att.indexOf('#')+1,att.indexOf('_'))));");
+		pStream.println(ind(3)+"use.setAttributeList(getAttributeList());");
+		pStream.println(ind(3)+"use.setElementList(new List());");
+		pStream.println(ind(3)+"return use;");
+		pStream.println(ind(2)+"}");
+		pStream.println(ind(2)+"when ((name().equals(\"isSkillOf\")");
+		pStream.println(ind(2)+"|| name().equals(\"isPropertyOf\"))");
 		pStream.println("&& getNumAttribute() > 0 && getAttribute(0) instanceof RdfResource)");
 		pStream.println(ind(2)+"to ClassUse {");
 		pStream.println(ind(3)+"ClassUse use = new ClassUse();");
-- 
GitLab