Commit 8483d772 authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Can now parse ontology v0.6 from IPA

parent cf190438
...@@ -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()
...@@ -648,4 +663,4 @@ void Value() #Value : { Token t; } ...@@ -648,4 +663,4 @@ void Value() #Value : { Token t; }
{ {
t = <STRING_LITERAL> t = <STRING_LITERAL>
{jjtThis.setSTRING_LITERAL(t.image);} {jjtThis.setSTRING_LITERAL(t.image);}
} }
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Supports Markdown
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