Commit ed1e4c15 authored by Anders Nilsson's avatar Anders Nilsson

Added version V08a ontology. Modified compiler so that both the meta compiler...

Added version V08a ontology. Modified compiler so that both the meta compiler and the generated one can be run directly on the unmodified ontology
parent 270e0436
......@@ -31,7 +31,8 @@ aspect Types {
eq OwlClassUse.decl() {
ComplexElement top = getTopElement();
for (int i=0; i<top.getNumElement(); i++) {
if (getId().equals(((ComplexElement) top.getElement(i)).getId())) {
if ((top.getElement(i) instanceof ComplexElement) &&
getId().equals(((ComplexElement) top.getElement(i)).getId())) {
return (OwlClassDecl) top.getElement(i);
}
}
......
......@@ -31,6 +31,7 @@ OwlClass : ComplexElement;
OwlDataRange : ComplexElement;
OwlDatatypeProperty : ComplexElement;
OwlDisjointWith : ComplexElement;
OwlDistinctMembers: ComplexElement;
OwlEquivalentClass : ComplexElement;
OwlFunctionalProperty : OwlProperty;
OwlImports : ComplexElement;
......@@ -67,8 +68,10 @@ XmlnsXsd : Attribute;
XmlnsRdfs : Attribute;
XmlnsOwl : Attribute;
Value ::= <STRING_LITERAL>;
DiscardedElement : Element ::= Identifier Attribute* Element*;
Value ::= <STRING_LITERAL>;
Identifier ::= <IDENTIFIER>;
// Types used by rewrite rules
abstract OClass : ComplexElement ::= <Id:String>;
......
/* -*-Java-*- */
/*
* Copyright (C) 2006 Anders Nilsson <anders.nilsson@cs.lth.se>
......@@ -13,6 +14,9 @@ options {
NODE_PREFIX = "";
JAVA_UNICODE_ESCAPE = true;
STATIC = false;
// DEBUG_PARSER = true;
// DEBUG_LOOKAHEAD = true;
// DEBUG_TOKEN_MANAGER = true;
} // options
......@@ -69,6 +73,7 @@ SPECIAL_TOKEN : /* COMMENTS */
| < OWL_DATARANGE : "owl:DataRange" >
| < OWL_DATATYPEPROPERTY : "owl:DatatypeProperty" >
| < OWL_DISJOINTWITH : "owl:disjointWith" >
| < OWL_DISTINCTMEMBERS : "owl:distinctMembers" >
| < OWL_EQUIVALENTCLASS : "owl:equivalentClass" >
| < OWL_FUNCTIONALPROPERTY : "owl:FunctionalProperty" >
| < OWL_IMPORTS : "owl:imports" >
......@@ -223,8 +228,8 @@ SPECIAL_TOKEN : /* COMMENTS */
| < LBRACKET : "[" >
| < RBRACKET : "]" >
| < SEMICOLON : ";" >
// | < COMMA : "," >
// | < DOT : "." >
| < COMMA : "," >
| < DOT : "." >
}// SEPARATORS
......@@ -236,7 +241,7 @@ SPECIAL_TOKEN : /* COMMENTS */
// | < BANG : "!" >
// | < TILDE : "~" >
// | < HOOK : "?" >
// | < COLON : ":" >
| < COLON : ":" >
// | < EQ : "==" >
// | < LE : "<=" >
// | < GE : ">=" >
......@@ -245,10 +250,10 @@ SPECIAL_TOKEN : /* COMMENTS */
// | < SC_AND : "&&" >
// | < INCR : "++" >
// | < DECR : "--" >
// | < PLUS : "+" >
// | < MINUS : "-" >
| < PLUS : "+" >
| < MINUS : "-" >
// | < STAR : "*" >
// | < SLASH : "/" >
| < SLASH : "/" >
// | < BIT_AND : "&" >
// | < BIT_OR : "|" >
// | < XOR : "^" >
......@@ -313,10 +318,23 @@ void Element() : {}
{
( "<" ( OwlElement()
| RdfElement()
| DiscardedElement()
))
| SimpleElement()
}
void DiscardedElement() #DiscardedElement : {}
{
Identifier() AttributeList()
(">" ElementList() "</" <IDENTIFIER> ">" | ElementList() "/>")
}
void Identifier() #Identifier : {Token t;}
{
t = <IDENTIFIER>
{jjtThis.setIDENTIFIER(t.image);}
}
void SimpleElement() : {}
{
IntElement()
......@@ -338,7 +356,8 @@ void FloatElement() #FloatElement : { Token t; }
void StringElement() #StringElement : { Token t; }
{
t = <IDENTIFIER>
t = <IDENTIFIER> | t = <COMMA> | t = <MINUS> | t = <DOT> | t = <PLUS> | t = <SLASH>
| t = <COLON>
{jjtThis.setIDENTIFIER(t.image);}
}
......@@ -352,6 +371,7 @@ void OwlElement() : {}
| OwlDataRange()
| OwlDatatypeProperty()
| OwlDisjointWith()
| OwlDistinctMembers()
| OwlEquivalentClass()
| OwlFunctionalProperty()
| OwlImports()
......@@ -414,6 +434,12 @@ void OwlDisjointWith() #OwlDisjointWith : {}
(">" ElementList() "</" <OWL_DISJOINTWITH> ">" | ElementList() "/>")
}
void OwlDistinctMembers() #OwlDistinctMembers : {}
{
<OWL_DISTINCTMEMBERS> AttributeList()
(">" ElementList() "</" <OWL_DISTINCTMEMBERS> ">" | ElementList() "/>")
}
void OwlEquivalentClass() #OwlEquivalentClass : {}
{
<OWL_EQUIVALENTCLASS> AttributeList()
......
/* -*-Java-*- */
/*
* Copyright (C) 2006 Anders Nilsson <anders.nilsson@cs.lth.se>
......@@ -225,7 +226,7 @@ SPECIAL_TOKEN : /* COMMENTS */
| < RBRACKET : "]" >
| < SEMICOLON : ";" >
| < COMMA : "," >
// | < DOT : "." >
| < DOT : "." >
}// SEPARATORS
......@@ -312,7 +313,7 @@ void Identifier() #OwlIdentifier : {Token t;}
void OtherToken() #OwlIdentifier : {Token t;}
{
t=<PLUS> | t=<MINUS> | t=<SLASH> | t=<COMMA>
t=<PLUS> | t=<MINUS> | t=<SLASH> | t=<COMMA> | t=<DOT>
{jjtThis.setIDENTIFIER(t.image);}
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment