Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Nilsson
OwlCompiler
Commits
fec258f0
Commit
fec258f0
authored
Dec 12, 2006
by
Anders Nilsson
Browse files
Fixing ClassUses
parent
c65d6cc2
Changes
1
Hide whitespace changes
Inline
Side-by-side
CompilerGeneration.jrag
View file @
fec258f0
...
...
@@ -220,18 +220,20 @@ aspect GenRewrites {
pStream.println(ind(1)+"}");
// TEMPORARY!!!!!
// Rewrite isSkillOf to ClassUse
// pStream.println(ind(1)+"rewrite ComplexElement {");
// pStream.println(ind(2)+"when ("+name()+")");
// pStream.println(ind(2)+"to ClassUse {");
// pStream.println(ind(3)+"ClassUse use = new ClassUse();");
// 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)+"return use;");
// pStream.println(ind(2)+"}");
// pStream.println(ind(1)+"}");
// Rewrite isSkillOf/hasSkill/hasProperty/isPropertyOf to ClassUse
pStream.println(ind(1)+"rewrite ComplexElement {");
pStream.println(ind(2)+"when ((name().equals(\"hasSkill\")");
pStream.println(ind(2)+"|| name().equals(\"isSkillOf\"))");
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(1)+"}");
super.genRewrites(pStream);
...
...
@@ -337,6 +339,9 @@ aspect GenMisc {
pStream.println(ind(1)+"String ComplexElement.name() {");
pStream.println(ind(2)+"return getOwlIdentifier().getIDENTIFIER();");
pStream.println(ind(1)+"}");
pStream.println(ind(1)+"String Attribute.name() {");
pStream.println(ind(2)+"return getValue().getSTRING_LITERAL();");
pStream.println(ind(1)+"}");
super.genMisc(pStream);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment