KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > rdf > arp > RDFParser


1 /* Generated By:JavaCC: Do not edit this line. RDFParser.java */
2 package com.hp.hpl.jena.rdf.arp;
3
4 import java.util.*;
5 import org.xml.sax.SAXException JavaDoc;
6
7 class RDFParser implements ARPErrorNumbers, RDFParserConstants {
8 /*
9  * (c) Copyright Hewlett-Packard Development Company, LP
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  * notice, this list of conditions and the following disclaimer in the
19  * documentation and/or other materials provided with the distribution.
20  * 3. The name of the author may not be used to endorse or promote products
21  * derived from this software without specific prior written permission.
22
23  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  
34  * * $Id: RDFParser.java,v 1.20 2005/04/12 14:15:47 jeremy_carroll Exp $
35    
36    AUTHOR: Jeremy J. Carroll
37 */

38
39
40
41   static {
42 // Terminal description for error messages.
43
// The tokeniser (XMLHandler) defines what the tokens actually are.
44
tokenImage[A_ABOUT] = "attribute rdf:about";
45      tokenImage[A_ID] = "attribute rdf:ID";
46      tokenImage[A_NODEID] = "attribute rdf:nodeID";
47      tokenImage[A_OTHER] = "property attributes";
48      tokenImage[A_PARSETYPE] = "rdf:parseType";
49      tokenImage[A_RESOURCE] = "attribute rdf:resource";
50      tokenImage[A_TYPE] = "attribute rdf:type";
51      tokenImage[A_DATATYPE] = "attribute rdf:datatype";
52      tokenImage[A_RDF_N] = "attribute rdf:rdf_NNN";
53      tokenImage[A_XMLLANG] = "attribute xml:lang";
54      tokenImage[A_XMLSPACE] = "attribute xml:space";
55      tokenImage[A_XMLBASE] = "attribute xml:base";
56      tokenImage[AV_RESOURCE] = "'Resource'";
57      tokenImage[AV_LITERAL] = "'Literal'";
58      tokenImage[AV_STRING] = "attribute value";
59      tokenImage[CD_STRING] = "XML ELEMENT CONTENT";
60      tokenImage[E_DESCRIPTION] = "start element rdf:Description";
61      tokenImage[E_END] = "end element tag";
62      tokenImage[E_LI] = "start element rdf:li";
63      tokenImage[E_OTHER] = "general start element tag";
64      tokenImage[E_RDF] = "start element rdf:RDF";
65      tokenImage[E_RDF_N] = "start element rdf:rdf_NNN";
66      tokenImage[AV_DAMLCOLLECTION] = "'daml:collection'";
67      tokenImage[AV_COLLECTION] = "'Collection'";
68      tokenImage[COMMENT]= "XML comment";
69      tokenImage[PROCESSING_INSTRUCTION]="processing instruction";
70      tokenImage[A_XMLNS]="namespace declaration";
71      tokenImage[X_WARNING] = ""; // suppress messages about this ...
72
tokenImage[X_SAX_EX] = ""; // suppress messages about this ...
73
}
74
75    XMLHandler arp;
76    ParserSupport X;
77    // For creating syntax error messages.
78
Token startAttr;
79    RDFParser(TokenPipe pipe, XMLHandler arp) {
80      this(pipe);
81      this.arp = arp;
82      X = new ParserSupport(arp);
83    }
84
85 /* FORMATTING CONVENTIONS
86 1: each element in production on own line at column 4
87 2: kleene stars and optionals round single elements on same line
88 3: kleene stars and optionals round multiple elements using
89    indentation levels of 2
90 4: code at column 40, possibly on same line as element
91 5: try/catch at column 30
92 6: | at column 2 on own line with comment // OR
93 */

94 // Entry point where whole file is known to be rdf and
95
// so rdf:RDF element is optional.
96
// No kleene star - there can only be one document level element.
97
final public void rdfFile(XMLContext ctxt) throws ParseException {
98     whiteOrErr();
99     rdfFileSub(ctxt);
100     white1(false);
101   }
102
103   final public void rdfFileSub(XMLContext ctxt) throws ParseException {
104                                          ARPResource r = null;
105     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
106     case E_RDF:
107       rdf(ctxt);
108       break;
109     case E_DESCRIPTION:
110     case E_OTHER:
111     case E_LI:
112     case E_RDF_N:
113       try {
114                                          arp.startRDF();
115         r = obj(ctxt);
116       } finally {
117                                 arp.endLocalScope(r);
118                                 arp.endRDF();
119       }
120       break;
121     default:
122       jj_la1[0] = jj_gen;
123       jj_consume_token(-1);
124       throw new ParseException();
125     }
126   }
127
128   final public void zwhite(boolean suggestParseType) throws ParseException {
129     if (suggestParseType) {
130       xwhite();
131     } else {
132       white();
133     }
134   }
135
136   final public void white() throws ParseException {
137     white1(true);
138   }
139
140   final public void xwhite() throws ParseException {
141     label_1:
142     while (true) {
143       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
144       case CD_STRING:
145       case PROCESSING_INSTRUCTION:
146       case COMMENT:
147       case X_SAX_EX:
148         ;
149         break;
150       default:
151         jj_la1[1] = jj_gen;
152         break label_1;
153       }
154       xOneWhite();
155     }
156   }
157
158   final public void white1(boolean warnOnPi) throws ParseException {
159     label_2:
160     while (true) {
161       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
162       case CD_STRING:
163       case PROCESSING_INSTRUCTION:
164       case COMMENT:
165       case X_SAX_EX:
166         ;
167         break;
168       default:
169         jj_la1[2] = jj_gen;
170         break label_2;
171       }
172       oneWhite(warnOnPi);
173     }
174   }
175
176   final public void whiteOrErr() throws ParseException {
177     label_3:
178     while (true) {
179       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
180       case CD_STRING:
181       case PROCESSING_INSTRUCTION:
182       case COMMENT:
183       case X_SAX_EX:
184       case X_WARNING:
185         ;
186         break;
187       default:
188         jj_la1[3] = jj_gen;
189         break label_3;
190       }
191       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
192       case CD_STRING:
193       case PROCESSING_INSTRUCTION:
194       case COMMENT:
195       case X_SAX_EX:
196         oneWhite(false);
197         break;
198       case X_WARNING:
199         warning();
200         break;
201       default:
202         jj_la1[4] = jj_gen;
203         jj_consume_token(-1);
204         throw new ParseException();
205       }
206     }
207   }
208
209   final public void xOneWhite() throws ParseException {
210                                          Token w;
211     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
212     case CD_STRING:
213       w = jj_consume_token(CD_STRING);
214                                          X.checkWhite((StrToken)w,true);
215       break;
216     case PROCESSING_INSTRUCTION:
217       // OR
218
w = jj_consume_token(PROCESSING_INSTRUCTION);
219                                          X.processingInstruction(w,true);
220       break;
221     case COMMENT:
222       jj_consume_token(COMMENT);
223       break;
224     case X_SAX_EX:
225       saxEx();
226       break;
227     default:
228       jj_la1[5] = jj_gen;
229       jj_consume_token(-1);
230       throw new ParseException();
231     }
232   }
233
234   final public void oneWhite(boolean warnOnPi) throws ParseException {
235                                          Token w;
236     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
237     case CD_STRING:
238       w = jj_consume_token(CD_STRING);
239                                          X.checkWhite((StrToken)w,false);
240       break;
241     case PROCESSING_INSTRUCTION:
242       pi(warnOnPi);
243       break;
244     case COMMENT:
245       jj_consume_token(COMMENT);
246       break;
247     case X_SAX_EX:
248       saxEx();
249       break;
250     default:
251       jj_la1[6] = jj_gen;
252       jj_consume_token(-1);
253       throw new ParseException();
254     }
255   }
256
257   final public Token saxEx() throws ParseException {
258                                          Token rslt;
259     rslt = jj_consume_token(X_SAX_EX);
260                                          X.saxException(rslt);
261                                          {if (true) return rslt;}
262     throw new Error JavaDoc("Missing return statement in function");
263   }
264
265   final public void empty() throws ParseException {
266     label_4:
267     while (true) {
268       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
269       case PROCESSING_INSTRUCTION:
270       case COMMENT:
271         ;
272         break;
273       default:
274         jj_la1[7] = jj_gen;
275         break label_4;
276       }
277       oneEmpty();
278     }
279   }
280
281   final public void oneEmpty() throws ParseException {
282     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
283     case PROCESSING_INSTRUCTION:
284       pi(true);
285       break;
286     case COMMENT:
287       jj_consume_token(COMMENT);
288       break;
289     default:
290       jj_la1[8] = jj_gen;
291       jj_consume_token(-1);
292       throw new ParseException();
293     }
294   }
295
296   final public Token pi(boolean warnOnPi) throws ParseException {
297                                          Token w;
298     w = jj_consume_token(PROCESSING_INSTRUCTION);
299                                          if (warnOnPi) X.processingInstruction(w,false);
300                                          {if (true) return w;}
301     throw new Error JavaDoc("Missing return statement in function");
302   }
303
304 /* [6.1] RDF ::= ['<rdf:RDF>'] obj* ['</rdf:RDF>'] */
305   final public void rdf(XMLContext ctxt) throws ParseException {
306                                          ARPResource r = null;
307     try {
308       jj_consume_token(E_RDF);
309                                          arp.startRDF();
310       ctxt = xmlAttrs(ctxt);
311       white();
312       label_5:
313       while (true) {
314         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
315         case E_DESCRIPTION:
316         case E_OTHER:
317         case E_LI:
318         case E_RDF_N:
319           ;
320           break;
321         default:
322           jj_la1[9] = jj_gen;
323           break label_5;
324         }
325         try {
326           r = obj(ctxt);
327         } finally {
328                                         arp.endLocalScope(r);
329                                         r = null;
330         }
331         white();
332       }
333       jj_consume_token(E_END);
334     } catch (ParseException e) {
335                                        error_recovery(e);
336     } finally {
337                                arp.endRDF();
338     }
339   }
340
341 /* [6.2] obj ::= description | container */
342   final public ARPResource obj(XMLContext ctxt) throws ParseException {
343                                           ARPResource r =
344                                                         new ARPResource(arp);
345     try {
346       description(ctxt,r,false);
347                                          {if (true) return r;}
348     } catch (ParseException e) {
349                                arp.endLocalScope(r);
350                                {if (true) throw e;}
351     } catch (RuntimeException JavaDoc e) {
352                                arp.endLocalScope(r);
353                                {if (true) throw e;}
354     }
355     throw new Error JavaDoc("Missing return statement in function");
356   }
357
358   final public ARPResource xobj(XMLContext ctxt) throws ParseException {
359                                           ARPResource r =
360                                                         new ARPResource(arp);
361     try {
362       description(ctxt,r,true);
363                                            // javaCC bug work-around
364
jj_scanpos = jj_lastpos = null;
365                                            {if (true) return r;}
366     } catch (ParseException e) {
367                                arp.endLocalScope(r);
368                                {if (true) throw e;}
369     } catch (RuntimeException JavaDoc e) {
370                                arp.endLocalScope(r);
371                                {if (true) throw e;}
372     }
373     throw new Error JavaDoc("Missing return statement in function");
374   }
375
376 /* [6.3] description ::= '<rdf:Description' idAboutAttr? propAttr* '/>'
377  * | '<rdf:Description' idAboutAttr? propAttr* '>'
378  * propertyElt* '</rdf:Description>'
379  * | typedNode */

380   final public void description(XMLContext ctxt, ARPResource r, boolean suggestParseType) throws ParseException {
381     try {
382       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
383       case E_DESCRIPTION:
384         jj_consume_token(E_DESCRIPTION);
385         ctxt = xmlAttrs(ctxt);
386         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
387         case A_ID:
388         case A_ABOUT:
389         case A_NODEID:
390           idAboutAttr(ctxt,r);
391           break;
392         default:
393           jj_la1[10] = jj_gen;
394           ;
395         }
396         label_6:
397         while (true) {
398           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
399           case A_OTHER:
400           case A_RDF_N:
401           case A_TYPE:
402             ;
403             break;
404           default:
405             jj_la1[11] = jj_gen;
406             break label_6;
407           }
408           propAttr(ctxt,r);
409         }
410         zwhite(suggestParseType);
411         label_7:
412         while (true) {
413           switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
414           case E_OTHER:
415           case E_LI:
416           case E_RDF_N:
417             ;
418             break;
419           default:
420             jj_la1[12] = jj_gen;
421             break label_7;
422           }
423           propertyElt(ctxt,r);
424           zwhite(suggestParseType);
425         }
426                                            // javaCC bug work-around
427
jj_scanpos = jj_lastpos = null;
428         jj_consume_token(E_END);
429         break;
430       case E_OTHER:
431       case E_LI:
432       case E_RDF_N:
433         typedNode(ctxt,r,suggestParseType);
434         break;
435       default:
436         jj_la1[13] = jj_gen;
437         jj_consume_token(-1);
438         throw new ParseException();
439       }
440     } catch (ParseException e) {
441                                        error_recovery(e);
442     }
443   }
444
445 /*
446  [6.5] idAboutAttr ::= idAttr | aboutAttr | nodeIdAttr
447 */

448   final public void idAboutAttr(XMLContext ctxt,ARPResource r) throws ParseException {
449                                          String JavaDoc s;
450     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
451     case A_ID:
452       s = idAttr(ctxt);
453                                          r.setAbout(s);
454       break;
455     case A_ABOUT:
456       aboutAttr(ctxt,r);
457       break;
458     case A_NODEID:
459       nodeIdAttr(ctxt,r);
460       break;
461     default:
462       jj_la1[14] = jj_gen;
463       jj_consume_token(-1);
464       throw new ParseException();
465     }
466   }
467
468 /*
469  [6.6] idAttr ::= ' ID="' IDsymbol '"'
470 */

471   final public String JavaDoc idAttr(XMLContext ctxt) throws ParseException {
472                                          String JavaDoc s;
473     jj_consume_token(A_ID);
474     s = idSymbol(ctxt);
475     label_8:
476     while (true) {
477       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
478       case X_WARNING:
479         ;
480         break;
481       default:
482         jj_la1[15] = jj_gen;
483         break label_8;
484       }
485       warning();
486     }
487                                          {if (true) return s;}
488     throw new Error JavaDoc("Missing return statement in function");
489   }
490
491 /*
492   [6.7] aboutAttr ::= ' about="' URI-reference '"'
493 */

494   final public void aboutAttr(XMLContext ctxt,ARPResource r) throws ParseException {
495                                          URIReference u;
496     jj_consume_token(A_ABOUT);
497     u = uriReference(ctxt);
498     label_9:
499     while (true) {
500       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
501       case X_WARNING:
502         ;
503         break;
504       default:
505         jj_la1[16] = jj_gen;
506         break label_9;
507       }
508       warning();
509     }
510                                          r.setAbout(u);
511   }
512
513 /*
514    nodeIdAttr ::= ' rdf:nodeID="' XMLNCName '"'
515 */

516   final public void nodeIdAttr(XMLContext ctxt,ARPResource r) throws ParseException {
517                                          Token t;
518     jj_consume_token(A_NODEID);
519     t = jj_consume_token(AV_STRING);
520     label_10:
521     while (true) {
522       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
523       case X_WARNING:
524         ;
525         break;
526       default:
527         jj_la1[17] = jj_gen;
528         break label_10;
529       }
530       warning();
531     }
532                                          r.setNodeId(X.checkNodeID(t));
533   }
534
535 /*
536  [6.10] propAttr ::= typeAttr
537                           | propName '="' string '"' (with embedded quotes escaped)
538 */

539   final public void propAttr(XMLContext ctxt,ARPResource r) throws ParseException {
540                                          Token str;
541                                          Token prop;
542     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
543     case A_TYPE:
544       typeAttr(ctxt,r);
545       break;
546     case A_OTHER:
547       // OR
548
prop = jj_consume_token(A_OTHER);
549       str = jj_consume_token(AV_STRING);
550       label_11:
551       while (true) {
552         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
553         case X_WARNING:
554           ;
555           break;
556         default:
557           jj_la1[18] = jj_gen;
558           break label_11;
559         }
560         warning();
561       }
562                                            X.checkString(str);
563                                            r.setPredicateObject(
564                                                  ((ARPQname)prop)
565                                                       .asURIReference(arp),
566                                                  new ARPString((StrToken)str,
567                                                             ctxt.getLang()) );
568       break;
569     case A_RDF_N:
570       // OR
571
prop = jj_consume_token(A_RDF_N);
572       str = jj_consume_token(AV_STRING);
573       label_12:
574       while (true) {
575         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
576         case X_WARNING:
577           ;
578           break;
579         default:
580           jj_la1[19] = jj_gen;
581           break label_12;
582         }
583         warning();
584       }
585                                            X.checkString(str);
586                                            r.setPredicateObject(
587                                                  ((ARPQname)prop)
588                                                       .asURIReference(arp),
589                                                  new ARPString((StrToken)str,
590                                                             ctxt.getLang()) );
591       break;
592     default:
593       jj_la1[20] = jj_gen;
594       jj_consume_token(-1);
595       throw new ParseException();
596     }
597   }
598
599 /*
600  [6.11] typeAttr ::= ' type="' URI-reference '"'
601 */

602   final public void typeAttr(XMLContext ctxt,ARPResource r) throws ParseException {
603                                          URIReference u;
604     jj_consume_token(A_TYPE);
605     u = uriReference(ctxt);
606     label_13:
607     while (true) {
608       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
609       case X_WARNING:
610         ;
611         break;
612       default:
613         jj_la1[21] = jj_gen;
614         break label_13;
615       }
616       warning();
617     }
618                                          r.setType(u);
619   }
620
621 /*
622  [6.12] propertyElt ::= '<' propName idAttr? '>' value '</' propName '>'
623                          | '<' propName idAttr? parseLiteral '>'
624                                literal '</' propName '>'
625                          | '<' propName idAttr? parseResource '>'
626                                propertyElt* '</' propName '>'
627                          | '<' propName idRefAttr? propAttr* '/>'
628
629 Merged with:
630  [6.29] referencedItem ::= '<rdf:li' resourceAttr '/>'
631  [6.30] inlineItem ::= '<rdf:li' '>' value </rdf:li>'
632                          | '<rdf:li' parseLiteral '>' literal </rdf:li>'
633                          | '<rdf:li' parseResource '>' propertyElt* </rdf:li>'
634
635 see working group notes.
636
637 In these productions E_END comes after the action in case the action
638 throws a ParseException. In such a case, error_recovery is looking for the
639 E_END.
640 */

641   final public void propertyElt(XMLContext ctxt,ARPResource r) throws ParseException {
642                                          Token p;
643     try {
644       p = propertyEltTag();
645                                          p = (Token)p.clone();
646                                          // We do not want to hold on
647
// to the sequence of all subsequent
648
// tokens.
649
p.next = null;
650       ctxt = xmlAttrs(ctxt);
651       propertyEltIdAndValue(ctxt, r, p);
652       jj_consume_token(E_END);
653     } catch (ParseException e) {
654                                          error_recovery(e);
655     }
656   }
657
658   final public Token propertyEltTag() throws ParseException {
659                                          Token p;
660     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
661     case E_OTHER:
662       p = jj_consume_token(E_OTHER);
663                                          {if (true) return p;}
664       break;
665     case E_LI:
666       // OR
667
p = jj_consume_token(E_LI);
668                                          {if (true) return p;}
669       break;
670     case E_RDF_N:
671       // OR
672
p = jj_consume_token(E_RDF_N);
673                                          {if (true) return p;}
674       break;
675     default:
676       jj_la1[22] = jj_gen;
677       jj_consume_token(-1);
678       throw new ParseException();
679     }
680     throw new Error JavaDoc("Missing return statement in function");
681   }
682
683   final public void propertyEltIdAndValue(XMLContext ctxt,ARPResource r, Token p) throws ParseException {
684                                          String JavaDoc reify = null;
685                                          Object JavaDoc v;
686     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
687     case A_ID:
688       reify = idAttr(ctxt);
689       break;
690     default:
691       jj_la1[23] = jj_gen;
692       ;
693     }
694     v = propEltValue(ctxt);
695                                          try {
696                                            X.createTriple(r, p, v, reify );
697                                            // javaCC bug work-around
698
jj_scanpos = jj_lastpos = null;
699                                          }
700                                          finally {
701                                           arp.endLocalScope(v);
702
703                                          }
704   }
705
706   final public Object JavaDoc propEltValue(XMLContext ctxt) throws ParseException {
707                                          String JavaDoc xml;
708                                          Object JavaDoc v;
709                                          Token parseType;
710                                          String JavaDoc parseTypeVal;
711                                          ARPResource ptr;
712                                          AResourceInternal daml[];
713                                          ARPString dtLex;
714                                          URIReference dtURI;
715                                          Location wh;
716     if (jj_2_1(2)) {
717       jj_consume_token(A_PARSETYPE);
718       parseType = jj_consume_token(AV_LITERAL);
719                                          parseTypeVal =
720                                              ((StrToken)parseType).value;
721                                          // Allow garbage collector
722
// to operate for very large
723
// xml:literals
724
wh = parseType.location;
725                                          parseType = null;
726       label_14:
727       while (true) {
728         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
729         case X_WARNING:
730           ;
731           break;
732         default:
733           jj_la1[24] = jj_gen;
734           break label_14;
735         }
736         warning();
737       }
738       xml = litValue(ctxt.getNamespaces(),wh);
739                                          {if (true) return
740                                           new ARPString(xml,
741                                                  ctxt.getLang(),
742                                                  parseTypeVal );}
743     } else if (jj_2_2(2)) {
744       jj_consume_token(A_PARSETYPE);
745       jj_consume_token(AV_DAMLCOLLECTION);
746                                            daml = new AResourceInternal[1];
747       label_15:
748       while (true) {
749         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
750         case X_WARNING:
751           ;
752           break;
753         default:
754           jj_la1[25] = jj_gen;
755           break label_15;
756         }
757         warning();
758       }
759       white();
760       collection(ctxt,
761                 X.damlCollectionAction(daml));
762                                            {if (true) return daml[0];}
763     } else if (jj_2_3(2)) {
764       jj_consume_token(A_PARSETYPE);
765       jj_consume_token(AV_COLLECTION);
766                                           daml = new AResourceInternal[1];
767       label_16:
768       while (true) {
769         switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
770         case X_WARNING:
771           ;
772           break;
773         default:
774           jj_la1[26] = jj_gen;
775           break label_16;
776         }
777         warning();
778       }
779       white();
780       collection(ctxt,
781               X.collectionAction(daml));
782                                           {if (true) return daml[0];}
783     } else {
784       switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {