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
85eb9240
Commit
85eb9240
authored
Apr 02, 2007
by
Anders Nilsson
Browse files
Synching
parent
120386a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
siaras/Ontology.java
View file @
85eb9240
...
...
@@ -9,7 +9,7 @@ import AST.Start;
import
AST.SiarasParser
;
import
AST.ParseException
;
import
java.io.*
;
import
java.net.
URL
;
import
java.net.
*
;
public
class
Ontology
extends
Parser
{
public
static
Start
getAST
(
String
ontologyURL
)
{
...
...
@@ -25,20 +25,19 @@ public class Ontology extends Parser {
// }
// }
try
{
Reader
r
=
new
String
Reader
(
(
String
)
new
URL
(
ontologyURL
).
getFile
());
Reader
r
=
new
File
Reader
(
new
URL
(
ontologyURL
).
getFile
());
SiarasParser
parser
=
new
SiarasParser
(
r
);
ast
=
parser
.
Start
();
}
catch
(
ParseException
e
)
{
}
catch
(
ParseException
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
// catch (FileNotFoundException e) {
// System.err.println("file " + ontologyURL + " not found");
// }
catch
(
IOException
e
)
{
catch
(
MalformedURLException
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
}
catch
(
FileNotFoundException
e
)
{
System
.
err
.
println
(
"file "
+
ontologyURL
+
" not found"
);
}
return
ast
;
// try {
...
...
siaras/SkillserverInterface.jrag
View file @
85eb9240
...
...
@@ -8,7 +8,7 @@
aspect SkillserverInterface {
public Thing ASTNode.getIndividual(String id) {
System.out.println("foo: "+this);
//
System.out.println("foo: "+this);
for (int i=0; i<getNumChild(); i++) {
Thing t = getChild(i).getIndividual(id);
if (t!=null) {
...
...
@@ -19,20 +19,9 @@ aspect SkillserverInterface {
return null;
}
public Thing Start.getIndividual(String id) {
for (int i=0; i<getNumElement(); i++) {
Thing t = getElement(i).getIndividual(id);
if (t!=null) {
System.out.println("Found: "+t);
return t;
}
}
return null;
}
public Thing Thing.getIndividual(String id) {
System.out.println("Looking for: "+id+" in: "+
name
());
if (id.equals(
name
())) {
System.out.println("Looking for: "+id+" in: "+
id
());
if (id.equals(
id
())) {
return this;
} else {
return super.getIndividual(id);
...
...
@@ -40,9 +29,22 @@ aspect SkillserverInterface {
}
}
aspect PrettyPrinter {
public void Start.prettyPrint() {
System.out.println("PrettyPrinting");
prettyPrint("",System.out);
aspect Misc {
public String Thing.id() {
for (int i=0; i<getNumElement(); i++) {
if (getElement(i).isIdentifier()) {
Identifier ident = ((ClassUse) getElement(i)).decl();
return ident.getElement(0).id();
}
}
return null;
}
public String ValueElement.id() {
return getElement(0).getLITERAL();
}
syn boolean Element.isIdentifier() = false;
eq Identifier.isIdentifier() = true;
eq ClassUse.isIdentifier() = decl().isIdentifier();
}
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