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
72486b04
Commit
72486b04
authored
Sep 22, 2006
by
Anders Nilsson
Browse files
Trying to extract restrictions instead of properties
parent
2337a8e9
Changes
4
Hide whitespace changes
Inline
Side-by-side
.bzrignore
View file @
72486b04
...
...
@@ -4,3 +4,4 @@ AST
*.class
semantic.cache
plugins
testontologies/ontologyV06_Jambalaya.properties
DumpClasses.jrag
View file @
72486b04
...
...
@@ -16,16 +16,21 @@ aspect DumpClasses {
void OwlClassDecl.dumpClasses(PrintStream pStream) {
pStream.print(getId());
pStream.print(" : "+getSuperClass().getId());
pStream.print(" ::= ");
Properties props = getProperties();
for (int i=0; i<props.getNumProperty(); i++) {
pStream.print(" ::=");
Restrictions restrs = getRestrictions();
for (int i=0; i<restrs.getNumOwlRestriction(); i++) {
pStream.print(" "+"restr");
}
// Properties props = getProperties();
// for (int i=0; i<props.getNumProperty(); i++) {
// pStream.print("<");
pStream.print(props.getProperty(i).getId());
//
pStream.print(
" "+
props.getProperty(i).getId());
// pStream.print(":");
// pStream.print(props.getProperty(i).range().type());
// pStream.print(">");
// pStream.print(" ");
}
//
}
pStream.println(";");
}
}
Types.jrag
View file @
72486b04
...
...
@@ -53,6 +53,30 @@ aspect Types {
}
}
aspect Restrictions {
Restrictions OwlClassDecl.restrictions;
syn lazy Restrictions OwlClassDecl.getRestrictions() {
if (restrictions == null) {
List l = new List();
collectRestrictions(l);
restrictions = new Restrictions(l);
}
return restrictions;
}
void ASTNode.collectRestrictions(List l) {
for (int i=0; i<getNumChild(); i++) {
getChild(i).collectRestrictions(l);
}
}
void OwlRestriction.collectRestrictions(List l) {
l.add(this);
}
}
aspect Properties {
void ASTNode.collectProperties(List l) {
for (int i=0; i<getNumChild(); i++) {
...
...
owl.ast
View file @
72486b04
...
...
@@ -69,5 +69,6 @@ OwlClassDecl : OClass ::= <Id:String> ;
OwlClassUse : OClass ::= <Id:String> ;
Properties ::= Property:Element*;
Restrictions ::= OwlRestriction*;
OwlProperty : ComplexElement;
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