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
1da31eb4
Commit
1da31eb4
authored
18 years ago
by
Anders Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
Synching. Doesn't compile
parent
bfe1842b
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
+25
-0
25 additions, 0 deletions
CompilerGeneration.jrag
siaras/build.xml
+1
-1
1 addition, 1 deletion
siaras/build.xml
with
26 additions
and
1 deletion
CompilerGeneration.jrag
+
25
−
0
View file @
1da31eb4
...
@@ -27,6 +27,7 @@ aspect AbsGrammarGeneration {
...
@@ -27,6 +27,7 @@ aspect AbsGrammarGeneration {
pStream.println("StringElement : SimpleElement ::= <IDENTIFIER>;");
pStream.println("StringElement : SimpleElement ::= <IDENTIFIER>;");
pStream.println("IntElement : SimpleElement ::= <INTEGER_LITERAL>;");
pStream.println("IntElement : SimpleElement ::= <INTEGER_LITERAL>;");
pStream.println("FloatElement : SimpleElement ::= <FLOAT_LITERAL>;");
pStream.println("FloatElement : SimpleElement ::= <FLOAT_LITERAL>;");
pStream.println("abstract ClassUse : ComplexElement ::= /decl:Thing/;");
pStream.println("Attribute ::= Value;");
pStream.println("Attribute ::= Value;");
pStream.println("RdfDatatype : Attribute ::= ;");
pStream.println("RdfDatatype : Attribute ::= ;");
pStream.println("RdfId : Attribute ::= ;");
pStream.println("RdfId : Attribute ::= ;");
...
@@ -58,6 +59,9 @@ aspect AbsGrammarGeneration {
...
@@ -58,6 +59,9 @@ aspect AbsGrammarGeneration {
pStream.print(" ::=");
pStream.print(" ::=");
getOwnRestrictions().genAbsGrammar(pStream);
getOwnRestrictions().genAbsGrammar(pStream);
pStream.println(";");
pStream.println(";");
pStream.print(getId()+"Use");
pStream.print(" : ClassUse");
pStream.println(";");
}
}
void Restrictions.genAbsGrammar(PrintStream pStream) {
void Restrictions.genAbsGrammar(PrintStream pStream) {
...
@@ -251,8 +255,16 @@ aspect GenRewrites {
...
@@ -251,8 +255,16 @@ aspect GenRewrites {
pStream.println(ind(3)+"return node;");
pStream.println(ind(3)+"return node;");
pStream.println(ind(2)+"}");
pStream.println(ind(2)+"}");
pStream.println(ind(1)+"}");
pStream.println(ind(1)+"}");
pStream.println();
// Rearrange device nodes on the AST to get away from the
// Rearrange device nodes on the AST to get away from the
// current diagonal style from Protege
// current diagonal style from Protege
pStream.println(ind(1)+"rewrite "+name()+" {");
pStream.println(ind(2)+"when (!isTopElement())");
pStream.println(ind(2)+"to "+name()+"Use {");
pStream.println(ind(3)+"getStart().addElement(this);");
pStream.println(ind(3)+"return new "+name()+"Use();");
pStream.println(ind(2)+"}");
pStream.println(ind(1)+"}");
}
}
}
}
...
@@ -282,6 +294,19 @@ aspect GenMisc {
...
@@ -282,6 +294,19 @@ aspect GenMisc {
pStream.println(ind(1)+"eq StringElement.value() = getIDENTIFIER();");
pStream.println(ind(1)+"eq StringElement.value() = getIDENTIFIER();");
pStream.println(ind(1)+"eq IntElement.value() = getINTEGER_LITERAL();");
pStream.println(ind(1)+"eq IntElement.value() = getINTEGER_LITERAL();");
pStream.println(ind(1)+"eq FloatElement.value() = getFLOAT_LITERAL();");
pStream.println(ind(1)+"eq FloatElement.value() = getFLOAT_LITERAL();");
pStream.println(ind(1)+"boolean Thing.isTopElement() {");
pStream.println(ind(2)+"return getParent().getParent() instanceof Start;");
pStream.println(ind(1)+"}");
pStream.println(ind(1)+"Start ASTNode.getStart() {");
pStream.println(ind(2)+"return getParent().getStart();");
pStream.println(ind(1)+"}");
pStream.println(ind(1)+"Start Start.getStart() {");
pStream.println(ind(2)+"return this;");
pStream.println(ind(1)+"}");
super.genMisc(pStream);
super.genMisc(pStream);
pStream.println("}");
pStream.println("}");
}
}
...
...
This diff is collapsed.
Click to expand it.
siaras/build.xml
+
1
−
1
View file @
1da31eb4
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
gen - generates java files
gen - generates java files
genClean - removes all generated files and their class files
genClean - removes all generated files and their class files
-->
-->
<project
name=
"
Java1.4Frontend
"
default=
"build"
basedir=
"."
>
<project
name=
"
OntologyCompiler
"
default=
"build"
basedir=
"."
>
<!-- "package" is the directory where generated files will be stored -->
<!-- "package" is the directory where generated files will be stored -->
<property
name=
"package"
value=
"AST"
/>
<property
name=
"package"
value=
"AST"
/>
...
...
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