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
459cffd9
Commit
459cffd9
authored
Jan 24, 2007
by
Anders Nilsson
Browse files
Synching
parent
0a49ff26
Changes
2
Hide whitespace changes
Inline
Side-by-side
CompilerGeneration.jrag
View file @
459cffd9
...
...
@@ -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)+"get
Start
().addElement(this);");
pStream.println(ind(3)+"get
RdfDecl
().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();");
...
...
siaras/OntologyGeneration.jrag
View file @
459cffd9
/* -*-Java-*- */
/*
* Copyright (C) 200
6
Anders Nilsson <anders.nilsson@cs.lth.se>
* Copyright (C) 200
7
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\"?>");
...
...
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