Skip to content
Snippets Groups Projects
Commit 8483d772 authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Can now parse ontology v0.6 from IPA

parent cf190438
Branches
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ RdfsRange : ComplexElement; ...@@ -17,6 +17,7 @@ RdfsRange : ComplexElement;
RdfsSubClassOf : ComplexElement; RdfsSubClassOf : ComplexElement;
RdfsSubPropertyOf : ComplexElement; RdfsSubPropertyOf : ComplexElement;
OwlOntology : ComplexElement; OwlOntology : ComplexElement;
OwlAllDifferent : ComplexElement;
OwlAllValuesFrom : ComplexElement; OwlAllValuesFrom : ComplexElement;
OwlCardinality : ComplexElement; OwlCardinality : ComplexElement;
OwlClass : ComplexElement; OwlClass : ComplexElement;
...@@ -39,6 +40,7 @@ OwlUnionOf : ComplexElement; ...@@ -39,6 +40,7 @@ OwlUnionOf : ComplexElement;
abstract SimpleElement : Element; abstract SimpleElement : Element;
StringElement : SimpleElement ::= <IDENTIFIER>; StringElement : SimpleElement ::= <IDENTIFIER>;
IntElement : SimpleElement ::= <INTEGER_LITERAL>; IntElement : SimpleElement ::= <INTEGER_LITERAL>;
FloatElement : SimpleElement ::= <FLOAT_LITERAL>;
abstract Attribute ::= Value; abstract Attribute ::= Value;
Version : Attribute; Version : Attribute;
......
...@@ -56,6 +56,7 @@ SPECIAL_TOKEN : /* COMMENTS */ ...@@ -56,6 +56,7 @@ SPECIAL_TOKEN : /* COMMENTS */
<DEFAULT, BOUNDS> TOKEN : /* RESERVED WORDS AND LITERALS */ <DEFAULT, BOUNDS> TOKEN : /* RESERVED WORDS AND LITERALS */
{ {
< OWL_ALLVALUESFROM : "owl:allValuesFrom" > < OWL_ALLVALUESFROM : "owl:allValuesFrom" >
| < OWL_ALLDIFFERENT : "owl:AllDifferent" >
| < OWL_CARDINALITY : "owl:cardinality" > | < OWL_CARDINALITY : "owl:cardinality" >
| < OWL_CLASS : "owl:Class" > | < OWL_CLASS : "owl:Class" >
| < OWL_DATARANGE : "owl:DataRange" > | < OWL_DATARANGE : "owl:DataRange" >
...@@ -118,7 +119,7 @@ SPECIAL_TOKEN : /* COMMENTS */ ...@@ -118,7 +119,7 @@ SPECIAL_TOKEN : /* COMMENTS */
| |
< #OCTAL_LITERAL: "0" (["0"-"7"])* > < #OCTAL_LITERAL: "0" (["0"-"7"])* >
| |
< FLOATING_POINT_LITERAL: < FLOAT_LITERAL:
(["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? (["f","F","d","D"])? (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? (["f","F","d","D"])?
| |
"." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])? "." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])?
...@@ -165,7 +166,7 @@ SPECIAL_TOKEN : /* COMMENTS */ ...@@ -165,7 +166,7 @@ SPECIAL_TOKEN : /* COMMENTS */
<DEFAULT, BOUNDS> TOKEN : /* IDENTIFIERS */ <DEFAULT, BOUNDS> TOKEN : /* IDENTIFIERS */
{ {
< IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* > < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>|"-")* >
| |
< #LETTER: < #LETTER:
[ [
...@@ -312,6 +313,7 @@ void Element() : {} ...@@ -312,6 +313,7 @@ void Element() : {}
void SimpleElement() : {} void SimpleElement() : {}
{ {
IntElement() IntElement()
| FloatElement()
| StringElement() | StringElement()
} }
...@@ -321,6 +323,12 @@ void IntElement() #IntElement : { Token t; } ...@@ -321,6 +323,12 @@ void IntElement() #IntElement : { Token t; }
{jjtThis.setINTEGER_LITERAL(t.image);} {jjtThis.setINTEGER_LITERAL(t.image);}
} }
void FloatElement() #FloatElement : { Token t; }
{
t = <FLOAT_LITERAL>
{jjtThis.setFLOAT_LITERAL(t.image);}
}
void StringElement() #StringElement : { Token t; } void StringElement() #StringElement : { Token t; }
{ {
t = <IDENTIFIER> t = <IDENTIFIER>
...@@ -330,6 +338,7 @@ void StringElement() #StringElement : { Token t; } ...@@ -330,6 +338,7 @@ void StringElement() #StringElement : { Token t; }
void OwlElement() : {} void OwlElement() : {}
{ {
OwlOntology() OwlOntology()
| OwlAllDifferent()
| OwlAllValuesFrom() | OwlAllValuesFrom()
| OwlCardinality() | OwlCardinality()
| OwlClass() | OwlClass()
...@@ -356,6 +365,12 @@ void OwlOntology() #OwlOntology : {} ...@@ -356,6 +365,12 @@ void OwlOntology() #OwlOntology : {}
(">" ElementList() "</" <OWL_ONTOLOGY> ">" | ElementList() "/>") (">" ElementList() "</" <OWL_ONTOLOGY> ">" | ElementList() "/>")
} }
void OwlAllDifferent() #OwlAllDifferent : {}
{
<OWL_ALLDIFFERENT> AttributeList()
(">" ElementList() "</" <OWL_ALLDIFFERENT> ">" | ElementList() "/>")
}
void OwlAllValuesFrom() #OwlAllValuesFrom : {} void OwlAllValuesFrom() #OwlAllValuesFrom : {}
{ {
<OWL_ALLVALUESFROM> AttributeList() <OWL_ALLVALUESFROM> AttributeList()
......
File moved
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment