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

Can now parse ontology v0.6 from IPA

parent cf190438
......@@ -17,6 +17,7 @@ RdfsRange : ComplexElement;
RdfsSubClassOf : ComplexElement;
RdfsSubPropertyOf : ComplexElement;
OwlOntology : ComplexElement;
OwlAllDifferent : ComplexElement;
OwlAllValuesFrom : ComplexElement;
OwlCardinality : ComplexElement;
OwlClass : ComplexElement;
......@@ -39,6 +40,7 @@ OwlUnionOf : ComplexElement;
abstract SimpleElement : Element;
StringElement : SimpleElement ::= <IDENTIFIER>;
IntElement : SimpleElement ::= <INTEGER_LITERAL>;
FloatElement : SimpleElement ::= <FLOAT_LITERAL>;
abstract Attribute ::= Value;
Version : Attribute;
......
......@@ -56,6 +56,7 @@ SPECIAL_TOKEN : /* COMMENTS */
<DEFAULT, BOUNDS> TOKEN : /* RESERVED WORDS AND LITERALS */
{
< OWL_ALLVALUESFROM : "owl:allValuesFrom" >
| < OWL_ALLDIFFERENT : "owl:AllDifferent" >
| < OWL_CARDINALITY : "owl:cardinality" >
| < OWL_CLASS : "owl:Class" >
| < OWL_DATARANGE : "owl:DataRange" >
......@@ -118,7 +119,7 @@ SPECIAL_TOKEN : /* COMMENTS */
|
< #OCTAL_LITERAL: "0" (["0"-"7"])* >
|
< FLOATING_POINT_LITERAL:
< FLOAT_LITERAL:
(["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? (["f","F","d","D"])?
|
"." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])?
......@@ -165,7 +166,7 @@ SPECIAL_TOKEN : /* COMMENTS */
<DEFAULT, BOUNDS> TOKEN : /* IDENTIFIERS */
{
< IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* >
< IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>|"-")* >
|
< #LETTER:
[
......@@ -312,6 +313,7 @@ void Element() : {}
void SimpleElement() : {}
{
IntElement()
| FloatElement()
| StringElement()
}
......@@ -321,6 +323,12 @@ void IntElement() #IntElement : { Token t; }
{jjtThis.setINTEGER_LITERAL(t.image);}
}
void FloatElement() #FloatElement : { Token t; }
{
t = <FLOAT_LITERAL>
{jjtThis.setFLOAT_LITERAL(t.image);}
}
void StringElement() #StringElement : { Token t; }
{
t = <IDENTIFIER>
......@@ -330,6 +338,7 @@ void StringElement() #StringElement : { Token t; }
void OwlElement() : {}
{
OwlOntology()
| OwlAllDifferent()
| OwlAllValuesFrom()
| OwlCardinality()
| OwlClass()
......@@ -356,6 +365,12 @@ void OwlOntology() #OwlOntology : {}
(">" ElementList() "</" <OWL_ONTOLOGY> ">" | ElementList() "/>")
}
void OwlAllDifferent() #OwlAllDifferent : {}
{
<OWL_ALLDIFFERENT> AttributeList()
(">" ElementList() "</" <OWL_ALLDIFFERENT> ">" | ElementList() "/>")
}
void OwlAllValuesFrom() #OwlAllValuesFrom : {}
{
<OWL_ALLVALUESFROM> AttributeList()
......@@ -648,4 +663,4 @@ void Value() #Value : { Token t; }
{
t = <STRING_LITERAL>
{jjtThis.setSTRING_LITERAL(t.image);}
}
\ No newline at end of file
}
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