AST.cxx

Go to the documentation of this file.
00001 
00002 /*
00003  * Copyright (C) 2008, The EROS Group, LLC.
00004  * All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or
00007  * without modification, are permitted provided that the following
00008  * conditions are met:
00009  *
00010  *   - Redistributions of source code must contain the above
00011  *     copyright notice, this list of conditions, and the following
00012  *     disclaimer.
00013  *
00014  *   - Redistributions in binary form must reproduce the above
00015  *     copyright notice, this list of conditions, and the following
00016  *     disclaimer in the documentation and/or other materials
00017  *     provided with the distribution.
00018  *
00019  *   - Neither the names of the copyright holders nor the names of any
00020  *     of any contributors may be used to endorse or promote products
00021  *     derived from this software without specific prior written
00022  *     permission.
00023  *
00024  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00025  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00026  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00027  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00028  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00029  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00030  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00031  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00032  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00033  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00034  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035  */
00036 
00037 #include <stdlib.h>
00038 #include <dirent.h>
00039 #include <fstream>
00040 #include <iostream>
00041 #include <string>
00042 #include "AST.hxx"
00043 
00044 
00045 #include "Type.hxx"
00046 #include "Special.hxx"
00047 #include "UocInfo.hxx"
00048 
00049 using namespace boost;
00050 using namespace sherpa;
00051 unsigned long long AST::astCount = 0;
00052 
00053 
00054 AST::~AST()
00055 {
00056 }
00057 
00058 AST::AST(const AstType at)
00059 {
00060   astType = at;
00061 
00062   ID = ++(AST::astCount);
00063   identType = id_unresolved;
00064   flags = NO_FLAGS;
00065   isDecl = false;
00066   scheme = GC_NULL;
00067   symType = GC_NULL;
00068   symbolDef = GC_NULL;
00069   defn = GC_NULL;
00070   defForm = GC_NULL;
00071   defbps = GC_NULL;
00072   decl = GC_NULL;
00073   printVariant = pf_NONE;                // until otherwise stated
00074   tagType = GC_NULL;
00075   field_bits = 0;
00076   unin_discm = 0;
00077   total_fill = 0;
00078   tvarLB = GC_NULL;
00079   parentLB = GC_NULL;
00080 }
00081 
00082 AST::AST(const AstType at, const AST_TOKEN_TYPE& tok)
00083 {
00084   astType = at;
00085   loc = tok.loc;
00086   s = tok.str;
00087 
00088   ID = ++(AST::astCount);
00089   identType = id_unresolved;
00090   flags = NO_FLAGS;
00091   isDecl = false;
00092   scheme = GC_NULL;
00093   symType = GC_NULL;
00094   symbolDef = GC_NULL;
00095   defn = GC_NULL;
00096   defForm = GC_NULL;
00097   defbps = GC_NULL;
00098   decl = GC_NULL;
00099   printVariant = pf_NONE;                // until otherwise stated
00100   tagType = GC_NULL;
00101   field_bits = 0;
00102   unin_discm = 0;
00103   total_fill = 0;
00104   tvarLB = GC_NULL;
00105   parentLB = GC_NULL;
00106 }
00107 
00108 AST::AST(const AstType at, const AST_LOCATION_TYPE& _loc)
00109 {
00110   astType = at;
00111   loc = _loc;
00112 
00113   ID = ++(AST::astCount);
00114   identType = id_unresolved;
00115   flags = NO_FLAGS;
00116   isDecl = false;
00117   scheme = GC_NULL;
00118   symType = GC_NULL;
00119   symbolDef = GC_NULL;
00120   defn = GC_NULL;
00121   defForm = GC_NULL;
00122   defbps = GC_NULL;
00123   decl = GC_NULL;
00124   printVariant = pf_NONE;                // until otherwise stated
00125   tagType = GC_NULL;
00126   field_bits = 0;
00127   unin_discm = 0;
00128   total_fill = 0;
00129   tvarLB = GC_NULL;
00130   parentLB = GC_NULL;
00131 }
00132 
00133 AST::AST(const AstType at, const AST_LOCATION_TYPE& _loc,
00134          GCPtr<AST>::Type child1)
00135 {
00136   astType = at;
00137   loc = _loc;
00138   addChild(child1);
00139 
00140   ID = ++(AST::astCount);
00141   identType = id_unresolved;
00142   flags = NO_FLAGS;
00143   isDecl = false;
00144   scheme = GC_NULL;
00145   symType = GC_NULL;
00146   symbolDef = GC_NULL;
00147   defn = GC_NULL;
00148   defForm = GC_NULL;
00149   defbps = GC_NULL;
00150   decl = GC_NULL;
00151   printVariant = pf_NONE;                // until otherwise stated
00152   tagType = GC_NULL;
00153   field_bits = 0;
00154   unin_discm = 0;
00155   total_fill = 0;
00156   tvarLB = GC_NULL;
00157   parentLB = GC_NULL;
00158 }
00159 
00160 AST::AST(const AstType at, const AST_LOCATION_TYPE& _loc,
00161          GCPtr<AST>::Type child1,
00162          GCPtr<AST>::Type child2)
00163 {
00164   astType = at;
00165   loc = _loc;
00166   addChild(child1);
00167   addChild(child2);
00168 
00169   ID = ++(AST::astCount);
00170   identType = id_unresolved;
00171   flags = NO_FLAGS;
00172   isDecl = false;
00173   scheme = GC_NULL;
00174   symType = GC_NULL;
00175   symbolDef = GC_NULL;
00176   defn = GC_NULL;
00177   defForm = GC_NULL;
00178   defbps = GC_NULL;
00179   decl = GC_NULL;
00180   printVariant = pf_NONE;                // until otherwise stated
00181   tagType = GC_NULL;
00182   field_bits = 0;
00183   unin_discm = 0;
00184   total_fill = 0;
00185   tvarLB = GC_NULL;
00186   parentLB = GC_NULL;
00187 }
00188 
00189 AST::AST(const AstType at, const AST_LOCATION_TYPE& _loc,
00190          GCPtr<AST>::Type child1,
00191          GCPtr<AST>::Type child2,
00192          GCPtr<AST>::Type child3)
00193 {
00194   astType = at;
00195   loc = _loc;
00196   addChild(child1);
00197   addChild(child2);
00198   addChild(child3);
00199 
00200   ID = ++(AST::astCount);
00201   identType = id_unresolved;
00202   flags = NO_FLAGS;
00203   isDecl = false;
00204   scheme = GC_NULL;
00205   symType = GC_NULL;
00206   symbolDef = GC_NULL;
00207   defn = GC_NULL;
00208   defForm = GC_NULL;
00209   defbps = GC_NULL;
00210   decl = GC_NULL;
00211   printVariant = pf_NONE;                // until otherwise stated
00212   tagType = GC_NULL;
00213   field_bits = 0;
00214   unin_discm = 0;
00215   total_fill = 0;
00216   tvarLB = GC_NULL;
00217   parentLB = GC_NULL;
00218 }
00219 
00220 AST::AST(const AstType at, const AST_LOCATION_TYPE& _loc,
00221          GCPtr<AST>::Type child1,
00222          GCPtr<AST>::Type child2,
00223          GCPtr<AST>::Type child3,
00224          GCPtr<AST>::Type child4)
00225 {
00226   astType = at;
00227   loc = _loc;
00228   addChild(child1);
00229   addChild(child2);
00230   addChild(child3);
00231   addChild(child4);
00232 
00233   ID = ++(AST::astCount);
00234   identType = id_unresolved;
00235   flags = NO_FLAGS;
00236   isDecl = false;
00237   scheme = GC_NULL;
00238   symType = GC_NULL;
00239   symbolDef = GC_NULL;
00240   defn = GC_NULL;
00241   defForm = GC_NULL;
00242   defbps = GC_NULL;
00243   decl = GC_NULL;
00244   printVariant = pf_NONE;                // until otherwise stated
00245   tagType = GC_NULL;
00246   field_bits = 0;
00247   unin_discm = 0;
00248   total_fill = 0;
00249   tvarLB = GC_NULL;
00250   parentLB = GC_NULL;
00251 }
00252 
00253 AST::AST(const AstType at, const AST_LOCATION_TYPE& _loc,
00254          GCPtr<AST>::Type child1,
00255          GCPtr<AST>::Type child2,
00256          GCPtr<AST>::Type child3,
00257          GCPtr<AST>::Type child4,
00258          GCPtr<AST>::Type child5)
00259 {
00260   astType = at;
00261   loc = _loc;
00262   addChild(child1);
00263   addChild(child2);
00264   addChild(child3);
00265   addChild(child4);
00266   addChild(child5);
00267 
00268   ID = ++(AST::astCount);
00269   identType = id_unresolved;
00270   flags = NO_FLAGS;
00271   isDecl = false;
00272   scheme = GC_NULL;
00273   symType = GC_NULL;
00274   symbolDef = GC_NULL;
00275   defn = GC_NULL;
00276   defForm = GC_NULL;
00277   defbps = GC_NULL;
00278   decl = GC_NULL;
00279   printVariant = pf_NONE;                // until otherwise stated
00280   tagType = GC_NULL;
00281   field_bits = 0;
00282   unin_discm = 0;
00283   total_fill = 0;
00284   tvarLB = GC_NULL;
00285   parentLB = GC_NULL;
00286 }
00287 
00288 AST::AST(const AstType at, const AST_LOCATION_TYPE& _loc,
00289          GCPtr<AST>::Type child1,
00290          GCPtr<AST>::Type child2,
00291          GCPtr<AST>::Type child3,
00292          GCPtr<AST>::Type child4,
00293          GCPtr<AST>::Type child5,
00294          GCPtr<AST>::Type child6)
00295 {
00296   astType = at;
00297   loc = _loc;
00298   addChild(child1);
00299   addChild(child2);
00300   addChild(child3);
00301   addChild(child4);
00302   addChild(child5);
00303   addChild(child6);
00304 
00305   ID = ++(AST::astCount);
00306   identType = id_unresolved;
00307   flags = NO_FLAGS;
00308   isDecl = false;
00309   scheme = GC_NULL;
00310   symType = GC_NULL;
00311   symbolDef = GC_NULL;
00312   defn = GC_NULL;
00313   defForm = GC_NULL;
00314   defbps = GC_NULL;
00315   decl = GC_NULL;
00316   printVariant = pf_NONE;                // until otherwise stated
00317   tagType = GC_NULL;
00318   field_bits = 0;
00319   unin_discm = 0;
00320   total_fill = 0;
00321   tvarLB = GC_NULL;
00322   parentLB = GC_NULL;
00323 }
00324 
00325 AST::AST(const AstType at, const AST_LOCATION_TYPE& _loc,
00326          GCPtr<AST>::Type child1,
00327          GCPtr<AST>::Type child2,
00328          GCPtr<AST>::Type child3,
00329          GCPtr<AST>::Type child4,
00330          GCPtr<AST>::Type child5,
00331          GCPtr<AST>::Type child6,
00332          GCPtr<AST>::Type child7)
00333 {
00334   astType = at;
00335   loc = _loc;
00336   addChild(child1);
00337   addChild(child2);
00338   addChild(child3);
00339   addChild(child4);
00340   addChild(child5);
00341   addChild(child6);
00342   addChild(child7);
00343 
00344   ID = ++(AST::astCount);
00345   identType = id_unresolved;
00346   flags = NO_FLAGS;
00347   isDecl = false;
00348   scheme = GC_NULL;
00349   symType = GC_NULL;
00350   symbolDef = GC_NULL;
00351   defn = GC_NULL;
00352   defForm = GC_NULL;
00353   defbps = GC_NULL;
00354   decl = GC_NULL;
00355   printVariant = pf_NONE;                // until otherwise stated
00356   tagType = GC_NULL;
00357   field_bits = 0;
00358   unin_discm = 0;
00359   total_fill = 0;
00360   tvarLB = GC_NULL;
00361   parentLB = GC_NULL;
00362 }
00363 
00364 AST::AST(const AstType at, const AST_LOCATION_TYPE& _loc,
00365          GCPtr<AST>::Type child1,
00366          GCPtr<AST>::Type child2,
00367          GCPtr<AST>::Type child3,
00368          GCPtr<AST>::Type child4,
00369          GCPtr<AST>::Type child5,
00370          GCPtr<AST>::Type child6,
00371          GCPtr<AST>::Type child7,
00372          GCPtr<AST>::Type child8)
00373 {
00374   astType = at;
00375   loc = _loc;
00376   addChild(child1);
00377   addChild(child2);
00378   addChild(child3);
00379   addChild(child4);
00380   addChild(child5);
00381   addChild(child6);
00382   addChild(child8);
00383 
00384   ID = ++(AST::astCount);
00385   identType = id_unresolved;
00386   flags = NO_FLAGS;
00387   isDecl = false;
00388   scheme = GC_NULL;
00389   symType = GC_NULL;
00390   symbolDef = GC_NULL;
00391   defn = GC_NULL;
00392   defForm = GC_NULL;
00393   defbps = GC_NULL;
00394   decl = GC_NULL;
00395   printVariant = pf_NONE;                // until otherwise stated
00396   tagType = GC_NULL;
00397   field_bits = 0;
00398   unin_discm = 0;
00399   total_fill = 0;
00400   tvarLB = GC_NULL;
00401   parentLB = GC_NULL;
00402 }
00403 
00404 ::std::string
00405 AST::getTokenString()
00406 {
00407   return s;
00408 }
00409 
00410 void
00411 AST::addChild(GCPtr<AST>::Type cld)
00412 {
00413   children.push_back(cld);
00414 }
00415 
00416 const char *
00417 AST::tagName(const AstType at)
00418 {
00419   switch(at) {
00420   case at_Null:
00421     return "at_Null";
00422   case at_AnyGroup:
00423     return "at_AnyGroup";
00424   case at_ident:
00425     return "at_ident";
00426   case at_ifident:
00427     return "at_ifident";
00428   case at_usesel:
00429     return "at_usesel";
00430   case at_boolLiteral:
00431     return "at_boolLiteral";
00432   case at_charLiteral:
00433     return "at_charLiteral";
00434   case at_intLiteral:
00435     return "at_intLiteral";
00436   case at_floatLiteral:
00437     return "at_floatLiteral";
00438   case at_stringLiteral:
00439     return "at_stringLiteral";
00440   case at_module:
00441     return "at_module";
00442   case at_interface:
00443     return "at_interface";
00444   case at_defunion:
00445     return "at_defunion";
00446   case at_declunion:
00447     return "at_declunion";
00448   case at_defstruct:
00449     return "at_defstruct";
00450   case at_declstruct:
00451     return "at_declstruct";
00452   case at_defobject:
00453     return "at_defobject";
00454   case at_defrepr:
00455     return "at_defrepr";
00456   case at_declrepr:
00457     return "at_declrepr";
00458   case at_reprctrs:
00459     return "at_reprctrs";
00460   case at_reprctr:
00461     return "at_reprctr";
00462   case at_reprrepr:
00463     return "at_reprrepr";
00464   case at_boxedCat:
00465     return "at_boxedCat";
00466   case at_unboxedCat:
00467     return "at_unboxedCat";
00468   case at_opaqueCat:
00469     return "at_opaqueCat";
00470   case at_oc_closed:
00471     return "at_oc_closed";
00472   case at_oc_open:
00473     return "at_oc_open";
00474   case at_defexception:
00475     return "at_defexception";
00476   case at_deftypeclass:
00477     return "at_deftypeclass";
00478   case at_tcdecls:
00479     return "at_tcdecls";
00480   case at_tyfn:
00481     return "at_tyfn";
00482   case at_tcapp:
00483     return "at_tcapp";
00484   case at_method_decls:
00485     return "at_method_decls";
00486   case at_method_decl:
00487     return "at_method_decl";
00488   case at_qualType:
00489     return "at_qualType";
00490   case at_constraints:
00491     return "at_constraints";
00492   case at_definstance:
00493     return "at_definstance";
00494   case at_tcmethods:
00495     return "at_tcmethods";
00496   case at_tcmethod_binding:
00497     return "at_tcmethod_binding";
00498   case at_proclaim:
00499     return "at_proclaim";
00500   case at_define:
00501     return "at_define";
00502   case at_recdef:
00503     return "at_recdef";
00504   case at_importAs:
00505     return "at_importAs";
00506   case at_provide:
00507     return "at_provide";
00508   case at_import:
00509     return "at_import";
00510   case at_ifsel:
00511     return "at_ifsel";
00512   case at_declares:
00513     return "at_declares";
00514   case at_declare:
00515     return "at_declare";
00516   case at_tvlist:
00517     return "at_tvlist";
00518   case at_constructors:
00519     return "at_constructors";
00520   case at_constructor:
00521     return "at_constructor";
00522   case at_fields:
00523     return "at_fields";
00524   case at_field:
00525     return "at_field";
00526   case at_fill:
00527     return "at_fill";
00528   case at_methdecl:
00529     return "at_methdecl";
00530   case at_bitfieldType:
00531     return "at_bitfieldType";
00532   case at_byRefType:
00533     return "at_byRefType";
00534   case at_arrayRefType:
00535     return "at_arrayRefType";
00536   case at_boxedType:
00537     return "at_boxedType";
00538   case at_unboxedType:
00539     return "at_unboxedType";
00540   case at_fn:
00541     return "at_fn";
00542   case at_methType:
00543     return "at_methType";
00544   case at_primaryType:
00545     return "at_primaryType";
00546   case at_fnargVec:
00547     return "at_fnargVec";
00548   case at_arrayType:
00549     return "at_arrayType";
00550   case at_vectorType:
00551     return "at_vectorType";
00552   case at_mutableType:
00553     return "at_mutableType";
00554   case at_constType:
00555     return "at_constType";
00556   case at_typeapp:
00557     return "at_typeapp";
00558   case at_exceptionType:
00559     return "at_exceptionType";
00560   case at_fieldType:
00561     return "at_fieldType";
00562   case at_dummyType:
00563     return "at_dummyType";
00564   case at_identPattern:
00565     return "at_identPattern";
00566   case at_typeAnnotation:
00567     return "at_typeAnnotation";
00568   case at_mixfix:
00569     return "at_mixfix";
00570   case at_unit:
00571     return "at_unit";
00572   case at_suspend:
00573     return "at_suspend";
00574   case at_sizeof:
00575     return "at_sizeof";
00576   case at_bitsizeof:
00577     return "at_bitsizeof";
00578   case at_MakeVector:
00579     return "at_MakeVector";
00580   case at_vector:
00581     return "at_vector";
00582   case at_array:
00583     return "at_array";
00584   case at_begin:
00585     return "at_begin";
00586   case at_select:
00587     return "at_select";
00588   case at_fqCtr:
00589     return "at_fqCtr";
00590   case at_sel_ctr:
00591     return "at_sel_ctr";
00592   case at_array_nth:
00593     return "at_array_nth";
00594   case at_array_ref_nth:
00595     return "at_array_ref_nth";
00596   case at_vector_nth:
00597     return "at_vector_nth";
00598   case at_nth:
00599     return "at_nth";
00600   case at_lambda:
00601     return "at_lambda";
00602   case at_argVec:
00603     return "at_argVec";
00604   case at_apply:
00605     return "at_apply";
00606   case at_struct_apply:
00607     return "at_struct_apply";
00608   case at_object_apply:
00609     return "at_object_apply";
00610   case at_ucon_apply:
00611     return "at_ucon_apply";
00612   case at_if:
00613     return "at_if";
00614   case at_when:
00615     return "at_when";
00616   case at_unless:
00617     return "at_unless";
00618   case at_and:
00619     return "at_and";
00620   case at_or:
00621     return "at_or";
00622   case at_cond:
00623     return "at_cond";
00624   case at_cond_legs:
00625     return "at_cond_legs";
00626   case at_cond_leg:
00627     return "at_cond_leg";
00628   case at_condelse:
00629     return "at_condelse";
00630   case at_setbang:
00631     return "at_setbang";
00632   case at_deref:
00633     return "at_deref";
00634   case at_dup:
00635     return "at_dup";
00636   case at_inner_ref:
00637     return "at_inner_ref";
00638   case at_allocREF:
00639     return "at_allocREF";
00640   case at_copyREF:
00641     return "at_copyREF";
00642   case at_mkClosure:
00643     return "at_mkClosure";
00644   case at_setClosure:
00645     return "at_setClosure";
00646   case at_mkArrayRef:
00647     return "at_mkArrayRef";
00648   case at_labeledBlock:
00649     return "at_labeledBlock";
00650   case at_return_from:
00651     return "at_return_from";
00652   case at_uswitch:
00653     return "at_uswitch";
00654   case at_usw_legs:
00655     return "at_usw_legs";
00656   case at_usw_leg:
00657     return "at_usw_leg";
00658   case at_otherwise:
00659     return "at_otherwise";
00660   case at_try:
00661     return "at_try";
00662   case at_throw:
00663     return "at_throw";
00664   case at_let:
00665     return "at_let";
00666   case at_letbindings:
00667     return "at_letbindings";
00668   case at_letbinding:
00669     return "at_letbinding";
00670   case at_letrec:
00671     return "at_letrec";
00672   case at_loop:
00673     return "at_loop";
00674   case at_loopbindings:
00675     return "at_loopbindings";
00676   case at_loopbinding:
00677     return "at_loopbinding";
00678   case at_looptest:
00679     return "at_looptest";
00680   case at_localFrame:
00681     return "at_localFrame";
00682   case at_frameBindings:
00683     return "at_frameBindings";
00684   case at_letStar:
00685     return "at_letStar";
00686   case at_identList:
00687     return "at_identList";
00688   case at_container:
00689     return "at_container";
00690   case at_docString:
00691     return "at_docString";
00692   case at_letGather:
00693     return "at_letGather";
00694   case agt_var:
00695     return "agt_var";
00696   case agt_uselhs:
00697     return "agt_uselhs";
00698   case agt_literal:
00699     return "agt_literal";
00700   case agt_tvar:
00701     return "agt_tvar";
00702   case agt_CompilationUnit:
00703     return "agt_CompilationUnit";
00704   case agt_definition:
00705     return "agt_definition";
00706   case agt_type_definition:
00707     return "agt_type_definition";
00708   case agt_tc_definition:
00709     return "agt_tc_definition";
00710   case agt_value_definition:
00711     return "agt_value_definition";
00712   case agt_if_definition:
00713     return "agt_if_definition";
00714   case agt_category:
00715     return "agt_category";
00716   case agt_openclosed:
00717     return "agt_openclosed";
00718   case agt_fielditem:
00719     return "agt_fielditem";
00720   case agt_qtype:
00721     return "agt_qtype";
00722   case agt_type:
00723     return "agt_type";
00724   case agt_expr:
00725     return "agt_expr";
00726   case agt_expr_or_define:
00727     return "agt_expr_or_define";
00728   case agt__AnonGroup0:
00729     return "agt__AnonGroup0";
00730   case agt_eform:
00731     return "agt_eform";
00732   case agt_ucon:
00733     return "agt_ucon";
00734   case agt_ow:
00735     return "agt_ow";
00736   default:
00737     return "<unknown>";
00738   }
00739 }
00740 
00741 const char *
00742 AST::nodeName(const AstType at)
00743 {
00744   switch(at) {
00745   case at_Null:
00746     return "Null";
00747   case at_AnyGroup:
00748     return "AnyGroup";
00749   case at_ident:
00750     return "ident";
00751   case at_ifident:
00752     return "ifident";
00753   case at_usesel:
00754     return "usesel";
00755   case at_boolLiteral:
00756     return "boolLiteral";
00757   case at_charLiteral:
00758     return "charLiteral";
00759   case at_intLiteral:
00760     return "intLiteral";
00761   case at_floatLiteral:
00762     return "floatLiteral";
00763   case at_stringLiteral:
00764     return "stringLiteral";
00765   case at_module:
00766     return "module";
00767   case at_interface:
00768     return "interface";
00769   case at_defunion:
00770     return "defunion";
00771   case at_declunion:
00772     return "declunion";
00773   case at_defstruct:
00774     return "defstruct";
00775   case at_declstruct:
00776     return "declstruct";
00777   case at_defobject:
00778     return "defobject";
00779   case at_defrepr:
00780     return "defrepr";
00781   case at_declrepr:
00782     return "declrepr";
00783   case at_reprctrs:
00784     return "reprctrs";
00785   case at_reprctr:
00786     return "reprctr";
00787   case at_reprrepr:
00788     return "reprrepr";
00789   case at_boxedCat:
00790     return "boxedCat";
00791   case at_unboxedCat:
00792     return "unboxedCat";
00793   case at_opaqueCat:
00794     return "opaqueCat";
00795   case at_oc_closed:
00796     return "oc_closed";
00797   case at_oc_open:
00798     return "oc_open";
00799   case at_defexception:
00800     return "defexception";
00801   case at_deftypeclass:
00802     return "deftypeclass";
00803   case at_tcdecls:
00804     return "tcdecls";
00805   case at_tyfn:
00806     return "tyfn";
00807   case at_tcapp:
00808     return "tcapp";
00809   case at_method_decls:
00810     return "method_decls";
00811   case at_method_decl:
00812     return "method_decl";
00813   case at_qualType:
00814     return "qualType";
00815   case at_constraints:
00816     return "constraints";
00817   case at_definstance:
00818     return "definstance";
00819   case at_tcmethods:
00820     return "tcmethods";
00821   case at_tcmethod_binding:
00822     return "tcmethod_binding";
00823   case at_proclaim:
00824     return "proclaim";
00825   case at_define:
00826     return "define";
00827   case at_recdef:
00828     return "recdef";
00829   case at_importAs:
00830     return "importAs";
00831   case at_provide:
00832     return "provide";
00833   case at_import:
00834     return "import";
00835   case at_ifsel:
00836     return "ifsel";
00837   case at_declares:
00838     return "declares";
00839   case at_declare:
00840     return "declare";
00841   case at_tvlist:
00842     return "tvlist";
00843   case at_constructors:
00844     return "constructors";
00845   case at_constructor:
00846     return "constructor";
00847   case at_fields:
00848     return "fields";
00849   case at_field:
00850     return "field";
00851   case at_fill:
00852     return "fill";
00853   case at_methdecl:
00854     return "methdecl";
00855   case at_bitfieldType:
00856     return "bitfieldType";
00857   case at_byRefType:
00858     return "byRefType";
00859   case at_arrayRefType:
00860     return "arrayRefType";
00861   case at_boxedType:
00862     return "boxedType";
00863   case at_unboxedType:
00864     return "unboxedType";
00865   case at_fn:
00866     return "fn";
00867   case at_methType:
00868     return "methType";
00869   case at_primaryType:
00870     return "primaryType";
00871   case at_fnargVec:
00872     return "fnargVec";
00873   case at_arrayType:
00874     return "arrayType";
00875   case at_vectorType:
00876     return "vectorType";
00877   case at_mutableType:
00878     return "mutableType";
00879   case at_constType:
00880     return "constType";
00881   case at_typeapp:
00882     return "typeapp";
00883   case at_exceptionType:
00884     return "exceptionType";
00885   case at_fieldType:
00886     return "fieldType";
00887   case at_dummyType:
00888     return "dummyType";
00889   case at_identPattern:
00890     return "identPattern";
00891   case at_typeAnnotation:
00892     return "typeAnnotation";
00893   case at_mixfix:
00894     return "mixfix";
00895   case at_unit:
00896     return "unit";
00897   case at_suspend:
00898     return "suspend";
00899   case at_sizeof:
00900     return "sizeof";
00901   case at_bitsizeof:
00902     return "bitsizeof";
00903   case at_MakeVector:
00904     return "MakeVector";
00905   case at_vector:
00906     return "vector";
00907   case at_array:
00908     return "array";
00909   case at_begin:
00910     return "begin";
00911   case at_select:
00912     return "select";
00913   case at_fqCtr:
00914     return "fqCtr";
00915   case at_sel_ctr:
00916     return "sel_ctr";
00917   case at_array_nth:
00918     return "array_nth";
00919   case at_array_ref_nth:
00920     return "array_ref_nth";
00921   case at_vector_nth:
00922     return "vector_nth";
00923   case at_nth:
00924     return "nth";
00925   case at_lambda:
00926     return "lambda";
00927   case at_argVec:
00928     return "argVec";
00929   case at_apply:
00930     return "apply";
00931   case at_struct_apply:
00932     return "struct_apply";
00933   case at_object_apply:
00934     return "object_apply";
00935   case at_ucon_apply:
00936     return "ucon_apply";
00937   case at_if:
00938     return "if";
00939   case at_when:
00940     return "when";
00941   case at_unless:
00942     return "unless";
00943   case at_and:
00944     return "and";
00945   case at_or:
00946     return "or";
00947   case at_cond:
00948     return "cond";
00949   case at_cond_legs:
00950     return "cond_legs";
00951   case at_cond_leg:
00952     return "cond_leg";
00953   case at_condelse:
00954     return "condelse";
00955   case at_setbang:
00956     return "setbang";
00957   case at_deref:
00958     return "deref";
00959   case at_dup:
00960     return "dup";
00961   case at_inner_ref:
00962     return "inner_ref";
00963   case at_allocREF:
00964     return "allocREF";
00965   case at_copyREF:
00966     return "copyREF";
00967   case at_mkClosure:
00968     return "mkClosure";
00969   case at_setClosure:
00970     return "setClosure";
00971   case at_mkArrayRef:
00972     return "mkArrayRef";
00973   case at_labeledBlock:
00974     return "labeledBlock";
00975   case at_return_from:
00976     return "return_from";
00977   case at_uswitch:
00978     return "uswitch";
00979   case at_usw_legs:
00980     return "usw_legs";
00981   case at_usw_leg:
00982     return "usw_leg";
00983   case at_otherwise:
00984     return "otherwise";
00985   case at_try:
00986     return "try";
00987   case at_throw:
00988     return "throw";
00989   case at_let:
00990     return "let";
00991   case at_letbindings:
00992     return "letbindings";
00993   case at_letbinding:
00994     return "letbinding";
00995   case at_letrec:
00996     return "letrec";
00997   case at_loop:
00998     return "loop";
00999   case at_loopbindings:
01000     return "loopbindings";
01001   case at_loopbinding:
01002     return "loopbinding";
01003   case at_looptest:
01004     return "looptest";
01005   case at_localFrame:
01006     return "localFrame";
01007   case at_frameBindings:
01008     return "frameBindings";
01009   case at_letStar:
01010     return "letStar";
01011   case at_identList:
01012     return "identList";
01013   case at_container:
01014     return "container";
01015   case at_docString:
01016     return "docString";
01017   case at_letGather:
01018     return "letGather";
01019   case agt_var:
01020     return "var";
01021   case agt_uselhs:
01022     return "uselhs";
01023   case agt_literal:
01024     return "literal";
01025   case agt_tvar:
01026     return "tvar";
01027   case agt_CompilationUnit:
01028     return "CompilationUnit";
01029   case agt_definition:
01030     return "definition";
01031   case agt_type_definition:
01032     return "type_definition";
01033   case agt_tc_definition:
01034     return "tc_definition";
01035   case agt_value_definition:
01036     return "value_definition";
01037   case agt_if_definition:
01038     return "if_definition";
01039   case agt_category:
01040     return "category";
01041   case agt_openclosed:
01042     return "openclosed";
01043   case agt_fielditem:
01044     return "fielditem";
01045   case agt_qtype:
01046     return "qtype";
01047   case agt_type:
01048     return "type";
01049   case agt_expr:
01050     return "expr";
01051   case agt_expr_or_define:
01052     return "expr_or_define";
01053   case agt__AnonGroup0:
01054     return "_AnonGroup0";
01055   case agt_eform:
01056     return "eform";
01057   case agt_ucon:
01058     return "ucon";
01059   case agt_ow:
01060     return "ow";
01061   default:
01062     return "<unknown>";
01063   }
01064 }
01065 
01066 const char *
01067 AST::printName(const AstType at)
01068 {
01069   switch(at) {
01070   case at_Null:
01071     return "Null";
01072   case at_AnyGroup:
01073     return "AnyGroup";
01074   case at_ident:
01075     return "<ident>";
01076   case at_ifident:
01077     return "<ifident>";
01078   case at_usesel:
01079     return "<usesel>";
01080   case at_boolLiteral:
01081     return "<boolLiteral>";
01082   case at_charLiteral:
01083     return "<charLiteral>";
01084   case at_intLiteral:
01085     return "<intLiteral>";
01086   case at_floatLiteral:
01087     return "<floatLiteral>";
01088   case at_stringLiteral:
01089     return "<stringLiteral>";
01090   case at_module:
01091     return "module";
01092   case at_interface:
01093     return "interface";
01094   case at_defunion:
01095     return "union";
01096   case at_declunion:
01097     return "union";
01098   case at_defstruct:
01099     return "struct";
01100   case at_declstruct:
01101     return "struct";
01102   case at_defobject:
01103     return "object";
01104   case at_defrepr:
01105     return "repr";
01106   case at_declrepr:
01107     return "repr";
01108   case at_reprctrs:
01109     return "<reprctrs>";
01110   case at_reprctr:
01111     return "<reprctr>";
01112   case at_reprrepr:
01113     return "<reprrepr>";
01114   case at_boxedCat:
01115     return "boxed";
01116   case at_unboxedCat:
01117     return "unboxed";
01118   case at_opaqueCat:
01119     return "opaque";
01120   case at_oc_closed:
01121     return "closed";
01122   case at_oc_open:
01123     return "open";
01124   case at_defexception:
01125     return "exception";
01126   case at_deftypeclass:
01127     return "trait";
01128   case at_tcdecls:
01129     return "<tcdecls>";
01130   case at_tyfn:
01131     return "tyfn";
01132   case at_tcapp:
01133     return "<tcapp>";
01134   case at_method_decls:
01135     return "<method_decls>";
01136   case at_method_decl:
01137     return "<method_decl>";
01138   case at_qualType:
01139     return "<qualType>";
01140   case at_constraints:
01141     return "<constraints>";
01142   case at_definstance:
01143     return "instance";
01144   case at_tcmethods:
01145     return "<tcmethods>";
01146   case at_tcmethod_binding:
01147     return "<tcmethod_binding>";
01148   case at_proclaim:
01149     return "def";
01150   case at_define:
01151     return "def";
01152   case at_recdef:
01153     return "def";
01154   case at_importAs:
01155     return "import";
01156   case at_provide:
01157     return "provide";
01158   case at_import:
01159     return "import";
01160   case at_ifsel:
01161     return "<ifsel>";
01162   case at_declares:
01163     return "<declares>";
01164   case at_declare:
01165     return "declare";
01166   case at_tvlist:
01167     return "<tvlist>";
01168   case at_constructors:
01169     return "<constructors>";
01170   case at_constructor:
01171     return "<constructor>";
01172   case at_fields:
01173     return "<fields>";
01174   case at_field:
01175     return "<field>";
01176   case at_fill:
01177     return "fill";
01178   case at_methdecl:
01179     return "<methdecl>";
01180   case at_bitfieldType:
01181     return "bitfield";
01182   case at_byRefType:
01183     return "ByRef";
01184   case at_arrayRefType:
01185     return "ArrayRef";
01186   case at_boxedType:
01187     return "boxed";
01188   case at_unboxedType:
01189     return "unboxed";
01190   case at_fn:
01191     return "fn";
01192   case at_methType:
01193     return "method";
01194   case at_primaryType:
01195     return "<primaryType>";
01196   case at_fnargVec:
01197     return "<fnargVec>";
01198   case at_arrayType:
01199     return "array";
01200   case at_vectorType:
01201     return "vector";
01202   case at_mutableType:
01203     return "mutable";
01204   case at_constType:
01205     return "const";
01206   case at_typeapp:
01207     return "<typeapp>";
01208   case at_exceptionType:
01209     return "exception";
01210   case at_fieldType:
01211     return "<fieldType>";
01212   case at_dummyType:
01213     return "<dummyType>";
01214   case at_identPattern:
01215     return "<identPattern>";
01216   case at_typeAnnotation:
01217     return "<typeAnnotation>";
01218   case at_mixfix:
01219     return "<mixfix>";
01220   case at_unit:
01221     return "()";
01222   case at_suspend:
01223     return "<suspend>";
01224   case at_sizeof:
01225     return "sizeof";
01226   case at_bitsizeof:
01227     return "bitsizeof";
01228   case at_MakeVector:
01229     return "MakeVector";
01230   case at_vector:
01231     return "vector";
01232   case at_array:
01233     return "array";
01234   case at_begin:
01235     return "begin";
01236   case at_select:
01237     return "<select>";
01238   case at_fqCtr:
01239     return "<fqCtr>";
01240   case at_sel_ctr:
01241     return "<sel_ctr>";
01242   case at_array_nth:
01243     return "<array_nth>";
01244   case at_array_ref_nth:
01245     return "<array_ref_nth>";
01246   case at_vector_nth:
01247     return "<vector_nth>";
01248   case at_nth:
01249     return "<nth>";
01250   case at_lambda:
01251     return "lambda";
01252   case at_argVec:
01253     return "<argVec>";
01254   case at_apply:
01255     return "<apply>";
01256   case at_struct_apply:
01257     return "<struct_apply>";
01258   case at_object_apply:
01259     return "<object_apply>";
01260   case at_ucon_apply:
01261     return "<ucon_apply>";
01262   case at_if:
01263     return "if";
01264   case at_when:
01265     return "when";
01266   case at_unless:
01267     return "unless";
01268   case at_and:
01269     return "and";
01270   case at_or:
01271     return "or";
01272   case at_cond:
01273     return "cond";
01274   case at_cond_legs:
01275     return "<cond_legs>";
01276   case at_cond_leg:
01277     return "<cond_leg>";
01278   case at_condelse:
01279     return "<condelse>";
01280   case at_setbang:
01281     return "set!";
01282   case at_deref:
01283     return "deref";
01284   case at_dup:
01285     return "dup";
01286   case at_inner_ref:
01287     return "<inner_ref>";
01288   case at_allocREF:
01289     return "<allocREF>";
01290   case at_copyREF:
01291     return "<copyREF>";
01292   case at_mkClosure:
01293     return "<mkClosure>";
01294   case at_setClosure:
01295     return "<setClosure>";
01296   case at_mkArrayRef:
01297     return "<mkArrayRef>";
01298   case at_labeledBlock:
01299     return "label";
01300   case at_return_from:
01301     return "<return_from>";
01302   case at_uswitch:
01303     return "switch";
01304   case at_usw_legs:
01305     return "<usw_legs>";
01306   case at_usw_leg:
01307     return "case";
01308   case at_otherwise:
01309     return "otherwise";
01310   case at_try:
01311     return "try";
01312   case at_throw:
01313     return "throw";
01314   case at_let:
01315     return "let";
01316   case at_letbindings:
01317     return "<letbindings>";
01318   case at_letbinding:
01319     return "<letbinding>";
01320   case at_letrec:
01321     return "letrec";
01322   case at_loop:
01323     return "loop";
01324   case at_loopbindings:
01325     return "<loopbindings>";
01326   case at_loopbinding:
01327     return "<loopbinding>";
01328   case at_looptest:
01329     return "<looptest>";
01330   case at_localFrame:
01331     return "<localFrame>";
01332   case at_frameBindings:
01333     return "<frameBindings>";
01334   case at_letStar:
01335     return "<letStar>";
01336   case at_identList:
01337     return "<identList>";
01338   case at_container:
01339     return "<container>";
01340   case at_docString:
01341     return "<docString>";
01342   case at_letGather:
01343     return "<letGather>";
01344   case agt_var:
01345     return "{var}";
01346   case agt_uselhs:
01347     return "{uselhs}";
01348   case agt_literal:
01349     return "{literal}";
01350   case agt_tvar:
01351     return "{tvar}";
01352   case agt_CompilationUnit:
01353     return "{CompilationUnit}";
01354   case agt_definition:
01355     return "{definition}";
01356   case agt_type_definition:
01357     return "{type_definition}";
01358   case agt_tc_definition:
01359     return "{tc_definition}";
01360   case agt_value_definition:
01361     return "{value_definition}";
01362   case agt_if_definition:
01363     return "{if_definition}";
01364   case agt_category:
01365     return "{category}";
01366   case agt_openclosed:
01367     return "{openclosed}";
01368   case agt_fielditem:
01369     return "{fielditem}";
01370   case agt_qtype:
01371     return "{qtype}";
01372   case agt_type:
01373     return "{type}";
01374   case agt_expr:
01375     return "{expr}";
01376   case agt_expr_or_define:
01377     return "{expr_or_define}";
01378   case agt__AnonGroup0:
01379     return "{_AnonGroup0}";
01380   case agt_eform:
01381     return "{eform}";
01382   case agt_ucon:
01383     return "{ucon}";
01384   case agt_ow:
01385     return "{ow}";
01386   default:
01387     return "<unknown>";
01388   }
01389 }
01390 
01391 #define ISSET(v,b) ((v)[((b)/8)] & (1u << ((b)%8)))
01392 
01393 void
01394 astChTypeError(const AST &myAst, const AstType exp_at,
01395                const AstType act_at, size_t child)
01396 {
01397   ::std::cerr << myAst.loc.asString() << ": " << myAst.tagName();
01398   ::std::cerr << " has incompatible Child# " << child;
01399   ::std::cerr << ". Expected " << AST::tagName(exp_at) << ", "; 
01400   ::std::cerr << "Obtained " << AST::tagName(act_at) << "." << ::std::endl;
01401 }
01402 
01403 void
01404 astChNumError(const AST &myAst, const size_t exp_ch,
01405                const size_t act_ch)
01406 {
01407   ::std::cerr << myAst.loc.asString() << ": " << myAst.tagName();
01408   ::std::cerr << " has wrong number of children. ";
01409   ::std::cerr << "Expected " << exp_ch << ", ";
01410   ::std::cerr << "Obtained " << act_ch << "." << ::std::endl;
01411 }
01412 
01413 static const unsigned char *astMembers[] = {
01414   (unsigned char *)"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_Null
01415   (unsigned char *)"\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_AnyGroup
01416   (unsigned char *)"\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_ident
01417   (unsigned char *)"\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_ifident
01418   (unsigned char *)"\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_usesel
01419   (unsigned char *)"\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_boolLiteral
01420   (unsigned char *)"\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_charLiteral
01421   (unsigned char *)"\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_intLiteral
01422   (unsigned char *)"\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_floatLiteral
01423   (unsigned char *)"\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_stringLiteral
01424   (unsigned char *)"\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_module
01425   (unsigned char *)"\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_interface
01426   (unsigned char *)"\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_defunion
01427   (unsigned char *)"\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_declunion
01428   (unsigned char *)"\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_defstruct
01429   (unsigned char *)"\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_declstruct
01430   (unsigned char *)"\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_defobject
01431   (unsigned char *)"\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_defrepr
01432   (unsigned char *)"\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_declrepr
01433   (unsigned char *)"\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_reprctrs
01434   (unsigned char *)"\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_reprctr
01435   (unsigned char *)"\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_reprrepr
01436   (unsigned char *)"\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_boxedCat
01437   (unsigned char *)"\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_unboxedCat
01438   (unsigned char *)"\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_opaqueCat
01439   (unsigned char *)"\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_oc_closed
01440   (unsigned char *)"\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_oc_open
01441   (unsigned char *)"\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_defexception
01442   (unsigned char *)"\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_deftypeclass
01443   (unsigned char *)"\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_tcdecls
01444   (unsigned char *)"\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_tyfn
01445   (unsigned char *)"\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_tcapp
01446   (unsigned char *)"\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_method_decls
01447   (unsigned char *)"\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_method_decl
01448   (unsigned char *)"\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_qualType
01449   (unsigned char *)"\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_constraints
01450   (unsigned char *)"\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_definstance
01451   (unsigned char *)"\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_tcmethods
01452   (unsigned char *)"\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_tcmethod_binding
01453   (unsigned char *)"\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_proclaim
01454   (unsigned char *)"\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_define
01455   (unsigned char *)"\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_recdef
01456   (unsigned char *)"\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_importAs
01457   (unsigned char *)"\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_provide
01458   (unsigned char *)"\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_import
01459   (unsigned char *)"\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_ifsel
01460   (unsigned char *)"\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_declares
01461   (unsigned char *)"\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_declare
01462   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_tvlist
01463   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_constructors
01464   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_constructor
01465   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_fields
01466   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_field
01467   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_fill
01468   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_methdecl
01469   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_bitfieldType
01470   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_byRefType
01471   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_arrayRefType
01472   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_boxedType
01473   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_unboxedType
01474   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_fn
01475   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_methType
01476   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_primaryType
01477   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_fnargVec
01478   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_arrayType
01479   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_vectorType
01480   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_mutableType
01481   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_constType
01482   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_typeapp
01483   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_exceptionType
01484   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_fieldType
01485   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_dummyType
01486   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_identPattern
01487   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_typeAnnotation
01488   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_mixfix
01489   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_unit
01490   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_suspend
01491   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_sizeof
01492   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_bitsizeof
01493   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_MakeVector
01494   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_vector
01495   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_array
01496   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_begin
01497   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_select
01498   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_fqCtr
01499   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_sel_ctr
01500   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_array_nth
01501   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00", // at_array_ref_nth
01502   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00", // at_vector_nth
01503   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00", // at_nth
01504   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00", // at_lambda
01505   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00", // at_argVec
01506   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00", // at_apply
01507   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00", // at_struct_apply
01508   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00", // at_object_apply
01509   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00", // at_ucon_apply
01510   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00", // at_if
01511   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00", // at_when
01512   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00", // at_unless
01513   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00", // at_and
01514   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00", // at_or
01515   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00", // at_cond
01516   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00", // at_cond_legs
01517   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00", // at_cond_leg
01518   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00", // at_condelse
01519   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00", // at_setbang
01520   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00", // at_deref
01521   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00", // at_dup
01522   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00", // at_inner_ref
01523   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00", // at_allocREF
01524   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00", // at_copyREF
01525   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00", // at_mkClosure
01526   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00", // at_setClosure
01527   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00", // at_mkArrayRef
01528   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00", // at_labeledBlock
01529   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00", // at_return_from
01530   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00", // at_uswitch
01531   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00", // at_usw_legs
01532   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00", // at_usw_leg
01533   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00", // at_otherwise
01534   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00", // at_try
01535   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00", // at_throw
01536   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", // at_let
01537   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", // at_letbindings
01538   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00", // at_letbinding
01539   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00", // at_letrec
01540   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00", // at_loop
01541   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00", // at_loopbindings
01542   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00", // at_loopbinding
01543   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00", // at_looptest
01544   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00", // at_localFrame
01545   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00", // at_frameBindings
01546   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00", // at_letStar
01547   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00", // at_identList
01548   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00", // at_container
01549   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00", // at_docString
01550   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00", // at_letGather
01551   (unsigned char *)"\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00", // agt_var
01552   (unsigned char *)"\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", // agt_uselhs
01553   (unsigned char *)"\xe0\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", // agt_literal
01554   (unsigned char *)"\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", // agt_tvar
01555   (unsigned char *)"\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", // agt_CompilationUnit
01556   (unsigned char *)"\x00\xf0\x07\x18\x90\x9f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x07\x00", // agt_definition
01557   (unsigned char *)"\x00\xf0\x07\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00", // agt_type_definition
01558   (unsigned char *)"\x00\x00\x00\x10\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00", // agt_tc_definition
01559   (unsigned char *)"\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00", // agt_value_definition
01560   (unsigned char *)"\x00\x00\x00\x00\x80\x9c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00", // agt_if_definition
01561   (unsigned char *)"\x00\x00\xc0\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00", // agt_category
01562   (unsigned char *)"\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", // agt_openclosed
01563   (unsigned char *)"\x00\x00\x00\x00\x00\x00\x70\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", // agt_fielditem
01564   (unsigned char *)"\x14\x00\x00\x00\x04\x00\x80\x7f\xff\x00\x00\x00\x00\x00\x00\x00\x00\x12\xc0\x00", // agt_qtype
01565   (unsigned char *)"\x14\x00\x00\x00\x00\x00\x80\x7f\xff\x00\x00\x00\x00\x00\x00\x00\x00\x12\x80\x00", // agt_type
01566   (unsigned char *)"\xf4\x03\x00\x00\x00\x00\x00\x00\x00\xfe\xff\xf7\x3f\xfe\x1f\x67\x50\x0a\x00\x09", // agt_expr
01567   (unsigned char *)"\xf4\x03\x00\x00\x00\x03\x00\x00\x00\xfe\xff\xf7\x3f\xfe\x1f\x67\x50\x0a\x00\x0b", // agt_expr_or_define
01568   (unsigned char *)"\xf4\x03\x00\x00\x00\x00\x80\x7f\xff\xfe\xff\xf7\x3f\xfe\x1f\x67\x50\x1a\x80\x0d", // agt__AnonGroup0
01569   (unsigned char *)"\xf4\x03\x00\x00\x00\x00\x00\x00\x00\xf8\xff\xf7\x3f\xfe\x1f\x67\x50\x0a\x00\x08", // agt_eform
01570   (unsigned char *)"\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x02\x00\x10", // agt_ucon
01571   (unsigned char *)"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x20"  // agt_ow
01572 };
01573 
01574 bool
01575 AST::isMemberOfType(AstType ty) const
01576 {
01577   return ISSET(astMembers[ty], astType) ? true : false;}
01578 
01579 bool
01580 AST::isValid() const
01581 {
01582   size_t c;
01583   size_t specNdx;
01584   bool errorsPresent = false;
01585 
01586   for (c = 0; c < children.size(); c++) {
01587     if (!child(c)->isValid())
01588       errorsPresent = true;
01589   }
01590 
01591   c = 0;
01592   specNdx = 0;
01593 
01594   switch(astType) {
01595   case at_Null: // leaf AST:
01596     if(children.size() != 0) {
01597       astChNumError(*this, 0, children.size());
01598       errorsPresent = true;
01599     }
01600     break;
01601 
01602   case at_AnyGroup: // leaf AST:
01603     if(children.size() != 0) {
01604       astChNumError(*this, 0, children.size());
01605       errorsPresent = true;
01606     }
01607     break;
01608 
01609   case at_ident: // leaf AST:
01610     if(children.size() != 0) {
01611       astChNumError(*this, 0, children.size());
01612       errorsPresent = true;
01613     }
01614     break;
01615 
01616   case at_ifident: // leaf AST:
01617     if(children.size() != 0) {
01618       astChNumError(*this, 0, children.size());
01619       errorsPresent = true;
01620     }
01621     break;
01622 
01623   case at_usesel: // normal AST:
01624     // match agt_uselhs
01625     if(c >= children.size()) {
01626       astChNumError(*this, c+1, children.size());
01627       errorsPresent = true;
01628       break;
01629     }
01630     if (!ISSET(astMembers[agt_uselhs], child(c)->astType)) {
01631       astChTypeError(*this, agt_uselhs, child(c)->astType, c);
01632       errorsPresent = true;
01633     }
01634     c++;
01635 
01636     // match at_ident
01637     if(c >= children.size()) {
01638       astChNumError(*this, c+1, children.size());
01639       errorsPresent = true;
01640       break;
01641     }
01642     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
01643       astChTypeError(*this, at_ident, child(c)->astType, c);
01644       errorsPresent = true;
01645     }
01646     c++;
01647 
01648     if(c != children.size()) {
01649       astChNumError(*this, c, children.size());
01650       errorsPresent = true;
01651     }
01652     break;
01653 
01654   case at_boolLiteral: // leaf AST:
01655     if(children.size() != 0) {
01656       astChNumError(*this, 0, children.size());
01657       errorsPresent = true;
01658     }
01659     break;
01660 
01661   case at_charLiteral: // leaf AST:
01662     if(children.size() != 0) {
01663       astChNumError(*this, 0, children.size());
01664       errorsPresent = true;
01665     }
01666     break;
01667 
01668   case at_intLiteral: // leaf AST:
01669     if(children.size() != 0) {
01670       astChNumError(*this, 0, children.size());
01671       errorsPresent = true;
01672     }
01673     break;
01674 
01675   case at_floatLiteral: // leaf AST:
01676     if(children.size() != 0) {
01677       astChNumError(*this, 0, children.size());
01678       errorsPresent = true;
01679     }
01680     break;
01681 
01682   case at_stringLiteral: // leaf AST:
01683     if(children.size() != 0) {
01684       astChNumError(*this, 0, children.size());
01685       errorsPresent = true;
01686     }
01687     break;
01688 
01689   case at_module: // normal AST:
01690     // match agt_definition*
01691     while (c < children.size()) {
01692       if (!ISSET(astMembers[agt_definition], child(c)->astType))
01693         astChTypeError(*this, agt_definition, child(c)->astType, c);
01694       c++;
01695     }
01696 
01697     if(c != children.size()) {
01698       astChNumError(*this, c, children.size());
01699       errorsPresent = true;
01700     }
01701     break;
01702 
01703   case at_interface: // normal AST:
01704     // match at_ident
01705     if(c >= children.size()) {
01706       astChNumError(*this, c+1, children.size());
01707       errorsPresent = true;
01708       break;
01709     }
01710     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
01711       astChTypeError(*this, at_ident, child(c)->astType, c);
01712       errorsPresent = true;
01713     }
01714     c++;
01715 
01716     // match agt_definition*
01717     while (c < children.size()) {
01718       if (!ISSET(astMembers[agt_definition], child(c)->astType))
01719         astChTypeError(*this, agt_definition, child(c)->astType, c);
01720       c++;
01721     }
01722 
01723     if(c != children.size()) {
01724       astChNumError(*this, c, children.size());
01725       errorsPresent = true;
01726     }
01727     break;
01728 
01729   case at_defunion: // normal AST:
01730     // match at_ident
01731     if(c >= children.size()) {
01732       astChNumError(*this, c+1, children.size());
01733       errorsPresent = true;
01734       break;
01735     }
01736     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
01737       astChTypeError(*this, at_ident, child(c)->astType, c);
01738       errorsPresent = true;
01739     }
01740     c++;
01741 
01742     // match at_tvlist
01743     if(c >= children.size()) {
01744       astChNumError(*this, c+1, children.size());
01745       errorsPresent = true;
01746       break;
01747     }
01748     if (!ISSET(astMembers[at_tvlist], child(c)->astType)) {
01749       astChTypeError(*this, at_tvlist, child(c)->astType, c);
01750       errorsPresent = true;
01751     }
01752     c++;
01753 
01754     // match agt_category
01755     if(c >= children.size()) {
01756       astChNumError(*this, c+1, children.size());
01757       errorsPresent = true;
01758       break;
01759     }
01760     if (!ISSET(astMembers[agt_category], child(c)->astType)) {
01761       astChTypeError(*this, agt_category, child(c)->astType, c);
01762       errorsPresent = true;
01763     }
01764     c++;
01765 
01766     // match at_declares
01767     if(c >= children.size()) {
01768       astChNumError(*this, c+1, children.size());
01769       errorsPresent = true;
01770       break;
01771     }
01772     if (!ISSET(astMembers[at_declares], child(c)->astType)) {
01773       astChTypeError(*this, at_declares, child(c)->astType, c);
01774       errorsPresent = true;
01775     }
01776     c++;
01777 
01778     // match at_constructors
01779     if(c >= children.size()) {
01780       astChNumError(*this, c+1, children.size());
01781       errorsPresent = true;
01782       break;
01783     }
01784     if (!ISSET(astMembers[at_constructors], child(c)->astType)) {
01785       astChTypeError(*this, at_constructors, child(c)->astType, c);
01786       errorsPresent = true;
01787     }
01788     c++;
01789 
01790     // match at_constraints
01791     if(c >= children.size()) {
01792       astChNumError(*this, c+1, children.size());
01793       errorsPresent = true;
01794       break;
01795     }
01796     if (!ISSET(astMembers[at_constraints], child(c)->astType)) {
01797       astChTypeError(*this, at_constraints, child(c)->astType, c);
01798       errorsPresent = true;
01799     }
01800     c++;
01801 
01802     if(c != children.size()) {
01803       astChNumError(*this, c, children.size());
01804       errorsPresent = true;
01805     }
01806     break;
01807 
01808   case at_declunion: // normal AST:
01809     // match at_ident
01810     if(c >= children.size()) {
01811       astChNumError(*this, c+1, children.size());
01812       errorsPresent = true;
01813       break;
01814     }
01815     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
01816       astChTypeError(*this, at_ident, child(c)->astType, c);
01817       errorsPresent = true;
01818     }
01819     c++;
01820 
01821     // match at_tvlist
01822     if(c >= children.size()) {
01823       astChNumError(*this, c+1, children.size());
01824       errorsPresent = true;
01825       break;
01826     }
01827     if (!ISSET(astMembers[at_tvlist], child(c)->astType)) {
01828       astChTypeError(*this, at_tvlist, child(c)->astType, c);
01829       errorsPresent = true;
01830     }
01831     c++;
01832 
01833     // match agt_category
01834     if(c >= children.size()) {
01835       astChNumError(*this, c+1, children.size());
01836       errorsPresent = true;
01837       break;
01838     }
01839     if (!ISSET(astMembers[agt_category], child(c)->astType)) {
01840       astChTypeError(*this, agt_category, child(c)->astType, c);
01841       errorsPresent = true;
01842     }
01843     c++;
01844 
01845     // match at_declares
01846     if(c >= children.size()) {
01847       astChNumError(*this, c+1, children.size());
01848       errorsPresent = true;
01849       break;
01850     }
01851     if (!ISSET(astMembers[at_declares], child(c)->astType)) {
01852       astChTypeError(*this, at_declares, child(c)->astType, c);
01853       errorsPresent = true;
01854     }
01855     c++;
01856 
01857     // match at_constructors
01858     if(c >= children.size()) {
01859       astChNumError(*this, c+1, children.size());
01860       errorsPresent = true;
01861       break;
01862     }
01863     if (!ISSET(astMembers[at_constructors], child(c)->astType)) {
01864       astChTypeError(*this, at_constructors, child(c)->astType, c);
01865       errorsPresent = true;
01866     }
01867     c++;
01868 
01869     // match at_constraints
01870     if(c >= children.size()) {
01871       astChNumError(*this, c+1, children.size());
01872       errorsPresent = true;
01873       break;
01874     }
01875     if (!ISSET(astMembers[at_constraints], child(c)->astType)) {
01876       astChTypeError(*this, at_constraints, child(c)->astType, c);
01877       errorsPresent = true;
01878     }
01879     c++;
01880 
01881     if(c != children.size()) {
01882       astChNumError(*this, c, children.size());
01883       errorsPresent = true;
01884     }
01885     break;
01886 
01887   case at_defstruct: // normal AST:
01888     // match at_ident
01889     if(c >= children.size()) {
01890       astChNumError(*this, c+1, children.size());
01891       errorsPresent = true;
01892       break;
01893     }
01894     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
01895       astChTypeError(*this, at_ident, child(c)->astType, c);
01896       errorsPresent = true;
01897     }
01898     c++;
01899 
01900     // match at_tvlist
01901     if(c >= children.size()) {
01902       astChNumError(*this, c+1, children.size());
01903       errorsPresent = true;
01904       break;
01905     }
01906     if (!ISSET(astMembers[at_tvlist], child(c)->astType)) {
01907       astChTypeError(*this, at_tvlist, child(c)->astType, c);
01908       errorsPresent = true;
01909     }
01910     c++;
01911 
01912     // match agt_category
01913     if(c >= children.size()) {
01914       astChNumError(*this, c+1, children.size());
01915       errorsPresent = true;
01916       break;
01917     }
01918     if (!ISSET(astMembers[agt_category], child(c)->astType)) {
01919       astChTypeError(*this, agt_category, child(c)->astType, c);
01920       errorsPresent = true;
01921     }
01922     c++;
01923 
01924     // match at_declares
01925     if(c >= children.size()) {
01926       astChNumError(*this, c+1, children.size());
01927       errorsPresent = true;
01928       break;
01929     }
01930     if (!ISSET(astMembers[at_declares], child(c)->astType)) {
01931       astChTypeError(*this, at_declares, child(c)->astType, c);
01932       errorsPresent = true;
01933     }
01934     c++;
01935 
01936     // match at_fields
01937     if(c >= children.size()) {
01938       astChNumError(*this, c+1, children.size());
01939       errorsPresent = true;
01940       break;
01941     }
01942     if (!ISSET(astMembers[at_fields], child(c)->astType)) {
01943       astChTypeError(*this, at_fields, child(c)->astType, c);
01944       errorsPresent = true;
01945     }
01946     c++;
01947 
01948     // match at_constraints
01949     if(c >= children.size()) {
01950       astChNumError(*this, c+1, children.size());
01951       errorsPresent = true;
01952       break;
01953     }
01954     if (!ISSET(astMembers[at_constraints], child(c)->astType)) {
01955       astChTypeError(*this, at_constraints, child(c)->astType, c);
01956       errorsPresent = true;
01957     }
01958     c++;
01959 
01960     if(c != children.size()) {
01961       astChNumError(*this, c, children.size());
01962       errorsPresent = true;
01963     }
01964     break;
01965 
01966   case at_declstruct: // normal AST:
01967     // match at_ident
01968     if(c >= children.size()) {
01969       astChNumError(*this, c+1, children.size());
01970       errorsPresent = true;
01971       break;
01972     }
01973     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
01974       astChTypeError(*this, at_ident, child(c)->astType, c);
01975       errorsPresent = true;
01976     }
01977     c++;
01978 
01979     // match at_tvlist
01980     if(c >= children.size()) {
01981       astChNumError(*this, c+1, children.size());
01982       errorsPresent = true;
01983       break;
01984     }
01985     if (!ISSET(astMembers[at_tvlist], child(c)->astType)) {
01986       astChTypeError(*this, at_tvlist, child(c)->astType, c);
01987       errorsPresent = true;
01988     }
01989     c++;
01990 
01991     // match agt_category
01992     if(c >= children.size()) {
01993       astChNumError(*this, c+1, children.size());
01994       errorsPresent = true;
01995       break;
01996     }
01997     if (!ISSET(astMembers[agt_category], child(c)->astType)) {
01998       astChTypeError(*this, agt_category, child(c)->astType, c);
01999       errorsPresent = true;
02000     }
02001     c++;
02002 
02003     // match at_declares
02004     if(c >= children.size()) {
02005       astChNumError(*this, c+1, children.size());
02006       errorsPresent = true;
02007       break;
02008     }
02009     if (!ISSET(astMembers[at_declares], child(c)->astType)) {
02010       astChTypeError(*this, at_declares, child(c)->astType, c);
02011       errorsPresent = true;
02012     }
02013     c++;
02014 
02015     // match at_fields
02016     if(c >= children.size()) {
02017       astChNumError(*this, c+1, children.size());
02018       errorsPresent = true;
02019       break;
02020     }
02021     if (!ISSET(astMembers[at_fields], child(c)->astType)) {
02022       astChTypeError(*this, at_fields, child(c)->astType, c);
02023       errorsPresent = true;
02024     }
02025     c++;
02026 
02027     // match at_constraints
02028     if(c >= children.size()) {
02029       astChNumError(*this, c+1, children.size());
02030       errorsPresent = true;
02031       break;
02032     }
02033     if (!ISSET(astMembers[at_constraints], child(c)->astType)) {
02034       astChTypeError(*this, at_constraints, child(c)->astType, c);
02035       errorsPresent = true;
02036     }
02037     c++;
02038 
02039     if(c != children.size()) {
02040       astChNumError(*this, c, children.size());
02041       errorsPresent = true;
02042     }
02043     break;
02044 
02045   case at_defobject: // normal AST:
02046     // match at_ident
02047     if(c >= children.size()) {
02048       astChNumError(*this, c+1, children.size());
02049       errorsPresent = true;
02050       break;
02051     }
02052     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
02053       astChTypeError(*this, at_ident, child(c)->astType, c);
02054       errorsPresent = true;
02055     }
02056     c++;
02057 
02058     // match at_tvlist
02059     if(c >= children.size()) {
02060       astChNumError(*this, c+1, children.size());
02061       errorsPresent = true;
02062       break;
02063     }
02064     if (!ISSET(astMembers[at_tvlist], child(c)->astType)) {
02065       astChTypeError(*this, at_tvlist, child(c)->astType, c);
02066       errorsPresent = true;
02067     }
02068     c++;
02069 
02070     // match agt_category
02071     if(c >= children.size()) {
02072       astChNumError(*this, c+1, children.size());
02073       errorsPresent = true;
02074       break;
02075     }
02076     if (!ISSET(astMembers[agt_category], child(c)->astType)) {
02077       astChTypeError(*this, agt_category, child(c)->astType, c);
02078       errorsPresent = true;
02079     }
02080     c++;
02081 
02082     // match at_declares
02083     if(c >= children.size()) {
02084       astChNumError(*this, c+1, children.size());
02085       errorsPresent = true;
02086       break;
02087     }
02088     if (!ISSET(astMembers[at_declares], child(c)->astType)) {
02089       astChTypeError(*this, at_declares, child(c)->astType, c);
02090       errorsPresent = true;
02091     }
02092     c++;
02093 
02094     // match at_fields
02095     if(c >= children.size()) {
02096       astChNumError(*this, c+1, children.size());
02097       errorsPresent = true;
02098       break;
02099     }
02100     if (!ISSET(astMembers[at_fields], child(c)->astType)) {
02101       astChTypeError(*this, at_fields, child(c)->astType, c);
02102       errorsPresent = true;
02103     }
02104     c++;
02105 
02106     // match at_constraints
02107     if(c >= children.size()) {
02108       astChNumError(*this, c+1, children.size());
02109       errorsPresent = true;
02110       break;
02111     }
02112     if (!ISSET(astMembers[at_constraints], child(c)->astType)) {
02113       astChTypeError(*this, at_constraints, child(c)->astType, c);
02114       errorsPresent = true;
02115     }
02116     c++;
02117 
02118     if(c != children.size()) {
02119       astChNumError(*this, c, children.size());
02120       errorsPresent = true;
02121     }
02122     break;
02123 
02124   case at_defrepr: // normal AST:
02125     // match at_ident
02126     if(c >= children.size()) {
02127       astChNumError(*this, c+1, children.size());
02128       errorsPresent = true;
02129       break;
02130     }
02131     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
02132       astChTypeError(*this, at_ident, child(c)->astType, c);
02133       errorsPresent = true;
02134     }
02135     c++;
02136 
02137     // match at_tvlist
02138     if(c >= children.size()) {
02139       astChNumError(*this, c+1, children.size());
02140       errorsPresent = true;
02141       break;
02142     }
02143     if (!ISSET(astMembers[at_tvlist], child(c)->astType)) {
02144       astChTypeError(*this, at_tvlist, child(c)->astType, c);
02145       errorsPresent = true;
02146     }
02147     c++;
02148 
02149     // match agt_category
02150     if(c >= children.size()) {
02151       astChNumError(*this, c+1, children.size());
02152       errorsPresent = true;
02153       break;
02154     }
02155     if (!ISSET(astMembers[agt_category], child(c)->astType)) {
02156       astChTypeError(*this, agt_category, child(c)->astType, c);
02157       errorsPresent = true;
02158     }
02159     c++;
02160 
02161     // match at_declares
02162     if(c >= children.size()) {
02163       astChNumError(*this, c+1, children.size());
02164       errorsPresent = true;
02165       break;
02166     }
02167     if (!ISSET(astMembers[at_declares], child(c)->astType)) {
02168       astChTypeError(*this, at_declares, child(c)->astType, c);
02169       errorsPresent = true;
02170     }
02171     c++;
02172 
02173     // match at_reprctrs
02174     if(c >= children.size()) {
02175       astChNumError(*this, c+1, children.size());
02176       errorsPresent = true;
02177       break;
02178     }
02179     if (!ISSET(astMembers[at_reprctrs], child(c)->astType)) {
02180       astChTypeError(*this, at_reprctrs, child(c)->astType, c);
02181       errorsPresent = true;
02182     }
02183     c++;
02184 
02185     // match at_constraints
02186     if(c >= children.size()) {
02187       astChNumError(*this, c+1, children.size());
02188       errorsPresent = true;
02189       break;
02190     }
02191     if (!ISSET(astMembers[at_constraints], child(c)->astType)) {
02192       astChTypeError(*this, at_constraints, child(c)->astType, c);
02193       errorsPresent = true;
02194     }
02195     c++;
02196 
02197     if(c != children.size()) {
02198       astChNumError(*this, c, children.size());
02199       errorsPresent = true;
02200     }
02201     break;
02202 
02203   case at_declrepr: // normal AST:
02204     // match at_ident
02205     if(c >= children.size()) {
02206       astChNumError(*this, c+1, children.size());
02207       errorsPresent = true;
02208       break;
02209     }
02210     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
02211       astChTypeError(*this, at_ident, child(c)->astType, c);
02212       errorsPresent = true;
02213     }
02214     c++;
02215 
02216     // match at_tvlist
02217     if(c >= children.size()) {
02218       astChNumError(*this, c+1, children.size());
02219       errorsPresent = true;
02220       break;
02221     }
02222     if (!ISSET(astMembers[at_tvlist], child(c)->astType)) {
02223       astChTypeError(*this, at_tvlist, child(c)->astType, c);
02224       errorsPresent = true;
02225     }
02226     c++;
02227 
02228     // match agt_category
02229     if(c >= children.size()) {
02230       astChNumError(*this, c+1, children.size());
02231       errorsPresent = true;
02232       break;
02233     }
02234     if (!ISSET(astMembers[agt_category], child(c)->astType)) {
02235       astChTypeError(*this, agt_category, child(c)->astType, c);
02236       errorsPresent = true;
02237     }
02238     c++;
02239 
02240     // match at_declares
02241     if(c >= children.size()) {
02242       astChNumError(*this, c+1, children.size());
02243       errorsPresent = true;
02244       break;
02245     }
02246     if (!ISSET(astMembers[at_declares], child(c)->astType)) {
02247       astChTypeError(*this, at_declares, child(c)->astType, c);
02248       errorsPresent = true;
02249     }
02250     c++;
02251 
02252     // match at_reprctrs
02253     if(c >= children.size()) {
02254       astChNumError(*this, c+1, children.size());
02255       errorsPresent = true;
02256       break;
02257     }
02258     if (!ISSET(astMembers[at_reprctrs], child(c)->astType)) {
02259       astChTypeError(*this, at_reprctrs, child(c)->astType, c);
02260       errorsPresent = true;
02261     }
02262     c++;
02263 
02264     // match at_constraints
02265     if(c >= children.size()) {
02266       astChNumError(*this, c+1, children.size());
02267       errorsPresent = true;
02268       break;
02269     }
02270     if (!ISSET(astMembers[at_constraints], child(c)->astType)) {
02271       astChTypeError(*this, at_constraints, child(c)->astType, c);
02272       errorsPresent = true;
02273     }
02274     c++;
02275 
02276     if(c != children.size()) {
02277       astChNumError(*this, c, children.size());
02278       errorsPresent = true;
02279     }
02280     break;
02281 
02282   case at_reprctrs: // normal AST:
02283     // match at_reprctr+
02284     if(c >= children.size()) {
02285       astChNumError(*this, c+1, children.size());
02286       errorsPresent = true;
02287       break;
02288     }
02289     if (!ISSET(astMembers[at_reprctr], child(c)->astType)) {
02290       astChTypeError(*this, at_reprctr, child(c)->astType, 0);
02291       errorsPresent = true;
02292     }
02293     while (c < children.size()) {
02294       if (!ISSET(astMembers[at_reprctr], child(c)->astType))
02295         astChTypeError(*this, at_reprctr, child(c)->astType, c);
02296       c++;
02297     }
02298 
02299     if(c != children.size()) {
02300       astChNumError(*this, c, children.size());
02301       errorsPresent = true;
02302     }
02303     break;
02304 
02305   case at_reprctr: // normal AST:
02306     // match at_constructor
02307     if(c >= children.size()) {
02308       astChNumError(*this, c+1, children.size());
02309       errorsPresent = true;
02310       break;
02311     }
02312     if (!ISSET(astMembers[at_constructor], child(c)->astType)) {
02313       astChTypeError(*this, at_constructor, child(c)->astType, c);
02314       errorsPresent = true;
02315     }
02316     c++;
02317 
02318     // match at_reprrepr+
02319     if(c >= children.size()) {
02320       astChNumError(*this, c+1, children.size());
02321       errorsPresent = true;
02322       break;
02323     }
02324     if (!ISSET(astMembers[at_reprrepr], child(c)->astType)) {
02325       astChTypeError(*this, at_reprrepr, child(c)->astType, 1);
02326       errorsPresent = true;
02327     }
02328     while (c < children.size()) {
02329       if (!ISSET(astMembers[at_reprrepr], child(c)->astType))
02330         astChTypeError(*this, at_reprrepr, child(c)->astType, c);
02331       c++;
02332     }
02333 
02334     if(c != children.size()) {
02335       astChNumError(*this, c, children.size());
02336       errorsPresent = true;
02337     }
02338     break;
02339 
02340   case at_reprrepr: // normal AST:
02341     // match at_ident
02342     if(c >= children.size()) {
02343       astChNumError(*this, c+1, children.size());
02344       errorsPresent = true;
02345       break;
02346     }
02347     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
02348       astChTypeError(*this, at_ident, child(c)->astType, c);
02349       errorsPresent = true;
02350     }
02351     c++;
02352 
02353     // match at_intLiteral
02354     if(c >= children.size()) {
02355       astChNumError(*this, c+1, children.size());
02356       errorsPresent = true;
02357       break;
02358     }
02359     if (!ISSET(astMembers[at_intLiteral], child(c)->astType)) {
02360       astChTypeError(*this, at_intLiteral, child(c)->astType, c);
02361       errorsPresent = true;
02362     }
02363     c++;
02364 
02365     if(c != children.size()) {
02366       astChNumError(*this, c, children.size());
02367       errorsPresent = true;
02368     }
02369     break;
02370 
02371   case at_boxedCat: // leaf AST:
02372     if(children.size() != 0) {
02373       astChNumError(*this, 0, children.size());
02374       errorsPresent = true;
02375     }
02376     break;
02377 
02378   case at_unboxedCat: // leaf AST:
02379     if(children.size() != 0) {
02380       astChNumError(*this, 0, children.size());
02381       errorsPresent = true;
02382     }
02383     break;
02384 
02385   case at_opaqueCat: // leaf AST:
02386     if(children.size() != 0) {
02387       astChNumError(*this, 0, children.size());
02388       errorsPresent = true;
02389     }
02390     break;
02391 
02392   case at_oc_closed: // leaf AST:
02393     if(children.size() != 0) {
02394       astChNumError(*this, 0, children.size());
02395       errorsPresent = true;
02396     }
02397     break;
02398 
02399   case at_oc_open: // leaf AST:
02400     if(children.size() != 0) {
02401       astChNumError(*this, 0, children.size());
02402       errorsPresent = true;
02403     }
02404     break;
02405 
02406   case at_defexception: // normal AST:
02407     // match at_ident
02408     if(c >= children.size()) {
02409       astChNumError(*this, c+1, children.size());
02410       errorsPresent = true;
02411       break;
02412     }
02413     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
02414       astChTypeError(*this, at_ident, child(c)->astType, c);
02415       errorsPresent = true;
02416     }
02417     c++;
02418 
02419     // match at_tvlist
02420     if(c >= children.size()) {
02421       astChNumError(*this, c+1, children.size());
02422       errorsPresent = true;
02423       break;
02424     }
02425     if (!ISSET(astMembers[at_tvlist], child(c)->astType)) {
02426       astChTypeError(*this, at_tvlist, child(c)->astType, c);
02427       errorsPresent = true;
02428     }
02429     c++;
02430 
02431     // match agt_category
02432     if(c >= children.size()) {
02433       astChNumError(*this, c+1, children.size());
02434       errorsPresent = true;
02435       break;
02436     }
02437     if (!ISSET(astMembers[agt_category], child(c)->astType)) {
02438       astChTypeError(*this, agt_category, child(c)->astType, c);
02439       errorsPresent = true;
02440     }
02441     c++;
02442 
02443     // match at_declares
02444     if(c >= children.size()) {
02445       astChNumError(*this, c+1, children.size());
02446       errorsPresent = true;
02447       break;
02448     }
02449     if (!ISSET(astMembers[at_declares], child(c)->astType)) {
02450       astChTypeError(*this, at_declares, child(c)->astType, c);
02451       errorsPresent = true;
02452     }
02453     c++;
02454 
02455     // match at_fields
02456     if(c >= children.size()) {
02457       astChNumError(*this, c+1, children.size());
02458       errorsPresent = true;
02459       break;
02460     }
02461     if (!ISSET(astMembers[at_fields], child(c)->astType)) {
02462       astChTypeError(*this, at_fields, child(c)->astType, c);
02463       errorsPresent = true;
02464     }
02465     c++;
02466 
02467     // match at_constraints
02468     if(c >= children.size()) {
02469       astChNumError(*this, c+1, children.size());
02470       errorsPresent = true;
02471       break;
02472     }
02473     if (!ISSET(astMembers[at_constraints], child(c)->astType)) {
02474       astChTypeError(*this, at_constraints, child(c)->astType, c);
02475       errorsPresent = true;
02476     }
02477     c++;
02478 
02479     if(c != children.size()) {
02480       astChNumError(*this, c, children.size());
02481       errorsPresent = true;
02482     }
02483     break;
02484 
02485   case at_deftypeclass: // normal AST:
02486     // match at_ident
02487     if(c >= children.size()) {
02488       astChNumError(*this, c+1, children.size());
02489       errorsPresent = true;
02490       break;
02491     }
02492     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
02493       astChTypeError(*this, at_ident, child(c)->astType, c);
02494       errorsPresent = true;
02495     }
02496     c++;
02497 
02498     // match at_tvlist
02499     if(c >= children.size()) {
02500       astChNumError(*this, c+1, children.size());
02501       errorsPresent = true;
02502       break;
02503     }
02504     if (!ISSET(astMembers[at_tvlist], child(c)->astType)) {
02505       astChTypeError(*this, at_tvlist, child(c)->astType, c);
02506       errorsPresent = true;
02507     }
02508     c++;
02509 
02510     // match at_tcdecls
02511     if(c >= children.size()) {
02512       astChNumError(*this, c+1, children.size());
02513       errorsPresent = true;
02514       break;
02515     }
02516     if (!ISSET(astMembers[at_tcdecls], child(c)->astType)) {
02517       astChTypeError(*this, at_tcdecls, child(c)->astType, c);
02518       errorsPresent = true;
02519     }
02520     c++;
02521 
02522     // match agt_openclosed
02523     if(c >= children.size()) {
02524       astChNumError(*this, c+1, children.size());
02525       errorsPresent = true;
02526       break;
02527     }
02528     if (!ISSET(astMembers[agt_openclosed], child(c)->astType)) {
02529       astChTypeError(*this, agt_openclosed, child(c)->astType, c);
02530       errorsPresent = true;
02531     }
02532     c++;
02533 
02534     // match at_method_decls
02535     if(c >= children.size()) {
02536       astChNumError(*this, c+1, children.size());
02537       errorsPresent = true;
02538       break;
02539     }
02540     if (!ISSET(astMembers[at_method_decls], child(c)->astType)) {
02541       astChTypeError(*this, at_method_decls, child(c)->astType, c);
02542       errorsPresent = true;
02543     }
02544     c++;
02545 
02546     // match at_constraints
02547     if(c >= children.size()) {
02548       astChNumError(*this, c+1, children.size());
02549       errorsPresent = true;
02550       break;
02551     }
02552     if (!ISSET(astMembers[at_constraints], child(c)->astType)) {
02553       astChTypeError(*this, at_constraints, child(c)->astType, c);
02554       errorsPresent = true;
02555     }
02556     c++;
02557 
02558     if(c != children.size()) {
02559       astChNumError(*this, c, children.size());
02560       errorsPresent = true;
02561     }
02562     break;
02563 
02564   case at_tcdecls: // normal AST:
02565     // match at_tyfn*
02566     while (c < children.size()) {
02567       if (!ISSET(astMembers[at_tyfn], child(c)->astType))
02568         astChTypeError(*this, at_tyfn, child(c)->astType, c);
02569       c++;
02570     }
02571 
02572     if(c != children.size()) {
02573       astChNumError(*this, c, children.size());
02574       errorsPresent = true;
02575     }
02576     break;
02577 
02578   case at_tyfn: // normal AST:
02579     // match at_fnargVec
02580     if(c >= children.size()) {
02581       astChNumError(*this, c+1, children.size());
02582       errorsPresent = true;
02583       break;
02584     }
02585     if (!ISSET(astMembers[at_fnargVec], child(c)->astType)) {
02586       astChTypeError(*this, at_fnargVec, child(c)->astType, c);
02587       errorsPresent = true;
02588     }
02589     c++;
02590 
02591     // match agt_tvar
02592     if(c >= children.size()) {
02593       astChNumError(*this, c+1, children.size());
02594       errorsPresent = true;
02595       break;
02596     }
02597     if (!ISSET(astMembers[agt_tvar], child(c)->astType)) {
02598       astChTypeError(*this, agt_tvar, child(c)->astType, c);
02599       errorsPresent = true;
02600     }
02601     c++;
02602 
02603     if(c != children.size()) {
02604       astChNumError(*this, c, children.size());
02605       errorsPresent = true;
02606     }
02607     break;
02608 
02609   case at_tcapp: // normal AST:
02610     // match agt_var
02611     if(c >= children.size()) {
02612       astChNumError(*this, c+1, children.size());
02613       errorsPresent = true;
02614       break;
02615     }
02616     if (!ISSET(astMembers[agt_var], child(c)->astType)) {
02617       astChTypeError(*this, agt_var, child(c)->astType, c);
02618       errorsPresent = true;
02619     }
02620     c++;
02621 
02622     // match agt_type+
02623     if(c >= children.size()) {
02624       astChNumError(*this, c+1, children.size());
02625       errorsPresent = true;
02626       break;
02627     }
02628     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
02629       astChTypeError(*this, agt_type, child(c)->astType, 1);
02630       errorsPresent = true;
02631     }
02632     while (c < children.size()) {
02633       if (!ISSET(astMembers[agt_type], child(c)->astType))
02634         astChTypeError(*this, agt_type, child(c)->astType, c);
02635       c++;
02636     }
02637 
02638     if(c != children.size()) {
02639       astChNumError(*this, c, children.size());
02640       errorsPresent = true;
02641     }
02642     break;
02643 
02644   case at_method_decls: // normal AST:
02645     // match at_method_decl*
02646     while (c < children.size()) {
02647       if (!ISSET(astMembers[at_method_decl], child(c)->astType))
02648         astChTypeError(*this, at_method_decl, child(c)->astType, c);
02649       c++;
02650     }
02651 
02652     if(c != children.size()) {
02653       astChNumError(*this, c, children.size());
02654       errorsPresent = true;
02655     }
02656     break;
02657 
02658   case at_method_decl: // normal AST:
02659     // match at_ident
02660     if(c >= children.size()) {
02661       astChNumError(*this, c+1, children.size());
02662       errorsPresent = true;
02663       break;
02664     }
02665     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
02666       astChTypeError(*this, at_ident, child(c)->astType, c);
02667       errorsPresent = true;
02668     }
02669     c++;
02670 
02671     // match at_fn
02672     if(c >= children.size()) {
02673       astChNumError(*this, c+1, children.size());
02674       errorsPresent = true;
02675       break;
02676     }
02677     if (!ISSET(astMembers[at_fn], child(c)->astType)) {
02678       astChTypeError(*this, at_fn, child(c)->astType, c);
02679       errorsPresent = true;
02680     }
02681     c++;
02682 
02683     if(c != children.size()) {
02684       astChNumError(*this, c, children.size());
02685       errorsPresent = true;
02686     }
02687     break;
02688 
02689   case at_qualType: // normal AST:
02690     // match at_constraints
02691     if(c >= children.size()) {
02692       astChNumError(*this, c+1, children.size());
02693       errorsPresent = true;
02694       break;
02695     }
02696     if (!ISSET(astMembers[at_constraints], child(c)->astType)) {
02697       astChTypeError(*this, at_constraints, child(c)->astType, c);
02698       errorsPresent = true;
02699     }
02700     c++;
02701 
02702     // match agt_type
02703     if(c >= children.size()) {
02704       astChNumError(*this, c+1, children.size());
02705       errorsPresent = true;
02706       break;
02707     }
02708     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
02709       astChTypeError(*this, agt_type, child(c)->astType, c);
02710       errorsPresent = true;
02711     }
02712     c++;
02713 
02714     if(c != children.size()) {
02715       astChNumError(*this, c, children.size());
02716       errorsPresent = true;
02717     }
02718     break;
02719 
02720   case at_constraints: // normal AST:
02721     // match at_tcapp*
02722     while (c < children.size()) {
02723       if (!ISSET(astMembers[at_tcapp], child(c)->astType))
02724         astChTypeError(*this, at_tcapp, child(c)->astType, c);
02725       c++;
02726     }
02727 
02728     if(c != children.size()) {
02729       astChNumError(*this, c, children.size());
02730       errorsPresent = true;
02731     }
02732     break;
02733 
02734   case at_definstance: // normal AST:
02735     // match at_tcapp
02736     if(c >= children.size()) {
02737       astChNumError(*this, c+1, children.size());
02738       errorsPresent = true;
02739       break;
02740     }
02741     if (!ISSET(astMembers[at_tcapp], child(c)->astType)) {
02742       astChTypeError(*this, at_tcapp, child(c)->astType, c);
02743       errorsPresent = true;
02744     }
02745     c++;
02746 
02747     // match at_tcmethods
02748     if(c >= children.size()) {
02749       astChNumError(*this, c+1, children.size());
02750       errorsPresent = true;
02751       break;
02752     }
02753     if (!ISSET(astMembers[at_tcmethods], child(c)->astType)) {
02754       astChTypeError(*this, at_tcmethods, child(c)->astType, c);
02755       errorsPresent = true;
02756     }
02757     c++;
02758 
02759     // match at_constraints
02760     if(c >= children.size()) {
02761       astChNumError(*this, c+1, children.size());
02762       errorsPresent = true;
02763       break;
02764     }
02765     if (!ISSET(astMembers[at_constraints], child(c)->astType)) {
02766       astChTypeError(*this, at_constraints, child(c)->astType, c);
02767       errorsPresent = true;
02768     }
02769     c++;
02770 
02771     if(c != children.size()) {
02772       astChNumError(*this, c, children.size());
02773       errorsPresent = true;
02774     }
02775     break;
02776 
02777   case at_tcmethods: // normal AST:
02778     // match at_tcmethod_binding*
02779     while (c < children.size()) {
02780       if (!ISSET(astMembers[at_tcmethod_binding], child(c)->astType))
02781         astChTypeError(*this, at_tcmethod_binding, child(c)->astType, c);
02782       c++;
02783     }
02784 
02785     if(c != children.size()) {
02786       astChNumError(*this, c, children.size());
02787       errorsPresent = true;
02788     }
02789     break;
02790 
02791   case at_tcmethod_binding: // normal AST:
02792     // match at_ident
02793     if(c >= children.size()) {
02794       astChNumError(*this, c+1, children.size());
02795       errorsPresent = true;
02796       break;
02797     }
02798     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
02799       astChTypeError(*this, at_ident, child(c)->astType, c);
02800       errorsPresent = true;
02801     }
02802     c++;
02803 
02804     // match agt_expr
02805     if(c >= children.size()) {
02806       astChNumError(*this, c+1, children.size());
02807       errorsPresent = true;
02808       break;
02809     }
02810     if (!ISSET(astMembers[agt_expr], child(c)->astType)) {
02811       astChTypeError(*this, agt_expr, child(c)->astType, c);
02812       errorsPresent = true;
02813     }
02814     c++;
02815 
02816     if(c != children.size()) {
02817       astChNumError(*this, c, children.size());
02818       errorsPresent = true;
02819     }
02820     break;
02821 
02822   case at_proclaim: // normal AST:
02823     // match agt_var
02824     if(c >= children.size()) {
02825       astChNumError(*this, c+1, children.size());
02826       errorsPresent = true;
02827       break;
02828     }
02829     if (!ISSET(astMembers[agt_var], child(c)->astType)) {
02830       astChTypeError(*this, agt_var, child(c)->astType, c);
02831       errorsPresent = true;
02832     }
02833     c++;
02834 
02835     // match agt_qtype
02836     if(c >= children.size()) {
02837       astChNumError(*this, c+1, children.size());
02838       errorsPresent = true;
02839       break;
02840     }
02841     if (!ISSET(astMembers[agt_qtype], child(c)->astType)) {
02842       astChTypeError(*this, agt_qtype, child(c)->astType, c);
02843       errorsPresent = true;
02844     }
02845     c++;
02846 
02847     // match at_constraints
02848     if(c >= children.size()) {
02849       astChNumError(*this, c+1, children.size());
02850       errorsPresent = true;
02851       break;
02852     }
02853     if (!ISSET(astMembers[at_constraints], child(c)->astType)) {
02854       astChTypeError(*this, at_constraints, child(c)->astType, c);
02855       errorsPresent = true;
02856     }
02857     c++;
02858 
02859     if(c != children.size()) {
02860       astChNumError(*this, c, children.size());
02861       errorsPresent = true;
02862     }
02863     break;
02864 
02865   case at_define: // normal AST:
02866     // match at_identPattern
02867     if(c >= children.size()) {
02868       astChNumError(*this, c+1, children.size());
02869       errorsPresent = true;
02870       break;
02871     }
02872     if (!ISSET(astMembers[at_identPattern], child(c)->astType)) {
02873       astChTypeError(*this, at_identPattern, child(c)->astType, c);
02874       errorsPresent = true;
02875     }
02876     c++;
02877 
02878     // match agt_expr
02879     if(c >= children.size()) {
02880       astChNumError(*this, c+1, children.size());
02881       errorsPresent = true;
02882       break;
02883     }
02884     if (!ISSET(astMembers[agt_expr], child(c)->astType)) {
02885       astChTypeError(*this, agt_expr, child(c)->astType, c);
02886       errorsPresent = true;
02887     }
02888     c++;
02889 
02890     // match at_constraints
02891     if(c >= children.size()) {
02892       astChNumError(*this, c+1, children.size());
02893       errorsPresent = true;
02894       break;
02895     }
02896     if (!ISSET(astMembers[at_constraints], child(c)->astType)) {
02897       astChTypeError(*this, at_constraints, child(c)->astType, c);
02898       errorsPresent = true;
02899     }
02900     c++;
02901 
02902     if(c != children.size()) {
02903       astChNumError(*this, c, children.size());
02904       errorsPresent = true;
02905     }
02906     break;
02907 
02908   case at_recdef: // normal AST:
02909     // match at_identPattern
02910     if(c >= children.size()) {
02911       astChNumError(*this, c+1, children.size());
02912       errorsPresent = true;
02913       break;
02914     }
02915     if (!ISSET(astMembers[at_identPattern], child(c)->astType)) {
02916       astChTypeError(*this, at_identPattern, child(c)->astType, c);
02917       errorsPresent = true;
02918     }
02919     c++;
02920 
02921     // match agt_expr
02922     if(c >= children.size()) {
02923       astChNumError(*this, c+1, children.size());
02924       errorsPresent = true;
02925       break;
02926     }
02927     if (!ISSET(astMembers[agt_expr], child(c)->astType)) {
02928       astChTypeError(*this, agt_expr, child(c)->astType, c);
02929       errorsPresent = true;
02930     }
02931     c++;
02932 
02933     // match at_constraints
02934     if(c >= children.size()) {
02935       astChNumError(*this, c+1, children.size());
02936       errorsPresent = true;
02937       break;
02938     }
02939     if (!ISSET(astMembers[at_constraints], child(c)->astType)) {
02940       astChTypeError(*this, at_constraints, child(c)->astType, c);
02941       errorsPresent = true;
02942     }
02943     c++;
02944 
02945     if(c != children.size()) {
02946       astChNumError(*this, c, children.size());
02947       errorsPresent = true;
02948     }
02949     break;
02950 
02951   case at_importAs: // normal AST:
02952     // match at_ifident
02953     if(c >= children.size()) {
02954       astChNumError(*this, c+1, children.size());
02955       errorsPresent = true;
02956       break;
02957     }
02958     if (!ISSET(astMembers[at_ifident], child(c)->astType)) {
02959       astChTypeError(*this, at_ifident, child(c)->astType, c);
02960       errorsPresent = true;
02961     }
02962     c++;
02963 
02964     // match at_ident
02965     if(c >= children.size()) {
02966       astChNumError(*this, c+1, children.size());
02967       errorsPresent = true;
02968       break;
02969     }
02970     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
02971       astChTypeError(*this, at_ident, child(c)->astType, c);
02972       errorsPresent = true;
02973     }
02974     c++;
02975 
02976     if(c != children.size()) {
02977       astChNumError(*this, c, children.size());
02978       errorsPresent = true;
02979     }
02980     break;
02981 
02982   case at_provide: // normal AST:
02983     // match at_ifident
02984     if(c >= children.size()) {
02985       astChNumError(*this, c+1, children.size());
02986       errorsPresent = true;
02987       break;
02988     }
02989     if (!ISSET(astMembers[at_ifident], child(c)->astType)) {
02990       astChTypeError(*this, at_ifident, child(c)->astType, c);
02991       errorsPresent = true;
02992     }
02993     c++;
02994 
02995     // match at_ident+
02996     if(c >= children.size()) {
02997       astChNumError(*this, c+1, children.size());
02998       errorsPresent = true;
02999       break;
03000     }
03001     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
03002       astChTypeError(*this, at_ident, child(c)->astType, 1);
03003       errorsPresent = true;
03004     }
03005     while (c < children.size()) {
03006       if (!ISSET(astMembers[at_ident], child(c)->astType))
03007         astChTypeError(*this, at_ident, child(c)->astType, c);
03008       c++;
03009     }
03010 
03011     if(c != children.size()) {
03012       astChNumError(*this, c, children.size());
03013       errorsPresent = true;
03014     }
03015     break;
03016 
03017   case at_import: // normal AST:
03018     // match at_ifident
03019     if(c >= children.size()) {
03020       astChNumError(*this, c+1, children.size());
03021       errorsPresent = true;
03022       break;
03023     }
03024     if (!ISSET(astMembers[at_ifident], child(c)->astType)) {
03025       astChTypeError(*this, at_ifident, child(c)->astType, c);
03026       errorsPresent = true;
03027     }
03028     c++;
03029 
03030     // match at_ifsel*
03031     while (c < children.size()) {
03032       if (!ISSET(astMembers[at_ifsel], child(c)->astType))
03033         astChTypeError(*this, at_ifsel, child(c)->astType, c);
03034       c++;
03035     }
03036 
03037     if(c != children.size()) {
03038       astChNumError(*this, c, children.size());
03039       errorsPresent = true;
03040     }
03041     break;
03042 
03043   case at_ifsel: // normal AST:
03044     // match at_ident
03045     if(c >= children.size()) {
03046       astChNumError(*this, c+1, children.size());
03047       errorsPresent = true;
03048       break;
03049     }
03050     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
03051       astChTypeError(*this, at_ident, child(c)->astType, c);
03052       errorsPresent = true;
03053     }
03054     c++;
03055 
03056     // match at_ident
03057     if(c >= children.size()) {
03058       astChNumError(*this, c+1, children.size());
03059       errorsPresent = true;
03060       break;
03061     }
03062     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
03063       astChTypeError(*this, at_ident, child(c)->astType, c);
03064       errorsPresent = true;
03065     }
03066     c++;
03067 
03068     if(c != children.size()) {
03069       astChNumError(*this, c, children.size());
03070       errorsPresent = true;
03071     }
03072     break;
03073 
03074   case at_declares: // normal AST:
03075     // match at_declare*
03076     while (c < children.size()) {
03077       if (!ISSET(astMembers[at_declare], child(c)->astType))
03078         astChTypeError(*this, at_declare, child(c)->astType, c);
03079       c++;
03080     }
03081 
03082     if(c != children.size()) {
03083       astChNumError(*this, c, children.size());
03084       errorsPresent = true;
03085     }
03086     break;
03087 
03088   case at_declare: // normal AST:
03089     // match at_ident
03090     if(c >= children.size()) {
03091       astChNumError(*this, c+1, children.size());
03092       errorsPresent = true;
03093       break;
03094     }
03095     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
03096       astChTypeError(*this, at_ident, child(c)->astType, c);
03097       errorsPresent = true;
03098     }
03099     c++;
03100 
03101     // match agt_type?
03102     if ((c < children.size()) && ISSET(astMembers[agt_type], child(c)->astType))
03103       c++;
03104 
03105     if(c != children.size()) {
03106       astChNumError(*this, c, children.size());
03107       errorsPresent = true;
03108     }
03109     break;
03110 
03111   case at_tvlist: // normal AST:
03112     // match agt_tvar*
03113     while (c < children.size()) {
03114       if (!ISSET(astMembers[agt_tvar], child(c)->astType))
03115         astChTypeError(*this, agt_tvar, child(c)->astType, c);
03116       c++;
03117     }
03118 
03119     if(c != children.size()) {
03120       astChNumError(*this, c, children.size());
03121       errorsPresent = true;
03122     }
03123     break;
03124 
03125   case at_constructors: // normal AST:
03126     // match at_constructor*
03127     while (c < children.size()) {
03128       if (!ISSET(astMembers[at_constructor], child(c)->astType))
03129         astChTypeError(*this, at_constructor, child(c)->astType, c);
03130       c++;
03131     }
03132 
03133     if(c != children.size()) {
03134       astChNumError(*this, c, children.size());
03135       errorsPresent = true;
03136     }
03137     break;
03138 
03139   case at_constructor: // normal AST:
03140     // match at_ident
03141     if(c >= children.size()) {
03142       astChNumError(*this, c+1, children.size());
03143       errorsPresent = true;
03144       break;
03145     }
03146     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
03147       astChTypeError(*this, at_ident, child(c)->astType, c);
03148       errorsPresent = true;
03149     }
03150     c++;
03151 
03152     // match agt_fielditem*
03153     while (c < children.size()) {
03154       if (!ISSET(astMembers[agt_fielditem], child(c)->astType))
03155         astChTypeError(*this, agt_fielditem, child(c)->astType, c);
03156       c++;
03157     }
03158 
03159     if(c != children.size()) {
03160       astChNumError(*this, c, children.size());
03161       errorsPresent = true;
03162     }
03163     break;
03164 
03165   case at_fields: // normal AST:
03166     // match agt_fielditem*
03167     while (c < children.size()) {
03168       if (!ISSET(astMembers[agt_fielditem], child(c)->astType))
03169         astChTypeError(*this, agt_fielditem, child(c)->astType, c);
03170       c++;
03171     }
03172 
03173     if(c != children.size()) {
03174       astChNumError(*this, c, children.size());
03175       errorsPresent = true;
03176     }
03177     break;
03178 
03179   case at_field: // normal AST:
03180     // match at_ident
03181     if(c >= children.size()) {
03182       astChNumError(*this, c+1, children.size());
03183       errorsPresent = true;
03184       break;
03185     }
03186     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
03187       astChTypeError(*this, at_ident, child(c)->astType, c);
03188       errorsPresent = true;
03189     }
03190     c++;
03191 
03192     // match agt_type
03193     if(c >= children.size()) {
03194       astChNumError(*this, c+1, children.size());
03195       errorsPresent = true;
03196       break;
03197     }
03198     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
03199       astChTypeError(*this, agt_type, child(c)->astType, c);
03200       errorsPresent = true;
03201     }
03202     c++;
03203 
03204     if(c != children.size()) {
03205       astChNumError(*this, c, children.size());
03206       errorsPresent = true;
03207     }
03208     break;
03209 
03210   case at_fill: // normal AST:
03211     // match agt_type
03212     if(c >= children.size()) {
03213       astChNumError(*this, c+1, children.size());
03214       errorsPresent = true;
03215       break;
03216     }
03217     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
03218       astChTypeError(*this, agt_type, child(c)->astType, c);
03219       errorsPresent = true;
03220     }
03221     c++;
03222 
03223     // match at_intLiteral?
03224     if ((c < children.size()) && ISSET(astMembers[at_intLiteral], child(c)->astType))
03225       c++;
03226 
03227     if(c != children.size()) {
03228       astChNumError(*this, c, children.size());
03229       errorsPresent = true;
03230     }
03231     break;
03232 
03233   case at_methdecl: // normal AST:
03234     // match at_ident
03235     if(c >= children.size()) {
03236       astChNumError(*this, c+1, children.size());
03237       errorsPresent = true;
03238       break;
03239     }
03240     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
03241       astChTypeError(*this, at_ident, child(c)->astType, c);
03242       errorsPresent = true;
03243     }
03244     c++;
03245 
03246     // match agt_type
03247     if(c >= children.size()) {
03248       astChNumError(*this, c+1, children.size());
03249       errorsPresent = true;
03250       break;
03251     }
03252     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
03253       astChTypeError(*this, agt_type, child(c)->astType, c);
03254       errorsPresent = true;
03255     }
03256     c++;
03257 
03258     if(c != children.size()) {
03259       astChNumError(*this, c, children.size());
03260       errorsPresent = true;
03261     }
03262     break;
03263 
03264   case at_bitfieldType: // normal AST:
03265     // match at_primaryType
03266     if(c >= children.size()) {
03267       astChNumError(*this, c+1, children.size());
03268       errorsPresent = true;
03269       break;
03270     }
03271     if (!ISSET(astMembers[at_primaryType], child(c)->astType)) {
03272       astChTypeError(*this, at_primaryType, child(c)->astType, c);
03273       errorsPresent = true;
03274     }
03275     c++;
03276 
03277     // match at_intLiteral
03278     if(c >= children.size()) {
03279       astChNumError(*this, c+1, children.size());
03280       errorsPresent = true;
03281       break;
03282     }
03283     if (!ISSET(astMembers[at_intLiteral], child(c)->astType)) {
03284       astChTypeError(*this, at_intLiteral, child(c)->astType, c);
03285       errorsPresent = true;
03286     }
03287     c++;
03288 
03289     if(c != children.size()) {
03290       astChNumError(*this, c, children.size());
03291       errorsPresent = true;
03292     }
03293     break;
03294 
03295   case at_byRefType: // normal AST:
03296     // match agt_type
03297     if(c >= children.size()) {
03298       astChNumError(*this, c+1, children.size());
03299       errorsPresent = true;
03300       break;
03301     }
03302     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
03303       astChTypeError(*this, agt_type, child(c)->astType, c);
03304       errorsPresent = true;
03305     }
03306     c++;
03307 
03308     if(c != children.size()) {
03309       astChNumError(*this, c, children.size());
03310       errorsPresent = true;
03311     }
03312     break;
03313 
03314   case at_arrayRefType: // normal AST:
03315     // match agt_type
03316     if(c >= children.size()) {
03317       astChNumError(*this, c+1, children.size());
03318       errorsPresent = true;
03319       break;
03320     }
03321     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
03322       astChTypeError(*this, agt_type, child(c)->astType, c);
03323       errorsPresent = true;
03324     }
03325     c++;
03326 
03327     if(c != children.size()) {
03328       astChNumError(*this, c, children.size());
03329       errorsPresent = true;
03330     }
03331     break;
03332 
03333   case at_boxedType: // normal AST:
03334     // match agt_type
03335     if(c >= children.size()) {
03336       astChNumError(*this, c+1, children.size());
03337       errorsPresent = true;
03338       break;
03339     }
03340     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
03341       astChTypeError(*this, agt_type, child(c)->astType, c);
03342       errorsPresent = true;
03343     }
03344     c++;
03345 
03346     if(c != children.size()) {
03347       astChNumError(*this, c, children.size());
03348       errorsPresent = true;
03349     }
03350     break;
03351 
03352   case at_unboxedType: // normal AST:
03353     // match agt_type
03354     if(c >= children.size()) {
03355       astChNumError(*this, c+1, children.size());
03356       errorsPresent = true;
03357       break;
03358     }
03359     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
03360       astChTypeError(*this, agt_type, child(c)->astType, c);
03361       errorsPresent = true;
03362     }
03363     c++;
03364 
03365     if(c != children.size()) {
03366       astChNumError(*this, c, children.size());
03367       errorsPresent = true;
03368     }
03369     break;
03370 
03371   case at_fn: // normal AST:
03372     // match at_fnargVec
03373     if(c >= children.size()) {
03374       astChNumError(*this, c+1, children.size());
03375       errorsPresent = true;
03376       break;
03377     }
03378     if (!ISSET(astMembers[at_fnargVec], child(c)->astType)) {
03379       astChTypeError(*this, at_fnargVec, child(c)->astType, c);
03380       errorsPresent = true;
03381     }
03382     c++;
03383 
03384     // match agt_type
03385     if(c >= children.size()) {
03386       astChNumError(*this, c+1, children.size());
03387       errorsPresent = true;
03388       break;
03389     }
03390     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
03391       astChTypeError(*this, agt_type, child(c)->astType, c);
03392       errorsPresent = true;
03393     }
03394     c++;
03395 
03396     if(c != children.size()) {
03397       astChNumError(*this, c, children.size());
03398       errorsPresent = true;
03399     }
03400     break;
03401 
03402   case at_methType: // normal AST:
03403     // match at_fnargVec
03404     if(c >= children.size()) {
03405       astChNumError(*this, c+1, children.size());
03406       errorsPresent = true;
03407       break;
03408     }
03409     if (!ISSET(astMembers[at_fnargVec], child(c)->astType)) {
03410       astChTypeError(*this, at_fnargVec, child(c)->astType, c);
03411       errorsPresent = true;
03412     }
03413     c++;
03414 
03415     // match agt_type
03416     if(c >= children.size()) {
03417       astChNumError(*this, c+1, children.size());
03418       errorsPresent = true;
03419       break;
03420     }
03421     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
03422       astChTypeError(*this, agt_type, child(c)->astType, c);
03423       errorsPresent = true;
03424     }
03425     c++;
03426 
03427     if(c != children.size()) {
03428       astChNumError(*this, c, children.size());
03429       errorsPresent = true;
03430     }
03431     break;
03432 
03433   case at_primaryType: // leaf AST:
03434     if(children.size() != 0) {
03435       astChNumError(*this, 0, children.size());
03436       errorsPresent = true;
03437     }
03438     break;
03439 
03440   case at_fnargVec: // normal AST:
03441     // match agt_type*
03442     while (c < children.size()) {
03443       if (!ISSET(astMembers[agt_type], child(c)->astType))
03444         astChTypeError(*this, agt_type, child(c)->astType, c);
03445       c++;
03446     }
03447 
03448     if(c != children.size()) {
03449       astChNumError(*this, c, children.size());
03450       errorsPresent = true;
03451     }
03452     break;
03453 
03454   case at_arrayType: // normal AST:
03455     // match agt_type
03456     if(c >= children.size()) {
03457       astChNumError(*this, c+1, children.size());
03458       errorsPresent = true;
03459       break;
03460     }
03461     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
03462       astChTypeError(*this, agt_type, child(c)->astType, c);
03463       errorsPresent = true;
03464     }
03465     c++;
03466 
03467     // match at_intLiteral
03468     if(c >= children.size()) {
03469       astChNumError(*this, c+1, children.size());
03470       errorsPresent = true;
03471       break;
03472     }
03473     if (!ISSET(astMembers[at_intLiteral], child(c)->astType)) {
03474       astChTypeError(*this, at_intLiteral, child(c)->astType, c);
03475       errorsPresent = true;
03476     }
03477     c++;
03478 
03479     if(c != children.size()) {
03480       astChNumError(*this, c, children.size());
03481       errorsPresent = true;
03482     }
03483     break;
03484 
03485   case at_vectorType: // normal AST:
03486     // match agt_type
03487     if(c >= children.size()) {
03488       astChNumError(*this, c+1, children.size());
03489       errorsPresent = true;
03490       break;
03491     }
03492     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
03493       astChTypeError(*this, agt_type, child(c)->astType, c);
03494       errorsPresent = true;
03495     }
03496     c++;
03497 
03498     // match at_intLiteral?
03499     if ((c < children.size()) && ISSET(astMembers[at_intLiteral], child(c)->astType))
03500       c++;
03501 
03502     if(c != children.size()) {
03503       astChNumError(*this, c, children.size());
03504       errorsPresent = true;
03505     }
03506     break;
03507 
03508   case at_mutableType: // normal AST:
03509     // match agt_type
03510     if(c >= children.size()) {
03511       astChNumError(*this, c+1, children.size());
03512       errorsPresent = true;
03513       break;
03514     }
03515     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
03516       astChTypeError(*this, agt_type, child(c)->astType, c);
03517       errorsPresent = true;
03518     }
03519     c++;
03520 
03521     if(c != children.size()) {
03522       astChNumError(*this, c, children.size());
03523       errorsPresent = true;
03524     }
03525     break;
03526 
03527   case at_constType: // normal AST:
03528     // match agt_type
03529     if(c >= children.size()) {
03530       astChNumError(*this, c+1, children.size());
03531       errorsPresent = true;
03532       break;
03533     }
03534     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
03535       astChTypeError(*this, agt_type, child(c)->astType, c);
03536       errorsPresent = true;
03537     }
03538     c++;
03539 
03540     if(c != children.size()) {
03541       astChNumError(*this, c, children.size());
03542       errorsPresent = true;
03543     }
03544     break;
03545 
03546   case at_typeapp: // normal AST:
03547     // match agt_var
03548     if(c >= children.size()) {
03549       astChNumError(*this, c+1, children.size());
03550       errorsPresent = true;
03551       break;
03552     }
03553     if (!ISSET(astMembers[agt_var], child(c)->astType)) {
03554       astChTypeError(*this, agt_var, child(c)->astType, c);
03555       errorsPresent = true;
03556     }
03557     c++;
03558 
03559     // match agt_type+
03560     if(c >= children.size()) {
03561       astChNumError(*this, c+1, children.size());
03562       errorsPresent = true;
03563       break;
03564     }
03565     if (!ISSET(astMembers[agt_type], child(c)->astType)) {
03566       astChTypeError(*this, agt_type, child(c)->astType, 1);
03567       errorsPresent = true;
03568     }
03569     while (c < children.size()) {
03570       if (!ISSET(astMembers[agt_type], child(c)->astType))
03571         astChTypeError(*this, agt_type, child(c)->astType, c);
03572       c++;
03573     }
03574 
03575     if(c != children.size()) {
03576       astChNumError(*this, c, children.size());
03577       errorsPresent = true;
03578     }
03579     break;
03580 
03581   case at_exceptionType: // leaf AST:
03582     if(children.size() != 0) {
03583       astChNumError(*this, 0, children.size());
03584       errorsPresent = true;
03585     }
03586     break;
03587 
03588   case at_fieldType: // normal AST:
03589     // match at_ident
03590     if(c >= children.size()) {
03591       astChNumError(*this, c+1, children.size());
03592       errorsPresent = true;
03593       break;
03594     }
03595     if (!ISSET(astMembers[at_ident], child(c)->astType)) {
03596       astChTypeError(*this, at_ident, child(c)->astType, c);
03597       errorsPresent = true;
03598     }
03599     c++;
03600 
03601     if(c != children.size()) {
03602       astChNumError(*this, c, children.size());
03603       errorsPresent = true;
03604     }
03605     break;
03606 
03607   case at_dummyType: // leaf AST:
03608     if(children.size() != 0) {
03609       astChNumError(*this, 0, children.size());
03610       errorsPresent = true;
03611     }
03612     break;
03613 
03614   case at_identPattern: // normal AST:
03615     // match agt_var
03616     if(c >= children.size()) {
03617       astChNumError(*this, c+1, children.size());
03618       errorsPresent = true;
03619       break;
03620     }
03621     if (!ISSET(astMembers[agt_var], child(c)->astType)) {
03622       astChTypeError(*this, agt_var, child(c)->astType, c);
03623       errorsPresent = true;
<