| 1 |
#ifndef OWL2FUNCTIONALSTYLEPARSER_H |
| 2 |
#define OWL2FUNCTIONALSTYLEPARSER_H |
| 3 |
#include "JavaCC.h" |
| 4 |
#include "CharStream.h" |
| 5 |
#include "Token.h" |
| 6 |
#include "TokenManager.h" |
| 7 |
#include "OWL2FunctionalStyleParserTokenManager.h" |
| 8 |
#include "CJAVACCParser.h" |
| 9 |
|
| 10 |
#include "OWL2FunctionalStyleParserConstants.h" |
| 11 |
#include "ErrorHandler.h" |
| 12 |
namespace Konclude { |
| 13 |
namespace Parser { |
| 14 |
namespace FunctionalJAVACC { |
| 15 |
struct JJCalls { |
| 16 |
int gen; |
| 17 |
Token *first; |
| 18 |
int arg; |
| 19 |
JJCalls *next; |
| 20 |
~JJCalls() { if (next) delete next; } |
| 21 |
JJCalls() { next = NULL; arg = 0; gen = -1; first = NULL; } |
| 22 |
}; |
| 23 |
|
| 24 |
class OWL2FunctionalStyleParser : public CJAVACCParser { |
| 25 |
public: |
| 26 |
|
| 27 |
QString languageTag(); |
| 28 |
|
| 29 |
QString nodeId(); |
| 30 |
|
| 31 |
QString fullIri(); |
| 32 |
|
| 33 |
QString iri(); |
| 34 |
|
| 35 |
QString abbreviatedIri(); |
| 36 |
|
| 37 |
QString prefixName(); |
| 38 |
|
| 39 |
void ontologyAnnotations(); |
| 40 |
|
| 41 |
void ontologyDocument(); |
| 42 |
|
| 43 |
void prefixDeclaration(); |
| 44 |
|
| 45 |
void ontology(); |
| 46 |
|
| 47 |
QString ontologyIri(); |
| 48 |
|
| 49 |
QString versionIri(); |
| 50 |
|
| 51 |
void directlyImportsDocuments(); |
| 52 |
|
| 53 |
void axioms(); |
| 54 |
|
| 55 |
CBuildExpressionPtr owlClass(); |
| 56 |
|
| 57 |
CBuildExpressionPtr datatype(); |
| 58 |
|
| 59 |
CBuildExpressionPtr objectProperty(); |
| 60 |
|
| 61 |
CBuildExpressionPtr dataProperty(); |
| 62 |
|
| 63 |
CBuildExpressionPtr annotationProperty(); |
| 64 |
|
| 65 |
CBuildExpressionPtr individual(); |
| 66 |
|
| 67 |
CBuildExpressionPtr namedIndividual(); |
| 68 |
|
| 69 |
CBuildExpressionPtr anonymousIndividual(); |
| 70 |
|
| 71 |
CBuildExpressionPtr literal(bool annotation); |
| 72 |
|
| 73 |
QString quotedQString(); |
| 74 |
|
| 75 |
CBuildExpressionPtr declaration(); |
| 76 |
|
| 77 |
CBuildExpressionPtr entity(); |
| 78 |
|
| 79 |
CBuildExpressionPtr objectPropertyExpression(); |
| 80 |
|
| 81 |
CBuildExpressionPtr inverseObjectProperty(); |
| 82 |
|
| 83 |
CBuildExpressionPtr dataPropertyExpression(); |
| 84 |
|
| 85 |
CBuildExpressionPtr dataRange(); |
| 86 |
|
| 87 |
CEXPRESSIONLIST <CBuildExpressionPtr> dataRangeList(); |
| 88 |
|
| 89 |
CBuildExpressionPtr dataIntersectionOf(); |
| 90 |
|
| 91 |
CBuildExpressionPtr dataUnionOf(); |
| 92 |
|
| 93 |
CBuildExpressionPtr dataComplementOf(); |
| 94 |
|
| 95 |
CBuildExpressionPtr dataOneOf(); |
| 96 |
|
| 97 |
CBuildExpressionPtr datatypeRestriction(); |
| 98 |
|
| 99 |
CEXPRESSIONLIST <CBuildExpressionPtr> facetRestrictionList(); |
| 100 |
|
| 101 |
CBuildExpressionPtr facetRestriction(); |
| 102 |
|
| 103 |
CBuildExpressionPtr classExpression(); |
| 104 |
|
| 105 |
CBuildExpressionPtr objectIntersectionOf(); |
| 106 |
|
| 107 |
CBuildExpressionPtr objectUnionOf(); |
| 108 |
|
| 109 |
CBuildExpressionPtr objectComplementOf(); |
| 110 |
|
| 111 |
CBuildExpressionPtr objectOneOf(); |
| 112 |
|
| 113 |
CBuildExpressionPtr objectSomeValuesFrom(); |
| 114 |
|
| 115 |
CBuildExpressionPtr objectAllValuesFrom(); |
| 116 |
|
| 117 |
CBuildExpressionPtr objectHasValue(); |
| 118 |
|
| 119 |
CBuildExpressionPtr objectHasSelf(); |
| 120 |
|
| 121 |
CBuildExpressionPtr objectMinCardinality(); |
| 122 |
|
| 123 |
CBuildExpressionPtr objectMaxCardinality(); |
| 124 |
|
| 125 |
CBuildExpressionPtr objectExactCardinality(); |
| 126 |
|
| 127 |
CBuildExpressionPtr dataSomeValuesFrom(); |
| 128 |
|
| 129 |
CBuildExpressionPtr dataAllValuesFrom(); |
| 130 |
|
| 131 |
CBuildExpressionPtr dataHasValue(); |
| 132 |
|
| 133 |
CBuildExpressionPtr dataMinCardinality(); |
| 134 |
|
| 135 |
CBuildExpressionPtr dataMaxCardinality(); |
| 136 |
|
| 137 |
CBuildExpressionPtr dataExactCardinality(); |
| 138 |
|
| 139 |
CBuildExpressionPtr axiom(); |
| 140 |
|
| 141 |
void axiomAnnotations(); |
| 142 |
|
| 143 |
CBuildExpressionPtr classAxiom(); |
| 144 |
|
| 145 |
CBuildExpressionPtr subClassOf(); |
| 146 |
|
| 147 |
CBuildExpressionPtr equivalentClasses(); |
| 148 |
|
| 149 |
CBuildExpressionPtr disjointClasses(); |
| 150 |
|
| 151 |
CBuildExpressionPtr disjointUnion(); |
| 152 |
|
| 153 |
CEXPRESSIONLIST <CBuildExpressionPtr> classExpressionList(); |
| 154 |
|
| 155 |
CBuildExpressionPtr objectPropertyAxiom(); |
| 156 |
|
| 157 |
CBuildExpressionPtr subObjectPropertyOf(); |
| 158 |
|
| 159 |
CBuildExpressionPtr propertyExpressionChain(); |
| 160 |
|
| 161 |
CBuildExpressionPtr equivalentObjectProperties(); |
| 162 |
|
| 163 |
CBuildExpressionPtr disjointObjectProperties(); |
| 164 |
|
| 165 |
CEXPRESSIONLIST <CBuildExpressionPtr> objectPropertyExpressionList(); |
| 166 |
|
| 167 |
CBuildExpressionPtr inverseObjectProperties(); |
| 168 |
|
| 169 |
CBuildExpressionPtr objectPropertyDomain(); |
| 170 |
|
| 171 |
CBuildExpressionPtr objectPropertyRange(); |
| 172 |
|
| 173 |
CBuildExpressionPtr functionalObjectProperty(); |
| 174 |
|
| 175 |
CBuildExpressionPtr inverseFunctionalObjectProperty(); |
| 176 |
|
| 177 |
CBuildExpressionPtr reflexiveObjectProperty(); |
| 178 |
|
| 179 |
CBuildExpressionPtr irreflexiveObjectProperty(); |
| 180 |
|
| 181 |
CBuildExpressionPtr symmetricObjectProperty(); |
| 182 |
|
| 183 |
CBuildExpressionPtr asymmetricObjectProperty(); |
| 184 |
|
| 185 |
CBuildExpressionPtr transitiveObjectProperty(); |
| 186 |
|
| 187 |
CBuildExpressionPtr dataPropertyAxiom(); |
| 188 |
|
| 189 |
CBuildExpressionPtr subDataPropertyOf(); |
| 190 |
|
| 191 |
CBuildExpressionPtr equivalentDataProperties(); |
| 192 |
|
| 193 |
CBuildExpressionPtr disjointDataProperties(); |
| 194 |
|
| 195 |
CEXPRESSIONLIST <CBuildExpressionPtr> dataPropertyExpressionList(); |
| 196 |
|
| 197 |
CBuildExpressionPtr dataPropertyDomain(); |
| 198 |
|
| 199 |
CBuildExpressionPtr dataPropertyRange(); |
| 200 |
|
| 201 |
CBuildExpressionPtr functionalDataProperty(); |
| 202 |
|
| 203 |
CBuildExpressionPtr datatypeDefinition(); |
| 204 |
|
| 205 |
CBuildExpressionPtr hasKey(); |
| 206 |
|
| 207 |
CBuildExpressionPtr assertion(); |
| 208 |
|
| 209 |
CBuildExpressionPtr sameIndividual(); |
| 210 |
|
| 211 |
CBuildExpressionPtr differentIndividuals(); |
| 212 |
|
| 213 |
CEXPRESSIONLIST <CBuildExpressionPtr> individualList(); |
| 214 |
|
| 215 |
CBuildExpressionPtr classAssertion(); |
| 216 |
|
| 217 |
CBuildExpressionPtr objectPropertyAssertion(); |
| 218 |
|
| 219 |
CBuildExpressionPtr negativeObjectPropertyAssertion(); |
| 220 |
|
| 221 |
CBuildExpressionPtr dataPropertyAssertion(); |
| 222 |
|
| 223 |
CBuildExpressionPtr negativeDataPropertyAssertion(); |
| 224 |
|
| 225 |
CBuildExpressionPtr annotation(); |
| 226 |
|
| 227 |
void annotationAnnotations(); |
| 228 |
|
| 229 |
CBuildExpressionPtr annotationValue(); |
| 230 |
|
| 231 |
CBuildExpressionPtr annotationAxiom(); |
| 232 |
|
| 233 |
CBuildExpressionPtr annotationAssertion(); |
| 234 |
|
| 235 |
CBuildExpressionPtr annotationSubject(); |
| 236 |
|
| 237 |
CBuildExpressionPtr subAnnotationPropertyOf(); |
| 238 |
|
| 239 |
CBuildExpressionPtr annotationPropertyDomain(); |
| 240 |
|
| 241 |
CBuildExpressionPtr annotationPropertyRange(); |
| 242 |
public: TokenManager *token_source; |
| 243 |
public: CharStream *jj_input_stream; |
| 244 |
/** Current token. */ |
| 245 |
public: Token *token; |
| 246 |
/** Next token. */ |
| 247 |
public: Token *jj_nt; |
| 248 |
private: int jj_ntk; |
| 249 |
private: JJCalls jj_2_rtns[1]; |
| 250 |
private: bool jj_rescan; |
| 251 |
private: int jj_gc; |
| 252 |
private: Token *jj_scanpos, *jj_lastpos; |
| 253 |
private: int jj_la; |
| 254 |
/** Whether we are looking ahead. */ |
| 255 |
private: bool jj_lookingAhead; |
| 256 |
private: bool jj_semLA; |
| 257 |
private: int jj_gen; |
| 258 |
private: int jj_la1[42]; |
| 259 |
private: ErrorHandler *errorHandler; |
| 260 |
private: bool errorHandlerCreated; |
| 261 |
protected: bool hasError; |
| 262 |
public: void setErrorHandler(ErrorHandler *eh) { |
| 263 |
if (errorHandlerCreated) delete errorHandler; |
| 264 |
errorHandler = eh; |
| 265 |
errorHandlerCreated = false; |
| 266 |
} |
| 267 |
Token *head; |
| 268 |
public: |
| 269 |
|
| 270 |
OWL2FunctionalStyleParser(TokenManager *tm); |
| 271 |
public: virtual ~OWL2FunctionalStyleParser(); |
| 272 |
|
| 273 |
void ReInit(TokenManager *tm); |
| 274 |
|
| 275 |
Token * jj_consume_token(int kind); |
| 276 |
|
| 277 |
Token * getNextToken(); |
| 278 |
|
| 279 |
Token * getToken(int index); |
| 280 |
|
| 281 |
int jj_ntk_f(); |
| 282 |
private: int jj_kind; |
| 283 |
int **jj_expentries; |
| 284 |
int *jj_expentry; |
| 285 |
|
| 286 |
/** Generate ParseException. */ |
| 287 |
|
| 288 |
protected: virtual void parseError(); |
| 289 |
private: int trace_indent; |
| 290 |
private: bool trace_enabled; |
| 291 |
/** Enable tracing. */ |
| 292 |
|
| 293 |
public: void enable_tracing(); |
| 294 |
|
| 295 |
public: void disable_tracing(); |
| 296 |
public: |
| 297 |
inline COntologyBuilder* getBuilder() { |
| 298 |
return mBuilder; |
| 299 |
} |
| 300 |
|
| 301 |
protected: |
| 302 |
COntologyBuilder* mBuilder;private: bool jj_done; |
| 303 |
|
| 304 |
}; |
| 305 |
} |
| 306 |
} |
| 307 |
} |
| 308 |
#endif |