owl.jjt 27.1 KB
Newer Older
1
/* -*-Java-*- */
2 3 4 5 6 7 8

/* 
 * Copyright (C) 2006  Anders Nilsson <anders.nilsson@cs.lth.se>
 *
 * This file is part of OntologyCompiler.
 */

9 10 11 12 13
options {
    MULTI                       = true;
    VISITOR                     = true;
    NODE_DEFAULT_VOID           = true;
    NODE_SCOPE_HOOK             = false;
14
    NODE_PREFIX                 = "";
15 16
    JAVA_UNICODE_ESCAPE         = true;
    STATIC                      = false;
17 18 19
//  	DEBUG_PARSER                = true;
// 	DEBUG_LOOKAHEAD             = true;
//  	DEBUG_TOKEN_MANAGER         = true;
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
} // options


PARSER_BEGIN(OwlParser)
package AST;
public class OwlParser {
}
PARSER_END(OwlParser)


//--------------------------------------------------------------------//
//                           LEXICAL TOKENS                           //
//--------------------------------------------------------------------//

<DEFAULT, BOUNDS> SKIP : /* WHITE SPACE */
{
    " "
    |
    "\t"
    |
    "\n"
    |
    "\r"
    |
    "\f"
}// WHITE SPACE


// <DEFAULT,BOUNDS> SPECIAL_TOKEN : /* COMMENTS */
// {
//     <SLASH_SLASH_COMMENT :  "//" (~["\n","\r"])* >
// }

SPECIAL_TOKEN : /* COMMENTS */
{
//     <SLASH_STAR_COMMENT  :  "/*" (~["*"])* "*" ("*" | (~["*","/"] (~["*"])* "*"))* "/"  >
56
< "<!--" ( ~["-"] | ( "-" ~["-"] ) )* "-->">
57
	| < "<rdfs:comment" ( ~["<"] | ( "<" ~["/"] ) )* "</rdfs:comment>" >
58
	| < "<!DOCTYPE rdf:RDF [" ( ~["]"] )* "]>" > 
59
//     <XML_COMMENT  :  "<!--" (~["-","-",">"])* "-->"  >
60 61 62
}// COMMENTS


63 64 65 66
// <BOUNDS> TOKEN: {
//     < BEGINCOMMENT : "<!--"     >
//   | < ENDCOMMENT   : "-->"     >
// }
67 68 69

<DEFAULT, BOUNDS> TOKEN : /* RESERVED WORDS AND LITERALS */
{
70 71 72 73
    < LIST_FIRST              : "list:first" >
  | < LIST_REST               : "list:rest" >
  | < EXPR_KIFCONDITION       : "expr:KIF-Condition" >
  | < EXPR_EXPRESSIONDATA     : "expr:expressionData" >
74 75 76 77
  | < EXPRESSION_CONDITION     : "Expression:Condition" >
  | < EXPRESSION_LOGICLANGUAGE : "Expression:LogicLanguage" >
  | < EXPRESSION_REFURI        : "Expression:refURI" >
  | < OBJECTLIST_LIST          : "ObjectList:List" >
78
  | < OWL_ALLVALUESFROM     : "owl:allValuesFrom" >
79
  | < OWL_ALLDIFFERENT      : "owl:AllDifferent" >
80
  | < OWL_CARDINALITY        : "owl:cardinality" >
81 82 83 84
  | < OWL_CLASS             : "owl:Class" >
  | < OWL_DATARANGE         : "owl:DataRange" >
  | < OWL_DATATYPEPROPERTY  : "owl:DatatypeProperty" >
  | < OWL_DISJOINTWITH      : "owl:disjointWith" >
85
  | < OWL_DISTINCTMEMBERS      : "owl:distinctMembers" >
86
  | < OWL_EQUIVALENTCLASS   : "owl:equivalentClass" >
87
  | < OWL_EQUIVALENTPROPERTY : "owl:equivalentProperty" >
88
  | < OWL_FUNCTIONALPROPERTY : "owl:FunctionalProperty" >
89
  | < OWL_HASVALUE             : "owl:hasValue" >
90 91
  | < OWL_IMPORTS            : "owl:imports" >
  | < OWL_INTERSECTIONOF     : "owl:intersectionOf" >
92
  | < OWL_INVERSEOF         : "owl:inverseOf" >
93
  | < OWL_MAXCARDINALITY     : "owl:maxCardinality" >
94
  | < OWL_MINCARDINALITY     : "owl:minCardinality" >
95 96 97 98 99 100
  | < OWL_OBJECTPROPERTY    : "owl:ObjectProperty" >
  | < OWL_ONPROPERTY        : "owl:onProperty" >
  | < OWL_ONEOF             : "owl:oneOf" >
  | < OWL_ONTOLOGY          : "owl:Ontology" >
  | < OWL_RESTRICTION       : "owl:Restriction" >
  | < OWL_SOMEVALUESFROM    : "owl:someValuesFrom" >
101
  | < OWL_TRANSITIVEPROPERTY : "owl:TransitiveProperty" >
102
  | < OWL_UNIONOF           : "owl:unionOf" >
103
  | < OWL_VERSIONINFO       : "owl:versionInfo" >
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
  | < P1_ANYORDER           : "p1:Any-Order" >
  | < P1_COMPONENTS         : "p1:components" >
  | < P1_COMPOSEDOF         : "p1:composedOf" >
  | < P1_CONTROLCONSTRUCTBAG : "p1:ControlConstructBag" >
  | < P1_CONTROLCONSTRUCTLIST : "p1:ControlConstructList" >
  | < P1_ELSE               : "p1:else" >
  | < P1_HASINPUT           : "p1:hasInput" >
  | < P1_HASOUTPUT          : "p1:hasOutput" >
  | < P1_IFCONDITION        : "p1:ifCondition" >
  | < P1_IFTHENELSE         : "p1:If-Then-Else" >
  | < P1_INPUT              : "p1:Input" >
  | < P1_OUTPUT             : "p1:Output" >
  | < P1_PARAMETERTYPE      : "p1:parameterType" >
  | < P1_PERFORM            : "p1:Perform" >
  | < P1_PROCESS            : "p1:process" >
  | < P1_REPEATUNTIL        : "p1:Repeat-Until" >
  | < P1_SEQUENCE           : "p1:Sequence" >
  | < P1_THEN               : "p1:then" >
  | < P1_UNTILCONDITION     : "p1:untilCondition" >
  | < P1_UNTILPROCESS       : "p1:untilProcess" >
124 125
  | < PROCESS_PARTICIPANT     : "Process:Participant" >
  | < PROCESS_PERFORM         : "Process:Perform" >
126 127
  | < RDF_RDF               : "rdf:RDF"      >
  | < RDF_ABOUT             : "rdf:about" >
128
  | < RDF_DATATYPE          : "rdf:datatype" >
129
  | < RDF_DESCRIPTION       : "rdf:Description" >
130 131
  | < RDF_ID                : "rdf:ID" >
  | < RDF_FIRST             : "rdf:first" >
Anders Nilsson's avatar
Anders Nilsson committed
132
  | < RDF_PROPERTY          : "rdf:Property" >
133 134 135 136
  | < RDF_REST              : "rdf:rest" >
  | < RDF_PARSETYPE         : "rdf:parseType" >
  | < RDF_RESOURCE          : "rdf:resource" >
  | < RDF_TYPE              : "rdf:type" >
137
  | < RDFS_COMMENT          : "rdfs:comment" >
138
  | < RDFS_DOMAIN           : "rdfs:domain" >
139
  | < RDFS_LABEL            : "rdfs:label" >
140
  | < RDFS_RANGE            : "rdfs:range" >
141
  | < RDFS_SEEALSO          : "rdfs:seeAlso" >
142
  | < RDFS_SUBCLASSOF       : "rdfs:subClassOf" >
143
  | < RDFS_SUBPROPERTYOF    : "rdfs:subPropertyOf" >
144
  | < VERSION               : "version" >
145 146 147
  | < XML                   : "xml"          >
  | < XML_BASE              : "xml:base" >
  | < XMLNS                 : "xmlns" >	 
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
  | < XMLNS_XX                 : "xmlns:" >	 
//   | < XMLNS_DAML            : "xmlns:daml" >	 
//   | < XMLNS_DC              : "xmlns:dc" >	 
//   | < XMLNS_EXPR              : "xmlns:expr" >	 
//   | < XMLNS_LIST              : "xmlns:list" >	 
//   | < XMLNS_P1              : "xmlns:p1" >	 
//   | < XMLNS_OWL             : "xmlns:owl" >	 
//   | < XMLNS_OWLS             : "xmlns:owl-s" >	 
//   | < XMLNS_PROTEGE         : "xmlns:protege" >	 
//   | < XMLNS_RDF             : "xmlns:rdf" >	 
//   | < XMLNS_RDFS            : "xmlns:rdfs" >	 
//   | < XMLNS_SWRL            : "xmlns:swrl" >	 
//   | < XMLNS_SWRLB           : "xmlns:swrlb" >	 
//   | < XMLNS_XSD             : "xmlns:xsd" >	 
//   | < XMLNS_XSP             : "xmlns:xsp" >	 
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180

}// RESERVED WORDS AND LITERALS
<DEFAULT, BOUNDS> TOKEN : /* LITERALS */
{
    < INTEGER_LITERAL:
        <DECIMAL_LITERAL> (["l","L"])?
        |
        <HEX_LITERAL> (["l","L"])?
        |
        <OCTAL_LITERAL> (["l","L"])?
    >
    |
    < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* >
    |
    < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ >
    |
    < #OCTAL_LITERAL: "0" (["0"-"7"])* >
    |
181
    < FLOAT_LITERAL:
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
        (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? (["f","F","d","D"])?
        |
        "." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])?
        |
        (["0"-"9"])+ <EXPONENT> (["f","F","d","D"])?
        |
        (["0"-"9"])+ (<EXPONENT>)? ["f","F","d","D"]
    >
    |
    < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
    |
    < CHARACTER_LITERAL:
        "'"
        (   (~["'","\\","\n","\r"])
            |
            ("\\"
                (   ["n","t","b","r","f","\\","'","\""]
                    |
                    ["0"-"7"] ( ["0"-"7"] )?
                    |
                    ["0"-"3"] ["0"-"7"] ["0"-"7"]
                )
            )
        )
        "'"
    >
    |
    < STRING_LITERAL:
        "\""
        (   (~["\"","\\","\n","\r"])
            |
            ("\\"
                (    ["n","t","b","r","f","\\","'","\""]
                     |
                     ["0"-"7"] ( ["0"-"7"] )?
                     |
                     ["0"-"3"] ["0"-"7"] ["0"-"7"]
                )
            )
        )*
        "\""
    >
}// LITERALS

<DEFAULT, BOUNDS> TOKEN : /* IDENTIFIERS */
{
228
    < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>|"-")* >
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243
    |
    < #LETTER:
        [
        "\u0024",
        "\u0041"-"\u005a",
        "\u005f",
        "\u0061"-"\u007a",
        "\u00c0"-"\u00d6",
        "\u00d8"-"\u00f6",
        "\u00f8"-"\u00ff",
        "\u0100"-"\u1fff",
        "\u3040"-"\u318f",
        "\u3300"-"\u337f",
        "\u3400"-"\u3d2d",
        "\u4e00"-"\u9fff",
244 245 246 247
        "\uf900"-"\ufaff",
		"+",
		"-",
		",",
Anders Nilsson's avatar
Anders Nilsson committed
248 249
		"[",
		"]",
250
		"."
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
        ]
    >
    |
    < #DIGIT:
        [
        "\u0030"-"\u0039",
        "\u0660"-"\u0669",
        "\u06f0"-"\u06f9",
        "\u0966"-"\u096f",
        "\u09e6"-"\u09ef",
        "\u0a66"-"\u0a6f",
        "\u0ae6"-"\u0aef",
        "\u0b66"-"\u0b6f",
        "\u0be7"-"\u0bef",
        "\u0c66"-"\u0c6f",
        "\u0ce6"-"\u0cef",
        "\u0d66"-"\u0d6f",
        "\u0e50"-"\u0e59",
        "\u0ed0"-"\u0ed9",
        "\u1040"-"\u1049"
        ]
    >
}// IDENTIFIERS

<DEFAULT,BOUNDS> TOKEN : /* SEPARATORS */
{
277 278 279
//       < LPAREN               : "("    >
//     | < RPAREN               : ")"    >
     < LBRACE               : "{"    >
280
    | < RBRACE               : "}"    >
Anders Nilsson's avatar
Anders Nilsson committed
281 282
//     | < LBRACKET             : "["    >
//     | < RBRACKET             : "]"    >
283
    | < SEMICOLON            : ";"    >
284 285 286
    | < QUOTE                : "\""    >
//     | < COMMA                : ","    >
//     | < DOT                  : "."    >
287 288 289
}// SEPARATORS


290 291
<DEFAULT,BOUNDS> TOKEN : /* OPERATORS */
{
292 293 294
       < ASSIGN               : "="    >
     | < START_ENDTAG        : "</"    >
     | < START_TAG           : "<"    >
295 296 297 298 299
//     | < GT                   : ">"    >
//     | < LT                   : "<"    >
//     | < BANG                 : "!"    >
//     | < TILDE                : "~"    >
//     | < HOOK                 : "?"    >
300
     | < COLON                : ":"    >
301 302 303 304 305 306 307 308
//     | < EQ                   : "=="   >
//     | < LE                   : "<="   >
//     | < GE                   : ">="   >
//     | < NE                   : "!="   >
//     | < SC_OR                : "||"   >
//     | < SC_AND               : "&&"   >
//     | < INCR                 : "++"   >
//     | < DECR                 : "--"   >
309 310
//      | < PLUS                 : "+"    >
//      | < MINUS                : "-"    >
311
//     | < STAR                 : "*"    >
312
     | < SLASH                : "/"    >
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
//     | < BIT_AND              : "&"    >
//     | < BIT_OR               : "|"    >
//     | < XOR                  : "^"    >
//     | < REM                  : "%"    >
//     | < LSHIFT               : "<<"   >
//     | < RSIGNEDSHIFT         : ">>"   >
//     | < RUNSIGNEDSHIFT       : ">>>"  >
//     | < PLUSASSIGN           : "+="   >
//     | < MINUSASSIGN          : "-="   >
//     | < STARASSIGN           : "*="   >
//     | < SLASHASSIGN          : "/="   >
//     | < ANDASSIGN            : "&="   >
//     | < ORASSIGN             : "|="   >
//     | < XORASSIGN            : "^="   >
//     | < REMASSIGN            : "%="   >
//     | < LSHIFTASSIGN         : "<<="  >
//     | < RSIGNEDSHIFTASSIGN   : ">>="  >
//     | < RUNSIGNEDSHIFTASSIGN : ">>>=" >
331
}// OPERATORS
332 333


334 335 336 337 338 339
// <DEFAULT,BOUNDS> TOKEN : /* TEXT */
// {
//     < TEXT : <LETTER> (~["<",">"])*    >
// }// TEXT


340 341 342 343
//--------------------------------------------------------------------//
//                      THE OWL LANGUAGE GRAMMAR                     //
//--------------------------------------------------------------------//

344
Start Start() #Start : {}
345
{
346
    Specification()
347 348 349
  { return jjtThis; }
}

350 351
void Specification() #Specification : {}
{
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374
    XmlHeader()
	RdfDeclaration()
}

void XmlHeader() #XmlHeader : {}
{
    "<?" <XML> AttributeList() "?>"
}

void RdfDeclaration() #RdfDeclaration : {}
{
    "<"  <RDF_RDF> AttributeList() ">"
	ElementList()
    "</" <RDF_RDF> ">"
}

void ElementList() #List : {}
{
    (Element())*    
}

void Element() : {}
{
375
    ( "<" ( JElement()
376
	    | OwlElement()
377
	    | RdfElement()
378
	    | P1Element()
379 380
	    | ProcessElement()
	    | DiscardedElement()
381 382 383 384
	    ))
	| SimpleElement()
}

385 386 387 388 389 390 391 392 393 394 395 396
void DiscardedElement() #DiscardedElement : {}
{
	Identifier() AttributeList() 
	(">" ElementList() "</" <IDENTIFIER> ">" | ElementList() "/>")
}

void Identifier() #Identifier : {Token t;}
{
	t = <IDENTIFIER>
	{jjtThis.setIDENTIFIER(t.image);}
}

397 398 399
void SimpleElement() : {}
{
    IntElement()
400
	| FloatElement()
401 402 403 404 405 406
	| StringElement()
}

void IntElement() #IntElement : { Token t; }
{
    t = <INTEGER_LITERAL>
407
	{jjtThis.setLITERAL(t.image);}
408 409
}

410 411 412
void FloatElement() #FloatElement : { Token t; }
{
    t = <FLOAT_LITERAL>
413
	{jjtThis.setLITERAL(t.image);}
414 415
}

416
void StringElement() #StringElement : { Token t;String s; }
417
{
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445
	t = <IDENTIFIER>
	{
		s = t.image;
		if (getToken(1).kind != START_TAG ) {
		s += getData();
	}
	}
        {jjtThis.setLITERAL(s);}
}

JAVACODE
String getData() {
	StringBuffer s = new StringBuffer();
//     jjtThis.someData = true;
    while ((getToken(1)).kind != START_TAG && (getToken(1)).kind != START_ENDTAG) {
		Token t = getNextToken();
		if (t.specialToken != null) {
			Token tmp_t = t.specialToken;
			while (tmp_t.specialToken != null) {
				tmp_t = tmp_t.specialToken;
			}
			while (tmp_t != null) {
				s.append(tmp_t.image);
				tmp_t = tmp_t.next;
			}
		}
		s.append(t.image);
	}
446
	return s.toString().trim();
447 448
}

449 450 451 452 453 454 455
// void StringElement() #StringElement : { Token t; }
// {
//     t = <IDENTIFIER> | t = <COMMA> | t = <MINUS> | t = <DOT> | t = <PLUS> | t = <SLASH>
// 		| t = <COLON>
// 	{jjtThis.setIDENTIFIER(t.image);}
// }

456 457
void JElement(): {}
{
458 459 460 461
	ListFirst()
	| ListRest()
	| ExprKIFCondition()
	| ExprExpressionData()
462 463 464 465
	| ExpressionCondition()
	| ExpressionLogicLanguage()
	| ExpressionRefURI()
	| ObjectListList()
466 467
}

468
void ListFirst() #ListFirst : {}
469
{
470 471
    <LIST_FIRST> AttributeList() 
	(">" ElementList() "</" <LIST_FIRST> ">" | ElementList() "/>")
472 473
}

474
void ListRest() #ListRest : {}
475
{
476 477
    <LIST_REST> AttributeList() 
	(">" ElementList() "</" <LIST_REST> ">" | ElementList() "/>")
478 479 480
}


481
void ExprKIFCondition() #ExprKIFCondition : {}
482
{
483 484
    <EXPR_KIFCONDITION> AttributeList() 
	(">" ElementList() "</" <EXPR_KIFCONDITION> ">" | ElementList() "/>")
485 486 487
}


488
void ExprExpressionData() #ExprExpressionData : {}
489
{
490 491
    <EXPR_EXPRESSIONDATA> AttributeList() 
	(">" ElementList() "</" <EXPR_EXPRESSIONDATA> ">" | ElementList() "/>")
492 493
}

494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517
void ExpressionCondition() #ExpressionCondition : {}
{
    <EXPRESSION_CONDITION> AttributeList() 
	(">" ElementList() "</" <EXPRESSION_CONDITION> ">" | ElementList() "/>")
}

void ExpressionLogicLanguage() #ExpressionLogicLanguage : {}
{
    <EXPRESSION_LOGICLANGUAGE> AttributeList() 
	(">" ElementList() "</" <EXPRESSION_LOGICLANGUAGE> ">" | ElementList() "/>")
}

void ExpressionRefURI() #ExpressionRefURI : {}
{
    <EXPRESSION_REFURI> AttributeList() 
	(">" ElementList() "</" <EXPRESSION_REFURI> ">" | ElementList() "/>")
}

void ObjectListList() #ObjectListList : {}
{
    <OBJECTLIST_LIST> AttributeList() 
	(">" ElementList() "</" <OBJECTLIST_LIST> ">" | ElementList() "/>")
}

518 519 520
void OwlElement() : {}
{
    OwlOntology()
521
	| OwlAllDifferent()
522
	| OwlAllValuesFrom()
523
	| OwlCardinality()
524
	| OwlClass()
525 526
	| OwlDataRange()
	| OwlDatatypeProperty()
527
	| OwlDisjointWith()
528
	| OwlDistinctMembers()
529
	| OwlEquivalentClass()
530
	| OwlEquivalentProperty()
531
	| OwlFunctionalProperty()
532
	| OwlHasValue()
533 534
	| OwlImports()
	| OwlIntersectionOf()
535
	| OwlInverseOf()
536
	| OwlMaxCardinality()
537
	| OwlMinCardinality()
538
	| OwlObjectProperty()
539
	| OwlOneOf()
540 541
	| OwlOnProperty()
	| OwlRestriction()
542 543
	| OwlSomeValuesFrom()
	| OwlTransitiveProperty()
544
	| OwlUnionOf()
545
	| OwlVersionInfo()
546 547 548 549
}

void OwlOntology() #OwlOntology : {}
{
550 551
    <OWL_ONTOLOGY> AttributeList() 
	(">" ElementList() "</" <OWL_ONTOLOGY> ">" | ElementList() "/>")
552 553
}

554 555 556 557 558 559
void OwlAllDifferent() #OwlAllDifferent : {}
{
    <OWL_ALLDIFFERENT> AttributeList() 
	(">" ElementList() "</" <OWL_ALLDIFFERENT> ">" | ElementList() "/>")
}

560 561 562 563 564 565
void OwlAllValuesFrom() #OwlAllValuesFrom : {}
{
    <OWL_ALLVALUESFROM> AttributeList() 
	(">" ElementList() "</" <OWL_ALLVALUESFROM> ">" | ElementList() "/>")
}

566 567 568 569 570 571
void OwlCardinality() #OwlCardinality : {}
{
    <OWL_CARDINALITY> AttributeList() 
	(">" ElementList() "</" <OWL_CARDINALITY> ">" | ElementList() "/>")
}

572 573 574 575 576 577
void OwlClass() #OwlClass : {}
{
    <OWL_CLASS> AttributeList() 
	(">" ElementList() "</" <OWL_CLASS> ">" | ElementList() "/>")
}

578 579 580 581 582 583 584 585 586 587 588 589
void OwlDataRange() #OwlDataRange : {}
{
    <OWL_DATARANGE> AttributeList() 
	(">" ElementList() "</" <OWL_DATARANGE> ">" | ElementList() "/>")
}

void OwlDatatypeProperty() #OwlDatatypeProperty : {}
{
    <OWL_DATATYPEPROPERTY> AttributeList() 
	(">" ElementList() "</" <OWL_DATATYPEPROPERTY> ">" | ElementList() "/>")
}

590 591 592 593 594 595
void OwlDisjointWith() #OwlDisjointWith : {}
{
    <OWL_DISJOINTWITH> AttributeList() 
	(">" ElementList() "</" <OWL_DISJOINTWITH> ">" | ElementList() "/>")
}

596 597 598 599 600 601
void OwlDistinctMembers() #OwlDistinctMembers : {}
{
    <OWL_DISTINCTMEMBERS> AttributeList() 
	(">" ElementList() "</" <OWL_DISTINCTMEMBERS> ">" | ElementList() "/>")
}

602 603 604 605 606 607
void OwlEquivalentClass() #OwlEquivalentClass : {}
{
    <OWL_EQUIVALENTCLASS> AttributeList() 
	(">" ElementList() "</" <OWL_EQUIVALENTCLASS> ">" | ElementList() "/>")
}

608 609 610 611 612 613
void OwlEquivalentProperty() #OwlEquivalentProperty : {}
{
    <OWL_EQUIVALENTPROPERTY> AttributeList() 
	(">" ElementList() "</" <OWL_EQUIVALENTPROPERTY> ">" | ElementList() "/>")
}

614 615 616 617 618 619
void OwlFunctionalProperty() #OwlFunctionalProperty : {}
{
    <OWL_FUNCTIONALPROPERTY> AttributeList() 
	(">" ElementList() "</" <OWL_FUNCTIONALPROPERTY> ">" | ElementList() "/>")
}

620 621 622 623 624 625
void OwlHasValue () #OwlHasValue  : {}
{
    <OWL_HASVALUE> AttributeList() 
	(">" ElementList() "</" <OWL_HASVALUE> ">" | ElementList() "/>")
}

626 627 628 629 630 631 632 633 634 635 636 637
void OwlImports () #OwlImports  : {}
{
    <OWL_IMPORTS> AttributeList() 
	(">" ElementList() "</" <OWL_IMPORTS> ">" | ElementList() "/>")
}

void OwlIntersectionOf () #OwlIntersectionOf  : {}
{
    <OWL_INTERSECTIONOF> AttributeList() 
	(">" ElementList() "</" <OWL_INTERSECTIONOF> ">" | ElementList() "/>")
}

638 639 640 641 642 643
void OwlInverseOf () #OwlInverseOf  : {}
{
    <OWL_INVERSEOF> AttributeList() 
	(">" ElementList() "</" <OWL_INVERSEOF> ">" | ElementList() "/>")
}

644 645 646 647 648 649
void OwlMaxCardinality () #OwlMaxCardinality  : {}
{
    <OWL_MAXCARDINALITY> AttributeList() 
	(">" ElementList() "</" <OWL_MAXCARDINALITY> ">" | ElementList() "/>")
}

650 651 652 653 654 655
void OwlMinCardinality () #OwlMinCardinality  : {}
{
    <OWL_MINCARDINALITY> AttributeList() 
	(">" ElementList() "</" <OWL_MINCARDINALITY> ">" | ElementList() "/>")
}

656 657 658 659 660 661
void OwlObjectProperty () #OwlObjectProperty  : {}
{
    <OWL_OBJECTPROPERTY> AttributeList() 
	(">" ElementList() "</" <OWL_OBJECTPROPERTY> ">" | ElementList() "/>")
}

662 663 664 665 666 667
void OwlOneOf () #OwlOneOf  : {}
{
    <OWL_ONEOF> AttributeList() 
	(">" ElementList() "</" <OWL_ONEOF> ">" | ElementList() "/>")
}

668 669 670 671 672 673
void OwlOnProperty () #OwlOnProperty  : {}
{
    <OWL_ONPROPERTY> AttributeList() 
	(">" ElementList() "</" <OWL_ONPROPERTY> ">" | ElementList() "/>")
}

674 675 676 677 678 679
void OwlRestriction () #OwlRestriction  : {}
{
    <OWL_RESTRICTION> AttributeList() 
	(">" ElementList() "</" <OWL_RESTRICTION> ">" | ElementList() "/>")
}

680 681 682 683 684 685
void OwlSomeValuesFrom () #OwlSomeValuesFrom  : {}
{
    <OWL_SOMEVALUESFROM> AttributeList() 
	(">" ElementList() "</" <OWL_SOMEVALUESFROM> ">" | ElementList() "/>")
}

686
void OwlTransitiveProperty () #OwlTransitiveProperty  : {}
687
{
688 689
    <OWL_TRANSITIVEPROPERTY> AttributeList() 
	(">" ElementList() "</" <OWL_TRANSITIVEPROPERTY> ">" | ElementList() "/>")
690 691
}

692 693 694 695 696 697
void OwlUnionOf () #OwlUnionOf  : {}
{
    <OWL_UNIONOF> AttributeList() 
	(">" ElementList() "</" <OWL_UNIONOF> ">" | ElementList() "/>")
}

698 699 700 701 702 703
void OwlVersionInfo () #OwlVersionInfo  : {}
{
    <OWL_VERSIONINFO> AttributeList() 
	(">" ElementList() "</" <OWL_VERSIONINFO> ">" | ElementList() "/>")
}

704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847
void P1Element() : {}
{
    P1AnyOrder()
    | P1Components()
    | P1ComposedOf()
	| P1ControlConstructBag()
	| P1ControlConstructList()
	| P1Else()
	| P1HasInput()
	| P1HasOutput()
	| P1IfCondition()
	| P1IfThenElse()
	| P1Input()
	| P1Output()
	| P1ParameterType()
	| P1Perform()
	| P1Process()
	| P1RepeatUntil()
	| P1Sequence()
	| P1Then()
	| P1UntilCondition()
	| P1UntilProcess()
}

void P1AnyOrder() #P1AnyOrder : {}
{
    <P1_ANYORDER> AttributeList() 
	(">" ElementList() "</" <P1_ANYORDER> ">" | ElementList() "/>")
}

void P1Components() #P1Components : {}
{
    <P1_COMPONENTS> AttributeList() 
	(">" ElementList() "</" <P1_COMPONENTS> ">" | ElementList() "/>")
}

void P1ComposedOf() #P1ComposedOf : {}
{
    <P1_COMPOSEDOF> AttributeList() 
	(">" ElementList() "</" <P1_COMPOSEDOF> ">" | ElementList() "/>")
}

void P1ControlConstructBag() #P1ControlConstructBag : {}
{
    <P1_CONTROLCONSTRUCTBAG> AttributeList() 
	(">" ElementList() "</" <P1_CONTROLCONSTRUCTBAG> ">" | ElementList() "/>")
}

void P1ControlConstructList() #P1ControlConstructList : {}
{
    <P1_CONTROLCONSTRUCTLIST> AttributeList() 
	(">" ElementList() "</" <P1_CONTROLCONSTRUCTLIST> ">" | ElementList() "/>")
}

void P1Else() #P1Else : {}
{
    <P1_ELSE> AttributeList() 
	(">" ElementList() "</" <P1_ELSE> ">" | ElementList() "/>")
}

void P1HasInput() #P1HasInput : {}
{
    <P1_HASINPUT> AttributeList() 
	(">" ElementList() "</" <P1_HASINPUT> ">" | ElementList() "/>")
}

void P1HasOutput() #P1HasOutput : {}
{
    <P1_HASOUTPUT> AttributeList() 
	(">" ElementList() "</" <P1_HASOUTPUT> ">" | ElementList() "/>")
}

void P1IfCondition() #P1IfCondition : {}
{
    <P1_IFCONDITION> AttributeList() 
	(">" ElementList() "</" <P1_IFCONDITION> ">" | ElementList() "/>")
}

void P1IfThenElse() #P1IfThenElse : {}
{
    <P1_IFTHENELSE> AttributeList() 
	(">" ElementList() "</" <P1_IFTHENELSE> ">" | ElementList() "/>")
}

void P1Input() #P1Input : {}
{
    <P1_INPUT> AttributeList() 
	(">" ElementList() "</" <P1_INPUT> ">" | ElementList() "/>")
}

void P1Output() #P1Output : {}
{
    <P1_OUTPUT> AttributeList() 
	(">" ElementList() "</" <P1_OUTPUT> ">" | ElementList() "/>")
}

void P1ParameterType() #P1ParameterType : {}
{
    <P1_PARAMETERTYPE> AttributeList() 
	(">" ElementList() "</" <P1_PARAMETERTYPE> ">" | ElementList() "/>")
}

void P1Perform() #P1Perform : {}
{
    <P1_PERFORM> AttributeList() 
	(">" ElementList() "</" <P1_PERFORM> ">" | ElementList() "/>")
}

void P1Process() #P1Process : {}
{
    <P1_PROCESS> AttributeList() 
	(">" ElementList() "</" <P1_PROCESS> ">" | ElementList() "/>")
}

void P1RepeatUntil() #P1RepeatUntil : {}
{
    <P1_REPEATUNTIL> AttributeList() 
	(">" ElementList() "</" <P1_REPEATUNTIL> ">" | ElementList() "/>")
}

void P1Sequence() #P1Sequence : {}
{
    <P1_SEQUENCE> AttributeList() 
	(">" ElementList() "</" <P1_SEQUENCE> ">" | ElementList() "/>")
}

void P1Then() #P1Then : {}
{
    <P1_THEN> AttributeList() 
	(">" ElementList() "</" <P1_THEN> ">" | ElementList() "/>")
}

void P1UntilCondition() #P1UntilCondition : {}
{
    <P1_UNTILCONDITION> AttributeList() 
	(">" ElementList() "</" <P1_UNTILCONDITION> ">" | ElementList() "/>")
}

void P1UntilProcess() #P1UntilProcess : {}
{
    <P1_UNTILPROCESS> AttributeList() 
	(">" ElementList() "</" <P1_UNTILPROCESS> ">" | ElementList() "/>")
}

848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865
void ProcessElement(): {}
{
    ProcessParticipant()
  | ProcessPerform()
}

void ProcessParticipant() #ProcessParticipant : {}
{
    <PROCESS_PARTICIPANT> AttributeList() 
	(">" ElementList() "</" <PROCESS_PARTICIPANT> ">" | ElementList() "/>")
}

void ProcessPerform() #ProcessPerform : {}
{
    <PROCESS_PERFORM> AttributeList() 
	(">" ElementList() "</" <PROCESS_PERFORM> ">" | ElementList() "/>")
}

866

867 868
void RdfElement() : {}
{
869
    RdfType()
870
	| RdfDescription()
871
	| RdfFirst()
Anders Nilsson's avatar
Anders Nilsson committed
872
	| RdfProperty()
873
	| RdfRest()
874
	| RdfsComment()
875
	| RdfsDomain()
876
	| RdfsLabel()
877
	| RdfsRange()
878
	| RdfsSeeAlso()
879 880
	| RdfsSubClassOf()
	| RdfsSubPropertyOf()
881 882
}

883
void RdfType() #RdfType : {}
884
{
885 886 887 888
    <RDF_TYPE> AttributeList() 
	(">" ElementList() "</" <RDF_TYPE> ">" | ElementList() "/>")
}

889 890 891 892 893 894
void RdfDescription() #RdfDescription : {}
{
    <RDF_DESCRIPTION> AttributeList() 
	(">" ElementList() "</" <RDF_DESCRIPTION> ">" | ElementList() "/>")
}

895 896 897 898 899 900
void RdfFirst() #RdfFirst : {}
{
    <RDF_FIRST> AttributeList() 
	(">" ElementList() "</" <RDF_FIRST> ">" | ElementList() "/>")
}

Anders Nilsson's avatar
Anders Nilsson committed
901 902 903 904 905 906
void RdfProperty() #RdfProperty : {}
{
    <RDF_PROPERTY> AttributeList() 
	(">" ElementList() "</" <RDF_PROPERTY> ">" | ElementList() "/>")
}

907 908 909 910
void RdfRest() #RdfRest : {}
{
    <RDF_REST> AttributeList() 
	(">" ElementList() "</" <RDF_REST> ">" | ElementList() "/>")
911 912
}

913 914 915 916 917 918
void RdfsComment() #RdfsComment : {}
{
    <RDFS_COMMENT> AttributeList() 
	(">" ElementList() "</" <RDFS_COMMENT> ">" | ElementList() "/>")
}

919 920 921 922
void RdfsDomain() #RdfsDomain : {}
{
    <RDFS_DOMAIN> AttributeList() 
	(">" ElementList() "</" <RDFS_DOMAIN> ">" | ElementList() "/>")
923 924
}

925 926 927 928 929 930
void RdfsLabel() #RdfsLabel : {}
{
    <RDFS_LABEL> AttributeList() 
	(">" ElementList() "</" <RDFS_LABEL> ">" | ElementList() "/>")
}

931 932 933 934 935 936
void RdfsRange() #RdfsRange : {}
{
    <RDFS_RANGE> AttributeList() 
	(">" ElementList() "</" <RDFS_RANGE> ">" | ElementList() "/>")
}

937 938 939 940 941 942
void RdfsSeeAlso() #RdfsSeeAlso : {}
{
    <RDFS_SEEALSO> AttributeList() 
	(">" ElementList() "</" <RDFS_SEEALSO> ">" | ElementList() "/>")
}

943 944 945 946 947 948
void RdfsSubClassOf() #RdfsSubClassOf : {}
{
    <RDFS_SUBCLASSOF> AttributeList() 
	(">" ElementList() "</" <RDFS_SUBCLASSOF> ">" | ElementList() "/>")
}

949 950 951 952 953 954
void RdfsSubPropertyOf() #RdfsSubPropertyOf : {}
{
    <RDFS_SUBPROPERTYOF> AttributeList() 
	(">" ElementList() "</" <RDFS_SUBPROPERTYOF> ">" | ElementList() "/>")
}

955 956 957 958 959
void AttributeList() #List : {}
{
    (Attribute())*
}

960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975
void Attribute() : {}
{
    Version()
	| RdfAttribute()
	| XmlAttribute()
	| XmlnsAttribute()
}

void Version() #Version : {}
{
    <VERSION> <ASSIGN> Value()
}

void RdfAttribute() : {}
{
    RdfAbout()
976
	| RdfDatatype()
977
	| RdfId()
978
	| RdfParseType()
979 980 981 982 983 984 985 986
	| RdfResource()
}

void RdfAbout() #RdfAbout : {}
{
    <RDF_ABOUT> <ASSIGN> Value()
}

987 988 989 990 991
void RdfDatatype() #RdfDatatype : {}
{
    <RDF_DATATYPE> <ASSIGN> Value()
}

992 993 994 995 996
void RdfId() #RdfId : {}
{
    <RDF_ID> <ASSIGN> Value()
}

997 998 999 1000 1001 1002
void RdfParseType() #RdfParseType : {}
{
    <RDF_PARSETYPE> <ASSIGN> Value()
}

void RdfResource() #RdfResource : {}
1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019
{
    <RDF_RESOURCE> <ASSIGN> Value()
}

void XmlAttribute() : {}
{
    XmlBase()
}

void XmlBase() #XmlBase : {}
{
    <XML_BASE> <ASSIGN> Value()
}

void XmlnsAttribute() : {}
{
    Xmlns()
1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034
  | XmlnsXX()
// 	| XmlnsDaml()
// 	| XmlnsDc()
// 	| XmlnsExpr()
// 	| XmlnsList()
// 	| XmlnsOwl()
// 	| XmlnsOwls()
// 	| XmlnsP1()
// 	| XmlnsProtege()
// 	| XmlnsRdf()
// 	| XmlnsRdfs()
// 	| XmlnsSwrl()
// 	| XmlnsSwrlb()
// 	| XmlnsXsd()
// 	| XmlnsXsp()
1035 1036 1037 1038 1039 1040 1041
}

void Xmlns() #Xmlns : {}
{
    <XMLNS> <ASSIGN> Value()
}

1042
void XmlnsXX() #XmlnsXX : {Token t;}
1043
{
1044 1045
    <XMLNS_XX> t = <IDENTIFIER> <ASSIGN> Value()
	{jjtThis.setIDENTIFIER(t.image);}
1046 1047
}

1048 1049 1050 1051
// void XmlnsDaml() #XmlnsDaml : {}
// {
//     <XMLNS_DAML> <ASSIGN> Value()
// }
1052

1053 1054 1055 1056
// void XmlnsDc() #XmlnsDc : {}
// {
//     <XMLNS_DC> <ASSIGN> Value()
// }
1057

1058 1059 1060 1061
// void XmlnsExpr() #XmlnsExpr : {}
// {
//     <XMLNS_EXPR> <ASSIGN> Value()
// }
1062

1063 1064 1065 1066
// void XmlnsList() #XmlnsList : {}
// {
//     <XMLNS_LIST> <ASSIGN> Value()
// }
1067

1068 1069 1070 1071
// void XmlnsP1() #XmlnsP1 : {}
// {
//     <XMLNS_P1> <ASSIGN> Value()
// }
1072

1073 1074 1075 1076
// void XmlnsProtege() #XmlnsProtege : {}
// {
//     <XMLNS_PROTEGE> <ASSIGN> Value()
// }
1077

1078 1079 1080 1081
// void XmlnsRdf() #XmlnsRdf : {}
// {
//     <XMLNS_RDF> <ASSIGN> Value()
// }
1082

1083 1084 1085 1086
// void XmlnsSwrl() #XmlnsSwrl : {}
// {
//     <XMLNS_SWRL> <ASSIGN> Value()
// }
1087

1088 1089 1090 1091
// void XmlnsSwrlb() #XmlnsSwrlb : {}
// {
//     <XMLNS_SWRLB> <ASSIGN> Value()
// }
1092

1093 1094 1095 1096
// void XmlnsXsd() #XmlnsXsd : {}
// {
//     <XMLNS_XSD> <ASSIGN> Value()
// }
1097

1098 1099 1100 1101
// void XmlnsXsp() #XmlnsXsp : {}
// {
//     <XMLNS_XSP> <ASSIGN> Value()
// }
1102

1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116
// void XmlnsRdfs() #XmlnsRdfs : {}
// {
//     <XMLNS_RDFS> <ASSIGN> Value()
// }

// void XmlnsOwl() #XmlnsOwl : {}
// {
//     <XMLNS_OWL> <ASSIGN> Value()
// }

// void XmlnsOwls() #XmlnsOwls : {}
// {
//     <XMLNS_OWLS> <ASSIGN> Value()
// }
1117 1118 1119 1120 1121

void Value() #Value : { Token t; }
{
    t = <STRING_LITERAL>
	{jjtThis.setSTRING_LITERAL(t.image);}
1122
}