Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OwlCompiler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Nilsson
OwlCompiler
Commits
683281f4
Commit
683281f4
authored
18 years ago
by
Anders Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
Synching
parent
85eb9240
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
siaras/SkillserverInterface.jrag
+52
-6
52 additions, 6 deletions
siaras/SkillserverInterface.jrag
with
52 additions
and
6 deletions
siaras/SkillserverInterface.jrag
+
52
−
6
View file @
683281f4
...
...
@@ -33,18 +33,64 @@ 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
();
Identifier ident =
(Identifier)
((ClassUse) getElement(i)).decl();
return
((StringElement)
ident.getElement(0)
).getLITERAL
();
}
}
return null;
}
public String ValueElement.id() {
return getElement(0).getLITERAL();
}
syn boolean Element.isIdentifier() = false;
eq Identifier.isIdentifier() = true;
eq ClassUse.isIdentifier() = decl().isIdentifier();
}
aspect Decl {
syn lazy Thing ClassUse.decl() {
String id = getAttribute(0).getValue().getSTRING_LITERAL();
return rootNode().findDecl(id);
}
Start ASTNode.rootNode() {
ASTNode parent = getParent();
while (!(parent instanceof Start)) {
parent = parent.getParent();
}
return (Start) parent;
}
syn Thing Start.findDecl(String id) {
for (int i=0; i<getNumElement(); i++) {
if (getElement(i).findDecl(id) != null) {
return (Thing) getElement(i);
}
}
return null;
}
syn Thing Element.findDecl(String id) = null;
eq ComplexElement.findDecl(String id) {
for (int i=0; i<getNumElement(); i++) {
if (getElement(i).findDecl(id) != null) {
return (Thing) getElement(i);
}
}
return null;
}
eq Thing.findDecl(String id) {
for (int i=0; i<getNumAttribute(); i++) {
if (getAttribute(i).isEqualId(id)) {
return this;
}
}
return null;
}
syn boolean Attribute.isEqualId(String id) = false;
eq RdfId.isEqualId(String id) {
if (getValue().getSTRING_LITERAL().equals(id)) {
return true;
}
return false;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment