org.semanticweb.owl.io.abstract_syntax
Class ANTLRParser

java.lang.Object
  |
  +--antlr.Parser
        |
        +--antlr.LLkParser
              |
              +--org.semanticweb.owl.io.abstract_syntax.ANTLRParser
All Implemented Interfaces:
ANTLRParserTokenTypes

public class ANTLRParser
extends antlr.LLkParser
implements ANTLRParserTokenTypes

ANTLR generated parser for OWL abstract syntax. It is invoked by AbstractOWLParser which implements Parser. Builds two tables: a namespaceTable with all name spaces used in the ontology and an idsTable with the types of the OWLPropertys which can be inferred from the ontology. While parsing an ontology, builds a corresponding OWLOntology using the utility class OWLBuilder.

Generated by ANTLR from file abstract-owl.g. Relies on AbstractOWLLexer.

Warning: ObjectProperty and DatatypeProperty entities have to be defined before they can be used. Eg:


Field Summary
static String[] _tokenNames
           
static antlr.collections.impl.BitSet _tokenSet_0
           
static antlr.collections.impl.BitSet _tokenSet_1
           
static antlr.collections.impl.BitSet _tokenSet_10
           
static antlr.collections.impl.BitSet _tokenSet_11
           
static antlr.collections.impl.BitSet _tokenSet_12
           
static antlr.collections.impl.BitSet _tokenSet_13
           
static antlr.collections.impl.BitSet _tokenSet_14
           
static antlr.collections.impl.BitSet _tokenSet_15
           
static antlr.collections.impl.BitSet _tokenSet_16
           
static antlr.collections.impl.BitSet _tokenSet_17
           
static antlr.collections.impl.BitSet _tokenSet_18
           
static antlr.collections.impl.BitSet _tokenSet_19
           
static antlr.collections.impl.BitSet _tokenSet_2
           
static antlr.collections.impl.BitSet _tokenSet_20
           
static antlr.collections.impl.BitSet _tokenSet_21
           
static antlr.collections.impl.BitSet _tokenSet_22
           
static antlr.collections.impl.BitSet _tokenSet_23
           
static antlr.collections.impl.BitSet _tokenSet_24
           
static antlr.collections.impl.BitSet _tokenSet_25
           
static antlr.collections.impl.BitSet _tokenSet_3
           
static antlr.collections.impl.BitSet _tokenSet_4
           
static antlr.collections.impl.BitSet _tokenSet_5
           
static antlr.collections.impl.BitSet _tokenSet_6
           
static antlr.collections.impl.BitSet _tokenSet_7
           
static antlr.collections.impl.BitSet _tokenSet_8
           
static antlr.collections.impl.BitSet _tokenSet_9
           
static String ANN_PROP
           
static int ANN_PROP_INT
           
 OWLBuilder builder
          Main helper to build the OWLOntology.
static int DATA_PROP_INT
           
static String DATA_PROPERTY
           
static String OBJ_PROP
           
static int OBJ_PROP_INT
           
static int ONT_PROP_INT
           
static String ONTO_PROP
           
static URI RDFS_LIT_URI
           
 
Fields inherited from class antlr.Parser
astFactory, inputState, returnAST, tokenNames, tokenTypeToASTClassMap, traceDepth
 
Fields inherited from interface org.semanticweb.owl.io.abstract_syntax.ANTLRParserTokenTypes
ALL_VALUES_FROM, ANNOTATION, ANNOTATION_LOWER, ANNOTATION_PROPERTY, ARABIC_DIGIT, AT, CARD, CARDINALITY, CLASS, COLON, COMPLEMENT_OF, COMPLETE, DASH, DATATYPE, DATATYPE_PROPERTY, DEPRECATED, DIFFERENT_INDIVIDUALS, DIGIT_NON_ARABIC, DISJOINT_CLASSES, DOMAIN, DOUBLE_CARET, ENUMERATED_CLASS, EOF, EQUAL, EQUIVALENT_CLASSES, EQUIVALENT_PROPERTIES, ESC, FUNCTIONAL, INDIVIDUAL, INTERSECTION_OF, INVERSE_FUNCTIONAL, INVERSE_OF, LANGLE, LANGUAGE, LETTER, LOCAL_NAME, LOWER_ROMAN, LPAREN, MAX_CARDINALITY, MIN_CARDINALITY, ML_COMMENT, NAMESPACE, NULL_TREE_LOOKAHEAD, OBJECT_PROPERTY, ONE_OF, ONTOLOGY, ONTOLOGY_PROPERTY, ORDER_ENFORCING_DUMMY_TOKEN, PARTIAL, PLUS, PREFIX, QUOTE, QUOTED_STRING, RANGE, RANGLE, RDFSLITERAL, REF_PREFIX, RESTRICTION, RPAREN, SAME_INDIVIDUAL, SL_COMMENT, SOME_VALUES_FROM, SUB_CLASS_OF, SUB_PROPERTY_OF, SUPER, SYMMETRIC, TRANSITIVE, TYPE, UNDERSCORE, UNION_OF, URI_ID, VALUE, VOCAB, WS
 
Constructor Summary
  ANTLRParser(antlr.ParserSharedInputState state)
           
  ANTLRParser(antlr.TokenBuffer tokenBuf)
           
protected ANTLRParser(antlr.TokenBuffer tokenBuf, int k)
           
  ANTLRParser(antlr.TokenStream lexer)
           
protected ANTLRParser(antlr.TokenStream lexer, int k)
           
 
Method Summary
 OWLBuilder.AnnotationComponent annotation()
          Rule.
 OWLAnnotationProperty annotationProperty()
          Rule.
 URI annotationPropertyID()
          Rule.
 void axiom()
          Rule.
 OWLBuilder.CardinalityComponent cardinality()
          Rule.
 URI classID()
          Rule.
 OWLDataValue dataLiteral()
          Rule.
 OWLDataRange dataRange()
          Rule.
 OWLBuilder.RestrictionComponent dataRestrictionComponent()
          Rule.
 OWLDataType dataType()
          Rule.
 URI datatypeID()
          Rule.
 OWLDataProperty dataTypeProperty()
          Rule.
 OWLDataValue datatypeString()
          Rule.
 URI datavaluedPropertyID()
          Rule.
 OWLDescription description()
          Rule.
 void directive()
          Rule.
 void disjointClasses()
          Rule.
 OWLClass enumeratedClass()
          Rule.
 void equivalentClasses()
          Rule.
 void equivalentProperties()
          Rule.
 OWLDescription externalDescription(OWLBuilder newBuilder, Map newIdsTable, Map newNamespaceTable)
          Invoked by AbstractOWLParser.parseDescription(Reader).
 void fact()
          Rule.
 Map getIdsTable()
          Get the IdsTable value.
 Map getNamespaceTable()
          Get the NamespaceTable value.
 OWLIndividual individual()
          Rule.
 URI individualID()
          Rule.
 OWLBuilder.RestrictionComponent individualRestrictionComponent()
          Rule.
 URI individualvaluedPropertyID()
          Rule.
 int inferPropertyType(Set ids)
          Compares the Strings in ids with the keys in idsTable and returns the first not null type in the form of one of DATA_PROP_INT, OBJ_PROP_INT, ANN_PROP_INT, ONT_PROP_INT.
 boolean modality()
          Rule.
 void namespace()
          Namespace rule: populates namespaceTable.
 OWLObjectProperty objectProperty()
          Rule.
 OWLOntology ontology(URI physicalURI, OWLBuilder builder)
          Starting rule.
 URI ontologyID()
          Rule.
 void ontologyProperty()
          Rule.
 URI ontologyPropertyID()
          Rule.
 OWLClass owlClass()
          Rule.
 String[] qname()
          Rule.
 OWLRestriction restriction()
          Rule.
 void setIdsTable(Map newIdsTable)
          Set the IdsTable value.
 void setNamespaceTable(Map newNamespaceTable)
          Set the NamespaceTable value.
 void setPropertyHandler(SomeUndefinedOWLPropertyHandler handler)
          Sets the propertyHandler property to handler.
 void subClass()
          Rule.
 void subprop()
          Rule.
 OWLDescription type()
          Rule.
 URI uriReference()
          Rule.
 OWLBuilder.PropertyValue value()
          Rule.
 
Methods inherited from class antlr.LLkParser
consume, LA, LT, traceIn, traceOut
 
Methods inherited from class antlr.Parser
addMessageListener, addParserListener, addParserMatchListener, addParserTokenListener, addSemanticPredicateListener, addSyntacticPredicateListener, addTraceListener, consumeUntil, consumeUntil, defaultDebuggingSetup, getAST, getASTFactory, getFilename, getInputState, getTokenName, getTokenNames, getTokenTypeToASTClassMap, isDebugMode, mark, match, match, matchNot, panic, removeMessageListener, removeParserListener, removeParserMatchListener, removeParserTokenListener, removeSemanticPredicateListener, removeSyntacticPredicateListener, removeTraceListener, reportError, reportError, reportWarning, rewind, setASTFactory, setASTNodeClass, setASTNodeType, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIndent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

builder

public OWLBuilder builder
Main helper to build the OWLOntology.


DATA_PROPERTY

public static final String DATA_PROPERTY
See Also:
Constant Field Values

OBJ_PROP

public static final String OBJ_PROP
See Also:
Constant Field Values

ANN_PROP

public static final String ANN_PROP
See Also:
Constant Field Values

ONTO_PROP

public static final String ONTO_PROP
See Also:
Constant Field Values

RDFS_LIT_URI

public static final URI RDFS_LIT_URI

DATA_PROP_INT

public static final int DATA_PROP_INT
See Also:
Constant Field Values

OBJ_PROP_INT

public static final int OBJ_PROP_INT
See Also:
Constant Field Values

ANN_PROP_INT

public static final int ANN_PROP_INT
See Also:
Constant Field Values

ONT_PROP_INT

public static final int ONT_PROP_INT
See Also:
Constant Field Values

_tokenNames

public static final String[] _tokenNames

_tokenSet_0

public static final antlr.collections.impl.BitSet _tokenSet_0

_tokenSet_1

public static final antlr.collections.impl.BitSet _tokenSet_1

_tokenSet_2

public static final antlr.collections.impl.BitSet _tokenSet_2

_tokenSet_3

public static final antlr.collections.impl.BitSet _tokenSet_3

_tokenSet_4

public static final antlr.collections.impl.BitSet _tokenSet_4

_tokenSet_5

public static final antlr.collections.impl.BitSet _tokenSet_5

_tokenSet_6

public static final antlr.collections.impl.BitSet _tokenSet_6

_tokenSet_7

public static final antlr.collections.impl.BitSet _tokenSet_7

_tokenSet_8

public static final antlr.collections.impl.BitSet _tokenSet_8

_tokenSet_9

public static final antlr.collections.impl.BitSet _tokenSet_9

_tokenSet_10

public static final antlr.collections.impl.BitSet _tokenSet_10

_tokenSet_11

public static final antlr.collections.impl.BitSet _tokenSet_11

_tokenSet_12

public static final antlr.collections.impl.BitSet _tokenSet_12

_tokenSet_13

public static final antlr.collections.impl.BitSet _tokenSet_13

_tokenSet_14

public static final antlr.collections.impl.BitSet _tokenSet_14

_tokenSet_15

public static final antlr.collections.impl.BitSet _tokenSet_15

_tokenSet_16

public static final antlr.collections.impl.BitSet _tokenSet_16

_tokenSet_17

public static final antlr.collections.impl.BitSet _tokenSet_17

_tokenSet_18

public static final antlr.collections.impl.BitSet _tokenSet_18

_tokenSet_19

public static final antlr.collections.impl.BitSet _tokenSet_19

_tokenSet_20

public static final antlr.collections.impl.BitSet _tokenSet_20

_tokenSet_21

public static final antlr.collections.impl.BitSet _tokenSet_21

_tokenSet_22

public static final antlr.collections.impl.BitSet _tokenSet_22

_tokenSet_23

public static final antlr.collections.impl.BitSet _tokenSet_23

_tokenSet_24

public static final antlr.collections.impl.BitSet _tokenSet_24

_tokenSet_25

public static final antlr.collections.impl.BitSet _tokenSet_25
Constructor Detail

ANTLRParser

protected ANTLRParser(antlr.TokenBuffer tokenBuf,
                      int k)

ANTLRParser

public ANTLRParser(antlr.TokenBuffer tokenBuf)

ANTLRParser

protected ANTLRParser(antlr.TokenStream lexer,
                      int k)

ANTLRParser

public ANTLRParser(antlr.TokenStream lexer)

ANTLRParser

public ANTLRParser(antlr.ParserSharedInputState state)
Method Detail

getIdsTable

public Map getIdsTable()
Get the IdsTable value.

Returns:
the IdsTable value.

setIdsTable

public void setIdsTable(Map newIdsTable)
Set the IdsTable value.

Parameters:
newIdsTable - The new IdsTable value.

getNamespaceTable

public Map getNamespaceTable()
Get the NamespaceTable value.

Returns:
the NamespaceTable value.

setNamespaceTable

public void setNamespaceTable(Map newNamespaceTable)
Set the NamespaceTable value.

Parameters:
newNamespaceTable - The new NamespaceTable value.

setPropertyHandler

public void setPropertyHandler(SomeUndefinedOWLPropertyHandler handler)
Sets the propertyHandler property to handler.

Parameters:
handler - a SomeUndefinedOWLPropertyHandler value

inferPropertyType

public int inferPropertyType(Set ids)
                      throws UndefinedOWLPropertyException,
                             UndefinedOWLPropertyTypeException,
                             SomeUndefinedOWLPropertyException
Compares the Strings in ids with the keys in idsTable and returns the first not null type in the form of one of DATA_PROP_INT, OBJ_PROP_INT, ANN_PROP_INT, ONT_PROP_INT.

Parameters:
ids - a Set of Strings corresponding to property uris.
Throws:
UndefinedOWLPropertyException - if no property type is defined.
SomeUndefinedOWLPropertyException - if the property type can be inferred but some properties are undefined; the exception might beeen have handled by the SomeUndefinedOWLPropertyHandler though.
UndefinedOWLPropertyTypeException

ontology

public final OWLOntology ontology(URI physicalURI,
                                  OWLBuilder builder)
                           throws antlr.RecognitionException,
                                  antlr.TokenStreamException,
                                  OWLException
Starting rule. Parses an OWL abstract syntax ontology and returns the corresponding OWLOntology.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

namespace

public final void namespace()
                     throws antlr.RecognitionException,
                            antlr.TokenStreamException
Namespace rule: populates namespaceTable.

antlr.RecognitionException
antlr.TokenStreamException

ontologyID

public final URI ontologyID()
                     throws antlr.RecognitionException,
                            antlr.TokenStreamException,
                            MalformedOWLURIException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
MalformedOWLURIException

directive

public final void directive()
                     throws antlr.RecognitionException,
                            antlr.TokenStreamException,
                            OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

annotationPropertyID

public final URI annotationPropertyID()
                               throws antlr.RecognitionException,
                                      antlr.TokenStreamException,
                                      MalformedOWLURIException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
MalformedOWLURIException

uriReference

public final URI uriReference()
                       throws antlr.RecognitionException,
                              antlr.TokenStreamException,
                              MalformedOWLURIException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
MalformedOWLURIException

individual

public final OWLIndividual individual()
                               throws antlr.RecognitionException,
                                      antlr.TokenStreamException,
                                      OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

dataLiteral

public final OWLDataValue dataLiteral()
                               throws antlr.RecognitionException,
                                      antlr.TokenStreamException,
                                      OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

fact

public final void fact()
                throws antlr.RecognitionException,
                       antlr.TokenStreamException,
                       OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

axiom

public final void axiom()
                 throws antlr.RecognitionException,
                        antlr.TokenStreamException,
                        OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

individualID

public final URI individualID()
                       throws antlr.RecognitionException,
                              antlr.TokenStreamException,
                              MalformedOWLURIException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
MalformedOWLURIException

annotation

public final OWLBuilder.AnnotationComponent annotation()
                                                throws antlr.RecognitionException,
                                                       antlr.TokenStreamException,
                                                       OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

type

public final OWLDescription type()
                          throws antlr.RecognitionException,
                                 antlr.TokenStreamException,
                                 OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

value

public final OWLBuilder.PropertyValue value()
                                     throws antlr.RecognitionException,
                                            antlr.TokenStreamException,
                                            OWLException
Rule. Assumes the first property in the value expression has been already defined. If it is not a datatype property it assumes it is an object property.

Throws:
UndefinedOWLPropertyException - if the first property is not defined.
antlr.RecognitionException
antlr.TokenStreamException
OWLException

description

public final OWLDescription description()
                                 throws antlr.RecognitionException,
                                        antlr.TokenStreamException,
                                        OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

owlClass

public final OWLClass owlClass()
                        throws antlr.RecognitionException,
                               antlr.TokenStreamException,
                               OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

enumeratedClass

public final OWLClass enumeratedClass()
                               throws antlr.RecognitionException,
                                      antlr.TokenStreamException,
                                      OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

disjointClasses

public final void disjointClasses()
                           throws antlr.RecognitionException,
                                  antlr.TokenStreamException,
                                  OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

equivalentClasses

public final void equivalentClasses()
                             throws antlr.RecognitionException,
                                    antlr.TokenStreamException,
                                    OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

subClass

public final void subClass()
                    throws antlr.RecognitionException,
                           antlr.TokenStreamException,
                           OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

dataType

public final OWLDataType dataType()
                           throws antlr.RecognitionException,
                                  antlr.TokenStreamException,
                                  OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

dataTypeProperty

public final OWLDataProperty dataTypeProperty()
                                       throws antlr.RecognitionException,
                                              antlr.TokenStreamException,
                                              OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

objectProperty

public final OWLObjectProperty objectProperty()
                                       throws antlr.RecognitionException,
                                              antlr.TokenStreamException,
                                              OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

annotationProperty

public final OWLAnnotationProperty annotationProperty()
                                               throws antlr.RecognitionException,
                                                      antlr.TokenStreamException,
                                                      OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

ontologyProperty

public final void ontologyProperty()
                            throws antlr.RecognitionException,
                                   antlr.TokenStreamException,
                                   OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

equivalentProperties

public final void equivalentProperties()
                                throws antlr.RecognitionException,
                                       antlr.TokenStreamException,
                                       OWLException
Rule.

Throws:
UndefinedOWLPropertyException - if none of the properties is defined.
MalformedOWLPropertyURIException - if one of the properties is not a well formed URI.
antlr.RecognitionException
antlr.TokenStreamException
OWLException

subprop

public final void subprop()
                   throws antlr.RecognitionException,
                          antlr.TokenStreamException,
                          OWLException
Rule.

Throws:
UndefinedOWLPropertyException - if neither of the properties is defined.
MalformedOWLPropertyURIException - if one of the two properties is not a well formed URI.
antlr.RecognitionException
antlr.TokenStreamException
OWLException

classID

public final URI classID()
                  throws antlr.RecognitionException,
                         antlr.TokenStreamException,
                         MalformedOWLURIException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
MalformedOWLURIException

modality

public final boolean modality()
                       throws antlr.RecognitionException,
                              antlr.TokenStreamException
Rule. Returns true is the modality is partial.

antlr.RecognitionException
antlr.TokenStreamException

datatypeID

public final URI datatypeID()
                     throws antlr.RecognitionException,
                            antlr.TokenStreamException,
                            MalformedOWLURIException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
MalformedOWLURIException

datavaluedPropertyID

public final URI datavaluedPropertyID()
                               throws antlr.RecognitionException,
                                      antlr.TokenStreamException,
                                      MalformedOWLURIException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
MalformedOWLURIException

dataRange

public final OWLDataRange dataRange()
                             throws antlr.RecognitionException,
                                    antlr.TokenStreamException,
                                    OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

individualvaluedPropertyID

public final URI individualvaluedPropertyID()
                                     throws antlr.RecognitionException,
                                            antlr.TokenStreamException,
                                            MalformedOWLURIException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
MalformedOWLURIException

ontologyPropertyID

public final URI ontologyPropertyID()
                             throws antlr.RecognitionException,
                                    antlr.TokenStreamException,
                                    MalformedOWLURIException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
MalformedOWLURIException

externalDescription

public final OWLDescription externalDescription(OWLBuilder newBuilder,
                                                Map newIdsTable,
                                                Map newNamespaceTable)
                                         throws antlr.RecognitionException,
                                                antlr.TokenStreamException,
                                                OWLException
Invoked by AbstractOWLParser.parseDescription(Reader). Returns the OWLDescription corresponding to the description in the Reader using newBuilder and newIdsTable.

Parameters:
newBuilder - the OWLBuilder used to build the description.
newIdsTable - the table of ids used to disambiguate the property types.
antlr.RecognitionException
antlr.TokenStreamException
OWLException

restriction

public final OWLRestriction restriction()
                                 throws antlr.RecognitionException,
                                        antlr.TokenStreamException,
                                        OWLException
Rule. Assumes the first property in the restriction is defined in the ontology. If it is not a datatype property it assumes it is an object property.

Throws:
UndefinedOWLPropertyException - if the property is not defined.
antlr.RecognitionException
antlr.TokenStreamException
OWLException

dataRestrictionComponent

public final OWLBuilder.RestrictionComponent dataRestrictionComponent()
                                                               throws antlr.RecognitionException,
                                                                      antlr.TokenStreamException,
                                                                      OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

individualRestrictionComponent

public final OWLBuilder.RestrictionComponent individualRestrictionComponent()
                                                                     throws antlr.RecognitionException,
                                                                            antlr.TokenStreamException,
                                                                            OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

cardinality

public final OWLBuilder.CardinalityComponent cardinality()
                                                  throws antlr.RecognitionException,
                                                         antlr.TokenStreamException
Rule.

antlr.RecognitionException
antlr.TokenStreamException

datatypeString

public final OWLDataValue datatypeString()
                                  throws antlr.RecognitionException,
                                         antlr.TokenStreamException,
                                         OWLException
Rule.

antlr.RecognitionException
antlr.TokenStreamException
OWLException

qname

public final String[] qname()
                     throws antlr.RecognitionException,
                            antlr.TokenStreamException
Rule.

antlr.RecognitionException
antlr.TokenStreamException


WonderWeb