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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Nilsson
OwlCompiler
Commits
dce01c7f
Commit
dce01c7f
authored
18 years ago
by
Anders Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
Synching
parent
459cffd9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CompilerGeneration.jrag
+19
-12
19 additions, 12 deletions
CompilerGeneration.jrag
siaras/owl.ast
+1
-1
1 addition, 1 deletion
siaras/owl.ast
with
20 additions
and
13 deletions
CompilerGeneration.jrag
+
19
−
12
View file @
dce01c7f
...
...
@@ -23,6 +23,7 @@ aspect AbsGrammarGeneration {
pStream.println("abstract Element;");
pStream.println("ComplexElement : Element ::= OwlIdentifier Attribute* Element*;");
pStream.println("ValueElement : ComplexElement;");
pStream.println("RdfDeclaration : ComplexElement;");
pStream.println("abstract SimpleElement : Element;");
pStream.println("StringElement : SimpleElement ::= <LITERAL>;");
pStream.println("IntElement : SimpleElement ::= <LITERAL>;");
...
...
@@ -246,6 +247,12 @@ aspect GenRewrites {
pStream.println(ind(3)+"use.setElementList(new List());");
pStream.println(ind(3)+"return use;");
pStream.println(ind(2)+"}");
pStream.println(ind(2)+"when (name().equals(\"rdf:RDF\") && !(this instanceof RdfDeclaration))");
pStream.println(ind(2)+"to RdfDeclaration {");
pStream.println(ind(3)+"return new RdfDeclaration(getOwlIdentifier(),getAttributeList(),getElementList());");
pStream.println(ind(2)+"}");
// pStream.println(ind(2)+"when ((name().equals(\"isSkillOf\")");
// pStream.println(ind(2)+"|| name().equals(\"isPropertyOf\"))");
// pStream.println("&& getNumAttribute() > 0 && getAttribute(0) instanceof RdfResource)");
...
...
@@ -308,17 +315,17 @@ aspect GenRewrites {
pStream.println();
// Rearrange device nodes on the AST to get away from the
// current diagonal style from Protege
pStream.println(ind(1)+"rewrite "+name()+" {");
pStream.println(ind(2)+"when (!isTopElement())");
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)+"getRdfDecl().addElement(this);");
pStream.println(ind(3)+"return use;");
pStream.println(ind(2)+"}");
pStream.println(ind(1)+"}");
//
pStream.println(ind(1)+"rewrite "+name()+" {");
//
pStream.println(ind(2)+"when (!isTopElement())");
//
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)+"getRdfDecl().addElement(this);");
//
pStream.println(ind(3)+"return use;");
//
pStream.println(ind(2)+"}");
//
pStream.println(ind(1)+"}");
}
}
...
...
@@ -365,7 +372,7 @@ aspect GenMisc {
pStream.println(ind(1)+"}");
// ASTNode.getRdfDecl()
pStream.println(ind(1)+"
Start
ASTNode.getRdfDecl() {");
pStream.println(ind(1)+"
RdfDeclaration
ASTNode.getRdfDecl() {");
pStream.println(ind(2)+"return getParent().getRdfDecl();");
pStream.println(ind(1)+"}");
pStream.println(ind(1)+"RdfDeclaration RdfDeclaration.getRdfDecl() {");
...
...
This diff is collapsed.
Click to expand it.
siaras/owl.ast
+
1
−
1
View file @
dce01c7f
...
...
@@ -6,7 +6,7 @@
// This file is part of OntologyCompiler.
RdfDeclaration : ComplexElement;
RdfDescription : ComplexElement;
RdfFirst : ComplexElement;
RdfRest : ComplexElement;
...
...
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