From ec67cd09180002fadc9464a318dae020fef29d7d Mon Sep 17 00:00:00 2001 From: drl7x Date: Thu, 1 Mar 2001 20:12:10 +0000 Subject: [PATCH] got rid of files in case directory. t --- src/Makefile.sources | 93 - src/abstract.c | 6407 --------------------- src/aliasChecks.c | 3909 ------------- src/aliasTable.c | 824 --- src/cgrammar.tab.c | 5763 ------------------- src/cgrammar.tab.h | 220 - src/checking.c | 820 --- src/clabstract.c | 2352 -------- src/clause.c | 155 - src/clauseStack.c | 186 - src/constraint.c | 613 -- src/constraintGeneration.c | 1523 ----- src/constraintList.c | 324 -- src/constraintResolve.c | 780 --- src/constraintTerm.c | 406 -- src/context.c | 4143 -------------- src/cpperror.c | 399 -- src/cppexp.c | 1337 ----- src/cpphash.c | 492 -- src/cpplib.c | 7441 ------------------------ src/cppmain.c | 222 - src/cprim.c | 415 -- src/cstring.c | 950 ---- src/cstringList.c | 243 - src/cstringSList.c | 252 - src/ctype.c | 2398 -------- src/ctypeList.c | 131 - src/cvar.c | 31 - src/declaratorInvNodeList.c | 114 - src/declaratorNodeList.c | 130 - src/dummy.c | 3 - src/ekind.c | 106 - src/enumNameList.c | 275 - src/enumNameSList.c | 45 - src/environmentTable.c | 1157 ---- src/exprChecks.c | 1436 ----- src/exprData.c | 40 - src/exprNode.c | 10006 --------------------------------- src/exprNodeList.c | 202 - src/exprNodeSList.c | 138 - src/fcnNodeList.c | 127 - src/fileIdList.c | 36 - src/fileTable.c | 827 --- src/fileloc.c | 798 --- src/filelocList.c | 294 - src/filelocStack.c | 234 - src/flagMarker.c | 155 - src/flagMarkerList.c | 541 -- src/flags.c | 1213 ---- src/general.c | 736 --- src/globSet.c | 165 - src/globals.c | 96 - src/guardSet.c | 356 -- src/hashTable.c | 469 -- src/idDecl.c | 181 - src/idDeclList.c | 109 - src/importNodeList.c | 114 - src/imports.c | 383 -- src/initDeclNodeList.c | 118 - src/intSet.c | 176 - src/interfaceNodeList.c | 114 - src/lclctypes.c | 172 - src/lclinit.c | 1557 ----- src/lcllib.c | 565 -- src/lclscan.c | 212 - src/lclscanline.c | 1945 ------- src/lclsyntable.c | 181 - src/lcltokentable.c | 230 - src/letDeclNodeList.c | 117 - src/lex.yy.c | 5400 ------------------ src/lh.c | 499 -- src/llerror.c | 1666 ------ src/llgrammar.c | 3902 ------------- src/llgrammar.tab.c | 3856 ------------- src/llmain.c | 2404 -------- src/lltok.c | 239 - src/lslOpList.c | 107 - src/lslOpSet.c | 198 - src/lslinit.c | 1555 ----- src/lslparse.c | 512 -- src/lsymbol.c | 360 -- src/lsymbolList.c | 95 - src/lsymbolSet.c | 157 - src/ltoken.c | 326 -- src/ltokenList.c | 231 - src/macrocache.c | 408 -- src/mapping.c | 124 - src/message.c | 277 - src/messageLog.c | 214 - src/multiVal.c | 306 - src/nameChecks.c | 1462 ----- src/osd.c | 544 -- src/pairNodeList.c | 116 - src/paramNodeList.c | 167 - src/programNodeList.c | 111 - src/qtype.c | 226 - src/qual.c | 117 - src/qualList.c | 218 - src/quantifierNodeList.c | 120 - src/rangeTable.c | 829 --- src/replaceNodeList.c | 114 - src/sRef.c | 9190 ------------------------------ src/sRefSet.c | 998 ---- src/sRefSetList.c | 104 - src/sRefTable.c | 147 - src/scan.c | 168 - src/scanline.c | 822 --- src/shift.c | 100 - src/sigNodeSet.c | 222 - src/signature.c | 1323 ----- src/signature.tab.c | 1277 ----- src/sort.c | 3160 ----------- src/sortList.c | 139 - src/sortSet.c | 236 - src/sortSetList.c | 140 - src/source.c | 332 -- src/specialClauses.c | 944 ---- src/stDeclNodeList.c | 129 - src/storeRefNodeList.c | 142 - src/structNames.c | 154 - src/symtable.c | 2121 ------- src/syntable.c | 218 - src/termNodeList.c | 260 - src/tokentable.c | 180 - src/traitRefNodeList.c | 111 - src/typeIdSet.c | 299 - src/typeNameNodeList.c | 112 - src/uentry.c | 9882 -------------------------------- src/uentryList.c | 849 --- src/usymIdSet.c | 388 -- src/usymtab.c | 5612 ------------------ src/usymtab_interface.c | 1733 ------ src/varDeclarationNodeList.c | 107 - src/varKinds.c | 623 -- src/varNodeList.c | 138 - src/ynm.c | 54 - 136 files changed, 137976 deletions(-) delete mode 100644 src/Makefile.sources delete mode 100644 src/abstract.c delete mode 100644 src/aliasChecks.c delete mode 100644 src/aliasTable.c delete mode 100644 src/cgrammar.tab.c delete mode 100644 src/cgrammar.tab.h delete mode 100644 src/checking.c delete mode 100644 src/clabstract.c delete mode 100644 src/clause.c delete mode 100644 src/clauseStack.c delete mode 100644 src/constraint.c delete mode 100644 src/constraintGeneration.c delete mode 100644 src/constraintList.c delete mode 100644 src/constraintResolve.c delete mode 100644 src/constraintTerm.c delete mode 100644 src/context.c delete mode 100644 src/cpperror.c delete mode 100644 src/cppexp.c delete mode 100644 src/cpphash.c delete mode 100644 src/cpplib.c delete mode 100644 src/cppmain.c delete mode 100644 src/cprim.c delete mode 100644 src/cstring.c delete mode 100644 src/cstringList.c delete mode 100644 src/cstringSList.c delete mode 100644 src/ctype.c delete mode 100644 src/ctypeList.c delete mode 100644 src/cvar.c delete mode 100644 src/declaratorInvNodeList.c delete mode 100644 src/declaratorNodeList.c delete mode 100644 src/dummy.c delete mode 100644 src/ekind.c delete mode 100644 src/enumNameList.c delete mode 100644 src/enumNameSList.c delete mode 100644 src/environmentTable.c delete mode 100644 src/exprChecks.c delete mode 100644 src/exprData.c delete mode 100644 src/exprNode.c delete mode 100644 src/exprNodeList.c delete mode 100644 src/exprNodeSList.c delete mode 100644 src/fcnNodeList.c delete mode 100644 src/fileIdList.c delete mode 100644 src/fileTable.c delete mode 100644 src/fileloc.c delete mode 100644 src/filelocList.c delete mode 100644 src/filelocStack.c delete mode 100644 src/flagMarker.c delete mode 100644 src/flagMarkerList.c delete mode 100644 src/flags.c delete mode 100644 src/general.c delete mode 100644 src/globSet.c delete mode 100644 src/globals.c delete mode 100644 src/guardSet.c delete mode 100644 src/hashTable.c delete mode 100644 src/idDecl.c delete mode 100644 src/idDeclList.c delete mode 100644 src/importNodeList.c delete mode 100644 src/imports.c delete mode 100644 src/initDeclNodeList.c delete mode 100644 src/intSet.c delete mode 100644 src/interfaceNodeList.c delete mode 100644 src/lclctypes.c delete mode 100644 src/lclinit.c delete mode 100644 src/lcllib.c delete mode 100644 src/lclscan.c delete mode 100644 src/lclscanline.c delete mode 100644 src/lclsyntable.c delete mode 100644 src/lcltokentable.c delete mode 100644 src/letDeclNodeList.c delete mode 100644 src/lex.yy.c delete mode 100644 src/lh.c delete mode 100644 src/llerror.c delete mode 100644 src/llgrammar.c delete mode 100644 src/llgrammar.tab.c delete mode 100644 src/llmain.c delete mode 100644 src/lltok.c delete mode 100644 src/lslOpList.c delete mode 100644 src/lslOpSet.c delete mode 100644 src/lslinit.c delete mode 100644 src/lslparse.c delete mode 100644 src/lsymbol.c delete mode 100644 src/lsymbolList.c delete mode 100644 src/lsymbolSet.c delete mode 100644 src/ltoken.c delete mode 100644 src/ltokenList.c delete mode 100644 src/macrocache.c delete mode 100644 src/mapping.c delete mode 100644 src/message.c delete mode 100644 src/messageLog.c delete mode 100644 src/multiVal.c delete mode 100644 src/nameChecks.c delete mode 100644 src/osd.c delete mode 100644 src/pairNodeList.c delete mode 100644 src/paramNodeList.c delete mode 100644 src/programNodeList.c delete mode 100644 src/qtype.c delete mode 100644 src/qual.c delete mode 100644 src/qualList.c delete mode 100644 src/quantifierNodeList.c delete mode 100644 src/rangeTable.c delete mode 100644 src/replaceNodeList.c delete mode 100644 src/sRef.c delete mode 100644 src/sRefSet.c delete mode 100644 src/sRefSetList.c delete mode 100644 src/sRefTable.c delete mode 100644 src/scan.c delete mode 100644 src/scanline.c delete mode 100644 src/shift.c delete mode 100644 src/sigNodeSet.c delete mode 100644 src/signature.c delete mode 100644 src/signature.tab.c delete mode 100644 src/sort.c delete mode 100644 src/sortList.c delete mode 100644 src/sortSet.c delete mode 100644 src/sortSetList.c delete mode 100644 src/source.c delete mode 100644 src/specialClauses.c delete mode 100644 src/stDeclNodeList.c delete mode 100644 src/storeRefNodeList.c delete mode 100644 src/structNames.c delete mode 100644 src/symtable.c delete mode 100644 src/syntable.c delete mode 100644 src/termNodeList.c delete mode 100644 src/tokentable.c delete mode 100644 src/traitRefNodeList.c delete mode 100644 src/typeIdSet.c delete mode 100644 src/typeNameNodeList.c delete mode 100644 src/uentry.c delete mode 100644 src/uentryList.c delete mode 100644 src/usymIdSet.c delete mode 100644 src/usymtab.c delete mode 100644 src/usymtab_interface.c delete mode 100644 src/varDeclarationNodeList.c delete mode 100644 src/varKinds.c delete mode 100644 src/varNodeList.c delete mode 100644 src/ynm.c diff --git a/src/Makefile.sources b/src/Makefile.sources deleted file mode 100644 index 2427a1a..0000000 --- a/src/Makefile.sources +++ /dev/null @@ -1,93 +0,0 @@ -### -### Makefile.sources -### - -SETSRC = globSet.c intSet.c typeIdSet.c guardSet.c usymIdSet.c sRefSet.c - -LISTSRC = clauseStack.c filelocStack.c \ - cstringList.c cstringSList.c sRefSetList.c ctypeList.c \ - enumNameList.c enumNameSList.c exprNodeList.c exprNodeSList.c \ - uentryList.c fileIdList.c filelocList.c qualList.c \ - flagMarkerList.c idDeclList.c - -CPPSRC = cppmain.c cpplib.c cppexp.c cpphash.c cpperror.c - -CSRC = uentry.c cprim.c macrocache.c qual.c qtype.c specialClauses.c \ - ctype.c cvar.c clabstract.c idDecl.c clause.c - -LCLINTSRC = exprNode.c exprChecks.c llmain.c - CHECKSRC = structNames.c aliasChecks.c varKinds.c nameChecks.c - - GLOBSRC = context.c globals.c flags.c general.c osd.c - -GRAMS = cgrammar.y cscanner.l llgrammar.y signature.y -GRAMSRC = cgrammar.c cscanner.c - -GENERALSRC = cstring.c fileloc.c message.c source.c \ - fileTable.c hashTable.c llerror.c messageLog.c \ - flagMarker.c aliasTable.c ynm.c sRefTable.c \ - ekind.c usymtab.c multiVal.c lltok.c sRef.c lcllib.c \ - constraint.c \ - constraintTerm.c \ - constraintExpr.c \ - constraintExprData.c \ - constraintResolve.c \ - constraintOutput.c \ - environmentTable.c \ - constraintList.c \ - constraintGeneration.c \ - forjunk.c \ - exprData.c - -### -### These source files are relevant for LCL only. -### Not uses if NOLCL is set. -### - -LCLONLYSRC = usymtab_interface.c abstract.c ltoken.c lclscanline.c \ - lclsyntable.c lcltokentable.c sort.c symtable.c lclinit.c \ - shift.c lclscan.c lsymbol.c mapping.c - -LSLSRC = tokentable.c scan.c scanline.c lslparse.c \ - lh.c checking.c lclctypes.c imports.c lslinit.c syntable.c - -LCLGRAMS = llgrammar.y signature.y -LCLGRAMSSRC = llgrammar.c signature.c - -LCLSETSRC = lsymbolSet.c sigNodeSet.c lslOpSet.c sortSet.c - -LCLLISTSRC = initDeclNodeList.c sortList.c declaratorInvNodeList.c \ - interfaceNodeList.c sortSetList.c declaratorNodeList.c \ - letDeclNodeList.c stDeclNodeList.c lslOpList.c storeRefNodeList.c \ - lsymbolList.c termNodeList.c ltokenList.c traitRefNodeList.c \ - pairNodeList.c typeNameNodeList.c fcnNodeList.c paramNodeList.c \ - programNodeList.c varDeclarationNodeList.c varNodeList.c \ - quantifierNodeList.c replaceNodeList.c importNodeList.c - -ifeq ($(NOLCL), 1) -LCLSRC = -else -LCLSRC = $(LCLSETSRC) $(LCLLISTSRC) $(LSLSRC) $(CMNSRC) $(LCLONLYSRC) $(LCLGRAMSSRC) -endif - -COMMONSRC = $(CPPSRC) $(CSRC) $(CHECKSRC) $(GENERALSRC) $(GLOBSRC) \ - $(IFACESRC) $(LISTSRC) $(SETSRC) $(LCLSRC) $(LCLGRAMSRC) - -SRC = $(COMMONSRC) $(LCLINTSRC) -ALLSRC = $(SRC) $(GRAMSRC) - -## all except cscanner.c -ALMOSTALLSRC = llgrammar.c cgrammar.c signature.c $(SRC) -OBJ = $(subst .c,.o,$(ALLSRC)) - -CHECKS = $(subst .c,.check,$(SRC)) - -ALLHEADERS = - -SANITIZERSRC = $(COMMONSRC) cscanner.c sgrammar.c sNode.c sChecks.c sMain.c -SANITIZEROBJ = $(subst .c,.o,$(SANITIZERSRC)) - - - - - diff --git a/src/abstract.c b/src/abstract.c deleted file mode 100644 index dc4d135..0000000 --- a/src/abstract.c +++ /dev/null @@ -1,6407 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** abstract.c -** -** Module for building abstract syntax trees for LCL. -** -** This module is too close to the surface syntax of LCL. -** Suffices for now. -** -** AUTHOR: -** Yang Meng Tan, -** Massachusetts Institute of Technology -*/ - -# include "lclintMacros.nf" -# include "llbasic.h" -# include "lslparse.h" -# include "llgrammar.h" /* need simpleOp, MULOP and logicalOp in makeInfixTermNode */ -# include "lclscan.h" -# include "lh.h" -# include "imports.h" - -static lsymbol lsymbol_Bool; -static lsymbol lsymbol_bool; -static lsymbol lsymbol_TRUE; -static lsymbol lsymbol_FALSE; - -static void lclPredicateNode_free (/*@only@*/ /*@null@*/ lclPredicateNode p_x) ; -static void exposedNode_free (/*@only@*/ /*@null@*/ exposedNode p_x) ; -static void CTypesNode_free (/*@null@*/ /*@only@*/ CTypesNode p_x); -static /*@null@*/ CTypesNode CTypesNode_copy (/*@null@*/ CTypesNode p_x) /*@*/ ; -static void - constDeclarationNode_free (/*@only@*/ /*@null@*/ constDeclarationNode p_x); -static void claimNode_free (/*@only@*/ /*@null@*/ claimNode p_x); -static void iterNode_free (/*@only@*/ /*@null@*/ iterNode p_x); -static void abstBodyNode_free (/*@only@*/ /*@null@*/ abstBodyNode p_n); -static void abstractNode_free (/*@only@*/ /*@null@*/ abstractNode p_x); -static void taggedUnionNode_free (/*@only@*/ /*@null@*/ taggedUnionNode p_x); -static void typeNode_free (/*@only@*/ /*@null@*/ typeNode p_t); -static /*@null@*/ strOrUnionNode - strOrUnionNode_copy (/*@null@*/ strOrUnionNode p_n) /*@*/ ; -static void strOrUnionNode_free (/*@null@*/ /*@only@*/ strOrUnionNode p_n) - /*@modifies *p_n @*/ ; - -static void enumSpecNode_free (/*@null@*/ /*@only@*/ enumSpecNode p_x); -static /*@only@*/ /*@null@*/ enumSpecNode - enumSpecNode_copy (/*@null@*/ enumSpecNode p_x) /*@*/ ; -static /*@only@*/ lclTypeSpecNode - lclTypeSpecNode_copySafe (lclTypeSpecNode p_n) /*@*/ ; -static void lclTypeSpecNode_free (/*@null@*/ /*@only@*/ lclTypeSpecNode p_n); -static void typeNamePack_free (/*@only@*/ /*@null@*/ typeNamePack p_x); -static void opFormNode_free (/*@only@*/ /*@null@*/ opFormNode p_op); -static quantifiedTermNode quantifiedTermNode_copy (quantifiedTermNode p_q) /*@*/ ; -static void nameAndReplaceNode_free (/*@only@*/ /*@null@*/ nameAndReplaceNode p_x); -static void renamingNode_free (/*@only@*/ /*@null@*/ renamingNode p_x); -static void exportNode_free (/*@null@*/ /*@only@*/ exportNode p_x); -static void privateNode_free (/*@only@*/ /*@null@*/ privateNode p_x); -static /*@null@*/ termNode termNode_copy (/*@null@*/ termNode p_t) /*@*/ ; -static void - stmtNode_free (/*@only@*/ /*@null@*/ stmtNode p_x) /*@modifies *p_x@*/ ; -static /*@null@*/ typeExpr typeExpr_copy (/*@null@*/ typeExpr p_x) /*@*/ ; - -static lsymbol ConditionalSymbol; -static lsymbol equalSymbol; -static lsymbol eqSymbol; -static lclTypeSpecNode exposedType; - -static /*@only@*/ cstring abstDeclaratorNode_unparse (abstDeclaratorNode p_x); -static pairNodeList extractParams (/*@null@*/ typeExpr p_te); -static sort extractReturnSort (lclTypeSpecNode p_t, declaratorNode p_d); -static void checkAssociativity (termNode p_x, ltoken p_op); -static void LCLBootstrap (void); -static cstring printMiddle (int p_j); -static void paramNode_checkQualifiers (lclTypeSpecNode p_t, typeExpr p_d); - -void -resetImports (cstring current) -{ - lsymbolSet_free (g_currentImports); - - g_currentImports = lsymbolSet_new (); /* equal_symbol; */ - (void) lsymbolSet_insert (g_currentImports, - lsymbol_fromChars (cstring_toCharsSafe (current))); -} - -void -abstract_init () -{ - typeInfo ti = (typeInfo) dmalloc (sizeof (*ti)); - nameNode nn; - ltoken dom, range; - sigNode sign; - opFormNode opform; - ltokenList domain = ltokenList_new (); - ltokenList domain2; - - equalSymbol = lsymbol_fromChars ("="); - eqSymbol = lsymbol_fromChars ("\\eq"); - - /* - ** not: cstring_toCharsSafe (context_getBoolName ()) - ** we use the hard wired "bool" name. - */ - - lsymbol_bool = lsymbol_fromChars ("bool"); - lsymbol_Bool = lsymbol_fromChars ("Bool"); - - lsymbol_TRUE = lsymbol_fromChars ("TRUE"); - lsymbol_FALSE = lsymbol_fromChars ("FALSE"); - - ConditionalSymbol = lsymbol_fromChars ("if__then__else__"); - - /* generate operators for - ** __ \not, __ \implies __ , __ \and __, __ \or __ - */ - - range = ltoken_create (simpleId, lsymbol_bool); - dom = ltoken_create (simpleId, lsymbol_bool); - - ltokenList_addh (domain, ltoken_copy (dom)); - - domain2 = ltokenList_copy (domain); /* moved this here (before release) */ - - sign = makesigNode (ltoken_undefined, domain, ltoken_copy (range)); - - opform = makeOpFormNode (ltoken_undefined, OPF_ANYOPM, - opFormUnion_createAnyOp (ltoken_not), - ltoken_undefined); - nn = makeNameNodeForm (opform); - symtable_enterOp (g_symtab, nn, sign); - - ltokenList_addh (domain2, dom); - - sign = makesigNode (ltoken_undefined, domain2, range); - - opform = makeOpFormNode (ltoken_undefined, OPF_MANYOPM, - opFormUnion_createAnyOp (ltoken_and), - ltoken_undefined); - - nn = makeNameNodeForm (opform); - symtable_enterOp (g_symtab, nn, sigNode_copy (sign)); - - opform = makeOpFormNode (ltoken_undefined, OPF_MANYOPM, - opFormUnion_createAnyOp (ltoken_or), - ltoken_undefined); - - nn = makeNameNodeForm (opform); - symtable_enterOp (g_symtab, nn, sigNode_copy (sign)); - - opform = makeOpFormNode (ltoken_undefined, OPF_MANYOPM, - opFormUnion_createAnyOp (ltoken_implies), - ltoken_undefined); - nn = makeNameNodeForm (opform); - symtable_enterOp (g_symtab, nn, sign); - - /* from lclscanline.c's init procedure */ - /* comment out so we can add in lclinit.lci: synonym double float */ - /* ReserveToken (FLOAT, "float"); */ - /* But we need to make the scanner parse "float" not as a simpleId, but - as a TYPEDEF_NAME. This is done later in abstract_init */ - - ti->id = ltoken_createType (LLT_TYPEDEF_NAME, SID_TYPE, lsymbol_fromChars ("float")); - - ti->modifiable = FALSE; - ti->abstract = FALSE; - ti->export = FALSE; /* this is implicit, not exported */ - ti->basedOn = sort_float; - symtable_enterType (g_symtab, ti); -} - -void -declareForwardType (declaratorNode declare) -{ - typeInfo ti = (typeInfo) dmalloc (sizeof (*ti)); - sort tsort, handle; - lsymbol typedefname; - - typedefname = ltoken_getText (declare->id); - ti->id = ltoken_copy (declare->id); - - ltoken_setCode (ti->id, LLT_TYPEDEF_NAME); - ltoken_setIdType (ti->id, SID_TYPE); - - ti->modifiable = FALSE; - ti->abstract = FALSE; - tsort = lclTypeSpecNode2sort (exposedType); - handle = typeExpr2ptrSort (tsort, declare->type); - ti->basedOn = sort_makeSyn (declare->id, handle, typedefname); - ti->export = FALSE; - - symtable_enterType (g_symtab, ti); -} - -void LCLBuiltins (void) -{ - typeInfo ti = (typeInfo) dmalloc (sizeof (*ti)); - varInfo vi = (varInfo) dmalloc (sizeof (*vi)); - - /* immutable type bool; - uses CTrait; - constant bool FALSE = false; - constant bool TRUE = true; */ - - /* the following defines the builtin LSL sorts and operators */ - LCLBootstrap (); - - /* now LCL builtin proper */ - /* do "immutable type bool;" */ - - ti->id = ltoken_copy (ltoken_bool); - - ltoken_setCode (ti->id, LLT_TYPEDEF_NAME); - ltoken_setIdType (ti->id, SID_TYPE); - - ti->modifiable = FALSE; - ti->abstract = TRUE; - ti->basedOn = sort_bool; - ti->export = FALSE; /* this wasn't set (detected by lclint) */ - symtable_enterType (g_symtab, ti); - - /* do "constant bool FALSE = false;" */ - vi->id = ltoken_createType (simpleId, SID_VAR, lsymbol_fromChars ("FALSE")); - - vi->kind = VRK_CONST; - vi->sort = sort_bool; - vi->export = TRUE; - - (void) symtable_enterVar (g_symtab, vi); - - /* do "constant bool TRUE = true;" */ - /* vi->id = ltoken_copy (vi->id); */ - ltoken_setText (vi->id, lsymbol_fromChars ("TRUE")); - (void) symtable_enterVar (g_symtab, vi); - - varInfo_free (vi); - - importCTrait (); -} - -static void -LCLBootstrap (void) -{ - nameNode nn1, nn2; - ltoken range; - sigNode sign; - sort s; - - /* - ** Minimal we need to bootstrap is to provide the sort - ** "bool" and 2 bool constants "true" and "false". - ** sort_init should already have been called, and hence - ** the bool and Bool sorts defined. - */ - - s = sort_makeImmutable (ltoken_undefined, lsymbol_bool); - range = ltoken_create (simpleId, lsymbol_bool); - sign = makesigNode (ltoken_undefined, ltokenList_new (), range); - - nn1 = (nameNode) dmalloc (sizeof (*nn1)); - nn1->isOpId = TRUE; - - nn1->content.opid = ltoken_create (simpleId, lsymbol_fromChars ("true")); - - symtable_enterOp (g_symtab, nn1, sign); - - nn2 = (nameNode) dmalloc (sizeof (*nn2)); - nn2->isOpId = TRUE; - nn2->content.opid = ltoken_create (simpleId, lsymbol_fromChars ("false")); - - symtable_enterOp (g_symtab, nn2, sigNode_copy (sign)); -} - -interfaceNodeList -consInterfaceNode (/*@only@*/ interfaceNode n, /*@returned@*/ interfaceNodeList ns) -{ - /* n is never empty, but ns may be empty */ - interfaceNodeList_addl (ns, n); - return (ns); -} - -/*@only@*/ interfaceNode -makeInterfaceNodeImports (/*@only@*/ importNodeList x) -{ - interfaceNode i = (interfaceNode) dmalloc (sizeof (*i)); - lsymbol importSymbol; - - i->kind = INF_IMPORTS; - i->content.imports = x; /* an importNodeList */ - - importNodeList_elements (x, imp) - { - importSymbol = ltoken_getRawText (imp->val); - - if (lsymbolSet_member (g_currentImports, importSymbol)) - { - lclerror (imp->val, - message ("Circular imports: %s", - cstring_fromChars (lsymbol_toChars (importSymbol)))); - } - else - { - processImport (importSymbol, imp->val, imp->kind); - } - } end_importNodeList_elements; - - lhOutLine (cstring_undefined); - return (i); -} - -/*@only@*/ interfaceNode -makeInterfaceNodeUses (/*@only@*/ traitRefNodeList x) -{ - interfaceNode i = (interfaceNode) dmalloc (sizeof (*i)); - - i->kind = INF_USES; - i->content.uses = x; - /* read in LSL traits */ - - return (i); -} - -/*@only@*/ interfaceNode -interfaceNode_makeConst (/*@only@*/ constDeclarationNode x) -{ - interfaceNode i = (interfaceNode) dmalloc (sizeof (*i)); - exportNode e = (exportNode) dmalloc (sizeof (*e)); - - e->kind = XPK_CONST; - e->content.constdeclaration = x; - i->kind = INF_EXPORT; - i->content.export = e; - - return (i); -} - -/*@only@*/ interfaceNode -interfaceNode_makeVar (/*@only@*/ varDeclarationNode x) -{ - interfaceNode i = (interfaceNode) dmalloc (sizeof (*i)); - exportNode e = (exportNode) dmalloc (sizeof (*e)); - - e->kind = XPK_VAR; - e->content.vardeclaration = x; - i->kind = INF_EXPORT; - i->content.export = e; - - if (context_msgLh ()) - { - lhOutLine (lhVarDecl (x->type, x->decls, x->qualifier)); - } - - return (i); -} - -/*@only@*/ interfaceNode -interfaceNode_makeType (/*@only@*/ typeNode x) -{ - interfaceNode i = (interfaceNode) dmalloc (sizeof (*i)); - exportNode e = (exportNode) dmalloc (sizeof (*e)); - e->kind = XPK_TYPE; - e->content.type = x; - i->kind = INF_EXPORT; - i->content.export = e; - - if (context_msgLh ()) - { - - lhOutLine (lhType (x)); - } - - return (i); -} - -/*@only@*/ interfaceNode -interfaceNode_makeFcn (/*@only@*/ fcnNode x) -{ - interfaceNode i = (interfaceNode) dmalloc (sizeof (*i)); - exportNode e = (exportNode) dmalloc (sizeof (*e)); - - e->kind = XPK_FCN; - e->content.fcn = x; - i->kind = INF_EXPORT; - i->content.export = e; - - if (context_msgLh ()) - { - llassert (x->typespec != NULL); - llassert (x->declarator != NULL); - - lhOutLine (lhFunction (x->typespec, x->declarator)); - } - - return (i); -} - -/*@only@*/ interfaceNode -interfaceNode_makeClaim (/*@only@*/ claimNode x) -{ - interfaceNode i = (interfaceNode) dmalloc (sizeof (*i)); - exportNode e = (exportNode) dmalloc (sizeof (*e)); - - e->kind = XPK_CLAIM; - e->content.claim = x; - i->kind = INF_EXPORT; - i->content.export = e; - return (i); -} - -/*@only@*/ interfaceNode -interfaceNode_makeIter (/*@only@*/ iterNode x) -{ - interfaceNode i = (interfaceNode) dmalloc (sizeof (*i)); - exportNode e = (exportNode) dmalloc (sizeof (*e)); - - e->kind = XPK_ITER; - e->content.iter = x; - i->kind = INF_EXPORT; - i->content.export = e; - return (i); -} - -/*@only@*/ interfaceNode -interfaceNode_makePrivConst (/*@only@*/ constDeclarationNode x) -{ - interfaceNode i = (interfaceNode) dmalloc (sizeof (*i)); - privateNode e = (privateNode) dmalloc (sizeof (*e)); - - e->kind = PRIV_CONST; - e->content.constdeclaration = x; - i->kind = INF_PRIVATE; - i->content.private = e; - return (i); -} - -/*@only@*/ interfaceNode -interfaceNode_makePrivVar (/*@only@*/ varDeclarationNode x) -{ - interfaceNode i = (interfaceNode) dmalloc (sizeof (*i)); - privateNode e = (privateNode) dmalloc (sizeof (*e)); - - e->kind = PRIV_VAR; - e->content.vardeclaration = x; - i->kind = INF_PRIVATE; - i->content.private = e; - return (i); -} - -/*@only@*/ interfaceNode -interfaceNode_makePrivType (/*@only@*/ typeNode x) -{ - interfaceNode i = (interfaceNode) dmalloc (sizeof (*i)); - privateNode e = (privateNode) dmalloc (sizeof (*e)); - - e->kind = PRIV_TYPE; - e->content.type = x; - i->kind = INF_PRIVATE; - i->content.private = e; - return (i); -} - -/*@only@*/ interfaceNode -interfaceNode_makePrivFcn (/*@only@*/ fcnNode x) -{ - interfaceNode i = (interfaceNode) dmalloc (sizeof (*i)); - privateNode e = (privateNode) dmalloc (sizeof (*e)); - - /* - ** bug detected by lclint enum checking - ** e->kind = XPK_FCN; - */ - - e->kind = PRIV_FUNCTION; - e->content.fcn = x; - i->kind = INF_PRIVATE; - i->content.private = e; - return (i); -} - -/*@only@*/ cstring -exportNode_unparse (exportNode n) -{ - if (n != (exportNode) 0) - { - switch (n->kind) - { - case XPK_CONST: - return (message - ("%q\n", - constDeclarationNode_unparse (n->content.constdeclaration))); - case XPK_VAR: - return (message - ("%q\n", - varDeclarationNode_unparse (n->content.vardeclaration))); - case XPK_TYPE: - return (message ("%q\n", typeNode_unparse (n->content.type))); - case XPK_FCN: - return (fcnNode_unparse (n->content.fcn)); - case XPK_CLAIM: - return (claimNode_unparse (n->content.claim)); - case XPK_ITER: - return (iterNode_unparse (n->content.iter)); - default: - llfatalbug (message ("exportNode_unparse: unknown kind: %d", (int) n->kind)); - } - } - return cstring_undefined; -} - -/*@only@*/ cstring -privateNode_unparse (privateNode n) -{ - if (n != (privateNode) 0) - { - switch (n->kind) - { - case PRIV_CONST: - return (constDeclarationNode_unparse (n->content.constdeclaration)); - case PRIV_VAR: - return (varDeclarationNode_unparse (n->content.vardeclaration)); - case PRIV_TYPE: - return (typeNode_unparse (n->content.type)); - case PRIV_FUNCTION: - return (fcnNode_unparse (n->content.fcn)); - default: - llfatalbug (message ("privateNode_unparse: unknown kind: %d", - (int) n->kind)); - } - } - return cstring_undefined; -} - -void lclPredicateNode_free (/*@null@*/ /*@only@*/ lclPredicateNode x) -{ - if (x != NULL) - { - termNode_free (x->predicate); - ltoken_free (x->tok); - sfree (x); - } -} - -static /*@only@*/ cstring -lclPredicateNode_unparse (/*@null@*/ lclPredicateNode p) /*@*/ -{ - if (p != (lclPredicateNode) 0) - { - cstring st = cstring_undefined; - - switch (p->kind) - { - case LPD_REQUIRES: - st = cstring_makeLiteral (" requires "); - break; - case LPD_CHECKS: - st = cstring_makeLiteral (" checks "); - break; - case LPD_ENSURES: - st = cstring_makeLiteral (" ensures "); - break; - case LPD_INTRACLAIM: - st = cstring_makeLiteral (" claims "); - break; - case LPD_CONSTRAINT: - st = cstring_makeLiteral ("constraint "); - break; - case LPD_INITIALLY: - st = cstring_makeLiteral ("initially "); - break; - case LPD_PLAIN: - break; - default: - llfatalbug (message ("lclPredicateNode_unparse: unknown kind: %d", - (int) p->kind)); - } - return (message ("%q%q;\n", st, termNode_unparse (p->predicate))); - } - return cstring_undefined; -} - -bool -ltoken_similar (ltoken t1, ltoken t2) -{ - lsymbol sym1 = ltoken_getText (t1); - lsymbol sym2 = ltoken_getText (t2); - - if (sym1 == sym2) - { - return TRUE; - } - - if ((sym1 == eqSymbol && sym2 == equalSymbol) || - (sym2 == eqSymbol && sym1 == equalSymbol)) - { - return TRUE; - } - - if ((sym1 == lsymbol_bool && sym2 == lsymbol_Bool) || - (sym2 == lsymbol_bool && sym1 == lsymbol_Bool)) - { - return TRUE; - } - - return FALSE; -} - -/*@only@*/ cstring -iterNode_unparse (/*@null@*/ iterNode i) -{ - if (i != (iterNode) 0) - { - return (message ("iter %s %q", ltoken_unparse (i->name), - paramNodeList_unparse (i->params))); - } - return cstring_undefined; -} - - -/*@only@*/ cstring -fcnNode_unparse (/*@null@*/ fcnNode f) -{ - if (f != (fcnNode) 0) - { - return (message ("%q %q%q{\n%q%q%q%q%q%q}\n", - lclTypeSpecNode_unparse (f->typespec), - declaratorNode_unparse (f->declarator), - varDeclarationNodeList_unparse (f->globals), - varDeclarationNodeList_unparse (f->inits), - letDeclNodeList_unparse (f->lets), - lclPredicateNode_unparse (f->require), - modifyNode_unparse (f->modify), - lclPredicateNode_unparse (f->ensures), - lclPredicateNode_unparse (f->claim))); - } - return cstring_undefined; -} - -/*@only@*/ cstring -varDeclarationNode_unparse (/*@null@*/ varDeclarationNode x) -{ - if (x != (varDeclarationNode) 0) - { - cstring st; - - if (x->isSpecial) - { - return (sRef_unparse (x->sref)); - } - else - { - switch (x->qualifier) - { - case QLF_NONE: - st = cstring_undefined; - break; - case QLF_CONST: - st = cstring_makeLiteral ("const "); - break; - case QLF_VOLATILE: - st = cstring_makeLiteral ("volatile "); - break; - BADDEFAULT; - } - - st = message ("%q%q %q", st, lclTypeSpecNode_unparse (x->type), - initDeclNodeList_unparse (x->decls)); - return (st); - } - } - - return cstring_undefined; -} - -/*@only@*/ cstring -typeNode_unparse (/*@null@*/ typeNode t) -{ - if (t != (typeNode) 0) - { - switch (t->kind) - { - case TK_ABSTRACT: - return (abstractNode_unparse (t->content.abstract)); - case TK_EXPOSED: - return (exposedNode_unparse (t->content.exposed)); - case TK_UNION: - return (taggedUnionNode_unparse (t->content.taggedunion)); - default: - llfatalbug (message ("typeNode_unparse: unknown kind: %d", (int)t->kind)); - } - } - return cstring_undefined; -} - -/*@only@*/ cstring -constDeclarationNode_unparse (/*@null@*/ constDeclarationNode x) -{ - if (x != (constDeclarationNode) 0) - { - return (message ("constant %q %q", lclTypeSpecNode_unparse (x->type), - initDeclNodeList_unparse (x->decls))); - } - - return cstring_undefined; -} - -/*@only@*/ storeRefNode -makeStoreRefNodeTerm (/*@only@*/ termNode t) -{ - storeRefNode x = (storeRefNode) dmalloc (sizeof (*x)); - - x->kind = SRN_TERM; - x->content.term = t; - return (x); -} - -/*@only@*/ storeRefNode -makeStoreRefNodeType (/*@only@*/ lclTypeSpecNode t, bool isObj) -{ - storeRefNode x = (storeRefNode) dmalloc (sizeof (*x)); - - x->kind = isObj ? SRN_OBJ : SRN_TYPE; - x->content.type = t; - return (x); -} - -storeRefNode -makeStoreRefNodeInternal (void) -{ - storeRefNode x = (storeRefNode) dmalloc (sizeof (*x)); - - x->kind = SRN_SPECIAL; - x->content.ref = sRef_makeInternalState (); - return (x); -} - -storeRefNode -makeStoreRefNodeSystem (void) -{ - storeRefNode x = (storeRefNode) dmalloc (sizeof (*x)); - - x->kind = SRN_SPECIAL; - x->content.ref = sRef_makeSystemState (); - return (x); -} - -/*@only@*/ modifyNode -makeModifyNodeSpecial (/*@only@*/ ltoken t, bool modifiesNothing) -{ - modifyNode x = (modifyNode) dmalloc (sizeof (*x)); - - x->tok = t; - x->modifiesNothing = modifiesNothing; - x->hasStoreRefList = FALSE; - return (x); -} - -/*@only@*/ modifyNode -makeModifyNodeRef (/*@only@*/ ltoken t, /*@only@*/ storeRefNodeList y) -{ - modifyNode x = (modifyNode) dmalloc (sizeof (*x)); - sort sort; - - x->tok = t; - x->hasStoreRefList = TRUE; - x->modifiesNothing = FALSE; - x->list = y; - /* check that all storeRef's are modifiable */ - - storeRefNodeList_elements (y, sr) - { - if (storeRefNode_isTerm (sr)) - { - sort = sr->content.term->sort; - - if (!sort_mutable (sort) && sort_isValidSort (sort)) - { - ltoken errtok = termNode_errorToken (sr->content.term); - lclerror (errtok, - message ("Term denoting immutable object used in modifies list: %q", - termNode_unparse (sr->content.term))); - } - } - else - { - if (!storeRefNode_isSpecial (sr)) - { - sort = lclTypeSpecNode2sort (sr->content.type); - - if (storeRefNode_isObj (sr)) - { - sort = sort_makeObj (sort); - } - - if (!sort_mutable (sort)) - { - ltoken errtok = lclTypeSpecNode_errorToken (sr->content.type); - lclerror (errtok, - message ("Immutable type used in modifies list: %q", - sort_unparse (sort))); - } - } - } - } end_storeRefNodeList_elements; - return (x); -} - -/*@observer@*/ ltoken -termNode_errorToken (/*@null@*/ termNode n) -{ - if (n != (termNode) 0) - { - switch (n->kind) - { - case TRM_LITERAL: - case TRM_UNCHANGEDALL: - case TRM_UNCHANGEDOTHERS: - case TRM_SIZEOF: - case TRM_CONST: - case TRM_VAR: - case TRM_ZEROARY: /* also the default kind, when no in symbol table */ - return n->literal; - case TRM_QUANTIFIER: - return n->quantified->open; - case TRM_APPLICATION: - if (n->name != NULL) - { - if (n->name->isOpId) - { - return n->name->content.opid; - } - else - { - llassert (n->name->content.opform != NULL); - return n->name->content.opform->tok; - } - } - else - { - return ltoken_undefined; - } - } - } - return ltoken_undefined; -} - -/*@observer@*/ ltoken -nameNode_errorToken (/*@null@*/ nameNode nn) -{ - if (nn != (nameNode) 0) - { - if (nn->isOpId) - { - return nn->content.opid; - } - else - { - if (nn->content.opform != NULL) - { - return nn->content.opform->tok; - } - } - } - - return ltoken_undefined; -} - -/*@observer@*/ ltoken -lclTypeSpecNode_errorToken (/*@null@*/ lclTypeSpecNode t) -{ - if (t != (lclTypeSpecNode) 0) - { - switch (t->kind) - { - case LTS_TYPE: - { - llassert (t->content.type != NULL); - - if (ltokenList_empty (t->content.type->ctypes)) - break; - else - return (ltokenList_head (t->content.type->ctypes)); - } - case LTS_STRUCTUNION: - llassert (t->content.structorunion != NULL); - return t->content.structorunion->tok; - case LTS_ENUM: - llassert (t->content.enumspec != NULL); - return t->content.enumspec->tok; - case LTS_CONJ: - return (lclTypeSpecNode_errorToken (t->content.conj->a)); - } - } - - return ltoken_undefined; -} - -static bool -sort_member_modulo_cstring (sort s, /*@null@*/ termNode t) -{ - - if (t != (termNode) 0) - { - if (t->kind == TRM_LITERAL) - { /* allow multiple types */ - sortNode sn; - - sortSet_elements (t->possibleSorts, el) - { - if (sort_compatible_modulo_cstring (s, el)) - { - return TRUE; - } - } end_sortSet_elements; - - sn = sort_lookup (s); - - if (sn.kind == SRT_PTR) - { - char *lit = lsymbol_toChars (ltoken_getText (t->literal)); - - if (lit != NULL) - { - long val = 0; - - if (sscanf (lit, "%ld", &val) == 1) - { - if (val == 0) return TRUE; - } - } - } - - return FALSE; - } - else - { - return sort_compatible_modulo_cstring (s, t->sort); - } - } - return FALSE; -} - -/*@only@*/ letDeclNode - makeLetDeclNode (ltoken varid, /*@only@*/ /*@null@*/ lclTypeSpecNode t, - /*@only@*/ termNode term) -{ - letDeclNode x = (letDeclNode) dmalloc (sizeof (*x)); - varInfo vi = (varInfo) dmalloc (sizeof (*vi)); - ltoken errtok; - sort s, termsort; - - if (t != (lclTypeSpecNode) 0) - { - /* check varid has the same sort as term */ - s = lclTypeSpecNode2sort (t); - termsort = term->sort; - /* should keep the arguments in order */ - if (!sort_member_modulo_cstring (s, term) && - !term->error_reported) - { - errtok = termNode_errorToken (term); - - /* errorShowPoint (tsource_thisLine (lclsource), ltoken_getCol (errtok)); */ - /* sprintf (ERRMSG, "expect `%s' type but given term has `%s' type", - sort_unparse (s), sort_unparse (termsort)); */ - - lclerror (errtok, - message ("Let declaration expects type %q", sort_unparse (s))); - /* evs --- don't know how to generated this message or what it means? */ - } - } - else - { - s = term->sort; - } - /* assign variable its type and sort, store in symbol table */ - vi->id = ltoken_copy (varid); - vi->kind = VRK_LET; - vi->sort = s; - vi->export = TRUE; - - (void) symtable_enterVar (g_symtab, vi); - varInfo_free (vi); - - x->varid = varid; - x->sortspec = t; - x->term = term; - x->sort = sort_makeNoSort (); - - return (x); -} - -/*@only@*/ programNode -makeProgramNodeAction (/*@only@*/ programNodeList x, actionKind k) -{ - programNode n = (programNode) dmalloc (sizeof (*n)); - n->wrapped = 0; - n->kind = k; - n->content.args = x; - return (n); -} - -/*@only@*/ programNode -makeProgramNode (/*@only@*/ stmtNode x) -{ - programNode n = (programNode) dmalloc (sizeof (*n)); - - n->wrapped = 0; - n->kind = ACT_SELF; - n->content.self = x; - return (n); -} - -/*@only@*/ typeNode -makeAbstractTypeNode (/*@only@*/ abstractNode x) -{ - typeNode n = (typeNode) dmalloc (sizeof (*n)); - - n->kind = TK_ABSTRACT; - n->content.abstract = x; - - return (n); -} - -/*@only@*/ typeNode -makeExposedTypeNode (/*@only@*/ exposedNode x) -{ - typeNode n = (typeNode) dmalloc (sizeof (*n)); - - n->kind = TK_EXPOSED; - n->content.exposed = x; - return (n); -} - -/* -** evs added 8 Sept 1993 -*/ - -/*@only@*/ importNode -importNode_makePlain (/*@only@*/ ltoken t) -{ - importNode imp = (importNode) dmalloc (sizeof (*imp)); - - imp->kind = IMPPLAIN; - imp->val = t; - return (imp); -} - -/*@only@*/ importNode -importNode_makeBracketed (/*@only@*/ ltoken t) -{ - importNode imp = (importNode) dmalloc (sizeof (*imp)); - - imp->kind = IMPBRACKET; - imp->val = t; - return (imp); -} - -static cstring extractQuote (/*@only@*/ cstring s) -{ - int len = cstring_length (s); - char *sc = cstring_toCharsSafe (s); - cstring t; - - llassert (len > 1); - *(sc + len - 1) = '\0'; - t = cstring_fromChars (mstring_copy (sc + 1)); - cstring_free (s); - return (t); -} - -/*@only@*/ importNode -importNode_makeQuoted (/*@only@*/ ltoken t) -{ - importNode imp = (importNode) dmalloc (sizeof (*imp)); - cstring q = extractQuote (cstring_copy (ltoken_getRawString (t))); - - imp->kind = IMPQUOTE; - - ltoken_setRawText (t, lsymbol_fromChars (cstring_toCharsSafe (q))); - - imp->val = t; - - cstring_free (q); - return (imp); -} - -/* -** check that is it '<' and '>' -** should probably be in a different file? -*/ - -static void cylerror (/*@only@*/ char *s) -{ - ylerror(s); - sfree (s); -} - -void -checkBrackets (ltoken lb, ltoken rb) -{ - /* no attempt at error recovery...not really necessary */ - cstring tname; - - tname = ltoken_getRawString (lb); - - if (!cstring_equalLit (tname, "<")) - { - cylerror (cstring_toCharsSafeO (message ("Invalid import token: %s", tname))); - } - - tname = ltoken_getRawString (rb); - - if (!cstring_equalLit (tname, ">")) - { - cylerror (cstring_toCharsSafeO (message ("Invalid import token: %s", tname))); - } -} - -/*@only@*/ traitRefNode -makeTraitRefNode (/*@only@*/ ltokenList fl, /*@only@*/ renamingNode r) -{ - traitRefNode n = (traitRefNode) dmalloc (sizeof (*n)); - - n->traitid = fl; - n->rename = r; - return (n); -} - -/* -** printLeaves: no commas -*/ - -static /*@only@*/ cstring -printLeaves (ltokenList f) -{ - bool firstone = TRUE; - cstring s = cstring_undefined; - - ltokenList_elements (f, i) - { - if (firstone) - { - s = cstring_copy (ltoken_unparse (i)); - firstone = FALSE; - } - else - { - s = message ("%q %s", s, ltoken_unparse (i)); - } - } end_ltokenList_elements; - - return s; -} - - -/*@only@*/ cstring -printLeaves2 (ltokenList f) -{ - return (ltokenList_unparse (f)); -} - -/*@only@*/ cstring -printRawLeaves2 (ltokenList f) -{ - bool first = TRUE; - cstring s = cstring_undefined; - - ltokenList_elements (f, i) - { - if (first) - { - s = message ("%s", ltoken_getRawString (i)); - first = FALSE; - } - else - s = message ("%q, %s", s, ltoken_getRawString (i)); - } end_ltokenList_elements; - - return s; -} - -/*@only@*/ renamingNode -makeRenamingNode (/*@only@*/ typeNameNodeList n, /*@only@*/ replaceNodeList r) -{ - renamingNode ren = (renamingNode) dmalloc (sizeof (*ren)); - - if (typeNameNodeList_empty (n)) - { - ren->is_replace = TRUE; - ren->content.replace = r; - typeNameNodeList_free (n); - } - else - { - nameAndReplaceNode nr = (nameAndReplaceNode) dmalloc (sizeof (*nr)); - nr->replacelist = r; - nr->namelist = n; - ren->is_replace = FALSE; - ren->content.name = nr; - } - - return (ren); -} - -/*@only@*/ cstring -renamingNode_unparse (/*@null@*/ renamingNode x) -{ - if (x != (renamingNode) 0) - { - if (x->is_replace) - { - return (replaceNodeList_unparse (x->content.replace)); - } - else - { - return (message ("%q%q", typeNameNodeList_unparse (x->content.name->namelist), - replaceNodeList_unparse (x->content.name->replacelist))); - } - } - return cstring_undefined; -} - -/*@only@*/ replaceNode -makeReplaceNameNode (ltoken t, typeNameNode tn, nameNode nn) -{ - replaceNode r = (replaceNode) dmalloc (sizeof (*r)); - - r->tok = t; - r->isCType = FALSE; - r->typename = tn; - r->content.renamesortname.name = nn; - r->content.renamesortname.signature = (sigNode)NULL; - - return (r); -} - -/*@only@*/ replaceNode -makeReplaceNode (ltoken t, typeNameNode tn, - bool is_ctype, ltoken ct, - nameNode nn, sigNode sn) -{ - replaceNode r = (replaceNode) dmalloc (sizeof (*r)); - - r->tok = t; - r->isCType = is_ctype; - r->typename = tn; - - if (is_ctype) - { - r->content.ctype = ct; - sigNode_free (sn); - nameNode_free (nn); - } - else - { - r->content.renamesortname.name = nn; - r->content.renamesortname.signature = sn; - ltoken_free (ct); - } - - return (r); -} - -/*@only@*/ cstring -replaceNode_unparse (/*@null@*/ replaceNode x) -{ - if (x != (replaceNode) 0) - { - cstring st; - - st = message ("%q for ", typeNameNode_unparse (x->typename)); - - if (x->isCType) - { - st = message ("%q%s", st, ltoken_getRawString (x->content.ctype)); - } - else - { - st = message ("%q%q%q", st, nameNode_unparse (x->content.renamesortname.name), - sigNode_unparse (x->content.renamesortname.signature)); - } - return st; - } - return cstring_undefined; -} - -/*@only@*/ nameNode -makeNameNodeForm (/*@only@*/ /*@null@*/ opFormNode opform) -{ - nameNode nn = (nameNode) dmalloc (sizeof (*nn)); - - nn->isOpId = FALSE; - nn->content.opform = opform; - - return (nn); -} - -/*@only@*/ nameNode -makeNameNodeId (/*@only@*/ ltoken opid) -{ - nameNode nn = (nameNode) dmalloc (sizeof (*nn)); - - /* - ** current LSL -syms output bug produces "if_then_else_" rather - ** than 6 separate tokens - */ - - if (ltoken_getText (opid) == ConditionalSymbol) - { - opFormNode opform = makeOpFormNode (ltoken_undefined, OPF_IF, - opFormUnion_createMiddle (0), - ltoken_undefined); - nn->isOpId = FALSE; - nn->content.opform = opform; - ltoken_free (opid); - } - else - { - nn->isOpId = TRUE; - nn->content.opid = opid; - } - - return (nn); -} - -/*@only@*/ cstring -nameNode_unparse (/*@null@*/ nameNode n) -{ - if (n != (nameNode) 0) - { - if (n->isOpId) - { - return (cstring_copy (ltoken_getRawString (n->content.opid))); /*!!!*/ - } - else - { - return (opFormNode_unparse (n->content.opform)); - } - } - return cstring_undefined; -} - -/*@only@*/ sigNode -makesigNode (ltoken t, /*@only@*/ ltokenList domain, ltoken range) -{ - sigNode s = (sigNode) dmalloc (sizeof (*s)); - unsigned int key; - - /* - ** Assign a hash key here to speed up lookup of operators. - */ - - s->tok = t; - s->domain = domain; - s->range = range; - key = MASH (0, ltoken_getText (range)); - - ltokenList_elements (domain, id) - { - lsymbol sym = ltoken_getText (id); - key = MASH (key, sym); - } end_ltokenList_elements; - - s->key = key; - return (s); -} - -cstring sigNode_unparse (/*@null@*/ sigNode n) -{ - if (n != (sigNode) 0) - { - return (message (":%q -> %s", printLeaves2 (n->domain), - ltoken_unparse (n->range))); - } - - return cstring_undefined; -} - -void sigNode_markOwned (sigNode n) -{ - sfreeEventually (n); -} - -/*@only@*/ cstring -sigNode_unparseText (/*@null@*/ sigNode n) -{ - if (n != (sigNode) 0) - { - return (message ("%q -> %s", printLeaves2 (n->domain), - ltoken_unparse (n->range))); - } - return cstring_undefined; -} - -static unsigned int - opFormNode2key (opFormNode op, opFormKind k) -{ - unsigned int key; - - switch (k) - { - case OPF_IF: - /* OPF_IF is the first enum, so it's 0 */ - - /*@-type@*/ - key = MASH (k, k + 1); - /*@=type@*/ - - break; - case OPF_ANYOP: - case OPF_MANYOP: - case OPF_ANYOPM: - case OPF_MANYOPM: - { /* treat eq and = the same */ - lsymbol sym = ltoken_getText (op->content.anyop); - - if (sym == equalSymbol) - { - key = MASH (k, eqSymbol); - } - else - { - key = MASH (k, ltoken_getText (op->content.anyop)); - } - break; - } - case OPF_MIDDLE: - case OPF_MMIDDLE: - case OPF_MIDDLEM: - case OPF_MMIDDLEM: - case OPF_BMIDDLE: - case OPF_BMMIDDLE: - case OPF_BMIDDLEM: - case OPF_BMMIDDLEM: - key = MASH (k, op->content.middle); - key = MASH (key, ltoken_getRawText (op->tok)); - break; - case OPF_SELECT: - case OPF_MAP: - case OPF_MSELECT: - case OPF_MMAP: - key = MASH (k, ltoken_getRawText (op->content.id)); - break; - default: - key = 0; - } - - return key; -} - -/*@only@*/ opFormNode -makeOpFormNode (ltoken t, opFormKind k, opFormUnion u, - ltoken close) -{ - opFormNode n = (opFormNode) dmalloc (sizeof (*n)); - unsigned int key = 0; - - /* - ** Assign a hash key here to speed up lookup of operators. - */ - - n->tok = t; - n->close = close; - n->kind = k; - - - switch (k) - { - case OPF_IF: - n->content.middle = 0; - /* OPF_IF is the first enum, so it's 0 */ - key = MASH /*@+enumint@*/ (k, k + 1) /*@=enumint@*/; - break; - case OPF_ANYOP: - case OPF_MANYOP: - case OPF_ANYOPM: - case OPF_MANYOPM: - { /* treat eq and = the same */ - lsymbol sym = ltoken_getText (u.anyop); - - if (sym == equalSymbol) - { - key = MASH (k, eqSymbol); - } - else - { - key = MASH (k, ltoken_getText (u.anyop)); - } - - n->content = u; - break; - } - case OPF_MIDDLE: - case OPF_MMIDDLE: - case OPF_MIDDLEM: - case OPF_MMIDDLEM: - case OPF_BMIDDLE: - case OPF_BMMIDDLE: - case OPF_BMIDDLEM: - case OPF_BMMIDDLEM: - n->content = u; - key = MASH (k, u.middle); - key = MASH (key, ltoken_getRawText (t)); - break; - case OPF_SELECT: - case OPF_MAP: - case OPF_MSELECT: - case OPF_MMAP: - key = MASH (k, ltoken_getRawText (u.id)); - n->content = u; - break; - default: - { - llbug (message ("makeOpFormNode: unknown opFormKind: %d", (int) k)); - } - } - n->key = key; - return (n); -} - -static cstring printMiddle (int j) -{ - int i; - char *s = mstring_createEmpty (); - - for (i = j; i >= 1; i--) - { - s = mstring_concatFree1 (s, "__"); - - if (i != 1) - { - s = mstring_concatFree1 (s, ", "); - } - } - - return cstring_fromCharsO (s); -} - -/*@only@*/ cstring -opFormNode_unparse (/*@null@*/ opFormNode n) -{ - if (n != (opFormNode) 0) - { - switch (n->kind) - { - case OPF_IF: - return (cstring_makeLiteral ("if __ then __ else __ ")); - case OPF_ANYOP: - return (cstring_copy (ltoken_getRawString (n->content.anyop))); - case OPF_MANYOP: - return (message ("__ %s", ltoken_getRawString (n->content.anyop))); - case OPF_ANYOPM: - return (message ("%s __ ", ltoken_getRawString (n->content.anyop))); - case OPF_MANYOPM: - return (message ("__ %s __ ", ltoken_getRawString (n->content.anyop))); - case OPF_MIDDLE: - return (message ("%s %q %s", - ltoken_getRawString (n->tok), - printMiddle (n->content.middle), - ltoken_getRawString (n->close))); - case OPF_MMIDDLE: - return (message ("__ %s %q %s", - ltoken_getRawString (n->tok), - printMiddle (n->content.middle), - ltoken_getRawString (n->close))); - case OPF_MIDDLEM: - return (message ("%s %q %s __", - ltoken_getRawString (n->tok), - printMiddle (n->content.middle), - ltoken_getRawString (n->close))); - case OPF_MMIDDLEM: - return (message ("__ %s%q %s __", - ltoken_getRawString (n->tok), - printMiddle (n->content.middle), - ltoken_getRawString (n->close))); - case OPF_BMIDDLE: - return (message ("[%q]", printMiddle (n->content.middle))); - case OPF_BMMIDDLE: - return (message ("__ [%q]", printMiddle (n->content.middle))); - case OPF_BMIDDLEM: - return (message ("[%q] __", printMiddle (n->content.middle))); - case OPF_BMMIDDLEM: - return (message ("__ [%q] __", printMiddle (n->content.middle))); - case OPF_SELECT: - return (message (" \\select %s", ltoken_getRawString (n->content.id))); - case OPF_MAP: - return (message (" \\field_arrow%s", ltoken_getRawString (n->content.id))); - case OPF_MSELECT: - return (message ("__ \\select %s", ltoken_getRawString (n->content.id))); - case OPF_MMAP: - return (message ("__ \\field_arrow %s", ltoken_getRawString (n->content.id))); - default: - llfatalbug (message ("opFormNodeUnparse: unknown kind: %d", - (int) n->kind)); - } - } - return cstring_undefined; -} - -/*@only@*/ typeNameNode -makeTypeNameNode (bool isObj, lclTypeSpecNode t, abstDeclaratorNode n) -{ - typeNameNode tn = (typeNameNode) dmalloc (sizeof (*tn)); - typeNamePack p = (typeNamePack) dmalloc (sizeof (*p)); - - tn->isTypeName = TRUE; - p->isObj = isObj; - p->type = t; - p->abst = n; - tn->opform = (opFormNode) 0; - tn->typename = p; - return (tn); -} - -/*@only@*/ typeNameNode -makeTypeNameNodeOp (opFormNode n) -{ - typeNameNode t = (typeNameNode) dmalloc (sizeof (*t)); - t->typename = (typeNamePack) 0; - t->opform = n; - t->isTypeName = FALSE; - return (t); -} - -/*@only@*/ cstring -typeNameNode_unparse (/*@null@*/ typeNameNode n) -{ - if (n != (typeNameNode) 0) - { - if (n->isTypeName) - { - cstring st = cstring_undefined; - typeNamePack p = n->typename; - - llassert (p != NULL); - - if (p->isObj) - st = cstring_makeLiteral ("obj "); - - return (message ("%q%q%q", st, lclTypeSpecNode_unparse (p->type), - abstDeclaratorNode_unparse (p->abst))); - - } - else - return (opFormNode_unparse (n->opform)); - } - return cstring_undefined; -} - -/*@only@*/ lclTypeSpecNode -makeLclTypeSpecNodeConj (/*@null@*/ lclTypeSpecNode a, /*@null@*/ lclTypeSpecNode b) -{ - lclTypeSpecNode n = (lclTypeSpecNode) dmalloc (sizeof (*n)); - - n->kind = LTS_CONJ; - n->pointers = 0; - n->quals = qualList_new (); - n->content.conj = (lclconj) dmalloc (sizeof (*n->content.conj)); - n->content.conj->a = a; - n->content.conj->b = b; - - return (n); -} - -/*@only@*/ lclTypeSpecNode -makeLclTypeSpecNodeType (/*@null@*/ CTypesNode x) -{ - lclTypeSpecNode n = (lclTypeSpecNode) dmalloc (sizeof (*n)); - - n->kind = LTS_TYPE; - n->pointers = 0; - n->content.type = x; - n->quals = qualList_new (); - return (n); -} - -/*@only@*/ lclTypeSpecNode -makeLclTypeSpecNodeSU (/*@null@*/ strOrUnionNode x) -{ - lclTypeSpecNode n = (lclTypeSpecNode) dmalloc (sizeof (*n)); - - n->kind = LTS_STRUCTUNION; - n->pointers = 0; - n->content.structorunion = x; - n->quals = qualList_new (); - return (n); -} - -/*@only@*/ lclTypeSpecNode -makeLclTypeSpecNodeEnum (/*@null@*/ enumSpecNode x) -{ - lclTypeSpecNode n = (lclTypeSpecNode) dmalloc (sizeof (*n)); - - n->quals = qualList_new (); - n->kind = LTS_ENUM; - n->pointers = 0; - n->content.enumspec = x; - return (n); -} - -lclTypeSpecNode -lclTypeSpecNode_addQual (lclTypeSpecNode n, qual q) -{ - llassert (lclTypeSpecNode_isDefined (n)); - n->quals = qualList_add (n->quals, q); - return n; -} - -/*@only@*/ cstring -lclTypeSpecNode_unparse (/*@null@*/ lclTypeSpecNode n) -{ - if (n != (lclTypeSpecNode) 0) - { - switch (n->kind) - { - case LTS_TYPE: - llassert (n->content.type != NULL); - return (printLeaves (n->content.type->ctypes)); - case LTS_STRUCTUNION: - return (strOrUnionNode_unparse (n->content.structorunion)); - case LTS_ENUM: - return (enumSpecNode_unparse (n->content.enumspec)); - case LTS_CONJ: - return (lclTypeSpecNode_unparse (n->content.conj->a)); - default: - llfatalbug (message ("lclTypeSpecNode_unparse: unknown lclTypeSpec kind: %d", - (int) n->kind)); - } - } - return cstring_undefined; -} - -/*@only@*/ enumSpecNode -makeEnumSpecNode (ltoken t, ltoken optTagId, - /*@owned@*/ ltokenList enums) -{ - enumSpecNode n = (enumSpecNode) dmalloc (sizeof (*n)); - tagInfo ti; - smemberInfo *top = smemberInfo_undefined; - - n->tok = t; - n->opttagid = ltoken_copy (optTagId); - n->enums = enums; - - /* generate sort for this LCL type */ - n->sort = sort_makeEnum (optTagId); - - if (!ltoken_isUndefined (optTagId)) - { - /* First, check to see if tag is already defined */ - ti = symtable_tagInfo (g_symtab, ltoken_getText (optTagId)); - - if (tagInfo_exists (ti)) - { - if (ti->kind == TAG_ENUM) - { - /* 23 Sep 1995 --- had been noting here...is this right? */ - - ti->content.enums = enums; - ti->sort = n->sort; - ti->imported = context_inImport (); - } - else - { - lclerror (optTagId, - message ("Tag %s previously defined as %q, redefined as enum", - ltoken_getRawString (optTagId), - tagKind_unparse (ti->kind))); - - /* evs --- shouldn't they be in different name spaces? */ - } - - ltoken_free (optTagId); - } - else - { - ti = (tagInfo) dmalloc (sizeof (*ti)); - - ti->kind = TAG_ENUM; - ti->id = optTagId; - ti->content.enums = enums; - ti->sort = n->sort; - ti->imported = context_inImport (); - /* First, store tag info in symbol table */ - (void) symtable_enterTag (g_symtab, ti); - } - } - - /* check that enumeration constants are unique */ - - ltokenList_reset (enums); - - while (!ltokenList_isFinished (enums)) - { - ltoken c = ltokenList_current (enums); - smemberInfo *ei = (smemberInfo *) dmalloc (sizeof (*ei)); - - ei->name = ltoken_getText (c); - ei->next = top; - ei->sort = n->sort; - top = ei; - - if (!varInfo_exists (symtable_varInfo (g_symtab, ltoken_getText (c)))) - { /* put info into symbol table */ - varInfo vi = (varInfo) dmalloc (sizeof (*vi)); - - vi->id = ltoken_copy (c); - vi->kind = VRK_ENUM; - vi->sort = n->sort; - vi->export = TRUE; - - (void) symtable_enterVar (g_symtab, vi); - varInfo_free (vi); - } - else - { - lclerror (c, message ("Enumerated value redeclared: %s", - ltoken_getRawString (c))); - ltokenList_removeCurrent (enums); - } - ltokenList_advance (enums); - /*@-branchstate@*/ - } - /*@=branchstate@*/ - - (void) sort_updateEnum (n->sort, top); - return (n); -} - -/*@only@*/ enumSpecNode -makeEnumSpecNode2 (ltoken t, ltoken tagid) -{ - /* a reference, not a definition */ - enumSpecNode n = (enumSpecNode) dmalloc (sizeof (*n)); - tagInfo ti = symtable_tagInfo (g_symtab, ltoken_getText (tagid)); - - n->tok = t; - n->opttagid = tagid; - n->enums = ltokenList_new (); - - if (tagInfo_exists (ti)) - { - if (ti->kind == TAG_ENUM) - { - n->sort = ti->sort; - } - else - { - n->sort = sort_makeNoSort (); - lclerror (tagid, message ("Tag %s defined as %q, used as enum", - ltoken_getRawString (tagid), - tagKind_unparse (ti->kind))); - } - } - else - { - n->sort = sort_makeNoSort (); - lclerror (t, message ("Undefined type: enum %s", - ltoken_getRawString (tagid))); - } - - return (n); -} - -/*@only@*/ cstring -enumSpecNode_unparse (/*@null@*/ enumSpecNode n) -{ - if (n != (enumSpecNode) 0) - { - cstring s = cstring_makeLiteral ("enum "); - - if (!ltoken_isUndefined (n->opttagid)) - { - s = message ("%q%s ", s, ltoken_getRawString (n->opttagid)); - } - - s = message ("%q{%q}", s, printLeaves2 (n->enums)); - return s; - } - return cstring_undefined; -} - -/*@only@*/ strOrUnionNode -makestrOrUnionNode (ltoken str, suKind k, ltoken opttagid, - /*@only@*/ stDeclNodeList x) -{ - strOrUnionNode n = (strOrUnionNode) dmalloc (sizeof (*n)); - lsymbolSet set = lsymbolSet_new (); - declaratorNodeList declarators; - sort fieldsort, tsort1, tsort2; - smemberInfo *mi, *top = smemberInfo_undefined; - bool doTag = FALSE; - bool isStruct = (k == SU_STRUCT); - tagInfo t; - - - n->kind = k; - n->tok = str; - n->opttagid = ltoken_copy (opttagid); - n->structdecls = x; - n->sort = isStruct ? sort_makeStr (opttagid) : sort_makeUnion (opttagid); - - if (!ltoken_isUndefined (opttagid)) - { - /* First, check to see if tag is already defined */ - t = symtable_tagInfo (g_symtab, ltoken_getText (opttagid)); - - if (tagInfo_exists (t)) - { - if ((t->kind == TAG_FWDUNION && k == SU_UNION) || - (t->kind == TAG_FWDSTRUCT && k == SU_STRUCT)) - { - /* to allow self-recursive types and forward tag declarations */ - t->content.decls = stDeclNodeList_copy (x); /* update tag info */ - t->sort = n->sort; - } - else - { - lclerror (opttagid, - message ("Tag %s previously defined as %q, used as %q", - ltoken_getRawString (opttagid), - tagKind_unparse (t->kind), - cstring_makeLiteral (isStruct ? "struct" : "union"))); - } - } - else - { - doTag = TRUE; - } - } - else - { - doTag = TRUE; - } - - if (doTag && !ltoken_isUndefined (opttagid)) - { - t = (tagInfo) dmalloc (sizeof (*t)); - - /* can either override prev defn or use prev defn */ - /* override it so as to detect more errors */ - - t->kind = (k == SU_STRUCT) ? TAG_STRUCT : TAG_UNION; - t->id = opttagid; - t->content.decls = stDeclNodeList_copy (x); - t->sort = n->sort; - t->imported = FALSE; - - /* Next, update tag info in symbol table */ - (void) symtable_enterTagForce (g_symtab, t); - } - - /* check no duplicate field names */ - - stDeclNodeList_elements (x, i) - { - fieldsort = lclTypeSpecNode2sort (i->lcltypespec); - - /* need the locations, not values */ - /* fieldsort = sort_makeObj (fieldsort); */ - /* 2/19/93, was - fieldsort = sort_makeGlobal (fieldsort); */ - - declarators = i->declarators; - - declaratorNodeList_elements (declarators, decl) - { - lsymbol fieldname; - mi = (smemberInfo *) dmalloc (sizeof (*mi)); - /* need to make dynamic copies */ - fieldname = ltoken_getText (decl->id); - - /* 2/19/93, added */ - tsort1 = typeExpr2ptrSort (fieldsort, decl->type); - tsort2 = sort_makeGlobal (tsort1); - - mi->name = fieldname; - mi->sort = tsort2; /* fieldsort; */ - mi->next = top; - top = mi; - - if (lsymbolSet_member (set, fieldname)) - { - lclerror (decl->id, - message ("Field name reused: %s", - ltoken_getRawString (decl->id))); - } - else - { - (void) lsymbolSet_insert (set, fieldname); - } - /*@-branchstate@*/ - } end_declaratorNodeList_elements; - /*@=branchstate@*/ - } end_stDeclNodeList_elements; - - if (k == SU_STRUCT) - { - (void) sort_updateStr (n->sort, top); - } - else - { - (void) sort_updateUnion (n->sort, top); - } - - /* We shall keep the info with both tags and types if any - of them are present. */ - - lsymbolSet_free (set); - - return (n); -} - -/*@only@*/ strOrUnionNode -makeForwardstrOrUnionNode (ltoken str, suKind k, - ltoken tagid) -{ - strOrUnionNode n = (strOrUnionNode) dmalloc (sizeof (*n)); - sort sort = sort_makeNoSort (); - tagInfo t; - - /* a reference, not a definition */ - - n->kind = k; - n->tok = str; - n->opttagid = tagid; - n->structdecls = stDeclNodeList_new (); - - /* get sort for this LCL type */ - t = symtable_tagInfo (g_symtab, ltoken_getText (tagid)); - - if (tagInfo_exists (t)) - { - sort = t->sort; - - if (!(((t->kind == TAG_STRUCT || t->kind == TAG_FWDSTRUCT) && k == SU_STRUCT) - || ((t->kind == TAG_UNION || t->kind == TAG_FWDUNION) && k == SU_UNION))) - { - lclerror (tagid, - message ("Tag %s previously defined as %q, used as %q", - ltoken_getRawString (tagid), - tagKind_unparse (t->kind), - cstring_makeLiteral ((k == SU_STRUCT) ? "struct" : "union"))); - } - } - else - { - /* - ** changed from error: 31 Mar 1994 - ** - ** lclerror (str, message ("Undefined type: %s %s", s, ltoken_getRawString (tagid)); - ** - */ - - /* forward struct's and union's are ok... */ - - if (k == SU_STRUCT) - { - (void) checkAndEnterTag (TAG_FWDSTRUCT, ltoken_copy (tagid)); - lhForwardStruct (tagid); - sort = sort_makeStr (tagid); - } - else - { - (void) checkAndEnterTag (TAG_FWDUNION, ltoken_copy (tagid)); - lhForwardUnion (tagid); - sort = sort_makeUnion (tagid); - } - } - - n->sort = sort; - return (n); -} - -/*@only@*/ cstring -strOrUnionNode_unparse (/*@null@*/ strOrUnionNode n) -{ - if (n != (strOrUnionNode) 0) - { - cstring s; - switch (n->kind) - { - case SU_STRUCT: - s = cstring_makeLiteral ("struct "); - break; - case SU_UNION: - s = cstring_makeLiteral ("union "); - break; - BADDEFAULT - } - - if (!ltoken_isUndefined (n->opttagid)) - { - s = message ("%q%s ", s, ltoken_getRawString (n->opttagid)); - } - s = message ("%q{%q}", s, stDeclNodeList_unparse (n->structdecls)); - return s; - } - return cstring_undefined; -} - -/*@only@*/ stDeclNode -makestDeclNode (lclTypeSpecNode s, - declaratorNodeList x) -{ - stDeclNode n = (stDeclNode) dmalloc (sizeof (*n)); - - n->lcltypespec = s; - n->declarators = x; - return n; -} - -/*@only@*/ typeExpr -makeFunctionNode (typeExpr x, paramNodeList p) -{ - typeExpr y = (typeExpr) dmalloc (sizeof (*y)); - - y->wrapped = 0; - y->kind = TEXPR_FCN; - y->content.function.returntype = x; - y->content.function.args = p; - y->sort = sort_makeNoSort (); - - return (y); -} - -static /*@observer@*/ ltoken - extractDeclarator (/*@null@*/ typeExpr t) -{ - if (t != (typeExpr) 0) - { - switch (t->kind) - { - case TEXPR_BASE: - return t->content.base; - case TEXPR_PTR: - return (extractDeclarator (t->content.pointer)); - case TEXPR_ARRAY: - return (extractDeclarator (t->content.array.elementtype)); - case TEXPR_FCN: - return (extractDeclarator (t->content.function.returntype)); - } - } - - return ltoken_undefined; -} - -/*@only@*/ typeExpr -makeTypeExpr (ltoken t) -{ - typeExpr x = (typeExpr) dmalloc (sizeof (*x)); - - - x->wrapped = 0; - x->kind = TEXPR_BASE; - x->content.base = t; - x->sort = sort_makeNoSort (); - - return (x); -} - - -/*@only@*/ declaratorNode -makeDeclaratorNode (typeExpr t) -{ - declaratorNode x = (declaratorNode) dmalloc (sizeof (*x)); - - x->id = ltoken_copy (extractDeclarator (t)); - x->type = t; - x->isRedecl = FALSE; - - return (x); -} - -static /*@only@*/ declaratorNode -makeUnknownDeclaratorNode (/*@only@*/ ltoken t) -{ - declaratorNode x = (declaratorNode) dmalloc (sizeof (*x)); - - x->id = t; - x->type = (typeExpr) 0; - x->isRedecl = FALSE; - - return (x); -} - -static /*@only@*/ cstring -printTypeExpr2 (/*@null@*/ typeExpr x) -{ - paramNodeList params; - - if (x != (typeExpr) 0) - { - cstring s; /* print out types in reverse order */ - - switch (x->kind) - { - case TEXPR_BASE: - return (message ("%s ", ltoken_getRawString (x->content.base))); - case TEXPR_PTR: - return (message ("%qptr to ", printTypeExpr2 (x->content.pointer))); - case TEXPR_ARRAY: - return (message ("array[%q] of %q", - termNode_unparse (x->content.array.size), - printTypeExpr2 (x->content.array.elementtype))); - case TEXPR_FCN: - s = printTypeExpr2 (x->content.function.returntype); - params = x->content.function.args; - if (!paramNodeList_empty (params)) - { - s = message ("%qfcn with args: (%q)", s, - paramNodeList_unparse (x->content.function.args)); - } - else - s = message ("%qfcn with no args", s); - return s; - default: - llfatalbug (message ("printTypeExpr2: unknown typeExprKind: %d", (int) x->kind)); - } - } - return cstring_undefined; -} - -/*@only@*/ cstring -declaratorNode_unparse (declaratorNode x) -{ - return (typeExpr_unparse (x->type)); -} - -/*@only@*/ declaratorNode - declaratorNode_copy (declaratorNode x) -{ - declaratorNode ret = (declaratorNode) dmalloc (sizeof (*ret)); - - ret->type = typeExpr_copy (x->type); - ret->id = ltoken_copy (x->id); - ret->isRedecl = x->isRedecl; - - return (ret); -} - -static /*@null@*/ typeExpr typeExpr_copy (/*@null@*/ typeExpr x) -{ - if (x == NULL) - { - return NULL; - } - else - { - typeExpr ret = (typeExpr) dmalloc (sizeof (*ret)); - - ret->wrapped = x->wrapped; - ret->kind = x->kind; - - switch (ret->kind) - { - case TEXPR_BASE: - ret->content.base = ltoken_copy (x->content.base); - break; - case TEXPR_PTR: - ret->content.pointer = typeExpr_copy (x->content.pointer); - break; - case TEXPR_ARRAY: - ret->content.array.elementtype = typeExpr_copy (x->content.array.elementtype); - ret->content.array.size = termNode_copy (x->content.array.size); - break; - case TEXPR_FCN: - ret->content.function.returntype = typeExpr_copy (x->content.function.returntype); - ret->content.function.args = paramNodeList_copy (x->content.function.args); - break; - } - - ret->sort = x->sort; - return ret; - } -} - -static /*@only@*/ cstring - typeExpr_unparseCode (/*@null@*/ typeExpr x) -{ - /* print out types in order of appearance in source */ - cstring s = cstring_undefined; - - if (x != (typeExpr) 0) - { - switch (x->kind) - { - case TEXPR_BASE: - return (cstring_copy (ltoken_getRawString (x->content.base))); - case TEXPR_PTR: - return (typeExpr_unparseCode (x->content.pointer)); - case TEXPR_ARRAY: - return (typeExpr_unparseCode (x->content.array.elementtype)); - case TEXPR_FCN: - return (typeExpr_unparseCode (x->content.function.returntype)); - } - } - return s; -} - -void typeExpr_free (/*@only@*/ /*@null@*/ typeExpr x) -{ - if (x != (typeExpr) 0) - { - switch (x->kind) - { - case TEXPR_BASE: - break; - case TEXPR_PTR: - typeExpr_free (x->content.pointer); - break; - case TEXPR_ARRAY: - typeExpr_free (x->content.array.elementtype); - termNode_free (x->content.array.size); - break; - case TEXPR_FCN: - typeExpr_free (x->content.function.returntype); - paramNodeList_free (x->content.function.args); - break; - /*@-branchstate@*/ - } - /*@=branchstate@*/ - - sfree (x); - } -} - - -/*@only@*/ cstring -declaratorNode_unparseCode (declaratorNode x) -{ - return (typeExpr_unparseCode (x->type)); -} - -/*@only@*/ cstring -typeExpr_unparse (/*@null@*/ typeExpr x) -{ - cstring s = cstring_undefined; /* print out types in order of appearance in source */ - paramNodeList params; - int i; - - if (x != (typeExpr) 0) - { - cstring front = cstring_undefined; - cstring back = cstring_undefined; - - llassert (x->wrapped < 100); - - for (i = x->wrapped; i >= 1; i--) - { - front = cstring_appendChar (front, '('); - back = cstring_appendChar (back, ')'); - } - - switch (x->kind) - { - case TEXPR_BASE: - s = message ("%q%s", s, ltoken_getRawString (x->content.base)); - break; - case TEXPR_PTR: - s = message ("%q*%q", s, typeExpr_unparse (x->content.pointer)); - break; - case TEXPR_ARRAY: - s = message ("%q%q[%q]", s, - typeExpr_unparse (x->content.array.elementtype), - termNode_unparse (x->content.array.size)); - break; - case TEXPR_FCN: - s = message ("%q%q (", s, - typeExpr_unparse (x->content.function.returntype)); - params = x->content.function.args; - - if (!paramNodeList_empty (params)) - { - s = message ("%q%q", s, - paramNodeList_unparse (x->content.function.args)); - } - - s = message ("%q)", s); - break; - } - s = message ("%q%q%q", front, s, back); - } - else - { - s = cstring_makeLiteral ("?"); - } - - return s; -} - -/*@only@*/ cstring -typeExpr_unparseNoBase (/*@null@*/ typeExpr x) -{ - cstring s = cstring_undefined; /* print out types in order of appearance in source */ - paramNodeList params; - int i; - - if (x != (typeExpr) 0) - { - cstring front = cstring_undefined; - cstring back = cstring_undefined; - - llassert (x->wrapped < 100); - - for (i = x->wrapped; i >= 1; i--) - { - front = cstring_appendChar (front, '('); - back = cstring_appendChar (back, ')'); - } - - switch (x->kind) - { - case TEXPR_BASE: - s = message ("%q /* %s */", s, ltoken_getRawString (x->content.base)); - break; - case TEXPR_PTR: - s = message ("%q*%q", s, typeExpr_unparseNoBase (x->content.pointer)); - break; - case TEXPR_ARRAY: - s = message ("%q%q[%q]", s, - typeExpr_unparseNoBase (x->content.array.elementtype), - termNode_unparse (x->content.array.size)); - break; - case TEXPR_FCN: - s = message ("%q%q (", s, - typeExpr_unparseNoBase (x->content.function.returntype)); - params = x->content.function.args; - - if (!paramNodeList_empty (params)) - { - s = message ("%q%q", s, - paramNodeList_unparse (x->content.function.args)); - } - - s = message ("%q)", s); - break; - } - s = message ("%q%q%q", front, s, back); - } - else - { - s = cstring_makeLiteral ("?"); - } - - return s; -} - -cstring -typeExpr_name (/*@null@*/ typeExpr x) -{ - if (x != (typeExpr) 0) - { - switch (x->kind) - { - case TEXPR_BASE: - return (cstring_copy (ltoken_getRawString (x->content.base))); - case TEXPR_PTR: - return (typeExpr_name (x->content.pointer)); - case TEXPR_ARRAY: - return (typeExpr_name (x->content.array.elementtype)); - case TEXPR_FCN: - return (typeExpr_name (x->content.function.returntype)); - } - } - - /* evs --- 14 Mar 1995 - ** not a bug: its okay to have empty parameter names - ** llbug ("typeExpr_name: null"); - */ - - return cstring_undefined; -} - -/*@only@*/ typeExpr - makePointerNode (ltoken star, /*@only@*/ /*@returned@*/ typeExpr x) -{ - if (x != (typeExpr)0 && (x->kind == TEXPR_FCN && (x->wrapped == 0))) - { - x->content.function.returntype = makePointerNode (star, x->content.function.returntype); - return x; - } - else - { - typeExpr y = (typeExpr) dmalloc (sizeof (*y)); - - y->wrapped = 0; - y->kind = TEXPR_PTR; - y->content.pointer = x; - y->sort = sort_makeNoSort (); - ltoken_free (star); - - return y; - } -} - -typeExpr makeArrayNode (/*@returned@*/ typeExpr x, - /*@only@*/ arrayQualNode a) -{ - if (x != (typeExpr)0 && (x->kind == TEXPR_FCN && (x->wrapped == 0))) - { - /* - ** Spurious errors reported here, because of referencing - ** in makeArrayNode. - */ - - /*@i3@*/ x->content.function.returntype = makeArrayNode (x, a); - /*@i1@*/ return x; - } - else - { - typeExpr y = (typeExpr) dmalloc (sizeof (*y)); - y->wrapped = 0; - y->kind = TEXPR_ARRAY; - - if (a == (arrayQualNode) 0) - { - y->content.array.size = (termNode) 0; - } - else - { - y->content.array.size = a->term; - ltoken_free (a->tok); - sfree (a); - } - - y->content.array.elementtype = x; - y->sort = sort_makeNoSort (); - - return (y); - } -} - -/*@only@*/ constDeclarationNode -makeConstDeclarationNode (lclTypeSpecNode t, initDeclNodeList decls) -{ - constDeclarationNode n = (constDeclarationNode) dmalloc (sizeof (*n)); - sort s, s2, initValueSort; - ltoken varid, errtok; - termNode initValue; - - s = lclTypeSpecNode2sort (t); - - initDeclNodeList_elements (decls, init) - { - declaratorNode vdnode = init->declarator; - varInfo vi = (varInfo) dmalloc (sizeof (*vi)); - - varid = ltoken_copy (vdnode->id); - s2 = typeExpr2ptrSort (s, vdnode->type); - initValue = init->value; - - if (termNode_isDefined (initValue) && !initValue->error_reported) - { - initValueSort = initValue->sort; - - /* should keep the arguments in order */ - if (!sort_member_modulo_cstring (s2, initValue) - && !initValue->error_reported) - { - errtok = termNode_errorToken (initValue); - - lclerror - (errtok, - message ("Constant %s declared type %q, initialized to %q: %q", - ltoken_unparse (varid), - sort_unparse (s2), - sort_unparse (initValueSort), - termNode_unparse (initValue))); - } - } - - vi->id = varid; - vi->kind = VRK_CONST; - vi->sort = s2; - vi->export = TRUE; - - (void) symtable_enterVar (g_symtab, vi); - varInfo_free (vi); - - } end_initDeclNodeList_elements; - - n->type = t; - n->decls = decls; - - return n; -} - -varDeclarationNode makeInternalStateNode (void) -{ - varDeclarationNode n = (varDeclarationNode) dmalloc (sizeof (*n)); - - n->isSpecial = TRUE; - n->sref = sRef_makeInternalState (); - - /*@-compdef@*/ return n; /*@=compdef@*/ -} - -varDeclarationNode makeFileSystemNode (void) -{ - varDeclarationNode n = (varDeclarationNode) dmalloc (sizeof (*n)); - - n->isSpecial = TRUE; - n->sref = sRef_makeSystemState (); - - /*@-compdef@*/ return n; /*@=compdef@*/ -} - -/*@only@*/ varDeclarationNode -makeVarDeclarationNode (lclTypeSpecNode t, initDeclNodeList x, - bool isGlobal, bool isPrivate) -{ - varDeclarationNode n = (varDeclarationNode) dmalloc (sizeof (*n)); - sort s, s2, initValueSort; - ltoken varid, errtok; - termNode initValue; - declaratorNode vdnode; - - n->isSpecial = FALSE; - n->qualifier = QLF_NONE; - n->isGlobal = isGlobal; - n->isPrivate = isPrivate; - n->decls = x; - - s = lclTypeSpecNode2sort (t); - - /* t is an lclTypeSpec, its sort may not be assigned yet */ - - initDeclNodeList_elements (x, init) - { - vdnode = init->declarator; - varid = vdnode->id; - s2 = typeExpr2ptrSort (s, vdnode->type); - initValue = init->value; - - if (termNode_isDefined (initValue) && !initValue->error_reported) - { - initValueSort = initValue->sort; - /* should keep the arguments in order */ - if (!sort_member_modulo_cstring (s2, initValue) - && !initValue->error_reported) - { - errtok = termNode_errorToken (initValue); - - lclerror (errtok, - message ("Variable %s declared type %q, initialized to %q", - ltoken_unparse (varid), - sort_unparse (s2), - sort_unparse (initValueSort))); - } - } - - /* - ** If global, check that it has been declared already, don't push - ** onto symbol table yet (wrong scope, done in enteringFcnScope - */ - - if (isGlobal) - { - varInfo vi = symtable_varInfo (g_symtab, ltoken_getText (varid)); - - if (!varInfo_exists (vi)) - { - lclerror (varid, - message ("Undeclared global variable: %s", - ltoken_getRawString (varid))); - } - else - { - if (vi->kind == VRK_CONST) - { - lclerror (varid, - message ("Constant used in global list: %s", - ltoken_getRawString (varid))); - } - } - } - else - { - varInfo vi = (varInfo) dmalloc (sizeof (*vi)); - - vi->id = ltoken_copy (varid); - if (isPrivate) - { - vi->kind = VRK_PRIVATE; - /* check that initValue is not empty */ - if (initValue == (termNode) 0) - { - lclerror (varid, - message ("Private variable must have initialization: %s", - ltoken_getRawString (varid))); - } - } - else - { - vi->kind = VRK_VAR; - } - - vi->sort = sort_makeGlobal (s2); - vi->export = TRUE; - - vdnode->isRedecl = symtable_enterVar (g_symtab, vi); - varInfo_free (vi); - } - } end_initDeclNodeList_elements; - - n->type = t; - - return n; -} - -/*@only@*/ initDeclNode -makeInitDeclNode (declaratorNode d, termNode x) -{ - initDeclNode n = (initDeclNode) dmalloc (sizeof (*n)); - - n->declarator = d; - n->value = x; - return n; -} - -/*@only@*/ abstractNode -makeAbstractNode (ltoken t, ltoken name, - bool isMutable, bool isRefCounted, abstBodyNode a) -{ - abstractNode n = (abstractNode) dmalloc (sizeof (*n)); - sort handle; - typeInfo ti = (typeInfo) dmalloc (sizeof (*ti)); - - n->tok = t; - n->isMutable = isMutable; - n->name = name; - n->body = a; - n->isRefCounted = isRefCounted; - - if (isMutable) - handle = sort_makeMutable (name, ltoken_getText (name)); - else - handle = sort_makeImmutable (name, ltoken_getText (name)); - n->sort = handle; - - ti->id = ltoken_createType (ltoken_getCode (ltoken_typename), SID_TYPE, - ltoken_getText (name)); - ti->modifiable = isMutable; - ti->abstract = TRUE; - ti->basedOn = handle; - ti->export = TRUE; - - symtable_enterType (g_symtab, ti); - - - return n; -} - -/*@only@*/ cstring -abstractNode_unparse (abstractNode n) -{ - if (n != (abstractNode) 0) - { - cstring s; - - if (n->isMutable) - s = cstring_makeLiteral ("mutable"); - else - s = cstring_makeLiteral ("immutable"); - - return (message ("%q type %s%q;", s, ltoken_getRawString (n->name), - abstBodyNode_unparse (n->body))); - } - return cstring_undefined; -} - -void -setExposedType (lclTypeSpecNode s) -{ - exposedType = s; -} - -/*@only@*/ exposedNode -makeExposedNode (ltoken t, lclTypeSpecNode s, - declaratorInvNodeList d) -{ - exposedNode n = (exposedNode) dmalloc (sizeof (*n)); - - n->tok = t; - n->type = s; - n->decls = d; - - return n; -} - -/*@only@*/ cstring -exposedNode_unparse (exposedNode n) -{ - if (n != (exposedNode) 0) - { - return (message ("typedef %q %q;", - lclTypeSpecNode_unparse (n->type), - declaratorInvNodeList_unparse (n->decls))); - } - return cstring_undefined; -} - -/*@only@*/ declaratorInvNode -makeDeclaratorInvNode (declaratorNode d, abstBodyNode b) -{ - declaratorInvNode n = (declaratorInvNode) dmalloc (sizeof (*n)); - n->declarator = d; - n->body = b; - - return (n); -} - -/*@only@*/ cstring -declaratorInvNode_unparse (declaratorInvNode d) -{ - return (message ("%q%q", declaratorNode_unparse (d->declarator), - abstBodyNode_unparseExposed (d->body))); -} - -/*@only@*/ cstring -abstBodyNode_unparse (abstBodyNode n) -{ - if (n != (abstBodyNode) 0) - { - return (lclPredicateNode_unparse (n->typeinv)); - } - return cstring_undefined; -} - -/*@only@*/ cstring -abstBodyNode_unparseExposed (abstBodyNode n) -{ - if (n != (abstBodyNode) 0) - { - return (message ("%q", lclPredicateNode_unparse (n->typeinv))); - } - return cstring_undefined; -} - -/*@only@*/ cstring -taggedUnionNode_unparse (taggedUnionNode n) -{ - if (n != (taggedUnionNode) 0) - { - return (message ("tagged union {%q}%q;\n", - stDeclNodeList_unparse (n->structdecls), - declaratorNode_unparse (n->declarator))); - } - return cstring_undefined; -} - -static /*@observer@*/ paramNodeList - typeExpr_toParamNodeList (/*@null@*/ typeExpr te) -{ - if (te != (typeExpr) 0) - { - switch (te->kind) - { - case TEXPR_FCN: - return te->content.function.args; - case TEXPR_PTR: - return typeExpr_toParamNodeList (te->content.pointer); - case TEXPR_ARRAY: - /* return typeExpr_toParamNodeList (te->content.array.elementtype); */ - case TEXPR_BASE: - return paramNodeList_undefined; - } - } - return paramNodeList_undefined; -} - -/*@only@*/ fcnNode - fcnNode_fromDeclarator (/*@only@*/ /*@null@*/ lclTypeSpecNode t, - /*@only@*/ declaratorNode d) -{ - return (makeFcnNode (QU_UNKNOWN, t, d, - varDeclarationNodeList_new (), - varDeclarationNodeList_new (), - letDeclNodeList_new (), - (lclPredicateNode) 0, - (lclPredicateNode) 0, - (modifyNode) 0, - (lclPredicateNode) 0, - (lclPredicateNode) 0)); -} - -/*@only@*/ iterNode -makeIterNode (ltoken id, paramNodeList p) -{ - iterNode x = (iterNode) dmalloc (sizeof (*x)); - bool hasYield = FALSE; - - x->name = id; - x->params = p; - - /* check there is at least one yield param */ - - paramNodeList_elements (p, pe) - { - if (paramNode_isYield (pe)) - { - hasYield = TRUE; - break; - } - } end_paramNodeList_elements - - if (!hasYield) - { - lclerror (id, message ("Iterator has no yield parameters: %s", - ltoken_getRawString (id))); - } - - return (x); -} - -/*@only@*/ fcnNode -makeFcnNode (qual specQual, - /*@null@*/ lclTypeSpecNode t, - declaratorNode d, - /*@null@*/ globalList g, - /*@null@*/ varDeclarationNodeList privateinits, - /*@null@*/ letDeclNodeList lets, - /*@null@*/ lclPredicateNode checks, - /*@null@*/ lclPredicateNode requires, - /*@null@*/ modifyNode m, - /*@null@*/ lclPredicateNode ensures, - /*@null@*/ lclPredicateNode claims) -{ - fcnNode x = (fcnNode) dmalloc (sizeof (*x)); - - if (d->type != (typeExpr)0 && (d->type)->kind != TEXPR_FCN) - { - lclerror (d->id, cstring_makeLiteral - ("Attempt to specify function without parameter list")); - d->type = makeFunctionNode (d->type, paramNodeList_new ()); - } - - - x->special = specQual; - x->typespec = t; - x->declarator = d; - x->globals = g; - x->inits = privateinits; - x->lets = lets; - x->checks = checks; - x->require = requires; - x->modify = m; - x->ensures = ensures; - x->claim = claims; - - /* extract info to fill in x->name =; x->signature =; */ - x->name = ltoken_copy (d->id); - - return (x); -} - -/*@only@*/ claimNode -makeClaimNode (ltoken id, paramNodeList p, - globalList g, letDeclNodeList lets, lclPredicateNode requires, - programNode b, lclPredicateNode ensures) -{ - claimNode x = (claimNode) dmalloc (sizeof (*x)); - - - x->name = id; - x->params = p; - x->globals = g; - x->lets = lets; - x->require = requires; - x->body = b; - x->ensures = ensures; - return (x); -} - -/*@only@*/ lclPredicateNode -makeIntraClaimNode (ltoken t, lclPredicateNode n) -{ - ltoken_free (n->tok); - n->tok = t; - n->kind = LPD_INTRACLAIM; - return (n); -} - -/*@only@*/ lclPredicateNode -makeRequiresNode (ltoken t, lclPredicateNode n) -{ - ltoken_free (n->tok); - n->tok = t; - n->kind = LPD_REQUIRES; - return (n); -} - -/*@only@*/ lclPredicateNode -makeChecksNode (ltoken t, lclPredicateNode n) -{ - ltoken_free (n->tok); - n->tok = t; - n->kind = LPD_CHECKS; - return (n); -} - -/*@only@*/ lclPredicateNode -makeEnsuresNode (ltoken t, lclPredicateNode n) -{ - ltoken_free (n->tok); - n->tok = t; - n->kind = LPD_ENSURES; - return (n); -} - -/*@only@*/ lclPredicateNode -makeLclPredicateNode (ltoken t, termNode n, - lclPredicateKind k) -{ - lclPredicateNode x = (lclPredicateNode) dmalloc (sizeof (*x)); - - x->tok = t; - x->predicate = n; - x->kind = k; - return (x); -} - -/*@only@*/ quantifierNode -makeQuantifierNode (varNodeList v, ltoken quant) -{ - quantifierNode x = (quantifierNode) dmalloc (sizeof (*x)); - - x->quant = quant; - x->vars = v; - x->isForall = cstring_equalLit (ltoken_unparse (quant), "\forall"); - - return (x); -} - -/*@only@*/ arrayQualNode -makeArrayQualNode (ltoken t, termNode term) -{ - arrayQualNode x = (arrayQualNode) dmalloc (sizeof (*x)); - - x->tok = t; - x->term = term; - return (x); -} - -/*@only@*/ varNode -makeVarNode (/*@only@*/ ltoken varid, bool isObj, lclTypeSpecNode t) -{ - varNode x = (varNode) dmalloc (sizeof (*x)); - varInfo vi = (varInfo) dmalloc (sizeof (*vi)); - sort sort; - - vi->id = ltoken_copy (varid); - sort = lclTypeSpecNode2sort (t); - - /* 9/3/93, The following is needed because we want value sorts to be - the default, object sort is generated only if there is "obj" qualifier. - There are 2 cases: (1) for immutable types (including C primitive types), - we need to generate the object sort if qualifier is present; (2) for - array, struct and union types, they are already in their object sorts. - */ - - sort = sort_makeVal (sort); /* both cases are now value sorts */ - - if (isObj) - { - sort = sort_makeObj (sort); - } - - - vi->sort = sort; - vi->kind = VRK_QUANT; - vi->export = TRUE; - - (void) symtable_enterVar (g_symtab, vi); - varInfo_free (vi); - - x->varid = varid; - x->isObj = isObj; - x->type = t; - x->sort = sort_makeNoSort (); - - return (x); -} - -/*@only@*/ abstBodyNode -makeAbstBodyNode (ltoken t, fcnNodeList f) -{ - abstBodyNode x = (abstBodyNode) dmalloc (sizeof (*x)); - - x->tok = t; - x->typeinv = (lclPredicateNode)0; - x->fcns = f; - return (x); -} - -/*@only@*/ abstBodyNode -makeExposedBodyNode (ltoken t, lclPredicateNode inv) -{ - abstBodyNode x = (abstBodyNode) dmalloc (sizeof (*x)); - - x->tok = t; - x->typeinv = inv; - x->fcns = fcnNodeList_undefined; - return (x); -} - -/*@only@*/ abstBodyNode -makeAbstBodyNode2 (ltoken t, ltokenList ops) -{ - abstBodyNode x = (abstBodyNode) dmalloc (sizeof (*x)); - - x->tok = t; - x->typeinv = (lclPredicateNode) 0; - - x->fcns = fcnNodeList_new (); - - ltokenList_elements (ops, op) - { - x->fcns = fcnNodeList_add - (x->fcns, - fcnNode_fromDeclarator (lclTypeSpecNode_undefined, - makeUnknownDeclaratorNode (ltoken_copy (op)))); - } end_ltokenList_elements; - - ltokenList_free (ops); - - return (x); -} - -/*@only@*/ stmtNode - makeStmtNode (ltoken varId, ltoken fcnId, /*@only@*/ termNodeList v) -{ - stmtNode n = (stmtNode) dmalloc (sizeof (*n)); - - n->lhs = varId; - n->operator = fcnId; - n->args = v; - return (n); -} - -/* printDeclarators -> declaratorNodeList_unparse */ - -static cstring abstDeclaratorNode_unparse (abstDeclaratorNode x) -{ - return (typeExpr_unparse ((typeExpr) x)); -} - -/*@only@*/ paramNode -makeParamNode (lclTypeSpecNode t, typeExpr d) -{ - paramNode x = (paramNode) dmalloc (sizeof (*x)); - - paramNode_checkQualifiers (t, d); - - x->type = t; - x->paramdecl = d; - x->kind = PNORMAL; /*< forgot this! >*/ - - return (x); -} - -/*@only@*/ paramNode -paramNode_elipsis (void) -{ - paramNode x = (paramNode) dmalloc (sizeof (*x)); - - x->type = (lclTypeSpecNode) 0; - x->paramdecl = (typeExpr) 0; - x->kind = PELIPSIS; - - return (x); -} - -static /*@observer@*/ ltoken typeExpr_getTok (typeExpr d) -{ - while (d != (typeExpr)0) - { - if (d->kind == TEXPR_BASE) - { - return (d->content.base); - } - else - { - if (d->kind == TEXPR_PTR) - { - d = d->content.pointer; - } - else if (d->kind == TEXPR_ARRAY) - { - d = d->content.array.elementtype; - } - else if (d->kind == TEXPR_FCN) - { - d = d->content.function.returntype; - } - else - { - BADBRANCH; - } - } - } - - llfatalerror (cstring_makeLiteral ("typeExpr_getTok: unreachable code")); - BADEXIT; -} - -void -paramNode_checkQualifiers (lclTypeSpecNode t, typeExpr d) -{ - bool isPointer = FALSE; - bool isUser = FALSE; - bool hasAlloc = FALSE; - bool hasAlias = FALSE; - - llassert (lclTypeSpecNode_isDefined (t)); - - if (t->pointers == 0 - && (d != (typeExpr)0 && d->kind != TEXPR_PTR) && d->kind != TEXPR_ARRAY) - { - if (t->kind == LTS_TYPE) - { - sortNode sn; - - llassert (t->content.type != NULL); - - sn = sort_quietLookup (sort_getUnderlying ((t->content.type)->sort)); - - if (sn.kind == SRT_PTR || sn.kind == SRT_ARRAY - || sn.kind == SRT_HOF || sn.kind == SRT_NONE) - { - isPointer = TRUE; - } - } - } - else - { - isPointer = TRUE; - } - - if (d != (typeExpr)0 && d->kind != TEXPR_BASE) - { - if (t->kind == LTS_TYPE) - { - sortNode sn; - - llassert (t->content.type != NULL); - sn = sort_quietLookup (sort_getUnderlying ((t->content.type)->sort)); - - if (sn.kind == SRT_PTR || sn.kind == SRT_ARRAY - || sn.kind == SRT_HOF || sn.kind == SRT_NONE) - { - isUser = TRUE; - } - } - } - else - { - isPointer = TRUE; - } - - if (d != (typeExpr)NULL) - { - qualList_elements (t->quals, q) - { - if (qual_isAllocQual (q)) - { - if (hasAlloc) - { - ltoken tok = typeExpr_getTok (d); - lclerror (tok, message ("Parameter declared with multiple allocation " - "qualifiers: %q", typeExpr_unparse (d))); - } - hasAlloc = TRUE; - - if (!isPointer) - { - ltoken tok = typeExpr_getTok (d); - lclerror (tok, message ("Non-pointer declared as %s parameter: %q", - qual_unparse (q), - typeExpr_unparse (d))); - } - } - if (qual_isAliasQual (q)) - { - if (hasAlias) - { - ltoken tok = typeExpr_getTok (d); - lclerror (tok, message ("Parameter declared with multiple alias qualifiers: %q", - typeExpr_unparse (d))); - } - hasAlias = TRUE; - - if (!(isPointer || isUser)) - { - ltoken tok = typeExpr_getTok (d); - lclerror (tok, message ("Unsharable type declared as %s parameter: %q", - qual_unparse (q), - typeExpr_unparse (d))); - } - } - } end_qualList_elements; - } -} - -/*@only@*/ cstring -paramNode_unparse (paramNode x) -{ - if (x != (paramNode) 0) - { - if (x->kind == PELIPSIS) - { - return (cstring_makeLiteral ("...")); - } - - if (x->paramdecl != (typeExpr) 0) - { /* handle (void) */ - return (message ("%q %q", lclTypeSpecNode_unparse (x->type), - typeExpr_unparse (x->paramdecl))); - } - else - { - return (lclTypeSpecNode_unparse (x->type)); - } - } - return cstring_undefined; -} - -static cstring -lclTypeSpecNode_unparseAltComments (/*@null@*/ lclTypeSpecNode typespec) /*@*/ -{ - if (typespec != (lclTypeSpecNode) 0) - { - cstring s = qualList_toCComments (typespec->quals); - - switch (typespec->kind) - { - case LTS_TYPE: - { - llassert (typespec->content.type != NULL); - - return (cstring_concatFree - (s, printLeaves (typespec->content.type->ctypes))); - } - case LTS_ENUM: - { - bool first = TRUE; - enumSpecNode n = typespec->content.enumspec; - - s = cstring_concatFree (s, cstring_makeLiteral ("enum")); - llassert (n != NULL); - - if (!ltoken_isUndefined (n->opttagid)) - { - s = message ("%q %s", s, ltoken_unparse (n->opttagid)); - } - s = message ("%q {", s); - - ltokenList_elements (n->enums, e) - { - if (first) - { - first = FALSE; - s = message ("%q%s", s, ltoken_getRawString (e)); - } - else - s = message ("%q, %s", s, ltoken_getRawString (e)); - } end_ltokenList_elements; - - return (message ("%q}", s)); - } - case LTS_STRUCTUNION: - { - strOrUnionNode n = typespec->content.structorunion; - stDeclNodeList decls; - - llassert (n != NULL); - - switch (n->kind) - { - case SU_STRUCT: - s = cstring_concatFree (s, cstring_makeLiteral ("struct ")); - /*@switchbreak@*/ break; - case SU_UNION: - s = cstring_concatFree (s, cstring_makeLiteral ("union ")); - /*@switchbreak@*/ break; - } - - if (!ltoken_isUndefined (n->opttagid)) - { - if (stDeclNodeList_size (n->structdecls) == 0) - { - return (message ("%q%s", s, ltoken_unparse (n->opttagid))); - } - - s = message ("%q%s {\n\2\1", s, ltoken_unparse (n->opttagid)); - } - else - { - s = message ("%q{\n\2\1", s); - } - - decls = n->structdecls; - - stDeclNodeList_elements (decls, f) - { - s = message ("%q%q\1%q;\n\1", s, - lclTypeSpecNode_unparseAltComments (f->lcltypespec), - declaratorNodeList_unparse (f->declarators)); - } end_stDeclNodeList_elements; - - return (message ("%q\3}", s)); - } - case LTS_CONJ: - { - cstring_free (s); - - return - (message - ("%q, %q", - lclTypeSpecNode_unparseAltComments (typespec->content.conj->a), - lclTypeSpecNode_unparseAltComments (typespec->content.conj->b))); - } - BADDEFAULT; - } - } - else - { - llcontbuglit ("lclTypeSpecNode_unparseComments: null typespec"); - - return cstring_undefined; - } - - BADEXIT; -} - -cstring lclTypeSpecNode_unparseComments (/*@null@*/ lclTypeSpecNode typespec) -{ - if (typespec != (lclTypeSpecNode) 0) - { - cstring s = qualList_toCComments (typespec->quals); - - switch (typespec->kind) - { - case LTS_TYPE: - { - llassert (typespec->content.type != NULL); - - return (cstring_concatFree - (s, printLeaves (typespec->content.type->ctypes))); - } - case LTS_ENUM: - { - bool first = TRUE; - enumSpecNode n = typespec->content.enumspec; - - s = cstring_concatFree (s, cstring_makeLiteral ("enum")); - llassert (n != NULL); - - if (!ltoken_isUndefined (n->opttagid)) - { - s = message ("%q %s", s, ltoken_unparse (n->opttagid)); - } - s = message ("%q {", s); - - ltokenList_elements (n->enums, e) - { - if (first) - { - first = FALSE; - s = message ("%q%s", s, ltoken_getRawString (e)); - } - else - s = message ("%q, %s", s, ltoken_getRawString (e)); - } end_ltokenList_elements; - - return (message ("%q}", s)); - } - case LTS_STRUCTUNION: - { - strOrUnionNode n = typespec->content.structorunion; - stDeclNodeList decls; - - llassert (n != NULL); - - switch (n->kind) - { - case SU_STRUCT: - s = cstring_concatFree (s, cstring_makeLiteral ("struct ")); - /*@switchbreak@*/ break; - case SU_UNION: - s = cstring_concatFree (s, cstring_makeLiteral ("union ")); - /*@switchbreak@*/ break; - } - - if (!ltoken_isUndefined (n->opttagid)) - { - if (stDeclNodeList_size (n->structdecls) == 0) - { - return (message ("%q%s", s, ltoken_unparse (n->opttagid))); - } - - s = message ("%q%s {\n\2\1", s, ltoken_unparse (n->opttagid)); - } - else - { - s = message ("%q{\n\2\1", s); - } - - decls = n->structdecls; - - stDeclNodeList_elements (decls, f) - { - s = message ("%q%q\1%q;\n\1", s, - lclTypeSpecNode_unparseComments (f->lcltypespec), - declaratorNodeList_unparse (f->declarators)); - } end_stDeclNodeList_elements; - - return (message ("%q\3}", s)); - } - case LTS_CONJ: - { - cstring_free (s); - - return - (message - ("%q /*@alt %q@*/", - lclTypeSpecNode_unparseComments (typespec->content.conj->a), - lclTypeSpecNode_unparseAltComments (typespec->content.conj->b))); - } - BADDEFAULT; - } - } - else - { - llcontbuglit ("lclTypeSpecNode_unparseComments: null typespec"); - - return cstring_undefined; - } - - BADEXIT; -} - -/*@only@*/ cstring -paramNode_unparseComments (paramNode x) -{ - if (x != (paramNode) 0) - { - if (x->kind == PELIPSIS) - { - return (cstring_makeLiteral ("...")); - } - - if (x->paramdecl != (typeExpr) 0) - { /* handle (void) */ - return (message ("%q %q", - lclTypeSpecNode_unparseComments (x->type), - typeExpr_unparseNoBase (x->paramdecl))); - } - else - { - return (lclTypeSpecNode_unparseComments (x->type)); - } - } - return cstring_undefined; -} - -/*@only@*/ termNode -makeIfTermNode (ltoken ift, termNode ifn, ltoken thent, - termNode thenn, ltoken elset, - termNode elsen) -{ - termNode t = (termNode) dmalloc (sizeof (*t)); - opFormNode opform = makeOpFormNode (ift, OPF_IF, opFormUnion_createMiddle (0), - ltoken_undefined); - nameNode nn = makeNameNodeForm (opform); - termNodeList args = termNodeList_new (); - - t->error_reported = FALSE; - t->wrapped = 0; - termNodeList_addh (args, ifn); - termNodeList_addh (args, thenn); - termNodeList_addh (args, elsen); - t->name = nn; - t->args = args; - t->kind = TRM_APPLICATION; - t->sort = sort_makeNoSort (); - t->given = t->sort; - t->possibleSorts = sortSet_new (); - t->possibleOps = lslOpSet_new (); - - ltoken_free (thent); - ltoken_free (elset); - - return (t); -} - -static /*@observer@*/ ltoken - nameNode2anyOp (nameNode n) -{ - if (n != (nameNode) 0) - { - opFormNode opnode = n->content.opform; - opFormKind kind; - - llassert (opnode != NULL); - - kind = opnode->kind; - - if (kind == OPF_MANYOPM || kind == OPF_ANYOP || - kind == OPF_MANYOP || kind == OPF_ANYOPM) - { - opFormUnion u; - - u = opnode->content; - return u.anyop; - } - } - return ltoken_undefined; -} - -/*@only@*/ termNode -makeInfixTermNode (termNode x, ltoken op, termNode y) -{ - termNode t = (termNode) dmalloc (sizeof (*t)); - opFormNode opform; - nameNode nn; - termNodeList args = termNodeList_new (); - - checkAssociativity (x, op); - - opform = makeOpFormNode (op, OPF_MANYOPM, - opFormUnion_createAnyOp (op), - ltoken_undefined); - - nn = makeNameNodeForm (opform); - - t->error_reported = FALSE; - t->wrapped = 0; - termNodeList_addh (args, x); - termNodeList_addh (args, y); - t->name = nn; - t->args = args; - t->kind = TRM_APPLICATION; - t->sort = sort_makeNoSort (); - t->given = t->sort; - t->possibleSorts = sortSet_new (); /* sort_equal */ - t->possibleOps = lslOpSet_new (); - return (t); -} - -/*@only@*/ quantifiedTermNode - quantifiedTermNode_copy (quantifiedTermNode q) -{ - quantifiedTermNode ret = (quantifiedTermNode) dmalloc (sizeof (*ret)); - - ret->quantifiers = quantifierNodeList_copy (q->quantifiers); - ret->open = ltoken_copy (q->open); - ret->close = ltoken_copy (q->close); - ret->body = termNode_copySafe (q->body); - - return (ret); -} - -/*@only@*/ termNode -makeQuantifiedTermNode (quantifierNodeList qn, ltoken open, - termNode t, ltoken close) -{ - sort sort; - termNode n = (termNode) dmalloc (sizeof (*n)); - quantifiedTermNode q = (quantifiedTermNode) dmalloc (sizeof (*q)); - - n->name = NULL; /*> missing this --- detected by lclint <*/ - n->error_reported = FALSE; - n->wrapped = 0; - n->error_reported = FALSE; - n->kind = TRM_QUANTIFIER; - n->possibleSorts = sortSet_new (); - n->possibleOps = lslOpSet_new (); - n->kind = TRM_UNCHANGEDALL; - n->args = termNodeList_new (); /*< forgot this >*/ - - termNodeList_free (t->args); - t->args = termNodeList_new (); - - sort = sort_bool; - n->sort = sort; - (void) sortSet_insert (n->possibleSorts, sort); - - q->quantifiers = qn; - q->open = open; - q->close = close; - q->body = t; - - n->quantified = q; - return (n); -} - -/*@only@*/ termNode -makePostfixTermNode (/*@returned@*/ /*@only@*/ termNode secondary, ltokenList postfixops) -{ - termNode top = secondary; - - ltokenList_elements (postfixops, op) - { - top = makePostfixTermNode2 (top, ltoken_copy (op)); - /*@i@*/ } end_ltokenList_elements; - - ltokenList_free (postfixops); - - return (top); /* dep as only? */ -} - -/* -** secondary is returned in the args list -*/ - -/*@only@*/ termNode -makePostfixTermNode2 (/*@returned@*/ /*@only@*/ termNode secondary, - /*@only@*/ ltoken postfixop) -{ - termNode t = (termNode) dmalloc (sizeof (*t)); - - opFormNode opform = makeOpFormNode (postfixop, - OPF_MANYOP, opFormUnion_createAnyOp (postfixop), - ltoken_undefined); - nameNode nn = makeNameNodeForm (opform); - termNodeList args = termNodeList_new (); - - t->error_reported = FALSE; - t->wrapped = 0; - termNodeList_addh (args, secondary); - t->name = nn; - t->args = args; - t->kind = TRM_APPLICATION; - t->sort = sort_makeNoSort (); - t->given = t->sort; - t->possibleSorts = sortSet_new (); - t->possibleOps = lslOpSet_new (); - return t; -} - -/*@only@*/ termNode -makePrefixTermNode (ltoken op, termNode arg) -{ - termNode t = (termNode) dmalloc (sizeof (*t)); - termNodeList args = termNodeList_new (); - opFormNode opform = makeOpFormNode (op, OPF_ANYOPM, opFormUnion_createAnyOp (op), - ltoken_undefined); - nameNode nn = makeNameNodeForm (opform); - - t->error_reported = FALSE; - t->wrapped = 0; - t->name = nn; - termNodeList_addh (args, arg); - t->args = args; - t->kind = TRM_APPLICATION; - t->sort = sort_makeNoSort (); - t->given = t->sort; - t->possibleSorts = sortSet_new (); - t->possibleOps = lslOpSet_new (); - return t; -} - -/*@only@*/ termNode -makeOpCallTermNode (ltoken op, ltoken open, - termNodeList args, ltoken close) -{ - /* like prefixTerm, but with opId LPAR termNodeList RPAR */ - termNode t = (termNode) dmalloc (sizeof (*t)); - nameNode nn = makeNameNodeId (op); - - t->error_reported = FALSE; - t->wrapped = 0; - t->name = nn; - t->args = args; - t->kind = TRM_APPLICATION; - t->sort = sort_makeNoSort (); - t->given = t->sort; - t->possibleSorts = sortSet_new (); - t->possibleOps = lslOpSet_new (); - - ltoken_free (open); - ltoken_free (close); - - return t; -} - -/*@exposed@*/ termNode -CollapseInfixTermNode (/*@returned@*/ termNode secondary, termNodeList infix) -{ - termNode left = secondary; - - termNodeList_elements (infix, node) - { - termNodeList_addl (node->args, termNode_copySafe (left)); - left = node; - /* computePossibleSorts (left); */ - } end_termNodeList_elements; - - return (left); -} - -static void -checkAssociativity (termNode x, ltoken op) -{ - ltoken lastOpToken; - - if (x->wrapped == 0 && /* no parentheses */ - x->kind == TRM_APPLICATION && x->name != (nameNode) 0 && - (!x->name->isOpId)) - { - lastOpToken = nameNode2anyOp (x->name); - - if ((ltoken_getCode (lastOpToken) == logicalOp && - ltoken_getCode (op) == logicalOp) || - ((ltoken_getCode (lastOpToken) == simpleOp || - ltoken_getCode (lastOpToken) == LLT_MULOP) && - (ltoken_getCode (op) == simpleOp || - ltoken_getCode (op) == LLT_MULOP))) - if (ltoken_getText (lastOpToken) != ltoken_getText (op)) - { - lclerror (op, - message - ("Parentheses needed to specify associativity of %s and %s", - cstring_fromChars (lsymbol_toChars (ltoken_getText (lastOpToken))), - cstring_fromChars (lsymbol_toChars (ltoken_getText (op))))); - } - } -} - -termNodeList -pushInfixOpPartNode (/*@returned@*/ termNodeList x, ltoken op, - /*@only@*/ termNode secondary) -{ - termNode lastLeftTerm; - termNodeList args = termNodeList_new (); - termNode t = (termNode) dmalloc (sizeof (*t)); - opFormNode opform; - nameNode nn; - - termNodeList_addh (args, secondary); - - if (!termNodeList_empty (x)) - { - termNodeList_reset (x); - lastLeftTerm = termNodeList_current (x); - checkAssociativity (lastLeftTerm, op); - } - - opform = makeOpFormNode (op, OPF_MANYOPM, - opFormUnion_createAnyOp (op), ltoken_undefined); - - nn = makeNameNodeForm (opform); - - t->error_reported = FALSE; - t->wrapped = 0; - t->name = nn; - t->kind = TRM_APPLICATION; - t->args = args; - t->sort = sort_makeNoSort (); - t->given = t->sort; - t->possibleSorts = sortSet_new (); - t->possibleOps = lslOpSet_new (); - termNodeList_addh (x, t); - /* don't compute sort yet, do it in CollapseInfixTermNode */ - return (x); -} - -termNode -updateMatchedNode (/*@only@*/ termNode left, /*@returned@*/ termNode t, - /*@only@*/ termNode right) -{ - opFormNode op; - - if ((t == (termNode) 0) || (t->name == NULL) || t->name->isOpId) - { - llbugexitlit ("updateMatchedNode: expect opForm in nameNode"); - } - - op = t->name->content.opform; - llassert (op != NULL); - - if (left == (termNode) 0) - { - if (right == (termNode) 0) - { - /* op->kind is not changed */ - termNode_free (right); - } - else - { - op->kind = OPF_MIDDLEM; - op->key = opFormNode2key (op, OPF_MIDDLEM); - termNodeList_addh (t->args, right); - } - } - else - { - termNodeList_addl (t->args, left); - if (right == (termNode) 0) - { - op->kind = OPF_MMIDDLE; - op->key = opFormNode2key (op, OPF_MMIDDLE); - } - else - { - op->kind = OPF_MMIDDLEM; - op->key = opFormNode2key (op, OPF_MMIDDLEM); - termNodeList_addh (t->args, right); - } - } - return t; -} - -/*@only@*/ termNode - updateSqBracketedNode (/*@only@*/ termNode left, - /*@only@*/ /*@returned@*/ termNode t, - /*@only@*/ termNode right) -{ - opFormNode op; - - if ((t == (termNode) 0) || (t->name == NULL) || (t->name->isOpId)) - { - llbugexitlit ("updateSqBracketededNode: expect opForm in nameNode"); - } - - op = t->name->content.opform; - llassert (op != NULL); - - if (left == (termNode) 0) - { - if (right == (termNode) 0) - { - /* op->kind is not changed */ - } - else - { - op->kind = OPF_BMIDDLEM; - op->key = opFormNode2key (op, OPF_BMIDDLEM); - termNodeList_addh (t->args, right); - } - } - else - { - termNodeList_addl (t->args, left); - - if (right == (termNode) 0) - { - op->kind = OPF_BMMIDDLE; - op->key = opFormNode2key (op, OPF_BMMIDDLE); - } - else - { - op->kind = OPF_BMMIDDLEM; - op->key = opFormNode2key (op, OPF_BMMIDDLEM); - termNodeList_addh (t->args, right); - } - } - return t; -} - -/*@only@*/ termNode -makeSqBracketedNode (ltoken lbracket, - termNodeList args, ltoken rbracket) -{ - termNode t = (termNode) dmalloc (sizeof (*t)); - int size; - opFormNode opform; - nameNode nn; - - t->error_reported = FALSE; - t->wrapped = 0; - - size = termNodeList_size (args); - opform = makeOpFormNode (lbracket, OPF_BMIDDLE, opFormUnion_createMiddle (size), - rbracket); - nn = makeNameNodeForm (opform); - t->name = nn; - t->kind = TRM_APPLICATION; - t->args = args; - t->sort = sort_makeNoSort (); - t->given = t->sort; - t->possibleSorts = sortSet_new (); - t->possibleOps = lslOpSet_new (); - /* do sort checking later, not here, incomplete parse */ - return (t); -} - -/*@only@*/ termNode -makeMatchedNode (ltoken open, termNodeList args, ltoken close) -{ - /* matched : open args close */ - termNode t = (termNode) dmalloc (sizeof (*t)); - int size; - opFormNode opform; - nameNode nn; - - t->error_reported = FALSE; - t->wrapped = 0; - - size = termNodeList_size (args); - opform = makeOpFormNode (open, OPF_MIDDLE, opFormUnion_createMiddle (size), close); - nn = makeNameNodeForm (opform); - t->name = nn; - t->kind = TRM_APPLICATION; - t->args = args; - t->sort = sort_makeNoSort (); - t->given = t->sort; - t->possibleSorts = sortSet_new (); - t->possibleOps = lslOpSet_new (); - /* do sort checking later, not here, incomplete parse */ - return (t); -} - -/*@only@*/ termNode -makeSimpleTermNode (ltoken varid) -{ - sort theSort = sort_makeNoSort (); - lsymbol sym; - opInfo oi; - varInfo vi; - termNode n = (termNode) dmalloc (sizeof (*n)); - - n->error_reported = FALSE; - n->wrapped = 0; - n->name = (nameNode) 0; - n->given = theSort; - n->args = termNodeList_new (); - n->possibleSorts = sortSet_new (); - n->possibleOps = lslOpSet_new (); - - sym = ltoken_getText (varid); - - /* lookup current scope */ - vi = symtable_varInfoInScope (g_symtab, sym); - - if (varInfo_exists (vi)) - { - theSort = vi->sort; - n->kind = TRM_VAR; - n->sort = theSort; - n->literal = varid; - (void) sortSet_insert (n->possibleSorts, theSort); - } - else - { /* need to handle LCL constants */ - vi = symtable_varInfo (g_symtab, sym); - - if (varInfo_exists (vi) && vi->kind == VRK_CONST) - { - theSort = vi->sort; - n->kind = TRM_CONST; - n->sort = theSort; - n->literal = varid; - (void) sortSet_insert (n->possibleSorts, theSort); - } - else - { /* and LSL operators (true, false, new, nil, etc) */ - nameNode nn = makeNameNodeId (ltoken_copy (varid)); - oi = symtable_opInfo (g_symtab, nn); - - if (opInfo_exists (oi) && (oi->name->isOpId) && - !sigNodeSet_isEmpty (oi->signatures)) - { - sigNodeSet_elements (oi->signatures, x) - { - if (ltokenList_empty (x->domain)) - /* yes, it really is empty, not not empty */ - { - lslOp op = (lslOp) dmalloc (sizeof (*op)); - - op->name = nameNode_copy (nn); - op->signature = x; - (void) sortSet_insert (n->possibleSorts, sigNode_rangeSort (x)); - (void) lslOpSet_insert (n->possibleOps, op); - } - } end_sigNodeSet_elements; - } - - nameNode_free (nn); - - if (sortSet_size (n->possibleSorts) == 0) - { - lclerror - (varid, - message ("Unrecognized identifier (constant, variable or operator): %s", - ltoken_getRawString (varid))); - - } - - n->sort = sort_makeNoSort (); - n->literal = varid; - n->kind = TRM_ZEROARY; - } - } - - return (n); -} - -/*@only@*/ termNode -makeSelectTermNode (termNode pri, ltoken select, /*@dependent@*/ ltoken id) -{ - termNode t = (termNode) dmalloc (sizeof (*t)); - opFormNode opform = makeOpFormNode (select, - OPF_MSELECT, opFormUnion_createAnyOp (id), - ltoken_undefined); - nameNode nn = makeNameNodeForm (opform); - termNodeList args = termNodeList_new (); - - t->error_reported = FALSE; - t->wrapped = 0; - t->name = nn; - t->kind = TRM_APPLICATION; - termNodeList_addh (args, pri); - t->args = args; - t->kind = TRM_APPLICATION; - t->sort = sort_makeNoSort (); - t->given = t->sort; - t->possibleSorts = sortSet_new (); - t->possibleOps = lslOpSet_new (); - - return t; -} - -/*@only@*/ termNode -makeMapTermNode (termNode pri, ltoken map, /*@dependent@*/ ltoken id) -{ - termNode t = (termNode) dmalloc (sizeof (*t)); - opFormNode opform = makeOpFormNode (map, OPF_MMAP, opFormUnion_createAnyOp (id), - ltoken_undefined); - nameNode nn = makeNameNodeForm (opform); - termNodeList args = termNodeList_new (); - - t->error_reported = FALSE; - t->wrapped = 0; - t->kind = TRM_APPLICATION; - t->name = nn; - termNodeList_addh (args, pri); - t->args = args; - t->kind = TRM_APPLICATION; - t->sort = sort_makeNoSort (); - t->given = t->sort; - t->possibleSorts = sortSet_new (); - t->possibleOps = lslOpSet_new (); - return t; -} - -/*@only@*/ termNode -makeLiteralTermNode (ltoken tok, sort s) -{ - nameNode nn = makeNameNodeId (ltoken_copy (tok)); - opInfo oi = symtable_opInfo (g_symtab, nn); - lslOp op = (lslOp) dmalloc (sizeof (*op)); - termNode n = (termNode) dmalloc (sizeof (*n)); - sigNode sign; - ltoken range; - - n->name = nn; - n->error_reported = FALSE; - n->wrapped = 0; - n->kind = TRM_LITERAL; - n->literal = tok; - n->given = sort_makeNoSort (); - n->sort = n->given; - n->args = termNodeList_new (); - n->possibleSorts = sortSet_new (); - n->possibleOps = lslOpSet_new (); - - /* look up signatures for this operator too */ - - range = ltoken_create (simpleId, sort_getLsymbol (s)); - sign = makesigNode (ltoken_undefined, ltokenList_new (), - ltoken_copy (range)); - - if (opInfo_exists (oi) && (oi->name->isOpId) - && (sigNodeSet_size (oi->signatures) > 0)) - { - sigNodeSet_elements (oi->signatures, x) - { - if (ltokenList_empty (x->domain)) - { - lslOp opn = (lslOp) dmalloc (sizeof (*opn)); - sort sort; - - opn->name = nameNode_copy (nn); - opn->signature = x; - sort = sigNode_rangeSort (x); - (void) sortSet_insert (n->possibleSorts, sort); - (void) lslOpSet_insert (n->possibleOps, opn); - } - } end_sigNodeSet_elements; - } - - /* insert into literal term */ - (void) sortSet_insert (n->possibleSorts, s); - - op->name = nameNode_copy (nn); - op->signature = sign; - (void) lslOpSet_insert (n->possibleOps, op); - - /* enter the literal as an operator into the operator table */ - /* 8/9/93. C's char constant 'c' syntax conflicts - with LSL's lslinit.lsi table. Throw out, because it's not - needed anyway. */ - /* symtable_enterOp (g_symtab, nn, sign); */ - - if (s == sort_int) - { - sigNode osign; - lslOp opn = (lslOp) dmalloc (sizeof (*opn)); - - /* if it is a C int, we should overload it as double too because - C allows you to say "x > 2". */ - - (void) sortSet_insert (n->possibleSorts, sort_double); - - ltoken_setText (range, lsymbol_fromChars ("double")); - osign = makesigNode (ltoken_undefined, ltokenList_new (), range); - opn->name = nameNode_copy (nn); - opn->signature = osign; - (void) lslOpSet_insert (n->possibleOps, opn); - - symtable_enterOp (g_symtab, nameNode_copySafe (nn), sigNode_copy (osign)); - } - else - { - ltoken_free (range); - } - - /* future: could overload cstrings to be both char_Vec as well as - char_ObjPtr */ - - /*@-mustfree@*/ - return n; -} /*@=mustfree@*/ - -/*@only@*/ termNode -makeUnchangedTermNode1 (ltoken op, /*@unused@*/ ltoken all) -{ - termNode t = (termNode) dmalloc (sizeof (*t)); - - t->error_reported = FALSE; - t->wrapped = 0; - t->kind = TRM_UNCHANGEDALL; - t->sort = sort_bool; - t->literal = op; - t->given = sort_makeNoSort (); - t->name = NULL; /*< missing this >*/ - t->args = termNodeList_new (); - t->possibleSorts = sortSet_new (); - t->possibleOps = lslOpSet_new (); - (void) sortSet_insert (t->possibleSorts, t->sort); - - ltoken_free (all); - - return t; -} - -/*@only@*/ termNode -makeUnchangedTermNode2 (ltoken op, storeRefNodeList x) -{ - termNode t = (termNode) dmalloc (sizeof (*t)); - ltoken errtok; - sort sort; - - t->name = NULL; /*< missing this >*/ - t->error_reported = FALSE; - t->wrapped = 0; - t->kind = TRM_UNCHANGEDOTHERS; - t->sort = sort_bool; - t->literal = op; - t->unchanged = x; - t->given = sort_makeNoSort (); - t->possibleSorts = sortSet_new (); - t->possibleOps = lslOpSet_new (); - t->args = termNodeList_new (); - - (void) sortSet_insert (t->possibleSorts, t->sort); - /* check storeRefNode's are mutable, uses sort of term */ - - storeRefNodeList_elements (x, sto) - { - if (storeRefNode_isTerm (sto)) - { - sort = sto->content.term->sort; - if (!sort_mutable (sort)) - { - errtok = termNode_errorToken (sto->content.term); - lclerror (errtok, - message ("Term denoting immutable object used in unchanged list: %q", - termNode_unparse (sto->content.term))); - } - } - else - { - if (storeRefNode_isType (sto)) - { - lclTypeSpecNode type = sto->content.type; - sort = lclTypeSpecNode2sort (type); - if (!sort_mutable (sort)) - { - errtok = lclTypeSpecNode_errorToken (type); - lclerror (errtok, message ("Immutable type used in unchanged list: %q", - sort_unparse (sort))); - } - } - } - } end_storeRefNodeList_elements; - - return t; -} - -/*@only@*/ termNode - makeSizeofTermNode (ltoken op, lclTypeSpecNode type) -{ - termNode t = (termNode) dmalloc (sizeof (*t)); - - t->name = NULL; /*< missing this >*/ - t->error_reported = FALSE; - t->wrapped = 0; - t->kind = TRM_SIZEOF; - t->sort = sort_int; - t->literal = op; - t->sizeofField = type; - t->given = sort_makeNoSort (); - t->possibleSorts = sortSet_new (); - t->possibleOps = lslOpSet_new (); - t->args = termNodeList_new (); - - (void) sortSet_insert (t->possibleSorts, t->sort); - /* nothing to check */ - return (t); -} - -/*@only@*/ cstring -claimNode_unparse (claimNode c) -{ - if (c != (claimNode) 0) - { - cstring s = message ("claims (%q)%q{\n%q", - paramNodeList_unparse (c->params), - varDeclarationNodeList_unparse (c->globals), - lclPredicateNode_unparse (c->require)); - - if (c->body != NULL) - { - s = message ("%qbody {%q}\n", s, programNode_unparse (c->body)); - } - s = message ("%q%q}\n", s, lclPredicateNode_unparse (c->ensures)); - return s; - } - return cstring_undefined; -} - -static void -WrongArity (ltoken tok, int expect, int size) -{ - lclerror (tok, message ("Expecting %d arguments but given %d", expect, size)); -} - -static cstring -printTermNode2 (/*@null@*/ opFormNode op, termNodeList args, sort sort) -{ - if (op != (opFormNode) 0) - { - cstring s = cstring_undefined; - cstring sortText; - cstring sortSpace; - - if (sort != sort_makeNoSort ()) - { - sortText = message (": %s", cstring_fromChars (lsymbol_toChars (sort_getLsymbol (sort)))); - sortSpace = cstring_makeLiteral (" "); - } - else - { - sortText = cstring_undefined; - sortSpace = cstring_undefined; - } - - switch (op->kind) - { - case OPF_IF: - { - int size = termNodeList_size (args); - - if (size == 3) - { - s = message ("if %q then %q else %q\n", - termNode_unparse (termNodeList_getN (args, 0)), - termNode_unparse (termNodeList_getN (args, 1)), - termNode_unparse (termNodeList_getN (args, 2))); - } - else - { - WrongArity (op->tok, 3, size); - s = cstring_makeLiteral ("if __ then __ else __"); - } - s = message ("%q%s", s, sortText); - break; - } - case OPF_ANYOP: - { /* ymtan ? */ - s = message ("%s %s", - ltoken_getRawString (op->content.anyop), - sortText); - break; - } - case OPF_MANYOP: - { - int size = termNodeList_size (args); - - if (size == 1) - { - s = message ("%q ", termNode_unparse (termNodeList_head (args))); - } - else - { - WrongArity (op->content.anyop, 1, size); - s = cstring_makeLiteral ("__ "); - } - s = message ("%q%s%s", s, ltoken_getRawString (op->content.anyop), - sortText); - break; - } - case OPF_ANYOPM: - { - int size = termNodeList_size (args); - - s = message ("%s ", ltoken_getRawString (op->content.anyop)); - - if (size == 1) - { - s = message ("%q%q", s, termNode_unparse (termNodeList_head (args))); - } - else - { - WrongArity (op->content.anyop, 1, size); - s = message ("%q__", s); - } - s = message ("%q%s", s, sortText); - break; - } - case OPF_MANYOPM: - { - int size = termNodeList_size (args); - - if (size == 2) - { - s = message ("%q %s %q", - termNode_unparse (termNodeList_getN (args, 0)), - ltoken_getRawString (op->content.anyop), - termNode_unparse (termNodeList_getN (args, 1))); - } - else - { - WrongArity (op->content.anyop, 2, size); - s = message ("__ %s __", ltoken_getRawString (op->content.anyop)); - } - s = message ("%q%s", s, sortText); - break; - } - case OPF_MIDDLE: - { - int size = termNodeList_size (args); - int expect = op->content.middle; - - /* ymtan ? use { or openSym token ? */ - - if (size == expect) - { - s = message ("{%q}", termNodeList_unparse (args)); - } - else - { - WrongArity (op->tok, expect, size); - s = cstring_makeLiteral ("{ * }"); - } - - s = message ("%q%s", s, sortText); - break; /*** <<<--- bug detected by LCLint ***/ - } - case OPF_MMIDDLE: - { - int size = termNodeList_size (args); - int expect = op->content.middle + 1; - - if (size == expect) - { - s = message ("%q{%q}", - termNode_unparse (termNodeList_head (args)), - termNodeList_unparseTail (args)); - } - else - { - WrongArity (op->tok, expect, size); - s = cstring_makeLiteral ("__ { * }"); - } - - s = message ("%q%s", s, sortText); - break; - } - case OPF_MIDDLEM: - { - int size = termNodeList_size (args); - int expect = op->content.middle + 1; - - if (size == expect) - { - termNodeList_finish (args); - - s = message ("{%q}%s%s%q", - termNodeList_unparseToCurrent (args), - sortText, sortSpace, - termNode_unparse (termNodeList_current (args))); - } - else - { - WrongArity (op->tok, expect, size); - - s = message ("{ * }%s __", sortText); - - /* used to put in extra space! evs 94-01-05 */ - } - break; - } - case OPF_MMIDDLEM: - { - int size = termNodeList_size (args); - int expect = op->content.middle + 2; - - if (size == expect) - { - termNodeList_finish (args); - - s = message ("%q {%q} %s%s%q", - termNode_unparse (termNodeList_head (args)), - termNodeList_unparseSecondToCurrent (args), - sortText, sortSpace, - termNode_unparse (termNodeList_current (args))); - } - else - { - WrongArity (op->tok, expect, size); - s = message ("__ { * } %s __", sortText); - - /* also had extra space? */ - } - break; - } - case OPF_BMIDDLE: - { - int size = termNodeList_size (args); - int expect = op->content.middle; - - if (size == expect) - { - s = message ("[%q]", termNodeList_unparse (args)); - } - else - { - WrongArity (op->tok, expect, size); - s = cstring_makeLiteral ("[ * ]"); - } - s = message ("%q%s", s, sortText); - break; - } - case OPF_BMMIDDLE: - { - int size = termNodeList_size (args); - int expect = op->content.middle + 1; - - if (size == expect) - { - s = message ("%q[%q]", - termNode_unparse (termNodeList_head (args)), - termNodeList_unparseTail (args)); - } - else - { - WrongArity (op->tok, expect, size); - s = cstring_makeLiteral ("__ [ * ]"); - } - - s = message ("%q%s", s, sortText); - break; - } - case OPF_BMMIDDLEM: - { - int size = termNodeList_size (args); - int expect = op->content.middle + 1; - - if (size == expect) - { - s = message ("%q[%q] __", - termNode_unparse (termNodeList_head (args)), - termNodeList_unparseTail (args)); - } - else - { - WrongArity (op->tok, expect, size); - s = cstring_makeLiteral ("__ [ * ] __"); - } - s = message ("%q%s", s, sortText); - break; - } - case OPF_BMIDDLEM: - { - int size = termNodeList_size (args); - int expect = op->content.middle + 1; - - if (size == expect) - { - termNodeList_finish (args); - - s = message ("[%q]%s%s%q", - termNodeList_unparseToCurrent (args), - sortText, sortSpace, - termNode_unparse (termNodeList_current (args))); - } - else - { - WrongArity (op->tok, expect, size); - s = cstring_makeLiteral ("[ * ] __"); - } - - break; - } - case OPF_SELECT: - { /* ymtan constant, check args ? */ - s = cstring_prependChar ('.', ltoken_getRawString (op->content.id)); - break; - } - case OPF_MAP: - s = cstring_concat (cstring_makeLiteralTemp ("->"), - ltoken_getRawString (op->content.id)); - break; - case OPF_MSELECT: - { - int size = termNodeList_size (args); - - if (size == 1) - { - s = message ("%q.%s", termNode_unparse (termNodeList_head (args)), - ltoken_getRawString (op->content.id)); - } - else - { - WrongArity (op->content.id, 1, size); - s = cstring_concat (cstring_makeLiteralTemp ("__."), - ltoken_getRawString (op->content.id)); - } - break; - } - case OPF_MMAP: - { - int size = termNodeList_size (args); - - if (size == 1) - { - s = message ("%q->%s", termNode_unparse (termNodeList_head (args)), - ltoken_getRawString (op->content.id)); - } - else - { - WrongArity (op->content.id, 1, size); - s = cstring_concat (cstring_makeLiteralTemp ("__->"), - ltoken_getRawString (op->content.id)); - } - break; - } - } - - cstring_free (sortSpace); - cstring_free (sortText); - return s; - } - return cstring_undefined; -} - -/*@only@*/ cstring -termNode_unparse (/*@null@*/ termNode n) -{ - cstring s = cstring_undefined; - cstring back = cstring_undefined; - cstring front = cstring_undefined; - int count; - - if (n != (termNode) 0) - { - for (count = n->wrapped; count > 0; count--) - { - front = cstring_appendChar (front, '('); - back = cstring_appendChar (back, ')'); - } - - switch (n->kind) - { - case TRM_LITERAL: - case TRM_CONST: - case TRM_VAR: - case TRM_ZEROARY: - s = cstring_copy (ltoken_getRawString (n->literal)); - break; - case TRM_APPLICATION: - { - nameNode nn = n->name; - if (nn != (nameNode) 0) - { - if (nn->isOpId) - { - s = message ("%s (%q) ", - ltoken_getRawString (nn->content.opid), - termNodeList_unparse (n->args)); - /* must we handle n->given ? skip for now */ - } - else - { - s = message ("%q ", printTermNode2 (nn->content.opform, n->args, n->given)); - } - } - else - { - llfatalbug - (message ("termNode_unparse: expect non-empty nameNode: TRM_APPLICATION: %q", - nameNode_unparse (nn))); - } - break; - } - case TRM_UNCHANGEDALL: - s = cstring_makeLiteral ("unchanged (all)"); - break; - case TRM_UNCHANGEDOTHERS: - s = message ("unchanged (%q)", storeRefNodeList_unparse (n->unchanged)); - break; - case TRM_SIZEOF: - s = message ("sizeof (%q)", lclTypeSpecNode_unparse (n->sizeofField)); - break; - case TRM_QUANTIFIER: - { - quantifiedTermNode x = n->quantified; - s = message ("%q%s%q%s", - quantifierNodeList_unparse (x->quantifiers), - ltoken_getRawString (x->open), - termNode_unparse (x->body), - ltoken_getRawString (x->close)); - break; - } - } - } - return (message ("%q%q%q", front, s, back)); -} - -static void modifyNode_free (/*@null@*/ /*@only@*/ modifyNode m) -{ - if (m != (modifyNode) 0) - { - - if (m->hasStoreRefList) - { - storeRefNodeList_free (m->list); - /*@-branchstate@*/ - } - /*@=branchstate@*/ - - ltoken_free (m->tok); - sfree (m); - } -} - -/*@only@*/ cstring -modifyNode_unparse (/*@null@*/ modifyNode m) -{ - if (m != (modifyNode) 0) - { - if (m->hasStoreRefList) - { - return (message (" modifies %q; \n", storeRefNodeList_unparse (m->list))); - } - else - { - if (m->modifiesNothing) - { - return (cstring_makeLiteral ("modifies nothing; \n")); - } - else - { - return (cstring_makeLiteral ("modifies anything; \n")); - } - } - } - return cstring_undefined; -} - -/*@only@*/ cstring -programNode_unparse (programNode p) -{ - if (p != (programNode) 0) - { - cstring s = cstring_undefined; - int count; - - switch (p->kind) - { - case ACT_SELF: - { - cstring back = cstring_undefined; - - for (count = p->wrapped; count > 0; count--) - { - s = cstring_appendChar (s, '('); - back = cstring_appendChar (back, ')'); - } - s = message ("%q%q%q", s, stmtNode_unparse (p->content.self), back); - break; - } - case ACT_ITER: - s = message ("*(%q)", programNodeList_unparse (p->content.args)); - break; - case ACT_ALTERNATE: - s = message ("|(%q)", programNodeList_unparse (p->content.args)); - break; - case ACT_SEQUENCE: - s = programNodeList_unparse (p->content.args); - break; - } - - return s; - } - return cstring_undefined; -} - -/*@only@*/ cstring -stmtNode_unparse (stmtNode x) -{ - cstring s = cstring_undefined; - - if (x != (stmtNode) 0) - { - if (ltoken_isValid (x->lhs)) - { - s = cstring_concat (ltoken_getRawString (x->lhs), - cstring_makeLiteralTemp (" = ")); - } - - s = message ("%q%s (%q)", s, - ltoken_getRawString (x->operator), - termNodeList_unparse (x->args)); - } - - return s; -} - -/*@only@*/ lslOp - makelslOpNode (/*@only@*/ /*@null@*/ nameNode name, - /*@dependent@*/ sigNode s) -{ - lslOp x = (lslOp) dmalloc (sizeof (*x)); - - x->name = name; - x->signature = s; - - /* enter operator info into symtab */ - /* if not, they may need to be renamed in LCL imports */ - - if (g_lslParsingTraits) - { - if (name != NULL) - { - symtable_enterOp (g_symtab, nameNode_copySafe (name), sigNode_copy (s)); - } - } - else - { - /* nameNode_free (name); */ /* YIKES! */ - } - - return x; -} - -/*@only@*/ cstring -lslOp_unparse (lslOp x) -{ - char *s = mstring_createEmpty (); - - if (x != (lslOp) 0) - { - s = mstring_concatFree (s, cstring_toCharsSafe (nameNode_unparse (x->name))); - - if (x->signature != (sigNode) 0) - { - s = mstring_concatFree (s, cstring_toCharsSafe (sigNode_unparse (x->signature))); - } - } - - return cstring_fromCharsO (s); -} - -static bool -sameOpFormNode (/*@null@*/ opFormNode n1, /*@null@*/ opFormNode n2) -{ - if (n1 == n2) - return TRUE; - - if (n1 == 0) - return FALSE; - - if (n2 == 0) - return FALSE; - - if (n1->kind == n2->kind) - { - switch (n1->kind) - { - case OPF_IF: - return TRUE; - case OPF_ANYOP: - case OPF_MANYOP: - case OPF_ANYOPM: - return (ltoken_similar (n1->content.anyop, n2->content.anyop)); - case OPF_MANYOPM: - { - /* want to treat eq and = the same */ - return ltoken_similar (n1->content.anyop, n2->content.anyop); - } - case OPF_MIDDLE: - case OPF_MMIDDLE: - case OPF_MIDDLEM: - case OPF_MMIDDLEM: - /* need to check the rawText of openSym and closeSym */ - if ((int) n1->content.middle == (int) n2->content.middle) - { - if (lsymbol_equal (ltoken_getRawText (n1->tok), - ltoken_getRawText (n2->tok)) && - lsymbol_equal (ltoken_getRawText (n1->close), - ltoken_getRawText (n2->close))) - return TRUE; - } - return FALSE; - case OPF_BMIDDLE: - case OPF_BMMIDDLE: - case OPF_BMIDDLEM: - case OPF_BMMIDDLEM: - return ((int) n1->content.middle == (int) n2->content.middle); - case OPF_SELECT: - case OPF_MAP: - case OPF_MSELECT: - case OPF_MMAP: - return (ltoken_similar (n1->content.id, n2->content.id)); - } - } - return FALSE; -} - -bool -sameNameNode (/*@null@*/ nameNode n1, /*@null@*/ nameNode n2) -{ - if (n1 == n2) - return TRUE; - if (n1 != (nameNode) 0 && n2 != (nameNode) 0) - { - if (bool_equal (n1->isOpId, n2->isOpId)) - { - if (n1->isOpId) - return (ltoken_similar (n1->content.opid, n2->content.opid)); - else - return sameOpFormNode (n1->content.opform, - n2->content.opform); - } - } - return FALSE; -} - -void CTypesNode_free (/*@only@*/ /*@null@*/ CTypesNode x) -{ - if (x != NULL) - { - ltokenList_free (x->ctypes); - sfree (x); - } -} - -/*@null@*/ CTypesNode CTypesNode_copy (/*@null@*/ CTypesNode x) -{ - if (x != NULL) - { - CTypesNode newnode = (CTypesNode) dmalloc (sizeof (*newnode)); - newnode->intfield = x->intfield; - newnode->ctypes = ltokenList_copy (x->ctypes); - newnode->sort = x->sort; - - return newnode; - } - else - { - return NULL; - } -} - -/*@only@*/ CTypesNode - makeCTypesNode (/*@only@*/ CTypesNode ctypes, ltoken ct) -{ - /*@only@*/ CTypesNode newnode; - lsymbol sortname; - bits sortbits; - - if (ctypes == (CTypesNode) NULL) - { - newnode = (CTypesNode) dmalloc (sizeof (*newnode)); - newnode->intfield = 0; - newnode->ctypes = ltokenList_new (); - newnode->sort = sort_makeNoSort (); - } - else - { - newnode = ctypes; - } - - if ((ltoken_getIntField (ct) & newnode->intfield) != 0) - { - lclerror (ct, - message - ("Duplicate type specifier ignored: %s", - cstring_fromChars - (lsymbol_toChars - (lclctype_toSortDebug (ltoken_getIntField (ct)))))); - - /* evs --- don't know how to generator this error */ - - /* Use previous value, to keep things consistent */ - ltoken_free (ct); - return newnode; - } - - sortbits = newnode->intfield | ltoken_getIntField (ct); - sortname = lclctype_toSort (sortbits); - - if (sortname == lsymbol_fromChars ("error")) - { - lclerror (ct, cstring_makeLiteral ("Invalid combination of type specifiers")); - } - else - { - newnode->intfield = sortbits; - } - - ltokenList_addh (newnode->ctypes, ct); - - /* - ** Sorts are assigned after CTypesNode is created during parsing, - ** see bison grammar. - */ - - return newnode; -} - -/*@only@*/ CTypesNode -makeTypeSpecifier (ltoken typedefname) -{ - CTypesNode newnode = (CTypesNode) dmalloc (sizeof (*newnode)); - typeInfo ti = symtable_typeInfo (g_symtab, ltoken_getText (typedefname)); - - newnode->intfield = 0; - newnode->ctypes = ltokenList_singleton (ltoken_copy (typedefname)); - - /* if we see "bool" include bool.h header file */ - - if (ltoken_getText (typedefname) == lsymbol_bool) - { - lhIncludeBool (); - } - - if (typeInfo_exists (ti)) - { - /* must we be concern about whether this type is exported by module? - No. Because all typedef's are exported. No hiding supported. */ - /* Later, may want to keep types around too */ - /* 3/2/93, use underlying sort */ - newnode->sort = sort_getUnderlying (ti->basedOn); - } - else - { - lclerror (typedefname, message ("Unrecognized type: %s", - ltoken_getRawString (typedefname))); - /* evs --- Don't know how to get this message */ - - newnode->sort = sort_makeNoSort (); - } - - ltoken_free (typedefname); - return newnode; -} - -bool sigNode_equal (sigNode n1, sigNode n2) -{ - /* n1 and n2 are never 0 */ - - return ((n1 == n2) || - (n1->key == n2->key && - ltoken_similar (n1->range, n2->range) && - ltokenList_equal (n1->domain, n2->domain))); -} - -sort -typeExpr2ptrSort (sort base, /*@null@*/ typeExpr t) -{ - if (t != (typeExpr) 0) - { - switch (t->kind) - { - case TEXPR_BASE: - return base; - case TEXPR_PTR: - return typeExpr2ptrSort (sort_makePtr (ltoken_undefined, base), - t->content.pointer); - case TEXPR_ARRAY: - return typeExpr2ptrSort (sort_makeArr (ltoken_undefined, base), - t->content.array.elementtype); - case TEXPR_FCN: - /* map all hof types to some sort of SRT_HOF */ - return sort_makeHOFSort (base); - } - } - return base; -} - -static sort -typeExpr2returnSort (sort base, /*@null@*/ typeExpr t) -{ - if (t != (typeExpr) 0) - { - switch (t->kind) - { - case TEXPR_BASE: - return base; - case TEXPR_PTR: - return typeExpr2returnSort (sort_makePtr (ltoken_undefined, base), - t->content.pointer); - case TEXPR_ARRAY: - return typeExpr2returnSort (sort_makeArr (ltoken_undefined, base), - t->content.array.elementtype); - case TEXPR_FCN: - return typeExpr2returnSort (base, t->content.function.returntype); - } - } - return base; -} - -sort -lclTypeSpecNode2sort (lclTypeSpecNode type) -{ - if (type != (lclTypeSpecNode) 0) - { - switch (type->kind) - { - case LTS_TYPE: - llassert (type->content.type != NULL); - return sort_makePtrN (type->content.type->sort, type->pointers); - case LTS_STRUCTUNION: - llassert (type->content.structorunion != NULL); - return sort_makePtrN (type->content.structorunion->sort, - type->pointers); - case LTS_ENUM: - llassert (type->content.enumspec != NULL); - return sort_makePtrN (type->content.enumspec->sort, - type->pointers); - case LTS_CONJ: - return (lclTypeSpecNode2sort (type->content.conj->a)); - } - } - return (sort_makeNoSort ()); -} - -lsymbol -checkAndEnterTag (tagKind k, ltoken opttagid) -{ - /* should be tagKind, instead of int */ - tagInfo t; - sort sort = sort_makeNoSort (); - - if (!ltoken_isUndefined (opttagid)) - { - switch (k) - { - case TAG_FWDSTRUCT: - case TAG_STRUCT: - sort = sort_makeStr (opttagid); - break; - case TAG_FWDUNION: - case TAG_UNION: - sort = sort_makeUnion (opttagid); - break; - case TAG_ENUM: - sort = sort_makeEnum (opttagid); - break; - } - - /* see if it is already in symbol table */ - t = symtable_tagInfo (g_symtab, ltoken_getText (opttagid)); - - if (tagInfo_exists (t)) - { - if (t->kind == TAG_FWDUNION || t->kind == TAG_FWDSTRUCT) - { - /* this is fine, for mutually recursive types */ - } - else - { /* this is not good, complain later */ - cstring s; - - switch (k) - { - case TAG_ENUM: - s = cstring_makeLiteral ("Enum"); - break; - case TAG_STRUCT: - case TAG_FWDSTRUCT: - s = cstring_makeLiteral ("Struct"); - break; - case TAG_UNION: - case TAG_FWDUNION: - s = cstring_makeLiteral ("Union"); - break; - } - - t->sort = sort; - t->kind = k; - lclerror (opttagid, - message ("Tag redefined: %q %s", s, - ltoken_getRawString (opttagid))); - - } - - ltoken_free (opttagid); - } - else - { - tagInfo newnode = (tagInfo) dmalloc (sizeof (*newnode)); - - newnode->sort = sort; - newnode->kind = k; - newnode->id = opttagid; - newnode->imported = FALSE; - newnode->content.decls = stDeclNodeList_new (); - - (void) symtable_enterTag (g_symtab, newnode); - } - } - - return sort_getLsymbol (sort); -} - -static sort -extractReturnSort (lclTypeSpecNode t, declaratorNode d) -{ - sort sort; - sort = lclTypeSpecNode2sort (t); - sort = typeExpr2returnSort (sort, d->type); - return sort; -} - -void -signNode_free (/*@only@*/ signNode sn) -{ - sortList_free (sn->domain); - ltoken_free (sn->tok); - sfree (sn); -} - -/*@only@*/ cstring -signNode_unparse (signNode sn) -{ - cstring s = cstring_undefined; - - if (sn != (signNode) 0) - { - s = message (": %q -> %s", sortList_unparse (sn->domain), - sort_unparseName (sn->range)); - } - return s; -} - -static /*@only@*/ pairNodeList - globalList_toPairNodeList (globalList g) -{ - /* expect list to be globals, drop private ones */ - pairNodeList result = pairNodeList_new (); - pairNode p; - declaratorNode vdnode; - lclTypeSpecNode type; - sort sort; - lsymbol sym; - initDeclNodeList decls; - - varDeclarationNodeList_elements (g, x) - { - if (x->isSpecial) - { - ; - } - else - { - if (x->isGlobal && !x->isPrivate) - { - type = x->type; - decls = x->decls; - - initDeclNodeList_elements (decls, init) - { - p = (pairNode) dmalloc (sizeof (*p)); - - vdnode = init->declarator; - sym = ltoken_getText (vdnode->id); - /* 2/21/93, not sure if it should be extractReturnSort, - or some call to typeExpr2ptrSort */ - sort = extractReturnSort (type, vdnode); - p->sort = sort_makeGlobal (sort); - /* if (!sort_isArrayKind (sort)) p->sort = sort_makeObj (sort); - else p->sort = sort; */ - /* p->name = sym; */ - p->tok = ltoken_copy (vdnode->id); - pairNodeList_addh (result, p); - } end_initDeclNodeList_elements; - } - } - } end_varDeclarationNodeList_elements; - return result; -} - -void -enteringFcnScope (lclTypeSpecNode t, declaratorNode d, globalList g) -{ - scopeInfo si = (scopeInfo) dmalloc (sizeof (*si)); - varInfo vi = (varInfo) dmalloc (sizeof (*vi)); - sort returnSort; - ltoken result = ltoken_copy (ltoken_id); - pairNodeList paramPairs, globals; - fctInfo fi = (fctInfo) dmalloc (sizeof (*fi)); - signNode sign = (signNode) dmalloc (sizeof (*sign)); - sortList domain = sortList_new (); - unsigned int key; - - paramPairs = extractParams (d->type); - returnSort = extractReturnSort (t, d); - globals = globalList_toPairNodeList (g); - - sign->tok = ltoken_undefined; - sign->range = returnSort; - - key = MASH (0, sort_getLsymbol (returnSort)); - - pairNodeList_elements (paramPairs, p) - { - sortList_addh (domain, p->sort); - key = MASH (key, sort_getLsymbol (p->sort)); - } end_pairNodeList_elements; - - sign->domain = domain; - sign->key = key; - - /* push fcn onto symbol table stack first */ - fi->id = ltoken_copy (d->id); - fi->export = TRUE; - fi->signature = sign; - fi->globals = globals; - - (void) symtable_enterFct (g_symtab, fi); - - /* push new fcn scope */ - si->kind = SPE_FCN; - symtable_enterScope (g_symtab, si); - - /* add "result" with return type to current scope */ - ltoken_setText (result, lsymbol_fromChars ("result")); - - vi->id = result; - vi->sort = sort_makeFormal (returnSort); /* make appropriate values */ - vi->kind = VRK_PARAM; - vi->export = TRUE; - - (void) symtable_enterVar (g_symtab, vi); - - /* - ** evs - 4 Mar 1995 - ** pust globals first (they are in outer scope) - */ - - /* push onto symbol table the global variables declared in this function, - together with their respective sorts */ - - pairNodeList_elements (globals, gl) - { - ltoken_free (vi->id); - vi->id = ltoken_copy (gl->tok); - vi->kind = VRK_GLOBAL; - vi->sort = gl->sort; - (void) symtable_enterVar (g_symtab, vi); - } end_pairNodeList_elements; - - /* - ** could enter a new scope; instead, warn when variable shadows global - ** that is used - */ - - /* - ** push onto symbol table the formal parameters of this function, - ** together with their respective sorts - */ - - pairNodeList_elements (paramPairs, pair) - { - ltoken_free (vi->id); - vi->id = ltoken_copy (pair->tok); - vi->sort = pair->sort; - vi->kind = VRK_PARAM; - (void) symtable_enterVar (g_symtab, vi); - } end_pairNodeList_elements; - - pairNodeList_free (paramPairs); - varInfo_free (vi); -} - -void -enteringClaimScope (paramNodeList params, globalList g) -{ - scopeInfo si = (scopeInfo) dmalloc (sizeof (*si)); - pairNodeList globals; - lclTypeSpecNode paramtype; - typeExpr paramdecl; - sort sort; - - globals = globalList_toPairNodeList (g); - /* push new claim scope */ - si->kind = SPE_CLAIM; - - symtable_enterScope (g_symtab, si); - - /* push onto symbol table the formal parameters of this function, - together with their respective sorts */ - - paramNodeList_elements (params, param) - { - paramdecl = param->paramdecl; - paramtype = param->type; - if (paramdecl != (typeExpr) 0 && paramtype != (lclTypeSpecNode) 0) - { - varInfo vi = (varInfo) dmalloc (sizeof (*vi)); - - sort = lclTypeSpecNode2sort (paramtype); - sort = sort_makeFormal (sort); - vi->sort = typeExpr2ptrSort (sort, paramdecl); - vi->id = ltoken_copy (extractDeclarator (paramdecl)); - vi->kind = VRK_PARAM; - vi->export = TRUE; - - (void) symtable_enterVar (g_symtab, vi); - varInfo_free (vi); - } - } end_paramNodeList_elements; - - /* push onto symbol table the global variables declared in this function, - together with their respective sorts */ - - pairNodeList_elements (globals, g2) - { - varInfo vi = (varInfo) dmalloc (sizeof (*vi)); - - vi->id = ltoken_copy (g2->tok); - vi->kind = VRK_GLOBAL; - vi->sort = g2->sort; - vi->export = TRUE; - - /* should catch duplicates in formals */ - (void) symtable_enterVar (g_symtab, vi); - varInfo_free (vi); - } end_pairNodeList_elements; - - pairNodeList_free (globals); - /* should not free it here! ltoken_free (claimId); @*/ -} - -static /*@only@*/ pairNodeList - extractParams (/*@null@*/ typeExpr te) -{ - /* extract the parameters from a function header declarator's typeExpr */ - sort sort; - typeExpr paramdecl; - paramNodeList params; - lclTypeSpecNode paramtype; - pairNodeList head = pairNodeList_new (); - pairNode pair; - - if (te != (typeExpr) 0) - { - params = typeExpr_toParamNodeList (te); - if (paramNodeList_isDefined (params)) - { - paramNodeList_elements (params, param) - { - paramdecl = param->paramdecl; - paramtype = param->type; - if (paramdecl != (typeExpr) 0 && paramtype != (lclTypeSpecNode) 0) - { - pair = (pairNode) dmalloc (sizeof (*pair)); - sort = lclTypeSpecNode2sort (paramtype); - /* 2/17/93, was sort_makeVal (sort) */ - sort = sort_makeFormal (sort); - pair->sort = typeExpr2ptrSort (sort, paramdecl); - /* pair->name = ltoken_getText (extractDeclarator (paramdecl)); */ - pair->tok = ltoken_copy (extractDeclarator (paramdecl)); - pairNodeList_addh (head, pair); - } - } end_paramNodeList_elements; - } - } - return head; -} - -sort -sigNode_rangeSort (sigNode sig) -{ - if (sig == (sigNode) 0) - { - return sort_makeNoSort (); - } - else - { - return sort_fromLsymbol (ltoken_getText (sig->range)); - } -} - -/*@only@*/ sortList - sigNode_domain (sigNode sig) -{ - sortList domain = sortList_new (); - - if (sig == (sigNode) 0) - { - ; - } - else - { - ltokenList dom = sig->domain; - - ltokenList_elements (dom, tok) - { - sortList_addh (domain, sort_fromLsymbol (ltoken_getText (tok))); - } end_ltokenList_elements; - } - - return domain; -} - -opFormUnion -opFormUnion_createAnyOp (/*@temp@*/ ltoken t) -{ - opFormUnion u; - - /* do not distinguish between .anyop and .id */ - u.anyop = t; - return u; -} - -opFormUnion -opFormUnion_createMiddle (int middle) -{ - opFormUnion u; - - u.middle = middle; - return u; -} - -paramNode -markYieldParamNode (paramNode p) -{ - p->kind = PYIELD; - - llassert (p->type != NULL); - p->type->quals = qualList_add (p->type->quals, qual_createYield ()); - - return (p); -} - -/*@only@*/ lclTypeSpecNode - lclTypeSpecNode_copySafe (lclTypeSpecNode n) -{ - lclTypeSpecNode ret = lclTypeSpecNode_copy (n); - - llassert (ret != NULL); - return ret; -} - -/*@null@*/ /*@only@*/ lclTypeSpecNode - lclTypeSpecNode_copy (/*@null@*/ lclTypeSpecNode n) -{ - if (n != NULL) - { - switch (n->kind) - { - case LTS_CONJ: - return (makeLclTypeSpecNodeConj (lclTypeSpecNode_copy (n->content.conj->a), - lclTypeSpecNode_copy (n->content.conj->b))); - case LTS_TYPE: - return (makeLclTypeSpecNodeType (CTypesNode_copy (n->content.type))); - case LTS_STRUCTUNION: - return (makeLclTypeSpecNodeSU (strOrUnionNode_copy (n->content.structorunion))); - case LTS_ENUM: - return (makeLclTypeSpecNodeEnum (enumSpecNode_copy (n->content.enumspec))); - } - } - - return NULL; -} - -void lclTypeSpecNode_free (/*@null@*/ /*@only@*/ lclTypeSpecNode n) -{ - if (n != NULL) - { - switch (n->kind) - { - case LTS_CONJ: - lclTypeSpecNode_free (n->content.conj->a); - lclTypeSpecNode_free (n->content.conj->b); - break; - case LTS_TYPE: - CTypesNode_free (n->content.type); - break; - case LTS_STRUCTUNION: - strOrUnionNode_free (n->content.structorunion); - break; - case LTS_ENUM: - enumSpecNode_free (n->content.enumspec); - break; - } - - qualList_free (n->quals); - sfree (n); - } -} - -static /*@null@*/ opFormNode opFormNode_copy (/*@null@*/ opFormNode op) -{ - if (op != NULL) - { - opFormNode ret = (opFormNode) dmalloc (sizeof (*ret)); - - ret->tok = ltoken_copy (op->tok); - ret->kind = op->kind; - ret->content = op->content; - ret->key = op->key; - ret->close = ltoken_copy (op->close); - - return ret; - } - else - { - return NULL; - } -} - -void opFormNode_free (/*@null@*/ opFormNode op) -{ - sfree (op); -} - -void nameNode_free (nameNode n) -{ - - if (n != NULL) - { - if (!n->isOpId) - { - opFormNode_free (n->content.opform); - } - - sfree (n); - } -} - -bool -lslOp_equal (lslOp x, lslOp y) -{ - return ((x == y) || - ((x != 0) && (y != 0) && - sameNameNode (x->name, y->name) && - sigNode_equal (x->signature, y->signature))); -} - -void lslOp_free (lslOp x) -{ - nameNode_free (x->name); - sfree (x); -} - -void sigNode_free (sigNode x) -{ - if (x != NULL) - { - ltokenList_free (x->domain); - ltoken_free (x->tok); - ltoken_free (x->range); - sfree (x); - } -} - -void declaratorNode_free (/*@null@*/ /*@only@*/ declaratorNode x) -{ - if (x != NULL) - { - typeExpr_free (x->type); - ltoken_free (x->id); - sfree (x); - } -} - -void abstBodyNode_free (/*@null@*/ /*@only@*/ abstBodyNode n) -{ - if (n != NULL) - { - lclPredicateNode_free (n->typeinv); - fcnNodeList_free (n->fcns); - ltoken_free (n->tok); - sfree (n); - } -} - -void fcnNode_free (/*@null@*/ /*@only@*/ fcnNode f) -{ - if (f != NULL) - { - lclTypeSpecNode_free (f->typespec); - declaratorNode_free (f->declarator); - globalList_free (f->globals); - varDeclarationNodeList_free (f->inits); - letDeclNodeList_free (f->lets); - lclPredicateNode_free (f->checks); - lclPredicateNode_free (f->require); - lclPredicateNode_free (f->claim); - lclPredicateNode_free (f->ensures); - modifyNode_free (f->modify); - ltoken_free (f->name); - sfree (f); - } -} - -void declaratorInvNode_free (/*@null@*/ /*@only@*/ declaratorInvNode x) -{ - if (x != NULL) - { - declaratorNode_free (x->declarator); - abstBodyNode_free (x->body); - sfree (x); - } -} - -/*@only@*/ lslOp lslOp_copy (lslOp x) -{ - return (makelslOpNode (nameNode_copy (x->name), x->signature)); -} - -sigNode sigNode_copy (sigNode s) -{ - llassert (s != NULL); - return (makesigNode (ltoken_copy (s->tok), - ltokenList_copy (s->domain), - ltoken_copy (s->range))); -} - -/*@null@*/ nameNode nameNode_copy (/*@null@*/ nameNode n) -{ - if (n == NULL) return NULL; - return nameNode_copySafe (n); -} - -nameNode nameNode_copySafe (nameNode n) -{ - if (n->isOpId) - { - return (makeNameNodeId (ltoken_copy (n->content.opid))); - } - else - { - /* error should be detected by lclint: forgot to copy opform! */ - return (makeNameNodeForm (opFormNode_copy (n->content.opform))); - } -} - -bool initDeclNode_isRedeclaration (initDeclNode d) -{ - return (d->declarator->isRedecl); -} - -void termNode_free (/*@only@*/ /*@null@*/ termNode t) -{ - sfree (t); -} - -/*@only@*/ termNode termNode_copySafe (termNode t) -{ - termNode ret = termNode_copy (t); - - llassert (ret != NULL); - return ret; -} - -/*@null@*/ /*@only@*/ termNode termNode_copy (/*@null@*/ termNode t) -{ - if (t != NULL) - { - termNode ret = (termNode) dmalloc (sizeof (*ret)); - - ret->wrapped = t->wrapped; - ret->kind = t->kind; - ret->sort = t->sort; - ret->given = t->given; - ret->possibleSorts = sortSet_copy (t->possibleSorts); - ret->error_reported = t->error_reported; - ret->possibleOps = lslOpSet_copy (t->possibleOps); - ret->name = nameNode_copy (t->name); - ret->args = termNodeList_copy (t->args); - - if (t->kind == TRM_LITERAL - || t->kind == TRM_SIZEOF - || t->kind == TRM_VAR - || t->kind == TRM_CONST - || t->kind == TRM_ZEROARY) - { - ret->literal = ltoken_copy (t->literal); - } - - if (t->kind == TRM_UNCHANGEDOTHERS) - { - ret->unchanged = storeRefNodeList_copy (t->unchanged); - } - - if (t->kind == TRM_QUANTIFIER) - { - ret->quantified = quantifiedTermNode_copy (t->quantified); - } - - if (t->kind == TRM_SIZEOF) - { - ret->sizeofField = lclTypeSpecNode_copySafe (t->sizeofField); - } - - return ret; - } - else - { - - return NULL; - } -} - -void importNode_free (/*@only@*/ /*@null@*/ importNode x) -{ - sfree (x); -} - -void initDeclNode_free (/*@only@*/ /*@null@*/ initDeclNode x) -{ - if (x != NULL) - { - declaratorNode_free (x->declarator); - termNode_free (x->value); - sfree (x); - } -} - -void letDeclNode_free (/*@only@*/ /*@null@*/ letDeclNode x) -{ - if (x != NULL) - { - lclTypeSpecNode_free (x->sortspec); - termNode_free (x->term); - ltoken_free (x->varid); - sfree (x); - } -} - -void pairNode_free (/*@only@*/ /*@null@*/ pairNode x) -{ - sfree (x); -} - -/*@null@*/ paramNode paramNode_copy (/*@null@*/ paramNode p) -{ - if (p != NULL) - { - paramNode ret = (paramNode) dmalloc (sizeof (*ret)); - - ret->type = lclTypeSpecNode_copy (p->type); - ret->paramdecl = typeExpr_copy (p->paramdecl); - ret->kind = p->kind; - return ret; - } - - return NULL; -} - -void paramNode_free (/*@only@*/ /*@null@*/ paramNode x) -{ - if (x != NULL) - { - lclTypeSpecNode_free (x->type); - typeExpr_free (x->paramdecl); - sfree (x); - } -} - -void programNode_free (/*@only@*/ /*@null@*/ programNode x) -{ - if (x != NULL) - { - switch (x->kind) - { - case ACT_SELF: stmtNode_free (x->content.self); break; - case ACT_ITER: - case ACT_ALTERNATE: - case ACT_SEQUENCE: programNodeList_free (x->content.args); break; - BADDEFAULT; - } - sfree (x); - } -} - -quantifierNode quantifierNode_copy (quantifierNode x) -{ - quantifierNode ret = (quantifierNode) dmalloc (sizeof (*ret)); - - ret->quant = ltoken_copy (x->quant); - ret->vars = varNodeList_copy (x->vars); - ret->isForall = x->isForall; - - return ret; -} - -void quantifierNode_free (/*@null@*/ /*@only@*/ quantifierNode x) -{ - if (x != NULL) - { - varNodeList_free (x->vars); - ltoken_free (x->quant); - sfree (x); - } -} - -void replaceNode_free (/*@only@*/ /*@null@*/ replaceNode x) -{ - if (x != NULL) - { - if (x->isCType) - { - ; - } - else - { - nameNode_free (x->content.renamesortname.name); - sigNode_free (x->content.renamesortname.signature); - } - - typeNameNode_free (x->typename); - ltoken_free (x->tok); - sfree (x); - } -} - -storeRefNode storeRefNode_copy (storeRefNode x) -{ - storeRefNode ret = (storeRefNode) dmalloc (sizeof (*ret)); - - ret->kind = x->kind; - - switch (x->kind) - { - case SRN_TERM: - ret->content.term = termNode_copySafe (x->content.term); - break; - case SRN_OBJ: case SRN_TYPE: - ret->content.type = lclTypeSpecNode_copy (x->content.type); - break; - case SRN_SPECIAL: - ret->content.ref = sRef_copy (x->content.ref); - break; - } - - return ret; -} - -void storeRefNode_free (/*@only@*/ /*@null@*/ storeRefNode x) -{ - if (x != NULL) - { - if (storeRefNode_isTerm (x)) - { - termNode_free (x->content.term); - } - else if (storeRefNode_isType (x) || storeRefNode_isObj (x)) - { - lclTypeSpecNode_free (x->content.type); - } - else - { - /* nothing to free */ - } - - sfree (x); - } -} - -stDeclNode stDeclNode_copy (stDeclNode x) -{ - stDeclNode ret = (stDeclNode) dmalloc (sizeof (*ret)); - - ret->lcltypespec = lclTypeSpecNode_copySafe (x->lcltypespec); - ret->declarators = declaratorNodeList_copy (x->declarators); - - return ret; -} - -void stDeclNode_free (/*@only@*/ /*@null@*/ stDeclNode x) -{ - if (x != NULL) - { - lclTypeSpecNode_free (x->lcltypespec); - declaratorNodeList_free (x->declarators); - sfree (x); - } -} - -void traitRefNode_free (/*@only@*/ /*@null@*/ traitRefNode x) -{ - if (x != NULL) - { - ltokenList_free (x->traitid); - renamingNode_free (x->rename); - sfree (x); - } -} - -void typeNameNode_free (/*@only@*/ /*@null@*/ typeNameNode n) -{ - if (n != NULL) - { - typeNamePack_free (n->typename); - opFormNode_free (n->opform); - sfree (n); - } -} - -void varDeclarationNode_free (/*@only@*/ /*@null@*/ varDeclarationNode x) -{ - if (x != NULL) - { - if (x->isSpecial) - { - ; - } - else - { - lclTypeSpecNode_free (x->type); - initDeclNodeList_free (x->decls); - sfree (x); - } - } -} - -varNode varNode_copy (varNode x) -{ - varNode ret = (varNode) dmalloc (sizeof (*ret)); - - ret->varid = ltoken_copy (x->varid); - ret->isObj = x->isObj; - ret->type = lclTypeSpecNode_copySafe (x->type); - ret->sort = x->sort; - - return ret; -} - -void varNode_free (/*@only@*/ /*@null@*/ varNode x) -{ - if (x != NULL) - { - lclTypeSpecNode_free (x->type); - ltoken_free (x->varid); - sfree (x); - } -} - -void stmtNode_free (/*@only@*/ /*@null@*/ stmtNode x) -{ - if (x != NULL) - { - ltoken_free (x->lhs); - termNodeList_free (x->args); - ltoken_free (x->operator); - sfree (x); - } -} - -void renamingNode_free (/*@only@*/ /*@null@*/ renamingNode x) -{ - if (x != NULL) - { - if (x->is_replace) - { - replaceNodeList_free (x->content.replace); - } - else - { - nameAndReplaceNode_free (x->content.name); - } - - sfree (x); - } -} - -void nameAndReplaceNode_free (/*@only@*/ /*@null@*/ nameAndReplaceNode x) -{ - if (x != NULL) - { - typeNameNodeList_free (x->namelist); - replaceNodeList_free (x->replacelist); - sfree (x); - } -} - -void typeNamePack_free (/*@only@*/ /*@null@*/ typeNamePack x) -{ - if (x != NULL) - { - lclTypeSpecNode_free (x->type); - abstDeclaratorNode_free (x->abst); - sfree (x); - } -} - -cstring interfaceNode_unparse (interfaceNode x) -{ - if (x != NULL) - { - switch (x->kind) - { - case INF_IMPORTS: - return (message ("[imports] %q", importNodeList_unparse (x->content.imports))); - case INF_USES: - return (message ("[uses] %q", traitRefNodeList_unparse (x->content.uses))); - case INF_EXPORT: - return (message ("[export] %q", exportNode_unparse (x->content.export))); - case INF_PRIVATE: - return (message ("[private] %q", privateNode_unparse (x->content.private))); - } - - BADBRANCH; - } - else - { - return (cstring_makeLiteral ("")); - } -} - -void interfaceNode_free (/*@null@*/ /*@only@*/ interfaceNode x) -{ - if (x != NULL) - { - - switch (x->kind) - { - case INF_IMPORTS: importNodeList_free (x->content.imports); break; - case INF_USES: traitRefNodeList_free (x->content.uses); break; - case INF_EXPORT: exportNode_free (x->content.export); break; - case INF_PRIVATE: privateNode_free (x->content.private); break; - } - sfree (x); - } -} - -void exportNode_free (/*@null@*/ /*@only@*/ exportNode x) -{ - if (x != NULL) - { - switch (x->kind) - { - case XPK_CONST: constDeclarationNode_free (x->content.constdeclaration); break; - case XPK_VAR: varDeclarationNode_free (x->content.vardeclaration); break; - case XPK_TYPE: typeNode_free (x->content.type); break; - case XPK_FCN: fcnNode_free (x->content.fcn); break; - case XPK_CLAIM: claimNode_free (x->content.claim); break; - case XPK_ITER: iterNode_free (x->content.iter); break; - } - - sfree (x); - } -} - -void privateNode_free (/*@null@*/ /*@only@*/ privateNode x) -{ - if (x != NULL) - { - switch (x->kind) - { - case PRIV_CONST: - constDeclarationNode_free (x->content.constdeclaration); break; - case PRIV_VAR: - varDeclarationNode_free (x->content.vardeclaration); break; - case PRIV_TYPE: - typeNode_free (x->content.type); break; - case PRIV_FUNCTION: - fcnNode_free (x->content.fcn); break; - } - - sfree (x); - } -} - -void constDeclarationNode_free (/*@only@*/ /*@null@*/ constDeclarationNode x) -{ - if (x != NULL) - { - lclTypeSpecNode_free (x->type); - initDeclNodeList_free (x->decls); - sfree (x); - } -} - -void typeNode_free (/*@only@*/ /*@null@*/ typeNode t) -{ - if (t != NULL) - { - switch (t->kind) - { - case TK_ABSTRACT: abstractNode_free (t->content.abstract); break; - case TK_EXPOSED: exposedNode_free (t->content.exposed); break; - case TK_UNION: taggedUnionNode_free (t->content.taggedunion); break; - } - - sfree (t); - } -} - -void claimNode_free (/*@only@*/ /*@null@*/ claimNode x) -{ - if (x != NULL) - { - paramNodeList_free (x->params); - globalList_free (x->globals); - letDeclNodeList_free (x->lets); - lclPredicateNode_free (x->require); - programNode_free (x->body); - lclPredicateNode_free (x->ensures); - ltoken_free (x->name); - sfree (x); - } -} - -void iterNode_free (/*@only@*/ /*@null@*/ iterNode x) -{ - if (x != NULL) - { - paramNodeList_free (x->params); - ltoken_free (x->name); - sfree (x); - } -} - -void abstractNode_free (/*@only@*/ /*@null@*/ abstractNode x) -{ - if (x != NULL) - { - abstBodyNode_free (x->body); - ltoken_free (x->tok); - ltoken_free (x->name); - sfree (x); - } -} - -void exposedNode_free (/*@only@*/ /*@null@*/ exposedNode x) -{ - if (x != NULL) - { - lclTypeSpecNode_free (x->type); - declaratorInvNodeList_free (x->decls); - ltoken_free (x->tok); - sfree (x); - } -} - -void taggedUnionNode_free (/*@only@*/ /*@null@*/ taggedUnionNode x) -{ - if (x != NULL) - { - stDeclNodeList_free (x->structdecls); - declaratorNode_free (x->declarator); - sfree (x); - } -} - -/*@only@*/ /*@null@*/ strOrUnionNode - strOrUnionNode_copy (/*@null@*/ strOrUnionNode n) -{ - if (n != NULL) - { - strOrUnionNode ret = (strOrUnionNode) dmalloc (sizeof (*ret)); - - ret->kind = n->kind; - ret->tok = ltoken_copy (n->tok); - ret->opttagid = ltoken_copy (n->opttagid); - ret->sort = n->sort; - ret->structdecls = stDeclNodeList_copy (n->structdecls); - - return ret; - } - else - { - return NULL; - } -} - -void strOrUnionNode_free (/*@null@*/ /*@only@*/ strOrUnionNode n) -{ - if (n != NULL) - { - stDeclNodeList_free (n->structdecls); - ltoken_free (n->tok); - ltoken_free (n->opttagid); - sfree (n); - } -} - -void enumSpecNode_free (/*@null@*/ /*@only@*/ enumSpecNode x) -{ - if (x != NULL) - { - ltokenList_free (x->enums); - ltoken_free (x->tok); - ltoken_free (x->opttagid); - sfree (x); - } -} - -/*@only@*/ /*@null@*/ enumSpecNode enumSpecNode_copy (/*@null@*/ enumSpecNode x) -{ - if (x != NULL) - { - enumSpecNode ret = (enumSpecNode) dmalloc (sizeof (*ret)); - - ret->tok = ltoken_copy (x->tok); - ret->opttagid = ltoken_copy (x->opttagid); - ret->enums = ltokenList_copy (x->enums); - ret->sort = x->sort; - - return ret; - } - else - { - return NULL; - } -} - -void lsymbol_setbool (lsymbol s) -{ - lsymbol_bool = s; -} - -lsymbol lsymbol_getbool () -{ - return lsymbol_bool; -} - -lsymbol lsymbol_getBool () -{ - return lsymbol_Bool; -} - -lsymbol lsymbol_getFALSE () -{ - return lsymbol_FALSE; -} - -lsymbol lsymbol_getTRUE () -{ - return lsymbol_TRUE; -} - - diff --git a/src/aliasChecks.c b/src/aliasChecks.c deleted file mode 100644 index 64ab91e..0000000 --- a/src/aliasChecks.c +++ /dev/null @@ -1,3909 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** aliasChecks.c -*/ - -# include "lclintMacros.nf" -# include "basic.h" -# include "aliasChecks.h" - -static void checkStructTransfer (exprNode p_lhs, sRef p_slhs, exprNode p_rhs, sRef p_srhs, - fileloc p_loc, transferKind p_tt); -static void checkLeaveTrans (uentry p_actual, transferKind p_transferType); -static void checkTransfer (exprNode p_fexp, sRef p_fref, - exprNode p_texp, sRef p_tref, - fileloc p_loc, transferKind p_transferType); -static void checkGlobTrans (uentry p_glob, transferKind p_type); - -static ynm - checkCompletelyDefined (exprNode p_fexp, sRef p_fref, - exprNode p_texp, sRef p_tref, - bool p_topLevel, bool p_inUnion, bool p_directUnion, - fileloc p_loc, transferKind p_transferType, int p_depth, - bool p_report); - -static /*@exposed@*/ sRef dependentReference (sRef p_sr); -static bool canLoseLocalReference (sRef p_sr, fileloc p_loc) ; - -/* added DRL 8/19/200- */ -static void -checkTransferNullTerminatedAux (sRef p_fref, exprNode p_fexp, - /*@unused@*/ bool p_ffix, - sRef p_tref, exprNode p_texp, /*@unused@*/ bool p_tfix, - fileloc p_loc, transferKind p_transferType); -/* -** returns the most specific alkind -*/ - -alkind alkind_resolve (alkind a1, alkind a2) -{ - if (a1 == AK_UNKNOWN || a1 == AK_ERROR) return a2; - if (a2 == AK_UNKNOWN || a2 == AK_ERROR || a2 == AK_LOCAL) return a1; - if (a1 == AK_LOCAL) return a2; - return a1; -} - -/* -** tref <- fref -** -** transferType: -** FCNRETURN return fref; tref is return type -** GLOBASSIGN tref = fref; -** FCNPASS call (fref) ; tref is the argument type -** -*/ - -static /*@only@*/ cstring -transferErrorMessage (transferKind transferType, alkind tkind) /*@*/ -{ - switch (transferType) - { - case TT_FCNRETURN: - return (message ("returned as %s", alkind_unparse (tkind))); - case TT_DOASSIGN: - return (message ("assigned to %s", alkind_unparse (tkind))); - case TT_FIELDASSIGN: - return (message ("assigned to %s", alkind_unparse (tkind))); - case TT_GLOBINIT: - return (message ("used as initial value for %s", - alkind_unparse (tkind))); - case TT_FCNPASS: - return (message ("passed as %s param", alkind_unparse (tkind))); - BADDEFAULT; - } - BADEXIT; -} - -static cstring -transferErrorExpMessage (transferKind transferType, exkind tkind) /*@*/ -{ - if (exkind_isUnknown (tkind)) - { - switch (transferType) - { - case TT_FCNRETURN: - return (cstring_makeLiteral ("returned without qualification")); - case TT_FIELDASSIGN: - case TT_DOASSIGN: - return (cstring_makeLiteral ("assigned to unqualified reference")); - case TT_FCNPASS: - return (cstring_makeLiteral ("passed without qualification")); - case TT_GLOBINIT: - return (cstring_makeLiteral ("used as initial value for unqualified storage")); - BADDEFAULT; - } - } - else - { - switch (transferType) - { - case TT_FCNRETURN: - return (message ("returned as %s", exkind_unparse (tkind))); - case TT_FIELDASSIGN: - case TT_DOASSIGN: - return (message ("assigned to %s", exkind_unparse (tkind))); - case TT_FCNPASS: - return (message ("passed as %s param", exkind_unparse (tkind))); - BADDEFAULT; - } - } - - BADEXIT; -} - -static /*@observer@*/ cstring -transferNullMessage (transferKind transferType) /*@*/ -{ - switch (transferType) - { - case TT_FCNRETURN: - return (cstring_makeLiteralTemp ("returned as non-null")); - case TT_DOASSIGN: - case TT_FIELDASSIGN: - return (cstring_makeLiteralTemp ("assigned to non-null")); - case TT_GLOBINIT: - return (cstring_makeLiteralTemp ("initialized to non-null")); - case TT_FCNPASS: - return (cstring_makeLiteralTemp ("passed as non-null param")); - BADDEFAULT; - } - BADEXIT; -} - -static /*@observer@*/ cstring -transferNTMessage (transferKind transferType) /*@*/ -{ - switch (transferType) - { - case TT_FCNRETURN: - return (cstring_makeLiteralTemp ("returned as nullterminated")); - case TT_DOASSIGN: - case TT_FIELDASSIGN: - return (cstring_makeLiteralTemp ("assigned to nullterminated")); - case TT_GLOBINIT: - return (cstring_makeLiteralTemp ("initialized to nullterminated")); - case TT_FCNPASS: - return (cstring_makeLiteralTemp ("passed as nullterminated param")); - BADDEFAULT; - } - BADEXIT; -} - -static /*@dependent@*/ exprNode atFunction = exprNode_undefined; -static int atArgNo = 0; -static int atNumArgs = 0; - -static cstring generateText (exprNode e1, exprNode e2, - sRef tref, transferKind tt) - /*@*/ -{ - if (tt == TT_DOASSIGN || tt == TT_GLOBINIT) - { - return (message ("%s = %s", exprNode_unparse (e2), - exprNode_unparse (e1))); - } - else if (tt == TT_FIELDASSIGN) - { - return (message ("%s = %s (field %q)", - exprNode_unparse (e2), - exprNode_unparse (e1), - sRef_unparse (tref))); - } - else if (tt == TT_FCNPASS) - { - return (message ("%s (%s%s%s)", - exprNode_unparse (atFunction), - (atArgNo == 1 ? cstring_undefined - : cstring_makeLiteralTemp ("..., ")), - exprNode_unparse (e1), - (atArgNo == atNumArgs ? cstring_undefined - : cstring_makeLiteralTemp (", ...")))); - } - else - { - return (cstring_copy (exprNode_unparse (e1))); - } -} - -static /*@observer@*/ cstring -transferType_unparse (transferKind transferType) /*@*/ -{ - switch (transferType) - { - case TT_FCNRETURN: - return (cstring_makeLiteralTemp ("Returned")); - case TT_DOASSIGN: - case TT_FIELDASSIGN: - return (cstring_makeLiteralTemp ("Assigned")); - case TT_FCNPASS: - return (cstring_makeLiteralTemp ("Passed")); - case TT_GLOBINIT: - return (cstring_makeLiteralTemp ("Initialized")); - case TT_GLOBRETURN: - return (cstring_makeLiteralTemp ("GLOB RETURN!")); - case TT_GLOBPASS: - return (cstring_makeLiteralTemp ("GLOB PASS!")); - case TT_PARAMRETURN: - return (cstring_makeLiteralTemp ("PARAM RETURN!")); - case TT_LEAVETRANS: - return (cstring_makeLiteralTemp ("LEAVE TRANS!")); - BADDEFAULT; - } - BADEXIT; -} - -static /*@observer@*/ cstring udError (sRef s) -{ - if (sRef_isDead (s)) - { - return cstring_makeLiteralTemp ("released"); - } - else if (sRef_isAllocated (s)) - { - return cstring_makeLiteralTemp ("allocated but not defined"); - } - else - { - return cstring_makeLiteralTemp ("undefined"); - } -} - -static /*@only@*/ -cstring defExpl (sRef s) /*@*/ -{ - sRef rb = sRef_getRootBase (s); - - if (sRef_sameName (rb, s)) - { - if (sRef_isAllocated (s)) - { - return cstring_makeLiteral (" (allocated only)"); - } - return cstring_undefined; - } - else - { - return (message (" (%q is %s)", sRef_unparse (s), udError (s))); - } -} - -/* -** returns TRUE if fref is completely defined. -** if !report, returns TRUE unless error is at the deep level. -*/ - -static ynm - checkCompletelyDefined (exprNode fexp, sRef fref, - exprNode texp, sRef tref, - bool topLevel, bool inUnion, bool directUnion, - fileloc loc, transferKind transferType, - int depth, bool report) -{ - ctype ct; - alkind fkind = sRef_getAliasKind (fref); - alkind tkind = sRef_getAliasKind (tref); - - if (depth > MAXDEPTH) - { - llquietbug - (message - ("Check definition limit exceeded, checking %q. " - "This either means there is a variable with at least " - "%d indirections apparent in the program text, or " - "there is a bug in LCLint.", - sRef_unparse (fref), - MAXDEPTH)); - - return YES; - } - - if (!sRef_isKnown (fref)) - { - return YES; - } - - if (alkind_isStack (fkind)) - { - ctype rt = ctype_realType (sRef_getType (tref)); - - if (ctype_isMutable (rt) && !ctype_isSU (rt)) - { - if (transferType == TT_PARAMRETURN) - { - if (optgenerror - (FLG_RETSTACK, - message - ("Stack-allocated storage %qreachable from parameter %q", - sRef_unparseOpt (fref), - sRef_unparse (sRef_getRootBase (fref))), - loc)) - { - sRef_showAliasInfo (fref); - } - } - else if (transferType == TT_GLOBRETURN) - { - if (optgenerror - (FLG_RETSTACK, - message - ("Stack-allocated storage %qreachable from global %q", - sRef_unparseOpt (fref), - sRef_unparse (sRef_getRootBase (fref))), - loc)) - { - sRef_showAliasInfo (fref); - } - } - else if (transferType == TT_FCNRETURN) - { - if (optgenerror - (FLG_RETSTACK, - message - ("Stack-allocated storage %qreachable from return value: %s", - sRef_unparseOpt (fref), - exprNode_unparse (fexp)), - loc)) - { - sRef_showAliasInfo (fref); - } - } - else - { - /* no error */ - } - } - } - - if (!topLevel) - { - if ((sRef_isObserver (fref) && !sRef_isObserver (tref)) - || (sRef_isExposed (fref) && !(sRef_isObserver (tref) - || sRef_isExposed (tref)))) - { - flagcode code = (sRef_isObserver (fref) - ? FLG_OBSERVERTRANS : FLG_EXPOSETRANS); - - if (!sRef_isStateLive (fref)) - { - ; /* no error (will be a definition error) */ - } - else if (transferType == TT_DOASSIGN - || transferType == TT_FIELDASSIGN - || transferType == TT_GLOBINIT - || transferType == TT_FCNPASS) - { - ; /* no error */ - } - else if (transferType == TT_PARAMRETURN) - { - if (optgenerror - (code, - message - ("%s storage %qreachable from %s parameter", - exkind_capName (sRef_getExKind (fref)), - sRef_unparseOpt (fref), - exkind_unparseError (sRef_getExKind (tref))), - loc)) - { - sRef_showExpInfo (fref); - sRef_setExKind (fref, XO_UNKNOWN, loc); - } - } - else if (transferType == TT_LEAVETRANS) - { - ; - } - else if (transferType == TT_GLOBINIT) - { - if (optgenerror - (code, - message - ("%s storage %qreachable from %s initial value", - exkind_capName (sRef_getExKind (fref)), - sRef_unparseOpt (fref), - exkind_unparseError (sRef_getExKind (tref))), - loc)) - { - sRef_showExpInfo (fref); - sRef_setExKind (fref, XO_UNKNOWN, loc); - } - } - else if (transferType == TT_GLOBRETURN) - { - if (optgenerror - (code, - message - ("%s storage %qreachable from %s global", - exkind_capName (sRef_getExKind (fref)), - sRef_unparseOpt (fref), - exkind_unparseError (sRef_getExKind (tref))), - loc)) - { - sRef_showExpInfo (fref); - sRef_setExKind (fref, XO_UNKNOWN, loc); - } - } - else if (transferType == TT_FCNRETURN) - { - if (optgenerror - (code, - message - ("%s storage %qreachable from %s return value", - exkind_capName (sRef_getExKind (fref)), - sRef_unparseOpt (fref), - exkind_unparseError (sRef_getExKind (tref))), - loc)) - { - sRef_showExpInfo (fref); - sRef_setExKind (fref, XO_UNKNOWN, loc); - } - } - else - { - llcontbug (message ("Transfer type: %s", - transferType_unparse (transferType))); - - if (optgenerror - (code, - message - ("%s storage %qreachable from %s return value", - exkind_capName (sRef_getExKind (fref)), - sRef_unparseOpt (fref), - exkind_unparseError (sRef_getExKind (tref))), - loc)) - { - sRef_showExpInfo (fref); - sRef_setExKind (fref, XO_UNKNOWN, loc); - } - } - - } - - if (!alkind_compatible (fkind, tkind)) - { - if (fkind == AK_UNKNOWN && !sRef_isStateLive (fref)) - { - ; /* no error (will be a definition error) */ - } - else if (transferType == TT_DOASSIGN) - { - ; /* no error */ - } - else if (transferType == TT_FCNPASS) - { - if (alkind_isKnown (sRef_getAliasKind (tref))) - { - if (optgenerror - (FLG_COMPMEMPASS, - message - ("Storage %qreachable from passed parameter " - "is %s (should be %s): %s", - sRef_unparseOpt (fref), - alkind_unparse (sRef_getAliasKind (fref)), - alkind_unparse (sRef_getAliasKind (tref)), - exprNode_unparse (fexp)), - loc)) - { - sRef_showAliasInfo (fref); - } - } - } - else if (transferType == TT_PARAMRETURN) - { - bool noerror = FALSE; - - if (alkind_isDependent (sRef_getAliasKind (fref))) - { - if (canLoseLocalReference (fref, loc)) - { - noerror = TRUE; - } - } - - if (!noerror - && optgenerror - (FLG_COMPMEMPASS, - message - ("Storage %qreachable from parameter is %s (should be %s)", - sRef_unparseOpt (fref), - alkind_unparse (sRef_getAliasKind (fref)), - alkind_unparse (sRef_getAliasKind (tref))), - loc)) - { - sRef_showAliasInfo (fref); - } - } - else if (transferType == TT_LEAVETRANS) - { - if (optgenerror - (FLG_COMPMEMPASS, - message - ("Storage %qreachable from temporary reference is %s " - "at scope exit (should be %s)", - sRef_unparseOpt (fref), - alkind_unparse (sRef_getAliasKind (fref)), - alkind_unparse (sRef_getAliasKind (tref))), - loc)) - { - sRef_showAliasInfo (fref); - } - } - else if (transferType == TT_GLOBRETURN) - { - if (optgenerror - (FLG_COMPMEMPASS, - message - ("Storage %qreachable from global is %s (should be %s)", - sRef_unparseOpt (fref), - alkind_unparse (sRef_getAliasKind (fref)), - alkind_unparse (sRef_getAliasKind (tref))), - loc)) - { - sRef_showAliasInfo (fref); - } - } - else if (transferType == TT_FCNRETURN) - { - if (optgenerror - (FLG_COMPMEMPASS, - message - ("Storage %qreachable from return value is %s (should be %s)", - sRef_unparseOpt (fref), - alkind_unparse (sRef_getAliasKind (fref)), - alkind_unparse (sRef_getAliasKind (tref))), - loc)) - { - sRef_showAliasInfo (fref); - } - } - else if (transferType == TT_GLOBINIT) - { - if (optgenerror - (FLG_COMPMEMPASS, - message - ("Storage %qreachable from initial value is %s (should be %s)", - sRef_unparseOpt (fref), - alkind_unparse (sRef_getAliasKind (fref)), - alkind_unparse (sRef_getAliasKind (tref))), - loc)) - { - sRef_showAliasInfo (fref); - } - } - else - { - llcontbug (message ("Transfer type: %s", - transferType_unparse (transferType))); - - if (optgenerror - (FLG_COMPMEMPASS, - message - ("Storage %qreachable from return value is %s (should be %s)", - sRef_unparseOpt (fref), - alkind_unparse (sRef_getAliasKind (fref)), - alkind_unparse (sRef_getAliasKind (tref))), - loc)) - { - sRef_showAliasInfo (fref); - } - } - } - - if (sRef_isDead (fref)) - { - if (directUnion) - { - return NO; - } - - if (transferType == TT_PARAMRETURN) - { - if (optgenerror - (FLG_USERELEASED, - message - ("Released storage %q reachable from parameter at return point", - sRef_unparse (fref)), - loc)) - { - sRef_showStateInfo (fref); - return YES; - } - } - else if (transferType == TT_LEAVETRANS) - { - if (optgenerror - (FLG_USERELEASED, - message ("Released storage %q reachable from temporary " - "reference at scope exit", - sRef_unparse (fref)), - loc)) - { - sRef_showStateInfo (fref); - return YES; - } - } - else if (transferType == TT_GLOBRETURN) - { - if (optgenerror - (FLG_GLOBSTATE, - message ("Released storage %q reachable from global", - sRef_unparse (fref)), - loc)) - { - sRef_showStateInfo (fref); - return YES; - } - } - else if (transferType == TT_FCNPASS) - { - if (optgenerror - (FLG_USERELEASED, - message ("Released storage %q reachable from passed parameter", - sRef_unparse (fref)), - loc)) - { - sRef_showStateInfo (fref); - return YES; - } - } - else - { - if (optgenerror - (FLG_USERELEASED, - message ("Released storage %q reachable from parameter", - sRef_unparse (fref)), - loc)) - { - sRef_showStateInfo (fref); - return YES; - } - } - } - } - - if (!topLevel - && sRef_possiblyNull (fref) - && !sRef_perhapsNull (tref) - && ctype_isRealPointer (sRef_getType (tref)) - && !usymtab_isGuarded (fref)) - { - if (transferType == TT_FCNRETURN) - { - if (optgenerror - (FLG_NULLRET, - message ("%q storage %qderivable from return value: %s", - cstring_capitalize (sRef_nullMessage (fref)), - sRef_unparseOpt (fref), - exprNode_unparse (fexp)), - loc)) - { - sRef_showNullInfo (fref); - sRef_setNullError (fref); - } - } - else if (transferType == TT_GLOBRETURN || transferType == TT_PARAMRETURN) - { - if (optgenerror - (FLG_NULLSTATE, - message - ("Function returns with %s storage derivable from %q %q", - sRef_nullMessage (fref), - cstring_makeLiteral ((transferType == TT_GLOBRETURN) - ? "global" : "parameter"), - sRef_unparse (fref)), - loc)) - { - sRef_showNullInfo (fref); - sRef_setNullError (fref); - } - } - else if (transferType == TT_GLOBPASS) - { - if (optgenerror - (FLG_NULLPASS, - message ("Function called with %s storage " - "derivable from global %q", - sRef_nullMessage (fref), - sRef_unparse (fref)), - loc)) - { - sRef_showNullInfo (fref); - sRef_setNullError (fref); - } - } - else if (transferType == TT_FCNPASS) - { - if (optgenerror - (FLG_NULLSTATE, - message ("%q storage %qderivable from parameter %q", - cstring_capitalize (sRef_nullMessage (fref)), - sRef_unparseOpt (fref), - generateText (fexp, exprNode_undefined, - sRef_undefined, TT_FCNPASS)), - loc)) - { - sRef_showNullInfo (fref); - sRef_setNullError (fref); - } - } - else - { - llassert (transferType == TT_DOASSIGN - || transferType == TT_GLOBINIT - || transferType == TT_LEAVETRANS); - } - } - - if (sRef_isRelDef (tref) - || sRef_isPartial (tref) - || sRef_isAllocated (tref) - || sRef_isStateSpecial (tref)) - { - /* should check fref is allocated? */ - return YES; - } - - ct = ctype_realType (sRef_getType (fref)); - - if (!(sRef_isAnyDefined (fref) - || sRef_isPdefined (fref) - || sRef_isAllocated (fref) - || sRef_isStateUnknown (fref))) - { - if (transferType == TT_GLOBRETURN) - { - if (report - && optgenerror - (FLG_COMPDEF, - message ("Function returns with global %q not " - "completely defined%q", - sRef_unparse (sRef_getRootBase (fref)), - defExpl (fref)), - loc)) - { - sRef_showStateInfo (fref); - sRef_setDefined (fref, loc); - } - } - else if (transferType == TT_GLOBPASS) - { - if (report && - optgenerror - (FLG_COMPDEF, - message - ("Function called with global %q not completely defined%q", - sRef_unparse (sRef_getRootBase (fref)), - defExpl (fref)), - loc)) - { - sRef_showStateInfo (fref); - sRef_setDefined (fref, loc); - } - } - else if (transferType == TT_PARAMRETURN) - { - if (report && !topLevel - && optgenerror - (FLG_COMPDEF, - message ("Function returns storage %q reachable from parameter not " - "completely defined%q", - sRef_unparse (sRef_getRootBase (fref)), - defExpl (fref)), - loc)) - { - sRef_showStateInfo (fref); - sRef_setDefined (fref, loc); - } - } - else if (transferType == TT_LEAVETRANS) - { - if (report && !topLevel - && optgenerror - (FLG_COMPDEF, - message ("Scope exits with storage %q reachable from " - "temporary reference not completely defined%q", - sRef_unparse (sRef_getRootBase (fref)), - defExpl (fref)), - loc)) - { - sRef_showStateInfo (fref); - sRef_setDefined (fref, loc); - } - } - else - { - if (transferType != TT_DOASSIGN - && (!(sRef_isNew (fref) || sRef_isType (fref)))) - { - if (report) - { - if (sRef_isDead (fref)) - { - if (optgenerror - (FLG_USERELEASED, - message ("%s storage %qwas released: %q", - transferType_unparse (transferType), - sRef_unparseOpt (fref), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showStateInfo (fref); - } - } - else - { - if (optgenerror - (FLG_COMPDEF, - message - ("%s storage %qnot completely defined%q: %q", - transferType_unparse (transferType), - sRef_unparseOpt (sRef_getRootBase (fref)), - defExpl (fref), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef rb = sRef_getRootBase (fref); - sRef_showStateInfo (fref); - sRef_setDefinedComplete (rb, loc); - } - } - } - } - else - { - - if (sRef_isAllocated (fref) && sRef_isValid (tref) - && (transferType == TT_DOASSIGN)) - { - sRef_setAllocatedComplete (tref, loc); - } - return YES; - } - } - - return NO; - } - - if (ctype_isUnknown (ct)) - { - return YES; - } - else if (ctype_isPointer (ct)) - { - ctype tct = ctype_realType (sRef_getType (tref)); - - if (sRef_isStateUnknown (fref)) - { - return NO; - } - else - { - if (ctype_isAP (tct) || ctype_isUnknown (tct)) - { - sRef fptr = sRef_constructDeref (fref); - sRef tptr = sRef_constructDeref (tref); - - return (checkCompletelyDefined (fexp, fptr, texp, tptr, - FALSE, inUnion, FALSE, loc, - transferType, depth + 1, report)); - } - else - { - return YES; - } - } - } - else if (ctype_isArray (ct)) - { - return YES; - } - else if (ctype_isStruct (ct)) - { - ctype tct = ctype_realType (sRef_getType (tref)); - - if (ctype_match (ct, tct)) - { - bool isOk = TRUE; - bool hasOneDefined = FALSE; - cstringSList badFields = cstringSList_undefined; - - if (sRef_isStateUnknown (fref) || sRef_isAllocated (tref)) - { - return YES; - } - - if (sRef_isPdefined (fref) || sRef_isAnyDefined (fref)) - { - sRefSet_realElements (sRef_derivedFields (fref), sr) - { - bool thisField; - - hasOneDefined = TRUE; - - if (sRef_isField (sr)) - { - cstring fieldname = sRef_getField (sr); - sRef fldref = sRef_makeField (tref, fieldname); - bool shouldCheck = !sRef_isRecursiveField (fldref); - - if (shouldCheck) - { - thisField = - ynm_toBoolRelaxed - (checkCompletelyDefined (fexp, sr, texp, fldref, - FALSE, inUnion, FALSE, loc, - transferType, depth + 1, - FALSE)); - } - else - { - thisField = TRUE; - } - - if (!thisField) - { - isOk = FALSE; - badFields = cstringSList_add (badFields, - sRef_getField (sr)); - } - } - } end_sRefSet_realElements; - } - else if (sRef_isAllocated (fref)) - { - /* - ** for structures, each field must be completely defined - */ - - uentryList fields = ctype_getFields (ct); - - uentryList_elements (fields, ue) - { - bool thisField; - cstring name = uentry_getRealName (ue); - sRef ffield = sRef_makeField (fref, name); - sRef tfield = sRef_makeField (tref, name); - bool shouldCheck = !sRef_isRecursiveField (tfield); - - if (!shouldCheck) - { - thisField = TRUE; - } - else - { - thisField = ynm_toBoolRelaxed - (checkCompletelyDefined (fexp, ffield, texp, tfield, - FALSE, inUnion, FALSE, - loc, transferType, - depth + 1, FALSE)); - } - - if (!thisField) - { - isOk = FALSE; - badFields = cstringSList_add (badFields, uentry_rawName (ue)); - } - else - { - hasOneDefined = TRUE; - } - } end_uentryList_elements; - } - else - { - ; - } - - if (!isOk && (!inUnion || hasOneDefined)) - { - if (transferType == TT_GLOBRETURN) - { - if (optgenerror - (FLG_COMPDEF, - message ("Global storage %q contains %d undefined field%p " - "when call returns: %q", - sRef_unparse (fref), - cstringSList_size (badFields), - cstringSList_unparseAbbrev (badFields)), - loc)) - { - sRef_setDefined (fref, loc); - } - } - else if (transferType == TT_GLOBPASS) - { - if (optgenerror - (FLG_COMPDEF, - message ("Global storage %q contains %d undefined field%p " - "before call: %q", - sRef_unparse (fref), - cstringSList_size (badFields), - cstringSList_unparseAbbrev (badFields)), - loc)) - { - sRef_setDefined (fref, loc); - } - } - else if (transferType == TT_PARAMRETURN) - { - if (optgenerror - (FLG_COMPDEF, - message ("Storage %qreachable from parameter " - "contains %d undefined field%p: %q", - sRef_unparseOpt (fref), - cstringSList_size (badFields), - cstringSList_unparseAbbrev (badFields)), - loc)) - { - sRef_setDefined (fref, loc); - } - } - else if (transferType == TT_LEAVETRANS) - { - /* no error */ - } - else - { - if (optgenerror - (FLG_COMPDEF, - message ("%s storage %qcontains %d undefined field%p: %q", - transferType_unparse (transferType), - sRef_unparseOpt (fref), - cstringSList_size (badFields), - cstringSList_unparseAbbrev (badFields)), - loc)) - { - sRef_setDefined (fref, loc); - } - } - } - - cstringSList_free (badFields); - - if (inUnion) - { - if (directUnion) - { - return (ynm_fromBool (hasOneDefined)); - } - else - { - return (MAYBE); - } - } - else - { - return (ynm_fromBool (!report || isOk)); - } - } - else - { - return YES; - } - } - else if (ctype_isUnion (ct)) - { - if (sRef_isStateUnknown (fref) || sRef_isAllocated (tref)) - { - return YES; - } - else - { - ctype tct = ctype_realType (sRef_getType (tref)); - - if (ctype_isKnown (tct) && ctype_match (ct, tct)) - { - cstringSList goodFields = cstringSList_new (); - bool isOk = FALSE; - int nelements = sRefSet_size (sRef_derivedFields (fref)); - - /* - ** for unions, at least one field must be completely defined - */ - - if (sRef_isPdefined (fref) || sRef_isAnyDefined (fref)) - { - isOk = TRUE; - } - - sRefSet_realElements (sRef_derivedFields (fref), sr) - { - bool thisField; - - if (sRef_isField (sr)) - { - sRef fldref = sRef_makeField (tref, sRef_getField (sr)); - - thisField = ynm_toBoolStrict - (checkCompletelyDefined - (fexp, sr, texp, fldref, FALSE, inUnion, - (nelements > 1 ? TRUE : FALSE), - loc, transferType, depth + 1, FALSE)); - - if (thisField) - { - goodFields = cstringSList_add - (goodFields, sRef_getField (sr)); - } - } - } end_sRefSet_realElements; - - if (cstringSList_empty (goodFields) - && !isOk - && context_getFlag (FLG_UNIONDEF)) - { - if (!inUnion) - { - if (transferType == TT_PARAMRETURN) - { - voptgenerror - (FLG_UNIONDEF, - message ("Union %q reachable from parameter has " - "no defined field", - sRef_unparse (fref)), - loc); - } - else if (transferType == TT_LEAVETRANS) - { - voptgenerror - (FLG_UNIONDEF, - message ("Union %q has no defined field at scope exit", - sRef_unparse (fref)), - loc); - } - else if (transferType == TT_DOASSIGN - || transferType == TT_FIELDASSIGN - || transferType == TT_GLOBINIT) - { - ; /* no error */ - } - else - { - voptgenerror - (FLG_UNIONDEF, - message ("%s union %q has no defined field", - transferType_unparse (transferType), - sRef_unparse (fref)), - loc); - } - } - isOk = FALSE; - } - - cstringSList_free (goodFields); - return ynm_fromBool (!report || isOk); - } - } - } - else - { - ; - } - - return YES; -} - -/* -** fref is being free'd -*/ - -typedef enum { - DSC_GLOB, DSC_LOCAL, DSC_PARAM, DSC_STRUCT - } dscCode; - -static /*@observer@*/ cstring dscCode_unparse (dscCode desc) /*@*/ -{ - switch (desc) - { - case DSC_GLOB: - return cstring_makeLiteralTemp ("killed global"); - case DSC_LOCAL: - return cstring_makeLiteralTemp ("variable declared in this scope"); - case DSC_PARAM: - return cstring_makeLiteralTemp ("released storage"); - case DSC_STRUCT: - return cstring_makeLiteralTemp ("released structure parameter"); - } - - BADEXIT; -} - -static bool - checkCompletelyDestroyed (exprNode p_fexp, sRef p_fref, bool p_topLevel, - fileloc p_loc, int p_depth, dscCode p_desc); - -bool checkGlobalDestroyed (sRef fref, fileloc loc) -{ - return (checkCompletelyDestroyed (exprNode_undefined, fref, TRUE, - loc, 0, DSC_GLOB)); -} - -void checkLocalDestroyed (sRef fref, fileloc loc) -{ - if (sRef_isObserver (fref) || sRef_isExposed (fref) - || sRef_isPartial (fref)) - { - ; - } - else - { - (void) checkCompletelyDestroyed (exprNode_undefined, fref, TRUE, - loc, 0, DSC_LOCAL); - } -} - -void checkStructDestroyed (sRef fref, fileloc loc) -{ - if (sRef_isObserver (fref) || sRef_isExposed (fref) - || sRef_isPartial (fref)) - { - ; - } - else - { - (void) checkCompletelyDestroyed (exprNode_undefined, fref, TRUE, loc, 0, DSC_STRUCT); - } -} - -static bool - checkCompletelyDestroyed (exprNode fexp, sRef fref, bool topLevel, - fileloc loc, int depth, - dscCode desc) -{ - ctype ct; - - if (depth > MAXDEPTH) - { - llquietbug (message ("checkCompletelyDestroyed: too deep: %s / %q", - exprNode_unparse (fexp), - sRef_unparseFull (fref))); - return TRUE; - } - - if (!sRef_isKnown (fref)) return TRUE; - if (usymtab_isProbableNull (fref)) return TRUE; - if (!context_getFlag (FLG_COMPDESTROY)) return TRUE; - if (!context_getFlag (FLG_MUSTFREE)) return TRUE; - - ct = ctype_realType (sRef_getType (fref)); - - if (!topLevel) - { - bool error = FALSE; - - if (sRef_isFresh (fref) || sRef_isOnly (fref)) - { - error = TRUE; - - if (sRef_isDead (fref) - || sRef_isUnuseable (fref) - || sRef_definitelyNull (fref) - || sRef_isObserver (fref) - || sRef_isExposed (fref)) - { - error = FALSE; - } - } - - if (error) - { - if (sRef_isPossiblyDead (fref) || sRef_isRelDef (fref)) - { - if (exprNode_isDefined (fexp)) - { - voptgenerror2 - (FLG_COMPDESTROY, FLG_STRICTDESTROY, - message ("Only storage %q (type %s) derived from %s " - "may not have been released: %s", - sRef_unparse (fref), - ctype_unparse (sRef_getType (fref)), - dscCode_unparse (desc), - exprNode_unparse (fexp)), - loc); - } - else - { - voptgenerror2 - (FLG_COMPDESTROY, FLG_STRICTDESTROY, - message - ("Only storage %q (type %s) derived from %s " - "may not have been released", - sRef_unparse (fref), - ctype_unparse (sRef_getType (fref)), - dscCode_unparse (desc)), - loc); - } - - sRef_kill (fref, loc); /* prevent further errors */ - } - else - { - if (sRef_isStateUndefined (fref)) - { - return TRUE; - } - else - { - if (exprNode_isDefined (fexp)) - { - voptgenerror - (FLG_COMPDESTROY, - message ("Only storage %q (type %s) derived from %s " - "is not released (memory leak): %s", - sRef_unparse (fref), - ctype_unparse (sRef_getType (fref)), - dscCode_unparse (desc), - exprNode_unparse (fexp)), - loc); - } - else - { - voptgenerror - (FLG_COMPDESTROY, - message ("Only storage %q (type %s) derived from %s " - "is not released (memory leak)", - sRef_unparse (fref), - ctype_unparse (sRef_getType (fref)), - dscCode_unparse (desc)), - loc); - } - } - } - - return FALSE; - } - - if (sRef_isAnyDefined (fref) || sRef_isDead (fref) - || (sRef_isPdefined (fref) - && sRefSet_isEmpty (sRef_derivedFields (fref)))) - { - return TRUE; - } - } - - if (ctype_isPointer (ct)) - { - sRef fptr = sRef_constructDeadDeref (fref); - bool res = checkCompletelyDestroyed (fexp, fptr, FALSE, loc, - depth + 1, desc); - - return res; - } - else if (ctype_isArray (ct)) - { - if ((sRef_isStateUnknown (fref) || sRef_isAllocated (fref)) - && !sRef_hasDerived (fref)) - { - /* - ** Bogosity necessary to prevent infinite depth. - */ - - return FALSE; - } - else - { - sRef farr = sRef_constructDeadDeref (fref); - - return (checkCompletelyDestroyed (fexp, farr, FALSE, loc, - depth + 1, desc)); - } - } - else if (ctype_isStruct (ct)) - { - /* - ** for structures, each field must be completely destroyed - */ - - bool isOk = TRUE; - uentryList fields = ctype_getFields (ct); - - if (depth >= MAXDEPTH) - { - llquietbug (message ("checkCompletelyDestroyed (fields): too deep: %s / %q", - exprNode_unparse (fexp), - sRef_unparseFull (fref))); - - return TRUE; - } - else - { - uentryList_elements (fields, ue) - { - sRef field = sRef_makeField (fref, uentry_rawName (ue)); - - /* - ** note order of && operands --- want to report multiple errors - */ - - isOk = (checkCompletelyDestroyed (fexp, field, FALSE, loc, - depth + 1, desc) - && isOk); - } end_uentryList_elements; - } - - return isOk; - } - else - { - return TRUE; - } -} - -void -checkReturnTransfer (exprNode fexp, uentry rval) -{ - sRef uref = uentry_getSref (rval); - sRef rref = sRef_makeNew (sRef_getType (uref), uref, cstring_undefined); - - if (sRef_isStateSpecial (rref)) - { - uentry fcn = context_getHeader (); - sRef fref = exprNode_getSref (fexp); - specialClauses clauses = uentry_getSpecialClauses (fcn); - - specialClauses_postElements (clauses, cl) - { - sRefSet refs = specialClause_getRefs (cl); - sRefTest tst = specialClause_getPostTestFunction (cl); - sRefMod modf = specialClause_getReturnEffectFunction (cl); - - sRefSet_elements (refs, el) - { - sRef base = sRef_getRootBase (el); - - if (sRef_isResult (base)) - { - sRef sr = sRef_fixBase (el, fref); - - if (tst != NULL && !(tst (sr))) - { - if (optgenerror - (specialClause_postErrorCode (cl), - message ("%s storage %q corresponds to " - "storage listed in %q clause: %s", - specialClause_postErrorString (cl, sr), - sRef_unparse (sr), - specialClause_unparseKind (cl), - exprNode_unparse (fexp)), - exprNode_loc (fexp))) - { - sRefShower ss = specialClause_getPostTestShower (cl); - - if (ss != NULL) - { - ss (sr); - } - } - } - - if (modf != NULL) - { - modf (sr, exprNode_loc (fexp)); - } - } - else - { - /* - ** Non-results are checked in exit scope. - */ - } - } end_sRefSet_elements ; - } end_specialClauses_postElements ; - - (void) checkTransfer (fexp, fref, - exprNode_undefined, rref, - exprNode_loc (fexp), TT_FCNRETURN); - } - else - { - if (ctype_isRealSU (exprNode_getType (fexp))) - { - sRef fref = exprNode_getSref (fexp); - - checkStructTransfer (exprNode_undefined, rref, - fexp, fref, - exprNode_loc (fexp), - TT_FCNRETURN); - } - else - { - (void) checkTransfer (fexp, exprNode_getSref (fexp), - exprNode_undefined, rref, - exprNode_loc (fexp), TT_FCNRETURN); - } - } -} - -static void - checkPassSpecialClauses (uentry ue, exprNode fexp, sRef fref, int argno) -{ - specialClauses clauses = uentry_getSpecialClauses (ue); - - DPRINTF (("Check pass special: %s / %s", - exprNode_unparse (fexp), sRef_unparseFull (fref))); - - specialClauses_preElements (clauses, cl) - { - sRefSet refs = specialClause_getRefs (cl); - sRefTest tst = specialClause_getPreTestFunction (cl); - sRefMod modf = specialClause_getEffectFunction (cl); - - sRefSet_elements (refs, el) - { - sRef base = sRef_getRootBase (el); - - if (sRef_isResult (base)) - { - ; /* nothing to check before */ - } - else if (sRef_isParam (base)) - { - if (sRef_getParam (base) == argno - 1) - { - sRef sb; - - DPRINTF (("Fix base: %s / %s", - sRef_unparseFull (el), - sRef_unparseFull (fref))); - - sb = sRef_fixBase (el, fref); - - if (tst != NULL && !(tst(sb))) - { - voptgenerror - (specialClause_preErrorCode (cl), - message ("%s storage %qcorresponds to " - "storage listed in %q clause of " - "called function: %s", - specialClause_preErrorString (cl, sb), - sRef_unparseOpt (sb), - specialClause_unparseKind (cl), - exprNode_unparse (fexp)), - exprNode_loc (fexp)); - } - - if (modf != NULL) - { - DPRINTF (("Fixing: %s", sRef_unparseFull (sb))); - modf (sb, exprNode_loc (fexp)); - DPRINTF (("==> %s", sRef_unparseFull (sb))); - } - } - } - else - { - BADBRANCH; - } - } end_sRefSet_elements ; - } end_specialClauses_preElements ; - - DPRINTF (("After: %s", sRef_unparseFull (fref))); -} - -/* -** should not modify arg -*/ - -void -checkPassTransfer (exprNode fexp, uentry arg, bool isSpec, - /*@dependent@*/ exprNode fcn, int argno, int totargs) -{ - sRef tref = uentry_getSref (arg); - sRef fref = exprNode_getSref (fexp); - bool isOut = FALSE; - bool isPartial = FALSE; - bool isImpOut = FALSE; - ctype ct = uentry_getType (arg); - - DPRINTF (("Check pass: %s -> %s", - sRef_unparseFull (fref), - sRef_unparseFull (tref))); - - atFunction = fcn; - atArgNo = argno; - atNumArgs = totargs; - - if (ctype_isElips (ct)) - { - ct = ctype_unknown; - } - - if (!ctype_isElips (ct) && - (ctype_isVoidPointer (ct) && uentry_isOut (arg) && sRef_isOnly (tref))) - { - if (ctype_isRealAP (ct)) - { - if (sRef_aliasCheckSimplePred (sRef_isDead, fref)) - { - if (optgenerror - (FLG_USERELEASED, - message ("Dead storage %qpassed as out parameter: %s", - sRef_unparseOpt (fref), - exprNode_unparse (fexp)), - exprNode_loc (fexp))) - { - if (sRef_isDead (fref)) - { - sRef_showStateInfo (fref); - } - } - - sRef_setAllocated (fref, exprNode_loc (fexp)); - } - else if (context_getFlag (FLG_STRICTUSERELEASED) - && sRef_aliasCheckSimplePred (sRef_isPossiblyDead, fref)) - { - if (optgenerror2 - (FLG_USERELEASED, FLG_STRICTUSERELEASED, - message ("Possibly dead storage %qpassed as out parameter: %s", - sRef_unparseOpt (fref), - exprNode_unparse (fexp)), - exprNode_loc (fexp))) - { - if (sRef_isPossiblyDead (fref)) - { - sRef_showStateInfo (fref); - } - } - - sRef_setAllocated (fref, exprNode_loc (fexp)); - } - else if (sRef_aliasCheckSimplePred (sRef_isStateUndefined, fref) - || sRef_aliasCheckSimplePred (sRef_isUnuseable, fref)) - { - voptgenerror - (FLG_USEDEF, - message ("Unallocated storage %qpassed as out parameter: %s", - sRef_unparseOpt (fref), - exprNode_unparse (fexp)), - exprNode_loc (fexp)); - - sRef_setAllocated (fref, exprNode_loc (fexp)); - } - else - { - ; - } - } - - (void) checkCompletelyDestroyed (fexp, fref, TRUE, exprNode_loc (fexp), - 0, DSC_PARAM); - - /* make it defined now, so checkTransfer is okay */ - sRef_setDefined (fref, exprNode_loc (fexp)); - } - else if (uentry_isOut (arg)) - { - if (ctype_isRealAP (ct) - && (sRef_isStateUndefined (fref) || sRef_isUnuseable (fref))) - { - voptgenerror - (FLG_USEDEF, - message ("Unallocated storage %qpassed as out parameter: %s", - sRef_unparseOpt (fref), - exprNode_unparse (fexp)), - exprNode_loc (fexp)); - sRef_setAllocated (fref, exprNode_loc (fexp)); - } - isOut = TRUE; - } - else if (uentry_isPartial (arg)) - { - if (ctype_isRealAP (ct) - && (sRef_isStateUndefined (fref) || sRef_isUnuseable (fref))) - { - voptgenerror - (FLG_USEDEF, - message ("Unallocated storage %qpassed as partial parameter: %s", - sRef_unparseOpt (fref), - exprNode_unparse (fexp)), - exprNode_loc (fexp)); - sRef_setAllocated (fref, exprNode_loc (fexp)); - } - isPartial = TRUE; - } - else if (uentry_isStateSpecial (arg)) - { - uentry ue = exprNode_getUentry (fcn); - - if (ctype_isRealAP (ct) - && (sRef_isStateUndefined (fref) || sRef_isUnuseable (fref))) - { - voptgenerror - (FLG_USEDEF, - message ("Unallocated storage %qpassed as special parameter: %s", - sRef_unparseOpt (fref), - exprNode_unparse (fexp)), - exprNode_loc (fexp)); - sRef_setAllocated (fref, exprNode_loc (fexp)); - } - - if (uentry_hasSpecialClauses (ue)) - { - checkPassSpecialClauses (ue, fexp, fref, argno); - } - - return; /* ??? */ - } - else if (sRef_isStateDefined (tref)) - { - exprNode_checkUseParam (fexp); - } - else - { - if (isSpec || (!context_getFlag (FLG_IMPOUTS))) - { - exprNode_checkUseParam (fexp); - } - else - { - if (!sRef_isMacroParamRef (fref) - && (ctype_isRealAP (ct))) - { - if (sRef_isAddress (fref)) - { - if (sRef_isStateUndefined (fref) || sRef_isUnuseable (fref)) - { - voptgenerror - (FLG_USEDEF, - message - ("Unallocated address %qpassed as implicit " - "out parameter: %s", - sRef_unparseOpt (fref), - exprNode_unparse (fexp)), - exprNode_loc (fexp)); - sRef_setAllocated (fref, exprNode_loc (fexp)); - } - } - - /* yes, I really mean this! */ - tref = sRef_copy (tref); - sRef_setAllocated (tref, exprNode_loc (fexp)); - - isOut = TRUE; - isImpOut = TRUE; - } - else - { - exprNode_checkUseParam (fexp); - } - } - } - - if (sRef_isNew (fref)) - { - alkind tkind = sRef_getAliasKind (tref); - - if ((sRef_isFresh (fref) || sRef_isOnly (fref)) - && !alkind_isOnly (tkind) - && !alkind_isKeep (tkind) - && !alkind_isOwned (tkind) - && !alkind_isError (tkind) - && !uentry_isReturned (arg)) - - { - voptgenerror - (FLG_MUSTFREE, - message ("New fresh storage %qpassed as %s (not released): %s", - sRef_unparseOpt (fref), - alkind_unparse (sRef_getAliasKind (tref)), - exprNode_unparse (fexp)), - exprNode_loc (fexp)); - } - else - { - if (sRef_isNewRef (fref) && !sRef_isKillRef (tref)) - { - alkind ak = sRef_getAliasKind (tref); - - if (!alkind_isError (ak)) - { - voptgenerror - (FLG_MUSTFREE, - message ("New reference %qpassed as %s (not released): %s", - sRef_unparseOpt (fref), - alkind_unparse (sRef_getAliasKind (tref)), - exprNode_unparse (fexp)), - exprNode_loc (fexp)); - } - } - } - } - - (void) checkTransfer (fexp, exprNode_getSref (fexp), - exprNode_undefined, tref, - exprNode_loc (fexp), TT_FCNPASS); - - setCodePoint (); - fref = exprNode_getSref (fexp); - - if (isOut && !sRef_isDead (fref) && !sRef_isPossiblyDead (fref)) - { - sRef base; - - if (ctype_isRealAP (sRef_getType (fref))) - { - base = sRef_makePointer (fref); - } - else - { - base = fref; - } - - if (isImpOut) - { - exprNode_checkMSet (fexp, base); - } - else - { - exprNode_checkSet (fexp, base); - } - - if (sRef_isValid (base)) - { - setCodePoint (); - - sRef_clearDerived (base); - sRef_setDefined (base, exprNode_loc (fexp)); - usymtab_clearAlias (base); - sRef_setNullUnknown (base, exprNode_loc (fexp)); - } - } - - if (isPartial) - { - if (sRef_isValid (fref)) - { - sRef_setPartial (fref, exprNode_loc (fexp)); - } - } - - atFunction = exprNode_undefined; - atArgNo = 0; - atNumArgs = 0; - - /* need to fixup here: derived refs could be bogus */ - /* (better to change sRef to not add derivs for "protected" ref) */ - - uentry_fixupSref (arg); - - setCodePoint (); - - DPRINTF (("Check pass: ==> %s", - sRef_unparseFull (fref))); -} - -void -checkGlobReturn (uentry glob) -{ - sRef_protectDerivs (); - checkGlobTrans (glob, TT_GLOBRETURN); - sRef_clearProtectDerivs (); -} - -void checkParamReturn (uentry actual) -{ - checkLeaveTrans (actual, TT_PARAMRETURN); -} - -void checkLoseRef (uentry actual) -{ - checkLeaveTrans (actual, TT_LEAVETRANS); -} - -static void -checkLeaveTrans (uentry actual, transferKind transferType) -{ - sRef aref = uentry_getSref (actual); - sRef origref = uentry_getOrigSref (actual); - - if (transferType == TT_PARAMRETURN - && (sRef_isKeep (origref) || sRef_isOnly (origref) - || sRef_isOwned (origref))) - { - /* caller cannot use, nothing to check */ - } - else - { - if (sRef_isNSLocalVar (origref)) - { - ; - } - else - { - (void) checkCompletelyDefined (exprNode_undefined, aref, - exprNode_undefined, origref, - TRUE, FALSE, FALSE, - g_currentloc, transferType, - 0, TRUE); - } - } -} - -static void -checkGlobTrans (uentry glob, transferKind type) -{ - sRef eref = uentry_getOrigSref (glob); - - (void) checkCompletelyDefined (exprNode_undefined, uentry_getSref (glob), - exprNode_undefined, eref, - TRUE, FALSE, FALSE, - g_currentloc, type, 0, TRUE); -} - -/* -** For lhs of assignment, alias kind is set from basic type. -** Yoikes! -*/ - -static void -fixAssignLhs (sRef s) -{ - sRef_resetStateComplete (s); -} - -static void checkStructTransfer (exprNode lhs, sRef slhs, exprNode rhs, sRef srhs, - fileloc loc, - transferKind tt) -{ - ctype st = ctype_realType (sRef_getType (srhs)); - - if (ctype_isSU (st) && ctype_isRealSU (sRef_getType (slhs)) - && ctype_match (sRef_getType (slhs), st)) - { - if (tt == TT_DOASSIGN && sRef_isStateDefined (srhs)) - { - sRef_setDefinedComplete (slhs, loc); - } - - if (sRef_isDependent (slhs) - || sRef_isObserver (slhs) - || sRef_isExposed (slhs)) - { - ; - } - else - { - if (sRef_isLocalVar (slhs) - && sRef_isGlobal (sRef_getRootBase (srhs))) - { - sRef_setDependent (slhs, exprNode_loc (lhs)); - } - else - { - if (ctype_isUnion (st)) - { - sRef_setDefState (slhs, sRef_getDefState (srhs), - exprNode_loc (lhs)); - - sRefSet_realElements (sRef_derivedFields (srhs), sr) - { - if (sRef_isField (sr)) - { - cstring fieldname = sRef_getField (sr); - sRef lfld = sRef_makeField (slhs, fieldname); - - (void) checkTransfer (rhs, sr, lhs, lfld, - exprNode_loc (lhs), tt); - } - } end_sRefSet_realElements ; - } - else - { - uentryList fields = ctype_getFields (st); - - uentryList_elements (fields, field) - { - sRef rfld = sRef_makeField (srhs, uentry_rawName (field)); - sRef lfld = sRef_makeField (slhs, uentry_rawName (field)); - (void) checkTransfer (rhs, rfld, lhs, lfld, exprNode_loc (lhs), tt); - } end_uentryList_elements ; - } - - if (sRef_isOnly (srhs)) - { - sRef_setKeptComplete (srhs, loc); - } - } - } - } -} - -void -checkInitTransfer (exprNode lhs, exprNode rhs) -{ - sRef slhs = exprNode_getSref (lhs); - - if (sRef_isGlobal (slhs) || (!sRef_isCvar (slhs))) - { - (void) checkTransfer (rhs, exprNode_getSref (rhs), - lhs, slhs, exprNode_loc (rhs), TT_GLOBINIT); - } - else - { - checkAssignTransfer (lhs, rhs); - } -} - -void -checkAssignTransfer (exprNode lhs, exprNode rhs) -{ - sRef slhs = exprNode_getSref (lhs); - sRef srhs = exprNode_getSref (rhs); - sRef base = sRef_getBaseSafe (slhs); - nstate ns; - struct _bbufinfo bs; - - DPRINTF (("Check assign: %s = %s", exprNode_unparse (lhs), - exprNode_unparse (rhs))); - DPRINTF (("lhs: %s", sRef_unparseFull (slhs))); - DPRINTF (("rhs: %s", sRef_unparseFull (srhs))); - - if (ctype_isRealSU (sRef_getType (srhs))) - { - checkStructTransfer (lhs, slhs, rhs, srhs, exprNode_loc (lhs), TT_FIELDASSIGN); - } - else - { - (void) checkTransfer (rhs, srhs, lhs, slhs, - exprNode_loc (lhs), TT_DOASSIGN); - } - - if (sRef_isConst (srhs) && sRef_isLocalState (srhs)) - { - /* constants can match anything (e.g., NULL) */ - sRef_setAliasKind (slhs, AK_ERROR, fileloc_undefined); - } - - if (sRef_isValid (base) && sRef_isStateDefined (base)) - { - sRef_setPdefined (base, g_currentloc); - } - - if (sRef_isPartial (srhs)) - { - sRef_setPartial (slhs, exprNode_loc (rhs)); - } - - - ns = sRef_getNullState (srhs); - - if (nstate_possiblyNull (ns)) - { - if (usymtab_isGuarded (srhs)) - { - ns = NS_NOTNULL; - } - } - - sRef_setNullStateInnerComplete (slhs, ns, exprNode_loc (rhs)); - - if (sRef_isExposed (srhs) || sRef_isObserver (srhs)) - { - sRef_setExKind (slhs, sRef_getExKind (srhs), exprNode_loc (rhs)); - } - - /* We put the function to transfer NT states */ - bs = sRef_getNullTerminatedState (srhs); - sRef_setNullTerminatedStateInnerComplete (slhs, bs, exprNode_loc (rhs)); - DPRINTF (("Done transfer: %s", sRef_unparseFull (slhs))); -} - -static void -checkTransferNullAux (sRef fref, exprNode fexp, /*@unused@*/ bool ffix, - sRef tref, exprNode texp, /*@unused@*/ bool tfix, - fileloc loc, transferKind transferType) -{ - alkind tkind = sRef_getAliasKind (tref); - ctype ttyp = ctype_realType (sRef_getType (tref)); - - if (ctype_isUnknown (ttyp)) - { - ttyp = exprNode_getType (texp); - - if (ctype_isUnknown (ttyp)) - { - ttyp = exprNode_getType (fexp); - - if (ctype_isUnknown (ttyp)) - { - ttyp = sRef_getType (fref); - } - } - } - - if (ctype_isFunction (ttyp) && (transferType == TT_FCNRETURN)) - { - ttyp = ctype_returnValue (ttyp); - } - - /* - ** check for null (don't need to check aliases??) - */ - - if (sRef_possiblyNull (fref) - && !usymtab_isGuarded (fref) - && ctype_isRealAP (ttyp)) - { - if (!alkind_isLocal (tkind) && !alkind_isFresh (tkind) - && !sRef_perhapsNull (tref) - && !(transferType == TT_DOASSIGN)) - { - if (transferType == TT_GLOBINIT) - { - if (optgenerror - (FLG_NULLASSIGN, - message ("%s %q initialized to %s value: %q", - sRef_getScopeName (tref), - sRef_unparse (tref), - sRef_nullMessage (fref), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showNullInfo (fref); - sRef_setNullError (tref); - } - } - else - { - if (optgenerror - ((transferType == TT_FCNPASS) ? FLG_NULLPASS : FLG_NULLRET, - message ("%q storage %q%s: %q", - cstring_capitalize (sRef_nullMessage (fref)), - sRef_unparseOpt (fref), - transferNullMessage (transferType), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showNullInfo (fref); - sRef_setNullError (fref); - } - } - } - else - { - ; - } - } -} - - -static void -checkTransferAssignAux (sRef fref, exprNode fexp, /*@unused@*/ bool ffix, - sRef tref, exprNode texp, bool tfix, - fileloc loc, transferKind transferType) -{ - alkind tkind = sRef_getAliasKind (tref); - - /* - ** Assignment to same --- no errors, or state changes. - ** This can happen when returned params are used. - */ - - if (sRef_sameName (fref, tref)) - { - sRef_copyState (tref, fref); - return; - } - - if ((alkind_isOnly (tkind) || alkind_isFresh (tkind) - || alkind_isNewRef (tkind) || alkind_isOwned (tkind)) - && !(sRef_isDead (tref) - || sRef_isStateUndefined (tref) - || sRef_isUnuseable (tref) - || sRef_isPartial (tref) - || sRef_definitelyNull (tref) - || sRef_isStackAllocated (tref) - || sRef_isAllocIndexRef (tref)) - && !(sRef_same (fref, tref)) /* okay to assign to self (returned params) */ - && !(usymtab_isProbableNull (tref))) - { - if (context_getFlag (FLG_MUSTFREE)) - { - if (canLoseReference (tref, loc)) - { - ; /* no error */ - } - else - { - if (sRef_hasLastReference (tref)) - { - if (optgenerror - (FLG_MUSTFREE, - message ("Last reference %q to %s storage %qnot released " - "before assignment: %q", - sRef_unparse (tref), - alkind_unparse (tkind), - sRef_unparseOpt (sRef_getAliasInfoRef (tref)), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showRefLost (tref); - } - } - else - { - if (context_inGlobalScope ()) - { - /* no errors for static initializations */ - } - else - { - /* - ** don't report this error for a[i], since it could - ** be a new element. - */ - - if (alkind_isNewRef (tkind)) - { - if (optgenerror - (FLG_MUSTFREE, - message - ("%q %qnot released before assignment: %q", - cstring_makeLiteral - (alkind_isKillRef (sRef_getOrigAliasKind (tref)) - ? "Kill reference parameter" : "New reference"), - sRef_unparseOpt (tref), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (tref); - sRef_setAliasKind (tref, AK_ERROR, loc); - } - } - else if - (!(sRef_isUnknownArrayFetch (tref) - && !context_getFlag (FLG_STRICTDESTROY)) - && !sRef_isUnionField (tref) - && !sRef_isRelDef (tref) - && optgenerror - (FLG_MUSTFREE, - message - ("%s storage %qnot released before assignment: %q", - alkind_capName (tkind), - sRef_unparseOpt (tref), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (tref); - } - else - { - ; - } - } - } - } - } - } - - fixAssignLhs (tref); - - if (sRef_isRefCounted (tref)) /* tkind might not be correct now */ - { - if (sRef_isNewRef (fref)) - { - sRef_setAliasKind (tref, AK_NEWREF, loc); - } - else if (sRef_isConst (fref)) - { - /* for now, constants are not ref counted */ - sRef_setAliasKind (tref, AK_ERROR, loc); - } - else - { - ; - } - - if (!sRef_isNSLocalVar (tref) - && sRef_isRefCounted (fref) - && sRef_isStateDefined (fref)) - { - voptgenerror - (FLG_NEWREFTRANS, - message ("New reference %qto reference counted storage: %q", - sRef_unparseOpt (tref), - generateText (fexp, texp, tref, transferType)), - loc); - } - } - - /* - ** Not for structures and unions, since assignments copy. - */ - - if (sRef_isStack (fref) - && !ctype_isSU (ctype_realType (sRef_getType (fref)))) - { - sRef_setAliasKindComplete (tref, AK_STACK, loc); - } - - if (sRef_isNSLocalVar (tref) - && !sRef_isOwned (tref) /*< should only apply to static >*/ - && ctype_isMutable (sRef_getType (tref))) - { - if (sRef_isOnly (fref) && sRef_isNew (fref)) - { - if (!tfix) - { - sRef_setFresh (tref, loc); - } - } - } -} - -/* -** requires sRef_isOnly (fref) -*/ - -static void -checkOnlyTransferAux (sRef fref, exprNode fexp, bool ffix, - sRef tref, exprNode texp, /*@unused@*/ bool tfix, - fileloc loc, transferKind transferType) -{ - alkind tkind = sRef_getAliasKind (tref); - - if (sRef_isExposed (tref) || sRef_isObserver (tref)) - { - if (transferType == TT_FCNRETURN && sRef_isNew (fref) - && !alkind_isError (tkind)) - { - if (optgenerror - (FLG_ONLYTRANS, - message ("Only storage %q%q (will not be released): %q", - sRef_unparseOpt (fref), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (fref); - } - } - - /* no errors for exposed transfers (is this good enough?) */ - } - else if (alkind_isOnly (tkind) || alkind_isKeep (tkind) || alkind_isOwned (tkind)) - { - ; /* okay */ - } - else if ((transferType == TT_FCNPASS) - && (alkind_isUnknown (tkind) - || alkind_isTemp (tkind) || alkind_isUnique (tkind))) - { - if (sRef_isFresh (fref) - && alkind_isUnknown (tkind) && !context_getFlag (FLG_PASSUNKNOWN)) - { - if (!ffix) sRef_setAliasKind (fref, AK_UNKNOWN, loc); - } - } - else if (alkind_isLocal (tkind) - || alkind_isFresh (tkind) || alkind_isUnknown (tkind)) - { - if ((transferType == TT_DOASSIGN) - && sRef_isNew (fref) - && sRef_isOnly (fref)) - { - bool error = FALSE; - - if (alkind_isUnknown (tkind) - && sRef_isGlobal (sRef_getRootBase (tref))) - { - if (optgenerror - (FLG_ONLYUNQGLOBALTRANS, - message ("Only storage %q%q: %q", - sRef_unparseOpt (fref), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (fref); - sRef_setAliasKind (tref, AK_ERROR, loc); - error = TRUE; - } - } - - if (!error && !ffix) - { - sRef_setFresh (tref, loc); - } - } - else - { - if (alkind_isLocal (tkind)) - { - if (sRef_sameName (tref, fref)) - { - ; /* don't set this --- corresponds to return transfer */ - } - else - { - /* - ** Don't set local to dependent. Error will - ** be detected through aliasing. Except for - ** arrays. - */ - - if (!tfix && sRef_isThroughArrayFetch (fref) - && context_getFlag (FLG_DEPARRAYS)) - { - sRef_setDependent (tref, loc); - } - } - } - else - { - if (optgenerror - (FLG_ONLYTRANS, - message ("Only storage %q%q: %q", - sRef_unparseOpt (fref), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (fref); - } - } - } - } - else - { - if (alkind_isError (tkind) - || (alkind_isUnknown (tkind) && !context_getFlag (FLG_MEMIMPLICIT))) - { - flagcode_recordSuppressed (FLG_ONLYTRANS); - } - else - { - if ((alkind_isKept (tkind) || alkind_isStack (tkind) - || alkind_isDependent (tkind)) - && sRef_isNSLocalVar (tref)) - { - ; /* okay */ - } - else - { - if (optgenerror - (FLG_ONLYTRANS, - message ("Only storage %q%q: %q", - sRef_unparseOpt (fref), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (fref); - } - } - } - - if (transferType == TT_DOASSIGN) - { - /* - ** alias kind unknown to suppress future messages - */ - - if (!ffix && sRef_isNSLocalVar (sRef_getRootBase (fref))) - { - sRef_clearAliasKind (fref); - } - } - } -} - -/* -** ??? same as checkOnly ? -*/ - -static void -checkOwnedTransferAux (sRef fref, exprNode fexp, bool ffix, - sRef tref, exprNode texp, bool tfix, - fileloc loc, transferKind transferType) -{ - alkind tkind = sRef_getAliasKind (tref); - - if (sRef_isExposed (tref) || sRef_isObserver (tref)) - { - if (transferType == TT_FCNRETURN && sRef_isNew (fref)) - { - if (optgenerror - (FLG_OWNEDTRANS, - message ("Owned storage %q%q (will not be released): %q", - sRef_unparseOpt (fref), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (fref); - } - } - } - else if (alkind_isOnly (tkind) || alkind_isKeep (tkind) - || alkind_isDependent (tkind) - || alkind_isOwned (tkind)) - { - /* okay */ - } - else if (alkind_isLocal (tkind) - || alkind_isFresh (tkind) || alkind_isUnknown (tkind)) - { - if ((transferType == TT_DOASSIGN) - && sRef_isNew (fref) && sRef_isOnly (fref)) - { - if (!tfix) - { - sRef_setFresh (tref, loc); - } - } - else - { - } - } - else if ((transferType == TT_FCNPASS) - && (alkind_isUnknown (tkind) - || alkind_isTemp (tkind) || alkind_isUnique (tkind))) - { - if (sRef_isFresh (fref) - && alkind_isUnknown (tkind) && !context_getFlag (FLG_PASSUNKNOWN)) - { - if (!ffix) { sRef_clearAliasKind (fref); } - } - } - else - { - if (alkind_isUnknown (tkind) && !context_getFlag (FLG_MEMIMPLICIT)) - { - flagcode_recordSuppressed (FLG_OWNEDTRANS); - } - else - { - if (alkind_isKept (tkind) && sRef_isNSLocalVar (tref)) - { - ; /* okay */ - } - else - { - voptgenerror - (FLG_OWNEDTRANS, - message ("Owned storage %q%q: %q", - sRef_unparseOpt (fref), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc); - } - } - - if (transferType == TT_DOASSIGN) - { - /* - ** alias kind unknown to suppress future messages - */ - - if (!ffix) { sRef_clearAliasKind (fref); } - } - } -} - -static void -checkFreshTransferAux (sRef fref, exprNode fexp, bool ffix, - sRef tref, exprNode texp, /*@unused@*/ bool tfix, - fileloc loc, transferKind transferType) -{ - alkind tkind = sRef_getAliasKind (tref); - - /* - ** error to return fresh as non-only - */ - - if (transferType == TT_FCNRETURN - && !(alkind_isOnly (tkind) || alkind_isNewRef (tkind))) - { - if (alkind_isUnknown (tkind) && !context_getFlag (FLG_MEMIMPLICIT)) - { - flagcode_recordSuppressed (FLG_NEWREFTRANS); - } - else - { - if (alkind_isError (tkind)) - { - if (!ffix) - { - sRef_killComplete (fref, loc); - } - } - else if (alkind_isRefCounted (tkind)) - { - if (optgenerror - (FLG_NEWREFTRANS, - message - ("New reference returned without newref qualifier: %q", - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (fref); - sRef_killComplete (fref, loc); - } - } - else - { - if (optgenerror - (FLG_FRESHTRANS, - message ("Fresh storage %q (should be only): %q", - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (fref); - sRef_killComplete (fref, loc); - } - } - } - } - - /* - ** Okay to assign fresh to only, shared or unqualified. - ** - ** should generate other errors? - */ - - if (alkind_isOnly (tkind)) - { - if (transferType == TT_DOASSIGN && !sRef_isGlobal (tref)) - { - if (!ffix) - { - if (!sRef_isNSLocalVar (tref)) - { - sRef_setKeptComplete (fref, loc); - } - } - } - else - { - if (sRef_isConst (fref)) - { - ; - } - else - { - if (!ffix) - { - sRef_killComplete (fref, loc); - } - } - } - } - else if (alkind_isOwned (tkind)) - { - if (!ffix) - { - sRef_setDependentComplete (fref, loc); - } - } - else if (alkind_isRefCounted (tkind) - && (transferType == TT_FCNRETURN) && sRef_isFresh (fref)) - { - if (!ffix) - { - sRef_killComplete (fref, loc); - } - } - else if (alkind_isKeep (tkind)) - { - if (!ffix) - { - if (!sRef_isNSLocalVar (tref)) - { - sRef_setKeptComplete (fref, loc); - } - } - } - else if (alkind_isShared (tkind)) - { - if (!ffix) { sRef_setShared (fref, loc); } - } - else if (alkind_isLocal (tkind) || alkind_isUnknown (tkind)) - { - if (transferType == TT_DOASSIGN || transferType == TT_FCNRETURN) - { - /* - ** local shares fresh. Make it owned/dependent. - */ - - if (!tfix) - { - sRef_setOwned (tref, loc); - } - - if (!ffix && !tfix) - { - sRef_setDependentComplete (fref, loc); - } - - /* NO! sRef_clearAliasKind (fref); */ - } - else - { - if (context_getFlag (FLG_PASSUNKNOWN)) - { - sRef_clearAliasKind (fref); - } - } - } - else - { - ; - } -} - -static void -checkTransferExposure (sRef fref, exprNode fexp, /*@unused@*/ bool ffix, - sRef tref, exprNode texp, bool tfix, - fileloc loc, - transferKind transferType) -{ - alkind fkind = sRef_getAliasKind (fref); - alkind tkind = sRef_getAliasKind (tref); - exkind tekind = sRef_getExKind (tref); - - if (sRef_isObserver (fref) && ctype_isMutable (sRef_getType (fref))) - { - /* - ** observer -> exposed or observer - */ - - /* - ** observer -> temp is okay [NO! really? only in function calls] - */ - - if (sRef_isExposed (tref) || sRef_isObserver (tref) - || alkind_isLocal (tkind)) - { - /* okay */ - - if ((transferType == TT_DOASSIGN) && alkind_isLocal (tkind)) - { - if (!tfix) { sRef_setAliasKindComplete (tref, fkind, loc); } - } - } - else - { - if (transferType == TT_FCNRETURN - || transferType == TT_DOASSIGN - || transferType == TT_FIELDASSIGN - || transferType == TT_GLOBINIT) - { - bool hasError = FALSE; - - if (exprNode_isStringLiteral (fexp) - && transferType == TT_GLOBINIT) - { - hasError = optgenerror - (FLG_READONLYTRANS, - message ("Read-only string literal storage %q%q: %q", - sRef_unparseOpt (fref), - transferErrorExpMessage (transferType, tekind), - generateText (fexp, texp, tref, transferType)), - loc); - - sRef_setAliasKind (fref, AK_ERROR, fileloc_undefined); - } - else - { - if ((transferType == TT_DOASSIGN - || transferType == TT_FIELDASSIGN) - && (sRef_isNSLocalVar (tref) - || (exprNode_isStringLiteral (fexp) - && ctype_isRealArray (exprNode_getType (texp))))) - { - ; /* No error for local assignment or assignment - to static array (copies string). */ - } - else - { - if (exprNode_isStringLiteral (fexp)) - { - hasError = optgenerror - (FLG_READONLYTRANS, - message - ("Read-only string literal storage %q%q: %q", - sRef_unparseOpt (fref), - transferErrorExpMessage (transferType, tekind), - generateText (fexp, texp, tref, transferType)), - loc); - - } - - if (!hasError) - { - hasError = optgenerror - (FLG_OBSERVERTRANS, - message - ("Observer storage %q%q: %q", - sRef_unparseOpt (fref), - transferErrorExpMessage (transferType, tekind), - generateText (fexp, texp, tref, transferType)), - loc); - } - } - } - - if (hasError) - { - if (transferType != TT_GLOBINIT) - { - sRef_showExpInfo (fref); - sRef_setAliasKind (tref, AK_ERROR, loc); - } - } - else - { - if (transferType == TT_DOASSIGN && !tfix) - { - DPRINTF (("Setting unknown!")); - /* sRef_setAliasKind (tref, AK_ERROR, loc); */ - } - } - } - else /* TT_FCNPASS */ - { - llassert (transferType == TT_FCNPASS); - - if (alkind_isTemp (tkind) - || alkind_isDependent (tkind) - || alkind_isRefCounted (tkind)) - { - ; /* okay */ - } - else - { - if (!alkind_isError (tkind)) - { - if (optgenerror - (FLG_OBSERVERTRANS, - message ("Observer storage %q%q: %q", - sRef_unparseOpt (fref), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showExpInfo (fref); - sRef_clearAliasState (fref, loc); - } - } - } - } - } - } - else if (sRef_isExposed (fref) && ctype_isMutable (sRef_getType (fref))) - { - if (transferType == TT_FCNRETURN) - { - if (!(sRef_isExposed (tref) || sRef_isObserver (tref) - || sRef_isParam (fref))) - { - if (optgenerror - (FLG_EXPOSETRANS, - message ("Exposed storage %q%q: %q", - sRef_unparseOpt (fref), - transferErrorExpMessage (transferType, tekind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showExpInfo (fref); - } - } - } - else if (transferType == TT_FCNPASS) - { - if (!(sRef_isExposed (tref) - || sRef_isObserver (tref) - || (alkind_isUnknown (tkind) - || alkind_isDependent (tkind) - || alkind_isTemp (tkind) - || alkind_isKillRef (tkind) - || alkind_isRefCounted (tkind)))) - { - if (alkind_isUnique (tkind) || alkind_isError (tkind)) - { - } - else - { - if (optgenerror - (FLG_EXPOSETRANS, - message ("Exposed storage %q%q: %q", - sRef_unparseOpt (fref), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showExpInfo (fref); - sRef_clearAliasState (fref, loc); - } - } - - } - else - { - ; - } - } - else if (transferType == TT_DOASSIGN) - { - if (!(sRef_isExposed (tref) - || !sRef_isCvar (tref) - || (alkind_isUnknown (tkind) - || alkind_isDependent (tkind) - || alkind_isRefCounted (tkind) - || alkind_isNewRef (tkind) - || alkind_isFresh (tkind) - || alkind_isLocal (tkind)))) - { - if (optgenerror - (FLG_EXPOSETRANS, - message ("Exposed storage %q%q: %q", - sRef_unparseOpt (fref), - transferErrorExpMessage (transferType, tekind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showExpInfo (fref); - } - } - if (!tfix) { sRef_setExposed (tref, loc); } - } - else - { - llassert (transferType == TT_GLOBPASS - || transferType == TT_GLOBRETURN - || transferType == TT_PARAMRETURN - || transferType == TT_LEAVETRANS - || transferType == TT_GLOBINIT); - } - } - else - { - ; - } -} - -/* -** returns TRUE if there is no error reported -** -** if fixt, don't change tref (except if error reported.) -** if fixf, don't change fref (except if error reported.) -*/ - -static void -checkTransferAux (exprNode fexp, sRef fref, bool ffix, - exprNode texp, sRef tref, bool tfix, - fileloc loc, transferKind transferType) -{ - alkind fkind; - alkind tkind; - bool isassign = (transferType == TT_DOASSIGN); - bool isfieldassign = (transferType == TT_FIELDASSIGN); - bool iseitherassign = isassign || (transferType == TT_FIELDASSIGN); - bool isfcnpass = (transferType == TT_FCNPASS); - bool isfcnreturn = (transferType == TT_FCNRETURN); - - setCodePoint (); - - /*start modification David Larochelle */ - - if (!ffix && !tfix) - { - setCodePoint (); - checkTransferNullTerminatedAux (fref, fexp, ffix, tref, texp, tfix, - loc, transferType); - } - /*end modification */ - - if (!ffix && !tfix) - { - setCodePoint (); - checkTransferNullAux (fref, fexp, ffix, tref, texp, tfix, - loc, transferType); - } - - if (isassign) - { - setCodePoint (); - checkTransferAssignAux (fref, fexp, ffix, tref, texp, tfix, - loc, transferType); - } - - /* - ** Check for definition - */ - - /* - ** errors passing out params already detected in checkAnyCall - */ - - if (!ffix && !tfix) - { - bool defok = TRUE; - - if (!iseitherassign - || (!sRef_isNSLocalVar (tref) - && (sRef_isAnyDefined (tref) || !sRef_stateKnown (tref)))) - { - setCodePoint (); - - if (!ynm_toBoolRelaxed - (checkCompletelyDefined (fexp, fref, texp, tref, - TRUE, FALSE, FALSE, - loc, transferType, 0, TRUE))) - { - defok = FALSE; - } - } - - setCodePoint (); - - if (defok && iseitherassign) - { - sRef_setDefState (tref, sRef_getDefState (fref), loc); - } - } - - - /* - ** check exposure - */ - - setCodePoint (); - checkTransferExposure (fref, fexp, ffix, tref, texp, tfix, - loc, transferType); - - fkind = sRef_getAliasKind (fref); - tkind = sRef_getAliasKind (tref); - - /* - ** check aliasing - */ - - if (alkind_isOnly (fkind)) - { - setCodePoint (); - checkOnlyTransferAux (fref, fexp, ffix, - tref, texp, tfix, - loc, transferType); - } - else if (alkind_isFresh (fkind)) - { - setCodePoint (); - checkFreshTransferAux (fref, fexp, ffix, - tref, texp, tfix, - loc, transferType); - } - else if (alkind_isOwned (fkind)) - { - setCodePoint (); - checkOwnedTransferAux (fref, fexp, ffix, - tref, texp, tfix, - loc, transferType); - } - else if (alkind_isDependent (fkind)) - { - setCodePoint (); - if (isfcnreturn && - (sRef_isExposed (tref) || sRef_isObserver (tref))) - { - ; /* okay */ - } - else if ((alkind_isOnly (tkind) || alkind_isKeep (tkind) - || alkind_isOwned (tkind)) - || (!isfcnpass && alkind_isTemp (tkind))) - { - bool error = TRUE; - - if (sRef_isLocalVar (fref)) - { - sRef depRef = dependentReference (fref); - - if (sRef_isValid (depRef) && sRef_isLocalVar (depRef)) - { - error = FALSE; - sRef_kill (depRef, loc); - sRef_kill (fref, loc); - } - - } - - if (isfieldassign) - { - error = FALSE; - } - - if (canLoseLocalReference (fref, loc)) - { - ; - } - else - { - if (error && - (optgenerror - (FLG_DEPENDENTTRANS, - message ("%s storage %q%q: %q", - alkind_capName (fkind), - sRef_unparseOpt (fref), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc))) - { - DPRINTF (("Here: %s / %s", - sRef_unparseFull (fref), - sRef_unparseFull (tref))); - - sRef_showAliasInfo (fref); - } - } - } - else - { - if (isassign && (alkind_isFresh (tkind) || alkind_isLocal (tkind))) - { - if (!tfix && !ffix) - { - sRef_setDependent (tref, loc); - } - } - } - } - else if (alkind_isShared (fkind)) - { - setCodePoint (); - /* - ** xxx <- shared - */ - - if (alkind_isOnly (tkind) - || (!isfcnpass - && (!(sRef_isObserver (tref) || sRef_isExposed (tref)) - && alkind_isTemp (tkind)))) - { - if (optgenerror - (FLG_SHAREDTRANS, - message ("%s storage %q%q: %q", - alkind_capName (fkind), - sRef_unparseOpt (fref), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (fref); - } - } - else - { - if (alkind_isFresh (tkind) || alkind_isLocal (tkind)) - { - sRef_setShared (tref, loc); - } - } - } - else if (alkind_isKeep (fkind)) - { - setCodePoint (); - - if (alkind_isKeep (tkind) - || alkind_isLocal (tkind) - || (isfcnreturn && sRef_isExposed (tref)) - || (iseitherassign - && (alkind_isOnly (tkind) || alkind_isOwned (tkind)))) - { - sRef_setKept (fref, loc); - } - else if (isfcnpass - && (alkind_isTemp (tkind) || alkind_isOwned (tkind))) - { - ; - } - else - { - if (!alkind_isError (tkind)) - { - if (optgenerror - (FLG_KEEPTRANS, - message ("%s storage %q: %q", - alkind_capName (fkind), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (fref); - } - } - } - } - else if (alkind_isTemp (fkind) || alkind_isKept (fkind)) - { - /* - ** xxx <- temp - */ - - if (alkind_isOnly (tkind) - || alkind_isShared (tkind) - || (alkind_isTemp (fkind) - && !isfcnreturn && alkind_isDependent (tkind)) - || alkind_isOwned (tkind) - || alkind_isKeep (tkind)) - { - if (!exprNode_isNullValue (fexp) - && (ctype_isMutable (exprNode_getType (fexp)) - || (ctype_isArray (exprNode_getType (fexp)) - && sRef_isParam (fref))) - && (!iseitherassign || sRef_isReference (tref))) - { - if (sRef_isThroughArrayFetch (fref)) - { - if (optgenerror2 - (alkind_isTemp (fkind) ? FLG_TEMPTRANS : FLG_KEPTTRANS, - FLG_STRICTUSERELEASED, - message ("%s storage %q%q: %q", - alkind_capName (fkind), - sRef_unparseOpt (fref), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (fref); - } - } - else - { - if (optgenerror - (alkind_isTemp (fkind) ? FLG_TEMPTRANS : FLG_KEPTTRANS, - message ("%s storage %q%q: %q", - alkind_capName (fkind), - sRef_unparseOpt (fref), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (fref); - } - } - } - } - } - else if (alkind_isRefCounted (fkind) || alkind_isKillRef (fkind)) - { - if (alkind_isNewRef (tkind)) - { - /* - ** check that the refs field has been modified - */ - - if (!sRef_isConst (fref)) - { - voptgenerror - (FLG_REFCOUNTTRANS, - message ("Reference counted storage returned without modifying " - "reference count: %s", - exprNode_unparse (fexp)), - loc); - } - } - else if (iseitherassign) - { - if (alkind_isRefCounted (fkind)) - { - if (!sRef_isLocalVar (tref)) - { - vgenhinterror - (FLG_REFCOUNTTRANS, - message - ("Assignment to non-local from reference counted storage: %s", - exprNode_unparse (fexp)), - cstring_makeLiteral - ("Reference counted storage should call a function returning " - "a newref instead of direct assignments."), - loc); - } - else - { - ; - } - } - } - else /* fcnpass */ - { - if (alkind_isRefCounted (tkind) || alkind_isTemp (tkind)) - { - /* okay --- no change in state */ - } - else if (alkind_isKillRef (tkind)) - { - if (!ffix && !tfix && !(transferType == TT_FCNRETURN)) - { - sRef_killComplete (fref, loc); - } - } - else - { - if (!alkind_isError (tkind)) - { - voptgenerror - (FLG_REFCOUNTTRANS, - message ("Reference counted storage %q: %q", - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc); - } - } - } - } - else - { - ; - } - - setCodePoint (); - - if (alkind_isOnly (tkind) || alkind_isKeep (tkind)) - { - if (sRef_isAddress (fref)) - { - voptgenerror - (FLG_IMMEDIATETRANS, - message ("Immediate address %q %q: %q", - sRef_unparse (fref), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc); - - sRef_setAliasKind (fref, AK_ERROR, loc); - } - else - { - if ((alkind_isUnknown (fkind) || alkind_isStatic (fkind)) - && !sRef_isDefinitelyNull (fref) - && (!ffix && !tfix) - && (!exprNode_isNullValue (fexp))) - { - flagcode errkind = alkind_isStatic (fkind) - ? FLG_STATICTRANS : FLG_UNKNOWNTRANS; - - if (transferType == TT_GLOBINIT) - { - if (errkind == FLG_STATICTRANS) - { - errkind = FLG_STATICINITTRANS; - } - else - { - errkind = FLG_UNKNOWNINITTRANS; - } - } - - if (optgenerror - (errkind, - message ("%s storage %s %q: %q", - alkind_capName (fkind), - exprNode_unparse (fexp), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (fref); - } - } - } - - /* don't kill shared to suppress future messages */ - if (!alkind_isShared (fkind)) - { - if (isassign) - { - if (!ffix) - { - /*< yuk! should do this in aliasaux >*/ - - if (!sRef_isNSLocalVar (tref) && !sRef_sameName (fref, tref)) - { - if (!tfix) - { - sRef_setKeptComplete (fref, loc); - } - else - { - sRef_setKept (fref, loc); - } - } - } - } - else - { - if (!ffix) - { - if (!tfix) - { - if (alkind_isKeep (tkind)) - { - sRef_setKeptComplete (fref, loc); - } - else - { - sRef_killComplete (fref, loc); - } - } - else - { - if (alkind_isKeep (tkind)) - { - sRef_setKept (fref, loc); - } - else - { - sRef_kill (fref, loc); - } - } - } - } - } - } - else if (alkind_isOwned (tkind)) - { - /* don't kill shared to suppress future messages */ - if (!alkind_isShared (fkind)) - { - if (!isassign - || !sRef_sameName (fref, tref)) /* result of return parameter */ - { - if (!ffix) - { - if (!tfix) - { - sRef_setDependentComplete (fref, loc); - } - else - { - sRef_setDependent (fref, loc); - } - } - } - } - } - else if (alkind_isShared (tkind)) - { - if (alkind_isFresh (fkind) || alkind_isLocal (fkind)) - { - if (!ffix) - { - sRef_setShared (fref, loc); - } - } - } - else if (alkind_isUnknown (tkind) && context_getFlag (FLG_MEMIMPLICIT)) - { - if (alkind_isDependent (fkind)) - { - if (!exprNode_isNullValue (fexp) - && ctype_isMutable (exprNode_getType (fexp)) - && (!iseitherassign || sRef_isReference (tref))) - { - if (canLoseReference (fref, loc)) - { - ; - } - else - { - if (optgenerror - (FLG_DEPENDENTTRANS, - message ("%s storage %q%q: %q", - alkind_capName (fkind), - sRef_unparseOpt (fref), - transferErrorMessage (transferType, tkind), - generateText (fexp, texp, tref, transferType)), - loc)) - { - DPRINTF (("Here: %s / %s", sRef_unparseFull (fref), - sRef_unparseFull (tref))); - sRef_showAliasInfo (fref); - } - } - } - } - } - else if (alkind_isNewRef (tkind)) - { - if (!ffix && !tfix) - { - sRef_killComplete (fref, loc); - } - } - else if (alkind_isKillRef (tkind)) - { - if (transferType == TT_FCNRETURN) - { - if (sRef_isNewRef (fref)) - { - if (optgenerror - (FLG_REFCOUNTTRANS, - message ("New reference returned as temp reference: %q", - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (fref); - } - } - } - else - { - if (sRef_isNewRef (fref)) - { - sRef_killComplete (fref, loc); - } - else - { - if (sRef_isRefCounted (fref) - && sRef_isCvar (fref) - && !sRef_isLocalVar (fref)) - { - if (optgenerror - (FLG_REFCOUNTTRANS, - message - ("External reference counted storage released: %q", - generateText (fexp, texp, tref, transferType)), - loc)) - { - sRef_showAliasInfo (fref); - } - } - } - } - - } - else - { - ; - } - - setCodePoint (); -} - -/* -** assigns fexp := tref or passes fexp as a parameter, or returns fexp. -** -** For assignments, sets alias and definition state accordingly. -*/ - -static void -checkTransfer (exprNode fexp, sRef fref, exprNode texp, sRef tref, - fileloc loc, transferKind transferType) -{ - setCodePoint (); - - if (context_inProtectVars ()) - { - return; - } - - /* - ** for local references, we need to check - ** the transfer for all possible aliases. - */ - - if (sRef_isLocalVar (tref) && transferType != TT_DOASSIGN) - { - sRefSet alias = usymtab_allAliases (tref); - - sRefSet_realElements (alias, atref) - { - sRef abase = sRef_getRootBase (atref); - - if (sRef_isKnown (atref) - && !sRef_isLocalVar (abase) - && !sRef_isExternal (abase)) - { - atref = sRef_updateSref (atref); - - if (sRef_hasName (atref)) - { - if (!sRef_isNew (atref) - && !sRef_sameName (tref, atref)) - { - context_setAliasAnnote (atref, tref); - } - - checkTransferAux (fexp, fref, TRUE, - texp, atref, FALSE, - loc, transferType); - - context_clearAliasAnnote (); - } - } - } end_sRefSet_realElements; - - sRefSet_free (alias); - } - - - if (sRef_isLocalVar (fref)) - { - sRefSet alias = usymtab_allAliases (fref); - - sRefSet_realElements (alias, afref) - { - sRef abase = sRef_getRootBase (afref); - - if (sRef_isKnown (afref) - && !sRef_isLocalVar (abase) - && !sRef_isExternal (abase)) - { - afref = sRef_updateSref (afref); - - if (sRef_hasName (afref)) - { - if (!sRef_isNew (afref) - && !sRef_sameName (afref, fref)) - { - context_setAliasAnnote (afref, fref); - } - - checkTransferAux (fexp, afref, FALSE, - texp, tref, TRUE, - loc, transferType); - - context_clearAliasAnnote (); - } - } - } end_sRefSet_realElements; - - sRefSet_free (alias); - } - - setCodePoint (); - - checkTransferAux (fexp, fref, FALSE, texp, tref, FALSE, - loc, transferType); - - setCodePoint (); -} - -static /*@exposed@*/ sRef - dependentReference (sRef sr) -{ - sRefSet ab = usymtab_aliasedBy (sr); /* yes, really mean aliasedBy */ - - /* - ** If there is a local variable that aliases sr, then there is no - ** error. Make the local an only. - */ - - if (!sRefSet_isEmpty (ab)) - { - sRef res = sRef_undefined; - - /* - ** make one an only, others alias it - */ - - - sRefSet_realElements (ab, current) - { - if (sRef_isOwned (current)) - { - res = current; - break; - } - } end_sRefSet_realElements; - - sRefSet_free (ab); - return res; - } - - return sRef_undefined; -} - -bool canLoseReference (sRef sr, fileloc loc) -{ - bool gotone = FALSE; - sRefSet ab = usymtab_aliasedBy (sr); /* yes, really mean aliasedBy */ - - - /* - ** if there is a local variable that aliases sr, then there is no - ** error. Make the local an only. - */ - - if (!sRefSet_isEmpty (ab)) - { - /* - ** make one an only, others alias it - */ - - - sRefSet_realElements (ab, current) - { - sRef_setLastReference (current, sr, loc); - gotone = TRUE; - break; - } end_sRefSet_realElements; - - sRefSet_free (ab); - } - - return gotone; -} - -bool canLoseLocalReference (sRef sr, fileloc loc) -{ - bool gotone = FALSE; - sRefSet ab = usymtab_aliasedBy (sr); /* yes, really mean aliasedBy */ - - - /* - ** if there is a local variable that aliases sr, then there is no - ** error. Make the local an only. - */ - - if (!sRefSet_isEmpty (ab)) - { - /* - ** make one an only, others alias it - */ - - - sRefSet_realElements (ab, current) - { - if (sRef_isRealLocalVar (sRef_getRootBase (current))) - { - sRef_setLastReference (current, sr, loc); - gotone = TRUE; - break; - } - } end_sRefSet_realElements; - - sRefSet_free (ab); - } - - return gotone; -} - - -/*start modification */ - -/*added by David Larochelle 4/13/2000*/ - -/*this is modeled after checkTransferNullAux */ - -static void -checkTransferNullTerminatedAux (sRef fref, exprNode fexp, - /*@unused@*/ bool ffix, - sRef tref, exprNode texp, /*@unused@*/ bool tfix, - fileloc loc, transferKind transferType) -{ - alkind tkind = sRef_getAliasKind (tref); - ctype ttyp = ctype_realType (sRef_getType (tref)); - -/* DEBUG - printf ("checking for fexp-%s\n", exprNode_unparse(fexp)); - printf ("checking for texp-%s\n", exprNode_unparse(texp)); -*/ - - if (ctype_isUnknown (ttyp)) - { - ttyp = exprNode_getType (texp); - - if (ctype_isUnknown (ttyp)) - { - ttyp = exprNode_getType (fexp); - - if (ctype_isUnknown (ttyp)) - { - ttyp = sRef_getType (fref); - } - } - } - - if (ctype_isFunction (ttyp) && (transferType == TT_FCNRETURN)) - { - ttyp = ctype_returnValue (ttyp); - } - - /* - ** check for null terminated (don't need to check aliases??) - */ - - if (!sRef_isNullTerminated (fref) - && !usymtab_isGuarded (fref) - && ctype_isRealAP (ttyp)) - { - if (!alkind_isLocal (tkind) && !alkind_isFresh (tkind) - //this should be perhapsNullTerminated but I didn't want to write - && (sRef_isPossiblyNullTerminated (tref) || - sRef_isNullTerminated (tref)) - && !(transferType == TT_DOASSIGN)) - { - if (transferType == TT_GLOBINIT) - { - printf("-----------------------------------NULLTERMINATED ERROR1\n"); - if (sRef_isPossiblyNullTerminated (fref)) { - if (lloptgenerror - (FLG_NULLTERMINATEDWARNING, - message ("%s %q initialized to %s value: %q", - sRef_getScopeName (tref), - sRef_unparse (tref), - sRef_ntMessage (fref), - generateText (fexp, texp, tref, transferType)), - loc)) - { - - printf ("NULLTERMINATED REFERENCE ERROR\n"); - // printf ("First way\n"); - } - - } else { - - if (lloptgenerror - (FLG_NULLTERMINATED, - message ("%s %q initialized to %s value: %q", - sRef_getScopeName (tref), - sRef_unparse (tref), - sRef_ntMessage (fref), - generateText (fexp, texp, tref, transferType)), - loc)) - { - - printf ("NULLTERMINATED REFERENCE ERROR\n"); - // printf ("First way\n"); - } - - printf("-----------------------------\n\n"); - - } - } - else - { - printf("****************************NULLTERMINATED ERROR2\n"); - // ((transferType == TT_FCNPASS) ? FLG_NULLPASS : FLG_NULLRET, - - if (sRef_isPossiblyNullTerminated (fref)) - { - - if (lloptgenerror - (FLG_NULLTERMINATEDWARNING, - message ("%q storage %q%s: %q", - /*@i777@*/cstring_capitalize (sRef_ntMessage (fref)), - sRef_unparseOpt (fref), - transferNTMessage (transferType), - generateText (fexp, texp, tref, transferType)), - loc)) - { - - printf ("NULLTERMINATED REFERENCE ERROR\n"); - // printf ("First way\n"); - } - - } else { - if (lloptgenerror - ((transferType == TT_FCNPASS) ? FLG_NULLTERMINATED: FLG_NULLTERMINATED, - message ("%q storage %q%s: %q", - /*@i77@*/cstring_capitalize (sRef_ntMessage (fref)), - sRef_unparseOpt (fref), - transferNTMessage (transferType), - generateText (fexp, texp, tref, transferType)), - loc)) - { - // sRef_showNullInfo (fref); - // sRef_setNullError (fref); - printf ("SYMBOL REFERENCED IS NOT NULLTERMINATED!\n"); - - } - printf("*******************************=\n\n"); - } - } - } - else - { - ; - } - } -} -/* end modification */ - - diff --git a/src/aliasTable.c b/src/aliasTable.c deleted file mode 100644 index 14bf663..0000000 --- a/src/aliasTable.c +++ /dev/null @@ -1,824 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** aliasTable.c -*/ - -# include "lclintMacros.nf" -# include "basic.h" - -/*@constant int ATINVALID; @*/ -# define ATINVALID -1 - -static sRefSet - aliasTable_canAliasAux (aliasTable p_s, sRef p_sr, int p_lim) /*@*/ ; -static sRefSet - aliasTable_aliasedByLimit (aliasTable p_s, sRef p_sr, int p_lim) /*@*/ ; -static sRefSet - aliasTable_aliasedByAux (aliasTable p_s, sRef p_sr, int p_lim) /*@*/ ; - -aliasTable -aliasTable_new () -{ - return (aliasTable_undefined); -} - -static /*@only@*/ /*@notnull@*/ aliasTable -aliasTable_newEmpty (void) -{ - aliasTable s = (aliasTable) dmalloc (sizeof (*s)); - - s->nelements = 0; - s->nspace = aliasTableBASESIZE; - s->keys = (sRef *) dmalloc (sizeof (*s->keys) * aliasTableBASESIZE); - s->values = (sRefSet *) dmalloc (sizeof (*s->values) * aliasTableBASESIZE); - - return (s); -} - -static void -aliasTable_grow (/*@notnull@*/ aliasTable s) -{ - int i; - o_sRefSet *oldvalues = s->values; - sRef *oldkeys = s->keys; - - s->nspace += aliasTableBASESIZE; - - s->values = (sRefSet *) dmalloc (sizeof (*s->values) - * (s->nelements + s->nspace)); - s->keys = (sRef *) dmalloc (sizeof (*s->keys) * (s->nelements + aliasTableBASESIZE)); - - if (s->keys == (sRef *) 0 || s->values == (sRefSet *)0) - { - llfatalerror (cstring_makeLiteral ("aliasTable_grow: out of memory!")); - } - - for (i = 0; i < s->nelements; i++) - { - s->values[i] = oldvalues[i]; - s->keys[i] = oldkeys[i]; - } - - sfree (oldvalues); - sfree (oldkeys); -} - -static int aliasTable_lookupRefs (/*@notnull@*/ aliasTable s, sRef sr) -{ - int i; - - - for (i = 0; i < aliasTable_size (s); i++) - { - if (sRef_same (sr, s->keys[i])) - { - return i; - } - } - - return ATINVALID; -} - -/* -** sr aliases al (and anything al aliases!) -*/ - -aliasTable -aliasTable_addMustAlias (/*@returned@*/ aliasTable s, - /*@exposed@*/ sRef sr, - sRef al) -{ - int ind; - sRefSet ss; - - llassert (NOALIAS (sr, al)); - - if (aliasTable_isUndefined (s)) - { - s = aliasTable_newEmpty (); - ind = ATINVALID; - } - else - { - ind = aliasTable_lookupRefs (s, sr); - } - - ss = aliasTable_canAlias (s, al); - - - if (ind == ATINVALID) - { - if (s->nspace <= 0) { - aliasTable_grow (s); - } - - s->nspace--; - s->keys[s->nelements] = sr; - s->values[s->nelements] = sRefSet_single (al); - ind = s->nelements; - s->nelements++; - } - else - { - s->values[ind] = sRefSet_insert (s->values[ind], al); - } - - s->values[ind] = sRefSet_unionExcept (s->values[ind], ss, s->keys[ind]); - - sRefSet_free (ss); - return s; -} - -static aliasTable - aliasTable_addSet (/*@returned@*/ aliasTable s, - /*@exposed@*/ sRef key, /*@only@*/ sRefSet value) -{ - if (!sRefSet_isEmpty (value)) - { - if (aliasTable_isUndefined (s)) - { - s = aliasTable_newEmpty (); - } - else - { - if (s->nspace <= 0) - { - aliasTable_grow (s); - } - } - - s->nspace--; - s->keys[s->nelements] = key; - s->values[s->nelements] = value; - s->nelements++; - } - else - { - sRefSet_free (value); - } - - return s; -} - -/* -** When aliases are cleared: -** -** o remove all entries for sr -** o replace all aliases for things which alias sr with sr's aliases -** -** Clear aliases for sr; if sr is a direct param reference, clear its aliases too. -*/ - -static void aliasTable_clearAliasesAux (/*@notnull@*/ aliasTable p_s, sRef p_sr) - /*@modifies p_s@*/ ; - -void aliasTable_clearAliases (aliasTable s, sRef sr) -{ - if (aliasTable_isUndefined (s)) - { - return; - } - else - { - sRef rb = sRef_getRootBase (sr); - - - if (!sRef_isCvar (sr) && sRef_isLocalVar (rb)) - { - int ind = aliasTable_lookupRefs (s, rb); - - if (ind != ATINVALID) - { - sRefSet al = s->values[ind]; - - - sRefSet_realElements (al, el) - { - - if (sRef_isParam (el)) - { - if (sRef_sameName (el, rb)) - { - sRef fb = sRef_fixBase (sr, el); - - aliasTable_clearAliasesAux (s, fb); - } - } - } end_sRefSet_realElements ; - } - } - - aliasTable_clearAliasesAux (s, sr); - } -} - -static -void aliasTable_clearAliasesAux (/*@notnull@*/ aliasTable s, sRef sr) -{ - int i; - - for (i = 0; i < s->nelements; i++) - { - sRef key = s->keys[i]; - - if (sRef_includedBy (key, sr)) - { - sRefSet_clear (s->values[i]); - } - else - { - (void) sRefSet_deleteBase (s->values[i], sr); - } - } -} - -/* -** returns set of all sRefs that must alias sr (but are different from sr) -*/ - -static /*@only@*/ sRefSet aliasTable_aliasedByAux (aliasTable s, sRef sr, int lim) -{ - static bool hadWarning = FALSE; - sRefSet res = sRefSet_undefined; - int i; - - llassert (!sRef_isConj (sr)); - - - if (aliasTable_isUndefined (s) || lim >= ALIASSEARCHLIMIT) - { - if (lim >= ALIASSEARCHLIMIT && !hadWarning) - { - llquietbug - (message ("Alias search limit exceeded, checking %q. " - "This either means there is a variable with at least " - "%d indirections, or there is a bug in LCLint.", - sRef_unparse (sr), - ALIASSEARCHLIMIT)); - - hadWarning = TRUE; - } - - return sRefSet_undefined; - } - else - { - sRefSet abl; - - if (sRef_isPointer (sr)) - { - abl = aliasTable_aliasedByLimit (s, sRef_getBase (sr), lim); - res = sRefSet_addIndirection (abl); - } - else if (sRef_isAddress (sr)) - { - abl = aliasTable_aliasedByLimit (s, sRef_getBase (sr), lim); - res = sRefSet_removeIndirection (abl); - } - else if (sRef_isField (sr)) - { - abl = aliasTable_aliasedByLimit (s, sRef_getBase (sr), lim); - res = sRefSet_accessField (abl, sRef_getField (sr)); - } - else if (sRef_isArrayFetch (sr)) - { - abl = aliasTable_aliasedByLimit (s, sRef_getBase (sr), lim); - - if (sRef_isIndexKnown (sr)) - { - int idx = sRef_getIndex (sr); - - res = sRefSet_fetchKnown (abl, idx); - } - else - { - res = sRefSet_fetchUnknown (abl); - } - } - else - { - abl = sRefSet_undefined; - } - - sRefSet_free (abl); - } - - for (i = 0; i < s->nelements; i++) - { - sRef elem = s->keys[i]; - - if (!sRef_same (sr, elem)) /* was sameName */ - { - - sRefSet_realElements (s->values[i], current) - { - - if (sRef_similar (sr, current)) - { - res = sRefSet_insert (res, sRef_fixOuterRef (elem)); - /*@innerbreak@*/ break; - } - } end_sRefSet_realElements; - } - } - - return res; -} - -static /*@only@*/ sRefSet aliasTable_aliasedByLimit (aliasTable s, sRef sr, int lim) -{ - sRefSet res; - - - if (sRef_isConj (sr)) - { - res = sRefSet_unionFree (aliasTable_aliasedByLimit (s, sRef_getConjA (sr), lim), - aliasTable_aliasedByLimit (s, sRef_getConjB (sr), lim)); - } - else - { - res = aliasTable_aliasedByAux (s, sr, lim + 1); - } - - return res; -} - -/*@only@*/ sRefSet aliasTable_aliasedBy (aliasTable s, sRef sr) -{ - if (sRef_isConj (sr)) - { - return (sRefSet_unionFree (aliasTable_aliasedBy (s, sRef_getConjA (sr)), - aliasTable_aliasedBy (s, sRef_getConjB (sr)))); - } - - return (aliasTable_aliasedByAux (s, sr, 0)); -} - -/*@only@*/ sRefSet aliasTable_canAlias (aliasTable s, sRef sr) -{ - sRefSet res; - - - if (sRef_isConj (sr)) - { - res = sRefSet_unionFree (aliasTable_canAlias (s, sRef_getConjA (sr)), - aliasTable_canAlias (s, sRef_getConjB (sr))); - } - else - { - res = aliasTable_canAliasAux (s, sr, 0); - } - - return res; -} - -/* -** need to limit the depth of aliasing searches -*/ - -static /*@only@*/ sRefSet aliasTable_canAliasLimit (aliasTable s, sRef sr, int lim) -{ - sRefSet res; - - if (sRef_isConj (sr)) - { - sRefSet a = aliasTable_canAliasLimit (s, sRef_getConjA (sr), lim); - sRefSet b = aliasTable_canAliasLimit (s, sRef_getConjB (sr), lim); - - res = sRefSet_unionFree (a, b); - } - else - { - res = aliasTable_canAliasAux (s, sr, lim + 1); - } - - return res; -} - -static /*@only@*/ sRefSet - aliasTable_canAliasAux (aliasTable s, sRef sr, int lim) -{ - static bool hadWarning = FALSE; - llassert (!sRef_isConj (sr)); - - - if (aliasTable_isUndefined (s) || lim >= ALIASSEARCHLIMIT) - { - if (lim >= ALIASSEARCHLIMIT && !hadWarning) - { - llquietbug - (message ("Alias search limit exceeded, checking %q. " - "This either means there is a variable with at least " - "%d indirections, or there is a bug in LCLint.", - sRef_unparse (sr), - ALIASSEARCHLIMIT)); - - hadWarning = TRUE; - } - - return sRefSet_undefined; - } - else - { - int ind = aliasTable_lookupRefs (s, sr); - - if (sRef_isPointer (sr) || sRef_isAddress (sr) || sRef_isField (sr) - || sRef_isArrayFetch (sr)) - { - sRef base = sRef_getBase (sr); - sRefSet tmp = aliasTable_canAliasLimit (s, base, lim); - sRefSet ret; - - if (sRef_isPointer (sr)) - { - ret = sRefSet_addIndirection (tmp); - } - else if (sRef_isAddress (sr)) - { - ret = sRefSet_removeIndirection (tmp); - } - else if (sRef_isField (sr)) - { - ret = sRefSet_accessField (tmp, sRef_getField (sr)); - } - else if (sRef_isArrayFetch (sr)) - { - if (sRef_isIndexKnown (sr)) - { - ret = sRefSet_fetchKnown (tmp, sRef_getIndex (sr)); - } - else - { - ret = sRefSet_fetchUnknown (tmp); - } - } - else - { - BADBRANCH; - } - - if (ind != ATINVALID) - { - ret = sRefSet_union (ret, s->values[ind]); - } - - sRefSet_free (tmp); - return ret; - } - - if (ind == ATINVALID) return sRefSet_undefined; - - return sRefSet_newCopy (s->values[ind]); - } -} - -aliasTable aliasTable_copy (aliasTable s) -{ - if (aliasTable_isEmpty (s)) - { - return aliasTable_undefined; - } - else - { - aliasTable t = (aliasTable) dmalloc (sizeof (*s)); - int i; - - t->nelements = s->nelements; - t->nspace = 0; - t->keys = (sRef *) dmalloc (sizeof (*s->keys) * s->nelements); - t->values = (sRefSet *) dmalloc (sizeof (*s->values) * t->nelements); - - for (i = 0; i < s->nelements; i++) - { - t->keys[i] = s->keys[i]; - t->values[i] = sRefSet_newCopy (s->values[i]); - } - - return t; - } -} - -static void -aliasTable_levelPrune (aliasTable s, int lexlevel) -{ - - - if (aliasTable_isEmpty (s)) - { - return; - } - else - { - int i; - int backcount = s->nelements - 1; - - for (i = 0; i <= backcount; i++) - { - sRef key = s->keys[i]; - - if (sRef_lexLevel (key) > lexlevel) - { - int j; - for (j = backcount; j > i; j--) - { - backcount--; - s->nelements--; - s->nspace++; - - if (sRef_lexLevel (s->keys[j]) <= lexlevel) - { - s->keys[i] = s->keys[j]; - s->values[i] = s->values[j]; - sRefSet_levelPrune (s->values[i], lexlevel); - /*@innerbreak@*/ break; - } - } - if (backcount == i) - s->nelements--; - } - else - { - sRefSet_levelPrune (s->values[i], lexlevel); - } - } - } -} - -/* -** levelUnionSeq -** -** like level union, but know that t2 was executed after t1. So if -** t1 has x -> { a, b } and t2 has x -> { a }, then result has x -> { a }. -** -** NOTE: t2 is "only". -*/ - -aliasTable aliasTable_levelUnionSeq (/*@returned@*/ aliasTable t1, - /*@only@*/ aliasTable t2, int level) -{ - if (aliasTable_isUndefined (t2)) - { - return t1; - } - - if (aliasTable_isUndefined (t1)) - { - t1 = aliasTable_newEmpty (); - } - else - { - aliasTable_levelPrune (t1, level); - } - - aliasTable_elements (t2, key, value) - { - if (sRef_lexLevel (key) <= level) - { - int ind = aliasTable_lookupRefs (t1, key); - - sRefSet_levelPrune (value, level); - - if (ind == ATINVALID) - { - /* okay, t2 is killed */ - /*@-exposetrans@*/ /*@-dependenttrans@*/ - t1 = aliasTable_addSet (t1, key, value); - /*@=exposetrans@*/ /*@=dependenttrans@*/ - } - else - { - sRefSet_free (t1->values[ind]); - - /*@-dependenttrans@*/ /* okay, t2 is killed */ - t1->values[ind] = value; - /*@=dependenttrans@*/ - } - } - else - { - /*@-exposetrans@*/ /*@-dependenttrans@*/ - sRefSet_free (value); - /*@=exposetrans@*/ /*@=dependenttrans@*/ - } - - } end_aliasTable_elements; - - sfree (t2->keys); - sfree (t2->values); - sfree (t2); - - return t1; -} - -aliasTable -aliasTable_levelUnion (/*@returned@*/ aliasTable t1, aliasTable t2, int level) -{ - if (aliasTable_isUndefined (t1)) - { - if (aliasTable_isUndefined (t2)) - { - return t1; - } - else - { - t1 = aliasTable_newEmpty (); - } - } - else - { - aliasTable_levelPrune (t1, level); - } - - aliasTable_elements (t2, key, cvalue) - { - sRefSet value = sRefSet_newCopy (cvalue); - - if (sRef_lexLevel (key) <= level) - { - sRefSet_levelPrune (value, level); - - if (sRefSet_size (value) > 0) - { - int ind = aliasTable_lookupRefs (t1, key); - - if (ind == ATINVALID) - { - t1 = aliasTable_addSet (t1, key, value); - } - else - { - t1->values[ind] = sRefSet_union (t1->values[ind], value); - sRefSet_free (value); - } - } - else - { - sRefSet_free (value); - } - } - else - { - sRefSet_free (value); - } - } end_aliasTable_elements; - - return t1; -} - -aliasTable aliasTable_levelUnionNew (aliasTable t1, aliasTable t2, int level) -{ - aliasTable ret = aliasTable_levelUnion (aliasTable_copy (t1), t2, level); - - return ret; -} - -/*@only@*/ cstring -aliasTable_unparse (aliasTable s) -{ - cstring st = cstring_undefined; - - if (aliasTable_isUndefined (s)) return (cstring_makeLiteral ("")); - - aliasTable_elements (s, key, value) - { - st = message ("%q\t%q -> %q\n", st, sRef_unparse (key), - sRefSet_unparse (value)); - } end_aliasTable_elements; - - return st; -} - -/* -** bogus! -*/ - -void -aliasTable_fixSrefs (aliasTable s) -{ - int i; - - if (aliasTable_isUndefined (s)) return; - - for (i = 0; i < s->nelements; i++) - { - sRef old = s->keys[i]; - - if (sRef_isLocalVar (old)) - { - s->keys[i] = uentry_getSref (sRef_getUentry (old)); - } - - sRefSet_fixSrefs (s->values[i]); - } -} - -void -aliasTable_free (/*@only@*/ aliasTable s) -{ - int i; - - if (aliasTable_isUndefined (s)) return; - - for (i = 0; i < s->nelements; i++) - { - sRefSet_free (s->values[i]); - } - - sfree (s->values); - sfree (s->keys); - sfree (s); -} - -void -aliasTable_checkGlobs (aliasTable t) -{ - aliasTable_elements (t, key, value) - { - sRef root = sRef_getRootBase (key); - - if (sRef_isAliasCheckedGlobal (root)) - { - sRefSet_realElements (value, sr) - { - root = sRef_getRootBase (sr); - - if (((sRef_isAliasCheckedGlobal (root) - && !(sRef_similar (root, key))) - || sRef_isAnyParam (root)) - && !sRef_isExposed (root)) - { - if (sRef_isAliasCheckedGlobal (key)) - { - if (!(sRef_isShared (key) - && sRef_isShared (root))) - { - voptgenerror - (FLG_GLOBALIAS, - message - ("Function returns with %q variable %q aliasing %q %q", - cstring_makeLiteral (sRef_isRealGlobal (key) - ? "global" : "file static"), - sRef_unparse (key), - cstring_makeLiteral (sRef_isAnyParam (root) - ? "parameter" : "global"), - sRef_unparse (sr)), - g_currentloc); - } - } - - } - } end_sRefSet_realElements; - } - else if (sRef_isAnyParam (key) || sRef_isAnyParam (root)) - { - sRefSet_realElements (value, sr) - { - root = sRef_getRootBase (sr); - - if (sRef_isAliasCheckedGlobal (root) - && !sRef_isExposed (root) - && !sRef_isDead (key) - && !sRef_isShared (root)) - { - voptgenerror - (FLG_GLOBALIAS, - message ("Function returns with parameter %q aliasing %q %q", - sRef_unparse (key), - cstring_makeLiteral (sRef_isRealGlobal (root) - ? "global" : "file static"), - sRef_unparse (sr)), - g_currentloc); - } - } end_sRefSet_realElements; - } - else - { - ; - } - } end_aliasTable_elements; -} - - - diff --git a/src/cgrammar.tab.c b/src/cgrammar.tab.c deleted file mode 100644 index 8f242b2..0000000 --- a/src/cgrammar.tab.c +++ /dev/null @@ -1,5763 +0,0 @@ - -/* A Bison parser, made from cgrammar.y - by GNU Bison version 1.25 - */ - -#define YYBISON 1 /* Identify Bison output. */ - -#define BADTOK 258 -#define SKIPTOK 259 -#define CTOK_ELIPSIS 260 -#define CASE 261 -#define DEFAULT 262 -#define CIF 263 -#define CELSE 264 -#define SWITCH 265 -#define WHILE 266 -#define DO 267 -#define CFOR 268 -#define GOTO 269 -#define CONTINUE 270 -#define BREAK 271 -#define RETURN 272 -#define TSEMI 273 -#define TLBRACE 274 -#define TRBRACE 275 -#define TCOMMA 276 -#define TCOLON 277 -#define TASSIGN 278 -#define TLPAREN 279 -#define TRPAREN 280 -#define TLSQBR 281 -#define TRSQBR 282 -#define TDOT 283 -#define TAMPERSAND 284 -#define TEXCL 285 -#define TTILDE 286 -#define TMINUS 287 -#define TPLUS 288 -#define TMULT 289 -#define TDIV 290 -#define TPERCENT 291 -#define TLT 292 -#define TGT 293 -#define TCIRC 294 -#define TBAR 295 -#define TQUEST 296 -#define CSIZEOF 297 -#define CALIGNOF 298 -#define ARROW_OP 299 -#define CTYPEDEF 300 -#define COFFSETOF 301 -#define INC_OP 302 -#define DEC_OP 303 -#define LEFT_OP 304 -#define RIGHT_OP 305 -#define LE_OP 306 -#define GE_OP 307 -#define EQ_OP 308 -#define NE_OP 309 -#define AND_OP 310 -#define OR_OP 311 -#define MUL_ASSIGN 312 -#define DIV_ASSIGN 313 -#define MOD_ASSIGN 314 -#define ADD_ASSIGN 315 -#define SUB_ASSIGN 316 -#define LEFT_ASSIGN 317 -#define RIGHT_ASSIGN 318 -#define AND_ASSIGN 319 -#define XOR_ASSIGN 320 -#define OR_ASSIGN 321 -#define CSTRUCT 322 -#define CUNION 323 -#define CENUM 324 -#define VA_ARG 325 -#define VA_DCL 326 -#define QGLOBALS 327 -#define QMODIFIES 328 -#define QNOMODS 329 -#define QCONSTANT 330 -#define QFUNCTION 331 -#define QITER 332 -#define QDEFINES 333 -#define QUSES 334 -#define QALLOCATES 335 -#define QSETS 336 -#define QRELEASES 337 -#define QPRECLAUSE 338 -#define QPOSTCLAUSE 339 -#define QALT 340 -#define QUNDEF 341 -#define QKILLED 342 -#define QENDMACRO 343 -#define LLMACRO 344 -#define LLMACROITER 345 -#define LLMACROEND 346 -#define TENDMACRO 347 -#define QSWITCHBREAK 348 -#define QLOOPBREAK 349 -#define QINNERBREAK 350 -#define QSAFEBREAK 351 -#define QINNERCONTINUE 352 -#define QFALLTHROUGH 353 -#define QLINTNOTREACHED 354 -#define QLINTFALLTHROUGH 355 -#define QLINTFALLTHRU 356 -#define QARGSUSED 357 -#define QPRINTFLIKE 358 -#define QLINTPRINTFLIKE 359 -#define QSCANFLIKE 360 -#define QMESSAGELIKE 361 -#define QNOTREACHED 362 -#define QCONST 363 -#define QVOLATILE 364 -#define QINLINE 365 -#define QEXTENSION 366 -#define QEXTERN 367 -#define QSTATIC 368 -#define QAUTO 369 -#define QREGISTER 370 -#define QOUT 371 -#define QIN 372 -#define QYIELD 373 -#define QONLY 374 -#define QTEMP 375 -#define QSHARED 376 -#define QREF 377 -#define QUNIQUE 378 -#define QCHECKED 379 -#define QUNCHECKED 380 -#define QCHECKEDSTRICT 381 -#define QCHECKMOD 382 -#define QKEEP 383 -#define QKEPT 384 -#define QPARTIAL 385 -#define QSPECIAL 386 -#define QOWNED 387 -#define QDEPENDENT 388 -#define QRETURNED 389 -#define QEXPOSED 390 -#define QNULL 391 -#define QOBSERVER 392 -#define QISNULL 393 -#define QEXITS 394 -#define QMAYEXIT 395 -#define QNEVEREXIT 396 -#define QTRUEEXIT 397 -#define QFALSEEXIT 398 -#define QLONG 399 -#define QSIGNED 400 -#define QUNSIGNED 401 -#define QSHORT 402 -#define QUNUSED 403 -#define QSEF 404 -#define QNOTNULL 405 -#define QRELNULL 406 -#define QABSTRACT 407 -#define QCONCRETE 408 -#define QMUTABLE 409 -#define QIMMUTABLE 410 -#define QTRUENULL 411 -#define QFALSENULL 412 -#define QEXTERNAL 413 -#define QREFCOUNTED 414 -#define QREFS 415 -#define QNEWREF 416 -#define QTEMPREF 417 -#define QKILLREF 418 -#define QRELDEF 419 -#define CGCHAR 420 -#define CBOOL 421 -#define CINT 422 -#define CGFLOAT 423 -#define CDOUBLE 424 -#define CVOID 425 -#define QANYTYPE 426 -#define QINTEGRALTYPE 427 -#define QUNSIGNEDINTEGRALTYPE 428 -#define QSIGNEDINTEGRALTYPE 429 -#define QNULLTERMINATED 430 -#define QSETBUFFERSIZE 431 -#define QBUFFERCONSTRAINT 432 -#define QENSURESCONSTRAINT 433 -#define QSETSTRINGLENGTH 434 -#define QMAXSET 435 -#define QMAXREAD 436 -#define QTESTINRANGE 437 -#define IDENTIFIER 438 -#define NEW_IDENTIFIER 439 -#define TYPE_NAME_OR_ID 440 -#define CCONSTANT 441 -#define ITER_NAME 442 -#define ITER_ENDNAME 443 -#define TYPE_NAME 444 - -#line 19 "cgrammar.y" - -/* -** -** cgrammar.y -** -** Yacc/Bison grammar for extended ANSI C used by LCLint. -** -** original grammar by Nate Osgood --- -** hacrat@catfish.lcs.mit.edu Mon Jun 14 13:06:32 1993 -** -** changes for LCLint --- handle typedef names correctly -** fix struct/union parsing bug (empty struct is accepted) -** add productions to handle macros --- require -** error correction --- main source of conflicts in grammar. -** need to process initializations sequentially, L->R -** -** production names are cryptic, so more productions fit on one line -** -** conflicts: 87 shift/reduce, 18 reduce/reduce -** most of these are due to handling macros -** a few are due to handling type expressions -*/ - -/*@=allmacros@*/ - -extern int yylex (); -extern void swallowMacro (void); - -# include "lclintMacros.nf" -# include "basic.h" -# include "cgrammar.h" -# include "exprChecks.h" - -/*@-allmacros@*/ -/*@-matchfields@*/ - -# define SHOWCSYM FALSE -void yyerror (char *s); - -/* -** This is necessary, or else when the bison-generated code #include's malloc.h, -** there will be a parse error. -** -** Unfortunately, it means the error checking on malloc, etc. is lost for allocations -** in bison-generated files under Win32. -*/ - -# ifdef WIN32 -# undef malloc -# undef calloc -# undef realloc -# endif - -void checkandsetBufState(idDecl id, exprNode is); - -#line 75 "cgrammar.y" -typedef union -{ - lltok tok; - int count; - specialClauseKind sck; - qual typequal; - qualList tquallist; - ctype ctyp; - sRef sr; - /*@only@*/ qtype qtyp; - /*@only@*/ cstring cname; - /*@only@*/ idDecl ntyp; - /*@only@*/ idDeclList ntyplist; - /*@only@*/ uentryList flist; - /*@owned@*/ uentryList entrylist; - /*@observer@*/ /*@dependent@*/ uentry entry; - /*@only@*/ uentry oentry; - /*@only@*/ exprNode expr; - /*@only@*/ enumNameList enumnamelist; - /*@only@*/ exprNodeList alist; - /*@only@*/ sRefSet srset; - /*@only@*/ cstringList cstringlist; - /*drl - added 1/19/2001 - */ - constraint con; - constraintList conL; - constraintExpr conE; - /* drl */ -} YYSTYPE; -#ifndef YYDEBUG -#define YYDEBUG 1 -#endif - -#include - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif -#endif - - - -#define YYFINAL 1229 -#define YYFLAG -32768 -#define YYNTBASE 190 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 444 ? yytranslate[x] : 434) - -static const short yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189 -}; - -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 1, 3, 5, 8, 11, 13, 15, 17, 19, - 21, 23, 32, 44, 45, 51, 53, 57, 59, 62, - 64, 71, 75, 82, 83, 91, 92, 101, 103, 110, - 114, 121, 122, 129, 130, 138, 139, 140, 151, 155, - 159, 163, 166, 168, 169, 172, 173, 176, 179, 180, - 185, 186, 187, 192, 193, 196, 198, 203, 205, 207, - 209, 211, 213, 215, 220, 226, 228, 230, 232, 234, - 238, 243, 246, 250, 254, 258, 260, 262, 264, 265, - 268, 269, 272, 274, 277, 279, 282, 284, 287, 289, - 293, 296, 298, 300, 302, 304, 306, 308, 310, 311, - 314, 315, 322, 323, 330, 332, 334, 335, 336, 342, - 343, 349, 351, 353, 354, 356, 357, 358, 362, 363, - 367, 369, 371, 373, 375, 377, 379, 381, 383, 385, - 387, 389, 391, 393, 395, 397, 399, 401, 402, 410, - 411, 420, 422, 426, 427, 431, 432, 436, 439, 443, - 446, 449, 451, 453, 455, 459, 464, 467, 471, 475, - 479, 481, 483, 485, 489, 491, 493, 497, 502, 505, - 509, 513, 517, 519, 523, 525, 527, 529, 533, 535, - 537, 539, 544, 548, 553, 560, 566, 572, 575, 578, - 580, 584, 586, 589, 592, 595, 598, 601, 604, 607, - 610, 612, 614, 618, 620, 630, 631, 635, 640, 643, - 648, 651, 653, 658, 660, 664, 668, 672, 674, 678, - 682, 684, 688, 692, 694, 698, 702, 706, 710, 712, - 716, 720, 722, 726, 728, 732, 734, 738, 740, 741, - 746, 748, 749, 754, 756, 757, 758, 766, 768, 772, - 776, 780, 784, 788, 792, 796, 800, 804, 808, 812, - 814, 818, 819, 821, 823, 825, 827, 829, 833, 834, - 844, 845, 857, 860, 861, 868, 869, 877, 882, 887, - 888, 889, 892, 894, 899, 900, 905, 907, 911, 916, - 918, 922, 924, 926, 928, 930, 932, 935, 938, 941, - 944, 947, 950, 953, 956, 959, 962, 965, 968, 971, - 974, 977, 980, 983, 986, 989, 992, 995, 998, 1001, - 1004, 1007, 1010, 1013, 1016, 1019, 1022, 1025, 1028, 1031, - 1034, 1037, 1040, 1043, 1046, 1049, 1052, 1055, 1058, 1061, - 1064, 1067, 1070, 1072, 1074, 1076, 1078, 1081, 1084, 1087, - 1090, 1093, 1096, 1099, 1102, 1105, 1108, 1111, 1114, 1117, - 1120, 1124, 1126, 1131, 1133, 1137, 1140, 1143, 1146, 1147, - 1149, 1150, 1151, 1163, 1164, 1165, 1177, 1184, 1191, 1192, - 1193, 1204, 1205, 1206, 1217, 1223, 1229, 1234, 1239, 1240, - 1242, 1244, 1247, 1253, 1257, 1260, 1265, 1267, 1271, 1276, - 1283, 1284, 1293, 1298, 1300, 1304, 1307, 1309, 1314, 1316, - 1318, 1321, 1324, 1326, 1329, 1331, 1334, 1336, 1338, 1340, - 1343, 1345, 1348, 1351, 1355, 1357, 1361, 1363, 1367, 1369, - 1371, 1375, 1376, 1379, 1380, 1385, 1390, 1392, 1394, 1397, - 1399, 1401, 1404, 1405, 1407, 1413, 1416, 1420, 1424, 1429, - 1433, 1438, 1443, 1449, 1451, 1453, 1455, 1457, 1459, 1461, - 1463, 1465, 1467, 1469, 1474, 1479, 1484, 1487, 1489, 1491, - 1493, 1496, 1499, 1507, 1514, 1517, 1518, 1519, 1530, 1531, - 1538, 1540, 1542, 1544, 1546, 1549, 1551, 1553, 1555, 1557, - 1559, 1561, 1563, 1567, 1569, 1572, 1575, 1578, 1580, 1582, - 1584, 1586, 1588, 1590, 1592, 1594, 1596, 1598, 1602, 1604, - 1606, 1609, 1612, 1613, 1618, 1619, 1625, 1626, 1630, 1631, - 1636, 1640, 1643, 1647, 1648, 1649, 1650, 1651, 1652, 1654, - 1657, 1660, 1664, 1667, 1671, 1675, 1680, 1683, 1686, 1690, - 1694, 1699, 1701, 1704, 1706, 1709, 1711, 1714, 1716, 1719, - 1721, 1724, 1726, 1731, 1734, 1735, 1741, 1742, 1749, 1754, - 1759, 1760, 1761, 1772, 1774, 1775, 1780, 1782, 1784, 1786, - 1788, 1790, 1794, 1796, 1801, 1805, 1810, 1817, 1823, 1829, - 1832, 1835, 1837, 1840, 1843, 1846, 1849, 1852, 1855, 1858, - 1861, 1863, 1865, 1870, 1872, 1876, 1880, 1884, 1886, 1890, - 1894, 1896, 1900, 1904, 1906, 1910, 1914, 1918, 1922, 1924, - 1928, 1932, 1934, 1938, 1940, 1944, 1946, 1950, 1952, 1956, - 1958, 1962, 1964, 1965, 1966, 1974, 1976, 1980, 1984, 1988, - 1992, 1996, 2000, 2004, 2008, 2012, 2016, 2020, 2022, 2023, - 2025, 2028, 2036, 2039, 2042, 2050, 2057, 2060, 2064, 2067, - 2071, 2074, 2078, 2082, 2086, 2090, 2093, 2097, 2098, 2100, - 2102, 2104, 2106, 2108, 2110, 2112, 2114 -}; - -static const short yyrhs[] = { -1, - 191, 0, 192, 0, 191, 192, 0, 260, 430, 0, - 193, 0, 194, 0, 204, 0, 207, 0, 297, 0, - 1, 0, 75, 317, 330, 340, 330, 430, 305, 88, - 0, 75, 317, 330, 340, 330, 23, 305, 310, 309, - 430, 88, 0, 0, 76, 195, 196, 430, 88, 0, - 197, 0, 317, 330, 197, 0, 201, 0, 344, 201, - 0, 432, 0, 305, 24, 330, 340, 305, 25, 0, - 198, 26, 27, 0, 198, 26, 305, 296, 27, 330, - 0, 0, 198, 306, 24, 25, 199, 209, 211, 0, - 0, 198, 306, 24, 341, 25, 200, 209, 211, 0, - 432, 0, 305, 24, 330, 197, 305, 25, 0, 201, - 26, 27, 0, 201, 26, 305, 296, 27, 330, 0, - 0, 201, 306, 24, 25, 202, 227, 0, 0, 201, - 306, 24, 341, 25, 203, 227, 0, 0, 0, 77, - 432, 24, 341, 25, 205, 227, 206, 430, 88, 0, - 89, 371, 92, 0, 90, 358, 92, 0, 91, 359, - 92, 0, 89, 92, 0, 256, 0, 0, 210, 229, - 0, 0, 212, 213, 0, 216, 214, 0, 0, 215, - 178, 218, 88, 0, 0, 0, 217, 177, 218, 88, - 0, 0, 219, 218, 0, 219, 0, 222, 221, 222, - 18, 0, 180, 0, 181, 0, 52, 0, 51, 0, - 53, 0, 223, 0, 225, 24, 222, 25, 0, 24, - 222, 226, 222, 25, 0, 224, 0, 186, 0, 431, - 0, 184, 0, 224, 26, 27, 0, 224, 26, 186, - 27, 0, 34, 224, 0, 24, 224, 25, 0, 224, - 28, 432, 0, 224, 44, 432, 0, 220, 0, 33, - 0, 32, 0, 0, 0, 230, 0, 0, 228, 230, - 0, 237, 0, 231, 237, 0, 240, 0, 231, 240, - 0, 253, 0, 253, 231, 0, 233, 0, 232, 21, - 233, 0, 236, 234, 0, 431, 0, 184, 0, 86, - 0, 87, 0, 116, 0, 117, 0, 130, 0, 0, - 235, 236, 0, 0, 72, 238, 391, 430, 88, 243, - 0, 0, 72, 239, 232, 430, 88, 243, 0, 74, - 0, 244, 0, 0, 0, 72, 241, 391, 430, 243, - 0, 0, 72, 242, 232, 430, 243, 0, 74, 0, - 246, 0, 0, 244, 0, 0, 0, 73, 245, 261, - 0, 0, 73, 247, 262, 0, 78, 0, 79, 0, - 80, 0, 81, 0, 82, 0, 88, 0, 88, 0, - 83, 0, 84, 0, 119, 0, 137, 0, 135, 0, - 133, 0, 132, 0, 121, 0, 138, 0, 150, 0, - 0, 248, 330, 254, 267, 430, 250, 305, 0, 0, - 251, 330, 252, 255, 267, 430, 249, 305, 0, 340, - 0, 317, 330, 340, 0, 0, 19, 258, 387, 0, - 0, 391, 259, 380, 0, 208, 257, 0, 265, 430, - 88, 0, 430, 88, 0, 265, 430, 0, 430, 0, - 431, 0, 184, 0, 263, 26, 27, 0, 263, 26, - 264, 27, 0, 34, 263, 0, 24, 263, 25, 0, - 263, 28, 432, 0, 263, 44, 432, 0, 263, 0, - 186, 0, 263, 0, 265, 21, 263, 0, 431, 0, - 184, 0, 266, 26, 27, 0, 266, 26, 264, 27, - 0, 34, 266, 0, 24, 266, 25, 0, 266, 28, - 432, 0, 266, 44, 432, 0, 266, 0, 267, 21, - 266, 0, 431, 0, 184, 0, 186, 0, 24, 294, - 25, 0, 185, 0, 111, 0, 268, 0, 269, 26, - 294, 27, 0, 269, 24, 25, 0, 269, 24, 270, - 25, 0, 70, 24, 293, 21, 352, 25, 0, 269, - 330, 28, 432, 305, 0, 269, 330, 44, 432, 305, - 0, 269, 47, 0, 269, 48, 0, 293, 0, 270, - 21, 293, 0, 269, 0, 47, 271, 0, 48, 271, - 0, 29, 277, 0, 34, 277, 0, 33, 277, 0, - 32, 277, 0, 31, 277, 0, 30, 277, 0, 274, - 0, 273, 0, 272, 28, 432, 0, 432, 0, 46, - 305, 24, 352, 330, 21, 272, 25, 305, 0, 0, - 305, 275, 276, 0, 42, 24, 352, 25, 0, 42, - 271, 0, 43, 24, 352, 25, 0, 43, 271, 0, - 271, 0, 24, 352, 25, 277, 0, 277, 0, 278, - 34, 277, 0, 278, 35, 277, 0, 278, 36, 277, - 0, 278, 0, 279, 33, 278, 0, 279, 32, 278, - 0, 279, 0, 280, 49, 279, 0, 280, 50, 279, - 0, 280, 0, 281, 37, 280, 0, 281, 38, 280, - 0, 281, 51, 280, 0, 281, 52, 280, 0, 281, - 0, 282, 53, 281, 0, 282, 54, 281, 0, 282, - 0, 283, 29, 282, 0, 283, 0, 284, 39, 283, - 0, 284, 0, 285, 40, 284, 0, 285, 0, 0, - 286, 55, 287, 285, 0, 286, 0, 0, 288, 56, - 289, 286, 0, 288, 0, 0, 0, 288, 41, 291, - 294, 22, 292, 290, 0, 290, 0, 271, 23, 293, - 0, 271, 57, 293, 0, 271, 58, 293, 0, 271, - 59, 293, 0, 271, 60, 293, 0, 271, 61, 293, - 0, 271, 62, 293, 0, 271, 63, 293, 0, 271, - 64, 293, 0, 271, 65, 293, 0, 271, 66, 293, - 0, 293, 0, 294, 21, 293, 0, 0, 294, 0, - 290, 0, 298, 0, 71, 0, 303, 0, 317, 305, - 18, 0, 0, 317, 330, 340, 330, 299, 305, 309, - 18, 305, 0, 0, 317, 330, 340, 330, 23, 300, - 305, 310, 309, 18, 305, 0, 340, 330, 0, 0, - 340, 330, 23, 302, 305, 310, 0, 0, 45, 317, - 304, 330, 307, 305, 18, 0, 45, 317, 305, 18, - 0, 45, 307, 305, 18, 0, 0, 0, 308, 305, - 0, 301, 0, 307, 21, 330, 301, 0, 0, 309, - 21, 330, 301, 0, 293, 0, 19, 311, 20, 0, - 19, 311, 21, 20, 0, 310, 0, 311, 21, 310, - 0, 112, 0, 110, 0, 113, 0, 114, 0, 115, - 0, 108, 305, 0, 109, 305, 0, 116, 305, 0, - 117, 305, 0, 130, 305, 0, 131, 305, 0, 132, - 305, 0, 133, 305, 0, 118, 305, 0, 120, 305, - 0, 119, 305, 0, 128, 305, 0, 129, 305, 0, - 121, 305, 0, 123, 305, 0, 139, 305, 0, 140, - 305, 0, 142, 305, 0, 143, 305, 0, 141, 305, - 0, 136, 305, 0, 151, 305, 0, 134, 305, 0, - 135, 305, 0, 137, 305, 0, 124, 305, 0, 127, - 305, 0, 125, 305, 0, 126, 305, 0, 156, 305, - 0, 157, 305, 0, 148, 305, 0, 158, 305, 0, - 149, 305, 0, 152, 305, 0, 153, 305, 0, 154, - 305, 0, 155, 305, 0, 150, 305, 0, 159, 305, - 0, 160, 305, 0, 163, 305, 0, 164, 305, 0, - 161, 305, 0, 162, 305, 0, 175, 305, 0, 147, - 0, 144, 0, 145, 0, 146, 0, 165, 330, 0, - 167, 330, 0, 166, 330, 0, 168, 330, 0, 169, - 330, 0, 170, 330, 0, 171, 330, 0, 172, 330, - 0, 173, 330, 0, 174, 330, 0, 433, 330, 0, - 321, 330, 0, 335, 330, 0, 314, 330, 0, 305, - 317, 305, 0, 319, 0, 319, 85, 318, 88, 0, - 352, 0, 352, 21, 318, 0, 312, 320, 0, 313, - 320, 0, 315, 320, 0, 0, 317, 0, 0, 0, - 330, 67, 432, 305, 19, 322, 384, 331, 385, 323, - 20, 0, 0, 0, 330, 68, 432, 305, 19, 324, - 384, 331, 385, 325, 20, 0, 330, 67, 432, 305, - 19, 20, 0, 330, 68, 432, 305, 19, 20, 0, - 0, 0, 330, 67, 305, 19, 326, 384, 331, 385, - 327, 20, 0, 0, 0, 330, 68, 305, 19, 328, - 384, 331, 385, 329, 20, 0, 330, 67, 305, 19, - 20, 0, 330, 68, 305, 19, 20, 0, 330, 67, - 432, 330, 0, 330, 68, 432, 330, 0, 0, 332, - 0, 207, 0, 331, 332, 0, 317, 330, 333, 305, - 18, 0, 317, 305, 18, 0, 334, 330, 0, 333, - 21, 334, 330, 0, 340, 0, 22, 305, 296, 0, - 340, 22, 305, 296, 0, 330, 69, 19, 337, 20, - 305, 0, 0, 330, 69, 432, 19, 336, 337, 20, - 305, 0, 330, 69, 432, 305, 0, 338, 0, 337, - 21, 338, 0, 337, 21, 0, 432, 0, 432, 23, - 305, 296, 0, 198, 0, 354, 0, 344, 189, 0, - 344, 339, 0, 198, 0, 344, 198, 0, 347, 0, - 330, 345, 0, 108, 0, 109, 0, 342, 0, 343, - 342, 0, 34, 0, 34, 343, 0, 34, 344, 0, - 34, 343, 344, 0, 346, 0, 346, 21, 5, 0, - 432, 0, 346, 21, 432, 0, 5, 0, 348, 0, - 348, 21, 5, 0, 0, 349, 351, 0, 0, 348, - 21, 350, 351, 0, 305, 317, 339, 305, 0, 432, - 0, 316, 0, 316, 353, 0, 344, 0, 355, 0, - 344, 355, 0, 0, 355, 0, 305, 24, 330, 353, - 25, 0, 26, 27, 0, 26, 296, 27, 0, 355, - 26, 27, 0, 355, 26, 296, 27, 0, 305, 24, - 25, 0, 305, 24, 347, 25, 0, 355, 305, 24, - 25, 0, 355, 305, 24, 347, 25, 0, 373, 0, - 374, 0, 377, 0, 380, 0, 393, 0, 396, 0, - 427, 0, 401, 0, 429, 0, 357, 0, 176, 431, - 186, 88, 0, 179, 431, 186, 88, 0, 182, 431, - 186, 88, 0, 22, 432, 0, 360, 0, 358, 0, - 367, 0, 360, 367, 0, 400, 360, 0, 426, 372, - 11, 24, 294, 25, 18, 0, 426, 372, 11, 24, - 294, 25, 0, 362, 367, 0, 0, 0, 13, 24, - 295, 18, 295, 18, 363, 295, 364, 25, 0, 0, - 187, 382, 24, 366, 404, 25, 0, 188, 0, 373, - 0, 374, 0, 377, 0, 369, 391, 0, 369, 0, - 370, 0, 393, 0, 368, 0, 361, 0, 365, 0, - 429, 0, 24, 367, 25, 0, 1, 0, 395, 367, - 0, 382, 19, 0, 386, 20, 0, 372, 0, 390, - 0, 373, 0, 374, 0, 377, 0, 381, 0, 394, - 0, 396, 0, 401, 0, 428, 0, 24, 372, 25, - 0, 429, 0, 1, 0, 432, 22, 0, 107, 356, - 0, 0, 6, 296, 375, 22, 0, 0, 98, 6, - 296, 376, 22, 0, 0, 7, 378, 22, 0, 0, - 98, 7, 379, 22, 0, 24, 380, 25, 0, 382, - 388, 0, 382, 389, 383, 0, 0, 0, 0, 0, - 0, 20, 0, 107, 20, 0, 392, 20, 0, 392, - 107, 20, 0, 391, 20, 0, 391, 107, 20, 0, - 391, 392, 20, 0, 391, 392, 107, 20, 0, 19, - 387, 0, 19, 20, 0, 19, 390, 20, 0, 19, - 391, 20, 0, 19, 391, 392, 20, 0, 372, 0, - 390, 372, 0, 297, 0, 391, 297, 0, 356, 0, - 392, 356, 0, 18, 0, 294, 18, 0, 18, 0, - 294, 18, 0, 294, 0, 8, 24, 294, 25, 0, - 395, 356, 0, 0, 395, 356, 9, 397, 356, 0, - 0, 10, 24, 294, 398, 25, 356, 0, 11, 24, - 294, 25, 0, 11, 24, 294, 25, 0, 0, 0, - 187, 402, 382, 24, 403, 404, 25, 380, 425, 383, - 0, 406, 0, 0, 404, 405, 21, 406, 0, 424, - 0, 431, 0, 185, 0, 184, 0, 186, 0, 24, - 294, 25, 0, 407, 0, 269, 26, 294, 27, 0, - 269, 24, 25, 0, 269, 24, 270, 25, 0, 70, - 24, 293, 21, 352, 25, 0, 269, 330, 28, 432, - 305, 0, 269, 330, 44, 432, 305, 0, 269, 47, - 0, 269, 48, 0, 408, 0, 47, 271, 0, 48, - 271, 0, 29, 277, 0, 34, 277, 0, 33, 277, - 0, 32, 277, 0, 31, 277, 0, 30, 277, 0, - 274, 0, 409, 0, 24, 352, 25, 277, 0, 410, - 0, 278, 34, 277, 0, 278, 35, 277, 0, 278, - 36, 277, 0, 411, 0, 279, 33, 278, 0, 279, - 32, 278, 0, 412, 0, 280, 49, 279, 0, 280, - 50, 279, 0, 413, 0, 281, 37, 280, 0, 281, - 38, 280, 0, 281, 51, 280, 0, 281, 52, 280, - 0, 414, 0, 282, 53, 281, 0, 282, 54, 281, - 0, 415, 0, 283, 29, 282, 0, 416, 0, 284, - 39, 283, 0, 417, 0, 285, 40, 284, 0, 418, - 0, 286, 55, 285, 0, 419, 0, 288, 56, 286, - 0, 420, 0, 0, 0, 288, 41, 422, 294, 22, - 423, 290, 0, 421, 0, 271, 23, 293, 0, 271, - 57, 293, 0, 271, 58, 293, 0, 271, 59, 293, - 0, 271, 60, 293, 0, 271, 61, 293, 0, 271, - 62, 293, 0, 271, 63, 293, 0, 271, 64, 293, - 0, 271, 65, 293, 0, 271, 66, 293, 0, 188, - 0, 0, 12, 0, 399, 356, 0, 426, 356, 11, - 24, 294, 25, 18, 0, 362, 356, 0, 399, 372, - 0, 426, 372, 11, 24, 294, 25, 18, 0, 426, - 372, 11, 24, 294, 25, 0, 362, 372, 0, 14, - 432, 18, 0, 15, 18, 0, 97, 15, 18, 0, - 16, 18, 0, 93, 16, 18, 0, 94, 16, 18, - 0, 95, 16, 18, 0, 96, 16, 18, 0, 17, - 18, 0, 17, 294, 18, 0, 0, 18, 0, 183, - 0, 184, 0, 187, 0, 188, 0, 431, 0, 185, - 0, 189, 0, 185, 0 -}; - -#endif - -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 269, 270, 273, 274, 277, 278, 279, 280, 281, 282, - 283, 286, 288, 292, 292, 297, 303, 307, 308, 312, - 313, 315, 317, 321, 324, 332, 335, 344, 345, 347, - 349, 365, 369, 376, 380, 386, 388, 388, 392, 393, - 394, 395, 398, 401, 402, 408, 409, 413, 417, 422, - 429, 433, 438, 445, 448, 449, 452, 457, 458, 461, - 462, 463, 466, 467, 468, 473, 474, 482, 485, 487, - 488, 493, 494, 495, 497, 513, 517, 518, 523, 524, - 534, 535, 538, 539, 542, 543, 546, 547, 550, 551, - 554, 557, 558, 561, 562, 563, 564, 565, 568, 569, - 572, 572, 575, 575, 578, 582, 583, 586, 586, 589, - 589, 592, 596, 597, 600, 601, 604, 610, 617, 623, - 630, 631, 632, 633, 634, 637, 640, 643, 644, 647, - 648, 649, 650, 651, 652, 653, 654, 657, 663, 670, - 676, 685, 691, 695, 697, 701, 704, 711, 721, 722, - 725, 726, 729, 730, 731, 732, 733, 734, 735, 736, - 740, 741, 745, 746, 749, 751, 753, 754, 755, 756, - 757, 759, 763, 767, 779, 780, 781, 782, 783, 784, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 798, - 799, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 815, 816, 819, 823, 824, 827, 828, 829, - 830, 833, 834, 838, 839, 840, 841, 844, 845, 846, - 849, 850, 851, 854, 855, 856, 857, 858, 861, 862, - 863, 866, 867, 870, 871, 875, 876, 879, 880, 885, - 891, 892, 898, 904, 905, 905, 907, 910, 911, 912, - 913, 914, 915, 916, 917, 918, 919, 920, 921, 924, - 925, 928, 929, 932, 937, 938, 939, 942, 955, 959, - 960, 963, 968, 969, 969, 974, 975, 976, 977, 980, - 983, 986, 989, 990, 993, 994, 997, 998, 999, 1003, - 1005, 1014, 1015, 1016, 1017, 1018, 1021, 1022, 1023, 1024, - 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, - 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, - 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, - 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, - 1065, 1066, 1072, 1073, 1074, 1075, 1078, 1079, 1080, 1081, - 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, - 1094, 1098, 1099, 1103, 1104, 1108, 1109, 1110, 1113, 1114, - 1117, 1119, 1121, 1122, 1124, 1126, 1127, 1129, 1131, 1133, - 1135, 1136, 1138, 1140, 1141, 1143, 1145, 1146, 1149, 1152, - 1153, 1154, 1157, 1159, 1163, 1165, 1169, 1170, 1171, 1175, - 1177, 1177, 1179, 1182, 1184, 1186, 1189, 1194, 1201, 1202, - 1203, 1210, 1214, 1215, 1219, 1220, 1223, 1224, 1227, 1228, - 1231, 1232, 1233, 1234, 1237, 1238, 1241, 1242, 1245, 1246, - 1247, 1250, 1250, 1251, 1252, 1255, 1267, 1283, 1284, 1287, - 1288, 1289, 1292, 1293, 1296, 1298, 1299, 1301, 1302, 1304, - 1306, 1308, 1310, 1316, 1317, 1318, 1319, 1320, 1321, 1322, - 1323, 1324, 1326, 1330, 1332, 1334, 1340, 1345, 1348, 1351, - 1352, 1356, 1358, 1360, 1362, 1366, 1367, 1369, 1373, 1375, - 1377, 1380, 1381, 1382, 1383, 1384, 1385, 1386, 1387, 1388, - 1389, 1390, 1391, 1392, 1395, 1401, 1404, 1407, 1408, 1411, - 1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421, - 1424, 1425, 1431, 1432, 1433, 1434, 1437, 1438, 1439, 1440, - 1443, 1444, 1448, 1451, 1454, 1457, 1460, 1463, 1466, 1467, - 1468, 1469, 1471, 1472, 1474, 1476, 1483, 1487, 1489, 1491, - 1493, 1497, 1498, 1501, 1502, 1505, 1506, 1509, 1510, 1513, - 1514, 1515, 1518, 1526, 1531, 1532, 1536, 1537, 1540, 1545, - 1548, 1549, 1550, 1558, 1559, 1559, 1563, 1564, 1565, 1576, - 1583, 1584, 1587, 1588, 1589, 1590, 1591, 1593, 1594, 1595, - 1596, 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607, - 1608, 1611, 1612, 1615, 1616, 1617, 1618, 1621, 1622, 1623, - 1626, 1627, 1628, 1631, 1632, 1633, 1634, 1635, 1638, 1639, - 1640, 1643, 1644, 1647, 1648, 1652, 1653, 1656, 1657, 1660, - 1661, 1664, 1665, 1666, 1667, 1670, 1671, 1672, 1673, 1674, - 1675, 1676, 1677, 1678, 1679, 1680, 1681, 1684, 1685, 1688, - 1691, 1693, 1695, 1699, 1700, 1702, 1704, 1707, 1708, 1709, - 1711, 1712, 1713, 1714, 1715, 1716, 1717, 1720, 1721, 1724, - 1727, 1728, 1729, 1730, 1731, 1734, 1735 -}; -#endif - - -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) - -static const char * const yytname[] = { "$","error","$undefined.","BADTOK", -"SKIPTOK","CTOK_ELIPSIS","CASE","DEFAULT","CIF","CELSE","SWITCH","WHILE","DO", -"CFOR","GOTO","CONTINUE","BREAK","RETURN","TSEMI","TLBRACE","TRBRACE","TCOMMA", -"TCOLON","TASSIGN","TLPAREN","TRPAREN","TLSQBR","TRSQBR","TDOT","TAMPERSAND", -"TEXCL","TTILDE","TMINUS","TPLUS","TMULT","TDIV","TPERCENT","TLT","TGT","TCIRC", -"TBAR","TQUEST","CSIZEOF","CALIGNOF","ARROW_OP","CTYPEDEF","COFFSETOF","INC_OP", -"DEC_OP","LEFT_OP","RIGHT_OP","LE_OP","GE_OP","EQ_OP","NE_OP","AND_OP","OR_OP", -"MUL_ASSIGN","DIV_ASSIGN","MOD_ASSIGN","ADD_ASSIGN","SUB_ASSIGN","LEFT_ASSIGN", -"RIGHT_ASSIGN","AND_ASSIGN","XOR_ASSIGN","OR_ASSIGN","CSTRUCT","CUNION","CENUM", -"VA_ARG","VA_DCL","QGLOBALS","QMODIFIES","QNOMODS","QCONSTANT","QFUNCTION","QITER", -"QDEFINES","QUSES","QALLOCATES","QSETS","QRELEASES","QPRECLAUSE","QPOSTCLAUSE", -"QALT","QUNDEF","QKILLED","QENDMACRO","LLMACRO","LLMACROITER","LLMACROEND","TENDMACRO", -"QSWITCHBREAK","QLOOPBREAK","QINNERBREAK","QSAFEBREAK","QINNERCONTINUE","QFALLTHROUGH", -"QLINTNOTREACHED","QLINTFALLTHROUGH","QLINTFALLTHRU","QARGSUSED","QPRINTFLIKE", -"QLINTPRINTFLIKE","QSCANFLIKE","QMESSAGELIKE","QNOTREACHED","QCONST","QVOLATILE", -"QINLINE","QEXTENSION","QEXTERN","QSTATIC","QAUTO","QREGISTER","QOUT","QIN", -"QYIELD","QONLY","QTEMP","QSHARED","QREF","QUNIQUE","QCHECKED","QUNCHECKED", -"QCHECKEDSTRICT","QCHECKMOD","QKEEP","QKEPT","QPARTIAL","QSPECIAL","QOWNED", -"QDEPENDENT","QRETURNED","QEXPOSED","QNULL","QOBSERVER","QISNULL","QEXITS","QMAYEXIT", -"QNEVEREXIT","QTRUEEXIT","QFALSEEXIT","QLONG","QSIGNED","QUNSIGNED","QSHORT", -"QUNUSED","QSEF","QNOTNULL","QRELNULL","QABSTRACT","QCONCRETE","QMUTABLE","QIMMUTABLE", -"QTRUENULL","QFALSENULL","QEXTERNAL","QREFCOUNTED","QREFS","QNEWREF","QTEMPREF", -"QKILLREF","QRELDEF","CGCHAR","CBOOL","CINT","CGFLOAT","CDOUBLE","CVOID","QANYTYPE", -"QINTEGRALTYPE","QUNSIGNEDINTEGRALTYPE","QSIGNEDINTEGRALTYPE","QNULLTERMINATED", -"QSETBUFFERSIZE","QBUFFERCONSTRAINT","QENSURESCONSTRAINT","QSETSTRINGLENGTH", -"QMAXSET","QMAXREAD","QTESTINRANGE","IDENTIFIER","NEW_IDENTIFIER","TYPE_NAME_OR_ID", -"CCONSTANT","ITER_NAME","ITER_ENDNAME","TYPE_NAME","file","externalDefs","externalDef", -"constantDecl","fcnDecl","@1","plainFcn","plainNamedDecl","namedDeclBase","@2", -"@3","plainNamedDeclBase","@4","@5","iterDecl","@6","@7","macroDef","fcnDefHdr", -"optGlobMods","@8","optGlobBufConstraints","@9","optGlobBufConstraintsRest", -"optGlobEnsuresConstraintsAux","@10","optGlobBufConstraintsAux","@11","BufConstraintList", -"BufConstraint","bufferModifier","relationalOp","BufConstraintExpr","BufConstraintTerm", -"BufConstraintSrefExpr","BufUnaryOp","BufBinaryOp","optPlainGlobMods","@13", -"optGlobModsRest","optPlainGlobModsRest","specialClauses","globIdList","globIdListExpr", -"globId","globQual","optGlobQuals","optGlobModsAux","@14","@15","optPlainGlobModsAux", -"@16","@17","optMods","fcnMods","@18","fcnPlainMods","@19","specialTag","endStateTag", -"endSpecialTag","stateSpecialClause","specialClauseType","specialClause","@20", -"@21","fcnDefHdrAux","fcnBody","@22","@23","fcnDef","locModifies","locPlainModifies", -"modListExpr","mExpr","modList","specClauseListExpr","specClauseList","primaryExpr", -"postfixExpr","argumentExprList","unaryExpr","fieldDesignator","offsetofExpr", -"sizeofExpr","@24","sizeofExprAux","castExpr","timesExpr","plusExpr","shiftExpr", -"relationalExpr","equalityExpr","bitandExpr","xorExpr","bitorExpr","andExpr", -"@25","orExpr","@26","conditionalExpr","@27","@28","assignExpr","expr","optExpr", -"constantExpr","initializer","instanceDecl","@29","@30","namedInitializer","@31", -"typeDecl","@32","IsType","PushType","namedInitializerList","namedInitializerListAux", -"optDeclarators","init","initList","storageSpecifier","typeQualifier","typeModifier", -"typeSpecifier","completeType","completeTypeSpecifier","altType","completeTypeSpecifierAux", -"optCompleteType","suSpc","@33","@34","@35","@36","@37","@38","@39","@40","NotType", -"structDeclList","structDecl","structNamedDeclList","structNamedDecl","enumSpc", -"@41","enumeratorList","enumerator","optNamedDecl","namedDecl","genericParamList", -"innerMods","innerModsList","pointers","paramIdList","idList","paramTypeList", -"paramList","@42","@43","paramDecl","typeExpression","abstractDecl","optAbstractDeclBase", -"abstractDeclBase","stmt","lclintassertion","iterBody","endBody","iterDefStmtList", -"iterDefIterationStmt","forPred","@44","@45","partialIterStmt","@46","iterDefStmt", -"iterSelectionStmt","openScope","closeScope","macroBody","stmtErr","labeledStmt", -"caseStmt","@47","@48","defaultStmt","@49","@50","compoundStmt","compoundStmtErr", -"CreateInnerScope","DeleteInnerScope","CreateStructInnerScope","DeleteStructInnerScope", -"DeleteInnerScopeSafe","compoundStmtRest","compoundStmtAux","compoundStmtAuxErr", -"stmtListErr","initializerList","stmtList","expressionStmt","expressionStmtErr", -"ifPred","selectionStmt","@51","@52","whilePred","iterWhilePred","iterStmt", -"@53","@54","iterArgList","@55","iterArgExpr","primaryIterExpr","postfixIterExpr", -"unaryIterExpr","castIterExpr","timesIterExpr","plusIterExpr","shiftIterExpr", -"relationalIterExpr","equalityIterExpr","bitandIterExpr","xorIterExpr","bitorIterExpr", -"andIterExpr","orIterExpr","conditionalIterExpr","@56","@57","assignIterExpr", -"endIter","doHeader","iterationStmt","iterationStmtErr","jumpStmt","optSemi", -"id","newId","typeName", NULL -}; -#endif - -static const short yyr1[] = { 0, - 190, 190, 191, 191, 192, 192, 192, 192, 192, 192, - 192, 193, 193, 195, 194, 196, 196, 197, 197, 198, - 198, 198, 198, 199, 198, 200, 198, 201, 201, 201, - 201, 202, 201, 203, 201, 205, 206, 204, 207, 207, - 207, 207, 208, 210, 209, 212, 211, 213, 215, 214, - 214, 217, 216, 216, 218, 218, 219, 220, 220, 221, - 221, 221, 222, 222, 222, 223, 223, 224, 224, 224, - 224, 224, 224, 224, 224, 225, 226, 226, -1, -1, - 228, 227, 229, 229, 230, 230, 231, 231, 232, 232, - 233, 234, 234, 235, 235, 235, 235, 235, 236, 236, - 238, 237, 239, 237, 237, 237, 237, 241, 240, 242, - 240, 240, 240, 240, 243, 243, 245, 244, 247, 246, - 248, 248, 248, 248, 248, 249, 250, 251, 251, 252, - 252, 252, 252, 252, 252, 252, 252, 254, 253, 255, - 253, 256, 256, 258, 257, 259, 257, 260, 261, 261, - 262, 262, 263, 263, 263, 263, 263, 263, 263, 263, - 264, 264, 265, 265, 266, 266, 266, 266, 266, 266, - 266, 266, 267, 267, 268, 268, 268, 268, 268, 268, - 269, 269, 269, 269, 269, 269, 269, 269, 269, 270, - 270, 271, 271, 271, 271, 271, 271, 271, 271, 271, - 271, 271, 272, 272, 273, 275, 274, 276, 276, 276, - 276, 277, 277, 278, 278, 278, 278, 279, 279, 279, - 280, 280, 280, 281, 281, 281, 281, 281, 282, 282, - 282, 283, 283, 284, 284, 285, 285, 286, 287, 286, - 288, 289, 288, 290, 291, 292, 290, 293, 293, 293, - 293, 293, 293, 293, 293, 293, 293, 293, 293, 294, - 294, 295, 295, 296, 297, 297, 297, 298, 299, 298, - 300, 298, 301, 302, 301, 304, 303, 303, 303, 305, - 306, 307, 308, 308, 309, 309, 310, 310, 310, 311, - 311, 312, 312, 312, 312, 312, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 314, 314, 314, 314, 315, 315, 315, 315, - 315, 315, 315, 315, 315, 315, 315, 315, 315, 315, - 316, 317, 317, 318, 318, 319, 319, 319, 320, 320, - 322, 323, 321, 324, 325, 321, 321, 321, 326, 327, - 321, 328, 329, 321, 321, 321, 321, 321, 330, 331, - 331, 331, 332, 332, 333, 333, 334, 334, 334, 335, - 336, 335, 335, 337, 337, 337, 338, 338, 339, 339, - 339, 339, 340, 340, 341, 341, 342, 342, 343, 343, - 344, 344, 344, 344, 345, 345, 346, 346, 347, 347, - 347, 349, 348, 350, 348, 351, 351, 352, 352, 353, - 353, 353, 354, 354, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 356, 356, 356, 356, 356, 356, 356, - 356, 356, 356, 357, 357, 357, -1, 358, 359, 360, - 360, 361, 361, 361, 361, 363, 364, 362, 366, 365, - 365, 367, 367, 367, 367, 367, 367, 367, 367, 367, - 367, 367, 367, 367, 368, 369, 370, 371, 371, 372, - 372, 372, 372, 372, 372, 372, 372, 372, 372, 372, - 373, 373, 375, 374, 376, 374, 378, 377, 379, 377, - 380, 380, 381, 382, 383, 384, 385, 386, 387, 387, - 387, 387, 387, 387, 387, 387, 388, 389, 389, 389, - 389, 390, 390, 391, 391, 392, 392, 393, 393, 394, - 394, 394, 395, 396, 397, 396, 398, 396, 399, 400, - 402, 403, 401, 404, 405, 404, 406, 406, 406, 406, - 407, 407, 408, 408, 408, 408, 408, 408, 408, 408, - 408, 409, 409, 409, 409, 409, 409, 409, 409, 409, - 409, 410, 410, 411, 411, 411, 411, 412, 412, 412, - 413, 413, 413, 414, 414, 414, 414, 414, 415, 415, - 415, 416, 416, 417, 417, 418, 418, 419, 419, 420, - 420, 421, 422, 423, 421, 424, 424, 424, 424, 424, - 424, 424, 424, 424, 424, 424, 424, 425, 425, 426, - 427, 427, 427, 428, 428, 428, 428, 429, 429, 429, - 429, 429, 429, 429, 429, 429, 429, 430, 430, 431, - 432, 432, 432, 432, 432, 433, 433 -}; - -static const short yyr2[] = { 0, - 0, 1, 1, 2, 2, 1, 1, 1, 1, 1, - 1, 8, 11, 0, 5, 1, 3, 1, 2, 1, - 6, 3, 6, 0, 7, 0, 8, 1, 6, 3, - 6, 0, 6, 0, 7, 0, 0, 10, 3, 3, - 3, 2, 1, 0, 2, 0, 2, 2, 0, 4, - 0, 0, 4, 0, 2, 1, 4, 1, 1, 1, - 1, 1, 1, 4, 5, 1, 1, 1, 1, 3, - 4, 2, 3, 3, 3, 1, 1, 1, 0, 2, - 0, 2, 1, 2, 1, 2, 1, 2, 1, 3, - 2, 1, 1, 1, 1, 1, 1, 1, 0, 2, - 0, 6, 0, 6, 1, 1, 0, 0, 5, 0, - 5, 1, 1, 0, 1, 0, 0, 3, 0, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 7, 0, - 8, 1, 3, 0, 3, 0, 3, 2, 3, 2, - 2, 1, 1, 1, 3, 4, 2, 3, 3, 3, - 1, 1, 1, 3, 1, 1, 3, 4, 2, 3, - 3, 3, 1, 3, 1, 1, 1, 3, 1, 1, - 1, 4, 3, 4, 6, 5, 5, 2, 2, 1, - 3, 1, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 3, 1, 9, 0, 3, 4, 2, 4, - 2, 1, 4, 1, 3, 3, 3, 1, 3, 3, - 1, 3, 3, 1, 3, 3, 3, 3, 1, 3, - 3, 1, 3, 1, 3, 1, 3, 1, 0, 4, - 1, 0, 4, 1, 0, 0, 7, 1, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, - 3, 0, 1, 1, 1, 1, 1, 3, 0, 9, - 0, 11, 2, 0, 6, 0, 7, 4, 4, 0, - 0, 2, 1, 4, 0, 4, 1, 3, 4, 1, - 3, 1, 1, 1, 1, 1, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 1, 4, 1, 3, 2, 2, 2, 0, 1, - 0, 0, 11, 0, 0, 11, 6, 6, 0, 0, - 10, 0, 0, 10, 5, 5, 4, 4, 0, 1, - 1, 2, 5, 3, 2, 4, 1, 3, 4, 6, - 0, 8, 4, 1, 3, 2, 1, 4, 1, 1, - 2, 2, 1, 2, 1, 2, 1, 1, 1, 2, - 1, 2, 2, 3, 1, 3, 1, 3, 1, 1, - 3, 0, 2, 0, 4, 4, 1, 1, 2, 1, - 1, 2, 0, 1, 5, 2, 3, 3, 4, 3, - 4, 4, 5, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 4, 4, 4, 2, 1, 1, 1, - 2, 2, 7, 6, 2, 0, 0, 10, 0, 6, - 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 3, 1, 2, 2, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, - 2, 2, 0, 4, 0, 5, 0, 3, 0, 4, - 3, 2, 3, 0, 0, 0, 0, 0, 1, 2, - 2, 3, 2, 3, 3, 4, 2, 2, 3, 3, - 4, 1, 2, 1, 2, 1, 2, 1, 2, 1, - 2, 1, 4, 2, 0, 5, 0, 6, 4, 4, - 0, 0, 10, 1, 0, 4, 1, 1, 1, 1, - 1, 3, 1, 4, 3, 4, 6, 5, 5, 2, - 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 4, 1, 3, 3, 3, 1, 3, 3, - 1, 3, 3, 1, 3, 3, 3, 3, 1, 3, - 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 0, 0, 7, 1, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 1, 0, 1, - 2, 7, 2, 2, 7, 6, 2, 3, 2, 3, - 2, 3, 3, 3, 3, 2, 3, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 1 -}; - -static const short yydefact[] = { 0, - 11, 421, 389, 266, 389, 14, 0, 0, 0, 0, - 280, 280, 293, 292, 294, 295, 296, 280, 280, 280, - 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, - 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, - 280, 280, 280, 344, 345, 346, 343, 280, 280, 280, - 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, - 280, 280, 280, 280, 389, 389, 389, 389, 389, 389, - 389, 389, 389, 389, 280, 660, 661, 665, 662, 663, - 666, 0, 3, 6, 7, 413, 8, 9, 389, 43, - 658, 10, 265, 267, 0, 369, 369, 389, 369, 389, - 362, 389, 0, 389, 142, 280, 664, 20, 389, 417, - 418, 419, 422, 423, 283, 280, 280, 276, 389, 667, - 389, 389, 665, 0, 510, 280, 517, 0, 0, 0, - 640, 0, 0, 0, 0, 280, 550, 0, 280, 280, - 280, 280, 280, 280, 280, 280, 280, 0, 42, 0, - 0, 0, 0, 0, 0, 280, 180, 176, 179, 177, - 561, 181, 192, 212, 202, 201, 214, 218, 221, 224, - 229, 232, 234, 236, 238, 241, 244, 248, 260, 552, - 206, 0, 0, 542, 500, 501, 502, 503, 0, 0, - 504, 280, 505, 0, 506, 0, 507, 509, 175, 0, - 494, 0, 548, 0, 524, 481, 0, 0, 0, 490, - 0, 491, 470, 489, 486, 487, 482, 483, 484, 0, - 0, 488, 0, 0, 0, 492, 469, 0, 297, 298, - 299, 300, 305, 307, 306, 310, 311, 322, 324, 325, - 323, 308, 309, 301, 302, 303, 304, 319, 320, 317, - 321, 312, 313, 316, 314, 315, 328, 330, 335, 318, - 331, 332, 333, 334, 326, 327, 329, 336, 337, 340, - 341, 338, 339, 347, 349, 348, 350, 351, 352, 353, - 354, 355, 356, 342, 4, 280, 0, 144, 148, 544, - 389, 389, 659, 5, 389, 370, 366, 367, 360, 368, - 0, 280, 280, 358, 280, 280, 0, 359, 414, 357, - 420, 424, 389, 0, 282, 389, 0, 273, 280, 658, - 16, 18, 0, 389, 280, 28, 432, 280, 176, 179, - 212, 264, 513, 175, 0, 280, 280, 280, 280, 0, - 649, 651, 656, 0, 0, 389, 438, 0, 0, 195, - 200, 199, 198, 197, 196, 0, 280, 193, 194, 280, - 0, 0, 0, 0, 0, 280, 519, 280, 0, 0, - 0, 512, 463, 280, 454, 455, 456, 457, 0, 458, - 459, 280, 461, 280, 460, 462, 524, 280, 280, 188, - 189, 0, 280, 280, 280, 280, 280, 280, 280, 280, - 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, - 280, 280, 280, 280, 280, 280, 280, 280, 280, 239, - 245, 242, 551, 280, 0, 647, 39, 0, 525, 543, - 554, 644, 0, 511, 280, 0, 0, 0, 549, 40, - 471, 475, 485, 496, 497, 495, 0, 0, 41, 22, - 280, 432, 389, 280, 524, 545, 280, 268, 143, 389, - 0, 364, 0, 389, 0, 389, 0, 280, 280, 279, - 280, 278, 274, 389, 0, 280, 0, 389, 280, 19, - 429, 0, 0, 415, 430, 280, 0, 0, 518, 0, - 557, 0, 263, 0, 648, 657, 178, 280, 280, 0, - 440, 439, 441, 280, 508, 280, 0, 652, 653, 654, - 655, 650, 515, 0, 0, 0, 0, 0, 643, 389, - 522, 641, 0, 0, 183, 0, 190, 0, 0, 0, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 215, 216, 217, 220, 219, 222, 223, 225, 226, - 227, 228, 230, 231, 233, 235, 237, 280, 280, 280, - 261, 280, 280, 207, 538, 179, 542, 0, 389, 523, - 555, 0, 0, 493, 479, 0, 0, 24, 0, 529, - 280, 546, 145, 389, 280, 389, 524, 147, 280, 269, - 363, 280, 379, 0, 387, 382, 0, 388, 0, 404, - 407, 401, 403, 284, 280, 280, 658, 15, 30, 280, - 432, 280, 17, 416, 425, 427, 36, 434, 389, 433, - 437, 514, 553, 0, 559, 280, 361, 446, 0, 432, - 442, 280, 0, 213, 389, 280, 0, 520, 521, 0, - 0, 0, 537, 0, 562, 280, 184, 182, 280, 280, - 240, 0, 243, 280, 209, 280, 211, 539, 540, 280, - 280, 280, 560, 280, 280, 389, 44, 26, 530, 533, - 280, 280, 531, 280, 547, 0, 271, 280, 365, 385, - 526, 371, 386, 526, 374, 280, 406, 280, 0, 0, - 280, 280, 280, 0, 32, 0, 280, 0, 81, 431, - 280, 443, 280, 0, 447, 450, 280, 0, 448, 0, - 432, 0, 0, 516, 464, 465, 466, 280, 280, 191, - 186, 187, 246, 0, 0, 541, 556, 0, 280, 280, - 280, 280, 280, 280, 280, 280, 280, 0, 176, 179, - 177, 192, 212, 201, 218, 221, 224, 229, 232, 234, - 236, 238, 241, 0, 565, 564, 573, 582, 592, 594, - 598, 601, 604, 609, 612, 614, 616, 618, 620, 622, - 626, 567, 175, 0, 23, 46, 107, 44, 534, 535, - 280, 532, 21, 280, 285, 389, 377, 526, 389, 378, - 526, 400, 405, 280, 0, 277, 280, 287, 275, 280, - 0, 389, 81, 34, 0, 426, 428, 37, 114, 435, - 409, 0, 280, 443, 410, 444, 558, 476, 0, 451, - 449, 452, 0, 0, 185, 0, 565, 280, 208, 210, - 646, 0, 0, 195, 200, 199, 198, 197, 196, 193, - 194, 280, 280, 280, 188, 189, 0, 280, 280, 280, - 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, - 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, - 280, 280, 280, 280, 239, 623, 242, 480, 0, 474, - 25, 54, 101, 117, 105, 121, 122, 123, 124, 125, - 128, 129, 45, 107, 83, 106, 389, 389, 87, 46, - 536, 280, 0, 391, 389, 389, 390, 389, 389, 389, - 408, 280, 290, 0, 285, 12, 31, 33, 81, 29, - 658, 108, 119, 112, 82, 114, 85, 113, 432, 436, - 411, 412, 280, 445, 453, 0, 204, 0, 524, 247, - 645, 178, 280, 0, 183, 0, 0, 0, 0, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, - 215, 216, 217, 220, 219, 222, 223, 225, 226, 227, - 228, 230, 231, 233, 235, 237, 619, 280, 621, 280, - 473, 47, 51, 0, 389, 99, 658, 84, 138, 0, - 88, 27, 285, 280, 389, 0, 280, 392, 380, 389, - 383, 389, 402, 288, 280, 658, 35, 0, 389, 99, - 658, 86, 280, 477, 280, 0, 642, 639, 213, 280, - 184, 182, 280, 280, 0, 566, 48, 0, 0, 389, - 94, 95, 96, 97, 98, 658, 89, 99, 0, 0, - 0, 154, 118, 163, 658, 0, 153, 0, 130, 135, - 134, 133, 132, 131, 136, 137, 140, 0, 270, 280, - 394, 280, 280, 389, 397, 0, 372, 0, 375, 289, - 291, 0, 38, 658, 658, 120, 658, 152, 280, 0, - 205, 203, 638, 525, 0, 186, 187, 624, 0, 0, - 0, 58, 59, 69, 67, 0, 56, 76, 0, 63, - 66, 0, 68, 0, 99, 0, 100, 93, 91, 92, - 0, 157, 0, 0, 0, 0, 0, 150, 0, 0, - 166, 173, 658, 165, 0, 280, 286, 280, 280, 0, - 395, 280, 381, 0, 384, 0, 13, 116, 116, 151, - 478, 563, 185, 280, 0, 0, 66, 0, 72, 53, - 55, 61, 60, 62, 0, 0, 0, 0, 0, 116, - 90, 116, 158, 155, 162, 161, 0, 159, 160, 164, - 149, 0, 169, 0, 0, 0, 0, 0, 658, 272, - 398, 389, 393, 280, 373, 376, 109, 115, 111, 625, - 50, 78, 77, 0, 73, 0, 0, 70, 0, 74, - 75, 0, 102, 104, 156, 170, 167, 0, 171, 172, - 174, 127, 280, 0, 396, 399, 0, 57, 71, 64, - 168, 139, 126, 280, 65, 141, 0, 0, 0 -}; - -static const short yydefgoto[] = { 1227, - 82, 83, 84, 85, 122, 320, 321, 86, 667, 778, - 322, 803, 919, 87, 699, 921, 904, 89, 776, 777, - 881, 882, 982, 1027, 1028, 983, 984, 1096, 1097, 1098, - 1155, 1099, 1100, 1101, 1102, 1194, 808, 809, 893, 925, - 894, 1036, 1037, 1109, 1038, 1039, 895, 985, 986, 927, - 1009, 1010, 1187, 1188, 987, 928, 1011, 897, 1224, 1213, - 898, 1057, 899, 1048, 1125, 90, 289, 453, 455, 91, - 1043, 1076, 1044, 1167, 1045, 1122, 1123, 162, 163, 526, - 164, 936, 165, 166, 425, 564, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 558, 177, 560, 178, - 559, 828, 179, 207, 494, 333, 290, 93, 678, 784, - 115, 606, 94, 316, 181, 287, 116, 117, 903, 799, - 914, 96, 97, 98, 99, 347, 291, 461, 101, 297, - 102, 788, 1134, 791, 1136, 681, 1066, 684, 1068, 103, - 906, 907, 1063, 1064, 104, 689, 599, 600, 813, 119, - 483, 112, 113, 106, 614, 615, 484, 485, 486, 701, - 620, 348, 819, 815, 503, 372, 373, 208, 228, 209, - 210, 374, 933, 1080, 212, 664, 213, 214, 215, 216, - 183, 430, 375, 376, 488, 637, 377, 335, 514, 378, - 188, 379, 570, 786, 999, 221, 583, 521, 429, 190, - 584, 585, 380, 191, 192, 381, 661, 624, 382, 224, - 383, 387, 719, 755, 879, 756, 757, 758, 759, 760, - 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 978, 1144, 772, 1084, 384, 385, 197, 386, 294, - 334, 200, 109 -}; - -static const short yypact[] = { 2240, --32768, 108, 6007,-32768, 6677,-32768, 697, 3211, 3591, 3591, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 431,-32768,-32768, --32768, 2416,-32768,-32768,-32768, 355,-32768,-32768, 5623,-32768, - 114,-32768,-32768,-32768, 74, 6512, 6512,-32768, 6512, 140, - 149,-32768, 766,-32768,-32768, 697,-32768,-32768,-32768,-32768, --32768,-32768, 108,-32768,-32768, 191,-32768, 140,-32768,-32768, --32768, 6007,-32768, 217,-32768, 4477,-32768, 225, 234, 253, --32768, 268, 697, 306, 319, 762,-32768, 2790, 4477, 4477, - 4477, 4477, 4477, 4477,-32768, 4703, 4703, 398,-32768, 393, - 425, 434, 445, 413, 219, 5070,-32768, 450, 456,-32768, - 486,-32768, 905, 898,-32768,-32768,-32768, 1049, 423, 577, - 723, 752, 488, 508, 487, 521, 67,-32768,-32768, 325, --32768, 3738, 468, 502,-32768,-32768,-32768,-32768, 615, 3358, --32768, 5070,-32768, 3738,-32768, 3738,-32768,-32768, 580, 636, --32768, 620,-32768, 2979, 486, 647, 344, 599, 3401,-32768, - 3591,-32768,-32768,-32768, 6272,-32768,-32768,-32768,-32768, 656, - 676,-32768, 3591, 3591, 3738,-32768,-32768, 629,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 687, 708,-32768,-32768,-32768, - 140, 5466,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 722, 477,-32768,-32768, 697, 697, 59,-32768, 355,-32768, --32768,-32768,-32768, 749,-32768,-32768, 758, 724, 477, 114, --32768, 540, 759,-32768, 697,-32768, 255, 4477,-32768,-32768, --32768,-32768,-32768,-32768, 768, 4477, 4477, 4477, 797, 770, --32768,-32768,-32768, 516, 464, 6141, 296, 786, 800,-32768, --32768,-32768,-32768,-32768,-32768, 816, 4477,-32768,-32768, 4477, - 828, 838, 879, 886, 891, 4477,-32768, 1718, 693, 693, - 693,-32768,-32768, 5070,-32768,-32768,-32768,-32768, 892,-32768, --32768, 5070,-32768, 5070,-32768,-32768,-32768, 1451, 4477,-32768, --32768, 96, 4477, 4477, 4477, 4477, 4477, 4477, 4477, 4477, - 4477, 4477, 4477, 4477, 4477, 4477, 4477, 4477, 4477, 4477, - 4477, 4477, 4477, 4477, 4477, 4477, 4477, 4477, 4477,-32768, --32768,-32768,-32768, 4477, 716,-32768,-32768, 2601,-32768,-32768, - 910,-32768, 913,-32768, 4477, 505, 901, 920,-32768,-32768, --32768,-32768, 6272,-32768,-32768,-32768, 3168, 954,-32768,-32768, - 4477, 68, 3840, 477, 949,-32768, 477,-32768, 570, 6677, - 896, 972, 992, 998, 1006, 998, 697, 1035, 477,-32768, - 477,-32768,-32768,-32768, 912, 1025, 1037,-32768, 477, 540, --32768, 697, 1047,-32768, 1045, 697, 279, 1059,-32768, 333, - 1079, 385, 1079, 1069,-32768,-32768,-32768,-32768, 2008, 1078, - 587,-32768, 627, 4477,-32768,-32768, 1085,-32768,-32768,-32768, --32768,-32768,-32768, 1109, 1116, 948, 957, 963,-32768, 3840, --32768,-32768, 1139, 1134,-32768, 412,-32768, 99, 697, 697, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768, 1049, 1049, 423, 423, 577, 577, - 577, 577, 723, 723, 752, 488, 508, 4477, 4477, 4477, --32768, 4929, 4940,-32768,-32768, 5855,-32768, 3548, 4024,-32768, --32768, 1137, 426,-32768,-32768, 1138, 1140,-32768, 1141,-32768, - 2110,-32768,-32768, 4208, 4392,-32768, 949,-32768,-32768, 1146, --32768,-32768, 1144, 1151,-32768, 1152, 1157,-32768, 843,-32768, - 1148,-32768,-32768,-32768, 191,-32768, 406,-32768,-32768, 4477, - 358, 477,-32768,-32768, 1156,-32768,-32768, 1176, 6677,-32768, --32768,-32768,-32768, 1158,-32768, 797,-32768,-32768, 1155, 556, - 627, 2412, 1160,-32768,-32768,-32768, 1164,-32768,-32768, 1099, - 1100, 1102,-32768, 1165,-32768, 4477,-32768,-32768,-32768,-32768, - 487, 914, 521, 4477,-32768, 4477,-32768,-32768,-32768, 4435, - 5070, 4477,-32768, 5178, 4477,-32768,-32768,-32768,-32768,-32768, - 4618, 4661,-32768, 4844,-32768, 1166,-32768,-32768,-32768,-32768, --32768, 1175,-32768,-32768, 1177,-32768, 697,-32768, 697, 1178, - 2040,-32768,-32768, 1171,-32768, 1180,-32768, 348,-32768,-32768, - 697, 614, 5070, 1182,-32768,-32768, 137, 1181,-32768, 1183, - 109, 1186, 1184,-32768,-32768,-32768,-32768, 4477, 5178,-32768, --32768,-32768,-32768, 1187, 1189,-32768,-32768, 452, 4477, 4477, - 4477, 4477, 4477, 4477, 4477, 4703, 4703, 1179, 504, 575, - 582, 1077, 1033, 604, 1081, 918, 981, 850, 1024, 1173, - 1169, 1185, 1161, 90, 1190,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768, 612, 660,-32768,-32768, 1326,-32768,-32768,-32768, - 4887,-32768,-32768,-32768,-32768, 6599,-32768,-32768, 6599,-32768, --32768,-32768,-32768, 4477, 1054,-32768, 2040,-32768,-32768, 2040, - 1123,-32768,-32768,-32768, 1193,-32768,-32768,-32768, 1429,-32768, - 355, 1195,-32768, 539,-32768, 627,-32768,-32768, 1196,-32768, --32768,-32768, 1197, 697,-32768, 695, 1201, 4477,-32768,-32768, - 1202, 729, 1205, 782, 798, 830, 853, 874, 885, 893, - 895, 4477, 1633, 4477, 902, 909, 155, 4477, 4477, 4477, - 4477, 4477, 4477, 4477, 4477, 4477, 4477, 4477, 4477, 4477, - 4477, 4477, 4477, 4477, 4477, 4477, 4477, 4477, 4477, 4477, - 4477, 4477, 4477, 4477, 4477,-32768, 4477,-32768, 1211, 1215, --32768, 1057, 24,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 1066,-32768,-32768,-32768,-32768, 1030,-32768, --32768, 2040, 583,-32768, 140, 5701,-32768, 6599, 5701, 6599, --32768,-32768,-32768, 1098,-32768,-32768,-32768,-32768,-32768,-32768, - 114, 300,-32768,-32768,-32768, 1080,-32768,-32768, 189,-32768, --32768,-32768, 3694,-32768,-32768, 638,-32768, 1220, 949,-32768, --32768, 916, 4477, 1221, 945, 946, 240, 697, 697,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 947, 970, 971, 858, 993, 523, 673, 410, 489, 622, - 662, 467, 652, 427, 254, 336, 487, 4477, 521, 5178, --32768,-32768, 1065, 1067, 6403, 57, 81,-32768,-32768, 866, --32768,-32768,-32768,-32768,-32768, 1228, 366,-32768,-32768, 5701, --32768, 5701,-32768,-32768, 1979, 764,-32768, 1159, 6403, 57, - 81,-32768, 755,-32768,-32768, 697,-32768, 1061, 1021,-32768, - 1022, 1023,-32768,-32768, 1101,-32768,-32768, 1073, 101, 5309, --32768,-32768,-32768,-32768,-32768, 840,-32768, 57, 944, 55, - 55,-32768,-32768, 285, 987, 1167,-32768, 151,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768, 1001,-32768, 477, --32768,-32768, 1232,-32768, 1235, 1236,-32768, 1239,-32768,-32768, --32768, 1188,-32768, 5151, 840,-32768, 987,-32768, 654, 1229, --32768,-32768,-32768,-32768, 1238, 1032, 1034,-32768, 101, 101, - 156,-32768,-32768,-32768,-32768, 1194, 101,-32768, 1104,-32768, - 370, 1237,-32768, 1198, 57, 1199,-32768,-32768,-32768,-32768, - 705, 285, 85, 697, 697, 55, 1204,-32768, 151, 151, --32768, 543, 1052,-32768, 151,-32768,-32768, 4477, 366, 1250, --32768,-32768,-32768, 1249,-32768, 1251,-32768, 1200, 1200,-32768, --32768,-32768, 1043, 4477, 1207, 1113, 711, 156, 370,-32768, --32768,-32768,-32768,-32768, 101, 41, 697, 697, 101, 1200, --32768, 1200,-32768,-32768,-32768, 285, 1245,-32768,-32768, 285, --32768, 792, 543, 823, 697, 697, 151, 1208, 1052,-32768, --32768,-32768,-32768, 4477,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 101,-32768, 711, 1256,-32768, 1248,-32768, --32768, 1259,-32768,-32768,-32768,-32768,-32768, 1254,-32768,-32768, - 543,-32768,-32768, 1209,-32768,-32768, 1264,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768, 1290, 1293,-32768 -}; - -static const short yypgoto[] = {-32768, --32768, 1216,-32768,-32768,-32768,-32768, -391, -105,-32768,-32768, - 974,-32768,-32768,-32768,-32768,-32768, 107,-32768, 522,-32768, - 405,-32768,-32768,-32768,-32768,-32768,-32768, -897,-32768,-32768, --32768, -931,-32768, -943,-32768,-32768, -709,-32768,-32768,-32768, - -696, 299, 201,-32768,-32768, 272, 417,-32768,-32768, 386, --32768,-32768, -863, -674,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768, -884, 141, 303, -959, 194,-32768, -647, 475, - 1234,-32768,-32768, -590,-32768,-32768, 11, -363, -402, -245, - -350, -348, -371, -352, -471, -483,-32768, -578,-32768, -24, --32768,-32768, 928, 1332, -610, -360, 15,-32768,-32768,-32768, - -465,-32768,-32768,-32768, 0, -226, 849,-32768, -811, -716, --32768,-32768,-32768,-32768,-32768,-32768, 80, 740,-32768, 585, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 967, - -699, -611,-32768, 204,-32768,-32768, 645, 648, 524, 13, - -376, 1224,-32768, 8,-32768,-32768, -584,-32768,-32768,-32768, - 640, -233, 995,-32768, -496, 193,-32768, 1329,-32768, 1120, --32768, 1041,-32768,-32768,-32768,-32768, -39,-32768,-32768,-32768, --32768, 63, 1231, 1362,-32768,-32768, 1616,-32768,-32768, -354, --32768, 969, 264, -551, -582,-32768, 829,-32768,-32768, 922, - -87, -420, 127,-32768, 221, 84,-32768,-32768, 170,-32768, - 211,-32768,-32768, 632,-32768, 373,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768, 1686,-32768,-32768, 1731, -311, - 188, 446,-32768 -}; - - -#define YYLAST 6866 - - -static const short yytable[] = { 95, - 309, 292, 95, 604, 631, 513, 547, 548, 475, 114, - 229, 230, 105, 515, 92, 704, 742, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 545, 546, 708, 556, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 553, 554, 557, 1198, 555, 462, - 184, 742, 481, 744, 284, 579, 653, 467, 1040, 100, - 913, 95, 118, 915, 121, 754, 651, 613, 1041, 909, - 577, 193, 578, 918, 105, 477, 92, 295, 293, 301, - 588, 332, 896, 1006, 1040, 95, 88, 421, 1040, -103, - -103, 1164, 926, 481, 1041, 314, 315, 317, 1041, 424, - 312, 323, 422, 529, 1090, 648, 823, 443, 744, 325, - 876, 293, 789, 822, 1091, 222, 222, 346, 629, 530, - 754, 2, 1031, 1032, 356, 877, 1147, 1149, 660, 350, - 351, 352, 353, 354, 355, 1111, 1112, -280, 1146, 1172, - 1173, 100, 499, 672, 437, 549, 550, 551, 552, 441, - 2, 442, 1033, 1034, 1119, 296, 296, 194, 296, 1148, - 753, 1058, 948, 446, 1120, 993, 1035, 107, 88, 1091, - 107, 1145, 752, 481, 107, 199, 199, 199, 949, 1151, - 349, 324, 991, 346, 1196, 816, -103, -103, 1000, 1007, - 1002, 313, -389, 706, -389, 110, 111, 1211, 195, 896, - 697, 193, -389, 1197, 366, 367, 1199, 1202, 1166, 223, - 223, 1170, 515, 303, 696, 753, 908, 76, 1042, 910, - 327, 76, 77, 123, 426, 79, 80, 752, 336, 694, - -389, -389, -389, 477, -389, -389, 432, 337, 433, 481, - 424, 746, 1217, 76, 1042, 193, 1022, 76, 1042, 107, - 1165, 710, 635, 193, -615, 1189, 338, 193, -615, 193, - 1092, 1093, 417, 76, 1094, 451, 1095, 448, 1071, 1166, - 301, 339, 750, 107, 998, 693, 1203, 998, 1204, 424, - 745, 95, 460, 497, 463, 465, 456, 194, 193, 107, - 1113, 751, 1114, 748, 459, 749, 746, 816, 95, -280, - 107, 499, 1014, 341, 323, 199, 1001, 346, 1115, 2, - 222, 474, 742, 76, 1121, 222, 342, 222, 76, 1094, - 569, 332, 423, 199, 708, 424, 500, 750, 195, 222, - 222, 194, 806, 424, 501, 745, -617, 623, 462, 194, - -617, 439, 481, 194, 424, 194, 751, 346, 748, 199, - 749, -389, -389, -389, 418, -389, -389, 199, -281, 199, - 286, 199, 695, 199, 431, -110, -110, 1062, 998, 744, - 998, 199, 195, 979, 194, 1156, 199, 1157, 199, 2, - 195, 754, 713, 977, 195, 424, 195, 441, 361, 625, - 199, 199, 199, 1158, 542, 543, 544, 1067, 747, 1069, - 724, 360, 725, 293, 223, 498, 332, 365, 692, 223, - -605, 223, 646, 911, -605, 195, 647, -389, -389, -389, - 362, -389, -389, 223, 223, 108, 424, -613, 108, 363, - 663, -613, 124, 95, 407, 408, 95, 456, 409, 410, - 364, 966, 967, 594, -667, 597, 586, 603, 95, 589, - 95, -661, 424, 747, 332, 610, 831, -665, 323, 415, - 416, 423, -110, -110, 424, 619, 325, -610, 497, 107, - 567, -610, 107, 107, 107, 833, 753, 627, 964, 965, - 500, 975, 633, 411, 412, 460, 107, -662, 752, -606, - 2, 193, 107, -606, 634, -667, 417, 413, 414, 972, - 973, 976, 439, 974, -570, 424, 419, 108, -570, 497, - 76, 77, 123, 496, 79, 80, 424, 409, 410, 498, - -389, -389, -389, -602, -389, -389, 418, -602, 76, 77, - 123, 108, 79, 80, 407, 408, 516, 517, 518, 427, - 481, 199, -280, -281, 499, 476, 519, 326, 1174, 199, - 1175, 199, 2, 222, 522, 420, 523, 746, 340, -389, - 706, -389, 631, 456, 1018, 332, 1176, -389, 676, -389, - -389, 460, -389, -498, 1127, -569, 811, 194, 456, -569, - 994, -664, -571, 995, 690, 691, -571, 332, 750, 1008, - -280, 323, 499, -667, -667, 199, 745, -667, -667, 325, - 968, 969, 970, 971, -591, 409, 410, 751, -591, 748, - 633, 749, -568, 428, 199, 460, -568, -280, 195, 499, - 199, 107, -607, 435, 107, 582, -607, 2, 721, 722, - -280, 193, 632, 346, 107, 346, 107, 434, 107, 76, - 77, 123, 1015, 79, 80, 1016, 107, 223, -663, 107, - 409, 410, -611, 107, 444, 1046, -611, 785, -440, 499, - 424, 298, -608, 300, 880, 792, -608, 794, 411, 412, - 440, 800, 801, -603, 1072, 445, 805, -603, 702, 1078, - 619, 812, 413, 414, 407, 408, 500, 199, 811, 814, - 409, 410, 582, 450, 501, 424, 107, 107, 1104, 938, - 449, 76, 77, 123, 1106, 79, 80, 931, 346, 1163, - 1113, 452, 1114, 1117, 747, 1195, 1156, 194, 1157, 458, - 834, 835, 836, 837, 838, 839, 473, 108, 1115, 424, - 464, 466, 468, 942, 1158, 199, 199, 562, 563, 411, - 412, 582, 1138, 1139, 108, 1140, 470, 1181, 199, 332, - 326, 199, 199, 413, 414, 472, 582, 675, 195, 343, - 499, 293, 478, 902, 995, 328, 1085, 495, 2, 489, - 139, 140, 141, 142, 143, 144, 76, 77, 123, 107, - 79, 80, -585, 940, 415, 416, -585, 145, 146, 147, - 504, 1178, 930, 812, -262, 633, 1206, 1174, -590, 1175, - 328, 814, -590, 1216, 505, 139, 140, 141, 142, 143, - 144, 148, 305, 306, 307, 1176, 76, 77, 123, 506, - 79, 80, 145, 146, 147, 508, 1040, 199, 199, 1207, - -589, 773, 675, 727, -589, 509, 1041, 293, 199, 199, - 1105, 199, 686, 687, 675, 905, 148, 1214, 905, 961, - 962, 963, 157, -588, 107, 76, 107, -588, -600, 76, - 77, 123, -600, 79, 80, 107, 866, 867, 107, 107, - 199, 404, 405, 406, -587, 817, 510, 1030, -587, 108, - 868, 869, 108, 511, 996, -586, 773, 157, 512, -586, - 520, 1003, 601, -583, 108, -584, 108, -583, 571, -584, - 393, 1074, -580, 572, 326, 574, -580, 616, 388, -581, - 389, 621, -389, -581, 424, 723, -572, 76, 77, 123, - -572, 79, 80, 575, 76, 329, 330, 160, -389, 862, - 863, 390, 391, 1019, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 576, -575, 646, -595, 199, -575, - 1021, -595, 587, 309, 649, 650, 189, 220, 220, 76, - 329, 330, 160, 591, 1049, 905, 1050, 905, 905, 905, - -596, -597, 592, 1059, -596, -597, 95, 1051, 1052, 608, - 1053, 107, 1054, 1055, 293, 76, 1042, 1116, 1165, 1065, - 593, 107, 812, -599, 1081, 1056, -280, -599, 1126, 460, - 1079, 995, 1086, 1087, 596, 589, 404, 405, 406, 864, - 865, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, -593, -576, -574, 456, -593, -576, -574, 182, 211, - 211, 609, -578, 602, -579, 848, -578, 326, -579, 95, - 611, 1128, 1130, -577, 299, 618, 302, -577, 304, 293, - 308, 617, 1177, 912, 687, 310, 870, 871, 812, 905, - 622, 905, 404, 405, 406, 318, 626, 319, 456, 849, - 850, 851, 852, 853, 854, 855, 856, 857, 858, 424, - 843, 630, 844, 332, -389, 636, 189, 886, 887, 888, - 889, 890, 891, 892, 859, 860, 861, 1004, 1005, 1190, - -389, 424, 1088, 845, 846, 1180, 76, 1108, 95, 392, - 638, 1184, 601, 640, 601, 107, 107, 883, 884, 885, - 639, 1065, 641, 807, 1192, 1193, 621, 108, 642, 644, - 189, 922, 923, 924, 1152, 1153, 1154, 645, 189, 332, - 662, 665, 189, 680, 189, 668, 666, 773, 677, 682, - 688, 683, 220, 438, 1047, 685, 698, 220, 182, 220, - 700, 705, 703, 711, 107, 714, 715, 716, 718, 717, - 783, 220, 220, 189, 787, 796, 790, 802, 1047, 818, - 107, 872, 842, 107, 804, 820, 824, 873, 825, 821, - 916, 829, 1222, 830, 878, 875, 1103, 920, 929, 941, - 934, 935, 182, 1226, 874, 939, 1110, 1047, 1047, 943, - 182, 980, 981, -52, 182, 1124, 182, 1017, 185, 217, - 217, 1020, -49, 1029, 211, 1061, 1073, 107, 1083, 211, - 1089, 211, 1129, 1141, 1118, 1133, 1132, 454, 1135, 108, - 1159, 457, 1143, 211, 211, 182, 107, 1183, 1185, 937, - 1186, 1205, 884, 1218, 1219, 1137, 1103, 1103, 1103, 469, - 1221, 1150, 471, 1220, 1103, 1160, 1162, 507, 1225, 1228, - 479, 1171, 1229, 482, 1191, 1212, 1223, 285, 480, 900, - 1047, 107, 107, 1047, 992, 1161, 1124, 1124, 1075, 1107, - 988, 1012, 1124, 1077, 1208, 527, 107, 946, 1179, 605, - 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, - 541, 679, 1182, 795, 793, 1103, 311, 932, 227, 180, - 810, 502, 1103, 447, 107, 107, 1103, 1142, 643, 568, - 827, 561, 1026, 0, 0, 524, 0, 0, 0, 331, - 0, 1047, 107, 107, 1124, 0, 0, 0, 185, 186, - 218, 218, 331, 331, 331, 331, 331, 331, 0, 358, - 359, 1103, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1023, 1024, 0, 189, 883, 884, 885, - 0, 0, 0, 886, 887, 888, 889, 890, 891, 892, - 0, 0, 185, 0, 0, 220, 0, 0, 482, 0, - 185, 0, 0, 0, 185, 590, 185, 0, 0, 0, - 595, 0, 598, 0, 217, 0, 0, 0, 0, 217, - 607, 217, 108, 0, 612, 0, 0, 0, 0, 0, - 0, 0, 0, 217, 217, 185, 0, 0, 108, 0, - 0, 1082, 0, 0, 0, 0, 0, 344, 182, 345, - 0, 0, 0, 0, 328, 525, 0, 0, 0, 139, - 140, 141, 142, 143, 144, 0, 0, 211, 0, 0, - 0, 0, 0, 0, 0, 0, 145, 146, 147, 186, - 922, 923, 924, 0, 0, 108, 886, 887, 888, 889, - 890, 891, 892, 180, 0, 0, 0, 0, 0, 0, - 148, 180, 0, 0, 108, 180, 0, 180, 0, 0, - 0, 0, 0, 0, 0, 436, 189, 0, 0, 0, - 0, 0, 0, 186, 0, 0, 0, 0, 0, 0, - 0, 186, 590, 0, 0, 186, 180, 186, 0, 1168, - 1169, 157, 0, 0, 0, 218, 0, 0, 0, 0, - 218, 0, 218, 720, 108, 0, 0, 482, 0, 0, - 0, 0, 0, 0, 218, 218, 186, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 707, 0, 0, 331, - 0, 712, 1200, 1201, 0, 0, 0, 0, 182, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 798, 0, - 1209, 1210, 0, 187, 219, 219, 0, 0, 0, 0, - 0, 0, 775, 76, 329, 330, 160, 331, 331, 331, - 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, - 331, 331, 331, 0, 0, 0, 328, 945, 185, 487, - 0, 139, 140, 141, 142, 143, 144, 490, 491, 492, - 493, 0, 0, 0, 0, 0, 0, 217, 145, 146, - 147, 0, 0, 0, 331, 0, 0, 0, 487, 0, - 0, 0, 0, 196, 225, 225, 0, 0, 0, 487, - 0, 0, 148, 0, 0, 0, 0, 0, 847, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 528, 0, 0, 0, 798, 0, 0, 798, 0, 0, - 0, 0, 331, 0, 0, 0, -524, 331, 198, 226, - 226, 368, 0, 157, 0, 0, 139, 140, 141, 142, - 143, 144, 0, 187, 0, 0, 0, 0, 0, 180, - 0, 0, 0, 145, 146, 147, 573, 0, 917, 944, - 527, 0, 0, 0, 0, 950, 951, 952, 953, 954, - 955, 956, 957, 958, 959, 960, 0, 148, 0, 186, - 0, 331, 0, 331, 0, 655, 657, 187, 185, 0, - 0, 0, 0, 0, 0, 187, 0, 0, 218, 187, - 0, 187, 0, 0, 0, 76, 329, 330, 160, 219, - 0, 0, 0, 196, 219, 0, 219, 0, 157, 798, - 0, 0, 0, 0, 0, 0, 0, 0, 219, 219, - 187, 0, 0, 331, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 989, 990, 331, 0, 196, 198, 0, - 0, 997, 0, 0, 0, 196, 0, 0, 0, 196, - 0, 196, 0, 0, 0, 0, 0, 0, 0, 225, - 652, 0, 0, 0, 225, 1013, 225, 743, 0, 180, - 76, 329, 330, 160, 0, 0, 0, 0, 225, 225, - 196, 0, 198, 0, 0, 0, 0, 0, 0, 0, - 198, 0, 0, 0, 198, 0, 198, 0, 0, 186, - 0, 0, 798, 0, 226, 0, 0, 0, 0, 226, - 0, 226, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 743, 226, 226, 198, 0, 493, 0, 0, - 0, 1060, 0, 331, 331, 331, 331, 331, 331, 840, - 841, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 487, 0, 487, 0, 0, - 0, 0, 0, 728, 0, 0, 774, 797, 1070, 0, - 0, 0, 328, 0, 0, 0, 0, 139, 140, 141, - 142, 143, 144, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 145, 146, 147, 331, 0, 0, - 1131, 328, 0, 0, 628, 0, 139, 140, 141, 142, - 143, 144, 0, 187, 0, 0, 0, 0, 148, 826, - 0, 0, 0, 145, 146, 147, 0, 0, 797, 0, - 832, 331, 219, 328, 0, 0, 0, 0, 139, 140, - 141, 142, 143, 144, 0, 0, 0, 148, 0, 0, - 0, 0, 0, 0, 0, 145, 146, 147, 0, 157, - 0, 0, 331, 331, 331, 331, 331, 331, 331, 331, - 331, 331, 331, 331, 331, 331, 331, 331, 331, 148, - 331, 0, 0, 196, 0, 126, 127, 128, 157, 129, - 130, 131, 132, 133, 134, 135, 136, 203, -524, 669, - 0, 0, 225, 368, 0, 0, 0, 0, 139, 140, - 141, 142, 143, 144, 0, 0, 0, 0, 1215, 0, - 157, 0, 0, 0, 0, 145, 146, 147, 198, 0, - 0, 76, 329, 330, 160, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 947, 331, 226, 0, 148, - 0, 0, 0, 187, 0, 0, 0, 0, 0, 0, - 76, 329, 330, 160, 0, 0, 0, 0, 0, 0, - 0, 0, 150, 151, 152, 153, 154, 155, 0, 0, - 0, 0, 0, 743, 0, 0, 156, 0, 0, 0, - 157, 0, 76, 329, 330, 160, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 196, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -280, 493, 0, 0, 0, 0, 0, - 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 369, 0, 0, 370, 0, - 0, 371, 76, 158, 159, 160, 161, 80, 198, 0, - 0, 0, 0, 0, 0, 0, -389, -389, -389, 1025, - 4, 0, 0, 0, 5, 6, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 8, 9, - 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, - 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 331, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 331, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, -2, 1, 331, 0, 0, - 0, 0, 76, 77, 78, 0, 79, 80, 81, 0, - 0, 0, 0, 0, 0, 328, 0, 0, 709, -280, - 139, 140, 141, 142, 143, 144, 0, 0, 0, 2, - 0, 0, 0, 0, 0, 0, 0, 145, 146, 147, - 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 148, -389, -389, -389, 0, 4, 0, 0, 0, - 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 8, 9, 10, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 157, 11, 12, 13, 0, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 0, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 0, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 0, 0, 0, 76, 329, 330, 160, 76, 77, - 78, 125, 79, 80, 81, 0, 126, 127, 128, 0, - 129, 130, 131, 132, 133, 134, 135, 136, 137, -524, - 565, 0, 0, 0, 138, 0, 0, 0, 0, 139, - 140, 141, 142, 143, 144, 0, 0, 0, 0, 0, - 0, 0, -280, -280, 0, 3, 145, 146, 147, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -389, -389, -389, - 148, 4, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 150, 151, 152, 153, 154, 155, 0, - 0, 0, 0, 0, 0, 0, 0, 156, 11, 12, - 13, 157, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 0, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 0, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, - 0, 0, 0, 76, 158, 566, 160, 161, 80, 81, - 125, 0, 0, 0, 0, 126, 127, 128, 0, 129, - 130, 131, 132, 133, 134, 135, 136, 137, -524, 0, - 0, 0, 0, 138, 0, 0, 0, 0, 139, 140, - 141, 142, 143, 144, 0, 0, 0, 0, 0, 0, - 0, -280, -280, 0, 0, 145, 146, 147, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -280, -280, -280, 148, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 150, 151, 152, 153, 154, 155, 0, 0, - 0, 0, 0, 0, 0, 0, 156, -280, -280, -280, - 157, -280, -280, -280, -280, -280, -280, -280, -280, -280, - -280, 0, -280, -280, -280, -280, -280, -280, -280, -280, - -280, -280, -280, -280, -280, -280, -280, 0, -280, -280, - -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, - -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, - -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, - -280, -280, -280, -280, -280, 0, 0, 0, 0, 0, - 0, 0, 76, 158, 159, 160, 161, 80, -280, 201, - 0, 0, 0, 0, 126, 127, 128, 0, 0, 202, - 131, 132, 133, 134, 135, 136, 203, -524, -528, 0, - 0, 0, 204, 0, 0, 0, 0, 139, 140, 141, - 142, 143, 144, 0, 0, 0, 0, 0, 0, 0, - -280, -280, 0, 0, 145, 146, 147, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -280, -280, -280, 148, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 150, 151, 152, 153, 154, 155, 0, 0, 0, - 0, 0, 0, 0, 0, 156, -280, -280, -280, 157, - -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, - 0, -280, -280, -280, -280, -280, -280, -280, -280, -280, - -280, -280, -280, -280, -280, -280, 0, -280, -280, -280, - -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, - -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, - -280, -280, -280, -280, -280, -280, -280, -280, -280, -280, - -280, -280, -280, -280, 0, 0, 0, 0, 0, 0, - 0, 76, 158, 159, 160, 205, 206, -280, 201, 0, - 0, 0, 0, 126, 127, 128, 0, 0, 202, 131, - 132, 133, 134, 135, 136, 203, -472, -472, 0, 0, - 0, 204, -472, 0, 0, 0, 139, 140, 141, 142, - 143, 144, 0, 0, 0, 0, 0, 0, 0, -280, - -280, 125, 0, 145, 146, 147, 126, 127, 128, 0, - 129, 130, 131, 132, 133, 134, 135, 136, 137, -524, - 0, 0, 0, 0, 138, 0, 0, 148, 0, 139, - 140, 141, 142, 143, 144, 0, 0, 0, 0, 0, - 0, 0, -280, -280, 0, 0, 145, 146, 147, -472, - 150, 151, 152, 153, 154, 155, 0, 0, 0, 0, - 0, 0, 0, 0, 156, 0, 0, 0, 157, 0, - 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 149, 150, 151, 152, 153, 154, 155, 0, - 0, 0, 0, 0, 0, 0, 0, 156, 0, 0, - 0, 157, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 76, 158, 159, 160, 205, 206, 0, 0, 125, 0, - 0, 0, 0, 126, 127, 128, 0, 129, 130, 131, - 132, 133, 134, 135, 136, 137, -524, 0, 0, 0, - 0, 138, 0, 0, 0, 0, 139, 140, 141, 142, - 143, 144, 0, 76, 158, 159, 160, 161, 80, -280, - -280, 201, 0, 145, 146, 147, 126, 127, 128, 0, - 0, 202, 131, 132, 133, 134, 135, 136, 203, -524, - -528, 0, 0, 0, 204, 0, 0, 148, 0, 139, - 140, 141, 142, 143, 144, 0, 0, 0, 0, 0, - 0, 0, -280, -280, 0, 0, 145, 146, 147, -499, - 150, 151, 152, 153, 154, 155, 0, 0, 0, 0, - 0, 0, 0, 0, 156, 0, 0, 0, 157, 0, - 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -468, 150, 151, 152, 153, 154, 155, 0, - 0, 0, 0, 0, 0, 0, 0, 156, 0, 0, - 0, 157, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 76, 158, 159, 160, 161, 80, 0, 0, 125, 0, - 0, 0, 0, 126, 127, 128, 0, 129, 130, 131, - 132, 133, 134, 135, 136, 137, -524, 658, 0, 0, - 0, 138, 0, 0, 0, 0, 139, 140, 141, 142, - 143, 144, 0, 76, 158, 159, 160, 205, 206, -280, - -280, 201, 0, 145, 146, 147, 126, 127, 128, 0, - 0, 202, 131, 132, 133, 134, 135, 136, 203, -524, - -528, 0, 0, 0, 204, 0, 0, 148, 0, 139, - 140, 141, 142, 143, 144, 0, 0, 0, 0, 0, - 0, 0, -280, -280, 0, 0, 145, 146, 147, 0, - 150, 151, 152, 153, 154, 155, 0, 0, 0, 0, - 0, 0, 0, 0, 156, 0, 0, 0, 157, 0, - 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 150, 151, 152, 153, 154, 155, 0, - 0, 0, 0, 0, 0, 0, 0, 156, 0, 0, - 0, 157, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 328, -262, 0, - 0, 0, 139, 140, 141, 142, 143, 144, 0, 0, - 76, 158, 159, 160, 161, 80, 0, 0, 125, 145, - 146, 147, 0, 126, 127, 128, 0, 129, 130, 131, - 132, 133, 134, 135, 136, 137, -524, 0, 0, 0, - 0, 138, 0, 148, 0, 0, 139, 140, 141, 142, - 143, 144, 0, 76, 158, 159, 160, 205, 206, -280, - -280, 0, 0, 145, 146, 147, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 157, 0, 0, 148, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 150, 151, 152, 153, 154, 155, 0, 0, 0, 0, - 0, 0, 0, 0, 156, 126, 127, 128, 157, 129, - 130, 131, 132, 133, 134, 135, 136, 203, -524, 580, - 0, 0, 0, 368, 0, 0, 0, 0, 139, 140, - 141, 142, 143, 144, 0, 0, 76, 329, 330, 160, - 0, -280, -280, 0, 3, 145, 146, 147, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, - 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 76, 158, 159, 160, 161, 80, 0, 0, 0, 0, - 0, 0, 150, 151, 152, 153, 154, 155, 0, 0, - 0, 0, 0, 0, 0, 0, 581, 11, 12, 13, - 157, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 0, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 0, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 369, 0, 0, 370, 0, - 0, 371, 76, 158, 566, 160, 161, 80, 81, 126, - 127, 128, 0, 129, 130, 131, 132, 133, 134, 135, - 136, 203, -524, 659, 0, 0, 0, 368, 0, 0, - 0, 0, 139, 140, 141, 142, 143, 144, 0, 0, - 0, 0, 0, 0, 0, -280, -280, 0, 3, 145, - 146, 147, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 148, 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 150, 151, 152, 153, - 154, 155, 0, 0, 0, 0, 0, 0, 0, 0, - 156, 11, 12, 13, 157, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 0, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 0, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 369, - 0, 0, 370, 0, 0, 371, 76, 158, 566, 160, - 161, 80, 81, 126, 127, 128, 0, 129, 130, 131, - 132, 133, 134, 135, 136, 203, -524, 670, 0, 0, - 0, 368, 0, 0, 0, 0, 139, 140, 141, 142, - 143, 144, 0, 0, 0, 0, 0, 0, 0, -280, - -280, 0, 3, 145, 146, 147, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 148, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 150, 151, 152, 153, 154, 155, 0, 0, 0, 0, - 0, 0, 0, 0, 671, 11, 12, 13, 157, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 0, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 0, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 369, 0, 0, 370, 0, 0, 371, - 76, 158, 566, 160, 161, 80, 81, 126, 127, 128, - 0, 129, 130, 131, 132, 133, 134, 135, 136, 203, - -524, 673, 0, 0, 0, 368, 0, 0, 0, 0, - 139, 140, 141, 142, 143, 144, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 145, 146, 147, - 126, 127, 128, 0, 129, 130, 131, 132, 133, 134, - 135, 136, 203, -524, 726, 0, 0, 0, 368, 0, - 0, 148, 0, 139, 140, 141, 142, 143, 144, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 145, 146, 147, 0, 150, 151, 152, 153, 154, 155, - 0, 0, 0, 0, 0, 0, 0, 0, 674, 0, - 328, 0, 157, 0, 148, 139, 140, 141, 142, 143, - 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 145, 146, 147, 0, 0, 150, 151, 152, - 153, 154, 155, 0, 0, 0, 0, 0, 0, 0, - 0, 156, 0, 0, 0, 157, 148, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 369, 0, 0, - 370, 0, 0, 371, 76, 158, 159, 160, 161, 80, - 0, 0, 0, 0, 0, 0, 0, 157, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 369, 0, 0, 370, 0, 0, 371, 76, 158, 159, - 160, 161, 80, 126, 127, 128, 0, 129, 130, 131, - 132, 133, 134, 135, 136, 203, -524, 779, 0, 0, - 0, 368, 0, 0, 0, 0, 139, 140, 141, 142, - 143, 144, 0, 0, 0, 0, 0, 0, 0, 76, - 329, 330, 160, 145, 146, 147, 126, 127, 128, 0, - 129, 130, 131, 132, 133, 134, 135, 136, 203, -524, - 780, 0, 0, 0, 368, 0, 0, 148, 0, 139, - 140, 141, 142, 143, 144, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 145, 146, 147, 0, - 150, 151, 152, 153, 154, 155, 0, 0, 0, 0, - 0, 0, 0, 0, 156, 0, 357, 0, 157, 0, - 148, 139, 140, 141, 142, 143, 144, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 145, 146, - 147, 0, 0, 150, 151, 152, 153, 154, 155, 0, - 0, 0, 0, 0, 0, 0, 0, 781, 0, 0, - 0, 157, 148, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 369, 0, 0, 370, 0, 0, 371, - 76, 158, 159, 160, 161, 80, 0, 0, 0, 0, - 0, 0, 0, 157, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 369, 0, 0, 370, - 0, 0, 371, 76, 158, 159, 160, 161, 80, 126, - 127, 128, 0, 129, 130, 131, 132, 133, 134, 135, - 136, 203, -524, 782, 0, 0, 0, 368, 0, 0, - 0, 0, 139, 140, 141, 142, 143, 144, 0, 0, - 0, 0, 0, 0, 0, 76, 329, 330, 160, 145, - 146, 147, 126, 127, 128, 0, 129, 130, 131, 132, - 133, 134, 135, 136, 203, -524, 901, 0, 0, 0, - 368, 0, 0, 148, 0, 139, 140, 141, 142, 143, - 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 145, 146, 147, 0, 150, 151, 152, 153, - 154, 155, 0, 0, 0, 0, 0, 0, 0, 0, - 156, 0, 654, 0, 157, 0, 148, 139, 140, 141, - 142, 143, 144, 656, 0, 0, 0, 0, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 0, 0, 150, - 151, 152, 153, 154, 155, 145, 146, 147, 0, 0, - 0, 0, 0, 156, 0, 0, 0, 157, 148, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 369, - 0, 0, 370, 0, 0, 371, 76, 158, 159, 160, - 161, 80, 0, 0, 0, 0, 0, 0, 0, 157, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 157, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 369, 0, 0, 370, 0, 0, 371, 76, - 158, 159, 160, 161, 80, 126, 127, 128, 0, 129, - 130, 131, 132, 133, 134, 135, 136, 203, -524, 0, - 0, 0, 0, 368, 0, 0, 0, 0, 139, 140, - 141, 142, 143, 144, 0, 0, 0, 0, 0, 0, - 0, 76, 329, 330, 160, 145, 146, 147, 0, 0, - 0, 0, 76, 329, 330, 160, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 150, 151, 152, 153, 154, 155, 293, 0, - 0, 0, 0, 0, 0, 0, 156, 0, 0, 0, - 157, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, - 0, 729, 0, 0, 0, 0, 730, 731, 732, 733, - 734, 735, 0, 0, 0, 0, 0, -389, -389, -389, - 0, 4, 0, 145, 736, 737, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 369, 0, 738, 370, 0, - 0, 371, 76, 158, 159, 160, 161, 80, 11, 12, - 13, 0, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 0, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 157, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 293, 0, 0, 0, - 0, 0, 0, 0, 0, 120, 0, 0, 0, 81, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, - 76, 739, 740, 741, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -658, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 11, 12, 13, 0, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 0, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, -146, 0, 0, 0, 0, -146, - 0, 0, 0, 120, 0, 0, 0, 81, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 11, 12, 13, 0, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 0, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 0, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 288, 0, 0, 0, 0, 0, 0, 0, 0, - 120, 0, 0, 0, 81, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -527, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 11, 12, 13, 0, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 0, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 0, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 120, 11, 12, - 13, 81, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 0, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 0, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, -665, 0, 0, 0, - 0, 0, 0, 0, 0, 120, 0, 0, 0, 81, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -667, -667, -667, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -667, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -667, -667, -667, 0, -667, -667, -667, -667, - -667, -667, -667, -667, -667, -667, 0, -667, -667, -667, - -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, - -667, -667, 0, -667, -667, -667, -667, -667, -667, -667, - -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, - -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, - -667, -667, -667, -667, -667, -667, -667, -667, -667, -667, - -280, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 0, 0, -667, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 11, 12, 13, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 0, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 0, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, -206, -206, 0, 0, 0, 0, 0, 76, - 77, 78, 0, 79, 80, 81, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, - 13, 0, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 0, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 0, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 3, 0, 0, 0, - 0, 0, 0, 0, 0, 120, 0, 0, 0, 81, - 0, 0, 0, 0, 0, 0, 0, 0, -389, -389, - -389, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, - 12, 13, 0, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 0, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 0, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 3, 0, 0, - 0, 0, 0, 0, 0, 0, 120, 0, 0, 0, - 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 11, 12, 13, 0, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 0, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 0, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, -389, -389, - -389, 0, 0, 0, 0, 0, 0, 120, 0, 0, - 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, - 12, 13, 0, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 0, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 0, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 8, 9, 10, - 0, 0, 0, 0, 0, 0, 120, 0, 0, 0, - 81, 0, 0, 0, 0, 0, 11, 12, 13, 0, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 0, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 0, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 120, 11, 12, 13, 81, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 0, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 0, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 120, 0, 0, 0, 81 -}; - -static const short yycheck[] = { 0, - 106, 89, 3, 469, 501, 366, 409, 410, 320, 2, - 11, 12, 0, 368, 0, 626, 664, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 407, 408, 630, 418, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 415, 416, 419, 27, 417, 303, - 8, 719, 5, 664, 75, 452, 560, 19, 24, 0, - 797, 82, 3, 800, 5, 664, 558, 479, 34, 789, - 451, 8, 25, 803, 82, 322, 82, 24, 18, 100, - 455, 126, 777, 915, 24, 106, 0, 41, 24, 86, - 87, 27, 809, 5, 34, 116, 117, 118, 34, 21, - 113, 122, 56, 28, 24, 27, 711, 215, 719, 122, - 41, 18, 684, 25, 34, 9, 10, 138, 499, 44, - 719, 34, 86, 87, 145, 56, 1090, 1091, 569, 139, - 140, 141, 142, 143, 144, 1040, 1041, 18, 1090, 1119, - 1120, 82, 26, 584, 204, 411, 412, 413, 414, 209, - 34, 211, 116, 117, 24, 96, 97, 8, 99, 24, - 664, 993, 28, 223, 34, 902, 130, 0, 82, 34, - 3, 1089, 664, 5, 7, 8, 9, 10, 44, 1097, - 138, 122, 899, 204, 1148, 702, 183, 184, 908, 919, - 910, 21, 24, 25, 26, 108, 109, 1177, 8, 894, - 612, 138, 34, 1155, 6, 7, 186, 1159, 1113, 9, - 10, 1116, 587, 85, 611, 719, 788, 183, 184, 791, - 24, 183, 184, 185, 182, 187, 188, 719, 24, 610, - 183, 184, 185, 480, 187, 188, 194, 24, 196, 5, - 21, 664, 1194, 183, 184, 182, 27, 183, 184, 82, - 186, 632, 506, 190, 21, 1139, 24, 194, 25, 196, - 180, 181, 29, 183, 184, 286, 186, 225, 1005, 1174, - 291, 24, 664, 106, 906, 607, 1160, 909, 1162, 21, - 664, 302, 303, 25, 305, 306, 292, 138, 225, 122, - 26, 664, 28, 664, 302, 664, 719, 814, 319, 24, - 133, 26, 933, 18, 325, 138, 909, 328, 44, 34, - 204, 319, 980, 183, 184, 209, 18, 211, 183, 184, - 428, 366, 18, 156, 929, 21, 347, 719, 138, 223, - 224, 182, 5, 21, 347, 719, 21, 25, 592, 190, - 25, 18, 5, 194, 21, 196, 719, 368, 719, 182, - 719, 183, 184, 185, 39, 187, 188, 190, 24, 192, - 26, 194, 25, 196, 192, 86, 87, 22, 1000, 980, - 1002, 204, 182, 877, 225, 26, 209, 28, 211, 34, - 190, 980, 636, 875, 194, 21, 196, 447, 16, 25, - 223, 224, 225, 44, 404, 405, 406, 1000, 664, 1002, - 654, 24, 656, 18, 204, 346, 451, 15, 23, 209, - 21, 211, 21, 794, 25, 225, 25, 183, 184, 185, - 16, 187, 188, 223, 224, 0, 21, 21, 3, 16, - 25, 25, 7, 454, 32, 33, 457, 443, 49, 50, - 16, 864, 865, 464, 34, 466, 454, 468, 469, 457, - 471, 22, 21, 719, 499, 476, 25, 22, 479, 53, - 54, 18, 183, 184, 21, 486, 479, 21, 25, 302, - 428, 25, 305, 306, 307, 729, 980, 498, 862, 863, - 501, 873, 503, 37, 38, 506, 319, 22, 980, 21, - 34, 428, 325, 25, 504, 85, 29, 51, 52, 870, - 871, 874, 18, 872, 21, 21, 40, 82, 25, 25, - 183, 184, 185, 18, 187, 188, 21, 49, 50, 460, - 183, 184, 185, 21, 187, 188, 39, 25, 183, 184, - 185, 106, 187, 188, 32, 33, 369, 370, 371, 92, - 5, 374, 24, 24, 26, 26, 374, 122, 26, 382, - 28, 384, 34, 447, 382, 55, 384, 980, 133, 24, - 25, 26, 1079, 569, 939, 610, 44, 18, 589, 34, - 21, 592, 23, 92, 1060, 21, 702, 428, 584, 25, - 18, 22, 21, 21, 605, 606, 25, 632, 980, 921, - 24, 612, 26, 183, 184, 428, 980, 187, 188, 612, - 866, 867, 868, 869, 21, 49, 50, 980, 25, 980, - 631, 980, 21, 19, 447, 636, 25, 24, 428, 26, - 453, 454, 21, 24, 457, 453, 25, 34, 649, 650, - 24, 568, 26, 654, 467, 656, 469, 22, 471, 183, - 184, 185, 25, 187, 188, 28, 479, 447, 22, 482, - 49, 50, 21, 486, 19, 987, 25, 678, 25, 26, - 21, 97, 21, 99, 25, 686, 25, 688, 37, 38, - 92, 692, 693, 21, 1006, 20, 697, 25, 619, 1011, - 701, 702, 51, 52, 32, 33, 707, 520, 814, 702, - 49, 50, 520, 27, 707, 21, 529, 530, 1030, 25, - 92, 183, 184, 185, 1036, 187, 188, 189, 729, 25, - 26, 24, 28, 1045, 980, 25, 26, 568, 28, 18, - 730, 731, 732, 733, 734, 735, 23, 302, 44, 21, - 305, 306, 307, 25, 44, 568, 569, 42, 43, 37, - 38, 569, 1074, 1075, 319, 1077, 18, 1128, 581, 794, - 325, 584, 585, 51, 52, 18, 584, 585, 568, 18, - 26, 18, 24, 784, 21, 24, 1020, 18, 34, 22, - 29, 30, 31, 32, 33, 34, 183, 184, 185, 612, - 187, 188, 21, 828, 53, 54, 25, 46, 47, 48, - 25, 1123, 813, 814, 18, 816, 25, 26, 21, 28, - 24, 814, 25, 1184, 25, 29, 30, 31, 32, 33, - 34, 70, 67, 68, 69, 44, 183, 184, 185, 24, - 187, 188, 46, 47, 48, 18, 24, 660, 661, 27, - 21, 664, 660, 661, 25, 18, 34, 18, 671, 672, - 21, 674, 20, 21, 672, 786, 70, 1179, 789, 859, - 860, 861, 111, 21, 687, 183, 689, 25, 21, 183, - 184, 185, 25, 187, 188, 698, 37, 38, 701, 702, - 703, 34, 35, 36, 21, 703, 18, 985, 25, 454, - 51, 52, 457, 18, 905, 21, 719, 111, 18, 25, - 19, 912, 467, 21, 469, 21, 471, 25, 9, 25, - 23, 1009, 21, 11, 479, 25, 25, 482, 24, 21, - 26, 486, 28, 25, 21, 22, 21, 183, 184, 185, - 25, 187, 188, 24, 183, 184, 185, 186, 44, 32, - 33, 47, 48, 943, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 11, 21, 21, 21, 781, 25, - 25, 25, 24, 1079, 529, 530, 8, 9, 10, 183, - 184, 185, 186, 88, 119, 906, 121, 908, 909, 910, - 21, 21, 21, 994, 25, 25, 997, 132, 133, 88, - 135, 814, 137, 138, 18, 183, 184, 21, 186, 997, - 19, 824, 1013, 21, 1015, 150, 19, 25, 18, 1020, - 1013, 21, 1023, 1024, 19, 1013, 34, 35, 36, 49, - 50, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 21, 21, 21, 1030, 25, 25, 25, 8, 9, - 10, 27, 21, 19, 21, 23, 25, 612, 25, 1060, - 24, 1062, 1063, 21, 98, 21, 100, 25, 102, 18, - 104, 25, 21, 20, 21, 109, 53, 54, 1079, 1000, - 22, 1002, 34, 35, 36, 119, 18, 121, 1074, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 21, - 24, 24, 26, 1128, 28, 21, 138, 78, 79, 80, - 81, 82, 83, 84, 34, 35, 36, 20, 21, 1144, - 44, 21, 22, 47, 48, 1126, 183, 184, 1129, 163, - 22, 1132, 687, 186, 689, 948, 949, 72, 73, 74, - 25, 1129, 186, 698, 32, 33, 701, 702, 186, 11, - 182, 72, 73, 74, 51, 52, 53, 24, 190, 1184, - 24, 24, 194, 20, 196, 25, 27, 980, 23, 19, - 23, 20, 204, 205, 987, 19, 21, 209, 138, 211, - 5, 27, 25, 24, 997, 22, 88, 88, 24, 88, - 25, 223, 224, 225, 20, 18, 20, 27, 1011, 18, - 1013, 29, 24, 1016, 25, 25, 21, 39, 25, 27, - 88, 25, 1213, 25, 25, 55, 1029, 25, 24, 18, - 25, 25, 182, 1224, 40, 25, 1039, 1040, 1041, 25, - 190, 21, 18, 177, 194, 1048, 196, 18, 8, 9, - 10, 21, 178, 177, 204, 18, 88, 1060, 188, 209, - 178, 211, 21, 25, 88, 20, 22, 291, 20, 814, - 24, 295, 25, 223, 224, 225, 1079, 18, 20, 824, - 20, 27, 73, 18, 27, 88, 1089, 1090, 1091, 313, - 27, 88, 316, 25, 1097, 88, 88, 360, 25, 0, - 324, 88, 0, 327, 88, 88, 88, 82, 325, 778, - 1113, 1114, 1115, 1116, 900, 1105, 1119, 1120, 1010, 1038, - 894, 926, 1125, 1011, 1174, 388, 1129, 843, 1125, 471, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 592, 1129, 689, 687, 1148, 113, 814, 10, 8, - 701, 347, 1155, 224, 1157, 1158, 1159, 1084, 520, 428, - 719, 424, 980, -1, -1, 387, -1, -1, -1, 126, - -1, 1174, 1175, 1176, 1177, -1, -1, -1, 138, 8, - 9, 10, 139, 140, 141, 142, 143, 144, -1, 146, - 147, 1194, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 948, 949, -1, 428, 72, 73, 74, - -1, -1, -1, 78, 79, 80, 81, 82, 83, 84, - -1, -1, 182, -1, -1, 447, -1, -1, 452, -1, - 190, -1, -1, -1, 194, 459, 196, -1, -1, -1, - 464, -1, 466, -1, 204, -1, -1, -1, -1, 209, - 474, 211, 997, -1, 478, -1, -1, -1, -1, -1, - -1, -1, -1, 223, 224, 225, -1, -1, 1013, -1, - -1, 1016, -1, -1, -1, -1, -1, 136, 428, 138, - -1, -1, -1, -1, 24, 25, -1, -1, -1, 29, - 30, 31, 32, 33, 34, -1, -1, 447, -1, -1, - -1, -1, -1, -1, -1, -1, 46, 47, 48, 138, - 72, 73, 74, -1, -1, 1060, 78, 79, 80, 81, - 82, 83, 84, 182, -1, -1, -1, -1, -1, -1, - 70, 190, -1, -1, 1079, 194, -1, 196, -1, -1, - -1, -1, -1, -1, -1, 204, 568, -1, -1, -1, - -1, -1, -1, 182, -1, -1, -1, -1, -1, -1, - -1, 190, 586, -1, -1, 194, 225, 196, -1, 1114, - 1115, 111, -1, -1, -1, 204, -1, -1, -1, -1, - 209, -1, 211, 646, 1129, -1, -1, 611, -1, -1, - -1, -1, -1, -1, 223, 224, 225, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 630, -1, -1, 366, - -1, 635, 1157, 1158, -1, -1, -1, -1, 568, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 691, -1, - 1175, 1176, -1, 8, 9, 10, -1, -1, -1, -1, - -1, -1, 666, 183, 184, 185, 186, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, -1, -1, -1, 24, 25, 428, 328, - -1, 29, 30, 31, 32, 33, 34, 336, 337, 338, - 339, -1, -1, -1, -1, -1, -1, 447, 46, 47, - 48, -1, -1, -1, 451, -1, -1, -1, 357, -1, - -1, -1, -1, 8, 9, 10, -1, -1, -1, 368, - -1, -1, 70, -1, -1, -1, -1, -1, 742, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 389, -1, -1, -1, 797, -1, -1, 800, -1, -1, - -1, -1, 499, -1, -1, -1, 19, 504, 8, 9, - 10, 24, -1, 111, -1, -1, 29, 30, 31, 32, - 33, 34, -1, 138, -1, -1, -1, -1, -1, 428, - -1, -1, -1, 46, 47, 48, 435, -1, 802, 842, - 843, -1, -1, -1, -1, 848, 849, 850, 851, 852, - 853, 854, 855, 856, 857, 858, -1, 70, -1, 428, - -1, 558, -1, 560, -1, 562, 563, 182, 568, -1, - -1, -1, -1, -1, -1, 190, -1, -1, 447, 194, - -1, 196, -1, -1, -1, 183, 184, 185, 186, 204, - -1, -1, -1, 138, 209, -1, 211, -1, 111, 902, - -1, -1, -1, -1, -1, -1, -1, -1, 223, 224, - 225, -1, -1, 610, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 897, 898, 632, -1, 182, 138, -1, - -1, 905, -1, -1, -1, 190, -1, -1, -1, 194, - -1, 196, -1, -1, -1, -1, -1, -1, -1, 204, - 559, -1, -1, -1, 209, 929, 211, 664, -1, 568, - 183, 184, 185, 186, -1, -1, -1, -1, 223, 224, - 225, -1, 182, -1, -1, -1, -1, -1, -1, -1, - 190, -1, -1, -1, 194, -1, 196, -1, -1, 568, - -1, -1, 1005, -1, 204, -1, -1, -1, -1, 209, - -1, 211, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 719, 223, 224, 225, -1, 626, -1, -1, - -1, 995, -1, 730, 731, 732, 733, 734, 735, 736, - 737, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 654, -1, 656, -1, -1, - -1, -1, -1, 662, -1, -1, 665, 19, 20, -1, - -1, -1, 24, -1, -1, -1, -1, 29, 30, 31, - 32, 33, 34, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 46, 47, 48, 794, -1, -1, - 1064, 24, -1, -1, 27, -1, 29, 30, 31, 32, - 33, 34, -1, 428, -1, -1, -1, -1, 70, 718, - -1, -1, -1, 46, 47, 48, -1, -1, 19, -1, - 729, 828, 447, 24, -1, -1, -1, -1, 29, 30, - 31, 32, 33, 34, -1, -1, -1, 70, -1, -1, - -1, -1, -1, -1, -1, 46, 47, 48, -1, 111, - -1, -1, 859, 860, 861, 862, 863, 864, 865, 866, - 867, 868, 869, 870, 871, 872, 873, 874, 875, 70, - 877, -1, -1, 428, -1, 6, 7, 8, 111, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - -1, -1, 447, 24, -1, -1, -1, -1, 29, 30, - 31, 32, 33, 34, -1, -1, -1, -1, 1182, -1, - 111, -1, -1, -1, -1, 46, 47, 48, 428, -1, - -1, 183, 184, 185, 186, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 844, 943, 447, -1, 70, - -1, -1, -1, 568, -1, -1, -1, -1, -1, -1, - 183, 184, 185, 186, -1, -1, -1, -1, -1, -1, - -1, -1, 93, 94, 95, 96, 97, 98, -1, -1, - -1, -1, -1, 980, -1, -1, 107, -1, -1, -1, - 111, -1, 183, 184, 185, 186, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, - 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 568, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 24, 933, -1, -1, -1, -1, -1, - -1, -1, -1, 34, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 45, 176, -1, -1, 179, -1, - -1, 182, 183, 184, 185, 186, 187, 188, 568, -1, - -1, -1, -1, -1, -1, -1, 67, 68, 69, 978, - 71, -1, -1, -1, 75, 76, 77, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 89, 90, - 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 108, 109, 110, - -1, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 1128, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 1144, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 0, 1, 1184, -1, -1, - -1, -1, 183, 184, 185, -1, 187, 188, 189, -1, - -1, -1, -1, -1, -1, 24, -1, -1, 27, 24, - 29, 30, 31, 32, 33, 34, -1, -1, -1, 34, - -1, -1, -1, -1, -1, -1, -1, 46, 47, 48, - 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 70, 67, 68, 69, -1, 71, -1, -1, -1, - 75, 76, 77, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 89, 90, 91, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 111, 108, 109, 110, -1, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, -1, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, -1, -1, -1, 183, 184, 185, 186, 183, 184, - 185, 1, 187, 188, 189, -1, 6, 7, 8, -1, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, -1, -1, -1, 24, -1, -1, -1, -1, 29, - 30, 31, 32, 33, 34, -1, -1, -1, -1, -1, - -1, -1, 42, 43, -1, 45, 46, 47, 48, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 67, 68, 69, - 70, 71, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 93, 94, 95, 96, 97, 98, -1, - -1, -1, -1, -1, -1, -1, -1, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, -1, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, -1, -1, -1, -1, - -1, -1, -1, 183, 184, 185, 186, 187, 188, 189, - 1, -1, -1, -1, -1, 6, 7, 8, -1, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, - -1, -1, -1, 24, -1, -1, -1, -1, 29, 30, - 31, 32, 33, 34, -1, -1, -1, -1, -1, -1, - -1, 42, 43, -1, -1, 46, 47, 48, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 67, 68, 69, 70, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 93, 94, 95, 96, 97, 98, -1, -1, - -1, -1, -1, -1, -1, -1, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, -1, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, -1, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, -1, -1, -1, -1, -1, - -1, -1, 183, 184, 185, 186, 187, 188, 189, 1, - -1, -1, -1, -1, 6, 7, 8, -1, -1, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, -1, - -1, -1, 24, -1, -1, -1, -1, 29, 30, 31, - 32, 33, 34, -1, -1, -1, -1, -1, -1, -1, - 42, 43, -1, -1, 46, 47, 48, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 67, 68, 69, 70, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 93, 94, 95, 96, 97, 98, -1, -1, -1, - -1, -1, -1, -1, -1, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - -1, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, -1, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, -1, -1, -1, -1, -1, -1, - -1, 183, 184, 185, 186, 187, 188, 189, 1, -1, - -1, -1, -1, 6, 7, 8, -1, -1, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, - -1, 24, 25, -1, -1, -1, 29, 30, 31, 32, - 33, 34, -1, -1, -1, -1, -1, -1, -1, 42, - 43, 1, -1, 46, 47, 48, 6, 7, 8, -1, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - -1, -1, -1, -1, 24, -1, -1, 70, -1, 29, - 30, 31, 32, 33, 34, -1, -1, -1, -1, -1, - -1, -1, 42, 43, -1, -1, 46, 47, 48, 92, - 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, - -1, -1, -1, -1, 107, -1, -1, -1, 111, -1, - 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 92, 93, 94, 95, 96, 97, 98, -1, - -1, -1, -1, -1, -1, -1, -1, 107, -1, -1, - -1, 111, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 183, 184, 185, 186, 187, 188, -1, -1, 1, -1, - -1, -1, -1, 6, 7, 8, -1, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, -1, -1, -1, - -1, 24, -1, -1, -1, -1, 29, 30, 31, 32, - 33, 34, -1, 183, 184, 185, 186, 187, 188, 42, - 43, 1, -1, 46, 47, 48, 6, 7, 8, -1, - -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, -1, -1, -1, 24, -1, -1, 70, -1, 29, - 30, 31, 32, 33, 34, -1, -1, -1, -1, -1, - -1, -1, 42, 43, -1, -1, 46, 47, 48, 92, - 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, - -1, -1, -1, -1, 107, -1, -1, -1, 111, -1, - 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 92, 93, 94, 95, 96, 97, 98, -1, - -1, -1, -1, -1, -1, -1, -1, 107, -1, -1, - -1, 111, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 183, 184, 185, 186, 187, 188, -1, -1, 1, -1, - -1, -1, -1, 6, 7, 8, -1, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, - -1, 24, -1, -1, -1, -1, 29, 30, 31, 32, - 33, 34, -1, 183, 184, 185, 186, 187, 188, 42, - 43, 1, -1, 46, 47, 48, 6, 7, 8, -1, - -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, -1, -1, -1, 24, -1, -1, 70, -1, 29, - 30, 31, 32, 33, 34, -1, -1, -1, -1, -1, - -1, -1, 42, 43, -1, -1, 46, 47, 48, -1, - 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, - -1, -1, -1, -1, 107, -1, -1, -1, 111, -1, - 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 93, 94, 95, 96, 97, 98, -1, - -1, -1, -1, -1, -1, -1, -1, 107, -1, -1, - -1, 111, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 24, 25, -1, - -1, -1, 29, 30, 31, 32, 33, 34, -1, -1, - 183, 184, 185, 186, 187, 188, -1, -1, 1, 46, - 47, 48, -1, 6, 7, 8, -1, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, -1, -1, -1, - -1, 24, -1, 70, -1, -1, 29, 30, 31, 32, - 33, 34, -1, 183, 184, 185, 186, 187, 188, 42, - 43, -1, -1, 46, 47, 48, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 111, -1, -1, 70, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, - -1, -1, -1, -1, 107, 6, 7, 8, 111, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - -1, -1, -1, 24, -1, -1, -1, -1, 29, 30, - 31, 32, 33, 34, -1, -1, 183, 184, 185, 186, - -1, 42, 43, -1, 45, 46, 47, 48, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 70, - 71, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 183, 184, 185, 186, 187, 188, -1, -1, -1, -1, - -1, -1, 93, 94, 95, 96, 97, 98, -1, -1, - -1, -1, -1, -1, -1, -1, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, -1, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, -1, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, -1, -1, 179, -1, - -1, 182, 183, 184, 185, 186, 187, 188, 189, 6, - 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, -1, -1, -1, 24, -1, -1, - -1, -1, 29, 30, 31, 32, 33, 34, -1, -1, - -1, -1, -1, -1, -1, 42, 43, -1, 45, 46, - 47, 48, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 70, 71, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 93, 94, 95, 96, - 97, 98, -1, -1, -1, -1, -1, -1, -1, -1, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, -1, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, -1, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - -1, -1, 179, -1, -1, 182, 183, 184, 185, 186, - 187, 188, 189, 6, 7, 8, -1, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, - -1, 24, -1, -1, -1, -1, 29, 30, 31, 32, - 33, 34, -1, -1, -1, -1, -1, -1, -1, 42, - 43, -1, 45, 46, 47, 48, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 70, 71, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, - -1, -1, -1, -1, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, -1, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, -1, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, -1, -1, 179, -1, -1, 182, - 183, 184, 185, 186, 187, 188, 189, 6, 7, 8, - -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, -1, -1, -1, 24, -1, -1, -1, -1, - 29, 30, 31, 32, 33, 34, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 46, 47, 48, - 6, 7, 8, -1, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, -1, -1, -1, 24, -1, - -1, 70, -1, 29, 30, 31, 32, 33, 34, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 46, 47, 48, -1, 93, 94, 95, 96, 97, 98, - -1, -1, -1, -1, -1, -1, -1, -1, 107, -1, - 24, -1, 111, -1, 70, 29, 30, 31, 32, 33, - 34, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 46, 47, 48, -1, -1, 93, 94, 95, - 96, 97, 98, -1, -1, -1, -1, -1, -1, -1, - -1, 107, -1, -1, -1, 111, 70, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 176, -1, -1, - 179, -1, -1, 182, 183, 184, 185, 186, 187, 188, - -1, -1, -1, -1, -1, -1, -1, 111, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 176, -1, -1, 179, -1, -1, 182, 183, 184, 185, - 186, 187, 188, 6, 7, 8, -1, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, - -1, 24, -1, -1, -1, -1, 29, 30, 31, 32, - 33, 34, -1, -1, -1, -1, -1, -1, -1, 183, - 184, 185, 186, 46, 47, 48, 6, 7, 8, -1, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, -1, -1, -1, 24, -1, -1, 70, -1, 29, - 30, 31, 32, 33, 34, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 46, 47, 48, -1, - 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, - -1, -1, -1, -1, 107, -1, 24, -1, 111, -1, - 70, 29, 30, 31, 32, 33, 34, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 46, 47, - 48, -1, -1, 93, 94, 95, 96, 97, 98, -1, - -1, -1, -1, -1, -1, -1, -1, 107, -1, -1, - -1, 111, 70, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 176, -1, -1, 179, -1, -1, 182, - 183, 184, 185, 186, 187, 188, -1, -1, -1, -1, - -1, -1, -1, 111, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 176, -1, -1, 179, - -1, -1, 182, 183, 184, 185, 186, 187, 188, 6, - 7, 8, -1, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, -1, -1, -1, 24, -1, -1, - -1, -1, 29, 30, 31, 32, 33, 34, -1, -1, - -1, -1, -1, -1, -1, 183, 184, 185, 186, 46, - 47, 48, 6, 7, 8, -1, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, -1, -1, -1, - 24, -1, -1, 70, -1, 29, 30, 31, 32, 33, - 34, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 46, 47, 48, -1, 93, 94, 95, 96, - 97, 98, -1, -1, -1, -1, -1, -1, -1, -1, - 107, -1, 24, -1, 111, -1, 70, 29, 30, 31, - 32, 33, 34, 24, -1, -1, -1, -1, 29, 30, - 31, 32, 33, 34, 46, 47, 48, -1, -1, 93, - 94, 95, 96, 97, 98, 46, 47, 48, -1, -1, - -1, -1, -1, 107, -1, -1, -1, 111, 70, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 70, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 176, - -1, -1, 179, -1, -1, 182, 183, 184, 185, 186, - 187, 188, -1, -1, -1, -1, -1, -1, -1, 111, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 111, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 176, -1, -1, 179, -1, -1, 182, 183, - 184, 185, 186, 187, 188, 6, 7, 8, -1, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, -1, - -1, -1, -1, 24, -1, -1, -1, -1, 29, 30, - 31, 32, 33, 34, -1, -1, -1, -1, -1, -1, - -1, 183, 184, 185, 186, 46, 47, 48, -1, -1, - -1, -1, 183, 184, 185, 186, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 70, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 93, 94, 95, 96, 97, 98, 18, -1, - -1, -1, -1, -1, -1, -1, 107, -1, -1, -1, - 111, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 45, -1, -1, -1, -1, - -1, 24, -1, -1, -1, -1, 29, 30, 31, 32, - 33, 34, -1, -1, -1, -1, -1, 67, 68, 69, - -1, 71, -1, 46, 47, 48, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 176, -1, 70, 179, -1, - -1, 182, 183, 184, 185, 186, 187, 188, 108, 109, - 110, -1, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 111, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 18, -1, -1, -1, - -1, -1, -1, -1, -1, 185, -1, -1, -1, 189, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 45, -1, -1, -1, -1, -1, -1, - 183, 184, 185, 186, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 71, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 88, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 108, 109, 110, -1, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - -1, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, -1, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 19, -1, -1, -1, -1, 24, - -1, -1, -1, 185, -1, -1, -1, 189, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 71, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 108, 109, 110, -1, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, -1, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, -1, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 19, -1, -1, -1, -1, -1, -1, -1, -1, - 185, -1, -1, -1, 189, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 71, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 108, 109, 110, -1, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - -1, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 185, 108, 109, - 110, 189, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, -1, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 22, -1, -1, -1, - -1, -1, -1, -1, -1, 185, -1, -1, -1, 189, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 67, 68, 69, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 85, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 108, 109, 110, -1, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, -1, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, -1, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 34, -1, -1, 189, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 108, 109, 110, -1, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, -1, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 42, 43, -1, -1, -1, -1, -1, 183, - 184, 185, -1, 187, 188, 189, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 108, 109, - 110, -1, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, -1, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, -1, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 45, -1, -1, -1, - -1, -1, -1, -1, -1, 185, -1, -1, -1, 189, - -1, -1, -1, -1, -1, -1, -1, -1, 67, 68, - 69, -1, 71, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, - 109, 110, -1, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, -1, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 45, -1, -1, - -1, -1, -1, -1, -1, -1, 185, -1, -1, -1, - 189, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 71, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 108, 109, 110, -1, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, -1, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - -1, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 67, 68, - 69, -1, -1, -1, -1, -1, -1, 185, -1, -1, - -1, 189, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, - 109, 110, -1, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, -1, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, -1, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 89, 90, 91, - -1, -1, -1, -1, -1, -1, 185, -1, -1, -1, - 189, -1, -1, -1, -1, -1, 108, 109, 110, -1, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - -1, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, -1, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 185, 108, 109, 110, 189, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, -1, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, -1, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 185, -1, -1, -1, 189 -}; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/share/misc/bison.simple" - -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -#ifndef alloca -#ifdef __GNUC__ -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) -#include -#else /* not sparc */ -#if defined (MSDOS) && !defined (__TURBOC__) -#include -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -#include - #pragma alloca -#else /* not MSDOS, __TURBOC__, or _AIX */ -#ifdef __hpux -#ifdef __cplusplus -extern "C" { -void *alloca (unsigned int); -}; -#else /* not __cplusplus */ -void *alloca (); -#endif /* not __cplusplus */ -#endif /* __hpux */ -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc. */ -#endif /* not GNU C. */ -#endif /* alloca not defined. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT return(0) -#define YYABORT return(1) -#define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto yyerrlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { yychar = (token), yylval = (value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX yylex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ -#endif - -/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ - -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -int yyparse (void); -#endif - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (to, from, count) - char *to; - char *from; - int count; -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#else /* __cplusplus */ - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *to, char *from, int count) -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#endif -#endif - -#line 196 "/usr/share/misc/bison.simple" - -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ - -#ifdef YYPARSE_PARAM -#ifdef __cplusplus -#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* not __cplusplus */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#endif /* not __cplusplus */ -#else /* not YYPARSE_PARAM */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* not YYPARSE_PARAM */ - -int -yyparse(YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - register int yystate; - register int yyn; - register short *yyssp; - register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; - -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) -#else -#define YYPOPSTACK (yyvsp--, yyssp--) -#endif - - int yystacksize = YYINITDEPTH; - -#ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); -#endif - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss - 1; - yyvsp = yyvs; -#ifdef YYLSP_NEEDED - yylsp = yyls; -#endif - -/* Push a new state, which is found in yystate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: - - *++yyssp = yystate; - - if (yyssp >= yyss + yystacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; - -#ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); -#else - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); -#endif - - yyss = yyss1; yyvs = yyvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - return 2; - } - yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) - yystacksize = YYMAXDEPTH; - yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp)); - yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp)); -#endif -#endif /* no yyoverflow */ - - yyssp = yyss + size - 1; - yyvsp = yyvs + size - 1; -#ifdef YYLSP_NEEDED - yylsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); -#endif - - if (yyssp >= yyss + yystacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Entering state %d\n", yystate); -#endif - - goto yybackup; - yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (yychar == YYEMPTY) - { -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Reading a token: "); -#endif - yychar = YYLEX; - } - - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ - { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - yychar1 = YYTRANSLATE(yychar); - -#if YYDEBUG != 0 - if (yydebug) - { - fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) - goto yydefault; - - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - yystate = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -yydefault: - - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (yydebug) - { - int i; - - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - - - switch (yyn) { - -case 5: -#line 277 "cgrammar.y" -{ uentry_clearDecl (); ; - break;} -case 6: -#line 278 "cgrammar.y" -{ uentry_clearDecl (); ; - break;} -case 7: -#line 279 "cgrammar.y" -{ uentry_clearDecl (); ; - break;} -case 8: -#line 280 "cgrammar.y" -{ uentry_clearDecl (); ; - break;} -case 9: -#line 281 "cgrammar.y" -{ uentry_clearDecl (); ; - break;} -case 10: -#line 282 "cgrammar.y" -{ uentry_checkDecl (); exprNode_free (yyvsp[0].expr); ; - break;} -case 11: -#line 283 "cgrammar.y" -{ uentry_clearDecl (); ; - break;} -case 12: -#line 287 "cgrammar.y" -{ checkConstant (yyvsp[-6].qtyp, yyvsp[-4].ntyp); ; - break;} -case 13: -#line 289 "cgrammar.y" -{ checkValueConstant (yyvsp[-9].qtyp, yyvsp[-7].ntyp, yyvsp[-3].expr) ; ; - break;} -case 14: -#line 292 "cgrammar.y" -{ context_enterFunctionDecl (); ; - break;} -case 15: -#line 293 "cgrammar.y" -{ declareStaticFunction (yyvsp[-2].ntyp); context_quietExitFunction (); - context_exitFunctionDecl (); ; - break;} -case 16: -#line 298 "cgrammar.y" -{ - qtype qint = qtype_create (ctype_int); - yyval.ntyp = idDecl_fixBase (yyvsp[0].ntyp, qint); - qtype_free (qint); - ; - break;} -case 17: -#line 304 "cgrammar.y" -{ yyval.ntyp = idDecl_fixBase (yyvsp[0].ntyp, yyvsp[-2].qtyp); ; - break;} -case 19: -#line 309 "cgrammar.y" -{ yyval.ntyp = yyvsp[0].ntyp; qtype_adjustPointers (yyvsp[-1].count, idDecl_getTyp (yyval.ntyp)); ; - break;} -case 20: -#line 312 "cgrammar.y" -{ yyval.ntyp = idDecl_create (yyvsp[0].cname, qtype_unknown ()); ; - break;} -case 21: -#line 314 "cgrammar.y" -{ yyval.ntyp = idDecl_expectFunction (yyvsp[-2].ntyp); ; - break;} -case 22: -#line 316 "cgrammar.y" -{ yyval.ntyp = idDecl_replaceCtype (yyvsp[-2].ntyp, ctype_makeArray (idDecl_getCtype (yyvsp[-2].ntyp))); ; - break;} -case 23: -#line 318 "cgrammar.y" -{ - yyval.ntyp = idDecl_replaceCtype (yyvsp[-5].ntyp, ctype_makeFixedArray (idDecl_getCtype (yyvsp[-5].ntyp), exprNode_getLongValue (yyvsp[-2].expr))); - ; - break;} -case 24: -#line 322 "cgrammar.y" -{ setCurrentParams (uentryList_missingParams); - ; - break;} -case 25: -#line 325 "cgrammar.y" -{ /* need to support globals and modifies here! */ - ctype ct = ctype_makeFunction (idDecl_getCtype (yyvsp[-6].ntyp), - uentryList_makeMissingParams ()); - - yyval.ntyp = idDecl_replaceCtype (yyvsp[-6].ntyp, ct); - context_popLoc (); - ; - break;} -case 26: -#line 333 "cgrammar.y" -{ setCurrentParams (yyvsp[-1].entrylist); - ; - break;} -case 27: -#line 336 "cgrammar.y" -{ clearCurrentParams (); - yyval.ntyp = idDecl_replaceCtype (yyvsp[-7].ntyp, ctype_makeFunction (idDecl_getCtype (yyvsp[-7].ntyp), yyvsp[-4].entrylist)); - context_popLoc (); - - // printf("Done nameDeclBase\n"); - ; - break;} -case 28: -#line 344 "cgrammar.y" -{ yyval.ntyp = idDecl_create (yyvsp[0].cname, qtype_unknown ()); ; - break;} -case 29: -#line 346 "cgrammar.y" -{ yyval.ntyp = idDecl_expectFunction (yyvsp[-2].ntyp); ; - break;} -case 30: -#line 348 "cgrammar.y" -{ yyval.ntyp = idDecl_replaceCtype (yyvsp[-2].ntyp, ctype_makeArray (idDecl_getCtype (yyvsp[-2].ntyp))); ; - break;} -case 31: -#line 350 "cgrammar.y" -{ - int value; - - if (exprNode_hasValue (yyvsp[-2].expr) - && multiVal_isInt (exprNode_getValue (yyvsp[-2].expr))) - { - value = (int) multiVal_forceInt (exprNode_getValue (yyvsp[-2].expr)); - } - else - { - value = 0; - } - - yyval.ntyp = idDecl_replaceCtype (yyvsp[-5].ntyp, ctype_makeFixedArray (idDecl_getCtype (yyvsp[-5].ntyp), value)); - ; - break;} -case 32: -#line 366 "cgrammar.y" -{ setCurrentParams (uentryList_missingParams); - ; - break;} -case 33: -#line 369 "cgrammar.y" -{ /* need to support globals and modifies here! */ - ctype ct = ctype_makeFunction (idDecl_getCtype (yyvsp[-5].ntyp), - uentryList_makeMissingParams ()); - - yyval.ntyp = idDecl_replaceCtype (yyvsp[-5].ntyp, ct); - context_popLoc (); - ; - break;} -case 34: -#line 377 "cgrammar.y" -{ setCurrentParams (yyvsp[-1].entrylist); - ; - break;} -case 35: -#line 380 "cgrammar.y" -{ clearCurrentParams (); - yyval.ntyp = idDecl_replaceCtype (yyvsp[-6].ntyp, ctype_makeFunction (idDecl_getCtype (yyvsp[-6].ntyp), yyvsp[-3].entrylist)); - context_popLoc (); - ; - break;} -case 36: -#line 387 "cgrammar.y" -{ setCurrentParams (yyvsp[-1].entrylist); ; - break;} -case 37: -#line 388 "cgrammar.y" -{ clearCurrentParams (); ; - break;} -case 38: -#line 389 "cgrammar.y" -{ declareCIter (yyvsp[-8].cname, yyvsp[-6].entrylist); ; - break;} -case 39: -#line 392 "cgrammar.y" -{ exprNode_checkMacroBody (yyvsp[-1].expr); ; - break;} -case 40: -#line 393 "cgrammar.y" -{ exprNode_checkIterBody (yyvsp[-1].expr); ; - break;} -case 41: -#line 394 "cgrammar.y" -{ exprNode_checkIterEnd (yyvsp[-1].expr); ; - break;} -case 42: -#line 395 "cgrammar.y" -{ exprChecks_checkEmptyMacroBody (); ; - break;} -case 43: -#line 398 "cgrammar.y" -{ declareFunction (yyvsp[0].ntyp); ; - break;} -case 44: -#line 401 "cgrammar.y" -{ setProcessingGlobMods (); ; - break;} -case 45: -#line 402 "cgrammar.y" -{ clearProcessingGlobMods (); ; - break;} -case 46: -#line 408 "cgrammar.y" -{ setProcessingGlobMods (); ; - break;} -case 47: -#line 409 "cgrammar.y" -{ clearProcessingGlobMods (); ; - break;} -case 49: -#line 417 "cgrammar.y" -{ - DPRINTF ( ("doing optGlobEnsuresConstraintsAux\n") ); -context_setProtectVars (); enterParamsTemp (); - sRef_setGlobalScopeSafe (); - -; - break;} -case 50: -#line 423 "cgrammar.y" -{ - setEnsuresConstraints (yyvsp[-1].conL); - exitParamsTemp (); - sRef_clearGlobalScopeSafe (); - context_releaseVars (); - DPRINTF (("done optGlobBufConstraintsAux\n"));; - break;} -case 52: -#line 433 "cgrammar.y" -{ - DPRINTF ( ("doing optGlobBufConstraintsAux\n") ); -context_setProtectVars (); enterParamsTemp (); - sRef_setGlobalScopeSafe (); - -; - break;} -case 53: -#line 439 "cgrammar.y" -{ - setFunctionConstraints (yyvsp[-1].conL); - exitParamsTemp (); - sRef_clearGlobalScopeSafe (); - context_releaseVars (); - DPRINTF (("done optGlobBufConstraintsAux\n"));; - break;} -case 55: -#line 448 "cgrammar.y" -{ yyval.conL = constraintList_add (yyvsp[0].conL, yyvsp[-1].con); ; - break;} -case 56: -#line 449 "cgrammar.y" -{constraintList c; c = constraintList_new(); c = constraintList_add (c, yyvsp[0].con); yyval.conL = c; - break;} -case 57: -#line 452 "cgrammar.y" -{ - yyval.con = makeConstraintParse3 (yyvsp[-3].conE, yyvsp[-2].tok, yyvsp[-1].conE); - DPRINTF(("Done BufConstraint1\n")); ; - break;} -case 64: -#line 467 "cgrammar.y" -{yyval.conE = constraintExpr_parseMakeUnaryOp (yyvsp[-3].tok, yyvsp[-1].conE); DPRINTF( ("Got BufConstraintExpr UNary Op ") ); ; - break;} -case 65: -#line 468 "cgrammar.y" -{ - DPRINTF( ("Got BufConstraintExpr BINary Op ") ); - yyval.conE = constraintExpr_parseMakeBinaryOp (yyvsp[-3].conE, yyvsp[-2].tok, yyvsp[-1].conE); ; - break;} -case 66: -#line 473 "cgrammar.y" -{ yyval.conE = constraintExpr_makeTermsRef(yyvsp[0].sr);; - break;} -case 67: -#line 474 "cgrammar.y" -{ char *t; int c; - t = cstring_toCharsSafe (exprNode_unparse(yyvsp[0].expr)); - c = atoi( t ); - yyval.conE = constraintExpr_makeIntLiteral (c); -; - break;} -case 68: -#line 482 "cgrammar.y" -{ - yyval.sr = - checkbufferConstraintClausesId (yyvsp[0].entry);; - break;} -case 69: -#line 485 "cgrammar.y" -{ yyval.sr = fixSpecClausesId (yyvsp[0].cname); ; - break;} -case 70: -#line 487 "cgrammar.y" -{ yyval.sr = sRef_makeAnyArrayFetch (yyvsp[-2].sr); ; - break;} -case 71: -#line 488 "cgrammar.y" -{ - char *t; int c; - t = cstring_toCharsSafe (exprNode_unparse(yyvsp[-1].expr)); - c = atoi( t ); - yyval.sr = sRef_makeArrayFetchKnown(yyvsp[-3].sr, c); ; - break;} -case 72: -#line 493 "cgrammar.y" -{ yyval.sr = sRef_constructPointer (yyvsp[0].sr); ; - break;} -case 73: -#line 494 "cgrammar.y" -{ yyval.sr = yyvsp[-1].sr; ; - break;} -case 74: -#line 495 "cgrammar.y" -{ cstring_markOwned (yyvsp[0].cname); - yyval.sr = sRef_buildField (yyvsp[-2].sr, yyvsp[0].cname); ; - break;} -case 75: -#line 497 "cgrammar.y" -{ cstring_markOwned (yyvsp[0].cname); - yyval.sr = sRef_makeArrow (yyvsp[-2].sr, yyvsp[0].cname); ; - break;} -case 79: -#line 523 "cgrammar.y" -{ setProcessingGlobMods (); ; - break;} -case 80: -#line 524 "cgrammar.y" -{ clearProcessingGlobMods (); ; - break;} -case 81: -#line 534 "cgrammar.y" -{ setProcessingGlobMods (); ; - break;} -case 82: -#line 535 "cgrammar.y" -{ clearProcessingGlobMods (); ; - break;} -case 89: -#line 550 "cgrammar.y" -{ ; ; - break;} -case 90: -#line 551 "cgrammar.y" -{ ; ; - break;} -case 91: -#line 554 "cgrammar.y" -{ globListAdd (yyvsp[0].sr, yyvsp[-1].tquallist); ; - break;} -case 92: -#line 557 "cgrammar.y" -{ yyval.sr = uentry_getSref (yyvsp[0].entry); ; - break;} -case 93: -#line 558 "cgrammar.y" -{ yyval.sr = globListUnrecognized (yyvsp[0].cname); ; - break;} -case 94: -#line 561 "cgrammar.y" -{ yyval.typequal = qual_createUndef (); ; - break;} -case 95: -#line 562 "cgrammar.y" -{ yyval.typequal = qual_createKilled (); ; - break;} -case 96: -#line 563 "cgrammar.y" -{ yyval.typequal = qual_createOut (); ; - break;} -case 97: -#line 564 "cgrammar.y" -{ yyval.typequal = qual_createIn (); ; - break;} -case 98: -#line 565 "cgrammar.y" -{ yyval.typequal = qual_createPartial (); ; - break;} -case 99: -#line 568 "cgrammar.y" -{ yyval.tquallist = qualList_undefined; ; - break;} -case 100: -#line 569 "cgrammar.y" -{ yyval.tquallist = qualList_add (yyvsp[0].tquallist, yyvsp[-1].typequal); ; - break;} -case 101: -#line 572 "cgrammar.y" -{ setProcessingGlobalsList (); ; - break;} -case 102: -#line 574 "cgrammar.y" -{ unsetProcessingGlobals (); ; - break;} -case 103: -#line 575 "cgrammar.y" -{ setProcessingGlobalsList (); ; - break;} -case 104: -#line 577 "cgrammar.y" -{ unsetProcessingGlobals (); ; - break;} -case 105: -#line 579 "cgrammar.y" -{ setFunctionNoGlobals (); - setFunctionModifies (sRefSet_single (sRef_makeNothing ())); - ; - break;} -case 108: -#line 586 "cgrammar.y" -{ setProcessingGlobalsList (); ; - break;} -case 109: -#line 588 "cgrammar.y" -{ unsetProcessingGlobals (); ; - break;} -case 110: -#line 589 "cgrammar.y" -{ setProcessingGlobalsList (); ; - break;} -case 111: -#line 591 "cgrammar.y" -{ unsetProcessingGlobals (); ; - break;} -case 112: -#line 593 "cgrammar.y" -{ setFunctionNoGlobals (); - setFunctionModifies (sRefSet_single (sRef_makeNothing ())); - ; - break;} -case 117: -#line 605 "cgrammar.y" -{ - context_setProtectVars (); enterParamsTemp (); - sRef_setGlobalScopeSafe (); - ; - break;} -case 118: -#line 610 "cgrammar.y" -{ - setFunctionModifies (yyvsp[0].srset); exitParamsTemp (); - sRef_clearGlobalScopeSafe (); - context_releaseVars (); - ; - break;} -case 119: -#line 618 "cgrammar.y" -{ - context_setProtectVars (); enterParamsTemp (); - sRef_setGlobalScopeSafe (); - ; - break;} -case 120: -#line 623 "cgrammar.y" -{ - setFunctionModifies (yyvsp[0].srset); exitParamsTemp (); - sRef_clearGlobalScopeSafe (); - context_releaseVars (); - ; - break;} -case 130: -#line 647 "cgrammar.y" -{ yyval.sck = SP_ISONLY; ; - break;} -case 131: -#line 648 "cgrammar.y" -{ yyval.sck = SP_ISOBSERVER; ; - break;} -case 132: -#line 649 "cgrammar.y" -{ yyval.sck = SP_ISEXPOSED; ; - break;} -case 133: -#line 650 "cgrammar.y" -{ yyval.sck = SP_ISDEPENDENT; ; - break;} -case 134: -#line 651 "cgrammar.y" -{ yyval.sck = SP_ISOWNED; ; - break;} -case 135: -#line 652 "cgrammar.y" -{ yyval.sck = SP_ISSHARED; ; - break;} -case 136: -#line 653 "cgrammar.y" -{ yyval.sck = SP_ISNULL; ; - break;} -case 137: -#line 654 "cgrammar.y" -{ yyval.sck = SP_ISNOTNULL; ; - break;} -case 138: -#line 658 "cgrammar.y" -{ - context_setProtectVars (); - enterParamsTemp (); - sRef_setGlobalScopeSafe (); - ; - break;} -case 139: -#line 664 "cgrammar.y" -{ - setFunctionSpecialClause (yyvsp[-6].tok, yyvsp[-3].srset, yyvsp[-1].tok); - exitParamsTemp (); - sRef_clearGlobalScopeSafe (); - context_releaseVars (); - ; - break;} -case 140: -#line 671 "cgrammar.y" -{ - context_setProtectVars (); - enterParamsTemp (); - sRef_setGlobalScopeSafe (); - ; - break;} -case 141: -#line 677 "cgrammar.y" -{ - setFunctionStateSpecialClause (yyvsp[-7].tok, yyvsp[-5].sck, yyvsp[-3].srset, yyvsp[-1].tok); - exitParamsTemp (); - sRef_clearGlobalScopeSafe (); - context_releaseVars (); - ; - break;} -case 142: -#line 686 "cgrammar.y" -{ - qtype qint = qtype_create (ctype_int); - yyval.ntyp = idDecl_fixBase (yyvsp[0].ntyp, qint); - qtype_free (qint); - ; - break;} -case 143: -#line 692 "cgrammar.y" -{ yyval.ntyp = idDecl_fixBase (yyvsp[0].ntyp, yyvsp[-2].qtyp); ; - break;} -case 144: -#line 695 "cgrammar.y" -{ checkDoneParams (); context_enterInnerContext (); ; - break;} -case 145: -#line 697 "cgrammar.y" -{ - exprNode_checkFunctionBody (yyvsp[0].expr); yyval.expr = yyvsp[0].expr; - context_exitInner (yyvsp[0].expr); - ; - break;} -case 146: -#line 702 "cgrammar.y" -{ doneParams (); context_enterInnerContext (); ; - break;} -case 147: -#line 704 "cgrammar.y" -{ - context_exitInner (yyvsp[0].expr); - exprNode_checkFunctionBody (yyvsp[0].expr); - yyval.expr = yyvsp[0].expr; /* old style */ - ; - break;} -case 148: -#line 712 "cgrammar.y" -{ - context_setFunctionDefined (exprNode_loc (yyvsp[0].expr)); - /* exprNode_checkFunction (context_getHeader (), $2); */ - /* DRL 8 8 2000 */ - - context_exitFunction (); - ; - break;} -case 149: -#line 721 "cgrammar.y" -{ yyval.srset = yyvsp[-2].srset; ; - break;} -case 150: -#line 722 "cgrammar.y" -{ yyval.srset = sRefSet_new (); ; - break;} -case 151: -#line 725 "cgrammar.y" -{ yyval.srset = yyvsp[-1].srset; ; - break;} -case 152: -#line 726 "cgrammar.y" -{ yyval.srset = sRefSet_new (); ; - break;} -case 153: -#line 729 "cgrammar.y" -{ yyval.sr = uentry_getSref (yyvsp[0].entry); checkModifiesId (yyvsp[0].entry); ; - break;} -case 154: -#line 730 "cgrammar.y" -{ yyval.sr = fixModifiesId (yyvsp[0].cname); ; - break;} -case 155: -#line 731 "cgrammar.y" -{ yyval.sr = modListArrayFetch (yyvsp[-2].sr, sRef_undefined); ; - break;} -case 156: -#line 732 "cgrammar.y" -{ yyval.sr = modListArrayFetch (yyvsp[-3].sr, yyvsp[-1].sr); ; - break;} -case 157: -#line 733 "cgrammar.y" -{ yyval.sr = modListPointer (yyvsp[0].sr); ; - break;} -case 158: -#line 734 "cgrammar.y" -{ yyval.sr = yyvsp[-1].sr; ; - break;} -case 159: -#line 735 "cgrammar.y" -{ yyval.sr = modListFieldAccess (yyvsp[-2].sr, yyvsp[0].cname); ; - break;} -case 160: -#line 736 "cgrammar.y" -{ yyval.sr = modListArrowAccess (yyvsp[-2].sr, yyvsp[0].cname); ; - break;} -case 161: -#line 740 "cgrammar.y" -{ yyval.sr = yyvsp[0].sr; ; - break;} -case 162: -#line 741 "cgrammar.y" -{ yyval.sr = sRef_makeUnknown (); /* sRef_makeConstant ($1); ? */ ; - break;} -case 163: -#line 745 "cgrammar.y" -{ yyval.srset = sRefSet_single (yyvsp[0].sr); ; - break;} -case 164: -#line 746 "cgrammar.y" -{ yyval.srset = sRefSet_insert (yyvsp[-2].srset, yyvsp[0].sr); ; - break;} -case 165: -#line 750 "cgrammar.y" -{ yyval.sr = checkSpecClausesId (yyvsp[0].entry); ; - break;} -case 166: -#line 752 "cgrammar.y" -{ yyval.sr = fixSpecClausesId (yyvsp[0].cname); ; - break;} -case 167: -#line 753 "cgrammar.y" -{ yyval.sr = sRef_makeAnyArrayFetch (yyvsp[-2].sr); ; - break;} -case 168: -#line 754 "cgrammar.y" -{ yyval.sr = sRef_makeAnyArrayFetch (yyvsp[-3].sr); ; - break;} -case 169: -#line 755 "cgrammar.y" -{ yyval.sr = sRef_constructPointer (yyvsp[0].sr); ; - break;} -case 170: -#line 756 "cgrammar.y" -{ yyval.sr = yyvsp[-1].sr; ; - break;} -case 171: -#line 757 "cgrammar.y" -{ cstring_markOwned (yyvsp[0].cname); - yyval.sr = sRef_buildField (yyvsp[-2].sr, yyvsp[0].cname); ; - break;} -case 172: -#line 759 "cgrammar.y" -{ cstring_markOwned (yyvsp[0].cname); - yyval.sr = sRef_makeArrow (yyvsp[-2].sr, yyvsp[0].cname); ; - break;} -case 173: -#line 764 "cgrammar.y" -{ if (sRef_isValid (yyvsp[0].sr)) { yyval.srset = sRefSet_single (yyvsp[0].sr); } - else { yyval.srset = sRefSet_undefined; } - ; - break;} -case 174: -#line 768 "cgrammar.y" -{ if (sRef_isValid (yyvsp[0].sr)) - { - yyval.srset = sRefSet_insert (yyvsp[-2].srset, yyvsp[0].sr); - } - else - { - yyval.srset = yyvsp[-2].srset; - } - ; - break;} -case 175: -#line 779 "cgrammar.y" -{ yyval.expr = exprNode_fromIdentifier (yyvsp[0].entry); ; - break;} -case 176: -#line 780 "cgrammar.y" -{ yyval.expr = exprNode_fromUIO (yyvsp[0].cname); ; - break;} -case 177: -#line 781 "cgrammar.y" -{ yyval.expr = yyvsp[0].expr; ; - break;} -case 178: -#line 782 "cgrammar.y" -{ yyval.expr = exprNode_addParens (yyvsp[-2].tok, yyvsp[-1].expr); ; - break;} -case 179: -#line 783 "cgrammar.y" -{ yyval.expr = exprNode_fromIdentifier (coerceId (yyvsp[0].cname)); ; - break;} -case 180: -#line 784 "cgrammar.y" -{ yyval.expr = exprNode_makeError (); ; - break;} -case 182: -#line 788 "cgrammar.y" -{ yyval.expr = exprNode_arrayFetch (yyvsp[-3].expr, yyvsp[-1].expr); ; - break;} -case 183: -#line 789 "cgrammar.y" -{ yyval.expr = exprNode_functionCall (yyvsp[-2].expr, exprNodeList_new ()); ; - break;} -case 184: -#line 790 "cgrammar.y" -{ yyval.expr = exprNode_functionCall (yyvsp[-3].expr, yyvsp[-1].alist); ; - break;} -case 185: -#line 791 "cgrammar.y" -{ yyval.expr = exprNode_vaArg (yyvsp[-5].tok, yyvsp[-3].expr, yyvsp[-1].qtyp); ; - break;} -case 186: -#line 792 "cgrammar.y" -{ yyval.expr = exprNode_fieldAccess (yyvsp[-4].expr, yyvsp[-1].cname); ; - break;} -case 187: -#line 793 "cgrammar.y" -{ yyval.expr = exprNode_arrowAccess (yyvsp[-4].expr, yyvsp[-1].cname); ; - break;} -case 188: -#line 794 "cgrammar.y" -{ yyval.expr = exprNode_postOp (yyvsp[-1].expr, yyvsp[0].tok); ; - break;} -case 189: -#line 795 "cgrammar.y" -{ yyval.expr = exprNode_postOp (yyvsp[-1].expr, yyvsp[0].tok); ; - break;} -case 190: -#line 798 "cgrammar.y" -{ yyval.alist = exprNodeList_singleton (yyvsp[0].expr); ; - break;} -case 191: -#line 799 "cgrammar.y" -{ yyval.alist = exprNodeList_push (yyvsp[-2].alist, yyvsp[0].expr); ; - break;} -case 193: -#line 803 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 194: -#line 804 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 195: -#line 805 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 196: -#line 806 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 197: -#line 807 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 198: -#line 808 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 199: -#line 809 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 200: -#line 810 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 201: -#line 811 "cgrammar.y" -{ yyval.expr = yyvsp[0].expr; ; - break;} -case 202: -#line 812 "cgrammar.y" -{ yyval.expr = yyvsp[0].expr; ; - break;} -case 203: -#line 815 "cgrammar.y" -{ yyval.cstringlist = cstringList_add (yyvsp[-2].cstringlist, yyvsp[0].cname); ; - break;} -case 204: -#line 816 "cgrammar.y" -{ yyval.cstringlist = cstringList_single (yyvsp[0].cname); ; - break;} -case 205: -#line 820 "cgrammar.y" -{ yyval.expr = exprNode_offsetof (yyvsp[-5].qtyp, yyvsp[-2].cstringlist); ; - break;} -case 206: -#line 823 "cgrammar.y" -{ context_setProtectVars (); ; - break;} -case 207: -#line 824 "cgrammar.y" -{ context_sizeofReleaseVars (); yyval.expr = yyvsp[0].expr; ; - break;} -case 208: -#line 827 "cgrammar.y" -{ yyval.expr = exprNode_sizeofType (yyvsp[-1].qtyp); ; - break;} -case 209: -#line 828 "cgrammar.y" -{ yyval.expr = exprNode_sizeofExpr (yyvsp[0].expr); ; - break;} -case 210: -#line 829 "cgrammar.y" -{ yyval.expr = exprNode_alignofType (yyvsp[-1].qtyp); ; - break;} -case 211: -#line 830 "cgrammar.y" -{ yyval.expr = exprNode_alignofExpr (yyvsp[0].expr); ; - break;} -case 213: -#line 835 "cgrammar.y" -{ yyval.expr = exprNode_cast (yyvsp[-3].tok, yyvsp[0].expr, yyvsp[-2].qtyp); ; - break;} -case 215: -#line 839 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 216: -#line 840 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 217: -#line 841 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 219: -#line 845 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 220: -#line 846 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 222: -#line 850 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 223: -#line 851 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 225: -#line 855 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 226: -#line 856 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 227: -#line 857 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 228: -#line 858 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 230: -#line 862 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 231: -#line 863 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 233: -#line 867 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 235: -#line 871 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 237: -#line 876 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 239: -#line 881 "cgrammar.y" -{ exprNode_produceGuards (yyvsp[-1].expr); - context_enterAndClause (yyvsp[-1].expr); - ; - break;} -case 240: -#line 885 "cgrammar.y" -{ - yyval.expr = exprNode_op (yyvsp[-3].expr, yyvsp[0].expr, yyvsp[-2].tok); - context_exitAndClause (yyval.expr, yyvsp[0].expr); - ; - break;} -case 242: -#line 893 "cgrammar.y" -{ - exprNode_produceGuards (yyvsp[-1].expr); - context_enterOrClause (yyvsp[-1].expr); - ; - break;} -case 243: -#line 898 "cgrammar.y" -{ - yyval.expr = exprNode_op (yyvsp[-3].expr, yyvsp[0].expr, yyvsp[-2].tok); - context_exitOrClause (yyval.expr, yyvsp[0].expr); - ; - break;} -case 245: -#line 905 "cgrammar.y" -{ exprNode_produceGuards (yyvsp[-1].expr); context_enterTrueClause (yyvsp[-1].expr); ; - break;} -case 246: -#line 906 "cgrammar.y" -{ context_enterFalseClause (yyvsp[-4].expr); ; - break;} -case 247: -#line 907 "cgrammar.y" -{ yyval.expr = exprNode_cond (yyvsp[-6].expr, yyvsp[-3].expr, yyvsp[0].expr); context_exitClause (yyvsp[-6].expr, yyvsp[-3].expr, yyvsp[0].expr); ; - break;} -case 249: -#line 911 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 250: -#line 912 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 251: -#line 913 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 252: -#line 914 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 253: -#line 915 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 254: -#line 916 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 255: -#line 917 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 256: -#line 918 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 257: -#line 919 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 258: -#line 920 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 259: -#line 921 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 261: -#line 925 "cgrammar.y" -{ yyval.expr = exprNode_comma (yyvsp[-2].expr, yyvsp[0].expr); ; - break;} -case 262: -#line 928 "cgrammar.y" -{ yyval.expr = exprNode_undefined; ; - break;} -case 265: -#line 937 "cgrammar.y" -{ yyval.expr = yyvsp[0].expr; ; - break;} -case 266: -#line 938 "cgrammar.y" -{ doVaDcl (); yyval.expr = exprNode_makeError (); ; - break;} -case 267: -#line 939 "cgrammar.y" -{ yyval.expr = exprNode_makeError (); ; - break;} -case 268: -#line 942 "cgrammar.y" -{ yyval.expr = exprNode_makeError (); ; - break;} -case 269: -#line 956 "cgrammar.y" -{ - setProcessingVars (yyvsp[-3].qtyp); - processNamedDecl (yyvsp[-1].ntyp); ; - break;} -case 270: -#line 959 "cgrammar.y" -{ unsetProcessingVars (); yyval.expr = yyvsp[-2].expr; ; - break;} -case 271: -#line 961 "cgrammar.y" -{ setProcessingVars (yyvsp[-4].qtyp); processNamedDecl (yyvsp[-2].ntyp); - ; - break;} -case 272: -#line 964 "cgrammar.y" -{ yyval.expr = exprNode_concat (yyvsp[-2].expr, exprNode_makeInitialization (yyvsp[-8].ntyp, yyvsp[-3].expr)); - unsetProcessingVars (); - ; - break;} -case 273: -#line 968 "cgrammar.y" -{ processNamedDecl (yyvsp[-1].ntyp); yyval.expr = exprNode_makeError (); ; - break;} -case 274: -#line 969 "cgrammar.y" -{ processNamedDecl (yyvsp[-2].ntyp); ; - break;} -case 275: -#line 970 "cgrammar.y" -{ yyval.expr = exprNode_makeInitialization (yyvsp[-5].ntyp, yyvsp[0].expr); ; - break;} -case 276: -#line 974 "cgrammar.y" -{ setProcessingTypedef (yyvsp[0].qtyp); ; - break;} -case 277: -#line 975 "cgrammar.y" -{ unsetProcessingTypedef (); ; - break;} -case 278: -#line 976 "cgrammar.y" -{ /* in the ANSI grammar, semantics unclear */ ; - break;} -case 279: -#line 977 "cgrammar.y" -{ /* in the ANSI grammar, semantics unclear */ ; - break;} -case 280: -#line 980 "cgrammar.y" -{ g_expectingTypeName = TRUE; ; - break;} -case 281: -#line 983 "cgrammar.y" -{ g_expectingTypeName = TRUE; context_pushLoc (); ; - break;} -case 282: -#line 986 "cgrammar.y" -{ ; ; - break;} -case 283: -#line 989 "cgrammar.y" -{ ; ; - break;} -case 284: -#line 990 "cgrammar.y" -{ ; ; - break;} -case 285: -#line 993 "cgrammar.y" -{ yyval.expr = exprNode_makeError (); ; - break;} -case 286: -#line 994 "cgrammar.y" -{ yyval.expr = exprNode_concat (yyvsp[-3].expr, yyvsp[0].expr); ; - break;} -case 287: -#line 997 "cgrammar.y" -{ yyval.expr = yyvsp[0].expr; ; - break;} -case 288: -#line 998 "cgrammar.y" -{ yyval.expr = exprNode_makeInitBlock (yyvsp[-2].tok, yyvsp[-1].alist); ; - break;} -case 289: -#line 999 "cgrammar.y" -{ yyval.expr = exprNode_makeInitBlock (yyvsp[-3].tok, yyvsp[-2].alist); ; - break;} -case 290: -#line 1004 "cgrammar.y" -{ yyval.alist = exprNodeList_singleton (yyvsp[0].expr); ; - break;} -case 291: -#line 1006 "cgrammar.y" -{ yyval.alist = exprNodeList_push (yyvsp[-2].alist, yyvsp[0].expr); ; - break;} -case 292: -#line 1014 "cgrammar.y" -{ setStorageClass (SCEXTERN); yyval.typequal = qual_createExtern (); ; - break;} -case 293: -#line 1015 "cgrammar.y" -{ yyval.typequal = qual_createInline (); ; - break;} -case 294: -#line 1016 "cgrammar.y" -{ setStorageClass (SCSTATIC); yyval.typequal = qual_createStatic (); ; - break;} -case 295: -#line 1017 "cgrammar.y" -{ yyval.typequal = qual_createAuto (); ; - break;} -case 296: -#line 1018 "cgrammar.y" -{ yyval.typequal = qual_createRegister (); ; - break;} -case 297: -#line 1021 "cgrammar.y" -{ yyval.typequal = qual_createConst (); ; - break;} -case 298: -#line 1022 "cgrammar.y" -{ yyval.typequal = qual_createVolatile (); ; - break;} -case 299: -#line 1023 "cgrammar.y" -{ yyval.typequal = qual_createOut (); ; - break;} -case 300: -#line 1024 "cgrammar.y" -{ yyval.typequal = qual_createIn (); ; - break;} -case 301: -#line 1025 "cgrammar.y" -{ yyval.typequal = qual_createPartial (); ; - break;} -case 302: -#line 1026 "cgrammar.y" -{ yyval.typequal = qual_createSpecial (); ; - break;} -case 303: -#line 1027 "cgrammar.y" -{ yyval.typequal = qual_createOwned (); ; - break;} -case 304: -#line 1028 "cgrammar.y" -{ yyval.typequal = qual_createDependent (); ; - break;} -case 305: -#line 1029 "cgrammar.y" -{ yyval.typequal = qual_createYield (); ; - break;} -case 306: -#line 1030 "cgrammar.y" -{ yyval.typequal = qual_createTemp (); ; - break;} -case 307: -#line 1031 "cgrammar.y" -{ yyval.typequal = qual_createOnly (); ; - break;} -case 308: -#line 1032 "cgrammar.y" -{ yyval.typequal = qual_createKeep (); ; - break;} -case 309: -#line 1033 "cgrammar.y" -{ yyval.typequal = qual_createKept (); ; - break;} -case 310: -#line 1034 "cgrammar.y" -{ yyval.typequal = qual_createShared (); ; - break;} -case 311: -#line 1035 "cgrammar.y" -{ yyval.typequal = qual_createUnique (); ; - break;} -case 312: -#line 1036 "cgrammar.y" -{ yyval.typequal = qual_createExits (); ; - break;} -case 313: -#line 1037 "cgrammar.y" -{ yyval.typequal = qual_createMayExit (); ; - break;} -case 314: -#line 1038 "cgrammar.y" -{ yyval.typequal = qual_createTrueExit (); ; - break;} -case 315: -#line 1039 "cgrammar.y" -{ yyval.typequal = qual_createFalseExit (); ; - break;} -case 316: -#line 1040 "cgrammar.y" -{ yyval.typequal = qual_createNeverExit (); ; - break;} -case 317: -#line 1041 "cgrammar.y" -{ yyval.typequal = qual_createNull (); ; - break;} -case 318: -#line 1042 "cgrammar.y" -{ yyval.typequal = qual_createRelNull (); ; - break;} -case 319: -#line 1043 "cgrammar.y" -{ yyval.typequal = qual_createReturned (); ; - break;} -case 320: -#line 1044 "cgrammar.y" -{ yyval.typequal = qual_createExposed (); ; - break;} -case 321: -#line 1045 "cgrammar.y" -{ yyval.typequal = qual_createObserver (); ; - break;} -case 322: -#line 1046 "cgrammar.y" -{ yyval.typequal = qual_createChecked (); ; - break;} -case 323: -#line 1047 "cgrammar.y" -{ yyval.typequal = qual_createCheckMod (); ; - break;} -case 324: -#line 1048 "cgrammar.y" -{ yyval.typequal = qual_createUnchecked (); ; - break;} -case 325: -#line 1049 "cgrammar.y" -{ yyval.typequal = qual_createCheckedStrict (); ; - break;} -case 326: -#line 1050 "cgrammar.y" -{ yyval.typequal = qual_createTrueNull (); ; - break;} -case 327: -#line 1051 "cgrammar.y" -{ yyval.typequal = qual_createFalseNull (); ; - break;} -case 328: -#line 1052 "cgrammar.y" -{ yyval.typequal = qual_createUnused (); ; - break;} -case 329: -#line 1053 "cgrammar.y" -{ yyval.typequal = qual_createExternal (); ; - break;} -case 330: -#line 1054 "cgrammar.y" -{ yyval.typequal = qual_createSef (); ; - break;} -case 331: -#line 1055 "cgrammar.y" -{ yyval.typequal = qual_createAbstract (); ; - break;} -case 332: -#line 1056 "cgrammar.y" -{ yyval.typequal = qual_createConcrete (); ; - break;} -case 333: -#line 1057 "cgrammar.y" -{ yyval.typequal = qual_createMutable (); ; - break;} -case 334: -#line 1058 "cgrammar.y" -{ yyval.typequal = qual_createImmutable (); ; - break;} -case 335: -#line 1059 "cgrammar.y" -{ yyval.typequal = qual_createNotNull (); ; - break;} -case 336: -#line 1060 "cgrammar.y" -{ yyval.typequal = qual_createRefCounted (); ; - break;} -case 337: -#line 1061 "cgrammar.y" -{ yyval.typequal = qual_createRefs (); ; - break;} -case 338: -#line 1062 "cgrammar.y" -{ yyval.typequal = qual_createKillRef (); ; - break;} -case 339: -#line 1063 "cgrammar.y" -{ yyval.typequal = qual_createRelDef (); ; - break;} -case 340: -#line 1064 "cgrammar.y" -{ yyval.typequal = qual_createNewRef (); ; - break;} -case 341: -#line 1065 "cgrammar.y" -{ yyval.typequal = qual_createTempRef (); ; - break;} -case 342: -#line 1066 "cgrammar.y" -{ yyval.typequal = qual_createNullTerminated (); ; - break;} -case 343: -#line 1072 "cgrammar.y" -{ yyval.typequal = qual_createShort (); ; - break;} -case 344: -#line 1073 "cgrammar.y" -{ yyval.typequal = qual_createLong (); ; - break;} -case 345: -#line 1074 "cgrammar.y" -{ yyval.typequal = qual_createSigned (); ; - break;} -case 346: -#line 1075 "cgrammar.y" -{ yyval.typequal = qual_createUnsigned (); ; - break;} -case 353: -#line 1084 "cgrammar.y" -{ yyval.ctyp = ctype_unknown; ; - break;} -case 354: -#line 1085 "cgrammar.y" -{ yyval.ctyp = ctype_anyintegral; ; - break;} -case 355: -#line 1086 "cgrammar.y" -{ yyval.ctyp = ctype_unsignedintegral; ; - break;} -case 356: -#line 1087 "cgrammar.y" -{ yyval.ctyp = ctype_signedintegral; ; - break;} -case 360: -#line 1091 "cgrammar.y" -{ yyval.ctyp = ctype_fromQual (yyvsp[-1].typequal); ; - break;} -case 361: -#line 1095 "cgrammar.y" -{ yyval.qtyp = qtype_resolve (yyvsp[-1].qtyp); ; - break;} -case 362: -#line 1098 "cgrammar.y" -{ yyval.qtyp = yyvsp[0].qtyp; ; - break;} -case 363: -#line 1100 "cgrammar.y" -{ yyval.qtyp = qtype_mergeAlt (yyvsp[-3].qtyp, yyvsp[-1].qtyp); ; - break;} -case 365: -#line 1105 "cgrammar.y" -{ yyval.qtyp = qtype_mergeAlt (yyvsp[-2].qtyp, yyvsp[0].qtyp); ; - break;} -case 366: -#line 1108 "cgrammar.y" -{ yyval.qtyp = qtype_addQual (yyvsp[0].qtyp, yyvsp[-1].typequal); ; - break;} -case 367: -#line 1109 "cgrammar.y" -{ yyval.qtyp = qtype_addQual (yyvsp[0].qtyp, yyvsp[-1].typequal); ; - break;} -case 368: -#line 1110 "cgrammar.y" -{ yyval.qtyp = qtype_combine (yyvsp[0].qtyp, yyvsp[-1].ctyp); ; - break;} -case 369: -#line 1113 "cgrammar.y" -{ yyval.qtyp = qtype_unknown (); ; - break;} -case 370: -#line 1114 "cgrammar.y" -{ yyval.qtyp = yyvsp[0].qtyp; ; - break;} -case 371: -#line 1117 "cgrammar.y" -{ sRef_setGlobalScopeSafe (); ; - break;} -case 372: -#line 1119 "cgrammar.y" -{ sRef_clearGlobalScopeSafe (); ; - break;} -case 373: -#line 1121 "cgrammar.y" -{ yyval.ctyp = declareStruct (yyvsp[-8].cname, yyvsp[-3].flist); ; - break;} -case 374: -#line 1122 "cgrammar.y" -{ sRef_setGlobalScopeSafe (); ; - break;} -case 375: -#line 1124 "cgrammar.y" -{ sRef_clearGlobalScopeSafe (); ; - break;} -case 376: -#line 1126 "cgrammar.y" -{ yyval.ctyp = declareUnion (yyvsp[-8].cname, yyvsp[-3].flist); ; - break;} -case 377: -#line 1128 "cgrammar.y" -{ yyval.ctyp = declareStruct (yyvsp[-3].cname, uentryList_new ()); ; - break;} -case 378: -#line 1130 "cgrammar.y" -{ yyval.ctyp = declareUnion (yyvsp[-3].cname, uentryList_new ()); ; - break;} -case 379: -#line 1131 "cgrammar.y" -{ sRef_setGlobalScopeSafe (); ; - break;} -case 380: -#line 1133 "cgrammar.y" -{ sRef_clearGlobalScopeSafe (); ; - break;} -case 381: -#line 1135 "cgrammar.y" -{ yyval.ctyp = declareUnnamedStruct (yyvsp[-3].flist); ; - break;} -case 382: -#line 1136 "cgrammar.y" -{ sRef_setGlobalScopeSafe (); ; - break;} -case 383: -#line 1138 "cgrammar.y" -{ sRef_clearGlobalScopeSafe (); ; - break;} -case 384: -#line 1140 "cgrammar.y" -{ yyval.ctyp = declareUnnamedUnion (yyvsp[-3].flist); ; - break;} -case 385: -#line 1142 "cgrammar.y" -{ yyval.ctyp = ctype_createUnnamedStruct (uentryList_new ()); ; - break;} -case 386: -#line 1144 "cgrammar.y" -{ yyval.ctyp = ctype_createUnnamedUnion (uentryList_new ()); ; - break;} -case 387: -#line 1145 "cgrammar.y" -{ yyval.ctyp = handleStruct (yyvsp[-1].cname); ; - break;} -case 388: -#line 1146 "cgrammar.y" -{ yyval.ctyp = handleUnion (yyvsp[-1].cname); ; - break;} -case 389: -#line 1149 "cgrammar.y" -{ g_expectingTypeName = FALSE; ; - break;} -case 391: -#line 1153 "cgrammar.y" -{ yyval.flist = uentryList_undefined; /* bogus! */ ; - break;} -case 392: -#line 1154 "cgrammar.y" -{ yyval.flist = uentryList_mergeFields (yyvsp[-1].flist, yyvsp[0].flist); ; - break;} -case 393: -#line 1158 "cgrammar.y" -{ yyval.flist = fixUentryList (yyvsp[-2].ntyplist, yyvsp[-4].qtyp); ; - break;} -case 394: -#line 1160 "cgrammar.y" -{ yyval.flist = fixUnnamedDecl (yyvsp[-2].qtyp); ; - break;} -case 395: -#line 1164 "cgrammar.y" -{ yyval.ntyplist = idDeclList_singleton (yyvsp[-1].ntyp); ; - break;} -case 396: -#line 1166 "cgrammar.y" -{ yyval.ntyplist = idDeclList_add (yyvsp[-3].ntyplist, yyvsp[-1].ntyp); ; - break;} -case 397: -#line 1169 "cgrammar.y" -{ yyval.ntyp = yyvsp[0].ntyp; ; - break;} -case 398: -#line 1170 "cgrammar.y" -{ yyval.ntyp = idDecl_undefined; ; - break;} -case 399: -#line 1171 "cgrammar.y" -{ yyval.ntyp = yyvsp[-3].ntyp; ; - break;} -case 400: -#line 1176 "cgrammar.y" -{ yyval.ctyp = declareUnnamedEnum (yyvsp[-2].enumnamelist); ; - break;} -case 401: -#line 1177 "cgrammar.y" -{ context_pushLoc (); ; - break;} -case 402: -#line 1178 "cgrammar.y" -{ context_popLoc (); yyval.ctyp = declareEnum (yyvsp[-5].cname, yyvsp[-2].enumnamelist); ; - break;} -case 403: -#line 1179 "cgrammar.y" -{ yyval.ctyp = handleEnum (yyvsp[-1].cname); ; - break;} -case 404: -#line 1183 "cgrammar.y" -{ yyval.enumnamelist = enumNameList_single (yyvsp[0].cname); ; - break;} -case 405: -#line 1185 "cgrammar.y" -{ yyval.enumnamelist = enumNameList_push (yyvsp[-2].enumnamelist, yyvsp[0].cname); ; - break;} -case 407: -#line 1190 "cgrammar.y" -{ uentry ue = uentry_makeEnumConstant (yyvsp[0].cname, ctype_unknown); - usymtab_supGlobalEntry (ue); - yyval.cname = yyvsp[0].cname; - ; - break;} -case 408: -#line 1195 "cgrammar.y" -{ uentry ue = uentry_makeEnumInitializedConstant (yyvsp[-3].cname, ctype_unknown, yyvsp[0].expr); - usymtab_supGlobalEntry (ue); - yyval.cname = yyvsp[-3].cname; - ; - break;} -case 410: -#line 1202 "cgrammar.y" -{ yyval.ntyp = idDecl_create (cstring_undefined, qtype_create (yyvsp[0].ctyp)); ; - break;} -case 411: -#line 1204 "cgrammar.y" -{ - qtype qt = qtype_unknown (); - - qtype_adjustPointers (yyvsp[-1].count, qt); - yyval.ntyp = idDecl_create (cstring_copy (LastIdentifier ()), qt); - ; - break;} -case 412: -#line 1211 "cgrammar.y" -{ yyval.ntyp = yyvsp[0].ntyp; qtype_adjustPointers (yyvsp[-1].count, idDecl_getTyp (yyval.ntyp)); ; - break;} -case 414: -#line 1216 "cgrammar.y" -{ yyval.ntyp = yyvsp[0].ntyp; qtype_adjustPointers (yyvsp[-1].count, idDecl_getTyp (yyval.ntyp)); ; - break;} -case 415: -#line 1219 "cgrammar.y" -{ yyval.entrylist = handleParamTypeList (yyvsp[0].entrylist); ; - break;} -case 416: -#line 1220 "cgrammar.y" -{ yyval.entrylist = handleParamIdList (yyvsp[0].entrylist); ; - break;} -case 417: -#line 1223 "cgrammar.y" -{ /* ignored for now */; ; - break;} -case 418: -#line 1224 "cgrammar.y" -{ ; ; - break;} -case 419: -#line 1227 "cgrammar.y" -{ ; ; - break;} -case 420: -#line 1228 "cgrammar.y" -{ ; ; - break;} -case 421: -#line 1231 "cgrammar.y" -{ yyval.count = 1; ; - break;} -case 422: -#line 1232 "cgrammar.y" -{ yyval.count = 1; ; - break;} -case 423: -#line 1233 "cgrammar.y" -{ yyval.count = 1 + yyvsp[0].count; ; - break;} -case 424: -#line 1234 "cgrammar.y" -{ yyval.count = 1 + yyvsp[0].count; ; - break;} -case 426: -#line 1238 "cgrammar.y" -{ yyval.entrylist = uentryList_add (yyvsp[-2].entrylist, uentry_makeElipsisMarker ()); ; - break;} -case 427: -#line 1241 "cgrammar.y" -{ yyval.entrylist = uentryList_single (uentry_makeVariableLoc (yyvsp[0].cname, ctype_int)); ; - break;} -case 428: -#line 1242 "cgrammar.y" -{ yyval.entrylist = uentryList_add (yyvsp[-2].entrylist, uentry_makeVariableLoc (yyvsp[0].cname, ctype_int)); ; - break;} -case 429: -#line 1245 "cgrammar.y" -{ yyval.entrylist = uentryList_single (uentry_makeElipsisMarker ()); ; - break;} -case 431: -#line 1247 "cgrammar.y" -{ yyval.entrylist = uentryList_add (yyvsp[-2].entrylist, uentry_makeElipsisMarker ()); ; - break;} -case 432: -#line 1250 "cgrammar.y" -{ storeLoc (); ; - break;} -case 433: -#line 1250 "cgrammar.y" -{ yyval.entrylist = uentryList_single (yyvsp[0].oentry); ; - break;} -case 434: -#line 1251 "cgrammar.y" -{ storeLoc (); ; - break;} -case 435: -#line 1252 "cgrammar.y" -{ yyval.entrylist = uentryList_add (yyvsp[-3].entrylist, yyvsp[0].oentry); ; - break;} -case 436: -#line 1256 "cgrammar.y" -{ - if (isFlipOldStyle ()) - { - llparseerror (cstring_makeLiteral ("Inconsistent function parameter syntax (mixing old and new style declaration)")); - } - else - { - setNewStyle (); - } - yyval.oentry = makeCurrentParam (idDecl_fixParamBase (yyvsp[-1].ntyp, yyvsp[-2].qtyp)); - ; - break;} -case 437: -#line 1268 "cgrammar.y" -{ - idDecl tparam = idDecl_create (yyvsp[0].cname, qtype_unknown ()); - - if (isNewStyle ()) - { - llparseerror (message ("Inconsistent function parameter syntax: %q", - idDecl_unparse (tparam))); - } - - setFlipOldStyle (); - yyval.oentry = makeCurrentParam (tparam); - idDecl_free (tparam); - ; - break;} -case 439: -#line 1284 "cgrammar.y" -{ yyval.qtyp = qtype_newBase (yyvsp[-1].qtyp, yyvsp[0].ctyp); ; - break;} -case 440: -#line 1287 "cgrammar.y" -{ yyval.ctyp = ctype_adjustPointers (yyvsp[0].count, ctype_unknown); ; - break;} -case 442: -#line 1289 "cgrammar.y" -{ yyval.ctyp = ctype_adjustPointers (yyvsp[-1].count, yyvsp[0].ctyp); ; - break;} -case 443: -#line 1292 "cgrammar.y" -{ yyval.ctyp = ctype_unknown; ; - break;} -case 445: -#line 1297 "cgrammar.y" -{ yyval.ctyp = ctype_expectFunction (yyvsp[-1].ctyp); ; - break;} -case 446: -#line 1298 "cgrammar.y" -{ yyval.ctyp = ctype_makeArray (ctype_unknown); ; - break;} -case 447: -#line 1300 "cgrammar.y" -{ yyval.ctyp = ctype_makeFixedArray (ctype_unknown, exprNode_getLongValue (yyvsp[-1].expr)); ; - break;} -case 448: -#line 1301 "cgrammar.y" -{ yyval.ctyp = ctype_makeArray (yyvsp[-2].ctyp); ; - break;} -case 449: -#line 1303 "cgrammar.y" -{ yyval.ctyp = ctype_makeFixedArray (yyvsp[-3].ctyp, exprNode_getLongValue (yyvsp[-1].expr)); ; - break;} -case 450: -#line 1305 "cgrammar.y" -{ yyval.ctyp = ctype_makeFunction (ctype_unknown, uentryList_makeMissingParams ()); ; - break;} -case 451: -#line 1307 "cgrammar.y" -{ yyval.ctyp = ctype_makeParamsFunction (ctype_unknown, yyvsp[-1].entrylist); ; - break;} -case 452: -#line 1309 "cgrammar.y" -{ yyval.ctyp = ctype_makeFunction (yyvsp[-3].ctyp, uentryList_makeMissingParams ()); ; - break;} -case 453: -#line 1311 "cgrammar.y" -{ yyval.ctyp = ctype_makeParamsFunction (yyvsp[-4].ctyp, yyvsp[-1].entrylist); ; - break;} -case 463: -#line 1326 "cgrammar.y" -{yyval.expr = yyvsp[0].expr; printf ("Doing stmt lclintassertion\n"); ; - break;} -case 464: -#line 1330 "cgrammar.y" -{ printf(" QSETBUFFERSIZE id CCONSTANT HEllo World\n"); uentry_setBufferSize(yyvsp[-2].entry, yyvsp[-1].expr); yyval.expr = exprNode_createTok (yyvsp[0].tok); - ; - break;} -case 465: -#line 1332 "cgrammar.y" -{ printf(" QSETSTRINGLENGTH id CCONSTANT HEllo World\n"); uentry_setStringLength(yyvsp[-2].entry, yyvsp[-1].expr); yyval.expr = exprNode_createTok (yyvsp[0].tok); - ; - break;} -case 466: -#line 1334 "cgrammar.y" -{printf(" QTESTINRANGE\n"); uentry_testInRange(yyvsp[-2].entry, yyvsp[-1].expr); yyval.expr = exprNode_createTok (yyvsp[0].tok); - ; - break;} -case 467: -#line 1340 "cgrammar.y" -{ yyval.expr = exprNode_labelMarker (yyvsp[0].cname); ; - break;} -case 468: -#line 1345 "cgrammar.y" -{ yyval.expr = yyvsp[0].expr; ; - break;} -case 471: -#line 1353 "cgrammar.y" -{ yyval.expr = exprNode_concat (yyvsp[-1].expr, yyvsp[0].expr); ; - break;} -case 472: -#line 1357 "cgrammar.y" -{ yyval.expr = exprNode_while (yyvsp[-1].expr, yyvsp[0].expr); ; - break;} -case 473: -#line 1359 "cgrammar.y" -{ yyval.expr = exprNode_doWhile (yyvsp[-5].expr, yyvsp[-2].expr); ; - break;} -case 474: -#line 1361 "cgrammar.y" -{ yyval.expr = exprNode_doWhile (yyvsp[-4].expr, yyvsp[-1].expr); ; - break;} -case 475: -#line 1363 "cgrammar.y" -{ yyval.expr = exprNode_for (yyvsp[-1].expr, yyvsp[0].expr); ; - break;} -case 476: -#line 1367 "cgrammar.y" -{ context_setProtectVars (); ; - break;} -case 477: -#line 1367 "cgrammar.y" -{ context_sizeofReleaseVars (); ; - break;} -case 478: -#line 1369 "cgrammar.y" -{ yyval.expr = exprNode_forPred (yyvsp[-7].expr, yyvsp[-5].expr, yyvsp[-2].expr); - context_enterForClause (yyvsp[-5].expr); ; - break;} -case 479: -#line 1374 "cgrammar.y" -{ setProcessingIterVars (yyvsp[-2].entry); ; - break;} -case 480: -#line 1376 "cgrammar.y" -{ yyval.expr = exprNode_iterStart (yyvsp[-5].entry, yyvsp[-1].alist); ; - break;} -case 481: -#line 1377 "cgrammar.y" -{ yyval.expr = exprNode_createId (yyvsp[0].entry); ; - break;} -case 485: -#line 1383 "cgrammar.y" -{ yyval.expr = yyvsp[0].expr; ; - break;} -case 493: -#line 1391 "cgrammar.y" -{ yyval.expr = yyvsp[-1].expr; ; - break;} -case 494: -#line 1392 "cgrammar.y" -{ yyval.expr = exprNode_makeError (); ; - break;} -case 495: -#line 1396 "cgrammar.y" -{ /* don't: context_exitTrueClause ($1, $2); */ - yyval.expr = exprNode_if (yyvsp[-1].expr, yyvsp[0].expr); - ; - break;} -case 496: -#line 1401 "cgrammar.y" -{ yyval.expr = exprNode_createTok (yyvsp[0].tok); ; - break;} -case 497: -#line 1404 "cgrammar.y" -{ yyval.expr = exprNode_createTok (yyvsp[0].tok); ; - break;} -case 508: -#line 1419 "cgrammar.y" -{ yyval.expr = exprNode_addParens (yyvsp[-2].tok, yyvsp[-1].expr); ; - break;} -case 510: -#line 1421 "cgrammar.y" -{ yyval.expr = exprNode_makeError (); ; - break;} -case 511: -#line 1424 "cgrammar.y" -{ yyval.expr = exprNode_labelMarker (yyvsp[-1].cname); ; - break;} -case 512: -#line 1425 "cgrammar.y" -{ yyval.expr = exprNode_notReached (yyvsp[0].expr); ; - break;} -case 513: -#line 1431 "cgrammar.y" -{ context_enterCaseClause (yyvsp[0].expr); ; - break;} -case 514: -#line 1432 "cgrammar.y" -{ yyval.expr = exprNode_caseMarker (yyvsp[-2].expr, FALSE); ; - break;} -case 515: -#line 1433 "cgrammar.y" -{ context_enterCaseClause (yyvsp[0].expr); ; - break;} -case 516: -#line 1434 "cgrammar.y" -{ yyval.expr = exprNode_caseMarker (yyvsp[-2].expr, TRUE); ; - break;} -case 517: -#line 1437 "cgrammar.y" -{ context_enterCaseClause (exprNode_undefined); ; - break;} -case 518: -#line 1438 "cgrammar.y" -{ yyval.expr = exprNode_defaultMarker (yyvsp[-2].tok, FALSE); ; - break;} -case 519: -#line 1439 "cgrammar.y" -{ context_enterCaseClause (exprNode_undefined); ; - break;} -case 520: -#line 1440 "cgrammar.y" -{ yyval.expr = exprNode_defaultMarker (yyvsp[-2].tok, TRUE); ; - break;} -case 521: -#line 1443 "cgrammar.y" -{ yyval.expr = yyvsp[-1].expr; ; - break;} -case 522: -#line 1445 "cgrammar.y" -{ yyval.expr = yyvsp[0].expr; context_exitInner (yyvsp[0].expr); ; - break;} -case 523: -#line 1448 "cgrammar.y" -{ yyval.expr = yyvsp[-1].expr; ; - break;} -case 524: -#line 1451 "cgrammar.y" -{ context_enterInnerContext (); ; - break;} -case 525: -#line 1454 "cgrammar.y" -{ context_exitInnerPlain (); ; - break;} -case 526: -#line 1457 "cgrammar.y" -{ context_enterStructInnerContext (); ; - break;} -case 527: -#line 1460 "cgrammar.y" -{ context_exitStructInnerContext (); ; - break;} -case 528: -#line 1463 "cgrammar.y" -{ context_exitInnerSafe (); ; - break;} -case 529: -#line 1466 "cgrammar.y" -{ yyval.expr = exprNode_createTok (yyvsp[0].tok); ; - break;} -case 530: -#line 1467 "cgrammar.y" -{ yyval.expr = exprNode_notReached (exprNode_createTok (yyvsp[0].tok)); ; - break;} -case 531: -#line 1468 "cgrammar.y" -{ yyval.expr = exprNode_updateLocation (yyvsp[-1].expr, lltok_getLoc (yyvsp[0].tok)); ; - break;} -case 532: -#line 1470 "cgrammar.y" -{ yyval.expr = exprNode_notReached (exprNode_updateLocation (yyvsp[-2].expr, lltok_getLoc (yyvsp[0].tok))); ; - break;} -case 533: -#line 1471 "cgrammar.y" -{ yyval.expr = exprNode_updateLocation (yyvsp[-1].expr, lltok_getLoc (yyvsp[0].tok)); ; - break;} -case 534: -#line 1473 "cgrammar.y" -{ yyval.expr = exprNode_notReached (exprNode_updateLocation (yyvsp[-2].expr, lltok_getLoc (yyvsp[0].tok))); ; - break;} -case 535: -#line 1475 "cgrammar.y" -{ yyval.expr = exprNode_updateLocation (exprNode_concat (yyvsp[-2].expr, yyvsp[-1].expr), lltok_getLoc (yyvsp[0].tok)); ; - break;} -case 536: -#line 1477 "cgrammar.y" -{ yyval.expr = exprNode_notReached (exprNode_updateLocation (exprNode_concat (yyvsp[-3].expr, yyvsp[-2].expr), - lltok_getLoc (yyvsp[-1].tok))); - ; - break;} -case 537: -#line 1484 "cgrammar.y" -{ yyval.expr = exprNode_makeBlock (yyvsp[0].expr); ; - break;} -case 538: -#line 1488 "cgrammar.y" -{ yyval.expr = exprNode_createTok (yyvsp[0].tok); ; - break;} -case 539: -#line 1490 "cgrammar.y" -{ yyval.expr = exprNode_updateLocation (yyvsp[-1].expr, lltok_getLoc (yyvsp[0].tok)); ; - break;} -case 540: -#line 1492 "cgrammar.y" -{ yyval.expr = exprNode_updateLocation (yyvsp[-1].expr, lltok_getLoc (yyvsp[0].tok)); ; - break;} -case 541: -#line 1494 "cgrammar.y" -{ yyval.expr = exprNode_updateLocation (exprNode_concat (yyvsp[-2].expr, yyvsp[-1].expr), lltok_getLoc (yyvsp[0].tok)); ; - break;} -case 543: -#line 1498 "cgrammar.y" -{ yyval.expr = exprNode_concat (yyvsp[-1].expr, yyvsp[0].expr); ; - break;} -case 544: -#line 1501 "cgrammar.y" -{ yyval.expr = yyvsp[0].expr; ; - break;} -case 545: -#line 1502 "cgrammar.y" -{ yyval.expr = exprNode_concat (yyvsp[-1].expr, yyvsp[0].expr); ; - break;} -case 546: -#line 1505 "cgrammar.y" -{ yyval.expr = yyvsp[0].expr; ; - break;} -case 547: -#line 1506 "cgrammar.y" -{ yyval.expr = exprNode_concat (yyvsp[-1].expr, yyvsp[0].expr); ; - break;} -case 548: -#line 1509 "cgrammar.y" -{ yyval.expr = exprNode_createTok (yyvsp[0].tok); ; - break;} -case 549: -#line 1510 "cgrammar.y" -{ yyval.expr = exprNode_statement (yyvsp[-1].expr, yyvsp[0].tok); ; - break;} -case 550: -#line 1513 "cgrammar.y" -{ yyval.expr = exprNode_createTok (yyvsp[0].tok); ; - break;} -case 551: -#line 1514 "cgrammar.y" -{ yyval.expr = exprNode_statement (yyvsp[-1].expr, yyvsp[0].tok); ; - break;} -case 552: -#line 1515 "cgrammar.y" -{ yyval.expr = exprNode_checkExpr (yyvsp[0].expr); ; - break;} -case 553: -#line 1519 "cgrammar.y" -{ yyval.expr = yyvsp[-1].expr; exprNode_produceGuards (yyvsp[-1].expr); context_enterTrueClause (yyvsp[-1].expr); ; - break;} -case 554: -#line 1527 "cgrammar.y" -{ - context_exitTrueClause (yyvsp[-1].expr, yyvsp[0].expr); - yyval.expr = exprNode_if (yyvsp[-1].expr, yyvsp[0].expr); - ; - break;} -case 555: -#line 1531 "cgrammar.y" -{ context_enterFalseClause (yyvsp[-2].expr); ; - break;} -case 556: -#line 1532 "cgrammar.y" -{ - context_exitClause (yyvsp[-4].expr, yyvsp[-3].expr, yyvsp[0].expr); - yyval.expr = exprNode_ifelse (yyvsp[-4].expr, yyvsp[-3].expr, yyvsp[0].expr); - ; - break;} -case 557: -#line 1536 "cgrammar.y" -{ context_enterSwitch (yyvsp[0].expr); ; - break;} -case 558: -#line 1537 "cgrammar.y" -{ yyval.expr = exprNode_switch (yyvsp[-3].expr, yyvsp[0].expr); ; - break;} -case 559: -#line 1541 "cgrammar.y" -{ yyval.expr = exprNode_whilePred (yyvsp[-1].expr); context_enterWhileClause (yyvsp[-1].expr); ; - break;} -case 560: -#line 1545 "cgrammar.y" -{ yyval.expr = exprNode_whilePred(yyvsp[-1].expr); ; - break;} -case 561: -#line 1548 "cgrammar.y" -{ context_enterIterClause (); ; - break;} -case 562: -#line 1549 "cgrammar.y" -{ setProcessingIterVars (yyvsp[-3].entry); ; - break;} -case 563: -#line 1552 "cgrammar.y" -{ - yyval.expr = exprNode_iter (yyvsp[-9].entry, yyvsp[-4].alist, yyvsp[-2].expr, yyvsp[-1].entry); - - ; - break;} -case 564: -#line 1558 "cgrammar.y" -{ yyval.alist = exprNodeList_singleton (yyvsp[0].expr); ; - break;} -case 565: -#line 1559 "cgrammar.y" -{ nextIterParam (); ; - break;} -case 566: -#line 1560 "cgrammar.y" -{ yyval.alist = exprNodeList_push (yyvsp[-3].alist, yyvsp[0].expr); ; - break;} -case 567: -#line 1563 "cgrammar.y" -{ yyval.expr = exprNode_iterExpr (yyvsp[0].expr); ; - break;} -case 568: -#line 1564 "cgrammar.y" -{ yyval.expr = exprNode_iterId (yyvsp[0].entry); ; - break;} -case 569: -#line 1565 "cgrammar.y" -{ uentry ue = coerceIterId (yyvsp[0].cname); - - if (uentry_isValid (ue)) - { - yyval.expr = exprNode_iterId (ue); - } - else - { - yyval.expr = exprNode_iterNewId (cstring_copy (LastIdentifier ())); - } - ; - break;} -case 570: -#line 1576 "cgrammar.y" -{ yyval.expr = exprNode_iterNewId (yyvsp[0].cname); ; - break;} -case 572: -#line 1584 "cgrammar.y" -{ yyval.expr = exprNode_addParens (yyvsp[-2].tok, yyvsp[-1].expr); ; - break;} -case 574: -#line 1588 "cgrammar.y" -{ yyval.expr = exprNode_arrayFetch (yyvsp[-3].expr, yyvsp[-1].expr); ; - break;} -case 575: -#line 1589 "cgrammar.y" -{ yyval.expr = exprNode_functionCall (yyvsp[-2].expr, exprNodeList_new ()); ; - break;} -case 576: -#line 1590 "cgrammar.y" -{ yyval.expr = exprNode_functionCall (yyvsp[-3].expr, yyvsp[-1].alist); ; - break;} -case 577: -#line 1592 "cgrammar.y" -{ yyval.expr = exprNode_vaArg (yyvsp[-5].tok, yyvsp[-3].expr, yyvsp[-1].qtyp); ; - break;} -case 578: -#line 1593 "cgrammar.y" -{ yyval.expr = exprNode_fieldAccess (yyvsp[-4].expr, yyvsp[-1].cname); ; - break;} -case 579: -#line 1594 "cgrammar.y" -{ yyval.expr = exprNode_arrowAccess (yyvsp[-4].expr, yyvsp[-1].cname); ; - break;} -case 580: -#line 1595 "cgrammar.y" -{ yyval.expr = exprNode_postOp (yyvsp[-1].expr, yyvsp[0].tok); ; - break;} -case 581: -#line 1596 "cgrammar.y" -{ yyval.expr = exprNode_postOp (yyvsp[-1].expr, yyvsp[0].tok); ; - break;} -case 583: -#line 1600 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 584: -#line 1601 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 585: -#line 1602 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 586: -#line 1603 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 587: -#line 1604 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 588: -#line 1605 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 589: -#line 1606 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 590: -#line 1607 "cgrammar.y" -{ yyval.expr = exprNode_preOp (yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 591: -#line 1608 "cgrammar.y" -{ yyval.expr = yyvsp[0].expr; ; - break;} -case 593: -#line 1612 "cgrammar.y" -{ yyval.expr = exprNode_cast (yyvsp[-3].tok, yyvsp[0].expr, yyvsp[-2].qtyp); ; - break;} -case 595: -#line 1616 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 596: -#line 1617 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 597: -#line 1618 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 599: -#line 1622 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 600: -#line 1623 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 602: -#line 1627 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 603: -#line 1628 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 605: -#line 1632 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 606: -#line 1633 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 607: -#line 1634 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 608: -#line 1635 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 610: -#line 1639 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 611: -#line 1640 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 613: -#line 1644 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 615: -#line 1648 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 617: -#line 1653 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 619: -#line 1657 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 621: -#line 1661 "cgrammar.y" -{ yyval.expr = exprNode_op (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 623: -#line 1665 "cgrammar.y" -{ context_enterTrueClause (yyvsp[-1].expr); ; - break;} -case 624: -#line 1666 "cgrammar.y" -{ context_enterFalseClause (yyvsp[-4].expr); ; - break;} -case 625: -#line 1667 "cgrammar.y" -{ yyval.expr = exprNode_cond (yyvsp[-6].expr, yyvsp[-3].expr, yyvsp[0].expr); ; - break;} -case 627: -#line 1671 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 628: -#line 1672 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 629: -#line 1673 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 630: -#line 1674 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 631: -#line 1675 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 632: -#line 1676 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 633: -#line 1677 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 634: -#line 1678 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 635: -#line 1679 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 636: -#line 1680 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 637: -#line 1681 "cgrammar.y" -{ yyval.expr = exprNode_assign (yyvsp[-2].expr, yyvsp[0].expr, yyvsp[-1].tok); ; - break;} -case 638: -#line 1684 "cgrammar.y" -{ yyval.entry = yyvsp[0].entry; ; - break;} -case 639: -#line 1685 "cgrammar.y" -{ yyval.entry = uentry_undefined; ; - break;} -case 640: -#line 1688 "cgrammar.y" -{ context_enterDoWhileClause (); yyval.tok = yyvsp[0].tok; ; - break;} -case 641: -#line 1692 "cgrammar.y" -{ yyval.expr = exprNode_while (yyvsp[-1].expr, yyvsp[0].expr); context_exitWhileClause (yyvsp[-1].expr, yyvsp[0].expr); ; - break;} -case 642: -#line 1694 "cgrammar.y" -{ yyval.expr = exprNode_statement (exprNode_doWhile (yyvsp[-5].expr, yyvsp[-2].expr), yyvsp[0].tok); ; - break;} -case 643: -#line 1696 "cgrammar.y" -{ yyval.expr = exprNode_for (yyvsp[-1].expr, yyvsp[0].expr); context_exitForClause (yyvsp[-1].expr, yyvsp[0].expr); ; - break;} -case 644: -#line 1699 "cgrammar.y" -{ yyval.expr = exprNode_while (yyvsp[-1].expr, yyvsp[0].expr); context_exitWhileClause (yyvsp[-1].expr, yyvsp[0].expr); ; - break;} -case 645: -#line 1701 "cgrammar.y" -{ yyval.expr = exprNode_statement (exprNode_doWhile (yyvsp[-5].expr, yyvsp[-2].expr), yyvsp[0].tok); ; - break;} -case 646: -#line 1703 "cgrammar.y" -{ yyval.expr = exprNode_doWhile (yyvsp[-4].expr, yyvsp[-1].expr); ; - break;} -case 647: -#line 1704 "cgrammar.y" -{ yyval.expr = exprNode_for (yyvsp[-1].expr, yyvsp[0].expr); context_exitForClause (yyvsp[-1].expr, yyvsp[0].expr); ; - break;} -case 648: -#line 1707 "cgrammar.y" -{ yyval.expr = exprNode_goto (yyvsp[-1].cname); ; - break;} -case 649: -#line 1708 "cgrammar.y" -{ yyval.expr = exprNode_continue (yyvsp[-1].tok, BADTOK); ; - break;} -case 650: -#line 1710 "cgrammar.y" -{ yyval.expr = exprNode_continue (yyvsp[-2].tok, QINNERCONTINUE); ; - break;} -case 651: -#line 1711 "cgrammar.y" -{ yyval.expr = exprNode_break (yyvsp[-1].tok, BADTOK); ; - break;} -case 652: -#line 1712 "cgrammar.y" -{ yyval.expr = exprNode_break (yyvsp[-1].tok, QSWITCHBREAK); ; - break;} -case 653: -#line 1713 "cgrammar.y" -{ yyval.expr = exprNode_break (yyvsp[-1].tok, QLOOPBREAK); ; - break;} -case 654: -#line 1714 "cgrammar.y" -{ yyval.expr = exprNode_break (yyvsp[-1].tok, QINNERBREAK); ; - break;} -case 655: -#line 1715 "cgrammar.y" -{ yyval.expr = exprNode_break (yyvsp[-1].tok, QSAFEBREAK); ; - break;} -case 656: -#line 1716 "cgrammar.y" -{ yyval.expr = exprNode_nullReturn (yyvsp[-1].tok); ; - break;} -case 657: -#line 1717 "cgrammar.y" -{ yyval.expr = exprNode_return (yyvsp[-1].expr); ; - break;} -case 659: -#line 1721 "cgrammar.y" -{ ; ; - break;} -case 662: -#line 1728 "cgrammar.y" -{ yyval.cname = uentry_getName (yyvsp[0].entry); ; - break;} -case 663: -#line 1729 "cgrammar.y" -{ yyval.cname = uentry_getName (yyvsp[0].entry); ; - break;} -case 664: -#line 1730 "cgrammar.y" -{ yyval.cname = uentry_getName (yyvsp[0].entry); ; - break;} -case 665: -#line 1731 "cgrammar.y" -{ yyval.cname = yyvsp[0].cname; ; - break;} -case 667: -#line 1735 "cgrammar.y" -{ yyval.ctyp = ctype_unknown; ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 498 "/usr/share/misc/bison.simple" - - yyvsp -= yylen; - yyssp -= yylen; -#ifdef YYLSP_NEEDED - yylsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - - *++yyvsp = yyval; - -#ifdef YYLSP_NEEDED - yylsp++; - if (yylen == 0) - { - yylsp->first_line = yylloc.first_line; - yylsp->first_column = yylloc.first_column; - yylsp->last_line = (yylsp-1)->last_line; - yylsp->last_column = (yylsp-1)->last_column; - yylsp->text = 0; - } - else - { - yylsp->last_line = (yylsp+yylen-1)->last_line; - yylsp->last_column = (yylsp+yylen-1)->last_column; - } -#endif - - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTBASE]; - - goto yynewstate; - -yyerrlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++yynerrs; - -#ifdef YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - yyerror(msg); - free(msg); - } - else - yyerror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror("parse error"); - } - - goto yyerrlab1; -yyerrlab1: /* here on error raised explicitly by an action */ - - if (yyerrstatus == 3) - { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (yychar == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); -#endif - - yychar = YYEMPTY; - } - - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; - -yyerrdefault: /* current state does not do anything special for the error token. */ - -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto yydefault; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (yyssp == yyss) YYABORT; - yyvsp--; - yystate = *--yyssp; -#ifdef YYLSP_NEEDED - yylsp--; -#endif - -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting error token, "); -#endif - - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - yystate = yyn; - goto yynewstate; -} -#line 1737 "cgrammar.y" - - -/*@-redecl@*/ -extern char *yytext; -/*@=redecl@*/ - -# include "bison.reset" - -void yyerror (/*@unused@*/ char *s) -{ - static bool givehint = FALSE; - - if (context_inIterDef ()) - { - llerror (FLG_SYNTAX, message ("Iter syntax not parseable: %s", - context_inFunctionName ())); - } - else if (context_inIterEnd ()) - { - llerror (FLG_SYNTAX, message ("Iter finalizer syntax not parseable: %s", - context_inFunctionName ())); - } - else if (context_inMacro ()) - { - llerror (FLG_SYNTAX, message ("Macro syntax not parseable: %s", - context_inFunctionName ())); - - if (context_inMacroUnknown ()) - { - if (!givehint) - { - llhint (cstring_makeLiteral - ("Precede macro definition with /*@notfunction@*/ " - "to suppress checking and force expansion")); - givehint = TRUE; - } - } - - swallowMacro (); - } - else - { - llparseerror (cstring_undefined); - } -} - -void printState (idDecl t) { - cstring id = idDecl_getName (t); - uentry ue = usymtab_lookupSafe (id); - - sRef s = uentry_getSref (ue); - - printf("State = %d\n", s->bufinfo.bufstate); -} - - -/*take this out soon */ -/* void testassert1 (cstring id, icstring cons ) { */ - /* uentry ue =usymtab_lookupSafe (id); */ -/* sRef s = uentry_getSref (ue); */ -/* printf ("Doing testassert1 with setbuffersize\n"); */ -/* printf("State = %d\n", s->bufinfo.bufstate); */ -/* } */ -/* void testassert2 (cstring id) { */ -/* uentry ue =usymtab_lookupSafe (id); */ -/* sRef s = uentry_getSref (ue); */ -/* printf ("Doing testassert2 with setbuffersize\n"); */ -/* printf("State = %d\n", s->bufinfo.bufstate); */ -/* } */ - - - - - - diff --git a/src/cgrammar.tab.h b/src/cgrammar.tab.h deleted file mode 100644 index c1b9b8d..0000000 --- a/src/cgrammar.tab.h +++ /dev/null @@ -1,220 +0,0 @@ -typedef union -{ - lltok tok; - int count; - specialClauseKind sck; - qual typequal; - qualList tquallist; - ctype ctyp; - sRef sr; - /*@only@*/ qtype qtyp; - /*@only@*/ cstring cname; - /*@only@*/ idDecl ntyp; - /*@only@*/ idDeclList ntyplist; - /*@only@*/ uentryList flist; - /*@owned@*/ uentryList entrylist; - /*@observer@*/ /*@dependent@*/ uentry entry; - /*@only@*/ uentry oentry; - /*@only@*/ exprNode expr; - /*@only@*/ enumNameList enumnamelist; - /*@only@*/ exprNodeList alist; - /*@only@*/ sRefSet srset; - /*@only@*/ cstringList cstringlist; - /*drl - added 1/19/2001 - */ - constraint con; - constraintList conL; - constraintExpr conE; - /* drl */ -} YYSTYPE; -#define BADTOK 258 -#define SKIPTOK 259 -#define CTOK_ELIPSIS 260 -#define CASE 261 -#define DEFAULT 262 -#define CIF 263 -#define CELSE 264 -#define SWITCH 265 -#define WHILE 266 -#define DO 267 -#define CFOR 268 -#define GOTO 269 -#define CONTINUE 270 -#define BREAK 271 -#define RETURN 272 -#define TSEMI 273 -#define TLBRACE 274 -#define TRBRACE 275 -#define TCOMMA 276 -#define TCOLON 277 -#define TASSIGN 278 -#define TLPAREN 279 -#define TRPAREN 280 -#define TLSQBR 281 -#define TRSQBR 282 -#define TDOT 283 -#define TAMPERSAND 284 -#define TEXCL 285 -#define TTILDE 286 -#define TMINUS 287 -#define TPLUS 288 -#define TMULT 289 -#define TDIV 290 -#define TPERCENT 291 -#define TLT 292 -#define TGT 293 -#define TCIRC 294 -#define TBAR 295 -#define TQUEST 296 -#define CSIZEOF 297 -#define CALIGNOF 298 -#define ARROW_OP 299 -#define CTYPEDEF 300 -#define COFFSETOF 301 -#define INC_OP 302 -#define DEC_OP 303 -#define LEFT_OP 304 -#define RIGHT_OP 305 -#define LE_OP 306 -#define GE_OP 307 -#define EQ_OP 308 -#define NE_OP 309 -#define AND_OP 310 -#define OR_OP 311 -#define MUL_ASSIGN 312 -#define DIV_ASSIGN 313 -#define MOD_ASSIGN 314 -#define ADD_ASSIGN 315 -#define SUB_ASSIGN 316 -#define LEFT_ASSIGN 317 -#define RIGHT_ASSIGN 318 -#define AND_ASSIGN 319 -#define XOR_ASSIGN 320 -#define OR_ASSIGN 321 -#define CSTRUCT 322 -#define CUNION 323 -#define CENUM 324 -#define VA_ARG 325 -#define VA_DCL 326 -#define QGLOBALS 327 -#define QMODIFIES 328 -#define QNOMODS 329 -#define QCONSTANT 330 -#define QFUNCTION 331 -#define QITER 332 -#define QDEFINES 333 -#define QUSES 334 -#define QALLOCATES 335 -#define QSETS 336 -#define QRELEASES 337 -#define QPRECLAUSE 338 -#define QPOSTCLAUSE 339 -#define QALT 340 -#define QUNDEF 341 -#define QKILLED 342 -#define QENDMACRO 343 -#define LLMACRO 344 -#define LLMACROITER 345 -#define LLMACROEND 346 -#define TENDMACRO 347 -#define QSWITCHBREAK 348 -#define QLOOPBREAK 349 -#define QINNERBREAK 350 -#define QSAFEBREAK 351 -#define QINNERCONTINUE 352 -#define QFALLTHROUGH 353 -#define QLINTNOTREACHED 354 -#define QLINTFALLTHROUGH 355 -#define QLINTFALLTHRU 356 -#define QARGSUSED 357 -#define QPRINTFLIKE 358 -#define QLINTPRINTFLIKE 359 -#define QSCANFLIKE 360 -#define QMESSAGELIKE 361 -#define QNOTREACHED 362 -#define QCONST 363 -#define QVOLATILE 364 -#define QINLINE 365 -#define QEXTENSION 366 -#define QEXTERN 367 -#define QSTATIC 368 -#define QAUTO 369 -#define QREGISTER 370 -#define QOUT 371 -#define QIN 372 -#define QYIELD 373 -#define QONLY 374 -#define QTEMP 375 -#define QSHARED 376 -#define QREF 377 -#define QUNIQUE 378 -#define QCHECKED 379 -#define QUNCHECKED 380 -#define QCHECKEDSTRICT 381 -#define QCHECKMOD 382 -#define QKEEP 383 -#define QKEPT 384 -#define QPARTIAL 385 -#define QSPECIAL 386 -#define QOWNED 387 -#define QDEPENDENT 388 -#define QRETURNED 389 -#define QEXPOSED 390 -#define QNULL 391 -#define QOBSERVER 392 -#define QISNULL 393 -#define QEXITS 394 -#define QMAYEXIT 395 -#define QNEVEREXIT 396 -#define QTRUEEXIT 397 -#define QFALSEEXIT 398 -#define QLONG 399 -#define QSIGNED 400 -#define QUNSIGNED 401 -#define QSHORT 402 -#define QUNUSED 403 -#define QSEF 404 -#define QNOTNULL 405 -#define QRELNULL 406 -#define QABSTRACT 407 -#define QCONCRETE 408 -#define QMUTABLE 409 -#define QIMMUTABLE 410 -#define QTRUENULL 411 -#define QFALSENULL 412 -#define QEXTERNAL 413 -#define QREFCOUNTED 414 -#define QREFS 415 -#define QNEWREF 416 -#define QTEMPREF 417 -#define QKILLREF 418 -#define QRELDEF 419 -#define CGCHAR 420 -#define CBOOL 421 -#define CINT 422 -#define CGFLOAT 423 -#define CDOUBLE 424 -#define CVOID 425 -#define QANYTYPE 426 -#define QINTEGRALTYPE 427 -#define QUNSIGNEDINTEGRALTYPE 428 -#define QSIGNEDINTEGRALTYPE 429 -#define QNULLTERMINATED 430 -#define QSETBUFFERSIZE 431 -#define QBUFFERCONSTRAINT 432 -#define QENSURESCONSTRAINT 433 -#define QSETSTRINGLENGTH 434 -#define QMAXSET 435 -#define QMAXREAD 436 -#define QTESTINRANGE 437 -#define IDENTIFIER 438 -#define NEW_IDENTIFIER 439 -#define TYPE_NAME_OR_ID 440 -#define CCONSTANT 441 -#define ITER_NAME 442 -#define ITER_ENDNAME 443 -#define TYPE_NAME 444 - - -extern YYSTYPE yylval; diff --git a/src/checking.c b/src/checking.c deleted file mode 100644 index cdc1e5d..0000000 --- a/src/checking.c +++ /dev/null @@ -1,820 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** checking.c -** -** sort checking. -** -** AUTHOR: -** Yang Meng Tan, -** Massachusetts Institute of Technology -*/ - -# include "lclintMacros.nf" -# include "llbasic.h" -# include "llgrammar.h" -# include "checking.h" -# include "lclscan.h" - -/*@+ignorequals@*/ - -static /*@only@*/ cstring printBadArgs (sortSetList p_args); -static /*@only@*/ sortSet - standardOperators (/*@null@*/ nameNode p_n, sortSetList p_argSorts, sort p_qual); -static bool isStandardOperator (/*@null@*/ nameNode p_n); -static void assignSorts (termNode p_t, sort p_s); - -/*@null@*/ termNode -computePossibleSorts (/*@returned@*/ /*@null@*/ termNode t) -{ - ltoken errtok; - - if (t != (termNode) 0) - { - switch (t->kind) - { - case TRM_LITERAL: - case TRM_CONST: - case TRM_VAR: - case TRM_ZEROARY: - case TRM_SIZEOF: - case TRM_UNCHANGEDALL: - case TRM_UNCHANGEDOTHERS: - case TRM_QUANTIFIER: - break; - case TRM_APPLICATION: - { - bool fail = FALSE; - sortSetList argSorts = sortSetList_new (); - lslOpSet ops; - sortSet standards; - - if (termNodeList_size (t->args) != 0) - { - termNodeList_elements (t->args, arg) - { - (void) computePossibleSorts (arg); - - if (sortSet_size (arg->possibleSorts) == 0) - { - fail = TRUE; - } - else - { - sortSetList_addh (argSorts, arg->possibleSorts); - } - } end_termNodeList_elements; - - if (fail) - { - lslOpSet_free (t->possibleOps); - sortSetList_free (argSorts); - t->possibleOps = lslOpSet_new (); - return t; - } - } - - ops = symtable_opsWithLegalDomain (g_symtab, t->name, argSorts, t->given); - lslOpSet_free (t->possibleOps); - t->possibleOps = ops; - - lslOpSet_elements (t->possibleOps, op) - { - sort sort; - sort = sigNode_rangeSort (op->signature); - (void) sortSet_insert (t->possibleSorts, sort); - } end_lslOpSet_elements; - - standards = standardOperators (t->name, argSorts, t->given); - - sortSet_elements (standards, el) - { - (void) sortSet_insert (t->possibleSorts, el); - } end_sortSet_elements; - - sortSet_free (standards); - - if (!(t->error_reported) && sortSet_size (t->possibleSorts) == 0) - { - unsigned int arity = termNodeList_size (t->args); - errtok = nameNode_errorToken (t->name); - - /* errorShowPoint (tsource_thisLine (lclsource), ltoken_getCol (errtok)); */ - - if (isStandardOperator (t->name)) - { - lclerror (errtok, - message ("Type error: %q not declared for %q", - nameNode_unparse (t->name), printBadArgs (argSorts))); - } - else if (t->name != NULL - && symtable_opExistsWithArity (g_symtab, t->name, arity)) - { - sigNodeSet possibleOps = symtable_possibleOps (g_symtab, t->name); - cstring opName = nameNode_unparse (t->name); - - /* - ** all these will be standardOperators soon... - */ - - if (cstring_equalLit (opName, "__ [__]")) - { - lclerror (errtok, - message ("Type error: %q not declared for %q", - opName, printBadArgs (argSorts))); - } - else - { - lclerror (errtok, - message ("Type error: %q declared: %q\ngiven: %q", - opName, - sigNodeSet_unparseSomeSigs (possibleOps), - printBadArgs (argSorts))); - } - } - else - { - sigNodeSet possibleOps; - int npossibleOps; - - llassert (t->name != NULL); - - possibleOps = symtable_possibleOps (g_symtab, t->name); - npossibleOps = sigNodeSet_size (possibleOps); - - /* - ** evs --- check is it is wrong arity... - */ - - if (npossibleOps == 0) - { - lclerror - (errtok, - message ("Undeclared operator: %q", nameNode_unparse (t->name))); - } - else - { - lclerror - (errtok, - message ("Operator %q declared for %q arguments, given %d", - nameNode_unparse (t->name), - sigNodeSet_unparsePossibleAritys (possibleOps), - arity)); - } - } - t->error_reported = TRUE; - } - sortSetList_free (argSorts); - break; - } - } - } - - return t; -} - -static /*@only@*/ cstring -printBadArgs (sortSetList args) -{ - if (sortSetList_size (args) == 1) - { - return (sortSet_unparseOr (sortSetList_head (args))); - } - else - { - cstring s = cstring_undefined; - int argno = 1; - - sortSetList_elements (args, ss) - { - if (argno == 1) - s = message ("arg %d: %q", argno, sortSet_unparseOr (ss)); - else - s = message ("%q; arg %d: %q", s, argno, sortSet_unparseOr (ss)); - argno++; - } end_sortSetList_elements; - - return s; - } -} - -termNode -checkSort (/*@returned@*/ termNode t) -{ - sortSet sorts; - sort theSort; - int size; - ltoken errtok; - - (void) computePossibleSorts (t); - sorts = t->possibleSorts; - - llassert (sortSet_isDefined (sorts)); - - size = sortSet_size (sorts); - switch (size) - { - case 0: /* complain later */ - break; - case 1: /* just right */ - theSort = sortSet_choose (sorts); - assignSorts (t, theSort); - break; - default: - /* we allow C literals to have multiple sorts */ - if (t->kind != TRM_LITERAL) - { - errtok = termNode_errorToken (t); - t->error_reported = TRUE; - - lclerror (errtok, - message ("Term %q: can have more than one possible type. Possible types: %q", - termNode_unparse (t), sortSet_unparseClean (sorts))); - } - } - return t; -} - -static void - assignSorts (termNode t, sort s) -{ - /* other kinds are already assigned bottom-up */ - ltoken errtok; - - switch (t->kind) - { - case TRM_ZEROARY: /* pick s to be the sort chosen */ - case TRM_LITERAL: - sortSet_elements (t->possibleSorts, s2) - { - if (sort_equal (&s2, &s)) - { - sortSet_free (t->possibleSorts); - t->possibleSorts = sortSet_new (); - (void) sortSet_insert (t->possibleSorts, s); - t->sort = s; - } - return; - } end_sortSet_elements; - break; - case TRM_APPLICATION: - { - lslOpSet sigs = t->possibleOps; - lslOpSet oldops = lslOpSet_undefined; - sigNode op = (sigNode) 0; - nameNode name = t->name; - termNodeList args = t->args; - bool found = FALSE; - - errtok = nameNode_errorToken (name); - - /* why compute again? to check for duplicates */ - lslOpSet_elements (sigs, sig) - { - sort rsort = sigNode_rangeSort (sig->signature); - - if (sort_equal (&s, &rsort)) - { - lslOp iop; - - if (found) - { - t->error_reported = TRUE; - - lclerror (errtok, - message ("Ambiguous operator %q: %q or %q", - nameNode_unparse (name), - sigNode_unparse (op), - sigNode_unparse (sig->signature))); - return; - } - - iop = (lslOp) dmalloc (sizeof (*iop)); - found = TRUE; - op = sig->signature; - - oldops = t->possibleOps; - t->possibleOps = lslOpSet_new (); - iop->name = nameNode_copy (name); - iop->signature = op; - (void) lslOpSet_insert (t->possibleOps, iop); - t->sort = s; - /*@-branchstate@*/ - } - /*@=branchstate@*/ - } end_lslOpSet_elements; - - lslOpSet_free (oldops); - - if (!found) - { - if (sortSet_size (t->possibleSorts) == 1) - { - t->sort = sortSet_choose (t->possibleSorts); - } - else - { - /* errorShowPoint (tsource_thisLine (lclsource), ltoken_getCol (errtok)); */ - t->error_reported = TRUE; - - lclerror (errtok, message ("Operator not found: %q", - nameNode_unparse (name))); - /* evs --- ??? */ - } - return; - } - - if (termNodeList_empty (args)) - { - if (op != (sigNode) 0) - { - /* was --- NB: copy to avoid interference */ - /* shouldn't need to copy --- its a fresh list */ - sortList dom = sigNode_domain (op); - - sortList_reset (dom); - termNodeList_elements (args, arg) - { - assignSorts (arg, sortList_current (dom)); - sortList_advance (dom); - } end_termNodeList_elements; - - sortList_free (dom); - } - else - { - errtok = nameNode_errorToken (name); - /* errorShowPoint (tsource_thisLine (lclsource), ltoken_getCol (errtok)); */ - t->error_reported = TRUE; - - lclerror (errtok, message ("No matching operator: %q", - nameNode_unparse (name))); - } - return; - } - break; - } - default: /* do nothing */ - break; - } -} - -void -checkLclPredicate (ltoken t, lclPredicateNode n) -{ - sort theSort; - - if ((n == NULL) || (n->predicate == NULL)) - { - llcontbuglit ("checkLclPredicate expects valid lclPredicate. " - "Skipping current check"); - return; - } - - /* check only if there are no previous errors */ - - if (!n->predicate->error_reported) - { - /* check that the sort of n is boolean */ - theSort = n->predicate->sort; - if (!sort_compatible (theSort, sort_capBool)) - { - if (sort_isNoSort (theSort)) - { - ; /* "Expects a boolean term. Given term has unknown sort" */ - } - else - { - cstring clauset = ltoken_getRawString (t); - - if (cstring_firstChar (clauset) == '(') - { - clauset = cstring_makeLiteral ("Equality"); - } - else - { - /* uppercase first letter */ - clauset = cstring_copy (clauset); - cstring_setChar (clauset, 1, - (char) toupper (cstring_firstChar (clauset))); - } - - lclerror (t, message ("%q expects a boolean term, given %q.", - clauset, sort_unparse (theSort))); - - } - } - } -} - -/* -** these should not be doing string comparisons! -*/ - -static bool isDeRefOperator (cstring s) -{ - return (cstring_equalLit (s, "*")); -} - -static bool isStateOperator (cstring s) -{ - return (cstring_equalLit (s, "^") || - cstring_equalLit (s, "'") || - cstring_equalLit (s, "\\any") || - cstring_equalLit (s, "\\pre") || - cstring_equalLit (s, "\\post")); -} - -static bool isCompareOperator (cstring s) /* YUCK!!! */ -{ - return (cstring_equalLit (s, "\\eq") || - cstring_equalLit (s, "\\neq") || - cstring_equalLit (s, "=") || - cstring_equalLit (s, "!=") || - cstring_equalLit (s, "~=") || - cstring_equalLit (s, "==")); -} - -static bool isStandardOperator (/*@null@*/ nameNode n) -{ - if (n != (nameNode) 0) - { - if (!n->isOpId) - { - opFormNode opf = n->content.opform; - - llassert (opf != NULL); - - switch (opf->kind) - { - case OPF_IF: return TRUE; - case OPF_ANYOP: - break; - case OPF_MANYOP: - { - cstring s = ltoken_getRawString (opf->content.anyop); - - if (isStateOperator (s)) return TRUE; - return FALSE; - } - case OPF_ANYOPM: - /* operator: *__ */ - { - cstring s = ltoken_getRawString (opf->content.anyop); - - return (isDeRefOperator (s)); - } - case OPF_MANYOPM: - { - cstring s = ltoken_getRawString (opf->content.anyop); - - return (isCompareOperator (s)); - } - case OPF_MIDDLE: - break; - case OPF_MMIDDLE: - break; - case OPF_MIDDLEM: - break; - case OPF_MMIDDLEM: - break; - case OPF_BMIDDLE: - break; - case OPF_BMMIDDLE: - break; - case OPF_BMIDDLEM: - break; - case OPF_BMMIDDLEM: - break; - case OPF_SELECT: - break; - case OPF_MAP: - break; - case OPF_MSELECT: - break; - case OPF_MMAP: - break; - default: - break; - } - } - else - { - int code = ltoken_getCode (n->content.opid); - - if (code == simpleId) - { - cstring text = nameNode_unparse (n); - bool ret = (cstring_equalLit (text, "trashed") - || cstring_equalLit (text, "maxIndex") - || cstring_equalLit (text, "minIndex") - || cstring_equalLit (text, "isSub")); - - cstring_free (text); - return ret; - } - - return (code == LLT_MODIFIES || code == LLT_FRESH - || code == LLT_UNCHANGED || code == LLT_SIZEOF); - } - } - return FALSE; -} - -static /*@only@*/ sortSet -standardOperators (/*@null@*/ nameNode n, sortSetList argSorts, /*@unused@*/ sort qual) -{ - sortSet argSet; - sortSet ret = sortSet_new (); - - if (n == (nameNode) 0) return ret; - - if (n->isOpId) - { - int code = ltoken_getCode (n->content.opid); - - if (sortSetList_size (argSorts) == 1) - { - sortSetList_reset (argSorts); - - argSet = sortSetList_current (argSorts); - - sortSet_elements (argSet, current) - { - sortNode sn; - - sn = sort_quietLookup (current); - - while (sn.kind == SRT_SYN) - { - sn = sort_quietLookup (sn.baseSort); - } - - /*@-loopswitchbreak@*/ - switch (code) - { - case simpleId: - { - cstring text = ltoken_getRawString (n->content.opid); - - if (cstring_equalLit (text, "trashed")) /* GACK! */ - { - if (sn.kind == SRT_OBJ || - sn.kind == SRT_ARRAY) - (void) sortSet_insert (ret, sort_bool); - } - - if (cstring_equalLit (text, "maxIndex") || - cstring_equalLit (text, "minIndex")) - { - if (sn.kind == SRT_ARRAY || sn.kind == SRT_PTR) - (void) sortSet_insert (ret, sort_int); - - /* if (lsymbol_fromChars ("maxIndex") */ - } - } - break; - case LLT_MODIFIES: - case LLT_FRESH: - case LLT_UNCHANGED: - if (sn.kind == SRT_OBJ || - sn.kind == SRT_ARRAY) - { - (void) sortSet_insert (ret, sort_bool); - } - break; - case LLT_SIZEOF: - if (sn.kind == SRT_OBJ || - sn.kind == SRT_ARRAY || - sn.kind == SRT_VECTOR) - (void) sortSet_insert (ret, sort_int); - break; - default: - break; - } - } end_sortSet_elements; - } - } - else - { - opFormNode opf = n->content.opform; - - llassert (opf != NULL); - - switch (opf->kind) - { - case OPF_IF: - /* - ** if __ then __ else __ : bool, S, S -> S - ** is defined for all sorts - */ - - if (sortSetList_size (argSorts) == 3) - { - argSet = sortSetList_head (argSorts); - - if (sortSet_member (argSet, sort_bool)) - { - sortSetList_reset (argSorts); - sortSetList_advance (argSorts); - - argSet = sortSetList_current (argSorts); - - if (sortSet_size (argSet) == 1) - { - sort clause = sortSet_choose (argSet); - sort clause2; - - sortSetList_advance (argSorts); - argSet = sortSetList_current (argSorts); - - clause2 = sortSet_choose (argSet); - - if (sortSet_size (argSet) == 1 && - sort_equal (&clause, &clause2)) - { - (void) sortSet_insert (ret, clause); - } - } - } - } - break; - case OPF_MANYOP: - { - cstring s = ltoken_getRawString (opf->content.anyop); - - if (isStateOperator (s)) - { - if (sortSetList_size (argSorts) == 1) - { - sortSetList_reset (argSorts); - - argSet = sortSetList_current (argSorts); - - sortSet_elements (argSet, current) - { - sortNode sn; - - sn = sort_quietLookup (current); - - while (sn.kind == SRT_SYN) - { - sn = sort_quietLookup (sn.baseSort); - } - - switch (sn.kind) - { - case SRT_OBJ: - (void) sortSet_insert (ret, sn.baseSort); - break; - case SRT_ARRAY: - (void) sortSet_insert (ret, - sort_makeVec (ltoken_undefined, current)); - break; - case SRT_STRUCT: - (void) sortSet_insert (ret, - sort_makeTuple (ltoken_undefined, current)); - break; - case SRT_UNION: - (void) sortSet_insert (ret, - sort_makeUnionVal (ltoken_undefined, current)); - break; - case SRT_TUPLE: - case SRT_UNIONVAL: - case SRT_ENUM: - case SRT_LAST: - case SRT_FIRST: - case SRT_NONE: - case SRT_HOF: - case SRT_PRIM: - case SRT_PTR: - case SRT_VECTOR: - break; - case SRT_SYN: - llbuglit ("standardOperators: Synonym in switch"); - } - } end_sortSet_elements ; - } - } - } - break; - case OPF_ANYOPM: - /* operator: *__ */ - { - cstring s = ltoken_getRawString (opf->content.anyop); - - if (isDeRefOperator (s)) - { - if (sortSetList_size (argSorts) == 1) - { - sortSetList_reset (argSorts); - - argSet = sortSetList_current (argSorts); - - sortSet_elements (argSet, current) - { - sortNode sn; - - sn = sort_quietLookup (current); - - while (sn.kind == SRT_SYN) - { - sn = sort_quietLookup (sn.baseSort); - } - - if (sn.kind == SRT_PTR) - { - (void) sortSet_insert (ret, sn.baseSort); - } - } end_sortSet_elements; - } - } - } - break; - case OPF_ANYOP: - break; - case OPF_MANYOPM: - { - cstring s = ltoken_getRawString (opf->content.anyop); - - if (isCompareOperator (s)) - { - if (sortSetList_size (argSorts) == 2) - { - sortSet argSet2; - - sortSetList_reset (argSorts); - - argSet = sortSetList_current (argSorts); - sortSetList_advance (argSorts); - argSet2 = sortSetList_current (argSorts); - - if (sortSet_size (argSet) == 1) - { - sortSet_elements (argSet, cl) - { - sortSet_elements (argSet2, cl2) - { - if (sort_equal (&cl, &cl2)) - { - (void) sortSet_insert (ret, sort_bool); - } - } end_sortSet_elements; - } end_sortSet_elements; - } - } - } - } - break; - case OPF_MIDDLE: - break; - case OPF_MMIDDLE: - break; - case OPF_MIDDLEM: - break; - case OPF_MMIDDLEM: - break; - case OPF_BMIDDLE: - break; - case OPF_BMMIDDLE: - break; - case OPF_BMIDDLEM: - break; - case OPF_BMMIDDLEM: - break; - case OPF_SELECT: - break; - case OPF_MAP: - break; - case OPF_MSELECT: - break; - case OPF_MMAP: - break; - default: - break; - } - /*@=loopswitchbreak@*/ - } - return ret; -} diff --git a/src/clabstract.c b/src/clabstract.c deleted file mode 100644 index 39c73f0..0000000 --- a/src/clabstract.c +++ /dev/null @@ -1,2352 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** clabstract.c -** -** ASTs for C grammar -** -*/ - -# include "lclintMacros.nf" -# include "llbasic.h" -# include "cgrammar.h" - -# ifndef NOLCL -# include "usymtab_interface.h" -# endif - -# include "structNames.h" -# include "nameChecks.h" - -# ifdef SANITIZER -# include "sgrammar_tokens.h" -# else -# include "cgrammar_tokens.h" -# endif - -/* -** Lots of variables are needed because of interactions with the -** parser. This is easier than restructuring the grammar so the -** right values are available in the right place. -*/ - -/*drl*/ -static constraintList fcnConstraints = NULL; - -static constraintList fcnEnsuresConstraints = NULL; -/*end drl*/ - -//static constraintList fcnPreConditions = NULL; - - -static /*@only@*/ sRefSet fcnModifies = sRefSet_undefined; -static /*@only@*/ /*@null@*/ specialClauses specClauses = specialClauses_undefined; -static bool fcnNoGlobals = FALSE; -static bool ProcessingVars = FALSE; -static bool ProcessingParams = FALSE; -static bool ProcessingGlobals = FALSE; -static bool ProcessingTypedef = FALSE; -static bool ProcessingIterVars = FALSE; -static /*@only@*/ qtype processingType = qtype_undefined; -static uentry currentIter = uentry_undefined; -static globSet currentGlobals = globSet_undefined; -static /*@dependent@*/ uentryList saveParamList; /* for old style functions */ -static /*@owned@*/ uentry saveFunction = uentry_undefined; -static int saveIterParamNo; -static idDecl fixStructDecl (/*@returned@*/ idDecl p_d); -static void checkTypeDecl (uentry p_e, ctype p_rep); -static /*@dependent@*/ fileloc saveStoreLoc = fileloc_undefined; -static storageClassCode storageClass = SCNONE; -static void declareEnumList (/*@temp@*/ enumNameList p_el, ctype p_c, fileloc p_loc); -static void resetGlobals (void); -static qual specialFunctionCode = QU_UNKNOWN; -static bool argsUsed = FALSE; - -static bool hasSpecialCode (void) -{ - return (specialFunctionCode != QU_UNKNOWN); -} - -extern void setArgsUsed (void) -{ - if (argsUsed) - { - voptgenerror - (FLG_SYNTAX, - cstring_makeLiteral ("Multiple ARGSUSED comments for one function"), - g_currentloc); - } - - argsUsed = TRUE; -} - -static void reflectArgsUsed (uentry ue) -{ - if (argsUsed) - { - if (uentry_isFunction (ue)) - { - uentryList params = uentry_getParams (ue); - - uentryList_elements (params, el) - { - uentry_setUsed (el, fileloc_undefined); - } end_uentryList_elements ; - } - - argsUsed = FALSE; - } -} - -extern void setSpecialFunction (qual qu) -{ - if (specialFunctionCode != QU_UNKNOWN) - { - voptgenerror (FLG_SYNTAX, - message ("Multiple special function codes: %s, %s " - "(first code is ignored)", - qual_unparse (specialFunctionCode), - qual_unparse (qu)), - g_currentloc); - } - - specialFunctionCode = qu; -} - -static void reflectSpecialCode (uentry ue) -{ - switch (specialFunctionCode) - { - case QU_UNKNOWN: break; - case QU_PRINTFLIKE: - uentry_setPrintfLike (ue); - break; - case QU_SCANFLIKE: - uentry_setScanfLike (ue); - break; - case QU_MESSAGELIKE: - uentry_setMessageLike (ue); - break; - BADDEFAULT; - } - - specialFunctionCode = QU_UNKNOWN; -} - -static void resetStorageClass (void) -{ - qtype_free (processingType); - processingType = qtype_undefined; - storageClass = SCNONE; -} - -static void reflectModGlobs (uentry ue) -{ - if (fcnNoGlobals) - { - llassert (globSet_isUndefined (currentGlobals)); - - uentry_setGlobals (ue, globSet_undefined); - fcnNoGlobals = FALSE; - } - else if (globSet_isDefined (currentGlobals)) - { - uentry_setGlobals (ue, currentGlobals); - currentGlobals = globSet_undefined; - } - else - { - ; /* no globals */ - } - - if (sRefSet_isDefined (fcnModifies)) - { - uentry_setModifies (ue, fcnModifies); - fcnModifies = sRefSet_undefined; - } - /*drl added*/ - if (fcnConstraints) - { - uentry_setPreconditions (ue, fcnConstraints); - fcnConstraints = constraintList_undefined; - } - - if (fcnEnsuresConstraints) - { - uentry_setPostconditions (ue, fcnEnsuresConstraints); - fcnEnsuresConstraints = constraintList_undefined; - } - /*end drl*/ - - if (uentry_isFunction (ue)) - { - uentry_setSpecialClauses (ue, specClauses); - specClauses = NULL; - DPRINTF (("Done with spec clauses")); - } -} - -static void reflectStorageClass (uentry u) -{ - if (storageClass == SCSTATIC) - { - uentry_setStatic (u); - } - else if (storageClass == SCEXTERN) - { - uentry_setExtern (u); - } - else - { - ; /* no storage class */ - } - - } - -void storeLoc () -{ - saveStoreLoc = g_currentloc; -} - -void setFunctionNoGlobals (void) -{ - llassert (globSet_isUndefined (currentGlobals)); - fcnNoGlobals = TRUE; -} - -void - setFunctionStateSpecialClause (lltok stok, specialClauseKind kind, - sRefSet s, - /*@unused@*/ lltok etok) -{ - int tok = lltok_getTok (stok); - - switch (tok) - { - case QPRECLAUSE: - specClauses = specialClauses_add (specClauses, - specialClause_create (TK_BEFORE, kind, s)); - break; - case QPOSTCLAUSE: - specClauses = specialClauses_add (specClauses, - specialClause_create (TK_AFTER, kind, s)); - break; - default: - sRefSet_free (s); - BADBRANCH; - } - - DPRINTF (("Added to specclauses: %s", specialClauses_unparse (specClauses))); -} - -void setFunctionSpecialClause (lltok stok, sRefSet s, - /*@unused@*/ lltok etok) -{ - int tok = lltok_getTok (stok); - - switch (tok) - { - case QUSES: - specClauses = specialClauses_add (specClauses, specialClause_createUses (s)); - break; - case QDEFINES: - specClauses = specialClauses_add (specClauses, specialClause_createDefines (s)); - break; - case QALLOCATES: - specClauses = specialClauses_add (specClauses, specialClause_createAllocates (s)); - break; - case QSETS: - specClauses = specialClauses_add (specClauses, specialClause_createSets (s)); - break; - case QRELEASES: - specClauses = specialClauses_add (specClauses, specialClause_createReleases (s)); - break; - default: - sRefSet_free (s); - BADBRANCH; - } - - DPRINTF (("Added to specclauses: %s", specialClauses_unparse (specClauses))); -} - -/*drl - */ -constraintList getFunctionConstraints (void) -{ - return constraintList_copy (fcnConstraints); -} - - -constraintList getEnsuresConstraints (void) -{ - return constraintList_copy (fcnEnsuresConstraints); -} - -void setEnsuresConstraints (constraintList c) -{ - #warning m leak - fcnEnsuresConstraints = constraintList_copy (c); -} - -void setFunctionConstraints (constraintList c) -{ - #warning m leak - fcnConstraints = constraintList_copy (c); -} -/* end drl*/ - -void setFunctionModifies (sRefSet s) -{ - sRefSet_free (fcnModifies); - fcnModifies = s; -} - -static void reflectGlobalQualifiers (sRef sr, qualList quals) -{ - qualList_elements (quals, qel) - { - if (qual_isGlobalQual (qel)) /* undef, killed */ - { - sstate oldstate = sRef_getDefState (sr); - sstate defstate = sstate_fromQual (qel); - - if ((oldstate == SS_UNDEFGLOB && defstate == SS_KILLED) - || (oldstate == SS_KILLED && defstate == SS_UNDEFGLOB)) - { - defstate = SS_UNDEFKILLED; - } - else - { - ; /* any errors? */ - } - - sRef_setDefState (sr, defstate, fileloc_undefined); - } - else if (qual_isAllocQual (qel)) /* out, partial, reldef, etc. */ - { - ctype realType = sRef_getType (sr); - sstate defstate = sstate_fromQual (qel); - - if (qual_isRelDef (qel)) - { - ; /* okay anywhere */ - } - else - { - if (!ctype_isAP (realType) - && !ctype_isSU (realType) - && !ctype_isUnknown (realType) - && !ctype_isAbstract (sRef_getType (sr))) - { - llerror - (FLG_SYNTAX, - message ("Qualifier %s used on non-pointer or struct: %q", - qual_unparse (qel), sRef_unparse (sr))); - - } - } - - sRef_setDefState (sr, defstate, fileloc_undefined); - } - else if (qual_isNull (qel)) - { - sRef_setNullState (sr, NS_POSNULL, fileloc_undefined); - } - else if (qual_isRelNull (qel)) - { - sRef_setNullState (sr, NS_RELNULL, fileloc_undefined); - } - else if (qual_isNotNull (qel)) - { - sRef_setNullState (sr, NS_MNOTNULL, fileloc_undefined); - } - else - { - if (qual_isCQual (qel)) - { - ; /* okay */ - } - else - { - llerror (FLG_SYNTAX, - message ("Qualifier %s cannot be used in a globals list", - qual_unparse (qel))); - } - } - } end_qualList_elements; -} - -void globListAdd (sRef sr, qualList quals) -{ - if (sRef_isValid (sr)) - { - sRef sc = sRef_copy (sr); - - reflectGlobalQualifiers (sc, quals); - currentGlobals = globSet_insert (currentGlobals, sc); - } -} - -extern void declareCIter (cstring name, /*@owned@*/ uentryList params) -{ - uentry ue; - - ue = uentry_makeIter (name, - ctype_makeFunction (ctype_void, params), - fileloc_copy (g_currentloc)); - - usymtab_supEntry (uentry_makeEndIter (name, fileloc_copy (g_currentloc))); - - reflectModGlobs (ue); - - ue = usymtab_supGlobalEntryReturn (ue); -} - -extern void nextIterParam (void) -{ - llassert (ProcessingIterVars); - saveIterParamNo++; -} - -extern int iterParamNo (void) -{ - llassert (ProcessingIterVars); - return saveIterParamNo; -} - -/* -** yucky hacks to put it in the right place -*/ - -/*@only@*/ uentry -makeCurrentParam (idDecl t) -{ - uentry ue; - - saveStoreLoc = fileloc_undefined; - - /* param number unknown */ - - ue = uentry_makeParam (t, 0); - return ue; -} - -ctype -declareUnnamedEnum (enumNameList el) -{ - ctype ret = usymtab_enumEnumNameListType (el); - ctype rt; - uentry e; - - if (ctype_isDefined (ret)) - { - rt = ret; - e = uentry_makeEnumTagLoc (ctype_enumTag (rt), ret); - - reflectStorageClass (e); - usymtab_supGlobalEntry (e); - - declareEnumList (el, ret, g_currentloc); - enumNameList_free (el); - } - else - { - ctype ct = ctype_createEnum (fakeTag (), el); - - e = uentry_makeEnumTagLoc (ctype_enumTag (ctype_realType (ct)), ct); - reflectStorageClass (e); - - e = usymtab_supGlobalEntryReturn (e); - rt = uentry_getAbstractType (e); - declareEnumList (el, ct, g_currentloc); - } - - return (rt); -} - -ctype -declareEnum (cstring ename, enumNameList el) -{ - ctype cet; - uentry e; - - llassert (cstring_isDefined (ename)); - - cet = ctype_createEnum (ename, el); - e = uentry_makeEnumTagLoc (ename, cet); - reflectStorageClass (e); - e = usymtab_supGlobalEntryReturn (e); - cet = uentry_getType (e); - declareEnumList (el, cet, uentry_whereLast (e)); - return (uentry_getAbstractType (e)); -} - -static void -declareEnumList (enumNameList el, ctype c, fileloc loc) -{ - bool boolnames = FALSE; - bool othernames = FALSE; - - (void) context_getSaveLocation (); /* undefine it */ - - if (context_maybeSet (FLG_NUMENUMMEMBERS)) - { - int maxnum = context_getValue (FLG_NUMENUMMEMBERS); - int num = enumNameList_size (el); - - if (num > maxnum) - { - voptgenerror - (FLG_NUMENUMMEMBERS, - message ("Enumerator %s declared with %d members (limit is set to %d)", - ctype_unparse (c), num, maxnum), - loc); - } - } - - enumNameList_elements (el, e) - { - uentry ue = usymtab_lookupExposeGlob (e); - ctype ct = uentry_getType (ue); - - llassert (uentry_isEnumConstant (ue)); - - if (ctype_isUnknown (ct)) - { - uentry_setType (ue, c); - } - else - { - if (cstring_equal (e, context_getFalseName ()) - || cstring_equal (e, context_getTrueName ())) - { - if (othernames) - { - if (optgenerror - (FLG_INCONDEFS, - message ("Enumerator mixes boolean name (%s) with " - "non-boolean names", - e), - uentry_whereLast (ue))) - { - ; - } - } - - boolnames = TRUE; - uentry_setType (ue, ctype_bool); - DPRINTF (("Set type: %s / %s", - uentry_unparse (ue), ctype_unparse (ctype_bool))); - } - else - { - if (boolnames) - { - if (optgenerror - (FLG_INCONDEFS, - message ("Enumerator mixes boolean names (%s, %s) with " - "non-boolean name: %s", - context_getTrueName (), - context_getFalseName (), - e), - uentry_whereLast (ue))) - { - ; - } - } - - othernames = TRUE; - } - - if (!ctype_match (c, ct)) - { - if (ctype_isDirectBool (ct)) - { - if (cstring_equal (e, context_getFalseName ()) - || cstring_equal (e, context_getTrueName ())) - { - DPRINTF (("Here we are!")); - } - else - { - if (optgenerror - (FLG_INCONDEFS, - message ("Enumerator member %s declared with " - "inconsistent type: %s", - e, ctype_unparse (c)), - uentry_whereLast (ue))) - { - uentry_showWhereSpecifiedExtra - (ue, cstring_copy (ctype_unparse (ct))); - } - } - } - else - { - if (optgenerror - (FLG_INCONDEFS, - message ("Enumerator member %s declared with " - "inconsistent type: %s", - e, ctype_unparse (c)), - uentry_whereLast (ue))) - { - uentry_showWhereSpecifiedExtra - (ue, cstring_copy (ctype_unparse (ct))); - } - } - } - } - } end_enumNameList_elements; -} - -static /*@dependent@*/ uentryList currentParamList; - -void setCurrentParams (/*@dependent@*/ uentryList ue) -{ - currentParamList = ue; -} - -void clearCurrentParams (void) -{ - currentParamList = uentryList_undefined; -} - -/* -** requires: uentry_isFunction (e) -** parameter names for current function are in currentParamList -*/ - -static void enterFunctionParams (uentryList params) -{ - int paramno = 0; - - uentryList_elements (params, current) - { - if (uentry_hasName (current)) - { - uentry_setParamNo (current, paramno); - usymtab_supEntry (uentry_copy (current)); - } - - paramno++; - } end_uentryList_elements; -} - - -extern void enterParamsTemp (void) -{ - usymtab_enterScope (); - enterFunctionParams (currentParamList); -} - -extern void exitParamsTemp (void) -{ - usymtab_quietPlainExitScope (); -} - -static /*@exposed@*/ uentry globalDeclareFunction (idDecl tid) -{ - ctype deftype = idDecl_getCtype (tid); - ctype rettype; - uentry ue; - - DPRINTF (("Global function: %s", idDecl_unparse (tid))); - - if (ctype_isFunction (deftype)) - { - rettype = ctype_returnValue (deftype); - } - else - { - rettype = ctype_unknown; - } - - /* - ** check has been moved here... - */ - - if (ctype_isFunction (idDecl_getCtype (tid))) - { - ue = uentry_makeIdFunction (tid); - reflectSpecialCode (ue); - reflectArgsUsed (ue); - } - else - { - llparseerror (message ("Inconsistent function declaration: %q", - idDecl_unparse (tid))); - - tid = idDecl_replaceCtype - (tid, ctype_makeFunction (ctype_unknown, uentryList_undefined)); - ue = uentry_makeIdFunction (tid); - } - - reflectStorageClass (ue); - - uentry_checkParams (ue); - reflectModGlobs (ue); - - ue = usymtab_supGlobalEntryReturn (ue); - context_enterFunction (ue); - enterFunctionParams (uentry_getParams (ue)); - - resetStorageClass (); - return (ue); -} - -/* -** for now, no type checking -** (must check later though!) -*/ - -static /*@only@*/ uentry globalDeclareOldStyleFunction (idDecl tid) -{ - uentry ue; - - /* - ** check has been moved here... - */ - - if (cstring_equalLit (idDecl_observeId (tid), "main")) - { - context_setFlagTemp (FLG_MAINTYPE, FALSE); - } - - ue = uentry_makeIdFunction (tid); - reflectStorageClass (ue); - reflectSpecialCode (ue); - reflectArgsUsed (ue); - uentry_setDefined (ue, g_currentloc); - - uentry_checkParams (ue); - - if (ProcessingGlobals) - { - uentry_setGlobals (ue, currentGlobals); - } - - resetStorageClass (); - return (ue); -} - -static void oldStyleDeclareFunction (/*@only@*/ uentry e) -{ - uentryList params = saveParamList; - ctype rt = uentry_getType (e); - - llassert (ctype_isFunction (rt)); - - e = usymtab_supGlobalEntryReturn (e); - - context_enterFunction (e); - enterFunctionParams (params); - saveParamList = uentryList_undefined; - resetStorageClass (); -} - -void declareFunction (idDecl tid) /*@globals undef saveFunction; @*/ -{ - uentry ue; - - DPRINTF (("Declare function: %s", idDecl_unparse (tid))); - - if (ProcessingParams) - { - ue = globalDeclareOldStyleFunction (tid); - saveFunction = ue; - } - else - { - saveFunction = uentry_undefined; - - if (context_inRealFunction ()) - { - ue = uentry_makeVariableLoc (idDecl_observeId (tid), ctype_unknown); - - llparseerror (message ("Function declared inside function: %q", - idDecl_unparse (tid))); - - context_quietExitFunction (); - ue = usymtab_supEntryReturn (ue); - } - else - { - if (context_inInnerScope ()) - { - llparseerror (message ("Declaration in inner context: %q", - idDecl_unparse (tid))); - - sRef_setGlobalScope (); - ue = uentry_makeVariableLoc (idDecl_observeId (tid), - ctype_unknown); - ue = usymtab_supGlobalEntryReturn (ue); - sRef_clearGlobalScope (); - } - else - { - ue = globalDeclareFunction (tid); - } - } - - resetGlobals (); - } - - resetStorageClass (); - idDecl_free (tid); -} - -void declareStaticFunction (idDecl tid) /*@globals undef saveFunction; @*/ -{ - uentry ue; - - DPRINTF (("Declare static funciton: %s", idDecl_unparse (tid))); - - if (ProcessingParams) - { - ue = globalDeclareOldStyleFunction (tid); - saveFunction = ue; - } - else - { - saveFunction = uentry_undefined; - - if (context_inRealFunction ()) - { - ue = uentry_makeVariableLoc (idDecl_observeId (tid), ctype_unknown); - - llparseerror (message ("Function declared inside function: %q", - idDecl_unparse (tid))); - - context_quietExitFunction (); - ue = usymtab_supEntryReturn (ue); - } - else - { - if (context_inInnerScope ()) - { - llparseerror (message ("Declaration in inner context: %q", - idDecl_unparse (tid))); - - sRef_setGlobalScope (); - ue = uentry_makeVariableLoc (idDecl_observeId (tid), - ctype_unknown); - ue = usymtab_supGlobalEntryReturn (ue); - sRef_clearGlobalScope (); - } - else - { - ctype deftype = idDecl_getCtype (tid); - ctype rettype; - - if (ctype_isFunction (deftype)) - { - rettype = ctype_returnValue (deftype); - } - else - { - rettype = ctype_unknown; - } - - /* - ** check has been moved here... - */ - - if (ctype_isFunction (idDecl_getCtype (tid))) - { - ue = uentry_makeIdFunction (tid); - reflectSpecialCode (ue); - reflectArgsUsed (ue); - } - else - { - llparseerror (message ("Inconsistent function declaration: %q", - idDecl_unparse (tid))); - - tid = idDecl_replaceCtype - (tid, ctype_makeFunction (ctype_unknown, uentryList_undefined)); - ue = uentry_makeIdFunction (tid); - } - - reflectStorageClass (ue); - uentry_setStatic (ue); - - uentry_checkParams (ue); - reflectModGlobs (ue); - - DPRINTF (("Sub global entry: %s", uentry_unparse (ue))); - ue = usymtab_supGlobalEntryReturn (ue); - - context_enterFunction (ue); - enterFunctionParams (uentry_getParams (ue)); - resetStorageClass (); - } - } - - resetGlobals (); - } - - resetStorageClass (); - idDecl_free (tid); -} - -void -checkTypeDecl (uentry e, ctype rep) -{ - cstring n = uentry_getName (e); - - DPRINTF (("Check type decl: %s", n)); - - if (cstring_equal (context_getBoolName (), n)) - { - ctype rrep = ctype_realType (rep); - - /* - ** for abstract enum types, we need to fix the enum members: - ** they should have the abstract type, not the rep type. - */ - - if (ctype_isEnum (ctype_realType (rrep))) - { - enumNameList el = ctype_elist (rrep); - - enumNameList_elements (el, ye) - { - if (usymtab_existsGlob (ye)) - { - uentry ue = usymtab_lookupSafe (ye); - uentry_setType (ue, ctype_bool); - } - - if (cstring_equal (context_getTrueName (), ye) - || cstring_equal (context_getFalseName (), ye)) - { - ; - } - else - { - vgenhinterror - (FLG_SYNTAX, - message ("Member of boolean enumerated type definition " - "does not match name set to represent TRUE " - "or FALSE: %s", - ye), - message ("Use -boolfalse and -booltrue to set the " - "name of false and true boolean values."), - uentry_whereDefined (e)); - } - } end_enumNameList_elements; - } - } - - if (usymtab_exists (n)) - { - usymId llm = usymtab_getId (n); - uentry le = usymtab_getTypeEntry (llm); - - uentry_setDeclared (e, g_currentloc); - uentry_setSref (e, sRef_makeGlobal (llm, uentry_getType (le))); - - DPRINTF (("Here we are: %s / %s", - n, context_getBoolName ())); - - if (uentry_isAbstractDatatype (le)) - { - ctype rrep = ctype_realType (rep); - - /* - ** for abstract enum types, we need to fix the enum members: - ** they should have the abstract type, not the rep type. - */ - - if (ctype_isEnum (ctype_realType (rrep))) - { - ctype at = uentry_getAbstractType (le); - enumNameList el = ctype_elist (rrep); - - enumNameList_elements (el, ye) - { - if (usymtab_existsGlob (ye)) - { - uentry ue = usymtab_lookupSafe (ye); - - llassert (uentry_isEitherConstant (ue)); - llassertprint (ctype_match (uentry_getType (ue), rrep), - ("Bad enum: %s / %s", - uentry_unparse (ue), - ctype_unparse (rrep))); - - uentry_setType (ue, at); - } - } end_enumNameList_elements; - } - - if (uentry_isMutableDatatype (le)) - { - /* maybe more complicated if abstract and immutable ? */ - - if (!ctype_isRealPointer (rep) && !ctype_isRealAbstract (rep)) - { - voptgenerror - (FLG_MUTREP, - message ("Mutable abstract type %s declared without pointer " - "indirection: %s (violates assignment semantics)", - n, ctype_unparse (rep)), - uentry_whereDefined (e)); - - uentry_setMutable (e); - } - } - } - } - else - { - fileloc fl = uentry_whereDeclared (e); - - if (context_getFlag (FLG_LIKELYBOOL) - && !context_getFlag (FLG_BOOLINT)) - { - if ((cstring_equalLit (n, "BOOL") - || cstring_equalLit (n, "Bool") - || cstring_equalLit (n, "bool") - || cstring_equalLit (n, "boolean") - || cstring_equalLit (n, "Boolean") - || cstring_equalLit (n, "BOOLEAN")) - && !(cstring_equal (n, context_getBoolName ()))) - { - if (context_setBoolName ()) { - voptgenerror - (FLG_LIKELYBOOL, - message ("Type %s is probably meant as a boolean type, but does " - "not match the boolean type name \"%s\".", - n, - context_getBoolName ()), - fl); - } else - voptgenerror - (FLG_LIKELYBOOL, - message ("Type %s is probably meant as a boolean type, " - "but the boolean type name is not set. " - "Use -booltype %s to set it.", - n, - n), - fl); - } - } - - if (!uentry_isStatic (e) - && !ctype_isFunction (uentry_getType (e)) - && !fileloc_isLib (fl) - && !fileloc_isImport (fl) - && fileloc_isHeader (fl)) - { - voptgenerror (FLG_EXPORTTYPE, - message ("Type exported, but not specified: %s\n", n), - fl); - } - } - - cstring_free (n); -} - -uentryList -fixUentryList (idDeclList tl, qtype q) -{ - uentryList f = uentryList_new (); - - idDeclList_elements (tl, i) - { - if (idDecl_isDefined (i)) - { - uentry ue; - uentry old; - ctype rt; - - (void) idDecl_fixBase (i, q); - - /* - ** implicit annotations - */ - - (void) fixStructDecl (i); - - ue = uentry_makeIdVariable (i); - rt = ctype_realType (uentry_getType (ue)); - - /* - ** where is this here??? - - if (ctype_isArray (rt) || ctype_isSU (rt)) - { - sRef_setAllocated (uentry_getSref (ue), uentry_whereDefined (ue)); - } - - ** - */ - - if (uentry_isValid (old = uentryList_lookupField (f, uentry_rawName (ue)))) - { - if (optgenerror (FLG_SYNTAX, - message ("Field name reused: %s", uentry_rawName (ue)), - uentry_whereDefined (ue))) - { - llgenmsg (message ("Previous use of %s", uentry_rawName (ue)), - uentry_whereDefined (old)); - } - } - - f = uentryList_add (f, ue); - } - } end_idDeclList_elements; - - idDeclList_free (tl); - return (f); -} - -/* -** This is a hack to support unnamed struct/union fields as done by -** Microsoft VC++. It is not supported by the ANSI standard. -** -** The inner fields are added to the outer structure. This is meaningful -** for nesting structs inside unions, but lclint does no related -** checking. -*/ - -uentryList -fixUnnamedDecl (qtype q) -{ - ctype ct = ctype_realType (qtype_getType (q)); - - if (ctype_isStruct (ct) || ctype_isUnion (ct)) - { - uentryList res = ctype_getFields (ct); - - return (uentryList_copy (res)); - } - else - { - BADBRANCHCONT; - } - - return uentryList_undefined; -} - -void setStorageClass (storageClassCode sc) -{ - storageClass = sc; -} - -void -setProcessingIterVars (uentry iter) -{ - ProcessingIterVars = TRUE; - currentIter = iter; - saveIterParamNo = 0; -} - -void -setProcessingGlobalsList () -{ - ProcessingGlobals = TRUE; - - llassert (globSet_isUndefined (currentGlobals)); - currentGlobals = globSet_undefined; - - llassert (sRefSet_isUndefined (fcnModifies)); - fcnModifies = sRefSet_undefined; - - /* - ** No, special clauses might have been processed first! - llassert (specialClauses_isUndefined (specClauses)); - specClauses = specialClauses_undefined; - */ - - fcnNoGlobals = FALSE; -} - -static bool ProcessingGlobMods = FALSE; - -void -setProcessingGlobMods () -{ - ProcessingGlobMods = TRUE; -} - -void -clearProcessingGlobMods () -{ - ProcessingGlobMods = FALSE; -} - -bool -isProcessingGlobMods () -{ - return (ProcessingGlobMods); -} - -static void resetGlobals (void) -{ - ProcessingGlobals = FALSE; - currentGlobals = globSet_undefined; - llassert (sRefSet_isUndefined (fcnModifies)); - fcnModifies = sRefSet_undefined; - fcnNoGlobals = FALSE; -} - -void -unsetProcessingGlobals () -{ - ProcessingGlobals = FALSE; -} - -void -setProcessingVars (/*@only@*/ qtype q) -{ - ProcessingVars = TRUE; - qtype_free (processingType); - processingType = q; -} - -static void -setGenericParamList (/*@dependent@*/ uentryList pm) -{ - ProcessingParams = TRUE; - saveParamList = pm; -} - -void -setProcessingTypedef (/*@only@*/ qtype q) -{ - ProcessingTypedef = TRUE; - - qtype_free (processingType); - processingType = q; -} - -void -unsetProcessingVars () -{ - resetStorageClass (); - ProcessingVars = FALSE; -} - -void -doneParams () -{ - if (ProcessingParams) - { - if (uentry_isInvalid (saveFunction)) - { - llbuglit ("unsetProcessingVars: no saved function\n"); - - if (sRefSet_isDefined (fcnModifies)) { - sRefSet_free (fcnModifies); - fcnModifies = sRefSet_undefined; - } - } - else - { - ctype ct = ctype_returnValue (uentry_getType (saveFunction)); - uentryList params = uentryList_copy (saveParamList); - ctype ct2 = ctype_makeFunction (ct, params); - - uentry_setType (saveFunction, ct2); - ProcessingParams = FALSE; - - reflectModGlobs (saveFunction); - oldStyleDeclareFunction (saveFunction); - saveFunction = uentry_undefined; - resetGlobals (); - } - } - else - { - /* - ** If the paramlist used a type name, we could be here. - */ - - llfatalerror (message ("%q: Old-style function parameter list uses a " - "type name.", fileloc_unparse (g_currentloc))); - } -} - -void -checkDoneParams () -{ - if (uentry_isValid (saveFunction)) - { - /* - ** old style declaration - */ - - ctype ct = ctype_returnValue (uentry_getType (saveFunction)); - ctype ct2; - - uentryList_elements (saveParamList, current) - { - uentry_setType (current, ctype_int); /* all params are ints */ - } end_uentryList_elements; - - ct2 = ctype_makeParamsFunction (ct, uentryList_copy (saveParamList)); - - uentry_setType (saveFunction, ct2); - ProcessingParams = FALSE; - - oldStyleDeclareFunction (saveFunction); - saveFunction = uentry_undefined; - } -} - -void -unsetProcessingTypedef () -{ - ProcessingTypedef = FALSE; -} - -void checkConstant (qtype t, idDecl id) -{ - uentry e; - - id = idDecl_fixBase (id, t); - e = uentry_makeIdConstant (id); - - reflectStorageClass (e); - resetStorageClass (); - - usymtab_supGlobalEntry (e); -} - -void checkValueConstant (qtype t, idDecl id, exprNode e) -{ - uentry ue; - - id = idDecl_fixBase (id, t); - ue = uentry_makeIdConstant (id); - reflectStorageClass (ue); - resetStorageClass (); - - if (exprNode_isDefined (e)) - { - if (!exprNode_matchType (uentry_getType (ue), e)) - { - (void) gentypeerror - (exprNode_getType (e), e, - uentry_getType (ue), exprNode_undefined, - message ("Constant %q initialized to type %t, expects %t: %s", - uentry_getName (ue), - exprNode_getType (e), - uentry_getType (ue), - exprNode_unparse (e)), - exprNode_loc (e)); - } - else - { - if (exprNode_hasValue (e)) - { - uentry_mergeConstantValue (ue, multiVal_copy (exprNode_getValue (e))); - } - } - } - - usymtab_supGlobalEntry (ue); -} - - -void processNamedDecl (idDecl t) -{ - if (qtype_isUndefined (processingType)) - { - llparseerror (message ("No type before declaration name: %q", idDecl_unparse (t))); - - processingType = qtype_create (ctype_unknown); - } - - t = idDecl_fixBase (t, processingType); - - DPRINTF (("Declare: %s", idDecl_unparse (t))); - - if (ProcessingGlobals) - { - cstring id = idDecl_getName (t); - uentry ue = usymtab_lookupSafe (id); - - if (!uentry_isValid (ue)) - { - llerror (FLG_UNRECOG, - message ("Variable used in globals list is undeclared: %s", id)); - } - else - { - if (!ctype_match (uentry_getType (ue), idDecl_getCtype (t))) - { - voptgenerror - (FLG_INCONDEFS, - message ("Variable %s used in globals list declared %s, " - "but listed as %s", - id, ctype_unparse (uentry_getType (ue)), - ctype_unparse (idDecl_getCtype (t))), - g_currentloc); - } - else - { - sRef sr = sRef_copy (uentry_getSref (ue)); - - reflectGlobalQualifiers (sr, idDecl_getQuals (t)); - - currentGlobals = globSet_insert (currentGlobals, sr); - } - } - } - else if (ProcessingVars) - { - uentry e; - ctype ct; - - ct = ctype_realType (idDecl_getCtype (t)); - - if (ProcessingParams) - { - cstring id = idDecl_getName (t); - int paramno = uentryList_lookupRealName (saveParamList, id); - - if (paramno >= 0) - { - uentry cparam = uentryList_getN (saveParamList, paramno); - - uentry_setType (cparam, idDecl_getCtype (t)); - uentry_reflectQualifiers (cparam, idDecl_getQuals (t)); - uentry_setDeclaredOnly (cparam, context_getSaveLocation ()); - } - else - { - llfatalerrorLoc - (message ("Old style declaration uses unlisted parameter: %s", - id)); - } - } - else - { - fileloc loc; - - if (context_inIterDef ()) - { - cstring pname = makeParam (idDecl_observeId (t)); - uentry p = usymtab_lookupSafe (pname); - - cstring_free (pname); - - if (uentry_isYield (p)) - { - e = uentry_makeParam (t, sRef_getParam (uentry_getSref (p))); - - uentry_checkYieldParam (p, e); - - usymtab_supEntrySref (e); - return; - } - } - - if ((hasSpecialCode () || argsUsed) - && ctype_isFunction (idDecl_getCtype (t))) - { - e = uentry_makeIdFunction (t); - reflectSpecialCode (e); - reflectArgsUsed (e); - } - else - { - e = uentry_makeIdVariable (t); - } - - loc = uentry_whereDeclared (e); - - /* - if (context_inGlobalScope ()) - { - uentry_checkParams was here! - } - */ - - if (ctype_isFunction (uentry_getType (e))) - { - reflectModGlobs (e); - } - else - { - llassert (!globSet_isDefined (currentGlobals) - && !sRefSet_isDefined (fcnModifies)); - } - - e = usymtab_supEntrySrefReturn (e); - - if (uentry_isExtern (e) && !context_inGlobalScope ()) - { - voptgenerror - (FLG_NESTEDEXTERN, - message ("Declaration using extern inside function scope: %q", - uentry_unparse (e)), - g_currentloc); - - uentry_setDefined (e, fileloc_getExternal ()); - sRef_setDefined (uentry_getSref (e), fileloc_getExternal ()); - } - - if (uentry_isFunction (e)) - { - uentry_checkParams (e); - checkParamNames (e); - } - - if (uentry_isVar (e) - && uentry_isCheckedUnknown (e)) - { - sRef sr = uentry_getSref (e); - - if (sRef_isLocalVar (sr)) - { - if (context_getFlag (FLG_IMPCHECKMODINTERNALS)) - { - uentry_setCheckMod (e); - } - else - { - uentry_setUnchecked (e); - } - } - else if (sRef_isFileStatic (sr)) - { - if (context_getFlag (FLG_IMPCHECKEDSTRICTSTATICS)) - { - uentry_setCheckedStrict (e); - } - else if (context_getFlag (FLG_IMPCHECKEDSTATICS)) - { - uentry_setChecked (e); - } - else if (context_getFlag (FLG_IMPCHECKMODSTATICS)) - { - uentry_setCheckMod (e); - } - else - { - ; - } - } - else /* real global */ - { - llassert (sRef_isRealGlobal (sr)); - - if (context_getFlag (FLG_IMPCHECKEDSTRICTGLOBALS)) - { - uentry_setCheckedStrict (e); - } - else if (context_getFlag (FLG_IMPCHECKEDGLOBALS)) - { - uentry_setChecked (e); - } - else if (context_getFlag (FLG_IMPCHECKMODGLOBALS)) - { - uentry_setCheckMod (e); - } - else - { - ; - } - } - } - } - } - else if (ProcessingTypedef) - { - ctype ct = idDecl_getCtype (t); - uentry e; - - DPRINTF (("Processing typedef: %s", ctype_unparse (ct))); - - e = uentry_makeIdDatatype (t); - - if (cstring_equal (idDecl_getName (t), context_getBoolName ())) { - ctype rt = ctype_realType (ct); - - if (ctype_isEnum (rt)) { - ; - } else { - if (!(ctype_isInt (rt) - || ctype_isUnknown (rt) - || ctype_isChar (rt))) { - (void) llgenerror - (FLG_BOOLTYPE, - message ("Boolean type %s defined using non-standard type %s (integral, char or enum type expected)", - context_getBoolName (), - ctype_unparse (ct)), - uentry_whereLast (e)); - } - - ct = ctype_bool; - uentry_setType (e, ct); - } - } - - reflectStorageClass (e); - checkTypeDecl (e, ct); - - e = usymtab_supReturnTypeEntry (e); - - if (uentry_isMaybeAbstract (e)) - { - if (context_getFlag (FLG_IMPABSTRACT)) - { - uentry_setAbstract (e); - } - else - { - uentry_setConcrete (e); - } - } - } - else - { - llparseerror (message ("Suspect missing struct or union keyword: %q", - idDecl_unparse (t))); - } - - } - -/* -** moved from grammar -*/ - -static idDecl fixStructDecl (/*@returned@*/ idDecl d) -{ - if (ctype_isVisiblySharable (idDecl_getCtype (d)) - && context_getFlag (FLG_STRUCTIMPONLY)) - { - if (!qualList_hasAliasQualifier (idDecl_getQuals (d))) - { - if (qualList_hasExposureQualifier (idDecl_getQuals (d))) - { - idDecl_addQual (d, qual_createDependent ()); - } - else - { - idDecl_addQual (d, qual_createImpOnly ()); - } - } - } - - return d; -} - -ctype -declareUnnamedStruct (/*@only@*/ uentryList f) -{ - if (context_maybeSet (FLG_NUMSTRUCTFIELDS)) - { - int num = uentryList_size (f); - int max = context_getValue (FLG_NUMSTRUCTFIELDS); - - if (num > max) - { - voptgenerror - (FLG_NUMSTRUCTFIELDS, - message ("Structure declared with %d fields " - "(limit is set to %d)", - num, max), - g_currentloc); - } - } - - return (ctype_createUnnamedStruct (f)); -} - -ctype -declareUnnamedUnion (/*@only@*/ uentryList f) -{ - if (context_maybeSet (FLG_NUMSTRUCTFIELDS)) - { - int num = uentryList_size (f); - int max = context_getValue (FLG_NUMSTRUCTFIELDS); - - if (num > max) - { - voptgenerror - (FLG_NUMSTRUCTFIELDS, - message ("Union declared with %d fields " - "(limit is set to %d)", - num, max), - g_currentloc); - } - } - - return (ctype_createUnnamedUnion (f)); -} - -ctype declareStruct (cstring id, /*@only@*/ uentryList f) -{ - ctype ct; - uentry ue; - int num = uentryList_size (f); - - ct = ctype_createStruct (cstring_copy (id), f); - DPRINTF (("Declare struct: %s [%d]", ctype_unparse (ct), ct)); - ue = uentry_makeStructTagLoc (id, ct); - - if (context_maybeSet (FLG_NUMSTRUCTFIELDS)) - { - int max = context_getValue (FLG_NUMSTRUCTFIELDS); - - if (num > max) - { - voptgenerror - (FLG_NUMSTRUCTFIELDS, - message ("Structure %q declared with %d fields " - "(limit is set to %d)", - uentry_getName (ue), num, max), - uentry_whereLast (ue)); - } - } - - return (usymtab_supTypeEntry (ue)); -} - -ctype declareUnion (cstring id, uentryList f) -{ - ctype ct; - uentry ue; - int num = uentryList_size (f); - - ct = ctype_createUnion (cstring_copy (id), f); - ue = uentry_makeUnionTagLoc (id, ct); - - if (context_maybeSet (FLG_NUMSTRUCTFIELDS)) - { - int max = context_getValue (FLG_NUMSTRUCTFIELDS); - - if (num > max) - { - voptgenerror - (FLG_NUMSTRUCTFIELDS, - message ("Union %q declared with %d fields " - "(limit is set to %d)", - uentry_getName (ue), num, max), - uentry_whereLast (ue)); - } - } - - return (usymtab_supTypeEntry (ue)); -} - -ctype handleStruct (/*@only@*/ cstring id) -{ - if (usymtab_existsStructTag (id)) - { - ctype ct = uentry_getAbstractType (usymtab_lookupStructTag (id)); - - cstring_free (id); - return ct; - } - else - { - return (ctype_createForwardStruct (id)); - } -} - -ctype handleUnion (/*@only@*/ cstring id) -{ - if (usymtab_existsUnionTag (id)) - { - ctype ret = uentry_getAbstractType (usymtab_lookupUnionTag (id)); - cstring_free (id); - return (ret); - } - else - { - return (ctype_createForwardUnion (id)); - } -} - -ctype -handleEnum (cstring id) -{ - if (usymtab_existsEnumTag (id)) - { - ctype ret = uentry_getAbstractType (usymtab_lookupEnumTag (id)); - cstring_free (id); - return ret; - } - else - { - return (declareEnum (id, enumNameList_new ())); - } -} - -bool processingIterVars (void) -{ - return ProcessingIterVars; -} - -uentry getCurrentIter (void) -{ - return currentIter; -} - -static bool flipOldStyle = FALSE; -static bool flipNewStyle = TRUE; - -void setFlipOldStyle () { flipOldStyle = TRUE; } -bool isFlipOldStyle () { return flipOldStyle; } -bool isNewStyle () { return flipNewStyle; } -void setNewStyle () { flipNewStyle = TRUE; } - -/*@dependent@*/ uentryList handleParamIdList (/*@dependent@*/ uentryList params) -{ - int paramno = 0; - - /* - ** this is a really YUCKY hack to handle old style - ** declarations. - */ - - voptgenerror (FLG_OLDSTYLE, - cstring_makeLiteral ("Old style function declaration"), - g_currentloc); - - uentryList_elements (params, current) - { - uentry_setParam (current); - uentry_setSref (current, sRef_makeParam (paramno, ctype_unknown)); - paramno++; - } end_uentryList_elements; - - setGenericParamList (params); - g_expectingTypeName = TRUE; - - return params; -} - -/*@dependent@*/ uentryList handleParamTypeList (/*@returned@*/ uentryList params) -{ - if (flipOldStyle) - { - uentryList_fixMissingNames (params); - - voptgenerror (FLG_OLDSTYLE, - cstring_makeLiteral ("Old style function declaration."), - g_currentloc); - - setGenericParamList (params); - flipOldStyle = FALSE; - g_expectingTypeName = TRUE; - } - - return (params); -} - -void -doVaDcl () -{ - ctype c = ctype_unknown; - cstring id = cstring_makeLiteral ("va_alist"); - uentry e; - - if (ProcessingParams) - { - int i = uentryList_lookupRealName (saveParamList, id); - - if (i >= 0) - { - e = uentry_makeVariableSrefParam (id, c, sRef_makeParam (i, c)); - } - else - { - e = uentry_undefined; /* suppress gcc message */ - llfatalerrorLoc (cstring_makeLiteral ("va_dcl used without va_alist")); - } - } - else - { - llerror (FLG_SYNTAX, cstring_makeLiteral ("va_dcl used outside of function declaration")); - e = uentry_makeVariableLoc (id, c); - } - - cstring_free (id); - uentry_setUsed (e, g_currentloc); - usymtab_supEntrySref (e); -} - -/*@exposed@*/ sRef modListPointer (sRef s) -{ - ctype ct = sRef_getType (s); - ctype rt = ctype_realType (ct); - - if (ctype_isAP (rt)) - { - if (context_inHeader () && ctype_isAbstract (ct)) - { - voptgenerror - (FLG_ABSTRACT, - message - ("Modifies clause in header file dereferences abstract " - "type %s (interface modifies clause should not depend " - "on or expose type representation): %q", - ctype_unparse (ct), - sRef_unparse (s)), - g_currentloc); - } - - return (sRef_constructPointer (s)); - } - else - { - if (ctype_isKnown (rt)) - { - voptgenerror - (FLG_TYPE, - message ("Implementation modifies clause dereferences non-pointer (type %s): %q", - ctype_unparse (rt), - sRef_unparse (s)), - g_currentloc); - } - - return s; - } -} - -/*@exposed@*/ sRef modListFieldAccess (sRef s, cstring f) -{ - ctype ct = sRef_getType (s); - ctype rt = ctype_realType (ct); - - if (ctype_isStructorUnion (rt)) - { - uentry tf = uentryList_lookupField (ctype_getFields (rt), f); - - if (uentry_isUndefined (tf)) - { - voptgenerror (FLG_TYPE, - message ("Modifies list accesses non-existent " - "field %s of %t: %q", f, ct, - sRef_unparse (s)), - g_currentloc); - - cstring_free (f); - return sRef_undefined; - } - else - { - if (ctype_isAbstract (ct) && context_inHeader ()) - { - voptgenerror - (FLG_ABSTRACT, - message - ("Modifies clause in header file accesses abstract " - "type %s (interface modifies clause should not depend " - "on or expose type representation): %q", - ctype_unparse (ct), - sRef_unparse (s)), - g_currentloc); - } - } - - cstring_markOwned (f); - return (sRef_makeField (s, f)); - } - else - { - voptgenerror - (FLG_TYPE, - message ("Modifies clause dereferences non-pointer (type %s): %q", - ctype_unparse (rt), - sRef_unparse (s)), - g_currentloc); - - cstring_free (f); - return s; - } -} - -sRef globListUnrecognized (cstring s) -{ - if (cstring_equalLit (s, "nothing")) - { - return sRef_makeNothing (); - } - else if (cstring_equalLit (s, "internalState")) - { - return sRef_makeInternalState (); - } - else if (cstring_equalLit (s, "fileSystem") - || cstring_equalLit (s, "systemState")) - { - return sRef_makeSystemState (); - } - else - { - voptgenerror - (FLG_UNRECOG, - message ("Unrecognized identifier in globals list: %s", s), - g_currentloc); - - return sRef_undefined; - } -} - -/*@exposed@*/ sRef modListArrowAccess (sRef s, cstring f) -{ - ctype ct = sRef_getType (s); - ctype rt = ctype_realType (ct); - - if (ctype_isRealPointer (rt)) - { - ctype b = ctype_baseArrayPtr (rt); - ctype rb = ctype_realType (b); - - if (ctype_isStructorUnion (rb)) - { - uentry tf = uentryList_lookupField (ctype_getFields (rb), f); - - if (uentry_isUndefined (tf)) - { - voptgenerror (FLG_TYPE, - message ("Modifies list arrow accesses non-existent " - "field %s of %t: %q", f, b, - sRef_unparse (s)), - g_currentloc); - - cstring_free (f); - return sRef_undefined; - } - else - { - if (context_inHeader ()) - { - if (ctype_isAbstract (b)) - { - voptgenerror - (FLG_ABSTRACT, - message - ("Modifies clause in header file arrow accesses abstract " - "type %s (interface modifies clause should not depend " - "on or expose type representation): %q", - ctype_unparse (b), - sRef_unparse (s)), - g_currentloc); - } - } - else - { - if (ctype_isAbstract (ct)) - { - voptgenerror - (FLG_ABSTRACT, - message - ("Modifies clause in header file arrow accesses abstract " - "type %s (interface modifies clause should not depend " - "on or expose type representation): %q", - ctype_unparse (ct), - sRef_unparse (s)), - g_currentloc); - } - } - } - - cstring_markOwned (f); - return (sRef_makeArrow (s, f)); - } - else - { - voptgenerror - (FLG_TYPE, - message ("Modifies clause arrow accesses pointer to " - "non-structure (type %s): %q", - ctype_unparse (rt), - sRef_unparse (s)), - g_currentloc); - } - } - else - { - voptgenerror - (FLG_TYPE, - message ("Modifies clause arrow accesses non-pointer (type %s): %q", - ctype_unparse (rt), - sRef_unparse (s)), - g_currentloc); - } - - cstring_free (f); - return s; -} - -sRef checkSpecClausesId (uentry ue) -{ - cstring s = uentry_rawName (ue); - - if (sRef_isGlobal (uentry_getSref (ue))) - { - voptgenerror - (FLG_SYNTAX, - message ("Global variable %s used special clause. (Global variables " - "are not recognized in special clauses. If there is " - "sufficient interest in support for this, it may be " - "added to a future release. Send mail to " - "lclint@cs.virginia.edu.)", - s), - g_currentloc); - - return sRef_undefined; - } - else - { - if (cstring_equalLit (s, "result")) - { - if (optgenerror - (FLG_SYNTAX, - message ("Special clause list uses %s which is a variable and has special " - "meaning in a modifies list. (Special meaning assumed.)", s), - g_currentloc)) - { - uentry_showWhereDeclared (ue); - } - } - - return uentry_getSref (ue); - } -} -/*drl:1/19/2001 - oops to 1/8/2000 - date is wronge .. - don;t know what the real date is... - -*/ - -/*drl - added 1/8/2000 - based on checkSpecClausesId - called by grammar -*/ -sRef checkbufferConstraintClausesId (uentry ue) -{ - cstring s = uentry_rawName (ue); - if (cstring_equalLit (s, "result")) - { - if (optgenerror - (FLG_SYNTAX, - message ("Special clause list uses %s which is a variable and has special " - "meaning in a modifies list. (Special meaning assumed.)", s), - g_currentloc)) - { - uentry_showWhereDeclared (ue); - } - } - - return uentry_getSref (ue); -} - -void checkModifiesId (uentry ue) -{ - cstring s = uentry_rawName (ue); - - if (cstring_equalLit (s, "nothing") - || cstring_equalLit (s, "internalState") - || cstring_equalLit (s, "systemState") - || (cstring_equalLit (s, "fileSystem"))) - { - if (optgenerror - (FLG_SYNTAX, - message ("Modifies list uses %s which is a variable and has special " - "meaning in a modifies list. (Special meaning assumed.)", s), - g_currentloc)) - { - uentry_showWhereDeclared (ue); - } - } -} - -/*@exposed@*/ sRef fixModifiesId (cstring s) -{ - sRef ret; - cstring pname = makeParam (s); - uentry ue = usymtab_lookupSafe (pname); - - cstring_free (pname); - - if (cstring_equalLit (s, "nothing")) - { - ret = sRef_makeNothing (); - } - else if (cstring_equalLit (s, "internalState")) - { - ret = sRef_makeInternalState (); - } - else if (cstring_equalLit (s, "fileSystem") - || cstring_equalLit (s, "systemState")) - { - ret = sRef_makeSystemState (); - } - else - { - ret = sRef_undefined; - } - - if (sRef_isValid (ret)) - { - if (uentry_isValid (ue)) - { - voptgenerror - (FLG_SYNTAX, - message ("Modifies list uses %s which is a parameter and has special " - "meaning in a modifies list. (Special meaning assumed.)", s), - g_currentloc); - } - } - else - { - if (uentry_isValid (ue)) - { - ret = uentry_getSref (ue); - } - else - { - fileloc loc = fileloc_decColumn (g_currentloc, cstring_length (s)); - ret = sRef_undefined; - - voptgenerror - (FLG_UNRECOG, - message ("Unrecognized identifier in modifies comment: %s", s), - loc); - - fileloc_free (loc); - } - } - - return ret; -} - -sRef fixSpecClausesId (cstring s) -{ - sRef ret; - cstring pname = makeParam (s); - uentry ue = usymtab_lookupSafe (pname); - - cstring_free (pname); - - if (cstring_equalLit (s, "result")) - { - ret = sRef_makeResult (); - } - else - { - ret = sRef_undefined; - } - - if (sRef_isValid (ret)) - { - if (uentry_isValid (ue)) - { - voptgenerror - (FLG_SYNTAX, - message ("Special clause uses %s which is a parameter and has special " - "meaning in a special clause. (Special meaning assumed.)", s), - g_currentloc); - } - } - else - { - if (uentry_isValid (ue)) - { - ret = uentry_getSref (ue); - - if (sRef_isGlobal (ret)) - { - voptgenerror - (FLG_SYNTAX, - message ("Global variable %s used special clause. (Global variables " - "are not recognized in special clauses. If there is " - "sufficient interest in support for this, it may be " - "added to a future release. Send mail to " - "lclint@cs.virginia.edu.)", - s), - g_currentloc); - - ret = sRef_undefined; - } - } - else - { - fileloc loc = fileloc_decColumn (g_currentloc, cstring_length (s)); - ret = sRef_undefined; - - voptgenerror - (FLG_UNRECOG, - message ("Unrecognized identifier in special clause: %s", s), - loc); - - fileloc_free (loc); - } - } - - return ret; -} - -sRef modListArrayFetch (sRef s, /*@unused@*/ sRef mexp) -{ - ctype ct = sRef_getType (s); - ctype rt = ctype_realType (ct); - - if (ctype_isAP (rt)) - { - if (context_inHeader () && ctype_isAbstract (ct)) - { - voptgenerror - (FLG_ABSTRACT, - message - ("Modifies clause in header file indexes abstract " - "type %s (interface modifies clause should not depend " - "on or expose type representation): %q", - ctype_unparse (ct), - sRef_unparse (s)), - g_currentloc); - } - - return (sRef_makeAnyArrayFetch (s)); - } - else - { - voptgenerror - (FLG_TYPE, - message - ("Implementation modifies clause uses array fetch on non-array (type %s): %q", - ctype_unparse (ct), sRef_unparse (s)), - g_currentloc); - return s; - } -} - - - - - - - - diff --git a/src/clause.c b/src/clause.c deleted file mode 100644 index 7e7e256..0000000 --- a/src/clause.c +++ /dev/null @@ -1,155 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** clause.c -*/ - -# include "lclintMacros.nf" -# include "basic.h" - -cstring -clause_unparse (clause cl) -{ - switch (cl) - { - case TRUECLAUSE: return (cstring_makeLiteralTemp ("true")); - case FALSECLAUSE: return (cstring_makeLiteralTemp ("false")); - case ANDCLAUSE: return (cstring_makeLiteralTemp ("and")); - case ORCLAUSE: return (cstring_makeLiteralTemp ("or")); - case DOWHILECLAUSE: return (cstring_makeLiteralTemp ("do ... while")); - case WHILECLAUSE: return (cstring_makeLiteralTemp ("while")); - case ITERCLAUSE: return (cstring_makeLiteralTemp ("iter")); - case FORCLAUSE: return (cstring_makeLiteralTemp ("for")); - case CASECLAUSE: return (cstring_makeLiteralTemp ("case")); - case NOCLAUSE: return (cstring_makeLiteralTemp ("none")); - case SWITCHCLAUSE: return (cstring_makeLiteralTemp ("switch")); - case CONDCLAUSE: return (cstring_makeLiteralTemp ("cond")); - case TRUEEXITCLAUSE: return (cstring_makeLiteralTemp ("trueexit")); - case FALSEEXITCLAUSE: return (cstring_makeLiteralTemp ("falseexit")); - } - - BADEXIT; -} - -cstring -clause_nameTaken (clause cl) -{ - switch (cl) - { - case TRUECLAUSE: return (cstring_makeLiteralTemp ("in true branch")); - case FALSECLAUSE: return (cstring_makeLiteralTemp ("in true branch")); - case ANDCLAUSE: return (cstring_makeLiteralTemp ("in first and clause")); - case ORCLAUSE: return (cstring_makeLiteralTemp ("in first or clause")); - case DOWHILECLAUSE: return (cstring_makeLiteralTemp ("in do ... while body")); - case WHILECLAUSE: return (cstring_makeLiteralTemp ("in while body")); - case ITERCLAUSE: return (cstring_makeLiteralTemp ("in iter body")); - case FORCLAUSE: return (cstring_makeLiteralTemp ("in for body")); - case CASECLAUSE: return (cstring_makeLiteralTemp ("in one case")); - case NOCLAUSE: return (cstring_makeLiteralTemp ("in some clause")); - case SWITCHCLAUSE: return (cstring_makeLiteralTemp ("in one possible execution")); - case CONDCLAUSE: return (cstring_makeLiteralTemp ("in true condition")); - case TRUEEXITCLAUSE: return (cstring_makeLiteralTemp ("in trueexit")); - case FALSEEXITCLAUSE: return (cstring_makeLiteralTemp ("in falseexit")); - } - - BADBRANCH; -} - -cstring -clause_nameAlternate (clause cl) -{ - switch (cl) - { - case TRUECLAUSE: return (cstring_makeLiteralTemp ("in continuation")); - case FALSECLAUSE: return (cstring_makeLiteralTemp ("in false branch")); - case ANDCLAUSE: return (cstring_makeLiteralTemp ("in second and clause")); - case ORCLAUSE: return (cstring_makeLiteralTemp ("in second or clause")); - case DOWHILECLAUSE: return (cstring_makeLiteralTemp ("if loop is not taken")); - case WHILECLAUSE: return (cstring_makeLiteralTemp ("if loop is not taken")); - case ITERCLAUSE: return (cstring_makeLiteralTemp ("if iter body does not execute")); - case FORCLAUSE: return (cstring_makeLiteralTemp ("if for loop body does not execute")); - case CASECLAUSE: return (cstring_makeLiteralTemp ("in other case")); - case NOCLAUSE: - case SWITCHCLAUSE: return (cstring_makeLiteralTemp ("in other possible execution")); - case CONDCLAUSE: return (cstring_makeLiteralTemp ("in false condition")); - case TRUEEXITCLAUSE: return (cstring_makeLiteralTemp ("in trueexit")); - case FALSEEXITCLAUSE: return (cstring_makeLiteralTemp ("in falseexit")); - } - - BADBRANCH; -} - -cstring clause_nameFlip (clause cl, bool flip) -{ - if (flip) - { - return clause_nameAlternate (cl); - } - else - { - return clause_nameTaken (cl); - } -} - -bool clause_isBreakable (clause cl) -{ - return (cl == SWITCHCLAUSE - || cl == WHILECLAUSE - || cl == DOWHILECLAUSE - || cl == FORCLAUSE - || cl == ITERCLAUSE); -} - -bool clause_isLoop (clause cl) -{ - return (cl == WHILECLAUSE - || cl == FORCLAUSE - || cl == ITERCLAUSE - || cl == DOWHILECLAUSE); -} - -bool clause_isConditional (clause cl) -{ - return ( cl == TRUECLAUSE - || cl == FALSECLAUSE - || cl == WHILECLAUSE - || cl == FORCLAUSE - || cl == SWITCHCLAUSE - || cl == ITERCLAUSE); -} - -bool clause_isSwitch (clause cl) -{ - return (cl == SWITCHCLAUSE); -} - -bool clause_isCase (clause cl) -{ - return (cl == CASECLAUSE); -} - -bool clause_isNone (clause cl) -{ - return (cl == NOCLAUSE); -} diff --git a/src/clauseStack.c b/src/clauseStack.c deleted file mode 100644 index 8da6430..0000000 --- a/src/clauseStack.c +++ /dev/null @@ -1,186 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** clauseStack.c -** -** based on list_template.c -** -** where T has T_equal (or change this) and T_unparse -*/ - -# include "lclintMacros.nf" -# include "basic.h" - -clauseStack -clauseStack_new () -{ - clauseStack s = (clauseStack) dmalloc (sizeof (*s)); - - s->nelements = 0; - s->nspace = clauseStackBASESIZE; - s->elements = (clause *) dmalloc (sizeof (*s->elements) * clauseStackBASESIZE); - s->current = 0; - - return (s); -} - -static void -clauseStack_grow (clauseStack s) -{ - int i; - clause *newelements; - - s->nspace += clauseStackBASESIZE; - - newelements = (clause *) dmalloc (sizeof (*newelements) - * (s->nelements + s->nspace)); - - if (newelements == (clause *) 0) - { - llfatalerror (cstring_makeLiteral ("clauseStack_grow: out of memory!")); - } - - for (i = 0; i < s->nelements; i++) - { - newelements[i] = s->elements[i]; - } - - sfree (s->elements); - s->elements = newelements; -} - -void clauseStack_push (clauseStack s, clause el) -{ - if (s->nspace <= 0) - clauseStack_grow (s); - - s->nspace--; - s->elements[s->nelements] = el; - s->nelements++; - } - -void clauseStack_pop (clauseStack s) -{ - s->nelements--; - s->nspace++; - } - -clause clauseStack_top (clauseStack s) -{ - return (s->elements[s->nelements - 1]); -} - -void clauseStack_switchTop (clauseStack s, clause x) -{ - llassert (s->nelements > 0); - - s->elements[s->nelements - 1] = x; -} - -void -clauseStack_removeFirst (clauseStack s, clause key) -{ - if (clauseStack_top (s) == key) - { - clauseStack_pop (s); - } - else - { - int i; - - for (i = s->nelements - 2; i >= 0; i--) - { - clause el = s->elements[i]; - - if (el == key) - { - int j; - - for (j = i; j < s->nelements - 1; j++) - { - s->elements[j] = s->elements[j + 1]; - } - - s->nelements--; - s->nspace++; - return; - } - } - - llbuglit ("clauseStack_removeFirst: not found"); - } -} - -int -clauseStack_controlDepth (clauseStack s) -{ - int depth = 0; - int i; - - for (i = 0; i < s->nelements; i++) - { - clause current = s->elements[i]; - - if (clause_isConditional (current)) - { - depth++; - } - } - - return depth; -} - -cstring -clauseStack_unparse (clauseStack s) -{ - int i; - cstring st = cstring_makeLiteral ("["); - - for (i = 0; i < s->nelements; i++) - { - if (i == 0) - { - st = message ("%q %s", st, clause_unparse (s->elements[i])); - } - else - st = message ("%q, %s", st, clause_unparse (s->elements[i])); - } - - st = message ("%q ]", st); - return st; -} - -void -clauseStack_clear (clauseStack s) -{ - s->nspace += s->nelements; - s->nelements = 0; -} - -void -clauseStack_free (clauseStack s) -{ - sfree (s->elements); - sfree (s); -} diff --git a/src/constraint.c b/src/constraint.c deleted file mode 100644 index 2187b0d..0000000 --- a/src/constraint.c +++ /dev/null @@ -1,613 +0,0 @@ -/* -** constraintList.c -*/ - -//#define DEBUGPRINT 1 - -# include /* for isdigit */ -# include "lclintMacros.nf" -# include "basic.h" -# include "cgrammar.h" -# include "cgrammar_tokens.h" - -# include "exprChecks.h" -# include "aliasChecks.h" -# include "exprNodeSList.h" -//# include "exprData.i" - -/*@i33*/ -/*@-fcnuse*/ -/*@-assignexpose*/ - -constraint constraint_makeNew (void); - - -constraint makeConstraintParse (sRef x, lltok relOp, exprNode cconstant) - -{ - char *t; - int c; - constraint ret; - ret = constraint_makeNew(); - llassert (sRef_isValid(x) ); - if (!sRef_isValid(x)) - return ret; - - - ret->lexpr = constraintExpr_makeTermsRef (x); - #warning fix abstraction - - if (relOp.tok == GE_OP) - ret->ar = GTE; - else if (relOp.tok == LE_OP) - ret->ar = LTE; - else if (relOp.tok == EQ_OP) - ret->ar = EQ; - else - llfatalbug("Unsupported relational operator"); - - - t = cstring_toCharsSafe (exprNode_unparse(cconstant)); - c = atoi( t ); - ret->expr = constraintExpr_makeIntLiteral (c); - - ret->post = TRUE; - // ret->orig = ret; - DPRINTF(("GENERATED CONSTRAINT:")); - DPRINTF( (message ("%s", constraint_print(ret) ) ) ); - return ret; -} - -constraint makeConstraintParse2 (constraintExpr l, lltok relOp, exprNode cconstant) - -{ - char *t; - int c; - constraint ret; - ret = constraint_makeNew(); - llassert (l); - if (!l) - return ret; - - - ret->lexpr = constraintExpr_copy (l); - #warning fix abstraction - - if (relOp.tok == GE_OP) - ret->ar = GTE; - else if (relOp.tok == LE_OP) - ret->ar = LTE; - else if (relOp.tok == EQ_OP) - ret->ar = EQ; - else - llfatalbug("Unsupported relational operator"); - - - t = cstring_toCharsSafe (exprNode_unparse(cconstant)); - c = atoi( t ); - ret->expr = constraintExpr_makeIntLiteral (c); - - ret->post = TRUE; - // ret->orig = ret; - DPRINTF(("GENERATED CONSTRAINT:")); - DPRINTF( (message ("%s", constraint_print(ret) ) ) ); - return ret; -} - - -constraint makeConstraintParse3 (constraintExpr l, lltok relOp, constraintExpr r) -{ - constraint ret; - ret = constraint_makeNew(); - llassert (l); - if (!l) - return ret; - - - ret->lexpr = constraintExpr_copy (l); - #warning fix abstraction - - if (relOp.tok == GE_OP) - ret->ar = GTE; - else if (relOp.tok == LE_OP) - ret->ar = LTE; - else if (relOp.tok == EQ_OP) - ret->ar = EQ; - else - llfatalbug("Unsupported relational operator"); - - ret->expr = constraintExpr_copy (r); - - ret->post = TRUE; - // ret->orig = ret; - DPRINTF(("GENERATED CONSTRAINT:")); - DPRINTF( (message ("%s", constraint_print(ret) ) ) ); - return ret; -} - -constraint constraint_copy (constraint c) -{ - constraint ret; - ret = constraint_makeNew(); - ret->lexpr = constraintExpr_copy (c->lexpr); - ret->ar = c->ar; - ret->expr = constraintExpr_copy (c->expr); - ret->post = c->post; - ret->generatingExpr = c->generatingExpr; - - /*@i33 fix this*/ - if (c->orig != NULL) - ret->orig = constraint_copy (c->orig); - else - ret->orig = NULL; - return ret; -} - -/*like copy expect it doesn't allocate memory for the constraint*/ - -void constraint_overWrite (constraint c1, constraint c2) -{ - c1->lexpr = constraintExpr_copy (c2->lexpr); - c1->ar = c2->ar; - c1->expr = constraintExpr_copy (c2->expr); - c1->post = c2->post; - /*@i33 fix this*/ - if (c2->orig != NULL) - c1->orig = constraint_copy (c2->orig); - else - c1->orig = NULL; - c1->generatingExpr = c2->generatingExpr; -} - -bool constraint_resolve (/*@unused@*/ constraint c) -{ - return FALSE; -} - - - -constraint constraint_makeNew (void) -{ - constraint ret; - ret = dmalloc(sizeof (*ret) ); - ret->lexpr = NULL; - ret->expr = NULL; - ret->ar = LT; - ret->post = FALSE; - ret->orig = NULL; - ret->generatingExpr = NULL; - /*@i23*/return ret; -} - -constraint constraint_addGeneratingExpr (/*@returned@*/ constraint c, exprNode e) -{ - - if (c->generatingExpr == NULL) - { - c->generatingExpr = e; - DPRINTF ((message ("setting generatingExpr for %s to %s", constraint_print(c), exprNode_unparse(e) ) )); - } - else - { - DPRINTF ((message ("Not setting generatingExpr for %s to %s", constraint_print(c), exprNode_unparse(e) ) )); - } - return c; -} - -fileloc constraint_getFileloc (constraint c) -{ - if (c->generatingExpr) - return (exprNode_getfileloc (c->generatingExpr) ); - - return (constraintExpr_getFileloc (c->lexpr) ); - - -} - -static bool checkForMaxSet (constraint c) -{ - if (constraintExpr_hasMaxSet(c->lexpr) || constraintExpr_hasMaxSet(c->expr) ) - return TRUE; - - return FALSE; -} - -bool constraint_hasMaxSet(constraint c) -{ - if (c->orig) - { - if (checkForMaxSet(c->orig) ) - return TRUE; - } - - return (checkForMaxSet(c) ); -} - -constraint constraint_makeReadSafeExprNode ( exprNode po, exprNode ind) -{ - constraint ret = constraint_makeNew(); - // constraintTerm term; - po = exprNode_fakeCopy(po); - ind = exprNode_fakeCopy(ind); - ret->lexpr = constraintExpr_makeMaxReadExpr(po); - ret->ar = GTE; - ret->expr = constraintExpr_makeValueExpr (ind); - return ret; -} - -constraint constraint_makeWriteSafeInt (exprNode po, int ind) -{ - constraint ret = constraint_makeNew(); - - - ret->lexpr =constraintExpr_makeMaxSetExpr(po); - ret->ar = GTE; - ret->expr = constraintExpr_makeValueInt (ind); - /*@i1*/return ret; -} - -constraint constraint_makeSRefSetBufferSize (sRef s, int size) -{ - constraint ret = constraint_makeNew(); - ret->lexpr = constraintExpr_makeSRefMaxset (s); - ret->ar = EQ; - ret->expr = constraintExpr_makeValueInt (size); - ret->post = TRUE; - /*@i1*/return ret; -} - -constraint constraint_makeSRefWriteSafeInt (sRef s, int ind) -{ - constraint ret = constraint_makeNew(); - - - ret->lexpr = constraintExpr_makeSRefMaxset (s); - ret->ar = GTE; - ret->expr = constraintExpr_makeValueInt (ind); - ret->post = TRUE; - /*@i1*/return ret; -} - -/* drl added 01/12/2000 - - makes the constraint: Ensures index <= MaxRead(buffer) */ - -constraint constraint_makeEnsureLteMaxRead(exprNode index, exprNode buffer) -{ - constraint ret = constraint_makeNew(); - - ret->lexpr = constraintExpr_makeValueExpr (index); - ret->ar = LTE; - ret->expr = constraintExpr_makeMaxReadExpr(buffer); - ret->post = TRUE; - return ret; -} - -constraint constraint_makeWriteSafeExprNode (exprNode po, exprNode ind) -{ - constraint ret = constraint_makeNew(); - - - ret->lexpr =constraintExpr_makeMaxSetExpr(po); - ret->ar = GTE; - ret->expr = constraintExpr_makeValueExpr (ind); - /*@i1*/return ret; -} - - -constraint constraint_makeReadSafeInt ( exprNode po, int ind) -{ - constraint ret = constraint_makeNew(); - - po = exprNode_fakeCopy(po); - - ret->lexpr = constraintExpr_makeMaxReadExpr(po); - ret->ar = GTE; - ret->expr = constraintExpr_makeValueInt (ind); - return ret; -} - -constraint constraint_makeEnsureMaxReadAtLeast (exprNode e1, exprNode t2, fileloc sequencePoint) -{ - constraint ret = constraint_makeNew(); - - - e1 = exprNode_fakeCopy (e1); - t2 = exprNode_fakeCopy (t2); - - ret = constraint_makeReadSafeExprNode(e1, t2); - - ret->lexpr = constraintExpr_setFileloc (ret->lexpr, sequencePoint); - - ret->post = TRUE; - - // fileloc_incColumn (ret->lexpr->term->loc); - return ret; -} - - -static constraint constraint_makeEnsuresOp (exprNode e1, exprNode e2, fileloc sequencePoint, arithType ar) -{ - constraint ret = constraint_makeNew(); - exprNode e; - - e = exprNode_fakeCopy(e1); - if (! (e1 && e2) ) - { - llcontbug((message("null exprNode, Exprnodes are %s and %s", - exprNode_unparse(e1), exprNode_unparse(e2) ) - )); - } - - ret->lexpr = constraintExpr_makeValueExpr (e); - ret->ar = ar; - ret->post = TRUE; - e = exprNode_fakeCopy(e2); - ret->expr = constraintExpr_makeValueExpr (e); - - ret->lexpr = constraintExpr_setFileloc (ret->lexpr, sequencePoint); - return ret; -} - - -/* make constraint ensures e1 == e2 */ - -constraint constraint_makeEnsureEqual (exprNode e1, exprNode e2, fileloc sequencePoint) -{ - return ( constraint_makeEnsuresOp (e1, e2, sequencePoint, EQ) ); -} - -/*make constraint ensures e1 < e2 */ -constraint constraint_makeEnsureLessThan (exprNode e1, exprNode e2, fileloc sequencePoint) -{ - return ( constraint_makeEnsuresOp (e1, e2, sequencePoint, LT) ); -} - -constraint constraint_makeEnsureLessThanEqual (exprNode e1, exprNode e2, fileloc sequencePoint) -{ - return ( constraint_makeEnsuresOp (e1, e2, sequencePoint, LTE) ); -} - -constraint constraint_makeEnsureGreaterThan (exprNode e1, exprNode e2, fileloc sequencePoint) -{ - return ( constraint_makeEnsuresOp (e1, e2, sequencePoint, GT) ); -} - -constraint constraint_makeEnsureGreaterThanEqual (exprNode e1, exprNode e2, fileloc sequencePoint) -{ - return ( constraint_makeEnsuresOp (e1, e2, sequencePoint, GTE) ); -} - - -exprNode exprNode_copyConstraints (/*@returned@*/ exprNode dst, exprNode src) -{ - dst->ensuresConstraints = constraintList_copy (src->ensuresConstraints ); - dst->requiresConstraints = constraintList_copy (src->requiresConstraints ); - dst->trueEnsuresConstraints = constraintList_copy (src->trueEnsuresConstraints ); - dst->falseEnsuresConstraints = constraintList_copy (src->falseEnsuresConstraints ); - return dst; -} - -constraint constraint_makeMaxSetSideEffectPostDecrement (exprNode e, fileloc sequencePoint) -{ - constraint ret = constraint_makeNew(); - //constraintTerm term; - - e = exprNode_fakeCopy(e); - ret->lexpr = constraintExpr_makeValueExpr (e); - ret->ar = EQ; - ret->post = TRUE; - ret->expr = constraintExpr_makeValueExpr (e); - ret->expr = constraintExpr_makeDecConstraintExpr (ret->expr); - - ret->lexpr = constraintExpr_setFileloc (ret->lexpr, sequencePoint); -// fileloc_incColumn ( ret->lexpr->term->loc); -// fileloc_incColumn ( ret->lexpr->term->loc); - return ret; -} -constraint constraint_makeMaxSetSideEffectPostIncrement (exprNode e, fileloc sequencePoint) -{ - constraint ret = constraint_makeNew(); - //constraintTerm term; - - e = exprNode_fakeCopy(e); - ret->lexpr = constraintExpr_makeValueExpr (e); - ret->ar = EQ; - ret->post = TRUE; - ret->expr = constraintExpr_makeValueExpr (e); - ret->expr = constraintExpr_makeIncConstraintExpr (ret->expr); - - ret->lexpr = constraintExpr_setFileloc (ret->lexpr, sequencePoint); -// fileloc_incColumn ( ret->lexpr->term->loc); -// fileloc_incColumn ( ret->lexpr->term->loc); - return ret; -} - - - -// constraint constraint_makeMaxReadSideEffectPostIncrement (exprNode e, fileloc sequencePoint) -// { -// constraint ret = constraint_makeNew(); -// //constraintTerm term; - -// e = exprNode_fakeCopy(e); -// ret->lexpr = constraintExpr_makeMaxReadExpr(e); -// ret->ar = EQ; -// ret->post = TRUE; -// ret->expr = constraintExpr_makeIncConstraintExpr (e); -// ret->lexpr = constraintExpr_setFileLoc (ret->lexpr, sequencePoint); -// return ret; -// } - - -cstring arithType_print (arithType ar) -{ - cstring st = cstring_undefined; - switch (ar) - { - case LT: - st = cstring_makeLiteral (" < "); - break; - case LTE: - st = cstring_makeLiteral (" <= "); - break; - case GT: - st = cstring_makeLiteral (" > "); - break; - case GTE: - st = cstring_makeLiteral (" >= "); - break; - case EQ: - st = cstring_makeLiteral (" == "); - break; - case NONNEGATIVE: - st = cstring_makeLiteral (" NONNEGATIVE "); - break; - case POSITIVE: - st = cstring_makeLiteral (" POSITIVE "); - break; - default: - llassert(FALSE); - break; - } - return st; -} - -void constraint_printError (constraint c, fileloc loc) -{ - cstring string; - fileloc errorLoc; - - string = constraint_printDetailed (c); - - errorLoc = loc; - - if (constraint_getFileloc(c) ) - errorLoc = constraint_getFileloc(c); - - - if (c->post) - { - voptgenerror (FLG_FUNCTIONPOST, string, errorLoc); - } - else - { - voptgenerror (FLG_FUNCTIONCONSTRAINT, string, errorLoc); - } - -} - -cstring constraint_printDetailed (constraint c) -{ - cstring st = cstring_undefined; - - - if (!c->post) - { - if (c->orig) - st = message ("Unresolved constraint:\nLclint is unable to resolve %s needed to satisfy %s", constraint_print (c), constraint_print(c->orig) ); - else - st = message ("Unresolved constraint:\nLclint is unable to resolve %s", constraint_print (c)); - - } - else - { - if (c->orig) - st = message ("Block Post condition:\nThis function block has the post condition %s\n based on %s", constraint_print (c), constraint_print(c->orig) ); - else - st = message ("Block Post condition:\nThis function block has the post condition %s", constraint_print (c)); - } - - if (context_getFlag (FLG_CONSTRAINTLOCATION) ) - { - cstring temp; - // llassert (c->generatingExpr); - temp = message ("\nOriginal Generating expression %s: %s\n", fileloc_unparse( exprNode_getfileloc (c->generatingExpr) ), - exprNode_unparse(c->generatingExpr) ); - st = cstring_concat (st, temp); - - if (constraint_hasMaxSet(c) ) - { - cstring temp2; - temp2 = message ("\nHas MaxSet\n"); - st = cstring_concat (st, temp2); - } - } - return st; -} - -cstring constraint_print (constraint c) /*@*/ -{ - cstring st = cstring_undefined; - cstring type = cstring_undefined; - llassert (c); - if (c->post) - { - type = cstring_makeLiteral ("Ensures: "); - } - else - { - type = cstring_makeLiteral ("Requires: "); - } - st = message ("%s: %s %s %s", - type, - constraintExpr_print (c->lexpr), - arithType_print(c->ar), - constraintExpr_print(c->expr) - ); - return st; -} - -constraint constraint_doSRefFixBaseParam (constraint precondition, - exprNodeList arglist) -{ - precondition->lexpr = constraintExpr_doSRefFixBaseParam (precondition->lexpr, - arglist); - precondition->expr = constraintExpr_doSRefFixBaseParam (precondition->expr, - arglist); - - return precondition; -} - - -constraint constraint_doFixResult (constraint postcondition, exprNode fcnCall) -{ - postcondition = constraint_copy (postcondition); - postcondition->lexpr = constraintExpr_doFixResult (postcondition->lexpr, fcnCall); - postcondition->expr = constraintExpr_doFixResult (postcondition->expr, fcnCall); - - return postcondition; -} - -constraint constraint_doSRefFixConstraintParam (constraint precondition, - exprNodeList arglist) -{ - - precondition = constraint_copy (precondition); - precondition->lexpr = constraintExpr_doSRefFixConstraintParam (precondition->lexpr, arglist); - precondition->expr = constraintExpr_doSRefFixConstraintParam (precondition->expr, arglist); - - return precondition; -} - -// bool constraint_hasTerm (constraint c, constraintTerm term) -// { -// DPRINTF((message ("Constraint %s", constraint_print (c) ) ) ); - -// if (constraintExpr_includesTerm (c->lexpr, term) ) -// return TRUE; - -// if (constraintExpr_includesTerm (c->expr, term) ) -// return TRUE; - -// return FALSE; -// } - -constraint constraint_preserveOrig (constraint c) -{ - c->orig = constraint_copy (c); - return c; -} -/*@=fcnuse*/ -/*@=assignexpose*/ -/*@=czechfcns@*/ diff --git a/src/constraintGeneration.c b/src/constraintGeneration.c deleted file mode 100644 index 1fb948f..0000000 --- a/src/constraintGeneration.c +++ /dev/null @@ -1,1523 +0,0 @@ - -/* -** constraintGeneration.c -*/ - -//#define DEBUGPRINT 1 - -# include /* for isdigit */ -# include "lclintMacros.nf" -# include "basic.h" -# include "cgrammar.h" -# include "cgrammar_tokens.h" - -# include "exprChecks.h" -# include "aliasChecks.h" -# include "exprNodeSList.h" - -# include "exprData.i" -# include "exprDataQuite.i" - -bool /*@alt void@*/ exprNode_generateConstraints (/*@temp@*/ exprNode e); -static bool exprNode_handleError( exprNode p_e); - -//static cstring exprNode_findConstraints ( exprNode p_e); -static bool exprNode_isMultiStatement(exprNode p_e); -static bool exprNode_multiStatement (exprNode p_e); -bool exprNode_exprTraverse (exprNode e, bool definatelv, bool definaterv, fileloc sequencePoint); -//static void exprNode_constraintPropagateUp (exprNode p_e); -constraintList exprNode_traversRequiresConstraints (exprNode e); -constraintList exprNode_traversEnsuresConstraints (exprNode e); - -constraintList exprNode_traversTrueEnsuresConstraints (exprNode e); -constraintList exprNode_traversFalseEnsuresConstraints (exprNode e); - -extern constraintList reflectChanges (constraintList pre2, constraintList post1); - -void mergeResolve (exprNode parent, exprNode child1, exprNode child2); -exprNode makeDataTypeConstraints (exprNode e); -constraintList constraintList_makeFixedArrayConstraints (sRefSet s); -constraintList checkCall (exprNode fcn, exprNodeList arglist); - -void checkArgumentList (exprNode temp, exprNodeList arglist, fileloc sequencePoint); - -//bool exprNode_testd() -//{ - /* if ( ( (exprNode_isError ) ) ) - { - } - if ( ( (e_1 ) ) ) - { - } - */ -//} - -bool exprNode_isUnhandled (exprNode e) -{ - llassert( exprNode_isDefined(e) ); - switch (e->kind) - { - case XPR_INITBLOCK: - case XPR_EMPTY: - case XPR_LABEL: - case XPR_CONST: - case XPR_VAR: - case XPR_BODY: - case XPR_OFFSETOF: - case XPR_ALIGNOFT: - case XPR_ALIGNOF: - case XPR_VAARG: - case XPR_ITERCALL: - case XPR_ITER: - case XPR_CAST: - case XPR_GOTO: - case XPR_CONTINUE: - case XPR_BREAK: - case XPR_COMMA: - case XPR_COND: - case XPR_TOK: - case XPR_FTDEFAULT: - case XPR_DEFAULT: - case XPR_SWITCH: - case XPR_FTCASE: - case XPR_CASE: - // case XPR_INIT: - case XPR_NODE: - DPRINTF((message ("Warning current constraint generation does not handle expression %s", exprNode_unparse(e)) ) ); - return TRUE; - /*@notreached@*/ - break; - default: - return FALSE; - - } - /*not reached*/ - return FALSE; -} - -bool exprNode_handleError( exprNode e) -{ - if (exprNode_isError (e) || exprNode_isUnhandled(e) ) - { - static /*@only@*/ cstring error = cstring_undefined; - - if (!cstring_isDefined (error)) - { - error = cstring_makeLiteral (""); - } - - /*@-unqualifiedtrans*/ return TRUE; /*@=unqualifiedtrans*/ - } - return FALSE; -} - -bool /*@alt void@*/ exprNode_generateConstraints (/*@temp@*/ exprNode e) -{ - if (exprNode_isError (e) ) - return FALSE; - - e->requiresConstraints = constraintList_new(); - e->ensuresConstraints = constraintList_new(); - e->trueEnsuresConstraints = constraintList_new(); - e->falseEnsuresConstraints = constraintList_new(); - - if (exprNode_isUnhandled (e) ) - { - DPRINTF( (message("Warning ignoring %s", exprNode_unparse (e) ) ) ); - return FALSE; - } - - - // e = makeDataTypeConstraints (e); - - DPRINTF((message ("exprNode_generateConstraints Analysising %s at %s", exprNode_unparse( e), - fileloc_unparse(exprNode_getfileloc(e) ) ) ) ); - - if (exprNode_isMultiStatement ( e) ) - { - exprNode_multiStatement(e); - } - else - { - fileloc loc; - - loc = exprNode_getNextSequencePoint(e); - exprNode_exprTraverse(e, FALSE, FALSE, loc); - - // llassert(FALSE); - return FALSE; - } - - { - constraintList c; - - c = constraintList_makeFixedArrayConstraints (e->uses); - e->requiresConstraints = reflectChanges (e->requiresConstraints, c); - - // e->ensuresConstraints = constraintList_mergeEnsures(c, e->ensuresConstraints); - - } - - /* printf ("%s", (message ("%s", constraintList_printDetailed (e->requiresConstraints) ) ) ); - printf ("%s", (message ("%s", constraintList_printDetailed (e->ensuresConstraints) ) ) ); */ - return FALSE; -} - - -/* handles multiple statements */ - -bool exprNode_isMultiStatement(exprNode e) -{ -if (exprNode_handleError (e) != NULL) - return FALSE; - - switch (e->kind) - { - case XPR_FOR: - case XPR_FORPRED: - case XPR_IF: - case XPR_IFELSE: - case XPR_WHILE: - case XPR_WHILEPRED: - case XPR_DOWHILE: - case XPR_BLOCK: - case XPR_STMT: - case XPR_STMTLIST: - return TRUE; - default: - return FALSE; - } - -} - -bool exprNode_stmt (exprNode e) -{ - exprNode snode; - fileloc loc; - bool notError; - char * s; - - if (exprNode_isError(e) ) - { - return FALSE; - } - e->requiresConstraints = constraintList_new(); - e->ensuresConstraints = constraintList_new(); - // e = makeDataTypeConstraints(e); - - - DPRINTF(( "STMT:") ); - s = exprNode_unparse(e); - // DPRINTF ( ( message("STMT: %s ") ) ); - - if (e->kind == XPR_INIT) - { - DPRINTF (("Init") ); - DPRINTF ( (message ("%s ", exprNode_unparse (e)) ) ); - loc = exprNode_getNextSequencePoint(e); /* reduces to an expression */ - notError = exprNode_exprTraverse (e, FALSE, FALSE, loc); - e->requiresConstraints = exprNode_traversRequiresConstraints(e); - e->ensuresConstraints = exprNode_traversEnsuresConstraints(e); - return notError; - } - - if (e->kind != XPR_STMT) - { - - DPRINTF (("Not Stmt") ); - DPRINTF ( (message ("%s ", exprNode_unparse (e)) ) ); - if (exprNode_isMultiStatement (e) ) - { - return exprNode_multiStatement (e ); - } - BPRINTF( (message ("Ignoring non-statement %s", exprNode_unparse(e) ) ) ); - return TRUE; - // llassert(FALSE); - } - - DPRINTF (("Stmt") ); - DPRINTF ( (message ("%s ", exprNode_unparse (e)) ) ); - - snode = exprData_getUopNode (e->edata); - - /* could be stmt involving multiple statements: - i.e. if, while for ect. - */ - - if (exprNode_isMultiStatement (snode)) - { - // llassert(FALSE); - return exprNode_multiStatement (snode); - } - - loc = exprNode_getNextSequencePoint(e); /* reduces to an expression */ - notError = exprNode_exprTraverse (snode, FALSE, FALSE, loc); - e->requiresConstraints = exprNode_traversRequiresConstraints(snode); - // printf ("For: %s \n", exprNode_unparse (e) ); - // printf ("%s\n", constraintList_print(e->requiresConstraints) ); - e->ensuresConstraints = exprNode_traversEnsuresConstraints(snode); - // printf ("Ensures that:\n %s\n", constraintList_print(e->ensuresConstraints) ); - // llassert(notError); - return notError; - -} - - -bool exprNode_stmtList (exprNode e) -{ - exprNode stmt1, stmt2; - if (exprNode_isError (e) ) - { - return FALSE; - } - - e->requiresConstraints = constraintList_new(); - e->ensuresConstraints = constraintList_new(); - // e = makeDataTypeConstraints(e); - - /*Handle case of stmtList with only one statement: - The parse tree stores this as stmt instead of stmtList*/ - if (e->kind != XPR_STMTLIST) - { - return exprNode_stmt(e); - } - llassert (e->kind == XPR_STMTLIST); - DPRINTF(( "STMTLIST:") ); - DPRINTF ((cstring_toCharsSafe (exprNode_unparse(e)) ) ); - stmt1 = exprData_getPairA (e->edata); - stmt2 = exprData_getPairB (e->edata); - - - DPRINTF((" stmtlist ") ); - DPRINTF ((message("XW%s | %s", exprNode_unparse(stmt1), exprNode_unparse(stmt2) ) ) ); - - exprNode_stmt (stmt1); - DPRINTF(("\nstmt after stmtList call " )); - - exprNode_stmt (stmt2); - mergeResolve (e, stmt1, stmt2 ); - - DPRINTF ( (message ("smtlist constraints are: pre: %s \n and \t post %s\n", - constraintList_print(e->requiresConstraints), - constraintList_print(e->ensuresConstraints) ) ) ); - return TRUE; -} - - -exprNode doIf (exprNode e, exprNode test, exprNode body) -{ - DPRINTF ((message ("doIf: %s ", exprNode_unparse(e) ) ) ); - - test->ensuresConstraints = exprNode_traversEnsuresConstraints (test); - test->trueEnsuresConstraints = exprNode_traversTrueEnsuresConstraints(test); - - e->requiresConstraints = reflectChanges (body->requiresConstraints, test->trueEnsuresConstraints); - e->requiresConstraints = reflectChanges (e->requiresConstraints, - test->ensuresConstraints); - e->requiresConstraints = constraintList_addList(e->requiresConstraints, test->requiresConstraints); -#warning bad - e->ensuresConstraints = constraintList_copy (test->ensuresConstraints); - - DPRINTF ((message ("doIf: if requiers %s ", constraintList_print(e->requiresConstraints) ) ) ); - - return e; -} - - -exprNode doWhile (exprNode e, exprNode test, exprNode body) -{ - DPRINTF ((message ("doWhile: %s ", exprNode_unparse(e) ) ) ); - return doIf (e, test, body); -} - -constraintList constraintList_makeFixedArrayConstraints (sRefSet s) -{ - constraintList ret; - ret = constraintList_new(); - - sRefSet_elements (s, el) - { - // llassert (el); - if (sRef_isFixedArray(el) ) - { - int s; - constraint con; - s = sRef_getArraySize(el); - DPRINTF( (message("%s is a fixed array with size %d", - sRef_unparse(el), s) ) ); - con = constraint_makeSRefSetBufferSize (el, (s - 1)); - //con = constraint_makeSRefWriteSafeInt (el, (s - 1)); - ret = constraintList_add(ret, con); - } - else - { - DPRINTF( (message("%s is not a fixed array", - sRef_unparse(el)) ) ); - } - } - end_sRefSet_elements - - return ret; -} - -exprNode makeDataTypeConstraints (exprNode e) -{ - constraintList c; - DPRINTF(("makeDataTypeConstraints")); - - c = constraintList_makeFixedArrayConstraints (e->uses); - - e->ensuresConstraints = constraintList_addList (e->ensuresConstraints, c); - - return e; -} - -void doFor (exprNode e, exprNode forPred, exprNode forBody) -{ - exprNode init, test, inc; - //merge the constraints: modle as if statement - /* init - if (test) - for body - inc */ - init = exprData_getTripleInit (forPred->edata); - test = exprData_getTripleTest (forPred->edata); - inc = exprData_getTripleInc (forPred->edata); - - if ( ( (exprNode_isError (test) /*|| (exprNode_isError(init) )*/ ) || (exprNode_isError (inc) ) ) ) - { - DPRINTF ((message ("strange for statement:%s, ignoring it", exprNode_unparse(e) ) ) ); - return; - } - - forLoopHeuristics(e, forPred, forBody); - - e->requiresConstraints = reflectChanges (forBody->requiresConstraints, test->ensuresConstraints); - e->requiresConstraints = reflectChanges (e->requiresConstraints, test->trueEnsuresConstraints); - e->requiresConstraints = reflectChanges (e->requiresConstraints, forPred->ensuresConstraints); - - if (!forBody->canBreak) - { - e->ensuresConstraints = constraintList_addList(e->ensuresConstraints, forPred->ensuresConstraints); - e->ensuresConstraints = constraintList_addList(e->ensuresConstraints, test->falseEnsuresConstraints); - } - else - { - DPRINTF(("Can break") ); - } - -} - - - -bool exprNode_multiStatement (exprNode e) -{ - - bool ret; - exprData data; - exprNode e1, e2; - exprNode p, trueBranch, falseBranch; - exprNode forPred, forBody; - exprNode init, test, inc; - constraintList cons; - constraintList t, f; - e->requiresConstraints = constraintList_new(); - e->ensuresConstraints = constraintList_new(); - e->trueEnsuresConstraints = constraintList_new(); - e->falseEnsuresConstraints = constraintList_new(); - - // e = makeDataTypeConstraints(e); - - DPRINTF((message ("exprNode_multistatement Analysising %s %s at", exprNode_unparse( e), - fileloc_unparse(exprNode_getfileloc(e) ) ) ) ); - - if (exprNode_handleError (e)) - { - return FALSE; - } - - data = e->edata; - - ret = TRUE; - - switch (e->kind) - { - - case XPR_FOR: - // ret = message ("%s %s", - forPred = exprData_getPairA (data); - forBody = exprData_getPairB (data); - - //first generate the constraints - exprNode_generateConstraints (forPred); - exprNode_generateConstraints (forBody); - - - doFor (e, forPred, forBody); - - break; - - case XPR_FORPRED: - // ret = message ("for (%s; %s; %s)", - exprNode_generateConstraints (exprData_getTripleInit (data) ); - test = exprData_getTripleTest (data); - exprNode_exprTraverse (test,FALSE, FALSE, exprNode_loc(e)); - exprNode_generateConstraints (exprData_getTripleInc (data) ); - - if (!exprNode_isError(test) ) - test->trueEnsuresConstraints = exprNode_traversTrueEnsuresConstraints(test); - - exprNode_generateConstraints (exprData_getTripleInc (data)); - break; - - case XPR_WHILE: - e1 = exprData_getPairA (data); - e2 = exprData_getPairB (data); - - exprNode_exprTraverse (e1, - FALSE, FALSE, exprNode_loc(e1)); - - exprNode_generateConstraints (e2); - - e = doWhile (e, e1, e2); - - break; - - case XPR_IF: - DPRINTF(( "IF:") ); - DPRINTF ((exprNode_unparse(e) ) ); - // ret = message ("if (%s) %s", - e1 = exprData_getPairA (data); - e2 = exprData_getPairB (data); - - exprNode_exprTraverse (e1, - FALSE, FALSE, exprNode_loc(e1)); - - exprNode_generateConstraints (e2); - - e = doIf (e, e1, e2); - - - // e->constraints = constraintList_exprNodemerge (exprData_getPairA (data),exprData_getPairB(data)); - break; - - - case XPR_IFELSE: - DPRINTF(("Starting IFELSE")); - // ret = message ("if (%s) %s else %s", - p = exprData_getTriplePred (data); - trueBranch = exprData_getTripleTrue (data); - falseBranch = exprData_getTripleFalse (data); - - exprNode_exprTraverse (p, - FALSE, FALSE, exprNode_loc(p)); - exprNode_generateConstraints (trueBranch); - exprNode_generateConstraints (falseBranch); - - p->ensuresConstraints = exprNode_traversEnsuresConstraints (p); - p->trueEnsuresConstraints = exprNode_traversTrueEnsuresConstraints(p); - // p->falseEnsuresConstraints = exprNode_traversFalseEnsuresConstraints(p); - - // do requires clauses - - { - constraintList c1, c2; - c1 = constraintList_copy (p->ensuresConstraints); - - cons = reflectChanges (trueBranch->requiresConstraints, p->trueEnsuresConstraints); - cons = reflectChanges (cons, - p->ensuresConstraints); - e->requiresConstraints = constraintList_copy (cons); - /* - cons = reflectChanges (falseBranch->requiresConstraints, p->falseEnsuresConstraints); - cons = reflectChanges (cons, - c1); - e->requiresConstraints = constraintList_addList (e->requiresConstraints, - cons); - e->requiresConstraints = constraintList_addList (e->requiresConstraints, - p->requiresConstraints); - */ - - } - // do ensures clauses - // find the the ensures lists for each subbranch - t = constraintList_mergeEnsures (p->trueEnsuresConstraints, trueBranch->ensuresConstraints); - t = constraintList_mergeEnsures (p->ensuresConstraints, t); - - f = constraintList_mergeEnsures (p->falseEnsuresConstraints, falseBranch->ensuresConstraints); - f = constraintList_mergeEnsures (p->ensuresConstraints, f); - - // find ensures for whole if/else statement - - e->ensuresConstraints = constraintList_logicalOr (t, f); - DPRINTF( ("Done IFELSE") ); - break; - - case XPR_DOWHILE: - // ret = message ("do { %s } while (%s)", - exprNode_generateConstraints (exprData_getPairB (data)); - exprNode_generateConstraints (exprData_getPairA (data)); - break; - - case XPR_BLOCK: - // ret = message ("{ %s }", - exprNode_generateConstraints (exprData_getSingle (data)); - e->requiresConstraints = constraintList_copy ( (exprData_getSingle (data))->requiresConstraints ); - e->ensuresConstraints = constraintList_copy ( (exprData_getSingle (data))->ensuresConstraints ); - // e->constraints = (exprData_getSingle (data))->constraints; - break; - - case XPR_STMT: - case XPR_STMTLIST: - return exprNode_stmtList (e); - /*@notreached@*/ - break; - default: - ret=FALSE; - } - return ret; -} - -bool lltok_isBoolean_Op (lltok tok) -{ - /*this should really be a switch statement but - I don't want to violate the abstraction - maybe this should go in lltok.c */ - - if (lltok_isEq_Op (tok) ) - { - return TRUE; - } - if (lltok_isAnd_Op (tok) ) - - { - - return TRUE; - } - if (lltok_isOr_Op (tok) ) - { - return TRUE; - } - - if (lltok_isGt_Op (tok) ) - { - return TRUE; - } - if (lltok_isLt_Op (tok) ) - { - return TRUE; - } - - if (lltok_isLe_Op (tok) ) - { - return TRUE; - } - - if (lltok_isGe_Op (tok) ) - { - return TRUE; - } - - return FALSE; - -} - - -void exprNode_booleanTraverse (exprNode e, bool definatelv, bool definaterv, fileloc sequencePoint) -{ - constraint cons; -exprNode t1, t2; -exprData data; -lltok tok; -constraintList tempList; -data = e->edata; - -tok = exprData_getOpTok (data); - - -t1 = exprData_getOpA (data); -t2 = exprData_getOpB (data); - - -/* arithmetic tests */ - -if (lltok_isEq_Op (tok) ) -{ - cons = constraint_makeEnsureEqual (t1, t2, sequencePoint); - e->trueEnsuresConstraints = constraintList_add(e->trueEnsuresConstraints, cons); -} - - - if (lltok_isLt_Op (tok) ) - { - cons = constraint_makeEnsureLessThan (t1, t2, sequencePoint); - e->trueEnsuresConstraints = constraintList_add(e->trueEnsuresConstraints, cons); - cons = constraint_makeEnsureGreaterThanEqual (t1, t2, sequencePoint); - e->falseEnsuresConstraints = constraintList_add(e->falseEnsuresConstraints, cons); - } - - -if (lltok_isGe_Op (tok) ) -{ - - cons = constraint_makeEnsureGreaterThanEqual (t1, t2, sequencePoint); - e->trueEnsuresConstraints = constraintList_add(e->trueEnsuresConstraints, cons); - - cons = constraint_makeEnsureLessThan (t1, t2, sequencePoint); - e->falseEnsuresConstraints = constraintList_add(e->falseEnsuresConstraints, cons); - -} - - - if (lltok_isGt_Op (tok) ) -{ - cons = constraint_makeEnsureGreaterThan (t1, t2, sequencePoint); - e->trueEnsuresConstraints = constraintList_add(e->trueEnsuresConstraints, cons); - cons = constraint_makeEnsureLessThanEqual (t1, t2, sequencePoint); - e->falseEnsuresConstraints = constraintList_add(e->falseEnsuresConstraints, cons); -} - -if (lltok_isLe_Op (tok) ) -{ - cons = constraint_makeEnsureLessThanEqual (t1, t2, sequencePoint); - e->trueEnsuresConstraints = constraintList_add(e->trueEnsuresConstraints, cons); - - cons = constraint_makeEnsureGreaterThan (t1, t2, sequencePoint); - e->falseEnsuresConstraints = constraintList_add(e->falseEnsuresConstraints, cons); -} - - - -/*Logical operations */ - - if (lltok_isAnd_Op (tok) ) - - { - //true ensures - tempList = constraintList_copy (t1->trueEnsuresConstraints); - tempList = constraintList_addList (tempList, t2->trueEnsuresConstraints); - e->trueEnsuresConstraints = constraintList_addList(e->trueEnsuresConstraints, tempList); - - //false ensures: fens t1 or tens t1 and fens t2 - tempList = constraintList_copy (t1->trueEnsuresConstraints); - tempList = constraintList_addList (tempList, t2->falseEnsuresConstraints); - tempList = constraintList_logicalOr (tempList, t1->falseEnsuresConstraints); - e->falseEnsuresConstraints =constraintList_addList(e->falseEnsuresConstraints, tempList); - - } - - if (lltok_isOr_Op (tok) ) - { - //false ensures - tempList = constraintList_copy (t1->falseEnsuresConstraints); - tempList = constraintList_addList (tempList, t2->falseEnsuresConstraints); - e->falseEnsuresConstraints = constraintList_addList(e->falseEnsuresConstraints, tempList); - - //true ensures: tens t1 or fens t1 and tens t2 - tempList = constraintList_copy (t1->falseEnsuresConstraints); - tempList = constraintList_addList (tempList, t2->trueEnsuresConstraints); - tempList = constraintList_logicalOr (tempList, t1->trueEnsuresConstraints); - e->trueEnsuresConstraints =constraintList_addList(e->trueEnsuresConstraints, tempList); - - } - -} - -bool exprNode_exprTraverse (exprNode e, bool definatelv, bool definaterv, fileloc sequencePoint) -{ - exprNode t1, t2, fcn; - lltok tok; - bool handledExprNode; - exprData data; - constraint cons; - - if (exprNode_isError(e) ) - { - return FALSE; - } - - DPRINTF((message ("exprNode_exprTraverset Analysising %s %s at", exprNode_unparse( e), - fileloc_unparse(exprNode_getfileloc(e) ) ) ) ); - - e->requiresConstraints = constraintList_new(); - e->ensuresConstraints = constraintList_new(); - e->trueEnsuresConstraints = constraintList_new();; - e->falseEnsuresConstraints = constraintList_new();; - - if (exprNode_isUnhandled (e) ) - { - return FALSE; - } - // e = makeDataTypeConstraints (e); - - handledExprNode = TRUE; - - data = e->edata; - - switch (e->kind) - { - - - case XPR_WHILEPRED: - t1 = exprData_getSingle (data); - exprNode_exprTraverse (t1, definatelv, definaterv, sequencePoint); - e = exprNode_copyConstraints (e, t1); - break; - - case XPR_FETCH: - - if (definatelv ) - { - t1 = (exprData_getPairA (data) ); - t2 = (exprData_getPairB (data) ); - cons = constraint_makeWriteSafeExprNode (t1, t2); - } - else - { - t1 = (exprData_getPairA (data) ); - t2 = (exprData_getPairB (data) ); - cons = constraint_makeReadSafeExprNode (t1, t2 ); - } - - e->requiresConstraints = constraintList_add(e->requiresConstraints, cons); - cons = constraint_makeEnsureMaxReadAtLeast (t1, t2, sequencePoint); - e->ensuresConstraints = constraintList_add(e->ensuresConstraints, cons); - - cons = constraint_makeEnsureLteMaxRead (t2, t1); - e->trueEnsuresConstraints = constraintList_add(e->trueEnsuresConstraints, cons); - - // cons = constraint_makeEnsureMinReadAtMost (t1, t2, sequencePoint); - // e->ensuresConstraints = constraintList_add(e->ensuresConstraints, cons); - - exprNode_exprTraverse (exprData_getPairA (data), FALSE, TRUE, sequencePoint); - exprNode_exprTraverse (exprData_getPairB (data), FALSE, TRUE, sequencePoint); - - /*@i325 Should check which is array/index. */ - break; - - case XPR_PARENS: - exprNode_exprTraverse (exprData_getUopNode (e->edata), definatelv, definaterv, sequencePoint); - // e->constraints = constraintList_exprNodemerge (exprData_getUopNode (e->edata), exprNode_undefined); - break; - case XPR_INIT: - /* //t1 = exprData_getInitId (data); */ - t2 = exprData_getInitNode (data); - //exprNode_exprTraverse (t1, TRUE, FALSE, sequencePoint ); - - exprNode_exprTraverse (t2, definatelv, TRUE, sequencePoint ); - - /* this test is nessecary because some expressions generate a null expression node. function pointer do that -- drl */ - if ( (!exprNode_isError (e)) && (!exprNode_isError(t2)) ) - { - cons = constraint_makeEnsureEqual (e, t2, sequencePoint); - e->ensuresConstraints = constraintList_add(e->ensuresConstraints, cons); - } - - break; - case XPR_ASSIGN: - t1 = exprData_getOpA (data); - t2 = exprData_getOpB (data); - exprNode_exprTraverse (t1, TRUE, definaterv, sequencePoint ); - lltok_unparse (exprData_getOpTok (data)); - exprNode_exprTraverse (t2, definatelv, TRUE, sequencePoint ); - - /* this test is nessecary because some expressions generate a null expression node. function pointer do that -- drl */ - if ( (!exprNode_isError (t1)) && (!exprNode_isError(t2)) ) - { - cons = constraint_makeEnsureEqual (t1, t2, sequencePoint); - e->ensuresConstraints = constraintList_add(e->ensuresConstraints, cons); - } - break; - case XPR_OP: - t1 = exprData_getOpA (data); - t2 = exprData_getOpB (data); - - exprNode_exprTraverse (t1, definatelv, definaterv, sequencePoint ); - tok = exprData_getOpTok (data); - exprNode_exprTraverse (t2, definatelv, definaterv, sequencePoint ); - - if (lltok_isBoolean_Op (tok) ) - exprNode_booleanTraverse (e, definatelv, definaterv, sequencePoint); - - // e->constraints = constraintList_exprNodemerge (exprData_getOpA (data), exprData_getOpB (data)); - break; - case XPR_SIZEOFT: - ctype_unparse (qtype_getType (exprData_getType (data) ) ); - - break; - - case XPR_SIZEOF: - exprNode_exprTraverse (exprData_getSingle (data), definatelv, definaterv, sequencePoint ); - // e->constraints = constraintList_exprNodemerge (exprData_getSingle (e->edata), exprNode_undefined); - break; - - case XPR_CALL: - fcn = exprData_getFcn(data); - - exprNode_exprTraverse (fcn, definatelv, definaterv, sequencePoint ); - exprNodeList_unparse (exprData_getArgs (data) ); - DPRINTF ( (message ("Got call that %s ( %s) ", exprNode_unparse(fcn), exprNodeList_unparse (exprData_getArgs (data) ) ) ) ); - - fcn->requiresConstraints = constraintList_addList (fcn->requiresConstraints, - checkCall (fcn, exprData_getArgs (data) ) ); - - fcn->ensuresConstraints = constraintList_addList (fcn->ensuresConstraints, - getPostConditions(fcn, exprData_getArgs (data),e ) ); - - t1 = exprNode_createNew (exprNode_getType (e) ); - - checkArgumentList (t1, exprData_getArgs(data), sequencePoint); - - - mergeResolve (e, t1, fcn); - - // e->constraints = constraintList_add (e->constraints, constraint_create (e,exprNode_undefined, GT, CALLSAFE ) ); - break; - - case XPR_RETURN: - exprNode_exprTraverse (exprData_getSingle (data), definatelv, definaterv, sequencePoint ); - break; - - case XPR_NULLRETURN: - cstring_makeLiteral ("return");; - break; - - - case XPR_FACCESS: - exprNode_exprTraverse (exprData_getFieldNode (data), definatelv, definaterv, sequencePoint ); - exprData_getFieldName (data) ; - break; - - case XPR_ARROW: - exprNode_exprTraverse (exprData_getFieldNode (data), definatelv, definaterv, sequencePoint ); - exprData_getFieldName (data); - break; - - case XPR_STRINGLITERAL: - cstring_copy (exprData_getLiteral (data)); - break; - - case XPR_NUMLIT: - cstring_copy (exprData_getLiteral (data)); - break; - - case XPR_PREOP: - t1 = exprData_getUopNode(data); - tok = (exprData_getUopTok (data)); - //lltok_unparse (exprData_getUopTok (data)); - exprNode_exprTraverse (t1, definatelv, definaterv, sequencePoint ); - /*handle * pointer access */ - if (lltok_isInc_Op (tok) ) - { - DPRINTF(("doing ++(var)")); - t1 = exprData_getUopNode (data); - cons = constraint_makeMaxSetSideEffectPostIncrement (t1, sequencePoint ); - e->ensuresConstraints = constraintList_add (e->ensuresConstraints, cons); - } - else if (lltok_isDec_Op (tok) ) - { - DPRINTF(("doing --(var)")); - t1 = exprData_getUopNode (data); - cons = constraint_makeMaxSetSideEffectPostDecrement (t1, sequencePoint ); - e->ensuresConstraints = constraintList_add (e->ensuresConstraints, cons); - } - - if (lltok_isMult( exprData_getUopTok (data) ) ) - { - if (definatelv) - { - cons = constraint_makeWriteSafeInt (t1, 0); - } - else - { - cons = constraint_makeReadSafeInt (t1, 0); - } - e->requiresConstraints = constraintList_add(e->requiresConstraints, cons); - } - - /* ! expr */ - if (lltok_isNot_Op (exprData_getUopTok (data) ) ) - { - e->trueEnsuresConstraints = constraintList_copy (t1->falseEnsuresConstraints); - e->falseEnsuresConstraints = constraintList_copy (t1->trueEnsuresConstraints); - } - break; - - case XPR_POSTOP: - - exprNode_exprTraverse (exprData_getUopNode (data), TRUE, definaterv, sequencePoint ); - lltok_unparse (exprData_getUopTok (data)); - if (lltok_isInc_Op (exprData_getUopTok (data) ) ) - { - DPRINTF(("doing ++")); - t1 = exprData_getUopNode (data); - cons = constraint_makeMaxSetSideEffectPostIncrement (t1, sequencePoint ); - e->ensuresConstraints = constraintList_add (e->ensuresConstraints, cons); - } - if (lltok_isDec_Op (exprData_getUopTok (data) ) ) - { - DPRINTF(("doing --")); - t1 = exprData_getUopNode (data); - cons = constraint_makeMaxSetSideEffectPostDecrement (t1, sequencePoint ); - e->ensuresConstraints = constraintList_add (e->ensuresConstraints, cons); - } - break; - default: - handledExprNode = FALSE; - } - - e->requiresConstraints = constraintList_preserveOrig ( e->requiresConstraints); - e->ensuresConstraints = constraintList_preserveOrig ( e->ensuresConstraints); - e->requiresConstraints = constraintList_addGeneratingExpr ( e->requiresConstraints, e); - - e->ensuresConstraints = constraintList_addGeneratingExpr ( e->ensuresConstraints, e); - - DPRINTF((message ("ensures constraint for %s are %s", exprNode_unparse(e), constraintList_printDetailed(e->ensuresConstraints) ) )); - - return handledExprNode; -} - - -constraintList exprNode_traversTrueEnsuresConstraints (exprNode e) -{ - exprNode t1, t2; - - bool handledExprNode; - // char * mes; - exprData data; - constraintList ret; - - if (exprNode_handleError (e)) - { - ret = constraintList_new(); - return ret; - } - ret = constraintList_copy (e->trueEnsuresConstraints ); - - handledExprNode = TRUE; - - data = e->edata; - - switch (e->kind) - { - case XPR_WHILEPRED: - t1 = exprData_getSingle (data); - ret = constraintList_addList ( ret,exprNode_traversTrueEnsuresConstraints (t1) ); - break; - - case XPR_FETCH: - - ret = constraintList_addList (ret, - exprNode_traversTrueEnsuresConstraints - (exprData_getPairA (data) ) ); - - ret = constraintList_addList (ret, - exprNode_traversTrueEnsuresConstraints - (exprData_getPairB (data) ) ); - break; - case XPR_PREOP: - - ret = constraintList_addList (ret, - exprNode_traversTrueEnsuresConstraints - (exprData_getUopNode (data) ) ); - break; - - case XPR_PARENS: - ret = constraintList_addList (ret, exprNode_traversTrueEnsuresConstraints - (exprData_getUopNode (data) ) ); - break; - case XPR_ASSIGN: - ret = constraintList_addList (ret, - exprNode_traversTrueEnsuresConstraints - (exprData_getOpA (data) ) ); - - ret = constraintList_addList (ret, - exprNode_traversTrueEnsuresConstraints - (exprData_getOpB (data) ) ); - break; - case XPR_OP: - ret = constraintList_addList (ret, - exprNode_traversTrueEnsuresConstraints - (exprData_getOpA (data) ) ); - - ret = constraintList_addList (ret, - exprNode_traversTrueEnsuresConstraints - (exprData_getOpB (data) ) ); - break; - case XPR_SIZEOFT: - - // ctype_unparse (qtype_getType (exprData_getType (data) ) ); - - break; - - case XPR_SIZEOF: - - ret = constraintList_addList (ret, - exprNode_traversTrueEnsuresConstraints - (exprData_getSingle (data) ) ); - break; - - case XPR_CALL: - ret = constraintList_addList (ret, - exprNode_traversTrueEnsuresConstraints - (exprData_getFcn (data) ) ); - /*@i11*/ // exprNodeList_unparse (exprData_getArgs (data) ); - break; - - case XPR_RETURN: - ret = constraintList_addList (ret, - exprNode_traversTrueEnsuresConstraints - (exprData_getSingle (data) ) ); - break; - - case XPR_NULLRETURN: - // cstring_makeLiteral ("return");; - break; - - case XPR_FACCESS: - ret = constraintList_addList (ret, - exprNode_traversTrueEnsuresConstraints - (exprData_getFieldNode (data) ) ); - //exprData_getFieldName (data) ; - break; - - case XPR_ARROW: - ret = constraintList_addList (ret, - exprNode_traversTrueEnsuresConstraints - (exprData_getFieldNode (data) ) ); - // exprData_getFieldName (data); - break; - - case XPR_STRINGLITERAL: - // cstring_copy (exprData_getLiteral (data)); - break; - - case XPR_NUMLIT: - // cstring_copy (exprData_getLiteral (data)); - break; - case XPR_POSTOP: - - ret = constraintList_addList (ret, - exprNode_traversTrueEnsuresConstraints - (exprData_getUopNode (data) ) ); - break; - default: - break; - } - - return ret; -} - -constraintList exprNode_traversFalseEnsuresConstraints (exprNode e) -{ - exprNode t1, t2; - - bool handledExprNode; - // char * mes; - exprData data; - constraintList ret; - - if (exprNode_handleError (e)) - { - ret = constraintList_new(); - return ret; - } - ret = constraintList_copy (e->falseEnsuresConstraints ); - - handledExprNode = TRUE; - - data = e->edata; - - switch (e->kind) - { - case XPR_WHILEPRED: - t1 = exprData_getSingle (data); - ret = constraintList_addList ( ret,exprNode_traversFalseEnsuresConstraints (t1) ); - break; - - case XPR_FETCH: - - ret = constraintList_addList (ret, - exprNode_traversFalseEnsuresConstraints - (exprData_getPairA (data) ) ); - - ret = constraintList_addList (ret, - exprNode_traversFalseEnsuresConstraints - (exprData_getPairB (data) ) ); - break; - case XPR_PREOP: - - ret = constraintList_addList (ret, - exprNode_traversFalseEnsuresConstraints - (exprData_getUopNode (data) ) ); - break; - - case XPR_PARENS: - ret = constraintList_addList (ret, exprNode_traversFalseEnsuresConstraints - (exprData_getUopNode (data) ) ); - break; - case XPR_ASSIGN: - ret = constraintList_addList (ret, - exprNode_traversFalseEnsuresConstraints - (exprData_getOpA (data) ) ); - - ret = constraintList_addList (ret, - exprNode_traversFalseEnsuresConstraints - (exprData_getOpB (data) ) ); - break; - case XPR_OP: - ret = constraintList_addList (ret, - exprNode_traversFalseEnsuresConstraints - (exprData_getOpA (data) ) ); - - ret = constraintList_addList (ret, - exprNode_traversFalseEnsuresConstraints - (exprData_getOpB (data) ) ); - break; - case XPR_SIZEOFT: - - // ctype_unparse (qtype_getType (exprData_getType (data) ) ); - - break; - - case XPR_SIZEOF: - - ret = constraintList_addList (ret, - exprNode_traversFalseEnsuresConstraints - (exprData_getSingle (data) ) ); - break; - - case XPR_CALL: - ret = constraintList_addList (ret, - exprNode_traversFalseEnsuresConstraints - (exprData_getFcn (data) ) ); - /*@i11*/ // exprNodeList_unparse (exprData_getArgs (data) ); - break; - - case XPR_RETURN: - ret = constraintList_addList (ret, - exprNode_traversFalseEnsuresConstraints - (exprData_getSingle (data) ) ); - break; - - case XPR_NULLRETURN: - // cstring_makeLiteral ("return");; - break; - - case XPR_FACCESS: - ret = constraintList_addList (ret, - exprNode_traversFalseEnsuresConstraints - (exprData_getFieldNode (data) ) ); - //exprData_getFieldName (data) ; - break; - - case XPR_ARROW: - ret = constraintList_addList (ret, - exprNode_traversFalseEnsuresConstraints - (exprData_getFieldNode (data) ) ); - // exprData_getFieldName (data); - break; - - case XPR_STRINGLITERAL: - // cstring_copy (exprData_getLiteral (data)); - break; - - case XPR_NUMLIT: - // cstring_copy (exprData_getLiteral (data)); - break; - case XPR_POSTOP: - - ret = constraintList_addList (ret, - exprNode_traversFalseEnsuresConstraints - (exprData_getUopNode (data) ) ); - break; - default: - break; - } - - return ret; -} - - -/* walk down the tree and get all requires Constraints in each subexpression*/ -constraintList exprNode_traversRequiresConstraints (exprNode e) -{ - exprNode t1, t2; - - bool handledExprNode; - // char * mes; - exprData data; - constraintList ret; - - if (exprNode_handleError (e)) - { - ret = constraintList_new(); - return ret; - } - ret = constraintList_copy (e->requiresConstraints ); - - handledExprNode = TRUE; - - data = e->edata; - - switch (e->kind) - { - case XPR_WHILEPRED: - t1 = exprData_getSingle (data); - ret = constraintList_addList ( ret,exprNode_traversRequiresConstraints (t1) ); - break; - - case XPR_FETCH: - - ret = constraintList_addList (ret, - exprNode_traversRequiresConstraints - (exprData_getPairA (data) ) ); - - ret = constraintList_addList (ret, - exprNode_traversRequiresConstraints - (exprData_getPairB (data) ) ); - break; - case XPR_PREOP: - - ret = constraintList_addList (ret, - exprNode_traversRequiresConstraints - (exprData_getUopNode (data) ) ); - break; - - case XPR_PARENS: - ret = constraintList_addList (ret, exprNode_traversRequiresConstraints - (exprData_getUopNode (data) ) ); - break; - case XPR_ASSIGN: - ret = constraintList_addList (ret, - exprNode_traversRequiresConstraints - (exprData_getOpA (data) ) ); - - ret = constraintList_addList (ret, - exprNode_traversRequiresConstraints - (exprData_getOpB (data) ) ); - break; - case XPR_OP: - ret = constraintList_addList (ret, - exprNode_traversRequiresConstraints - (exprData_getOpA (data) ) ); - - ret = constraintList_addList (ret, - exprNode_traversRequiresConstraints - (exprData_getOpB (data) ) ); - break; - case XPR_SIZEOFT: - - // ctype_unparse (qtype_getType (exprData_getType (data) ) ); - - break; - - case XPR_SIZEOF: - - ret = constraintList_addList (ret, - exprNode_traversRequiresConstraints - (exprData_getSingle (data) ) ); - break; - - case XPR_CALL: - ret = constraintList_addList (ret, - exprNode_traversRequiresConstraints - (exprData_getFcn (data) ) ); - /*@i11*/ // exprNodeList_unparse (exprData_getArgs (data) ); - break; - - case XPR_RETURN: - ret = constraintList_addList (ret, - exprNode_traversRequiresConstraints - (exprData_getSingle (data) ) ); - break; - - case XPR_NULLRETURN: - // cstring_makeLiteral ("return");; - break; - - case XPR_FACCESS: - ret = constraintList_addList (ret, - exprNode_traversRequiresConstraints - (exprData_getFieldNode (data) ) ); - //exprData_getFieldName (data) ; - break; - - case XPR_ARROW: - ret = constraintList_addList (ret, - exprNode_traversRequiresConstraints - (exprData_getFieldNode (data) ) ); - // exprData_getFieldName (data); - break; - - case XPR_STRINGLITERAL: - // cstring_copy (exprData_getLiteral (data)); - break; - - case XPR_NUMLIT: - // cstring_copy (exprData_getLiteral (data)); - break; - case XPR_POSTOP: - - ret = constraintList_addList (ret, - exprNode_traversRequiresConstraints - (exprData_getUopNode (data) ) ); - break; - default: - break; - } - - return ret; -} - - -/* walk down the tree and get all Ensures Constraints in each subexpression*/ -constraintList exprNode_traversEnsuresConstraints (exprNode e) -{ - exprNode t1, t2; - - bool handledExprNode; - // char * mes; - exprData data; - // constraintExpr tmp; - // constraint cons; - constraintList ret; - - - if (exprNode_handleError (e)) - { - ret = constraintList_new(); - return ret; - } - - ret = constraintList_copy (e->ensuresConstraints ); - handledExprNode = TRUE; - - data = e->edata; - - DPRINTF( (message ( - "exprnode_traversEnsuresConstraints call for %s with constraintList of %s", - exprNode_unparse (e), - constraintList_print(e->ensuresConstraints) - ) - )); - - - switch (e->kind) - { - case XPR_WHILEPRED: - t1 = exprData_getSingle (data); - ret = constraintList_addList ( ret,exprNode_traversEnsuresConstraints (t1) ); - break; - - case XPR_FETCH: - - ret = constraintList_addList (ret, - exprNode_traversEnsuresConstraints - (exprData_getPairA (data) ) ); - - ret = constraintList_addList (ret, - exprNode_traversEnsuresConstraints - (exprData_getPairB (data) ) ); - break; - case XPR_PREOP: - - ret = constraintList_addList (ret, - exprNode_traversEnsuresConstraints - (exprData_getUopNode (data) ) ); - break; - - case XPR_PARENS: - ret = constraintList_addList (ret, exprNode_traversEnsuresConstraints - (exprData_getUopNode (data) ) ); - break; - case XPR_ASSIGN: - ret = constraintList_addList (ret, - exprNode_traversEnsuresConstraints - (exprData_getOpA (data) ) ); - - ret = constraintList_addList (ret, - exprNode_traversEnsuresConstraints - (exprData_getOpB (data) ) ); - break; - case XPR_OP: - ret = constraintList_addList (ret, - exprNode_traversEnsuresConstraints - (exprData_getOpA (data) ) ); - - ret = constraintList_addList (ret, - exprNode_traversEnsuresConstraints - (exprData_getOpB (data) ) ); - break; - case XPR_SIZEOFT: - - // ctype_unparse (qtype_getType (exprData_getType (data) ) ); - - break; - - case XPR_SIZEOF: - - ret = constraintList_addList (ret, - exprNode_traversEnsuresConstraints - (exprData_getSingle (data) ) ); - break; - - case XPR_CALL: - ret = constraintList_addList (ret, - exprNode_traversEnsuresConstraints - (exprData_getFcn (data) ) ); - /*@i11*/ // exprNodeList_unparse (exprData_getArgs (data) ); - break; - - case XPR_RETURN: - ret = constraintList_addList (ret, - exprNode_traversEnsuresConstraints - (exprData_getSingle (data) ) ); - break; - - case XPR_NULLRETURN: - // cstring_makeLiteral ("return");; - break; - - case XPR_FACCESS: - ret = constraintList_addList (ret, - exprNode_traversEnsuresConstraints - (exprData_getFieldNode (data) ) ); - //exprData_getFieldName (data) ; - break; - - case XPR_ARROW: - ret = constraintList_addList (ret, - exprNode_traversEnsuresConstraints - (exprData_getFieldNode (data) ) ); - // exprData_getFieldName (data); - break; - - case XPR_STRINGLITERAL: - // cstring_copy (exprData_getLiteral (data)); - break; - - case XPR_NUMLIT: - // cstring_copy (exprData_getLiteral (data)); - break; - case XPR_POSTOP: - - ret = constraintList_addList (ret, - exprNode_traversEnsuresConstraints - (exprData_getUopNode (data) ) ); - break; - default: - break; - } -DPRINTF( (message ( - "exprnode_traversEnsuresConstraints call for %s with constraintList of is returning %s", - exprNode_unparse (e), - // constraintList_print(e->ensuresConstraints), - constraintList_print(ret) - ) - )); - - - return ret; -} - diff --git a/src/constraintList.c b/src/constraintList.c deleted file mode 100644 index 7cf3f85..0000000 --- a/src/constraintList.c +++ /dev/null @@ -1,324 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** constraintList.c -** -** based on list_template.c -** -** where T has T_equal (or change this) and T_unparse -*/ - -# include "lclintMacros.nf" -# include "llbasic.h" - -constraintList constraintList_new () -{ - constraintList s = (constraintList) dmalloc (sizeof (*s)); - - s->nelements = 0; - s->nspace = constraintListBASESIZE; - s->elements = (constraint *) - dmalloc (sizeof (*s->elements) * constraintListBASESIZE); - - return (s); -} - -static void -constraintList_grow (constraintList s) -{ - int i; - constraint *newelements; - - s->nspace += constraintListBASESIZE; - newelements = (constraint *) dmalloc (sizeof (*newelements) - * (s->nelements + s->nspace)); - - for (i = 0; i < s->nelements; i++) - { - newelements[i] = s->elements[i]; - } - - sfree (s->elements); - s->elements = newelements; -} - -/* void constraintList_exprNodemerge(void) */ -/* { */ -/* } */ -constraintList -constraintList_add (constraintList s, constraint el) -{ - if (resolve (el, s) ) - return s; - - if (s->nspace <= 0) - constraintList_grow (s); - - s->nspace--; - s->elements[s->nelements] = el; - s->nelements++; - return s; -} - -constraintList constraintList_addList (constraintList s, constraintList new) -{ - llassert(s); - llassert(new); - - if (new == constraintList_undefined) - return s; - - constraintList_elements(new, elem) - { - s = constraintList_add (s, elem); - } - end_constraintList_elements - return s; -} - -cstring -constraintList_print (constraintList s) /*@*/ -{ - int i; - cstring st = cstring_undefined; - bool first = TRUE; - - if (s->nelements == 0) - st = cstring_makeLiteral(""); - - for (i = 0; i < s->nelements; i++) - { - cstring type = cstring_undefined; - constraint current = s->elements[i]; - - if (current != NULL) - { - cstring temp1 = constraint_print(current); - type = message ("%q %q\n", type, temp1 ); - } - - if (first) - { - st = type; - first = FALSE; - } - else - { - st = message ("%q, %q", st, type); - } - } - return st; -} - -void constraintList_printError (constraintList s, fileloc loc) -{ - - constraintList_elements (s, elem) - { - if (elem != NULL) - { - constraint_printError (elem, loc); - } - } - end_constraintList_elements; - return; -} - -cstring -constraintList_printDetailed (constraintList s) -{ - int i; - cstring st = cstring_undefined; - bool first = TRUE; - - if (s->nelements == 0) - st = cstring_makeLiteral(""); - - for (i = 0; i < s->nelements; i++) - { - cstring type = cstring_undefined; - constraint current = s->elements[i]; - - if (current != NULL) - { - cstring temp1 = constraint_printDetailed (current); - type = message ("%s %s\n", type, temp1 ); - } - - if (first) - { - st = type; - first = FALSE; - } - else - { - st = message ("%s %s", st, type); - } - } - return st; -} - -/*{ x: constraint | (x in l1 -> resolve (x, l2) || (x in l2 -> resolve (x, l1) -} */ - -constraintList -constraintList_logicalOr (constraintList l1, constraintList l2) -{ - constraint temp; - constraintList ret; - DPRINTF ( (message ("Logical of on %s and %s", - constraintList_print(l1), - constraintList_print(l2)) ) ); - - ret = constraintList_new(); - constraintList_elements (l1, el) - { - temp = substitute (el, l2); - - if (resolve (el, l2) || resolve(temp,l2) ) - { /*avoid redundant constraints*/ - if (!resolve (el, ret) ) - ret = constraintList_add (ret, el); - } - } - end_constraintList_elements; - - constraintList_elements (l2, el) - { - temp = substitute (el, l1); - - if (resolve (el, l1) || resolve(temp,l1) ) - { - /*avoid redundant constraints*/ - if (!resolve (el, ret) ) - ret = constraintList_add (ret, el); - } - } - end_constraintList_elements; - - - return ret; -} - -void -constraintList_free (constraintList s) -{ - int i; - for (i = 0; i < s->nelements; i++) - { - // constraint_free (s->elements[i]); - } - - sfree (s->elements); - sfree (s); -} - -constraintList -constraintList_copy (constraintList s) /*@*/ -{ - constraintList ret = constraintList_new (); - - constraintList_elements (s, el) - { - ret = constraintList_add (ret, constraint_copy (el)); - } end_constraintList_elements; - - return ret; -} - -constraintList constraintList_preserveOrig (constraintList c) -{ - constraintList_elements (c, el) - { - el = constraint_preserveOrig (el); - } - end_constraintList_elements; - return c; -} - -constraintList constraintList_addGeneratingExpr (constraintList c, exprNode e) -{ - DPRINTF ((message ("entering constraintList_addGeneratingExpr for %s ", exprNode_unparse(e) ) )); - - constraintList_elements (c, el) - { - DPRINTF ((message ("setting generatingExpr for %s to %s", constraint_print(el), exprNode_unparse(e) ) )); - el = constraint_addGeneratingExpr (el, e); - } - end_constraintList_elements; - return c; -} - -constraintList constraintList_doFixResult (constraintList postconditions, exprNode fcnCall) -{ - constraintList ret; - ret = constraintList_new(); - constraintList_elements (postconditions, el) - { - ret = constraintList_add (ret, constraint_doFixResult (el, fcnCall) ); - } - end_constraintList_elements; - - return ret; -} - -constraintList constraintList_doSRefFixConstraintParam (constraintList preconditions, exprNodeList arglist) -{ - constraintList ret; - ret = constraintList_new(); - - constraintList_elements (preconditions, el) - { - ret = constraintList_add(ret, constraint_doSRefFixConstraintParam (el, arglist) ); - } - end_constraintList_elements; - - return ret; -} -constraintList constraintList_doSRefFixBaseParam (constraintList preconditions, - exprNodeList arglist) -{ - constraintList ret; - ret = constraintList_new(); - - constraintList_elements (preconditions, el) - { - ret = constraintList_add(ret, constraint_doSRefFixBaseParam (el, arglist) ); - } - end_constraintList_elements; - - return ret; -} - -constraintList constraintList_togglePost (/*@returned@*/ constraintList c) -{ - constraintList_elements (c, el) - { - el->post = !el->post; - } - end_constraintList_elements; - return c; -} - - diff --git a/src/constraintResolve.c b/src/constraintResolve.c deleted file mode 100644 index 36dd667..0000000 --- a/src/constraintResolve.c +++ /dev/null @@ -1,780 +0,0 @@ -/* -* -** constraintResolve.c -*/ - -//#define DEBUGPRINT 1 - -# include /* for isdigit */ -# include "lclintMacros.nf" -# include "basic.h" -# include "cgrammar.h" -# include "cgrammar_tokens.h" - -# include "exprChecks.h" -# include "aliasChecks.h" -# include "exprNodeSList.h" -//# include "exprData.i" - -#include "constraintExpr.h" - - - - - -constraintList reflectChanges (constraintList pre2, constraintList post1); -constraint substitute (constraint c, constraintList p); -constraint constraint_searchandreplace (constraint c, constraintExpr old, constraintExpr new); -bool rangeCheck (arithType ar1, constraintExpr expr1, arithType ar2, constraintExpr expr2); -bool satifies (constraint pre, constraint post); -bool resolve (constraint c, constraintList p); -constraintList reflectChangesEnsures (constraintList pre2, constraintList post1); -constraint constraint_simplify (constraint c); - -constraintList constraintList_fixConflicts (constraintList list1, constraintList list2); - -constraintList constraintList_subsumeEnsures (constraintList list1, constraintList list2); - -constraintList constraintList_mergeEnsures (constraintList list1, constraintList list2); -constraint inequalitySubstitute (constraint c, constraintList p); - -/*********************************************/ - - -constraintList constraintList_mergeEnsures (constraintList list1, constraintList list2) -{ - constraintList ret; - constraintList temp; - ret = constraintList_new(); - - ret = reflectChangesEnsures (list1, list2); - ret = constraintList_fixConflicts (ret, list2); - ret = constraintList_subsumeEnsures (ret, list2); - list2 = constraintList_subsumeEnsures (list2, ret); - temp = constraintList_copy(list2); - - temp = constraintList_addList (temp, ret); - return temp; - //ret = constraintList_addList (ret, list2); - //return ret; -} - - -/* constraintList constraintList_resolveRequires (constraintList requires, constraintList ensures) */ -/* { */ - -/* constraintList ret; */ -/* constraintList temp; */ -/* ret = constraintList_new(); */ - -/* ret = reflectChangesEnsures (list1, list2); */ -/* ret = constraintList_fixConflicts (ret, list2); */ -/* ret = constraintList_subsumeEnsures (ret, list2); */ -/* list2 = constraintList_subsumeEnsures (list2, ret); */ -/* temp = constraintList_copy(list2); */ - -/* temp = constraintList_addList (temp, ret); */ -/* return temp; */ -/* //ret = constraintList_addList (ret, list2); */ -/* //return ret; */ -/* } */ - -void checkArgumentList (exprNode temp, exprNodeList arglist, fileloc sequencePoint) -{ - temp->requiresConstraints = constraintList_new(); - temp->ensuresConstraints = constraintList_new(); - temp->trueEnsuresConstraints = constraintList_new(); - temp->falseEnsuresConstraints = constraintList_new(); - - exprNodeList_elements (arglist, el) - { - exprNode_exprTraverse (el, FALSE, FALSE, sequencePoint); - el->requiresConstraints = exprNode_traversRequiresConstraints(el); - el->ensuresConstraints = exprNode_traversEnsuresConstraints(el); - - temp->requiresConstraints = constraintList_addList(temp->requiresConstraints, - el->requiresConstraints); - - temp->ensuresConstraints = constraintList_addList(temp->ensuresConstraints, - el->ensuresConstraints); - } - end_exprNodeList_elements; - -} - -constraintList checkCall (exprNode fcn, exprNodeList arglist) -{ - constraintList preconditions; - uentry temp; - DPRINTF ( (message ("Got call that %s ( %s) ", exprNode_unparse(fcn), exprNodeList_unparse (arglist ) ) ) ); - - temp = exprNode_getUentry (fcn); - - preconditions = uentry_getFcnPreconditions (temp); - - if (preconditions) - { - preconditions = constraintList_copy(preconditions); - preconditions= constraintList_togglePost (preconditions); - preconditions = constraintList_doSRefFixConstraintParam (preconditions, arglist); - } - else - { - preconditions = constraintList_new(); - } - - return preconditions; -} - -constraintList getPostConditions (exprNode fcn, exprNodeList arglist, exprNode fcnCall) -{ - constraintList postconditions; - uentry temp; - DPRINTF ( (message ("Got call that %s ( %s) ", exprNode_unparse(fcn), exprNodeList_unparse (arglist ) ) ) ); - - temp = exprNode_getUentry (fcn); - - postconditions = uentry_getFcnPostconditions (temp); - - if (postconditions) - { - postconditions = constraintList_copy(postconditions); - postconditions = constraintList_doFixResult (postconditions, fcnCall); - postconditions = constraintList_doSRefFixConstraintParam (postconditions, arglist); - } - else - { - postconditions = constraintList_new(); - } - - return postconditions; -} - -void mergeResolve (exprNode parent, exprNode child1, exprNode child2) -{ - constraintList temp; - - DPRINTF( (message ("magically merging constraint into parent:%s for", exprNode_unparse (parent) ))); - - DPRINTF( (message (" children: %s and %s", exprNode_unparse (child1), exprNode_unparse(child2) ) ) ); - - if (exprNode_isError (child1) || exprNode_isError(child2) ) - { - if (exprNode_isError (child1) && !exprNode_isError(child2) ) - { - parent->requiresConstraints = constraintList_copy (child2->requiresConstraints); - parent->ensuresConstraints = constraintList_copy (child2->ensuresConstraints); - DPRINTF((message ("Copied child constraints: pre: %s and post: %s", - constraintList_print( child2->requiresConstraints), - constraintList_print (child2->ensuresConstraints) - ) - )); - return; - } - else - { - llassert(exprNode_isError(child2) ); - parent->requiresConstraints = constraintList_new(); - parent->ensuresConstraints = constraintList_new(); - return; - } - } - - llassert(!exprNode_isError (child1) && ! exprNode_isError(child2) ); - - DPRINTF( (message ("Child constraints are %s %s and %s %s", - constraintList_print (child1->requiresConstraints), - constraintList_print (child1->ensuresConstraints), - constraintList_print (child2->requiresConstraints), - constraintList_print (child2->ensuresConstraints) - ) ) ); - - parent->requiresConstraints = constraintList_new(); - parent->ensuresConstraints = constraintList_new(); - - parent->requiresConstraints = constraintList_copy (child1->requiresConstraints); - - temp = reflectChanges (child2->requiresConstraints, child1->ensuresConstraints); - parent->requiresConstraints = constraintList_addList (parent->requiresConstraints, temp); - - parent->ensuresConstraints = constraintList_mergeEnsures(child1->ensuresConstraints, - child2->ensuresConstraints); - - DPRINTF( (message ("Parent constraints are %s and %s ", - constraintList_print (parent->requiresConstraints), - constraintList_print (parent->ensuresConstraints) - ) ) ); - -} - - - - -constraintList constraintList_subsumeEnsures (constraintList list1, constraintList list2) -{ - constraintList ret; - ret = constraintList_new(); - constraintList_elements (list1, el) - { - - DPRINTF ((message ("Examining %s", constraint_print (el) ) ) ); - if (!resolve (el, list2) ) - { - ret = constraintList_add (ret, el); - } - else - { - DPRINTF ( (message ("Subsuming %s", constraint_print (el) ) ) ); - } - } end_constraintList_elements; - - return ret; -} - - -constraintList reflectChanges (constraintList pre2, constraintList post1) -{ - - constraintList ret; - constraint temp; - ret = constraintList_new(); - DPRINTF((message ("reflectChanges: lists %s and %s", constraintList_print(pre2), constraintList_print(post1) ))); - - constraintList_elements (pre2, el) - { - if (!resolve (el, post1) ) - { - temp = substitute (el, post1); - if (!resolve (temp, post1) ) - { - // try inequality substitution - constraint temp2; - - // the inequality substitution may cause us to lose information - //so we don't want to store the result but we do it anyway - temp2 = constraint_copy (temp); - temp2 = inequalitySubstitute (temp, post1); - if (!resolve (temp2, post1) ) - ret = constraintList_add (ret, temp2); - } - } - } end_constraintList_elements; - - DPRINTF((message ("reflectChanges: returning %s", constraintList_print(ret) ) ) ); - return ret; -} - - - -constraintList reflectChangesEnsures (constraintList pre2, constraintList post1) -{ - constraintList ret; - constraint temp; - ret = constraintList_new(); - constraintList_elements (pre2, el) - { - if (!resolve (el, post1) ) - { - temp = substitute (el, post1); - llassert (temp != NULL); - - if (!resolve (temp, post1) ) - ret = constraintList_add (ret, temp); - } - else - { - DPRINTF ( (message ("Resolved away %s ", constraint_print(el) ) ) ); - } - } end_constraintList_elements; - - return ret; -} - - -bool constraint_conflict (constraint c1, constraint c2) -{ - - if (constraintExpr_similar(c1->lexpr, c2->lexpr) ) - { - if (c1->ar == EQ) - if (c1->ar == c2->ar) - { - DPRINTF ( (message ("%s conflicts with %s ", constraint_print (c1), constraint_print(c2) ) ) ); - return TRUE; - } - } - - DPRINTF ( (message ("%s doesn't conflict with %s ", constraint_print (c1), constraint_print(c2) ) ) ); - - return FALSE; - -} - -void constraint_fixConflict (constraint good, constraint conflicting) -{ - constraint temp; - if (conflicting->ar ==EQ ) - { - good->expr = constraintExpr_searchandreplace (good->expr, conflicting->lexpr, conflicting->expr); - temp = constraint_simplify (good); - constraint_overWrite (good, temp); - } - - -} - -bool conflict (constraint c, constraintList list) -{ - - constraintList_elements (list, el) - { - if ( constraint_conflict(el, c) ) - { - constraint_fixConflict (el, c); - return TRUE; - } - } end_constraintList_elements; - - return FALSE; - - -} - -//check if constraint in list1 and conflict with constraints in List2. If so we -//remove form list1 and (optionally) change list2. -constraintList constraintList_fixConflicts (constraintList list1, constraintList list2) -{ - constraintList ret; - ret = constraintList_new(); - constraintList_elements (list1, el) - { - if (! conflict (el, list2) ) - { - ret = constraintList_add (ret, el); - } - } end_constraintList_elements; - - return ret; - - -} - -bool resolve (constraint c, constraintList p) -{ - constraintList_elements (p, el) - { - if ( satifies (c, el) ) - { - DPRINTF ( (message ("\n%s Satifies %s\n ", constraint_print(el), constraint_print(c) ) ) ); - return TRUE; - } - DPRINTF ( (message ("\n%s does not satify %s\n ", constraint_print(el), constraint_print(c) ) ) ); - } - end_constraintList_elements; - DPRINTF ( (message ("no constraints satify %s", constraint_print(c) ) )); - return FALSE; -} - - -/*returns true if cosntraint post satifies cosntriant pre */ -bool satifies (constraint pre, constraint post) -{ - if (constraint_isAlwaysTrue (pre) ) - return TRUE; - - if (!constraintExpr_similar (pre->lexpr, post->lexpr) ) - { - return FALSE; - } - if (post->expr == NULL) - { - llassert(FALSE); - return FALSE; - } - - return rangeCheck (pre->ar, pre->expr, post->ar, post->expr); -} - -bool arithType_canResolve (arithType ar1, arithType ar2) -{ - switch (ar1) - { - case GTE: - case GT: - if ( (ar2 == GT) || (ar2 == GTE) || (ar2 == EQ) ) - { - return TRUE; - } - break; - - case EQ: - if (ar2 == EQ) - return TRUE; - break; - - case LT: - case LTE: - // llassert(FALSE); - if ( (ar2 == LT) || (ar2 == LTE) || (ar2 == EQ) ) - return TRUE; - default: - return FALSE; - } - return FALSE; -} - -bool constraint_isAlwaysTrue (constraint c) -{ - constraintExpr l, r; - bool lHasConstant, rHasConstant; - int lConstant, rConstant; - - l = c->lexpr; - r = c->expr; - - if (constraintExpr_canGetValue(l) && constraintExpr_canGetValue(r) ) - { - int cmp; - cmp = constraintExpr_compare (l, r); - switch (c->ar) - { - case EQ: - return (cmp == 0); - case GT: - return (cmp > 0); - case GTE: - return (cmp >= 0); - case LTE: - return (cmp <= 0); - case LT: - return (cmp < 0); - - default: - BADEXIT; - break; - } - } - - if (constraintExpr_similar (l,r) ) - { - switch (c->ar) - { - case EQ: - case GTE: - case LTE: - return TRUE; - - case GT: - case LT: - break; - default: - BADEXIT; - break; - } - } - - l = constraintExpr_copy (c->lexpr); - r = constraintExpr_copy (c->expr); - - // l = constraintExpr_propagateConstants (l, &lHasConstant, &lConstant); - r = constraintExpr_propagateConstants (r, &rHasConstant, &rConstant); - - if (constraintExpr_similar (l,r) ) - { - DPRINTF(( message("constraint_IsAlwaysTrue: after removing constants %s and %s are similar", constraintExpr_unparse(l), constraintExpr_unparse(r) ) )); - if (rHasConstant) - { - DPRINTF(( message("constraint_IsAlwaysTrue: rconstant is %d", rConstant ) )); - switch (c->ar) - { - case EQ: - return (rConstant == 0); - case LT: - return (rConstant > 0); - case LTE: - return (rConstant >= 0); - case GTE: - return (rConstant <= 0); - case GT: - return (rConstant < 0); - - default: - BADEXIT; - break; - } - } - - } - else - { - DPRINTF(( message("Constraint %s is not always true", constraint_print(c) ) )); - return FALSE; - } - - BADEXIT; -} - -bool rangeCheck (arithType ar1, constraintExpr expr1, arithType ar2, constraintExpr expr2) - -{ - DPRINTF ((message ("Doing Range CHECK %s and %s", constraintExpr_unparse(expr1), constraintExpr_unparse(expr2) ) )); - - if (! arithType_canResolve (ar1, ar2) ) - return FALSE; - - switch (ar1) - { - case GTE: - if (constraintExpr_similar (expr1, expr2) ) - return TRUE; - case GT: - if (! (constraintExpr_canGetValue (expr1) && - constraintExpr_canGetValue (expr2) ) ) - { - DPRINTF( ("Can't Get value")); - return FALSE; - } - - if (constraintExpr_compare (expr2, expr1) >= 0) - return TRUE; - - return FALSE; - case EQ: - if (constraintExpr_similar (expr1, expr2) ) - return TRUE; - - return FALSE; - case LTE: - if (constraintExpr_similar (expr1, expr2) ) - return TRUE; - case LT: - if (! (constraintExpr_canGetValue (expr1) && - constraintExpr_canGetValue (expr2) ) ) - { - DPRINTF( ("Can't Get value")); - return FALSE; - } - - if (constraintExpr_compare (expr2, expr1) <= 0) - return TRUE; - - return FALSE; - - default: - llcontbug((message("Unhandled case in switch: %s", arithType_print(ar1) ) ) ); - } - BADEXIT; - return FALSE; -} - - -constraint constraint_searchandreplace (constraint c, constraintExpr old, constraintExpr new) -{ - DPRINTF (("Doing replace for lexpr") ); - c->lexpr = constraintExpr_searchandreplace (c->lexpr, old, new); - DPRINTF (("Doing replace for expr") ); - c->expr = constraintExpr_searchandreplace (c->expr, old, new); - return c; -} - -bool constraint_search (constraint c, constraintExpr old) -{ - bool ret; - ret = FALSE; - - ret = constraintExpr_search (c->lexpr, old); - ret = ret || constraintExpr_search (c->expr, old); - return ret; -} - -//adjust file locs and stuff -constraint constraint_adjust (constraint substitute, constraint old) -{ - fileloc loc1, loc2, loc3; - - DPRINTF ( (message("Start adjust on %s and %s", constraint_print(substitute), - constraint_print(old)) - )); - - loc1 = constraint_getFileloc (old); - - loc2 = constraintExpr_getFileloc (substitute->lexpr); - - loc3 = constraintExpr_getFileloc (substitute->expr); - - - // special case of an equality that "contains itself" - if (constraintExpr_search (substitute->expr, substitute->lexpr) ) - if (fileloc_closer (loc1, loc3, loc2)) - { - constraintExpr temp; - DPRINTF ( (message("Doing adjust on %s", constraint_print(substitute) ) - )); - temp = substitute->lexpr; - substitute->lexpr = substitute->expr; - substitute->expr = temp; - substitute = constraint_simplify(substitute); - } - - return substitute; - -} - -constraint inequalitySubstitute (constraint c, constraintList p) -{ - if (c->ar != GTE) - return c; - - constraintList_elements (p, el) - { - if ( el->ar == LT) - // if (!constraint_conflict (c, el) ) - { - constraint temp; - temp = constraint_copy(el); - - // temp = constraint_adjust(temp, c); - - if (constraintExpr_same (el->lexpr, c->expr) ) - { - DPRINTF((message ("Replacing %s in %s with %s", - constraintExpr_print (c->expr), - constraint_print (c), - constraintExpr_print (el->expr) ) - )); - c->expr = constraintExpr_copy (el->expr); - } - - } - } - end_constraintList_elements; - - c = constraint_simplify(c); - return c; -} - -constraint substitute (constraint c, constraintList p) -{ - constraintList_elements (p, el) - { - if ( el->ar == EQ) - if (!constraint_conflict (c, el) ) - - { - constraint temp; - temp = constraint_copy(el); - - temp = constraint_adjust(temp, c); - - DPRINTF((message ("Substituting %s for %s", - constraint_print (temp), constraint_print (c) - ) ) ); - - - c = constraint_searchandreplace (c, temp->lexpr, temp->expr); - } - } - end_constraintList_elements; - - c = constraint_simplify(c); - return c; -} - - -constraint constraint_solve (constraint c) -{ - DPRINTF( (message ("Solving %s\n", constraint_print(c) ) ) ); - c->expr = constraintExpr_solveBinaryExpr (c->lexpr, c->expr); - DPRINTF( (message ("Solved and got %s\n", constraint_print(c) ) ) ); - - return c; -} - -static arithType flipAr (arithType ar) -{ - switch (ar) - { - case LT: - return GT; - case LTE: - return GTE; - case EQ: - return EQ; - case GT: - return LT; - case GTE: - return LTE; - default: - llcontbug (("unexpected value: case not handled")); - } - BADEXIT; -} - -static constraint constraint_swapLeftRight (constraint c) -{ - constraintExpr temp; - c->ar = flipAr (c->ar); - temp = c->lexpr; - c->lexpr = c->expr; - c->expr = temp; - DPRINTF(("Swaped left and right sides of constraint")); - return c; -} - -constraint constraint_simplify (constraint c) -{ - c->lexpr = constraintExpr_simplify (c->lexpr); - c->expr = constraintExpr_simplify (c->expr); - - c = constraint_solve (c); - - c->lexpr = constraintExpr_simplify (c->lexpr); - c->expr = constraintExpr_simplify (c->expr); - - if (constraintExpr_isLit(c->lexpr) && (!constraintExpr_isLit(c->expr) ) ) - { - c = constraint_swapLeftRight(c); - /*I don't think this will be an infinate loop*/ - constraint_simplify(c); - } - return c; -} - - - - -/* returns true if fileloc for term1 is closer to file for term2 than term3*/ - -bool fileloc_closer (fileloc loc1, fileloc loc2, fileloc loc3) -{ - if ( fileloc_lessthan (loc1, loc2) ) - { - if (fileloc_lessthan (loc2, loc3) ) - { - llassert (fileloc_lessthan (loc1, loc3) ); - return TRUE; - } - else - { - return FALSE; - } - } - - if ( !fileloc_lessthan (loc1, loc2) ) - { - if (!fileloc_lessthan (loc2, loc3) ) - { - llassert (!fileloc_lessthan (loc1, loc3) ); - return TRUE; - } - else - { - return FALSE; - } - } - - llassert(FALSE); - return FALSE; -} - - diff --git a/src/constraintTerm.c b/src/constraintTerm.c deleted file mode 100644 index 88bc21a..0000000 --- a/src/constraintTerm.c +++ /dev/null @@ -1,406 +0,0 @@ -/* -** constraintExpr.c -*/ - -//#define DEBUGPRINT 1 - -# include /* for isdigit */ -# include "lclintMacros.nf" -# include "basic.h" -# include "cgrammar.h" -# include "cgrammar_tokens.h" - -# include "exprChecks.h" -# include "aliasChecks.h" -# include "exprNodeSList.h" - -//# include "exprData.i" - -/*@-czechfcns@*/ - -//#include "constraintExpr.h" - - -constraintTerm new_constraintTermExpr (void) -{ - constraintTerm ret; - ret = dmalloc (sizeof (* ret ) ); - return ret; -} - - -bool constraintTerm_isIntLiteral (constraintTerm term) -{ - llassert(term); - - if (term->kind == INTLITERAL) - return TRUE; - - return FALSE; -} - -bool constraintTerm_isStringLiteral (constraintTerm c) -{ - llassert (c); - if (c->kind == EXPRNODE) - { - if (exprNode_knownStringValue(c->value.expr) ) - { - return TRUE; - } - } - return FALSE; -} - -cstring constraintTerm_getStringLiteral (constraintTerm c) -{ - llassert (c); - llassert (constraintTerm_isStringLiteral (c) ); - llassert (c->kind == EXPRNODE); - - return ( multiVal_forceString (exprNode_getValue (c->value.expr) ) ); -} - -constraintTerm constraintTerm_simplify (constraintTerm term) -{ - if (term->kind == EXPRNODE) - { - if ( exprNode_knownIntValue (term->value.expr ) ) - { - long int temp; - temp = exprNode_getLongValue (term->value.expr); - term->value.intlit = temp; - term->kind = INTLITERAL; - } - } - return term; -} - -fileloc constraintTerm_getFileloc (constraintTerm t) -{ - return (fileloc_copy (t->loc) ); -} - -constraintTerm constraintTerm_makeExprNode (/*@only@*/ exprNode e) -{ - constraintTerm ret = new_constraintTermExpr(); - ret->loc = exprNode_getfileloc(e); - ret->value.expr = e; - ret->kind = EXPRNODE; - ret = constraintTerm_simplify(ret); - return ret; -} - -constraintTerm constraintTerm_makesRef (/*@only@*/ sRef s) -{ - constraintTerm ret = new_constraintTermExpr(); - ret->loc = fileloc_undefined; - ret->value.sref = s; - ret->kind = SREF; - ret = constraintTerm_simplify(ret); - return ret; -} - -constraintTerm constraintTerm_copy (constraintTerm term) -{ - constraintTerm ret; - ret = new_constraintTermExpr(); - ret->loc = fileloc_copy (term->loc); - ret->value= term->value; - ret->kind = term->kind; - return ret; -} - -constraintTerm constraintTerm_setFileloc (constraintTerm term, fileloc loc) -{ - llassert(term); - term->loc = fileloc_copy(loc); - return term; -} - - -cstring constraintTerm_getName (constraintTerm term) -{ - cstring s; - s = cstring_undefined; - - llassert (term != NULL); - - switch (term->kind) - { - case EXPRNODE: - /*@i334*/ //wtf - s = message ("%s", exprNode_unparse (term->value.expr) ); - break; - case INTLITERAL: - s = message (" %d ", term->value.intlit); - break; - - case SREF: - s = message ("%s", sRef_unparse (term->value.sref) ); - - break; - } - - return s; -} - -constraintExpr -constraintTerm_doFixResult (constraintExpr e, exprNode fcnCall) -{ - constraintTerm t; - sRef s; - constraintExprData data = e->data; - - constraintExprKind kind = e->kind; - - constraintExpr ret; - - llassert(kind == term); - - t = constraintExprData_termGetTerm (data); - llassert (t != NULL); - - ret = e; - switch (t->kind) - { - case EXPRNODE: - break; - case INTLITERAL: - break; - - case SREF: - s = t->value.sref; - if (s->kind == SK_RESULT) - { - ret = constraintExpr_makeExprNode(fcnCall); - } - break; - } - return ret; - -} - -constraintTerm -constraintTerm_doSRefFixBaseParam (constraintTerm term, exprNodeList arglist) -{ - llassert (term != NULL); - - switch (term->kind) - { - case EXPRNODE: - /*@i334*/ //wtf - // s = message ("%s @ %s ", exprNode_unparse (term->value.expr), - // fileloc_unparse (term->loc) ); - break; - case INTLITERAL: - // s = message (" %d ", term->value.intlit); - break; - - case SREF: - term->value.sref = sRef_fixBaseParam (term->value.sref, arglist); - // s = message ("%s ", sRef_unparse (term->value.sref) ); - - break; - } - return term; - -} - -constraintExpr -constraintTerm_doSRefFixConstraintParam (constraintExpr e, exprNodeList arglist) -{ - constraintTerm t; - - constraintExprData data = e->data; - - constraintExprKind kind = e->kind; - - constraintExpr ret; - - llassert(kind == term); - - t = constraintExprData_termGetTerm (data); - llassert (t != NULL); - - ret = e; - switch (t->kind) - { - case EXPRNODE: - /*@i334*/ //wtf - // s = message ("%s @ %s ", exprNode_unparse (term->value.expr), - // fileloc_unparse (term->loc) ); - break; - case INTLITERAL: - // s = message (" %d ", term->value.intlit); - break; - - case SREF: - ret = sRef_fixConstraintParam (t->value.sref, arglist); - - // s = message ("%s ", sRef_unparse (term->value.sref) ); - - break; - } - return ret; - -} - -cstring constraintTerm_print (constraintTerm term) /*@*/ -{ - cstring s; - s = cstring_undefined; - - llassert (term != NULL); - - switch (term->kind) - { - case EXPRNODE: - /*@i334*/ //wtf - s = message ("%s @ %s ", exprNode_unparse (term->value.expr), - fileloc_unparse (term->loc) ); - break; - case INTLITERAL: - s = message (" %d ", term->value.intlit); - break; - - case SREF: - s = message ("%s ", sRef_unparseDebug (term->value.sref) ); - - break; - } - - return s; -} - - -constraintTerm constraintTerm_makeIntLiteral (int i) -{ - constraintTerm ret = new_constraintTermExpr(); - ret->value.intlit = i; - ret->kind = INTLITERAL; - ret->loc = fileloc_undefined; - return ret; -} - -bool constraintTerm_canGetValue (constraintTerm term) -{ - if (term->kind == INTLITERAL) - return TRUE; - else - return FALSE; -} - -int constraintTerm_getValue (constraintTerm term) -{ - llassert (term->kind == INTLITERAL); - return term->value.intlit; -} - - - -/* same and similar are similar but not the same*/ - -bool constraintTerm_same (constraintTerm term1, constraintTerm term2) -{ - llassert (term1 !=NULL && term2 !=NULL); - - if ( (term1->kind != term2->kind) || (term1->kind != EXPRNODE) ) - { - return FALSE; - } - - DPRINTF ( (message - ("Comparing srefs for %s and %s ", constraintTerm_print(term1), constraintTerm_print(term2) - ) - ) - ); - - if (sRef_same (term1->value.expr->sref, term2->value.expr->sref) ) - { - DPRINTF ((message (" %s and %s are same", constraintTerm_print(term1), constraintTerm_print(term2) ) )); - return TRUE; - } - else - { - DPRINTF ((message (" %s and %s are not same", constraintTerm_print(term1), constraintTerm_print(term2) ) )); - return FALSE; - } - -} - -sRef constraintTerm_getsRef (constraintTerm t) -{ - llassert (t); - if (t->kind == EXPRNODE) - { - return t->value.expr->sref; - } - - if (t->kind == SREF) - { - return t->value.sref; - } - - return sRef_undefined; -} - -bool constraintTerm_probSame (constraintTerm term1, constraintTerm term2) -{ - cstring s1, s2; - - llassert (term1 !=NULL && term2 !=NULL); - - DPRINTF ( (message - ("Comparing srefs for %s and %s ", constraintTerm_print(term1), constraintTerm_print(term2) - ) - ) - ); - - s1 = constraintTerm_getName (term1); - s2 = constraintTerm_getName (term2); - - if (cstring_equal (s1, s2) ) - { - DPRINTF ((message (" %s and %s are same", s1, s2 ) ) ); - return TRUE; - } - else - { - DPRINTF ((message (" %s and %s are not same", s1, s2 ) ) ); - return FALSE; - } -} - -bool constraintTerm_similar (constraintTerm term1, constraintTerm term2) -{ - sRef s1, s2; - - llassert (term1 !=NULL && term2 !=NULL); - - s1 = constraintTerm_getsRef (term1); - s2 = constraintTerm_getsRef (term2); - - if ( ! (s1 && s2) ) - { - return FALSE; - } - - DPRINTF ( (message - ("Comparing srefs for %s and %s ", constraintTerm_print(term1), constraintTerm_print(term2) - ) - ) - ); - - if (sRef_similarRelaxed(s1, s2) || sRef_sameName (s1, s2) ) - { - DPRINTF ((message (" %s and %s are same", constraintTerm_print(term1), constraintTerm_print(term2) ) )); - return TRUE; - } - else - { - DPRINTF ((message (" %s and %s are not same", constraintTerm_print(term1), constraintTerm_print(term2) ) )); - return FALSE; - } - -} diff --git a/src/context.c b/src/context.c deleted file mode 100644 index 02fe35b..0000000 --- a/src/context.c +++ /dev/null @@ -1,4143 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** context.c -*/ -/* - * Modified by Herbert 04/19/97: - * - added include for new header portab.h containing OS dependent stuff. - * - changed occurrances of '/' as path delimiters to macro from portab.h - * - changed the handling of the tmp directory -- will no longer always be - * ".", if possible, environment variables "TMP" or, if not set, "TMP", - * or, if not set "." will be used. - */ - -# include "lclintMacros.nf" -# include "llbasic.h" - -# ifndef NOLCL -# include "usymtab_interface.h" -# endif - -# include "exprChecks.h" -# include "filelocStack.h" -# include "fileIdList.h" -# include "llmain.h" -# include "intSet.h" -# include "osd.h" -# include "portab.h" - -extern /*@external@*/ int yydebug; - -typedef struct -{ - cstring file; - typeIdSet daccess ; -} maccesst; - -typedef enum { - CX_GLOBAL, CX_INNER, - CX_FUNCTION, CX_FCNDECL, - CX_MACROFCN, CX_MACROCONST, CX_UNKNOWNMACRO, - CX_ITERDEF, CX_ITEREND, - CX_LCL, CX_LCLLIB -} kcontext; - -static struct _context -{ - int linesprocessed; - int speclinesprocessed; - - flagMarkerList markers; - - /* - ** used to record state where a macro must match a function name - ** (i.e., no params were listed in the macro definition - */ - - bool macroMissingParams BOOLBITS; - bool preprocessing BOOLBITS; - bool incommandline BOOLBITS; - bool insuppressregion BOOLBITS; - bool inDerivedFile BOOLBITS; - bool instandardlib BOOLBITS; - bool inimport BOOLBITS; - bool inheader BOOLBITS; - bool inmacrocache BOOLBITS; - bool protectVars BOOLBITS; - bool neednl BOOLBITS; - bool showfunction BOOLBITS; - bool savedFlags BOOLBITS; - bool justpopped BOOLBITS; - bool anyExports BOOLBITS; - - flagcode library; - - ynm isNullGuarded; - fileloc saveloc; - fileloc pushloc; - - clauseStack clauses; - clause inclause; - - int numerrors; - - filelocStack locstack; - fileTable ftab; - cstring msgAnnote; - /*@observer@*/ sRef aliasAnnote; - /*@observer@*/ sRef aliasAnnoteAls; - messageLog msgLog; - - macrocache mc; - /*@observer@*/ sRefSet mods; - - /* file access types */ - typeIdSet facct; - - /* local access types (this function) */ - typeIdSet acct; - - /* no access types (@noaccess) */ - typeIdSet nacct; - - /*@observer@*/ globSet globs; - /*@only@*/ globSet globs_used; - - int nmods; - int maxmods; - /*@reldef@*/ maccesst *moduleaccess; /* Not defined is nmods == 0. */ - - kcontext kind; - - ctype boolType; - - bool flags[NUMFLAGS]; - bool saveflags[NUMFLAGS]; - bool setGlobally[NUMFLAGS]; - bool setLocally[NUMFLAGS]; - - int values[NUMVALUEFLAGS]; - int counters[NUMVALUEFLAGS]; - - o_cstring strings[NUMSTRINGFLAGS]; - sRefSetList modrecs; - - union - { - bool glob; - int cdepth; - /*@dependent@*/ /*@exposed@*/ uentry fcn; - } cont; -} gc; - -static /*@exposed@*/ cstring context_exposeString (flagcode p_flag) ; -static void context_restoreFlagSettings (void) /*@modifies gc@*/ ; -static void context_saveFlagSettings (void) /*@modifies gc@*/ ; -static void context_exitClauseAux (exprNode p_pred, exprNode p_tbranch) - /*@modifies gc@*/ ; -static void context_exitClauseSimp (void) /*@modifies gc@*/ ; -static void context_exitClausePlain (void) /*@modifies gc@*/ ; -static void context_setJustPopped (void) /*@modifies gc.justpopped@*/ ; -static void context_setValue (flagcode p_flag, int p_val) /*@modifies gc.flags@*/ ; -static void context_setFlag (flagcode p_f, bool p_b) - /*@modifies gc.flags@*/ ; - -static void - context_setFlagAux (flagcode p_f, bool p_b, bool p_inFile, bool p_isRestore) - /*@modifies gc.flags@*/ ; - -static void context_restoreFlag (flagcode p_f) /*@modifies gc.flags@*/ ; - -/*@+enumindex@*/ - -cstring context_unparseFlagMarkers () -{ - return (flagMarkerList_unparse (gc.markers)); -} - -void context_setPreprocessing (void) -{ - llassert (!gc.preprocessing); - gc.preprocessing = TRUE; -} - -void context_clearPreprocessing (void) -{ - llassert (gc.preprocessing); - gc.preprocessing = FALSE; -} - -bool context_isPreprocessing (void) -{ - return gc.preprocessing; -} - -void context_setInCommandLine (void) -{ - llassert (!gc.incommandline); - gc.incommandline = TRUE; -} - -void context_clearInCommandLine (void) -{ - llassert (gc.incommandline); - gc.incommandline = FALSE; -} - -bool context_isInCommandLine (void) -{ - return gc.incommandline; -} - -static -void pushClause (clause c) /*@modifies gc.clauses, gc.inclause@*/ -{ - gc.inclause = c; - clauseStack_push (gc.clauses, c); - - if (clause_isConditional (c) - && context_getFlag (FLG_CONTROLNESTDEPTH)) - { - int maxdepth = context_getValue (FLG_CONTROLNESTDEPTH); - int depth = clauseStack_controlDepth (gc.clauses); - - if (depth == maxdepth + 1) - { - voptgenerror - (FLG_CONTROLNESTDEPTH, - message ("Maximum control nesting depth " - "(%d) exceeded", - maxdepth), - g_currentloc); - } - } -} - -static -clause topClause (clauseStack s) /*@*/ -{ - if (clauseStack_isEmpty (s)) return NOCLAUSE; - return ((clause) clauseStack_top (s)); -} - -void -context_addMacroCache (/*@only@*/ cstring def) -{ - macrocache_addEntry (gc.mc, fileloc_copy (g_currentloc), def); -} - -void -context_addComment (/*@only@*/ cstring def) -{ - macrocache_addComment (gc.mc, fileloc_copy (g_currentloc), def); -} - -/* -** returns TRUE is fl is in ignore region, or region where -code -** -** the logic is fuzzy... -*/ - -static bool -context_inSuppressFlagZone (fileloc fl, flagcode code) -{ - ynm ret = flagMarkerList_suppressError (gc.markers, code, fl); - bool res = FALSE; - - if (ynm_isMaybe (ret)) - { - /* - ** whas is dis? - */ - - if (gc.savedFlags) - { - res = !gc.saveflags[code]; - } - else - { - res = !context_getFlag (code); - } - } - else - { - res = ynm_toBoolStrict (ret); - } - - return res; -} - -static bool -context_suppressSystemMsg (fileloc fl) -{ - if (context_getFlag (FLG_SYSTEMDIRERRORS)) - { - return FALSE; - } - else - { - return (fileloc_isSystemFile (fl)); - } -} - -bool -context_suppressFlagMsg (flagcode flag, fileloc fl) -{ - if (context_suppressSystemMsg (fl)) - { - return TRUE; - } - - /* want same object compare here */ - - if (fileloc_equal (fl, g_currentloc) || gc.inDerivedFile) - { - return (!context_getFlag (flag) - || context_inSuppressRegion () - || context_inSuppressZone (fl) - || (gc.inDerivedFile && context_inSuppressFlagZone (fl, flag))); - } - else - { - return (context_inSuppressFlagZone (fl, flag)); - } -} - -bool -context_suppressNotFlagMsg (flagcode flag, fileloc fl) -{ - - if (context_suppressSystemMsg (fl)) - { - return TRUE; - } - - /*@access fileloc@*/ - if (fl == g_currentloc) - /*@noaccess fileloc@*/ - { - return (context_getFlag (flag) || context_inSuppressRegion ()); - } - else - { - /* for now... */ - return (context_getFlag (flag) || context_inSuppressRegion ()); - } -} - -bool -context_inSuppressZone (fileloc fl) -{ - if (context_suppressSystemMsg (fl)) - { - return TRUE; - } - - return (flagMarkerList_inIgnore (gc.markers, fl)); -} - -bool -context_inSuppressRegion (void) -{ - return (gc.insuppressregion); -} - -void -context_enterSuppressRegion (void) -{ - if (gc.insuppressregion) - { - gc.insuppressregion = FALSE; /* get this msg! */ - llmsg (message - ("%q: New ignore errors region entered while in ignore errors region", - fileloc_unparse (g_currentloc))); - } - - gc.insuppressregion = TRUE; - flagMarkerList_add (gc.markers, flagMarker_createIgnoreOn (g_currentloc)); -} - -static void -context_addFlagMarker (flagcode code, ynm set) -{ - flagMarkerList_add (gc.markers, - flagMarker_createLocalSet (code, set, g_currentloc)); -} - -void -context_enterSuppressLine (int count) -{ - fileloc nextline = fileloc_copy (g_currentloc); - - flagMarkerList_add (gc.markers, - flagMarker_createIgnoreCount (count, g_currentloc)); - - fileloc_nextLine (nextline); - flagMarkerList_add (gc.markers, - flagMarker_createIgnoreOff (nextline)); - fileloc_free (nextline); -} - -void context_checkSuppressCounts (void) -{ - if (context_getFlag (FLG_SUPCOUNTS)) - { - flagMarkerList_checkSuppressCounts (gc.markers); - } -} - -void context_incLineno (void) -{ - gc.linesprocessed++; - incLine (); -} - -void -context_exitSuppressRegion (void) -{ - if (!gc.insuppressregion) - { - llerrorlit (FLG_SYNTAX, - "End ignore errors in region while not ignoring errors"); - } - - gc.insuppressregion = FALSE; - flagMarkerList_add (gc.markers, flagMarker_createIgnoreOff (g_currentloc)); -} - -# ifndef NOLCL -void -context_enterLCLfile (void) -{ - gc.kind = CX_LCL; - gc.facct = typeIdSet_emptySet (); -} -# endif - -static void -addModuleAccess (/*@only@*/ cstring fname, typeIdSet mods) -{ - int i; - - for (i = 0; i < gc.nmods; i++) - { - if (cstring_equal (gc.moduleaccess[i].file, fname)) - { - gc.moduleaccess[i].daccess = typeIdSet_union (gc.moduleaccess[i].daccess, mods); - cstring_free (fname); - return; - } - } - - if (gc.nmods == gc.maxmods) - { - maccesst *oldmods; - - gc.maxmods = gc.maxmods + DEFAULTMAXMODS; - oldmods = gc.moduleaccess; - - gc.moduleaccess = (maccesst *) dmalloc (sizeof (*gc.moduleaccess) * (gc.maxmods)); - - for (i = 0; i < gc.nmods; i++) - { - gc.moduleaccess[i] = oldmods[i]; - } - - sfree (oldmods); - } - - gc.moduleaccess[gc.nmods].file = fname; - gc.moduleaccess[gc.nmods].daccess = mods; - - gc.nmods++; -} - -static void -insertModuleAccess (cstring fname, typeId t) -{ - int i; - - for (i = 0; i < gc.nmods; i++) - { - if (cstring_equal (gc.moduleaccess[i].file, fname)) - { - gc.moduleaccess[i].daccess = typeIdSet_insert (gc.moduleaccess[i].daccess, t); - break; - } - } - - addModuleAccess (cstring_copy (fname), typeIdSet_single (t)); -} - -# ifndef NOLCL -void -context_exitLCLfile (void) -{ - if (gc.kind != CX_LCLLIB) - { - char *lclname = - removeExtension (cstring_toCharsSafe - (fileName (currentFile ())), ".lcl"); - - addModuleAccess (cstring_fromCharsO (removePath (lclname)), gc.facct); - - mstring_free (lclname); - } - - gc.kind = CX_LCL; - gc.kind = CX_GLOBAL; - gc.facct = typeIdSet_emptySet (); -} -# endif - -void -context_dumpModuleAccess (FILE *fout) -{ - int i = 0; - - for (i = 0; i < gc.nmods; i++) - { - cstring td = typeIdSet_dump (gc.moduleaccess[i].daccess); - - fprintf (fout, "%s#%s@\n", - cstring_toCharsSafe (gc.moduleaccess[i].file), - cstring_toCharsSafe (td)); - - cstring_free (td); - } -} - -bool context_usingPosixLibrary () -{ - return (gc.library == FLG_POSIXLIB - || gc.library == FLG_POSIXSTRICTLIB - || gc.library == FLG_UNIXLIB - || gc.library == FLG_UNIXSTRICTLIB); -} - -bool context_usingAnsiLibrary () -{ - return (gc.library != FLG_NOLIB); -} - -flagcode context_getLibrary () -{ - return gc.library; -} - -void context_setLibrary (flagcode code) -{ - gc.library = code; -} - -/*@observer@*/ char *context_selectedLibrary () -{ - switch (gc.library) - { - case FLG_STRICTLIB: - return LLSTRICTLIBS_NAME; - case FLG_POSIXLIB: - return LLPOSIXLIBS_NAME; - case FLG_POSIXSTRICTLIB: - return LLPOSIXSTRICTLIBS_NAME; - case FLG_UNIXLIB: - return LLUNIXLIBS_NAME; - case FLG_UNIXSTRICTLIB: - return LLUNIXSTRICTLIBS_NAME; - case FLG_ANSILIB: - return LLSTDLIBS_NAME; - BADDEFAULT; - } -} - - -void -context_loadModuleAccess (FILE *in) -{ - char *s = mstring_create (MAX_DUMP_LINE_LENGTH); - char *lasts = s; - char *name = mstring_create (MAX_NAME_LENGTH); - char *oname = name; -# ifndef NOFREE - char *os = s; -# endif - - while (fgets (s, MAX_DUMP_LINE_LENGTH, in) != NULL - && *s == ';') - { - ; - } - - while (s != NULL && *s != ';' && *s != '\0') - { - name = oname; - - while (*s != '#' && *s != '\0') - { - *name++ = *s++; - } - - *name = '\0'; - - if (*s != '#') - { - llcontbug (message ("context_loadModuleAccess: bad library line: %s\n", - cstring_fromChars (s))); - break; - } - - s++; - - addModuleAccess (cstring_copy (cstring_fromChars (oname)), - typeIdSet_undump (&s)); - - (void) fgets (s, MAX_DUMP_LINE_LENGTH, in); - llassert (s != lasts); - lasts = s; - } - - sfree (oname); -# ifndef NOFREE - sfree (os); -# endif -} - -typeIdSet context_fileAccessTypes (void) -{ - return gc.facct; -} - -void -context_resetModeFlags (void) -{ - - allFlagCodes (code) - { - if (flagcode_isModeFlag (code)) - { - context_setFlag (code, FALSE); - } - } end_allFlagCodes; - - } - -/* -** resetAllFlags -** -** Set all flags to FALSE, except for a few which are -** true by default. -** -** Set all values and strings to appropriate defaults. -** Set all counters to 0. -*/ - -static void -conext_resetAllCounters (void) -{ - int i; - - for (i = 0; i < NUMVALUEFLAGS; i++) - { - gc.counters[i] = 0; - } -} - -void -context_resetAllFlags (void) -{ - allFlagCodes (code) - { - gc.flags[code] = FALSE; - - if (flagcode_hasValue (code)) - { - int val = 0; - - /*@-loopswitchbreak@*/ - switch (code) - { - case FLG_LIMIT: - val = DEFAULT_LIMIT; break; - case FLG_LINELEN: - val = DEFAULT_LINELEN; break; - case FLG_EXTERNALNAMELEN: - val = DEFAULT_EXTERNALNAMELEN; break; - case FLG_INTERNALNAMELEN: - val = DEFAULT_INTERNALNAMELEN; break; - case FLG_COMMENTCHAR: - val = (int) DEFAULT_COMMENTCHAR; break; - case FLG_CONTROLNESTDEPTH: - val = (int) DEFAULT_CONTROLNESTDEPTH; break; - case FLG_STRINGLITERALLEN: - val = (int) DEFAULT_STRINGLITERALLEN; break; - case FLG_INCLUDENEST: - val = (int) DEFAULT_INCLUDENEST; break; - case FLG_NUMSTRUCTFIELDS: - val = (int) DEFAULT_NUMSTRUCTFIELDS; break; - case FLG_NUMENUMMEMBERS: - val = (int) DEFAULT_NUMENUMMEMBERS; break; - case FLG_EXPECT: - case FLG_LCLEXPECT: - break; - default: - llbug (message ("Bad value flag: %s", flagcode_unparse (code))); - } - /*@=loopswitchbreak@*/ - - context_setValue (code, val); - } - else if (flagcode_hasString (code)) - { - cstring val = cstring_undefined; - - switch (code) - { /*@-loopswitchbreak@*/ - case FLG_LARCHPATH: - { - char *larchpath = osd_getEnvironmentVariable (LARCH_PATH); - - if (larchpath != NULL) - { - val = cstring_fromCharsNew (larchpath); - } - else - { - val = cstring_makeLiteral (DEFAULT_LARCHPATH); - } - - break; - } - case FLG_LCLIMPORTDIR: - { - val = cstring_fromCharsNew (osd_getEnvironment (LCLIMPORTDIR, DEFAULT_LCLIMPORTDIR)); - break; - } - case FLG_TMPDIR: -# if defined(OS2) || defined(MSDOS) || defined(WIN32) - { - char *env = osd_getEnvironmentVariable ("TMP"); - - if (env == NULL) - { - env = osd_getEnvironmentVariable ("TEMP"); - } - - val = cstring_makeLiteral (env != NULL ? env : DEFAULT_TMPDIR); - } -# else - val = cstring_makeLiteral (DEFAULT_TMPDIR); -# endif /* !defined(OS2) && !defined(MSDOS) */ - - break; - case FLG_BOOLTYPE: - val = cstring_makeLiteral (DEFAULT_BOOLTYPE); break; - case FLG_BOOLFALSE: - val = cstring_makeLiteral ("FALSE"); break; - case FLG_BOOLTRUE: - val = cstring_makeLiteral ("TRUE"); break; - case FLG_MACROVARPREFIX: - val = cstring_makeLiteral ("m_"); break; - case FLG_SYSTEMDIRS: - val = cstring_makeLiteral (DEFAULT_SYSTEMDIR); break; - default: - break; - } /*@=loopswitchbreak@*/ - - context_setString (code, val); - } - else - { - ; /* nothing to set */ - } - } end_allFlagCodes; - - /* - ** These flags are true by default. - */ - - gc.flags[FLG_MODIFIES] = TRUE; - gc.flags[FLG_NESTCOMMENT] = TRUE; - gc.flags[FLG_GLOBALS] = TRUE; - gc.flags[FLG_FULLINITBLOCK] = TRUE; - gc.flags[FLG_LIKELYBOOL] = TRUE; - gc.flags[FLG_ZEROPTR] = TRUE; - gc.flags[FLG_NUMLITERAL] = TRUE; - gc.flags[FLG_DUPLICATEQUALS] = TRUE; - gc.flags[FLG_SKIPANSIHEADERS] = TRUE; - gc.flags[FLG_SKIPPOSIXHEADERS] = TRUE; - gc.flags[FLG_SYSTEMDIREXPAND] = TRUE; - gc.flags[FLG_UNRECOGCOMMENTS] = TRUE; - gc.flags[FLG_CASTFCNPTR] = TRUE; - gc.flags[FLG_DOLCS] = TRUE; - gc.flags[FLG_USEVARARGS] = TRUE; - gc.flags[FLG_MAINTYPE] = TRUE; - gc.flags[FLG_SPECMACROS] = TRUE; - gc.flags[FLG_REDEF] = TRUE; - gc.flags[FLG_MACRONEXTLINE] = TRUE; - - gc.flags[FLG_SIZEOFFORMALARRAY] = TRUE; - gc.flags[FLG_FIXEDFORMALARRAY] = TRUE; - - gc.flags[FLG_PREDASSIGN] = TRUE; - gc.flags[FLG_MODOBSERVER] = TRUE; - gc.flags[FLG_MACROVARPREFIXEXCLUDE] = TRUE; - gc.flags[FLG_EXTERNALNAMECASEINSENSITIVE] = TRUE; - - gc.flags[FLG_PARAMIMPTEMP] = TRUE; - gc.flags[FLG_RETIMPONLY] = TRUE; - gc.flags[FLG_GLOBIMPONLY] = TRUE; - gc.flags[FLG_STRUCTIMPONLY] = TRUE; - gc.flags[FLG_PREPROC] = TRUE; - gc.flags[FLG_NAMECHECKS] = TRUE; - gc.flags[FLG_FORMATCODE] = TRUE; - gc.flags[FLG_FORMATTYPE] = TRUE; - gc.flags[FLG_BADFLAG] = TRUE; - gc.flags[FLG_WARNFLAGS] = TRUE; - gc.flags[FLG_WARNUNIXLIB] = TRUE; - gc.flags[FLG_WARNPOSIX] = TRUE; - gc.flags[FLG_SHOWCOL] = TRUE; - gc.flags[FLG_SHOWFUNC] = TRUE; - gc.flags[FLG_SUPCOUNTS] = TRUE; - gc.flags[FLG_HINTS] = TRUE; - gc.flags[FLG_SYNTAX] = TRUE; - gc.flags[FLG_TYPE] = TRUE; - gc.flags[FLG_INCOMPLETETYPE] = TRUE; - gc.flags[FLG_ABSTRACT] = TRUE; - gc.flags[FLG_ITER] = TRUE; - gc.flags[FLG_CONTROL] = TRUE; - gc.flags[FLG_UNRECOG] = TRUE; - gc.flags[FLG_SYSTEMUNRECOG] = TRUE; - gc.flags[FLG_LINTCOMMENTS] = TRUE; - gc.flags[FLG_ACCESSCZECH] = TRUE; - gc.flags[FLG_ACCESSMODULE] = TRUE; - gc.flags[FLG_ACCESSFILE] = TRUE; - gc.flags[FLG_MACROVARPREFIX] = TRUE; - - /* - ** Changed for version 2.4. - */ - - gc.flags[FLG_GNUEXTENSIONS] = TRUE; - - /* - ** On by default for Win32, but not Unix (to support MS/VC++ error message format). - */ - -# ifdef WIN32 - gc.flags[FLG_PARENFILEFORMAT] = TRUE; -# endif -} - -/* -** C is way-lame, and you can initialize an array to a constant except where -** it is declared. Hence, a macro is used to set the modeflags. -*/ - -/*@notfunction@*/ -# define SETFLAGS() \ - { int i = 0; while (modeflags[i] != INVALID_FLAG) { \ - if (!flagcode_isModeFlag (modeflags[i])) \ - { llbug (message ("not a mode flag: %s", \ - flagcode_unparse (modeflags[i]))); } \ - else { context_setFlag (modeflags[i], TRUE); } i++; }} - -void -context_setMode (cstring s) -{ - intSet setflags = intSet_new (); - - allFlagCodes (code) - { - if (flagcode_isModeFlag (code)) - { - if (gc.setGlobally[code]) - { - (void) intSet_insert (setflags, (int) code); - } - } - } end_allFlagCodes; - - if (!intSet_isEmpty (setflags)) - { - cstring rflags = cstring_undefined; - int num = 0; - - intSet_elements (setflags, el) - { - if (cstring_isUndefined (rflags)) - { - rflags = cstring_copy (flagcode_unparse ((flagcode) (el))); - } - else - { - rflags = message ("%q, %s", rflags, - flagcode_unparse ((flagcode) el)); - } - - num++; - if (num > 4 && intSet_size (setflags) > 6) - { - rflags = message ("%q, (%d others) ...", rflags, - intSet_size (setflags) - num); - break; - } - } end_intSet_elements ; - - voptgenerror (FLG_WARNFLAGS, - message ("Setting mode %s after setting mode flags will " - "override set values of flags: %s", - s, rflags), - g_currentloc); - - cstring_free (rflags); - } - - intSet_free (setflags); - - context_resetModeFlags (); - - if (cstring_equalLit (s, "standard")) - { - flagcode modeflags[] = - { - FLG_ENUMINT, FLG_MACROMATCHNAME, - FLG_MACROUNDEF, FLG_RELAXQUALS, - FLG_USEALLGLOBS, FLG_CHECKSTRICTGLOBALS, - FLG_CHECKSTRICTGLOBALIAS, - FLG_CHECKEDGLOBALIAS, - FLG_CHECKMODGLOBALIAS, - FLG_PREDBOOLOTHERS, FLG_PREDBOOLINT, - FLG_PARAMUNUSED, FLG_VARUNUSED, FLG_FUNCUNUSED, - FLG_TYPEUNUSED, - FLG_CONSTUNUSED, FLG_ENUMMEMUNUSED, FLG_FIELDUNUSED, - FLG_PTRNUMCOMPARE, FLG_BOOLCOMPARE, FLG_MUTREP, - FLG_NOEFFECT, FLG_IMPTYPE, - FLG_RETVALOTHER, FLG_RETVALBOOL, FLG_RETVALINT, - FLG_SPECUNDEF, FLG_INCONDEFS, FLG_INCONDEFSLIB, - FLG_MATCHFIELDS, - FLG_MACROPARAMS, FLG_MACROASSIGN, FLG_SEFPARAMS, - FLG_MACROSTMT, FLG_MACROPARENS, - FLG_MACROFCNDECL, - FLG_MACROCONSTDECL, - FLG_MACROREDEF, FLG_INFLOOPS, FLG_UNREACHABLE, - FLG_NORETURN, FLG_CASEBREAK, FLG_MISSCASE, FLG_USEDEF, - FLG_FIRSTCASE, - FLG_NESTEDEXTERN, - FLG_NUMLITERAL, - FLG_ZEROBOOL, - /* memchecks flags */ - FLG_NULLDEREF, - FLG_NULLSTATE, FLG_NULLASSIGN, - FLG_NULLPASS, FLG_NULLRET, - - FLG_COMPDEF, FLG_COMPMEMPASS, FLG_UNIONDEF, - FLG_RETSTACK, - - /* memtrans flags */ - FLG_EXPOSETRANS, - FLG_OBSERVERTRANS, - FLG_DEPENDENTTRANS, - FLG_NEWREFTRANS, - FLG_ONLYTRANS, - FLG_OWNEDTRANS, - FLG_FRESHTRANS, - FLG_SHAREDTRANS, - FLG_TEMPTRANS, - FLG_KEPTTRANS, - FLG_REFCOUNTTRANS, - FLG_STATICTRANS, - FLG_UNKNOWNTRANS, - FLG_KEEPTRANS, - FLG_IMMEDIATETRANS, - - FLG_EXPORTLOCAL, - - FLG_USERELEASED, FLG_ALIASUNIQUE, FLG_MAYALIASUNIQUE, - FLG_MUSTFREE, FLG_MUSTDEFINE, FLG_GLOBSTATE, - FLG_COMPDESTROY, FLG_MUSTNOTALIAS, - FLG_MEMIMPLICIT, - FLG_BRANCHSTATE, - - FLG_EVALORDER, FLG_SHADOW, FLG_READONLYSTRINGS, - FLG_EXITARG, - FLG_IMPCHECKEDSPECGLOBALS, - FLG_MODGLOBS, FLG_WARNLINTCOMMENTS, - FLG_IFEMPTY, FLG_REALCOMPARE, - FLG_BOOLOPS, FLG_PTRNEGATE, - FLG_SHIFTSIGNED, - INVALID_FLAG } ; - - SETFLAGS (); - } - else if (cstring_equalLit (s, "weak")) - { - flagcode modeflags[] = - { - FLG_BOOLINT, FLG_CHARINT, FLG_FLOATDOUBLE, - FLG_ENUMINT, FLG_RELAXQUALS, FLG_FORWARDDECL, - FLG_CHARINDEX, FLG_ABSTVOIDP, FLG_USEALLGLOBS, - FLG_CHARUNSIGNEDCHAR, - FLG_PREDBOOLOTHERS, - FLG_VARUNUSED, FLG_FUNCUNUSED, - FLG_TYPEUNUSED, - FLG_CHECKSTRICTGLOBALS, FLG_MACROMATCHNAME, - FLG_RETVALOTHER, - FLG_IFEMPTY, - FLG_RETSTACK, FLG_PTRNEGATE, - FLG_LONGUNSIGNEDINTEGRAL, - FLG_LONGUNSIGNEDUNSIGNEDINTEGRAL, - FLG_NUMLITERAL, - FLG_CHARINTLITERAL, - FLG_ZEROBOOL, - INVALID_FLAG - } ; - - SETFLAGS (); - } - else if (cstring_equalLit (s, "checks")) - { - flagcode modeflags[] = - { - FLG_EXPORTLOCAL, FLG_IMPTYPE, - FLG_CHECKSTRICTGLOBALIAS, - FLG_CHECKEDGLOBALIAS, - FLG_CHECKMODGLOBALIAS, - FLG_UNCHECKEDGLOBALIAS, - FLG_EXITARG, FLG_PTRNUMCOMPARE, - FLG_BOOLCOMPARE, FLG_MACROUNDEF, - FLG_MUSTMOD, FLG_ALLGLOBALS, - FLG_PREDBOOLOTHERS, FLG_PREDBOOLPTR, FLG_PREDBOOLINT, - FLG_USEALLGLOBS, FLG_MUTREP, FLG_RETALIAS, - FLG_RETEXPOSE, FLG_ASSIGNEXPOSE, FLG_CASTEXPOSE, - FLG_FUNCUNUSED, FLG_GLOBALSIMPMODIFIESNOTHING, - FLG_TYPEUNUSED, FLG_FIELDUNUSED, FLG_PARAMUNUSED, FLG_VARUNUSED, - FLG_CONSTUNUSED, FLG_ENUMMEMUNUSED, - FLG_NOEFFECT, FLG_EXPORTHEADER, FLG_EXPORTHEADERVAR, - FLG_RETVALOTHER, FLG_RETVALBOOL, FLG_RETVALINT, - FLG_SPECUNDEF, FLG_IMPCHECKMODINTERNALS, - FLG_DECLUNDEF, FLG_INCONDEFS, FLG_INCONDEFSLIB, - FLG_MATCHFIELDS, - FLG_MACROPARAMS, - FLG_MACROASSIGN, - FLG_DECLPARAMMATCH, - FLG_FCNDEREF, - FLG_FIRSTCASE, - FLG_SEFPARAMS, FLG_SEFUNSPEC, FLG_MACROSTMT, FLG_MACROPARENS, - FLG_MACROCONSTDECL, - FLG_MACROFCNDECL, - FLG_MACROREDEF, - FLG_INFLOOPS, FLG_INFLOOPSUNCON, - FLG_UNREACHABLE, - FLG_NORETURN, FLG_CASEBREAK, FLG_MISSCASE, - FLG_EVALORDER, FLG_USEDEF, - - FLG_NESTEDEXTERN, - - /* memchecks flags */ - - FLG_NULLSTATE, FLG_NULLDEREF, FLG_NULLASSIGN, - FLG_NULLPASS, FLG_NULLRET, - - FLG_COMPDEF, FLG_COMPMEMPASS, FLG_UNIONDEF, FLG_RETSTACK, - - /* memtrans flags */ - FLG_EXPOSETRANS, - FLG_OBSERVERTRANS, - FLG_DEPENDENTTRANS, - FLG_NEWREFTRANS, - FLG_ONLYTRANS, - FLG_OWNEDTRANS, - FLG_FRESHTRANS, - FLG_SHAREDTRANS, - FLG_TEMPTRANS, - FLG_KEPTTRANS, - FLG_REFCOUNTTRANS, - FLG_STATICTRANS, - FLG_UNKNOWNTRANS, - FLG_STATICINITTRANS, - FLG_UNKNOWNINITTRANS, - FLG_KEEPTRANS, - FLG_IMMEDIATETRANS, - FLG_ONLYUNQGLOBALTRANS, - FLG_USERELEASED, FLG_ALIASUNIQUE, FLG_MAYALIASUNIQUE, - FLG_MUSTFREE, FLG_MUSTDEFINE, FLG_GLOBSTATE, - FLG_COMPDESTROY, FLG_MUSTNOTALIAS, - FLG_MEMIMPLICIT, - FLG_BRANCHSTATE, - FLG_NULLPOINTERARITH, - FLG_SHADOW, FLG_DEPARRAYS, - FLG_REDECL, FLG_READONLYSTRINGS, FLG_READONLYTRANS, - FLG_LOOPLOOPBREAK, FLG_SWITCHLOOPBREAK, FLG_MODGLOBS, - FLG_CHECKSTRICTGLOBALS, FLG_IMPCHECKEDSPECGLOBALS, - FLG_MACROMATCHNAME, FLG_WARNLINTCOMMENTS, - FLG_INCLUDENEST, FLG_ANSIRESERVED, FLG_CPPNAMES, - FLG_NOPARAMS, FLG_IFEMPTY, FLG_WHILEEMPTY, FLG_REALCOMPARE, - FLG_BOOLOPS, FLG_SHIFTSIGNED, - INVALID_FLAG } ; - - SETFLAGS (); - } - else if (cstring_equalLit (s, "strict")) - { - flagcode modeflags[] = - { - FLG_CHECKSTRICTGLOBALIAS, - FLG_CHECKEDGLOBALIAS, - FLG_CHECKMODGLOBALIAS, - FLG_UNCHECKEDGLOBALIAS, - FLG_MODFILESYSTEM, - FLG_MACROMATCHNAME, - FLG_MACROUNDEF, FLG_MUTREP, FLG_MUSTMOD, - FLG_ALLGLOBALS, FLG_IMPTYPE, - FLG_MODNOMODS, FLG_MODGLOBSUNSPEC, FLG_MODSTRICTGLOBSUNSPEC, - FLG_GLOBUNSPEC, FLG_SIZEOFTYPE, - FLG_EXPORTHEADER, FLG_EXPORTHEADERVAR, - FLG_NOPARAMS, FLG_OLDSTYLE, FLG_EXITARG, - FLG_RETSTACK, - FLG_FCNDEREF, - FLG_ONLYUNQGLOBALTRANS, - FLG_GLOBALSIMPMODIFIESNOTHING, - FLG_PREDBOOLOTHERS, FLG_PREDBOOLPTR, FLG_PREDBOOLINT, - FLG_INTERNALGLOBS, FLG_INTERNALGLOBSNOGLOBS, - FLG_USEALLGLOBS, FLG_RETALIAS, - FLG_MODGLOBS, FLG_MODGLOBSUNSPEC, FLG_MODGLOBSUNCHECKED, - FLG_RETEXPOSE, FLG_ASSIGNEXPOSE, FLG_CASTEXPOSE, - FLG_NOEFFECTUNCON, FLG_EVALORDERUNCON, - FLG_FUNCUNUSED, - FLG_EXPORTITER, FLG_EXPORTCONST, - FLG_TYPEUNUSED, FLG_FIELDUNUSED, FLG_PARAMUNUSED, FLG_TOPUNUSED, - FLG_CONSTUNUSED, FLG_ENUMMEMUNUSED, - FLG_VARUNUSED, - FLG_NULLPOINTERARITH, FLG_POINTERARITH, - FLG_PTRNUMCOMPARE, - FLG_BOOLCOMPARE, FLG_NOEFFECT, - FLG_RETVALINT, FLG_RETVALBOOL, FLG_RETVALOTHER, - FLG_ANSIRESERVED, FLG_ANSIRESERVEDLOCAL, FLG_CPPNAMES, - FLG_RETVALBOOL, FLG_RETVALINT, FLG_SPECUNDEF, - FLG_DECLUNDEF, FLG_STRICTOPS, FLG_INCONDEFS, - FLG_INCONDEFSLIB, FLG_MATCHFIELDS, FLG_EXPORTMACRO, FLG_EXPORTVAR, - FLG_EXPORTFCN, FLG_EXPORTTYPE, FLG_EXPORTLOCAL, FLG_MACROPARAMS, - FLG_MACROASSIGN, - FLG_SEFPARAMS, FLG_SEFUNSPEC, FLG_MACROSTMT, FLG_MACROPARENS, - FLG_MACROFCNDECL, - FLG_MACROCONSTDECL, - FLG_MACROREDEF, FLG_MACROEMPTY, - FLG_INFLOOPS, FLG_INFLOOPSUNCON, - FLG_UNREACHABLE, - FLG_NORETURN, FLG_CASEBREAK, FLG_MISSCASE, FLG_USEDEF, - FLG_EVALORDER, - FLG_MODUNCON, FLG_MODUNCONNOMODS, FLG_MODINTERNALSTRICT, - FLG_MODOBSERVERUNCON, - - FLG_NESTEDEXTERN, - FLG_FIRSTCASE, - - /* memchecks flags */ - FLG_NULLSTATE, FLG_NULLDEREF, FLG_NULLASSIGN, - FLG_NULLPASS, FLG_NULLRET, - - FLG_COMPDEF, FLG_COMPMEMPASS, FLG_UNIONDEF, - - /* memtrans flags */ - FLG_EXPOSETRANS, - FLG_OBSERVERTRANS, - FLG_DEPENDENTTRANS, - FLG_NEWREFTRANS, - FLG_ONLYTRANS, - FLG_OWNEDTRANS, - FLG_FRESHTRANS, - FLG_SHAREDTRANS, - FLG_TEMPTRANS, - FLG_KEPTTRANS, - FLG_REFCOUNTTRANS, - FLG_STATICTRANS, - FLG_UNKNOWNTRANS, - FLG_KEEPTRANS, - FLG_IMMEDIATETRANS, - FLG_STATICINITTRANS, - FLG_UNKNOWNINITTRANS, - - FLG_USERELEASED, FLG_ALIASUNIQUE, FLG_MAYALIASUNIQUE, - FLG_MUSTFREE, FLG_MUSTDEFINE, FLG_GLOBSTATE, - FLG_COMPDESTROY, FLG_MUSTNOTALIAS, - FLG_MEMIMPLICIT, - FLG_BRANCHSTATE, - - FLG_DECLPARAMNAME, FLG_DECLPARAMMATCH, - - FLG_SHADOW, FLG_DEPARRAYS, - FLG_STRICTDESTROY, FLG_STRICTUSERELEASED, FLG_STRICTBRANCHSTATE, - FLG_REDECL, FLG_READONLYSTRINGS, FLG_READONLYTRANS, - FLG_LOOPLOOPBREAK, FLG_LOOPSWITCHBREAK, FLG_SWITCHLOOPBREAK, - FLG_SWITCHSWITCHBREAK, FLG_LOOPLOOPCONTINUE, - FLG_CHECKSTRICTGLOBALS, FLG_IMPCHECKEDSPECGLOBALS, - FLG_ALLGLOBALS, FLG_IMPCHECKEDSTRICTGLOBALS, - FLG_IMPCHECKEDSTRICTSTATICS, - FLG_IMPCHECKEDSTRICTSPECGLOBALS, - FLG_IMPCHECKMODINTERNALS, - FLG_WARNMISSINGGLOBALS, FLG_WARNMISSINGGLOBALSNOGLOBS, - FLG_WARNLINTCOMMENTS, FLG_ANSIRESERVEDLOCAL, - FLG_INCLUDENEST, FLG_STRINGLITERALLEN, - FLG_NUMSTRUCTFIELDS, FLG_NUMENUMMEMBERS, - FLG_CONTROLNESTDEPTH, - FLG_FORBLOCK, FLG_WHILEBLOCK, - FLG_FOREMPTY, FLG_WHILEEMPTY, - FLG_IFEMPTY, FLG_IFBLOCK, - FLG_ELSEIFCOMPLETE, - FLG_REALCOMPARE, FLG_BOOLOPS, - FLG_SYSTEMDIRERRORS, FLG_UNUSEDSPECIAL, - - FLG_SHIFTSIGNED, FLG_BITWISEOPS, - INVALID_FLAG } ; - - SETFLAGS (); - } - else - { - llcontbug (message ("context_setMode: bad mode: %s", s)); - } -} - -bool -context_isSpecialFile (cstring fname) -{ - char *ext = filenameExtension (cstring_toCharsSafe (fname)); - - return (mstring_equal (ext, ".y") - || mstring_equal (ext, ".l") - || cstring_equalLit (fname, "lex.yy.c")); -} - -bool -context_isSystemDir (cstring dir) -{ - cstring sysDirs = context_exposeString (FLG_SYSTEMDIRS); - char *thisdir = cstring_toCharsSafe (sysDirs); - char *nextdir = strchr (thisdir, SEPCHAR); - - if (nextdir != NULL) - { - *nextdir = '\0'; - nextdir += 1; - } - - while (thisdir != NULL) - { - DPRINTF (("Test: %s / %s", dir, thisdir)); - - if (cstring_equalCanonicalPrefix (dir, thisdir)) - { - if (nextdir != NULL) - { - *(nextdir - 1) = SEPCHAR; - } - - return TRUE; - } - - if (nextdir != NULL) - { - *(nextdir - 1) = SEPCHAR; - } - - if (nextdir != NULL) - { - thisdir = nextdir; - nextdir = strchr (thisdir, SEPCHAR); - - if (nextdir != NULL) - { - *nextdir = '\0'; - nextdir += 1; - } - } - else - { - break; - } - } - - DPRINTF (("Returns FALSE")); - return FALSE; -} - -void -context_addFileAccessType (typeId t) -{ - cstring base; - - if (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN - || gc.kind == CX_UNKNOWNMACRO) - { - gc.acct = typeIdSet_insert (gc.acct, t); - } - - gc.facct = typeIdSet_insert (gc.facct, t); - - base = fileloc_getBase (g_currentloc); - insertModuleAccess (base, t); - DPRINTF (("Add file access: %s / %s", typeIdSet_unparse (gc.facct), - typeIdSet_unparse (gc.acct))); -} - -void -context_removeFileAccessType (typeId t) -{ - if (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN - || gc.kind == CX_UNKNOWNMACRO) - { - gc.acct = typeIdSet_removeFresh (gc.acct, t); - } - - gc.facct = typeIdSet_removeFresh (gc.facct, t); - gc.nacct = typeIdSet_insert (gc.nacct, t); -} - -void context_enterFunctionDecl (void) -{ - llassert (gc.kind == CX_GLOBAL); - gc.kind = CX_FCNDECL; -} - -void context_exitFunctionDecl (void) -{ - gc.kind = CX_GLOBAL; -} - -bool context_inFunctionDecl (void) -{ - return (gc.kind == CX_FCNDECL); -} - -void -context_enterMacro (/*@observer@*/ uentry e) -{ - context_enterFunction (e); - gc.kind = CX_MACROFCN; -} - -void -context_enterUnknownMacro (/*@dependent@*/ uentry e) -{ - llassert (uentry_isFunction (e)); - context_enterFunction (e); - gc.kind = CX_UNKNOWNMACRO; -} - -void context_enterAndClause (exprNode e) -{ - - usymtab_trueBranch (guardSet_copy (exprNode_getGuards (e))); - pushClause (ANDCLAUSE); -} - -void context_enterOrClause (exprNode e) -{ - usymtab_trueBranch (guardSet_invert (exprNode_getGuards (e))); - pushClause (ORCLAUSE); -} - -bool context_inDeepLoop (void) -{ - bool inLoop = FALSE; - - clauseStack_elements (gc.clauses, el) - { - if (clause_isLoop (el)) - { - if (inLoop) - { - return TRUE; - } - - inLoop = TRUE; - } - } end_clauseStack_elements; - - return FALSE; -} - -bool context_inDeepSwitch (void) -{ - bool inLoop = FALSE; - - clauseStack_elements (gc.clauses, el) - { - if (clause_isSwitch (el)) - { - if (inLoop) - { - return TRUE; - } - - inLoop = TRUE; - } - } end_clauseStack_elements; - - return FALSE; -} - -bool context_inDeepLoopSwitch (void) -{ - bool inLoop = FALSE; - - clauseStack_elements (gc.clauses, el) - { - if (clause_isBreakable (el)) - { - if (inLoop) - { - return TRUE; - } - - inLoop = TRUE; - } - } end_clauseStack_elements; - - return FALSE; -} - -clause context_breakClause (void) -{ - clauseStack_elements (gc.clauses, el) - { - if (clause_isSwitch (el)) - { - return el; - } - else if (clause_isLoop (el)) - { - return el; - } - else - { - ; - } - } end_clauseStack_elements; - - return NOCLAUSE; -} - -clause context_nextBreakClause (void) -{ - bool hasOne = FALSE; - - clauseStack_elements (gc.clauses, el) - { - if (clause_isBreakable (el)) - { - if (hasOne) - { - return el; - } - else - { - hasOne = TRUE; - } - } - } end_clauseStack_elements; - - return NOCLAUSE; -} - -bool context_inConditional (void) -{ - clauseStack_elements (gc.clauses, el) - { - /* - ** Should also include TRUECLAUSE and FALSECLAUSE, but need - ** to distinguish if from ? for this - */ - - if (clause_isBreakable (el) && (el != DOWHILECLAUSE)) - { - return TRUE; - } - } end_clauseStack_elements; - - return FALSE; -} - -void context_exitAndClause (exprNode pred, exprNode tbranch) -{ - context_setJustPopped (); - - llassert (gc.inclause == ANDCLAUSE); - - usymtab_popAndBranch (pred, tbranch); - clauseStack_pop (gc.clauses); - gc.inclause = topClause (gc.clauses); -} - -void context_exitOrClause (exprNode pred, exprNode tbranch) -{ - context_setJustPopped (); - - llassert (gc.inclause == ORCLAUSE); - - usymtab_popOrBranch (pred, tbranch); - clauseStack_pop (gc.clauses); - gc.inclause = topClause (gc.clauses); -} - -static void context_enterCondClauseAux (clause cl) - /*@modifies gc@*/ -{ - pushClause (cl); -} - -static void context_enterTrueAux (exprNode e, clause cl) - /*@modifies gc@*/ -{ - usymtab_trueBranch (guardSet_copy (exprNode_getGuards (e))); - pushClause (cl); -} - -void context_enterIterClause (void) -{ - context_enterTrueAux (exprNode_undefined, ITERCLAUSE); -} - -void context_enterDoWhileClause (void) -{ - pushClause (DOWHILECLAUSE); -} - -void context_enterWhileClause (exprNode e) -{ - context_enterTrueAux (e, WHILECLAUSE); -} - -void context_enterForClause (exprNode e) -{ - context_enterTrueAux (e, FORCLAUSE); -} - -void context_enterTrueClause (exprNode e) -{ - context_enterTrueAux (e, TRUECLAUSE); -} - -void context_enterSwitch (exprNode e) -{ - - usymtab_switchBranch (e); - context_enterCondClauseAux (SWITCHCLAUSE); -} - -void context_exitSwitch (exprNode e, bool allpaths) -{ - usymtab_exitSwitch (e, allpaths); - - while (clause_isCase (clauseStack_top (gc.clauses))) - { - clauseStack_pop (gc.clauses); - } - - context_exitClauseSimp (); -} - -void context_enterCaseClause (exprNode e) -{ - bool branch = FALSE; - - DPRINTF (("Enter case clause!")); - - branch = usymtab_newCase (exprNode_undefined, e); - - if (branch) - { - context_enterCondClauseAux (CASECLAUSE); - } -} - -static void context_enterFalseClauseAux (exprNode e, clause cl) - /*@modifies gc@*/ -{ - usymtab_altBranch (guardSet_invert (exprNode_getGuards (e))); - gc.inclause = cl; - clauseStack_switchTop (gc.clauses, cl); -} - -void context_enterFalseClause (exprNode e) -{ - - context_enterFalseClauseAux (e, FALSECLAUSE); -} - -void -context_enterConstantMacro (/*@exposed@*/ /*@dependent@*/ uentry e) -{ - gc.kind = CX_MACROCONST; - gc.cont.fcn = e; - gc.showfunction = context_getFlag (FLG_SHOWFUNC); - - gc.acct = typeIdSet_subtract (typeIdSet_union (gc.facct, uentry_accessType (e)), - gc.nacct); - - - usymtab_enterScope (); - sRef_enterFunctionScope (); - - gc.globs = globSet_undefined; - globSet_clear (gc.globs_used); - gc.mods = sRefSet_undefined; -} - -uentry context_getHeader (void) -{ - if (!(context_inFunctionLike () || (gc.kind == CX_MACROCONST))) - { - llfatalbug (message ("context_getHeader: bad call: %q", - context_unparse ())); - } - - return (gc.cont.fcn); -} - -void -context_setFunctionDefined (fileloc loc) -{ - switch (gc.kind) - { - case CX_UNKNOWNMACRO: - case CX_FUNCTION: - case CX_MACROFCN: - uentry_setFunctionDefined (gc.cont.fcn, loc); - break; - default: - /* (not a bug because of parse errors) */ - break; - } -} - -void -context_enterFunction (/*@exposed@*/ uentry e) -{ - gc.kind = CX_FUNCTION; - gc.cont.fcn = e; - - if (uentry_hasAccessType (e)) - { - gc.acct = typeIdSet_subtract (typeIdSet_union (gc.facct, uentry_accessType (e)), - gc.nacct); - } - else - { - gc.acct = gc.facct; - } - - DPRINTF (("Enter function: %s / %s", uentry_unparse (e), - typeIdSet_unparse (gc.acct))); - - gc.showfunction = context_getFlag (FLG_SHOWFUNC); - - gc.globs = uentry_getGlobs (e); - globSet_clear (gc.globs_used); - gc.mods = uentry_getMods (e); - - usymtab_enterFunctionScope (e); - sRef_enterFunctionScope (); -} - -static bool context_checkStrictGlobals (void) -{ - return (context_getFlag (FLG_CHECKSTRICTGLOBALS)); -} - -static bool context_hasGlobs (void) -{ - if (context_inFunctionLike ()) - { - return (uentry_hasGlobs (gc.cont.fcn)); - } - else - { - return (FALSE); - } -} - -static bool context_checkCheckedGlobals (void) -{ - return (context_getFlag (FLG_GLOBALS) - && (context_getFlag (FLG_GLOBUNSPEC) - || context_hasGlobs ())); -} - -static bool context_checkUnknownGlobals (void) -{ - /* should be uentry_hasGlobs ? */ - - return (context_getFlag (FLG_ALLGLOBALS) - && (context_getFlag (FLG_GLOBUNSPEC) - || context_hasGlobs ())); -} - -static bool context_checkUncheckedGlobals (void) -{ - return (FALSE); -} - -bool -context_checkExport (uentry e) -{ - if (!gc.anyExports) return FALSE; - - if (uentry_isFunction (e) - || (uentry_isVariable (e) && ctype_isFunction (uentry_getType (e)))) - { - return context_maybeSet (FLG_EXPORTFCN); - } - else if (uentry_isExpandedMacro (e)) - { - return context_maybeSet (FLG_EXPORTMACRO); - } - else if (uentry_isVariable (e)) - { - return context_maybeSet (FLG_EXPORTVAR); - } - else if (uentry_isEitherConstant (e)) - { - return context_maybeSet (FLG_EXPORTCONST); - } - else if (uentry_isIter (e) || uentry_isEndIter (e)) - { - return context_maybeSet (FLG_EXPORTITER); - } - else if (uentry_isDatatype (e)) - { - return context_maybeSet (FLG_EXPORTTYPE); - } - else - { - BADEXIT; - } -} - -bool -context_checkGlobUse (uentry glob) -{ - - if (uentry_isCheckedStrict (glob)) - { - return context_checkStrictGlobals (); - } - else if (uentry_isChecked (glob)) - { - return context_checkCheckedGlobals (); - } - else if (uentry_isCheckedUnknown (glob) || uentry_isCheckMod (glob)) - { - return context_checkUnknownGlobals (); - } - else - { - llassert (uentry_isUnchecked (glob)); - - return context_checkUncheckedGlobals (); - } -} - -bool -context_checkAliasGlob (uentry glob) -{ - if (uentry_isCheckedStrict (glob)) - { - return gc.flags[FLG_CHECKSTRICTGLOBALIAS]; - } - else if (uentry_isChecked (glob)) - { - return gc.flags[FLG_CHECKEDGLOBALIAS]; - } - else if (uentry_isCheckMod (glob)) - { - return gc.flags[FLG_CHECKMODGLOBALIAS]; - } - else - { - llassert (uentry_isUnchecked (glob) || uentry_isCheckedUnknown (glob)); - - return gc.flags[FLG_UNCHECKEDGLOBALIAS]; - } -} - -bool context_checkInternalUse (void) -{ - if (context_hasGlobs ()) - { - return (gc.flags[FLG_INTERNALGLOBS]); - } - else - { - return (gc.flags[FLG_INTERNALGLOBSNOGLOBS]); - } -} - -bool -context_checkGlobMod (sRef el) -{ - uentry ue = sRef_getUentry (el); - - /* no: llassert (sRef_isGlobal (el)); also check local statics */ - - if (uentry_isCheckedModify (ue) - || (!uentry_isUnchecked (ue) && (gc.flags[FLG_ALLGLOBALS]))) - { - if (context_hasMods ()) - { - return (gc.flags[FLG_MODGLOBS]); - } - else - { - if (uentry_isCheckedStrict (ue)) - { - return (gc.flags[FLG_MODGLOBSUNSPEC]); - } - else - { - return (gc.flags[FLG_MODSTRICTGLOBSUNSPEC]); - } - } - } - else - { - if (context_hasMods ()) - { - return (gc.flags[FLG_MODGLOBSUNCHECKED]); - } - else - { - return FALSE; - } - } -} - -void -context_usedGlobal (sRef el) -{ - if (!globSet_member (gc.globs_used, el)) - { - /* - ** The first time a global is used in a function, we need - ** to clear the derived sRefs, since they were set for the - ** previous function. - */ - - sRef_clearDerived (el); - gc.globs_used = globSet_insert (gc.globs_used, el); - } -} - -/*@observer@*/ sRefSet -context_modList (void) -{ - return gc.mods; -} - -bool -context_globAccess (sRef s) -{ - llassert (sRef_isGlobal (s) || sRef_isKindSpecial (s)); - return (globSet_member (gc.globs, s)); -} - -bool -context_hasAccess (typeId t) -{ - if (context_inFunctionLike ()) - { - return (typeIdSet_member (gc.acct, t)); - } - else - { - return (context_hasFileAccess (t)); - } -} - -bool -context_hasFileAccess (typeId t) -{ - return (typeIdSet_member (gc.facct, t)); -} - -/*@only@*/ cstring -context_unparseAccess (void) -{ - return (message ("%q / %q", typeIdSet_unparse (gc.acct), - typeIdSet_unparse (gc.facct))); -} - -/*@only@*/ cstring -context_unparseClauses (void) -{ - return (clauseStack_unparse (gc.clauses)); -} - -bool -context_couldHaveAccess (typeId t) -{ - if (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN || gc.kind == CX_UNKNOWNMACRO) - { - return (typeIdSet_member (gc.acct, t)); - } - else - { - return (typeIdSet_member (gc.facct, t)); - } -} - -ctype -context_getRetType (void) -{ - ctype f = ctype_undefined; - - if (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN) - { - f = uentry_getType (gc.cont.fcn); - } - else if (gc.kind == CX_UNKNOWNMACRO) - { - return ctype_unknown; - } - else - { - llcontbuglit ("context_getRetType: not in a function context"); - return ctype_unknown; - } - - if (!ctype_isFunction (f)) - { - if (ctype_isKnown (f)) - { - llbuglit ("context_getRetType: not a function"); - } - - return ctype_unknown; - } - return (ctype_returnValue (f)); -} - -bool -context_hasMods (void) -{ - if (context_inFunctionLike ()) - { - return (uentry_hasMods (gc.cont.fcn)); - } - else - { - return FALSE; - } -} - -void -context_exitAllClauses (void) -{ - - while (!clauseStack_isEmpty (gc.clauses)) - { - clause el = clauseStack_top (gc.clauses); - - gc.inclause = el; - - if (clause_isNone (el)) - { - usymtab_quietExitScope (g_currentloc); - clauseStack_pop (gc.clauses); - } - else - { - context_exitClausePlain (); - } - } - - clauseStack_clear (gc.clauses); - - - gc.inclause = NOCLAUSE; -} - -static -void context_exitClauseSimp (void) -{ - - context_setJustPopped (); - clauseStack_pop (gc.clauses); - gc.inclause = topClause (gc.clauses); -} - -static -void context_exitCaseClause (void) -{ - context_setJustPopped (); - usymtab_popCaseBranch (); - clauseStack_pop (gc.clauses); - gc.inclause = topClause (gc.clauses); -} - -static -void context_exitClauseAux (exprNode pred, exprNode tbranch) -{ - context_setJustPopped (); - usymtab_popTrueBranch (pred, tbranch, gc.inclause); - clauseStack_pop (gc.clauses); - gc.inclause = topClause (gc.clauses); -} - -void context_exitTrueClause (exprNode pred, exprNode tbranch) -{ - if (gc.inclause != TRUECLAUSE) - { - llparseerror (cstring_makeLiteral - ("Likely parse error. Conditional clauses are inconsistent.")); - return; - } - - - context_setJustPopped (); - - usymtab_popTrueBranch (pred, tbranch, TRUECLAUSE); - clauseStack_pop (gc.clauses); - gc.inclause = topClause (gc.clauses); - - } - -void context_exitIterClause (exprNode body) -{ - llassert (gc.inclause == ITERCLAUSE); - - context_setJustPopped (); - - if (context_getFlag (FLG_LOOPEXEC)) - { - usymtab_popTrueExecBranch (exprNode_undefined, body, ITERCLAUSE); - } - else - { - usymtab_popTrueBranch (exprNode_undefined, body, ITERCLAUSE); - } - - clauseStack_pop (gc.clauses); - gc.inclause = topClause (gc.clauses); -} - -static void context_popCase (void) { - /* - ** If we are exiting an outer clause, sometimes still in a switch case. - ** - ** e.g.: - ** - ** switch(a) - ** { - ** case 1: - ** while (c>3) - ** { - ** case 3: ++c; - ** } - ** } - */ - - DPRINTF (("Popping case clause: %s", - clauseStack_unparse (gc.clauses))); - - if (gc.inclause == CASECLAUSE) { - context_exitCaseClause (); - } -} - -void context_exitWhileClause (exprNode pred, exprNode body) -{ - guardSet invGuards = guardSet_invert (exprNode_getGuards (pred)); - - context_popCase (); - - if (gc.inclause != WHILECLAUSE) { - DPRINTF (("Clause: %s / %s", clause_unparse (gc.inclause), - clauseStack_unparse (gc.clauses))); - } - - llassert (gc.inclause == WHILECLAUSE); - - context_setJustPopped (); - - - /* - ** predicate must be false after while loop (unless there are breaks) - */ - - if (context_getFlag (FLG_LOOPEXEC)) - { - usymtab_popTrueExecBranch (pred, body, WHILECLAUSE); - } - else - { - usymtab_popTrueBranch (pred, body, WHILECLAUSE); - } - - - usymtab_addGuards (invGuards); - guardSet_free (invGuards); - - clauseStack_pop (gc.clauses); - gc.inclause = topClause (gc.clauses); -} - -void context_exitDoWhileClause (exprNode pred) -{ - guardSet invGuards = guardSet_invert (exprNode_getGuards (pred)); - - if (gc.inclause == CASECLAUSE) { - /* handle Duff's device */ - clauseStack_pop (gc.clauses); - gc.inclause = topClause (gc.clauses); - } - - llassert (gc.inclause == DOWHILECLAUSE); - - context_setJustPopped (); - - - usymtab_addGuards (invGuards); - guardSet_free (invGuards); - - clauseStack_pop (gc.clauses); - gc.inclause = topClause (gc.clauses); -} - -void context_exitForClause (exprNode forPred, exprNode body) -{ - guardSet invGuards = guardSet_invert (exprNode_getForGuards (forPred)); - - llassert (gc.inclause == FORCLAUSE); - context_setJustPopped (); - - /* - ** predicate must be false after while loop (unless there are breaks) - */ - - if (context_getFlag (FLG_LOOPEXEC)) - { - usymtab_popTrueExecBranch (forPred, body, FORCLAUSE); - } - else - { - usymtab_popTrueBranch (forPred, body, FORCLAUSE); - } - - usymtab_addGuards (invGuards); - guardSet_free (invGuards); - clauseStack_pop (gc.clauses); - gc.inclause = topClause (gc.clauses); -} - -static void context_exitClausePlain (void) -{ - llassert (gc.inclause != NOCLAUSE); - - if (gc.inclause == FALSECLAUSE) - { - context_exitClause (exprNode_undefined, exprNode_undefined, exprNode_undefined); - } - else - { - context_exitClauseAux (exprNode_undefined, exprNode_undefined); - } - -} - -void context_exitClause (exprNode pred, exprNode tbranch, exprNode fbranch) -{ - - context_setJustPopped (); - - if (gc.inclause == FALSECLAUSE) - { - usymtab_popBranches (pred, tbranch, fbranch, FALSE, FALSECLAUSE); - - llassert (clauseStack_top (gc.clauses) == FALSECLAUSE); - - clauseStack_pop (gc.clauses); - gc.inclause = topClause (gc.clauses); - } - else - { - context_exitTrueClause (pred, tbranch); - } -} - -void -context_returnFunction (void) -{ - usymtab_checkFinalScope (TRUE); -} - -void -context_exitFunction (void) -{ - if (!context_inFunction () && !context_inMacroConstant () - && !context_inMacroUnknown () - && !context_inIterDef () && !context_inIterEnd ()) - { - /* - ** not a bug because of parse errors - */ - } - else - { - if (context_inMacro () && usymtab_inFunctionScope ()) - { - usymtab_exitScope (exprNode_undefined); - } - - if (uentry_hasGlobs (gc.cont.fcn)) - { - exprChecks_checkUsedGlobs (gc.globs, gc.globs_used); - } - - - if (uentry_hasMods (gc.cont.fcn)) - { - if (context_getFlag (FLG_MUSTMOD)) - { - exprNode_checkAllMods (gc.mods, gc.cont.fcn); - } - } - - /* - ** clear file static modifies - */ - - /* do this first to get unused error messages */ - - usymtab_exitScope (exprNode_undefined); - sRef_exitFunctionScope (); - - gc.showfunction = FALSE; - gc.kind = CX_GLOBAL; - gc.cont.glob = TRUE; - gc.acct = gc.facct; - gc.globs = globSet_new (); - globSet_clear (gc.globs_used); - gc.mods = sRefSet_new (); - } - - llassert (clauseStack_isEmpty (gc.clauses)); - llassert (gc.inclause == NOCLAUSE); -} - -void -context_quietExitFunction (void) -{ - while (gc.kind == CX_INNER) - { - context_exitInnerPlain (); - } - - if (!context_inFunction () && !context_inMacroConstant () && !context_inMacroUnknown () - && !context_inIterDef () && !context_inIterEnd ()) - { - } - else - { - usymtab_quietExitScope (g_currentloc); - - gc.showfunction = FALSE; - gc.kind = CX_GLOBAL; - gc.cont.glob = TRUE; - gc.acct = gc.facct; - gc.globs = globSet_new (); - globSet_clear (gc.globs_used); - gc.mods = sRefSet_new (); - - sRef_exitFunctionScope (); - } -} - -/*@observer@*/ uentryList -context_getParams (void) -{ - if (context_inFunctionLike ()) - { - return (uentry_getParams (gc.cont.fcn)); - } - else - { - llcontbug (message ("context_getParams: not in function: %q", context_unparse ())); - return uentryList_undefined; - } -} - -/*@observer@*/ globSet -context_getUsedGlobs (void) -{ - llassert (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN - || gc.kind == CX_UNKNOWNMACRO || gc.kind == CX_ITERDEF); - - return (gc.globs_used); -} - -cstring -context_moduleName () -{ - return (fileloc_getBase (g_currentloc)); -} - -/*@observer@*/ globSet -context_getGlobs (void) -{ - llassert (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN - || gc.kind == CX_UNKNOWNMACRO || gc.kind == CX_ITERDEF); - - return (gc.globs); -} - -void -context_addBoolAccess (void) -{ - cstring bname = context_getString (FLG_BOOLTYPE); - typeIdSet boolt = typeIdSet_single (usymtab_getTypeId (bname)); - - addModuleAccess (cstring_copy (bname), boolt); - - /* for sys/types (perhaps, this is bogus!) */ - addModuleAccess (cstring_makeLiteral ("types"), boolt); -} - -# if 0 -bool -context_canAccessBool (void) -{ - return TRUE; -} -# endif - -/* - static typeId boolType = typeId_invalid; - - if (typeId_isInvalid (boolType)) - { - boolType = usymtab_getTypeId (context_getBoolName ()); - } - - if (typeId_isInvalid (boolType)) { - return FALSE; - } else { - return (typeIdSet_member (gc.acct, boolType)); - } -} -*/ - -/* evs 2000-07-25: old version - replaced */ - -ctype -context_boolImplementationType () { - /* For now, this is bogus! */ - return ctype_int; -} - -bool -context_canAccessBool (void) -{ - static typeId boolType = typeId_invalid; - - if (typeId_isInvalid (boolType)) - { - boolType = usymtab_getTypeId (context_getBoolName ()); - } - - if (!typeId_isInvalid (boolType)) - { - return context_hasAccess (boolType); - } - else - { - ; - } - - return FALSE; -} - -void -context_setMessageAnnote (/*@only@*/ cstring s) -{ - llassert (cstring_isUndefined (gc.msgAnnote)); - gc.msgAnnote = s; -} - -bool -context_hasMessageAnnote (void) -{ - return (cstring_isDefined (gc.msgAnnote)); -} - -void -context_clearMessageAnnote (void) -{ - if (cstring_isDefined (gc.msgAnnote)) - { - cstring_free (gc.msgAnnote); - gc.msgAnnote = cstring_undefined; - } -} - -/*@only@*/ cstring -context_getMessageAnnote (void) -{ - cstring st = gc.msgAnnote; - - gc.msgAnnote = cstring_undefined; - return st; -} - -void -context_setAliasAnnote (/*@observer@*/ sRef s, /*@observer@*/ sRef t) -{ - llassert (sRef_isInvalid (gc.aliasAnnote)); - llassert (!sRef_sameName (s, t)); - gc.aliasAnnote = s; - gc.aliasAnnoteAls = t; -} - -bool -context_hasAliasAnnote (void) -{ - return (sRef_isValid (gc.aliasAnnote)); -} - -void -context_clearAliasAnnote (void) -{ - gc.aliasAnnote = sRef_undefined; -} - -cstring -context_getAliasAnnote (void) -{ - sRef ret = gc.aliasAnnote; - sRef als = gc.aliasAnnoteAls; - - llassert (sRef_isValid (ret) && sRef_isValid (als)); - - gc.aliasAnnote = sRef_undefined; - return (message ("%q aliases %q", sRef_unparse (als), sRef_unparse (ret))); -} - -void -context_recordFileModifies (sRefSet mods) -{ - gc.modrecs = sRefSetList_add (gc.modrecs, mods); -} - -void -context_recordFileGlobals (globSet mods) -{ - /*@access globSet@*/ context_recordFileModifies (mods); /*@noaccess globSet@*/ -} - -void -context_setCommentMarkerChar (char c) -{ - llassert (c != '\0'); - - context_setValue (FLG_COMMENTCHAR, (int) c); -} - -char -context_getCommentMarkerChar (void) -{ - return ((char) context_getValue (FLG_COMMENTCHAR)); -} - -static void -context_setValue (flagcode flag, int val) -{ - int index = flagcode_valueIndex (flag); - - llassert (index >= 0 && index <= NUMVALUEFLAGS); - - if (val <= 0) - { - switch (flag) - { - case FLG_INCLUDENEST: - case FLG_CONTROLNESTDEPTH: - case FLG_STRINGLITERALLEN: - case FLG_NUMSTRUCTFIELDS: - case FLG_NUMENUMMEMBERS: - case FLG_LINELEN: - { - cstring warn = message ("Value for %s must be a positive " - "number (given %d)", - flagcode_unparse (flag), val); - - flagWarning (warn); - cstring_free (warn); - val = MINLINELEN; - } - return; - default: - break; - } - } - - if (flag == FLG_LINELEN && val < MINLINELEN) - { - cstring warn = message ("Value for %s must be at least %d (given %d)", - flagcode_unparse (flag), - MINLINELEN, val); - flagWarning (warn); - cstring_free (warn); - val = MINLINELEN; - } - - gc.values[index] = val; -} - -void -context_setValueAndFlag (flagcode flag, int val) -{ - gc.flags[flag] = TRUE; - context_setValue (flag, val); -} - -int -context_getValue (flagcode flag) -{ - int index = flagcode_valueIndex (flag); - - llassert (index >= 0 && index <= NUMVALUEFLAGS); - return (gc.values[index]); -} - -int -context_getCounter (flagcode flag) -{ - int index = flagcode_valueIndex (flag); - - llassert (index >= 0 && index <= NUMVALUEFLAGS); - return (gc.counters[index]); -} - -void -context_incCounter (flagcode flag) -{ - int index = flagcode_valueIndex (flag); - - llassert (index >= 0 && index <= NUMVALUEFLAGS); - /* check limit */ - gc.counters[index]++; -} - -void -context_decCounter (flagcode flag) -{ - int index = flagcode_valueIndex (flag); - - llassert (index >= 0 && index <= NUMVALUEFLAGS); - gc.counters[index]--; -} - -bool context_showFunction (void) -{ - return (gc.showfunction); -} - -void -context_setString (flagcode flag, cstring val) -{ - int index = flagcode_stringIndex (flag); - - llassert (index >= 0 && index <= NUMSTRINGFLAGS); - - if (flag == FLG_SYSTEMDIRS) - { - llassert (cstring_isDefined (val)); - - if (cstring_firstChar (val) == '\"') - { - cstring oval = val; - cstring tval = cstring_copy (cstring_suffix (val, 1)); - - if (cstring_lastChar (tval) != '\"') - { - int n = cstring_length (tval) - 1; - - while (isspace ((int) cstring_getChar (tval, n))) - { - n--; - } - - if (cstring_getChar (tval, n) != '\"') - { - cstring msg = message ("Setting -systemdirs to string with unmatching quotes: %s", val); - flagWarning (msg); - cstring_free (msg); - } - else - { - cstring otval = tval; - tval = cstring_prefix (tval, n); - cstring_free (otval); - } - } - - val = cstring_copy (cstring_clip (tval, cstring_length (tval) - 1)); - DPRINTF (("val = %s", val)); - cstring_free (tval); - cstring_free (oval); - } - } - - if (flag == FLG_TMPDIR) - { - llassert (cstring_isDefined (val)); - - if (cstring_length (val) == 0) - { - cstring_free (val); - val = message (".%s", cstring_makeLiteralTemp (CONNECTSTR)); - } - else if (cstring_lastChar (val) != CONNECTCHAR) - { - val = cstring_appendChar (val, CONNECTCHAR); - } - else - { - ; - } - } - - if (cstring_length (val) >= 1 - && cstring_firstChar (val) == '"') - { - cstring s = message - ("setting %s to string beginning with \". You probably " - "don't meant to have the \"'s.", - flagcode_unparse (flag)); - - flagWarning (s); - cstring_free (s); - } - - if (flag == FLG_BOOLTYPE) - { - - } - - gc.strings[index] = val; -} - -static /*@exposed@*/ cstring -context_exposeString (flagcode flag) -{ - int index = flagcode_stringIndex (flag); - - llassert (index >= 0 && index <= NUMSTRINGFLAGS); - return (gc.strings[index]); -} - -cstring -context_getString (flagcode flag) -{ - return (context_exposeString (flag)); -} - -void -context_resetErrors (void) -{ - gc.numerrors = 0; -} - -void context_initMod (void) - /*@globals undef gc; @*/ -{ - gc.kind = CX_GLOBAL; - gc.instandardlib = FALSE; - gc.numerrors = 0; - gc.neednl = FALSE; - gc.linesprocessed = 0; - gc.speclinesprocessed = 0; - gc.insuppressregion = FALSE; - gc.macroMissingParams = FALSE; - gc.preprocessing = FALSE; - gc.incommandline = FALSE; - gc.mc = macrocache_create (); - gc.nmods = 0; - gc.maxmods = DEFAULTMAXMODS; - gc.moduleaccess = (maccesst *) - dmalloc (sizeof (*gc.moduleaccess) * (gc.maxmods)); - - gc.library = FLG_ANSILIB; - - gc.locstack = filelocStack_new (); - gc.modrecs = sRefSetList_undefined; - gc.anyExports = FALSE; - - gc.ftab = fileTable_create (); - gc.msgLog = messageLog_new (); - gc.inimport = FALSE; - gc.inDerivedFile = FALSE; - gc.inheader = FALSE; - gc.markers = flagMarkerList_new (); - gc.cont.glob = TRUE; - gc.showfunction = FALSE; - gc.msgAnnote = cstring_undefined; - gc.aliasAnnote = sRef_undefined; - gc.aliasAnnoteAls = sRef_undefined; - gc.boolType = ctype_bool; - gc.mods = sRefSet_new (); - - gc.saveloc = fileloc_undefined; - - gc.inmacrocache = FALSE; - gc.inclause = NOCLAUSE; - gc.clauses = clauseStack_new (); - gc.globs = globSet_new (); - gc.nacct = typeIdSet_emptySet (); - gc.acct = typeIdSet_emptySet (); - gc.facct = typeIdSet_emptySet (); - gc.savedFlags = FALSE; - gc.pushloc = fileloc_undefined; - gc.protectVars = FALSE; - gc.justpopped = FALSE; - gc.isNullGuarded = NO; - gc.globs_used = globSet_undefined; - - allFlagCodes (code) - { - gc.setGlobally[code] = FALSE; - gc.setLocally[code] = FALSE; - } end_allFlagCodes ; - - usymtab_initMod (); - - context_resetAllFlags (); - conext_resetAllCounters (); - context_setMode (DEFAULT_MODE); -} - -ctype -context_typeofZero (void) -{ - ctype ct = ctype_int; - - if (context_getFlag (FLG_ZEROPTR)) - { - ct = ctype_makeConj (ct, ctype_voidPointer); - } - - if (context_getFlag (FLG_ZEROBOOL)) { - ct = ctype_makeConj (ct, ctype_bool); - } - - return ct; -} - -ctype -context_typeofOne (void) -{ - ctype ct = ctype_int; - - /* 1 is on longer a bool (was before 2.4) - if (!context_getFlag (FLG_ABSTRACTBOOL)) - { - ct = ctype_makeConj (ct, ctype_bool); - } - */ - - return (ct); -} - -/*@only@*/ cstring -context_unparse (void) -{ - cstring s; - - switch (gc.kind) - { - case CX_LCL: - s = message ("LCL File: %q", fileloc_unparse (g_currentloc)); - break; - case CX_LCLLIB: - s = message ("LCL Lib File: %q", fileloc_unparse (g_currentloc)); - break; - case CX_GLOBAL: - s = message ("Global Context:%q", fileloc_unparse (g_currentloc)); - break; - case CX_INNER: - s = message ("Inner Context:%q", fileloc_unparse (g_currentloc)); - break; - case CX_FUNCTION: - s = message ("Function %q :%q \n\taccess %q\n\tmodifies %q", - uentry_unparse (gc.cont.fcn), - fileloc_unparse (g_currentloc), - typeIdSet_unparse (gc.acct), - sRefSet_unparse (gc.mods)); - break; - case CX_MACROFCN: - s = message ("Function Macro %q", uentry_unparse (gc.cont.fcn)); - break; - case CX_UNKNOWNMACRO: - s = message ("Forward Specified Macro %q", uentry_unparse (gc.cont.fcn)); - break; - case CX_MACROCONST: - s = message ("Constant Macro %q", uentry_unparse (gc.cont.fcn)); - break; - case CX_ITERDEF: - s = message ("Iter definition %q", uentry_unparse (gc.cont.fcn)); - break; - case CX_ITEREND: - s = message ("Iter end %q", uentry_unparse (gc.cont.fcn)); - break; - default: - s = message ("Un-unparseable context: %d", (int) gc.kind); - break; - } - - s = message ("%q\naccess: %q", s, context_unparseAccess ()); - return (s); -} - -extern ctype -context_currentFunctionType (void) -{ - if (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN) - { - return (uentry_getType (gc.cont.fcn)); - } - else if (gc.kind == CX_INNER) - { - llcontbuglit ("context_currentFunctionType: inner context"); - do { context_exitInnerPlain (); } while (gc.kind == CX_INNER); - return (context_currentFunctionType ()); - } - else - { - llcontbuglit ("context_currentFunctionType: not in function"); - return (ctype_undefined); - } -} - -void -context_enterInnerContext (void) -{ - if (gc.kind == CX_GLOBAL) - { - gc.kind = CX_INNER; - gc.cont.cdepth = 1; - } - else if (gc.kind == CX_INNER) - { - gc.cont.cdepth++; - } - else - { - ; - } - - - usymtab_enterScope (); - pushClause (NOCLAUSE); -} - -void -context_exitInnerPlain (void) /*@modifies gc;@*/ -{ - context_exitInner (exprNode_undefined); -} - -void -context_exitInner (exprNode exp) -{ - - llassertprint (gc.inclause == NOCLAUSE || gc.inclause == CASECLAUSE, - ("inclause = %s", clause_nameTaken (gc.inclause))); - - clauseStack_removeFirst (gc.clauses, NOCLAUSE); - gc.inclause = topClause (gc.clauses); - - if (gc.kind == CX_INNER) - { - if (--gc.cont.cdepth == 0) - { - gc.kind = CX_GLOBAL; - gc.cont.glob = TRUE; - } - } - else - { - if (gc.kind == CX_GLOBAL) - { - llcontbuglit ("Attempt to exit global context"); - return; - } - } - - usymtab_exitScope (exp); -} - - -void -context_enterStructInnerContext (void) -{ - if (gc.kind == CX_GLOBAL) - { - gc.kind = CX_INNER; - gc.cont.cdepth = 1; - } - else if (gc.kind == CX_INNER) - { - gc.cont.cdepth++; - } - else - { - ; - } - - usymtab_enterScope (); -} - -void -context_exitStructInnerContext (void) -{ - if (gc.kind == CX_INNER) - { - if (--gc.cont.cdepth == 0) - { - gc.kind = CX_GLOBAL; - gc.cont.glob = TRUE; - } - } - else - { - if (gc.kind == CX_GLOBAL) - { - llcontbuglit ("Attempt to exit global context"); - return; - } - } - - usymtab_exitScope (exprNode_undefined); -} - -void -context_exitInnerSafe (void) -{ - - if (gc.kind == CX_INNER) - { - if (--gc.cont.cdepth == 0) - { - gc.cont.cdepth++; - } - } - else if (gc.kind == CX_GLOBAL) - { - llcontbuglit ("Attempt to exit global context"); - return; - } - else - { - if (usymtab_inDeepScope ()) - { - usymtab_exitScope (exprNode_undefined); - } - } -} - -static -void setModuleAccess (void) -{ - gc.facct = typeIdSet_emptySet (); - - if (fileId_isValid (currentFile ())) - { - cstring baseName = fileloc_getBase (g_currentloc); - - if (context_getFlag (FLG_ACCESSFILE)) - { - if (usymtab_existsType (baseName)) - { - gc.facct = typeIdSet_insert (gc.facct, - usymtab_getTypeId (baseName)); - } - else - { - ; - } - } - - if (context_getFlag (FLG_ACCESSMODULE)) - { - int i; - bool hasaccess = FALSE; - - for (i = 0; i < gc.nmods; i++) - { - if (cstring_equal (baseName, gc.moduleaccess[i].file)) - { - gc.facct = typeIdSet_union (gc.facct, gc.moduleaccess[i].daccess); - - hasaccess = TRUE; - break; - } - } - } - - gc.acct = gc.facct; - gc.inheader = fileId_isHeader (currentFile ()); - } - else - { - llcontbuglit ("Current file not defined\n"); - gc.facct = typeIdSet_emptySet (); - gc.acct = gc.facct; - gc.inheader = FALSE; - } - - /* 17 Jan 1995: forgot to clear nacct */ - - gc.nacct = typeIdSet_emptySet (); -} - -static void -context_enterFileAux (void) -{ - setModuleAccess (); -} - -void -context_enterFile (void) -{ - context_enterFileAux (); - usymtab_enterFile (); -} - -void -context_enterMacroFile (void) -{ - context_enterFileAux (); -} - -bool -context_inFunction (void) -{ - kcontext ck = gc.kind; - - return ((ck == CX_FUNCTION) || (ck == CX_MACROFCN) || (ck == CX_INNER)); -} - -bool -context_inFunctionLike (void) -{ - return (gc.kind == CX_FUNCTION || gc.kind == CX_MACROFCN - || gc.kind == CX_UNKNOWNMACRO || gc.kind == CX_ITERDEF); -} - -bool -context_inRealFunction (void) -{ - kcontext ck = gc.kind; - - return ((ck == CX_FUNCTION) || (ck == CX_MACROFCN)); -} - -void -context_processAllMacros (void) -{ - usymtab_enterFile (); - - gc.inmacrocache = TRUE; - macrocache_processUndefinedElements (gc.mc); - cleanupMessages (); - usymtab_exitFile (); - - gc.inmacrocache = FALSE; - macrocache_finalize (); -} - -/* -** this happens once at the end of each C file -** -** check each Macro that was defined in current file.c or current file.h -** -*/ - -static void -context_processMacros (void) -{ - if (fileId_isValid (currentFile ())) - { - fileloc lastfl; - cstring cbase = cstring_fromChars - (removePathFree - (removeAnyExtension - (cstring_toCharsSafe (fileName (currentFile ()))))); - - gc.inmacrocache = TRUE; - - DPRINTF (("Processing macros: %s", cbase)); - lastfl = macrocache_processFileElements (gc.mc, cbase); - DPRINTF (("Processing macros: %s", fileloc_unparse (lastfl))); - - cstring_free (cbase); - - if (fileloc_isDefined (lastfl)) - { - g_currentloc = fileloc_update (g_currentloc, lastfl); - cleanupMessages (); - } - - gc.inmacrocache = FALSE; - } -} - -bool -context_processingMacros (void) -{ - return (gc.inmacrocache); -} - -void -context_exitFile (void) -{ - if (gc.kind != CX_GLOBAL) - { - llfatalerrorLoc - (cstring_makeLiteral ("File ended outside global scope")); - } - - if (gc.insuppressregion) - { - /* gack...don't reverse the order of these lines! ;-> */ - gc.insuppressregion = FALSE; - llerrorlit (FLG_SYNTAX, - "File ended in ignore errors region, " - "possible missing /*@end*/"); - } - - /* fix up parse errors */ - - while (!usymtab_inFileScope ()) - { - usymtab_quietExitScope (g_currentloc); - } - - /* - ** Clear the file-specific modifies information. - */ - - sRefSetList_elements (gc.modrecs, mods) - { - sRefSet_clearStatics (mods); - } end_sRefSetList_elements ; - - sRefSetList_clear (gc.modrecs); - - context_processMacros (); - cleanupMessages (); - - usymtab_exitFile (); - - gc.inDerivedFile = FALSE; - filelocStack_clear (gc.locstack); - - gc.nacct = typeIdSet_emptySet (); /* empty noaccess */ - - gc.cont.glob = TRUE; - - if (gc.savedFlags) - { - context_restoreFlagSettings (); - gc.savedFlags = FALSE; - } -} - -void -context_exitMacroCache (void) -{ - if (gc.kind != CX_GLOBAL) - { - if (context_inMacro ()) /* this is okay, file could end without newline in macro */ - { - context_exitFunction (); - } - else - { - llcontbug (message ("context_exitMacroCache: outside global scope: %q", - context_unparse ())); - gc.kind = CX_GLOBAL; - } - } - - /* - ** no longer valid here - ** if (gc.insuppressregion) - ** { - ** gc.insuppressregion = FALSE; - ** llerror ("File ended in ignore errors region, possible missing @"); - ** } - */ - - gc.cont.glob = TRUE; -} - -void -context_saveLocation (void) -{ - /* was llassert (fileloc_isUndefined (gc.saveloc)) */ - fileloc_free (gc.saveloc); - - - gc.saveloc = fileloc_copy (g_currentloc); - } - -fileloc -context_getSaveLocation (void) -{ - fileloc fl = gc.saveloc; - - gc.saveloc = fileloc_undefined; - return fl; -} - -/*@observer@*/ cstring -context_inFunctionName (void) -{ - if (gc.kind == CX_FUNCTION - || gc.kind == CX_MACROFCN || gc.kind == CX_UNKNOWNMACRO - || gc.kind == CX_MACROCONST - || gc.kind == CX_ITERDEF || gc.kind == CX_ITEREND) - { - return (uentry_rawName (gc.cont.fcn)); - } - else - { - llcontbuglit ("context_inFunctionName: not in function"); - return (cstring_undefined); - } -} - -void -context_userSetFlag (flagcode f, bool b) -{ - DPRINTF (("set flag: %s", flagcode_name (f))); - - if (f == FLG_NEVERINCLUDE && b) - { - if (gc.flags[FLG_EXPORTHEADER]) - { - flagWarning (cstring_makeLiteralTemp - ("setting +neverinclude after +exportheader. " - "Turning off exportheader, since headers are not checked " - "when +neverinclude is used.")); - - gc.flags[FLG_EXPORTHEADER] = FALSE; - } - } - else - { - if (f == FLG_EXPORTHEADER && b) - { - if (gc.flags[FLG_NEVERINCLUDE]) - { - flagWarning (cstring_makeLiteralTemp - ("setting +exportheader after +neverinclude. " - "Not setting exportheader, since headers are not checked " - "when +neverinclude is used.")); - gc.flags[FLG_EXPORTHEADER] = FALSE; - return; - } - } - } - - if (context_getFlag (FLG_WARNFLAGS) && f != FLG_NOF && f != FLG_OPTF) - { - bool lastsetting = context_getFlag (f); - - if (bool_equal (lastsetting, b) - && !flagcode_isSpecialFlag (f) - && !flagcode_isIdemFlag (f) - && !flagcode_hasArgument (f)) - { - cstring warn = message ("setting %s%s redundant with current value", - cstring_makeLiteralTemp (b ? "+" : "-"), - flagcode_name (f)); - flagWarning (warn); - cstring_free (warn); - } - } - - if (flagcode_isLibraryFlag (f)) - { - if (gc.library != FLG_ANSILIB - && gc.library != f) - { - cstring warn = message ("selecting library %s after library %s was " - "selected (only one library may be used)", - flagcode_name (f), - flagcode_name (gc.library)); - flagWarning (warn); - cstring_free (warn); - } - - if (f == FLG_UNIXLIB) - { - if (context_getFlag (FLG_WARNUNIXLIB)) - { - flagWarning (cstring_makeLiteralTemp - ("selecting unix library. Unix library is " - "ad hoc addition to POSIX library. Recommend " - "use +posixlib to select POSIX library instead. " - "Use -warnunixlib to suppress this message.")); - } - } - - gc.library = f; - } - - gc.setGlobally[f] = TRUE; - context_setFlag (f, b); -} - -void -context_fileSetFlag (flagcode f, ynm set) -{ - if (!gc.savedFlags) - { - context_saveFlagSettings (); - } - - if (ynm_isOff (set)) - { - context_setFlagAux (f, FALSE, TRUE, FALSE); - } - else if (ynm_isOn (set)) - { - context_setFlagAux (f, TRUE, TRUE, FALSE); - gc.setLocally[f] = TRUE; - } - else - { - context_restoreFlag (f); - } -} - -static void -context_restoreFlag (flagcode f) -{ - - if (!gc.savedFlags) - { - voptgenerror - (FLG_SYNTAX, - message ("Attempt to restore flag %s when no file scope flags " - "have been set.", - flagcode_unparse (f)), - g_currentloc); - } - else - { - context_addFlagMarker (f, MAYBE); - context_setFlagAux (f, gc.saveflags[f], FALSE, TRUE); - } - - } - -static void -context_setFlag (flagcode f, bool b) -{ - context_setFlagAux (f, b, FALSE, FALSE); -} - -void -context_setFlagTemp (flagcode f, bool b) -{ - DPRINTF (("Set flag temp: %s / %s", flagcode_unparse (f), bool_unparse (b))); - gc.flags[f] = b; -} - -/*@notfunction@*/ -# define DOSET(ff,b) \ - do { if (inFile) { gc.setLocally[ff] = TRUE; \ - context_addFlagMarker (ff, ynm_fromBool (b)); } \ - DPRINTF (("set flag: %s / %s", flagcode_name (ff), bool_unparse (b))); \ - gc.flags[ff] = b; } while (FALSE) - -static void - context_setFlagAux (flagcode f, bool b, bool - inFile, /*@unused@*/ bool isRestore) -{ - DPRINTF (("set flag: %s / %s", flagcode_unparse (f), bool_unparse (b))); - - if (f == FLG_USESTDERR) - { - if (b) { - g_msgstream = stderr; - } else { - g_msgstream = stdout; - } - } - - if (flagcode_isSpecialFlag (f)) - { - gc.flags[f] = b; - - - switch (f) - { - case FLG_ALLEMPTY: - DOSET (FLG_ALLEMPTY, b); - DOSET (FLG_IFEMPTY, b); - DOSET (FLG_WHILEEMPTY, b); - DOSET (FLG_FOREMPTY, b); - break; - case FLG_PREDBOOL: - DOSET (FLG_PREDBOOL, b); - DOSET (FLG_PREDBOOLINT, b); - DOSET (FLG_PREDBOOLPTR, b); - DOSET (FLG_PREDBOOLOTHERS, b); - break; - case FLG_GLOBALIAS: - DOSET (FLG_CHECKSTRICTGLOBALIAS, b); - DOSET (FLG_CHECKEDGLOBALIAS, b); - DOSET (FLG_CHECKMODGLOBALIAS, b); - DOSET (FLG_UNCHECKEDGLOBALIAS, b); - break; - case FLG_ALLBLOCK: - DOSET (FLG_ALLBLOCK, b); - DOSET (FLG_IFBLOCK, b); - DOSET (FLG_WHILEBLOCK, b); - DOSET (FLG_FORBLOCK, b); - break; - case FLG_GRAMMAR: - if (b) - { - yydebug = 1; - } - else - { - yydebug = 0; - } - - DOSET (FLG_GRAMMAR, b); - break; - case FLG_CODEIMPONLY: - DOSET (FLG_CODEIMPONLY, b); - DOSET (FLG_GLOBIMPONLY, b); - DOSET (FLG_RETIMPONLY, b); - DOSET (FLG_STRUCTIMPONLY, b); - break; - case FLG_SPECALLIMPONLY: - DOSET (FLG_SPECALLIMPONLY, b); - DOSET (FLG_SPECGLOBIMPONLY, b); - DOSET (FLG_SPECRETIMPONLY, b); - DOSET (FLG_SPECSTRUCTIMPONLY, b); - break; - case FLG_ALLIMPONLY: - DOSET (FLG_ALLIMPONLY, b); - DOSET (FLG_GLOBIMPONLY, b); - DOSET (FLG_RETIMPONLY, b); - DOSET (FLG_STRUCTIMPONLY, b); - DOSET (FLG_SPECGLOBIMPONLY, b); - DOSET (FLG_SPECRETIMPONLY, b); - DOSET (FLG_SPECSTRUCTIMPONLY, b); - break; - case FLG_ANSILIMITS: - DOSET (FLG_ANSILIMITS, b); - DOSET (FLG_CONTROLNESTDEPTH, b); - DOSET (FLG_STRINGLITERALLEN, b); - DOSET (FLG_INCLUDENEST, b); - DOSET (FLG_NUMSTRUCTFIELDS, b); - DOSET (FLG_NUMENUMMEMBERS, b); - - if (b) - { - context_setValue (FLG_CONTROLNESTDEPTH, DEFAULT_CONTROLNESTDEPTH); - context_setValue (FLG_STRINGLITERALLEN, DEFAULT_STRINGLITERALLEN); - context_setValue (FLG_INCLUDENEST, DEFAULT_INCLUDENEST); - context_setValue (FLG_NUMSTRUCTFIELDS, DEFAULT_NUMSTRUCTFIELDS); - context_setValue (FLG_NUMENUMMEMBERS, DEFAULT_NUMENUMMEMBERS); - } - break; - case FLG_EXTERNALNAMELEN: - DOSET (FLG_DISTINCTEXTERNALNAMES, TRUE); - DOSET (FLG_EXTERNALNAMELEN, TRUE); - break; - case FLG_INTERNALNAMELEN: - DOSET (FLG_DISTINCTINTERNALNAMES, TRUE); - DOSET (FLG_INTERNALNAMELEN, TRUE); - break; - case FLG_EXTERNALNAMECASEINSENSITIVE: - DOSET (FLG_EXTERNALNAMECASEINSENSITIVE, b); - - if (b && !gc.flags[FLG_DISTINCTEXTERNALNAMES]) - { - DOSET (FLG_DISTINCTEXTERNALNAMES, TRUE); - context_setValue (FLG_EXTERNALNAMELEN, 0); - } - break; - case FLG_INTERNALNAMECASEINSENSITIVE: - DOSET (FLG_INTERNALNAMECASEINSENSITIVE, b); - - if (b && !gc.flags[FLG_DISTINCTINTERNALNAMES]) - { - DOSET (FLG_DISTINCTINTERNALNAMES, TRUE); - context_setValue (FLG_INTERNALNAMELEN, 0); - } - break; - case FLG_INTERNALNAMELOOKALIKE: - DOSET (FLG_INTERNALNAMELOOKALIKE, b); - - if (b && !gc.flags[FLG_DISTINCTINTERNALNAMES]) - { - DOSET (FLG_DISTINCTINTERNALNAMES, TRUE); - context_setValue (FLG_INTERNALNAMELEN, 0); - } - break; - case FLG_MODUNSPEC: - DOSET (FLG_MODNOMODS, b); - DOSET (FLG_MODGLOBSUNSPEC, b); - DOSET (FLG_MODSTRICTGLOBSUNSPEC, b); - break; - case FLG_EXPORTANY: - DOSET (FLG_EXPORTVAR, b); - DOSET (FLG_EXPORTFCN, b); - DOSET (FLG_EXPORTTYPE, b); - DOSET (FLG_EXPORTMACRO, b); - DOSET (FLG_EXPORTCONST, b); - gc.anyExports = TRUE; - break; - case FLG_REPEXPOSE: - DOSET (FLG_RETEXPOSE, b); - DOSET (FLG_ASSIGNEXPOSE, b); - DOSET (FLG_CASTEXPOSE, b); - break; - case FLG_RETVAL: - DOSET (FLG_RETVALBOOL, b); - DOSET (FLG_RETVALINT, b); - DOSET (FLG_RETVALOTHER, b); - break; - case FLG_PARTIAL: - if (b) - { - DOSET (FLG_EXPORTLOCAL, FALSE); - DOSET (FLG_DECLUNDEF, FALSE); - DOSET (FLG_SPECUNDEF, FALSE); - DOSET (FLG_TOPUNUSED, FALSE); - } - break; - case FLG_DEEPBREAK: - DOSET (FLG_LOOPLOOPBREAK, b); - DOSET (FLG_LOOPSWITCHBREAK, b); - DOSET (FLG_SWITCHLOOPBREAK, b); - DOSET (FLG_SWITCHSWITCHBREAK, b); - DOSET (FLG_LOOPLOOPCONTINUE, b); - DOSET (FLG_DEEPBREAK, b); - break; - case FLG_ACCESSALL: - DOSET (FLG_ACCESSMODULE, b); - DOSET (FLG_ACCESSFILE, b); - DOSET (FLG_ACCESSCZECH, b); - break; - case FLG_ALLMACROS: - DOSET (FLG_ALLMACROS, b); - DOSET (FLG_FCNMACROS, b); - DOSET (FLG_CONSTMACROS, b); - break; - case FLG_CZECH: - if (b) { DOSET (FLG_ACCESSCZECH, b); } - DOSET (FLG_CZECHFUNCTIONS, b); - DOSET (FLG_CZECHVARS, b); - DOSET (FLG_CZECHCONSTANTS, b); - DOSET (FLG_CZECHTYPES, b); - break; - case FLG_SLOVAK: - if (b) { DOSET (FLG_ACCESSSLOVAK, b); } - DOSET (FLG_SLOVAKFUNCTIONS, b); - DOSET (FLG_SLOVAKVARS, b); - DOSET (FLG_SLOVAKCONSTANTS, b); - DOSET (FLG_SLOVAKTYPES, b); - break; - case FLG_CZECHOSLOVAK: - if (b) { DOSET (FLG_ACCESSCZECHOSLOVAK, b); } - DOSET (FLG_CZECHOSLOVAKFUNCTIONS, b); - DOSET (FLG_CZECHOSLOVAKVARS, b); - DOSET (FLG_CZECHOSLOVAKCONSTANTS, b); - DOSET (FLG_CZECHOSLOVAKTYPES, b); - break; - case FLG_NULL: - DOSET (FLG_NULLSTATE, b); - DOSET (FLG_NULLDEREF, b); - DOSET (FLG_NULLASSIGN, b); - DOSET (FLG_NULLPASS, b); - DOSET (FLG_NULLRET, b); - break; - case FLG_MEMCHECKS: - DOSET (FLG_NULLSTATE, b); - DOSET (FLG_NULLDEREF, b); - DOSET (FLG_NULLASSIGN, b); - DOSET (FLG_NULLPASS, b); - DOSET (FLG_NULLRET, b); - DOSET (FLG_COMPDEF, b); - DOSET (FLG_COMPMEMPASS, b); - DOSET (FLG_UNIONDEF, b); - DOSET (FLG_MEMTRANS, b); - DOSET (FLG_USERELEASED, b); - DOSET (FLG_ALIASUNIQUE, b); - DOSET (FLG_MAYALIASUNIQUE, b); - DOSET (FLG_MUSTFREE, b); - DOSET (FLG_MUSTDEFINE, b); - DOSET (FLG_GLOBSTATE, b); - DOSET (FLG_COMPDESTROY, b); - DOSET (FLG_MUSTNOTALIAS, b); - DOSET (FLG_MEMIMPLICIT, b); - DOSET (FLG_BRANCHSTATE, b); - /*@fallthrough@*/ /* also sets memtrans flags */ - case FLG_MEMTRANS: - DOSET (FLG_MEMTRANS, b); - DOSET (FLG_EXPOSETRANS, b); - DOSET (FLG_OBSERVERTRANS, b); - DOSET (FLG_DEPENDENTTRANS, b); - DOSET (FLG_NEWREFTRANS, b); - DOSET (FLG_ONLYTRANS, b); - DOSET (FLG_OWNEDTRANS, b); - DOSET (FLG_FRESHTRANS, b); - DOSET (FLG_SHAREDTRANS, b); - DOSET (FLG_TEMPTRANS, b); - DOSET (FLG_KEPTTRANS, b); - DOSET (FLG_REFCOUNTTRANS, b); - DOSET (FLG_STATICTRANS, b); - DOSET (FLG_UNKNOWNTRANS, b); - DOSET (FLG_KEEPTRANS, b); - DOSET (FLG_IMMEDIATETRANS, b); - break; - - default: - llcontbug (message ("Unhandled special flag: %s", - flagcode_unparse (f))); - break; - } - } - else - { - if (flagcode_isIdemFlag (f)) - { - DOSET (f, TRUE); - } - else - { - if (b && !gc.anyExports - && (f == FLG_EXPORTVAR || f == FLG_EXPORTFCN - || f == FLG_EXPORTTYPE || f == FLG_EXPORTMACRO - || f == FLG_EXPORTCONST - || f == FLG_EXPORTANY)) - { - gc.anyExports = TRUE; - } - - DOSET (f, b); - } - } -} - -bool -context_maybeSet (flagcode d) -{ - return (gc.flags[d] || gc.setLocally[d]); -} - -bool -context_getFlag (flagcode d) -{ - return (gc.flags[d]); -} - -static void context_saveFlagSettings (void) -{ - gc.savedFlags = TRUE; - llassert (sizeof (gc.saveflags) == sizeof (gc.flags)); - memcpy (gc.saveflags, gc.flags, sizeof (gc.flags)); -} - -static void context_restoreFlagSettings (void) -{ - llassert (sizeof (gc.saveflags) == sizeof (gc.flags)); - memcpy (gc.flags, gc.saveflags, sizeof (gc.flags)); - gc.savedFlags = FALSE; -} - -void context_setFilename (fileId fid, int lineno) - /*@globals fileloc g_currentloc;@*/ - /*@modifies g_currentloc@*/ -{ - if (fileId_baseEqual (currentFile (), fid)) - { - setLine (lineno); - return; - } - else - { - fileloc_setColumn (g_currentloc, 0); - - if (fileloc_isSpecialFile (g_currentloc)) - { - gc.inDerivedFile = TRUE; - } - - if (filelocStack_popPushFile (gc.locstack, g_currentloc)) - { - int maxdepth = context_getValue (FLG_INCLUDENEST); - - if (filelocStack_size (gc.locstack) > maxdepth) - { - int depth = filelocStack_includeDepth (gc.locstack); - - if (depth > maxdepth) - { - if (optgenerror - (FLG_INCLUDENEST, - message ("Maximum include nesting depth " - "(%d, current depth %d) exceeded", - maxdepth, - depth), - filelocStack_nextTop (gc.locstack))) - { - filelocStack_printIncludes (gc.locstack); - } - } - } - } - - g_currentloc = fileloc_create (fid, lineno, 1); - gc.inheader = fileId_isHeader (currentFile ()); - - context_enterFileAux (); - } -} - -void context_enterIterDef (/*@observer@*/ uentry le) -{ - context_enterMacro (le); - gc.acct = typeIdSet_subtract (gc.facct, gc.nacct); - gc.kind = CX_ITERDEF; -} - -void context_enterIterEnd (/*@observer@*/ uentry le) -{ - context_enterMacro (le); - gc.kind = CX_ITEREND; -} - -void -context_destroyMod (void) - /*@globals killed gc@*/ -{ - setCodePoint (); - ctype_destroyMod (); - setCodePoint (); - usymtab_free (); - setCodePoint (); - fileTable_free (gc.ftab); - filelocStack_free (gc.locstack); - setCodePoint (); - gc.ftab = fileTable_undefined; - - macrocache_free (gc.mc); - sfree (gc.moduleaccess); - setCodePoint (); - - fileloc_free (gc.saveloc); gc.saveloc = fileloc_undefined; - fileloc_free (gc.pushloc); gc.pushloc = fileloc_undefined; - - setCodePoint (); - sRefSetList_free (gc.modrecs); - setCodePoint (); - flagMarkerList_free (gc.markers); - setCodePoint (); - messageLog_free (gc.msgLog); - setCodePoint (); - clauseStack_free (gc.clauses); - setCodePoint (); - - cstring_free (gc.msgAnnote); - globSet_free (gc.globs_used); - } - -/* -** Flag shortcuts. -*/ - -bool context_msgBoolInt (void) -{ - return gc.flags [FLG_BOOLINT]; -} - -bool context_msgCharInt (void) -{ - return gc.flags [FLG_CHARINT]; -} - -bool context_msgEnumInt (void) -{ - return gc.flags [FLG_ENUMINT]; -} - -bool context_msgPointerArith (void) -{ - return gc.flags [FLG_POINTERARITH]; -} - -bool context_msgStrictOps (void) -{ - return gc.flags [FLG_STRICTOPS]; -} - -# ifndef NOLCL -bool context_msgLh (void) -{ - return gc.flags [FLG_DOLH]; -} -# endif - -void context_pushLoc (void) -{ - fileloc_free (gc.pushloc); - gc.pushloc = gc.saveloc; - gc.saveloc = fileloc_undefined; -} - -void context_popLoc (void) -{ - gc.saveloc = fileloc_update (gc.saveloc, gc.pushloc); -} - -bool context_inGlobalScope (void) -{ - return (usymtab_inFileScope() || usymtab_inGlobalScope ()); -} - -bool context_inInnerScope (void) -{ - return (gc.kind == CX_INNER); -} - -void context_setProtectVars (void) -{ - gc.protectVars = TRUE; -} - -bool context_anyErrors (void) -{ - return (gc.numerrors > 0); -} - -void context_hasError (void) -{ - gc.numerrors++; -} - -int context_numErrors (void) -{ - return gc.numerrors; -} - -bool context_neednl (void) -{ - return gc.neednl; -} - -void context_setNeednl (void) -{ - gc.neednl = TRUE; -} - -int context_getExpect (void) -{ - return (context_getValue (FLG_EXPECT)); -} - -# ifndef NOLCL -int context_getLCLExpect (void) -{ - return (context_getValue (FLG_LCLEXPECT)); -} -# endif - -int context_getLimit (void) -{ - return (context_getValue (FLG_LIMIT)); -} - -bool context_unlimitedMessages (void) -{ - return (context_getLimit () < 0); -} - -void context_releaseVars (void) -{ - llassert (gc.protectVars); - gc.protectVars = FALSE; -} - -void context_sizeofReleaseVars (void) -{ - /* If there is a nested sizeof, this might not hold: - llassert (gc.protectVars); - */ - - gc.protectVars = FALSE; -} - -bool context_inProtectVars (void) -{ - return (gc.protectVars); -} - -void context_hideShowscan (void) -{ - gc.flags[FLG_SHOWSCAN] = FALSE; -} - -void context_unhideShowscan (void) -{ - gc.flags[FLG_SHOWSCAN] = TRUE; -} - -bool context_inHeader (void) -{ - return (gc.inheader); -} - -fileTable context_fileTable (void) -{ - return gc.ftab; -} - -cstring context_tmpdir (void) -{ - return (context_getString (FLG_TMPDIR)); -} - -messageLog context_messageLog (void) -{ - return gc.msgLog; -} - -bool context_inMacroFunction (void) -{ - return (gc.kind == CX_MACROFCN); -} - -bool context_inMacroConstant (void) -{ - return (gc.kind == CX_MACROCONST); -} - -bool context_inMacroUnknown (void) -{ - return (gc.kind == CX_UNKNOWNMACRO); -} - -void context_setShownFunction (void) -{ - gc.showfunction = FALSE; -} - -bool context_doDump (void) -{ - return cstring_isNonEmpty (context_getString (FLG_DUMP)); -} - -bool context_doMerge (void) -{ - return cstring_isNonEmpty (context_getString (FLG_MERGE)); -} - -cstring context_getDump (void) -{ - return context_getString (FLG_DUMP); -} - -cstring context_getMerge (void) -{ - return context_getString (FLG_MERGE); -} - -# ifndef NOLCL -bool context_inLCLLib (void) -{ - return (gc.kind == CX_LCLLIB); -} - -bool context_inImport (void) -{ - return (gc.inimport); -} - -void context_enterImport (void) -{ - gc.inimport = TRUE; -} - -void context_leaveImport (void) -{ - gc.inimport = FALSE; -} -# endif - -bool context_inMacro (void) -{ - return (gc.kind == CX_MACROFCN || gc.kind == CX_MACROCONST - || gc.kind == CX_UNKNOWNMACRO - || gc.kind == CX_ITERDEF || gc.kind == CX_ITEREND); -} - -bool context_inIterDef (void) -{ - return (gc.kind == CX_ITERDEF); -} - -bool context_inIterEnd (void) -{ - return (gc.kind == CX_ITEREND); -} - -int context_getLinesProcessed (void) -{ - return (gc.linesprocessed); -} - -int context_getSpecLinesProcessed (void) -{ - return (gc.speclinesprocessed); -} - -# ifndef NOLCL -void context_processedSpecLine (void) -{ - gc.speclinesprocessed++; -} - -void context_resetSpecLines (void) -{ - gc.speclinesprocessed = 0; -} -# endif - -bool context_inGlobalContext (void) -{ - return (gc.kind == CX_GLOBAL); -} - -void context_setFileId (fileId s) -{ - g_currentloc = fileloc_updateFileId (g_currentloc, s); -} - -bool context_setBoolName (void) -{ - return (!cstring_equalLit (context_getString (FLG_BOOLTYPE), - DEFAULT_BOOLTYPE)); -} - -cstring context_printBoolName (void) -{ - if (context_setBoolName ()) - { - return context_getBoolName (); - } - else - { - return cstring_makeLiteralTemp ("boolean"); - } -} - -cstring context_getBoolName (void) -{ - return (context_getString (FLG_BOOLTYPE)); -} - -cstring context_getFalseName (void) -{ - return (context_getString (FLG_BOOLFALSE)); -} - -cstring context_getTrueName (void) -{ - return (context_getString (FLG_BOOLTRUE)); -} - -cstring context_getLarchPath (void) -{ - return (context_getString (FLG_LARCHPATH)); -} - -cstring context_getLCLImportDir (void) -{ - return (context_getString (FLG_LCLIMPORTDIR)); -} - -static void context_setJustPopped (void) -{ - gc.justpopped = TRUE; -} - -void context_clearJustPopped (void) -{ - gc.justpopped = FALSE; -} - -bool context_justPopped (void) -{ - return (gc.justpopped); -} - -void context_setMacroMissingParams (void) -{ - gc.macroMissingParams = TRUE; -} - -void context_resetMacroMissingParams (void) -{ - gc.macroMissingParams = FALSE; -} - -bool context_isMacroMissingParams (void) -{ - return (gc.macroMissingParams); -} - -void context_showFilelocStack (void) -{ - filelocStack_printIncludes (gc.locstack); -} - - - - - - - diff --git a/src/cpperror.c b/src/cpperror.c deleted file mode 100644 index 1fd7027..0000000 --- a/src/cpperror.c +++ /dev/null @@ -1,399 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** cpperror.c -*/ -/* Default error handlers for CPP Library. - Copyright (C) 1986, 87, 89, 92, 93, 94, 1995 Free Software Foundation, Inc. - Written by Per Bothner, 1994. - Based on CCCP program by by Paul Rubin, June 1986 - Adapted to ANSI C, Richard Stallman, Jan 1987 - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! */ - -/*@-macroconstdecl@*/ -/*@-macrofcndecl@*/ -/*@-evalorderuncon@*/ -/*@+ptrnegate@*/ -/*@-memchecks@*/ -/*@+charintliteral@*/ -/*@-infloopsuncon@*/ -/*@-loopswitchbreak@*/ -/*@-switchloopbreak@*/ -/*@-whileblock@*/ -/*@-forblock@*/ -/*@-elseifcomplete@*/ -/*@-abstract@*/ -/*@-usedef@*/ -/*@-retvalint@*/ -/*@-macroparams@*/ -/*@-readonlytrans@*/ -/*@-boolops@*/ -/*@-sizeoftype@*/ -/*@-predboolint@*/ -/*@-predboolptr@*/ -/*@+boolint@*/ -/*@+charint@*/ -/*@+ignorequals@*/ -/*@+ignoresigns@*/ -/*@+matchanyintegral@*/ -/*@-shiftsigned@*/ -/*@-onlyunqglobaltrans@*/ -/*@-macroconstdecl@*/ - -# include -# include -# include - -# define FATAL_EXIT_CODE EXIT_FAILURE - -# include "lclintMacros.nf" -# include "llbasic.h" -# include "cpp.h" -# include "cpplib.h" -# include "cpperror.h" - -static void cppReader_printFileAndLine (cppReader *p_pfile); -static void cppReader_warningWithLine (cppReader *p_pfile, - int p_line, int p_column, - /*@only@*/ cstring p_msg); - -/* Print the file names and line numbers of the #include - commands which led to the current file. */ - -static void cppReader_printContainingFiles (cppReader *pfile) -{ - cppBuffer *ip; - int first = 1; - - if (pfile == NULL) { - /* Error processing command line. */ - return; - } - - /* If stack of files hasn't changed since we last printed - this info, don't repeat it. */ - if (pfile->input_stack_listing_current) - { - return; - } - - ip = cppReader_fileBuffer (pfile); - - /* Give up if we don't find a source file. */ - if (ip == NULL) - { - return; - } - - /* Find the other, outer source files. */ - while ((ip = cppBuffer_prevBuffer (ip)), - ip != cppReader_nullBuffer (pfile)) - { - int line, col; - cstring temps; - - cppBuffer_lineAndColumn (ip, &line, &col); - if (ip->fname != NULL) - { - if (first) - { - first = 0; - fprintf (stderr, "In file included"); - } - else - fprintf (stderr, ",\n "); - } - - fprintf (stderr, " from %s", - cstring_toCharsSafe (temps = fileloc_unparseRaw (ip->nominal_fname, line))); - - cstring_free (temps); - } - - if (!first) - { - fprintf (stderr, ":\n"); - } - - /* Record we have printed the status as of this time. */ - pfile->input_stack_listing_current = 1; -} - -static void -cppReader_fileLineForMessage (cstring filename, long line, long column) -{ - if (column > 0) - { - cstring temps; - - if (filename != NULL) - { - fprintf (stderr, "%s: ", - cstring_toCharsSafe (temps = fileloc_unparseRawCol (filename, (int) line, (int) column))); - } - else - { - fprintf (stderr, "%s: ", - cstring_toCharsSafe (temps = fileloc_unparseRawCol (cstring_makeLiteralTemp (""), - (int) line, (int) column))); - } - - cstring_free (temps); - } - else - { - cstring temps; - - if (filename != NULL) - { - fprintf (stderr, "%s: ", - cstring_toCharsSafe (temps = fileloc_unparseRaw (filename, (int) line))); - - } - else - { - fprintf (stderr, "%s: ", - cstring_toCharsSafe (temps = fileloc_unparseRaw (cstring_makeLiteralTemp (""), - (int) line))); - } - - cstring_free (temps); - } -} - -/* IS_ERROR is 2 for "fatal" error, 1 for error, 0 for warning */ - -static void -cppReader_message (cppReader *pfile, int is_error, /*@only@*/ cstring msg) -{ - if (!is_error) - { - /* fprintf (stderr, "warning: "); */ - } - else if (is_error == 2) - { - pfile->errors = cppReader_fatalErrorLimit; - } - else if (pfile->errors < cppReader_fatalErrorLimit) - { - pfile->errors++; - } - else - { - ; - } - - fprintf (stderr, "%s", cstring_toCharsSafe (msg)); - fprintf (stderr, "\n"); -} - -/* Same as cppReader_error, except we consider the error to be "fatal", - such as inconsistent options. I.e. there is little point in continuing. - (We do not exit, to support use of cpplib as a library. - Instead, it is the caller's responsibility to check - cppFatalErrors. */ - -void -cppReader_fatalError (cppReader *pfile, /*@only@*/ cstring str) -{ - fprintf (stderr, "preprocessor: "); - cppReader_message (pfile, 2, str); -} - -void -cppReader_pfatalWithName (cppReader *pfile, cstring name) -{ - cppReader_perrorWithName (pfile, name); - exit (FATAL_EXIT_CODE); -} - -void -cppReader_printFileAndLine (cppReader *pfile) -{ - cppBuffer *ip = cppReader_fileBuffer (pfile); - - if (ip != NULL) - { - int line, col; - - cppBuffer_lineAndColumn (ip, &line, &col); - cppReader_fileLineForMessage (ip->nominal_fname, - line, pfile->show_column ? col : -1); - } - else - { - fprintf (stderr, "Command Line: "); - } -} - -void -cppReader_errorLit (cppReader *pfile, /*@observer@*/ cstring msg) -{ - cppReader_error (pfile, cstring_copy (msg)); -} - -void -cppReader_error (cppReader *pfile, /*@only@*/ cstring msg) -{ - prepareMessage (); - cppReader_printContainingFiles (pfile); - cppReader_printFileAndLine (pfile); - cppReader_message (pfile, 1, msg); - closeMessage (); -} - -/* Print error message but don't count it. */ - -void -cppReader_warningLit (cppReader *pfile, cstring msg) -{ - cppReader_warning (pfile, cstring_copy (msg)); -} - -void -cppReader_warning (cppReader *pfile, /*@only@*/ cstring msg) -{ - if (CPPOPTIONS (pfile)->inhibit_warnings) - return; - - if (CPPOPTIONS (pfile)->warnings_are_errors) - pfile->errors++; - - prepareMessage (); - cppReader_printContainingFiles (pfile); - cppReader_printFileAndLine (pfile); - cppReader_message (pfile, 0, msg); - closeMessage (); -} - -/* Print an error message and maybe count it. */ - -extern void -cppReader_pedwarnLit (cppReader *pfile, /*@observer@*/ cstring msg) -{ - cppReader_pedwarn (pfile, cstring_copy (msg)); -} - -extern void -cppReader_pedwarn (cppReader *pfile, /*@only@*/ cstring msg) -{ - if (CPPOPTIONS (pfile)->pedantic_errors) - { - cppReader_error (pfile, msg); - } - else - { - cppReader_warning (pfile, msg); - } -} - -void -cppReader_errorWithLine (cppReader *pfile, long line, long column, - /*@only@*/ cstring msg) -{ - cppBuffer *ip = cppReader_fileBuffer (pfile); - - prepareMessage (); - cppReader_printContainingFiles (pfile); - - if (ip != NULL) - cppReader_fileLineForMessage (ip->nominal_fname, line, column); - - cppReader_message (pfile, 1, msg); - closeMessage (); -} - -void -cppReader_warningWithLine (cppReader *pfile, - int line, int column, - /*@only@*/ cstring msg) -{ - cppBuffer *ip; - - if (CPPOPTIONS (pfile)->inhibit_warnings) - return; - - if (CPPOPTIONS (pfile)->warnings_are_errors) - pfile->errors++; - - prepareMessage (); - - cppReader_printContainingFiles (pfile); - - ip = cppReader_fileBuffer (pfile); - - if (ip != NULL) - { - cppReader_fileLineForMessage (ip->nominal_fname, line, column); - } - - cppReader_message (pfile, 0, msg); - closeMessage (); -} - -void -cppReader_pedwarnWithLine (cppReader *pfile, int line, int column, - /*@only@*/ cstring msg) -{ - if (CPPOPTIONS (pfile)->pedantic_errors) - { - cppReader_errorWithLine (pfile, column, line, msg); - } - else - { - cppReader_warningWithLine (pfile, line, column, msg); - } -} - -void cppReader_perrorWithName (cppReader *pfile, cstring name) -{ - cppReader_message (pfile, 1, - message ("preprocessing: %s: %s", - name, lldecodeerror (errno))); -} - - - - - - - - diff --git a/src/cppexp.c b/src/cppexp.c deleted file mode 100644 index b74938f..0000000 --- a/src/cppexp.c +++ /dev/null @@ -1,1337 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** cppexp.c -*/ -/* Parse C expressions for CCCP. - Copyright (C) 1987, 1992, 1994, 1995, 1997 Free Software Foundation. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! - -Written by Per Bothner 1994. */ - -/* Parse a C expression from text in a string */ - -/*@+charint@*/ -/*@+ignorequals@*/ -/*@+ignoresigns@*/ -/*@+matchanyintegral@*/ -/*@-shiftsigned@*/ - -# include -# include "lclintMacros.nf" -# include "llbasic.h" -# include "cpp.h" -# include "cpplib.h" -# include "cpphash.h" -# include "cppexp.h" -# include "cpperror.h" - -/* Yield nonzero if adding two numbers with A's and B's signs can yield a - number with SUM's sign, where A, B, and SUM are all C integers. */ - -/*@function static bool possibleSumSign (sef int, int, int) - modifies nothing ; @*/ - -#define possibleSumSign(a, b, sum) ((((a) ^ (b)) | ~ ((a) ^ (sum))) < 0) - -/* these are guesses! */ - -/*@constant int BITS_PER_UNIT@*/ -# define BITS_PER_UNIT 8 - -/*@constant size_t BITS_PER_CHAR@*/ -# define BITS_PER_CHAR 8 - -/*@constant size_t BITS_PER_WORD@*/ -# define BITS_PER_WORD 32 - -/*@constant size_t HOST_BITS_PER_INT@*/ -# define HOST_BITS_PER_INT 32 - -/*@constant size_t HOST_BITS_PER_LONG@*/ -# define HOST_BITS_PER_LONG 32 - -/*@constant char TARGET_BELL@*/ -# define TARGET_BELL (char) 6 - -/*@constant char TARGET_BS@*/ -# define TARGET_BS (char) 7 - -/*@constant char TARGET_FF@*/ -# define TARGET_FF (char) 8 - -/*@constant char TARGET_NEWLINE@*/ -# define TARGET_NEWLINE '\n' - -/*@constant char TARGET_CR@*/ -# define TARGET_CR '\n' - -/*@constant char TARGET_TAB@*/ -# define TARGET_TAB '\t' - -/*@constant char TARGET_VT@*/ -# define TARGET_VT '\v' - -#ifdef MULTIBYTE_CHARS -#include -#include -#endif - -#include - -#ifndef INT_TYPE_SIZE -/*@constant size_t INT_TYPE_SIZE@*/ -#define INT_TYPE_SIZE BITS_PER_WORD -#endif - -#ifndef LONG_TYPE_SIZE -/*@constant size_t LONG_TYPE_SIZE@*/ -#define LONG_TYPE_SIZE BITS_PER_WORD -#endif - -#ifndef WCHAR_TYPE_SIZE -/*@constant size_t WCHAR_TYPE_SIZE@*/ -#define WCHAR_TYPE_SIZE INT_TYPE_SIZE -#endif - -# ifndef CHAR_TYPE_SIZE -/*@constant size_t CHAR_TYPE_SIZE@*/ -# define CHAR_TYPE_SIZE BITS_PER_CHAR -# endif - -#ifndef MAX_CHAR_TYPE_SIZE -/*@constant size_t MAX_CHAR_TYPE_SIZE@*/ -#define MAX_CHAR_TYPE_SIZE CHAR_TYPE_SIZE -#endif - -#ifndef MAX_LONG_TYPE_SIZE -/*@constant size_t MAX_LONG_TYPE_SIZE@*/ -#define MAX_LONG_TYPE_SIZE LONG_TYPE_SIZE -#endif - -#ifndef MAX_WCHAR_TYPE_SIZE -/*@constant size_t MAX_WCHAR_TYPE_SIZE@*/ -#define MAX_WCHAR_TYPE_SIZE WCHAR_TYPE_SIZE -#endif - -static struct operation cppReader_lex (cppReader *); -static void integer_overflow (cppReader *); -static long left_shift (cppReader *, long, bool p_unsignedp, size_t); -static long right_shift (long, bool p_unsignedp, unsigned long); - -/*@constant short CPPREADER_ERRORTOK@*/ -#define CPPREADER_ERRORTOK 299 - -/*@constant int OROR@*/ -#define OROR 300 - -/*@constant int ANDAND@*/ -#define ANDAND 301 - -/*@constant int CPP_EQUALTOK@*/ -#define CPP_EQUALTOK 302 - -/*@constant int NOTEQUAL@*/ -#define NOTEQUAL 303 - -/*@constant int LEQ@*/ -#define LEQ 304 - -/*@constant int GEQ@*/ -#define GEQ 305 - -/*@constant int LSH@*/ -#define LSH 306 - -/*@constant int RSH@*/ -#define RSH 307 - -/*@constant int NAME@*/ -#define NAME 308 - -/*@constant short CPPEXP_INT@*/ -#define CPPEXP_INT 309 - -/*@constant short CPPEXP_CHAR@*/ -#define CPPEXP_CHAR 310 - -/*@constant int LEFT_OPERAND_REQUIRED@*/ -#define LEFT_OPERAND_REQUIRED 1 - -/*@constant int RIGHT_OPERAND_REQUIRED@*/ -#define RIGHT_OPERAND_REQUIRED 2 - -/*@constant int HAVE_VALUE@*/ -#define HAVE_VALUE 4 - -#ifndef HOST_BITS_PER_WIDE_INT - -#if HOST_BITS_PER_LONG > HOST_BITS_PER_INT -/*@constant int HOST_BITS_PER_WIDE_INT@*/ -#define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG -/*@notfunction@*/ -#define HOST_WIDE_INT long -#else -/*@constant int HOST_BITS_PER_WIDE_INT@*/ -#define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_INT -/*@notfunction@*/ -#define HOST_WIDE_INT long -#endif - -#endif - -struct operation { - short op; - - /* Priority of op (relative to it right operand). */ - /*@reldef@*/ char rprio; - - /*@reldef@*/ char flags; - - /* true if value should be treated as unsigned */ - /*@reldef@*/ bool unsignedp; - - /* The value logically "right" of op. */ - /*@reldef@*/ HOST_WIDE_INT value; -} ; - -/* Take care of parsing a number (anything that starts with a digit). - LEN is the number of characters in it. */ - -/* maybe needs to actually deal with floating point numbers */ - -struct operation -cppReader_parseNumber (cppReader *pfile, char *start, int olen) -{ - struct operation op; - char *p = start; - char c; - int i; - long n = 0; - unsigned long nd, ULONG_MAX_over_base; - int base = 10; - int len = olen; - bool overflow = FALSE; - int digit, largest_digit = 0; - bool spec_long = FALSE; - - op.unsignedp = FALSE; - - for (i = 0; i < len; i++) - { - if (p[i] == '.') { - /* It's a float since it contains a point. */ - cppReader_errorLit - (pfile, - cstring_makeLiteralTemp - ("Floating point numbers not allowed in #if expressions")); - op.op = CPPREADER_ERRORTOK; - return op; - } - } - - if (len >= 3 && (mstring_equalPrefix (p, "0x") - || mstring_equalPrefix (p, "0X"))) - { - p += 2; - base = 16; - len -= 2; - } - else if (*p == '0') - { - base = 8; - } - else - { - ; - } - - /* Some buggy compilers (e.g. MPW C) seem to need both casts. */ - ULONG_MAX_over_base = ((unsigned long) -1) / ((unsigned long) base); - - for (; len > 0; len--) { - c = *p++; - - if (c >= '0' && c <= '9') - { - digit = (int) (c - '0'); - } - else if (base == 16 && c >= 'a' && c <= 'f') - { - digit = (int) (c - 'a') + 10; - } - else if (base == 16 && c >= 'A' && c <= 'F') - { - digit = (int) (c - 'A') + 10; - } - else - { - /* `l' means long, and `u' means unsigned. */ - while (TRUE) - { - if (c == 'l' || c == 'L') - { - if (spec_long) - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("two `l's in integer constant")); - spec_long = TRUE; - } - else if (c == 'u' || c == 'U') - { - if (op.unsignedp) - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("two `u's in integer constant")); - op.unsignedp = TRUE; - } - else - { - /*@innerbreak@*/ break; - } - - if (--len == 0) - { - /*@innerbreak@*/ break; - } - - c = *p++; - } - /* Don't look for any more digits after the suffixes. */ - break; - } - - if (largest_digit < digit) - { - largest_digit = digit; - } - - nd = (long unsigned) (n * base + digit); - overflow |= (ULONG_MAX_over_base < (unsigned long) n) - | (nd < (unsigned long) n); - n = (long) nd; - } - - if (len != 0) - { - cppReader_errorLit - (pfile, - cstring_makeLiteralTemp ("Invalid number in #if expression")); - op.op = CPPREADER_ERRORTOK; - return op; - } - - if (base <= largest_digit) - { - cppReader_pedwarnLit - (pfile, - cstring_makeLiteralTemp - ("Integer constant contains digits beyond the radix")); - } - - if (overflow) - { - cppReader_pedwarnLit - (pfile, - cstring_makeLiteralTemp ("Integer constant out of range")); - } - - /* If too big to be signed, consider it unsigned. */ - if ((long) n < 0 && ! op.unsignedp) - { - if (base == 10) - { - cppReader_warningLit - (pfile, - cstring_makeLiteralTemp ("Integer constant is so large that it is unsigned")); - } - - op.unsignedp = TRUE; - } - - op.value = n; - op.op = CPPEXP_INT; - return op; -} - -struct token { - /*@null@*/ /*@observer@*/ char *operator; - int token; -}; - -static struct token tokentab2[] = { - { "&&", ANDAND }, - { "||", OROR }, - { "<<", LSH }, - { ">>", RSH }, - { "==", CPP_EQUALTOK }, - { "!=", NOTEQUAL }, - { "<=", LEQ }, - { ">=", GEQ }, - { "++", CPPREADER_ERRORTOK }, - { "--", CPPREADER_ERRORTOK }, - { NULL, CPPREADER_ERRORTOK } -} ; - -/* Read one token. */ - -struct operation cppReader_lex (cppReader *pfile) -{ - int ic; - char c; - register struct token *toktab; - enum cpp_token token; - struct operation op; - char *tok_start, *tok_end; - int old_written; - - retry: - - old_written = size_toInt (cppReader_getWritten (pfile)); - cppSkipHspace (pfile); - ic = cppBufPeek (cppReader_getBufferSafe (pfile)); - - c = (char) ic; - llassert (c != '#'); - - if (c == '\n') - { - op.op = 0; - return op; - } - - token = cppGetToken (pfile); - tok_start = pfile->token_buffer + old_written; - tok_end = cppReader_getPWritten (pfile); - pfile->limit = tok_start; - - switch (token) - { - case CPP_EOF: /* Should not happen ... */ - case CPP_VSPACE: - op.op = 0; - return op; - case CPP_POP: - if (cstring_isDefined (cppReader_getBufferSafe (pfile)->fname)) - { - op.op = 0; - return op; - } - (void) cppReader_popBuffer (pfile); - goto retry; - case CPP_HSPACE: case CPP_COMMENT: - goto retry; - case CPP_NUMBER: - return cppReader_parseNumber (pfile, tok_start, tok_end - tok_start); - case CPP_STRING: - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("string constants not allowed in #if expressions")); - op.op = CPPREADER_ERRORTOK; - return op; - case CPP_CHAR: - /* This code for reading a character constant - handles multicharacter constants and wide characters. - It is mostly copied from c-lex.c. */ - { - int result = 0; - int num_chars = 0; - size_t width = MAX_CHAR_TYPE_SIZE; - int wide_flag = 0; - int max_chars; - char *ptr = tok_start; -#ifdef MULTIBYTE_CHARS - char token_buffer[MAX_LONG_TYPE_SIZE/MAX_CHAR_TYPE_SIZE + MB_CUR_MAX]; -#else - char token_buffer[MAX_LONG_TYPE_SIZE/MAX_CHAR_TYPE_SIZE + 1]; -#endif - - if (*ptr == 'L') - { - ptr++; - wide_flag = 1; - width = MAX_WCHAR_TYPE_SIZE; -#ifdef MULTIBYTE_CHARS - max_chars = MB_CUR_MAX; -#else - max_chars = 1; -#endif - } - else - { - max_chars = size_toInt (MAX_LONG_TYPE_SIZE / width); - } - - ++ptr; - while (ptr < tok_end && ((c = *ptr++) != '\'')) - { - if (c == '\\') - { - c = cppReader_parseEscape (pfile, &ptr); - if (width < HOST_BITS_PER_INT && c >= (1 << width)) - { - cppReader_pedwarnLit - (pfile, - cstring_makeLiteralTemp ("Escape sequence out of range for character")); - } - } - - num_chars++; - - /* Merge character into result; ignore excess chars. */ - if (num_chars < max_chars + 1) - { - if (width < HOST_BITS_PER_INT) - { - result = (int) ((unsigned) result << width) | (c & ((1 << width) - 1)); - } - else - { - result = c; - } - - token_buffer[num_chars - 1] = c; - } - } - - token_buffer[num_chars] = 0; - - if (c != '\'') - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("malformatted character constant")); - else if (num_chars == 0) - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("empty character constant")); - else if (num_chars > max_chars) - { - num_chars = max_chars; - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("character constant too long")); - } - else if (num_chars != 1 && ! cppReader_isTraditional (pfile)) - { - cppReader_warningLit (pfile, - cstring_makeLiteralTemp ("multi-character character constant")); - } - else - { - ; - } - - /* If char type is signed, sign-extend the constant. */ - if (wide_flag == 0) - { - int num_bits = num_chars * width; - - if ((cppReader_lookup ("__CHAR_UNSIGNED__", - sizeof ("__CHAR_UNSIGNED__") - 1, -1) != NULL) - || (((unsigned) result >> (num_bits - 1)) & 1) == 0) - { - op.value - = result & ((unsigned long) ~0 >> (HOST_BITS_PER_LONG - num_bits)); - } - else - { - op.value - = result | ~((unsigned long) ~0 >> (HOST_BITS_PER_LONG - num_bits)); - } - } - else - { -#ifdef MULTIBYTE_CHARS - /* Set the initial shift state and convert the next sequence. */ - result = 0; - /* In all locales L'\0' is zero and mbtowc will return zero, - so don't use it. */ - if (num_chars > 1 - || (num_chars == 1 && token_buffer[0] != '\0')) - { - wchar_t wc; - (void) mbtowc (NULL, NULL, 0); - if (mbtowc (& wc, token_buffer, num_chars) == num_chars) - result = wc; - else - cppReader_pedwarn (pfile,"Ignoring invalid multibyte character"); - } -#endif - op.value = result; - } - } - - /* This is always a signed type. */ - op.unsignedp = FALSE; - op.op = CPPEXP_CHAR; - - return op; - - case CPP_NAME: - return cppReader_parseNumber (pfile, "0", 0); - - case CPP_OTHER: - /* See if it is a special token of length 2. */ - if (tok_start + 2 == tok_end) - { - for (toktab = tokentab2; toktab->operator != NULL; toktab++) - { - if (tok_start[0] == toktab->operator[0] - && tok_start[1] == toktab->operator[1]) - { - /*@loopbreak@*/ break; - } - } - - if (toktab->token == CPPREADER_ERRORTOK) - { - cppReader_error (pfile, message ("`%s' not allowed in operand of `#if'", cstring_fromChars (tok_start))); - } - - op.op = toktab->token; - return op; - } - /*@fallthrough@*/ - default: - op.op = *tok_start; - return op; - } - - BADEXIT; - /*@notreached@*/ -} - - -/* Parse a C escape sequence. STRING_PTR points to a variable - containing a pointer to the string to parse. That pointer - is updated past the characters we use. The value of the - escape sequence is returned. - - A negative value means the sequence \ newline was seen, - which is supposed to be equivalent to nothing at all. - - If \ is followed by a null character, we return a negative - value and leave the string pointer pointing at the null character. - - If \ is followed by 000, we return 0 and leave the string pointer - after the zeros. A value of 0 does not mean end of string. */ - -int -cppReader_parseEscape (cppReader *pfile, char **string_ptr) -{ - char c = *(*string_ptr)++; - - switch (c) - { - case 'a': - return TARGET_BELL; - case 'b': - return TARGET_BS; - case 'e': - case 'E': - if (cppReader_isPedantic (pfile)) - { - cppReader_pedwarn (pfile, - message ("non-ANSI-standard escape sequence, `\\%c'", c)); - } - return (char) 033; - case 'f': - return TARGET_FF; - case 'n': - return TARGET_NEWLINE; - case 'r': - return TARGET_CR; - case 't': - return TARGET_TAB; - case 'v': - return TARGET_VT; - case '\n': - return -2; - case 0: - (*string_ptr)--; - return 0; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - { - int i = (int) c - '0'; - int count = 0; - - while (++count < 3) - { - c = *(*string_ptr)++; - if (c >= '0' && c <= '7') - { - i = ((unsigned) i << 3) + c - '0'; - } - - else - { - (*string_ptr)--; - /*@loopbreak@*/ break; - } - } - if ((i & ~((1 << MAX_CHAR_TYPE_SIZE) - 1)) != 0) - { - i &= (1 << MAX_CHAR_TYPE_SIZE) - 1; - cppReader_pedwarnLit (pfile, - cstring_makeLiteralTemp ("octal character constant does not fit in a byte")); - } - return i; - } - case 'x': - { - register unsigned i = 0, overflow = 0, digits_found = 0, digit; - for (;;) - { - c = *(*string_ptr)++; - - if (c >= '0' && c <= '9') - { - digit = (unsigned int) (c - '0'); - } - else if (c >= 'a' && c <= 'f') - { - digit = (unsigned int) (c - 'a') + 10; - } - else if (c >= 'A' && c <= 'F') - { - digit = (unsigned int) (c - 'A') + 10; - } - else - { - (*string_ptr)--; - /*@loopbreak@*/ break; - } - overflow |= i ^ (i << 4 >> 4); - i = (i << 4) + digit; - digits_found = 1; - } - - if (digits_found == 0) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("\\x used with no following hex digits")); - } - - if ((overflow | (i & ~((1 << BITS_PER_UNIT) - 1))) != 0) - { - i &= (1 << BITS_PER_UNIT) - 1; - cppReader_pedwarnLit (pfile, - cstring_makeLiteralTemp ("hex character constant does not fit in a byte")); - } - - return i; - } - default: - return c; - } -} - -static void -integer_overflow (cppReader *pfile) -{ - if (cppReader_isPedantic (pfile)) - cppReader_pedwarnLit (pfile, - cstring_makeLiteralTemp ("integer overflow in preprocessor expression")); -} - -static long -left_shift (cppReader *pfile, long a, bool unsignedp, size_t b) -{ - if (b >= HOST_BITS_PER_LONG) - { - if (!unsignedp && a != 0) - { - integer_overflow (pfile); - } - - return 0; - } - else if (unsignedp) - { - return (unsigned long) a << b; - } - else - { - long l = a << b; - - if (l >> b != a) - { - integer_overflow (pfile); - } - - return l; - } -} - -static long -right_shift (long a, bool unsignedp, unsigned long b) -{ - if (b >= HOST_BITS_PER_LONG) - return (unsignedp ? 0 : a >> (HOST_BITS_PER_LONG - 1)); - else if (unsignedp) - return (unsigned long) a >> b; - else - return a >> b; -} - -/* These priorities are all even, so we can handle associatively. */ - -/*@constant int PAREN_INNER_PRIO@*/ -#define PAREN_INNER_PRIO 0 - -/*@constant int COMMA_PRIO@*/ -#define COMMA_PRIO 4 - -/*@constant int COND_PRIO@*/ -#define COND_PRIO (COMMA_PRIO+2) - -/*@constant int OROR_PRIO@*/ -#define OROR_PRIO (COND_PRIO+2) - -/*@constant int ANDAND_PRIO@*/ -#define ANDAND_PRIO (OROR_PRIO+2) - -/*@constant int OR_PRIO@*/ -#define OR_PRIO (ANDAND_PRIO+2) - -/*@constant int XOR_PRIO@*/ -#define XOR_PRIO (OR_PRIO+2) - -/*@constant int AND_PRIO@*/ -#define AND_PRIO (XOR_PRIO+2) - -/*@constant int CPP_EQUAL_PRIO@*/ -#define CPP_EQUAL_PRIO (AND_PRIO+2) - -/*@constant int LESS_PRIO@*/ -#define LESS_PRIO (CPP_EQUAL_PRIO+2) - -/*@constant int SHIFT_PRIO@*/ -#define SHIFT_PRIO (LESS_PRIO+2) - -/*@constant int PLUS_PRIO@*/ -#define PLUS_PRIO (SHIFT_PRIO+2) - -/*@constant int MUL_PRIO@*/ -#define MUL_PRIO (PLUS_PRIO+2) - -/*@constant int UNARY_PRIO@*/ -#define UNARY_PRIO (MUL_PRIO+2) - -/*@constant int PAREN_OUTER_PRIO@*/ -#define PAREN_OUTER_PRIO (UNARY_PRIO+2) - -/*@notfunction@*/ -#define COMPARE(OP) \ - top->unsignedp = FALSE;\ - top->value = ((unsigned1 || unsigned2) \ - ? (unsigned long) v1 OP (unsigned long) v2 \ - : ((long) v1 OP (long) v2)) ? 1 : 0 - -/* Parse and evaluate a C expression, reading from PFILE. - Returns the value of the expression. */ - -/*@constant int INIT_STACK_SIZE@*/ -# define INIT_STACK_SIZE 20 - -HOST_WIDE_INT -cppReader_parseExpression (cppReader *pfile) -{ - /* The implementation is an operator precedence parser, - i.e. a bottom-up parser, using a stack for not-yet-reduced tokens. - - The stack base is 'stack', and the current stack pointer is 'top'. - There is a stack element for each operator (only), - and the most recently pushed operator is 'top->op'. - An operand (value) is stored in the 'value' field of the stack - element of the operator that precedes it. - In that case the 'flags' field has the HAVE_VALUE flag set. */ - - struct operation init_stack[INIT_STACK_SIZE]; - struct operation *stack = init_stack; - struct operation *limit = stack + INIT_STACK_SIZE; - register struct operation *top = stack; - int lprio, rprio = 0; - int skip_evaluation = 0; - - top->rprio = 0; - top->flags = 0; - - for (;;) - { - struct operation op; - int flags = 0; - - /* Read a token */ - op = cppReader_lex (pfile); - - /* See if the token is an operand, in which case go to set_value. - If the token is an operator, figure out its left and right - priorities, and then goto maybe_reduce. */ - - switch (op.op) - { - case NAME: - top->value = 0, top->unsignedp = FALSE; - goto set_value; - case CPPEXP_INT: - case CPPEXP_CHAR: - top->value = op.value; - top->unsignedp = op.unsignedp; - goto set_value; - case 0: - lprio = 0; goto maybe_reduce; - case '+': case '-': - /* Is this correct if unary ? FIXME */ - flags = RIGHT_OPERAND_REQUIRED; - lprio = PLUS_PRIO; rprio = lprio + 1; goto maybe_reduce; - case '!': case '~': - flags = RIGHT_OPERAND_REQUIRED; - rprio = UNARY_PRIO; lprio = rprio + 1; goto maybe_reduce; - case '*': case '/': case '%': - lprio = MUL_PRIO; goto binop; - case '<': case '>': case LEQ: case GEQ: - lprio = LESS_PRIO; goto binop; - case CPP_EQUALTOK: case NOTEQUAL: - lprio = CPP_EQUAL_PRIO; goto binop; - case LSH: case RSH: - lprio = SHIFT_PRIO; goto binop; - case '&': lprio = AND_PRIO; goto binop; - case '^': lprio = XOR_PRIO; goto binop; - case '|': lprio = OR_PRIO; goto binop; - case ANDAND: lprio = ANDAND_PRIO; goto binop; - case OROR: lprio = OROR_PRIO; goto binop; - case ',': - lprio = COMMA_PRIO; goto binop; - case '(': - lprio = PAREN_OUTER_PRIO; rprio = PAREN_INNER_PRIO; - goto maybe_reduce; - case ')': - lprio = PAREN_INNER_PRIO; rprio = PAREN_OUTER_PRIO; - goto maybe_reduce; - case ':': - lprio = COND_PRIO; rprio = COND_PRIO; - goto maybe_reduce; - case '?': - lprio = COND_PRIO + 1; rprio = COND_PRIO; - goto maybe_reduce; - binop: - flags = LEFT_OPERAND_REQUIRED | RIGHT_OPERAND_REQUIRED; - rprio = lprio + 1; - goto maybe_reduce; - default: - cppReader_error - (pfile, - message ("Invalid character in #if: %c", - (char) op.op)); - goto syntax_error; - } - - set_value: - /* Push a value onto the stack. */ - if ((top->flags & HAVE_VALUE) != 0) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("syntax error in #if")); - goto syntax_error; - } - top->flags |= HAVE_VALUE; - continue; - - maybe_reduce: - /* Push an operator, and check if we can reduce now. */ - while (top->rprio > lprio) - { - /*@-usedef@*/ - long v1 = top[-1].value, v2 = top[0].value; - bool unsigned1 = top[-1].unsignedp; - bool unsigned2 = top[0].unsignedp; - - top--; - - if (((top[1].flags & LEFT_OPERAND_REQUIRED) != 0) - && ((top[0].flags & HAVE_VALUE) == 0)) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("syntax error - missing left operand")); - goto syntax_error; - } - if (((top[1].flags & RIGHT_OPERAND_REQUIRED) != 0) - && ((top[1].flags & HAVE_VALUE) == 0)) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("syntax error - missing right operand")); - goto syntax_error; - } - /* top[0].value = (top[1].op)(v1, v2);*/ - switch (top[1].op) - { - case '+': - if ((top->flags & HAVE_VALUE) == 0) - { /* Unary '+' */ - top->value = v2; - top->unsignedp = unsigned2; - top->flags |= HAVE_VALUE; - } - else - { - top->value = v1 + v2; - top->unsignedp = unsigned1 || unsigned2; - if (!top->unsignedp && (skip_evaluation == 0) - && ! possibleSumSign (v1, v2, top->value)) - integer_overflow (pfile); - } - /*@switchbreak@*/ break; - case '-': - if ((top->flags & HAVE_VALUE) == 0) - { /* Unary '-' */ - top->value = - v2; - if ((skip_evaluation == 0) - && (top->value & v2) < 0 && !unsigned2) - integer_overflow (pfile); - top->unsignedp = unsigned2; - top->flags |= HAVE_VALUE; - } - else - { /* Binary '-' */ - top->value = v1 - v2; - top->unsignedp = unsigned1 || unsigned2; - if (!top->unsignedp && (skip_evaluation == 0) - && !possibleSumSign (top->value, v2, v1)) - { - integer_overflow (pfile); - } - } - /*@switchbreak@*/ break; - case '*': - top->unsignedp = unsigned1 || unsigned2; - - if (top->unsignedp) - { - top->value = (unsigned long) v1 * v2; - } - else if (skip_evaluation == 0) - { - top->value = v1 * v2; - if ((v1 != 0) - && (top->value / v1 != v2 - || (top->value & v1 & v2) < 0)) - { - integer_overflow (pfile); - } - } - else - { - ; - } - - /*@switchbreak@*/ break; - case '/': - if (skip_evaluation != 0) - /*@switchbreak@*/ break; - if (v2 == 0) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("Division by zero in #if")); - v2 = 1; - } - top->unsignedp = unsigned1 || unsigned2; - if (top->unsignedp) - top->value = (unsigned long) v1 / v2; - else - { - top->value = v1 / v2; - if ((top->value & v1 & v2) < 0) - integer_overflow (pfile); - } - /*@switchbreak@*/ break; - case '%': - if (skip_evaluation != 0) - /*@switchbreak@*/ break; - if (v2 == 0) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("Division by zero in #if")); - v2 = 1; - } - top->unsignedp = unsigned1 || unsigned2; - if (top->unsignedp) - top->value = (unsigned long) v1 % v2; - else - top->value = v1 % v2; - /*@switchbreak@*/ break; - case '!': - if ((top->flags & HAVE_VALUE) != 0) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("Syntax error")); - goto syntax_error; - } - - top->value = (v2 == 0) ? 1 : 0; - top->unsignedp = FALSE; - top->flags |= HAVE_VALUE; - /*@switchbreak@*/ break; - case '~': - if ((top->flags & HAVE_VALUE) != 0) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("syntax error")); - goto syntax_error; - } - top->value = ~ v2; - top->unsignedp = unsigned2; - top->flags |= HAVE_VALUE; - /*@switchbreak@*/ break; - case '<': COMPARE(<); /*@switchbreak@*/ break; - case '>': COMPARE(>); /*@switchbreak@*/ break; - case LEQ: COMPARE(<=); /*@switchbreak@*/ break; - case GEQ: COMPARE(>=); /*@switchbreak@*/ break; - case CPP_EQUALTOK: - top->value = (v1 == v2) ? 1 : 0; - top->unsignedp = FALSE; - /*@switchbreak@*/ break; - case NOTEQUAL: - top->value = (v1 != v2) ? 1 : 0; - top->unsignedp = FALSE; - /*@switchbreak@*/ break; - case LSH: - if (skip_evaluation != 0) - { - /*@switchbreak@*/ break; - } - - top->unsignedp = unsigned1; - if (v2 < 0 && ! unsigned2) - top->value = right_shift (v1, unsigned1, -v2); - else - top->value = left_shift (pfile, v1, unsigned1, v2); - /*@switchbreak@*/ break; - case RSH: - if (skip_evaluation != 0) - { - /*@switchbreak@*/ break; - } - top->unsignedp = unsigned1; - if (v2 < 0 && ! unsigned2) - top->value = left_shift (pfile, v1, unsigned1, -v2); - else - top->value = right_shift (v1, unsigned1, v2); - /*@switchbreak@*/ break; - -/*@notfunction@*/ -#define LOGICAL(OP) \ - top->value = v1 OP v2;\ - top->unsignedp = unsigned1 || unsigned2; - - case '&': LOGICAL(&); /*@switchbreak@*/ break; - case '^': LOGICAL(^); /*@switchbreak@*/ break; - case '|': LOGICAL(|); /*@switchbreak@*/ break; - case ANDAND: - top->value = ((v1 != 0) && (v2 != 0)) ? 1 : 0; - top->unsignedp = FALSE; - - if (v1 == 0) - { - skip_evaluation--; - } - /*@switchbreak@*/ break; - case OROR: - top->value = ((v1 != 0) || (v2 != 0)) ? 1 : 0; - top->unsignedp = FALSE; - if (v1 != 0) - { - skip_evaluation--; - } - /*@switchbreak@*/ break; - case ',': - if (cppReader_isPedantic (pfile)) - cppReader_pedwarnLit (pfile, - cstring_makeLiteralTemp ("comma operator in operand of `#if'")); - top->value = v2; - top->unsignedp = unsigned2; - /*@switchbreak@*/ break; - case '(': case '?': - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("syntax error in #if")); - goto syntax_error; - case ':': - if (top[0].op != '?') - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("syntax error ':' without preceding '?'")); - goto syntax_error; - } - else if (((top[1].flags & HAVE_VALUE) == 0) - || ((top[-1].flags & HAVE_VALUE) == 0) - || ((top[0].flags & HAVE_VALUE) == 0)) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("bad syntax for ?: operator")); - goto syntax_error; - } - else - { - top--; - if (top->value != 0) - { - skip_evaluation--; - } - - top->value = (top->value != 0) ? v1 : v2; - top->unsignedp = unsigned1 || unsigned2; - } - /*@switchbreak@*/ break; - case ')': - if (((top[1].flags & HAVE_VALUE) != 0) - || ((top[0].flags & HAVE_VALUE) == 0) - || top[0].op != '(' - || ((top[-1].flags & HAVE_VALUE) != 0)) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("mismatched parentheses in #if")); - goto syntax_error; - } - else - { - top--; - top->value = v1; - top->unsignedp = unsigned1; - top->flags |= HAVE_VALUE; - } - /*@switchbreak@*/ break; - default: - fprintf (stderr, - top[1].op >= ' ' && top[1].op <= '~' - ? "unimplemented operator '%c'\n" - : "unimplemented operator '\\%03o'\n", - top[1].op); - } - } - if (op.op == 0) - { - long val; - - if (top != stack) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("internal error in #if expression")); - } - - val = top->value; - - if (stack != init_stack) - { - sfree (stack); - /*@-branchstate@*/ - } /*@=branchstate@*/ - - return val; - } - top++; - - /* Check for and handle stack overflow. */ - if (top == limit) - { - struct operation *new_stack; - int old_size = (char *) limit - (char *) stack; - size_t new_size = size_fromInt (2 * old_size); - - if (stack != init_stack) - { - new_stack = (struct operation *) drealloc ((char *) stack, - new_size); - } - else - { - new_stack = (struct operation *) dmalloc (new_size); - - /* Bug: the parameters were in the wrong order! */ - memcpy ((char *) new_stack, (char *) stack, old_size); - /*@-branchstate@*/ - } /*@=branchstate@*/ - - stack = new_stack; - top = (struct operation *) ((char *) new_stack + old_size); - limit = (struct operation *) ((char *) new_stack + new_size); - /*@-branchstate@*/ - } /*@=branchstate@*/ - - top->flags = flags; - top->rprio = rprio; - top->op = op.op; - if ((op.op == OROR && (top[-1].value != 0)) - || (op.op == ANDAND && (top[-1].value == 0)) - || (op.op == '?' && (top[-1].value == 0))) - { - skip_evaluation++; - } - else if (op.op == ':') - { - if (top[-2].value != 0) /* Was condition true? */ - { - skip_evaluation++; - } - else - { - skip_evaluation--; - } - } - else - { - ; - } - } - syntax_error: - /*@-usereleased@*/ - if (stack != init_stack) - { - sfree (stack); - /*@-branchstate@*/ - } /*@=branchstate@*/ - /*@=usereleased@*/ - - cppReader_skipRestOfLine (pfile); - return 0; -} diff --git a/src/cpphash.c b/src/cpphash.c deleted file mode 100644 index 9f316a4..0000000 --- a/src/cpphash.c +++ /dev/null @@ -1,492 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** cpphash.c -** -** Pre-processor hash table. Derived from gnu cpp. -*/ - -/* Part of CPP library. (Macro hash table support.) - Copyright (C) 1986, 87, 89, 92-95, 1996 Free Software Foundation, Inc. - Written by Per Bothner, 1994. - Based on CCCP program by by Paul Rubin, June 1986 - Adapted to ANSI C, Richard Stallman, Jan 1987 - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! */ - -# include "lclintMacros.nf" -# include "llbasic.h" -# include -# include "cpp.h" -# include "cpplib.h" -# include "cpphash.h" - -typedef /*@only@*/ HASHNODE *o_HASHNODE; - -static o_HASHNODE hashtab[CPP_HASHSIZE]; -static o_HASHNODE ohashtab[CPP_HASHSIZE]; - -static void HashNode_delete (/*@null@*/ /*@only@*/ HASHNODE *); - -/* p_prev need not be defined, but isn't defined by HashNode_copy */ - -/*@function static unsigned int hashStep (unsigned, char) modifies nothing ; @*/ -# define hashStep(old, c) (((old) << 2) + (unsigned int) (c)) - -/*@function static unsigned int makePositive (unsigned int) modifies nothing ; @*/ -# define makePositive(v) ((v) & 0x7fffffff) /* make number positive */ - -static /*@null@*/ HASHNODE * - HashNode_copy (/*@null@*/ HASHNODE *, - /*@dependent@*/ HASHNODE **p_hdr, - /*@dependent@*/ /*@null@*/ /*@special@*/ HASHNODE *p_prev) - /*@*/ ; - -void cppReader_saveHashtab () -{ - int i; - - for (i = 0; i < CPP_HASHSIZE; i++) - { - ohashtab[i] = HashNode_copy (hashtab[i], &ohashtab[i], NULL); - } -} - -void cppReader_restoreHashtab () -{ - int i; - - for (i = 0; i < CPP_HASHSIZE; i++) { - /* HashNode_delete (hashtab[i]); */ - hashtab[i] = HashNode_copy (ohashtab[i], &hashtab[i], NULL); - } -} - -static void HashNode_delete (/*@only@*/ /*@null@*/ HASHNODE *node) -{ - if (node == NULL) - { - ; - } - else - { - HashNode_delete (node->next); - - if (node->type == T_MACRO) - { - DEFINITION *d = node->value.defn; - struct reflist *ap, *nextap; - - for (ap = d->pattern; ap != NULL; ap = nextap) - { - nextap = ap->next; - sfree (ap); - } - - if (d->nargs >= 0) - { - sfree (d->args.argnames); - } - - sfree (d); - } - - cstring_free (node->name); - sfree (node); - } -} - -/*@null@*/ HASHNODE *HashNode_copy (HASHNODE *node, HASHNODE **hdr, - /*@dependent@*/ HASHNODE *prev) -{ - if (node == NULL) - { - return NULL; - } - else - { - HASHNODE *res = dmalloc (sizeof (*res)); - - res->next = HashNode_copy (node->next, hdr, res); - res->prev = prev; - - res->bucket_hdr = hdr; - res->type = node->type; - res->length = node->length; - res->name = cstring_copy (node->name); - - if (node->type == T_MACRO) - { - DEFINITION *d = node->value.defn; - DEFINITION *nd = dmalloc (sizeof (*nd)); - - res->value.defn = nd; - nd->nargs = d->nargs; - - nd->length = d->length; - nd->predefined = d->predefined; - nd->expansion = d->expansion; - nd->line = d->line; - nd->file = d->file; - - if (d->pattern != NULL) - { - struct reflist *ap, *nextap; - struct reflist **last = &nd->pattern; - - for (ap = d->pattern; ap != NULL; ap = nextap) - { - struct reflist *npattern = dmalloc (sizeof (*(nd->pattern))); - - nextap = ap->next; - - if (ap == d->pattern) - { - *last = npattern; - /*@-branchstate@*/ - } /*@=branchstate@*/ /* npattern is propagated through loop */ - - last = &(npattern->next); - npattern->next = NULL; /* will get filled in */ - npattern->stringify = d->pattern->stringify; - npattern->raw_before = d->pattern->raw_before; - npattern->raw_after = d->pattern->raw_after; - npattern->rest_args = d->pattern->rest_args; - npattern->argno = d->pattern->argno; - /*@-mustfree@*/ - } - /*@=mustfree@*/ - } - else - { - nd->pattern = NULL; - } - - if (d->nargs >= 0) - { - llassert (d->args.argnames != NULL); - - nd->args.argnames = mstring_copy (d->args.argnames); - } - else - { - /* - ** This fix found by: - ** - ** Date: Mon, 31 May 1999 15:10:50 +0900 (JST) - ** From: "N.Komazaki" - */ - - /*! why doesn't lclint report an error for this? */ - nd->args.argnames = mstring_createEmpty (); - } - } - else - { - if (node->type == T_CONST) - { - res->value.ival = node->value.ival; - } - else if (node->type == T_PCSTRING) - { - res->value.cpval = mstring_copy (node->value.cpval); - llassert (res->value.cpval != NULL); - } - else - { - res->value = node->value; - } - } - - /*@-uniondef@*/ /*@-compdef@*/ /* res->prev is not defined */ - return res; - /*@=uniondef@*/ /*@=compdef@*/ - } -} - -/* Return hash function on name. must be compatible with the one - computed a step at a time, elsewhere */ - -int -hashf (const char *name, int len, int hashsize) -{ - unsigned int r = 0; - - while (len-- != 0) - { - r = hashStep (r, *name++); - } - - return (int) (makePositive (r) % hashsize); -} - -/* -** Find the most recent hash node for name name (ending with first -** non-identifier char) cppReader_installed by install -** -** If LEN is >= 0, it is the length of the name. -** Otherwise, compute the length by scanning the entire name. -** -** If HASH is >= 0, it is the precomputed hash code. -** Otherwise, compute the hash code. -*/ - -/*@null@*/ HASHNODE *cppReader_lookup (char *name, int len, int hash) -{ - const char *bp; - HASHNODE *bucket; - - if (len < 0) - { - for (bp = name; isIdentifierChar (*bp); bp++) - { - ; - } - - len = bp - name; - } - - if (hash < 0) - { - hash = hashf (name, len, CPP_HASHSIZE); - } - - bucket = hashtab[hash]; - - while (bucket != NULL) - { - if (bucket->length == len && - cstring_equalLen (bucket->name, cstring_fromChars (name), len)) - { - return bucket; - } - - bucket = bucket->next; - } - - return NULL; -} - -/*@null@*/ HASHNODE *cppReader_lookupExpand (char *name, int len, int hash) -{ - HASHNODE *node = cppReader_lookup (name, len, hash); - - DPRINTF (("Lookup expand: %s", name)); - - if (node != NULL) - { - if (node->type == T_MACRO) - { - DEFINITION *defn = (DEFINITION *) node->value.defn; - - DPRINTF (("Check macro...")); - - if (defn->noExpand) { - DPRINTF (("No expand!")); - return NULL; - } - } - } - - return node; -} - -/* - * Delete a hash node. Some weirdness to free junk from macros. - * More such weirdness will have to be added if you define more hash - * types that need it. - */ - -/* Note that the DEFINITION of a macro is removed from the hash table - but its storage is not freed. This would be a storage leak - except that it is not reasonable to keep undefining and redefining - large numbers of macros many times. - In any case, this is necessary, because a macro can be #undef'd - in the middle of reading the arguments to a call to it. - If #undef freed the DEFINITION, that would crash. */ - -void -cppReader_deleteMacro (HASHNODE *hp) -{ - if (hp->prev != NULL) - { - /*@-mustfree@*/ - hp->prev->next = hp->next; - /*@=mustfree@*/ - /*@-branchstate@*/ - } /*@=branchstate@*/ - - if (hp->next != NULL) - { - hp->next->prev = hp->prev; - } - - /* make sure that the bucket chain header that - the deleted guy was on points to the right thing afterwards. */ - if (hp == *hp->bucket_hdr) { - *hp->bucket_hdr = hp->next; - } - - if (hp->type == T_MACRO) - { - DEFINITION *d = hp->value.defn; - struct reflist *ap, *nextap; - - for (ap = d->pattern; ap != NULL; ap = nextap) - { - nextap = ap->next; - sfree (ap); - } - - if (d->nargs >= 0) - { - sfree (d->args.argnames); - } - } - - /*@-dependenttrans@*/ /*@-exposetrans@*/ /*@-compdestroy@*/ - sfree (hp); - /*@=dependenttrans@*/ /*@=exposetrans@*/ /*@=compdestroy@*/ -} - -/* Install a name in the main hash table, even if it is already there. - name stops with first non alphanumeric, except leading '#'. - caller must check against redefinition if that is desired. - cppReader_deleteMacro () removes things installed by install () in fifo order. - this is important because of the `defined' special symbol used - in #if, and also if pushdef/popdef directives are ever implemented. - - If LEN is >= 0, it is the length of the name. - Otherwise, compute the length by scanning the entire name. - - If HASH is >= 0, it is the precomputed hash code. - Otherwise, compute the hash code. */ - -HASHNODE *cppReader_install (char *name, int len, enum node_type type, - int ivalue, char *value, int hash) -{ - HASHNODE *hp; - int i, bucket; - char *p, *q; - - if (len < 0) { - p = name; - - while (isIdentifierChar (*p)) - { - p++; - } - - len = p - name; - } - - if (hash < 0) - { - hash = hashf (name, len, CPP_HASHSIZE); - } - - i = sizeof (*hp) + len + 1; - - - hp = (HASHNODE *) dmalloc (size_fromInt (i)); - bucket = hash; - hp->bucket_hdr = &hashtab[bucket]; - - hp->next = hashtab[bucket]; - hp->prev = NULL; - - if (hp->next != NULL) - { - hp->next->prev = hp; - } - - hashtab[bucket] = hp; - - hp->type = type; - hp->length = len; - - if (hp->type == T_CONST) - { - hp->value.ival = ivalue; - llassert (value == NULL); - } - else - { - hp->value.cpval = value; - } - - { - char *tmp = ((char *) hp) + sizeof (*hp); - p = tmp; - q = name; - - for (i = 0; i < len; i++) - { - *p++ = *q++; - } - - tmp[len] = '\0'; - hp->name = cstring_fromChars (tmp); - } - - /*@-mustfree@*/ /*@-uniondef@*/ /*@-compdef@*/ - return hp; - /*@=mustfree@*/ /*@=uniondef@*/ /*@=compdef@*/ -} - -HASHNODE *cppReader_installMacro (char *name, int len, - struct definition *defn, int hash) -{ - return cppReader_install (name, len, T_MACRO, 0, (char *) defn, hash); -} - -void -cppReader_hashCleanup (void) -{ - int i; - - for (i = CPP_HASHSIZE; --i >= 0; ) - { - while (hashtab[i] != NULL) - { - cppReader_deleteMacro (hashtab[i]); - } - } -} diff --git a/src/cpplib.c b/src/cpplib.c deleted file mode 100644 index 04e5c21..0000000 --- a/src/cpplib.c +++ /dev/null @@ -1,7441 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** cpplib.c -*/ -/* - Copyright (C) 1986, 87, 89, 92-6, 1997 Free Software Foundation, Inc. - Contributed by Per Bothner, 1994-95. - Based on CCCP program by Paul Rubin, June 1986 - Adapted to ANSI C, Richard Stallman, Jan 1987 - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! */ - -/* - * Herbert 06/12/2000: - * - OS2 drive specs like WIN32 - * - Includes for IBMs OS/2 compiler - */ - -# include -# include -# include -# ifdef __STDC__ -# include -# endif - -# include - -# if !(defined (WIN32) || defined (OS2) && defined (__IBMC__)) -# include -# endif - -# include -# include -# include - -# if defined (WIN32) || defined (OS2) && defined (__IBMC__) -# include -# include /* for __DATE__ and __TIME__ */ -# include -# else -# ifndef VMS -# ifndef USG -# include -# include -# else -# include -# include -# include -# endif /* USG */ -# endif /* not VMS */ -# endif /* not WIN32 */ - -/* This defines "errno" properly for VMS, and gives us EACCES. */ -# include - -# include "lclintMacros.nf" -# include "llbasic.h" -# include "lcllib.h" -# include "cpp.h" -# include "cpplib.h" -# include "cpperror.h" -# include "cpphash.h" -# include "cppexp.h" -# include "version.h" -# include "portab.h" -# include "osd.h" - -/* -** This is really kludgey code... -*/ - -/*@+boolint@*/ -/*@+charint@*/ - -#define NO_SHORTNAMES - -# ifdef open -# undef open -# undef read -# undef write -# endif /* open */ - -/*@constant int IMPORT_FOUND@*/ -# define IMPORT_FOUND -2 - -/*@constant int SKIP_INCLUDE@*/ -# define SKIP_INCLUDE IMPORT_FOUND - -/*@constant unused int IMPORT_NOT_FOUND@*/ -# define IMPORT_NOT_FOUND -1 - -#ifndef STDC_VALUE -/*@constant unused int STDC_VALUE@*/ -#define STDC_VALUE 1 -#endif - -/* By default, colon separates directories in a path. */ -#ifndef PATH_SEPARATOR -/*@constant char PATH_SEPARATOR@*/ -#define PATH_SEPARATOR ':' -#endif - -static void parse_name (cppReader *, int); - -static int cpp_openIncludeFile (char *p_filename) - /*@modifies fileSystem @*/ ; - -static void cpp_setLocation (cppReader *p_pfile) - /*@modifies g_currentloc@*/ ; - -static enum cpp_token cpp_handleComment (cppReader *p_pfile, - struct parse_marker *p_smark) - /*@modifies *p_pfile, *p_smark@*/; - -static bool cpp_shouldCheckMacro (cppReader *p_pfile, char *p_p) /*@*/ ; - -static bool cpp_skipIncludeFile (cstring p_fname) /*@*/ ; - -#ifndef O_RDONLY -#define O_RDONLY 0 -#endif - -/* Symbols to predefine. */ - -#ifdef CPP_PREDEFINES -static /*@observer@*/ char *predefs = CPP_PREDEFINES; -#else -static /*@observer@*/ char *predefs = ""; -#endif - -/* We let tm.h override the types used here, to handle trivial differences - such as the choice of unsigned int or long unsigned int for size_t. - When machines start needing nontrivial differences in the size type, - it would be best to do something here to figure out automatically - from other information what type to use. */ - -/* The string value for __SIZE_TYPE__. */ - -#ifndef SIZE_TYPE -/*@constant observer char *SIZE_TYPE@*/ -#define SIZE_TYPE "long unsigned int" -#endif - -/* The string value for __PTRDIFF_TYPE__. */ - -#ifndef PTRDIFF_TYPE -/*@constant observer char *PTRDIFF_TYPE@*/ -#define PTRDIFF_TYPE "long int" -#endif - -/* The string value for __WCHAR_TYPE__. */ - -#ifndef WCHAR_TYPE -/*@constant observer char *WCHAR_TYPE@*/ -#define WCHAR_TYPE "int" -#endif - -/* The string value for __USER_LABEL_PREFIX__ */ - -#ifndef USER_LABEL_PREFIX -/*@constant observer char *USER_LABEL_PREFIX@*/ -#define USER_LABEL_PREFIX "" -#endif - -/* The string value for __REGISTER_PREFIX__ */ - -#ifndef REGISTER_PREFIX -/*@constant observer char *REGISTER_PREFIX@*/ -#define REGISTER_PREFIX "" -#endif - -/* table to tell if char can be part of a C identifier. */ -static bool is_idchar[256]; -/* table to tell if char can be first char of a c identifier. */ -static bool is_idstart[256]; -/* table to tell if c is horizontal space. */ -static bool is_hor_space[256]; -/* table to tell if c is horizontal or vertical space. */ -static bool is_space[256]; - -static /*@exposed@*/ /*@null@*/ cppBuffer * -cppReader_getBuffer (/*@special@*/ cppReader *p_pfile) - /*@uses p_pfile->buffer@*/ - /*@modifies nothing@*/ ; - -/*@notfunction@*/ -# define SKIP_WHITE_SPACE(p) do { /*@access cstring@*/ while (is_hor_space[(int) *(p)]) { (p)++; } } /*@noaccess cstring@*/ while (0) - -/*@notfunction@*/ -# define SKIP_ALL_WHITE_SPACE(p) do { while (is_space[*(p)]) { (p)++; } } while (0) - -static int cpp_peekN (cppReader *p_pfile, int p_n) /*@*/ ; - -/*@function static int cppBuffer_get (sef cppBuffer *p_b) modifies *p_b ; @*/ -# define cppBuffer_get(BUFFER) \ - ((BUFFER)->cur < (BUFFER)->rlimit ? *(BUFFER)->cur++ : EOF) - -/* Append string STR (of length N) to PFILE's output buffer. Make space. */ -/*@function static void cppReader_puts (sef cppReader *p_file, char *p_str, sef size_t p_n) - modifies *p_file; @*/ -# define cppReader_puts(PFILE, STR, N) \ - cppReader_reserve(PFILE, N), cppReader_putStrN (PFILE, STR,N) - -/* Append character CH to PFILE's output buffer. Assume sufficient space. */ - -/*@function static void cppReader_putCharQ (cppReader *p_file, char p_ch) - modifies *p_file; @*/ -# define cppReader_putCharQ(PFILE, CH) (*(PFILE)->limit++ = (CH)) - -/* Append character CH to PFILE's output buffer. Make space if need be. */ - -/*@function static void cppReader_putChar (sef cppReader *p_file, char p_ch) - modifies *p_file; @*/ -#define cppReader_putChar(PFILE, CH) (cppReader_reserve (PFILE, (size_t) 1), cppReader_putCharQ (PFILE, CH)) - -/* Make sure PFILE->limit is followed by '\0'. */ -/*@function static void cppReader_nullTerminateQ (cppReader *p_file) - modifies *p_file; @*/ - -#define cppReader_nullTerminateQ(PFILE) (*(PFILE)->limit = 0) - -/*@function static void cppReader_nullTerminate (sef cppReader *p_file) - modifies *p_file; @*/ -# define cppReader_nullTerminate(PFILE) \ - (cppReader_reserve (PFILE, (size_t) 1), *(PFILE)->limit = 0) - -/*@function static void cppReader_adjustWritten (cppReader *p_file, size_t) - modifies *p_file; @*/ -#define cppReader_adjustWritten(PFILE,DELTA) ((PFILE)->limit += (DELTA)) - -/*@function static bool cppReader_isC89 (cppReader *) modifies nothing; @*/ -#define cppReader_isC89(PFILE) (CPPOPTIONS(PFILE)->c89) - -/*@function static observer char *cppReader_wcharType (cppReader *) - modifies nothing; @*/ - -# define cppReader_wcharType(PFILE) \ - (CPPOPTIONS (PFILE)->cplusplus ? "__wchar_t" : WCHAR_TYPE) - -static void cppBuffer_forward (cppBuffer *p_buf, int p_n) /*@modifies *p_buf@*/ ; - -/*@function static void cppReader_forward (cppReader *p_pfile, int) modifies *p_pfile; @*/ -# define cppReader_forward(pfile, N) \ - (cppBuffer_forward (cppReader_getBufferSafe (pfile), (N))) - -/*@function static int cppReader_getC (cppReader *p_pfile) modifies *p_pfile; @*/ -# define cppReader_getC(pfile) (cppBuffer_get (cppReader_getBufferSafe (pfile))) - -/*@function static int cppReader_peekC (cppReader *) modifies nothing;@*/ -# define cppReader_peekC(pfile) (cppBufPeek (cppReader_getBufferSafe (pfile))) - -/* Move all backslash-newline pairs out of embarrassing places. - Exchange all such pairs following BP - with any potentially-embarrassing characters that follow them. - Potentially-embarrassing characters are / and * - (because a backslash-newline inside a comment delimiter - would cause it not to be recognized). */ - -/*@notfunction@*/ -# define NEWLINE_FIX \ - do { while (cppReader_peekC (pfile) == '\\' && cpp_peekN (pfile, 1) == '\n') { cppReader_forward (pfile, 2); } } while(FALSE) - - /* Same, but assume we've already read the potential '\\' into C. */ -/*@notfunction@*/ -# define NEWLINE_FIX1(C) do { \ - while ((C) == '\\' && cppReader_peekC (pfile) == '\n') { cppReader_forward (pfile, 1); (C) = cppReader_getC (pfile); }\ - } while(0) - -static void parseSetMark (/*@out@*/ struct parse_marker *, - cppReader *); -static void parseClearMark (struct parse_marker *); -static void parseGotoMark (struct parse_marker *, cppReader *); -static void parseMoveMark (struct parse_marker *, cppReader *); - -/* If we have a huge buffer, may need to cache more recent counts */ -static /*@exposed@*/ char *cppLineBase (/*@sef@*/ cppBuffer *); - -static /*@exposed@*/ /*@null@*/ cppBuffer * - cppReader_pushBuffer (cppReader *p_pfile, - /*@owned@*/ /*@null@*/ char *, size_t) - /*@modifies p_pfile@*/ ; - -static void cppReader_appendIncludeChain -(cppReader *p_pfile, - /*@keep@*/ struct file_name_list *p_first, - /*@dependent@*/ struct file_name_list *p_last); - -static void cppReader_macroCleanup (cppBuffer *p_pbuf, cppReader *p_pfile); -static enum cpp_token cppReader_nullUnderflow (/*@unused@*/ cppReader *p_pfile); - -static void cppReader_nullCleanup (/*@unused@*/ cppBuffer *p_pbuf, - /*@unused@*/ cppReader *p_pfile); - -static void cppReader_fileCleanup (cppBuffer *p_pbuf, - /*@unused@*/ cppReader *p_pfile); - -static int cppReader_handleDirective (cppReader *p_pfile); - -static void cppReader_scanBuffer (cppReader *p_pfile); - -# if defined (WIN32) || defined (OS2) && defined (__IBMC__) - -/* -** WIN32 (at least the VC++ include files) does not define mode_t. -*/ - -/*@-incondefs@*/ /*@-czechtypes@*/ -typedef unsigned int mode_t; -/*@=incondefs@*/ /*@=czechtypes@*/ - -# endif - -static int file_size_and_mode (int p_fd, /*@out@*/ mode_t *p_mode_pointer, - /*@out@*/ size_t *p_size_pointer); -static int safe_read (int p_desc, /*@out@*/ char *p_ptr, int p_len); - - -/* -** cppBuffer_isMacro is true if the buffer contains macro expansion. -** (Note that it is false while we're expanding marco *arguments*.) -*/ - -static bool cppBuffer_isMacro (/*@null@*/ cppBuffer *) /*@*/ ; - -static void path_include (cppReader *p_pfile, char *p_path) - /*@modifies p_pfile@*/ ; - -static void initialize_builtins (cppReader *p_pfile) - /*@modifies p_pfile@*/ ; - -static void initialize_char_syntax (struct cppOptions *p_opts) ; - -static int /*@alt void@*/ finclude (cppReader *p_pfile, int p_f, - cstring p_fname, - bool p_system_header_p, - /*@dependent@*/ /*@null@*/ struct file_name_list *p_dirptr); - -static void validate_else (cppReader *p_pfile, cstring p_directive); - -static void conditional_skip (cppReader *p_pfile, int p_skip, - enum node_type p_type, - /*@dependent@*/ /*@null@*/ char *p_control_macro); - -static HOST_WIDE_INT eval_if_expression (cppReader *p_pfile, - char *p_buf, - int p_length); - -static void skip_if_group (cppReader *p_pfile, int p_any); - -static bool comp_def_part (bool p_first, char *p_beg1, int p_len1, - char *p_beg2, int p_len2, bool p_last); - -#ifdef abort -extern void fancy_abort (); -#endif - -static bool redundant_include_p (cppReader *p_pfile, /*@null@*/ cstring p_name); -static bool is_system_include (cppReader *p_pfile, cstring p_filename); - -static /*@observer@*/ /*@null@*/ struct file_name_map * -read_name_map (cppReader *p_pfile, cstring p_dirname); - -static cstring read_filename_string (int p_ch, FILE *p_f); - -static int open_include_file (cppReader *p_pfile, - /*@owned@*/ cstring p_fname, - /*@null@*/ struct file_name_list *p_searchptr); - -static void push_macro_expansion (cppReader *, - /*@owned@*/ char *, size_t, - /*@dependent@*/ HASHNODE *); - -/* Last arg to output_line_command. */ -enum file_change_code { - same_file, enter_file, leave_file -}; - -/* `struct directive' defines one #-directive, including how to handle it. */ - -struct directive { - int length; /* Length of name */ - /*@null@*/ int (*func)(); /* Function to handle directive */ - /*@observer@*/ cstring name; /* Name of directive */ - enum node_type type; /* Code which describes which directive. */ - bool command_reads_line; /* One if rest of line is read by func. */ - bool traditional_comments; /* Nonzero: keep comments if -traditional. */ - bool pass_thru; /* Copy preprocessed directive to output file.*/ -}; - -/* These functions are declared to return int instead of void since they - are going to be placed in a table and some old compilers have trouble with - pointers to functions returning void. */ - -static int do_define (cppReader *, /*@null@*/ struct directive *, - char *, char *); -static int do_defineAux (cppReader *, /*@null@*/ struct directive *, - char *, char *, bool); - -static int do_line (cppReader *, /*@null@*/ struct directive *); -static int do_include (cppReader *, struct directive *, char *, char *); -static int do_undef (cppReader *, struct directive *, char *, char *); -static int do_error (cppReader *, struct directive *, char *, char *); -static int do_pragma (cppReader *, struct directive *, char *, char *); -static int do_ident (cppReader *, struct directive *, char *, char *); -static int do_if (cppReader *, struct directive *, char *, char *); -static int do_xifdef (cppReader *, struct directive *, char *, char *); -static int do_else (cppReader *, struct directive *, char *, char *); -static int do_elif (cppReader *, struct directive *, char *, char *); -static int do_endif (cppReader *, struct directive *, char *, char *); -static int do_warning (cppReader *, struct directive *, char *, char *); - -/* If a buffer's dir field is SELF_DIR_DUMMY, it means the file was found - via the same directory as the file that #included it. */ - -/*@constant observer struct file_name_list *SELF_DIR_DUMMY@*/ -#define SELF_DIR_DUMMY ((struct file_name_list *) (~0)) - -/* #include "file" looks in source file dir, then stack. */ -/* #include just looks in the stack. */ -/* -I directories are added to the end, then the defaults are added. */ - -/*@access cstring@*/ - -static struct default_include { - /*@dependent@*/ /*@observer@*/ cstring fname; /* The name of the directory. */ - int cplusplus; /* Only look here if we're compiling C++. */ - int cxx_aware; /* Includes in this directory don't need to - be wrapped in extern "C" when compiling - C++. */ -} include_defaults_array[] -= { - /* This is the dir for fixincludes. Put it just before - the files that we fix. */ - { GCC_INCLUDE_DIR, 0, 0 }, - { GCC_INCLUDE_DIR2, 0, 0 }, - { cstring_undefined, 0, 0 } -}; - -/*@noaccess cstring@*/ - -/* Here is the actual list of #-directives, most-often-used first. - The initialize_builtins function assumes #define is the very first. */ - -/*@access cstring@*/ - -static struct directive directive_table[] = { - { 6, do_define, "define", T_DEFINE, FALSE, TRUE, FALSE }, - { 5, do_xifdef, "ifdef", T_IFDEF, TRUE, FALSE, FALSE }, - { 6, do_xifdef, "ifndef", T_IFNDEF, TRUE, FALSE, FALSE }, - { 7, do_include, "include", T_INCLUDE, TRUE, FALSE, FALSE }, - { 5, do_endif, "endif", T_ENDIF, TRUE, FALSE, FALSE }, - { 4, do_else, "else", T_ELSE, TRUE, FALSE, FALSE }, - { 2, do_if, "if", T_IF, TRUE, FALSE, FALSE }, - { 4, do_elif, "elif", T_ELIF, TRUE, FALSE, FALSE }, - { 5, do_undef, "undef", T_UNDEF, FALSE, FALSE, FALSE }, - { 5, do_error, "error", T_ERROR, FALSE, FALSE, FALSE }, - { 7, do_warning, "warning", T_WARNING, FALSE, FALSE, FALSE }, - { 6, do_pragma, "pragma", T_PRAGMA, FALSE, FALSE, TRUE}, - { 4, do_line, "line", T_LINE, TRUE, FALSE, FALSE }, - { 5, do_ident, "ident", T_IDENT, TRUE, FALSE, TRUE }, - /* { 8, do_unassert, "unassert", T_UNASSERT, TRUE, FALSE, FALSE }, */ - { -1, 0, "", T_UNUSED, FALSE, FALSE, FALSE }, -}; - -/*@noaccess cstring@*/ -/*@+charint@*/ - -static void -initialize_char_syntax (struct cppOptions *opts) -{ - char i; - - /* - * Set up is_idchar and is_idstart tables. These should be - * faster than saying (is_alpha (c) || c == '_'), etc. - * Set up these things before calling any routines tthat - * refer to them. - */ - - for (i = 'a'; i <= 'z'; i++) { - is_idchar[i - 'a' + 'A'] = TRUE; - is_idchar[(int) i] = TRUE; - is_idstart[i - 'a' + 'A'] = TRUE; - is_idstart[(int) i] = TRUE; - } - - for (i = '0'; i <= '9'; i++) - { - is_idchar[(int) i] = TRUE; - } - - is_idchar['_'] = TRUE; - is_idstart['_'] = TRUE; - is_idchar['$'] = opts->dollars_in_ident; - is_idstart['$'] = opts->dollars_in_ident; - - /* horizontal space table */ - is_hor_space[' '] = TRUE; - is_hor_space['\t'] = TRUE; - is_hor_space['\v'] = TRUE; - is_hor_space['\f'] = TRUE; - is_hor_space['\r'] = TRUE; - - is_space[' '] = TRUE; - is_space['\t'] = TRUE; - is_space['\v'] = TRUE; - is_space['\f'] = TRUE; - is_space['\n'] = TRUE; - is_space['\r'] = TRUE; -} - -bool isIdentifierChar (char c) -{ - return is_idchar[(int) c]; -} - -/* Place into P_PFILE a quoted string representing the string SRC. - Caller must reserve enough space in pfile->token_buffer. */ - -static void -quote_string (cppReader *pfile, char *src) -{ - char c; - - cppReader_putCharQ (pfile, '\"'); - for (;;) - { - switch ((c = *src++)) - { - default: - if (isprint (c)) - cppReader_putCharQ (pfile, c); - else - { - sprintf (cppReader_getPWritten (pfile), "\\%03o", - (unsigned int) c); - cppReader_adjustWritten (pfile, (size_t) 4); - } - /*@switchbreak@*/ break; - - case '\"': - case '\\': - cppReader_putCharQ (pfile, '\\'); - cppReader_putCharQ (pfile, c); - /*@switchbreak@*/ break; - - case '\0': - cppReader_putCharQ (pfile, '\"'); - cppReader_nullTerminateQ (pfile); - return; - } - } -} - -/* Re-allocates PFILE->token_buffer so it will hold at least N more chars. */ - -void -cppReader_growBuffer (cppReader *pfile, size_t n) -{ - size_t old_written = cppReader_getWritten (pfile); - pfile->token_buffer_size = n + 2 * pfile->token_buffer_size; - pfile->token_buffer = (char *) - drealloc (pfile->token_buffer, pfile->token_buffer_size); - cppReader_setWritten (pfile, old_written); -} - -/* - * process a given definition string, for initialization - * If STR is just an identifier, define it with value 1. - * If STR has anything after the identifier, then it should - * be identifier=definition. - */ - -void -cppReader_define (cppReader *pfile, char *str) -{ - char *buf = NULL; - char *p = str; - - DPRINTF (("Cpp reader define: %s", str)); - - if (!is_idstart[(int) *p]) - { - DPRINTF (("ERROR 1")); - cppReader_error (pfile, - message ("Malformed option `-D%s'", - cstring_fromChars (str))); - - return; - } - - p++; - - DPRINTF (("Here 2")); - - while (is_idchar[(int) *p]) - { - p++; - } - - if (*p == '(') { - p++; - while (*p != ')' && *p != '\0') { - p++; - } - - if (*p == ')') { - p++; - } else { - cppReader_error - (pfile, - message ("Malformed option: -D%s (no closing parenthesis)", - cstring_fromChars (str))); - } - } - - DPRINTF (("Here 2")); - - if (*p == '\0') - { - buf = (char *) dmalloc (size_fromInt (p - str + 4)); - strcpy ((char *) buf, str); - strcat ((char *) buf, " 1"); - } - else if (*p != '=') - { - DPRINTF (("ERROR 2")); - cppReader_error (pfile, - message ("Malformed option: -D%s (expected '=', found '%c')", - cstring_fromChars (str), - *p)); - return; - } - else - { - char *q; - /* Copy the entire option so we can modify it. */ - DPRINTF (("Copying...")); - buf = (char *) dmalloc (2 * strlen (str) + 1); - strncpy (buf, str, size_fromInt (p - str)); - - /* Change the = to a space. */ - buf[p - str] = ' '; - /* Scan for any backslash-newline and remove it. */ - p++; - q = &buf[p - str]; - - while (*p != '\0') - { - if (*p == '\\' && p[1] == '\n') - p += 2; - else - *q++ = *p++; - } - - DPRINTF (("Here we are...")); - *q = '\0'; - } - - llassert (buf != NULL); - DPRINTF (("Do define: %s / %ld", buf, size_toLong (strlen (buf)))); - (void) do_define (pfile, NULL, buf, buf + strlen (buf)); - sfree (buf); -} - -/* Append a chain of `struct file_name_list's - to the end of the main include chain. - FIRST is the beginning of the chain to append, and LAST is the end. */ - -void -cppReader_appendIncludeChain (cppReader *pfile, - struct file_name_list *first, - struct file_name_list *last) -{ - struct cppOptions *opts = CPPOPTIONS (pfile); - struct file_name_list *dir; - - if (first == NULL || last == NULL) - { - return; - } - - if (opts->include == 0) - { - opts->include = first; - } - else - { - llassert (opts->last_include->next == NULL); - opts->last_include->next = first; - } - - if (opts->first_bracket_include == 0) - { - opts->first_bracket_include = first; - - for (dir = first; ; dir = dir->next) { - int len = cstring_length (dir->fname) + INCLUDE_LEN_FUDGE; - if (len > pfile->max_include_len) - pfile->max_include_len = len; - if (dir == last) - break; - } - } - - llassert (last->next == NULL); - /* last->next = NULL; */ - opts->last_include = last; -} - -static /*@unused@*/ void -cppReader_showIncludeChain (cppReader *pfile) -{ - struct file_name_list *dirs = CPPOPTIONS (pfile)->include; - - if (dirs != NULL) - { - while (dirs != NULL) - { - fprintf (stderr, "*%s*:", cstring_toCharsSafe (dirs->fname)); - dirs = dirs->next; - } - - fprintf (stderr, "\n"); - } - else - { - fprintf (stderr, "No includes\n"); - } -} - -void -cppReader_addIncludeChain (cppReader *pfile, struct file_name_list *dir) -{ - struct cppOptions *opts = CPPOPTIONS (pfile); - - if (dir == 0) - { - return; - } - - if (opts->include == 0) - { - opts->include = dir; - } - else - { - llassert (opts->last_include->next == NULL); - opts->last_include->next = dir; - } - - if (opts->first_bracket_include == 0) - { - int len = cstring_length (dir->fname) + INCLUDE_LEN_FUDGE; - opts->first_bracket_include = dir; - if (len > pfile->max_include_len) - { - pfile->max_include_len = len; - } - } - - dir->next = NULL; - opts->last_include = dir; - /* cppReader_showIncludeChain (pfile); */ -} - -/* Given a colon-separated list of file names PATH, - add all the names to the search path for include files. */ - -static void -path_include (cppReader *pfile, char *path) -{ - char *p; - -#ifdef __CYGWIN32__ - char *win32temp; - - /* if we have a posix path list, convert to win32 path list */ - win32temp = (char *) dmalloc /*@i4@*/ - (cygwin32_posix_to_win32_path_list_buf_size (path)); - cygwin32_posix_to_win32_path_list (path, win32temp); - path = win32temp; -#endif - - p = path; - - if (*p != '\0') - while (1) { - char *q = p; - char *name; - struct file_name_list *dirtmp; - - /* Find the end of this name. */ - while (*q != '\0' && *q != PATH_SEPARATOR) - { - q++; - } - - if (p == q) - { - /* An empty name in the path stands for the current directory. */ - name = (char *) dmalloc ((size_t) 2); - name[0] = '.'; - name[1] = '\0'; - } - else - { - /* Otherwise use the directory that is named. */ - name = (char *) dmalloc (size_fromInt (q - p + 1)); - memcpy (name, p, size_fromInt (q - p)); - name[q - p] = '\0'; - } - - dirtmp = (struct file_name_list *) dmalloc (sizeof (*dirtmp)); - dirtmp->next = 0; /* New one goes on the end */ - dirtmp->control_macro = 0; - dirtmp->c_system_include_path = 0; - dirtmp->fname = cstring_fromChars (name); - dirtmp->got_name_map = 0; - cppReader_addIncludeChain (pfile, dirtmp); - - /* Advance past this name. */ - p = q; - if (*p == '\0') - break; - /* Skip the colon. */ - p++; - } -} - -void -cppOptions_init (cppOptions *opts) -{ - memset ((char *) opts, 0, sizeof *opts); - assertSet (opts); - - opts->in_fname = NULL; - opts->out_fname = NULL; - - /* Initialize is_idchar to allow $. */ - opts->dollars_in_ident = TRUE; - - opts->no_line_commands = 0; - opts->no_trigraphs = TRUE; - opts->put_out_comments = 1; - opts->print_include_names = 0; - opts->dump_macros = DUMP_DEFINITIONS; /* DUMP_NONE; */ - opts->no_output = 0; - opts->cplusplus = 0; - - opts->cplusplus_comments = 1; - opts->verbose = 0; - opts->lang_asm = 0; - opts->for_lint = 0; - opts->chill = 0; - opts->pedantic_errors = 0; - opts->inhibit_warnings = 0; - opts->warn_comments = 0; - opts->warnings_are_errors = 0; - - initialize_char_syntax (opts); -} - -enum cpp_token -cppReader_nullUnderflow (/*@unused@*/ cppReader *pfile) -{ - return CPP_EOF; -} - -void -cppReader_nullCleanup (/*@unused@*/ cppBuffer *pbuf, - /*@unused@*/ cppReader *pfile) -{ - ; -} - -void -cppReader_macroCleanup (cppBuffer *pbuf, /*@unused@*/ cppReader *pfile) -{ - HASHNODE *macro = pbuf->hnode; - - if (macro->type == T_DISABLED) - { - macro->type = T_MACRO; - } - - if (macro->type != T_MACRO || pbuf->buf != macro->value.defn->expansion) - { - sfree (pbuf->buf); - pbuf->buf = NULL; - } -} - -void -cppReader_fileCleanup (cppBuffer *pbuf, /*@unused@*/ cppReader *pfile) -{ - if (pbuf->buf != NULL) - { - sfree (pbuf->buf); - pbuf->buf = NULL; - } -} - -/* Assuming we have read '/'. - If this is the start of a comment (followed by '*' or '/'), - skip to the end of the comment, and return ' '. - Return EOF if we reached the end of file before the end of the comment. - If not the start of a comment, return '/'. */ - -static int -skip_comment (cppReader *pfile, /*@null@*/ long *linep) -{ - int c = 0; - - llassert (pfile->buffer != NULL); - llassert (pfile->buffer->cur != NULL); - - while (cppReader_peekC (pfile) == '\\' && cpp_peekN (pfile, 1) == '\n') - { - if (linep != NULL) - { - (*linep)++; - } - - cppReader_forward (pfile, 2); - } - - if (cppReader_peekC (pfile) == '*') - { - cppReader_forward (pfile, 1); - - for (;;) - { - int prev_c = c; - c = cppReader_getC (pfile); - - if (c == EOF) - { - return EOF; - } - - while (c == (int) '\\' && cppReader_peekC (pfile) == (int) '\n') - { - if (linep != NULL ) - { - (*linep)++; - } - - cppReader_forward (pfile, 1), c = cppReader_getC (pfile); - } - - if (prev_c == (int) '*' && c == (int) '/') - { - return (int) ' '; - } - - if (c == (int) '\n' && (linep != NULL)) - { - (*linep)++; - } - } - } - else if (cppReader_peekC (pfile) == '/' - && CPPOPTIONS (pfile)->cplusplus_comments) - { - cppReader_forward (pfile, 1); - - for (;;) - { - c = cppReader_getC (pfile); - - if (c == EOF) - { - /* Allow hash comment to be terminated by EOF. */ - return (int) ' '; - } - - while (c == (int) '\\' && cppReader_peekC (pfile) == '\n') - { - cppReader_forward (pfile, 1); - c = cppReader_getC (pfile); - - if (linep != NULL) - { - (*linep)++; - } - } - - if (c == (int) '\n') - { - /* Don't consider final '\n' to be part of comment. */ - cppReader_forward (pfile, -1); - return (int) ' '; - } - } - } - else - { - return (int) '/'; - } -} - -/* Skip whitespace \-newline and comments. Does not macro-expand. */ -int /*@alt void@*/ -cppSkipHspace (cppReader *pfile) -{ - int nspaces = 0; - - while (TRUE) - { - int c; - - llassert (pfile->buffer != NULL); - - c = cppReader_peekC (pfile); - - if (c == EOF) - { - return 0; /* FIXME */ - } - - if (is_hor_space[c]) - { - if ((c == '\f' || c == '\v') && cppReader_isPedantic (pfile)) - cppReader_pedwarn (pfile, - message ("%s in preprocessing directive", - c == '\f' - ? cstring_makeLiteralTemp ("formfeed") - : cstring_makeLiteralTemp ("vertical tab"))); - - nspaces++; - cppReader_forward (pfile, 1); - } - else if (c == '/') - { - cppReader_forward (pfile, 1); - c = skip_comment (pfile, NULL); - - if (c == '/') - { - cppReader_forward (pfile, -1); - } - - if (c == EOF || c == '/') - { - return nspaces; - } - } - else if (c == '\\' && cpp_peekN (pfile, 1) == '\n') - { - cppReader_forward (pfile, 2); - } - else if (c == '@' && CPPBUFFER (pfile)->has_escapes - && is_hor_space [cpp_peekN (pfile, 1)]) - { - cppReader_forward (pfile, 2); - } - else - { - return nspaces; - } - } -} - -/* Read the rest of the current line. - The line is appended to PFILE's output buffer. */ - -static void -copy_rest_of_line (cppReader *pfile) -{ - struct cppOptions *opts = CPPOPTIONS (pfile); - - for (;;) - { - int c; - int nextc; - - llassert (pfile->buffer != NULL); - - c = cppReader_getC (pfile); - switch (c) - { - case EOF: - goto end_directive; - case '\\': - if (cppReader_peekC (pfile) == '\n') - { - cppReader_forward (pfile, 1); - continue; - } - - /*@fallthrough@*/ case '\'': case '\"': - goto scan_directive_token; - - case '/': - nextc = cppReader_peekC (pfile); - - /* - ** was (opts->cplusplus_comments && nextc == '*') - ** yoikes! - */ - - if (nextc == '*' - || (opts->cplusplus_comments && nextc == '/')) - { - goto scan_directive_token; - } - /*@switchbreak@*/ break; - case '\f': - case '\v': - if (cppReader_isPedantic (pfile)) - cppReader_pedwarn (pfile, - message ("%s in preprocessing directive", - c == '\f' - ? cstring_makeLiteralTemp ("formfeed") - : cstring_makeLiteralTemp ("vertical tab"))); - /*@switchbreak@*/ break; - - case '\n': - cppReader_forward (pfile, -1); - goto end_directive; - scan_directive_token: - cppReader_forward (pfile, -1); - (void) cppGetToken (pfile); - continue; - } - cppReader_putChar (pfile, c); - } -end_directive: ; - cppReader_nullTerminate (pfile); -} - -void -cppReader_skipRestOfLine (cppReader *pfile) -{ - size_t old = cppReader_getWritten (pfile); - copy_rest_of_line (pfile); - cppReader_setWritten (pfile, old); -} - -/* Handle a possible # directive. - '#' has already been read. */ - -int -cppReader_handleDirective (cppReader *pfile) -{ - int c; - struct directive *kt = NULL; - int ident_length; - size_t after_ident = 0; - char *ident, *line_end = NULL; - size_t old_written = cppReader_getWritten (pfile); - int nspaces = cppSkipHspace (pfile); - - c = cppReader_peekC (pfile); - - if (c >= '0' && c <= '9') - { - /* Handle # followed by a line number. */ - if (cppReader_isPedantic (pfile)) - { - cppReader_pedwarnLit - (pfile, - cstring_makeLiteralTemp ("`#' followed by integer")); - } - - (void) do_line (pfile, NULL); - goto done_a_directive; - } - - - /* Now find the directive name. */ - - cppReader_putChar (pfile, '#'); - - parse_name (pfile, cppReader_getC (pfile)); - - llassert (pfile->token_buffer != NULL); - ident = pfile->token_buffer + old_written + 1; - - ident_length = cppReader_getPWritten (pfile) - ident; - - if (ident_length == 0 && cppReader_peekC (pfile) == '\n') - { - /* A line of just `#' becomes blank. */ - return 1; - } - - for (kt = directive_table; ; kt++) - { - if (kt->length <= 0) - { - return 0; /* goto not_a_directive; */ - } - - if (kt->length == ident_length - && (cstring_equalPrefix (kt->name, ident))) - { - break; - } - } - - if (kt->command_reads_line) - { - after_ident = 0; - } - else - { - /* Nonzero means do not delete comments within the directive. - #define needs this when -traditional. */ - bool comments = 1; /*cppReader_isTraditional (pfile) && kt->traditional_comments; */ - int save_put_out_comments = CPPOPTIONS (pfile)->put_out_comments; - CPPOPTIONS (pfile)->put_out_comments = comments; - after_ident = cppReader_getWritten (pfile); - copy_rest_of_line (pfile); - CPPOPTIONS (pfile)->put_out_comments = save_put_out_comments; - } - - - /* For #pragma and #define, we may want to pass through the directive. - Other directives may create output, but we don't want the directive - itself out, so we pop it now. For example #include may write a #line - command (see comment in do_include), and conditionals may emit - #failed ... #endfailed stuff. But note that popping the buffer - means the parameters to kt->func may point after pfile->limit - so these parameters are invalid as soon as something gets appended - to the token_buffer. */ - - line_end = cppReader_getPWritten (pfile); - - - if (!kt->pass_thru && kt->type != T_DEFINE) - { - cppReader_setWritten (pfile, old_written); - } - - llassert (pfile->token_buffer != NULL); - - /* was kt->pass_thru || */ - - if (kt->type == T_DEFINE - && cpp_shouldCheckMacro (pfile, pfile->token_buffer + old_written)) - { - char *p = pfile->token_buffer + old_written; - - /* - ** Still need to record value for preprocessing, so - ** #ifdef's, etc. using the value behave correctly. - */ - - (void) do_defineAux (pfile, kt, - pfile->token_buffer + after_ident, - line_end, - TRUE); - - if (*p == '#') - { - *p = ' '; - } - - SKIP_WHITE_SPACE (p); - - llassert (*p == 'd'); - *p++ = LLMRCODE[0]; - - llassert (*p == 'e'); - *p++ = LLMRCODE[1]; - - llassert (*p == 'f'); - *p++ = LLMRCODE[2]; - - llassert (*p == 'i'); - *p++ = LLMRCODE[3]; - - llassert (*p == 'n'); - *p++ = LLMRCODE[4]; - - llassert (*p == 'e'); - - /* - ** This is way-bogus. We use the last char to record the number of - ** spaces. Its too hard to get them back into the input stream. - */ - - if (nspaces > 9) nspaces = 9; - - *p++ = '0' + nspaces; - - return 0; /* not_a_directive */ - } - else if (kt->pass_thru) - { - /* Just leave the entire #define in the output stack. */ - return 0; /* not_a_directive */ - - } - else if (kt->type == T_DEFINE - && CPPOPTIONS (pfile)->dump_macros == DUMP_NAMES) - { - char *p = pfile->token_buffer + old_written + 7; /* Skip "#define". */ - SKIP_WHITE_SPACE (p); - - while (is_idchar[(int) *p]) - { - p++; - } - - pfile->limit = p; - cppReader_putChar (pfile, '\n'); - } - else if (kt->type == T_DEFINE) - { - cppReader_setWritten (pfile, old_written); - } - else - { - ; - } - -done_a_directive: - if (kt == NULL) { - return 1; - } else { - llassert (kt->func != NULL); - (void) (kt->func) (pfile, kt, pfile->token_buffer + after_ident, line_end); - return 1; - } -} - -/* Pass a directive through to the output file. - BUF points to the contents of the directive, as a contiguous string. - LIMIT points to the first character past the end of the directive. - KEYWORD is the keyword-table entry for the directive. */ - -static void -pass_thru_directive (char *buf, char *limit, - cppReader *pfile, - struct directive *keyword) -{ - int keyword_length = keyword->length; - - cppReader_reserve (pfile, - size_fromInt (2 + keyword_length + (limit - buf))); - cppReader_putCharQ (pfile, '#'); - /*@-observertrans@*/ - cppReader_putStrN (pfile, cstring_toCharsSafe (keyword->name), - size_fromInt (keyword_length)); - /*:=observertrans@*/ - - if (limit != buf && buf[0] != ' ') - { - /* Was a bug, since reserve only used 1 + ... */ - cppReader_putCharQ (pfile, ' '); - } - - cppReader_putStrN (pfile, buf, size_fromInt (limit - buf)); -} - -/* Read a replacement list for a macro with parameters. - Build the DEFINITION structure. - Reads characters of text starting at BUF until END. - ARGLIST specifies the formal parameters to look for - in the text of the definition; NARGS is the number of args - in that list, or -1 for a macro name that wants no argument list. - MACRONAME is the macro name itself (so we can avoid recursive expansion) - and NAMELEN is its length in characters. - - Note that comments, backslash-newlines, and leading white space - have already been deleted from the argument. */ - -static DEFINITION * -collect_expansion (cppReader *pfile, char *buf, char *limit, - int nargs, /*@null@*/ struct arglist *arglist) -{ - DEFINITION *defn; - char *p, *lastp, *exp_p; - struct reflist *endpat = NULL; - /* Pointer to first nonspace after last ## seen. */ - char *concat = 0; - /* Pointer to first nonspace after last single-# seen. */ - char *stringify = 0; - size_t maxsize; - char expected_delimiter = '\0'; - - - /* Scan thru the replacement list, ignoring comments and quoted - strings, picking up on the macro calls. It does a linear search - thru the arg list on every potential symbol. Profiling might say - that something smarter should happen. */ - - if (limit < buf) - abort (); - - /* Find the beginning of the trailing whitespace. */ - p = buf; - - while (p < limit && is_space[(int) limit[-1]]) - { - limit--; - } - - /* Allocate space for the text in the macro definition. - Leading and trailing whitespace chars need 2 bytes each. - Each other input char may or may not need 1 byte, - so this is an upper bound. The extra 5 are for invented - leading and trailing newline-marker and final null. */ - maxsize = (sizeof (*defn) + (limit - p) + 5); - - /* Occurrences of '@' get doubled, so allocate extra space for them. */ - while (p < limit) - { - if (*p++ == '@') - { - maxsize++; - } - } - - defn = (DEFINITION *) dmalloc (maxsize); - defn->noExpand = FALSE; - defn->file = NULL; - defn->pattern = NULL; - defn->nargs = nargs; - defn->predefined = NULL; - - exp_p = defn->expansion = (char *) defn + sizeof (*defn); - - defn->line = 0; - defn->rest_args = NULL; - defn->args.argnames = NULL; - - lastp = exp_p; - - p = buf; - - /* Add one initial space escape-marker to prevent accidental - token-pasting (often removed by macroexpand). */ - *exp_p++ = '@'; - *exp_p++ = ' '; - - if (limit - p >= 2 && p[0] == '#' && p[1] == '#') { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("`##' at start of macro definition")); - p += 2; - } - - /* Process the main body of the definition. */ - while (p < limit) { - int skipped_arg = 0; - register char c = *p++; - - *exp_p++ = c; - - if (!cppReader_isTraditional (pfile)) { - switch (c) { - case '\'': - case '\"': - if (expected_delimiter != '\0') - { - if (c == expected_delimiter) - expected_delimiter = '\0'; - } - else - { - expected_delimiter = c; - } - /*@switchbreak@*/ break; - - case '\\': - if (p < limit && (expected_delimiter != '\0')) - { - /* In a string, backslash goes through - and makes next char ordinary. */ - *exp_p++ = *p++; - } - /*@switchbreak@*/ break; - - case '@': - /* An '@' in a string or character constant stands for itself, - and does not need to be escaped. */ - if (expected_delimiter == '\0') - { - *exp_p++ = c; - } - - /*@switchbreak@*/ break; - - case '#': - /* # is ordinary inside a string. */ - if (expected_delimiter != '\0') - { - /*@switchbreak@*/ break; - } - - if (p < limit && *p == '#') { - /* ##: concatenate preceding and following tokens. */ - /* Take out the first #, discard preceding whitespace. */ - exp_p--; - - /*@-usedef@*/ - while (exp_p > lastp && is_hor_space[(int) exp_p[-1]]) - { - --exp_p; - } - /*@=usedef@*/ - - /* Skip the second #. */ - p++; - /* Discard following whitespace. */ - SKIP_WHITE_SPACE (p); - concat = p; - if (p == limit) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("`##' at end of macro definition")); - } - } else if (nargs >= 0) { - /* Single #: stringify following argument ref. - Don't leave the # in the expansion. */ - exp_p--; - SKIP_WHITE_SPACE (p); - if (p == limit || ! is_idstart[(int) *p] - || (*p == 'L' && p + 1 < limit && (p[1] == '\'' || p[1] == '"'))) - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("`#' operator is not followed by a macro argument name")); - else - stringify = p; - } else { - ; /* BADBRANCH; */ - } - - /*@switchbreak@*/ break; - } - } else { - /* In -traditional mode, recognize arguments inside strings and - and character constants, and ignore special properties of #. - Arguments inside strings are considered "stringified", but no - extra quote marks are supplied. */ - switch (c) { - case '\'': - case '\"': - if (expected_delimiter != '\0') { - if (c == expected_delimiter) - expected_delimiter = '\0'; - } else - expected_delimiter = c; - /*@switchbreak@*/ break; - - case '\\': - /* Backslash quotes delimiters and itself, but not macro args. */ - if (expected_delimiter != '\0' && p < limit - && (*p == expected_delimiter || *p == '\\')) { - *exp_p++ = *p++; - continue; - } - /*@switchbreak@*/ break; - - case '/': - if (expected_delimiter != '\0') /* No comments inside strings. */ - /*@switchbreak@*/ break; - if (*p == '*') { - /* If we find a comment that wasn't removed by cppReader_handleDirective, - this must be -traditional. So replace the comment with - nothing at all. */ - exp_p--; - p += 1; - while (p < limit && !(p[-2] == '*' && p[-1] == '/')) - { - p++; - } - } - /*@switchbreak@*/ break; - } - } - - /* Handle the start of a symbol. */ - if (is_idchar[(int) c] && nargs > 0) { - char *id_beg = p - 1; - int id_len; - - --exp_p; - while (p != limit && is_idchar[(int) *p]) - { - p++; - } - - id_len = p - id_beg; - - if (is_idstart[(int) c] - && ! (id_len == 1 && c == 'L' && (*p == '\'' || *p == '"'))) { - register struct arglist *arg; - - for (arg = arglist; arg != NULL; arg = arg->next) { - struct reflist *tpat; - - if (arg->name[0] == c - && arg->length == id_len - && strncmp (arg->name, id_beg, size_fromInt (id_len)) == 0) { - char *p1; - - if (expected_delimiter && CPPOPTIONS (pfile)->warn_stringify) { - if (cppReader_isTraditional (pfile)) { - cppReader_warning (pfile, - message ("macro argument `%x' is stringified.", - cstring_prefix (cstring_fromChars (arg->name), id_len))); - } else { - cppReader_warning (pfile, - message ("macro arg `%x' would be stringified with -traditional.", - cstring_prefix (cstring_fromChars (arg->name), id_len))); - } - } - /* If ANSI, don't actually substitute inside a string. */ - if (!cppReader_isTraditional (pfile) && expected_delimiter) - /*@innerbreak@*/ break; - /* make a pat node for this arg and append it to the end of - the pat list */ - tpat = (struct reflist *) dmalloc (sizeof (*tpat)); - tpat->next = NULL; - tpat->raw_before = (concat == id_beg); - tpat->raw_after = 0; - tpat->rest_args = arg->rest_args; - tpat->stringify = (cppReader_isTraditional (pfile) - ? expected_delimiter != '\0' - : stringify == id_beg); - - if (endpat == NULL) - { - defn->pattern = tpat; - } - else - { - endpat->next = tpat; - /*@-branchstate@*/ - } /*@=branchstate@*/ /* evs 2000 was =branchstate */ - - endpat = tpat; - - tpat->argno = arg->argno; - tpat->nchars = exp_p - lastp; - - p1 = p; - - SKIP_WHITE_SPACE (p1); - - if (p1 + 2 <= limit && p1[0] == '#' && p1[1] == '#') - { - tpat->raw_after = 1; - } - - lastp = exp_p; /* place to start copying from next time */ - skipped_arg = 1; - - /*@innerbreak@*/ break; - } - } - } - - /* If this was not a macro arg, copy it into the expansion. */ - if (skipped_arg == 0) { - register char *lim1 = p; - p = id_beg; - - while (p != lim1) - { - *exp_p++ = *p++; - } - - if (stringify == id_beg) - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("`#' operator should be followed by a macro argument name")); - } - } - } - - if (!cppReader_isTraditional (pfile) && expected_delimiter == '\0') - { - /* If ANSI, put in a "@ " marker to prevent token pasting. - But not if "inside a string" (which in ANSI mode - happens only for -D option). */ - *exp_p++ = '@'; - *exp_p++ = ' '; - } - - *exp_p = '\0'; - - defn->length = size_fromInt (exp_p - defn->expansion); - - /* Crash now if we overrun the allocated size. */ - if (defn->length + 1 > maxsize) - { - llfatalbug (cstring_makeLiteral ("Maximum definition size exceeded.")); - } - - return defn; -} - -/* - * special extension string that can be added to the last macro argument to - * allow it to absorb the "rest" of the arguments when expanded. Ex: - * #define wow(a, b...) process (b, a, b) - * { wow (1, 2, 3); } -> { process (2, 3, 1, 2, 3); } - * { wow (one, two); } -> { process (two, one, two); } - * if this "rest_arg" is used with the concat token '##' and if it is not - * supplied then the token attached to with ## will not be outputted. Ex: - * #define wow (a, b...) process (b ## , a, ## b) - * { wow (1, 2); } -> { process (2, 1, 2); } - * { wow (one); } -> { process (one); { - */ - -/*@-readonlytrans@*/ -static char rest_extension[] = "..."; -/*:=readonlytrans@*/ - -/*@notfunction@*/ -#define REST_EXTENSION_LENGTH (sizeof (rest_extension) - 1) - -/* Create a DEFINITION node from a #define directive. Arguments are - as for do_define. */ - -static /*@null@*/ MACRODEF -create_definition (char *buf, char *limit, - cppReader *pfile, bool predefinition, - bool noExpand) -{ - char *bp; /* temp ptr into input buffer */ - char *symname; /* remember where symbol name starts */ - int sym_length; /* and how long it is */ - int rest_args = 0; /* really int! */ - int line; - int col; - cstring file = (CPPBUFFER (pfile) != NULL) - ? CPPBUFFER (pfile)->nominal_fname : cstring_makeLiteralTemp (""); - DEFINITION *defn; - int arglengths = 0; /* Accumulate lengths of arg names - plus number of args. */ - MACRODEF mdef; - - cppBuffer_lineAndColumn (CPPBUFFER (pfile), &line, &col); - - bp = buf; - - while (is_hor_space[(int) *bp]) - { - bp++; - } - - symname = bp; /* remember where it starts */ - - sym_length = cppReader_checkMacroName (pfile, bp, cstring_makeLiteralTemp ("macro")); - - bp += sym_length; - - /* Lossage will occur if identifiers or control keywords are broken - across lines using backslash. This is not the right place to take - care of that. */ - - if (*bp == '(') { - struct arglist *arg_ptrs = NULL; - int argno = 0; - - bp++; /* skip '(' */ - SKIP_WHITE_SPACE (bp); - - /* Loop over macro argument names. */ - while (*bp != ')') - { - struct arglist *temp = (struct arglist *) dmalloc (sizeof (*temp)); - temp->name = bp; - temp->next = arg_ptrs; - temp->argno = argno++; - temp->rest_args = 0; - - arg_ptrs = temp; - - if (rest_args != 0) - { - cppReader_pedwarn (pfile, - message ("another parameter follows `%s'", - cstring_fromChars (rest_extension))); - } - - if (!is_idstart[(int) *bp]) - { - cppReader_pedwarnLit (pfile, - cstring_makeLiteralTemp ("invalid character in macro parameter name")); - } - - /* Find the end of the arg name. */ - while (is_idchar[(int) *bp]) - { - bp++; - /* do we have a "special" rest-args extension here? */ - if (limit - bp > size_toInt (REST_EXTENSION_LENGTH) - && strncmp (rest_extension, bp, REST_EXTENSION_LENGTH) == 0) - { - rest_args = 1; - temp->rest_args = 1; - /*@innerbreak@*/ break; - } - } - - temp->length = bp - temp->name; - - if (rest_args != 0) - { - bp += REST_EXTENSION_LENGTH; - } - - arglengths += temp->length + 2; - SKIP_WHITE_SPACE (bp); - - if (temp->length == 0 || (*bp != ',' && *bp != ')')) { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("Parameter list for #define is not parseable")); - goto nope; - } - - if (*bp == ',') { - bp++; - SKIP_WHITE_SPACE (bp); - } - if (bp >= limit) { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("unterminated parameter list in `#define'")); - goto nope; - } - { - struct arglist *otemp; - - for (otemp = temp->next; otemp != NULL; otemp = otemp->next) - { - if (temp->length == otemp->length && - strncmp (temp->name, otemp->name, size_fromInt (temp->length)) == 0) { - cstring name = cstring_copyLength (temp->name, temp->length); - cppReader_error (pfile, - message ("duplicate argument name `%x' in `#define'", name)); - goto nope; - } - } - } - } - - ++bp; /* skip paren */ - SKIP_WHITE_SPACE (bp); - /* now everything from bp before limit is the definition. */ - defn = collect_expansion (pfile, bp, limit, argno, arg_ptrs); - defn->rest_args = rest_args; - - /* Now set defn->args.argnames to the result of concatenating - the argument names in reverse order - with comma-space between them. */ - defn->args.argnames = (char *) dmalloc (size_fromInt (arglengths + 1)); - - { - struct arglist *temp; - int i = 0; - for (temp = arg_ptrs; temp != NULL; temp = temp->next) { - memcpy (&defn->args.argnames[i], temp->name, size_fromInt (temp->length)); - i += temp->length; - if (temp->next != 0) { - defn->args.argnames[i++] = ','; - defn->args.argnames[i++] = ' '; - } - } - - defn->args.argnames[i] = '\0'; - } - - sfree (arg_ptrs); - } else { - /* Simple expansion or empty definition. */ - - if (bp < limit) - { - if (is_hor_space[(int) *bp]) { - bp++; - SKIP_WHITE_SPACE (bp); - } else { - switch (*bp) { - case '!': case '"': case '#': case '%': case '&': case '\'': - case ')': case '*': case '+': case ',': case '-': case '.': - case '/': case ':': case ';': case '<': case '=': case '>': - case '?': case '[': case '\\': case ']': case '^': case '{': - case '|': case '}': case '~': - cppReader_warning (pfile, - message ("Missing white space after #define %x", - cstring_prefix (cstring_fromChars (symname), - sym_length))); - break; - - default: - cppReader_pedwarn (pfile, - message ("Missing white space after #define %x", - cstring_prefix (cstring_fromChars (symname), - sym_length))); - break; - } - } - } - /* now everything from bp before limit is the definition. */ - defn = collect_expansion (pfile, bp, limit, -1, NULL); - defn->args.argnames = mstring_createEmpty (); - } - - defn->noExpand = noExpand; - DPRINTF (("No expand: %d", noExpand)); - - defn->line = line; - - /* not: llassert (cstring_isUndefined (defn->file)); */ - defn->file = file; - - /* OP is null if this is a predefinition */ - defn->predefined = predefinition; - mdef.defn = defn; - mdef.symnam = symname; - mdef.symlen = sym_length; - - return mdef; - -nope: - mdef.defn = NULL; - mdef.symnam = NULL; - return mdef; -} - -/* Check a purported macro name SYMNAME, and yield its length. - USAGE is the kind of name this is intended for. */ - -int cppReader_checkMacroName (cppReader *pfile, - char *symname, - cstring usage) -{ - char *p; - size_t sym_length; - - for (p = symname; is_idchar[(int) *p]; p++) - { - ; - } - - sym_length = size_fromInt (p - symname); - - if (sym_length == 0 - || (sym_length == 1 && *symname == 'L' && (*p == '\'' || *p == '"'))) - cppReader_error (pfile, message ("invalid %s name", usage)); - else if (!is_idstart[(int) *symname]) - { - char *msg = (char *) dmalloc (sym_length + 1); - memcpy (msg, symname, sym_length); - msg[sym_length] = '\0'; - cppReader_error (pfile, message ("invalid %s name `%s'", usage, - cstring_fromChars (msg))); - sfree (msg); - } - else - { - if ((strncmp (symname, "defined", 7) == 0) && sym_length == 7) - { - cppReader_error (pfile, message ("invalid %s name `defined'", usage)); - } - } - - return size_toInt (sym_length); -} - -/* Return zero if two DEFINITIONs are isomorphic. */ - -static bool -compare_defs (DEFINITION *d1, DEFINITION *d2) -{ - register struct reflist *a1, *a2; - register char *p1 = d1->expansion; - register char *p2 = d2->expansion; - bool first = TRUE; - - if (d1->nargs != d2->nargs) - { - return TRUE; - } - - llassert (d1->args.argnames != NULL); - llassert (d2->args.argnames != NULL); - - if (strcmp ((char *)d1->args.argnames, (char *)d2->args.argnames) != 0) - { - return TRUE; - } - - for (a1 = d1->pattern, a2 = d2->pattern; - (a1 != NULL) && (a2 != NULL); - a1 = a1->next, a2 = a2->next) { - if (!((a1->nchars == a2->nchars - && (strncmp (p1, p2, size_fromInt (a1->nchars)) == 0)) - || ! comp_def_part (first, p1, a1->nchars, p2, a2->nchars, 0)) - || a1->argno != a2->argno - || a1->stringify != a2->stringify - || a1->raw_before != a2->raw_before - || a1->raw_after != a2->raw_after) - return TRUE; - first = 0; - p1 += a1->nchars; - p2 += a2->nchars; - } - if (a1 != a2) - return TRUE; - - if (comp_def_part (first, p1, d1->length - (p1 - d1->expansion), - p2, d2->length - (p2 - d2->expansion), 1)) - return TRUE; - - return FALSE; -} - -/* Return TRUE if two parts of two macro definitions are effectively different. - One of the parts starts at BEG1 and has LEN1 chars; - the other has LEN2 chars at BEG2. - Any sequence of whitespace matches any other sequence of whitespace. - FIRST means these parts are the first of a macro definition; - so ignore leading whitespace entirely. - LAST means these parts are the last of a macro definition; - so ignore trailing whitespace entirely. */ - -static bool -comp_def_part (bool first, char *beg1, int len1, char *beg2, int len2, bool last) -{ - char *end1 = beg1 + len1; - char *end2 = beg2 + len2; - - if (first) { - while (beg1 != end1 && is_space[(int) *beg1]) { beg1++; } - while (beg2 != end2 && is_space[(int) *beg2]) { beg2++; } - } - if (last) { - while (beg1 != end1 && is_space[(int) end1[-1]]) { end1--; } - while (beg2 != end2 && is_space[(int) end2[-1]]) { end2--; } - } - while (beg1 != end1 && beg2 != end2) { - if (is_space[(int) *beg1] && is_space[(int) *beg2]) { - while (beg1 != end1 && is_space[(int) *beg1]) { beg1++; } - while (beg2 != end2 && is_space[(int) *beg2]) { beg2++; } - } else if (*beg1 == *beg2) { - beg1++; beg2++; - } else break; - } - return (beg1 != end1) || (beg2 != end2); -} - -/* Process a #define command. - BUF points to the contents of the #define command, as a contiguous string. - LIMIT points to the first character past the end of the definition. - KEYWORD is the keyword-table entry for #define, - or NULL for a "predefined" macro. */ - -static int -do_defineAux (cppReader *pfile, struct directive *keyword, - char *buf, char *limit, bool noExpand) -{ - int hashcode; - MACRODEF mdef; - HASHNODE *hp; - - DPRINTF (("Define aux: %d", noExpand)); - - mdef = create_definition (buf, limit, pfile, keyword == NULL, noExpand); - - if (mdef.defn == 0) - goto nope; - - hashcode = hashf (mdef.symnam, mdef.symlen, CPP_HASHSIZE); - - DPRINTF (("Macro: %s / %s", - cstring_copyLength (mdef.symnam, mdef.symlen), - bool_unparse (noExpand))); - - if ((hp = cppReader_lookup (mdef.symnam, mdef.symlen, hashcode)) != NULL) - { - bool ok = FALSE; - - /* Redefining a precompiled key is ok. */ - if (hp->type == T_PCSTRING) - ok = TRUE; - /* Redefining a macro is ok if the definitions are the same. */ - else if (hp->type == T_MACRO) - ok = !compare_defs (mdef.defn, hp->value.defn); - /* Redefining a constant is ok with -D. */ - else if (hp->type == T_CONST) - ok = !CPPOPTIONS (pfile)->done_initializing; - else { - BADBRANCH; - } - - /* Print the warning if it's not ok. */ - if (!ok) - { - /* - ** If we are passing through #define and #undef directives, do - ** that for this re-definition now. - */ - - if (CPPOPTIONS (pfile)->debug_output && (keyword != NULL)) - { - /* llassert (keyword != NULL); */ - pass_thru_directive (buf, limit, pfile, keyword); - } - - cpp_setLocation (pfile); - - if (hp->type == T_MACRO) - { - if (hp->value.defn->noExpand) - { - ; /* error will be reported checking macros */ - } - else - { - genppllerrorhint - (FLG_MACROREDEF, - message ("Macro %q already defined", - cstring_copyLength (mdef.symnam, mdef.symlen)), - message ("%q: Previous definition of %q", - fileloc_unparseRaw (hp->value.defn->file, - (int) hp->value.defn->line), - cstring_copyLength (mdef.symnam, mdef.symlen))); - } - } - else - { - genppllerror (FLG_MACROREDEF, - message ("Macro %q already defined", - cstring_copyLength (mdef.symnam, - mdef.symlen))); - - } - } - - /* Replace the old definition. */ - hp->type = T_MACRO; - hp->value.defn = mdef.defn; - } - else - { - /* - ** If we are passing through #define and #undef directives, do - ** that for this new definition now. - */ - - HASHNODE *hn; - - if (CPPOPTIONS (pfile)->debug_output && (keyword != NULL)) - { - pass_thru_directive (buf, limit, pfile, keyword); - } - - DPRINTF (("Define macro: %s / %d", - mdef.symnam, mdef.defn->noExpand)); - - hn = cppReader_installMacro (mdef.symnam, mdef.symlen, mdef.defn, hashcode); - /*@-branchstate@*/ - } /*@=branchstate@*/ - - return 0; - -nope: - - return 1; -} - -static int -do_define (cppReader *pfile, struct directive *keyword, - char *buf, char *limit) -{ - DPRINTF (("Regular do define")); - return do_defineAux (pfile, keyword, buf, limit, FALSE); -} - -/* This structure represents one parsed argument in a macro call. - `raw' points to the argument text as written (`raw_length' is its length). - `expanded' points to the argument's macro-expansion - (its length is `expand_length'). - `stringified_length' is the length the argument would have - if stringified. - `use_count' is the number of times this macro arg is substituted - into the macro. If the actual use count exceeds 10, - the value stored is 10. */ - -/* raw and expanded are relative to ARG_BASE */ -/*@notfunction@*/ -#define ARG_BASE ((pfile)->token_buffer) - -struct argdata { - /* Strings relative to pfile->token_buffer */ - long raw; - size_t expanded; - size_t stringified; - int raw_length; - int expand_length; - int stringified_length; - bool newlines; - int use_count; -}; - -/* Allocate a new cppBuffer for PFILE, and push it on the input buffer stack. - If BUFFER != NULL, then use the LENGTH characters in BUFFER - as the new input buffer. - Return the new buffer, or NULL on failure. */ - -/*@null@*/ /*@exposed@*/ cppBuffer * -cppReader_pushBuffer (cppReader *pfile, char *buffer, size_t length) -{ - cppBuffer *buf = cppReader_getBuffer (pfile); - - if (buf == pfile->buffer_stack) - { - cppReader_fatalError - (pfile, - message ("%s: macro or `#include' recursion too deep", - (buf->fname != NULL) - ? buf->fname - : cstring_makeLiteral (""))); - sfreeEventually (buffer); - return NULL; - } - - llassert (buf != NULL); - - buf--; - memset ((char *) buf, 0, sizeof (*buf)); - CPPBUFFER (pfile) = buf; - - buf->if_stack = pfile->if_stack; - buf->cleanup = cppReader_nullCleanup; - buf->underflow = cppReader_nullUnderflow; - buf->buf = buffer; - buf->cur = buf->buf; - - if (buffer != NULL) - { - buf->alimit = buf->rlimit = buffer + length; - } - else - { - buf->alimit = buf->rlimit = NULL; - } - - return buf; -} - -cppBuffer * -cppReader_popBuffer (cppReader *pfile) -{ - cppBuffer *buf = CPPBUFFER (pfile); - - llassert (buf != NULL); - - (void) (*buf->cleanup) (buf, pfile); - return ++CPPBUFFER (pfile); -} - -/* Scan until CPPBUFFER (PFILE) is exhausted into PFILE->token_buffer. - Pop the buffer when done. */ - -void -cppReader_scanBuffer (cppReader *pfile) -{ - cppBuffer *buffer = CPPBUFFER (pfile); - for (;;) - { - enum cpp_token token; - - token = cppGetToken (pfile); - - if (token == CPP_EOF) /* Should not happen ... */ - { - break; - } - - if (token == CPP_POP && CPPBUFFER (pfile) == buffer) - { - (void) cppReader_popBuffer (pfile); - break; - } - } -} - -/* - * Rescan a string (which may have escape marks) into pfile's buffer. - * Place the result in pfile->token_buffer. - * - * The input is copied before it is scanned, so it is safe to pass - * it something from the token_buffer that will get overwritten - * (because it follows cppReader_getWritten). This is used by do_include. - */ - -static void -cpp_expand_to_buffer (cppReader *pfile, char *buf, size_t length) -{ - register cppBuffer *ip; - char *limit = buf + length; - char *buf1, *p1, *p2; - - if (length < 0) - abort (); - - /* Set up the input on the input stack. */ - - buf1 = (char *) dmalloc (length + 1); - - p1 = buf; - p2 = buf1; - - while (p1 != limit) - { - *p2++ = *p1++; - } - - buf1[length] = '\0'; - - ip = cppReader_pushBuffer (pfile, buf1, length); - - if (ip == NULL) - return; - - ip->has_escapes = TRUE; - - /* Scan the input, create the output. */ - cppReader_scanBuffer (pfile); - - cppReader_nullTerminate (pfile); -} - -static void -adjust_position (char *buf, char *limit, int *linep, int *colp) -{ - while (buf < limit) - { - char ch = *buf++; - if (ch == '\n') - (*linep)++, (*colp) = 1; - else - (*colp)++; - } -} - -/* Move line_base forward, updating lineno and colno. */ - -static void -update_position (cppBuffer *pbuf) -{ - char *old_pos; - char *new_pos = pbuf->cur; - register struct parse_marker *mark; - - llassert (pbuf->buf != NULL); - old_pos = pbuf->buf + pbuf->line_base; - - for (mark = pbuf->marks; mark != NULL; mark = mark->next) - { - if (pbuf->buf + mark->position < new_pos) - new_pos = pbuf->buf + mark->position; - } - pbuf->line_base += new_pos - old_pos; - - llassert (old_pos != NULL); - llassert (new_pos != NULL); - - adjust_position (old_pos, new_pos, &pbuf->lineno, &pbuf->colno); -} - -void -cppBuffer_lineAndColumn (/*@null@*/ cppBuffer *pbuf, /*@out@*/ int *linep, - /*@null@*/ /*@out@*/ int *colp) -{ - int dummy; - - if (colp == NULL) - { - colp = &dummy; - /*@-branchstate@*/ - } /*@=branchstate@*/ - - if (pbuf != NULL) - { - *linep = pbuf->lineno; - *colp = pbuf->colno; - - llassert (pbuf->buf != NULL); - llassert (pbuf->cur != NULL); - - adjust_position (pbuf->buf + pbuf->line_base, pbuf->cur, linep, colp); - } - else - { - *linep = 0; - *colp = 0; - } -} - -/* Return the cppBuffer that corresponds to a file (not a macro). */ - -/*@exposed@*/ /*@null@*/ cppBuffer *cppReader_fileBuffer (cppReader *pfile) -{ - cppBuffer *ip = cppReader_getBuffer (pfile); - - for ( ; - ip != NULL && ip != cppReader_nullBuffer (pfile); - ip = cppBuffer_prevBuffer (ip)) - { - if (ip->fname != NULL) - { - return ip; - } - } - - return NULL; -} - -static long -count_newlines (char *buf, char *limit) -{ - register long count = 0; - - while (buf < limit) - { - char ch = *buf++; - if (ch == '\n') - count++; - } - return count; -} - -/* - * write out a #line command, for instance, after an #include file. - * If CONDITIONAL is nonzero, we can omit the #line if it would - * appear to be a no-op, and we can output a few newlines instead - * if we want to increase the line number by a small amount. - * FILE_CHANGE says whether we are entering a file, leaving, or neither. - */ - -static void -output_line_command (cppReader *pfile, bool conditional, - enum file_change_code file_change) -{ - int line, col; - cppBuffer *ip = CPPBUFFER (pfile); - cppBuffer *buf; - - llassert (ip != NULL); - - if (ip->fname == NULL) - return; - - update_position (ip); - - if (CPPOPTIONS (pfile)->no_line_commands - || CPPOPTIONS (pfile)->no_output) - return; - - buf = CPPBUFFER (pfile); - - llassert (buf != NULL); - - line = buf->lineno; - col = buf->colno; - - llassert (ip->cur != NULL); - - adjust_position (cppLineBase (ip), ip->cur, &line, &col); - - if (CPPOPTIONS (pfile)->no_line_commands) - return; - - if (conditional) { - if (line == pfile->lineno) - return; - - /* If the inherited line number is a little too small, - output some newlines instead of a #line command. */ - - if (line > pfile->lineno && line < pfile->lineno + 8) - { - cppReader_reserve (pfile, 20); - while (line > pfile->lineno) - { - cppReader_putCharQ (pfile, '\n'); - pfile->lineno++; - } - - return; - } - } - - cppReader_reserve (pfile, - size_fromInt (4 * cstring_length (ip->nominal_fname) + 50)); - - { -#ifdef OUTPUT_LINE_COMMANDS - static char sharp_line[] = "#line "; -#else - static char sharp_line[] = "# "; -#endif - cppReader_putStrN (pfile, sharp_line, sizeof(sharp_line)-1); - } - - sprintf (cppReader_getPWritten (pfile), "%d ", line); - cppReader_adjustWritten (pfile, strlen (cppReader_getPWritten (pfile))); - - quote_string (pfile, cstring_toCharsSafe (ip->nominal_fname)); - - if (file_change != same_file) { - cppReader_putCharQ (pfile, ' '); - cppReader_putCharQ (pfile, file_change == enter_file ? '1' : '2'); - } - /* Tell cc1 if following text comes from a system header file. */ - if (ip->system_header_p != '\0') { - cppReader_putCharQ (pfile, ' '); - cppReader_putCharQ (pfile, '3'); - } -#ifndef NO_IMPLICIT_EXTERN_C - /* Tell cc1plus if following text should be treated as C. */ - if (ip->system_header_p == (char) 2 && CPPOPTIONS (pfile)->cplusplus) { - cppReader_putCharQ (pfile, ' '); - cppReader_putCharQ (pfile, '4'); - } -#endif - cppReader_putCharQ (pfile, '\n'); - pfile->lineno = line; -} - - -/* - * Parse a macro argument and append the info on PFILE's token_buffer. - * REST_ARGS means to absorb the rest of the args. - * Return nonzero to indicate a syntax error. - */ - -static enum cpp_token -macarg (cppReader *pfile, int rest_args) -{ - int paren = 0; - enum cpp_token token; - char save_put_out_comments = CPPOPTIONS (pfile)->put_out_comments; - bool oldexpand = pfile->no_macro_expand; - CPPOPTIONS (pfile)->put_out_comments = 1; - - /* Try to parse as much of the argument as exists at this - input stack level. */ - - pfile->no_macro_expand = TRUE; - - for (;;) - { - token = cppGetToken (pfile); - - switch (token) - { - case CPP_EOF: - goto done; - case CPP_POP: - /* If we've hit end of file, it's an error (reported by caller). - Ditto if it's the end of cpp_expand_to_buffer text. - If we've hit end of macro, just continue. */ - if (!cppBuffer_isMacro (CPPBUFFER (pfile))) - goto done; - /*@switchbreak@*/ break; - case CPP_LPAREN: - paren++; - /*@switchbreak@*/ break; - case CPP_RPAREN: - if (--paren < 0) - goto found; - /*@switchbreak@*/ break; - case CPP_COMMA: - /* if we've returned to lowest level and - we aren't absorbing all args */ - if (paren == 0 && rest_args == 0) - goto found; - /*@switchbreak@*/ break; - found: - /* Remove ',' or ')' from argument buffer. */ - cppReader_adjustWritten (pfile, -1); - goto done; - default: - ; - } - } - -done: - CPPOPTIONS (pfile)->put_out_comments = save_put_out_comments; - pfile->no_macro_expand = oldexpand; - - return token; -} - - -/* Turn newlines to spaces in the string of length LENGTH at START, - except inside of string constants. - The string is copied into itself with its beginning staying fixed. */ - -static int -change_newlines (char *start, int length) -{ - register char *ibp; - register char *obp; - register char *limit; - char c; - - ibp = start; - limit = start + length; - obp = start; - - while (ibp < limit) { - *obp++ = c = *ibp++; - switch (c) { - - case '\'': - case '\"': - /* Notice and skip strings, so that we don't delete newlines in them. */ - { - char quotec = c; - while (ibp < limit) { - *obp++ = c = *ibp++; - if (c == quotec) - /*@innerbreak@*/ break; - if (c == '\n' && quotec == '\'') - /*@innerbreak@*/ break; - } - } - /*@switchbreak@*/ break; - } - } - - return obp - start; -} - -static /*@observer@*/ struct tm * -timestamp (/*@returned@*/ cppReader *pfile) -{ - if (pfile->timebuf == NULL) - { - time_t t = time ((time_t *) 0); - pfile->timebuf = localtime (&t); - } - - llassert (pfile->timebuf != NULL); - - return pfile->timebuf; -} - -static ob_mstring monthnames[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", -} ; - -/* - * expand things like __FILE__. Place the expansion into the output - * buffer *without* rescanning. - */ - -static void -special_symbol (HASHNODE *hp, cppReader *pfile) -{ - cstring buf = cstring_undefined; - size_t len; - int true_indepth; - cppBuffer *ip; - struct tm *timebuf; - - int paren = 0; /* For special `defined' keyword */ - - for (ip = cppReader_getBuffer (pfile); ip != NULL; ip = cppBuffer_prevBuffer (ip)) - { - if (ip == cppReader_nullBuffer (pfile)) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("cccp error: not in any file?!")); - return; /* the show must go on */ - } - - if (ip != NULL && ip->fname != NULL) - { - break; - } - } - - switch (hp->type) - { - case T_FILE: - case T_BASE_FILE: - { - char *string; - if (hp->type == T_BASE_FILE) - { - while (cppBuffer_prevBuffer (ip) != cppReader_nullBuffer (pfile)) - { - ip = cppBuffer_prevBuffer (ip); - } - } - - llassert (ip != NULL); - string = cstring_toCharsSafe (ip->nominal_fname); - - if (string == NULL) - { - string = ""; - } - - cppReader_reserve (pfile, 3 + 4 * strlen (string)); - quote_string (pfile, string); - return; - } - - case T_INCLUDE_LEVEL: - true_indepth = 0; - ip = cppReader_getBuffer (pfile); - - for (; ip != cppReader_nullBuffer (pfile) && ip != NULL; - ip = cppBuffer_prevBuffer (ip)) - { - if (ip != NULL && ip->fname != NULL) - { - true_indepth++; - } - } - - buf = message ("%d", true_indepth - 1); - break; - - case T_VERSION: - buf = message ("\"%s\"", cstring_makeLiteralTemp (CPP_VERSION)); - break; - -#ifndef NO_BUILTIN_SIZE_TYPE - case T_SIZE_TYPE: - buf = cstring_makeLiteral (SIZE_TYPE); - break; -#endif - -#ifndef NO_BUILTIN_PTRDIFF_TYPE - case T_PTRDIFF_TYPE: - buf = cstring_makeLiteral (PTRDIFF_TYPE); - break; -#endif - - case T_WCHAR_TYPE: - buf = cstring_makeLiteral (cppReader_wcharType (pfile)); - break; - - case T_USER_LABEL_PREFIX_TYPE: - buf = cstring_makeLiteral (USER_LABEL_PREFIX); - break; - - case T_REGISTER_PREFIX_TYPE: - buf = cstring_makeLiteral (REGISTER_PREFIX); - break; - - case T_CONST: - buf = message ("%d", hp->value.ival); - break; - - case T_SPECLINE: - { - if (ip != NULL) - { - int line = ip->lineno; - int col = ip->colno; - - llassert (ip->cur != NULL); - adjust_position (cppLineBase (ip), ip->cur, &line, &col); - - buf = message ("%d", (int) line); - } - else - { - BADBRANCH; - } - } - break; - - case T_DATE: - case T_TIME: - { - char *sbuf = (char *) dmalloc (20); - timebuf = timestamp (pfile); - if (hp->type == T_DATE) - { - sprintf (sbuf, "\"%s %2d %4d\"", monthnames[timebuf->tm_mon], - timebuf->tm_mday, timebuf->tm_year + 1900); - } - else - { - sprintf (sbuf, "\"%02d:%02d:%02d\"", timebuf->tm_hour, timebuf->tm_min, - timebuf->tm_sec); - } - - buf = cstring_fromCharsNew (sbuf); - sfree (sbuf); - break; - } - - case T_SPEC_DEFINED: - buf = cstring_makeLiteral (" 0 "); /* Assume symbol is not defined */ - ip = cppReader_getBuffer (pfile); - - llassert (ip->cur != NULL); - SKIP_WHITE_SPACE (ip->cur); - - if (*ip->cur == '(') - { - paren++; - ip->cur++; /* Skip over the paren */ - SKIP_WHITE_SPACE (ip->cur); - } - - if (!is_idstart[(int) *ip->cur]) - goto oops; - if (ip->cur[0] == 'L' && (ip->cur[1] == '\'' || ip->cur[1] == '"')) - goto oops; - - if ((hp = cppReader_lookup (ip->cur, -1, -1)) != 0) - { - cstring_free (buf); - buf = cstring_makeLiteral (" 1 "); - } - - while (is_idchar[(int) *ip->cur]) - { - ++ip->cur; - } - - SKIP_WHITE_SPACE (ip->cur); - - if (paren != 0) - { - if (*ip->cur != ')') - goto oops; - ++ip->cur; - } - break; - - oops: - - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("`defined' without an identifier")); - break; - - default: - cpp_setLocation (pfile); - llfatalerror (message ("Pre-processing error: invalid special hash type")); - } - - len = size_fromInt (cstring_length (buf)); - - cppReader_reserve (pfile, len + 1); - cppReader_putStrN (pfile, cstring_toCharsSafe (buf), len); - cppReader_nullTerminateQ (pfile); - - cstring_free (buf); - return; -} - -/* Write out a #define command for the special named MACRO_NAME - to PFILE's token_buffer. */ - -static void -dump_special_to_buffer (cppReader *pfile, char *macro_name) -{ - static char define_directive[] = "#define "; - size_t macro_name_length = strlen (macro_name); - output_line_command (pfile, 0, same_file); - cppReader_reserve (pfile, sizeof(define_directive) + macro_name_length); - cppReader_putStrN (pfile, define_directive, sizeof(define_directive)-1); - cppReader_putStrN (pfile, macro_name, macro_name_length); - cppReader_putCharQ (pfile, ' '); - cpp_expand_to_buffer (pfile, macro_name, macro_name_length); - cppReader_putChar (pfile, '\n'); -} - -/* Initialize the built-in macros. */ - -static void -cppReader_installBuiltin (/*@observer@*/ char *name, ctype ctyp, - int len, enum node_type type, - int ivalue, /*@null@*/ /*@only@*/ char *value, - int hash) -{ - cstring sname = cstring_fromCharsNew (name); - - llassert (usymtab_inGlobalScope ()); - - /* - ** Be careful here: this is done before the ctype table has - ** been initialized. - */ - - if (!usymtab_exists (sname)) - { - uentry ue = uentry_makeConstant (sname, ctyp, fileloc_createBuiltin ()); - - if (ctype_equal (ctyp, ctype_string)) - { - qualList ql = qualList_new (); - ql = qualList_add (ql, QU_OBSERVER); - uentry_reflectQualifiers (ue, ql); - qualList_free (ql); - } - - usymtab_addGlobalEntry (ue); - } - else - { - ; - } - - (void) cppReader_install (name, len, type, ivalue, value, hash); - cstring_free (sname); -} - -static void -cppReader_installBuiltinType (/*@observer@*/ char *name, ctype ctyp, - int len, enum node_type type, - int ivalue, - /*@only@*/ /*@null@*/ char *value, int hash) -{ - cstring sname = cstring_fromChars (name); - /* evs 2000 07 10 - removed a memory leak, detected by lclint */ - - llassert (usymtab_inGlobalScope ()); - - if (!usymtab_exists (sname)) - { - uentry ue = uentry_makeDatatype (sname, ctyp, - NO, NO, - fileloc_createBuiltin ()); - usymtab_addGlobalEntry (ue); - } - - (void) cppReader_install (name, len, type, ivalue, value, hash); -} - -static void -initialize_builtins (cppReader *pfile) -{ - cppReader_installBuiltin ("__LINE__", ctype_int, -1, T_SPECLINE, 0, NULL, -1); - cppReader_installBuiltin ("__DATE__", ctype_string, -1, T_DATE, 0, NULL, -1); - cppReader_installBuiltin ("__FILE__", ctype_string, -1, T_FILE, 0, NULL, -1); - cppReader_installBuiltin ("__BASE_FILE__", ctype_string, -1, T_BASE_FILE, 0, NULL, -1); - cppReader_installBuiltin ("__INCLUDE_LEVEL__", ctype_int, -1, T_INCLUDE_LEVEL, 0, NULL, -1); - cppReader_installBuiltin ("__VERSION__", ctype_string, -1, T_VERSION, 0, NULL, -1); -#ifndef NO_BUILTIN_SIZE_TYPE - cppReader_installBuiltinType ("__SIZE_TYPE__", ctype_anyintegral, -1, T_SIZE_TYPE, 0, NULL, -1); -#endif -#ifndef NO_BUILTIN_PTRDIFF_TYPE - cppReader_installBuiltinType ("__PTRDIFF_TYPE__ ", ctype_anyintegral, -1, T_PTRDIFF_TYPE, 0, NULL, -1); -#endif - cppReader_installBuiltinType ("__WCHAR_TYPE__", ctype_anyintegral, -1, T_WCHAR_TYPE, 0, NULL, -1); - cppReader_installBuiltin ("__USER_LABEL_PREFIX__", ctype_string, -1, T_USER_LABEL_PREFIX_TYPE, 0, NULL, -1); - cppReader_installBuiltin ("__REGISTER_PREFIX__", ctype_string, -1, T_REGISTER_PREFIX_TYPE, 0, NULL, -1); - cppReader_installBuiltin ("__TIME__", ctype_string, -1, T_TIME, 0, NULL, -1); - - /* - ** No, don't define __STDC__ - ** - - if (!cppReader_isTraditional (pfile)) - { - cppReader_installBuiltin ("__STDC__", ctype_int, -1, T_CONST, STDC_VALUE, NULL, -1); - } - - ** - */ - -# ifdef WIN32 - cppReader_installBuiltin ("_WIN32", ctype_int, -1, T_CONST, STDC_VALUE, NULL, -1); -# endif - - /* - ** This is supplied using a -D by the compiler driver - ** so that it is present only when truly compiling with GNU C. - */ - - /* cppReader_install ("__GNUC__", -1, T_CONST, 2, 0, -1); */ - - cppReader_installBuiltin ("__LCLINT__", ctype_int, -1, T_CONST, 2, NULL, -1); - - if (CPPOPTIONS (pfile)->debug_output) - { - dump_special_to_buffer (pfile, "__BASE_FILE__"); - dump_special_to_buffer (pfile, "__VERSION__"); -#ifndef NO_BUILTIN_SIZE_TYPE - dump_special_to_buffer (pfile, "__SIZE_TYPE__"); -#endif -#ifndef NO_BUILTIN_PTRDIFF_TYPE - dump_special_to_buffer (pfile, "__PTRDIFF_TYPE__"); -#endif - dump_special_to_buffer (pfile, "__WCHAR_TYPE__"); - dump_special_to_buffer (pfile, "__DATE__"); - dump_special_to_buffer (pfile, "__TIME__"); - if (!cppReader_isTraditional (pfile)) - dump_special_to_buffer (pfile, "__STDC__"); - } -} - - -/* Return 1 iff a token ending in C1 followed directly by a token C2 - could cause mis-tokenization. */ - -static bool -unsafe_chars (char c1, char c2) -{ - switch (c1) - { - case '+': case '-': - if (c2 == c1 || c2 == '=') - return 1; - goto letter; - case '.': - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - case 'e': case 'E': case 'p': case 'P': - if (c2 == '-' || c2 == '+') - return 1; /* could extend a pre-processing number */ - goto letter; - case 'L': - if (c2 == '\'' || c2 == '\"') - return 1; /* Could turn into L"xxx" or L'xxx'. */ - goto letter; - letter: - case '_': - case 'a': case 'b': case 'c': case 'd': case 'f': - case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': - case 'm': case 'n': case 'o': case 'q': case 'r': - case 's': case 't': case 'u': case 'v': case 'w': case 'x': - case 'y': case 'z': - case 'A': case 'B': case 'C': case 'D': case 'F': - case 'G': case 'H': case 'I': case 'J': case 'K': - case 'M': case 'N': case 'O': case 'Q': case 'R': - case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': - case 'Y': case 'Z': - /* We're in the middle of either a name or a pre-processing number. */ - return (is_idchar[(int) c2] || c2 == '.'); - case '<': case '>': case '!': case '%': case '#': case ':': - case '^': case '&': case '|': case '*': case '/': case '=': - return (c2 == c1 || c2 == '='); - } - return 0; -} - -/* Expand a macro call. - HP points to the symbol that is the macro being called. - Put the result of expansion onto the input stack - so that subsequent input by our caller will use it. - - If macro wants arguments, caller has already verified that - an argument list follows; arguments come from the input stack. */ - -static void -macroexpand (cppReader *pfile, /*@dependent@*/ HASHNODE *hp) -{ - int nargs; - DEFINITION *defn = hp->value.defn; - char *xbuf; - char *oxbuf = NULL; - int start_line; - int start_column; - size_t xbuf_len; - size_t old_written = cppReader_getWritten (pfile); - int rest_args; - int rest_zero = 0; - int i; - struct argdata *args = NULL; - - pfile->output_escapes++; - - cppBuffer_lineAndColumn (cppReader_fileBuffer (pfile), &start_line, &start_column); - - nargs = defn->nargs; - - if (nargs >= 0) - { - enum cpp_token token = CPP_EOF; - - args = (struct argdata *) dmalloc ((nargs + 1) * sizeof (*args)); - - for (i = 0; i < nargs; i++) - { - args[i].expanded = 0; - args[i].raw = 0; - args[i].raw_length = 0; - args[i].expand_length = args[i].stringified_length = -1; - args[i].use_count = 0; - } - - /* - ** Parse all the macro args that are supplied. I counts them. - ** The first NARGS args are stored in ARGS. - ** The rest are discarded. If rest_args is set then we assume - ** macarg absorbed the rest of the args. - */ - - i = 0; - rest_args = 0; - - cppReader_forward (pfile, 1); /* Discard the open-parenthesis before the first arg. */ - do - { - if (rest_args != 0) - { - continue; - } - - if (i < nargs || (nargs == 0 && i == 0)) - { - /* if we are working on last arg which absorbs rest of args... */ - if (i == nargs - 1 && defn->rest_args) - { - rest_args = 1; - } - - args[i].raw = size_toLong (cppReader_getWritten (pfile)); - token = macarg (pfile, rest_args); - args[i].raw_length = cppReader_getWritten (pfile) - args[i].raw; - args[i].newlines = FALSE; /* FIXME */ - } - else - { - token = macarg (pfile, 0); - } - - if (token == CPP_EOF || token == CPP_POP) - { - cppReader_errorWithLine (pfile, start_line, start_column, - cstring_fromCharsNew ("unterminated macro call")); - sfree (args); - return; - } - i++; - } while (token == CPP_COMMA); - - /* If we got one arg but it was just whitespace, call that 0 args. */ - if (i == 1) - { - char *bp; - char *lim; - - assertSet (args); - - bp = ARG_BASE + args[0].raw; - lim = bp + args[0].raw_length; - - /* cpp.texi says for foo ( ) we provide one argument. - However, if foo wants just 0 arguments, treat this as 0. */ - - if (nargs == 0) - { - while (bp != lim && is_space[(int) *bp]) - { - bp++; - } - } - - if (bp == lim) - i = 0; - } - - /* Don't output an error message if we have already output one for - a parse error above. */ - rest_zero = 0; - - if (nargs == 0 && i > 0) - { - cppReader_error (pfile, - message ("arguments given to macro `%s'", hp->name)); - } - else if (i < nargs) - { - /* traditional C allows foo() if foo wants one argument. */ - if (nargs == 1 && i == 0 && cppReader_isTraditional (pfile)) - { - ; - } - /* the rest args token is allowed to absorb 0 tokens */ - else if (i == nargs - 1 && defn->rest_args) - rest_zero = 1; - else if (i == 0) - cppReader_error (pfile, - message ("macro `%s' used without args", hp->name)); - else if (i == 1) - cppReader_error (pfile, - message ("macro `%s' used with just one arg", hp->name)); - else - { - cppReader_error (pfile, - message ("macro `%s' used with only %d args", - hp->name, i)); - } - } - else if (i > nargs) - { - cppReader_error (pfile, - message ("macro `%s' used with too many (%d) args", hp->name, i)); - } - else - { - ; - } - } - - /* If macro wants zero args, we parsed the arglist for checking only. - Read directly from the macro definition. */ - - if (nargs <= 0) - { - xbuf = defn->expansion; - xbuf_len = defn->length; - } - else - { - char *exp = defn->expansion; - int offset; /* offset in expansion, - copied a piece at a time */ - size_t totlen; /* total amount of exp buffer filled so far */ - - register struct reflist *ap, *last_ap; - - /* Macro really takes args. Compute the expansion of this call. */ - - /* Compute length in characters of the macro's expansion. - Also count number of times each arg is used. */ - xbuf_len = defn->length; - - llassert (args != NULL); - - for (ap = defn->pattern; ap != NULL; ap = ap->next) - { - if (ap->stringify) - { - struct argdata *arg = &args[ap->argno]; - - /* Stringify it it hasn't already been */ - assertSet (arg); - - if (arg->stringified_length < 0) - { - int arglen = arg->raw_length; - bool escaped = FALSE; - char in_string = '\0'; - char c; - - /* Initially need_space is -1. Otherwise, 1 means the - previous character was a space, but we suppressed it; - 0 means the previous character was a non-space. */ - int need_space = -1; - - i = 0; - arg->stringified = cppReader_getWritten (pfile); - if (!cppReader_isTraditional (pfile)) - cppReader_putChar (pfile, '\"'); /* insert beginning quote */ - for (; i < arglen; i++) - { - c = (ARG_BASE + arg->raw)[i]; - - if (in_string == '\0') - { - /* Internal sequences of whitespace are replaced by - one space except within an string or char token.*/ - if (is_space[(int) c]) - { - if (cppReader_getWritten (pfile) > arg->stringified - && (cppReader_getPWritten (pfile))[-1] == '@') - { - /* "@ " escape markers are removed */ - cppReader_adjustWritten (pfile, -1); - /*@innercontinue@*/ continue; - } - if (need_space == 0) - need_space = 1; - /*@innercontinue@*/ continue; - } - else if (need_space > 0) - cppReader_putChar (pfile, ' '); - else - { - ; - } - - need_space = 0; - } - - if (escaped) - escaped = 0; - else - { - if (c == '\\') - escaped = 1; - - if (in_string != '\0') - { - if (c == in_string) - in_string = '\0'; - } - else if (c == '\"' || c == '\'') - { - in_string = c; - } - else - { - ; - } - } - - /* Escape these chars */ - if (c == '\"' || (in_string != '\0' && c == '\\')) - cppReader_putChar (pfile, '\\'); - if (isprint (c)) - cppReader_putChar (pfile, c); - else - { - cppReader_reserve (pfile, 4); - sprintf (cppReader_getPWritten (pfile), "\\%03o", - (unsigned int) c); - cppReader_adjustWritten (pfile, 4); - } - } - if (!cppReader_isTraditional (pfile)) - cppReader_putChar (pfile, '\"'); /* insert ending quote */ - arg->stringified_length - = size_toInt (cppReader_getWritten (pfile) - arg->stringified); - } - - xbuf_len += args[ap->argno].stringified_length; - } - else if (ap->raw_before || ap->raw_after || cppReader_isTraditional (pfile)) - { - /* Add 4 for two newline-space markers to prevent - token concatenation. */ - xbuf_len += args[ap->argno].raw_length + 4; - } - else - { - /* We have an ordinary (expanded) occurrence of the arg. - So compute its expansion, if we have not already. */ - - if (args[ap->argno].expand_length < 0) - { - args[ap->argno].expanded = cppReader_getWritten (pfile); - cpp_expand_to_buffer (pfile, - ARG_BASE + args[ap->argno].raw, - size_fromInt (args[ap->argno].raw_length)); - - args[ap->argno].expand_length - = size_toInt (cppReader_getWritten (pfile) - args[ap->argno].expanded); - } - - /* Add 4 for two newline-space markers to prevent - token concatenation. */ - xbuf_len += args[ap->argno].expand_length + 4; - } - if (args[ap->argno].use_count < 10) - args[ap->argno].use_count++; - } - - xbuf = (char *) dmalloc (xbuf_len + 1); - oxbuf = xbuf; - - /* - ** Generate in XBUF the complete expansion - ** with arguments substituted in. - ** TOTLEN is the total size generated so far. - ** OFFSET is the index in the definition - ** of where we are copying from. - */ - - offset = 0; - totlen = 0; - - for (last_ap = NULL, ap = defn->pattern; ap != NULL; - last_ap = ap, ap = ap->next) - { - register struct argdata *arg = &args[ap->argno]; - size_t count_before = totlen; - - /* Add chars to XBUF. */ - for (i = 0; i < ap->nchars; i++, offset++) - { - xbuf[totlen++] = exp[offset]; - } - - /* If followed by an empty rest arg with concatenation, - delete the last run of nonwhite chars. */ - if (rest_zero && totlen > count_before - && ((ap->rest_args && ap->raw_before) - || (last_ap != NULL && last_ap->rest_args - && last_ap->raw_after))) - { - /* Delete final whitespace. */ - while (totlen > count_before && is_space[(int) xbuf[totlen - 1]]) - { - totlen--; - } - - /* Delete the nonwhites before them. */ - while (totlen > count_before && ! is_space[(int) xbuf[totlen - 1]]) - { - totlen--; - } - } - - if (ap->stringify != 0) - { - assertSet(arg); - memcpy (xbuf + totlen, - ARG_BASE + arg->stringified, - size_fromInt (arg->stringified_length)); - totlen += arg->stringified_length; - } - else if (ap->raw_before || ap->raw_after || cppReader_isTraditional (pfile)) - { - char *p1; - char *l1; - - assertSet (arg); - - p1 = ARG_BASE + arg->raw; - l1 = p1 + arg->raw_length; - - if (ap->raw_before) - { - while (p1 != l1 && is_space[(int) *p1]) - { - p1++; - } - - while (p1 != l1 && is_idchar[(int) *p1]) - { - xbuf[totlen++] = *p1++; - } - - /* Delete any no-reexpansion marker that follows - an identifier at the beginning of the argument - if the argument is concatenated with what precedes it. */ - if (p1[0] == '@' && p1[1] == '-') - p1 += 2; - } - if (ap->raw_after) - { - /* Arg is concatenated after: delete trailing whitespace, - whitespace markers, and no-reexpansion markers. */ - while (p1 != l1) - { - if (is_space[(int) l1[-1]]) l1--; - else if (l1[-1] == '-') - { - char *p2 = l1 - 1; - /* If a `-' is preceded by an odd number of newlines then it - and the last newline are a no-reexpansion marker. */ - while (p2 != p1 && p2[-1] == '\n') - { - p2--; - } - - if (((l1 - 1 - p2) & 1) != 0) - { - l1 -= 2; - } - else - { - /*@innerbreak@*/ break; - } - } - else - { - /*@innerbreak@*/ break; - } - } - } - - memcpy (xbuf + totlen, p1, size_fromInt (l1 - p1)); - totlen += l1 - p1; - } - else - { - char *expanded; - - assertSet (arg); - expanded = ARG_BASE + arg->expanded; - - if (!ap->raw_before && totlen > 0 - && (arg->expand_length != 0) - && !cppReader_isTraditional(pfile) - && unsafe_chars (xbuf[totlen-1], expanded[0])) - { - xbuf[totlen++] = '@'; - xbuf[totlen++] = ' '; - } - - memcpy (xbuf + totlen, expanded, - size_fromInt (arg->expand_length)); - totlen += arg->expand_length; - - if (!ap->raw_after && totlen > 0 - && offset < size_toInt (defn->length) - && !cppReader_isTraditional(pfile) - && unsafe_chars (xbuf[totlen-1], exp[offset])) - { - xbuf[totlen++] = '@'; - xbuf[totlen++] = ' '; - } - - /* If a macro argument with newlines is used multiple times, - then only expand the newlines once. This avoids creating - output lines which don't correspond to any input line, - which confuses gdb and gcov. */ - if (arg->use_count > 1 && arg->newlines > 0) - { - /* Don't bother doing change_newlines for subsequent - uses of arg. */ - arg->use_count = 1; - arg->expand_length - = change_newlines (expanded, arg->expand_length); - } - } - - if (totlen > xbuf_len) - abort (); - } - - /* if there is anything left of the definition - after handling the arg list, copy that in too. */ - - for (i = offset; i < size_toInt (defn->length); i++) - { - /* if we've reached the end of the macro */ - if (exp[i] == ')') - rest_zero = 0; - if (! (rest_zero && last_ap != NULL && last_ap->rest_args - && last_ap->raw_after)) - xbuf[totlen++] = exp[i]; - } - - xbuf[totlen] = '\0'; - xbuf_len = totlen; - } - - pfile->output_escapes--; - - /* Now put the expansion on the input stack - so our caller will commence reading from it. */ - push_macro_expansion (pfile, xbuf, xbuf_len, hp); - cppReader_getBuffer (pfile)->has_escapes = 1; - - /* Pop the space we've used in the token_buffer for argument expansion. */ - cppReader_setWritten (pfile, old_written); - - /* Recursive macro use sometimes works traditionally. - #define foo(x,y) bar (x (y,0), y) - foo (foo, baz) */ - - if (!cppReader_isTraditional (pfile)) - hp->type = T_DISABLED; - - sfree (args); -} - -static void -push_macro_expansion (cppReader *pfile, char *xbuf, size_t xbuf_len, - /*@dependent@*/ HASHNODE *hp) -{ - cppBuffer *mbuf = cppReader_pushBuffer (pfile, xbuf, xbuf_len); - - if (mbuf == NULL) - { - return; - } - - mbuf->cleanup = cppReader_macroCleanup; - - llassert (mbuf->hnode == NULL); - mbuf->hnode = hp; - - /* The first chars of the expansion should be a "@ " added by - collect_expansion. This is to prevent accidental token-pasting - between the text preceding the macro invocation, and the macro - expansion text. - - We would like to avoid adding unneeded spaces (for the sake of - tools that use cpp, such as imake). In some common cases we can - tell that it is safe to omit the space. - - The character before the macro invocation cannot have been an - idchar (or else it would have been pasted with the idchars of - the macro name). Therefore, if the first non-space character - of the expansion is an idchar, we do not need the extra space - to prevent token pasting. - - Also, we don't need the extra space if the first char is '(', - or some other (less common) characters. */ - - if (xbuf[0] == '@' && xbuf[1] == ' ' - && (is_idchar[(int) xbuf[2]] || xbuf[2] == '(' || xbuf[2] == '\'' - || xbuf[2] == '\"')) - { - llassert (mbuf->cur != NULL); - mbuf->cur += 2; - } -} - - -/* Like cppGetToken, except that it does not read past end-of-line. - Also, horizontal space is skipped, and macros are popped. */ - -static enum cpp_token -get_directive_token (cppReader *pfile) -{ - for (;;) - { - size_t old_written = cppReader_getWritten (pfile); - enum cpp_token token; - cppSkipHspace (pfile); - if (cppReader_peekC (pfile) == '\n') - { - return CPP_VSPACE; - } - - token = cppGetToken (pfile); - - switch (token) - { - case CPP_POP: - if (!cppBuffer_isMacro (cppReader_getBuffer (pfile))) - return token; - /*@fallthrough@*/ - case CPP_HSPACE: - case CPP_COMMENT: - cppReader_setWritten (pfile, old_written); - /*@switchbreak@*/ break; - default: - return token; - } - } -} - - -/* Handle #include and #import. - This function expects to see "fname" or on the input. - - The input is normally in part of the output_buffer following - cppReader_getWritten, and will get overwritten by output_line_command. - I.e. in input file specification has been popped by cppReader_handleDirective. - This is safe. */ - -static int -do_include (cppReader *pfile, struct directive *keyword, - /*@unused@*/ char *unused1, /*@unused@*/ char *unused2) -{ - bool skip_dirs = (keyword->type == T_INCLUDE_NEXT); - cstring fname; - char *fbeg, *fend; /* Beginning and end of fname */ - enum cpp_token token; - - /* Chain of dirs to search */ - struct file_name_list *search_start = CPPOPTIONS (pfile)->include; - struct file_name_list dsp[1]; /* First in chain, if #include "..." */ - struct file_name_list *searchptr = NULL; - size_t old_written = cppReader_getWritten (pfile); - - int flen; - - int f; /* file number */ - int angle_brackets = 0; /* 0 for "...", 1 for <...> */ - f= -1; /* JF we iz paranoid! */ - - pfile->parsing_include_directive++; - token = get_directive_token (pfile); - pfile->parsing_include_directive--; - - if (token == CPP_STRING) - { - /* FIXME - check no trailing garbage */ - fbeg = pfile->token_buffer + old_written + 1; - fend = cppReader_getPWritten (pfile) - 1; - if (fbeg[-1] == '<') - { - angle_brackets = 1; - /* If -I-, start with the first -I dir after the -I-. */ - if (CPPOPTIONS (pfile)->first_bracket_include != NULL) - search_start = CPPOPTIONS (pfile)->first_bracket_include; - } - /* If -I- was specified, don't search current dir, only spec'd ones. */ - else if (!CPPOPTIONS (pfile)->ignore_srcdir) - { - cppBuffer *fp = CPPBUFFER (pfile); - /* We have "filename". Figure out directory this source - file is coming from and put it on the front of the list. */ - - for ( ; fp != cppReader_nullBuffer (pfile); fp = cppBuffer_prevBuffer (fp)) - { - int n; - char *ep,*nam; - - llassert (fp != NULL); - - nam = NULL; - - if (cstring_isDefined (fp->nominal_fname)) - { - nam = cstring_toCharsSafe (fp->nominal_fname); - - /* Found a named file. Figure out dir of the file, - and put it in front of the search list. */ - dsp[0].next = search_start; - search_start = dsp; - -#ifndef VMS - ep = strrchr (nam, CONNECTCHAR); -#else /* VMS */ - ep = strrchr (nam, ']'); - if (ep == NULL) ep = strrchr (nam, '>'); - if (ep == NULL) ep = strrchr (nam, ':'); - if (ep != NULL) ep++; -#endif /* VMS */ - if (ep != NULL) - { - char save; - - n = ep - nam; - save = nam[n]; - nam[n] = '\0'; - - /*@-onlytrans@*/ /* This looks like a memory leak... */ - dsp[0].fname = cstring_fromCharsNew (nam); /* evs 2000-07-20: was fromChars */ - /*@=onlytrans@*/ - nam[n] = save; - - if (n + INCLUDE_LEN_FUDGE > pfile->max_include_len) - pfile->max_include_len = n + INCLUDE_LEN_FUDGE; - } - else - { - dsp[0].fname = cstring_undefined; /* Current directory */ - } - - dsp[0].got_name_map = 0; - break; - } - } - } - else - { - ; - } - } -#ifdef VMS - else if (token == CPP_NAME) - { - /* - * Support '#include xyz' like VAX-C to allow for easy use of all the - * decwindow include files. It defaults to '#include ' (so the - * code from case '<' is repeated here) and generates a warning. - */ - cppReader_warning (pfile, - "VAX-C-style include specification found, use '#include ' !"); - angle_brackets = 1; - /* If -I-, start with the first -I dir after the -I-. */ - if (CPPOPTIONS (pfile)->first_bracket_include) - search_start = CPPOPTIONS (pfile)->first_bracket_include; - fbeg = pfile->token_buffer + old_written; - fend = cppReader_getPWritten (pfile); - } -#endif - else - { - cppReader_error (pfile, - message ("Preprocessor command #%s expects \"FILENAME\" or ", - keyword->name)); - - cppReader_setWritten (pfile, old_written); - cppReader_skipRestOfLine (pfile); - return 0; - } - - *fend = 0; - - token = get_directive_token (pfile); - if (token != CPP_VSPACE) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("Junk at end of #include")); - - while (token != CPP_VSPACE && token != CPP_EOF && token != CPP_POP) - { - token = get_directive_token (pfile); - } - } - - /* - ** For #include_next, skip in the search path - ** past the dir in which the containing file was found. - */ - - if (skip_dirs) - { - cppBuffer *fp = CPPBUFFER (pfile); - - for (; fp != cppReader_nullBuffer (pfile); fp = cppBuffer_prevBuffer (fp)) - { - llassert (fp != NULL); - - if (fp->fname != NULL) - { - /* fp->dir is null if the containing file was specified with - an absolute file name. In that case, don't skip anything. */ - if (fp->dir == SELF_DIR_DUMMY) - { - search_start = CPPOPTIONS (pfile)->include; - } - else if (fp->dir != NULL) - { - search_start = fp->dir->next; - } - else - { - ; - } - - break; - } - } - } - - cppReader_setWritten (pfile, old_written); - - flen = fend - fbeg; - - DPRINTF (("fbeg: %s", fbeg)); - - if (flen == 0) - { - cppReader_error (pfile, - message ("Empty file name in #%s", keyword->name)); - return 0; - } - - /* - ** Allocate this permanently, because it gets stored in the definitions - ** of macros. - */ - - fname = cstring_undefined; - - /* + 2 above for slash and terminating null. */ - /* + 2 added for '.h' on VMS (to support '#include filename') */ - - /* If specified file name is absolute, just open it. */ - - if (osd_isConnectChar (*fbeg) -# if defined (WIN32) || defined (OS2) - || (*(fbeg + 1) == ':') -# endif - ) - { - fname = cstring_copyLength (fbeg, flen); - - if (redundant_include_p (pfile, fname)) - { - cstring_free (fname); - return 0; - } - - f = open_include_file (pfile, fname, NULL); - - if (f == IMPORT_FOUND) - { - return 0; /* Already included this file */ - } - } - else - { - /* Search directory path, trying to open the file. - Copy each filename tried into FNAME. */ - - for (searchptr = search_start; searchptr != NULL; - searchptr = searchptr->next) - { - if (!cstring_isEmpty (searchptr->fname)) - { - /* The empty string in a search path is ignored. - This makes it possible to turn off entirely - a standard piece of the list. */ - if (cstring_isEmpty (searchptr->fname)) - continue; - - fname = cstring_copy (searchptr->fname); - fname = cstring_appendChar (fname, CONNECTCHAR); - DPRINTF (("Here: %s", fname)); - } - else - { - ; - } - - fname = cstring_concatLength (fname, fbeg, flen); - - DPRINTF (("fname: %s", fname)); - -#ifdef VMS - /* Change this 1/2 Unix 1/2 VMS file specification into a - full VMS file specification */ - if (searchptr->fname && (searchptr->fname[0] != 0)) { - /* Fix up the filename */ - hack_vms_include_specification (fname); - } else { - /* This is a normal VMS filespec, so use it unchanged. */ - strncpy (fname, fbeg, flen); - fname[flen] = 0; - /* if it's '#include filename', add the missing .h */ - if (strchr (fname,'.') == NULL) { - strcat (fname, ".h"); - } - } -#endif /* VMS */ - /* ??? There are currently 3 separate mechanisms for avoiding processing - of redundant include files: #import, #pragma once, and - redundant_include_p. It would be nice if they were unified. */ - - if (redundant_include_p (pfile, fname)) - { - cstring_free (fname); - return 0; - } - - DPRINTF (("Trying: %s", fname)); - - f = open_include_file (pfile, fname, searchptr); - - if (f == IMPORT_FOUND) - { - return 0; /* Already included this file */ - } -#ifdef EACCES - else if (f == IMPORT_NOT_FOUND && errno == EACCES) - { - cppReader_warning (pfile, - message ("Header file %s exists, but is not readable", fname)); - } -#endif - - if (f >= 0) - { - break; - } - } - } - - if (f < 0) - { - /* A file that was not found. */ - fname = cstring_copyLength (fbeg, flen); - - if (search_start != NULL) - { - cppReader_error (pfile, - message ("Cannot find include file %s", fname)); - } - else - { - cppReader_error (pfile, - message ("No include path in which to find %s", fname)); - } - } - else { - /* - ** Check to see if this include file is a once-only include file. - ** If so, give up. - */ - - struct file_name_list *ptr; - - for (ptr = pfile->all_include_files; ptr != NULL; ptr = ptr->next) - { - if (cstring_equal (ptr->fname, fname)) - { - /* This file was included before. */ - break; - } - } - - if (ptr == NULL) - { - /* This is the first time for this file. */ - /* Add it to list of files included. */ - - ptr = (struct file_name_list *) dmalloc (sizeof (*ptr)); - ptr->control_macro = NULL; - ptr->c_system_include_path = NULL; - ptr->next = pfile->all_include_files; - ptr->fname = fname; - ptr->got_name_map = NULL; - - pfile->all_include_files = ptr; - assertSet (pfile->all_include_files); - } - - if (angle_brackets != 0) - { - pfile->system_include_depth++; - } - - /* Actually process the file */ - if (cppReader_pushBuffer (pfile, NULL, 0) == NULL) - { - cstring_free (fname); - return 0; - } - - if (finclude (pfile, f, fname, is_system_include (pfile, fname), - searchptr != dsp ? searchptr : SELF_DIR_DUMMY)) - { - output_line_command (pfile, 0, enter_file); - pfile->only_seen_white = 2; - } - - if (angle_brackets) - { - pfile->system_include_depth--; - } - /*@-branchstate@*/ - } /*@=branchstate@*/ - - return 0; -} - -/* Return nonzero if there is no need to include file NAME - because it has already been included and it contains a conditional - to make a repeated include do nothing. */ - -static bool -redundant_include_p (cppReader *pfile, cstring name) -{ - struct file_name_list *l = pfile->all_include_files; - - for (; l != NULL; l = l->next) - { - if (cstring_equal (name, l->fname) - && (l->control_macro != NULL) - && (cppReader_lookup (l->control_macro, -1, -1) != NULL)) - { - return TRUE; - } - } - - return FALSE; -} - -/* Return nonzero if the given FILENAME is an absolute pathname which - designates a file within one of the known "system" include file - directories. We assume here that if the given FILENAME looks like - it is the name of a file which resides either directly in a "system" - include file directory, or within any subdirectory thereof, then the - given file must be a "system" include file. This function tells us - if we should suppress pedantic errors/warnings for the given FILENAME. - - The value is 2 if the file is a C-language system header file - for which C++ should (on most systems) assume `extern "C"'. */ - -static bool -is_system_include (cppReader *pfile, cstring filename) -{ - struct file_name_list *searchptr; - - for (searchptr = CPPOPTIONS (pfile)->first_system_include; - searchptr != NULL; - searchptr = searchptr->next) - { - if (!cstring_isEmpty (searchptr->fname)) { - cstring sys_dir = searchptr->fname; - int length = cstring_length (sys_dir); - - if (cstring_equalLen (sys_dir, filename, length) - && osd_isConnectChar (cstring_getChar (filename, length))) - { - if (searchptr->c_system_include_path) - return 2; - else - return 1; - } - } - } - - return 0; -} - -/* Convert a character string literal into a nul-terminated string. - The input string is [IN ... LIMIT). - The result is placed in RESULT. RESULT can be the same as IN. - The value returned in the end of the string written to RESULT, - or NULL on error. */ - -static /*@null@*/ char * -convert_string (cppReader *pfile, /*@returned@*/ char *result, - char *in, char *limit, int handle_escapes) -{ - char c; - c = *in++; - - if (c != '\"') - { - return NULL; - } - - while (in < limit) - { - c = *in++; - - switch (c) - { - case '\0': - return NULL; - case '\"': - limit = in; - /*@switchbreak@*/ break; - case '\\': - if (handle_escapes) - { - char *bpc = (char *) in; - int i = (char) cppReader_parseEscape (pfile, &bpc); - in = (char *) bpc; - if (i >= 0) - *result++ = (char) c; - /*@switchbreak@*/ break; - } - - /*@fallthrough@*/ - default: - *result++ = c; - } - } - - *result = 0; - return result; -} - -/* - * interpret #line command. Remembers previously seen fnames - * in its very own hash table. - */ - -/*@constant int FNAME_HASHSIZE@*/ -#define FNAME_HASHSIZE 37 - -static int -do_line (cppReader *pfile, /*@unused@*/ struct directive *keyword) -{ - cppBuffer *ip = cppReader_getBuffer (pfile); - int new_lineno; - size_t old_written = cppReader_getWritten (pfile); - enum file_change_code file_change = same_file; - enum cpp_token token; - - token = get_directive_token (pfile); - - if (token != CPP_NUMBER - || !isdigit(pfile->token_buffer[old_written])) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("invalid format `#line' command")); - - goto bad_line_directive; - } - - /* The Newline at the end of this line remains to be processed. - To put the next line at the specified line number, - we must store a line number now that is one less. */ - new_lineno = atoi (pfile->token_buffer + old_written) - 1; - cppReader_setWritten (pfile, old_written); - - /* NEW_LINENO is one less than the actual line number here. */ - if (cppReader_isPedantic (pfile) && new_lineno < 0) - cppReader_pedwarnLit (pfile, - cstring_makeLiteralTemp ("line number out of range in `#line' command")); - - token = get_directive_token (pfile); - - if (token == CPP_STRING) { - char *fname = pfile->token_buffer + old_written; - char *end_name; - static HASHNODE *fname_table[FNAME_HASHSIZE]; - HASHNODE *hp, **hash_bucket; - char *p; - size_t num_start; - int fname_length; - - /* Turn the file name, which is a character string literal, - into a null-terminated string. Do this in place. */ - end_name = convert_string (pfile, fname, fname, cppReader_getPWritten (pfile), 1); - if (end_name == NULL) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("invalid format `#line' command")); - goto bad_line_directive; - } - - fname_length = end_name - fname; - num_start = cppReader_getWritten (pfile); - - token = get_directive_token (pfile); - if (token != CPP_VSPACE && token != CPP_EOF && token != CPP_POP) { - p = pfile->token_buffer + num_start; - if (cppReader_isPedantic (pfile)) - cppReader_pedwarnLit (pfile, - cstring_makeLiteralTemp ("garbage at end of `#line' command")); - - if (token != CPP_NUMBER || *p < '0' || *p > '4' || p[1] != '\0') - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("invalid format `#line' command")); - goto bad_line_directive; - } - if (*p == '1') - file_change = enter_file; - else if (*p == 2) - file_change = leave_file; - else if (*p == 3) - ip->system_header_p = 1; - else /* if (*p == 4) */ - ip->system_header_p = 2; - - cppReader_setWritten (pfile, num_start); - token = get_directive_token (pfile); - p = pfile->token_buffer + num_start; - if (token == CPP_NUMBER && p[1] == '\0' && (*p == '3' || *p== '4')) { - ip->system_header_p = *p == 3 ? 1 : 2; - token = get_directive_token (pfile); - } - if (token != CPP_VSPACE) { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("invalid format `#line' command")); - - goto bad_line_directive; - } - } - - hash_bucket = - &fname_table[hashf (fname, fname_length, FNAME_HASHSIZE)]; - for (hp = *hash_bucket; hp != NULL; hp = hp->next) - { - if (hp->length == fname_length && - strncmp (hp->value.cpval, fname, size_fromInt (fname_length)) == 0) { - ip->nominal_fname = cstring_fromChars (hp->value.cpval); - break; - } - } - - if (hp == 0) { - /* Didn't find it; cons up a new one. */ - hp = (HASHNODE *) dmalloc (sizeof (*hp) + fname_length + 1); - - hp->prev = NULL; - hp->bucket_hdr = NULL; - hp->type = T_NONE; - hp->name = cstring_undefined; - hp->next = *hash_bucket; - - *hash_bucket = hp; - - hp->length = fname_length; - hp->value.cpval = dmalloc (sizeof (*hp->value.cpval) * (fname_length + 1)); - memcpy (hp->value.cpval, fname, size_fromInt (fname_length)); - hp->value.cpval[fname_length] = '\0'; - ip->nominal_fname = cstring_fromChars (hp->value.cpval); - } - } - else if (token != CPP_VSPACE && token != CPP_EOF) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("invalid format `#line' command")); - goto bad_line_directive; - } - else - { - ; - } - - ip->lineno = new_lineno; -bad_line_directive: - cppReader_skipRestOfLine (pfile); - cppReader_setWritten (pfile, old_written); - output_line_command (pfile, 0, file_change); - return 0; -} - -/* - * remove the definition of a symbol from the symbol table. - * according to un*x /lib/cpp, it is not an error to undef - * something that has no definitions, so it isn't one here either. - */ - -static int -do_undef (cppReader *pfile, struct directive *keyword, char *buf, char *limit) -{ - - int sym_length; - HASHNODE *hp; - char *orig_buf = buf; - - SKIP_WHITE_SPACE (buf); - - sym_length = cppReader_checkMacroName (pfile, buf, cstring_makeLiteralTemp ("macro")); - - while ((hp = cppReader_lookup (buf, sym_length, -1)) != NULL) - { - /* If we are generating additional info for debugging (with -g) we - need to pass through all effective #undef commands. */ - if (CPPOPTIONS (pfile)->debug_output && (keyword != NULL)) - { - pass_thru_directive (orig_buf, limit, pfile, keyword); - } - - if (hp->type != T_MACRO) - { - cppReader_warning (pfile, - message ("Undefining preprocessor builtin: %s", - hp->name)); - } - - cppReader_deleteMacro (hp); - } - - if (cppReader_isPedantic (pfile)) { - buf += sym_length; - SKIP_WHITE_SPACE (buf); - if (buf != limit) - { - cppReader_pedwarnLit (pfile, - cstring_makeLiteralTemp ("garbage after `#undef' directive")); - } - } - - return 0; -} - - -/* - * Report an error detected by the program we are processing. - * Use the text of the line in the error message. - * (We use error because it prints the filename & line#.) - */ - -static int -do_error (cppReader *pfile, /*@unused@*/ struct directive *keyword, - char *buf, char *limit) -{ - int length = limit - buf; - cstring copy = cstring_copyLength (buf, length); - cstring adv = cstring_advanceWhiteSpace (copy); - - cppReader_error (pfile, message ("#error %s", adv)); - cstring_free (copy); - return 0; -} - -/* - * Report a warning detected by the program we are processing. - * Use the text of the line in the warning message, then continue. - * (We use error because it prints the filename & line#.) - */ - -static int -do_warning (cppReader *pfile, /*@unused@*/ struct directive *keyword, - char *buf, char *limit) -{ - int length = limit - buf; - cstring copy = cstring_copyLength (buf, length); - cstring adv = cstring_advanceWhiteSpace (copy); - cppReader_warning (pfile, message ("#warning %s", adv)); - cstring_free (copy); - return 0; -} - - -/* #ident has already been copied to the output file, so just ignore it. */ - -static int -do_ident (cppReader *pfile, /*@unused@*/ struct directive *keyword, - /*@unused@*/ char *buf, /*@unused@*/ char *limit) -{ - /* Allow #ident in system headers, since that's not user's fault. */ - if (cppReader_isPedantic (pfile) && !cppReader_getBuffer (pfile)->system_header_p) - cppReader_pedwarnLit (pfile, - cstring_makeLiteralTemp ("ANSI C does not allow `#ident'")); - - /* Leave rest of line to be read by later calls to cppGetToken. */ - - return 0; -} - -/* #pragma and its argument line have already been copied to the output file. - Just check for some recognized pragmas that need validation here. */ - -static int -do_pragma (cppReader *pfile, /*@unused@*/ struct directive *keyword, - /*@unused@*/ char *buf, /*@unused@*/ char *limit) -{ - while (*buf == ' ' || *buf == '\t') - { - buf++; - } - - if (!strncmp (buf, "implementation", 14)) { - /* Be quiet about `#pragma implementation' for a file only if it hasn't - been included yet. */ - struct file_name_list *ptr; - char *p = buf + 14, *fname, *inc_fname; - int fname_len; - SKIP_WHITE_SPACE (p); - if (*p == '\n' || *p != '\"') - return 0; - - fname = p + 1; - p = (char *) strchr (fname, '\"'); - fname_len = p != NULL ? p - fname : mstring_length (fname); - - for (ptr = pfile->all_include_files; ptr != NULL; ptr = ptr->next) - { - inc_fname = (char *) strrchr (cstring_toCharsSafe (ptr->fname), CONNECTCHAR); - inc_fname = (inc_fname != NULL) - ? inc_fname + 1 : cstring_toCharsSafe (ptr->fname); - - if ((inc_fname != NULL) - && (strncmp (inc_fname, fname, size_fromInt (fname_len)) == 0)) - { - cpp_setLocation (pfile); - - ppllerror (message ("`#pragma implementation' for `%s' appears " - "after file is included", - cstring_fromChars (fname))); - } - } - } - - return 0; -} - -/* - * handle #if command by - * 1) inserting special `defined' keyword into the hash table - * that gets turned into 0 or 1 by special_symbol (thus, - * if the luser has a symbol called `defined' already, it won't - * work inside the #if command) - * 2) rescan the input into a temporary output buffer - * 3) pass the output buffer to the yacc parser and collect a value - * 4) clean up the mess left from steps 1 and 2. - * 5) call conditional_skip to skip til the next #endif (etc.), - * or not, depending on the value from step 3. - */ - -static int -do_if (cppReader *pfile, /*@unused@*/ struct directive *keyword, - char *buf, char *limit) -{ - HOST_WIDE_INT value = eval_if_expression (pfile, buf, limit - buf); - conditional_skip (pfile, value == 0, T_IF, NULL); - return 0; -} - -/* - * handle a #elif directive by not changing if_stack either. - * see the comment above do_else. - */ - -static int do_elif (cppReader *pfile, /*@unused@*/ struct directive *keyword, - char *buf, char *limit) -{ - if (pfile->if_stack == cppReader_getBuffer (pfile)->if_stack) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("Preprocessor command #elif is not within a conditional")); - return 0; - } - else - { - llassert (pfile->if_stack != NULL); - - if (pfile->if_stack->type != T_IF && pfile->if_stack->type != T_ELIF) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("`#elif' after `#else'")); - - if (pfile->if_stack->fname != NULL - && cppReader_getBuffer (pfile)->fname != NULL - && !cstring_equal (pfile->if_stack->fname, - cppReader_getBuffer (pfile)->nominal_fname)) - fprintf (stderr, ", file %s", cstring_toCharsSafe (pfile->if_stack->fname)); - fprintf (stderr, ")\n"); - } - pfile->if_stack->type = T_ELIF; - } - - if (pfile->if_stack->if_succeeded) - { - skip_if_group (pfile, 0); - } - else - { - HOST_WIDE_INT value = eval_if_expression (pfile, buf, limit - buf); - if (value == 0) - skip_if_group (pfile, 0); - else - { - ++pfile->if_stack->if_succeeded; /* continue processing input */ - output_line_command (pfile, 1, same_file); - } - } - - return 0; -} - -/* - * evaluate a #if expression in BUF, of length LENGTH, - * then parse the result as a C expression and return the value as an int. - */ - -static HOST_WIDE_INT -eval_if_expression (cppReader *pfile, - /*@unused@*/ char *buf, - /*@unused@*/ int length) -{ - HASHNODE *save_defined; - HOST_WIDE_INT value; - size_t old_written = cppReader_getWritten (pfile); - - save_defined = cppReader_install ("defined", -1, T_SPEC_DEFINED, 0, 0, -1); - pfile->pcp_inside_if = 1; - - value = cppReader_parseExpression (pfile); - pfile->pcp_inside_if = 0; - - /* Clean up special symbol */ - cppReader_deleteMacro (save_defined); - - cppReader_setWritten (pfile, old_written); /* Pop */ - - return value; -} - -/* - * routine to handle ifdef/ifndef. Try to look up the symbol, - * then do or don't skip to the #endif/#else/#elif depending - * on what directive is actually being processed. - */ - -static int -do_xifdef (cppReader *pfile, struct directive *keyword, - /*@unused@*/ char *unused1, /*@unused@*/ char *unused2) -{ - int skip; - cppBuffer *ip = cppReader_getBuffer (pfile); - char *ident; - int ident_length; - enum cpp_token token; - int start_of_file = 0; - char *control_macro = 0; - size_t old_written = cppReader_getWritten (pfile); - - DPRINTF (("do xifdef: %d", - keyword->type == T_IFNDEF)); - - /* Detect a #ifndef at start of file (not counting comments). */ - if (cstring_isDefined (ip->fname) && keyword->type == T_IFNDEF) - { - start_of_file = pfile->only_seen_white == 2; - } - - pfile->no_macro_expand++; - token = get_directive_token (pfile); - pfile->no_macro_expand--; - - ident = pfile->token_buffer + old_written; - ident_length = size_toInt (cppReader_getWritten (pfile) - old_written); - cppReader_setWritten (pfile, old_written); /* Pop */ - - if (token == CPP_VSPACE || token == CPP_POP || token == CPP_EOF) - { - skip = (keyword->type == T_IFDEF); - if (! cppReader_isTraditional (pfile)) - { - cppReader_pedwarn (pfile, - message ("`#%s' with no argument", keyword->name)); - } - } - else if (token == CPP_NAME) - { - HASHNODE *hp = cppReader_lookup (ident, ident_length, -1); - skip = (keyword->type == T_IFDEF) - ? (hp == NULL) : (hp != NULL); - - DPRINTF (("hp null: %d / %d / %d", - (hp == NULL), - (keyword->type == T_IFNDEF), - skip)); - - if (start_of_file && !skip) - { - DPRINTF (("Not skipping!")); - control_macro = (char *) dmalloc (size_fromInt (ident_length + 1)); - memcpy (control_macro, ident, size_fromInt (ident_length + 1)); - } - } - else - { - skip = (keyword->type == T_IFDEF); - if (! cppReader_isTraditional (pfile)) - { - cppReader_error (pfile, - message ("`#%s' with invalid argument", keyword->name)); - } - } - - if (!cppReader_isTraditional (pfile)) - { - int c; - cppSkipHspace (pfile); - c = cppReader_peekC (pfile); - if (c != EOF && c != '\n') - { - cppReader_pedwarn (pfile, - message ("garbage at end of `#%s' argument", keyword->name)); - } - } - - cppReader_skipRestOfLine (pfile); - - DPRINTF (("Conditional skip: %d", skip)); - conditional_skip (pfile, skip, T_IF, control_macro); - return 0; -} - -/* Push TYPE on stack; then, if SKIP is nonzero, skip ahead. - If this is a #ifndef starting at the beginning of a file, - CONTROL_MACRO is the macro name tested by the #ifndef. - Otherwise, CONTROL_MACRO is 0. */ - -static void -conditional_skip (cppReader *pfile, int skip, - enum node_type type, - /*@dependent@*/ char *control_macro) -{ - cppIfStackFrame *temp = (cppIfStackFrame *) dmalloc (sizeof (*temp)); - - temp->fname = cppReader_getBuffer (pfile)->nominal_fname; - temp->next = pfile->if_stack; - temp->control_macro = control_macro; - temp->lineno = 0; - temp->if_succeeded = 0; - - pfile->if_stack = temp; - pfile->if_stack->type = type; - - if (skip != 0) - { - skip_if_group (pfile, 0); - return; - } - else - { - ++pfile->if_stack->if_succeeded; - output_line_command (pfile, 1, same_file); - } -} - -/* - * skip to #endif, #else, or #elif. adjust line numbers, etc. - * leaves input ptr at the sharp sign found. - * If ANY is nonzero, return at next directive of any sort. - */ - -static void -skip_if_group (cppReader *pfile, int any) -{ - int c; - struct directive *kt; - cppIfStackFrame *save_if_stack = pfile->if_stack; /* don't pop past here */ - register int ident_length; - char *ident; - struct parse_marker line_start_mark; - - parseSetMark (&line_start_mark, pfile); - - if (CPPOPTIONS (pfile)->output_conditionals) { - static char failed[] = "#failed\n"; - cppReader_puts (pfile, failed, sizeof(failed)-1); - pfile->lineno++; - output_line_command (pfile, 1, same_file); - } - -beg_of_line: - if (CPPOPTIONS (pfile)->output_conditionals) - { - cppBuffer *pbuf = cppReader_getBuffer (pfile); - char *start_line; - - llassert (pbuf->buf != NULL); - - start_line = pbuf->buf + line_start_mark.position; - cppReader_puts (pfile, start_line, size_fromInt (pbuf->cur - start_line)); - } - - parseMoveMark (&line_start_mark, pfile); - - if (!cppReader_isTraditional (pfile)) - { - cppSkipHspace (pfile); - } - - c = cppReader_getC (pfile); - if (c == '#') - { - size_t old_written = cppReader_getWritten (pfile); - cppSkipHspace (pfile); - - parse_name (pfile, cppReader_getC (pfile)); - ident_length = size_toInt (cppReader_getWritten (pfile) - old_written); - ident = pfile->token_buffer + old_written; - pfile->limit = ident; - - for (kt = directive_table; kt->length >= 0; kt++) - { - cppIfStackFrame *temp; - if (ident_length == kt->length - && cstring_equalPrefix (kt->name, ident)) - { - /* If we are asked to return on next directive, do so now. */ - if (any) - { - goto done; - } - - switch (kt->type) - { - case T_IF: - case T_IFDEF: - case T_IFNDEF: - temp = (cppIfStackFrame *) dmalloc (sizeof (*temp)); - temp->next = pfile->if_stack; - temp->fname = cppReader_getBuffer (pfile)->nominal_fname; - temp->type = kt->type; - temp->lineno = 0; - temp->if_succeeded = 0; - temp->control_macro = NULL; - - pfile->if_stack = temp; - /*@switchbreak@*/ break; - case T_ELSE: - case T_ENDIF: - if (cppReader_isPedantic (pfile) && pfile->if_stack != save_if_stack) - validate_else (pfile, - cstring_makeLiteralTemp (kt->type == T_ELSE ? "#else" : "#endif")); - /*@fallthrough@*/ - case T_ELIF: - if (pfile->if_stack == cppReader_getBuffer (pfile)->if_stack) - { - cppReader_error (pfile, - message ("Preprocessor command #%s is not within a conditional", kt->name)); - /*@switchbreak@*/ break; - } - else if (pfile->if_stack == save_if_stack) - { - goto done; /* found what we came for */ - } - else - { - ; - } - - if (kt->type != T_ENDIF) - { - llassert (pfile->if_stack != NULL); - - if (pfile->if_stack->type == T_ELSE) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("`#else' or `#elif' after `#else'")); - } - - pfile->if_stack->type = kt->type; - /*@switchbreak@*/ break; - } - - temp = pfile->if_stack; - llassert (temp != NULL); - pfile->if_stack = temp->next; - sfree (temp); - /*@switchbreak@*/ break; - default: ; - /*@-branchstate@*/ - } - /*@=branchstate@*/ - break; - } - - /* Don't let erroneous code go by. */ - - if (kt->length < 0 && !CPPOPTIONS (pfile)->lang_asm - && cppReader_isPedantic (pfile)) - { - cppReader_pedwarnLit (pfile, - cstring_makeLiteralTemp ("Invalid preprocessor directive name")); - } - } - - c = cppReader_getC (pfile); - } - /* We're in the middle of a line. Skip the rest of it. */ - for (;;) { - switch (c) - { - size_t old; - case EOF: - goto done; - case '/': /* possible comment */ - c = skip_comment (pfile, NULL); - if (c == EOF) - goto done; - /*@switchbreak@*/ break; - case '\"': - case '\'': - cppReader_forward (pfile, -1); - old = cppReader_getWritten (pfile); - (void) cppGetToken (pfile); - cppReader_setWritten (pfile, old); - /*@switchbreak@*/ break; - case '\\': - /* Char after backslash loses its special meaning. */ - if (cppReader_peekC (pfile) == '\n') - { - cppReader_forward (pfile, 1); - } - - /*@switchbreak@*/ break; - case '\n': - goto beg_of_line; - } - c = cppReader_getC (pfile); - } -done: - if (CPPOPTIONS (pfile)->output_conditionals) { - static char end_failed[] = "#endfailed\n"; - cppReader_puts (pfile, end_failed, sizeof(end_failed)-1); - pfile->lineno++; - } - pfile->only_seen_white = 1; - - parseGotoMark (&line_start_mark, pfile); - parseClearMark (&line_start_mark); -} - -/* - * handle a #else directive. Do this by just continuing processing - * without changing if_stack ; this is so that the error message - * for missing #endif's etc. will point to the original #if. It - * is possible that something different would be better. - */ - -static int -do_else (cppReader *pfile, /*@unused@*/ struct directive *keyword, - /*@unused@*/ char *buf, /*@unused@*/ char *limit) -{ - if (cppReader_isPedantic (pfile)) - { - validate_else (pfile, cstring_makeLiteralTemp ("#else")); - } - - cppReader_skipRestOfLine (pfile); - - if (pfile->if_stack == cppReader_getBuffer (pfile)->if_stack) { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("Preprocessor command #else is not within a conditional")); - return 0; - } else { - /* #ifndef can't have its special treatment for containing the whole file - if it has a #else clause. */ - - llassert (pfile->if_stack != NULL); - - pfile->if_stack->control_macro = 0; - - if (pfile->if_stack->type != T_IF && pfile->if_stack->type != T_ELIF) - { - cpp_setLocation (pfile); - genppllerrorhint (FLG_PREPROC, - message ("Pre-processor directive #else after #else"), - message ("%q: Location of match", - fileloc_unparseRaw (pfile->if_stack->fname, - pfile->if_stack->lineno))); - } - - pfile->if_stack->type = T_ELSE; - } - - if (pfile->if_stack->if_succeeded) - skip_if_group (pfile, 0); - else { - ++pfile->if_stack->if_succeeded; /* continue processing input */ - output_line_command (pfile, 1, same_file); - } - - return 0; -} - -/* - * unstack after #endif command - */ - -static int -do_endif (cppReader *pfile, /*@unused@*/ struct directive *keyword, - /*@unused@*/ char *buf, /*@unused@*/ char *limit) -{ - if (cppReader_isPedantic (pfile)) - { - validate_else (pfile, cstring_makeLiteralTemp ("#endif")); - } - - cppReader_skipRestOfLine (pfile); - - if (pfile->if_stack == cppReader_getBuffer (pfile)->if_stack) - { - cppReader_errorLit (pfile, cstring_makeLiteralTemp ("Unbalanced #endif")); - } - else - { - cppIfStackFrame *temp = pfile->if_stack; - - llassert (temp != NULL); - - pfile->if_stack = temp->next; - if (temp->control_macro != 0) - { - /* This #endif matched a #ifndef at the start of the file. - See if it is at the end of the file. */ - struct parse_marker start_mark; - int c; - - parseSetMark (&start_mark, pfile); - - for (;;) - { - cppSkipHspace (pfile); - c = cppReader_getC (pfile); - - if (c != '\n') - break; - } - - parseGotoMark (&start_mark, pfile); - parseClearMark (&start_mark); - - if (c == EOF) - { - /* If we get here, this #endif ends a #ifndef - that contains all of the file (aside from whitespace). - Arrange not to include the file again - if the macro that was tested is defined. - - Do not do this for the top-level file in a -include or any - file in a -imacros. */ - struct file_name_list *ifile = pfile->all_include_files; - - for ( ; ifile != NULL; ifile = ifile->next) - { - if (cstring_equal (ifile->fname, cppReader_getBuffer (pfile)->fname)) - { - ifile->control_macro = temp->control_macro; - break; - } - } - } - } - - sfree (temp); - output_line_command (pfile, 1, same_file); - } - return 0; -} - -/* When an #else or #endif is found while skipping failed conditional, - if -pedantic was specified, this is called to warn about text after - the command name. P points to the first char after the command name. */ - -static void -validate_else (cppReader *pfile, cstring directive) -{ - int c; - cppSkipHspace (pfile); - c = cppReader_peekC (pfile); - if (c != EOF && c != '\n') - { - cppReader_pedwarn (pfile, - message ("text following `%s' violates ANSI standard", directive)); - } -} - -/* -** Get the next token, and add it to the text in pfile->token_buffer. -** Return the kind of token we got. -*/ - -enum cpp_token -cppGetToken (cppReader *pfile) -{ - int c, c2, c3; - size_t old_written = 0; - int start_line, start_column; - enum cpp_token token; - struct cppOptions *opts = CPPOPTIONS (pfile); - cppReader_getBuffer (pfile)->prev = cppReader_getBuffer (pfile)->cur; - -get_next: - c = cppReader_getC (pfile); - - if (c == EOF) - { - handle_eof: - if (cppReader_getBuffer (pfile)->seen_eof) - { - cppBuffer *buf = cppReader_popBuffer (pfile); - - if (buf != cppReader_nullBuffer (pfile)) - { - goto get_next; - } - else - { - return CPP_EOF; - } - } - else - { - cppBuffer *next_buf = cppBuffer_prevBuffer (cppReader_getBuffer (pfile)); - cppReader_getBuffer (pfile)->seen_eof = 1; - - if (cstring_isDefined (cppReader_getBuffer (pfile)->nominal_fname) - && next_buf != cppReader_nullBuffer (pfile)) - { - /* We're about to return from an #include file. - Emit #line information now (as part of the CPP_POP) result. - But the #line refers to the file we will pop to. */ - cppBuffer *cur_buffer = CPPBUFFER (pfile); - CPPBUFFER (pfile) = next_buf; - pfile->input_stack_listing_current = 0; - output_line_command (pfile, 0, leave_file); - CPPBUFFER (pfile) = cur_buffer; - } - return CPP_POP; - } - } - else - { - long newlines; - struct parse_marker start_mark; - - switch (c) - { - case '/': - if (cppReader_peekC (pfile) == '=') - { - goto op2; - } - - if (opts->put_out_comments) - { - parseSetMark (&start_mark, pfile); - } - - newlines = 0; - cppBuffer_lineAndColumn (cppReader_fileBuffer (pfile), - &start_line, &start_column); - c = skip_comment (pfile, &newlines); - - if (opts->put_out_comments && (c == '/' || c == EOF)) - { - assertSet (&start_mark); - parseClearMark (&start_mark); - } - - if (c == '/') - goto randomchar; - if (c == EOF) - { - cppReader_errorWithLine (pfile, start_line, start_column, - cstring_makeLiteral ("Unterminated comment")); - goto handle_eof; - } - c = '/'; /* Initial letter of comment. */ - return_comment: - /* Comments are equivalent to spaces. - For -traditional, a comment is equivalent to nothing. */ - - if (opts->put_out_comments) - { - enum cpp_token res; - - assertSet (&start_mark); - res = cpp_handleComment (pfile, &start_mark); - pfile->lineno += newlines; - return res; - } - else if (cppReader_isTraditional (pfile)) - { - return CPP_COMMENT; - } - else - { - cppReader_reserve(pfile, 1); - cppReader_putCharQ (pfile, ' '); - return CPP_HSPACE; - } - - case '#': - if (!pfile->only_seen_white) - { - goto randomchar; - } - - if (cppReader_handleDirective (pfile)) - { - return CPP_DIRECTIVE; - } - - pfile->only_seen_white = 0; - return CPP_OTHER; - - case '\"': - case '\'': - /* A single quoted string is treated like a double -- some - programs (e.g., troff) are perverse this way */ - cppBuffer_lineAndColumn (cppReader_fileBuffer (pfile), - &start_line, &start_column); - old_written = cppReader_getWritten (pfile); - string: - cppReader_putChar (pfile, c); - while (TRUE) - { - int cc = cppReader_getC (pfile); - if (cc == EOF) - { - if (cppBuffer_isMacro (CPPBUFFER (pfile))) - { - /* try harder: this string crosses a macro expansion - boundary. This can happen naturally if -traditional. - Otherwise, only -D can make a macro with an unmatched - quote. */ - cppBuffer *next_buf - = cppBuffer_prevBuffer (cppReader_getBuffer (pfile)); - (*cppReader_getBuffer (pfile)->cleanup) - (cppReader_getBuffer (pfile), pfile); - CPPBUFFER (pfile) = next_buf; - continue; - } - if (!cppReader_isTraditional (pfile)) - { - cpp_setLocation (pfile); - - setLine (long_toInt (start_line)); - setColumn (long_toInt (start_column)); - - if (pfile->multiline_string_line != long_toInt (start_line) - && pfile->multiline_string_line != 0) - { - genppllerrorhint - (FLG_PREPROC, - message ("Unterminated string or character constant"), - message ("%q: Possible real start of unterminated constant", - fileloc_unparseRaw - (fileloc_filename (g_currentloc), - pfile->multiline_string_line))); - pfile->multiline_string_line = 0; - } - else - { - genppllerror - (FLG_PREPROC, - message ("Unterminated string or character constant")); - } - } - /*@loopbreak@*/ break; - } - cppReader_putChar (pfile, cc); - switch (cc) - { - case '\n': - /* Traditionally, end of line ends a string constant with - no error. So exit the loop and record the new line. */ - if (cppReader_isTraditional (pfile)) - goto while2end; - if (c == '\'') - { - goto while2end; - } - if (cppReader_isPedantic (pfile) - && pfile->multiline_string_line == 0) - { - cppReader_pedwarnWithLine - (pfile, long_toInt (start_line), - long_toInt (start_column), - cstring_makeLiteral ("String constant runs past end of line")); - } - if (pfile->multiline_string_line == 0) - { - pfile->multiline_string_line = start_line; - } - - /*@switchbreak@*/ break; - - case '\\': - cc = cppReader_getC (pfile); - if (cc == '\n') - { - /* Backslash newline is replaced by nothing at all. */ - cppReader_adjustWritten (pfile, -1); - pfile->lineno++; - } - else - { - /* ANSI stupidly requires that in \\ the second \ - is *not* prevented from combining with a newline. */ - NEWLINE_FIX1(cc); - if (cc != EOF) - cppReader_putChar (pfile, cc); - } - /*@switchbreak@*/ break; - - case '\"': - case '\'': - if (cc == c) - goto while2end; - /*@switchbreak@*/ break; - } - } - while2end: - pfile->lineno += count_newlines (pfile->token_buffer + old_written, - cppReader_getPWritten (pfile)); - pfile->only_seen_white = 0; - return c == '\'' ? CPP_CHAR : CPP_STRING; - - case '$': - if (!opts->dollars_in_ident) - goto randomchar; - goto letter; - - case ':': - if (opts->cplusplus && cppReader_peekC (pfile) == ':') - goto op2; - goto randomchar; - - case '&': - case '+': - case '|': - NEWLINE_FIX; - c2 = cppReader_peekC (pfile); - if (c2 == c || c2 == '=') - goto op2; - goto randomchar; - - case '*': - case '!': - case '%': - case '=': - case '^': - NEWLINE_FIX; - if (cppReader_peekC (pfile) == '=') - goto op2; - goto randomchar; - - case '-': - NEWLINE_FIX; - c2 = cppReader_peekC (pfile); - if (c2 == '-' && opts->chill) - { - /* Chill style comment */ - if (opts->put_out_comments) - { - parseSetMark (&start_mark, pfile); - } - - cppReader_forward (pfile, 1); /* Skip second '-'. */ - - for (;;) - { - c = cppReader_getC (pfile); - if (c == EOF) - /*@loopbreak@*/ break; - if (c == '\n') - { - /* Don't consider final '\n' to be part of comment. */ - cppReader_forward (pfile, -1); - /*@loopbreak@*/ break; - } - } - c = '-'; - goto return_comment; - } - if (c2 == '-' || c2 == '=' || c2 == '>') - goto op2; - goto randomchar; - - case '<': - if (pfile->parsing_include_directive) - { - for (;;) - { - cppReader_putChar (pfile, c); - if (c == '>') - /*@loopbreak@*/ break; - c = cppReader_getC (pfile); - NEWLINE_FIX1 (c); - if (c == '\n' || c == EOF) - { - cppReader_errorLit (pfile, - cstring_makeLiteralTemp ("Missing '>' in \"#include \"")); - /*@loopbreak@*/ break; - } - } - return CPP_STRING; - } - /*@fallthrough@*/ - case '>': - NEWLINE_FIX; - c2 = cppReader_peekC (pfile); - if (c2 == '=') - goto op2; - if (c2 != c) - goto randomchar; - cppReader_forward (pfile, 1); - cppReader_reserve (pfile, 4); - cppReader_putChar (pfile, c); - cppReader_putChar (pfile, c2); - NEWLINE_FIX; - c3 = cppReader_peekC (pfile); - if (c3 == '=') - cppReader_putCharQ (pfile, cppReader_getC (pfile)); - cppReader_nullTerminateQ (pfile); - pfile->only_seen_white = 0; - return CPP_OTHER; - - case '@': - if (cppReader_getBuffer (pfile)->has_escapes) - { - c = cppReader_getC (pfile); - if (c == '-') - { - if (pfile->output_escapes) - cppReader_puts (pfile, "@-", 2); - parse_name (pfile, cppReader_getC (pfile)); - return CPP_NAME; - } - else if (is_space [c]) - { - cppReader_reserve (pfile, 2); - if (pfile->output_escapes) - cppReader_putCharQ (pfile, '@'); - cppReader_putCharQ (pfile, c); - return CPP_HSPACE; - } - else - { - ; - } - } - if (pfile->output_escapes) - { - cppReader_puts (pfile, "@@", 2); - return CPP_OTHER; - } - goto randomchar; - case '.': - NEWLINE_FIX; - c2 = cppReader_peekC (pfile); - if (isdigit(c2)) - { - cppReader_reserve(pfile, 2); - cppReader_putCharQ (pfile, '.'); - c = cppReader_getC (pfile); - goto number; - } - - /* FIXME - misses the case "..\\\n." */ - if (c2 == '.' && cpp_peekN (pfile, 1) == '.') - { - cppReader_reserve(pfile, 4); - cppReader_putCharQ (pfile, '.'); - cppReader_putCharQ (pfile, '.'); - cppReader_putCharQ (pfile, '.'); - cppReader_forward (pfile, 2); - cppReader_nullTerminateQ (pfile); - pfile->only_seen_white = 0; - return CPP_3DOTS; - } - goto randomchar; - op2: - token = CPP_OTHER; - pfile->only_seen_white = 0; - op2any: - cppReader_reserve(pfile, 3); - cppReader_putCharQ (pfile, c); - cppReader_putCharQ (pfile, cppReader_getC (pfile)); - cppReader_nullTerminateQ (pfile); - return token; - - case 'L': - NEWLINE_FIX; - c2 = cppReader_peekC (pfile); - if ((c2 == '\'' || c2 == '\"') && !cppReader_isTraditional (pfile)) - { - cppReader_putChar (pfile, c); - c = cppReader_getC (pfile); - goto string; - } - goto letter; - - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - number: - c2 = '.'; - for (;;) - { - cppReader_reserve (pfile, 2); - cppReader_putCharQ (pfile, c); - NEWLINE_FIX; - c = cppReader_peekC (pfile); - if (c == EOF) - /*@loopbreak@*/ break; - if (!is_idchar[c] && c != '.' - && ((c2 != 'e' && c2 != 'E' - && ((c2 != 'p' && c2 != 'P') || cppReader_isC89 (pfile))) - || (c != '+' && c != '-'))) - /*@loopbreak@*/ break; - cppReader_forward (pfile, 1); - c2= c; - } - - cppReader_nullTerminateQ (pfile); - pfile->only_seen_white = 0; - return CPP_NUMBER; - - case 'b': case 'c': case 'd': case 'h': case 'o': - case 'B': case 'C': case 'D': case 'H': case 'O': - if (opts->chill && cppReader_peekC (pfile) == '\'') - { - pfile->only_seen_white = 0; - cppReader_reserve (pfile, 2); - cppReader_putCharQ (pfile, c); - cppReader_putCharQ (pfile, '\''); - cppReader_forward (pfile, 1); - for (;;) - { - c = cppReader_getC (pfile); - if (c == EOF) - goto chill_number_eof; - if (!is_idchar[c]) - { - if (c == '\\' && cppReader_peekC (pfile) == '\n') - { - cppReader_forward (pfile, 2); - continue; - } - /*@loopbreak@*/ break; - } - cppReader_putChar (pfile, c); - } - if (c == '\'') - { - cppReader_reserve (pfile, 2); - cppReader_putCharQ (pfile, c); - cppReader_nullTerminateQ (pfile); - return CPP_STRING; - } - else - { - cppReader_forward (pfile, -1); - chill_number_eof: - cppReader_nullTerminate (pfile); - return CPP_NUMBER; - } - } - else - goto letter; - case '_': - case 'a': case 'e': case 'f': case 'g': case 'i': case 'j': - case 'k': case 'l': case 'm': case 'n': case 'p': case 'q': - case 'r': case 's': case 't': case 'u': case 'v': case 'w': - case 'x': case 'y': case 'z': - case 'A': case 'E': case 'F': case 'G': case 'I': case 'J': - case 'K': case 'M': case 'N': case 'P': case 'Q': case 'R': - case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': - case 'Y': case 'Z': - letter: - { - HASHNODE *hp; - char *ident; - size_t before_name_written = cppReader_getWritten (pfile); - int ident_len; - parse_name (pfile, c); - pfile->only_seen_white = 0; - if (pfile->no_macro_expand) - { - return CPP_NAME; - } - - ident = pfile->token_buffer + before_name_written; - ident_len = (cppReader_getPWritten (pfile)) - ident; - - hp = cppReader_lookupExpand (ident, ident_len, -1); - - if (hp == NULL) - { - return CPP_NAME; - } - - if (hp->type == T_DISABLED) - { - if (pfile->output_escapes) - { /* Return "@-IDENT", followed by '\0'. */ - int i; - cppReader_reserve (pfile, 3); - ident = pfile->token_buffer + before_name_written; - cppReader_adjustWritten (pfile, 2); - - for (i = ident_len; i >= 0; i--) - { - ident[i+2] = ident[i]; - } - - ident[0] = '@'; - ident[1] = '-'; - } - return CPP_NAME; - } - - /* If macro wants an arglist, verify that a '(' follows. - first skip all whitespace, copying it to the output - after the macro name. Then, if there is no '(', - decide this is not a macro call and leave things that way. */ - - if (hp->type == T_MACRO && hp->value.defn->nargs >= 0) - { - struct parse_marker macro_mark; - int is_macro_call; - - while (cppBuffer_isMacro (CPPBUFFER (pfile))) - { - cppBuffer *next_buf; - cppSkipHspace (pfile); - if (cppReader_peekC (pfile) != EOF) - { - /*@loopbreak@*/ break; - } - - next_buf = cppBuffer_prevBuffer (cppReader_getBuffer (pfile)); - (*cppReader_getBuffer (pfile)->cleanup) (cppReader_getBuffer (pfile), pfile); - CPPBUFFER (pfile) = next_buf; - } - - parseSetMark (¯o_mark, pfile); - - for (;;) - { - cppSkipHspace (pfile); - c = cppReader_peekC (pfile); - is_macro_call = c == '('; - if (c != '\n') - /*@loopbreak@*/ break; - cppReader_forward (pfile, 1); - } - - if (!is_macro_call) - { - parseGotoMark (¯o_mark, pfile); - } - - parseClearMark (¯o_mark); - - if (!is_macro_call) - { - return CPP_NAME; - } - } - /* This is now known to be a macro call. */ - - /* it might not actually be a macro. */ - if (hp->type != T_MACRO) - { - size_t xbuf_len; - char *xbuf; - - cppReader_setWritten (pfile, before_name_written); - special_symbol (hp, pfile); - xbuf_len = cppReader_getWritten (pfile) - before_name_written; - xbuf = (char *) dmalloc (xbuf_len + 1); - cppReader_setWritten (pfile, before_name_written); - memcpy (xbuf, cppReader_getPWritten (pfile), xbuf_len + 1); - push_macro_expansion (pfile, xbuf, xbuf_len, hp); - } - else - { - /* Expand the macro, reading arguments as needed, - and push the expansion on the input stack. */ - macroexpand (pfile, hp); - cppReader_setWritten (pfile, before_name_written); - } - - /* An extra "@ " is added to the end of a macro expansion - to prevent accidental token pasting. We prefer to avoid - unneeded extra spaces (for the sake of cpp-using tools like - imake). Here we remove the space if it is safe to do so. */ - - llassert (pfile->buffer->rlimit != NULL); - - if (pfile->buffer->rlimit - pfile->buffer->cur >= 3 - && pfile->buffer->rlimit[-2] == '@' - && pfile->buffer->rlimit[-1] == ' ') - { - int c1 = pfile->buffer->rlimit[-3]; - int cl2 = cppBufPeek (cppBuffer_prevBuffer (CPPBUFFER (pfile))); - - if (cl2 == EOF || !unsafe_chars ((char) c1, (char) cl2)) - pfile->buffer->rlimit -= 2; - } - } - goto get_next; - - case ' ': case '\t': case '\v': case '\r': - for (;;) - { - cppReader_putChar (pfile, c); - c = cppReader_peekC (pfile); - if (c == EOF || !is_hor_space[c]) - /*@loopbreak@*/ break; - cppReader_forward (pfile, 1); - } - return CPP_HSPACE; - - case '\\': - c2 = cppReader_peekC (pfile); - if (c2 != '\n') - goto randomchar; - token = CPP_HSPACE; - goto op2any; - - case '\n': - cppReader_putChar (pfile, c); - if (pfile->only_seen_white == 0) - pfile->only_seen_white = 1; - pfile->lineno++; - output_line_command (pfile, 1, same_file); - return CPP_VSPACE; - - case '(': token = CPP_LPAREN; goto char1; - case ')': token = CPP_RPAREN; goto char1; - case '{': token = CPP_LBRACE; goto char1; - case '}': token = CPP_RBRACE; goto char1; - case ',': token = CPP_COMMA; goto char1; - case ';': token = CPP_SEMICOLON; goto char1; - - randomchar: - default: - token = CPP_OTHER; - char1: - pfile->only_seen_white = 0; - cppReader_putChar (pfile, c); - return token; - } - } - - BADBRANCH; - /*@notreached@*/ -} - -/* Parse an identifier starting with C. */ - -void -parse_name (cppReader *pfile, int c) -{ - for (;;) - { - if (!is_idchar[c]) - { - if (c == '\\' && cppReader_peekC (pfile) == '\n') - { - cppReader_forward (pfile, 2); - continue; - } - - cppReader_forward (pfile, -1); - break; - } - - if (c == '$' && cppReader_isPedantic (pfile)) - { - cppReader_pedwarnLit (pfile, - cstring_makeLiteralTemp ("`$' in identifier")); - } - - cppReader_reserve(pfile, 2); /* One more for final NUL. */ - cppReader_putCharQ (pfile, c); - c = cppReader_getC (pfile); - - if (c == EOF) - break; - } - - cppReader_nullTerminateQ (pfile); -} - -/* The file_name_map structure holds a mapping of file names for a - particular directory. This mapping is read from the file named - FILE_NAME_MAP_FILE in that directory. Such a file can be used to - map filenames on a file system with severe filename restrictions, - such as DOS. The format of the file name map file is just a series - of lines with two tokens on each line. The first token is the name - to map, and the second token is the actual name to use. */ - -struct file_name_map -{ - struct file_name_map *map_next; - cstring map_from; - cstring map_to; -}; - -/*@constant observer char *FILE_NAME_MAP_FILE*/ -#define FILE_NAME_MAP_FILE "header.gcc" - -/* Read a space delimited string of unlimited length from a stdio - file. */ - -static cstring read_filename_string (int ch, FILE *f) -{ - char *alloc, *set; - size_t len; - - len = 20; - set = alloc = dmalloc (len + 1); - - if (!is_space[ch]) - { - *set++ = ch; - while ((ch = getc (f)) != EOF && ! is_space[ch]) - { - if (set - alloc == size_toInt (len)) - { - len *= 2; - alloc = drealloc (alloc, len + 1); - set = alloc + len / 2; - /*@-branchstate@*/ } - - *set++ = ch; - } /*@=branchstate@*/ - } - *set = '\0'; - check (ungetc (ch, f) != EOF); - - return cstring_fromChars (alloc); -} - -/* This structure holds a linked list of file name maps, one per directory. */ - -struct file_name_map_list -{ - struct file_name_map_list *map_list_next; - cstring map_list_name; - struct file_name_map *map_list_map; -}; - -/* Read the file name map file for DIRNAME. */ - -static struct file_name_map * -read_name_map (cppReader *pfile, cstring dirname) -{ - struct file_name_map_list *map_list_ptr; - cstring name; - FILE *f; - - for (map_list_ptr = CPPOPTIONS (pfile)->map_list; - map_list_ptr != NULL; - map_list_ptr = map_list_ptr->map_list_next) - { - if (cstring_equal (map_list_ptr->map_list_name, dirname)) - { - return map_list_ptr->map_list_map; - } - } - - map_list_ptr = (struct file_name_map_list *) dmalloc (sizeof (*map_list_ptr)); - map_list_ptr->map_list_name = cstring_copy (dirname); - map_list_ptr->map_list_map = NULL; - - name = cstring_copy (dirname); - - if (cstring_length (dirname) > 0) - { - name = cstring_appendChar (name, CONNECTCHAR); - } - - name = cstring_concatFree1 (name, cstring_makeLiteralTemp (FILE_NAME_MAP_FILE)); - - f = fopen (cstring_toCharsSafe (name), "r"); - cstring_free (name); - - if (f == NULL) - { - map_list_ptr->map_list_map = NULL; - } - else - { - int ch; - - while ((ch = getc (f)) != EOF) - { - cstring from, to; - struct file_name_map *ptr; - - if (is_space[ch]) - { - continue; - } - - from = read_filename_string (ch, f); - while ((ch = getc (f)) != EOF && is_hor_space[ch]) - { - ; - } - - to = read_filename_string (ch, f); - - ptr = (struct file_name_map *) dmalloc (sizeof (*ptr)); - ptr->map_from = from; - - /* Make the real filename absolute. */ - if (cstring_length (to) > 1 - && osd_isConnectChar (cstring_firstChar (to))) - { - ptr->map_to = to; - } - else - { - ptr->map_to = cstring_copy (dirname); - ptr->map_to = cstring_appendChar (ptr->map_to, CONNECTCHAR); - ptr->map_to = cstring_concatFree (ptr->map_to, to); - } - - ptr->map_next = map_list_ptr->map_list_map; - map_list_ptr->map_list_map = ptr; - - while ((ch = getc (f)) != '\n') - { - if (ch == EOF) - { - /*@innerbreak@*/ break; - } - } - } - - assertSet (map_list_ptr->map_list_map); - check (fclose (f) == 0); - } - - map_list_ptr->map_list_next = pfile->opts->map_list; - pfile->opts->map_list = map_list_ptr; - - return map_list_ptr->map_list_map; -} - -/* Try to open include file FILENAME. SEARCHPTR is the directory - being tried from the include file search path. This function maps - filenames on file systems based on information read by - read_name_map. */ - -static int -open_include_file (cppReader *pfile, - cstring fname, - struct file_name_list *searchptr) -{ - char *filename = cstring_toCharsSafe (fname); - struct file_name_map *map; - char *from; - char *p, *dir; - - cstring_markOwned (fname); - - cpp_setLocation (pfile); - - if (context_getFlag (FLG_NEVERINCLUDE)) - { - if (isHeaderFile (fname)) - { - return SKIP_INCLUDE; - } - } - - if ((searchptr != NULL) && ! searchptr->got_name_map) - { - searchptr->name_map = read_name_map (pfile, - !cstring_isEmpty (searchptr->fname) - ? searchptr->fname : - cstring_makeLiteralTemp (".")); - searchptr->got_name_map = 1; - } - - /* First check the mapping for the directory we are using. */ - - if ((searchptr != NULL) - && (searchptr->name_map != NULL)) - { - from = filename; - - if (!cstring_isEmpty (searchptr->fname)) - { - from += cstring_length (searchptr->fname) + 1; - } - - for (map = searchptr->name_map; - map != NULL; - map = map->map_next) - { - if (cstring_equal (map->map_from, cstring_fromChars (from))) - { - /* - ** Found a match. Check if the file should be skipped - */ - - if (cpp_skipIncludeFile (map->map_to)) - { - return SKIP_INCLUDE; - } - else - { - return cpp_openIncludeFile (cstring_toCharsSafe (map->map_to)); - } - } - } - } - - /* - ** Try to find a mapping file for the particular directory we are - ** looking in. Thus #include will look up sys/types.h - ** in /usr/include/header.gcc and look up types.h in - ** /usr/include/sys/header.gcc. - */ - - p = strrchr (filename, CONNECTCHAR); - - if (p == NULL) - { - p = filename; - } - - if ((searchptr != NULL) - && (cstring_isDefined (searchptr->fname)) - && (cstring_length (searchptr->fname) == p - filename) - && !strncmp (cstring_toCharsSafe (searchptr->fname), - filename, - size_fromInt (p - filename))) - { - /* filename is in SEARCHPTR, which we've already checked. */ - - if (cpp_skipIncludeFile (cstring_fromChars (filename))) - { - return SKIP_INCLUDE; - } - else - { - return cpp_openIncludeFile (filename); - } - } - - if (p == filename) - { - dir = mstring_copy ("."); - from = filename; - } - else - { - dir = (char *) dmalloc (size_fromInt (p - filename + 1)); - memcpy (dir, filename, size_fromInt (p - filename)); - dir[p - filename] = '\0'; - from = p + 1; - } - - for (map = read_name_map (pfile, cstring_fromChars (dir)); - map != NULL; - map = map->map_next) - { - if (cstring_equal (map->map_from, cstring_fromChars (from))) - { - sfree (dir); - - if (cpp_skipIncludeFile (map->map_to)) - { - return SKIP_INCLUDE; - } - else - { - return cpp_openIncludeFile (cstring_toCharsSafe (map->map_to)); - } - } - } - - sfree (dir); - - if (cpp_skipIncludeFile (cstring_fromChars (filename))) - { - return SKIP_INCLUDE; - } - else - { - return cpp_openIncludeFile (filename); - } -} - -/* Process the contents of include file FNAME, already open on descriptor F, - with output to OP. - SYSTEM_HEADER_P is 1 if this file resides in any one of the known - "system" include directories (as decided by the `is_system_include' - function above). - DIRPTR is the link in the dir path through which this file was found, - or 0 if the file name was absolute or via the current directory. - Return 1 on success, 0 on failure. - - The caller is responsible for the cppReader_pushBuffer. */ - -static int -finclude (cppReader *pfile, int f, - cstring fname, - bool system_header_p, - /*@dependent@*/ struct file_name_list *dirptr) -{ - mode_t st_mode; - size_t st_size; - long i; - int length = 0; - cppBuffer *fp; /* For input stack frame */ - - if (file_size_and_mode (f, &st_mode, &st_size) < 0) - { - cppReader_perrorWithName (pfile, fname); - check (close (f) == 0); - (void) cppReader_popBuffer (pfile); - /*@-mustfree@*/ - return 0; - /*@=mustfree@*/ - } - - fp = cppReader_getBuffer (pfile); - - /*@-temptrans@*/ /* fname shouldn't really be temp */ - fp->nominal_fname = fp->fname = fname; - /*@=temptrans@*/ - - fp->dir = dirptr; - fp->system_header_p = system_header_p; - fp->lineno = 1; - fp->colno = 1; - fp->cleanup = cppReader_fileCleanup; - - if (S_ISREG (st_mode)) - { - sfree (fp->buf); - fp->buf = (char *) dmalloc (st_size + 2); - fp->alimit = fp->buf + st_size + 2; - fp->cur = fp->buf; - - /* Read the file contents, knowing that st_size is an upper bound - on the number of bytes we can read. */ - length = safe_read (f, fp->buf, size_toInt (st_size)); - fp->rlimit = fp->buf + length; - if (length < 0) goto nope; - } - else if (S_ISDIR (st_mode)) - { - cppReader_error (pfile, - message ("directory `%s' specified in #include", fname)); - check (close (f) == 0); - return 0; - } - else - { - /* - ** Cannot count its file size before reading. - ** First read the entire file into heap and - ** copy them into buffer on stack. - */ - - size_t bsize = 2000; - - st_size = 0; - - sfree (fp->buf); - fp->buf = (char *) dmalloc (bsize + 2); - - for (;;) { - i = safe_read (f, fp->buf + st_size, size_toInt (bsize - st_size)); - - if (i < 0) - goto nope; /* error! */ - st_size += i; - - if (st_size != bsize) - { - break; /* End of file */ - } - - bsize *= 2; - fp->buf = (char *) drealloc (fp->buf, bsize + 2); - } - - fp->cur = fp->buf; - length = size_toInt (st_size); - } - - if ((length > 0 && fp->buf[length - 1] != '\n') - /* Backslash-newline at end is not good enough. */ - || (length > 1 && fp->buf[length - 2] == '\\')) { - fp->buf[length++] = '\n'; - } - - fp->buf[length] = '\0'; - fp->rlimit = fp->buf + length; - - - /* Close descriptor now, so nesting does not use lots of descriptors. */ - check (close (f) == 0); - - /* Must do this before calling trigraph_pcp, so that the correct file name - will be printed in warning messages. */ - - pfile->input_stack_listing_current = 0; - return 1; - - nope: - - cppReader_perrorWithName (pfile, fname); - check (close (f) == 0); - sfree (fp->buf); - return 1; -} - -void -cppReader_init (cppReader *pfile) -{ - memset ((char *) pfile, 0, sizeof (*pfile)); - - pfile->get_token = cppGetToken; - pfile->token_buffer_size = 200; - pfile->token_buffer = (char *) dmalloc (pfile->token_buffer_size); - pfile->all_include_files = NULL; - - assertSet (pfile); - - cppReader_setWritten (pfile, 0); - - pfile->system_include_depth = 0; - pfile->max_include_len = 0; - pfile->timebuf = NULL; - pfile->only_seen_white = 1; - - pfile->buffer = cppReader_nullBuffer (pfile); -} - -void -cppReader_finish (/*@unused@*/ cppReader *pfile) -{ - ; -} - -/* Free resources used by PFILE. - This is the cppReader 'finalizer' or 'destructor' (in C++ terminology). */ - -void -cppCleanup (cppReader *pfile) -{ - while (CPPBUFFER (pfile) != cppReader_nullBuffer (pfile)) - { - (void) cppReader_popBuffer (pfile); - } - - if (pfile->token_buffer != NULL) - { - sfree (pfile->token_buffer); - pfile->token_buffer = NULL; - } - - while (pfile->if_stack != NULL) - { - cppIfStackFrame *temp = pfile->if_stack; - pfile->if_stack = temp->next; - sfree (temp); - } - - while (pfile->all_include_files != NULL) - { - struct file_name_list *temp = pfile->all_include_files; - pfile->all_include_files = temp->next; - /*@-dependenttrans@*/ - cstring_free (temp->fname); - /*@=dependenttrans@*/ - sfree (temp); - } - - cppReader_hashCleanup (); -} - -/* -** Get the file-mode and data size of the file open on FD -** and store them in *MODE_POINTER and *SIZE_POINTER. -*/ - -static int -file_size_and_mode (int fd, mode_t *mode_pointer, size_t *size_pointer) -{ - struct stat sbuf; - - if (fstat (fd, &sbuf) < 0) { - return (-1); - } - - if (mode_pointer != NULL) - { - *mode_pointer = sbuf.st_mode; - } - - if (size_pointer != NULL) - { - *size_pointer = (size_t) sbuf.st_size; - } - - return 0; -} - -/* Read LEN bytes at PTR from descriptor DESC, for file FILENAME, - retrying if necessary. Return a negative value if an error occurs, - otherwise return the actual number of bytes read, - which must be LEN unless end-of-file was reached. */ - -static int safe_read (int desc, char *ptr, int len) -{ - int left = len; - - while (left > 0) - { -# if defined (WIN32) || defined (OS2) && defined (__IBMC__) - /*@-compdef@*/ /* ptr is an out parameter */ - int nchars = _read (desc, ptr, (unsigned) left); - /*@=compdef@*/ -# else - ssize_t nchars = read (desc, ptr, size_fromInt (left)); -# endif - - if (nchars < 0) - { -#ifdef EINTR - if (errno == EINTR) - continue; -#endif - return (int) nchars; - } - - if (nchars == 0) { - break; - } - - ptr += nchars; - left -= nchars; - } - - return len - left; -} - -/* Initialize PMARK to remember the current position of PFILE. */ - -void -parseSetMark (struct parse_marker *pmark, cppReader *pfile) -{ - cppBuffer *pbuf = cppReader_getBuffer (pfile); - - pmark->next = pbuf->marks; - /*@-temptrans@*/ - pbuf->marks = pmark; - /*@=temptrans@*/ - - pmark->buf = pbuf; - pmark->position = pbuf->cur - pbuf->buf; -} - -/* Cleanup PMARK - we no longer need it. */ - -void parseClearMark (struct parse_marker *pmark) -{ - struct parse_marker **pp = &pmark->buf->marks; - - for (; ; pp = &(*pp)->next) - { - llassert (*pp != NULL); - if (*pp == pmark) break; - } - - *pp = pmark->next; -} - -/* Backup the current position of PFILE to that saved in PMARK. */ - -void -parseGotoMark (struct parse_marker *pmark, cppReader *pfile) -{ - cppBuffer *pbuf = cppReader_getBuffer (pfile); - - if (pbuf != pmark->buf) - { - cpp_setLocation (pfile); - llfatalbug (cstring_makeLiteral ("Internal error parseGotoMark")); - } - - llassert (pbuf->buf != NULL); - pbuf->cur = pbuf->buf + pmark->position; -} - -/* Reset PMARK to point to the current position of PFILE. (Same - as parseClearMark (PMARK), parseSetMark (PMARK, PFILE) but faster. */ - -void -parseMoveMark (struct parse_marker *pmark, cppReader *pfile) -{ - cppBuffer *pbuf = cppReader_getBuffer (pfile); - - if (pbuf != pmark->buf) - { - cpp_setLocation (pfile); - llfatalerror (cstring_makeLiteral ("Internal error parseMoveMark")); - } - - pmark->position = pbuf->cur - pbuf->buf; -} - -void cppReader_initializeReader (cppReader *pfile) -{ - struct cppOptions *opts = CPPOPTIONS (pfile); - char *xp; - - /* The code looks at the defaults through this pointer, rather than through - the constant structure above. This pointer gets changed if an environment - variable specifies other defaults. */ - - struct default_include *include_defaults = include_defaults_array; - - /* Add dirs from CPATH after dirs from -I. */ - /* There seems to be confusion about what CPATH should do, - so for the moment it is not documented. */ - /* Some people say that CPATH should replace the standard include dirs, - but that seems pointless: it comes before them, so it overrides them - anyway. */ - - xp = (char *) getenv ("CPATH"); - - if (xp != 0 && ! opts->no_standard_includes) - { - path_include (pfile, xp); - } - - /* Now that dollars_in_ident is known, initialize is_idchar. */ - initialize_char_syntax (opts); - - /* CppReader_Install __LINE__, etc. Must follow initialize_char_syntax - and option processing. */ - - initialize_builtins (pfile); - - /* Do standard #defines and assertions - that identify system and machine type. */ - - if (!opts->inhibit_predefs) { - char *p = (char *) dmalloc (strlen (predefs) + 1); - strcpy (p, predefs); - - while (*p) - { - char *q; - - while (*p == ' ' || *p == '\t') - { - p++; - } - - /* Handle -D options. */ - if (p[0] == '-' && p[1] == 'D') - { - q = &p[2]; - - while (*p && *p != ' ' && *p != '\t') - { - p++; - } - - if (*p != 0) - { - *p++= 0; - } - - if (opts->debug_output) - { - output_line_command (pfile, 0, same_file); - } - - cppReader_define (pfile, q); - - while (*p == ' ' || *p == '\t') - { - p++; - } - } - else - { - abort (); - } - } - - sfree (p); - } - - opts->done_initializing = 1; - - { /* Read the appropriate environment variable and if it exists - replace include_defaults with the listed path. */ - char *epath = 0; -#ifdef __CYGWIN32__ - char *win32epath; - int win32_buf_size = 0; /* memory we need to allocate */ -#endif - - if (opts->cplusplus) - { - epath = getenv ("CPLUS_INCLUDE_PATH"); - } - else - { - epath = getenv ("C_INCLUDE_PATH"); - } - - /* - ** If the environment var for this language is set, - ** add to the default list of include directories. - */ - - if (epath != NULL) { - char *nstore = (char *) dmalloc (strlen (epath) + 2); - int num_dirs; - char *startp, *endp; - -#ifdef __CYGWIN32__ - /* if we have a posix path list, convert to win32 path list */ - if (cygwin32_posix_path_list_p (epath)) - { - win32_buf_size = cygwin32_posix_to_win32_path_list_buf_size (epath); - win32epath = (char *) dmalloc /*@i4@*/ (win32_buf_size); - cygwin32_posix_to_win32_path_list (epath, win32epath); - epath = win32epath; - } -#endif - for (num_dirs = 1, startp = epath; *startp; startp++) - { - if (*startp == PATH_SEPARATOR) - num_dirs++; - } - - /*@-sizeoftype@*/ - include_defaults - = (struct default_include *) dmalloc ((num_dirs - * sizeof (struct default_include)) - + sizeof (include_defaults_array)); - /*@=sizeoftype@*/ - - startp = endp = epath; - num_dirs = 0; - while (1) { - /* Handle cases like c:/usr/lib:d:/gcc/lib */ - if ((*endp == PATH_SEPARATOR) || *endp == 0) - { - strncpy (nstore, startp, size_fromInt (endp - startp)); - if (endp == startp) - { - strcpy (nstore, "."); - } - else - { - nstore[endp-startp] = '\0'; - } - - include_defaults[num_dirs].fname = cstring_fromCharsNew (nstore); - include_defaults[num_dirs].cplusplus = opts->cplusplus; - include_defaults[num_dirs].cxx_aware = 1; - num_dirs++; - - if (*endp == '\0') - { - break; - } - endp = startp = endp + 1; - } - else - { - endp++; - } - } - /* Put the usual defaults back in at the end. */ - memcpy ((char *) &include_defaults[num_dirs], - (char *) include_defaults_array, - sizeof (include_defaults_array)); - - sfree (nstore); - /*@-branchstate@*/ } /*@=branchstate@*/ - } - - cppReader_appendIncludeChain (pfile, opts->before_system, - opts->last_before_system); - opts->first_system_include = opts->before_system; - - /* Unless -fnostdinc, - tack on the standard include file dirs to the specified list */ - if (!opts->no_standard_includes) { - struct default_include *p = include_defaults; - char *specd_prefix = opts->include_prefix; - char *default_prefix = mstring_copy (GCC_INCLUDE_DIR); - int default_len = 0; - - /* Remove the `include' from /usr/local/lib/gcc.../include. */ - if (default_prefix != NULL) { - if (!strcmp (default_prefix + strlen (default_prefix) - 8, "/include")) { - default_len = strlen (default_prefix) - 7; - default_prefix[default_len] = 0; - } - } - - /* Search "translated" versions of GNU directories. - These have /usr/local/lib/gcc... replaced by specd_prefix. */ - if (specd_prefix != 0 && default_len != 0) - for (p = include_defaults; p->fname != NULL; p++) { - /* Some standard dirs are only for C++. */ - if (!p->cplusplus - || (opts->cplusplus && !opts->no_standard_cplusplus_includes)) { - /* Does this dir start with the prefix? */ - if (!strncmp (cstring_toCharsSafe (p->fname), default_prefix, - size_fromInt (default_len))) - { - /* Yes; change prefix and add to search list. */ - struct file_name_list *nlist - = (struct file_name_list *) dmalloc (sizeof (*nlist)); - size_t this_len = strlen (specd_prefix) + cstring_length (p->fname) - default_len; - char *str = (char *) dmalloc (this_len + 1); - strcpy (str, specd_prefix); - strcat (str, cstring_toCharsSafe (p->fname) + default_len); - - nlist->next = NULL; - nlist->fname = cstring_fromChars (str); - nlist->control_macro = 0; - nlist->c_system_include_path = !p->cxx_aware; - nlist->got_name_map = 0; - - cppReader_addIncludeChain (pfile, nlist); - if (opts->first_system_include == 0) - { - opts->first_system_include = nlist; - } - } - } - } - - /* Search ordinary names for GNU include directories. */ - - for (p = include_defaults; p->fname != NULL; p++) - { - /* Some standard dirs are only for C++. */ - if (!p->cplusplus - || (opts->cplusplus && !opts->no_standard_cplusplus_includes)) - { - struct file_name_list *nlist - = (struct file_name_list *) dmalloc (sizeof (*nlist)); - nlist->control_macro = 0; - nlist->c_system_include_path = !p->cxx_aware; - nlist->fname = p->fname; - nlist->got_name_map = 0; - nlist->next = NULL; - - cppReader_addIncludeChain (pfile, nlist); - - if (opts->first_system_include == 0) - { - opts->first_system_include = nlist; - } - } - } - sfree (default_prefix); - } - - /* Tack the after_include chain at the end of the include chain. */ - cppReader_appendIncludeChain (pfile, opts->after_include, - opts->last_after_include); - - if (opts->first_system_include == 0) - { - opts->first_system_include = opts->after_include; - } - - /* With -v, print the list of dirs to search. */ - if (opts->verbose) { - struct file_name_list *p; - fprintf (stderr, "#include \"...\" search starts here:\n"); - - for (p = opts->include; p != NULL; p = p->next) { - if (p == opts->first_bracket_include) - fprintf (stderr, "#include <...> search starts here:\n"); - - fprintf (stderr, " %s\n", cstring_toCharsSafe (p->fname)); - } - fprintf (stderr, "End of search list.\n"); - } -} - -int cppReader_startProcess (cppReader *pfile, cstring fname) -{ - cppBuffer *fp; - int f; - struct cppOptions *opts = CPPOPTIONS (pfile); - - fp = cppReader_pushBuffer (pfile, NULL, 0); - - if (fp == NULL) - { - return 0; - } - - if (opts->in_fname == NULL) - { - opts->in_fname = cstring_makeLiteralTemp (""); - } - - fp->fname = opts->in_fname; - fp->nominal_fname = fp->fname; - fp->lineno = 0; - - /* Copy the entire contents of the main input file into - the stacked input buffer previously allocated for it. */ - - if (cstring_isEmpty (fname)) - { - fname = cstring_makeLiteralTemp (""); - f = 0; - } - else if ((f = open (cstring_toCharsSafe (fname), O_RDONLY, 0666)) < 0) - { - cppReader_pfatalWithName (pfile, fname); - } - else - { - ; - } - - if (finclude (pfile, f, fname, 0, NULL)) - { - output_line_command (pfile, 0, same_file); - } - - return 1; -} - -static /*@exposed@*/ /*@null@*/ cppBuffer *cppReader_getBuffer (cppReader *pfile) -{ - return pfile->buffer; -} - -/*@exposed@*/ cppBuffer *cppReader_getBufferSafe (cppReader *pfile) -{ - llassert (pfile->buffer != NULL); - return pfile->buffer; -} - -/*@exposed@*/ char *cppLineBase (cppBuffer *buf) -{ - llassert (buf->buf != NULL); - return (buf->buf + buf->line_base); -} - -int cppBufPeek (cppBuffer *buf) -{ - if (buf->cur == NULL || buf->rlimit == NULL) { - return EOF; - } - - if (buf->cur < buf->rlimit) { - return *(buf->cur); - } - - return EOF; -} - -bool cppBuffer_isMacro (cppBuffer *buf) -{ - if (buf != NULL) - { - return (buf->cleanup == cppReader_macroCleanup); - } - - return FALSE; -} - -/* -** Returns true if the macro should be checked, false -** if it should be expanded normally. -*/ - -static bool notparseable = FALSE; /* preceeded by @notparseable@ */ -static bool notfunction = FALSE; /* preceeded by @notfunction@ */ -static bool expectiter = FALSE; /* preceeded by @iter@ */ -static bool expectenditer = FALSE; /* second after @iter@ */ -static bool expectfunction = FALSE; /* preceeded by @function@ */ -static bool expectconstant = FALSE; /* preceeded by @constant@ */ -static bool expectmacro = FALSE; /* preceeded by notfunction or notparseable */ - -static void cpp_setLocation (cppReader *pfile) -{ - fileId fid; - int line; - - if (pfile->buffer != NULL) - { - if (cstring_isDefined (cppReader_getBuffer (pfile)->nominal_fname)) - { - cstring fname = cppReader_getBuffer (pfile)->nominal_fname; - - if (fileTable_exists (context_fileTable (), fname)) - { - fid = fileTable_lookup (context_fileTable (), fname); - } - else - { - fid = fileTable_lookup (context_fileTable (), - cppReader_getBuffer (pfile)->fname); - } - } - else - { - fid = fileTable_lookup (context_fileTable (), - cppReader_getBuffer (pfile)->fname); - } - - line = cppReader_getBuffer (pfile)->lineno; - fileloc_free (g_currentloc); - g_currentloc = fileloc_create (fid, line, 1); - } - else - { - fileloc_free (g_currentloc); - g_currentloc = fileloc_createBuiltin (); - } -} - -static bool cpp_shouldCheckMacro (cppReader *pfile, char *p) /*@*/ -{ - bool checkmacro = FALSE; - bool hasParams = FALSE; - bool noexpand = FALSE; - cstring sname; - char c; - - cpp_setLocation (pfile); - - DPRINTF (("Should check macro? %s", p)); - - if (expectiter || expectconstant || expectenditer) - { - if (expectiter) - { - expectiter = FALSE; - expectenditer = TRUE; - } - else - { - expectiter = FALSE; - expectconstant = FALSE; - expectenditer = FALSE; - } - - if (notfunction || notparseable) - { - notfunction = FALSE; - notparseable = FALSE; - return FALSE; - } - else - { - return TRUE; - } - } - - llassert (*p == '#'); - p++; - - while (*p == ' ' || *p == '\t') - { - p++; - } - - llassert (*p == 'd'); /* define starts */ - - p += 6; - - while (*p == ' ' || *p == '\t') - { - p++; - } - - sname = cstring_fromChars (p); - DPRINTF (("Check macro: %s", sname)); - - while (((c = *p) != ' ') - && c != '\0' && c != '(' - && c != '\t' && c != '\\' && c != '\n' - && !iscntrl (c)) - { - p++; - } - - hasParams = (c == '('); - *p = '\0'; - - - if (notparseable) - { - notparseable = FALSE; - } - else if (notfunction || fileloc_isStandardLib (g_currentloc)) - { - DPRINTF (("Clear notfunction")); - notfunction = FALSE; - } - else - { - if (noexpand) - { - checkmacro = TRUE; - - if (!expectenditer) - { - noexpand = FALSE; - } - } - else - { - if (usymtab_existsReal (sname)) - { - uentry ue = usymtab_lookup (sname); - - DPRINTF (("Lookup macro: %s", uentry_unparse (ue))); - - if (fileloc_isPreproc (uentry_whereLast (ue))) - { - goto macroDne; - } - else - { - if (uentry_isSpecified (ue)) - { - checkmacro = context_getFlag (FLG_SPECMACROS); - } - else - { - if (hasParams) - { - checkmacro = context_getFlag (FLG_LIBMACROS) - || context_getFlag (FLG_FCNMACROS); - } - } - } - } - else - { - macroDne: - DPRINTF (("Macro doesn't exist: %s", bool_unparse (checkmacro))); - - if (fileloc_isSystemFile (g_currentloc) - && context_getFlag (FLG_SYSTEMDIREXPAND)) - { - ; /* don't check this macro */ - DPRINTF (("Don't check 1")); - } - else - { - uentry le; - - if (hasParams) - { - DPRINTF (("Has params...")); - - if (context_getFlag (FLG_FCNMACROS)) - { - if (usymtab_exists (sname)) - { - /* - ** only get here is macro is redefined - ** error reported elsewhere - */ - - DPRINTF (("It exists!")); - } - else - { - /* - ** We make it a forward function, since it might be declared elsewhere. - ** After all headers have been processed, we should check the forward - ** functions. - */ - - fileloc loc = fileloc_makePreproc (g_currentloc); - - /* the line is off-by-one, since the newline was already read */ - decLine (); - - if (expectfunction) - { - expectfunction = FALSE; - } - - le = uentry_makeForwardFunction (sname, - typeId_invalid, loc); - - fileloc_free (loc); - - incLine (); - - /* Do not define here! */ - - (void) usymtab_addEntry (le); - } - - checkmacro = TRUE; - DPRINTF (("Check: TRUE")); - } - else - { - DPRINTF (("Flag FCN_MACROS not set!")); - } - } - else - { - DPRINTF (("No params")); - - if (context_getFlag (FLG_CONSTMACROS)) - { - bool nocontent = FALSE; - - if (c == '\0') - { - nocontent = TRUE; - } - else - { - if (isspace (c)) - { - char *rest = p + 1; - - /* - ** Check if there is nothing after the define. - */ - - while ((*rest) != '\0' && isspace (*rest)) - { - rest++; - } - - if (*rest == '\0') - { - nocontent = TRUE; /* empty macro, don't check */ - } - } - } - - if (usymtab_exists (sname)) - { - ; - } - else - { - fileloc loc = fileloc_makePreproc (g_currentloc); - DPRINTF (("Make constant: %s", sname)); - le = uentry_makeConstant (sname, - ctype_unknown, loc); - (void) usymtab_addEntry (le); - } - - checkmacro = !nocontent; - } - } - } - - if (checkmacro && usymtab_existsType (sname)) - { - DPRINTF (("Making false...")); - decLine (); - ppllerror (message ("Specified type implemented as macro: %s", sname)); - checkmacro = FALSE; - incLine (); - } - } - } - } - - if (!checkmacro) - { - if (usymtab_exists (sname)) - { - uentry ue = usymtab_lookupExpose (sname); - fileloc tloc = fileloc_makePreproc (g_currentloc); - - uentry_setDefined (ue, tloc); - fileloc_free (tloc); - uentry_setUsed (ue, fileloc_undefined); - } - else - { - fileloc tloc = fileloc_makePreproc (g_currentloc); - uentry ue = uentry_makeExpandedMacro (sname, tloc); - DPRINTF (("Make expanded macro: %s", sname)); - DPRINTF (("Not in symbol table: %s", sname)); - - (void) usymtab_addGlobalEntry (ue); - fileloc_free (tloc); - } - } - - *p = c; - DPRINTF (("Returning: %s", bool_unparse (checkmacro))); - return checkmacro; -} - -static enum cpp_token -cpp_handleComment (cppReader *pfile, struct parse_marker *smark) -{ - cppBuffer *pbuf = cppReader_getBuffer (pfile); - char *start; - int len; - bool eliminateComment = FALSE; - - llassert (pbuf->buf != NULL); - - start = pbuf->buf + smark->position; - - llassert (pbuf->cur != NULL); - len = pbuf->cur - start; - - if (start[0] == '*' - && start[1] == context_getCommentMarkerChar ()) - { - int i; - char c = ' '; - char *scomment = start + 2; - - start[0] = BEFORE_COMMENT_MARKER[0]; - start[1] = BEFORE_COMMENT_MARKER[1]; - - llassert (start[len - 2] == '*'); - start[len - 2] = AFTER_COMMENT_MARKER[0]; - - llassert (start[len - 1] == '/'); - start[len - 1] = AFTER_COMMENT_MARKER[1]; - - cppReader_reserve(pfile, size_fromInt (1 + len)); - cppReader_putCharQ (pfile, c); - - cpp_setLocation (pfile); - - if (mstring_equalPrefix (scomment, "ignore")) - { - if (!context_getFlag (FLG_NOCOMMENTS)) - { - context_enterSuppressRegion (); - } - } - else if (mstring_equalPrefix (scomment, "end")) - { - if (!context_getFlag (FLG_NOCOMMENTS)) - { - context_exitSuppressRegion (); - } - } - else if (mstring_equalPrefix (scomment, "notparseable")) - { - notparseable = TRUE; - expectmacro = TRUE; - eliminateComment = TRUE; - } - else if (mstring_equalPrefix (scomment, "notfunction")) - { - notfunction = TRUE; - expectmacro = TRUE; - eliminateComment = TRUE; - } - else if (mstring_equalPrefix (scomment, "iter")) - { - expectiter = TRUE; - } - else if (mstring_equalPrefix (scomment, "function")) - { - expectfunction = TRUE; - } - else if (mstring_equalPrefix (scomment, "constant")) - { - expectconstant = TRUE; - } - else - { - char sChar = *scomment; - - if (sChar == '=' - || sChar == '-' - || sChar == '+') - { - char *rest = scomment + 1; - - if (mstring_equalPrefix (rest, "commentchar")) - { - eliminateComment = TRUE; - - if (sChar == '=') - { - ppllerror (cstring_makeLiteral - ("Cannot restore commentchar")); - } - else - { - char *next = scomment + 12; /* strlen commentchar = 12 */ - - if (*next != ' ' && *next != '\t' && *next != '\n') - { - ppllerror - (message - ("Syntactic commentchar comment is not followed by a " - "whitespace character: %c", - *next)); - } - else - { - char cchar = *(next + 1); - - if (cchar == '\0') - { - ppllerror - (cstring_makeLiteral - ("Cannot set commentchar to NUL")); - } - else - { - context_setCommentMarkerChar (cchar); - /* setComment = TRUE; */ - } - } - } - } - else if (mstring_equalPrefix (rest, "namechecks")) - { - context_fileSetFlag (FLG_NAMECHECKS, - ynm_fromCodeChar (sChar)); - } - else if (mstring_equalPrefix (rest, "macroredef")) - { - context_fileSetFlag (FLG_MACROREDEF, - ynm_fromCodeChar (sChar)); - } - else if (mstring_equalPrefix (rest, "usevarargs")) - { - context_fileSetFlag (FLG_USEVARARGS, - ynm_fromCodeChar (sChar)); - } - else if (mstring_equalPrefix (rest, "nextlinemacros")) - { - context_fileSetFlag (FLG_MACRONEXTLINE, - ynm_fromCodeChar (sChar)); - } - else if (mstring_equalPrefix (rest, "allmacros") - || mstring_equalPrefix (rest, "fcnmacros") - || mstring_equalPrefix (rest, "constmacros")) - { - flagcode fl; - - if (mstring_equalPrefix (rest, "allmacros")) - { - fl = FLG_ALLMACROS; - } - else if (mstring_equalPrefix (rest, "fcnmacros")) - { - fl = FLG_FCNMACROS; - } - else - { - llassert (mstring_equalPrefix (rest, "constmacros")); - fl = FLG_CONSTMACROS; - } - - - context_fileSetFlag (fl, ynm_fromCodeChar (sChar)); - notfunction = FALSE; - } - else - { - ; - } - } - else - { - ; - } - } - - if (eliminateComment) - { - goto removeComment; - } - - /* Replaces comment char's in start with spaces */ - - for (i = 2; i < len - 2; i++) - { - if (start[i] == BEFORE_COMMENT_MARKER[0] - || start[i] == BEFORE_COMMENT_MARKER[1] - || start[i] == context_getCommentMarkerChar ()) - { - start[i] = ' '; - } - } - - cppReader_putStrN (pfile, start, size_fromInt (len)); - parseClearMark (smark); - return CPP_COMMENT; - } - else - { - removeComment: - { - int i; - - /* - ** Output the comment as all spaces so line/column - ** in output file is still correct. - */ - - char c = ' '; - cstring lintcomment = cstring_undefined; - - if (context_getFlag (FLG_LINTCOMMENTS)) - { - if (mstring_equalPrefix (start, "*NOTREACHED*/")) - { - lintcomment = cstring_makeLiteralTemp ("l_notreach"); - } - else if (mstring_equalPrefix (start, "*PRINTFLIKE*/")) - { - lintcomment = cstring_makeLiteralTemp ("l_printfli"); - } - else if (mstring_equalPrefix (start, "*FALLTHROUGH*/")) - { - lintcomment = cstring_makeLiteralTemp ("l_fallthrou"); - } - else if (mstring_equalPrefix (start, "*ARGSUSED*/")) - { - lintcomment = cstring_makeLiteralTemp ("l_argsus"); - } - else if (mstring_equalPrefix (start, "*FALLTHRU*/")) - { - lintcomment = cstring_makeLiteralTemp ("l_fallth"); - } - else - { - lintcomment = cstring_undefined; - } - } - else - { - lintcomment = cstring_undefined; - } - - if (cstring_isDefined (lintcomment)) - { - c = BEFORE_COMMENT_MARKER[0]; - start[0] = BEFORE_COMMENT_MARKER[1]; - - llassert (cstring_length (lintcomment) == len - 3); - - for (i = 1; i < len - 2; i++) - { - start[i] = cstring_getChar (lintcomment, i); - } - - start[len - 2] = AFTER_COMMENT_MARKER[0]; - start[len - 1] = AFTER_COMMENT_MARKER[1]; - } - else - { - /* Replaces char's in start with spaces */ - for (i = 0; i < len; i++) - { - if (start[i] == '/' - && i < len - 1 - && start[i + 1] == '*') { - cppReader_warning - (pfile, - message ("Start comment inside comment")); - } - - if (start[i] != '\n') - { - start[i] = ' '; - } - } - } - - cppReader_reserve (pfile, size_fromInt (1 + len)); - cppReader_putCharQ (pfile, c); - cppReader_putStrN (pfile, start, size_fromInt (len)); - parseClearMark (smark); - return CPP_COMMENT; - } - } -} - -static int cpp_openIncludeFile (char *filename) -{ - int res = open (filename, O_RDONLY, 0666); - - if (res - && !fileTable_exists (context_fileTable (), - cstring_fromChars (filename))) - { - DPRINTF (("Add header: %s", filename)); - (void) fileTable_addHeaderFile (context_fileTable (), - cstring_fromChars (filename)); - } - - return res; -} - -static bool cpp_skipIncludeFile (cstring fname) -{ - if (context_isSystemDir (fname)) - { - DPRINTF (("System dir: %s", fname)); - - if (lcllib_isSkipHeader (fname)) - { - DPRINTF (("Skip include TRUE: %s", fname)); - return TRUE; - } - - if (context_getFlag (FLG_SKIPSYSHEADERS)) - { - DPRINTF (("Skip include TRUE: %s", fname)); - return TRUE; - } - } - - if (context_getFlag (FLG_SINGLEINCLUDE)) - { - fname = cstring_fromChars (removePreDirs (cstring_toCharsSafe (fname))); - -# if defined (WIN32) || defined (OS2) - cstring_replaceAll (fname, '\\', '/'); -# endif - - if (fileTable_exists (context_fileTable (), fname)) - { - DPRINTF (("Skip include TRUE: %s", fname)); - return TRUE; - } - } - - DPRINTF (("Skip include FALSE: %s", fname)); - return FALSE; -} - -static int cpp_peekN (cppReader *pfile, int n) -{ - cppBuffer *buf = cppReader_getBuffer (pfile); - - llassert (buf->cur != NULL); - - return (buf->rlimit - buf->cur >= (n) - ? buf->cur[n] - : EOF); -} - -cppBuffer *cppBuffer_prevBuffer (cppBuffer *buf) -{ - return buf + 1; -} - -void cppBuffer_forward (cppBuffer *buf, int n) -{ - llassert (buf->cur != NULL); - buf->cur += n; -} diff --git a/src/cppmain.c b/src/cppmain.c deleted file mode 100644 index 4095020..0000000 --- a/src/cppmain.c +++ /dev/null @@ -1,222 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** cppmain.c -*/ -/* CPP main program, using CPP Library. - Copyright (C) 1995 Free Software Foundation, Inc. - Written by Per Bothner, 1994-95. - -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - In other words, you are welcome to use, share and improve this program. - You are forbidden to forbid anyone else to use, share and improve - what you give them. Help stamp out software-hoarding! */ - -# include "lclintMacros.nf" -# include "llbasic.h" -# include "cpp.h" -# include "cpplib.h" -# include "cpphash.h" -# include "cpperror.h" -# include "llmain.h" - -# include - -# ifdef WIN32 -/*@-ansireserved@*/ -extern /*@external@*/ /*@observer@*/ char *getenv (const char *); -/*@=ansireserved@*/ -# endif - -/* char *progname; */ - -cppReader g_cppState; - -#ifdef abort -/* More 'friendly' abort that prints the line and file. - config.h can #define abort fancy_abort if you like that sort of thing. */ - -void -fancy_abort () -{ - fatal ("Internal gcc abort."); -} -#endif - -void cppReader_initMod () -{ - struct cppOptions *opts = (struct cppOptions *) dmalloc (sizeof (*opts)); - - cppReader_init (&g_cppState); - llassert (g_cppState.opts == NULL); - g_cppState.opts = opts; - - cppOptions_init (opts); - /*@-compdef@*/ /* g_cppState is not yet innitialized */ -} /*@=compdef@*/ - -void cppReader_initialize () -{ - cppReader_initializeReader (&g_cppState); -} - -int cppProcess (/*@dependent@*/ cstring infile, - /*@dependent@*/ cstring outfile) -{ - FILE *ofile; - struct cppOptions *opts = CPPOPTIONS (&g_cppState); - - opts->out_fname = outfile; - opts->in_fname = infile; - opts->out_fname = outfile; - - if (cppFatalErrors (&g_cppState)) - { - llexit (LLFAILURE); - } - - g_cppState.show_column = TRUE; - - if (cppReader_startProcess (&g_cppState, opts->in_fname) == 0) - { - llexit (LLFAILURE); - } - - ofile = fopen (cstring_toCharsSafe (outfile), "w"); - - if (ofile == NULL) - { - fileTable_noDelete (context_fileTable (), outfile); - llfatalerror (message ("Cannot create temporary file for " - "pre-processor output. Trying to " - "open: %s. Use -tmpdir to change " - "the directory for temporary files.", - outfile)); - } - - for (;;) - { - enum cpp_token kind; - - llassert (g_cppState.token_buffer != NULL); - - if (!opts->no_output) - { - (void) fwrite (g_cppState.token_buffer, (size_t) 1, - cppReader_getWritten (&g_cppState), ofile); - } - - cppReader_setWritten (&g_cppState, 0); - kind = cppGetToken (&g_cppState); - - if (kind == CPP_EOF) - break; - } - - cppReader_finish (&g_cppState); - check (fclose (ofile) == 0); - - /* Resotre the original definition table. */ - - if (!context_getFlag (FLG_SINGLEINCLUDE)) - { - cppReader_restoreHashtab (); - } - - - /* Undefine everything from this file! */ - - if (g_cppState.errors != 0) { - return -1; - } - - return 0; -} - -void cppAddIncludeDir (cstring dir) -{ - /* -I option (Add directory to include path) */ - struct file_name_list *dirtmp = (struct file_name_list *) dmalloc (sizeof (*dirtmp)); - - DPRINTF (("Add include: %s", dir)); - - dirtmp->next = 0; /* New one goes on the end */ - dirtmp->control_macro = 0; - dirtmp->c_system_include_path = FALSE; - - /* This copy is necessary...but shouldn't be? */ - /*@-onlytrans@*/ - dirtmp->fname = cstring_copy (dir); - /*@=onlytrans@*/ - - dirtmp->got_name_map = FALSE; - cppReader_addIncludeChain (&g_cppState, dirtmp); -} - -void cppDoDefine (cstring str) -{ - cppBuffer *tbuf = g_cppState.buffer; - - g_cppState.buffer = NULL; - cppReader_define (&g_cppState, cstring_toCharsSafe (str)); - g_cppState.buffer = tbuf; -} - -void cppDoUndefine (cstring str) -{ - int sym_length; - HASHNODE *hp; - char *buf = cstring_toCharsSafe (str); - - sym_length = cppReader_checkMacroName (&g_cppState, buf, - cstring_makeLiteralTemp ("macro")); - - while ((hp = cppReader_lookup (buf, sym_length, -1)) != NULL) - { - /*@-exposetrans@*/ /*@-dependenttrans@*/ - cppReader_deleteMacro (hp); - /*@=exposetrans@*/ /*@=dependenttrans@*/ - } -} - -void cppReader_saveDefinitions () -{ - if (!context_getFlag (FLG_SINGLEINCLUDE)) - { - cppReader_saveHashtab (); - } -} diff --git a/src/cprim.c b/src/cprim.c deleted file mode 100644 index 55a7f88..0000000 --- a/src/cprim.c +++ /dev/null @@ -1,415 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** cprim.c -*/ - -# include "lclintMacros.nf" -# include "basic.h" - -static bool cprim_isReal (cprim c) -{ - return (cprim_isAnyReal (c)); -} - -static bool cprim_isNumeric (cprim c) -{ - return (cprim_isReal (c) || cprim_isInt (c)); -} - -cprim -cprim_fromInt (int i) -{ - if (i < CTX_UNKNOWN || i > CTX_LAST) - { - llcontbug (message ("cprim_fromInt: out of range: %d", i)); - return CTX_UNKNOWN; - } - return (cprim) i; -} - - -/* -** not symmetric: c1 := c2 or c2 is passed as c1 -** (if RELAXQUALS, c1 must be "bigger" than c2) -*/ - -static bool cprim_closeEnoughAux (cprim p_c1, cprim p_c2, bool p_deep); - -bool -cprim_closeEnoughDeep (cprim c1, cprim c2) -{ - /* - ** If * c2 is passed as * c1 - ** Comparison is slightly different since it is safe to pass int as long, - ** but not to pass int * as long *! - ** - ** For deep comparisons, +relaxquals does not permit the long/int break. - */ - - return cprim_closeEnoughAux (c1, c2, TRUE); -} - -bool -cprim_closeEnough (cprim c1, cprim c2) -{ - return cprim_closeEnoughAux (c1, c2, FALSE); -} - -static bool -cprim_closeEnoughAux (cprim c1, cprim c2, bool deep) -{ - if (c1 == c2) return TRUE; - - if (c1 == CTX_ANYINTEGRAL) - { - if (context_getFlag (FLG_MATCHANYINTEGRAL) - || context_getFlag (FLG_IGNOREQUALS)) - { - return (cprim_isAnyInt (c2) - || (cprim_isAnyChar (c2) && context_msgCharInt ())); - } - else if (context_getFlag (FLG_LONGINTEGRAL)) - { - return (cprim_closeEnough (CTX_LINT, c2)); - } - else if (context_getFlag (FLG_LONGUNSIGNEDINTEGRAL)) - { - return (cprim_closeEnough (CTX_ULINT, c2)); - } - else - { - return FALSE; - } - } - - if (c1 == CTX_UNSIGNEDINTEGRAL) - { - if (context_getFlag (FLG_MATCHANYINTEGRAL) - || context_getFlag (FLG_IGNOREQUALS)) - { - return (cprim_isAnyInt (c2) - || (cprim_isAnyChar (c2) && context_msgCharInt ())); - } - else if (context_getFlag (FLG_LONGUNSIGNEDUNSIGNEDINTEGRAL)) - { - return (cprim_closeEnough (CTX_ULINT, c2)); - } - else - { - return FALSE; - } - } - - if (c1 == CTX_SIGNEDINTEGRAL) - { - if (context_getFlag (FLG_MATCHANYINTEGRAL) - || context_getFlag (FLG_IGNOREQUALS)) - { - return (cprim_isAnyInt (c2) - || (cprim_isAnyChar (c2) && context_msgCharInt ())); - } - else if (context_getFlag (FLG_LONGSIGNEDINTEGRAL)) - { - return (cprim_closeEnough (CTX_LINT, c2)); - } - else - { - return FALSE; - } - } - - if (c2 == CTX_ANYINTEGRAL) - { - if (context_getFlag (FLG_MATCHANYINTEGRAL)) - { - return (cprim_isAnyInt (c1) - || (cprim_isAnyChar (c1) && context_msgCharInt ())); - } - else if (context_getFlag (FLG_LONGINTEGRAL)) - { - return (cprim_closeEnough (c1, CTX_LINT)); - } - else if (context_getFlag (FLG_LONGUNSIGNEDINTEGRAL)) - { - return (cprim_closeEnough (c1, CTX_ULINT)); - } - else - { - return FALSE; - } - } - - if (c2 == CTX_UNSIGNEDINTEGRAL) - { - if (context_getFlag (FLG_MATCHANYINTEGRAL)) - { - return (cprim_isAnyInt (c1) - || (cprim_isAnyChar (c1) && context_msgCharInt ())); - } - else if (context_getFlag (FLG_LONGUNSIGNEDUNSIGNEDINTEGRAL)) - { - return (cprim_closeEnough (c1, CTX_ULINT)); - } - else - { - return FALSE; - } - } - - if (c2 == CTX_SIGNEDINTEGRAL) - { - if (context_getFlag (FLG_MATCHANYINTEGRAL)) - { - return (cprim_isAnyInt (c2) - || (cprim_isAnyChar (c2) && context_msgCharInt ())); - } - else if (context_getFlag (FLG_LONGSIGNEDINTEGRAL)) - { - return (cprim_closeEnough (c1, CTX_LINT)); - } - else - { - return FALSE; - } - } - - if (context_getFlag (FLG_RELAXTYPES)) - { - if (cprim_isNumeric (c1) && cprim_isNumeric (c2)) return TRUE; - } - - if (context_getFlag (FLG_IGNOREQUALS)) - { - switch (c1) - { - case CTX_CHAR: - case CTX_UCHAR: - return (cprim_isAnyChar (c2) - || (cprim_isAnyInt (c2) && (context_msgCharInt ()))); - case CTX_DOUBLE: - case CTX_FLOAT: - case CTX_LDOUBLE: - return (c2 == CTX_DOUBLE || c2 == CTX_FLOAT || c2 == CTX_LDOUBLE); - case CTX_INT: - case CTX_LINT: - case CTX_LLINT: - case CTX_ULLINT: - case CTX_SINT: - case CTX_UINT: - case CTX_ULINT: - case CTX_USINT: - return (cprim_isAnyInt (c2) - || (cprim_isAnyChar (c2) && context_msgCharInt ())); - default: - return FALSE; - } - } - else - { - if (context_getFlag (FLG_IGNORESIGNS)) - { - if (c1 == CTX_UCHAR) - { - c1 = CTX_CHAR; - } - else if (c1 == CTX_UINT) - { - c1 = CTX_INT; - } - else if (c1 == CTX_ULINT) - { - c1 = CTX_LINT; - } - else if (c1 == CTX_USINT) - { - c1 = CTX_SINT; - } - else - { - ; - } - - if (c2 == CTX_UCHAR) - { - c2 = CTX_CHAR; - } - else if (c2 == CTX_UINT) - { - c2 = CTX_INT; - } - else if (c2 == CTX_ULINT) - { - c2 = CTX_LINT; - } - else if (c2 == CTX_USINT) - { - c2 = CTX_SINT; - } - else - { - ; - } - } - - if (c1 == c2) return TRUE; - - if (context_getFlag (FLG_FLOATDOUBLE)) - { - if (c1 == CTX_FLOAT && c2 == CTX_DOUBLE) - { - return TRUE; - } - if (c2 == CTX_FLOAT && c1 == CTX_DOUBLE) - { - return TRUE; - } - } - - if (!deep && context_getFlag (FLG_RELAXQUALS)) - { - switch (c1) - { - case CTX_DOUBLE: - return (c2 == CTX_FLOAT); - case CTX_LDOUBLE: - return (c2 == CTX_DOUBLE || c2 == CTX_FLOAT); - case CTX_SINT: - return (c2 == CTX_CHAR && context_msgCharInt ()); - case CTX_INT: - return (c2 == CTX_SINT - || (cprim_isAnyChar (c2) && context_msgCharInt ())); - case CTX_LLINT: - return (c2 == CTX_SINT - || c2 == CTX_INT - || c2 == CTX_LINT - || (cprim_isAnyChar (c2) && context_msgCharInt ())); - case CTX_ULLINT: - return (c2 == CTX_USINT - || c2 == CTX_UINT - || c2 == CTX_ULINT); - case CTX_LINT: - return (c2 == CTX_SINT - || c2 == CTX_INT - || (cprim_isAnyChar (c2) && context_msgCharInt ())); - case CTX_UINT: - return (c2 == CTX_USINT - || (c2 == CTX_UCHAR && context_msgCharInt ())); - case CTX_USINT: - return (c2 == CTX_UCHAR && context_msgCharInt ()); - case CTX_ULINT: - return (c2 == CTX_UINT || c2 == CTX_USINT); - case CTX_UCHAR: - return (c2 == CTX_UINT && context_msgCharInt ()); - case CTX_CHAR: - return ((c2 == CTX_INT || c2 == CTX_SINT) - && context_msgCharInt ()); - default: - return FALSE; - } - } - else - { - switch (c1) - { - case CTX_DOUBLE: - case CTX_LDOUBLE: - return FALSE; - case CTX_SINT: - case CTX_INT: - case CTX_LINT: - case CTX_LLINT: - return (c2 == CTX_CHAR && context_msgCharInt ()); - case CTX_UINT: - case CTX_USINT: - case CTX_ULINT: - case CTX_ULLINT: - return (c2 == CTX_UCHAR && context_msgCharInt ()); - case CTX_UCHAR: - return (c2 == CTX_UINT && context_msgCharInt ()); - case CTX_CHAR: - return ((c2 == CTX_INT || c2 == CTX_SINT) - && context_msgCharInt ()); - default: - return FALSE; - } - } - } -} - -/*@only@*/ cstring -cprim_unparse (cprim c) -{ - switch (c) - { - case CTX_UNKNOWN: - return cstring_makeLiteral ("-"); - case CTX_VOID: - return cstring_makeLiteral ("void"); - case CTX_CHAR: - return cstring_makeLiteral ("char"); - case CTX_UCHAR: - return cstring_makeLiteral ("unsigned char"); - case CTX_DOUBLE: - return cstring_makeLiteral ("double"); - case CTX_LDOUBLE: - return cstring_makeLiteral ("long double"); - case CTX_FLOAT: - return cstring_makeLiteral ("float"); - case CTX_INT: - return cstring_makeLiteral ("int"); - case CTX_LINT: - return cstring_makeLiteral ("long int"); - case CTX_LLINT: - return cstring_makeLiteral ("long long"); - case CTX_ULLINT: - return cstring_makeLiteral ("unsigned long long"); - case CTX_SINT: - return cstring_makeLiteral ("short int"); - case CTX_UINT: - return cstring_makeLiteral ("unsigned int"); - case CTX_ULINT: - return cstring_makeLiteral ("unsigned long int"); - case CTX_USINT: - return cstring_makeLiteral ("unsigned short int"); - case CTX_UNSIGNEDINTEGRAL: - return cstring_makeLiteral ("arbitrary unsigned integral type"); - case CTX_SIGNEDINTEGRAL: - return cstring_makeLiteral ("arbitrary signed integral type"); - case CTX_ANYINTEGRAL: - return cstring_makeLiteral ("arbitrary integral type"); - default: - return cstring_makeLiteral ("unknown prim"); - } -} - -bool cprim_isInt (cprim c) -{ - return (cprim_isAnyInt (c) - || (cprim_isAnyChar (c) && context_msgCharInt ())); -} - - - - diff --git a/src/cstring.c b/src/cstring.c deleted file mode 100644 index 7352a00..0000000 --- a/src/cstring.c +++ /dev/null @@ -1,950 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** cstring.c -*/ - -/* - * Herbert 06/12/2000 - * - use drive spec specials with OS2 like with WIN32 - * - cstring_replaceAll () needed in cpplib.c - */ - -# include "lclintMacros.nf" -# include "basic.h" -# include "osd.h" -# include "portab.h" - -static /*@only@*/ /*@notnull@*/ -cstring cstring_newEmpty (void) -{ - return (cstring_create (0)); -} - -char cstring_firstChar (cstring s) -{ - llassert (cstring_isDefined (s)); - llassert (cstring_length (s) > 0); - - return (s[0]); -} - -char cstring_getChar (cstring s, int n) -{ - int length = cstring_length (s); - - llassert (cstring_isDefined (s)); - llassert (n >= 1 && n <= length); - - return (s[n - 1]); -} - -cstring cstring_suffix (cstring s, int n) -{ - llassert (cstring_isDefined (s)); - llassert (n <= cstring_length (s)); - - return (s + n); -} - -cstring cstring_prefix (cstring s, int n) -{ - cstring t; - char c; - llassert (cstring_isDefined (s)); - llassert (n <= cstring_length (s)); - - c = *(s + n); - /*@-mods@*/ /* The modifications cancel out. */ - *(s + n) = '\0'; - t = cstring_copy (s); - *(s + n) = c; - /*@=mods@*/ - - return t; -} - -/* effects If s = [0-9]*, returns s as an int. -** else returns -1. -*/ - -int cstring_toPosInt (cstring s) -{ - int val = 0; - - cstring_chars (s, c) - { - if (isdigit ((unsigned char) c)) - { - val = (val * 10) + (int)(c - '0'); - } - else - { - return -1; - } - } end_cstring_chars ; - - return val; -} - -cstring cstring_beforeChar (cstring s, char c) -{ - if (cstring_isDefined (s)) - { - char *cp = strchr (s, c); - - if (cp != NULL) - { - cstring ret; - - /*@-mods@*/ - *cp = '\0'; - ret = cstring_copy (s); - *cp = c; - /*@=mods@*/ /* modification is undone */ - - return ret; - } - } - - return cstring_undefined; -} - -void cstring_setChar (cstring s, int n, char c) -{ - llassert (cstring_isDefined (s)); - llassert (n > 0 && n <= cstring_length (s)); - - s[n - 1] = c; -} - -char cstring_lastChar (cstring s) -{ - int length; - - llassert (cstring_isDefined (s)); - - length = cstring_length (s); - llassert (length > 0); - - return (s[length - 1]); -} - -/*@only@*/ cstring cstring_copy (cstring s) -{ - if (cstring_isDefined (s)) - { - return (mstring_copy (s)); - } - else - { - return cstring_undefined; - } -} - -/*@only@*/ cstring cstring_copyLength (char *s, int len) -{ - char *res = mstring_create (len + 1); - - strncpy (res, s, size_fromInt (len)); - res[len] = '\0'; - return res; -} - -bool cstring_containsChar (cstring c, char ch) -{ - if (cstring_isDefined (c)) - { - return (strchr (c, ch) != NULL); - } - else - { - return FALSE; - } -} - -/* -** Replaces all occurances of old in s with new. -*/ - -# if defined (WIN32) || defined (OS2) -void cstring_replaceAll (cstring s, char old, char snew) -{ - - llassert (old != snew); - - if (cstring_isDefined (s)) - { - char *sp = strchr (s, old); - - while (sp != NULL) - { - *sp = snew; - sp = strchr (sp, old); - } - - } -} -# endif - -void cstring_replaceLit (/*@unique@*/ cstring s, char *old, char *snew) -{ - - llassert (strlen (old) >= strlen (snew)); - - if (cstring_isDefined (s)) - { - char *sp = strstr (s, old); - - while (sp != NULL) - { - int lendiff = size_toInt (strlen (old) - strlen (snew)); - char *tsnew = snew; - - while (*tsnew != '\0') - { - *sp++ = *tsnew++; - } - - if (lendiff > 0) - { - while (*(sp + lendiff) != '\0') - { - *sp = *(sp + lendiff); - sp++; - } - - *sp = '\0'; - } - - sp = strstr (s, old); - } - } -} - -/* -** removes all chars in clist from s -*/ - -void cstring_stripChars (cstring s, const char *clist) -{ - if (cstring_isDefined (s)) - { - int i; - int size = cstring_length (s); - - for (i = 0; i < size; i++) - { - char c = s[i]; - - if (strchr (clist, c) != NULL) - { - /* strip this char */ - int j; - - size--; - - for (j = i; j < size; j++) - { - s[j] = s[j+1]; - } - - s[size] = '\0'; - i--; - } - } - } -} - -bool cstring_contains (/*@unique@*/ cstring c, cstring sub) -{ - if (cstring_isDefined (c)) - { - llassert (cstring_isDefined (sub)); - - return (strstr (c, sub) != NULL); - } - else - { - return FALSE; - } -} - -static char lookLike (char c) /*@*/ -{ - if (c == 'I' || c == 'l') - { - return '1'; - } - else if (c == 'O' || c == 'o') - { - return '0'; - } - else if (c == 'Z') - { - return '2'; - } - else if (c == 'S') - { - return '5'; - } - else - { - return c; - } -} - -cmpcode cstring_genericEqual (cstring s, cstring t, - int nchars, - bool caseinsensitive, - bool lookalike) -{ - if (s == t) return CGE_SAME; - else if (cstring_isUndefined (s)) - { - return cstring_isEmpty (t) ? CGE_SAME : CGE_DISTINCT; - } - else if (cstring_isUndefined (t)) - { - return cstring_isEmpty (s) ? CGE_SAME : CGE_DISTINCT; - } - else - { - int i = 0; - bool diffcase = FALSE; - bool difflookalike = FALSE; - - while (*s != '\0') - { - if (nchars > 0 && i >= nchars) - { - break; - } - - if (*t == *s) - { - ; /* no difference */ - } - else if (caseinsensitive - && (toupper ((int) *t) == toupper ((int) *s))) - { - diffcase = TRUE; - } - else if (lookalike && (lookLike (*t) == lookLike (*s))) - { - difflookalike = TRUE; - } - else - { - return CGE_DISTINCT; - } - i++; - s++; - t++; - } - - if (*s == '\0' && *t != '\0') - { - return CGE_DISTINCT; - } - - if (diffcase) - { - return CGE_CASE; - } - else if (difflookalike) - { - return CGE_LOOKALIKE; - } - else - { - return CGE_SAME; - } - } -} - - - -bool cstring_equalFree (/*@only@*/ cstring c1, /*@only@*/ cstring c2) -{ - bool res = cstring_equal (c1, c2); - cstring_free (c1); - cstring_free (c2); - return res; -} - -bool cstring_equal (cstring c1, cstring c2) -{ - if (c1 == c2) return TRUE; - else if (cstring_isUndefined (c1)) return cstring_isEmpty (c2); - else if (cstring_isUndefined (c2)) return cstring_isEmpty (c1); - else return (strcmp (c1, c2) == 0); -} - -bool cstring_equalLen (cstring c1, cstring c2, int len) -{ - if (c1 == c2) return TRUE; - else if (cstring_isUndefined (c1)) return cstring_isEmpty (c2); - else if (cstring_isUndefined (c2)) return cstring_isEmpty (c1); - else return (strncmp (c1, c2, size_fromInt (len)) == 0); -} - -bool cstring_equalCaseInsensitive (cstring c1, cstring c2) -{ - if (c1 == c2) return TRUE; - else if (cstring_isUndefined (c1)) return cstring_isEmpty (c2); - else if (cstring_isUndefined (c2)) return cstring_isEmpty (c1); - else return (cstring_genericEqual (c1, c2, 0, TRUE, FALSE) != CGE_DISTINCT); -} - -bool cstring_equalLenCaseInsensitive (cstring c1, cstring c2, int len) -{ - llassert (len >= 0); - - if (c1 == c2) return TRUE; - else if (cstring_isUndefined (c1)) return cstring_isEmpty (c2); - else if (cstring_isUndefined (c2)) return cstring_isEmpty (c1); - else return (cstring_genericEqual (c1, c2, len, TRUE, FALSE) != CGE_DISTINCT); -} - -bool cstring_equalPrefix (cstring c1, char *c2) -{ - llassert (c2 != NULL); - - if (cstring_isUndefined (c1)) - { - return (strlen (c2) == 0); - } - - return (strncmp (c1, c2, strlen (c2)) == 0); -} - -bool cstring_equalCanonicalPrefix (cstring c1, char *c2) -{ - llassert (c2 != NULL); - - if (cstring_isUndefined (c1)) - { - return (strlen (c2) == 0); - } - -# if defined (WIN32) || defined (OS2) - /* - ** If one has a drive specification, but the other doesn't, skip it. - */ - - if (strchr (c1, ':') == NULL - && strchr (c2, ':') != NULL) - { - c2 = strchr (c2 + 1, ':'); - } - else - { - if (strchr (c2, ':') == NULL - && strchr (c1, ':') != NULL) - { - c1 = strchr (c1 + 1, ':'); - } - } - - { - int len = size_toInt (strlen (c2)); - int i = 0; - int slen = 0; - - if (cstring_length (c1) < len) - { - return FALSE; - } - - for (i = 0; i < len; i++) - { - if (c1[slen] == c2[i] - || (osd_isConnectChar (c1[slen]) && osd_isConnectChar (c2[i]))) - { - ; - } - else - { - /* - ** We allow \\ to match \ because MS-DOS screws up the directory - ** names. - */ - - if (c1[slen] == '\\' - && (slen > 0 - && c1[slen - 1] == '\\' - && c2[i - 1] == '\\')) - { - slen++; - if (c1[slen] != c2[i]) - { - return FALSE; - } - } - else - { - return FALSE; - } - } - - slen++; - if (slen >= cstring_length (c1)) - { - return FALSE; - } - } - } - - return TRUE; -# else - return (strncmp (c1, c2, strlen (c2)) == 0); -# endif -} - -int cstring_xcompare (cstring *c1, cstring *c2) -{ - return (cstring_compare (*c1, *c2)); -} - -int cstring_compare (cstring c1, cstring c2) -{ - int res; - - if (c1 == c2) - { - res = 0; - } - else if (cstring_isUndefined (c1)) - { - if (cstring_isEmpty (c2)) - { - res = 0; - } - else - { - res = 1; - } - } - else if (cstring_isUndefined (c2)) - { - if (cstring_isEmpty (c1)) - { - res = 0; - } - else - { - res = -1; - } - } - else - { - res = strcmp (c1, c2); - } - - return (res); -} - -void cstring_markOwned (/*@owned@*/ cstring s) -{ - sfreeEventually (s); -} - -void cstring_free (/*@only@*/ cstring s) -{ - if (cstring_isDefined (s)) - { - sfree (s); - } -} - -cstring cstring_fromChars (/*@exposed@*/ const char *cp) -{ - return (cstring) cp; -} - -/*@exposed@*/ char *cstring_toCharsSafe (cstring s) -{ - static /*@only@*/ cstring emptystring = cstring_undefined; - - if (cstring_isDefined (s)) - { - return (char *) s; - } - else - { - if (cstring_isUndefined (emptystring)) - { - emptystring = cstring_newEmpty (); - } - - return emptystring; - } -} - -int cstring_length (cstring s) -{ - if (cstring_isDefined (s)) - { - return size_toInt (strlen (s)); - } - return 0; -} - -cstring -cstring_capitalize (cstring s) -{ - if (!cstring_isEmpty (s)) - { - cstring ret = cstring_copy (s); - - cstring_setChar (ret, 1, (char) toupper ((int) cstring_firstChar (ret))); - return ret; - } - - return cstring_undefined; -} - -cstring -cstring_capitalizeFree (cstring s) -{ - if (!cstring_isEmpty (s)) - { - cstring_setChar (s, 1, (char) toupper ((int) cstring_firstChar (s))); - return s; - } - - return s; -} - -cstring -cstring_clip (cstring s, int len) -{ - if (cstring_isUndefined (s) || cstring_length (s) <= len) - { - ; - } - else - { - llassert (s != NULL); - *(s + len) = '\0'; - } - - return s; -} - -/*@only@*/ cstring -cstring_elide (cstring s, int len) -{ - if (cstring_isUndefined (s) || cstring_length (s) <= len) - { - return cstring_copy (s); - } - else - { - cstring sc = cstring_create (len); - - strncpy (sc, s, size_fromInt (len)); - *(sc + len - 1) = '\0'; - *(sc + len - 2) = '.'; - *(sc + len - 3) = '.'; - *(sc + len - 4) = '.'; - return sc; - } -} - -/*@only@*/ cstring -cstring_fill (cstring s, int n) -{ - cstring t = cstring_create (n + 1); - cstring ot = t; - int len = cstring_length (s); - int i; - - if (len > n) - { - for (i = 0; i < n; i++) - { - *t++ = *s++; - } - *t = '\0'; - } - else - { - for (i = 0; i < len; i++) - { - *t++ = *s++; - } - for (i = 0; i < n - len; i++) - { - *t++ = ' '; - } - *t = '\0'; - } - - return ot; -} - -cstring -cstring_downcase (cstring s) -{ - if (cstring_isDefined (s)) - { - cstring t = cstring_create (strlen (s) + 1); - cstring ot = t; - char c; - - while ((c = *s) != '\0') - { - if (c >= 'A' && c <= 'Z') - { - c = c - 'A' + 'a'; - } - *t++ = c; - s++; - } - *t = '\0'; - - return ot; - } - else - { - return cstring_undefined; - } -} - -/*@notnull@*/ cstring -cstring_appendChar (/*@only@*/ cstring s1, char c) -{ - int l = cstring_length (s1); - char *s; - - s = (char *) dmalloc (sizeof (*s) * (l + 2)); - - if (cstring_isDefined (s1)) - { - strcpy (s, s1); - *(s + l) = c; - *(s + l + 1) = '\0'; - sfree (s1); - } - else - { - *(s) = c; - *(s + 1) = '\0'; - } - - return s; -} - -/*@only@*/ cstring -cstring_concatFree (cstring s, cstring t) -{ - cstring res = cstring_concat (s, t); - cstring_free (s); - cstring_free (t); - return res; -} - -/*@only@*/ cstring -cstring_concatFree1 (cstring s, cstring t) -{ - cstring res = cstring_concat (s, t); - cstring_free (s); - return res; -} - -# ifndef NOLCL -/*@only@*/ cstring -cstring_concatChars (cstring s, char *t) -{ - cstring res = cstring_concat (s, cstring_fromChars (t)); - cstring_free (s); - return res; -} -# endif - -/*@only@*/ cstring -cstring_concatLength (cstring s1, char *s2, int len) -{ - cstring tmp = cstring_copyLength (s2, len); - cstring res = cstring_concat (s1, tmp); - cstring_free (tmp); - cstring_free (s1); - - return res; -} - -/*@only@*/ cstring -cstring_concat (cstring s, cstring t) -{ - char *ret = mstring_create (cstring_length (s) + cstring_length (t)); - - if (cstring_isDefined (s)) - { - strcpy (ret, s); - } - if (cstring_isDefined (t)) - { - strcat (ret, t); - } - - return ret; -} - -/*@notnull@*/ /*@only@*/ cstring -cstring_prependCharO (char c, /*@only@*/ cstring s1) -{ - cstring res = cstring_prependChar (c, s1); - - cstring_free (s1); - return (res); -} - -/*@notnull@*/ /*@only@*/ cstring -cstring_prependChar (char c, /*@temp@*/ cstring s1) -{ - int l = cstring_length (s1); - char *s = (char *) dmalloc (sizeof (*s) * (l + 2)); - - *(s) = c; - - if (cstring_isDefined (s1)) - { - /*@-mayaliasunique@*/ - strcpy (s + 1, s1); - /*@=mayaliasunique@*/ - } - - *(s + l + 1) = '\0'; - return s; -} - -# ifndef NOLCL -bool -cstring_hasNonAlphaNumBar (cstring s) -{ - int c; - - if (cstring_isUndefined (s)) return FALSE; - - while ((c = (int) *s) != (int) '\0') - { - if ((isalnum (c) == 0) && (c != (int) '_') - && (c != (int) '.') && (c != (int) CONNECTCHAR)) - { - return TRUE; - } - - s++; - } - return FALSE; -} -# endif - -/*@only@*/ /*@notnull@*/ cstring -cstring_create (int n) -{ - char *s = dmalloc (sizeof (*s) * (n + 1)); - - *s = '\0'; - return s; -} - -# ifndef NOLCL -lsymbol cstring_toSymbol (cstring s) -{ - lsymbol res = lsymbol_fromChars (cstring_toCharsSafe (s)); - - cstring_free (s); - return res; -} -# endif - -cstring cstring_bsearch (cstring key, char **table, int nentries) -{ - if (cstring_isDefined (key)) - { - int low = 0; - int high = nentries; - int mid = (high + low + 1) / 2; - int last = -1; - cstring res = cstring_undefined; - - while (low <= high && mid < nentries) - { - int cmp; - - llassert (mid != last); - llassert (mid >= 0 && mid < nentries); - - cmp = cstring_compare (key, table[mid]); - - if (cmp == 0) - { - res = table[mid]; - break; - } - else if (cmp < 0) /* key is before table[mid] */ - { - high = mid - 1; - } - else /* key of after table[mid] */ - { - low = mid + 1; - } - - last = mid; - mid = (high + low + 1) / 2; - } - - if (mid != 0 && mid < nentries - 1) - { - llassert (cstring_compare (key, table[mid - 1]) > 0); - llassert (cstring_compare (key, table[mid + 1]) < 0); - } - - return res; - } - - return cstring_undefined; -} - -extern /*@observer@*/ cstring cstring_advanceWhiteSpace (cstring s) -{ - if (cstring_isDefined (s)) { - char *t = s; - - while (*t != '\0' && isspace ((int) *t)) { - t++; - } - - return t; - } - - return cstring_undefined; -} - - - diff --git a/src/cstringList.c b/src/cstringList.c deleted file mode 100644 index 7cced01..0000000 --- a/src/cstringList.c +++ /dev/null @@ -1,243 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** cstringList.c -** -** based on list_template.c -** -** where T has T_equal (or change this) and T_unparse -*/ - -# include "lclintMacros.nf" -# include "basic.h" - -cstringList -cstringList_new () -{ - return cstringList_undefined; -} - -static /*@notnull@*/ cstringList -cstringList_newEmpty (void) -{ - cstringList s = (cstringList) dmalloc (sizeof (*s)); - - s->nelements = 0; - s->nspace = cstringListBASESIZE; - s->elements = (cstring *) dmalloc (sizeof (*s->elements) * cstringListBASESIZE); - - return (s); -} - -static void -cstringList_grow (/*@notnull@*/ cstringList s) -{ - int i; - cstring *newelements; - - s->nspace += cstringListBASESIZE; - - newelements = (cstring *) dmalloc (sizeof (*newelements) - * (s->nelements + s->nspace)); - - - if (newelements == (cstring *) 0) - { - llfatalerror (cstring_makeLiteral ("cstringList_grow: out of memory!")); - } - - for (i = 0; i < s->nelements; i++) - { - newelements[i] = s->elements[i]; - } - - sfree (s->elements); - s->elements = newelements; -} - -cstringList cstringList_single (/*@keep@*/ cstring el) -{ - cstringList s = cstringList_new (); - s = cstringList_add (s, el); - return s; -} - -cstringList cstringList_add (cstringList s, /*@keep@*/ cstring el) -{ - if (!cstringList_isDefined (s)) - { - s = cstringList_newEmpty (); - } - - if (s->nspace <= 0) - { - cstringList_grow (s); - } - - s->nspace--; - s->elements[s->nelements] = el; - s->nelements++; - - return s; -} - -cstring -cstringList_unparse (cstringList s) -{ - return cstringList_unparseSep (s, cstring_makeLiteralTemp (", ")); -} - -cstring -cstringList_unparseSep (cstringList s, cstring sep) -{ - cstring st = cstring_undefined; - - if (cstringList_isDefined (s)) - { - int i; - - for (i = 0; i < s->nelements; i++) - { - if (i == 0) - { - st = cstring_copy (s->elements[i]); - } - else - st = message ("%q%s%s", st, sep, s->elements[i]); - } - } - - return st; -} - -void -cstringList_printSpaced (cstringList s, int indent, int gap, int linelen) -{ - if (cstringList_isDefined (s)) - { - cstring line = cstring_undefined; - cstring istring = cstring_fill (cstring_undefined, indent); - cstring gstring = cstring_fill (cstring_undefined, gap); - int numcol; - int longest = 0; - int i; - - /* - ** find the longest string - */ - - for (i = 0; i < s->nelements; i++) - { - int len = cstring_length (s->elements[i]); - - if (len > longest) - { - longest = len; - } - } - - numcol = (linelen - indent) / (longest + gap); - - if (numcol <= 1) - { - numcol = 1; - } - - for (i = 0; i < s->nelements; i++) - { - if (i % numcol == 0) - { - if (i != 0) - { - llmsg (line); - } - - line = message ("%s%q", istring, - cstring_fill (s->elements[i], longest)); - } - else - { - line = message ("%q%s%q", line, gstring, - cstring_fill (s->elements[i], longest)); - } - } - - cstring_free (line); - cstring_free (istring); - cstring_free (gstring); - } -} - -/*@only@*/ cstring -cstringList_unparseAbbrev (cstringList s) -{ - cstring st = cstring_undefined; - - if (cstringList_isDefined (s)) - { - int i; - - for (i = 0; i < s->nelements; i++) - { - if (i == 0) - { - st = cstring_copy (s->elements[i]); - } - else if (i > 3 && s->nelements > 5) - { - st = message ("%q, ...", st); - break; - } - else - { - st = message ("%q, %s", st, s->elements[i]); - } - } - } - - return st; -} - -void -cstringList_free (cstringList s) -{ - if (cstringList_isDefined (s)) - { - sfree (s->elements); - sfree (s); - } -} - -void -cstringList_alphabetize (cstringList s) -{ - if (cstringList_isDefined (s)) - { - /*@-modobserver@*/ - qsort (s->elements, (size_t) s->nelements, - sizeof (*s->elements), (int (*)(const void *, const void *)) cstring_xcompare); - /*@=modobserver@*/ - } -} - diff --git a/src/cstringSList.c b/src/cstringSList.c deleted file mode 100644 index 8fd4b71..0000000 --- a/src/cstringSList.c +++ /dev/null @@ -1,252 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** cstringSList.c -** -** based on list_template.c -** -** where T has T_equal (or change this) and T_unparse -*/ - -# include "lclintMacros.nf" -# include "basic.h" - -cstringSList -cstringSList_new () -{ - return cstringSList_undefined; -} - -static /*@notnull@*/ cstringSList -cstringSList_newEmpty (void) -{ - cstringSList s = (cstringSList) dmalloc (sizeof (*s)); - - s->nelements = 0; - s->nspace = cstringSListBASESIZE; - s->elements = (cstring *) dmalloc (sizeof (*s->elements) * cstringSListBASESIZE); - - return (s); -} - -static void -cstringSList_grow (/*@notnull@*/ cstringSList s) -{ - int i; - cstring *newelements; - - s->nspace += cstringSListBASESIZE; - - newelements = (cstring *) dmalloc (sizeof (*newelements) - * (s->nelements + s->nspace)); - - - if (newelements == (cstring *) 0) - { - llfatalerror (cstring_makeLiteral ("cstringSList_grow: out of memory!")); - } - - for (i = 0; i < s->nelements; i++) - { - newelements[i] = s->elements[i]; - } - - sfree (s->elements); - s->elements = newelements; -} - -cstringSList cstringSList_single (/*@exposed@*/ cstring el) -{ - cstringSList s = cstringSList_new (); - s = cstringSList_add (s, el); - return s; -} - -cstringSList cstringSList_add (cstringSList s, /*@exposed@*/ cstring el) -{ - if (!cstringSList_isDefined (s)) - { - s = cstringSList_newEmpty (); - } - - if (s->nspace <= 0) - { - cstringSList_grow (s); - } - - s->nspace--; - s->elements[s->nelements] = el; - s->nelements++; - - return s; -} - -cstring -cstringSList_unparse (cstringSList s) -{ - return cstringSList_unparseSep (s, cstring_makeLiteralTemp (", ")); -} - -cstring -cstringSList_unparseSep (cstringSList s, cstring sep) -{ - cstring st = cstring_undefined; - - if (cstringSList_isDefined (s)) - { - int i; - - for (i = 0; i < s->nelements; i++) - { - if (i == 0) - { - st = cstring_copy (s->elements[i]); - } - else - st = message ("%q%s%s", st, sep, s->elements[i]); - } - } - - return st; -} - -void -cstringSList_printSpaced (cstringSList s, int indent, int gap, int linelen) -{ - if (cstringSList_isDefined (s)) - { - cstring line = cstring_undefined; - cstring istring = cstring_fill (cstring_undefined, indent); - cstring gstring = cstring_fill (cstring_undefined, gap); - int numcol; - int longest = 0; - int i; - - /* - ** find the longest string - */ - - for (i = 0; i < s->nelements; i++) - { - int len = cstring_length (s->elements[i]); - - if (len > longest) - { - longest = len; - } - } - - numcol = (linelen - indent) / (longest + gap); - - if (numcol <= 1) - { - numcol = 1; - } - - for (i = 0; i < s->nelements; i++) - { - if (i % numcol == 0) - { - if (i != 0) - { - llmsg (line); - } - - line = message ("%s%q", istring, - cstring_fill (s->elements[i], longest)); - } - else - { - line = message ("%q%s%q", line, gstring, - cstring_fill (s->elements[i], longest)); - } - } - - cstring_free (line); - cstring_free (istring); - cstring_free (gstring); - } -} - -/*@only@*/ cstring -cstringSList_unparseAbbrev (cstringSList s) -{ - cstring st = cstring_undefined; - - if (cstringSList_isDefined (s)) - { - int i; - - for (i = 0; i < s->nelements; i++) - { - if (i == 0) - { - st = cstring_copy (s->elements[i]); - } - else if (i > 3 && s->nelements > 5) - { - st = message ("%q, ...", st); - break; - } - else - { - st = message ("%q, %s", st, s->elements[i]); - } - } - } - - return st; -} - -void -cstringSList_free (cstringSList s) -{ - if (cstringSList_isDefined (s)) - { - /* - ** A modification of observer message is reported here, since - ** *s->elements is an observer. But sfree doesn't REALLY modify - ** the value of this object. - */ - - /*@-modobserver@*/ - sfree (s->elements); - /*@=modobserver@*/ - - sfree (s); - } -} - -void -cstringSList_alphabetize (cstringSList s) -{ - if (cstringSList_isDefined (s)) - { - /*@-modobserver@*/ - qsort (s->elements, (size_t) s->nelements, - sizeof (*s->elements), (int (*)(const void *, const void *)) cstring_xcompare); - /*@=modobserver@*/ - } -} - diff --git a/src/ctype.c b/src/ctype.c deleted file mode 100644 index 02cd2a5..0000000 --- a/src/ctype.c +++ /dev/null @@ -1,2398 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** ctype.c -** -** This files implements three types: ctentry, cttable and ctype. -** They should probably be separated soon. -*/ - -# include "lclintMacros.nf" -# include "basic.h" -# include "structNames.h" - -static void ctype_recordConj (ctype p_c); - - -/* -** ctbase file -*/ - -# include "ctbase.i" - -/* -** ctype table -*/ - -# include "cttable.i" - -static ctype ctype_getConjA (ctype p_c) /*@*/ ; -static ctype ctype_getConjB (ctype p_c) /*@*/ ; - -static bool ctype_isComplex (ctype c) -{ - return (ctentry_isComplex (ctype_getCtentry(c))); -} - -static bool ctype_isPlain (ctype c) -{ - return (ctentry_isPlain (ctype_getCtentry(c))); -} - -static bool ctype_isBroken (ctype c) -{ - /*@+enumint@*/ - if (c == CTK_DNE || c == CTK_INVALID || c == CTK_UNKNOWN) - { - /*@-enumint@*/ - return TRUE; - } - else - { - ctentry cte = ctype_getCtentry (c); - - return (ctentry_isBogus (cte)); - } -} - -ctkind -ctkind_fromInt (int i) -{ - /*@+enumint@*/ - if (i < CTK_UNKNOWN || i > CTK_COMPLEX) - { - llcontbug (message ("ctkind_fromInt: out of range: %d", i)); - return CTK_INVALID; - } - return (ctkind) i; - /*@=enumint@*/ -} - -/* -** ctype functions -*/ - -void -ctype_initTable () -{ - cttable_init (); -} - -void -ctype_destroyMod () -{ - cttable_reset (); -} - -void -ctype_loadTable (FILE *f) -{ - cttable_load (f); -} - -void -ctype_dumpTable (FILE *f) -{ - DPRINTF (("Dumping cttable!")); - cttable_dump (f); -} - -cstring -ctype_unparseTable () -{ - return (cttable_unparse ()); -} - -void -ctype_printTable () -{ - cttable_print (); -} - -bool -ctype_isUserBool (ctype ct) -{ - if (ctype_isUA (ct)) - { - return (usymtab_isBoolType (ctype_typeId (ct))); - } - - return (FALSE); -} - -ctype -ctype_createUser (typeId u) -{ - /* requires: ctype_createUser (u) is never called more than once for any u. */ - - ctbase ct = ctbase_createUser (u); - return (cttable_addFullSafe (ctentry_makeNew (CTK_PLAIN, ct))); -} - -ctype -ctype_createAbstract (typeId u) -{ - /* requires: ctype_createAbstract (u) is never called more than once for any u. */ - /* [ tested by cttable_addFullSafe, not really required ] */ - return (cttable_addFullSafe (ctentry_makeNew (CTK_PLAIN, ctbase_createAbstract (u)))); -} - -int -ctype_count (void) -{ - return (cttab.size); -} - -ctype -ctype_realType (ctype c) -{ - ctype r = c; - - if (ctype_isUA (c)) - { - r = uentry_getRealType (usymtab_getTypeEntry (ctype_typeId (c))); - } - - if (ctype_isManifestBool (r)) - { - if (context_canAccessBool ()) - { - r = context_boolImplementationType (); - } - } - - return r; -} - -bool -ctype_isSimple (ctype c) -{ - return (!(ctype_isPointer (c) - || ctype_isArray (c) - || ctype_isFunction (c))); -} - -ctype -ctype_forceRealType (ctype c) -{ - ctype r = c; - - if (ctype_isUA (c)) - { - r = uentry_getForceRealType (usymtab_getTypeEntry (ctype_typeId (c))); - } - - return r; -} - -ctype -ctype_realishType (ctype c) -{ - if (ctype_isUA (c)) - { - if (ctype_isManifestBool (c)) - { - return ctype_bool; - } - else - { - ctype r = uentry_getRealType (usymtab_getTypeEntry - (ctype_typeId (c))); - return (r); - } - } - - return c; -} - -bool -ctype_isUA (ctype c) -{ - return (ctbase_isUA (ctype_getCtbase (c))); -} - -bool -ctype_isUser (ctype c) -{ - return (ctbase_isUser (ctype_getCtbase (c))); -} - -bool -ctype_isAbstract (ctype c) -{ - return ((ctype_isPlain (c) && ctbase_isAbstract (ctype_getCtbaseSafe (c))) || - (ctype_isConj (c) && - (ctype_isAbstract (ctype_getConjA (c)) - || ctype_isAbstract (ctype_getConjB (c))))); -} - -bool -ctype_isRealAbstract (ctype c) -{ - return (ctype_isAbstract (ctype_realType (c)) || - (ctype_isConj (c) && - (ctype_isRealAbstract (ctype_getConjA (c)) || - ctype_isRealAbstract (ctype_getConjB (c))))); -} - -/* -** primitive creators -*/ - -/* -** createPrim not necessary --- subsumed by ctype_int, etc. -*/ - -/* -** ctbase_unknown --- removed argument -*/ - -/* -** derived types: -** requires: if DerivedType (T) exists in cttable, then T->derivedType is it. -*/ - -ctype -ctype_makePointer (ctype c) -{ - if (c == ctype_char) - { - return ctype_string; - } - else if (c == ctype_void) - { - return ctype_voidPointer; - } - else - { - ctentry cte = ctype_getCtentry (c); - ctype clp = ctentry_getPtr (cte); - - if /*@+enumint@*/ (clp == CTK_DNE) /*@=enumint@*/ - { - ctype cnew = cttable_addDerived (CTK_PTR, ctbase_makePointer (c), c); - ctentry_setPtr (cte, cnew); - return (cnew); - } - else - { - return clp; - } - } -} - -ctype ctype_makeFixedArray (ctype c, long size) -{ - return (cttable_addDerived (CTK_ARRAY, ctbase_makeFixedArray (c, size), c)); -} - -ctype -ctype_makeArray (ctype c) -{ - ctentry cte = ctype_getCtentry (c); - ctype clp = ctentry_getArray (cte); - - if /*@+enumint@*/ (clp == CTK_DNE) /*@=enumint@*/ - { - ctype cnew = cttable_addDerived (CTK_ARRAY, ctbase_makeArray (c), c); - ctentry_setArray (cte, cnew); - return (cnew); - } - else - return clp; -} - -/* -** requires c is a pointer of array -*/ - -ctype -ctype_baseArrayPtr (ctype c) -{ - ctentry cte = ctype_getCtentry (ctype_realType (c)); - - if (ctype_isConj (c)) - { - if (ctype_isAP (ctype_getConjA (c))) - { - if (ctype_isAP (ctype_getConjB (c))) - { - return (ctype_makeConj (ctype_baseArrayPtr (ctype_getConjA (c)), - ctype_baseArrayPtr (ctype_getConjB (c)))); - } - else - { - return (ctype_baseArrayPtr (ctype_getConjA (c))); - } - } - else - { - return (ctype_baseArrayPtr (ctype_getConjB (c))); - } - } - else if (ctype_isInt (c)) /* could be NULL */ - { - return ctype_unknown; - } - else - { - ctype clp = ctentry_getBase (cte); - - if (ctype_isBroken (clp)) - { - llbuglit ("ctype_baseArrayPtr: bogus ctype"); - } - - return clp; - } -} - -ctype -ctype_returnValue (ctype c) -{ - return (ctbase_baseFunction (ctype_getCtbaseSafe (c))); -} - -/* -** must be a shared pointer -*/ - -/*@observer@*/ uentryList -ctype_argsFunction (ctype c) -{ - return (ctbase_argsFunction (ctype_getCtbaseSafe (c))); -} - -/* -** Returns type with base type p and compound types from c. -** -** i.e., c = char *[]; p = int -** => int *[] -*/ - -ctype -ctype_newBase (ctype c, ctype p) -{ - return (ctbase_newBase (c, p)); -} - -bool -ctype_sameAltTypes (ctype c1, ctype c2) -{ - ctype c1a, c2a; - ctype c1b, c2b; - - llassert (ctype_isConj (c1) && ctype_isConj (c2)); - - c1a = ctype_getConjA (c1); - c2a = ctype_getConjA (c2); - - c1b = ctype_getConjB (c1); - c2b = ctype_getConjB (c2); - - if (ctype_compare (c1a, c2a) == 0) - { - if (ctype_compare (c1b, c2b) == 0) - { - return TRUE; - } - else - { - if (ctype_isConj (c1b) && ctype_isConj (c2b)) - { - return ctype_sameAltTypes (c1b, c2b); - } - else - { - return FALSE; - } - } - } - else - { - if (ctype_compare (c1a, c2b) == 0) - { - if (ctype_compare (c1b, c2a) == 0) - { - return TRUE; - } - else - { - if (ctype_isConj (c1b) && ctype_isConj (c2a)) - { - return ctype_sameAltTypes (c1b, c2a); - } - else - { - return FALSE; - } - } - } - else - { - return FALSE; - } - } -} - -int -ctype_compare (ctype c1, ctype c2) -{ - ctentry ce1; - ctentry ce2; - - /* Can't get entries for special ctypes (elips marker) */ - - if (ctype_isElips (c1) || ctype_isElips (c2) - || ctype_isMissingParamsMarker (c1) || ctype_isMissingParamsMarker (c2)) { - return int_compare (c1, c2); - } - - ce1 = ctype_getCtentry (c1); - ce2 = ctype_getCtentry (c2); - - if (ctentry_isComplex (ce1)) - { - if (ctentry_isComplex (ce2)) - { - return (ctbase_compare (ctype_getCtbase (c1), - ctype_getCtbase (c2), FALSE)); - } - else - { - return 1; - } - } - else if (ctentry_isComplex (ce2)) - { - return -1; - } - else - { - return (int_compare (c1, c2)); - } -} - -/* -** complex types -*/ - -/* -** makeFunction: pointer to function returning base -*/ - -ctype -ctype_makeParamsFunction (ctype base, /*@only@*/ uentryList p) -{ - uentryList_fixImpParams (p); - return (ctype_makeFunction (base, p)); -} - -ctype -ctype_makeNFParamsFunction (ctype base, /*@only@*/ uentryList p) -{ - uentryList_fixImpParams (p); - return (ctbase_makeNFFunction (base, p)); -} - -ctype -ctype_makeFunction (ctype base, /*@only@*/ uentryList p) -{ - ctype ret; - ret = ctbase_makeFunction (base, p); - return (ret); -} - -ctype ctype_expectFunction (ctype c) -{ - /* handle parenthesized declarations */ - - if (!ctype_isAP (c)) - { - c = ctype_makePointer (c); - } - - return (cttable_addComplex (ctbase_expectFunction (c))); -} - -/* -** makeRealFunction: function returning base -*/ - -ctype ctype_makeRealFunction (ctype base, uentryList p) -{ - return (cttable_addComplex (ctbase_makeRealFunction (base, p))); -} - -/* -** plain predicates -*/ - -/*** -**** this is very poorly defined -**** -**** need to unify function/function pointer meaning -***/ - -bool -ctype_isFunction (ctype c) -{ - return (ctbase_isFunction (ctype_getCtbase (c))); -} - -bool -ctype_isExpFcn (ctype c) -{ - return (ctbase_isExpFcn (ctype_getCtbase (c))); -} - -bool -ctype_isVoid (ctype c) -{ - return (c == CTX_VOID); -} - -bool -ctype_isArbitraryIntegral (ctype c) -{ - ctype cr = ctype_realType (c); - - return (cr == ctype_anyintegral || cr == ctype_unsignedintegral - || cr == ctype_signedintegral); -} - -bool -ctype_isUnsignedIntegral (ctype c) -{ - ctype cr = ctype_realType (c); - - return (cr == ctype_unsignedintegral); -} - -bool -ctype_isSignedIntegral (ctype c) -{ - ctype cr = ctype_realType (c); - - return (cr == ctype_signedintegral); -} - -bool -ctype_isInt (ctype c) -{ - cprim cp = ctype_toCprim (c); - - return (c == ctype_unknown || cprim_isAnyInt (cp) - || (cprim_isAnyChar (cp) && context_msgCharInt ()) - || (c == ctype_bool && context_msgBoolInt ()) - || (ctype_isEnum (c) && context_msgEnumInt ())); -} - -bool -ctype_isRegularInt (ctype c) -{ - cprim cp = ctype_toCprim (c); - - return (c == ctype_unknown - || cprim_closeEnough (cprim_int, cp) - || (cprim_isAnyChar (cp) && context_msgCharInt ()) - || (c == ctype_bool && context_msgBoolInt ()) - || (ctype_isEnum (c) && context_msgEnumInt ())); -} - -bool -ctype_isString (ctype c) -{ - return (c == ctype_string - || (ctype_isPointer (c) - && ctype_isChar (ctype_baseArrayPtr (c)))); -} - -bool -ctype_isChar (ctype c) -{ - return ((c == ctype_unknown) || (cprim_isAnyChar (ctype_toCprim (c))) - || (context_getFlag (FLG_CHARINT) && ctype_isInt (c))); -} - -bool -ctype_isUnsignedChar (ctype c) -{ - return ((c == ctype_unknown) || (cprim_isUnsignedChar (ctype_toCprim (c)))); -} - -bool -ctype_isSignedChar (ctype c) -{ - return ((c == ctype_unknown) || (cprim_isSignedChar (ctype_toCprim (c)))); -} - -/* -** Returns true if c matches the name -booltype -*/ - -bool -ctype_isManifestBool (ctype c) -{ - /* - ** Changed the meaning of ctype_isBool - evs 2000-07-24 - ** The old meaning was very convoluted! - ** - ** c is a bool if: - ** c == CTX_BOOL - its a direct bool - ** c is a user/abstract type matching the bool name - ** (should never occur?) - */ - - if (ctype_isDirectBool (c)) { - return TRUE; - } else if (ctype_isUA (c)) { - return ctype_isUserBool (c); - } else { - return FALSE; - } -} - -bool -ctype_isBool (ctype c) -{ - /* - ** Changed the meaning of ctype_isBool - evs 2000-07-24 - ** The old meaning was very convoluted! - ** - ** c is a bool if: - ** its a manifest bool - ** +boolint and ctype_isInt (c) - */ - - if (ctype_isManifestBool (c)) { - return TRUE; - } else if (context_msgBoolInt ()) { - return ctype_isInt (c); - } else { - return FALSE; - } - -# if 0 - if (context_getFlag (FLG_ABSTRACTBOOL)) - { - if (typeId_isInvalid (boolType)) - { - boolType = usymtab_getTypeId (context_getBoolName ()); - } - - if (context_hasAccess (boolType)) - { - return (((c == CTX_UNKNOWN) || (c == CTX_BOOL) - || (context_msgBoolInt () - && (c == CTX_INT - || (c == CTX_CHAR && context_msgCharInt ())))) - || ctype_isInt (c)); - } - } - - return ((c == CTX_UNKNOWN) || (c == CTX_BOOL) - || (context_msgBoolInt () - && (c == CTX_INT || (c == CTX_CHAR && context_msgCharInt ())))); -# endif -} - -bool -ctype_isDirectBool (ctype c) -{ - return (c == CTX_BOOL); -} - -bool -ctype_isReal (ctype c) -{ - return (cprim_isAnyReal (ctype_toCprim (c))); -} - -bool -ctype_isFloat (ctype c) -{ - return (c == ctype_float); -} - -bool -ctype_isDouble (ctype c) -{ - return (c == ctype_double || c == ctype_ldouble); -} - -bool -ctype_isSigned (ctype c) -{ - return (!ctype_isUnsigned (c)); -} - -bool -ctype_isNumeric (ctype c) -{ - return (ctype_isInt (c) || ctype_isReal (c) || ctype_isEnum (c)); -} - - -/* -** real predicates -** -** work on actual type in current context -*/ - -bool -ctype_isRealNumeric (ctype c) -{ - if (ctype_isPlain (c)) - return (ctype_isNumeric (ctype_realType (c))); - if (ctype_isConj (c)) - return (ctype_isRealNumeric (ctype_getConjA (c)) || - ctype_isRealNumeric (ctype_getConjB (c))); - else - return FALSE; -} - -bool -ctype_isRealInt (ctype c) -{ - if (ctype_isPlain (c)) - return (ctype_isInt (ctype_realType (c))); - else if (ctype_isConj (c)) - return (ctype_isRealInt (ctype_getConjA (c)) || - ctype_isRealInt (ctype_getConjB (c))); - else - { - if (ctype_isEnum (c) && context_msgEnumInt ()) return TRUE; - return FALSE; - } -} - -bool -ctype_isRealVoid (ctype c) -{ - if (ctype_isPlain (c)) - { - return (ctype_isVoid (ctype_realType (c))); - } - else if (ctype_isConj (c)) - { - return (ctype_isRealVoid (ctype_getConjA (c)) || - ctype_isRealVoid (ctype_getConjB (c))); - } - else - { - return FALSE; - } -} - -bool -ctype_isRealBool (ctype c) -{ - if (ctype_isPlain (c)) - { - return (ctype_isBool (ctype_realishType (c))); - } - else if (ctype_isConj (c)) - { - return (ctype_isRealBool (ctype_getConjA (c)) || - ctype_isRealBool (ctype_getConjB (c))); - } - else - { - return FALSE; - } -} - -bool -ctype_isRealPointer (ctype c) -{ - if (ctype_isConj (c)) - return (ctype_isRealPointer (ctype_getConjA (c)) || - ctype_isRealPointer (ctype_getConjB (c))); - return (ctype_isPointer (ctype_realType (c))); -} - -bool -ctype_isRealSU (ctype c) -{ - if (ctype_isConj (c)) - { - return (ctype_isRealSU (ctype_getConjA (c)) || - ctype_isRealSU (ctype_getConjB (c))); - } - return (ctype_isStructorUnion (ctype_realType (c))); -} - -bool -ctype_isRealArray (ctype c) -{ - if (ctype_isConj (c)) - return (ctype_isRealArray (ctype_getConjA (c)) || - ctype_isRealArray (ctype_getConjB (c))); - return (ctype_isArray (ctype_realType (c))); -} - -bool -ctype_isRealAP (ctype c) -{ - if (ctype_isConj (c)) - return (ctype_isRealAP (ctype_getConjA (c)) || - ctype_isRealAP (ctype_getConjB (c))); - return (ctype_isAP (ctype_realType (c))); -} - -bool -ctype_isRealFunction (ctype c) -{ - if (ctype_isConj (c)) - return (ctype_isRealFunction (ctype_getConjA (c)) || - ctype_isRealFunction (ctype_getConjB (c))); - return (ctype_isFunction (ctype_realType (c))); -} - -bool -ctype_isDirectInt (ctype c) -{ - return (c == CTX_INT || c == CTX_UINT || c == CTX_SINT || c == CTX_ULINT || c == CTX_USINT); -} - -/* -** forceful predicates -** -** take *ctype; if its a conjunct, and there is a match replace with match only. -** if both match, still conjunct -*/ - -static bool - ctype_isForcePred (ctype * c, bool (pred) (ctype)) -{ - if (ctype_isConj (*c)) - { - ctype cbr = ctype_getConjA (*c); - - if ((*pred) (cbr)) - { - if ((*pred) (ctype_getConjB (*c))) - { - ; - } - else - { - *c = cbr; - } - - return TRUE; - } - else - { - if ((*pred) (cbr = ctype_getConjB (*c))) - { - *c = cbr; - return TRUE; - } - } - } - - return ((*pred) (*c)); -} - -bool -ctype_isForceRealNumeric (ctype * c) -{ - return (ctype_isForcePred (c, ctype_isRealNumeric)); -} - -bool -ctype_isForceRealInt (ctype * c) -{ - return (ctype_isForcePred (c, ctype_isRealInt)); -} - -bool -ctype_isForceRealBool (ctype * c) -{ - return (ctype_isForcePred (c, ctype_isRealBool)); -} - -/* -** conjuncts -** -** save int/char, int/bool, other random conjuncts -*/ - -static ctype -ctype_makeConjAux (ctype c1, ctype c2, bool isExplicit) -{ - if (ctype_isBogus (c1) || ctype_isUndefined (c1)) - { - return c2; - } - else if (ctype_isBogus (c2) || ctype_isUndefined (c2)) - { - return c1; - } - else - { - if (isExplicit) - { - return (ctype_makeExplicitConj (c1, c2)); - } - else - { - return (ctype_makeConj (c1, c2)); - } - } -} - -ctype -ctype_makeExplicitConj (ctype c1, ctype c2) -{ - if (ctype_isFunction (c1) && !ctype_isFunction (c2)) - { - ctype ret = ctype_makeExplicitConj (ctype_returnValue (c1), c2); - - return ctype_makeFunction (ret, uentryList_copy (ctype_getParams (c1))); - } - else if (ctype_isFunction (c2) && !ctype_isFunction (c1)) - { - ctype ret = ctype_makeExplicitConj (c1, ctype_returnValue (c2)); - - return ctype_makeFunction (ret, uentryList_copy (ctype_getParams (c2))); - } - else - { - return (cttable_addComplex (ctbase_makeConj (c1, c2, TRUE))); - } -} - -static ctype ic = ctype_unknown; /* int | char */ -static ctype ib = ctype_unknown; /* int | bool */ -static ctype ifl = ctype_unknown; /* int | float */ -static ctype ibf = ctype_unknown; /* int | bool | float */ -static ctype ibc = ctype_unknown; /* int | bool | char */ -static ctype iv = ctype_unknown; /* int | void * */ -static ctype ivf = ctype_unknown; /* int | void * | float */ -static ctype ivb = ctype_unknown; /* int | void * | bool */ -static ctype ivbf = ctype_unknown; /* int | void * | bool | float */ -static ctype cuc = ctype_unknown; /* char | unsigned char */ - -static void -ctype_recordConj (ctype c) -{ - ctype c1, c2; - - llassert (ctype_isConj (c)); - - c1 = ctype_getConjA (c); - c2 = ctype_getConjB (c); - - /* No, can't swap! - if (c2 == ctype_int && c1 != ctype_int) - { - ctype tmp; - - tmp = c1; - c1 = c2; - c2 = tmp; - } - */ - - if (c1 == ctype_int) - { - if (c2 == ctype_char) - { - llassert (ic == ctype_unknown); - ic = c; - } - else if (c2 == ctype_bool) - { - llassert (ib == ctype_unknown); - ib = c; - } - else if (c2 == ctype_float) - { - llassert (ifl == ctype_unknown); - ifl = c; - } - else if (c2 == CTP_VOID) - { - llassert (iv == ctype_unknown); - iv = c; - } - else - { - /* not special */ - } - } - else if (c1 == ib && ib != ctype_unknown) - { - if (c2 == ctype_float) - { - llassert (ibf == ctype_unknown); - ibf = c; - } - else if (c2 == ctype_char) - { - llassert (ibc == ctype_unknown); - ibc = c; - } - else - { - /* not special */ - } - } - else if (c1 == iv) - { - if (c2 == ctype_bool) - { - llassert (ivb == ctype_unknown); - ivb = c; - } - else if (c2 == ctype_float) - { - llassert (ivf == ctype_unknown); - ivf = c; - } - else - { - /* not special */ - } - } - else if (c1 == ivf) - { - if (c2 == ctype_bool) - { - llassert (ivbf == ctype_unknown); - ivbf = c; - } - } - else if (c1 == ivb) - { - if (c2 == ctype_float) - { - llassert (ivbf == ctype_unknown); - ivbf = c; - } - } - else if (c1 == ctype_char) - { - if (c2 == ctype_uchar) - { - llassert (cuc == ctype_unknown); - - cuc = c; - } - } - else - { - /* not special */ - } -} - -ctype -ctype_makeConj (ctype c1, ctype c2) -{ - /* no: can have unsigned long @alt long@: llassert (c1 != c2); */ - - DPRINTF (("Make conj: %s / %s", ctype_unparse (c1), ctype_unparse (c2))); - - if (ctype_isFunction (c1) && !ctype_isFunction (c2)) - { - ctype ret = ctype_makeConj (ctype_returnValue (c1), c2); - return ctype_makeFunction (ret, uentryList_copy (ctype_getParams (c1))); - } - else if (ctype_isFunction (c2) && !ctype_isFunction (c1)) - { - ctype ret = ctype_makeConj (c1, ctype_returnValue (c2)); - return ctype_makeFunction (ret, uentryList_copy (ctype_getParams (c2))); - } - else - { - if (ctype_isManifestBool (c1)) - { - c1 = ctype_bool; - } - - if (ctype_isManifestBool (c2)) - { - c2 = ctype_bool; - } - - if (ctbase_isVoidPointer (ctype_getCtbaseSafe (c1))) - { - c1 = ctype_voidPointer; - } - - if (ctbase_isVoidPointer (ctype_getCtbaseSafe (c2))) - { - c2 = ctype_voidPointer; - } - - /* - ** Ouch, can't do this. unsigned, etc. modifiers might - ** apply to wrong type! - ** - ** if (c2 == ctype_int && c1 != ctype_int) - ** { - ** ctype tmp; - ** - ** tmp = c1; - ** c1 = c2; - ** c2 = tmp; - ** } - ** - */ - - if (c1 == ctype_int) - { - if (c2 == ctype_char) - { - if (ic == ctype_unknown) - { - ic = cttable_addComplex (ctbase_makeConj (ctype_int, ctype_char, FALSE)); - } - - return ic; - } - else if (c2 == ctype_bool) - { - if (ib == ctype_unknown) - { - ib = cttable_addComplex - (ctbase_makeConj (ctype_int, ctype_bool, FALSE)); - } - - return ib; - } - else if (c2 == ctype_float) - { - if (ifl == ctype_unknown) - { - ifl = cttable_addComplex (ctbase_makeConj (ctype_int, ctype_float, FALSE)); - } - - return ifl; - } - else - { - if (c2 == ctype_voidPointer) - { - if (iv == ctype_unknown) - { - iv = cttable_addComplex - (ctbase_makeConj (ctype_int, - ctype_voidPointer, - FALSE)); - } - - return iv; - } - } - } - else if (c1 == ib && ib != ctype_unknown) - { - if (c2 == ctype_float) - { - if (ibf == ctype_unknown) - { - ibf = cttable_addComplex (ctbase_makeConj (ib, ctype_float, FALSE)); - } - - return ibf; - } - else if (c2 == ctype_char) - { - if (ibc == ctype_unknown) - { - ibc = cttable_addComplex (ctbase_makeConj (ib, ctype_char, FALSE)); - } - - return ibc; - } - else - { - ; - } - } - else if (c1 == iv) - { - if (c2 == ctype_bool) - { - if (ivb == ctype_unknown) - { - ivb = cttable_addComplex (ctbase_makeConj (c1, c2, FALSE)); - } - - return ivb; - } - else if (c2 == ctype_float) - { - if (ivf == ctype_unknown) - { - ivf = cttable_addComplex (ctbase_makeConj (c1, c2, FALSE)); - } - - return ivf; - } - else - { - ; - } - } - else if (c1 == ivf) - { - if (c2 == ctype_bool) - { - if (ivbf == ctype_unknown) - { - ivbf = cttable_addComplex (ctbase_makeConj (c1, c2, FALSE)); - } - - return ivbf; - } - } - else if (c1 == ivb) - { - if (c2 == ctype_float) - { - if (ivbf == ctype_unknown) - { - ivbf = cttable_addComplex (ctbase_makeConj (c1, c2, FALSE)); - } - - return ivbf; - } - } - else if (c1 == ctype_char) - { - if (c2 == ctype_uchar) - { - if (cuc == ctype_unknown) - { - cuc = cttable_addComplex (ctbase_makeConj (c1, c2, FALSE)); - } - - return cuc; - } - } - else - { - ; - } - - - return (cttable_addComplex (ctbase_makeConj (c1, c2, FALSE))); - } -} - - -bool -ctype_isConj (ctype c) -{ - return (ctype_isComplex (c) && ctbase_isConj (ctype_getCtbase (c))); -} - -static ctype -ctype_getConjA (ctype c) -{ - if (!ctype_isConj (c)) - llbuglit ("ctype_getConjA: not a conj"); - return (ctbase_getConjA (ctype_getCtbaseSafe (c))); -} - -static ctype -ctype_getConjB (ctype c) -{ - if (!ctype_isConj (c)) - llbuglit ("ctype_getConjB: not a conj"); - return (ctbase_getConjB (ctype_getCtbaseSafe (c))); -} - -static bool -ctype_isExplicitConj (ctype c) -{ - return (ctype_isConj (c) && ctbase_isExplicitConj (ctype_getCtbaseSafe (c))); -} - -/** << need to fix resolveConj >> **/ - -/* -** structs and unions -*/ - -ctype -ctype_createStruct (/*@only@*/ cstring n, /*@only@*/ uentryList f) -{ - ctype ct; - - DPRINTF (("Creating a struct: %s / %s", - n, uentryList_unparse (f))); - - ct = cttable_addComplex (ctbase_createStruct (n, f)); - DPRINTF (("ct: %s", ctype_unparse (ct))); - return (ct); -} - -uentryList -ctype_getFields (ctype c) -{ - return (ctbase_getuentryList (ctype_getCtbaseSafe (c))); -} - -ctype -ctype_createUnion (/*@only@*/ cstring n, /*@only@*/ uentryList f) -{ - ctype ret; - - ret = cttable_addComplex (ctbase_createUnion (n, f)); - return ret; -} - -/* -** matching -** -** if ctype's are same, definite match. -** else, need to call ctbase_match. -** -** if necessary context can memoize matches -*/ - -static bool - quickMatch (ctype c1, ctype c2) -{ - if (c1 == c2) - return TRUE; - - return FALSE; -} - -bool -ctype_genMatch (ctype c1, ctype c2, bool force, bool arg, bool def, bool deep) -{ - bool match; - - DPRINTF (("Gen match: %s / %s arg: %s", ctype_unparse (c1), ctype_unparse (c2), bool_unparse (arg))); - - if (quickMatch (c1, c2)) - { - return TRUE; - } - - if (ctype_isElips (c1) || ctype_isElips (c2)) - { - return FALSE; - } - else - { - match = ctbase_genMatch (ctype_getCtbase (c1), ctype_getCtbase (c2), force, arg, def, deep); - return (match); - } -} - -bool -ctype_sameName (ctype c1, ctype c2) -{ - if (quickMatch (c1, c2)) - return TRUE; - else - return (cstring_equal (ctype_unparse (c1), ctype_unparse (c2))); -} - -bool -ctype_almostEqual (ctype c1, ctype c2) -{ - if (ctype_equal (c1, c2)) - { - return TRUE; - } - else - { - return (ctbase_almostEqual (ctype_getCtbase (c1), ctype_getCtbase (c2))); - } -} - -bool -ctype_matchDef (ctype c1, ctype c2) -{ - DPRINTF (("Match def: %s / %s", ctype_unparse (c1), ctype_unparse (c2))); - - if (quickMatch (c1, c2)) - return TRUE; - - if (ctype_isElips (c1)) - return (ctype_isElips (c2) || ctype_isUnknown (c2)); - - if (ctype_isElips (c2)) - return (ctype_isUnknown (c2)); - else - { - bool oldrelax = context_getFlag (FLG_RELAXQUALS); - bool res; - - context_setFlagTemp (FLG_RELAXQUALS, FALSE); - res = ctbase_matchDef (ctype_getCtbase (c1), ctype_getCtbase (c2)); - context_setFlagTemp (FLG_RELAXQUALS, oldrelax); - return res; - } -} - -bool ctype_match (ctype c1, ctype c2) -{ - if (quickMatch (c1, c2)) - return TRUE; - - if (ctype_isElips (c1)) - return (ctype_isElips (c2) || ctype_isUnknown (c2)); - - if (ctype_isElips (c2)) - return (ctype_isUnknown (c2)); - - return (ctbase_match (ctype_getCtbase (c1), ctype_getCtbase (c2))); -} - -bool -ctype_forceMatch (ctype c1, ctype c2) -{ - if (quickMatch (c1, c2)) - return TRUE; - - if (ctype_isElips (c1)) - return (ctype_isElips (c2)); - - if (ctype_isElips (c2)) - return FALSE; - - /*@-modobserver@*/ - /* The call forceMatch may modify the observer params, but, we don't care. */ - return (ctbase_forceMatch (ctype_getCtbase (c1), ctype_getCtbase (c2))); - /*@=modobserver@*/ -} - -bool -ctype_matchArg (ctype c1, ctype c2) -{ - if (quickMatch (c1, c2)) - { - return TRUE; - } - else - { - return (ctbase_matchArg (ctype_getCtbase (c1), ctype_getCtbase (c2))); - } -} - -/* -** simple ctype_is operations. -** DO NOT use real type of c, only direct type. -*/ - -/* -** ctype_isVoidPointer -** -** void * -*/ - -bool -ctype_isVoidPointer (ctype c) -{ - if (ctype_isComplex (c)) - { - return ctbase_isVoidPointer (ctype_getCtbaseSafe (c)); - } - if (ctype_isConj (c)) - { - return (ctype_isVoidPointer (ctype_getConjA (c)) || - ctype_isVoidPointer (ctype_getConjB (c))); - } - else - { - return (c == ctype_voidPointer - || (ctype_isRealPointer (c) - && ctype_isVoid (ctype_baseArrayPtr (c)))); - } -} - -/* -** ctype_isPointer -** -** true for C and LCL pointers -*/ - -bool -ctype_isPointer (ctype c) -{ - if (ctype_isElips (c)) return FALSE; - - if (ctype_isComplex (c)) - { - ctbase ctb = ctype_getCtbaseSafe (c); - bool res = ctbase_isPointer (ctb); - - return res; - } - else - { - bool res = ctentry_isPointer (ctype_getCtentry (c)); - - return res; - } -} - -/* -** ctype_isArray -** -** true for C and LCL array's -*/ - -bool -ctype_isArray (ctype c) -{ - if (ctype_isElips (c)) return FALSE; - - if (ctype_isComplex (c)) - return (ctbase_isEitherArray (ctype_getCtbaseSafe (c))); - else - return (ctentry_isArray (ctype_getCtentry (c))); -} - -bool ctype_isIncompleteArray (ctype c) -{ - return (ctype_isArray (c) && !ctype_isFixedArray (c)); -} - -bool ctype_isFixedArray (ctype c) -{ - if (ctype_isElips (c)) return FALSE; - - return (ctbase_isFixedArray (ctype_getCtbaseSafe (c))); -} - -bool -ctype_isArrayPtr (ctype c) -{ - return ((ctype_isArray (c)) || (ctype_isPointer (c))); -} - -typeId -ctype_typeId (ctype c) -{ - return (ctbase_typeId (ctype_getCtbase (c))); -} - -cstring -ctype_unparseDeclaration (ctype c, /*@only@*/ cstring name) -{ - llassert (!(ctype_isElips (c) || ctype_isMissingParamsMarker (c))); - return (ctbase_unparseDeclaration (ctype_getCtbase (c), name)); -} - -cstring -ctype_unparse (ctype c) -{ - if (ctype_isElips (c)) - { - return cstring_makeLiteralTemp ("..."); - } - else if (ctype_isMissingParamsMarker (c)) - { - return cstring_makeLiteralTemp ("-"); - } - else - { - /*@-modobserver@*/ - return (ctentry_doUnparse (ctype_getCtentry (c))); - /*@=modobserver@*/ - } -} - -cstring -ctype_unparseSafe (ctype c) -{ - if (ctype_isElips (c)) - { - return cstring_makeLiteralTemp ("..."); - } - else if (ctype_isMissingParamsMarker (c)) - { - return cstring_makeLiteralTemp ("-"); - } - else - { - cstring ret; - - if /*@+enumint@*/ (c >= CTK_PLAIN && c < cttab.size) /*@=enumint@*/ - { - ctentry cte = ctype_getCtentry (c); - - if (cstring_isDefined (cte->unparse)) - { - return (cte->unparse); - } - } - - ret = message ("[%d]", (int) c); - cstring_markOwned (ret); - return ret; - } -} - -cstring -ctype_unparseDeep (ctype c) -{ - if (ctype_isElips (c)) - { - return cstring_makeLiteralTemp ("..."); - } - if (ctype_isMissingParamsMarker (c)) - { - return cstring_makeLiteralTemp ("-"); - } - - return (ctentry_doUnparseDeep (ctype_getCtentry (c))); -} - -ctype -ctype_undump (char **c) -{ - return ((ctype) getInt (c)); /* check its valid? */ -} - -cstring -ctype_dump (ctype c) -{ - DPRINTF (("Ctype dump: %s", ctype_unparse (c))); - - if (c < 0) - { - /* Handle invalid types in a kludgey way. */ - return (message ("0")); - } - - if (ctype_isUA (c)) - { - cstring tname = usymtab_getTypeEntryName - (usymtab_convertId (ctype_typeId (c))); - - if (cstring_equal (tname, context_getBoolName ())) - { - cstring_free (tname); - return (message ("%d", ctype_bool)); - } - - cstring_free (tname); - } - - DPRINTF (("Returning: %d", c)); - return (message ("%d", c)); -} - -ctype -ctype_getBaseType (ctype c) -{ - ctentry cte = ctype_getCtentry (c); - - switch (ctentry_getKind (cte)) - { - case CTK_UNKNOWN: - llcontbuglit ("ctype_getBaseType: unknown ctype"); break; - case CTK_INVALID: - llcontbuglit ("ctype_getBaseType: invalid ctype"); break; - case CTK_PLAIN: - return c; - case CTK_PTR: - case CTK_ARRAY: - return (ctype_getBaseType (ctype_baseArrayPtr (c))); - case CTK_COMPLEX: - { - ctbase ctb = cte->ctbase; - - if (ctbase_isDefined (ctb)) - { - switch (ctb->type) - { - case CT_UNKNOWN: - case CT_PRIM: - case CT_USER: - case CT_ENUM: - case CT_ENUMLIST: - case CT_BOOL: - case CT_ABST: - case CT_FCN: - case CT_STRUCT: - case CT_UNION: - case CT_EXPFCN: - return c; - case CT_PTR: - case CT_ARRAY: - return (ctype_getBaseType (ctb->contents.base)); - case CT_FIXEDARRAY: - return (ctype_getBaseType (ctb->contents.farray->base)); - case CT_CONJ: /* base type of A conj branch? */ - return (ctype_getBaseType (ctb->contents.conj->a)); - } - } - else - { - return c; - } - } - default: - llbuglit ("ctype_newBase: bad case"); - } - llcontbuglit ("ctype_getBaseType: unreachable code"); - return ((ctype)NULL); -} - -ctype -ctype_adjustPointers (int np, ctype c) -{ - - if (ctype_isFunction (c)) - { - c = ctype_makeParamsFunction - (ctype_adjustPointers (np, ctype_returnValue (c)), - uentryList_copy (ctype_argsFunction (c))); - } - else - { - /* fix this should not use getBaseType ??? */ - ctype cb = ctype_getBaseType (c); - - while (np > 0) - { - cb = ctype_makePointer (cb); - np--; - } - c = ctype_newBase (c, cb); - } - - return (c); -} - - -enumNameList -ctype_elist (ctype c) -{ - return (ctbase_elist (ctype_getCtbase (c))); -} - -bool -ctype_isFirstVoid (ctype c) -{ - return (c == CTX_VOID || (ctype_isConj (c) && ctype_isFirstVoid (ctype_getConjA (c)))); -} - -ctype -ctype_createEnum (/*@keep@*/ cstring tag, /*@keep@*/ enumNameList el) -{ - return (cttable_addComplex (ctbase_createEnum (tag, el))); -} - -bool -ctype_isEnum (ctype c) -{ - return (ctype_isComplex (c) && ctbase_isEnum (ctype_getCtbase (c))); -} - -cstring -ctype_enumTag (ctype c) -{ - llassert (ctype_isEnum (c)); - - return (ctbase_enumTag (ctype_getCtbaseSafe (c))); -} - -bool -ctype_isStruct (ctype c) -{ - return (ctype_isComplex (c) && ctbase_isStruct (ctype_getCtbaseSafe (c))); -} - -bool -ctype_isUnion (ctype c) -{ - return (ctype_isComplex (c) && ctbase_isUnion (ctype_getCtbaseSafe (c))); -} - -ctype -ctype_resolveNumerics (ctype c1, ctype c2) -{ - /* - ** returns longest type of c1 and c2 - */ - - if (c1 == c2) return c1; - - c1 = ctype_realType (c1); - c2 = ctype_realType (c2); - - if (ctype_isEnum (c1)) c1 = ctype_unknown; - if (ctype_isEnum (c2)) c2 = ctype_int; - - if (c1 == ctype_ldouble || c2 == ctype_ldouble) return ctype_ldouble; - if (c1 == ctype_ulint || c2 == ctype_ulint) return ctype_ulint; - if (c1 == ctype_lint || c2 == ctype_lint) return ctype_lint; - if (c1 == ctype_uint || c2 == ctype_uint) return ctype_uint; - if (c1 == ctype_int || c2 == ctype_int) return ctype_int; - if (c1 == ctype_sint || c2 == ctype_sint) return ctype_sint; - if (c1 == ctype_uchar || c2 == ctype_uchar) return ctype_uchar; - if (c1 == ctype_char || c2 == ctype_char) return ctype_char; - - if (ctype_isKnown (c1)) return c1; - else return c2; -} - -bool -ctype_isStructorUnion (ctype c) -{ - return (ctype_isStruct (c) || ctype_isUnion (c)); -} - -ctype -ctype_fixArrayPtr (ctype c) -{ - if (ctype_isArray (c)) - { - return (ctype_makePointer (ctype_baseArrayPtr (c))); - } - else - return c; -} - -/* -** createUnnamedStruct/Union -** -** check if it corresponds to an existing LCL-specified unnamed struct -** otherwise, give it a new tag -*/ - -ctype -ctype_createUnnamedStruct (/*@only@*/ uentryList f) -{ - ctype ret = usymtab_structFieldsType (f); - - if (ctype_isDefined (ret)) - { - uentryList_free (f); - return ret; - } - else - { - cstring ft = fakeTag (); - ctype ct = ctype_createStruct (cstring_copy (ft), f); - uentry ue = uentry_makeStructTagLoc (ft, ct); - - usymtab_supGlobalEntry (ue); - - cstring_free (ft); - return (ct); - } -} - -ctype -ctype_createUnnamedUnion (/*@only@*/ uentryList f) -{ - ctype ret = usymtab_unionFieldsType (f); - - if (ctype_isDefined (ret)) - { - uentryList_free (f); - return ret; - } - else - { - cstring ft = fakeTag (); - ctype ct = ctype_createUnion (cstring_copy (ft), f); - uentry ue = uentry_makeUnionTagLoc (ft, ct); - - usymtab_supGlobalEntry (ue); - cstring_free (ft); - return (ct); - } -} - -ctype -ctype_createForwardStruct (cstring n) -{ - uentry ue = uentry_makeStructTag (n, ctype_unknown, fileloc_undefined); - ctype ct = usymtab_supForwardTypeEntry (ue); - - cstring_free (n); - return (ct); -} - -ctype -ctype_createForwardUnion (cstring n) -{ - uentry ue = uentry_makeUnionTag (n, ctype_unknown, fileloc_undefined); - ctype ct = usymtab_supForwardTypeEntry (ue); - - cstring_free (n); - return (ct); -} - -ctype -ctype_removePointers (ctype c) -{ - ctype oldc; - - while (ctype_isArrayPtr (c)) - { - oldc = c; - c = ctype_baseArrayPtr (c); - llassert (c != oldc); - } - - return (c); -} - -bool ctype_isMutable (ctype t) -{ - if (ctype_isUA (t)) - { - return (uentry_isMutableDatatype - (usymtab_getTypeEntry (ctype_typeId (t)))); - } - else - { - return (ctype_isPointer (ctype_realType (t))); - } -} - -bool ctype_isRefCounted (ctype t) -{ - if (ctype_isUA (t)) - { - return (uentry_isRefCountedDatatype - (usymtab_getTypeEntry (ctype_typeId (t)))); - } - - return FALSE; -} - -bool ctype_isVisiblySharable (ctype t) -{ - if (ctype_isUnknown (t)) return TRUE; - - if (ctype_isConj (t)) - { - return (ctype_isVisiblySharable (ctype_getConjA (t)) - || ctype_isVisiblySharable (ctype_getConjB (t))); - } - - if (ctype_isMutable (t)) - { - if (ctype_isUA (t)) - { - ctype rt = ctype_realType (t); - - if (rt == t) - { - return TRUE; - } - else - { - return ctype_isVisiblySharable (rt); - } - } - else - { - return TRUE; - } - } - - return FALSE; -} - -# if 0 -/* Replaced by ctype_isMutable (more sensible) */ -bool ctype_canAlias (ctype ct) -{ - /* can ct refer to memory locations? - ** ==> a pointer or a mutable abstract type - ** arrays? - */ - - ctype tr = ctype_realType (ct); - - return (ctype_isPointer (tr) || ctype_isMutable (ct) || ctype_isStructorUnion (tr)); -} -# endif - -/* -** c1 is the dominant type; c2 is the modifier type -** -** eg. double + long int => long double -*/ - -ctype ctype_combine (ctype dominant, ctype modifier) -{ - DPRINTF (("Combine: %s + %s", - ctype_unparse (dominant), - ctype_unparse (modifier))); - - if (ctype_isConj (dominant)) - { - ctype res; - - if (ctype_isExplicitConj (dominant)) - { - res = ctype_makeExplicitConj (ctype_combine (ctype_getConjA (dominant), - modifier), - ctype_getConjB (dominant)); - } - else - { - res = ctype_makeConj (ctype_combine (ctype_getConjA (dominant), - modifier), - ctype_getConjB (dominant)); - } - - return res; - } - - if (ctype_isUnknown (modifier)) - { - return dominant; - } - else if (ctype_isUnknown (dominant)) - { - return modifier; - } - else - { - if (ctype_isEnum (dominant)) dominant = ctype_int; - if (ctype_isEnum (modifier)) modifier = ctype_int; - - if (modifier == ctype_uint) - { - if (dominant == ctype_int) return ctype_uint; - if (dominant == ctype_lint) return ctype_ulint; - if (dominant == ctype_sint) return ctype_usint; - if (dominant == ctype_char) return ctype_uchar; - - /* evs 2000-07-28: added this line */ - if (dominant == ctype_llint) return ctype_ullint; - - if ((dominant == ctype_uint) || dominant == ctype_uchar) - { - voptgenerror (FLG_DUPLICATEQUALS, - message ("Duplicate unsigned qualifier"), - g_currentloc); - - return ctype_uint; - } - else - { - voptgenerror (FLG_DUPLICATEQUALS, - message ("Type qualifier unsigned used with %s", - ctype_unparse (dominant)), - g_currentloc); - - return dominant; - } - } - else if (modifier == ctype_llint) - { - if (dominant == ctype_int) - { - return ctype_llint; - } - - voptgenerror (FLG_DUPLICATEQUALS, - message ("Duplicate long qualifier on non-int"), - g_currentloc); - } - else if (modifier == ctype_lint) - { - if (dominant == ctype_int) return ctype_lint; - if (dominant == ctype_uint) return ctype_ulint; - if (dominant == ctype_double) return ctype_ldouble; - - if (dominant == ctype_lint || dominant == ctype_ulint - || dominant == ctype_sint || dominant == ctype_usint - || dominant == ctype_ldouble) - { - if (dominant == ctype_lint) - { - /* long long not supported by ANSI */ - return ctype_llint; - } - - if (dominant == ctype_sint || dominant == ctype_usint) - { - if (!context_getFlag (FLG_IGNOREQUALS)) - { - llerrorlit (FLG_SYNTAX, - "Contradictory long and short type qualifiers"); - } - } - else - { - voptgenerror (FLG_DUPLICATEQUALS, - message ("Duplicate long qualifier"), - g_currentloc); - } - - return ctype_lint; - } - } - else if (modifier == ctype_sint) - { - if (dominant == ctype_int) return ctype_sint; - if (dominant == ctype_uint) return ctype_usint; - - if (dominant == ctype_sint || dominant == ctype_usint) - { - voptgenerror (FLG_DUPLICATEQUALS, - message ("Duplicate short qualifier"), - g_currentloc); - return ctype_uint; - } - else if (dominant == ctype_lint) - { - if (!context_getFlag (FLG_IGNOREQUALS)) - { - llerrorlit (FLG_SYNTAX, - "Contradictory long and short type qualifiers"); - } - - return dominant; - } - else - { - if (!context_getFlag (FLG_IGNOREQUALS)) - { - llerror (FLG_SYNTAX, - message ("Type qualifier short used with %s", - ctype_unparse (dominant))); - } - - return dominant; - } - } - else if (modifier == ctype_ulint) - { - if (dominant == ctype_int) return modifier; - - if (dominant == ctype_lint || dominant == ctype_ulint) - { - voptgenerror (FLG_DUPLICATEQUALS, - message ("Duplicate long qualifier"), - g_currentloc); - - return modifier; - } - - if (dominant == ctype_uint || dominant == ctype_usint) - { - voptgenerror (FLG_DUPLICATEQUALS, - message ("Duplicate unsigned qualifier"), - g_currentloc); - - return modifier; - } - - if (dominant == ctype_sint || dominant == ctype_usint) - { - if (!context_getFlag (FLG_IGNOREQUALS)) - { - llerrorlit (FLG_SYNTAX, - "Contradictory long and short type qualifiers"); - } - - return dominant; - } - - if (!context_getFlag (FLG_IGNOREQUALS)) - { - llerror (FLG_SYNTAX, - message ("Type qualifiers unsigned long used with %s", - ctype_unparse (dominant))); - } - - return dominant; - } - else if (modifier == ctype_usint) - { - if (dominant == ctype_int) return modifier; - - if (dominant == ctype_sint || dominant == ctype_usint) - { - voptgenerror (FLG_DUPLICATEQUALS, - message ("Duplicate short qualifier"), - g_currentloc); - return modifier; - } - - if (dominant == ctype_uint) - { - voptgenerror (FLG_DUPLICATEQUALS, - message ("Duplicate unsigned qualifier"), - g_currentloc); - - return modifier; - } - - if (dominant == ctype_lint || dominant == ctype_ulint - || dominant == ctype_llint) - { - if (!context_getFlag (FLG_IGNOREQUALS)) - { - llerrorlit (FLG_SYNTAX, - "Contradictory long and short type qualifiers"); - } - - return dominant; - } - - if (!context_getFlag (FLG_IGNOREQUALS)) - { - llerror (FLG_SYNTAX, - message ("Type qualifiers unsigned short used with %s", - ctype_unparse (dominant))); - } - - return dominant; - } - else - { - ; - } - - return dominant; - } -} - -ctype ctype_resolve (ctype c) -{ - if (ctype_isUnknown (c)) return ctype_int; - return c; -} - -ctype ctype_fromQual (qual q) -{ - if (qual_isSigned (q)) return ctype_int; - if (qual_isUnsigned (q)) return ctype_uint; - if (qual_isLong (q)) return ctype_lint; - if (qual_isShort (q)) return ctype_sint; - - llcontbug (message ("ctype_fromQual: invalid qualifier: %s", qual_unparse (q))); - return ctype_unknown; -} - -bool -ctype_isAnyFloat (ctype c) -{ - return (cprim_isAnyReal (ctype_toCprim (c))); -} - -bool -ctype_isUnsigned (ctype c) -{ - if (ctype_isConj (c)) - return (ctype_isUnsigned (ctype_getConjA (c)) || - ctype_isUnsigned (ctype_getConjB (c))); - - return (c == ctype_uint || c == ctype_uchar - || c == ctype_usint || c == ctype_ulint - || c == ctype_unsignedintegral); -} - -static bool -ctype_isLong (ctype c) -{ - if (ctype_isConj (c)) - return (ctype_isLong (ctype_getConjA (c)) || - ctype_isLong (ctype_getConjB (c))); - - return (c == ctype_lint || c == ctype_ulint); -} - -static bool -ctype_isShort (ctype c) -{ - if (ctype_isConj (c)) - return (ctype_isShort (ctype_getConjA (c)) || - ctype_isShort (ctype_getConjB (c))); - - return (c == ctype_sint || c == ctype_usint); -} - -bool -ctype_isStackAllocated (ctype c) -{ - ctype ct = ctype_realType (c); - - if (ctype_isConj (ct)) - return (ctype_isStackAllocated (ctype_getConjA (ct)) || - ctype_isStackAllocated (ctype_getConjB (ct))); - - return (ctype_isArray (c) || ctype_isSU (c)); -} - -static bool ctype_isMoreUnsigned (ctype c1, ctype c2) -{ - return (ctype_isUnsigned (c1) && !ctype_isUnsigned (c2)); -} - -static bool ctype_isLonger (ctype c1, ctype c2) -{ - return ((ctype_isDouble (c1) && !ctype_isDouble (c2)) - || (ctype_isLong (c1) && !ctype_isLong (c2)) - || (ctype_isShort (c2) && !ctype_isShort (c1))); -} - -ctype -ctype_widest (ctype c1, ctype c2) -{ - if (ctype_isMoreUnsigned (c2, c1) - || ctype_isLonger (c2, c1)) - { - return c2; - } - else - { - return c1; - } -} - -/*drl 11/28/2000 */ -/* requires that the type is an fixed array */ -/* return the size of the array */ - -long int ctype_getArraySize (ctype c) -{ - ctentry cte = ctype_getCtentry (c); - ctbase ctb; - llassert ( (ctentry_getKind (cte) == CTK_COMPLEX) || (ctentry_getKind(cte) == CTK_ARRAY) ); - - ctb = cte->ctbase; - - llassert (ctbase_isDefined (ctb) ); - - llassert (ctb->type == CT_FIXEDARRAY); - - return (ctb->contents.farray->size); -} diff --git a/src/ctypeList.c b/src/ctypeList.c deleted file mode 100644 index c5fab28..0000000 --- a/src/ctypeList.c +++ /dev/null @@ -1,131 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** ctypeList.c -** -** based on list_template.c -** -** where T has T_equal (or change this) and T_unparse -*/ - -# include "lclintMacros.nf" -# include "basic.h" - -/*@only@*/ ctypeList -ctypeList_new () -{ - ctypeList s = (ctypeList) dmalloc (sizeof (*s)); - - s->nelements = 0; - s->nspace = ctypeListBASESIZE; - s->elements = (ctype *) dmalloc (sizeof (*s->elements) * ctypeListBASESIZE); - - return (s); -} - -static void -ctypeList_grow (/*@notnull@*/ ctypeList s) -{ - int i; - ctype *newelements; - - s->nspace += ctypeListBASESIZE; - newelements = (ctype *) dmalloc (sizeof (*newelements) * (s->nelements + s->nspace)); - - if (newelements == (ctype *) 0) - { - llfatalerror (cstring_makeLiteral ("ctypeList_grow: out of memory!")); - } - - for (i = 0; i < s->nelements; i++) - { - newelements[i] = s->elements[i]; - } - - sfree (s->elements); - s->elements = newelements; -} - -void ctypeList_addh (ctypeList s, ctype el) -{ - llassert (ctypeList_isDefined (s)); - llassert (ctypeListBASESIZE > 0); - - if (s->nspace <= 0) ctypeList_grow (s); - - s->nspace--; - s->elements[s->nelements] = el; - s->nelements++; -} - -/*@only@*/ cstring -ctypeList_unparse (ctypeList ct) -{ - cstring s = cstring_undefined; - int i; - bool first = TRUE; - - if (ctypeList_isUndefined (ct) || ctypeList_size (ct) == 0) - { - return (cstring_makeLiteral ("void")); - } - - for (i = 0; i < ct->nelements; i++) - { - if (first) - { - s = cstring_copy (ctype_unparse (ct->elements[i])); - first = FALSE; - } - else - { - s = message ("%q, %s", s, ctype_unparse (ct->elements[i])); - } - } - - return s; -} - -void -ctypeList_free (/*@only@*/ ctypeList s) -{ - if (ctypeList_isDefined (s)) - { - int i; - for (i = 0; i < s->nelements; i++) - { - /* ctype_free (s->elements[i]); */ - } - - sfree (s->elements); /* not quite!!! */ - sfree (s); - } -} - - - - - - - diff --git a/src/cvar.c b/src/cvar.c deleted file mode 100644 index 107d238..0000000 --- a/src/cvar.c +++ /dev/null @@ -1,31 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** cvar.c -*/ - -# include "lclintMacros.nf" -# include "basic.h" -# include "cvar.h" - diff --git a/src/declaratorInvNodeList.c b/src/declaratorInvNodeList.c deleted file mode 100644 index 64cc2d7..0000000 --- a/src/declaratorInvNodeList.c +++ /dev/null @@ -1,114 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** declaratorInvNodeList.c -** -** based on list_template.c -** -** where T has T_equal (or change this) and T_unparse -*/ - -# include "lclintMacros.nf" -# include "llbasic.h" - -declaratorInvNodeList - declaratorInvNodeList_new () -{ - declaratorInvNodeList s = (declaratorInvNodeList) dmalloc (sizeof (*s)); - - s->nelements = 0; - - s->nspace = declaratorInvNodeListBASESIZE; - s->elements = (declaratorInvNode *) - dmalloc (sizeof (*s->elements) * declaratorInvNodeListBASESIZE); - - return (s); -} - -static void -declaratorInvNodeList_grow (declaratorInvNodeList s) -{ - int i; - declaratorInvNode *newelements; - - s->nspace = declaratorInvNodeListBASESIZE + s->nspace; - - newelements = (declaratorInvNode *) - dmalloc (sizeof (*newelements) * (s->nelements + s->nspace)); - - if (newelements == (declaratorInvNode *) 0) - { - llfatalerror (cstring_makeLiteral ("declaratorInvNodeList_grow: out of memory!")); - } - - for (i = 0; i < s->nelements; i++) - { - newelements[i] = s->elements[i]; - } - - sfree (s->elements); - s->elements = newelements; -} - -declaratorInvNodeList -declaratorInvNodeList_add (declaratorInvNodeList s, declaratorInvNode el) -{ - if (s->nspace <= 0) - { - declaratorInvNodeList_grow (s); - } - - s->nspace--; - s->elements[s->nelements] = el; - s->nelements++; - - return s; -} - -/*@only@*/ cstring -declaratorInvNodeList_unparse (declaratorInvNodeList s) -{ - int i; - cstring st = cstring_undefined; - - for (i = 0; i < s->nelements; i++) - { - st = message ("%q%q", st, declaratorInvNode_unparse (s->elements[i])); - } - - return st; -} - -void -declaratorInvNodeList_free (declaratorInvNodeList s) -{ - int i; - for (i = 0; i < s->nelements; i++) - { - declaratorInvNode_free (s->elements[i]); - } - - sfree (s->elements); - sfree (s); -} diff --git a/src/declaratorNodeList.c b/src/declaratorNodeList.c deleted file mode 100644 index 118f132..0000000 --- a/src/declaratorNodeList.c +++ /dev/null @@ -1,130 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** declaratorNodeList.c -** -** based on list_template.c -** -** where T has T_equal (or change this) and T_unparse -*/ - -# include "lclintMacros.nf" -# include "llbasic.h" - -declaratorNodeList - declaratorNodeList_new () -{ - declaratorNodeList s = (declaratorNodeList) dmalloc (sizeof (*s)); - - s->nelements = 0; - s->nspace = declaratorNodeListBASESIZE; - s->elements = (declaratorNode *) - dmalloc (sizeof (*s->elements) * declaratorNodeListBASESIZE); - - return (s); -} - -static void -declaratorNodeList_grow (declaratorNodeList s) -{ - int i; - declaratorNode *newelements; - - s->nspace = declaratorNodeListBASESIZE + s->nspace; - newelements = (declaratorNode *) dmalloc (sizeof (*newelements) * (s->nelements + s->nspace)); - - if (newelements == (declaratorNode *) 0) - { - llfatalerror (cstring_makeLiteral ("declaratorNodeList_grow: out of memory!")); - } - - for (i = 0; i < s->nelements; i++) - { - newelements[i] = s->elements[i]; - } - - sfree (s->elements); - s->elements = newelements; -} - -declaratorNodeList -declaratorNodeList_add (declaratorNodeList s, declaratorNode el) -{ - if (s->nspace <= 0) - declaratorNodeList_grow (s); - - s->nspace--; - s->elements[s->nelements] = el; - s->nelements++; - - return s; -} - -/*@only@*/ cstring -declaratorNodeList_unparse (declaratorNodeList s) -{ - cstring st = cstring_undefined; - bool first = TRUE; - - declaratorNodeList_elements (s, current) - { - if (first) - { - st = declaratorNode_unparse (current); - first = FALSE; - } - else - { - st = message ("%q, %q", st, declaratorNode_unparse (current)); - } - } end_declaratorNodeList_elements; - - return st; -} - -declaratorNodeList -declaratorNodeList_copy (declaratorNodeList s) -{ - declaratorNodeList ret = declaratorNodeList_new (); - - declaratorNodeList_elements (s, el) - { - ret = declaratorNodeList_add (ret, declaratorNode_copy (el)); - } end_declaratorNodeList_elements ; - - return ret; -} - -void -declaratorNodeList_free (declaratorNodeList s) -{ - int i; - for (i = 0; i < s->nelements; i++) - { - declaratorNode_free (s->elements[i]); - } - - sfree (s->elements); - sfree (s); -} diff --git a/src/dummy.c b/src/dummy.c deleted file mode 100644 index 15abc35..0000000 --- a/src/dummy.c +++ /dev/null @@ -1,3 +0,0 @@ -# include "lclintMacros.nf" -# include "llbasic.h" -# include "gram.h" diff --git a/src/ekind.c b/src/ekind.c deleted file mode 100644 index af5b6cf..0000000 --- a/src/ekind.c +++ /dev/null @@ -1,106 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** ekind.c -*/ - -# include "lclintMacros.nf" -# include "basic.h" - -ekind -ekind_fromInt (int i) -{ - if /*@+enumint@*/ (i < KINVALID || i > KELAST) /*@=enumint@*/ - { - llcontbug (message ("ekind_fromInt: invalid: %d", i)); - return KINVALID; - } - - return (ekind)i; -} - -cstring ekind_unparse (ekind k) -{ - switch (k) - { - case KENUMCONST: return cstring_makeLiteralTemp ("ect"); - case KCONST: return cstring_makeLiteralTemp ("cst"); - case KVAR: return cstring_makeLiteralTemp ("var"); - case KITER: return cstring_makeLiteralTemp ("itr"); - case KENDITER: return cstring_makeLiteralTemp ("etr"); - case KDATATYPE: return cstring_makeLiteralTemp ("dtp"); - case KFCN: return cstring_makeLiteralTemp ("fcn"); - case KSTRUCTTAG: return cstring_makeLiteralTemp ("stg"); - case KUNIONTAG: return cstring_makeLiteralTemp ("utg"); - case KENUMTAG: return cstring_makeLiteralTemp ("etg"); - case KELIPSMARKER: return cstring_makeLiteralTemp ("eps"); - case KINVALID: return cstring_makeLiteralTemp ("[invalid]"); - } - - BADEXIT; -} - -cstring ekind_unparseLong (ekind k) -{ - switch (k) - { - case KCONST: return cstring_makeLiteralTemp ("constant"); - case KENUMCONST: return cstring_makeLiteralTemp ("enum member"); - case KVAR: return cstring_makeLiteralTemp ("variable"); - case KITER: return cstring_makeLiteralTemp ("iterator"); - case KENDITER: return cstring_makeLiteralTemp ("iterator finalizer"); - case KDATATYPE: return cstring_makeLiteralTemp ("datatype"); - case KFCN: return cstring_makeLiteralTemp ("function"); - case KSTRUCTTAG: return cstring_makeLiteralTemp ("struct tag"); - case KUNIONTAG: return cstring_makeLiteralTemp ("union tag"); - case KENUMTAG: return cstring_makeLiteralTemp ("enum tag"); - case KELIPSMARKER: return cstring_makeLiteralTemp ("..."); - case KINVALID: return cstring_makeLiteralTemp ("[invalid]"); - } - - BADEXIT; -} - -cstring -ekind_capName (ekind k) -{ - switch (k) - { - case KCONST: return cstring_makeLiteralTemp ("Constant"); - case KENUMCONST: return cstring_makeLiteralTemp ("Enum member"); - case KVAR: return cstring_makeLiteralTemp ("Variable"); - case KITER: return cstring_makeLiteralTemp ("Iterator"); - case KENDITER: return cstring_makeLiteralTemp ("Iterator finalizer"); - case KDATATYPE: return cstring_makeLiteralTemp ("Datatype"); - case KFCN: return cstring_makeLiteralTemp ("Function"); - case KSTRUCTTAG: return cstring_makeLiteralTemp ("Struct tag"); - case KUNIONTAG: return cstring_makeLiteralTemp ("Union tag"); - case KENUMTAG: return cstring_makeLiteralTemp ("Enum tag"); - case KELIPSMARKER: return cstring_makeLiteralTemp ("..."); - case KINVALID: return cstring_makeLiteralTemp ("[invalid]"); - } - - BADEXIT; -} - diff --git a/src/enumNameList.c b/src/enumNameList.c deleted file mode 100644 index 9a45d09..0000000 --- a/src/enumNameList.c +++ /dev/null @@ -1,275 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** enumNameList.c -** -** based on list_template.c -** -** where T has T_equal (or change this) and T_unparse -** -** used to be cenum.c -*/ - -# include "lclintMacros.nf" -# include "basic.h" - -enumNameList - enumNameList_new () -{ - enumNameList s = (enumNameList) dmalloc (sizeof (*s)); - - s->nelements = 0; - s->nspace = enumNameListBASESIZE; - s->elements = (enumName *) - dmalloc (sizeof (*s->elements) * enumNameListBASESIZE); - - return (s); -} - -/*@only@*/ enumNameList -enumNameList_single (/*@keep@*/ enumName t) -{ - enumNameList s = (enumNameList) dmalloc (sizeof (*s)); - - s->nelements = 1; - s->nspace = enumNameListBASESIZE - 1; - s->elements = (enumName *) dmalloc (sizeof (*s->elements) * enumNameListBASESIZE); - s->elements[0] = t; - - return (s); -} - -bool -enumNameList_match (enumNameList e1, enumNameList e2) -{ - int i; - - if (e1->nelements != e2->nelements) return FALSE; - - for (i = 0; i < e1->nelements; i++) - { - if (!cstring_equal (e1->elements[i], e2->elements[i])) - return FALSE; - } - return TRUE; -} - -static void -enumNameList_grow (enumNameList s) -{ - int i; - enumName *newelements; - - s->nspace += enumNameListBASESIZE; - newelements = (enumName *) dmalloc (sizeof (*newelements) * (s->nelements + s->nspace)); - - if (newelements == (enumName *) 0) - { - llfatalerror (cstring_makeLiteral ("enumNameList_grow: out of memory!")); - } - - for (i = 0; i < s->nelements; i++) - { - newelements[i] = s->elements[i]; - } - - sfree (s->elements); - s->elements = newelements; -} - -void -enumNameList_addh (enumNameList s, /*@keep@*/ enumName el) -{ - if (s->nspace <= 0) - enumNameList_grow (s); - - s->nspace--; - s->elements[s->nelements] = el; - s->nelements++; -} - -enumNameList -enumNameList_push (/*@returned@*/ enumNameList s, /*@only@*/ enumName el) -{ - enumNameList_addh (s, el); - return s; -} - -/*@only@*/ enumNameList -enumNameList_copy (enumNameList s) -{ - enumNameList r = enumNameList_new (); - - enumNameList_elements (s, x) - { - enumNameList_addh (r, cstring_copy (x)); - } end_enumNameList_elements; - - return r; -} - -bool -enumNameList_member (enumNameList s, cstring m) -{ - enumNameList_elements (s, x) - { - if (cstring_equal (m, x)) return TRUE; - } end_enumNameList_elements; - - return FALSE; -} - -/*@only@*/ enumNameList -enumNameList_subtract (enumNameList source, enumNameList del) -{ - enumNameList ret = enumNameList_new (); - - enumNameList_elements (source, el) - { - if (!enumNameList_member (del, el)) - { - enumNameList_addh (ret, cstring_copy (el)); - } - } end_enumNameList_elements; - - return ret; -} - -cstring -enumNameList_unparse (enumNameList s) -{ - int i; - cstring st = cstring_undefined; - - for (i = 0; i < s->nelements; i++) - { - if (i == 0) - { - st = cstring_copy (s->elements[i]); - } - else - { - st = message ("%q, %s", st, s->elements[i]); - } - } - - return st; -} - -cstring enumNameList_unparseBrief (enumNameList s) -{ - int i; - cstring st = cstring_undefined; - - for (i = 0; i < s->nelements; i++) - { - if (i == 0) - { - st = cstring_copy (s->elements[i]); - } - else if (i == 3 && s->nelements > 5) - { - st = message ("%q, ...", st); - i = s->nelements - 2; - } - else - { - st = message ("%q, %s", st, s->elements[i]); - } - } - - return st; -} - -/*@only@*/ cstring -enumNameList_dump (enumNameList s) -{ - int i; - cstring st = cstring_undefined; - - for (i = 0; i < s->nelements; i++) - { - if (i == 0) - { - st = cstring_copy (s->elements[i]); - } - else - st = message ("%q,%s", st, s->elements[i]); - } - return st; -} - -/*@only@*/ enumNameList -enumNameList_undump (d_char *s) -{ - enumNameList e = enumNameList_new (); - - if (**s == '}') - (*s)++; - else - { - while (TRUE) - { - char *t = strchr (*s, ','); - char mt; - - if (t == NULL) - { - t = strchr (*s, '}'); - - if (t == NULL) - { - llcontbug (message ("enumNameList_undump: bad line: %s", cstring_fromChars (*s))); - return e; - } - } - - mt = *t; - *t = '\0'; - - enumNameList_addh (e, cstring_fromChars (mstring_copy (*s))); - *s = t + 1; - if (mt == '}') - break; - } - } - return e; -} - -void -enumNameList_free (enumNameList s) -{ - int i; - - - for (i = 0; i < s->nelements; i++) - { - cstring_free (s->elements[i]); - } - - sfree (s->elements); - sfree (s); -} - - diff --git a/src/enumNameSList.c b/src/enumNameSList.c deleted file mode 100644 index 6edd020..0000000 --- a/src/enumNameSList.c +++ /dev/null @@ -1,45 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** enumNameList.c -** -** based on list_template.c -** -** where T has T_equal (or change this) and T_unparse -** -** used to be cenum.c -*/ - -# include "lclintMacros.nf" -# include "basic.h" - -/*@access enumNameList@*/ - -void -enumNameSList_free (enumNameSList s) -{ - sfree (s->elements); - sfree (s); -} - diff --git a/src/environmentTable.c b/src/environmentTable.c deleted file mode 100644 index c20309a..0000000 --- a/src/environmentTable.c +++ /dev/null @@ -1,1157 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** environmentTable.c -*/ - -# include "lclintMacros.nf" -# include "basic.h" - -//#include "environmentTable.h" -#include "exprData.i" -#include "exprData.h" -#include "exprDataQuite.i" - -/*@i777*/ -/*@-fcnuse*/ -/*@ignore@*/ -/*@constant int ATINVALID; @*/ -# define ATINVALID -1 - -#define ENVIRONMENTSEARCHLIMIT ALIASSEARCHLIMIT -#define FLG_GLOBENVIRONMENT FLG_GLOBALIAS -#define NOENVIRONMENT NOALIAS - -static sRefSet - environmentTable_canEnvironmentAux (environmentTable p_s, sRef p_sr, int p_lim) /*@*/ ; -static sRefSet - environmentTable_aliasedByLimit (environmentTable p_s, sRef p_sr, int p_lim) /*@*/ ; -static sRefSet - environmentTable_aliasedByAux (environmentTable p_s, sRef p_sr, int p_lim) /*@*/ ; - -static /*@only@*/ sRefSet environmentTable_environmentedByLimit (environmentTable p_s, sRef p_sr, int p_lim) ; - -environmentTable -environmentTable_new () -{ - return (environmentTable_undefined); -} - -environmentTable -environmentTable_insertRelativeRange (/*@returned@*/ environmentTable p_s, - /*@exposed@*/ sRef p_sr, - int p_min, int p_max); - - -static /*@only@*/ /*@notnull@*/ environmentTable -environmentTable_newEmpty (void) -{ - environmentTable s = (environmentTable) dmalloc (sizeof (*s)); - - s->nelements = 0; - s->nspace = environmentTableBASESIZE; - s->keys = (sRef *) dmalloc (sizeof (*s->keys) * environmentTableBASESIZE); - s->values = (sRefSet *) dmalloc (sizeof (*s->values) * environmentTableBASESIZE); - s->rangeValues = (rangeAt*) dmalloc (sizeof (*s->rangeValues) * environmentTableBASESIZE); - return (s); -} - -static void -environmentTable_grow (/*@notnull@*/ environmentTable s) -{ - int i; - o_sRefSet *oldvalues = s->values; - sRef *oldkeys = s->keys; - rangeAt *oldranges = s->rangeValues; - - s->nspace += environmentTableBASESIZE; - - s->values = (sRefSet *) dmalloc (sizeof (*s->values) - * (s->nelements + s->nspace)); - s->keys = (sRef *) dmalloc (sizeof (*s->keys) * (s->nelements + environmentTableBASESIZE)); - - s->rangeValues = (rangeAt *) dmalloc (sizeof (*s->rangeValues) * (s->nelements + environmentTableBASESIZE)); - - - if (s->keys == (sRef *) 0 || s->values == (sRefSet *)0 || s->rangeValues == (rangeAt*) 0 ) - { - llfatalerror (cstring_makeLiteral ("environmentTable_grow: out of memory!")); - } - - for (i = 0; i < s->nelements; i++) - { - s->values[i] = oldvalues[i]; - s->keys[i] = oldkeys[i]; - s->rangeValues[i] = oldranges[i]; - } - // s->rangeValues[i] = dmalloc (sizeof (rangeAt)); - sfree (oldvalues); - sfree (oldkeys); - sfree (oldranges); -} - - - -static int environmentTable_lookupRefs (/*@notnull@*/ environmentTable s, sRef sr) -{ - int i; - - - for (i = 0; i < environmentTable_size (s); i++) - { - if (sRef_same (sr, s->keys[i])) - { - return i; - } - } - - return ATINVALID; -} - -environmentTable -environmentTable_postOpvar (/*@returned@*/ environmentTable s, sRef sr) -{ - int ind; - // printf("doing postop\n"); - if (environmentTable_isUndefined (s) ) - { - s = environmentTable_newEmpty(); - } - - ind = environmentTable_lookupRefs (s, sr); - if (ind == ATINVALID) - { - s = environmentTable_addRelativeRange (s, sr); - ind = s->nelements; - } - // assume it ++ we'll do -- later - - s->rangeValues[ind].max++; - s->rangeValues[ind].min++; - - return s; -} - -environmentTable -environmentTable_mergeEnvironments (environmentTable s1, environmentTable s2) -{ - int i; - environmentTable t1; - t1 = environmentTable_copy (s1); - if (environmentTable_isUndefined (s2) ) - return t1; - - for (i = 0; i < s2->nelements; i++) - { - int ind = environmentTable_lookupRefs ( t1, s1->keys[i]); - if (s2->rangeValues[i].isRelative) - { - if (ind == ATINVALID) - { - t1 = environmentTable_insertRelativeRange(t1, s2->keys[i], s2->rangeValues[i].max, s2->rangeValues[i].min); - } - else - { - t1->rangeValues[ind].min += s2->rangeValues[i].min; - t1->rangeValues[ind].max += s2->rangeValues[i].max; - } - } - else - { - /* we want to overwrite old value .. */ - t1 = environmentTable_addExactValue (t1, s2->keys[i], s2->rangeValues[i].max); - /*should fix this to do min and max ... */ - } - - } -} - -rangeAt -rangeAt_createRelativeRange () -{ - rangeAt tmp; - tmp.isRelative = TRUE; - tmp.unknown = FALSE; - tmp.max = 0; - tmp.min = 0; - return tmp; -} - -rangeAt rangeAt_createExactRange (int min, int max) -{ - rangeAt tmp; - tmp.isRelative = FALSE; - tmp.unknown = FALSE; - tmp.min = min; - tmp.max = max; - return tmp; -} - -environmentTable -environmentTable_addRelativeRange (/*@returned@*/ environmentTable s, - /*@exposed@*/ sRef sr) -{ - int ind; - sRefSet ss; - rangeAt range; - - if (environmentTable_isUndefined (s)) - { - s = environmentTable_newEmpty (); - ind = ATINVALID; - } - else - { - ind = environmentTable_lookupRefs (s, sr); - } - - if (ind == ATINVALID) - { - if (s->nspace <= 0) { - environmentTable_grow (s); - } - - s->nspace--; - s->keys[s->nelements] = sr; - /*fix this */ - // s->values[s->nelements] = sRefSet_single (al); - ind = s->nelements; - s->nelements++; - } - range = rangeAt_createRelativeRange(); - - s->rangeValues[ind] = range; - return s; -} - -void -environmentTable_testInRange ( environmentTable s, /*@exposed@*/ sRef sr, int index) -{ - int ind; - sRefSet ss; - rangeAt range; - if (environmentTable_isUndefined (s)) - { - fprintf(stderr,"environmentTable not defined\n"); - return; - } - - ind = environmentTable_lookupRefs (s, sr); - if (ind == ATINVALID) - { - fprintf (stderr,"range not known\n"); - return; - } - if ( &s->rangeValues[ind] ) - { - if ( (s->rangeValues[ind].min <= index ) && (s->rangeValues[ind].max >= index) ) - { - printf("The value %d is in the range for this variable \n", index); - } - else - printf("The value %d is NOT in the range for this variable \n", index); - } - -} - - -environmentTable -environmentTable_addExactValue (/*@returned@*/ environmentTable s, - /*@exposed@*/ sRef sr, - int val) -{ - int ind; - sRefSet ss; - rangeAt range; - - if (environmentTable_isUndefined (s)) - { - s = environmentTable_newEmpty (); - ind = ATINVALID; - } - else - { - ind = environmentTable_lookupRefs (s, sr); - } - - if (ind == ATINVALID) - { - if (s->nspace <= 0) { - environmentTable_grow (s); - } - - s->nspace--; - s->keys[s->nelements] = sr; - /*fix this */ - // s->values[s->nelements] = sRefSet_single (al); - ind = s->nelements; - s->nelements++; - } - - else - { - /* s->values[ind] = sRefSet_insert (s->values[ind], al); */ - } - /* - if ( (s->rangeValues[ind]) == 0 ) - { - s->rangeValues[ind] = dmalloc(sizeof(rangeAt) ); - } - */ - range.min = val; - range.max = val; - - s->rangeValues[ind] = range; - return s; -} - -environmentTable -environmentTable_insertRelativeRange (/*@returned@*/ environmentTable s, - /*@exposed@*/ sRef sr, - int min, int max) -{ - int ind; - sRefSet ss; - rangeAt range; - - if (environmentTable_isUndefined (s)) - { - s = environmentTable_newEmpty (); - ind = ATINVALID; - } - else - { - ind = environmentTable_lookupRefs (s, sr); - } - - if (ind == ATINVALID) - { - if (s->nspace <= 0) { - environmentTable_grow (s); - } - - s->nspace--; - s->keys[s->nelements] = sr; - /*fix this */ - // s->values[s->nelements] = sRefSet_single (al); - ind = s->nelements; - s->nelements++; - } - - range = rangeAt_createRelativeRange(); - range.min = min; - range.max = max; - - s->rangeValues[ind] = range; - return s; -} - -environmentTable -environmentTable_addMustAlias (/*@returned@*/ environmentTable s, - /*@exposed@*/ sRef sr, - sRef al) -{ - int ind; - sRefSet ss; - - llassert (NOENVIRONMENT (sr, al)); - /*@ignore@*/ - if (environmentTable_isUndefined (s)) - { - s = environmentTable_newEmpty (); - ind = ATINVALID; - } - else - { - ind = environmentTable_lookupRefs (s, sr); - } - - ss = environmentTable_canEnvironment (s, al); - - - if (ind == ATINVALID) - { - if (s->nspace <= 0) { - environmentTable_grow (s); - } - - s->nspace--; - s->keys[s->nelements] = sr; - s->values[s->nelements] = sRefSet_single (al); - ind = s->nelements; - s->nelements++; - } - else - { - s->values[ind] = sRefSet_insert (s->values[ind], al); - } - - s->values[ind] = sRefSet_unionExcept (s->values[ind], ss, s->keys[ind]); - - sRefSet_free (ss); - return s; -} - -static environmentTable - environmentTable_addSet (/*@returned@*/ environmentTable s, - /*@exposed@*/ sRef key, /*@only@*/ sRefSet value) -{ - if (!sRefSet_isEmpty (value)) - { - if (environmentTable_isUndefined (s)) - { - s = environmentTable_newEmpty (); - } - else - { - if (s->nspace <= 0) - { - environmentTable_grow (s); - } - } - - s->nspace--; - s->keys[s->nelements] = key; - s->values[s->nelements] = value; - s->nelements++; - } - else - { - sRefSet_free (value); - } - - return s; -} - -/* -** When environmentes are cleared: -** -** o remove all entries for sr -** o replace all environmentes for things which environment sr with sr's environmentes -** -** Clear environmentes for sr; if sr is a direct param reference, clear its environmentes too. -*/ - -static void environmentTable_clearEnvironmentesAux (/*@notnull@*/ environmentTable p_s, sRef p_sr) - /*@modifies p_s@*/ ; - -void environmentTable_clearEnvironmentes (environmentTable s, sRef sr) -{ - if (environmentTable_isUndefined (s)) - { - return; - } - else - { - sRef rb = sRef_getRootBase (sr); - - - if (!sRef_isCvar (sr) && sRef_isLocalVar (rb)) - { - int ind = environmentTable_lookupRefs (s, rb); - - if (ind != ATINVALID) - { - sRefSet al = s->values[ind]; - - - sRefSet_realElements (al, el) - { - - if (sRef_isParam (el)) - { - if (sRef_sameName (el, rb)) - { - sRef fb = sRef_fixBase (sr, el); - - environmentTable_clearEnvironmentesAux (s, fb); - } - } - } end_sRefSet_realElements ; - } - } - - environmentTable_clearEnvironmentesAux (s, sr); - } -} - -static -void environmentTable_clearEnvironmentesAux (/*@notnull@*/ environmentTable s, sRef sr) -{ - int i; - - for (i = 0; i < s->nelements; i++) - { - sRef key = s->keys[i]; - - if (sRef_includedBy (key, sr)) - { - sRefSet_clear (s->values[i]); - } - else - { - (void) sRefSet_deleteBase (s->values[i], sr); - } - } -} - -/* -** returns set of all sRefs that must environment sr (but are different from sr) -*/ - -static /*@only@*/ sRefSet environmentTable_environmentedByAux (environmentTable s, sRef sr, int lim) -{ - static bool hadWarning = FALSE; - sRefSet res = sRefSet_undefined; - int i; - - llassert (!sRef_isConj (sr)); - - - if (environmentTable_isUndefined (s) || lim >= ENVIRONMENTSEARCHLIMIT) - { - if (lim >= ENVIRONMENTSEARCHLIMIT && !hadWarning) - { - llquietbug - (message ("Environment search limit exceeded, checking %q. " - "This either means there is a variable with at least " - "%d indirections, or there is a bug in LCLint.", - sRef_unparse (sr), - ENVIRONMENTSEARCHLIMIT)); - - hadWarning = TRUE; - } - - return sRefSet_undefined; - } - else - { - sRefSet abl; - - if (sRef_isPointer (sr)) - { - abl = environmentTable_environmentedByLimit (s, sRef_getBase (sr), lim); - res = sRefSet_addIndirection (abl); - } - else if (sRef_isAddress (sr)) - { - abl = environmentTable_environmentedByLimit (s, sRef_getBase (sr), lim); - res = sRefSet_removeIndirection (abl); - } - else if (sRef_isField (sr)) - { - abl = environmentTable_environmentedByLimit (s, sRef_getBase (sr), lim); - res = sRefSet_accessField (abl, sRef_getField (sr)); - } - else if (sRef_isArrayFetch (sr)) - { - abl = environmentTable_environmentedByLimit (s, sRef_getBase (sr), lim); - - if (sRef_isIndexKnown (sr)) - { - int idx = sRef_getIndex (sr); - - res = sRefSet_fetchKnown (abl, idx); - } - else - { - res = sRefSet_fetchUnknown (abl); - } - } - else - { - abl = sRefSet_undefined; - } - - sRefSet_free (abl); - } - - for (i = 0; i < s->nelements; i++) - { - sRef elem = s->keys[i]; - - if (!sRef_same (sr, elem)) /* was sameName */ - { - - sRefSet_realElements (s->values[i], current) - { - - if (sRef_similar (sr, current)) - { - res = sRefSet_insert (res, sRef_fixOuterRef (elem)); - /*@innerbreak@*/ break; - } - } end_sRefSet_realElements; - } - } - - return res; -} - -static /*@only@*/ sRefSet environmentTable_environmentedByLimit (environmentTable s, sRef sr, int lim) -{ - sRefSet res; - - - if (sRef_isConj (sr)) - { - res = sRefSet_unionFree (environmentTable_environmentedByLimit (s, sRef_getConjA (sr), lim), - environmentTable_environmentedByLimit (s, sRef_getConjB (sr), lim)); - } - else - { - res = environmentTable_environmentedByAux (s, sr, lim + 1); - } - - return res; -} - -/*@only@*/ sRefSet environmentTable_environmentedBy (environmentTable s, sRef sr) -{ - if (sRef_isConj (sr)) - { - return (sRefSet_unionFree (environmentTable_environmentedBy (s, sRef_getConjA (sr)), - environmentTable_environmentedBy (s, sRef_getConjB (sr)))); - } - - return (environmentTable_environmentedByAux (s, sr, 0)); -} - -/*@only@*/ sRefSet environmentTable_canEnvironment (environmentTable s, sRef sr) -{ - sRefSet res; - - - if (sRef_isConj (sr)) - { - res = sRefSet_unionFree (environmentTable_canEnvironment (s, sRef_getConjA (sr)), - environmentTable_canEnvironment (s, sRef_getConjB (sr))); - } - else - { - res = environmentTable_canEnvironmentAux (s, sr, 0); - } - - return res; -} - -/* -** need to limit the depth of environmenting searches -*/ - -static /*@only@*/ sRefSet environmentTable_canEnvironmentLimit (environmentTable s, sRef sr, int lim) -{ - sRefSet res; - - if (sRef_isConj (sr)) - { - sRefSet a = environmentTable_canEnvironmentLimit (s, sRef_getConjA (sr), lim); - sRefSet b = environmentTable_canEnvironmentLimit (s, sRef_getConjB (sr), lim); - - res = sRefSet_unionFree (a, b); - } - else - { - res = environmentTable_canEnvironmentAux (s, sr, lim + 1); - } - - return res; -} - -static /*@only@*/ sRefSet - environmentTable_canEnvironmentAux (environmentTable s, sRef sr, int lim) -{ - static bool hadWarning = FALSE; - llassert (!sRef_isConj (sr)); - - - if (environmentTable_isUndefined (s) || lim >= ALIASSEARCHLIMIT) - { - if (lim >= ALIASSEARCHLIMIT && !hadWarning) - { - llquietbug - (message ("Environment search limit exceeded, checking %q. " - "This either means there is a variable with at least " - "%d indirections, or there is a bug in LCLint.", - sRef_unparse (sr), - ENVIRONMENTSEARCHLIMIT)); - - hadWarning = TRUE; - } - - return sRefSet_undefined; - } - else - { - int ind = environmentTable_lookupRefs (s, sr); - - if (sRef_isPointer (sr) || sRef_isAddress (sr) || sRef_isField (sr) - || sRef_isArrayFetch (sr)) - { - sRef base = sRef_getBase (sr); - sRefSet tmp = environmentTable_canEnvironmentLimit (s, base, lim); - sRefSet ret; - - if (sRef_isPointer (sr)) - { - ret = sRefSet_addIndirection (tmp); - } - else if (sRef_isAddress (sr)) - { - ret = sRefSet_removeIndirection (tmp); - } - else if (sRef_isField (sr)) - { - ret = sRefSet_accessField (tmp, sRef_getField (sr)); - } - else if (sRef_isArrayFetch (sr)) - { - if (sRef_isIndexKnown (sr)) - { - ret = sRefSet_fetchKnown (tmp, sRef_getIndex (sr)); - } - else - { - ret = sRefSet_fetchUnknown (tmp); - } - } - else - { - BADBRANCH; - } - - if (ind != ATINVALID) - { - ret = sRefSet_union (ret, s->values[ind]); - } - - sRefSet_free (tmp); - return ret; - } - - if (ind == ATINVALID) return sRefSet_undefined; - - return sRefSet_newCopy (s->values[ind]); - } -} - -environmentTable environmentTable_copy (environmentTable s) -{ - if (environmentTable_isEmpty (s)) - { - return environmentTable_undefined; - } - else - { - environmentTable t = (environmentTable) dmalloc (sizeof (*s)); - int i; - - t->nelements = s->nelements; - t->nspace = 0; - t->keys = (sRef *) dmalloc (sizeof (*s->keys) * s->nelements); - t->values = (sRefSet *) dmalloc (sizeof (*s->values) * t->nelements); - t->rangeValues = (rangeAt *) dmalloc (sizeof (*s->rangeValues) * t->nelements); - - for (i = 0; i < s->nelements; i++) - { - t->keys[i] = s->keys[i]; - t->values[i] = sRefSet_newCopy (s->values[i]); - t->rangeValues[i] = s->rangeValues[i]; - } - - return t; - } -} - -static void -environmentTable_levelPrune (environmentTable s, int lexlevel) -{ - - - if (environmentTable_isEmpty (s)) - { - return; - } - else - { - int i; - int backcount = s->nelements - 1; - - for (i = 0; i <= backcount; i++) - { - sRef key = s->keys[i]; - - if (sRef_lexLevel (key) > lexlevel) - { - int j; - for (j = backcount; j > i; j--) - { - backcount--; - s->nelements--; - s->nspace++; - - if (sRef_lexLevel (s->keys[j]) <= lexlevel) - { - s->keys[i] = s->keys[j]; - s->values[i] = s->values[j]; - sRefSet_levelPrune (s->values[i], lexlevel); - /*@innerbreak@*/ break; - } - } - if (backcount == i) - s->nelements--; - } - else - { - sRefSet_levelPrune (s->values[i], lexlevel); - } - } - } -} - -/* -** levelUnionSeq -** -** like level union, but know that t2 was executed after t1. So if -** t1 has x -> { a, b } and t2 has x -> { a }, then result has x -> { a }. -** -** NOTE: t2 is "only". -*/ - -environmentTable environmentTable_levelUnionSeq (/*@returned@*/ environmentTable t1, - /*@only@*/ environmentTable t2, int level) -{ - if (environmentTable_isUndefined (t2)) - { - return t1; - } - - if (environmentTable_isUndefined (t1)) - { - t1 = environmentTable_newEmpty (); - } - else - { - environmentTable_levelPrune (t1, level); - } - - environmentTable_elements (t2, key, value) - { - if (sRef_lexLevel (key) <= level) - { - int ind = environmentTable_lookupRefs (t1, key); - - sRefSet_levelPrune (value, level); - - if (ind == ATINVALID) - { - /* okay, t2 is killed */ - /*@-exposetrans@*/ /*@-dependenttrans@*/ - t1 = environmentTable_addSet (t1, key, value); - /*@=exposetrans@*/ /*@=dependenttrans@*/ - } - else - { - sRefSet_free (t1->values[ind]); - - /*@-dependenttrans@*/ /* okay, t2 is killed */ - t1->values[ind] = value; - /*@=dependenttrans@*/ - } - } - else - { - /*@-exposetrans@*/ /*@-dependenttrans@*/ - sRefSet_free (value); - /*@=exposetrans@*/ /*@=dependenttrans@*/ - } - - } end_environmentTable_elements; - - sfree (t2->keys); - sfree (t2->values); - sfree (t2); - - return t1; -} - -environmentTable -environmentTable_levelUnion (/*@returned@*/ environmentTable t1, environmentTable t2, int level) -{ - if (environmentTable_isUndefined (t1)) - { - if (environmentTable_isUndefined (t2)) - { - return t1; - } - else - { - t1 = environmentTable_newEmpty (); - } - } - else - { - environmentTable_levelPrune (t1, level); - } - - environmentTable_elements (t2, key, cvalue) - { - sRefSet value = sRefSet_newCopy (cvalue); - - if (sRef_lexLevel (key) <= level) - { - sRefSet_levelPrune (value, level); - - if (sRefSet_size (value) > 0) - { - int ind = environmentTable_lookupRefs (t1, key); - - if (ind == ATINVALID) - { - t1 = environmentTable_addSet (t1, key, value); - } - else - { - t1->values[ind] = sRefSet_union (t1->values[ind], value); - sRefSet_free (value); - } - } - else - { - sRefSet_free (value); - } - } - else - { - sRefSet_free (value); - } - } end_environmentTable_elements; - - return t1; -} - -environmentTable environmentTable_levelUnionNew (environmentTable t1, environmentTable t2, int level) -{ - environmentTable ret = environmentTable_levelUnion (environmentTable_copy (t1), t2, level); - - return ret; -} - -/*@only@*/ cstring -environmentTable_unparse (environmentTable s) -{ - cstring st = cstring_undefined; - - if (environmentTable_isUndefined (s)) return (cstring_makeLiteral ("")); - - environmentTable_elements (s, key, value) - { - st = message ("%q\t%q -> %q\n", st, sRef_unparse (key), - sRefSet_unparse (value)); - } end_environmentTable_elements; - - return st; -} - -/* -** bogus! -*/ - -void -environmentTable_fixSrefs (environmentTable s) -{ - int i; - - if (environmentTable_isUndefined (s)) return; - - for (i = 0; i < s->nelements; i++) - { - sRef old = s->keys[i]; - - if (sRef_isLocalVar (old)) - { - s->keys[i] = uentry_getSref (sRef_getUentry (old)); - } - - sRefSet_fixSrefs (s->values[i]); - } -} - -void -environmentTable_free (/*@only@*/ environmentTable s) -{ - int i; - - if (environmentTable_isUndefined (s)) return; - - for (i = 0; i < s->nelements; i++) - { - sRefSet_free (s->values[i]); - } - - sfree (s->values); - sfree (s->keys); - sfree (s); -} - -void -environmentTable_checkGlobs (environmentTable t) -{ - environmentTable_elements (t, key, value) - { - sRef root = sRef_getRootBase (key); - - if (sRef_isAliasCheckedGlobal (root)) - { - sRefSet_realElements (value, sr) - { - root = sRef_getRootBase (sr); - - if (((sRef_isAliasCheckedGlobal (root) - && !(sRef_similar (root, key))) - || sRef_isAnyParam (root)) - && !sRef_isExposed (root)) - { - if (sRef_isAliasCheckedGlobal (key)) - { - if (!(sRef_isShared (key) - && sRef_isShared (root))) - { - voptgenerror - (FLG_GLOBENVIRONMENT, - message - ("Function returns with %q variable %q environmenting %q %q", - cstring_makeLiteral (sRef_isRealGlobal (key) - ? "global" : "file static"), - sRef_unparse (key), - cstring_makeLiteral (sRef_isAnyParam (root) - ? "parameter" : "global"), - sRef_unparse (sr)), - g_currentloc); - } - } - - } - } end_sRefSet_realElements; - } - else if (sRef_isAnyParam (key) || sRef_isAnyParam (root)) - { - sRefSet_realElements (value, sr) - { - root = sRef_getRootBase (sr); - - if (sRef_isAliasCheckedGlobal (root) - && !sRef_isExposed (root) - && !sRef_isDead (key) - && !sRef_isShared (root)) - { - voptgenerror - (FLG_GLOBENVIRONMENT, - message ("Function returns with parameter %q environmenting %q %q", - sRef_unparse (key), - cstring_makeLiteral (sRef_isRealGlobal (root) - ? "global" : "file static"), - sRef_unparse (sr)), - g_currentloc); - } - } end_sRefSet_realElements; - } - else - { - ; - } - } end_environmentTable_elements; -} - - -exprNode exprNode_mergeEnvironments (exprNode ret, exprNode e1, exprNode e2) -{ - if (exprNode_isDefined (e1) && exprNode_isDefined (e2) ) - { - ret->environment = environmentTable_mergeEnvironments (e1->environment, e2->environment); - return ret; - } - if (exprNode_isUndefined(e1) && exprNode_isUndefined(e2) ) - { - ret->environment = environmentTable_undefined; - } - else - { - ret->environment = exprNode_isUndefined (e1) ? environmentTable_copy(e2->environment) - : environmentTable_copy (e1->environment); - return ret; - } -} - - - -exprNode -exprNode_updateForPostOp ( /*@notnull@*/ /*@returned@*/ exprNode e1) -{ - e1->environment = environmentTable_postOpvar (e1->environment, e1->sref); - return e1; -} - -void updateEnvironmentForPostOp (/*@notnull@*/ exprNode e1) -{ - sRef s1 = e1->sref; - // printf("doing updateEnvironmentForPostOp\n"); - e1 = exprNode_updateForPostOp (e1); - /*do in exprNode update exprnode*/ - usymtab_postopVar (s1); -} - -void updateEnvironment (/*@notnull@*/ exprNode e1, /*@notnull@*/ exprNode e2) -{ - // printf("doing updateEnvironment\n"); - if (!context_inProtectVars ()) - { - /* - ** depends on types of e1 and e2 - */ - - sRef s1 = e1->sref; - sRef s2 = e2->sref; - ctype t1 = exprNode_getType (e1); - // printf(" for %s = %s \n", sRef_unparse(s1), sRef_unparse(s2) ); - // printf("type is %d\n", t1); - if (multiVal_isInt( e2->val) ) - { - int val = multiVal_forceInt(e2->val); - // printf("value is %d \n", val); - usymtab_addExactValue( s1, val); - environmentTable_addExactValue (e1->environment, s1, val); - } - - /* handle pointer sRefs, record fields, arrays, etc... */ - } - else - { - // printf("context_inProtectVars\n"); - } - -} - -/*@=fcnuse*/ -/*@end@*/ diff --git a/src/exprChecks.c b/src/exprChecks.c deleted file mode 100644 index 44eb80b..0000000 --- a/src/exprChecks.c +++ /dev/null @@ -1,1436 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** exprChecks.c -*/ - -# include "lclintMacros.nf" -# include "basic.h" -# include "cgrammar.h" -# include "cgrammar_tokens.h" -# include "aliasChecks.h" -# include "exprChecks.h" - -/* -** for now, allow exprChecks to access exprNode. -** may remove this in future -*/ - -/*@access exprNode@*/ - -static bool checkCallModifyAux (sRef p_s, exprNode p_f, sRef p_alias, exprNode p_err); -static bool checkModifyValAux (sRef p_s, exprNode p_f, sRef p_alias, exprNode p_err); -static bool checkModifyAux (sRef p_s, exprNode p_f, sRef p_alias, exprNode p_err); -static void checkSafeReturnExpr (/*@notnull@*/ exprNode p_e); - -/* -** called at end of expression statement -** -** of e->kind is not an assign, empty, body or modop -** verify the the value is void -** -*/ - -void -exprNode_checkStatement (exprNode e) -{ - bool hasError = FALSE; - - if (!exprNode_isError (e)) - { - exprKind ek = e->kind; - - if (ek == XPR_CALL && !(ctype_isRealVoid (e->typ))) - { - if (ctype_isKnown (e->typ)) - { - if (ctype_isManifestBool (ctype_realishType (e->typ))) - { - hasError = optgenerror - (FLG_RETVALBOOL, - message ("Return value (type %t) ignored: %s", - e->typ, - exprNode_unparseFirst (e)), - e->loc); - } - else if (ctype_isDirectInt (e->typ)) - { - hasError = optgenerror - (FLG_RETVALINT, - message ("Return value (type %t) ignored: %s", - e->typ, - exprNode_unparseFirst (e)), - e->loc); - } - else - { - hasError = optgenerror - (FLG_RETVALOTHER, - message ("Return value (type %t) ignored: %s", - e->typ, - exprNode_unparseFirst (e)), - e->loc); - } - } - } - - if (!hasError && !(exprNode_mayEscape (e)) - && !(e->canBreak)) /* control changes are effects too! */ - { - if (sRefSet_hasRealElement (e->sets) - || sRefSet_hasRealElement (e->msets)) - { - ; /* okay */ - } - else - { - if (sRefSet_isEmpty (e->sets) && sRefSet_isEmpty (e->msets)) - { - voptgenerror - (FLG_NOEFFECT, - message ("Statement has no effect: %s", - exprNode_unparseFirst (e)), - e->loc); - } - else - { - if (context_maybeSet (FLG_NOEFFECTUNCON)) - { - if (sRefSet_hasUnconstrained (e->sets)) - { - voptgenerror - (FLG_NOEFFECTUNCON, - message ("Statement has no effect (possible " - "undected modification through " - "call to %q): %s", - sRefSet_unparseUnconstrained (e->sets), - exprNode_unparseFirst (e)), - e->loc); - } - else if (sRefSet_hasUnconstrained (e->msets)) - { - voptgenerror - (FLG_NOEFFECTUNCON, - message ("Statement has no effect (possible " - "undected modification through " - "call to %q): %s", - sRefSet_unparseUnconstrained (e->msets), - exprNode_unparseFirst (e)), - e->loc); - } - else - { - ; /* statement has unknown modification */ - } - } - } - } - } - } -} - -static bool -checkRepExposed (sRef base, /*@notnull@*/ exprNode e, sRef alias, - /*@unused@*/ exprNode unused) -{ - ctype btype; - - if (sRef_isInvalid (alias) || sRef_sameName (base, alias)) - { - btype = sRef_getType (base); - - if (ctype_isAbstract (btype) && ctype_isVisiblySharable (e->typ)) - { - voptgenerror (FLG_RETEXPOSE, - message ("Return value exposes rep of %s: %s", - ctype_unparse (btype), - exprNode_unparse (e)), - e->loc); - return TRUE; - } - } - else - { - sRef rbase = sRef_getRootBase (base); - btype = sRef_getType (rbase); - - if (ctype_isAbstract (btype) && ctype_isVisiblySharable (e->typ)) - { - voptgenerror - (FLG_RETEXPOSE, - message ("Return value may expose rep of %s through alias %q: %s", - ctype_unparse (btype), - sRef_unparse (rbase), - exprNode_unparse (e)), - e->loc); - return TRUE; - } - } - - return FALSE; -} - -static bool -checkRefGlobParam (sRef base, /*@notnull@*/ exprNode e, - sRef alias, /*@unused@*/ exprNode unused) -{ - if (sRef_isInvalid (alias) || sRef_sameName (base, alias)) - { - ctype ct = e->typ; - - if (ctype_isUnknown (ct)) - { - ct = sRef_getType (base); - } - - if (ctype_isVisiblySharable (ct)) - { - if (sRef_isGlobal (base)) - { - voptgenerror - (FLG_RETALIAS, - message ("Function returns reference to global %q: %s", - sRef_unparse (base), - exprNode_unparse (e)), - e->loc); - - return TRUE; - } - else if (sRef_isAnyParam (base)) - { - uentryList params = context_getParams (); - int paramno = sRef_getParam (base); - - if (paramno < uentryList_size (params)) - { - uentry arg = uentryList_getN (params, paramno); - sRef ref = uentry_getSref (arg); - - if (uentry_isReturned (arg) - || sRef_isOnly (ref) - || sRef_isExposed (ref) - || sRef_isRefCounted (ref)) - { - ; /* okay */ - } - else - { - voptgenerror - (FLG_RETALIAS, - message ("Function returns reference to parameter %q: %s", - sRef_unparse (base), - exprNode_unparse (e)), - e->loc); - } - } - else - { - llbuglit ("ret alias: bad paramno"); - } - - return TRUE; - } - else - { - return FALSE; - } - } - } - else - { - if (ctype_isVisiblySharable (e->typ)) - { - if (sRef_isGlobal (base)) - { - voptgenerror - (FLG_RETALIAS, - message ("Function may return reference to global %q through alias %q: %s", - sRef_unparse (alias), - sRef_unparse (base), - exprNode_unparse (e)), - e->loc); - return TRUE; - } - else if (sRef_isAnyParam (base) && !(sRef_isOnly (base))) - { - uentryList params = context_getParams (); - int paramno = sRef_getParam (base); - - if (paramno < uentryList_size (params)) - { - uentry arg = uentryList_getN (params, paramno); - - if (!uentry_isReturned (arg)) - { - voptgenerror - (FLG_RETALIAS, - message - ("Function may return reference to parameter %q through alias %q: %s", - sRef_unparse (base), - sRef_unparse (alias), - exprNode_unparse (e)), - e->loc); - - return TRUE; - } - } - else - { - voptgenerror - (FLG_RETALIAS, - message - ("Function may return reference to parameter %q through alias %q: %s", - sRef_unparse (base), - sRef_unparse (alias), - exprNode_unparse (e)), - e->loc); - - return TRUE; - } - } - else - { - return FALSE; - } - } - } - return FALSE; -} - - -void -exprNode_checkModify (exprNode e, exprNode err) -{ - llassert (exprNode_isDefined (e)); - - DPRINTF (("Check modify: %s", exprNode_unparse (e))); - - if (sRef_isValid (e->sref)) - { - sRef_aliasCheckPred (checkModifyAux, sRef_isReference, e->sref, e, err); - } -} - -void -exprNode_checkModifyVal (exprNode e, exprNode err) -{ - llassert (exprNode_isDefined (e)); - - DPRINTF (("Check modify val: %s", exprNode_unparse (e))); - - if (sRef_isValid (e->sref)) - { - sRef_aliasCheckPred (checkModifyValAux, sRef_isReference, e->sref, e, err); - } -} - -void -exprChecks_checkNullReturn (fileloc loc) -{ - if (!context_inRealFunction ()) - { - /* - llmsg ("exprChecks_checkNullReturnExpr: not in function context"); - */ - return; - } - else - { - if (ctype_isFunction (context_currentFunctionType ())) - { - ctype tr = ctype_returnValue (context_currentFunctionType ()); - - if (!ctype_isFirstVoid (tr)) - { - if (ctype_isUnknown (tr)) - { - voptgenerror - (FLG_CONTROL, - cstring_makeLiteral ("Empty return in function declared to implicitly return int"), - loc); - } - else - { - voptgenerror (FLG_CONTROL, - message ("Empty return in function declared to return %t", tr), - loc); - } - } - } - } -} - -void -exprNode_checkReturn (exprNode e) -{ - if (!exprNode_isError (e)) - { - if (!context_inRealFunction ()) - { - if (context_inMacro ()) - { - llerror (FLG_CONTROL, - message ("Macro %s uses return (not functional)", - context_inFunctionName ())); - } - else - { - /* - llbuglit ("exprNode_checkReturn: not in function context"); - */ - } - } - else - { - if (ctype_isFunction (context_currentFunctionType ())) - { - checkSafeReturnExpr (e); - } - else - { - ; - } - } - } -} - -void -exprNode_checkPred (cstring c, exprNode e) -{ - ctype ct; - - if (exprNode_isError (e)) - return; - - ct = exprNode_getType (e); - - if (exprNode_isAssign (e)) - { - voptgenerror - (FLG_PREDASSIGN, - message ("Test expression for %s is assignment expression: %s", - c, exprNode_unparse (e)), - e->loc); - } - - if (ctype_isRealBool (ct)) - { - ; - } - else if (ctype_isRealPointer (ct)) - { - voptgenerror - (FLG_PREDBOOLPTR, - message ("Test expression for %s not %s, type %t: %s", c, - context_printBoolName (), - ct, exprNode_unparse (e)), - e->loc); - } - else if (ctype_isRealInt (ct)) - { - voptgenerror - (FLG_PREDBOOLINT, - message ("Test expression for %s not %s, type %t: %s", c, - context_printBoolName (), ct, exprNode_unparse (e)), - e->loc); - } - else - { - voptgenerror - (FLG_PREDBOOLOTHERS, - message ("Test expression for %s not %s, type %t: %s", c, - context_printBoolName (), ct, exprNode_unparse (e)), - e->loc); - } -} - -void -exprChecks_checkUsedGlobs (globSet decl, globSet used) -{ - fileloc fl = uentry_whereSpecified (context_getHeader ()); - - if (fileloc_isUndefined (fl)) - { - fl = uentry_whereDeclared (context_getHeader ()); - } - - globSet_allElements (decl, el) - { - if (!globSet_member (used, el)) - { - if (sRef_isSpecInternalState (el) - || sRef_isNothing (el)) - { - ; - } - else - { - cstring sname = sRef_unparse (el); - - if (fileloc_isLib (fl)) - { - voptgenerror (FLG_USEALLGLOBS, - message ("Global %s listed (%q) but not used", - sname, fileloc_unparse (fl)), - g_currentloc); - } - else - { - voptgenerror (FLG_USEALLGLOBS, - message ("Global %s listed but not used", sname), - fl); - } - - cstring_free (sname); - } - } - } end_globSet_allElements; -} - -void -exprNode_checkAllMods (sRefSet mods, uentry ue) -{ - bool realParams = FALSE; - uentry le = context_getHeader (); - fileloc fl = uentry_whereSpecified (le); - uentryList specParamNames = uentryList_undefined; - uentryList paramNames = context_getParams (); - - if (uentry_isFunction (le)) - { - specParamNames = uentry_getParams (le); - - if (uentryList_isUndefined (specParamNames)) - { - ; /* unknown params */ - } - else if (uentryList_size (paramNames) != uentryList_size (specParamNames)) - { - llbug - (message ("exprNode_checkAllMods: parameter lists have different sizes: " - "%q (%d) / %q (%d)", - uentryList_unparse (paramNames), - uentryList_size (paramNames), - uentryList_unparse (specParamNames), - uentryList_size (specParamNames))); - } - else if (uentryList_size (paramNames) > 0 - && !uentry_hasRealName (uentryList_getN (specParamNames, 0))) - { - /* loaded from a library */ - } - else - { - realParams = TRUE; - } - } - - sRefSet_allElements (mods, sr) - { - if (sRef_isNothing (sr) || sRef_isSpecState (sr)) - { - ; /* should report on anything? */ - } - else if (sRef_isInternalState (sr)) - { - if (!sRef_isModified (sr)) - { - if (sRefSet_hasStatic (mods)) - { - ; /* okay */ - } - else - { - if (optgenerror - (FLG_MUSTMOD, - message - ("Function %s specified to modify internal state " - "but no internal state is modified", - uentry_rawName (ue)), - uentry_whereLast (ue))) - { - uentry_showWhereSpecified (le); - } - } - } - } - else - { - if (!sRef_isModified (sr)) - { - cstring sname = realParams ? sRef_unparse (sr) : sRef_unparse (sr); - - if (fileloc_isLib (fl) && !realParams) - { - voptgenerror - (FLG_MUSTMOD, - message ("Suspect object listed (%q) in modifies " - "clause of %s not modified: %s", - fileloc_unparse (fl), - uentry_rawName (ue), - sname), - uentry_whereLast (ue)); - } - else - { - if (optgenerror - (FLG_MUSTMOD, - message ("Suspect object listed in modifies of %s " - "not modified: %s", - uentry_rawName (ue), - sname), - uentry_whereLast (ue))) - { - uentry_showWhereSpecified (le); - } - } - cstring_free (sname); - } - } - } end_sRefSet_allElements; -} - -void exprNode_checkMacroBody (/*@only@*/ exprNode e) -{ - if (!exprNode_isError (e)) - { - uentry hdr; - - if (!(context_inFunctionLike () || context_inMacroConstant () - || context_inMacroUnknown ())) - { - llcontbug - (message - ("exprNode_checkMacroBody: not in macro function or constant: %q", - context_unparse ())); - exprNode_free (e); - return; - } - - hdr = context_getHeader (); - - if (e->kind == XPR_STMTLIST || e->kind == XPR_BODY) - { - voptgenerror - (FLG_MACROSTMT, - message - ("Macro %q definition is statement list (recommend " - "do { ... } while (0) constuction to ensure multiple " - "statement macro is syntactic function)", - uentry_getName (hdr)), - fileloc_isDefined (e->loc) ? e->loc : g_currentloc); - } - - if (context_inMacroConstant ()) - { - ctype t = uentry_getType (hdr); - - uentry_setDefined (hdr, e->loc); - - if (!(exprNode_matchType (t, e))) - { - cstring uname = uentry_getName (hdr); - - if (cstring_equal (uname, context_getTrueName ()) - || cstring_equal (uname, context_getFalseName ())) - { - /* - ** We need to do something special to allow FALSE and TRUE - ** to be defined without reporting errors. This is a tad - ** bogus, but otherwise lots of things would break. - */ - - - llassert (ctype_isManifestBool (t)); - /* Should also check type of e is a reasonable (?) bool type. */ - } - else - { - if (optgenerror - (FLG_INCONDEFS, - message - ("Constant %q specified as %s, but defined as %s: %s", - uentry_getName (hdr), - ctype_unparse (t), - ctype_unparse (e->typ), - exprNode_unparse (e)), - e->loc)) - { - uentry_showWhereSpecified (hdr); - } - } - - cstring_free (uname); - } - else - { - if (context_maybeSet (FLG_NULLSTATE) - && ctype_isUA(t) - && ctype_isRealPointer (t) - && exprNode_isNullValue (e)) - { - uentry ue = usymtab_getTypeEntry (ctype_typeId (t)); - sRef sr = uentry_getSref (ue); - - if (!sRef_possiblyNull (sr)) - { - vgenhinterror - (FLG_NULLSTATE, - message ("Constant %q of non-null type %s defined " - "as null: %s", - uentry_getName (hdr), ctype_unparse (t), - exprNode_unparse (e)), - message ("If %s can be null, add a /*@null@*/ " - "qualifer to its typedef.", - ctype_unparse (t)), - e->loc); - } - - uentry_mergeConstantValue (hdr, e->val); - e->val = multiVal_undefined; - } - } - } - else if (context_inMacroFunction () || context_inMacroUnknown ()) - { - ctype rettype = context_getRetType (); - - if (context_isMacroMissingParams ()) - { - llassert (context_inMacroFunction ()); - - /* - ** # define newname oldname - ** - ** newname is a function - ** specification of oldname should match - ** specification of newname. - */ - - if (!ctype_isFunction (e->typ)) - { - voptgenerror - (FLG_INCONDEFS, - message ("Function %s defined by unparameterized " - "macro not corresponding to function", - context_inFunctionName ()), - e->loc); - } - else - { - uentry ue = exprNode_getUentry (e); - - if (uentry_isValid (ue)) - { - /* - ** Okay, for now --- should check for consistency - */ - /* - ** uentry oldue = usymtab_lookup (cfname); - */ - - /* check var conformance here! */ - } - else - { - voptgenerror - (FLG_INCONDEFS, - message ("Function %s defined by unparameterized " - "macro not corresponding to function", - context_inFunctionName ()), - e->loc); - } - - e->typ = ctype_returnValue (e->typ); - rettype = e->typ; /* avoid aditional errors */ - } - } - - if (ctype_isVoid (rettype) || ctype_isUnknown (rettype)) - { - ; /* don't complain when void macros have values */ - } - else if (!exprNode_matchType (rettype, e)) - { - if (optgenerror - (FLG_INCONDEFS, - message ("Function %q specified to return %s, " - "implemented as macro having type %s: %s", - uentry_getName (hdr), - ctype_unparse (rettype), ctype_unparse (e->typ), - exprNode_unparse (e)), - e->loc)) - { - uentry_showWhereSpecified (hdr); - } - } - else - { - switch (e->kind) - { - /* these expressions have values: */ - case XPR_PARENS: case XPR_ASSIGN: - case XPR_EMPTY: case XPR_VAR: - case XPR_OP: case XPR_POSTOP: - case XPR_PREOP: case XPR_CALL: - case XPR_SIZEOFT: case XPR_SIZEOF: - case XPR_ALIGNOFT: case XPR_ALIGNOF: - case XPR_CAST: case XPR_FETCH: - case XPR_COMMA: case XPR_COND: - case XPR_ARROW: case XPR_CONST: - case XPR_STRINGLITERAL: case XPR_NUMLIT: - case XPR_FACCESS: case XPR_OFFSETOF: - - checkReturnTransfer (e, hdr); - break; - - /* these expressions don't */ - case XPR_LABEL: - case XPR_VAARG: case XPR_ITER: - case XPR_FOR: case XPR_FORPRED: - case XPR_GOTO: case XPR_CONTINUE: - case XPR_BREAK: case XPR_RETURN: - case XPR_NULLRETURN: case XPR_IF: - case XPR_IFELSE: case XPR_DOWHILE: - case XPR_WHILE: case XPR_STMT: - case XPR_STMTLIST: case XPR_SWITCH: - case XPR_INIT: case XPR_BODY: - case XPR_NODE: case XPR_ITERCALL: - case XPR_TOK: case XPR_CASE: - case XPR_FTCASE: case XPR_FTDEFAULT: - case XPR_DEFAULT: case XPR_WHILEPRED: - case XPR_BLOCK: case XPR_INITBLOCK: - if (optgenerror - (FLG_INCONDEFS, - message ("Function %q specified to return %s, " - "implemented as macro with no result: %s", - uentry_getName (hdr), - ctype_unparse (rettype), - exprNode_unparse (e)), - e->loc)) - { - uentry_showWhereSpecified (hdr); - } - } - } - - usymtab_checkFinalScope (FALSE); - } - else - { - llbug (message ("exprNode_checkMacroBody: not in macro function: %q", context_unparse ())); - } - - exprNode_free (e); - } - - context_exitFunction (); - return; -} - -void exprNode_checkFunctionBody (exprNode body) -{ - if (!exprNode_isError (body)) - { - bool noret = context_getFlag (FLG_NORETURN); - bool checkret = exprNode_mustEscape (body); - - if (!checkret - && noret - && !exprNode_errorEscape (body) - && context_inRealFunction () - && ctype_isFunction (context_currentFunctionType ())) - { - ctype tr = ctype_returnValue (context_currentFunctionType ()); - - if (!ctype_isFirstVoid (tr)) - { - if (ctype_isUnknown (tr)) - { - voptgenerror - (FLG_NORETURN, - cstring_makeLiteral ("Path with no return in function declared to implicity return int"), - g_currentloc); - } - else - { - voptgenerror - (FLG_NORETURN, - message ("Path with no return in function declared to return %t", - tr), - g_currentloc); - } - } - } - - exprNode_checkFunction (context_getHeader (), body); - - if (!checkret) - { - context_returnFunction (); - } - } -} -/*drl modified */ - -void exprNode_checkFunction (/*@unused@*/ uentry ue, /*@only@*/ exprNode body) -{ - constraintList c, t; - constraintList c2, fix; - - // return; - - exprNode_generateConstraints (body); - - c = uentry_getFcnPreconditions (ue); - DPRINTF(("function constraints\n")); - DPRINTF (("\n\n\n\n\n\n\n")); - - context_enterInnerContext (); - - if (c) - { - llassert (c); - DPRINTF ( (message ("Function preconditions are %s \n\n\n\n\n", constraintList_printDetailed (c) ) ) ); - - t = reflectChanges (body->requiresConstraints, constraintList_copy (c) ); - body->requiresConstraints = constraintList_copy (t); - - c2 = constraintList_copy (c); - fix = constraintList_makeFixedArrayConstraints (body->uses); - c2 = reflectChanges (c2, constraintList_copy(fix) ); - - t = reflectChanges (body->requiresConstraints, constraintList_copy (c2) ); - body->requiresConstraints = constraintList_copy (t); - - DPRINTF ( (message ("The body has the required cosntraints: %s", constraintList_printDetailed (t) ) ) ); - t = constraintList_mergeEnsures (c, body->ensuresConstraints); - - body->ensuresConstraints = constraintList_copy (t); - - DPRINTF ( (message ("The body has the ensures constraints: %s", constraintList_printDetailed (t) ) ) ); - } - - if (c) - { - DPRINTF((message ("The Function %s has the preconditions %s", uentry_unparse(ue), constraintList_printDetailed(c) ) ) ); - } - else - { - DPRINTF((message ("The Function %s has no preconditions", uentry_unparse(ue) ) ) ); - } - - constraintList_printError(body->requiresConstraints, g_currentloc); - constraintList_printError(body->ensuresConstraints, g_currentloc); - - // ConPrint (message ("Unable to resolve function constraints:\n%s", constraintList_printDetailed(body->requiresConstraints) ), g_currentloc); - - // ConPrint (message ("LCLint has found function post conditions:\n%s", constraintList_printDetailed(body->ensuresConstraints) ), g_currentloc); - - // printf ("The required constraints are:\n%s", constraintList_printDetailed(body->requiresConstraints) ); - // printf ("The ensures constraints are:\n%s", constraintList_printDetailed(body->ensuresConstraints) ); - - context_exitInnerPlain(); - /* exprNode_free (body); */ -} - -void exprChecks_checkEmptyMacroBody (void) -{ - uentry hdr; - - if (!(context_inFunctionLike () || context_inMacroConstant () - || context_inMacroUnknown ())) - { - llcontbug - (message ("exprNode_checkEmptyMacroBody: not in macro function or constant: %q", - context_unparse ())); - return; - } - - hdr = context_getHeader (); - - beginLine (); - - if (uentry_isFunction (hdr)) - { - voptgenerror - (FLG_MACROEMPTY, - message - ("Macro definition for %q is empty", uentry_getName (hdr)), - g_currentloc); - - usymtab_checkFinalScope (FALSE); - } - - context_exitFunction (); - return; -} - -void exprNode_checkIterBody (/*@only@*/ exprNode body) -{ - context_exitAllClauses (); - - context_exitFunction (); - exprNode_free (body); -} - -void exprNode_checkIterEnd (/*@only@*/ exprNode body) -{ - context_exitAllClauses (); - context_exitFunction (); - exprNode_free (body); -} - -static -bool checkModifyAuxAux (sRef s, exprNode f, sRef alias, exprNode err) -{ - bool hasMods = context_hasMods (); - flagcode errCode = hasMods ? FLG_MODIFIES : FLG_MODNOMODS; - - if (exprNode_isDefined (f)) - { - f->sets = sRefSet_insert (f->sets, s); - } - - if (context_getFlag (FLG_MODIFIES) - && (hasMods || context_getFlag (FLG_MODNOMODS))) - { - sRefSet mods = context_modList (); - - if (!sRef_canModify (s, mods)) - { - sRef rb = sRef_getRootBase (s); - - - if (sRef_isGlobal (rb)) - { - if (!context_checkGlobMod (rb)) - { - return FALSE; - } - } - - if (sRef_isInvalid (alias) || sRef_sameName (s, alias)) - { - if (sRef_isLocalVar (sRef_getRootBase (s))) - { - voptgenerror - (errCode, - message - ("Undocumented modification of internal state (%q): %s", - sRef_unparse (s), exprNode_unparse (err)), - exprNode_isDefined (f) ? f->loc : g_currentloc); - } - else - { - if (sRef_isSystemState (s)) - { - if (errCode == FLG_MODNOMODS) - { - if (context_getFlag (FLG_MODNOMODS)) - { - errCode = FLG_MODFILESYSTEM; - } - } - else - { - errCode = FLG_MODFILESYSTEM; - } - } - - voptgenerror - (errCode, - message ("Undocumented modification of %q: %s", - sRef_unparse (s), exprNode_unparse (err)), - exprNode_isDefined (f) ? f->loc : g_currentloc); - } - - return TRUE; - } - else - { - if (sRef_isReference (s) && !sRef_isAddress (alias)) - { - voptgenerror - (errCode, - message - ("Possible undocumented modification of %q through alias %q: %s", - sRef_unparse (s), - sRef_unparse (alias), - exprNode_unparse (err)), - exprNode_isDefined (f) ? f->loc : g_currentloc); - return TRUE; - } - } - } - } - else - { - if (context_maybeSet (FLG_MUSTMOD)) - { - (void) sRef_canModify (s, context_modList ()); - } - - if (sRef_isRefsField (s)) - { - sRef_setModified (s); - } - } - - return FALSE; -} - -static -bool checkModifyAux (sRef s, exprNode f, sRef alias, exprNode err) -{ - DPRINTF (("Check modify aux: %s", sRef_unparseFull (s))); - - if (sRef_isReference (s) && sRef_isObserver (s) - && context_maybeSet (FLG_MODOBSERVER)) - { - cstring sname; - - if (sRef_isPointer (s)) - { - sRef base = sRef_getBase (s); - sname = sRef_unparse (base); - } - else - { - if (sRef_isAddress (s)) - { - sRef p = sRef_constructPointer (s); - sname = sRef_unparse (p); - } - else - { - sname = sRef_unparse (s); - } - } - - if (!sRef_isValid (alias) || sRef_sameName (s, alias)) - { - if (sRef_isMeaningful (s)) - { - if (optgenerror - (FLG_MODOBSERVER, - message ("Suspect modification of observer %s: %s", - sname, exprNode_unparse (err)), - exprNode_isDefined (f) ? f->loc : g_currentloc)) - { - sRef_showExpInfo (s); - } - } - else - { - voptgenerror - (FLG_MODOBSERVER, - message ("Suspect modification of observer returned by " - "function call: %s", - exprNode_unparse (err)), - exprNode_isDefined (f) ? f->loc : g_currentloc); - } - } - else - { - if (optgenerror - (FLG_MODOBSERVER, - message ("Suspect modification of observer %s through alias %q: %s", - sname, sRef_unparse (alias), exprNode_unparse (err)), - exprNode_isDefined (f) ? f->loc : g_currentloc)) - { - sRef_showExpInfo (s); - } - } - - cstring_free (sname); - } - - (void) checkModifyAuxAux (s, f, alias, err); - return FALSE; -} - -static -bool checkModifyValAux (sRef s, exprNode f, sRef alias, exprNode err) -{ - (void) checkModifyAuxAux (s, f, alias, err); - return FALSE; -} - -static -bool checkCallModifyAux (sRef s, exprNode f, sRef alias, exprNode err) -{ - bool result = FALSE; - - if (sRef_isObserver (s) && context_maybeSet (FLG_MODOBSERVER)) - { - sRef p = sRef_isAddress (s) ? sRef_constructPointer (s) : s; - cstring sname = sRef_unparse (p); - - if (!sRef_isValid (alias) || sRef_sameName (s, alias)) - { - if (sRef_isMeaningful (s)) - { - result = optgenerror - (FLG_MODOBSERVER, - message ("Suspect modification of observer %s: %s", - sname, exprNode_unparse (err)), - exprNode_isDefined (f) ? f->loc : g_currentloc); - } - else - { - result = optgenerror - (FLG_MODOBSERVER, - message ("Suspect modification of observer returned by " - "function call: %s", - exprNode_unparse (err)), - exprNode_isDefined (f) ? f->loc : g_currentloc); - } - } - else - { - result = optgenerror - (FLG_MODOBSERVER, - message - ("Suspect modification of observer %s through alias %q: %s", - sname, sRef_unparse (alias), exprNode_unparse (err)), - exprNode_isDefined (f) ? f->loc : g_currentloc); - } - - cstring_free (sname); - } - else if (context_maybeSet (FLG_MODIFIES)) - { - if (!(sRef_canModifyVal (s, context_modList ()))) - { - sRef p = sRef_isAddress (s) ? sRef_constructPointer (s) : s; - cstring sname = sRef_unparse (p); - bool hasMods = context_hasMods (); - sRef rb = sRef_getRootBase (s); - flagcode errCode = hasMods ? FLG_MODIFIES : FLG_MODNOMODS; - bool check = TRUE; - - if (sRef_isGlobal (rb)) - { - uentry ue = sRef_getUentry (rb); - - /* be more specific here! */ - if (!uentry_isCheckedModify (ue)) - { - check = FALSE; - } - } - - if (check) - { - if (!sRef_isValid (alias) || sRef_sameName (s, alias)) - { - if (sRef_isLocalVar (sRef_getRootBase (s))) - { - voptgenerror - (errCode, - message - ("Undocumented modification of internal " - "state (%q) through call to %s: %s", - sRef_unparse (s), exprNode_unparse (f), - exprNode_unparse (err)), - exprNode_isDefined (f) ? f->loc : g_currentloc); - } - else - { - if (sRef_isSystemState (s)) - { - if (errCode == FLG_MODNOMODS) - { - if (context_getFlag (FLG_MODNOMODS)) - { - errCode = FLG_MODFILESYSTEM; - } - } - else - { - errCode = FLG_MODFILESYSTEM; - } - } - - result = optgenerror - (errCode, - message ("Undocumented modification of %s " - "possible from call to %s: %s", - sname, - exprNode_unparse (f), - exprNode_unparse (err)), - exprNode_isDefined (f) ? f->loc : g_currentloc); - } - } - else - { - result = optgenerror - (errCode, - message ("Undocumented modification of %s possible " - "from call to %s (through alias %q): %s", - sname, - exprNode_unparse (f), - sRef_unparse (alias), - exprNode_unparse (err)), - exprNode_isDefined (f) ? f->loc : g_currentloc); - } - } - cstring_free (sname); - } - } - else - { - if (context_maybeSet (FLG_MUSTMOD)) - { - (void) sRef_canModifyVal (s, context_modList ()); - } - } - - return result; -} - -void exprNode_checkCallModifyVal (sRef s, exprNodeList args, exprNode f, exprNode err) -{ - s = sRef_fixBaseParam (s, args); - sRef_aliasCheckPred (checkCallModifyAux, NULL, s, f, err); -} - -void -exprChecks_checkExport (uentry e) -{ - if (context_checkExport (e)) - { - fileloc fl = uentry_whereDeclared (e); - - if (fileloc_isHeader (fl) && !fileloc_isLib (fl) - && !fileloc_isImport (fl) && !uentry_isStatic (e)) - { - if (uentry_isFunction (e) || - (uentry_isVariable (e) && ctype_isFunction (uentry_getType (e)))) - { - voptgenerror - (FLG_EXPORTFCN, - message ("Function exported, but not specified: %q", - uentry_getName (e)), - fl); - } - else if (uentry_isExpandedMacro (e)) - { - voptgenerror - (FLG_EXPORTMACRO, - message ("Expanded macro exported, but not specified: %q", - uentry_getName (e)), - fl); - } - else if (uentry_isVariable (e) && !uentry_isParam (e)) - { - voptgenerror - (FLG_EXPORTVAR, - message ("Variable exported, but not specified: %q", - uentry_getName (e)), - fl); - } - else if (uentry_isEitherConstant (e)) - { - voptgenerror - (FLG_EXPORTCONST, - message ("Constant exported, but not specified: %q", - uentry_getName (e)), - fl); - } - else if (uentry_isIter (e) || uentry_isEndIter (e)) - { - voptgenerror - (FLG_EXPORTITER, - message ("Iterator exported, but not specified: %q", - uentry_getName (e)), - fl); - } - - else if (uentry_isDatatype (e)) - { - ; /* error already reported */ - } - else - { - BADEXIT; - } - } - } -} - -static void checkSafeReturnExpr (/*@notnull@*/ exprNode e) -{ - ctype tr = ctype_returnValue (context_currentFunctionType ()); - ctype te = exprNode_getType (e); - - if (!ctype_forceMatch (tr, te) && !exprNode_matchLiteral (tr, e)) - { - (void) gentypeerror - (te, e, tr, exprNode_undefined, - message ("Return value type %t does not match declared type %t: %s", - te, tr, exprNode_unparse (e)), - e->loc); - } - else - { - sRef ret = e->sref; - uentry rval = context_getHeader (); - sRef resultref = uentry_getSref (rval); - - checkReturnTransfer (e, rval); - - if (!(sRef_isExposed (uentry_getSref (context_getHeader ())) - || sRef_isObserver (uentry_getSref (context_getHeader ()))) - && (context_getFlag (FLG_RETALIAS) - || context_getFlag (FLG_RETEXPOSE))) - { - sRef base = sRef_getRootBase (ret); - ctype rtype = e->typ; - - if (ctype_isUnknown (rtype)) - { - rtype = tr; - } - - if (ctype_isVisiblySharable (rtype)) - { - if (context_getFlag (FLG_RETALIAS)) - { - sRef_aliasCheckPred (checkRefGlobParam, NULL, base, - e, exprNode_undefined); - } - - if (context_getFlag (FLG_RETEXPOSE) && sRef_isIReference (ret) - && !sRef_isExposed (resultref) && !sRef_isObserver (resultref)) - { - sRef_aliasCheckPred (checkRepExposed, NULL, base, e, - exprNode_undefined); - } - } - } - } -} - diff --git a/src/exprData.c b/src/exprData.c deleted file mode 100644 index 8bcfe0d..0000000 --- a/src/exprData.c +++ /dev/null @@ -1,40 +0,0 @@ -/* -** exprNode.c -*/ - -# include /* for isdigit */ -# include "lclintMacros.nf" -# include "basic.h" -# include "cgrammar.h" -# include "cgrammar_tokens.h" - -# include "exprChecks.h" -# include "aliasChecks.h" -# include "exprNodeSList.h" -# include "exprData.i" - -/*@only@*/ exprData exprData_makeLiteral (/*@only@*/ cstring s) -{ - exprData ed = (exprData) dmalloc (sizeof (*ed)); - - ed->literal = s; - return ed; -} - -/*@only@*/ exprData exprData_makeId (/*@temp@*/ uentry id) -{ - exprData ed = (exprData) dmalloc (sizeof (*ed)); - ed->id = cstring_copy (uentry_rawName (id)); - return ed; -} - -/*@only@*/ exprData exprData_makePair (/*@keep@*/ exprNode a, /*@keep@*/ exprNode b) -{ - exprData ed = (exprData) dmalloc (sizeof (*ed)); - - ed->pair = (exprPair) dmalloc (sizeof (*ed->pair)); - ed->pair->a = a; - ed->pair->b = b; - - return ed; -} diff --git a/src/exprNode.c b/src/exprNode.c deleted file mode 100644 index 349965a..0000000 --- a/src/exprNode.c +++ /dev/null @@ -1,10006 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** exprNode.c -*/ - -# include /* for isdigit */ -# include "lclintMacros.nf" -# include "basic.h" -# include "cgrammar.h" -# include "cgrammar_tokens.h" - -# include "exprChecks.h" -# include "aliasChecks.h" -# include "exprNodeSList.h" -# include "exprData.i" - -static bool exprNode_isEmptyStatement (exprNode p_e); -static /*@exposed@*/ exprNode exprNode_firstStatement (/*@returned@*/ exprNode p_e); -static bool exprNode_isFalseConstant (exprNode p_e) /*@*/ ; -static bool exprNode_isBlock (exprNode p_e); -static void checkGlobUse (uentry p_glob, bool p_isCall, /*@notnull@*/ exprNode p_e); -static void exprNode_addUse (exprNode p_e, sRef p_s); -static bool exprNode_matchArgType (ctype p_ct, exprNode p_e); - exprNode exprNode_fakeCopy (exprNode p_e) /*@*/ ; -static exprNode exprNode_statementError (/*@only@*/ exprNode p_e, /*@only@*/ lltok p_t); -static bool exprNode_matchTypes (exprNode p_e1, exprNode p_e2); -static void checkUniqueParams (exprNode p_fcn, - /*@notnull@*/ exprNode p_current, exprNodeList p_args, - int p_paramno, uentry p_ucurrent); -static void updateAliases (/*@notnull@*/ exprNode p_e1, /*@notnull@*/ exprNode p_e2); -static void abstractOpError (ctype p_tr1, ctype p_tr2, lltok p_op, - /*@notnull@*/ exprNode p_e1, /*@notnull@*/ exprNode p_e2, - fileloc p_loc1, fileloc p_loc2); -static ctype checkNumerics (ctype p_tr1, ctype p_tr2, ctype p_te1, ctype p_te2, - /*@notnull@*/ exprNode p_e1, /*@notnull@*/ exprNode p_e2, lltok p_op); -static void doAssign (/*@notnull@*/ exprNode p_e1, /*@notnull@*/ exprNode p_e2, bool p_isInit); -static void checkSafeUse (exprNode p_e, sRef p_s); -static void reflectNullTest (/*@notnull@*/ exprNode p_e, bool p_isnull); -static void checkMacroParen (exprNode p_e); -static exprNodeSList exprNode_flatten (/*@dependent@*/ exprNode p_e); -static void exprNode_checkSetAny (exprNode p_e, /*@dependent@*/ cstring p_name); -static void exprNode_checkUse (exprNode p_e, sRef p_s, fileloc p_loc); -static void exprNode_mergeUSs (exprNode p_res, exprNode p_other); -static void exprNode_mergeCondUSs (exprNode p_res, exprNode p_other1, exprNode p_other2); -static /*@only@*/ /*@notnull@*/ exprNode exprNode_fromIdentifierAux (/*@observer@*/ uentry p_c); -static void checkAnyCall (/*@notnull@*/ /*@dependent@*/ exprNode p_fcn, - /*@dependent@*/ cstring p_fname, - uentryList p_pn, exprNodeList p_args, - bool p_hasMods, sRefSet p_mods, bool p_isSpec, - int p_specialArgs); -static void checkOneArg (uentry p_ucurrent, /*@notnull@*/ exprNode p_current, - /*@dependent@*/ exprNode p_fcn, bool p_isSpec, int p_argno, int p_totargs); -static void - checkUnspecCall (/*@notnull@*/ /*@dependent@*/ exprNode p_fcn, uentryList p_params, exprNodeList p_args); - -static /*@only@*/ exprNode exprNode_effect (exprNode p_e) - /*@globals internalState@*/ ; -static /*@only@*/ cstring exprNode_doUnparse (exprNode p_e); -static /*@observer@*/ cstring exprNode_rootVarName (exprNode p_e); -static /*@exposed@*/ exprNode - exprNode_lastStatement (/*@returned@*/ exprNode p_e); - -static /*@null@*/ sRef defref = sRef_undefined; -static /*@only@*/ exprNode mustExitNode = exprNode_undefined; - -static int checkArgsReal (uentry p_fcn, /*@dependent@*/ exprNode p_f, - uentryList p_cl, - exprNodeList p_args, bool p_isIter, exprNode p_ret); - -static bool inEffect = FALSE; -static int nowalloc = 0; -static int totalloc = 0; -static int maxalloc = 0; - -static /*@only@*/ uentry regArg; -static /*@only@*/ uentry outArg; -static /*@only@*/ uentry outStringArg; -static /*@exposed@*/ sRef stdinRef; -static /*@exposed@*/ sRef stdoutRef; -static /*@only@*/ uentry csArg; -static /*@only@*/ uentry csOnlyArg; -static ctype cstringType; -static ctype ctypeType; -static ctype filelocType; -static bool initMod = FALSE; - -/* -** must occur after library has been read -*/ - -void exprNode_initMod (void) - /*@globals undef regArg, undef outArg, undef outStringArg, - undef csOnlyArg, undef csArg; - @*/ -{ - uentry ue; - idDecl tmp; - - initMod = TRUE; - cstringType = ctype_unknown; - ctypeType = ctype_unknown; - filelocType = ctype_unknown; - - defref = sRef_undefined; - - if (usymtab_existsType (cstring_makeLiteralTemp ("cstring"))) - { - cstringType = usymtab_lookupAbstractType (cstring_makeLiteralTemp ("cstring")); - } - - if (usymtab_existsType (cstring_makeLiteralTemp ("ctype"))) - { - ctypeType = usymtab_lookupAbstractType (cstring_makeLiteralTemp ("ctype")); - } - - if (usymtab_existsType (cstring_makeLiteralTemp ("fileloc"))) - { - filelocType = usymtab_lookupAbstractType (cstring_makeLiteralTemp ("fileloc")); - } - - if (usymtab_existsGlob (cstring_makeLiteralTemp ("stdin"))) - { - ue = usymtab_lookupGlob (cstring_makeLiteralTemp ("stdin")); - } - else /* define stdin */ - { - ue = uentry_makeVariable (cstring_makeLiteralTemp ("stdin"), - ctype_unknown, - fileloc_getBuiltin (), - FALSE); - uentry_setHasNameError (ue); - ue = usymtab_supGlobalEntryReturn (ue); - } - - stdinRef = sRef_makePointer (uentry_getSref (ue)); - - if (usymtab_existsGlob (cstring_makeLiteralTemp ("stdout"))) - { - ue = usymtab_lookupGlob (cstring_makeLiteralTemp ("stdout")); - } - else - { - ue = uentry_makeVariable (cstring_makeLiteralTemp ("stdout"), - ctype_unknown, - fileloc_getBuiltin (), - FALSE); - uentry_setHasNameError (ue); - ue = usymtab_supGlobalEntryReturn (ue); - } - - stdoutRef = sRef_makePointer (uentry_getSref (ue)); - - tmp = idDecl_create (cstring_undefined, qtype_create (ctype_unknown)); - - regArg = uentry_makeParam (tmp, PARAMUNKNOWN); - - idDecl_setTyp (tmp, - qtype_addQual (qtype_create (ctype_makePointer (ctype_unknown)), - qual_createOut ())); - - outArg = uentry_makeParam (tmp, PARAMUNKNOWN); - - idDecl_setTyp (tmp, qtype_addQual (qtype_create (ctype_string), - qual_createOut ())); - - outStringArg = uentry_makeParam (tmp, PARAMUNKNOWN); - - idDecl_setTyp (tmp, qtype_addQual (qtype_addQual (qtype_create (cstringType), - qual_createOnly ()), - qual_createNull ())); - - csOnlyArg = uentry_makeParam (tmp, PARAMUNKNOWN); - - idDecl_setTyp (tmp, qtype_addQual (qtype_create (cstringType), qual_createNull ())); - csArg = uentry_makeParam (tmp, PARAMUNKNOWN); - - idDecl_free (tmp); -} - -void -exprNode_destroyMod (void) - /*@globals killed regArg, killed outArg, killed outStringArg, - killed mustExitNode, initMod @*/ -{ - if (initMod) - { - uentry_free (regArg); - uentry_free (outArg); - uentry_free (outStringArg); - - exprNode_free (mustExitNode); - initMod = FALSE; - /*@-branchstate@*/ - } - /*@=branchstate@*/ -} - -static void exprNode_resetSref (/*@notnull@*/ exprNode e) -{ - e->sref = defref; -} - -static bool isFlagKey (char key) -{ - return (key == '-' || key == '+' || key == ' ' || key == '#'); -} - -static void exprNode_combineControl (/*@notnull@*/ exprNode ret, - /*@notnull@*/ exprNode ifclause, - /*@notnull@*/ exprNode elseclause) -{ - ret->canBreak = ifclause->canBreak || elseclause->canBreak; - - ret->mustBreak = - (ifclause->mustBreak || exprNode_mustEscape (ifclause)) - && (elseclause->mustBreak || exprNode_mustEscape (elseclause)); - - ret->exitCode = exitkind_combine (ifclause->exitCode, - elseclause->exitCode); - -} - -/* -** For exprNode's returned by exprNode_effect. -*/ - -static bool shallowKind (exprKind kind) -{ - return (kind == XPR_STRINGLITERAL - || kind == XPR_NUMLIT - || kind == XPR_EMPTY - || kind == XPR_BODY - || kind == XPR_NODE); -} - -static void -exprNode_freeIniter (/*@only@*/ exprNode e) -{ - if (!exprNode_isError (e)) - { - switch (e->kind) - { - case XPR_FACCESS: - sfree (e->edata->field); - sfree (e->edata); - break; - case XPR_FETCH: - exprNode_free (e->edata->op->b); - /*@-compdestroy@*/ sfree (e->edata->op); /*@=compdestroy@*/ - sfree (e->edata); - break; - default: - llbug (message ("other: %s", exprNode_unparse (e))); - } - - multiVal_free (e->val); - cstring_free (e->etext); - fileloc_free (e->loc); - sRefSet_free (e->uses); - sRefSet_free (e->sets); - sRefSet_free (e->msets); - guardSet_free (e->guards); - sfree (e); - } -} - -void -exprNode_freeShallow (/*@only@*/ exprNode e) -{ - if (!exprNode_isError (e)) - { - if (shallowKind (e->kind)) - { - } - else - { - if (!inEffect) - { - if (e->kind == XPR_EMPTY - || e->kind == XPR_BODY - || e->kind == XPR_STRINGLITERAL - || e->kind == XPR_NUMLIT - || e->kind == XPR_NODE - || e->kind == XPR_OFFSETOF - || e->kind == XPR_ALIGNOFT - || e->kind == XPR_ALIGNOF - || e->kind == XPR_SIZEOFT - || e->kind == XPR_SIZEOF) - { - /* don't free anything */ - } - else - { - /* multiVal_free (e->val); */ - cstring_free (e->etext); - fileloc_free (e->loc); - sRefSet_free (e->uses); - sRefSet_free (e->sets); - sRefSet_free (e->msets); - guardSet_free (e->guards); - exprData_freeShallow (e->edata, e->kind); - nowalloc--; - /*@-compdestroy@*/ sfree (e); /*@=compdestroy@*/ - /*@-branchstate@*/ - } - } - } /*@=branchstate@*/ - } - } - -void -exprNode_free (exprNode e) -{ - if (!exprNode_isError (e)) - { - if (!inEffect) - { - multiVal_free (e->val); - cstring_free (e->etext); - fileloc_free (e->loc); - sRefSet_free (e->uses); - sRefSet_free (e->sets); - sRefSet_free (e->msets); - guardSet_free (e->guards); - exprData_free (e->edata, e->kind); - - nowalloc--; - sfree (e); - /*@-branchstate@*/ - } /*@=branchstate@*/ - } -} - -exprNode -exprNode_makeError () -{ - return exprNode_undefined; -} - -static /*@out@*/ /*@only@*/ /*@notnull@*/ exprNode -exprNode_new (void) -{ - exprNode ret = (exprNode) dmalloc (sizeof (*ret)); - /* static int lastexpnodes = 0; */ - - nowalloc++; - totalloc++; - - if (nowalloc > maxalloc) - { - maxalloc = nowalloc; - } - - return ret; -} - -static /*@notnull@*/ /*@special@*/ exprNode - exprNode_createPlain (ctype c) - /*@defines result@*/ - /*@post:isnull result->edata, result->loc, result->val, result->guards, - result->uses, result->sets, result->msets, result->etext @*/ - /*@*/ -{ - exprNode e = exprNode_new (); - - e->typ = c; - e->kind = XPR_EMPTY; - e->val = multiVal_undefined; - e->sref = defref; - e->etext = cstring_undefined; - e->loc = fileloc_undefined; - e->guards = guardSet_undefined; - e->uses = sRefSet_undefined; - e->sets = sRefSet_undefined; - e->msets = sRefSet_undefined; - e->edata = exprData_undefined; - e->exitCode = XK_NEVERESCAPE; - e->canBreak = FALSE; - e->mustBreak = FALSE; - e->isJumpPoint = FALSE; - e->environment = environmentTable_undefined; - e->requiresConstraints = constraintList_new(); - e->ensuresConstraints = constraintList_new(); - - return (e); -} - -/*@observer@*/ exprNode exprNode_makeMustExit (void) -{ - if (exprNode_isUndefined (mustExitNode)) - { - mustExitNode = exprNode_createPlain (ctype_unknown); - mustExitNode->exitCode = XK_MUSTEXIT; - } - - return mustExitNode; -} - - -static /*@notnull@*/ /*@special@*/ exprNode exprNode_create (ctype c) - /*@defines result@*/ - /*@post:isnull result->edata, result->guards, result->val, - result->uses, result->sets, result->msets@*/ - /*@*/ -{ - exprNode e = exprNode_createPlain (c); - e->loc = fileloc_copy (g_currentloc); - return (e); -} - -static /*@notnull@*/ /*@special@*/ exprNode exprNode_createUnknown (void) - /*@defines result@*/ - /*@post:isnull result->edata, result->guards, - result->uses, result->sets, result->msets@*/ - /*@*/ -{ - return (exprNode_create (ctype_unknown)); -} - -static /*@notnull@*/ /*@special@*/ exprNode - exprNode_createLoc (ctype c, /*@keep@*/ fileloc loc) - /*@defines result@*/ - /*@post:isnull result->edata, result->guards, result->val, - result->uses, result->sets, result->msets@*/ - /*@*/ -{ - exprNode e = exprNode_createPlain (c); - e->loc = loc; - return (e); -} - -static void - exprNode_copySets (/*@special@*/ /*@notnull@*/ exprNode ret, exprNode e) - /*@defines ret->guards, ret->uses, ret->sets, ret->msets@*/ -{ - if (exprNode_isDefined (e)) - { - ret->guards = guardSet_copy (e->guards); - ret->uses = sRefSet_newCopy (e->uses); - ret->sets = sRefSet_newCopy (e->sets); - ret->msets = sRefSet_newCopy (e->msets); - } - else - { - ret->guards = guardSet_undefined; - ret->uses = sRefSet_undefined; - ret->sets = sRefSet_undefined; - ret->msets = sRefSet_undefined; - } -} - -static /*@notnull@*/ /*@special@*/ exprNode - exprNode_createPartialLocCopy (exprNode e, /*@only@*/ fileloc loc) - /*@defines result@*/ - /*@post:isnull result->edata, result->etext@*/ - /*@*/ -{ - exprNode ret = exprNode_new (); - - if (exprNode_isError (e)) - { - ret->typ = ctype_unknown; - ret->val = multiVal_undefined; - ret->loc = loc; - ret->guards = guardSet_undefined; - ret->uses = sRefSet_undefined; - ret->sets = sRefSet_undefined; - ret->msets = sRefSet_undefined; - } - else - { - ret->typ = e->typ; - ret->val = multiVal_copy (e->val); - ret->loc = loc; - ret->guards = guardSet_copy (e->guards); - ret->uses = sRefSet_newCopy (e->uses); - ret->sets = sRefSet_newCopy (e->sets); - ret->msets = sRefSet_newCopy (e->msets); - } - - ret->kind = XPR_EMPTY; - ret->sref = defref; - ret->etext = cstring_undefined; - ret->exitCode = XK_NEVERESCAPE; - ret->canBreak = FALSE; - ret->mustBreak = FALSE; - ret->isJumpPoint = FALSE; - ret->edata = exprData_undefined; - - return (ret); -} - - -static /*@notnull@*/ /*@special@*/ exprNode - exprNode_createPartialCopy (exprNode e) - /*@defines result@*/ - /*@post:isnull result->edata, result->etext@*/ - /*@*/ -{ - return (exprNode_createPartialLocCopy (e, fileloc_copy (exprNode_loc (e)))); -} - -static /*@notnull@*/ /*@special@*/ exprNode - exprNode_createPartialNVCopy (exprNode e) - /*@defines result@*/ - /*@post:isnull result->edata, result->etext, result->val @*/ - /*@*/ -{ - exprNode ret = exprNode_new (); - - if (exprNode_isError (e)) - { - ret->typ = ctype_unknown; - ret->loc = fileloc_undefined; - ret->guards = guardSet_undefined; - ret->uses = sRefSet_undefined; - ret->sets = sRefSet_undefined; - ret->msets = sRefSet_undefined; - } - else - { - ret->typ = e->typ; - ret->loc = fileloc_copy (e->loc); - ret->guards = guardSet_copy (e->guards); - ret->uses = sRefSet_newCopy (e->uses); - ret->sets = sRefSet_newCopy (e->sets); - ret->msets = sRefSet_newCopy (e->msets); - } - - ret->val = multiVal_undefined; - ret->kind = XPR_EMPTY; - ret->sref = defref; - ret->etext = cstring_undefined; - ret->exitCode = XK_NEVERESCAPE; - ret->canBreak = FALSE; - ret->mustBreak = FALSE; - ret->isJumpPoint = FALSE; - ret->edata = exprData_undefined; - - return (ret); -} - -static /*@notnull@*/ /*@special@*/ exprNode - exprNode_createSemiCopy (exprNode e) - /*@defines result@*/ - /*@post:isnull result->edata, result->etext, result->sets, - result->msets, result->uses, result->guards@*/ - /*@*/ -{ - if (exprNode_isError (e)) - { - return exprNode_createPlain (ctype_unknown); - } - else - { - exprNode ret = exprNode_new (); - - ret->typ = e->typ; - ret->val = multiVal_copy (e->val); - ret->loc = fileloc_copy (e->loc); - ret->guards = guardSet_undefined; - ret->uses = sRefSet_undefined; - ret->sets = sRefSet_undefined; - ret->msets = sRefSet_undefined; - - ret->kind = XPR_EMPTY; - ret->sref = defref; - ret->etext = cstring_undefined; - ret->exitCode = XK_NEVERESCAPE; - ret->canBreak = FALSE; - ret->mustBreak = FALSE; - ret->isJumpPoint = FALSE; - ret->edata = exprData_undefined; - - return (ret); - } -} - -bool -exprNode_isNullValue (exprNode e) -{ - if (exprNode_isDefined (e)) - { - multiVal m = exprNode_getValue (e); - - if (multiVal_isInt (m)) - { - return (multiVal_forceInt (m) == 0); - } - } - - return FALSE; -} - -static bool -exprNode_isUnknownConstant (/*@notnull@*/ exprNode e) -{ - while (e->kind == XPR_PARENS) - { - e = exprData_getUopNode (e->edata); - llassert (exprNode_isDefined (e)); - } - - if (e->kind == XPR_CONST) - { - multiVal m = exprNode_getValue (e); - - if (multiVal_isUnknown (m)) - { - return TRUE; - } - } - - return FALSE; -} - -/*@only@*/ exprNode - exprNode_numLiteral (ctype c, /*@temp@*/ cstring t, - /*@only@*/ fileloc loc, long val) -{ - exprNode e = exprNode_createLoc (c, loc); - - e->kind = XPR_NUMLIT; - - llassert (multiVal_isUndefined (e->val)); - e->val = multiVal_makeInt (val); - e->edata = exprData_makeLiteral (cstring_copy (t)); - - if (val == 0) - { - e->sref = sRef_makeUnknown (); - sRef_setDefNull (e->sref, e->loc); - } - - DPRINTF (("Num lit: %s / %s", exprNode_unparse (e), ctype_unparse (exprNode_getType (e)))); - return (e); -} - -/*@only@*/ exprNode -exprNode_charLiteral (char c, cstring text, /*@only@*/ fileloc loc) -{ - exprNode e = exprNode_createLoc (ctype_char, loc); - - if (context_getFlag (FLG_CHARINTLITERAL)) - { - e->typ = ctype_makeConj (ctype_char, ctype_int); - } - - e->kind = XPR_NUMLIT; - e->val = multiVal_makeChar (c); - - e->edata = exprData_makeLiteral (cstring_copy (text)); - return (e); -} - -/*@only@*/ exprNode -exprNode_floatLiteral (double d, ctype ct, cstring text, /*@only@*/ fileloc loc) -{ - exprNode e = exprNode_createLoc (ct, loc); - - e->kind = XPR_NUMLIT; - e->val = multiVal_makeDouble (d); - e->edata = exprData_makeLiteral (cstring_copy (text)); - return (e); -} - -multiVal exprNode_getValue (exprNode e) -{ - while (exprNode_isInParens (e)) { - if (e->edata != NULL) { - e = exprData_getUopNode (e->edata); - } else { - break; - } - } - - if (exprNode_isDefined (e)) { - return e->val; - } else { - return multiVal_undefined; - } -} - -/*@only@*/ exprNode -exprNode_stringLiteral (/*@only@*/ cstring t, /*@only@*/ fileloc loc) -{ - exprNode e = exprNode_createLoc (ctype_string, loc); - int len = cstring_length (t) - 2; - char *ts = cstring_toCharsSafe (t); - char *s = cstring_toCharsSafe (cstring_create (len + 1)); - - if (context_getFlag (FLG_STRINGLITERALLEN)) - { - if (len > context_getValue (FLG_STRINGLITERALLEN)) - { - voptgenerror (FLG_STRINGLITERALLEN, - message - ("String literal length (%d) exceeds maximum " - "length (%d): %s", - len, - context_getValue (FLG_STRINGLITERALLEN), - t), - e->loc); - } - } - - strncpy (s, ts+1, size_fromInt (len)); - *(s + len) = '\0'; - - - e->kind = XPR_STRINGLITERAL; - e->val = multiVal_makeString (cstring_fromCharsO (s)); - e->edata = exprData_makeLiteral (t); - e->sref = sRef_makeType (ctype_string); - /* Start modifications */ - /* This expr is null terminated, so we set the len and size */ - sRef_setNullTerminatedState(e->sref); - /* - TPRINTF("Len is set to : %d\n\n", strlen((char *)multiVal_forceString(e->val))); - TPRINTF("Size is set to : %d\n\n", strlen((char *)multiVal_forceString(e->val))); - TPRINTF("State is set to: %d\n\n", e->sref->bufinfo.bufstate); - */ - sRef_setLen(e->sref, strlen((char *)multiVal_forceString(e->val))); - sRef_setSize(e->sref, strlen((char *)multiVal_forceString(e->val))); - - if (context_getFlag (FLG_READONLYSTRINGS)) - { - sRef_setAliasKind (e->sref, AK_STATIC, fileloc_undefined); - sRef_setExKind (e->sref, XO_OBSERVER, loc); - } - else - { - sRef_setAliasKind (e->sref, AK_ERROR, fileloc_undefined); - } - - return (e); /* s released */ -} - -exprNode exprNode_fromUIO (cstring c) -{ - fileloc loc = context_getSaveLocation (); - exprNode e = exprNode_createPlain (ctype_unknown); - - e->kind = XPR_VAR; - - if (fileloc_isUndefined (loc)) - { - loc = fileloc_copy (g_currentloc); - } - - e->loc = loc; /* save loc was mangled */ - e->sref = defref; - - if (usymtab_exists (c)) - { - uentry ue = usymtab_lookupEither (c); - - if (uentry_isDatatype (ue) - && uentry_isSpecified (ue)) - { - llfatalerror - (message ("%q: Specified datatype %s used in code, but not defined. " - "(Cannot continue reasonably from this error.)", - fileloc_unparse (e->loc), c)); - } - else - { - BADBRANCH; - } - } - - llassertprint (!usymtab_exists (c), ("Entry exists: %s", c)); - - /* - ** was supercedeGlobalEntry...is this better? - */ - - if (!context_inIterEnd ()) - { - if (context_inMacro ()) - { - if (context_getFlag (FLG_UNRECOG)) - { - voptgenerror - (FLG_MACROUNDEF, - message ("Unrecognized identifier in macro definition: %s", c), e->loc); - } - else - { - flagcode_recordSuppressed (FLG_UNRECOG); - } - } - else - { - voptgenerror - (FLG_UNRECOG, message ("Unrecognized identifier: %s", c), - e->loc); - } - } - - e->edata = exprData_makeId (uentry_makeUnrecognized (c, fileloc_copy (loc))); - - /* No alias errors for unrecognized identifiers */ - sRef_setAliasKind (e->sref, AK_ERROR, loc); - - return (e); -} - -exprNode exprNode_createId (/*@observer@*/ uentry c) -{ - if (uentry_isValid (c)) - { - exprNode e = exprNode_new (); - - e->typ = uentry_getType (c); - - if (uentry_isFunction (c) - && !sRef_isLocalVar (uentry_getSref (c))) - { - e->sref = sRef_undefined; - } - else - { - e->sref = uentry_getSref (c); - } - - if (sRef_isStateUnknown (e->sref) && uentry_isNonLocal (c)) - { - sRef_setDefined (e->sref, fileloc_undefined); - } - - /* - ** yoikes! leaving this out was a heinous bug...that would have been - ** caught if i had lclint working first. gag! - */ - - e->etext = cstring_undefined; - - if (uentry_isEitherConstant (c)) - { - e->kind = XPR_CONST; - e->val = multiVal_copy (uentry_getConstantValue (c)); - } - else - { - e->kind = XPR_VAR; - e->val = multiVal_unknown (); - } - - e->edata = exprData_makeId (c); - e->loc = context_getSaveLocation (); - - if (fileloc_isUndefined (e->loc)) - { - fileloc_free (e->loc); - e->loc = fileloc_copy (g_currentloc); - } - - e->guards = guardSet_new (); - e->sets = sRefSet_new (); - e->msets = sRefSet_new (); - e->uses = sRefSet_new (); - - /*> missing fields, detected by lclint <*/ - e->exitCode = XK_NEVERESCAPE; - e->isJumpPoint = FALSE; - e->canBreak = FALSE; - e->mustBreak = FALSE; - - return e; - } - else - { - return exprNode_createUnknown (); - } -} - -/*@notnull@*/ exprNode -exprNode_fromIdentifier (/*@observer@*/ uentry c) -{ - exprNode ret; - - if (context_justPopped ()) /* watch out! c could be dead */ - { - uentry ce = usymtab_lookupSafe (LastIdentifier ()); - - if (uentry_isValid (ce)) - { - c = ce; - } - else - { - llbuglit ("Looks like Aunt Millie forgot to walk to dog again."); - } - } - - ret = exprNode_fromIdentifierAux (c); - - return ret; -} - - -static /*@only@*/ /*@notnull@*/ exprNode -exprNode_fromIdentifierAux (/*@observer@*/ uentry c) -{ - exprNode e = exprNode_createId (c); - sRef sr = e->sref; - - uentry_setUsed (c, e->loc); - - if (uentry_isVar (c) && sRef_isGlobal (sr)) - { - checkGlobUse (c, FALSE, e); - } - - return (e); -} - -static bool -exprNode_isZero (exprNode e) -{ - if (exprNode_isDefined (e)) - { - multiVal m = exprNode_getValue (e); - - if (multiVal_isInt (m)) - { - return (multiVal_forceInt (m) == 0); - } - } - - return FALSE; -} - -static bool -exprNode_isNonNegative (exprNode e) -{ - if (exprNode_isDefined (e)) - { - multiVal m = exprNode_getValue (e); - - if (multiVal_isInt (m)) - { - return (multiVal_forceInt (m) >= 0); - } - } - - return FALSE; -} - -/* -** a[x] - uses a but NOT a[] -** result sref = a[] (set/use in assignment) -** -** The syntax x[a] is also legal in C, and has the same -** semantics. If ind is an array, and arr is an int, flip -** the arguments. -*/ - -/*@only@*/ exprNode -exprNode_arrayFetch (/*@only@*/ exprNode e1, /*@only@*/ exprNode e2) -{ - /* - ** error in arr, error propagates (no new messages) - ** error in ind, assume valid and continue - */ - - if (exprNode_isError (e1)) - { - exprNode_free (e2); - return (exprNode_makeError ()); - } - else - { - exprNode arr; - exprNode ind; - ctype carr = exprNode_getType (e1); - ctype crarr = ctype_realType (carr); - - /* - ** this sets up funny aliasing, that leads to spurious - ** lclint errors. Hence, the i2 comments. - */ - - if (!ctype_isRealArray (crarr) - && ctype_isRealNumeric (crarr) - && !exprNode_isError (e2) - && ctype_isRealAP (exprNode_getType (e2))) /* fetch like 3[a] */ - { - arr = e2; - ind = e1; - - carr = exprNode_getType (arr); - crarr = ctype_realType (carr); - } - else - { - arr = e1; - ind = e2; - } - - if (sRef_possiblyNull (arr->sref)) - { - if (!usymtab_isGuarded (arr->sref)) - { - if (optgenerror (FLG_NULLDEREF, - message ("Index of %s pointer %q: %s", - sRef_nullMessage (arr->sref), - sRef_unparse (arr->sref), - exprNode_unparse (arr)), - arr->loc)) - { - sRef_showNullInfo (arr->sref); - - /* suppress future messages */ - sRef_setNullError (arr->sref); - } - } - } - - if (exprNode_isError (ind)) - { - if ((ctype_isArrayPtr (crarr) - && !ctype_isFunction (crarr)) - || ctype_isUnknown (carr)) - { - exprNode ret = exprNode_createPartialCopy (arr); - - if (ctype_isKnown (carr)) - { - ret->typ = ctype_baseArrayPtr (crarr); - } - else - { - ret->typ = ctype_unknown; - } - - ret->sref = sRef_makeArrayFetch (arr->sref); - - ret->kind = XPR_FETCH; - - /* - ** Because of funny aliasing (when arr and ind are - ** flipped) spurious errors would be reported here. - */ - - /*@i2@*/ ret->edata = exprData_makePair (arr, ind); - checkSafeUse (ret, arr->sref); - return (ret); - } - else - { - voptgenerror (FLG_TYPE, - message ("Array fetch from non-array (%t): %s[%s]", carr, - exprNode_unparse (e1), exprNode_unparse (e2)), - arr->loc); - exprNode_free (arr); - return (exprNode_makeError ()); - } - } - else - { - if (!ctype_isForceRealInt (&(ind->typ))) - { - ctype rt = ctype_realType (ind->typ); - - if (ctype_isChar (rt)) - { - vnoptgenerror - (FLG_CHARINDEX, - message ("Array fetch using non-integer, %t: %s[%s]", - ind->typ, - exprNode_unparse (e1), exprNode_unparse (e2)), - arr->loc); - } - else if (ctype_isEnum (rt)) - { - vnoptgenerror - (FLG_ENUMINDEX, - message ("Array fetch using non-integer, %t: %s[%s]", - ind->typ, - exprNode_unparse (e1), exprNode_unparse (e2)), - arr->loc); - } - else - { - voptgenerror - (FLG_TYPE, - message ("Array fetch using non-integer, %t: %s[%s]", - ind->typ, - exprNode_unparse (e1), exprNode_unparse (e2)), - arr->loc); - } - - multiVal_free (ind->val); - ind->val = multiVal_unknown (); - } - - if (ctype_isArrayPtr (crarr) && !ctype_isFunction (crarr)) - { - exprNode ret = exprNode_createSemiCopy (arr); - multiVal m = exprNode_getValue (ind); - - ret->typ = ctype_baseArrayPtr (crarr); - ret->kind = XPR_FETCH; - - if (multiVal_isInt (m)) - { - int i = (int) multiVal_forceInt (m); - - if (sRef_isValid (arr->sref)) { - ret->sref = sRef_makeArrayFetchKnown (arr->sref, i); - } else { - ret->sref = sRef_undefined; - } - } - else - { - ret->sref = sRef_makeArrayFetch (arr->sref); - } - - ret->sets = sRefSet_realNewUnion (arr->sets, ind->sets); - ret->msets = sRefSet_realNewUnion (arr->msets, ind->msets); - ret->uses = sRefSet_realNewUnion (arr->uses, ind->uses); - - /* (see comment on spurious errors above) */ - /*@i2@*/ ret->edata = exprData_makePair (arr, ind); - - exprNode_checkUse (ret, ind->sref, ind->loc); - exprNode_checkUse (ret, arr->sref, arr->loc); - - return (ret); - } - else - { - if (ctype_isUnknown (carr)) - { - exprNode ret = exprNode_createPartialCopy (arr); - - ret->kind = XPR_FETCH; - ret->typ = ctype_unknown; - ret->sets = sRefSet_union (ret->sets, ind->sets); - ret->msets = sRefSet_union (ret->msets, ind->msets); - ret->uses = sRefSet_union (ret->uses, ind->uses); - - /* (see comment on spurious errors above) */ - /*@i2@*/ ret->edata = exprData_makePair (arr, ind); - - exprNode_checkUse (ret, ind->sref, ind->loc); - exprNode_checkUse (ret, arr->sref, arr->loc); - return (ret); - } - else - { - voptgenerror - (FLG_TYPE, - message ("Array fetch from non-array (%t): %s[%s]", carr, - exprNode_unparse (e1), exprNode_unparse (e2)), - arr->loc); - - exprNode_free (arr); - exprNode_free (ind); - - return (exprNode_makeError ()); - } - } - } - } - BADEXIT; -} - - -static int -checkArgs (uentry fcn, /*@dependent@*/ exprNode f, ctype t, - exprNodeList args, exprNode ret) -{ - return (checkArgsReal (fcn, f, ctype_argsFunction (t), args, FALSE, ret)); -} - -/* -** checkPrintfArgs --- checks arguments for printf-like functions -** Arguments before ... have already been checked. -** The argument before the ... is a char *. -** argno is the format string argument. -*/ - -static void -checkPrintfArgs (/*@notnull@*/ /*@dependent@*/ exprNode f, uentry fcn, - exprNodeList args, exprNode ret, int argno) -{ - /* - ** the last argument before the elips is the format string - */ - - int i = argno; - fileloc formatloc; - int nargs = exprNodeList_size (args); - uentryList params = uentry_getParams (fcn); - exprNode a; - - /* - ** These should be ensured by checkSpecialFunction - */ - - llassert (uentryList_size (params) == argno + 1); - llassert (uentry_isElipsisMarker (uentryList_getN (params, argno))); - - a = exprNodeList_getN (args, argno - 1); - formatloc = fileloc_copy (exprNode_loc (a)); - - if (exprNode_isDefined (a) && exprNode_isStringLiteral (a) - && exprNode_knownStringValue (a)) - { - char *format = cstring_toCharsSafe (multiVal_forceString (exprNode_getValue (a))); - char *code = format; - char *ocode = code; - - nargs = exprNodeList_size (args); - - while ((code = strchr (code, '%')) != NULL) - { - char *origcode = code; - char key = *(++code); - ctype modtype = ctype_int; - bool modified = FALSE; - - fileloc_addColumn (formatloc, code - ocode); - - /* ignore flags */ - while (isFlagKey (key)) - { - key = *(++code); - fileloc_incColumn (formatloc); - } - - if (key == 'm') /* skipped in syslog */ - { - continue; - } - - /* ignore field width */ - while (isdigit ((int) key) != 0) - { - key = *(++code); - fileloc_incColumn (formatloc); - } - - /* ignore precision */ - if (key == '.') - { - key = *(++code); - fileloc_incColumn (formatloc); - - /* - ** In printf, '*' means: read the next arg as an int for the - ** field width. This seems to be missing from my copy of the - ** standard x3.159-1989. Setion 4.9.6.1 refers to * (described - ** later) but never does. - */ - - if (key == '*') - { - ; /* don't do anything --- handle later */ - } - else - { - while (isdigit ((int) key) != 0) - { - key = *(++code); - fileloc_incColumn (formatloc); - } - } - } - - if (key == 'h') - { - modtype = ctype_sint; /* short */ - key = *(++code); - fileloc_incColumn (formatloc); - } - else if (key == 'l' || key == 'L') - { - modtype = ctype_lint; /* long */ - key = *(++code); - fileloc_incColumn (formatloc); - - if (key == 'l' || key == 'L') { - modtype = ctype_llint; /* long long */ - key = *(++code); - fileloc_incColumn (formatloc); - } - } - else - { - ; /* no modifier */ - } - - /* now, key = type of conversion to apply */ - ++code; - fileloc_incColumn (formatloc); - - if (key != '%') - { - if (i >= nargs) - { - if (optgenerror - (FLG_TYPE, - message ("No argument corresponding to %q format " - "code %d (%%%h): \"%s\"", - uentry_getName (fcn), - i, key, - cstring_fromChars (format)), - f->loc)) - { - if (fileloc_isDefined (formatloc) - && context_getFlag (FLG_SHOWCOL)) - { - llgenindentmsg (cstring_makeLiteral ("Corresponding format code"), - formatloc); - } - } - i++; - } - else - { - a = exprNodeList_getN (args, i); - i++; - - if (!exprNode_isError (a)) - { - ctype expecttype; - - switch (key) - { - case '*': /* int argument for fieldwidth */ - expecttype = ctype_int; - *(--code) = '%'; /* convert it for next code */ - fileloc_subColumn (formatloc, 1); - /*@switchbreak@*/ break; - case 'u': - case 'o': - expecttype = ctype_combine (ctype_uint, modtype); - /*@switchbreak@*/ break; - - case 'i': /* int argument */ - case 'd': - expecttype = ctype_combine (ctype_int, modtype); - /*@switchbreak@*/ break; - - case 'x': /* unsigned int */ - case 'X': - expecttype = ctype_combine (ctype_uint, modtype); - /*@switchbreak@*/ break; - - case 'e': - case 'E': - case 'g': - case 'G': - case 'f': /* double */ - expecttype = ctype_combine (ctype_double, modtype); - /*@switchbreak@*/ break; - - case 'c': /* int converted to char (check its a char?) */ - expecttype = ctype_makeConj (ctype_char, ctype_uchar); - /*@switchbreak@*/ break; - - case 's': /* string */ - expecttype = ctype_string; - /*@switchbreak@*/ break; - case '[': - /* skip to ']' */ - while (((key = *(++code)) != ']') - && (key != '\0')) - { - fileloc_incColumn (formatloc); - } - - if (key == '\0') - { - llfatalerrorLoc - (message ("Bad character set format: %s", - cstring_fromChars (origcode))); - } - - expecttype = ctype_string; - /*@switchbreak@*/ break; - - case 'p': /* pointer */ - expecttype = ctype_makePointer (ctype_void); - /* really! */ - /*@switchbreak@*/ break; - - case 'n': /* pointer to int, modified by call! */ - expecttype = ctype_combine (ctype_makePointer (ctype_int), modtype); - modified = TRUE; - uentry_setDefState (regArg, SS_ALLOCATED); /* corresponds to out */ - /*@switchbreak@*/ break; - - case 'm': /* in a syslog, it doesn't consume an argument */ - /* should check we're really doing syslog */ - - /*@switchbreak@*/ break; - - - default: - expecttype = ctype_unknown; - - voptgenerror - (FLG_FORMATCODE, - message ("Unrecognized format code: %s", - cstring_fromChars (origcode)), - fileloc_isDefined (formatloc) - ? formatloc : g_currentloc); - - /*@switchbreak@*/ break; - } - - if (!(exprNode_matchArgType (expecttype, a))) - { - if (ctype_isVoidPointer (expecttype) - && ctype_isRealAbstract (a->typ) - && (context_getFlag (FLG_ABSTVOIDP))) - { - ; - } - else - { - if (llgenformattypeerror - (expecttype, exprNode_undefined, - a->typ, a, - message ("Format argument %d to %q (%%%h) expects " - "%t gets %t: %s", - i - argno, - uentry_getName (fcn), - key, expecttype, - a->typ, exprNode_unparse (a)), - a->loc)) - { - if (fileloc_isDefined (formatloc) - && context_getFlag (FLG_SHOWCOL)) - { - llgenindentmsg - (cstring_makeLiteral - ("Corresponding format code"), - formatloc); - } - } - } - } - - uentry_setType (regArg, expecttype); - checkOneArg (regArg, a, f, FALSE, i+1, nargs); - - if (ctype_equal (expecttype, ctype_string)) - { - exprNode_checkUse (a, sRef_makePointer (a->sref), a->loc); - } - - uentry_setType (regArg, ctype_unknown); - uentry_fixupSref (regArg); - - if (modified) - { - exprNode_checkCallModifyVal (a->sref, args, f, ret); - } - } - else - { - ; - } - } - } - ocode = code; - } - - if (i < nargs) - { - voptgenerror (FLG_TYPE, - message ("Format string for %q has %d arg%p, given %d", - uentry_getName (fcn), i - argno, nargs - argno), - f->loc); - } - } - else - { - /* no checking possible for compile-time unknown format strings */ - } - - fileloc_free (formatloc); -} - -static void -checkScanfArgs (/*@notnull@*/ /*@dependent@*/ exprNode f, uentry fcn, - exprNodeList args, exprNode ret, int argno) -{ - int i = argno; - fileloc formatloc; - int nargs = exprNodeList_size (args); - uentryList params = uentry_getParams (fcn); - exprNode a; - - /* - ** These should be ensured by checkSpecialFunction - */ - - llassert (uentryList_size (params) == argno + 1); - llassert (uentry_isElipsisMarker (uentryList_getN (params, argno))); - - a = exprNodeList_getN (args, argno - 1); - formatloc = fileloc_copy (exprNode_loc (a)); - - if (exprNode_isDefined (a) && exprNode_isStringLiteral (a) - && exprNode_knownStringValue (a)) - { - char *format = cstring_toCharsSafe (multiVal_forceString (exprNode_getValue (a))); - char *code = format; - char *ocode = code; - - nargs = exprNodeList_size (args); - - while ((code = strchr (code, '%')) != NULL) - { - char *origcode = code; - char key = *(++code); - ctype modtype = ctype_int; - char modifier = '\0'; - bool modified = TRUE; - bool ignore = FALSE; - - fileloc_addColumn (formatloc, code - ocode); - - /* - ** this is based on ANSI standard library description of fscanf - ** (from ANSI standard X3.159-1989, 4.9.6.1) - */ - - /* '*' suppresses assignment (does not need match argument) */ - - if (key == '*') - { - key = *(++code); - modified = FALSE; - ignore = TRUE; - fileloc_incColumn (formatloc); - } - - /* ignore field width */ - while (isdigit ((int) key) != 0) - { - key = *(++code); - fileloc_incColumn (formatloc); - } - - if (key == 'h') - { - modtype = ctype_sint; /* short */ - key = *(++code); - fileloc_incColumn (formatloc); - } - else if (key == 'l' || key == 'L') - { - modtype = ctype_lint; /* long */ - modifier = key; - - key = *(++code); - fileloc_incColumn (formatloc); - - if (key == 'l' || key == 'L') { - modtype = ctype_llint; /* long long */ - key = *(++code); - fileloc_incColumn (formatloc); - } - } - else - { - ; /* no modifier */ - } - - /* now, key = type of conversion to apply */ - ++code; - fileloc_incColumn (formatloc); - - if (key != '%') - { - if (ignore) - { - ; - } - else - { - if (i >= nargs) - { - if (optgenerror - (FLG_TYPE, - message ("No argument corresponding to %q format " - "code %d (%%%h): \"%s\"", - uentry_getName (fcn), - i, key, - cstring_fromChars (format)), - f->loc)) - { - if (fileloc_isDefined (formatloc) - && context_getFlag (FLG_SHOWCOL)) - { - llgenindentmsg - (cstring_makeLiteral ("Corresponding format code"), - formatloc); - } - } - i++; - } - else - { - a = exprNodeList_getN (args, i); - i++; - - if (!exprNode_isError (a)) - { - ctype expecttype; - - switch (key) - { - case '*': /* int argument for fieldwidth */ - expecttype = ctype_makePointer (ctype_int); - *(--code) = '%'; /* convert it for next code */ - fileloc_subColumn (formatloc, 1); - /*@switchbreak@*/ break; - case 'u': - case 'o': - expecttype = ctype_makePointer (ctype_combine (ctype_uint, modtype)); - /*@switchbreak@*/ break; - - case 'i': - case 'd': - case 'x': - case 'X': /* unsigned int */ - expecttype = ctype_makePointer (ctype_combine (ctype_int, modtype)); - /*@switchbreak@*/ break; - - case 'e': - case 'E': - case 'g': - case 'G': - case 'f': - /* printf is double, scanf is float! */ - - if (modifier == 'l') - { - expecttype = ctype_makePointer (ctype_double); - } - else if (modifier == 'L') - { - expecttype = ctype_makePointer (ctype_ldouble); - } - else - { - llassert (modifier == '\0'); - expecttype = ctype_makePointer (ctype_float); - } - /*@switchbreak@*/ break; - - case 'c': /* int converted to char (check its a char?) */ - expecttype = ctype_makePointer (ctype_makeConj (ctype_char, ctype_uchar)); - /*@switchbreak@*/ break; - - case 's': /* string */ - expecttype = ctype_string; - /*@switchbreak@*/ break; - - case '[': - /* skip to ']' */ - while (((key = *(++code)) != ']') - && (key != '\0')) - { - fileloc_incColumn (formatloc); - } - - if (key == '\0') - { - llfatalerrorLoc - (message ("Bad character set format: %s", - cstring_fromChars (origcode))); - } - - expecttype = ctype_string; - /*@switchbreak@*/ break; - - case 'p': /* pointer */ - expecttype = ctype_unknown; - /* really! */ - /*@switchbreak@*/ break; - - case 'n': /* pointer to int, modified by call! */ - expecttype = ctype_makePointer (ctype_int); - /*@switchbreak@*/ break; - - default: - expecttype = ctype_unknown; - - voptgenerror - (FLG_FORMATCODE, - message ("Unrecognized format code: %s", - cstring_fromChars (origcode)), - fileloc_isDefined (formatloc) - ? formatloc : g_currentloc); - - /*@switchbreak@*/ break; - } - - if (!(exprNode_matchArgType (expecttype, a))) - { - if (ctype_isVoidPointer (expecttype) - && ctype_isRealAbstract (a->typ) - && (context_getFlag (FLG_ABSTVOIDP))) - { - ; - } - else - { - if (modifier != '\0') - { - if (llgenformattypeerror - (expecttype, exprNode_undefined, - a->typ, a, - message ("Format argument %d to %q (%%%h%h) expects " - "%t gets %t: %s", - i - argno, - uentry_getName (fcn), - modifier, - key, expecttype, - a->typ, exprNode_unparse (a)), - a->loc)) - { - if (fileloc_isDefined (formatloc) - && context_getFlag (FLG_SHOWCOL)) - { - llgenindentmsg - (cstring_makeLiteral - ("Corresponding format code"), - formatloc); - } - } - - } - else - { - if (llgenformattypeerror - (expecttype, exprNode_undefined, - a->typ, a, - message ("Format argument %d to %q (%%%h) expects " - "%t gets %t: %s", - i - argno, - uentry_getName (fcn), - key, expecttype, - a->typ, exprNode_unparse (a)), - a->loc)) - { - if (fileloc_isDefined (formatloc) - && context_getFlag (FLG_SHOWCOL)) - { - llgenindentmsg - (cstring_makeLiteral - ("Corresponding format code"), - formatloc); - } - } - } - } - } - - uentry_setType (outArg, expecttype); - checkOneArg (outArg, a, f, FALSE, i+1, nargs); - uentry_setType (outArg, ctype_unknown); - uentry_fixupSref (outArg); - - if (modified) - { - exprNode_checkCallModifyVal (a->sref, args, f, ret); - } - } - else - { - /* a->sref = defref; */ - } - } - } - } - ocode = code; - } - - if (i < nargs) - { - voptgenerror (FLG_TYPE, - message ("Format string for %q has %d arg%p, given %d", - uentry_getName (fcn), i - argno, nargs - argno), - f->loc); - } - } - else - { - /* no checking possible for compile-time unknown format strings */ - } - - fileloc_free (formatloc); -} - -static void -checkMessageArgs (/*@notnull@*/ /*@dependent@*/ exprNode f, - uentry fcn, - exprNodeList args, - /*@unused@*/ int argno) -{ - /* - ** the last argument before the elips is the format string - */ - - int nargs = exprNodeList_size (args); - int i = argno; - fileloc formatloc; - exprNode a; - - a = exprNodeList_getN (args, argno - 1); - formatloc = fileloc_copy (exprNode_loc (a)); - - if (ctype_isUnknown (cstringType)) { - if (usymtab_existsType (cstring_makeLiteralTemp ("cstring"))) - { - cstringType = usymtab_lookupAbstractType (cstring_makeLiteralTemp ("cstring")); - } - } - - if (ctype_isUnknown (ctypeType)) { - if (usymtab_existsType (cstring_makeLiteralTemp ("ctype"))) - { - ctypeType = usymtab_lookupAbstractType (cstring_makeLiteralTemp ("ctype")); - } - } - - if (ctype_isUnknown (filelocType)) { - if (usymtab_existsType (cstring_makeLiteralTemp ("fileloc"))) - { - filelocType = usymtab_lookupAbstractType (cstring_makeLiteralTemp ("fileloc")); - } - } - - if (exprNode_isDefined (a) && exprNode_isStringLiteral (a) - && exprNode_knownStringValue (a)) - { - cstring format = multiVal_forceString (exprNode_getValue (a)); - char *code = cstring_toCharsSafe (format); - char *ocode = code; - - nargs = exprNodeList_size (args); - - while ((code = strchr (code, '%')) != NULL) - { - char *origcode = code; - char key = *(++code); - bool isOnly = FALSE; - - fileloc_addColumn (formatloc, code - ocode); - - while (key >= '0' && key <= '9') - { - key = *(++code); - fileloc_incColumn (formatloc); - } - - ++code; - fileloc_incColumn (formatloc); - - if (key != '%') - { - if (key == 'p') - { - goto nextKey; - } - - if (i >= nargs) - { - voptgenerror - (FLG_TYPE, - message ("Message missing format arg %d (%%%h): \"%s\"", - i + 1, key, format), - f->loc); - i++; - } - else - { - a = exprNodeList_getN (args, i); - i++; - - nextKey: - if (!exprNode_isError (a)) - { - ctype expecttype; - - /*@-loopswitchbreak@*/ - - switch (key) - { - case 'c': - case 'h': - expecttype = ctype_char; break; - case 's': - expecttype = cstringType; break; - case 'q': - expecttype = cstringType; isOnly = TRUE; break; - case 'x': - expecttype = cstringType; isOnly = TRUE; break; - case 'd': expecttype = ctype_int; break; - case 'u': expecttype = ctype_uint; break; - case 'w': expecttype = ctype_ulint; break; - case 'f': expecttype = ctype_float; break; - case 'b': expecttype = ctype_bool; break; - case 't': expecttype = ctypeType; break; - case 'l': expecttype = filelocType; break; - case 'p': /* a wee bit of a hack methinks */ - expecttype = ctype_int; - break; - case 'r': expecttype = ctype_bool; break; - default: - expecttype = ctype_unknown; - voptgenerror - (FLG_FORMATCODE, - message ("Unrecognized format code: %s", - cstring_fromChars (origcode)), - fileloc_isDefined (formatloc) - ? formatloc : g_currentloc); - break; - } - /*@=loopswitchbreak@*/ - - if (!(exprNode_matchArgType (expecttype, a))) - { - if (ctype_isVoidPointer (expecttype) - && ctype_isRealAbstract (a->typ) - && (context_getFlag (FLG_ABSTVOIDP))) - { - ; - } - else - { - if (llgenformattypeerror - (expecttype, exprNode_undefined, - a->typ, a, - message ("Format argument %d to %q (%%%h) expects " - "%t gets %t: %s", - i - argno, - uentry_getName (fcn), - key, expecttype, - a->typ, exprNode_unparse (a)), - a->loc)) - { - if (fileloc_isDefined (formatloc) - && context_getFlag (FLG_SHOWCOL)) - { - llgenindentmsg - (cstring_makeLiteral - ("Corresponding format code"), - formatloc); - } - } - } - } - - if (ctype_equal (expecttype, cstringType)) - { - if (isOnly) - { - checkOneArg (csOnlyArg, a, f, FALSE, i+1, nargs); - uentry_fixupSref (csOnlyArg); - } - else - { - checkOneArg (csArg, a, f, FALSE, i+1, nargs); - uentry_fixupSref (csArg); - } - } - else - { - checkOneArg (regArg, a, f, FALSE, i+1, nargs); - uentry_fixupSref (regArg); - } - } - } - } - } - - if (i < nargs) - { - voptgenerror (FLG_TYPE, - message ("Format string for %q has %d arg%p, given %d", - uentry_getName (fcn), i - argno, nargs -argno), - f->loc); - } - } - else - { - /* no checking possible for compile-time unknown format strings */ - } - - fileloc_free (formatloc); -} - -static void - checkExpressionDefinedAux (/*@notnull@*/ exprNode e1, - /*@notnull@*/ exprNode e2, - sRefSet sets1, - sRefSet sets2, - lltok op, - flagcode flag) -{ - bool hadUncon = FALSE; - - if (sRef_isGlobal (sRef_getRootBase (e1->sref)) && - sRefSet_hasUnconstrained (sets2)) - { - voptgenerror - (FLG_EVALORDERUNCON, - message - ("Expression may have undefined behavior (%q used in right operand " - "may set global variable %q used in left operand): %s %s %s", - sRefSet_unparseUnconstrained (sets2), - sRef_unparse (sRef_getRootBase (e1->sref)), - exprNode_unparse (e1), lltok_unparse (op), exprNode_unparse (e2)), - e2->loc); - } - - if (sRef_isGlobal (sRef_getRootBase (e2->sref)) && - sRefSet_hasUnconstrained (sets1)) - { - voptgenerror - (FLG_EVALORDERUNCON, - message - ("Expression has undefined behavior (%q used in left operand " - "may set global variable %q used in right operand): %s %s %s", - sRefSet_unparseUnconstrained (sets1), - sRef_unparse (e2->sref), - exprNode_unparse (e1), lltok_unparse (op), exprNode_unparse (e2)), - e2->loc); - } - - sRefSet_realElements (e1->uses, sr) - { - if (sRef_isMeaningful (sr) && sRefSet_member (sets2, sr)) - { - voptgenerror - (FLG_EVALORDER, - message - ("Expression has undefined behavior (left operand uses %q, " - "modified by right operand): %s %s %s", - sRef_unparse (sr), - exprNode_unparse (e1), lltok_unparse (op), exprNode_unparse (e2)), - e2->loc); - } - } end_sRefSet_realElements; - - sRefSet_realElements (sets1, sr) - { - if (sRef_isMeaningful (sr)) - { - if (sRef_same (sr, e2->sref)) - { - voptgenerror - (flag, - message - ("Expression has undefined behavior (value of right operand " - "modified by left operand): %s %s %s", - exprNode_unparse (e1), lltok_unparse (op), exprNode_unparse (e2)), - e2->loc); - } - else if (sRefSet_member (e2->uses, sr)) - { - voptgenerror - (flag, - message - ("Expression has undefined behavior (left operand modifies %q, " - "used by right operand): %s %s %s", - sRef_unparse (sr), - exprNode_unparse (e1), lltok_unparse (op), exprNode_unparse (e2)), - e2->loc); - } - else - { - if (sRefSet_member (sets2, sr)) - { - if (sRef_isUnconstrained (sr)) - { - if (hadUncon) - { - ; - } - else - { - hadUncon = optgenerror - (FLG_EVALORDERUNCON, - message - ("Expression may have undefined behavior. Left operand " - "calls %q; right operand calls %q. The unconstrained " - "functions may modify global state used by " - "the other operand): %s %s %s", - sRefSet_unparseUnconstrained (sets1), - sRefSet_unparseUnconstrained (sets2), - exprNode_unparse (e1), lltok_unparse (op), - exprNode_unparse (e2)), - e2->loc); - } - } - else - { - voptgenerror - (flag, - message - ("Expression has undefined behavior (both " - "operands modify %q): %s %s %s", - sRef_unparse (sr), - exprNode_unparse (e1), - lltok_unparse (op), exprNode_unparse (e2)), - e2->loc); - } - } - } - } - } end_sRefSet_realElements; -} - -static void checkExpressionDefined (exprNode e1, exprNode e2, lltok op) -{ - bool hasError = FALSE; - - if (exprNode_isError (e1) || exprNode_isError (e2)) - { - return; - } - - if (sRefSet_member (e2->sets, e1->sref)) - { - if (e2->kind == XPR_CALL) - { - ; - } - else - { - hasError = optgenerror - (FLG_EVALORDER, - message ("Expression has undefined behavior " - "(value of left operand is modified " - "by right operand): %s %s %s", - exprNode_unparse (e1), lltok_unparse (op), - exprNode_unparse (e2)), - e2->loc); - } - } - - if (context_getFlag (FLG_EVALORDERUNCON)) - { - if (sRefSet_member (e2->msets, e1->sref)) - { - if (e2->kind == XPR_CALL) - { - ; - } - else - { - hasError = optgenerror - (FLG_EVALORDER, - message - ("Expression has undefined behavior (value of left " - "operand may be modified by right operand): %s %s %s", - exprNode_unparse (e1), lltok_unparse (op), - exprNode_unparse (e2)), - e2->loc); - } - } - } - - if (!hasError) - { - checkExpressionDefinedAux (e1, e2, e1->sets, e2->sets, op, FLG_EVALORDER); - - if (context_maybeSet (FLG_EVALORDERUNCON)) - { - checkExpressionDefinedAux (e1, e2, e1->msets, - e2->msets, op, FLG_EVALORDERUNCON); - } - } -} - -static void checkSequencing (exprNode p_f, exprNodeList p_args); - -static int - checkArgsReal (uentry fcn, /*@dependent@*/ exprNode f, uentryList cl, - exprNodeList args, bool isIter, exprNode ret) -{ - int special = 0; - - if (!exprNode_isError (f)) - { - if (!uentryList_isMissingParams (cl)) - { - int nargs = exprNodeList_size (args); - int expectargs = uentryList_size (cl); - ctype last; - int i = 0; - - if (expectargs == 0) - { - if (nargs != 0) - { - if (isIter) - { - voptgenerror - (FLG_TYPE, - message ("Iter %q invoked with %d args, " - "declared void", - uentry_getName (fcn), - nargs), - f->loc); - } - else - { - voptgenerror - (FLG_TYPE, - message ("Function %s called with %d args, " - "declared void", - exprNode_unparse (f), nargs), - f->loc); - } - } - return special; - } - - last = uentry_getType (uentryList_getN (cl, expectargs - 1)); - - exprNodeList_reset (args); - - uentryList_elements (cl, current) - { - ctype ct = uentry_getType (current); - exprNode a; - - if (ctype_isElips (ct)) - { - /* - ** do special checking for printf/scanf library functions - ** - ** this is kludgey code, just for handling the special case - ** - */ - - if (uentry_isPrintfLike (fcn)) - { - checkPrintfArgs (f, fcn, args, ret, i); - special = i; - } - else if (uentry_isScanfLike (fcn)) - { - checkScanfArgs (f, fcn, args, ret, i); - special = i; - } - else if (uentry_isMessageLike (fcn)) - { - checkMessageArgs (f, fcn, args, i); - special = i; - } - else - { - llassert (!uentry_isSpecialFunction (fcn)); - } - - nargs = expectargs; /* avoid errors */ - break; - } - else - { - if (i >= nargs) break; - - a = exprNodeList_current (args); - exprNodeList_advance (args); - - i++; - - if (exprNode_isError (a)) - { - ; - } - else - { - /* - probably necessary? I'm not sure about this one - checkMacroParen (a); - */ - - f->guards = guardSet_union (f->guards, a->guards); - - DPRINTF (("match arg: %s / %s", ctype_unparse (ct), ctype_unparse (a->typ))); - - if (!(exprNode_matchArgType (ct, a))) - { - DPRINTF (("Args mismatch!")); - - if (ctype_isVoidPointer (ct) - && (ctype_isPointer (a->typ) - && (ctype_isRealAbstract (ctype_baseArrayPtr (a->typ))))) - { - vnoptgenerror - (FLG_ABSTVOIDP, - message - ("Pointer to abstract type (%t) used " - "as void pointer " - "(arg %d to %q): %s", - a->typ, i, - uentry_getName (fcn), - exprNode_unparse (a)), - a->loc); - } - else - { - if (isIter) - { - (void) gentypeerror - (ct, exprNode_undefined, - a->typ, a, - message - ("Iter %q expects arg %d to " - "be %t gets %t: %s", - uentry_getName (fcn), - i, ct, a->typ, exprNode_unparse (a)), - a->loc); - } - else - { - if (gentypeerror - (ct, - exprNode_undefined, - a->typ, - a, - message - ("Function %q expects arg %d to be %t gets %t: %s", - uentry_getName (fcn), - i, ct, a->typ, exprNode_unparse (a)), - a->loc)) - { - DPRINTF (("Types: %s / %s", - ctype_unparse (ct), - ctype_unparse (a->typ))); - } - - /* - ** Clear null marker for abstract types. - ** (It is not revealed, so suppress future messages.) - */ - - if (ctype_isAbstract (a->typ)) - { - sRef_setNullUnknown (exprNode_getSref (a), a->loc); - } - } - } - } - } - } - } end_uentryList_elements ; - - - if (expectargs != nargs) /* note: not != since we may have ... */ - { - if (ctype_isElips (last)) - { - voptgenerror - (FLG_TYPE, - message ("Function %s called with %d args, expects at least %d", - exprNode_unparse (f), - nargs, expectargs - 1), - f->loc); - } - else - { - if (isIter) - { - voptgenerror - (FLG_TYPE, - message ("Iter %q invoked with %d args, expects %d", - uentry_getName (fcn), nargs, expectargs), - f->loc); - } - else - { - voptgenerror - (FLG_TYPE, - message ("Function %s called with %d args, expects %d", - exprNode_unparse (f), - nargs, expectargs), - f->loc); - } - } - } - } - } - - return special; -} - -/* -** Check for undefined code sequences in function arguments: -** -** one parameter sets something used by another parameter -** one parameter sets something set by another parameter -*/ - -static void -checkSequencingOne (exprNode f, exprNodeList args, - /*@notnull@*/ exprNode el, int argno) -{ - /* - ** Do second loop, iff +undefunspec - */ - - int checkloop; - int numloops = context_maybeSet (FLG_EVALORDERUNCON) ? 2 : 1; - - for (checkloop = 0; checkloop < numloops; checkloop++) - { - sRefSet thissets; - - if (checkloop == 0) - { - thissets = el->sets; - } - else - { - llassert (checkloop == 1); - thissets = el->msets; - } - - sRefSet_realElements (thissets, thisset) - { - int j; - - /*@access exprNodeList@*/ - for (j = 0; j < args->nelements; j++) - { - exprNode jl = args->elements[j]; - int thisargno = j + 1; - - if (thisargno != argno && exprNode_isDefined (jl)) - { - sRefSet otheruses = jl->uses; - - if (sRef_isGlobal (sRef_getRootBase (jl->sref)) && - sRefSet_hasUnconstrained (thissets)) - { - voptgenerror - (FLG_EVALORDERUNCON, - /*@-sefparams@*/ - message - ("%q used in argument %d may set " - "global variable %q used by argument %d: %s(%q)", - cstring_capitalizeFree (sRefSet_unparseUnconstrained (thissets)), - /*@=sefparams@*/ - argno, - sRef_unparse (sRef_getRootBase (jl->sref)), - thisargno, - exprNode_unparse (f), exprNodeList_unparse (args)), - el->loc); - } - - if (sRefSet_member (otheruses, thisset)) - { - if (sRef_isUnconstrained (thisset)) - { - voptgenerror - (FLG_EVALORDERUNCON, - message - ("Unconstrained functions used in arguments %d (%q) " - "and %d (%s) may modify " - "or use global state in undefined way: %s(%q)", - argno, - sRefSet_unparseUnconstrainedPlain (otheruses), - thisargno, - sRef_unconstrainedName (thisset), - exprNode_unparse (f), - exprNodeList_unparse (args)), - el->loc); - } - else - { - voptgenerror - (FLG_EVALORDER, - message - ("Argument %d modifies %q, used by argument %d " - "(order of evaluation of actual parameters is " - "undefined): %s(%q)", - argno, sRef_unparse (thisset), thisargno, - exprNode_unparse (f), exprNodeList_unparse (args)), - el->loc); - } - } - else - { - sRefSet othersets = jl->sets; - - if (sRefSet_member (othersets, thisset)) - { - if (sRef_isUnconstrained (thisset)) - { - voptgenerror - (FLG_EVALORDERUNCON, - message - ("Unconstrained functions used in " - "arguments %d (%q) and %d (%s) may modify " - "or use global state in undefined way: %s(%q)", - argno, - sRefSet_unparseUnconstrainedPlain (othersets), - thisargno, - sRef_unconstrainedName (thisset), - exprNode_unparse (f), exprNodeList_unparse (args)), - el->loc); - } - else - { - voptgenerror - (FLG_EVALORDER, - message - ("Argument %d modifies %q, set by argument %d (order of" - " evaluation of actual parameters is undefined): %s(%q)", - argno, sRef_unparse (thisset), thisargno, - exprNode_unparse (f), exprNodeList_unparse (args)), - el->loc); - } - } - } - } - } - /*@noaccess exprNodeList@*/ - } end_sRefSet_realElements; - } -} - -static void -checkSequencing (exprNode f, exprNodeList args) -{ - if (exprNodeList_size (args) > 1) - { - int i; - exprNode el; - - /*@access exprNodeList*/ - - for (i = 0; i < args->nelements; i++) - { - el = args->elements[i]; - - if (!exprNode_isError (el)) - { - checkSequencingOne (f, args, el, i + 1); - } - } - /*@noaccess exprNodeList*/ - } -} - -/* -** requires le = exprNode_getUentry (f) -*/ - -static void -checkGlobMods (/*@notnull@*/ /*@dependent@*/ exprNode f, - uentry le, exprNodeList args, - /*@notnull@*/ exprNode ret, int specialArgs) -{ - bool isSpec = FALSE; - bool hasMods = FALSE; - cstring fname; - globSet usesGlobs = globSet_undefined; - sRefSet mods = sRefSet_undefined; - bool freshMods = FALSE; - uentryList params = uentryList_undefined; - - /* - ** check globals and modifies - */ - - setCodePoint (); - - if (!uentry_isValid (le)) - { - ctype fr = ctype_realType (f->typ); - - if (ctype_isFunction (fr)) - { - params = ctype_argsFunction (fr); - } - else - { - params = uentryList_missingParams; - } - - if (!context_getFlag (FLG_MODNOMODS) - && !context_getFlag (FLG_GLOBUNSPEC)) - { - checkUnspecCall (f, params, args); - } - - return; - } - - fname = uentry_rawName (le); - - setCodePoint (); - - if (uentry_isFunction (le)) - { - params = uentry_getParams (le); - mods = uentry_getMods (le); - hasMods = uentry_hasMods (le); - usesGlobs = uentry_getGlobs (le); - isSpec = uentry_isSpecified (le); - } - else /* not a function */ - { - ctype ct = ctype_realType (uentry_getType (le)); - - llassertprint (uentry_isVar (le) && ctype_isFunction (ct), - ("checkModGlobs: uentry not a function: %s", - uentry_unparse (le))); - - params = ctype_argsFunction (ct); - } - - /* - ** check globals - */ - - setCodePoint (); - - - globSet_allElements (usesGlobs, el) - { - if (sRef_isValid (el)) - { - if (sRef_isInternalState (el) || sRef_isSystemState (el)) - { - context_usedGlobal (el); - exprNode_checkUse (f, el, f->loc); - - if (context_checkInternalUse ()) - { - if (!context_globAccess (el)) - { - if (sRef_isSystemState (el) - && !context_getFlag (FLG_MODFILESYSTEM)) - { - ; - } - else - { - voptgenerror - (FLG_INTERNALGLOBS, - message - ("Called procedure %s may access %q, but " - "globals list does not include globals %s", - exprNode_unparse (f), - sRef_unparse (el), - cstring_makeLiteralTemp (sRef_isInternalState (el) - ? "internalState" - : "fileSystem")), - f->loc); - } - } - } - } - else if (sRef_isNothing (el) || sRef_isSpecState (el)) - { - ; - } - else - { - uentry gle = sRef_getUentry (el); - sRef sr = sRef_updateSref (el); - - if (sRef_isUndefGlob (el)) - { - sRef_setDefined (sr, f->loc); - exprNode_checkSet (f, sr); - } - else - { - /* - ** check definition - */ - - if (sRef_isAllocated (el)) - { - exprNode_checkSet (f, sr); - } - else - { - if (sRef_isStateUndefined (sr)) - { - voptgenerror - (FLG_GLOBSTATE, - message - ("%s %q used by function undefined before call: %s", - sRef_getScopeName (sr), - sRef_unparse (sr), - exprNode_unparse (f)), - f->loc); - sRef_setDefined (sr, f->loc); - } - exprNode_checkUse (f, sr, f->loc); - } - - checkGlobUse (gle, TRUE, f); - } - - if (sRef_isKilledGlob (el)) - { - sRef_kill (sr, f->loc); - context_usedGlobal (sr); - } - } - } - } end_globSet_allElements; - - /* - ** check modifies - */ - - if (context_hasMods () || context_getFlag (FLG_MODNOMODS)) - { - sRefSet smods = sRefSet_undefined; - - /* - ** NEED to check for modifies anything - */ - - /* - ** check each sRef that called function modifies (ml), is - ** modifiable by tl - */ - - setCodePoint (); - - sRefSet_allElements (mods, s) /* s is something which may be modified */ - { - if (sRef_isKindSpecial (s)) - { - if (sRef_isSpecInternalState (s)) - { - if (context_getFlag (FLG_MODINTERNALSTRICT)) - { - exprNode_checkCallModifyVal (s, args, f, ret); - } - else - { - sRefSet mmods = context_modList (); - - sRefSet_allElements (mmods, el) - { - if (sRef_isInternalState (el)) - { - sRef_setModified (el); - } - } end_sRefSet_allElements ; - } - } - else - { - exprNode_checkCallModifyVal (s, args, f, ret); - } - } - else - { - sRef rb = sRef_getRootBase (s); - - if (sRef_isGlobal (rb)) - { - context_usedGlobal (rb); - } - - if (sRef_isFileStatic (s) - && !fileId_equal (fileloc_fileId (f->loc), - fileloc_fileId (uentry_whereDefined (le)))) - { - smods = sRefSet_insert (smods, s); - } - else - { - exprNode_checkCallModifyVal (s, args, f, ret); - } - } - } end_sRefSet_allElements; - - setCodePoint (); - - /* - ** Static elements in modifies set can have nasty consequences. - ** (I think...have not been able to reproduce a possible bug.) - */ - - if (!sRefSet_isDefined (smods)) - { - mods = sRefSet_newCopy (mods); - freshMods = TRUE; - - sRefSet_allElements (smods, el) - { - bool res = sRefSet_delete (mods, el); - - llassert (res); - } end_sRefSet_allElements; - - sRefSet_free (smods); - /*@-branchstate@*/ - } - /*@=branchstate@*/ - } - else if (sRefSet_isDefined (mods)) - { /* just check observers */ - setCodePoint (); - - sRefSet_allElements (mods, s) /* s is something which may be modified */ - { - sRef rb = sRef_getRootBase (s); - - setCodePoint (); - - if (sRef_isParam (rb)) - { - sRef b = sRef_fixBaseParam (s, args); - - if (sRef_isObserver (b)) - { - exprNode e = exprNodeList_nth (args, sRef_getParam (rb)); - - if (optgenerror - (FLG_MODOBSERVER, - message ("Function call may modify observer%q: %s", - sRef_unparsePreOpt (b), exprNode_unparse (e)), - exprNode_loc (e))) - { - sRef_showExpInfo (b); - } - } - } - } end_sRefSet_allElements; - } - else - { - if (!hasMods) /* no specified modifications */ - { - if (context_getFlag (FLG_MODOBSERVERUNCON)) - { - exprNodeList_elements (args, e) - { - if (exprNode_isDefined (e)) - { - sRef s = exprNode_getSref (e); - - if (sRef_isObserver (s) - && ctype_isMutable (sRef_getType (s))) - { - if (optgenerror - (FLG_MODOBSERVERUNCON, - message - ("Call to unconstrained function %s may modify observer%q: %s", - exprNode_unparse (f), - sRef_unparsePreOpt (s), exprNode_unparse (e)), - exprNode_loc (e))) - { - sRef_showExpInfo (s); - } - } - } - } end_exprNodeList_elements; - } - } - } - - checkAnyCall (f, fname, params, args, hasMods, mods, isSpec, specialArgs); - - ret->uses = sRefSet_union (ret->uses, f->uses); - ret->sets = sRefSet_union (ret->sets, f->sets); - ret->msets = sRefSet_union (ret->msets, f->msets); - - if (freshMods) - { - /* - ** Spurious errors reported, because lclint can't tell - ** mods must be fresh if freshMods is true. - */ - - /*@i@*/ sRefSet_free (mods); - } - - setCodePoint (); -} - -void checkGlobUse (uentry glob, bool isCall, /*@notnull@*/ exprNode e) -{ - if (uentry_isVar (glob)) - { - if (context_inFunctionLike ()) - { - sRef sr = uentry_getSref (glob); - - context_usedGlobal (sr); - - if (context_checkGlobUse (glob)) - { - if (!context_globAccess (sr)) - { - if (isCall) - { - voptgenerror - (FLG_GLOBALS, - message ("Called procedure %s may access %s %q", - exprNode_unparse (e), - sRef_unparseScope (sr), - uentry_getName (glob)), - e->loc); - } - else - { - voptgenerror - (FLG_GLOBALS, - message ("Undocumented use of %s %s", - sRef_unparseScope (sr), - exprNode_unparse (e)), - e->loc); - } - } - } - } - } - else - { - llbug (message ("Global not variable: %q", uentry_unparse (glob))); - } -} - -static /*@only@*/ exprNode -functionCallSafe (/*@only@*/ /*@notnull@*/ exprNode f, - ctype t, /*@keep@*/ exprNodeList args) -{ - /* requires f is a non-error exprNode, with type function */ - cstring fname = exprNode_unparse (f); - uentry le = exprNode_getUentry (f); - exprNode ret = exprNode_createPartialCopy (f); - int special; - - setCodePoint (); - - ret->typ = ctype_returnValue (t); - ret->kind = XPR_CALL; - - ret->edata = exprData_makeCall (f, args); - - /* - ** Order of these steps is very important! - ** - ** Must check for argument dependencies before messing up uses and sets. - */ - - if (context_getFlag (FLG_EVALORDER)) - { - exprNodeList_elements (args, current) - { - if (exprNode_isDefined (current)) - { - exprNode_addUse (current, current->sref); - } - } end_exprNodeList_elements; - - if (context_maybeSet (FLG_EVALORDER) || context_maybeSet (FLG_EVALORDERUNCON)) - { - checkSequencing (f, args); - } - - exprNodeList_elements (args, current) - { - if (exprNode_isDefined (current) && sRef_isMeaningful (current->sref)) - { - exprNode_addUse (ret, sRef_makeDerived (current->sref)); - } - } end_exprNodeList_elements ; - } - - special = checkArgs (le, f, t, args, ret); - checkGlobMods (f, le, args, ret, special); - - setCodePoint (); - - if (uentry_isValid (le) - && (uentry_isFunction (le) - || (uentry_isVariable (le) - && ctype_isFunction (uentry_getType (le))))) - { - exitkind exk = uentry_getExitCode (le); - - /* f->typ is already set to the return type */ - - ret->sref = uentry_returnedRef (le, args); - - if (uentry_isFunction (le) && exprNodeList_size (args) >= 1) - { - qual nullPred = uentry_nullPred (le); - - if (qual_isTrueNull (nullPred)) - { - exprNode arg = exprNodeList_head (args); - - if (exprNode_isDefined (arg)) - { - ret->guards = guardSet_addFalseGuard (ret->guards, arg->sref); - } - } - else if (qual_isFalseNull (nullPred)) - { - exprNode arg = exprNodeList_head (args); - - if (exprNode_isDefined (arg)) - { - ret->guards = guardSet_addTrueGuard (ret->guards, arg->sref); - } - } - else - { - llassert (qual_isUnknown (nullPred)); - } - } - - if (exitkind_isConditionalExit (exk)) - { - /* - ** True exit is: - ** if (arg0) then { exit! } else { ; } - ** False exit is: - ** if (arg0) then { ; } else { exit! } - */ - - exprNode firstArg; - - llassert (!exprNodeList_isEmpty (args)); - firstArg = exprNodeList_head (args); - - if (exprNode_isDefined (firstArg) - && !guardSet_isEmpty (firstArg->guards)) - { - usymtab_trueBranch (guardSet_undefined); - usymtab_altBranch (guardSet_undefined); - - if (exitkind_isTrueExit (exk)) - { - usymtab_popBranches (firstArg, - exprNode_makeMustExit (), - exprNode_undefined, - TRUE, TRUEEXITCLAUSE); - } - else - { - usymtab_popBranches (firstArg, - exprNode_undefined, - exprNode_makeMustExit (), - TRUE, FALSEEXITCLAUSE); - } - } - - ret->exitCode = XK_MAYEXIT; - } - else if (exitkind_mustExit (exk)) - { - ret->exitCode = XK_MUSTEXIT; - } - else if (exitkind_couldExit (exk)) - { - ret->exitCode = XK_MAYEXIT; - } - else - { - ; - } - - if (cstring_equalLit (fname, "exit")) - { - if (exprNodeList_size (args) == 1) - { - exprNode arg = exprNodeList_head (args); - - if (exprNode_isDefined (arg) && exprNode_knownIntValue (arg)) - { - long int val = multiVal_forceInt (exprNode_getValue (arg)); - - if (val != 0) - { - voptgenerror - (FLG_EXITARG, - message - ("Argument to exit has implementation defined behavior: %s", - exprNode_unparse (arg)), - exprNode_loc (arg)); - } - } - } - } - } - else - { - ret->sref = defref; - exprNode_checkSetAny (ret, uentry_rawName (le)); - } - - return (ret); -} - -/* -** this is yucky! should keep the uentry as part of exprNode! -*/ - -/*@observer@*/ uentry -exprNode_getUentry (exprNode e) -{ - if (exprNode_isError (e)) - { - return uentry_undefined; - } - else - { - cstring s = exprNode_rootVarName (e); - uentry ue = usymtab_lookupSafe (s); - - return ue; - } -} - -exprNode -exprNode_makeInitBlock (lltok brace, /*@only@*/ exprNodeList inits) -{ - exprNode ret = exprNode_createPlain (ctype_unknown); - - ret->kind = XPR_INITBLOCK; - ret->edata = exprData_makeCall (exprNode_undefined, inits); - ret->loc = fileloc_update (ret->loc, lltok_getLoc (brace)); - - return (ret); -} - -exprNode -exprNode_functionCall (/*@only@*/ exprNode f, /*@only@*/ exprNodeList args) -{ - ctype t; - - setCodePoint (); - - if (exprNode_isUndefined (f)) - { - exprNode_free (f); - exprNodeList_free (args); - return exprNode_undefined; - } - - t = exprNode_getType (f); - - if (sRef_isLocalVar (f->sref)) - { - exprNode_checkUse (f, f->sref, f->loc); - - if (sRef_possiblyNull (f->sref)) - { - if (!usymtab_isGuarded (f->sref)) - { - if (optgenerror (FLG_NULLDEREF, - message ("Function call using %s pointer %q", - sRef_nullMessage (f->sref), - sRef_unparse (f->sref)), - f->loc)) - { - sRef_showNullInfo (f->sref); - sRef_setNullError (f->sref); - } - } - } - } - - setCodePoint (); - - if (ctype_isRealFunction (t)) - { - exprNode ret = functionCallSafe (f, t, args); - setCodePoint (); - return ret; - } - else if (ctype_isUnknown (t)) - { - exprNode ret = exprNode_createPartialCopy (f); - cstring tstring; - - setCodePoint (); - - ret->typ = t; - exprNodeList_elements (args, current) - { - if (exprNode_isDefined (current)) - { - exprNode_checkUse (ret, current->sref, ret->loc); - - /* - ** also, anything derivable from current->sref may be used - */ - - exprNode_addUse (ret, sRef_makeDerived (current->sref)); - exprNode_mergeUSs (ret, current); - } - } end_exprNodeList_elements; - - ret->edata = exprData_makeCall (f, args); - ret->kind = XPR_CALL; - - tstring = cstring_copy (exprNode_unparse (f)); - - cstring_markOwned (tstring); - exprNode_checkSetAny (ret, tstring); - - return (ret); - } - else - { - voptgenerror (FLG_TYPE, - message ("Call to non-function (type %t): %s", t, - exprNode_unparse (f)), - f->loc); - exprNode_free (f); - exprNodeList_free (args); - - return (exprNode_makeError ()); - } -} - -exprNode -exprNode_fieldAccess (/*@only@*/ exprNode s, /*@only@*/ cstring f) -{ - exprNode ret = exprNode_createPartialCopy (s); - - ret->kind = XPR_FACCESS; - - if (exprNode_isError (s)) - { - ret->edata = exprData_makeField (s, f); - return ret; - } - else - { - ctype t = exprNode_getType (s); - ctype tr = ctype_realType (t); - - checkMacroParen (s); - - ret->edata = exprData_makeField (s, f); - - if (ctype_isStructorUnion (tr)) - { - uentry tf = uentryList_lookupField (ctype_getFields (tr), f); - - if (uentry_isUndefined (tf)) - { - voptgenerror (FLG_TYPE, - message ("Access non-existent field %s of %t: %s", f, t, - exprNode_unparse (ret)), - s->loc); - - return (ret); - } - else - { - uentry_setUsed (tf, exprNode_loc (ret)); - - ret->typ = uentry_getType (tf); - checkSafeUse (ret, s->sref); - - ret->sref = sRef_makeField (s->sref, uentry_rawName (tf)); - return (ret); - } - } - else /* isStructorUnion */ - { - if (ctype_isRealAbstract (tr)) - { - voptgenerror - (FLG_ABSTRACT, - message ("Access field of abstract type (%t): %s.%s", - t, exprNode_unparse (s), f), - s->loc); - ret->typ = ctype_unknown; - } - else - { - if (ctype_isKnown (tr)) - { - voptgenerror - (FLG_TYPE, - message - ("Access field of non-struct or union (%t): %s.%s", - t, exprNode_unparse (s), f), - s->loc); - - ret->typ = ctype_unknown; - } - else - { - cstring sn = cstring_copy (f); - - checkSafeUse (ret, s->sref); - cstring_markOwned (sn); - ret->sref = sRef_makeField (s->sref, sn); - - return (ret); - } - } - return (ret); - } - } - BADEXIT; -} - -exprNode -exprNode_addParens (/*@only@*/ lltok lpar, /*@only@*/ exprNode e) -{ - exprNode ret = exprNode_createPartialCopy (e); - - ret->loc = fileloc_update (ret->loc, lltok_getLoc (lpar)); - ret->kind = XPR_PARENS; - ret->edata = exprData_makeUop (e, lpar); - - if (!exprNode_isError (e)) - { - ret->exitCode = e->exitCode; - ret->canBreak = e->canBreak; - ret->mustBreak = e->mustBreak; - ret->isJumpPoint = e->isJumpPoint; - ret->sref = e->sref; - } - - return ret; -} - -exprNode -exprNode_arrowAccess (/*@only@*/ exprNode s, /*@only@*/ cstring f) -{ - exprNode ret = exprNode_createPartialCopy (s); - - ret->edata = exprData_makeField (s, f); - ret->kind = XPR_ARROW; - - if (exprNode_isError (s)) - { - return (ret); - } - else - { - ctype t = exprNode_getType (s); - ctype tr = ctype_realType (t); - - checkMacroParen (s); - - (void) ctype_fixArrayPtr (tr); /* REWRITE THIS */ - - if (ctype_isRealPointer (tr)) - { - ctype b = ctype_realType (ctype_baseArrayPtr (tr)); - - if (ctype_isStructorUnion (b)) - { - uentry fentry = uentryList_lookupField (ctype_getFields (b), f); - - if (sRef_isKnown (s->sref) && sRef_possiblyNull (s->sref)) - { - if (!usymtab_isGuarded (s->sref) && !context_inProtectVars ()) - { - if (optgenerror - (FLG_NULLDEREF, - message ("Arrow access from %s pointer%q: %s", - sRef_nullMessage (s->sref), - sRef_unparsePreOpt (s->sref), - exprNode_unparse (ret)), - s->loc)) - { - sRef_showNullInfo (s->sref); - sRef_setNullError (s->sref); - } - } - } - - if (uentry_isUndefined (fentry)) - { - voptgenerror - (FLG_TYPE, - message ("Access non-existent field %s of %t: %s", - f, t, exprNode_unparse (ret)), - s->loc); - ret->typ = ctype_unknown; - - return (ret); - } - else - { - /* - ** was safeUse: shouldn't be safe! - ** - ** to do rec->field - ** rec must be defined, - ** *rec must be allocated - ** rec->field need only be defined it if is an rvalue - */ - - uentry_setUsed (fentry, exprNode_loc (ret)); - ret->typ = uentry_getType (fentry); - - exprNode_checkUse (ret, s->sref, s->loc); - - /* exprNode_checkUse (ret, sRef_makePointer (s->sref), s->loc); */ - ret->sref = sRef_makeArrow (s->sref, uentry_rawName (fentry)); - return (ret); - } - } - else /* Pointer to something that is not a struct or union*/ - { - if (ctype_isRealAbstract (tr)) - { - ctype xrt = ctype_forceRealType (tr); - - voptgenerror - (FLG_ABSTRACT, - message ("Arrow access field of abstract type (%t): %s->%s", - t, exprNode_unparse (s), f), - s->loc); - - /* - ** Set the state correctly, as if the abstraction is broken. - */ - - if (ctype_isRealPointer (xrt) && - (b = ctype_realType (ctype_baseArrayPtr (xrt)), - ctype_isStructorUnion (b))) - { - uentry fentry = uentryList_lookupField (ctype_getFields (b), f); - ret->typ = uentry_getType (fentry); - ret->sref = sRef_makeArrow (s->sref, uentry_rawName (fentry)); - } - else - { - ret->typ = ctype_unknown; - ret->sref = sRef_undefined; - } - } - else /* not a struct, union or abstract */ - { - if (ctype_isUnknown (tr)) { - cstring sn = cstring_copy (f); - - DPRINTF (("Here: %s", exprNode_unparse (s))); - - exprNode_checkUse (ret, s->sref, s->loc); - exprNode_checkUse (ret, sRef_makePointer (s->sref), s->loc); - - cstring_markOwned (sn); - ret->sref = sRef_makeArrow (s->sref, sn); - - ret->kind = XPR_ARROW; - return (ret); - } else { - voptgenerror - (FLG_TYPE, - message ("Arrow access field of non-struct or union " - "pointer (%t): %s->%s", - t, exprNode_unparse (s), f), - s->loc); - - ret->typ = ctype_unknown; - ret->sref = sRef_undefined; - } - } - } - } - else /* its not a pointer */ - { - if (!ctype_isUnknown (tr)) - { - voptgenerror - (FLG_TYPE, - message ("Arrow access of non-pointer (%t): %s->%s", - t, exprNode_unparse (s), f), - s->loc); - - ret->typ = ctype_unknown; - ret->sref = sRef_undefined; - } - else - { - cstring sn = cstring_copy (f); - - DPRINTF (("Here: %s", exprNode_unparse (s))); - - exprNode_checkUse (ret, s->sref, s->loc); - exprNode_checkUse (ret, sRef_makePointer (s->sref), s->loc); - - cstring_markOwned (sn); - ret->sref = sRef_makeArrow (s->sref, sn); - - ret->kind = XPR_ARROW; - return (ret); - } - } - - return (ret); - } - BADEXIT; -} - -/* -** only postOp's in C: i++ and i-- -*/ - -exprNode -exprNode_postOp (/*@only@*/ exprNode e, /*@only@*/ lltok op) -{ - /* check modification also */ - /* cstring opname = lltok_unparse (op);*/ - ctype t; - exprNode ret = exprNode_createPartialCopy (e); - - ret->loc = fileloc_update (ret->loc, lltok_getLoc (op)); - ret->kind = XPR_POSTOP; - ret->edata = exprData_makeUop (e, op); - - if (!exprNode_isDefined (e)) - { - return ret; - } - - checkMacroParen (e); - - exprNode_checkUse (ret, e->sref, e->loc); - exprNode_checkSet (ret, e->sref); - - t = exprNode_getType (e); - - if (sRef_isUnsafe (e->sref)) - { - voptgenerror (FLG_MACROPARAMS, - message ("Operand of %s is macro parameter (non-functional): %s%s", - lltok_unparse (op), exprNode_unparse (e), lltok_unparse (op)), - e->loc); - sRef_makeSafe (e->sref); - sRef_makeSafe (ret->sref); - } - - if (ctype_isForceRealNumeric (&t) || ctype_isRealAP (t)) - { - ret->typ = e->typ; - } - else - { - if (ctype_isRealAbstract (t)) - { - voptgenerror - (FLG_ABSTRACT, - message ("Operand of %s is abstract type (%t): %s", - lltok_unparse (op), t, exprNode_unparse (e)), - e->loc); - } - else - { - voptgenerror - (FLG_TYPE, - message ("Operand of %s is non-numeric (%t): %s", - lltok_unparse (op), t, exprNode_unparse (e)), - e->loc); - } - ret->typ = ctype_unknown; - } - - /* if (ctype_isZero (t)) e->typ = ctype_int; */ - - exprNode_checkModify (e, ret); - - /* added 7/11/2000 D.L */ - - updateEnvironmentForPostOp (e); - - /* start modifications */ - /* added by Seejo on 4/16/2000 */ - - /* Arithmetic operations on pointers wil modify the size/len/null terminated - status */ - if ((sRef_isPossiblyNullTerminated (e->sref)) || (sRef_isNullTerminated(e->sref))) { - - ret->sref = sRef_copy (e->sref); - - /* Operator : ++ */ - if (lltok_getTok (op) == INC_OP) { - if (sRef_getSize(e->sref) > 0) { - - sRef_setSize (ret->sref, sRef_getSize(e->sref) - 1); - - if (sRef_getLen(e->sref) == 1) { /* i.e. the first character is \0 */ - /* Assumption: there is only 1 \0 in the buffer */ - /* This will not be correct if there are 2 \0's in the buffer */ - sRef_setNotNullTerminatedState(ret->sref); - sRef_resetLen(ret->sref); - } else { - sRef_setNullTerminatedState(ret->sref); - sRef_setLen (ret->sref, sRef_getLen(e->sref) - 1); - } - if (sRef_isNullTerminated (ret->sref)) - printf ("ret->sref is Null Terminated\n"); - else if (sRef_isPossiblyNullTerminated (ret->sref)) - printf ("ret->sref is Possibly Null Terminated\n"); - else if (sRef_isNotNullTerminated (ret->sref)) - printf ("ret->sref is Not Null Terminated\n"); - } - } - - /* Operator : -- */ - if (lltok_getTok (op) == DEC_OP) { - if (sRef_getSize(e->sref) >= 0) { - sRef_setSize (ret->sref, sRef_getSize(e->sref) + 1); - sRef_setLen (ret->sref, sRef_getLen(e->sref) + 1); - } - } - } - - /* end modifications */ - - return ret; -} - -exprNode -exprNode_preOp (/*@only@*/ exprNode e, /*@only@*/ lltok op) -{ - bool checkMod = FALSE; - ctype te, tr; - int opid = lltok_getTok (op); - exprNode ret = exprNode_createSemiCopy (e); - - exprNode_copySets (ret, e); - - multiVal_free (ret->val); - ret->val = multiVal_undefined; - ret->loc = fileloc_update (ret->loc, lltok_getLoc (op)); - ret->kind = XPR_PREOP; - ret->edata = exprData_makeUop (e, op); - - if (exprNode_isError (e)) - { - return ret; - } - - checkMacroParen (e); - - te = exprNode_getType (e); - tr = ctype_realType (te); - - if (opid != TAMPERSAND) - { - exprNode_checkUse (ret, e->sref, e->loc); - - if (ctype_isRealAbstract (tr) - && (!(ctype_isRealBool (te) && (opid == TEXCL)))) - { - if (optgenerror (FLG_ABSTRACT, - message ("Operand of %s is abstract type (%t): %s", - lltok_unparse (op), tr, - exprNode_unparse (ret)), - e->loc)) - { - tr = te = ctype_unknown; - ret->typ = ctype_unknown; - sRef_setNullError (e->sref); - } - } - } - - switch (opid) - { - case INC_OP: - case DEC_OP: /* should also check modification! */ - - if (sRef_isMacroParamRef (e->sref)) - { - voptgenerror - (FLG_MACROPARAMS, - message ("Operand of %s is macro parameter (non-functional): %s", - lltok_unparse (op), exprNode_unparse (ret)), - e->loc); - } - else - { - exprNode_checkSet (ret, e->sref); - } - - if (ctype_isForceRealNumeric (&tr) || ctype_isRealAP (tr)) - { - } - else - { - if (context_msgStrictOps ()) - { - voptgenerror - (FLG_STRICTOPS, - message ("Operand of %s is non-numeric (%t): %s", - lltok_unparse (op), te, exprNode_unparse (ret)), - e->loc); - } - ret->typ = ctype_int; - } - - /* start modifications */ - /* added by Seejo on 4/16/2000 */ - - /* Arithmetic operations on pointers wil modify the size/len/null terminated - status */ - if ((sRef_isPossiblyNullTerminated (e->sref)) || (sRef_isNullTerminated(e->sref))) { - - ret->sref = sRef_copy (e->sref); - - /* Operator : ++ */ - if (lltok_getTok (op) == INC_OP) { - if (sRef_getSize(e->sref) > 0) { - - sRef_setSize (ret->sref, sRef_getSize(e->sref) - 1); - - if (sRef_getLen(e->sref) == 1) { /* i.e. the first character is \0 */ - /* Assumption: there is only 1 \0 in the buffer */ - /* This will not be correct if there are 2 \0's in the buffer */ - sRef_setNotNullTerminatedState(ret->sref); - sRef_resetLen (ret->sref); - } else { - sRef_setNullTerminatedState(ret->sref); - sRef_setLen (ret->sref, sRef_getLen(e->sref) - 1); - } - } - } - - /* Operator : -- */ - if (lltok_getTok (op) == DEC_OP) { - if (sRef_getSize(e->sref) >= 0) { - sRef_setSize (ret->sref, sRef_getSize(e->sref) + 1); - sRef_setLen (ret->sref, sRef_getLen(e->sref) + 1); - } - } - } - - /* end modifications */ - - checkMod = TRUE; - break; - - case TMINUS: - case TPLUS: - if (ctype_isForceRealNumeric (&tr)) - { - if (opid == TMINUS) - { - ret->val = multiVal_invert (exprNode_getValue (e)); - } - else - { - ret->val = multiVal_copy (exprNode_getValue (e)); - } - } - else - { - if (context_msgStrictOps ()) - { - voptgenerror - (FLG_STRICTOPS, - message ("Operand of %s is non-numeric (%t): %s", - lltok_unparse (op), te, exprNode_unparse (ret)), - e->loc); - } - - ret->typ = ctype_int; - } - break; - - case TEXCL: /* maybe this should be restricted */ - guardSet_flip (ret->guards); - - if (ctype_isRealBool (te)) - { - ; - } - else - { - if (ctype_isRealPointer (tr)) - { - if (sRef_isKnown (e->sref)) - { - ret->guards = guardSet_addFalseGuard (ret->guards, e->sref); - } - - voptgenerror2n - (FLG_BOOLOPS, FLG_PTRNEGATE, - message ("Operand of %s is non-boolean (%t): %s", - lltok_unparse (op), te, exprNode_unparse (ret)), - e->loc); - } - else - { - voptgenerror - (FLG_BOOLOPS, - message ("Operand of %s is non-boolean (%t): %s", - lltok_unparse (op), te, exprNode_unparse (ret)), - e->loc); - } - - ret->typ = ctype_bool; - } - break; - - case TTILDE: - if (ctype_isForceRealInt (&tr)) - { - } - else - { - if (context_msgStrictOps ()) - { - voptgenerror - (FLG_STRICTOPS, - message ("Operand of %s is non-integer (%t): %s", - lltok_unparse (op), te, exprNode_unparse (ret)), - e->loc); - } - - if (ctype_isInt (e->typ)) - { - ret->typ = e->typ; - } - else - { - ret->typ = ctype_int; - } - } - break; - - case TAMPERSAND: - ret->typ = ctype_makePointer (e->typ); - - if (sRef_isKnown (e->sref)) - { - ret->sref = sRef_makeAddress (e->sref); - } - - break; - - case TMULT: - - if (ctype_isAP (tr)) - { - ret->typ = ctype_baseArrayPtr (e->typ); - } - else - { - if (ctype_isKnown (te)) - { - if (ctype_isFunction (te)) - { - ret->typ = e->typ; - - voptgenerror - (FLG_FCNDEREF, - message ("Dereference of function type (%t): %s", - te, exprNode_unparse (ret)), - e->loc); - } - else - { - voptgenerror (FLG_TYPE, - message ("Dereference of non-pointer (%t): %s", - te, exprNode_unparse (ret)), - e->loc); - ret->typ = ctype_unknown; - } - } - else - { - ret->typ = ctype_unknown; - } - - } - - if (sRef_isKnown (e->sref)) - { - if (sRef_possiblyNull (e->sref)) - { - if (!usymtab_isGuarded (e->sref) && !context_inProtectVars ()) - { - if (optgenerror - (FLG_NULLDEREF, - message ("Dereference of %s pointer %q: %s", - sRef_nullMessage (e->sref), - sRef_unparse (e->sref), - exprNode_unparse (ret)), - e->loc)) - { - sRef_showNullInfo (e->sref); - sRef_setNotNull (e->sref, e->loc); /* suppress future messages */ - } - } - } - - ret->sref = sRef_makePointer (e->sref); - } - break; - - default: - llbug (message ("exprNode_preOp: unhandled op: %s", lltok_unparse (op))); - } - - if (checkMod) - { - exprNode_checkModify (e, ret); - } - - return ret; -} - -/* -** any reason to disallow sizeof (abstract type) ? -*/ - -/* -** used by both sizeof -*/ - -static -ctype sizeof_resultType (void) -{ - static ctype sizet = ctype_unknown; - - if (ctype_isUnknown (sizet)) - { - if (usymtab_existsType (cstring_makeLiteralTemp ("size_t"))) - { - sizet = uentry_getAbstractType (usymtab_lookup (cstring_makeLiteralTemp ("size_t"))); - } - else - { - sizet = ctype_ulint; - } - } - return sizet; -} - -exprNode -exprNode_sizeofType (/*@only@*/ qtype qt) -{ - exprNode ret = exprNode_create (sizeof_resultType ()); - ctype ct = qtype_getType (qt); - - ret->kind = XPR_SIZEOFT; - ret->edata = exprData_makeSizeofType (qt); - - voptgenerror (FLG_SIZEOFTYPE, - message ("Parameter to sizeof is type %s: %s", - ctype_unparse (ct), - exprNode_unparse (ret)), - ret->loc); - - return (ret); -} - -exprNode -exprNode_alignofType (/*@only@*/ qtype qt) -{ - exprNode ret = exprNode_create (sizeof_resultType ()); - ctype ct = qtype_getType (qt); - - ret->kind = XPR_ALIGNOFT; - ret->edata = exprData_makeSizeofType (qt); - - voptgenerror (FLG_SIZEOFTYPE, - message ("Parameter to alignof is type %s: %s", - ctype_unparse (ct), - exprNode_unparse (ret)), - ret->loc); - - return (ret); -} - -exprNode exprNode_offsetof (qtype qt, cstringList s) -{ - exprNode ret = exprNode_create (sizeof_resultType ()); - ctype ct = qtype_getType (qt); - - ret->kind = XPR_OFFSETOF; - ret->edata = exprData_makeOffsetof (qt, s); - - if (!ctype_isRealSU (ct)) - { - voptgenerror (FLG_TYPE, - message ("First parameter to offsetof is not a " - "struct or union type (type %s): %s", - ctype_unparse (ct), - exprNode_unparse (ret)), - ret->loc); - } - else - { - ctype lt = ct; - - cstringList_elements (s, el) { - uentryList fields; - uentry fld; - - if (ctype_isUndefined (lt)) - { - break; - } - else if (!ctype_isRealSU (lt)) - { - voptgenerror (FLG_TYPE, - message ("Inner offsetof type is not a " - "struct or union type (type %s before field %s): %s", - ctype_unparse (lt), el, - exprNode_unparse (ret)), - ret->loc); - break; - } - else - { - fields = ctype_getFields (ctype_realType (lt)); - fld = uentryList_lookupField (fields, el); - DPRINTF (("Try: %s / %s", ctype_unparse (lt), el)); - - if (uentry_isUndefined (fld)) - { - if (ctype_equal (lt, ct)) { - voptgenerror (FLG_TYPE, - message ("Field %s in offsetof is not the " - "name of a field of %s: %s", - el, - ctype_unparse (ct), - exprNode_unparse (ret)), - ret->loc); - } else { - voptgenerror (FLG_TYPE, - message ("Deep field %s in offsetof is not the " - "name of a field of %s: %s", - el, - ctype_unparse (lt), - exprNode_unparse (ret)), - ret->loc); - } - } - else - { - lt = uentry_getType (fld); - } - } - } end_cstringList_elements; - - /* Should report error if its a bit field - behavior is undefined! */ - } - - return (ret); -} - -/*@only@*/ exprNode -exprNode_sizeofExpr (/*@only@*/ exprNode e) -{ - exprNode ret; - - if (exprNode_isUndefined (e)) - { - ret = exprNode_createLoc (ctype_unknown, fileloc_copy (g_currentloc)); - ret->edata = exprData_makeSingle (e); - ret->typ = sizeof_resultType (); - ret->kind = XPR_SIZEOF; - } - else - { - uentry u = exprNode_getUentry (e); - - ret = exprNode_createPartialCopy (e); - ret->edata = exprData_makeSingle (e); - - ret->typ = sizeof_resultType (); - ret->kind = XPR_SIZEOF; - - if (uentry_isValid (u) - && uentry_isRefParam (u) - && ctype_isRealArray (uentry_getType (u))) - { - voptgenerror - (FLG_SIZEOFFORMALARRAY, - message ("Parameter to sizeof is an array-type function parameter: %s", - exprNode_unparse (ret)), - ret->loc); - } - } - - /* - ** sizeof (x) doesn't "really" use x - */ - - return (ret); -} - -/*@only@*/ exprNode -exprNode_alignofExpr (/*@only@*/ exprNode e) -{ - exprNode ret; - - if (exprNode_isUndefined (e)) - { - ret = exprNode_createLoc (ctype_unknown, fileloc_copy (g_currentloc)); - } - else - { - ret = exprNode_createPartialCopy (e); - } - - ret->edata = exprData_makeSingle (e); - ret->typ = sizeof_resultType (); - ret->kind = XPR_ALIGNOF; - - /* - ** sizeof (x) doesn't "really" use x - */ - - return (ret); -} - -/*@only@*/ exprNode -exprNode_cast (/*@only@*/ lltok tok, /*@only@*/ exprNode e, /*@only@*/ qtype q) -{ - ctype c; - ctype t; - exprNode ret; - - if (exprNode_isError (e)) - { - qtype_free (q); - lltok_release (tok); - return exprNode_undefined; - } - - checkMacroParen (e); - - c = qtype_getType (q); - t = exprNode_getType (e); - - ret = exprNode_createPartialCopy (e); - - ret->loc = fileloc_update (ret->loc, lltok_getLoc (tok)); - ret->typ = c; - ret->kind = XPR_CAST; - ret->edata = exprData_makeCast (tok, e, q); - - if (ctype_isRealSU (ctype_getBaseType (sRef_getType (e->sref)))) - { - /* - ** This is a bit of a hack to avoid a problem - ** when the code does, - ** (some other struct) x - ** ... - ** x->field - */ - - ret->sref = sRef_copy (e->sref); - usymtab_addForceMustAlias (ret->sref, e->sref); - sRef_setTypeFull (ret->sref, c); - DPRINTF (("Cast: %s -> %s", sRef_unparseFull (e->sref), - sRef_unparseFull (ret->sref))); - } - else - { - ret->sref = e->sref; - sRef_setTypeFull (ret->sref, c); - DPRINTF (("Cast 2: -> %s", sRef_unparseFull (ret->sref))); - } - - /* - ** we allow - ** abstract -> void - ** 0 <-> abstract * - ** void * <-> abstract * (if FLG_ABSTVOIDP) - ** abstract * <-> void * (if FLG_ABSTVOIDP) - */ - - if (ctype_isVoid (c)) /* cast to void is always okay --- discard value */ - { - ; - } - else if (ctype_isRealAP (c)) /* casting to array or pointer */ - { - ctype bc = ctype_getBaseType (c); - ctype bt = ctype_getBaseType (t); - ctype rt = ctype_realType (t); - - if (ctype_isFunction (ctype_baseArrayPtr (ctype_realType (c))) - && (ctype_isArrayPtr (rt) - && !ctype_isFunction (ctype_realType (ctype_baseArrayPtr (rt))))) - { - voptgenerror - (FLG_CASTFCNPTR, - message ("Cast from function pointer type (%t) to " - "non-function pointer (%t): %s", - c, t, exprNode_unparse (ret)), - e->loc); - } - - if (!ctype_isFunction (ctype_baseArrayPtr (c)) - && (ctype_isArrayPtr (rt) - && ctype_isFunction (ctype_realType (ctype_baseArrayPtr (rt))))) - { - voptgenerror - (FLG_CASTFCNPTR, - message ("Cast from non-function pointer type (%t) to " - "function pointer (%t): %s", - c, t, exprNode_unparse (ret)), - e->loc); - } - - if (exprNode_isZero (e) && context_getFlag (FLG_ZEROPTR) && - !(ctype_isRealAbstract (bc) - && context_hasAccess (ctype_typeId (bc)))) - { - ; /* okay to cast zero */ - } - else - { - if (ctype_isRealAbstract (bc) - && !context_hasAccess (ctype_typeId (bc))) - { - if (ctype_isVoidPointer (t) || ctype_isUnknown (t)) - { - vnoptgenerror - (FLG_ABSTVOIDP, - message ("Cast to underlying abstract type %t: %s", - c, exprNode_unparse (ret)), - e->loc); - } - else - { - voptgenerror - (FLG_ABSTRACT, - message ("Cast to underlying abstract type %t: %s", - c, exprNode_unparse (ret)), - e->loc); - } - } - - if (ctype_isRealAbstract (bt) - && !context_hasAccess (ctype_typeId (bt))) - { - if (ctype_isUnknown (c) || ctype_isVoidPointer (c)) - { - vnoptgenerror - (FLG_ABSTVOIDP, - message ("Cast from underlying abstract type %t: %s", - t, exprNode_unparse (ret)), - e->loc); - } - else - { - voptgenerror - (FLG_ABSTRACT, - message ("Cast from underlying abstract type %t: %s", - t, exprNode_unparse (ret)), - e->loc); - } - } - } - } - else - { - ctype bt = ctype_realType (ctype_getBaseType (t)); - ctype bc = ctype_realType (ctype_getBaseType (c)); - - if (ctype_isAbstract (bt) && !context_hasAccess (ctype_typeId (bt))) - { - if (ctype_match (c, t)) - { - if (ctype_equal (c, t)) - { - voptgenerror - (FLG_TYPE, - message ("Redundant cast involving abstract type %t: %s", - bt, exprNode_unparse (ret)), - e->loc); - } - } - else - { - voptgenerror - (FLG_ABSTRACT, - message ("Cast from abstract type %t: %s", - bt, exprNode_unparse (ret)), - e->loc); - } - } - - if (ctype_isAbstract (bc) - && !context_hasAccess (ctype_typeId (bc))) - { - if (ctype_match (c, t)) - { - ; - } - else - { - voptgenerror - (FLG_ABSTRACT, - message ("Cast to abstract type %t: %s", bc, - exprNode_unparse (ret)), - e->loc); - } - } - } - - if (ctype_isAbstract (c)) - { - if (sRef_isExposed (e->sref) || sRef_isOnly (e->sref)) - { - /* okay, cast exposed to abstract */ - sRef_clearExKindComplete (ret->sref, fileloc_undefined); - } - else - { - if (ctype_isVisiblySharable (t) - && sRef_isExternallyVisible (e->sref) - && !(ctype_isAbstract (t) - && context_hasAccess (ctype_typeId (t)))) - { - voptgenerror - (FLG_CASTEXPOSE, - message ("Cast to abstract type from externally visible " - "mutable storage exposes rep of %s: %s", - ctype_unparse (c), - exprNode_unparse (e)), - e->loc); - } - } - } - - return (ret); -} - -static bool -evaluationOrderUndefined (lltok op) -{ - int opid = lltok_getTok (op); - - return (opid != AND_OP && opid != OR_OP); -} - -static bool checkIntegral (/*@notnull@*/ exprNode e1, - /*@notnull@*/ exprNode e2, - /*@notnull@*/ exprNode ret, - lltok op) -{ - bool error = FALSE; - - ctype te1 = exprNode_getType (e1); - ctype te2 = exprNode_getType (e2); - - ctype tr1 = ctype_realishType (te1); - ctype tr2 = ctype_realishType (te2); - - if (ctype_isForceRealInt (&tr1) && ctype_isForceRealInt (&tr2)) - { - ; - } - else - { - if (context_msgStrictOps ()) - { - if (!ctype_isInt (tr1) && !ctype_isInt (tr2)) - { - if (ctype_sameName (te1, te2)) - { - error = optgenerror - (FLG_STRICTOPS, - message ("Operands of %s are non-integer (%t): %s", - lltok_unparse (op), te1, - exprNode_unparse (ret)), - e1->loc); - } - else - { - error = optgenerror - (FLG_STRICTOPS, - message ("Operands of %s are non-integers (%t, %t): %s", - lltok_unparse (op), te1, te2, - exprNode_unparse (ret)), - e1->loc); - } - } - else if (!ctype_isInt (tr1)) - { - error = optgenerror - (FLG_STRICTOPS, - message ("Left operand of %s is non-integer (%t): %s", - lltok_unparse (op), te1, exprNode_unparse (ret)), - e1->loc); - } - else - /* !ctype_isInt (te2) */ - { - error = optgenerror - (FLG_STRICTOPS, - message ("Right operand of %s is non-integer (%t): %s", - lltok_unparse (op), te2, exprNode_unparse (ret)), - e2->loc); - } - } - } - - return !error; -} - -/* -** returns exprNode representing e1 op e2 -** -** uses msg if there are errors -** can be used for both assignment ops and regular ops -** -** modifies e1 -*/ - -static /*@only@*/ /*@notnull@*/ exprNode -exprNode_makeOp (/*@keep@*/ exprNode e1, /*@keep@*/ exprNode e2, - /*@keep@*/ lltok op) -{ - ctype te1, te2, tr1, tr2, tret; - int opid = lltok_getTok (op); - bool hasError = FALSE; - exprNode ret; - - if (exprNode_isError (e1)) - { - ret = exprNode_createPartialNVCopy (e2); - } - else - { - ret = exprNode_createPartialNVCopy (e1); - } - - ret->val = multiVal_undefined; - ret->kind = XPR_OP; - ret->edata = exprData_makeOp (e1, e2, op); - - if (exprNode_isError (e1) || exprNode_isError (e2)) - { - if (opid == TLT || opid == TGT || opid == LE_OP || opid == GE_OP - || opid == EQ_OP || opid == NE_OP - || opid == AND_OP || opid == OR_OP) - { - ret->typ = ctype_bool; - } - - if (exprNode_isDefined (e1)) - { - exprNode_checkUse (ret, e1->sref, e1->loc); - } - - if (exprNode_isDefined (e2)) - { - exprNode_mergeUSs (ret, e2); - exprNode_checkUse (ret, e2->sref, e2->loc); - } - - return ret; - } - - tret = ctype_unknown; - te1 = exprNode_getType (e1); - DPRINTF (("te1 = %s / %s", exprNode_unparse (e1), ctype_unparse (te1))); - - te2 = exprNode_getType (e2); - - tr1 = ctype_realishType (te1); - tr2 = ctype_realishType (te2); - - if (opid == OR_OP) - { - ret->guards = guardSet_or (ret->guards, e2->guards); - } - else if (opid == AND_OP) - { - ret->guards = guardSet_and (ret->guards, e2->guards); - } - else - { - /* no guards */ - } - - if (opid == EQ_OP || opid == NE_OP) - { - exprNode temp1 = e1, temp2 = e2; - - /* could do NULL == x */ - - if (exprNode_isNullValue (e1) || exprNode_isUnknownConstant (e1)) - { - temp1 = e2; temp2 = e1; - } - - if (exprNode_isNullValue (temp2) || exprNode_isUnknownConstant (temp2)) - { - reflectNullTest (temp1, (opid == NE_OP)); - guardSet_free (ret->guards); - ret->guards = guardSet_copy (temp1->guards); - } - } - - if (opid == TLT || opid == TGT || opid == LE_OP || opid == GE_OP - || opid == EQ_OP || opid == NE_OP || opid == AND_OP || opid == OR_OP) - { - tret = ctype_bool; - } - - if (anyAbstract (tr1, tr2) && - (!((ctype_isRealBool (te1) || ctype_isRealBool (te2)) && - (opid == AND_OP || opid == OR_OP - || opid == EQ_OP || opid == NE_OP)))) - { - abstractOpError (tr1, tr2, op, e1, e2, e1->loc, e2->loc); - } - else if (ctype_isUnknown (te1) || ctype_isUnknown (te2)) - { - /* unknown types, no comparisons possible */ - } - else - { - switch (opid) - { - case TMULT: /* multiplication and division: */ - case TDIV: /* */ - case MUL_ASSIGN: /* numeric, numeric -> numeric */ - case DIV_ASSIGN: /* */ - - tret = checkNumerics (tr1, tr2, te1, te2, e1, e2, op); - break; - - case TPLUS: /* addition and subtraction: */ - case TMINUS: /* pointer, int -> pointer */ - case SUB_ASSIGN: /* int, pointer -> pointer */ - case ADD_ASSIGN: /* numeric, numeric -> numeric */ - - tr1 = ctype_fixArrayPtr (tr1); - - if ((ctype_isRealPointer (tr1) && !exprNode_isNullValue (e1)) - && (!ctype_isRealPointer (tr2) && ctype_isRealInt (tr2))) - { - /* pointer + int */ - - if (context_msgPointerArith ()) - { - voptgenerror - (FLG_POINTERARITH, - message ("Pointer arithmetic (%t, %t): %s", - te1, te2, exprNode_unparse (ret)), - e1->loc); - } - - if (sRef_possiblyNull (e1->sref) - && !usymtab_isGuarded (e1->sref)) - { - voptgenerror - (FLG_NULLPOINTERARITH, - message ("Pointer arithmetic involving possibly " - "null pointer %s: %s", - exprNode_unparse (e1), - exprNode_unparse (ret)), - e1->loc); - } - - ret->sref = sRef_copy (e1->sref); - - /* start modifications */ - /* added by Seejo on 4/16/2000 */ - - /* Arithmetic operations on pointers wil modify the size/len/null terminated - status */ - if ((sRef_isPossiblyNullTerminated (e1->sref)) || (sRef_isNullTerminated(e1->sref))) { - //if (sRef_isKnown (e->sref)) { - //ret->sref = sRef_makeAddress (e->sref); - //} - - int val; - /*drl 1-4-2001 - added ugly fixed to stop - program from crashing on point + int +int - one day I'll fix this or ask Seejo wtf the codes supposed to do. */ - - if (!multiVal_isInt (e2->val) ) - break; - /*end drl*/ - - val = (int) multiVal_forceInt (e2->val); - - /* Operator : + or += */ - if ((lltok_getTok (op) == TPLUS) || (lltok_getTok(op) == ADD_ASSIGN)) { - if (sRef_getSize(e1->sref) >= val) {/* Incrementing the pointer by - val should not result in a - size < 0 (size = 0 is ok !) */ - - sRef_setSize (ret->sref, sRef_getSize(e1->sref) - val); - - if (sRef_getLen(e1->sref) == val) { /* i.e. the character at posn val is \0 */ - sRef_setNotNullTerminatedState(ret->sref); - sRef_resetLen (ret->sref); - } else { - sRef_setNullTerminatedState(ret->sref); - sRef_setLen (ret->sref, sRef_getLen(e1->sref) - val); - } - } - } - - /* Operator : - or -= */ - if ((lltok_getTok (op) == TMINUS) || (lltok_getTok (op) == SUB_ASSIGN)) { - if (sRef_getSize(e1->sref) >= 0) { - sRef_setSize (ret->sref, sRef_getSize(e1->sref) + val); - sRef_setLen (ret->sref, sRef_getLen(e1->sref) + val); - } - } - } - - /* end modifications */ - - sRef_setNullError (ret->sref); - - /* - ** Fixed for 2.2c: the alias state of ptr + int is dependent, - ** since is points to storage that should not be deallocated - ** through this pointer. - */ - - if (sRef_isOnly (ret->sref) - || sRef_isFresh (ret->sref)) - { - sRef_setAliasKind (ret->sref, AK_DEPENDENT, exprNode_loc (ret)); - } - - tret = e1->typ; - } - else if ((!ctype_isRealPointer(tr1) && ctype_isRealInt (tr1)) - && (ctype_isRealPointer (tr2) && !exprNode_isNullValue (e2))) - { - if (context_msgPointerArith ()) - { - voptgenerror - (FLG_POINTERARITH, - message ("Pointer arithmetic (%t, %t): %s", - te1, te2, exprNode_unparse (ret)), - e1->loc); - } - - if (sRef_possiblyNull (e1->sref) - && !usymtab_isGuarded (e1->sref)) - { - voptgenerror - (FLG_NULLPOINTERARITH, - message ("Pointer arithmetic involving possibly " - "null pointer %s: %s", - exprNode_unparse (e2), - exprNode_unparse (ret)), - e2->loc); - } - - ret->sref = sRef_copy (e2->sref); - - /* start modifications */ - /* added by Seejo on 4/16/2000 */ - - /* Arithmetic operations on pointers wil modify the size/len/null terminated - status */ - - if ((sRef_isPossiblyNullTerminated (e2->sref)) || (sRef_isNullTerminated(e2->sref))) { - //if (sRef_isKnown (e->sref)) { - //ret->sref = sRef_makeAddress (e->sref); - //} - - int val = (int) multiVal_forceInt (e1->val); - - /* Operator : + or += */ - if ((lltok_getTok (op) == TPLUS) || (lltok_getTok(op) == ADD_ASSIGN)) { - if (sRef_getSize(e2->sref) >= val) {/* Incrementing the pointer by - val should not result in a - size < 0 (size = 0 is ok !) */ - - sRef_setSize (ret->sref, sRef_getSize(e2->sref) - val); - - if (sRef_getLen(e2->sref) == val) { /* i.e. the character at posn val is \0 */ - sRef_setNotNullTerminatedState(ret->sref); - sRef_resetLen (ret->sref); - } else { - sRef_setNullTerminatedState(ret->sref); - sRef_setLen (ret->sref, sRef_getLen(e2->sref) - val); - } - } - } - - /* Operator : - or -= */ - if ((lltok_getTok (op) == TMINUS) || (lltok_getTok (op) == SUB_ASSIGN)) { - if (sRef_getSize(e2->sref) >= 0) { - sRef_setSize (ret->sref, sRef_getSize(e2->sref) + val); - sRef_setLen (ret->sref, sRef_getLen(e2->sref) + val); - } - } - } - - /* end modifications */ - - sRef_setNullError (ret->sref); - - /* - ** Fixed for 2.2c: the alias state of ptr + int is dependent, - ** since is points to storage that should not be deallocated - ** through this pointer. - */ - - if (sRef_isOnly (ret->sref) - || sRef_isFresh (ret->sref)) { - sRef_setAliasKind (ret->sref, AK_DEPENDENT, exprNode_loc (ret)); - } - - tret = e2->typ; - ret->sref = e2->sref; - } - else - { - tret = checkNumerics (tr1, tr2, te1, te2, e1, e2, op); - } - - break; - - case LEFT_ASSIGN: /* Shifts: should be unsigned values */ - case RIGHT_ASSIGN: - case LEFT_OP: - case RIGHT_OP: - case TAMPERSAND: /* bitwise & */ - case AND_ASSIGN: - case TCIRC: /* ^ (XOR) */ - case TBAR: - case XOR_ASSIGN: - case OR_ASSIGN: - { - bool reported = FALSE; - flagcode code = FLG_BITWISEOPS; - - if (opid == LEFT_OP || opid == LEFT_ASSIGN - || opid == RIGHT_OP || opid == RIGHT_ASSIGN) { - code = FLG_SHIFTSIGNED; - } - - if (!ctype_isUnsigned (tr1)) - { - if (exprNode_isNonNegative (e1)) { - ; - } else { - reported = optgenerror - (code, - message ("Left operand of %s is not unsigned value (%t): %s", - lltok_unparse (op), te1, - exprNode_unparse (ret)), - e1->loc); - - if (reported) { - te1 = ctype_uint; - } - } - } - else - { - /* right need not be signed for shifts */ - if (code != FLG_SHIFTSIGNED - && !ctype_isUnsigned (tr2)) - { - if (!exprNode_isNonNegative (e2)) { - reported = optgenerror - (code, - message ("Right operand of %s is not unsigned value (%t): %s", - lltok_unparse (op), te2, - exprNode_unparse (ret)), - e2->loc); - } - } - } - - if (!reported) - { - if (!checkIntegral (e1, e2, ret, op)) { - te1 = ctype_unknown; - } - } - - DPRINTF (("Set: %s", ctype_unparse (te1))); - - /* - ** tret is the widest type of te1 and te2 - */ - - tret = ctype_widest (te1, te2); - break; - } - case MOD_ASSIGN: - case TPERCENT: - if (checkIntegral (e1, e2, ret, op)) { - tret = te1; - } else { - tret = ctype_unknown; - } - break; - case EQ_OP: - case NE_OP: - case TLT: /* comparisons */ - case TGT: /* numeric, numeric -> bool */ - if ((ctype_isReal (tr1) && !ctype_isInt (tr1)) - || (ctype_isReal (tr2) && !ctype_isInt (tr2))) - { - ctype rtype = tr1; - bool fepsilon = FALSE; - - if (!ctype_isReal (rtype) || ctype_isInt (rtype)) - { - rtype = tr2; - } - - if (opid == TLT || opid == TGT) - { - uentry ue1 = exprNode_getUentry (e1); - uentry ue2 = exprNode_getUentry (e2); - - /* - ** FLT_EPSILON, etc. really is a variable, not - ** a constant. - */ - - if (uentry_isVariable (ue1)) - { - cstring uname = uentry_rawName (ue1); - - if (cstring_equalLit (uname, "FLT_EPSILON") - || cstring_equalLit (uname, "DBL_EPSILON") - || cstring_equalLit (uname, "LDBL_EPSILON")) - { - fepsilon = TRUE; - } - } - - if (uentry_isVariable (ue2)) - { - cstring uname = uentry_rawName (ue2); - - if (cstring_equalLit (uname, "FLT_EPSILON") - || cstring_equalLit (uname, "DBL_EPSILON") - || cstring_equalLit (uname, "LDBL_EPSILON")) - { - fepsilon = TRUE; - } - } - } - - if (fepsilon) - { - ; /* Don't complain. */ - } - else - { - voptgenerror - (FLG_REALCOMPARE, - message ("Dangerous comparison involving %s types: %s", - ctype_unparse (rtype), - exprNode_unparse (ret)), - ret->loc); - } - } - /*@fallthrough@*/ - case LE_OP: - case GE_OP: - - /* - ** Types should match. - */ - - if (!exprNode_matchTypes (e1, e2)) - { - hasError = gentypeerror - (te1, e1, te2, e2, - message ("Operands of %s have incompatible types (%t, %t): %s", - lltok_unparse (op), te1, te2, exprNode_unparse (ret)), - e1->loc); - - } - - if (hasError - || (ctype_isForceRealNumeric (&tr1) - && ctype_isForceRealNumeric (&tr2)) || - (ctype_isRealPointer (tr1) && ctype_isRealPointer (tr2))) - { - ; /* okay */ - } - else - { - if ((ctype_isRealNumeric (tr1) && ctype_isRealPointer (tr2)) || - (ctype_isRealPointer (tr1) && ctype_isRealNumeric (tr2))) - { - voptgenerror - (FLG_PTRNUMCOMPARE, - message ("Comparison of pointer and numeric (%t, %t): %s", - te1, te2, exprNode_unparse (ret)), - e1->loc); - } - else - { - (void) checkNumerics (tr1, tr2, te1, te2, e1, e2, op); - } - tret = ctype_bool; - } - - /* EQ_OP should NOT be used with booleans (unless one is FALSE) */ - - if ((opid == EQ_OP || opid == NE_OP) && - ctype_isDirectBool (tr1) && ctype_isDirectBool (tr2)) - { - /* - ** is one a variable? - */ - - if (uentry_isVariable (exprNode_getUentry (e1)) - || uentry_isVariable (exprNode_getUentry (e2))) - { - /* - ** comparisons with FALSE are okay - */ - - if (exprNode_isFalseConstant (e1) - || exprNode_isFalseConstant (e2)) - { - ; - } - else - { - voptgenerror - (FLG_BOOLCOMPARE, - message - ("Use of %q with %s variables (risks inconsistency because " - "of multiple true values): %s", - cstring_makeLiteral ((opid == EQ_OP) ? "==" : "!="), - context_printBoolName (), exprNode_unparse (ret)), - e1->loc); - } - } - } - break; - - case AND_OP: /* bool, bool -> bool */ - case OR_OP: - - if (ctype_isForceRealBool (&tr1) && ctype_isForceRealBool (&tr2)) - { - ; - } - else - { - if (context_maybeSet (FLG_BOOLOPS)) - { - if (!ctype_isRealBool (te1) && !ctype_isRealBool (te2)) - { - if (ctype_sameName (te1, te2)) - { - voptgenerror - (FLG_BOOLOPS, - message ("Operands of %s are non-boolean (%t): %s", - lltok_unparse (op), te1, - exprNode_unparse (ret)), - e1->loc); - } - else - { - voptgenerror - (FLG_BOOLOPS, - message - ("Operands of %s are non-booleans (%t, %t): %s", - lltok_unparse (op), te1, te2, exprNode_unparse (ret)), - e1->loc); - } - } - else if (!ctype_isRealBool (te1)) - { - voptgenerror - (FLG_BOOLOPS, - message ("Left operand of %s is non-boolean (%t): %s", - lltok_unparse (op), te1, exprNode_unparse (ret)), - e1->loc); - } - else if (!ctype_isRealBool (te2)) - { - voptgenerror - (FLG_BOOLOPS, - message ("Right operand of %s is non-boolean (%t): %s", - lltok_unparse (op), te2, exprNode_unparse (ret)), - e2->loc); - } - else - { - ; - } - } - tret = ctype_bool; - } - break; - default: { - llfatalbug - (cstring_makeLiteral - ("There has been a problem in the parser. This is due to a bug " - "in either lclint, bison or gcc version 2.95 optimizations, " - "but it has not been confirmed. Please try rebuidling LCLint " - "without the -O option.")); - } - } - } - - DPRINTF (("Return type: %s", ctype_unparse (tret))); - ret->typ = tret; - - exprNode_checkUse (ret, e1->sref, e1->loc); - exprNode_mergeUSs (ret, e2); - exprNode_checkUse (ret, e2->sref, e2->loc); - - return ret; -} - -/*@only@*/ exprNode -exprNode_op (/*@only@*/ exprNode e1, /*@keep@*/ exprNode e2, - /*@only@*/ lltok op) -{ - exprNode ret; - - checkMacroParen (e1); - checkMacroParen (e2); - - if (evaluationOrderUndefined (op) && context_maybeSet (FLG_EVALORDER)) - { - checkExpressionDefined (e1, e2, op); - } - - ret = exprNode_makeOp (e1, e2, op); - return (ret); -} - -static -void exprNode_checkAssignMod (exprNode e1, exprNode ret) -{ - /* - ** This is somewhat bogus! - ** - ** Assigning to a nested observer in a non-observer datatype - ** should not produce an error. - */ - - sRef ref = exprNode_getSref (e1); - - DPRINTF (("Check assign mod: %s", - sRef_unparseFull (ref))); - - if (sRef_isObserver (ref) - || ((sRef_isFileStatic (ref) || sRef_isGlobal (ref)) - && ctype_isArray (ctype_realType (sRef_getType (ref))))) - { - sRef base = sRef_getBase (ref); - - if (sRef_isValid (base) && sRef_isObserver (base)) - { - exprNode_checkModify (e1, ret); - } - else - { - exprNode_checkModifyVal (e1, ret); - } - } - else - { - exprNode_checkModify (e1, ret); - } -} - -exprNode -exprNode_assign (/*@only@*/ exprNode e1, - /*@only@*/ exprNode e2, /*@only@*/ lltok op) -{ - bool isalloc = FALSE; - bool isjustalloc = FALSE; - exprNode ret; - - DPRINTF (("%s [%s] <- %s [%s]", - exprNode_unparse (e1), - ctype_unparse (e1->typ), - exprNode_unparse (e2), - ctype_unparse (e2->typ))); - - if (lltok_getTok (op) != TASSIGN) - { - ret = exprNode_makeOp (e1, e2, op); - } - else - { - ret = exprNode_createPartialCopy (e1); - ret->kind = XPR_ASSIGN; - ret->edata = exprData_makeOp (e1, e2, op); - - if (!exprNode_isError (e2)) - { - ret->sets = sRefSet_union (ret->sets, e2->sets); - ret->msets = sRefSet_union (ret->msets, e2->msets); - ret->uses = sRefSet_union (ret->uses, e2->uses); - } - } - - checkExpressionDefined (e1, e2, op); - - if (exprNode_isError (e1)) - { - if (!exprNode_isError (e2)) - { - ret->loc = fileloc_update (ret->loc, e2->loc); - } - else - { - ret->loc = fileloc_update (ret->loc, g_currentloc); - } - } - - if (!exprNode_isError (e2)) - { - checkMacroParen (e2); - } - - if (exprNode_isDefined (e1)) - { - if (sRef_isMacroParamRef (e1->sref)) - { - if (context_inIterDef ()) - { - uentry ue = sRef_getUentry (e1->sref); - - if (uentry_isYield (ue)) - { - ; - } - else - { - if (fileloc_isDefined (e1->loc)) - { - voptgenerror - (FLG_MACROPARAMS, - message ("Assignment to non-yield iter parameter: %q", - sRef_unparse (e1->sref)), - e1->loc); - } - else - { - voptgenerror - (FLG_MACROPARAMS, - message ("Assignment to non-yield iter parameter: %q", - sRef_unparse (e1->sref)), - g_currentloc); - } - } - } - else - { - if (fileloc_isDefined (e1->loc)) - { - voptgenerror - (FLG_MACROASSIGN, - message ("Assignment to macro parameter: %q", - sRef_unparse (e1->sref)), - e1->loc); - } - else - { - voptgenerror - (FLG_MACROASSIGN, - message ("Assignment to macro parameter: %q", - sRef_unparse (e1->sref)), - g_currentloc); - } - } - } - else - { - exprNode_checkAssignMod (e1, ret); - } - - if (exprNode_isDefined (e2)) - { - if (lltok_getTok (op) == TASSIGN) - { - ctype te1 = exprNode_getType (e1); - ctype te2 = exprNode_getType (e2); - - if (!ctype_forceMatch (te1, te2)) - { - if (exprNode_matchLiteral (te1, e2)) - { - ; - } - else - { - (void) gentypeerror - (te2, e2, te1, e1, - message ("Assignment of %t to %t: %s %s %s", - te2, te1, exprNode_unparse (e1), - lltok_unparse (op), - exprNode_unparse (e2)), - e1->loc); - } - } - } - - exprNode_mergeUSs (ret, e2); - exprNode_checkUse (ret, e2->sref, e2->loc); - - doAssign (e1, e2, FALSE); - ret->sref = e1->sref; - } - else - { - if (exprNode_isDefined (e2)) - { - exprNode_mergeUSs (ret, e2); - exprNode_checkUse (ret, e2->sref, e2->loc); - } - } - - if (sRef_isPointer (e1->sref) && !sRef_isMacroParamRef (e1->sref)) - { - exprNode_checkUse (ret, sRef_getBase (e1->sref), e1->loc); - } - - isjustalloc = sRef_isJustAllocated (e1->sref); - isalloc = sRef_isAllocated (e1->sref); - - if (sRef_isField (e1->sref)) - { - sRef root = sRef_getRootBase (sRef_getBase (e1->sref)); - - if (!sRef_isAllocated (root) && !sRef_isMacroParamRef (root)) - { - exprNode_checkUse (ret, root, e1->loc); - } - - } - - /* - ** be careful! this defines e1->sref. - */ - - if (!sRef_isMacroParamRef (e1->sref)) - { - exprNode_checkSet (ret, e1->sref); - } - - if (isjustalloc) - { - sRef_setAllocatedComplete (e1->sref, exprNode_isDefined (e2) - ? e2->loc : e1->loc); - } - else - { - if (isalloc) - { - sRef_setAllocatedShallowComplete (e1->sref, exprNode_loc (e2)); - } - } - } - - return ret; -} - -exprNode -exprNode_cond (/*@keep@*/ exprNode pred, /*@keep@*/ exprNode ifclause, - /*@keep@*/ exprNode elseclause) -{ - exprNode ret; - - if (!exprNode_isError (pred)) - { - ret = exprNode_createPartialCopy (pred); - checkMacroParen (pred); - exprNode_checkPred (cstring_makeLiteralTemp ("conditional"), pred); - - if (!exprNode_isError (ifclause)) - { - checkMacroParen (ifclause); /* update macro counts! */ - - if (!exprNode_isError (elseclause)) - { - checkMacroParen (elseclause); - - if (!exprNode_matchTypes (ifclause, elseclause)) - { - if (gentypeerror - (exprNode_getType (ifclause), - ifclause, - exprNode_getType (elseclause), - elseclause, - message ("Conditional clauses are not of same type: " - "%s (%t), %s (%t)", - exprNode_unparse (ifclause), - exprNode_getType (ifclause), - exprNode_unparse (elseclause), - exprNode_getType (elseclause)), - ifclause->loc)) - { - ret->sref = sRef_undefined; - ret->typ = ctype_unknown; - } - } - else - { - /* for now...should merge the states */ - ret->sref = ifclause->sref; - ret->typ = ifclause->typ; - - if (exprNode_isNullValue (ifclause)) - { - ret->typ = elseclause->typ; - } - } - - exprNode_checkUse (ret, pred->sref, pred->loc); - exprNode_checkUse (ifclause, ifclause->sref, ifclause->loc); - exprNode_checkUse (elseclause, elseclause->sref, elseclause->loc); - - exprNode_mergeCondUSs (ret, ifclause, elseclause); - - } - else - { - ret->typ = ifclause->typ; - - exprNode_checkUse (pred, pred->sref, pred->loc); - exprNode_checkUse (ifclause, ifclause->sref, ifclause->loc); - - exprNode_mergeCondUSs (ret, ifclause, exprNode_undefined); - } - } - else - { - if (!exprNode_isError (elseclause)) - { - ret->typ = elseclause->typ; - - exprNode_checkUse (pred, pred->sref, pred->loc); - exprNode_checkUse (elseclause, elseclause->sref, elseclause->loc); - - exprNode_mergeCondUSs (ret, exprNode_undefined, elseclause); - } - } - } - else /* pred is error */ - { - if (!exprNode_isError (ifclause)) - { - ret = exprNode_createSemiCopy (ifclause); - - checkMacroParen (ifclause); /* update macro counts! */ - - if (!exprNode_isError (elseclause)) - { - checkMacroParen (elseclause); - - ret->typ = ifclause->typ; - - if (!ctype_forceMatch (ifclause->typ, elseclause->typ)) - { - if (gentypeerror - (exprNode_getType (ifclause), - ifclause, - exprNode_getType (elseclause), - elseclause, - message ("Conditional clauses are not of same type: " - "%s (%t), %s (%t)", - exprNode_unparse (ifclause), - exprNode_getType (ifclause), - exprNode_unparse (elseclause), - exprNode_getType (elseclause)), - ifclause->loc)) - { - ret->typ = ctype_unknown; - } - } - - exprNode_checkUse (ifclause, ifclause->sref, ifclause->loc); - exprNode_checkUse (elseclause, elseclause->sref, elseclause->loc); - - exprNode_mergeCondUSs (ret, ifclause, elseclause); - } - } - else if (!exprNode_isError (elseclause)) /* pred, if errors */ - { - ret = exprNode_createSemiCopy (ifclause); - - ret->typ = elseclause->typ; - checkMacroParen (elseclause); - - exprNode_checkUse (elseclause, elseclause->sref, elseclause->loc); - exprNode_mergeCondUSs (ret, exprNode_undefined, elseclause); - } - else /* all errors! */ - { - ret = exprNode_createLoc (ctype_unknown, g_currentloc); - } - } - - ret->kind = XPR_COND; - ret->edata = exprData_makeCond (pred, ifclause, elseclause); - - if (exprNode_isDefined (ifclause) && exprNode_isDefined (elseclause)) - { - exprNode_combineControl (ret, ifclause, elseclause); - } - - return (ret); -} - -exprNode -exprNode_vaArg (/*@only@*/ lltok tok, /*@only@*/ exprNode arg, /*@only@*/ qtype qt) -{ - ctype totype = qtype_getType (qt); - exprNode ret = - exprNode_createPartialLocCopy (arg, fileloc_copy (lltok_getLoc (tok))); - ctype targ; - - /* - ** check use of va_arg : , type -> type - */ - - if (exprNode_isError (arg)) - { - } - else - { - targ = exprNode_getType (arg); - - /* - ** arg should have be a pointer - */ - - if (!ctype_isUA (targ) || - (!usymId_equal (ctype_typeId (targ), - usymtab_getTypeId (cstring_makeLiteralTemp ("va_list"))))) - { - voptgenerror - (FLG_TYPE, - message ("First argument to va_arg is not a va_list (type %t): %s", - targ, exprNode_unparse (arg)), - arg->loc); - } - - exprNode_checkSet (ret, arg->sref); - } - - /* - ** return type is totype - */ - - ret->typ = totype; - ret->kind = XPR_VAARG; - ret->edata = exprData_makeCast (tok, arg, qt); - - return (ret); -} - -exprNode exprNode_labelMarker (/*@only@*/ cstring label) -{ - exprNode ret = exprNode_createPlain (ctype_undefined); - ret->kind = XPR_LABEL; - ret->edata = exprData_makeLiteral (label); - ret->isJumpPoint = TRUE; - - return (ret); /* for now, ignore label */ -} - -exprNode exprNode_notReached (/*@returned@*/ exprNode stmt) -{ - if (exprNode_isDefined (stmt)) - { - stmt->isJumpPoint = TRUE; - - /* This prevent stray no return path errors, etc. */ - stmt->exitCode = XK_MUSTEXIT; - } - - return (stmt); -} - -bool exprNode_isDefaultMarker (exprNode e) -{ - if (exprNode_isDefined (e)) - { - return (e->kind == XPR_DEFAULT || e->kind == XPR_FTDEFAULT); - } - - return FALSE; -} - -bool exprNode_isCaseMarker (exprNode e) -{ - if (exprNode_isDefined (e)) - { - return (e->kind == XPR_FTCASE || e->kind == XPR_CASE); - } - - return FALSE; -} - -bool exprNode_isLabelMarker (exprNode e) -{ - if (exprNode_isDefined (e)) - { - return (e->kind == XPR_LABEL); - } - - return FALSE; -} - -exprNode exprNode_caseMarker (/*@only@*/ exprNode test, bool fallThrough) -{ - exprNode ret = exprNode_createPartialCopy (test); - - ret->kind = fallThrough ? XPR_FTCASE : XPR_CASE; - - if (exprNode_isError (test)) { - return ret; - } - - exprNode_checkUse (ret, test->sref, test->loc); - - usymtab_setExitCode (ret->exitCode); - - if (ret->mustBreak) - { - usymtab_setMustBreak (); - } - - ret->edata = exprData_makeSingle (test); - ret->isJumpPoint = TRUE; - - return ret; -} - -# if 0 -exprNode exprNode_caseStatement (/*@only@*/ exprNode test, /*@only@*/ exprNode stmt, bool fallThrough) -{ - exprNode ret = exprNode_createPartialCopy (test); - - ret->kind = fallThrough ? XPR_FTCASE : XPR_CASE; - ret->edata = exprData_makePair (test, stmt); - ret->isJumpPoint = TRUE; - - if (exprNode_isError (test)) - { - return ret; - } - - exprNode_checkUse (ret, test->sref, test->loc); - - if (exprNode_isError (stmt)) - { - return ret; - } - - exprNode_mergeUSs (ret, stmt); - - ret->exitCode = stmt->exitCode; - ret->mustBreak = stmt->mustBreak; - ret->canBreak = stmt->canBreak; - - usymtab_setExitCode (ret->exitCode); - - if (ret->mustBreak) - { - usymtab_setMustBreak (); - } - - return ret; -} -# endif - -/*@notnull@*/ /*@only@*/ exprNode -exprNode_defaultMarker (/*@only@*/ lltok def, bool fallThrough) -{ - exprNode ret = exprNode_createTok (def); - - ret->isJumpPoint = TRUE; - ret->kind = fallThrough ? XPR_FTDEFAULT : XPR_DEFAULT; - return (ret); -} - -bool -exprNode_mayEscape (exprNode e) -{ - if (exprNode_isDefined (e)) - { - return exitkind_couldEscape (e->exitCode); - } - return FALSE; -} - -static bool -exprNode_mustBreak (exprNode e) -{ - if (exprNode_isDefined (e)) - { - return e->mustBreak; - } - return FALSE; -} - -bool -exprNode_mustEscape (exprNode e) -{ - if (exprNode_isDefined (e)) - { - return exitkind_mustEscape (e->exitCode) || exprNode_mustBreak (e); - } - - return FALSE; -} - -bool -exprNode_errorEscape (exprNode e) -{ - if (exprNode_isDefined (e)) - { - return exitkind_isError (e->exitCode); - } - - return FALSE; -} - -exprNode exprNode_concat (/*@only@*/ exprNode e1, /*@only@*/ exprNode e2) -{ - exprNode ret = exprNode_createPartialCopy (e1); - - ret->edata = exprData_makePair (e1, e2); - ret->kind = XPR_STMTLIST; - - if (exprNode_isDefined (e1)) - { - ret->isJumpPoint = e1->isJumpPoint; - ret->canBreak = e1->canBreak; - } - else - { - if (exprNode_isDefined (e2)) - { - ret->loc = fileloc_update (ret->loc, e2->loc); - } - } - - if (exprNode_isDefined (e2)) - { - ret->exitCode = e2->exitCode; - ret->mustBreak = e2->mustBreak; - if (e2->canBreak) ret->canBreak = TRUE; - } - - /* - ** if e1 must return, then e2 is unreachable! - */ - - if (exprNode_isDefined (e1) && exprNode_isDefined (e2)) - { - if ((exprNode_mustEscape (e1) || exprNode_mustBreak (e1)) - && !(e2->isJumpPoint)) - { - if (context_getFlag (FLG_UNREACHABLE)) - { - exprNode nr = e2; - - if (e2->kind == XPR_STMT) - { - nr = exprData_getUopNode (e2->edata); - } - - if ((nr->kind == XPR_TOK - && lltok_isSemi (exprData_getTok (nr->edata)))) - { - /* okay to have unreachable ";" */ - ret->exitCode = XK_MUSTEXIT; - ret->canBreak = TRUE; - } - else - { - if (optgenerror (FLG_UNREACHABLE, - message ("Unreachable code: %s", - exprNode_unparseFirst (nr)), - exprNode_loc (nr))) - { - ret->isJumpPoint = TRUE; - ret->mustBreak = FALSE; - ret->exitCode = XK_ERROR; - DPRINTF (("Jump point: %s", exprNode_unparse (ret))); - } - else - { - ret->exitCode = XK_MUSTEXIT; - ret->canBreak = TRUE; - } - - } - } - } - else - { - if ((e2->kind == XPR_CASE || e2->kind == XPR_DEFAULT)) - { - /* - ** We want a warning anytime we have: - ** case xxx: ... - ** yyy; <<<- no break or return - ** case zzz: ... - */ - - exprNode lastStmt = exprNode_lastStatement (e1); - - if (exprNode_isDefined (lastStmt) - && !exprNode_mustEscape (lastStmt) - && !exprNode_mustBreak (lastStmt) - && !exprNode_isCaseMarker (lastStmt) - && !exprNode_isDefaultMarker (lastStmt) - && !exprNode_isLabelMarker (lastStmt)) - { - voptgenerror (FLG_CASEBREAK, - cstring_makeLiteral - ("Fall through case (no preceeding break)"), - e2->loc); - } - } - } - } - - exprNode_mergeUSs (ret, e2); - ret = exprNode_mergeEnvironments (ret, e1, e2); - usymtab_setExitCode (ret->exitCode); - - if (ret->mustBreak) - { - usymtab_setMustBreak (); - } - - return ret; -} - -exprNode exprNode_createTok (/*@only@*/ lltok t) -{ - exprNode ret = exprNode_create (ctype_unknown); - ret->kind = XPR_TOK; - ret->edata = exprData_makeTok (t); - return ret; -} - -exprNode exprNode_statement (/*@only@*/ exprNode e, /*@only@*/ lltok t) -{ - if (!exprNode_isError (e)) - { - exprNode_checkStatement(e); - } - - return (exprNode_statementError (e, t)); -} - -static exprNode exprNode_statementError (/*@only@*/ exprNode e, /*@only@*/ lltok t) -{ - exprNode ret = exprNode_createPartialCopy (e); - - if (!exprNode_isError (e)) - { - if (e->kind != XPR_ASSIGN) - { - exprNode_checkUse (ret, e->sref, e->loc); - } - - ret->exitCode = e->exitCode; - ret->canBreak = e->canBreak; - ret->mustBreak = e->mustBreak; - } - - ret->edata = exprData_makeUop (e, t); - ret->kind = XPR_STMT; - - return ret; -} - -exprNode exprNode_checkExpr (/*@returned@*/ exprNode e) -{ - if (!exprNode_isError (e)) - { - if (e->kind != XPR_ASSIGN) - { - exprNode_checkUse (e, e->sref, e->loc); - } - } - - return e; -} - -void exprNode_produceGuards (exprNode pred) -{ - if (!exprNode_isError (pred)) - { - if (ctype_isRealPointer (pred->typ)) - { - pred->guards = guardSet_addTrueGuard (pred->guards, pred->sref); - } - - exprNode_checkUse (pred, pred->sref, pred->loc); - exprNode_resetSref (pred); - } -} - -exprNode exprNode_makeBlock (/*@only@*/ exprNode e) -{ - exprNode ret = exprNode_createPartialCopy (e); - - if (!exprNode_isError (e)) - { - ret->exitCode = e->exitCode; - ret->canBreak = e->canBreak; - ret->mustBreak = e->mustBreak; - } - - ret->edata = exprData_makeSingle (e); - ret->kind = XPR_BLOCK; - return ret; -} - -bool exprNode_isBlock (exprNode e) -{ - return (exprNode_isDefined (e) - && ((e)->kind == XPR_BLOCK)); -} - -bool exprNode_isAssign (exprNode e) -{ - if (exprNode_isDefined (e)) - { - return (e->kind == XPR_ASSIGN); - } - - return FALSE; -} - -bool exprNode_isEmptyStatement (exprNode e) -{ - return (exprNode_isDefined (e) - && (e->kind == XPR_TOK) - && (lltok_isSemi (exprData_getTok (e->edata)))); -} - -exprNode exprNode_if (/*@only@*/ exprNode pred, /*@only@*/ exprNode tclause) -{ - exprNode ret; - bool emptyErr = FALSE; - - if (context_maybeSet (FLG_IFEMPTY)) - { - if (exprNode_isEmptyStatement (tclause)) - { - emptyErr = optgenerror (FLG_IFEMPTY, - cstring_makeLiteral - ("Body of if statement is empty"), - exprNode_loc (tclause)); - } - } - - if (!emptyErr && context_maybeSet (FLG_IFBLOCK)) - { - if (exprNode_isDefined (tclause) - && !exprNode_isBlock (tclause)) - { - voptgenerror (FLG_IFBLOCK, - message - ("Body of if statement is not a block: %s", - exprNode_unparse (tclause)), - exprNode_loc (tclause)); - } - } - - if (exprNode_isError (pred)) - { - if (exprNode_isError (tclause)) - { - ret = exprNode_createLoc (ctype_unknown, g_currentloc); - } - else - { - ret = exprNode_createPartialCopy (tclause); - } - } - else - { - if (exprNode_mustEscape (pred)) - { - voptgenerror - (FLG_UNREACHABLE, - message ("Predicate always exits: %s", exprNode_unparse (pred)), - exprNode_loc (pred)); - } - - exprNode_checkPred (cstring_makeLiteralTemp ("if"), pred); - exprNode_checkUse (pred, pred->sref, pred->loc); - - if (!exprNode_isError (tclause)) - { - exprNode_mergeCondUSs (pred, tclause, exprNode_undefined); - } - - ret = exprNode_createPartialCopy (pred); - } - - ret->kind = XPR_IF; - ret->edata = exprData_makePair (pred, tclause); - - ret->exitCode = XK_UNKNOWN; - - if (exprNode_isDefined (tclause)) - { - ret->exitCode = exitkind_makeConditional (tclause->exitCode); - ret->canBreak = tclause->canBreak; - ret->sets = sRefSet_union (ret->sets, tclause->sets); - ret->msets = sRefSet_union (ret->msets, tclause->msets); - ret->uses = sRefSet_union (ret->uses, tclause->uses); - } - - ret->mustBreak = FALSE; - - return ret; -} - -exprNode exprNode_ifelse (/*@only@*/ exprNode pred, - /*@only@*/ exprNode tclause, - /*@only@*/ exprNode eclause) -{ - exprNode ret; - bool tEmptyErr = FALSE; - bool eEmptyErr = FALSE; - - if (context_maybeSet (FLG_IFEMPTY)) - { - if (exprNode_isEmptyStatement (tclause)) - { - tEmptyErr = optgenerror - (FLG_IFEMPTY, - cstring_makeLiteral - ("Body of if clause of if statement is empty"), - exprNode_loc (tclause)); - } - - if (exprNode_isEmptyStatement (eclause)) - { - eEmptyErr = optgenerror - (FLG_IFEMPTY, - cstring_makeLiteral - ("Body of else clause of if statement is empty"), - exprNode_loc (eclause)); - } - } - - if (context_maybeSet (FLG_IFBLOCK)) - { - if (!tEmptyErr - && exprNode_isDefined (tclause) - && !exprNode_isBlock (tclause)) - { - voptgenerror (FLG_IFBLOCK, - message - ("Body of if clause of if statement is not a block: %s", - exprNode_unparse (tclause)), - exprNode_loc (tclause)); - } - - if (!eEmptyErr - && exprNode_isDefined (eclause) - && !exprNode_isBlock (eclause) - && !(eclause->kind == XPR_IF) - && !(eclause->kind == XPR_IFELSE)) - { - voptgenerror - (FLG_IFBLOCK, - message - ("Body of else clause of if statement is not a block: %s", - exprNode_unparse (eclause)), - exprNode_loc (eclause)); - } - } - - if (context_maybeSet (FLG_ELSEIFCOMPLETE)) - { - if (exprNode_isDefined (eclause) - && (eclause->kind == XPR_IF)) - { - voptgenerror (FLG_ELSEIFCOMPLETE, - message ("Incomplete else if logic (no final else): %s", - exprNode_unparse (eclause)), - exprNode_loc (eclause)); - } - } - - if (exprNode_isError (pred)) - { - if (exprNode_isError (tclause)) - { - if (exprNode_isError (eclause)) - { - ret = exprNode_createLoc (ctype_unknown, g_currentloc); - } - else - { - ret = exprNode_createPartialCopy (eclause); - } - } - else - { - ret = exprNode_createPartialCopy (tclause); - } - } - else /* pred is okay */ - { - ret = exprNode_createPartialCopy (pred); - - if (exprNode_mustEscape (pred)) - { - voptgenerror - (FLG_UNREACHABLE, - message ("Predicate always exits: %s", exprNode_unparse (pred)), - exprNode_loc (pred)); - } - - exprNode_checkPred (cstring_makeLiteralTemp ("if"), pred); - exprNode_checkUse (ret, pred->sref, pred->loc); - - exprNode_mergeCondUSs (ret, tclause, eclause); - } - - ret->kind = XPR_IFELSE; - ret->edata = exprData_makeCond (pred, tclause, eclause); - - if (exprNode_isDefined (tclause) && exprNode_isDefined (eclause)) - { - exprNode_combineControl (ret, tclause, eclause); - ret->loc = fileloc_update (ret->loc, eclause->loc); - } - - return ret; -} - -/* -** *allpaths <- TRUE iff all executions paths must go through the switch -*/ - -static bool -checkSwitchExpr (exprNode test, /*@dependent@*/ exprNode e, /*@out@*/ bool *allpaths) -{ - exprNodeSList el = exprNode_flatten (e); - bool mustReturn = TRUE; /* find a branch that doesn't */ - bool thisReturn = FALSE; - bool hasDefault = FALSE; - bool hasAllMembers = FALSE; - bool inSwitch = FALSE; - bool isEnumSwitch = FALSE; - bool canBreak = FALSE; - bool fallThrough = FALSE; - ctype ct = ctype_unknown; - enumNameSList usedEnums; - enumNameList enums; - - if (exprNode_isDefined (test)) - { - ctype ttype; - - ct = test->typ; - ttype = ctype_realType (ct); - - if (ctype_isEnum (ttype)) - { - isEnumSwitch = TRUE; - enums = ctype_elist (ttype); - usedEnums = enumNameSList_new (); - } - } - - exprNodeSList_elements (el, current) - { - if (exprNode_isDefined (current)) - { - switch (current->kind) - { - case XPR_FTDEFAULT: - case XPR_DEFAULT: - if (hasDefault) - { - voptgenerror - (FLG_CONTROL, - message ("Duplicate default cases in switch"), - exprNode_loc (current)); - } - /*@fallthrough@*/ - case XPR_FTCASE: - case XPR_CASE: - if (current->kind == XPR_DEFAULT || current->kind == XPR_FTDEFAULT) - { - hasDefault = TRUE; - } - else - { - if (isEnumSwitch) - { - exprNode st = exprData_getSingle (current->edata); - uentry ue = exprNode_getUentry (st); - - if (uentry_isValid (ue)) - { - cstring cname = uentry_rawName (ue); - - if (enumNameList_member (/*@-usedef@*/enums/*@=usedef@*/, cname)) - { - if (enumNameSList_member - (/*@-usedef@*/usedEnums/*@=usedef@*/, cname)) - { - voptgenerror - (FLG_CONTROL, - message ("Duplicate case in switch: %s", - cname), - current->loc); - } - else - { - enumNameSList_addh (usedEnums, cname); - } - } - else - { - voptgenerror - (FLG_TYPE, - message ("Case in switch not %s member: %s", - ctype_unparse (ct), cname), - current->loc); - } - } - } - } - - if (inSwitch && !fallThrough) - { - if (!thisReturn || canBreak) - { - mustReturn = FALSE; - } - } - - fallThrough = TRUE; - inSwitch = TRUE; - thisReturn = FALSE; - canBreak = FALSE; - /*@switchbreak@*/ break; - default: - thisReturn = thisReturn || exprNode_mustEscape (current); - canBreak = canBreak || current->canBreak; - if (canBreak) fallThrough = FALSE; - } - } - } end_exprNodeSList_elements; - - if (inSwitch) /* check the last one! */ - { - if (!thisReturn || canBreak) - { - mustReturn = FALSE; - } - } - - if (isEnumSwitch) - { - if (!hasDefault - && (enumNameSList_size (/*@-usedef@*/usedEnums/*@=usedef@*/) != - enumNameList_size (/*@-usedef@*/enums/*@=usedef@*/))) - { - enumNameSList unused = enumNameSList_subtract (enums, usedEnums); - - voptgenerror (FLG_MISSCASE, - message ("Missing case%s in switch: %q", - cstring_makeLiteralTemp - ((enumNameSList_size (unused) > 1) ? "s" : ""), - enumNameSList_unparse (unused)), - g_currentloc); - - enumNameSList_free (unused); - } - else - { - hasAllMembers = TRUE; - *allpaths = TRUE; - } - - enumNameSList_free (usedEnums); - } - else - { - *allpaths = hasDefault; - } - - exprNodeSList_free (el); - return ((hasDefault || hasAllMembers) && mustReturn); -} - -exprNode exprNode_switch (/*@only@*/ exprNode e, /*@only@*/ exprNode s) -{ - exprNode ret = exprNode_createPartialCopy (e); - bool allpaths; - - DPRINTF (("Switch: %s", exprNode_unparse (s))); - - ret->kind = XPR_SWITCH; - ret->edata = exprData_makePair (e, s); - - if (!exprNode_isError (s)) - { - exprNode fs = exprNode_firstStatement (s); - ret->loc = fileloc_update (ret->loc, s->loc); - - if (exprNode_isUndefined (fs) - || exprNode_isCaseMarker (fs) || exprNode_isLabelMarker (fs) - || exprNode_isDefaultMarker (fs)) { - ; - } else { - voptgenerror (FLG_FIRSTCASE, - message - ("Statement after switch is not a case: %s", exprNode_unparse (fs)), - fs->loc); - } - } - - if (!exprNode_isError (e)) - { - if (checkSwitchExpr (e, s, &allpaths)) - { - ret->exitCode = XK_MUSTRETURN; - } - else - { - ret->exitCode = e->exitCode; - } - - ret->canBreak = e->canBreak; - ret->mustBreak = e->mustBreak; - } - /* - ** forgot this! - ** exprNode.c:3883,32: Variable allpaths used before definition - */ - else - { - allpaths = FALSE; - } - - DPRINTF (("Context exit switch!")); - context_exitSwitch (ret, allpaths); - DPRINTF (("Context exit switch done!")); - - return ret; -} - -static void checkInfiniteLoop (/*@notnull@*/ exprNode test, - /*@notnull@*/ exprNode body) -{ - sRefSet tuses = test->uses; - - if (!sRefSet_isEmpty (test->uses)) - { - sRefSet sets = sRefSet_newCopy (body->sets); - bool hasError = TRUE; - bool innerState = FALSE; - sRefSet tuncon = sRefSet_undefined; - - sets = sRefSet_union (sets, test->sets); - sets = sRefSet_union (sets, body->msets); - sets = sRefSet_union (sets, test->msets); - - sRefSet_allElements (tuses, el) - { - if (sRef_isUnconstrained (el)) - { - tuncon = sRefSet_insert (tuncon, el); - } - else - { - if (sRefSet_member (sets, el)) - { - hasError = FALSE; - break; - } - } - - if (sRef_isInternalState (el) - || sRef_isFileStatic (sRef_getRootBase (el))) - { - innerState = TRUE; - } - } end_sRefSet_allElements ; - - if (hasError) - { - sRefSet suncon = sRefSet_undefined; - bool sinner = FALSE; - - sRefSet_allElements (sets, el) - { - if (sRef_isUnconstrained (el)) - { - suncon = sRefSet_insert (suncon, el); - } - else if (sRef_isInternalState (el)) - { - sinner = TRUE; - } - else - { - ; - } - } end_sRefSet_allElements ; - - if (sinner && innerState) - { - ; - } - else if (sRefSet_isEmpty (tuncon) - && sRefSet_isEmpty (suncon)) - { - voptgenerror - (FLG_INFLOOPS, - message - ("Suspected infinite loop. No value used in loop test (%q) " - "is modified by test or loop body.", - sRefSet_unparsePlain (tuses)), - test->loc); - } - else - { - if (sRefSet_isEmpty (tuncon)) - { - voptgenerror - (FLG_INFLOOPSUNCON, - message ("Suspected infinite loop. No condition values " - "modified. Modification possible through " - "unconstrained calls: %q", - sRefSet_unparsePlain (suncon)), - test->loc); - } - else - { - voptgenerror - (FLG_INFLOOPSUNCON, - message ("Suspected infinite loop. No condition values " - "modified. Possible undetected dependency through " - "unconstrained calls in loop test: %q", - sRefSet_unparsePlain (tuncon)), - test->loc); - } - } - } - - sRefSet_free (sets); - } -} - -exprNode exprNode_while (/*@keep@*/ exprNode t, /*@keep@*/ exprNode b) -{ - exprNode ret; - bool emptyErr = FALSE; - char *s; - // s = exprNode_generateConstraints (t); - // printf("pred: %s\n", s); - // s = exprNode_generateConstraints (b); - //printf ("body: %s\n", s); - //constraintList_print(b->constraints); - - if (context_maybeSet (FLG_WHILEEMPTY)) - { - if (exprNode_isEmptyStatement (b)) - { - emptyErr = optgenerror - (FLG_WHILEEMPTY, - cstring_makeLiteral - ("Body of while statement is empty"), - exprNode_loc (b)); - } - } - - if (!emptyErr && context_maybeSet (FLG_WHILEBLOCK)) - { - if (exprNode_isDefined (b) - && !exprNode_isBlock (b)) - { - if (context_inIterDef () - && (b->kind == XPR_STMTLIST - || b->kind == XPR_TOK)) - { - ; /* no error */ - } - else - { - voptgenerror (FLG_WHILEBLOCK, - message - ("Body of while statement is not a block: %s", - exprNode_unparse (b)), - exprNode_loc (b)); - } - } - } - - if (exprNode_isError (t)) - { - if (exprNode_isError (b)) - { - ret = exprNode_createLoc (ctype_unknown, g_currentloc); - } - else - { - ret = exprNode_createPartialCopy (b); - } - } - else - { - exprNode test; - - ret = exprNode_createPartialCopy (t); - - llassert (t->kind == XPR_WHILEPRED); - - test = exprData_getSingle (t->edata); - - if (!exprNode_isError (b) && exprNode_isDefined (test)) - { - if (context_maybeSet (FLG_INFLOOPS) - || context_maybeSet (FLG_INFLOOPSUNCON)) - { - /* - ** check that some variable in the predicate is set by the body - ** if the predicate uses any variables - */ - - checkInfiniteLoop (test, b); - } - - exprNode_mergeUSs (ret, b); - - if (exprNode_isDefined (b)) - { - ret->exitCode = exitkind_makeConditional (b->exitCode); - } - } - } - - ret->edata = exprData_makePair (t, b); - ret->kind = XPR_WHILE; - - if (exprNode_isDefined (t) && exprNode_mustEscape (t)) - { - voptgenerror - (FLG_CONTROL, - message ("Predicate always exits: %s", exprNode_unparse (t)), - exprNode_loc (t)); - } - - ret->exitCode = XK_NEVERESCAPE; - - /* - ** If loop is infinite, and there is no break inside, - ** exit code is never reach. - */ - - if (exprNode_knownIntValue (t)) - { - if (!exprNode_isZero (t)) - { - if (exprNode_isDefined (b)) - { - if (!b->canBreak) - { - /* Really, it means never reached. */ - ret->exitCode = XK_MUSTEXIT; - } - } - } - } - else - { - ; - } - - ret->canBreak = FALSE; - ret->mustBreak = FALSE; - - return ret; -} - -/* -** do { b } while (t); -** -** note: body passed as first argument -*/ - -exprNode exprNode_doWhile (/*@only@*/ exprNode b, /*@only@*/ exprNode t) -{ - exprNode ret; - - if (exprNode_isError (t)) - { - if (exprNode_isError (b)) - { - ret = exprNode_createLoc (ctype_unknown, g_currentloc); - } - else - { - ret = exprNode_createPartialCopy (b); - - ret->exitCode = exitkind_makeConditional (b->exitCode); - exprNode_checkUse (ret, b->sref, b->loc); - ret->exitCode = b->exitCode; - ret->canBreak = b->canBreak; - ret->mustBreak = b->mustBreak; - } - } - else - { - ret = exprNode_createPartialCopy (t); - exprNode_checkPred (cstring_makeLiteralTemp ("while"), t); - - if (!exprNode_isError (b)) - { - /* - ** forgot the copy's --- why wasn't this detected?? - */ - - ret->sets = sRefSet_copy (ret->sets, b->sets); - ret->msets = sRefSet_copy (ret->msets, b->msets); - ret->uses = sRefSet_copy (ret->uses, b->uses); - - /* left this out --- causes and aliasing bug (infinite loop) - should be detected?? */ - - exprNode_checkUse (ret, b->sref, b->loc); - exprNode_mergeUSs (ret, t); - exprNode_checkUse (ret, t->sref, t->loc); - - ret->exitCode = b->exitCode; - ret->canBreak = b->canBreak; - ret->mustBreak = b->mustBreak; - } - } - - context_exitDoWhileClause (t); - - ret->kind = XPR_DOWHILE; - ret->edata = exprData_makePair (t, b); - return ret; -} - -exprNode exprNode_for (/*@keep@*/ exprNode inc, /*@keep@*/ exprNode body) -{ - exprNode ret; - bool emptyErr = FALSE; - - if (context_maybeSet (FLG_FOREMPTY)) - { - if (exprNode_isEmptyStatement (body)) - { - emptyErr = optgenerror - (FLG_FOREMPTY, - cstring_makeLiteral - ("Body of for statement is empty"), - exprNode_loc (body)); - } - } - - if (!emptyErr && context_maybeSet (FLG_FORBLOCK)) - { - if (exprNode_isDefined (body) - && !exprNode_isBlock (body)) - { - if (context_inIterDef () - && (body->kind == XPR_STMTLIST - || body->kind == XPR_TOK)) - { - ; /* no error */ - } - else - { - voptgenerror (FLG_FORBLOCK, - message - ("Body of for statement is not a block: %s", - exprNode_unparse (body)), - exprNode_loc (body)); - } - } - } - - /* - ** for ud purposes: (alreadly) init -> test -> (now) LOOP: body + inc + test - */ - - if (exprNode_isError (body)) - { - ret = exprNode_createPartialCopy (inc); - } - else - { - ret = exprNode_createPartialCopy (body); - - ret->exitCode = exitkind_makeConditional (body->exitCode); - - exprNode_mergeUSs (inc, body); - - if (exprNode_isDefined (inc)) - { - exprNode tmp; - - context_setMessageAnnote (cstring_makeLiteral ("in post loop increment")); - - - tmp = exprNode_effect (exprData_getTripleInc (inc->edata)); - exprNode_freeShallow (tmp); - - context_clearMessageAnnote (); - context_setMessageAnnote (cstring_makeLiteral ("in post loop test")); - - tmp = exprNode_effect (exprData_getTripleTest (inc->edata)); - exprNode_freeShallow (tmp); - - context_clearMessageAnnote (); - - ret->uses = sRefSet_copy (ret->uses, inc->uses); - ret->sets = sRefSet_copy (ret->sets, inc->sets); - ret->msets = sRefSet_copy (ret->msets, inc->msets); - } - } - - ret->kind = XPR_FOR; - ret->edata = exprData_makePair (inc, body); - - if (exprNode_isDefined (inc)) { - exprNode test = exprData_getTripleTest (inc->edata); - - if (exprNode_isUndefined (test)) { - if (exprNode_isDefined (body)) { - if (!body->canBreak) { - /* Really, it means never reached. */ - ret->exitCode = XK_MUSTEXIT; - } - } - } - } - - return (ret); -} - -/* -** for (init; test; inc) -** ==> -** init; -** while (test) { body; inc; } -** -** Now: check use of init (may set vars for test) -** check use of test -** no checks on inc -_*/ - -/*@observer@*/ guardSet exprNode_getForGuards (exprNode pred) -{ - exprNode test; - - if (exprNode_isError (pred)) return guardSet_undefined; - - llassert (pred->kind == XPR_FORPRED); - - test = exprData_getTripleTest (pred->edata); - - if (!exprNode_isError (test)) - { - return (test->guards); - } - - return guardSet_undefined; -} - -exprNode exprNode_whilePred (/*@only@*/ exprNode test) -{ - exprNode ret = exprNode_createSemiCopy (test); - - if (exprNode_isDefined (test)) - { - exprNode_copySets (ret, test); - exprNode_checkPred (cstring_makeLiteralTemp ("while"), test); - exprNode_checkUse (ret, test->sref, test->loc); - - exprNode_produceGuards (test); - - ret->guards = guardSet_copy (test->guards); - } - - ret->edata = exprData_makeSingle (test); - ret->kind = XPR_WHILEPRED; - return ret; -} - -exprNode exprNode_forPred (/*@only@*/ exprNode init, /*@only@*/ exprNode test, - /*@only@*/ exprNode inc) -{ - exprNode ret; - - /* - ** for ud purposes: init -> test -> LOOP: [ body, inc ] - */ - - exprNode_checkPred (cstring_makeLiteralTemp ("for"), test); - - if (!exprNode_isError (inc)) - { - ret = exprNode_createPartialCopy (inc); - } - else - { - if (!exprNode_isError (init)) - { - ret = exprNode_createPartialCopy (init); - } - else if (!exprNode_isError (test)) - { - ret = exprNode_createPartialCopy (test); - } - else - { - ret = exprNode_createUnknown (); - } - } - - exprNode_mergeUSs (ret, init); - - if (exprNode_isDefined (init)) - { - exprNode_checkUse (ret, init->sref, init->loc); - } - - exprNode_mergeUSs (ret, test); - - if (exprNode_isDefined (test)) - { - exprNode_checkUse (ret, test->sref, test->loc); - } - - ret->kind = XPR_FORPRED; - ret->edata = exprData_makeFor (init, test, inc); - return (ret); -} - -/*@notnull@*/ /*@only@*/ exprNode exprNode_goto (/*@only@*/ cstring label) -{ - exprNode ret = exprNode_createUnknown (); - - if (context_inMacro ()) - { - voptgenerror (FLG_MACROSTMT, - message ("Macro %s uses goto (not functional)", - context_inFunctionName ()), - g_currentloc); - } - - ret->kind = XPR_GOTO; - ret->edata = exprData_makeLiteral (label); - ret->mustBreak = TRUE; - ret->exitCode = XK_GOTO; - ret->canBreak = TRUE; - return ret; -} - -exprNode exprNode_continue (/*@only@*/ lltok l, int qcontinue) -{ - exprNode ret = exprNode_createLoc (ctype_unknown, fileloc_copy (lltok_getLoc (l))); - - ret->kind = XPR_CONTINUE; - ret->edata = exprData_makeTok (l); - ret->canBreak = TRUE; - ret->mustBreak = TRUE; - - if (qcontinue == QSAFEBREAK) - { - ; /* no checking */ - } - else if (qcontinue == QINNERCONTINUE) - { - if (!context_inDeepLoop ()) - { - voptgenerror - (FLG_LOOPLOOPCONTINUE, - cstring_makeLiteral ("Continue statement marked with innercontinue " - "is not inside a nested loop"), - exprNode_loc (ret)); - } - } - else if (qcontinue == BADTOK) - { - if (context_inDeepLoop ()) - { - voptgenerror - (FLG_LOOPLOOPCONTINUE, - cstring_makeLiteral ("Continue statement in nested loop"), - exprNode_loc (ret)); - } - } - else - { - llbuglit ("exprNode_continue: bad qcontinue"); - } - - return ret; -} - -exprNode exprNode_break (/*@only@*/ lltok l, int bqual) -{ - exprNode ret = exprNode_createLoc (ctype_unknown, fileloc_copy (lltok_getLoc (l))); - clause breakClause = context_breakClause (); - - ret->kind = XPR_BREAK; - ret->edata = exprData_makeTok (l); - ret->canBreak = TRUE; - ret->mustBreak = TRUE; - - if (breakClause == NOCLAUSE) - { - voptgenerror - (FLG_SYNTAX, - cstring_makeLiteral ("Break not inside while, for or switch statement"), - exprNode_loc (ret)); - } - else - { - if (bqual != BADTOK) - { - switch (bqual) - { - case QSAFEBREAK: - break; - case QINNERBREAK: - if (breakClause == SWITCHCLAUSE) - { - if (!context_inDeepSwitch ()) - { - voptgenerror (FLG_SYNTAX, - cstring_makeLiteral - ("Break preceded by innerbreak is not in a deep switch"), - exprNode_loc (ret)); - } - } - else - { - if (!context_inDeepLoop ()) - { - voptgenerror (FLG_SYNTAX, - cstring_makeLiteral - ("Break preceded by innerbreak is not in a deep loop"), - exprNode_loc (ret)); - } - } - break; - case QLOOPBREAK: - if (breakClause == SWITCHCLAUSE) - { - voptgenerror (FLG_SYNTAX, - cstring_makeLiteral - ("Break preceded by loopbreak is breaking a switch"), - exprNode_loc (ret)); - } - break; - case QSWITCHBREAK: - if (breakClause != SWITCHCLAUSE) - { - voptgenerror - (FLG_SYNTAX, - message ("Break preceded by switchbreak is breaking %s", - cstring_makeLiteralTemp - ((breakClause == WHILECLAUSE - || breakClause == DOWHILECLAUSE) ? "a while loop" - : (breakClause == FORCLAUSE) ? "a for loop" - : (breakClause == ITERCLAUSE) ? "an iterator" - : "")), - exprNode_loc (ret)); - } - break; - BADDEFAULT; - } - } - else - { - if (breakClause == SWITCHCLAUSE) - { - clause nextBreakClause = context_nextBreakClause (); - - switch (nextBreakClause) - { - case NOCLAUSE: break; - case WHILECLAUSE: - case DOWHILECLAUSE: - case FORCLAUSE: - case ITERCLAUSE: - voptgenerror - (FLG_LOOPSWITCHBREAK, - cstring_makeLiteral ("Break statement in switch inside loop"), - exprNode_loc (ret)); - break; - case SWITCHCLAUSE: - voptgenerror - (FLG_SWITCHSWITCHBREAK, - cstring_makeLiteral ("Break statement in switch inside switch"), - exprNode_loc (ret)); - break; - BADDEFAULT; - } - } - else - { - if (context_inDeepLoop ()) - { - voptgenerror - (FLG_LOOPLOOPBREAK, - cstring_makeLiteral ("Break statement in nested loop"), - exprNode_loc (ret)); - } - else - { - if (context_inDeepLoopSwitch ()) - { - voptgenerror - (FLG_SWITCHLOOPBREAK, - cstring_makeLiteral ("Break statement in loop inside switch"), - exprNode_loc (ret)); - } - } - } - } - } - - return ret; -} - -exprNode exprNode_nullReturn (/*@only@*/ lltok t) -{ - fileloc loc = lltok_getLoc (t); - exprNode ret = exprNode_createLoc (ctype_unknown, fileloc_copy (loc)); - - context_returnFunction (); - exprChecks_checkNullReturn (loc); - - ret->kind = XPR_NULLRETURN; - ret->edata = exprData_makeTok (t); - ret->exitCode = XK_MUSTRETURN; - return ret; -} - -exprNode exprNode_return (/*@only@*/ exprNode e) -{ - exprNode ret; - - if (exprNode_isError (e)) - { - ret = exprNode_createUnknown (); - } - else - { - ret = exprNode_createLoc (ctype_unknown, fileloc_copy (e->loc)); - - exprNode_checkUse (ret, e->sref, e->loc); - exprNode_checkReturn (e); - } - - context_returnFunction (); - ret->kind = XPR_RETURN; - ret->edata = exprData_makeSingle (e); - ret->exitCode = XK_MUSTRETURN; - - return (ret); -} - -exprNode exprNode_comma (/*@only@*/ exprNode e1, /*@only@*/ exprNode e2) -{ - exprNode ret; - - if (exprNode_isError (e1)) - { - if (exprNode_isError (e2)) - { - ret = exprNode_createLoc (ctype_unknown, g_currentloc); - } - else - { - ret = exprNode_createPartialCopy (e2); - exprNode_checkUse (ret, e2->sref, e2->loc); - ret->sref = e2->sref; - } - } - else - { - ret = exprNode_createPartialCopy (e1); - - exprNode_checkUse (ret, e1->sref, e1->loc); - - if (!exprNode_isError (e2)) - { - exprNode_mergeUSs (ret, e2); - exprNode_checkUse (ret, e2->sref, e2->loc); - ret->sref = e2->sref; - } - } - - ret->kind = XPR_COMMA; - ret->edata = exprData_makePair (e1, e2); - - if (exprNode_isDefined (e1)) - { - if (exprNode_isDefined (e2)) - { - ret->typ = e2->typ; - - if (exprNode_mustEscape (e1) || e1->mustBreak) - { - voptgenerror - (FLG_UNREACHABLE, - message ("Second clause of comma expression is unreachable: %s", - exprNode_unparse (e2)), - exprNode_loc (e2)); - } - - ret->exitCode = exitkind_combine (e1->exitCode, e2->exitCode); - ret->mustBreak = e1->mustBreak || e2->mustBreak; - ret->canBreak = e1->canBreak || e2->canBreak; - } - else - { - if (exprNode_mustEscape (e1) || e1->mustBreak) - { - voptgenerror - (FLG_UNREACHABLE, - message ("Second clause of comma expression is unreachable: %s", - exprNode_unparse (e2)), - exprNode_loc (e2)); - } - - ret->exitCode = e1->exitCode; - ret->canBreak = e1->canBreak; - } - } - else - { - if (exprNode_isDefined (e2)) - { - ret->exitCode = e2->exitCode; - ret->mustBreak = e2->mustBreak; - ret->canBreak = e2->canBreak; - } - } - - return (ret); -} - -static bool exprNode_checkOneInit (/*@notnull@*/ exprNode el, exprNode val) -{ - ctype t1 = exprNode_getType (el); - ctype t2 = exprNode_getType (val); - bool hasError = FALSE; - - if (ctype_isUnknown (t1)) - { - voptgenerror (FLG_IMPTYPE, - message ("Variable has unknown (implicitly int) type: %s", - exprNode_unparse (el)), - el->loc); - - t1 = ctype_int; - el->typ = ctype_int; - } - - if (exprNode_isDefined (val) && val->kind == XPR_INITBLOCK) - { - exprNodeList vals = exprData_getArgs (val->edata); - - if (ctype_isRealAP (t1)) - { - int i = 0; - int nerrors = 0; - - exprNodeList_elements (vals, oneval) - { - cstring istring = message ("%d", i); - exprNode newel = - exprNode_arrayFetch - (exprNode_fakeCopy (el), - exprNode_numLiteral (ctype_int, istring, - fileloc_copy (el->loc), i)); - - if (exprNode_isDefined (newel)) - { - if (exprNodeList_size (vals) == 1 - && ctype_isString (exprNode_getType (oneval)) - && ctype_isChar (exprNode_getType (newel))) - { - exprNode_freeIniter (newel); - } - else - { - if (exprNode_checkOneInit (newel, oneval)) - { - hasError = TRUE; - nerrors++; - - if (nerrors > 3 && exprNodeList_size (vals) > 6) - { - llgenmsg - (message ("Additional initialization errors " - "for %s not reported", - exprNode_unparse (el)), - exprNode_loc (el)); - exprNode_freeIniter (newel); - break; - } - else - { - exprNode_freeIniter (newel); - } - } - else - { - exprNode_freeIniter (newel); - } - } - } - - cstring_free (istring); - i++; - /*@-branchstate@*/ - } end_exprNodeList_elements; - /*@=branchstate@*/ - } - else if (ctype_isStruct (ctype_realType (t1))) - { - uentryList fields = ctype_getFields (t1); - int i = 0; - - if (uentryList_size (fields) != exprNodeList_size (vals)) - { - if (uentryList_size (fields) > exprNodeList_size (vals)) - { - hasError = optgenerror - (FLG_FULLINITBLOCK, - message ("Initializer block for " - "%s has %d field%p, but %s has %d field%p: %q", - exprNode_unparse (el), - exprNodeList_size (vals), - ctype_unparse (t1), - uentryList_size (fields), - exprNodeList_unparse (vals)), - val->loc); - } - else - { - hasError = optgenerror - (FLG_TYPE, - message ("Initializer block for " - "%s has %d field%p, but %s has %d field%p: %q", - exprNode_unparse (el), - exprNodeList_size (vals), - ctype_unparse (t1), - uentryList_size (fields), - exprNodeList_unparse (vals)), - val->loc); - } - } - else - { - exprNodeList_elements (vals, oneval) - { - uentry thisfield = uentryList_getN (fields, i); - exprNode newel = - exprNode_fieldAccess (exprNode_fakeCopy (el), - uentry_getName (thisfield)); - - if (exprNode_isDefined (newel)) - { - if (exprNode_checkOneInit (newel, oneval)) - { - hasError = TRUE; - } - - exprNode_freeIniter (newel); - } - - i++; - } end_exprNodeList_elements; - } - } - else - { - hasError = optgenerror - (FLG_TYPE, - message ("Initializer block used for " - "%s where %t is expected: %s", - exprNode_unparse (el), t1, exprNode_unparse (val)), - val->loc); - } - } - else - { - if (exprNode_isDefined (val)) - { - doAssign (el, val, TRUE); - - if (!exprNode_matchType (t1, val)) - { - hasError = gentypeerror - (t1, val, t2, el, - message ("Initial value of %s is type %t, " - "expects %t: %s", - exprNode_unparse (el), - t2, t1, exprNode_unparse (val)), - val->loc); - } - } - } - - return hasError; -} - -exprNode exprNode_makeInitialization (/*@only@*/ idDecl t, - /*@only@*/ exprNode e) -{ - uentry ue = usymtab_lookup (idDecl_observeId (t)); - bool isUsed = uentry_isUsed (ue); - exprNode ret = exprNode_fromIdentifierAux (ue); - ctype ct = ctype_realishType (ret->typ); - fileloc loc; - - if (ctype_isUnknown (ct)) - { - voptgenerror (FLG_IMPTYPE, - message ("Variable has unknown (implicitly int) type: %s", - idDecl_getName (t)), - exprNode_isDefined (e) ? exprNode_loc (e) : g_currentloc); - - ct = ctype_int; - } - - if (exprNode_isError (e)) - { - e = exprNode_createUnknown (); - loc = g_currentloc; - - /* error: assume initializer is defined */ - sRef_setDefined (ret->sref, loc); - } - else - { - loc = exprNode_loc (e); - - /* - ** evs - 9 Apr 1995 - ** - ** was addSafeUse --- what's the problem? - ** - ** int x = 3, y = x ? - */ - - exprNode_checkUse (ret, e->sref, e->loc); - - if (ctype_isUnknown (e->typ) && uentry_isValid (ue)) - { - exprNode lhs = exprNode_createId (ue); - - /* - ** static storage should be undefined before initializing - */ - - if (uentry_isStatic (ue)) - { - sRef_setDefState (lhs->sref, SS_PARTIAL, fileloc_undefined); - } - - (void) exprNode_checkOneInit (lhs, e); - - if (uentry_isStatic (ue)) - { - sRef_setDefState (lhs->sref, SS_DEFINED, fileloc_undefined); - } - - exprNode_free (lhs); - } - else - { - if (!exprNode_matchType (ct, e)) - { - if (exprNode_isZero (e) && ctype_isArrayPtr (ct)) - { - ; - } - else - { - (void) gentypeerror - (exprNode_getType (e), e, exprNode_getType (ret), ret, - message - ("Variable %s initialized to type %t, expects %t: %s", - exprNode_unparse (ret), exprNode_getType (e), - exprNode_getType (ret), - exprNode_unparse (e)), - e->loc); - } - } - } - - if (uentry_isStatic (ue)) - { - sRef_setDefState (ret->sref, SS_PARTIAL, fileloc_undefined); - } - - doAssign (ret, e, TRUE); - - if (uentry_isStatic (ue)) - { - sRef_setDefState (ret->sref, SS_DEFINED, fileloc_undefined); - } - } - - if (context_inIterDef ()) - { - /* should check if it is yield */ - uentry_setUsed (ue, loc); - } - else - { - if (!isUsed) /* could be @unused@-qualified variable */ - { - uentry_setNotUsed (ue); - } - } - - ret->exitCode = XK_NEVERESCAPE; - ret->mustBreak = FALSE; - - /* - ** Must be before new kind is assigned! - */ - - exprData_free (ret->edata, ret->kind); - - ret->kind = XPR_INIT; - ret->edata = exprData_makeInit (t, e); - exprNode_mergeUSs (ret, e); - return ret; -} - -exprNode exprNode_iter (/*@observer@*/ uentry name, - /*@only@*/ exprNodeList alist, - /*@only@*/ exprNode body, - /*@observer@*/ uentry end) -{ - exprNode ret; - cstring iname; - - llassert (uentry_isValid (name)); - - uentry_setUsed (name, exprNode_loc (body)); - - ret = exprNode_createPartialCopy (body); - iname = uentry_getName (name); - - if (uentry_isInvalid (end)) - { - llerror (FLG_ITER, - message ("Iter %s not balanced with end_%s", iname, iname)); - } - else - { - cstring ename = uentry_getName (end); - - if (!cstring_equalPrefix (ename, "end_")) - { - llerror (FLG_ITER, message ("Iter %s not balanced with end_%s: %s", - iname, iname, ename)); - } - else - { - if (!cstring_equal (iname, cstring_suffix (ename, 4))) - { - llerror (FLG_ITER, - message ("Iter %s not balanced with end_%s: %s", - iname, iname, ename)); - } - } - - cstring_free (ename); - } - - context_exitIterClause (body); - - ret->kind = XPR_ITER; - ret->edata = exprData_makeIter (name, alist, body, end); - - if (uentry_isIter (name)) - { - (void) checkArgsReal (name, body, - uentry_getParams (name), alist, TRUE, ret); - } - - cstring_free (iname); - - return ret; -} - -exprNode -exprNode_iterNewId (/*@only@*/ cstring s) -{ - exprNode e = exprNode_new (); - uentry ue = uentryList_getN (uentry_getParams (getCurrentIter ()), iterParamNo ()); - - llassert (processingIterVars ()); - - e->loc = context_getSaveLocation (); - - if (fileloc_isUndefined (e->loc)) - { - fileloc_free (e->loc); - e->loc = fileloc_copy (g_currentloc); - } - - e->uses = sRefSet_new (); - e->sets = sRefSet_new (); - e->msets = sRefSet_new (); - e->kind = XPR_VAR; - e->val = multiVal_unknown (); - e->guards = guardSet_new (); - e->sref = defref; - e->isJumpPoint = FALSE; - e->exitCode = XK_NEVERESCAPE; - - /*> missing fields, detected by lclint <*/ - e->canBreak = FALSE; - e->mustBreak = FALSE; - e->etext = cstring_undefined; - - if (uentry_isYield (ue)) - { - uentry uue = uentry_makeVariable (s, uentry_getType (ue), - fileloc_copy (e->loc), - FALSE); - sRef sr; - - uue = usymtab_supEntrySrefReturn (uue); - - sr = uentry_getSref (uue); - sRef_mergeStateQuiet (sr, uentry_getSref (ue)); - sr = uentry_getSref (uue); - sRef_setDefined (sr, e->loc); - - e->typ = uentry_getType (uue); - e->sref = sr; - e->edata = exprData_makeId (uue); - uentry_setUsed (uue, g_currentloc); - } - else - { - uentry uue; - - sRef_setGlobalScope (); - uue = uentry_makeVariableLoc (s, ctype_unknown); - - e->typ = ctype_unknown; - e->edata = exprData_makeId (uue); - - uentry_setUsed (uue, e->loc); - uentry_setHasNameError (uue); - - if (context_getFlag (FLG_REPEATUNRECOG)) - { - uentry_markOwned (uue); - } - else - { - usymtab_supGlobalEntry (uue); - } - - sRef_clearGlobalScope (); - - voptgenerror (FLG_UNRECOG, message ("Unrecognized identifier: %s", s), - e->loc); - } - - - cstring_free (s); - return (e); -} - -exprNode -exprNode_iterExpr (/*@returned@*/ exprNode e) -{ - if (!processingIterVars ()) - { - llcontbuglit ("checkIterParam: not in iter"); - return e; - } - - if (uentry_isYield (uentryList_getN (uentry_getParams (getCurrentIter ()), - iterParamNo ()))) - { - if (exprNode_isDefined (e)) - { - if (fileloc_isDefined (e->loc)) - { - voptgenerror - (FLG_ITER, - message ("Yield parameter is not simple identifier: %s", - exprNode_unparse (e)), - e->loc); - } - else - { - voptgenerror - (FLG_ITER, - message ("Yield parameter is not simple identifier: %s", - exprNode_unparse (e)), - g_currentloc); - - } - } - } - return e; -} - -exprNode -exprNode_iterId (/*@observer@*/ uentry c) -{ - uentry ue; - - llassert (processingIterVars ()); - - ue = uentryList_getN (uentry_getParams (getCurrentIter ()), - iterParamNo ()); - - if (uentry_isYield (ue)) - { - ctype ct = uentry_getType (ue); - exprNode e = exprNode_createPlain (ct); - cstring name = uentry_getName (c); - uentry le = uentry_makeVariable (name, ct, fileloc_undefined, FALSE); - - uentry_setUsed (ue, g_currentloc); - uentry_setHasNameError (ue); - - cstring_free (name); - - e->kind = XPR_VAR; - e->edata = exprData_makeId (le); - e->loc = context_getSaveLocation (); - e->sref = uentry_getSref (le); - - usymtab_supEntrySref (le); - - if (!context_inHeader ()) - { - if (optgenerror - (FLG_ITER, - message ("Yield parameter shadows local declaration: %q", - uentry_getName (c)), - fileloc_isDefined (e->loc) ? e->loc : g_currentloc)) - { - uentry_showWhereDeclared (c); - } - } - - return e; - } - - return (exprNode_fromIdentifierAux (c)); -} - -exprNode exprNode_iterStart (/*@observer@*/ uentry name, /*@only@*/ exprNodeList alist) -{ - exprNode ret = exprNode_create (ctype_unknown); - - ret->kind = XPR_ITERCALL; - ret->edata = exprData_makeIterCall (name, alist); - - if (uentry_isIter (name)) - { - uentryList params = uentry_getParams (name); - - if (context_inIterDef () - && uentryList_size (params) == exprNodeList_size (alist)) - { - int i = 0; - - exprNodeList_elements (alist, arg) - { - uentry parg = uentryList_getN (params, i); - - if (uentry_isYield (parg)) - { - uentry ue = exprNode_getUentry (arg); - - if (uentry_isValid (ue)) - { - ; - } - } - - i++; - } end_exprNodeList_elements; - } - - (void) checkArgsReal (name, ret, params, alist, TRUE, ret); - checkUnspecCall (ret, params, alist); - } - - return ret; -} - -/*@exposed@*/ sRef exprNode_getSref (exprNode e) -{ - if (exprNode_isDefined (e)) - { - /*@access sRef@*/ - if (e->sref == defref) /*@noaccess sRef@*/ - { - /*@-mods@*/ - e->sref = sRef_makeUnknown (); - sRef_setAliasKind (e->sref, AK_ERROR, fileloc_undefined); - /*@=mods@*/ - return e->sref; - } - else - { - return e->sref; - } - } - else - { - return sRef_undefined; - } -} - -/*@observer@*/ cstring -exprNode_unparseFirst (exprNode e) -{ - if (exprNode_isDefined (e)) - { - cstring ret; - - if (e->kind == XPR_STMTLIST - || e->kind == XPR_COMMA || e->kind == XPR_COND) - { - exprNode first = exprData_getPairA (e->edata); - - if (exprNode_isDefined (first)) - { - return (exprNode_unparseFirst (exprData_getPairA (e->edata))); - } - else - { - return (cstring_makeLiteralTemp ("...")); - } - } - - ret = cstring_elide (exprNode_unparse (e), 20); - cstring_markOwned (ret); - - return (ret); - } - else - { - return cstring_makeLiteralTemp (""); - } -} - -/*@observer@*/ cstring -exprNode_unparse (exprNode e) -{ - if (exprNode_isError (e)) - { - return cstring_makeLiteralTemp (""); - } - - if (cstring_isDefined (e->etext)) - { - return e->etext; - } - else - { - cstring ret = exprNode_doUnparse (e); - - /*@-modifies@*/ /* benevolent */ - e->etext = ret; - /*@=modifies@*/ - return ret; - } -} - -/*@observer@*/ fileloc -exprNode_loc (exprNode e) -{ - if (exprNode_isError (e)) - { - return (g_currentloc); - } - else - { - return (e->loc); - } -} - -/* -** executes exprNode e -** recursively rexecutes as though in original parse using -** information in e->edata -*/ - -static /*@only@*/ exprNodeList exprNodeList_effect (exprNodeList e) -{ - exprNodeList ret = exprNodeList_new (); - - exprNodeList_elements (e, current) - { - exprNodeList_addh (ret, exprNode_effect (current)); - } end_exprNodeList_elements; - - return ret; -} - -static /*@only@*/ exprNode exprNode_effect (exprNode e) - /*@globals internalState@*/ -{ - bool innerEffect = inEffect; - exprNode ret; - exprData data; - - inEffect = TRUE; - - context_clearJustPopped (); - - if (exprNode_isError (e)) - { - ret = exprNode_undefined; - } - else - { - /* - ** Turn off expose and dependent transfer checking. - ** Need to pass exposed internal nodes, - ** [ copying would be a waste! ] - ** [ Actually, I think I wasted a lot more time than its worth ] - ** [ trying to do this. ] - */ - - /*@-exposetrans@*/ - /*@-observertrans@*/ - /*@-dependenttrans@*/ - - data = e->edata; - - switch (e->kind) - { - case XPR_PARENS: - ret = exprNode_addParens (exprData_getUopTok (data), - exprNode_effect (exprData_getUopNode (data))); - break; - case XPR_ASSIGN: - ret = exprNode_assign (exprNode_effect (exprData_getOpA (data)), - exprNode_effect (exprData_getOpB (data)), - exprData_getOpTok (data)); - break; - case XPR_INITBLOCK: - ret = exprNode_undefined; - break; - case XPR_CALL: - ret = exprNode_functionCall (exprNode_effect (exprData_getFcn (data)), - exprNodeList_effect (exprData_getArgs (data))); - break; - case XPR_EMPTY: - ret = e; - break; - - case XPR_LABEL: - ret = e; - break; - - case XPR_CONST: - case XPR_VAR: - { - cstring id = exprData_getId (data); - uentry ue = usymtab_lookupSafe (id); - - ret = exprNode_fromIdentifierAux (ue); - ret->loc = fileloc_update (ret->loc, e->loc); - break; - } - case XPR_BODY: - ret = e; - break; - case XPR_FETCH: - ret = exprNode_arrayFetch (exprNode_effect (exprData_getPairA (data)), - exprNode_effect (exprData_getPairB (data))); - break; - case XPR_OP: - ret = exprNode_op (exprNode_effect (exprData_getOpA (data)), - exprNode_effect (exprData_getOpB (data)), - exprData_getOpTok (data)); - break; - - case XPR_POSTOP: - ret = exprNode_postOp (exprNode_effect (exprData_getUopNode (data)), - exprData_getUopTok (data)); - break; - case XPR_PREOP: - ret = exprNode_preOp (exprNode_effect (exprData_getUopNode (data)), - exprData_getUopTok (data)); - break; - - case XPR_OFFSETOF: - case XPR_SIZEOFT: - case XPR_SIZEOF: - case XPR_ALIGNOFT: - case XPR_ALIGNOF: - ret = e; - break; - - case XPR_VAARG: - ret = exprNode_vaArg (exprData_getCastTok (data), - exprNode_effect (exprData_getCastNode (data)), - exprData_getCastType (data)); - break; - - case XPR_CAST: - ret = exprNode_cast (exprData_getCastTok (data), - exprNode_effect (exprData_getCastNode (data)), - exprData_getCastType (data)); - break; - case XPR_ITERCALL: - ret = exprNode_iterStart (exprData_getIterCallIter (data), - exprNodeList_effect - (exprData_getIterCallArgs (data))); - break; - - case XPR_ITER: - ret = exprNode_iter (exprData_getIterSname (data), - exprNodeList_effect (exprData_getIterAlist (data)), - exprNode_effect (exprData_getIterBody (data)), - exprData_getIterEname (data)); - break; - - case XPR_FOR: - ret = exprNode_for (exprNode_effect (exprData_getPairA (data)), - exprNode_effect (exprData_getPairB (data))); - break; - - case XPR_FORPRED: - ret = exprNode_forPred (exprNode_effect (exprData_getTripleInit (data)), - exprNode_effect (exprData_getTripleTest (data)), - exprNode_effect (exprData_getTripleInc (data))); - break; - - case XPR_TOK: - ret = exprNode_createTok (exprData_getTok (data)); - break; - - case XPR_GOTO: - ret = exprNode_goto (exprData_getLiteral (data)); - ret->loc = fileloc_update (ret->loc, e->loc); - break; - - case XPR_CONTINUE: - ret = exprNode_continue (exprData_getTok (data), QSAFEBREAK); - break; - - case XPR_BREAK: - ret = exprNode_break (exprData_getTok (data), QSAFEBREAK); - break; - - case XPR_RETURN: - ret = exprNode_return (exprNode_effect (exprData_getSingle (data))); - break; - - case XPR_NULLRETURN: - ret = exprNode_nullReturn (exprData_getTok (data)); - break; - - case XPR_COMMA: - ret = exprNode_comma (exprNode_effect (exprData_getPairA (data)), - exprNode_effect (exprData_getPairB (data))); - break; - - case XPR_COND: - ret = exprNode_cond (exprNode_effect (exprData_getTriplePred (data)), - exprNode_effect (exprData_getTripleTrue (data)), - exprNode_effect (exprData_getTripleFalse (data))); - break; - case XPR_IF: - ret = exprNode_if (exprNode_effect (exprData_getPairA (data)), - exprNode_effect (exprData_getPairB (data))); - break; - - case XPR_IFELSE: - ret = exprNode_ifelse (exprNode_effect (exprData_getTriplePred (data)), - exprNode_effect (exprData_getTripleTrue (data)), - exprNode_effect (exprData_getTripleFalse (data))); - break; - case XPR_WHILEPRED: - ret = exprNode_whilePred (exprData_getSingle (data)); - break; - - case XPR_WHILE: - ret = exprNode_while (exprNode_effect (exprData_getPairA (data)), - exprNode_effect (exprData_getPairB (data))); - break; - - case XPR_DOWHILE: - ret = exprNode_doWhile (exprNode_effect (exprData_getPairA (data)), - exprNode_effect (exprData_getPairB (data))); - break; - - case XPR_BLOCK: - ret = exprNode_makeBlock (exprNode_effect (exprData_getSingle (data))); - break; - - case XPR_STMT: - ret = exprNode_statement (exprNode_effect (exprData_getUopNode (data)), - exprData_getUopTok (data)); - break; - - case XPR_STMTLIST: - ret = exprNode_concat (exprNode_effect (exprData_getPairA (data)), - exprNode_effect (exprData_getPairB (data))); - break; - - case XPR_FTCASE: - case XPR_CASE: - ret = exprNode_caseMarker - (exprNode_effect (exprData_getSingle (data)), - TRUE); - break; - - case XPR_FTDEFAULT: - case XPR_DEFAULT: - ret = exprNode_createTok (exprData_getTok (data)); - break; - - case XPR_SWITCH: - ret = exprNode_switch (exprNode_effect (exprData_getPairA (data)), - exprNode_effect (exprData_getPairB (data))); - break; - - case XPR_INIT: - ret = exprNode_makeInitialization - (exprData_getInitId (data), - exprNode_effect (exprData_getInitNode (data))); - break; - - case XPR_FACCESS: - ret = exprNode_fieldAccess (exprNode_effect (exprData_getFieldNode (data)), - cstring_copy (exprData_getFieldName (data))); - break; - - case XPR_ARROW: - ret = exprNode_arrowAccess (exprNode_effect (exprData_getFieldNode (data)), - cstring_copy (exprData_getFieldName (data))); - break; - - case XPR_STRINGLITERAL: - ret = e; - break; - - case XPR_NUMLIT: - ret = e; - break; - - case XPR_NODE: - ret = e; - break; - /*@-branchstate@*/ - } - /*@=branchstate@*/ - /*@=observertrans@*/ - /*@=exposetrans@*/ - /*@=dependenttrans@*/ - } - - if (!innerEffect) - { - inEffect = FALSE; - } - - return ret; -} - -static /*@observer@*/ cstring exprNode_rootVarName (exprNode e) -{ - cstring ret; - exprData data; - - if (exprNode_isError (e)) - { - return cstring_undefined; - } - - data = e->edata; - - switch (e->kind) - { - case XPR_PARENS: - ret = exprNode_rootVarName (exprData_getUopNode (data)); - break; - case XPR_ASSIGN: - ret = exprNode_rootVarName (exprData_getOpA (data)); - break; - case XPR_CONST: - case XPR_VAR: - ret = exprData_getId (data); - break; - case XPR_LABEL: - case XPR_TOK: - case XPR_ITERCALL: - case XPR_EMPTY: - case XPR_CALL: - case XPR_INITBLOCK: - case XPR_BODY: - case XPR_FETCH: - case XPR_OP: - case XPR_POSTOP: - case XPR_PREOP: - case XPR_OFFSETOF: - case XPR_ALIGNOFT: - case XPR_ALIGNOF: - case XPR_SIZEOFT: - case XPR_SIZEOF: - case XPR_VAARG: - case XPR_CAST: - case XPR_ITER: - case XPR_FOR: - case XPR_FORPRED: - case XPR_BREAK: - case XPR_RETURN: - case XPR_NULLRETURN: - case XPR_COMMA: - case XPR_COND: - case XPR_IF: - case XPR_IFELSE: - case XPR_WHILE: - case XPR_WHILEPRED: - case XPR_DOWHILE: - case XPR_GOTO: - case XPR_CONTINUE: - case XPR_FTDEFAULT: - case XPR_DEFAULT: - case XPR_SWITCH: - case XPR_FTCASE: - case XPR_CASE: - case XPR_BLOCK: - case XPR_STMT: - case XPR_STMTLIST: - case XPR_INIT: - case XPR_FACCESS: - case XPR_ARROW: - case XPR_NODE: - case XPR_NUMLIT: - case XPR_STRINGLITERAL: - ret = cstring_undefined; - break; - } - - return ret; -} - - -static /*@only@*/ cstring exprNode_doUnparse (exprNode e) -{ - cstring ret; - exprData data; - - if (exprNode_isError (e)) - { - static /*@only@*/ cstring error = cstring_undefined; - - if (!cstring_isDefined (error)) - { - error = cstring_makeLiteral (""); - } - - return error; - } - - data = e->edata; - - switch (e->kind) - { - case XPR_PARENS: - ret = message ("(%s)", exprNode_unparse (exprData_getUopNode (e->edata))); - break; - case XPR_ASSIGN: - ret = message ("%s %s %s", - exprNode_unparse (exprData_getOpA (data)), - lltok_unparse (exprData_getOpTok (data)), - exprNode_unparse (exprData_getOpB (data))); - break; - case XPR_CALL: - ret = message ("%s(%q)", - exprNode_unparse (exprData_getFcn (data)), - exprNodeList_unparse (exprData_getArgs (data))); - break; - case XPR_INITBLOCK: - ret = message ("{ %q }", exprNodeList_unparse (exprData_getArgs (data))); - break; - case XPR_EMPTY: - ret = cstring_undefined; - break; - case XPR_LABEL: - ret = message ("%s:", exprData_getId (data)); - break; - case XPR_CONST: - case XPR_VAR: - ret = cstring_copy (exprData_getId (data)); - break; - case XPR_FETCH: - ret = message ("%s[%s]", exprNode_unparse (exprData_getPairA (data)), - exprNode_unparse (exprData_getPairB (data))); - break; - case XPR_BODY: - ret = message (""); - break; - case XPR_OP: - ret = message ("%s %s %s", - exprNode_unparse (exprData_getOpA (data)), - lltok_unparse (exprData_getOpTok (data)), - exprNode_unparse (exprData_getOpB (data))); - break; - - case XPR_PREOP: - ret = message ("%s%s", - lltok_unparse (exprData_getUopTok (data)), - exprNode_unparse (exprData_getUopNode (data))); - break; - - case XPR_POSTOP: - ret = message ("%s%s", - exprNode_unparse (exprData_getUopNode (data)), - lltok_unparse (exprData_getUopTok (data))); - break; - - case XPR_OFFSETOF: - ret = message ("offsetof(%s,%q)", - ctype_unparse (qtype_getType (exprData_getOffsetType (data))), - cstringList_unparseSep (exprData_getOffsetName (data), cstring_makeLiteralTemp ("."))); - break; - - case XPR_SIZEOFT: - ret = message ("sizeof(%s)", ctype_unparse (qtype_getType (exprData_getType (data)))); - break; - - case XPR_SIZEOF: - ret = message ("sizeof(%s)", exprNode_unparse (exprData_getSingle (data))); - break; - - case XPR_ALIGNOFT: - ret = message ("alignof(%s)", ctype_unparse (qtype_getType (exprData_getType (data)))); - break; - - case XPR_ALIGNOF: - ret = message ("alignof(%s)", exprNode_unparse (exprData_getSingle (data))); - break; - - case XPR_VAARG: - ret = message ("va_arg(%s, %q)", - exprNode_unparse (exprData_getCastNode (data)), - qtype_unparse (exprData_getCastType (data))); - break; - - case XPR_ITERCALL: - ret = message ("%q(%q)", - uentry_getName (exprData_getIterCallIter (data)), - exprNodeList_unparse (exprData_getIterCallArgs (data))); - break; - case XPR_ITER: - ret = message ("%q(%q) %s %q", - uentry_getName (exprData_getIterSname (data)), - exprNodeList_unparse (exprData_getIterAlist (data)), - exprNode_unparse (exprData_getIterBody (data)), - uentry_getName (exprData_getIterEname (data))); - break; - case XPR_CAST: - ret = message ("(%q)%s", - qtype_unparse (exprData_getCastType (data)), - exprNode_unparse (exprData_getCastNode (data))); - break; - - case XPR_FOR: - ret = message ("%s %s", - exprNode_unparse (exprData_getPairA (data)), - exprNode_unparse (exprData_getPairB (data))); - break; - - case XPR_FORPRED: - ret = message ("for (%s; %s; %s)", - exprNode_unparse (exprData_getTripleInit (data)), - exprNode_unparse (exprData_getTripleTest (data)), - exprNode_unparse (exprData_getTripleInc (data))); - break; - - case XPR_GOTO: - ret = message ("goto %s", exprData_getLiteral (data)); - break; - - case XPR_CONTINUE: - ret = cstring_makeLiteral ("continue"); - break; - - case XPR_BREAK: - ret = cstring_makeLiteral ("break"); - break; - - case XPR_RETURN: - ret = message ("return %s", exprNode_unparse (exprData_getSingle (data))); - break; - - case XPR_NULLRETURN: - ret = cstring_makeLiteral ("return"); - break; - - case XPR_COMMA: - ret = message ("%s, %s", - exprNode_unparse (exprData_getPairA (data)), - exprNode_unparse (exprData_getPairB (data))); - break; - - case XPR_COND: - ret = message ("%s ? %s : %s", - exprNode_unparse (exprData_getTriplePred (data)), - exprNode_unparse (exprData_getTripleTrue (data)), - exprNode_unparse (exprData_getTripleFalse (data))); - break; - case XPR_IF: - ret = message ("if (%s) %s", - exprNode_unparse (exprData_getPairA (data)), - exprNode_unparse (exprData_getPairB (data))); - break; - - case XPR_IFELSE: - ret = message ("if (%s) %s else %s", - exprNode_unparse (exprData_getTriplePred (data)), - exprNode_unparse (exprData_getTripleTrue (data)), - exprNode_unparse (exprData_getTripleFalse (data))); - break; - case XPR_WHILE: - ret = message ("while (%s) %s", - exprNode_unparse (exprData_getPairA (data)), - exprNode_unparse (exprData_getPairB (data))); - break; - - case XPR_WHILEPRED: - ret = cstring_copy (exprNode_unparse (exprData_getSingle (data))); - break; - - case XPR_TOK: - ret = cstring_copy (lltok_unparse (exprData_getTok (data))); - break; - - case XPR_DOWHILE: - ret = message ("do { %s } while (%s)", - exprNode_unparse (exprData_getPairB (data)), - exprNode_unparse (exprData_getPairA (data))); - break; - - case XPR_BLOCK: - ret = message ("{ %s }", exprNode_unparseFirst (exprData_getSingle (data))); - break; - - case XPR_STMT: - ret = cstring_copy (exprNode_unparse (exprData_getUopNode (data))); - break; - - case XPR_STMTLIST: - ret = message ("%s; %s", - exprNode_unparse (exprData_getPairA (data)), - exprNode_unparse (exprData_getPairB (data))); - break; - - case XPR_FTDEFAULT: - case XPR_DEFAULT: - ret = cstring_makeLiteral ("default:"); - break; - - case XPR_SWITCH: - ret = message ("switch (%s) %s", - exprNode_unparse (exprData_getPairA (data)), - exprNode_unparse (exprData_getPairB (data))); - break; - - case XPR_FTCASE: - case XPR_CASE: - ret = message ("case %s:", - exprNode_unparse (exprData_getSingle (data))); - break; - - case XPR_INIT: - ret = message ("%s = %s", - idDecl_getName (exprData_getInitId (data)), - exprNode_unparse (exprData_getInitNode (data))); - break; - - case XPR_FACCESS: - ret = message ("%s.%s", - exprNode_unparse (exprData_getFieldNode (data)), - exprData_getFieldName (data)); - break; - - case XPR_ARROW: - ret = message ("%s->%s", - exprNode_unparse (exprData_getFieldNode (data)), - exprData_getFieldName (data)); - break; - - case XPR_STRINGLITERAL: - ret = cstring_copy (exprData_getLiteral (data)); - break; - - case XPR_NUMLIT: - ret = cstring_copy (exprData_getLiteral (data)); - break; - - case XPR_NODE: - ret = cstring_makeLiteral (""); - break; - } - - return ret; -} - -bool -exprNode_isCharLit (exprNode e) -{ - if (exprNode_isDefined (e)) - { - return (multiVal_isChar (exprNode_getValue (e))); - } - else - { - return FALSE; - } -} - -bool -exprNode_isNumLit (exprNode e) -{ - if (exprNode_isDefined (e)) - { - return (multiVal_isInt (exprNode_getValue (e))); - } - else - { - return FALSE; - } -} - -static bool -exprNode_isFalseConstant (exprNode e) -{ - if (exprNode_isDefined (e)) - { - cstring s = exprNode_rootVarName (e); - - if (cstring_equal (s, context_getFalseName ())) - { - return TRUE; - } - } - - return FALSE; -} - -bool -exprNode_matchLiteral (ctype expected, exprNode e) -{ - if (exprNode_isDefined (e)) - { - multiVal m = exprNode_getValue (e); - - if (multiVal_isDefined (m)) - { - if (multiVal_isInt (m)) - { - long int val = multiVal_forceInt (m); - - if (ctype_isDirectBool (ctype_realishType (expected))) - { - if (val == 0) - { - return FALSE; /* really?! return TRUE; allow use of 0 for FALSE */ - } - else - { - return FALSE; - } - } - - if (ctype_isRealInt (expected)) - { - /* - ** unsigned <- [ constant >= 0 is okay ] - */ - - if (ctype_isUnsigned (expected)) - { - if (val < 0) - { - return FALSE; - } - } - - /* - ** No checks on sizes of integers...maybe add - ** these later. - */ - - DPRINTF (("Here: %s => %s", exprNode_unparse (e), ctype_unparse (expected))); - DPRINTF (("Type: %s / %s", ctype_unparse (exprNode_getType (e)), - bool_unparse (ctype_isInt (exprNode_getType (e))))); - - if (context_getFlag (FLG_NUMLITERAL) - && (ctype_isRegularInt (exprNode_getType (e)) || val == 0)) { - return TRUE; - } else { - if (val == 0) { - return TRUE; - } else { - return FALSE; /* evs 2000-05-17: previously, always returned TRUE */ - } - } - } - else if (ctype_isChar (expected)) - { - return FALSE; - } - else if (ctype_isArrayPtr (expected)) - { - return (val == 0); - } - else if (ctype_isAnyFloat (expected)) - { - return (context_getFlag (FLG_NUMLITERAL)); - } - else - { - return FALSE; - } - } - else if (multiVal_isDouble (m)) - { - if (ctype_isAnyFloat (expected)) - { - return TRUE; - } - } - else if (multiVal_isChar (m)) - { - char val = multiVal_forceChar (m); - - if (ctype_isChar (expected)) - { - if (ctype_isUnsigned (expected) && ((int)val) < 0) - { - return FALSE; - } - else - { - return TRUE; - } - } - } - else - { - return FALSE; - } - } - } - - return FALSE; -} - -bool -exprNode_matchType (ctype expected, exprNode e) -{ - ctype actual; - - if (!exprNode_isDefined (e)) return TRUE; - - actual = ctype_realishType (exprNode_getType (e)); - - if (ctype_match (ctype_realishType (expected), actual)) - { - return TRUE; - } - - llassert (!exprNode_isError (e)); - return (exprNode_matchLiteral (expected, e)); -} - -static bool -exprNode_matchTypes (exprNode e1, exprNode e2) -{ - ctype t1; - ctype t2; - - if (!exprNode_isDefined (e1)) return TRUE; - if (!exprNode_isDefined (e2)) return TRUE; - - /* - ** realish type --- keep bools, bools - */ - - t1 = ctype_realishType (exprNode_getType (e1)); - t2 = ctype_realishType (exprNode_getType (e2)); - - if (ctype_match (t1, t2)) - { - return TRUE; - } - - return (exprNode_matchLiteral (t1, e2) || exprNode_matchLiteral (t2, e1)); -} - -/* -** pass e as ct -*/ - -static bool - exprNode_matchArgType (ctype ct, exprNode e) -{ - ctype et; - - if (!exprNode_isDefined (e)) - { - return TRUE; - } - - et = ctype_realType (exprNode_getType (e)); - - if (ctype_matchArg (ct, et)) return TRUE; - - llassert (!exprNode_isError (e)); - return (exprNode_matchLiteral (ct, e)); -} - -static /*@only@*/ exprNodeSList - exprNode_flatten (/*@dependent@*/ exprNode e) /*@*/ -{ - if (exprNode_isDefined (e)) - { - if (e->kind == XPR_STMTLIST) - { - return (exprNodeSList_append - (exprNode_flatten (exprData_getPairA (e->edata)), - exprNode_flatten (exprData_getPairB (e->edata)))); - } - else if (e->kind == XPR_BLOCK) - { - return (exprNode_flatten (exprData_getSingle (e->edata))); - } - else - { - return (exprNodeSList_singleton (e)); - } - } - - return exprNodeSList_new (); -} - -static /*@exposed@*/ exprNode -exprNode_lastStatement (/*@returned@*/ exprNode e) -{ - if (exprNode_isDefined (e)) - { - if (e->kind == XPR_STMTLIST) - { - exprNode b = exprData_getPairB (e->edata); - - if (exprNode_isDefined (b)) - { - return exprNode_lastStatement (b); - } - else - { - return exprNode_lastStatement (exprData_getPairA (e->edata)); - } - } - else if (e->kind == XPR_BLOCK) - { - return (exprNode_lastStatement (exprData_getSingle (e->edata))); - } - else - { - return (e); - } - } - - return exprNode_undefined; -} - -static /*@exposed@*/ exprNode -exprNode_firstStatement (/*@returned@*/ exprNode e) -{ - if (exprNode_isDefined (e)) - { - if (e->kind == XPR_STMTLIST) - { - exprNode b = exprData_getPairA (e->edata); - - if (exprNode_isDefined (b)) - { - return exprNode_firstStatement (b); - } - else - { - return exprNode_firstStatement (exprData_getPairB (e->edata)); - } - } - else if (e->kind == XPR_BLOCK) - { - return (exprNode_firstStatement (exprData_getSingle (e->edata))); - } - else - { - return (e); - } - } - - return exprNode_undefined; -} - -static void -exprNode_mergeUSs (exprNode res, exprNode other) -{ - if (exprNode_isDefined (res) && exprNode_isDefined (other)) - { - res->msets = sRefSet_union (res->msets, other->msets); - res->sets = sRefSet_union (res->sets, other->sets); - res->uses = sRefSet_union (res->uses, other->uses); - } -} - -static void -exprNode_mergeCondUSs (exprNode res, exprNode other1, exprNode other2) -{ - if (exprNode_isDefined (res)) - { - if (exprNode_isDefined (other1)) - { - res->sets = sRefSet_union (res->sets, other1->sets); - res->msets = sRefSet_union (res->msets, other1->msets); - res->uses = sRefSet_union (res->uses, other1->uses); - } - if (exprNode_isDefined (other2)) - { - res->sets = sRefSet_union (res->sets, other2->sets); - res->msets = sRefSet_union (res->msets, other2->msets); - res->uses = sRefSet_union (res->uses, other2->uses); - } - } -} - -/* -** modifies e->uses -** -** Reports errors is s is not defined. -*/ - -static void -exprNode_addUse (exprNode e, sRef s) -{ - if (exprNode_isDefined (e)) - { - e->uses = sRefSet_insert (e->uses, s); - } -} - -void -exprNode_checkUse (exprNode e, sRef s, fileloc loc) -{ - if (sRef_isKnown (s) && !sRef_isConst (s)) - { - /* - ** need to check all outer types are useable - */ - - DPRINTF (("Check use: %s / %s", - exprNode_unparse (e), sRef_unparse (s))); - - exprNode_addUse (e, s); - - if (!context_inProtectVars ()) - { - /* - ** only report the deepest error - */ - - sRef errorRef = sRef_undefined; - sRef lastRef = sRef_undefined; - bool deadRef = FALSE; - bool unuseable = FALSE; - bool errorMaybe = FALSE; - - while (sRef_isValid (s) && sRef_isKnown (s)) - { - ynm readable = sRef_isReadable (s); - - if (!(ynm_toBoolStrict (readable))) - { - if (ynm_isMaybe (readable)) - { - lastRef = errorRef; - errorRef = s; - deadRef = sRef_isPossiblyDead (errorRef); - unuseable = sRef_isUnuseable (errorRef); - errorMaybe = TRUE; - } - else - { - lastRef = errorRef; - errorRef = s; - deadRef = sRef_isDead (errorRef); - unuseable = sRef_isUnuseable (errorRef); - errorMaybe = FALSE; - } - - if (!sRef_isPartial (s)) - { - sRef_setDefined (s, fileloc_undefined); - } - } - - s = sRef_getBaseSafe (s); - } /* end while */ - - if (sRef_isValid (errorRef)) - { - if (sRef_isValid (lastRef) && sRef_isField (lastRef) - && sRef_isPointer (errorRef)) - { - errorRef = lastRef; - } - - if (deadRef) - { - if (sRef_isThroughArrayFetch (errorRef)) - { - if (optgenerror - (FLG_STRICTUSERELEASED, - message ("%q %q may be used after being released", - sRef_unparseKindNamePlain (errorRef), - sRef_unparse (errorRef)), - loc)) - { - sRef_showRefKilled (errorRef); - - if (sRef_isKept (errorRef)) - { - sRef_clearAliasState (errorRef, loc); - } - } - } - else - { - DPRINTF (("HERE: %s", sRef_unparse (errorRef))); - - if (optgenerror - (FLG_USERELEASED, - message ("%q %q %qused after being released", - sRef_unparseKindNamePlain (errorRef), - sRef_unparse (errorRef), - cstring_makeLiteral (errorMaybe - ? "may be " : "")), - loc)) - { - sRef_showRefKilled (errorRef); - - if (sRef_isKept (errorRef)) - { - sRef_clearAliasState (errorRef, loc); - } - } - } - } - else if (unuseable) - { - if (optgenerror - (FLG_USEDEF, - message ("%q %q%qused in inconsistent state", - sRef_unparseKindName (errorRef), - sRef_unparseOpt (errorRef), - cstring_makeLiteral (errorMaybe ? "may be " : "")), - loc)) - { - sRef_showStateInconsistent (errorRef); - } - } - else - { - DPRINTF (("HERE: %s", sRef_unparse (errorRef))); - - voptgenerror - (FLG_USEDEF, - message ("%q %q%qused before definition", - sRef_unparseKindName (errorRef), - sRef_unparseOpt (errorRef), - cstring_makeLiteral (errorMaybe ? "may be " : "")), - loc); - } - - sRef_setDefined (errorRef, loc); - - if (sRef_isAddress (errorRef)) - { - sRef_setDefined (sRef_getRootBase (errorRef), loc); - } - } /* end is error */ - } - } - - setCodePoint (); -} - -static void -checkSafeUse (exprNode e, sRef s) -{ - if (exprNode_isDefined (e) && sRef_isKnown (s)) - { - e->uses = sRefSet_insert (e->uses, s); - } -} - -static void -exprNode_checkSetAny (exprNode e, /*@dependent@*/ cstring name) -{ - if (exprNode_isDefined (e)) - { - e->sets = sRefSet_insert (e->sets, sRef_makeUnconstrained (name)); - } -} - -void -exprNode_checkSet (exprNode e, sRef s) -{ - sRef defines = sRef_undefined; - - if (sRef_isValid (s) && !sRef_isNothing (s)) - { - uentry ue = sRef_getBaseUentry (s); - - if (uentry_isValid (ue)) - { - uentry_setLset (ue); - } - - if (!ynm_toBoolStrict (sRef_isWriteable (s))) - { - voptgenerror (FLG_USEDEF, - message ("Attempt to set unuseable storage: %q", - sRef_unparse (s)), - exprNode_loc (e)); - } - - if (sRef_isMeaningful (s)) - { - - if (sRef_isDead (s)) - { - sRef base = sRef_getBaseSafe (s); - - if (sRef_isValid (base) - && sRef_isDead (base)) - { - sRef_setPartial (s, exprNode_loc (e)); - } - - defines = s; /* okay - modifies for only param */ - } - else if (sRef_isPartial (s)) - { - sRef eref = exprNode_getSref (e); - - if (!sRef_isPartial (eref)) - { - /* - ** should do something different here??? - */ - - sRef_setDefinedComplete (eref, exprNode_loc (e)); - } - else - { - sRef_setPartialDefinedComplete (eref, exprNode_loc (e)); - } - - if (sRef_isMeaningful (eref)) - { - defines = eref; - } - else - { - defines = s; - } - } - else if (sRef_isAllocated (s)) - { - sRef eref = exprNode_getSref (e); - - - if (!sRef_isAllocated (eref)) - { - sRef_setDefinedComplete (eref, exprNode_loc (e)); - } - else - { - sRef base = sRef_getBaseSafe (eref); - - if (sRef_isValid (base)) - { - sRef_setPdefined (base, exprNode_loc (e)); - } - } - - defines = s; - } - else - { - sRef_setDefinedNCComplete (s, exprNode_loc (e)); - defines = s; - } - - } - else /* not meaningful...but still need to insert it */ - { - defines = s; - } - } - - if (exprNode_isDefined (e) && sRef_isValid (defines)) - { - e->sets = sRefSet_insert (e->sets, defines); - } -} - -void -exprNode_checkMSet (exprNode e, sRef s) -{ - if (sRef_isValid (s) && !sRef_isNothing (s)) - { - uentry ue = sRef_getBaseUentry (s); - - if (uentry_isValid (ue)) - { - uentry_setLset (ue); - } - - if (!ynm_toBoolStrict (sRef_isWriteable (s))) - { - voptgenerror (FLG_USEDEF, - message ("Attempt to set unuseable storage: %q", sRef_unparse (s)), - exprNode_loc (e)); - } - - if (sRef_isMeaningful (s)) - { - sRef_setDefinedComplete (s, exprNode_loc (e)); - } - - if (exprNode_isDefined (e)) - { - e->msets = sRefSet_insert (e->msets, s); - } - } -} - -static void -checkUnspecCall (/*@notnull@*/ /*@dependent@*/ exprNode fcn, uentryList params, exprNodeList args) -{ - checkAnyCall (fcn, cstring_undefined, params, args, - FALSE, sRefSet_undefined, FALSE, 0); -} - -static void -checkOneArg (uentry ucurrent, /*@notnull@*/ exprNode current, - /*@dependent@*/ exprNode fcn, bool isSpec, int argno, int totargs) -{ - setCodePoint (); - - if (uentry_isYield (ucurrent)) - { - sRef_setDefined (exprNode_getSref (current), exprNode_loc (current)); - exprNode_checkSet (current, current->sref); - } - else - { - if (uentry_isSefParam (ucurrent)) - { - sRefSet sets = current->sets; - sRef ref = exprNode_getSref (current); - - if (sRef_isMacroParamRef (ref)) - { - uentry ue = sRef_getUentry (ref); - - if (!uentry_isSefParam (ue)) - { - voptgenerror - (FLG_SEFPARAMS, - message - ("Parameter %d to %s is declared sef, but " - "the argument is a macro parameter declared " - "without sef: %s", - argno, exprNode_unparse (fcn), - exprNode_unparse (current)), - exprNode_loc (current)); - } - } - - if (!sRefSet_isEmpty (sets)) - { - sRefSet reported = sRefSet_undefined; - - sRefSet_realElements (current->sets, el) - { - if (sRefSet_isSameNameMember (reported, el)) - { - ; /* don't report again */ - } - else - { - if (sRef_isUnconstrained (el)) - { - voptgenerror - (FLG_SEFUNSPEC, - message - ("Parameter %d to %s is declared sef, but " - "the argument calls unconstrained function %s " - "(no guarantee it will not modify something): %s", - argno, exprNode_unparse (fcn), - sRef_unconstrainedName (el), - exprNode_unparse (current)), - exprNode_loc (current)); - } - else - { - voptgenerror - (FLG_SEFPARAMS, - message - ("Parameter %d to %s is declared sef, but " - "the argument may modify %q: %s", - argno, exprNode_unparse (fcn), - sRef_unparse (el), - exprNode_unparse (current)), - exprNode_loc (current)); - } - } - } end_sRefSet_realElements; - } - } - - checkPassTransfer (current, ucurrent, isSpec, fcn, argno, totargs); - exprNode_mergeUSs (fcn, current); - } -} - -static void - checkAnyCall (/*@dependent@*/ exprNode fcn, - /*@dependent@*/ cstring fname, - uentryList pn, - exprNodeList args, - bool hasMods, sRefSet mods, - bool isSpec, - int specialArgs) -{ - int paramno = 0; - int nargs = exprNodeList_size (args); - - setCodePoint (); - - /* - ** concat all args ud's to f, add each arg sref as a use unless - ** it was specified as "out", in which case it is a def. - */ - - uentryList_reset (pn); - - /* - ** aliasing checks: - ** - ** if paramn is only or unique, no other arg may alias argn - */ - - exprNodeList_elements (args, current) - { - paramno++; - - if (exprNode_isDefined (current)) - { - if ((!uentryList_isUndefined (pn) && !uentryList_isFinished (pn))) - { - uentry ucurrent = uentryList_current (pn); - - if (specialArgs == 0 - || (paramno < specialArgs)) - { - checkOneArg (ucurrent, current, fcn, isSpec, paramno, nargs); - - if (context_maybeSet (FLG_ALIASUNIQUE)) - { - if (uentry_isOnly (ucurrent) - || uentry_isUnique (ucurrent)) - { - checkUniqueParams (fcn, current, args, - paramno, ucurrent); - } - } - } - } - else /* uentry is undefined */ - { - if (specialArgs == 0) - { - exprNode_checkUseParam (current); - } - - exprNode_mergeUSs (fcn, current); - } - } - uentryList_advanceSafe (pn); - } end_exprNodeList_elements; - - if (hasMods) - { - setCodePoint (); - - sRefSet_allElements (mods, s) - { - sRef fb; - sRef rb = sRef_getRootBase (s); - - if (sRef_isGlobal (rb)) - { - context_usedGlobal (rb); - } - - fb = sRef_fixBaseParam (s, args); - - if (!sRef_isMacroParamRef (fb)) - { - if (sRef_isNothing (fb)) - { - ; - } - else - { - if (sRef_isValid (fb)) - { - uentry ue = sRef_getBaseUentry (s); - - if (uentry_isValid (ue)) - { - uentry_setLset (ue); - } - } - - fcn->sets = sRefSet_insert (fcn->sets, fb); - } - } - sRef_clearDerivedComplete (s); - } end_sRefSet_allElements; - - setCodePoint (); - } - else - { - if (context_hasMods ()) - { - if (context_maybeSet (FLG_MODUNCON)) - { - voptgenerror - (FLG_MODUNCON, - message ("Undetected modification possible " - "from call to unconstrained function %s: %s", - fname, - exprNode_unparse (fcn)), - exprNode_loc (fcn)); - } - } - else - { - if (context_maybeSet (FLG_MODUNCONNOMODS) - && !(context_inIterDef () || context_inIterEnd ())) - { - voptgenerror - (FLG_MODUNCONNOMODS, - message ("Undetected modification possible " - "from call to unconstrained function %s: %s", - fname, - exprNode_unparse (fcn)), - exprNode_loc (fcn)); - } - } - - exprNode_checkSetAny (fcn, fname); - } -} - -void exprNode_checkUseParam (exprNode current) -{ - if (exprNode_isDefined (current)) - { - exprNode_checkUse (current, current->sref, current->loc); - } -} - -static ctype - checkNumerics (ctype tr1, ctype tr2, ctype te1, ctype te2, - /*@notnull@*/ exprNode e1, /*@notnull@*/ exprNode e2, - lltok op) -{ - ctype ret = tr1; - - if (!ctype_match (tr1, tr2)) - { - if ((ctype_isRealInt (tr1) || ctype_isReal (tr1)) && - (ctype_isRealInt (tr2) || ctype_isReal (tr2))) - { - ; - } - else - { - (void) gentypeerror - (tr1, e1, tr2, e2, - message ("Incompatible types for %s (%s, %s): %s %s %s", - lltok_unparse (op), - ctype_unparse (te1), - ctype_unparse (te2), - exprNode_unparse (e1), lltok_unparse (op), - exprNode_unparse (e2)), - e1->loc); - } - ret = ctype_unknown; - } - else - { - if (ctype_isForceRealNumeric (&tr1) && ctype_isForceRealNumeric (&tr2)) - { - ret = ctype_resolveNumerics (tr1, tr2); - } - else if (!context_msgStrictOps ()) - { - if (ctype_isPointer (tr1)) - { - if (ctype_isPointer (tr2) && !exprNode_isNullValue (e2)) - { - ret = ctype_int; - } - else if (ctype_isInt (tr2)) - { - ret = te1; - } - else - { - ret = ctype_unknown; - } - } - else if (ctype_isPointer (tr2)) - { - if (ctype_isPointer (tr1)) - { - ret = ctype_int; - } - else if (ctype_isInt (tr1)) - { - ret = te2; - } - else - { - ret = ctype_unknown; - } - } - else - { - ret = ctype_resolveNumerics (tr1, tr2); - } - } - else - { - int opid = lltok_getTok (op); - bool comparop = (opid == EQ_OP || opid == NE_OP - || opid == TLT || opid == TGT - || opid == LE_OP || opid == GE_OP); - - if (!ctype_isNumeric (tr1) && !ctype_isNumeric (tr2)) - { - if (comparop - && ((ctype_isEnum (tr1) && ctype_isEnum (tr2)) - || (ctype_isBool (tr1) && ctype_isBool (tr2)) - || (ctype_isChar (tr1) && ctype_isChar (tr2)))) - { - ; /* no error */ - } - else - { - if (ctype_sameName (te1, te2)) - { - voptgenerror - (FLG_STRICTOPS, - message ("Operands of %s are non-numeric (%t): %s %s %s", - lltok_unparse (op), te1, - exprNode_unparse (e1), lltok_unparse (op), - exprNode_unparse (e2)), - e1->loc); - } - else - { - voptgenerror - (FLG_STRICTOPS, - message ("Operands of %s are non-numerics (%t, %t): %s %s %s", - lltok_unparse (op), te1, te2, - exprNode_unparse (e1), lltok_unparse (op), - exprNode_unparse (e2)), - e1->loc); - } - } - } - else if (!ctype_isNumeric (tr1)) - { - voptgenerror - (FLG_STRICTOPS, - message ("Right operand of %s is non-numeric (%t): %s %s %s", - lltok_unparse (op), te1, - exprNode_unparse (e1), lltok_unparse (op), - exprNode_unparse (e2)), - e1->loc); - } - else - { - if (!ctype_isNumeric (tr2)) - { - voptgenerror - (FLG_STRICTOPS, - message ("Left operand of %s is non-numeric (%t): %s %s %s", - lltok_unparse (op), te2, - exprNode_unparse (e1), lltok_unparse (op), - exprNode_unparse (e2)), - e2->loc); - } - } - - ret = ctype_unknown; - } - } - - return ret; -} - -static void -abstractOpError (ctype tr1, ctype tr2, lltok op, - /*@notnull@*/ exprNode e1, /*@notnull@*/ exprNode e2, - fileloc loc1, fileloc loc2) -{ - if (ctype_isRealAbstract (tr1) && ctype_isRealAbstract (tr2)) - { - if (ctype_match (tr1, tr2)) - { - voptgenerror - (FLG_ABSTRACT, - message ("Operands of %s are abstract type (%t): %s %s %s", - lltok_unparse (op), tr1, - exprNode_unparse (e1), lltok_unparse (op), exprNode_unparse (e2)), - loc1); - } - else - { - voptgenerror - (FLG_ABSTRACT, - message ("Operands of %s are abstract types (%t, %t): %s %s %s", - lltok_unparse (op), tr1, tr2, - exprNode_unparse (e1), lltok_unparse (op), exprNode_unparse (e2)), - loc1); - } - } - else if (ctype_isRealAbstract (tr1)) - { - voptgenerror - (FLG_ABSTRACT, - message ("Left operand of %s is abstract type (%t): %s %s %s", - lltok_unparse (op), tr1, - exprNode_unparse (e1), lltok_unparse (op), exprNode_unparse (e2)), - loc1); - } - else - { - if (ctype_isRealAbstract (tr2)) - { - voptgenerror - (FLG_ABSTRACT, - message ("Right operand of %s is abstract type (%t): %s %s %s", - lltok_unparse (op), tr2, - exprNode_unparse (e1), lltok_unparse (op), exprNode_unparse (e2)), - loc2); - } - } -} - -/* -** e1 <= e2 -** -** requies e1 and e2 and not error exprNode's. -** -** Checks: -** -** If e1 is a component of an abstract type, and e2 is mutable and client-visible, -** the rep of the abstract type is exposed. -** -** The order is very important: -** -** check rep expose (move into check transfer) -** check transfer -** setup aliases -*/ - -/* -** This isn't really a sensible procedure, but the indententation -** was getting too deep. -*/ - -static void -checkOneRepExpose (sRef ysr, sRef base, - /*@notnull@*/ exprNode e1, - /*@notnull@*/ exprNode e2, ctype ct, - sRef s2b) -{ - if (!(sRef_isOnly (ysr) || sRef_isKeep (ysr) - || sRef_isOwned (ysr) || sRef_isExposed (ysr))) - { - if (sRef_isAnyParam (base) && !sRef_isExposed (base)) - { - if (sRef_isIReference (ysr)) - { - if (sRef_sameName (base, sRef_getRootBase (e2->sref))) - { - voptgenerror - (FLG_ASSIGNEXPOSE, - message - ("Assignment of mutable component of parameter %q " - "to component of abstract " - "type %s exposes rep: %s = %s", - sRef_unparse (base), - ctype_unparse (ct), - exprNode_unparse (e1), exprNode_unparse (e2)), - e1->loc); - } - else - { - voptgenerror - (FLG_ASSIGNEXPOSE, - message - ("Assignment of mutable component of parameter %q " - "(through alias %q) to component of abstract " - "type %s exposes rep: %s = %s", - sRef_unparse (base), - sRef_unparse (e2->sref), - ctype_unparse (ct), - exprNode_unparse (e1), exprNode_unparse (e2)), - e1->loc); - } - } - else - { - if (sRef_sameName (base, sRef_getRootBase (e2->sref))) - { - voptgenerror - (FLG_ASSIGNEXPOSE, - message ("Assignment of mutable parameter %q " - "to component of abstract type %s " - "exposes rep: %s = %s", - sRef_unparse (base), - ctype_unparse (ct), - exprNode_unparse (e1), - exprNode_unparse (e2)), - e1->loc); - } - else - { - voptgenerror - (FLG_ASSIGNEXPOSE, - message ("Assignment of mutable parameter %q " - "(through alias %q) to " - "component of abstract type %s exposes " - "rep: %s = %s", - sRef_unparse (base), - sRef_unparse (e2->sref), - ctype_unparse (ct), - exprNode_unparse (e1), - exprNode_unparse (e2)), - e1->loc); - } - } - } - - if (sRef_isGlobal (s2b)) - { - if (sRef_sameName (base, sRef_getRootBase (e2->sref))) - { - voptgenerror - (FLG_REPEXPOSE, - message ("Assignment of global %q " - "to component of " - "abstract type %s exposes rep: %s = %s", - sRef_unparse (base), - ctype_unparse (ct), - exprNode_unparse (e1), exprNode_unparse (e2)), - e1->loc); - } - else - { - voptgenerror - (FLG_REPEXPOSE, - message ("Assignment of global %q (through alias %q) " - "to component of " - "abstract type %s exposes rep: %s = %s", - sRef_unparse (base), - sRef_unparse (e2->sref), - ctype_unparse (ct), - exprNode_unparse (e1), exprNode_unparse (e2)), - e1->loc); - } - } - } -} - -static void -doAssign (/*@notnull@*/ exprNode e1, /*@notnull@*/ exprNode e2, bool isInit) -{ - if (ctype_isRealFunction (exprNode_getType (e1)) - && !ctype_isRealPointer (exprNode_getType (e1))) - { - voptgenerror - (FLG_TYPE, - message ("Invalid left-hand side of assignment (function type %s): %s", - ctype_unparse (exprNode_getType (e1)), - exprNode_unparse (e1)), - e1->loc); - } - - if (context_getFlag (FLG_ASSIGNEXPOSE) && ctype_isMutable (e2->typ)) - { - ctype t2 = exprNode_getType (e2); - sRef sr = sRef_getRootBase (e1->sref); - ctype ct = sRef_getType (sr); - - if (ctype_isAbstract (t2) - && !(uentry_isMutableDatatype (usymtab_getTypeEntry (ctype_typeId (t2))))) - { - /* it is immutable, okay to reference */ - goto donerepexpose; - } - - if (ctype_isAbstract (ct) && sRef_isIReference (e1->sref)) - { - sRef s2b = sRef_getRootBase (e2->sref); - sRef s1 = e1->sref; - sRef s1b = sRef_getRootBase (s1); - sRefSet aliases; - - aliases = usymtab_canAlias (e2->sref); - - if (!sRef_similar (s2b, s1b) - && !sRef_isExposed (s1) - && !(sRef_isOnly (s2b) || sRef_isKeep (s2b) || sRef_isExposed (s2b))) - { - if (sRef_isAnyParam (s2b) && !sRef_isOnly (s2b) - && !sRef_isOwned (s2b) && !sRef_isKeep (s2b) - && !sRef_isExposed (s2b)) - { - if (sRef_isIReference (e2->sref)) - { - voptgenerror - (FLG_ASSIGNEXPOSE, - message - ("Assignment of mutable component of parameter %q " - "to component of abstract type %s exposes rep: %s = %s", - sRef_unparse (s2b), - ctype_unparse (ct), - exprNode_unparse (e1), exprNode_unparse (e2)), - e1->loc); - } - else - { - voptgenerror - (FLG_ASSIGNEXPOSE, - message ("Assignment of mutable parameter %q to " - "component of abstract type %s exposes rep: %s = %s", - sRef_unparse (s2b), - ctype_unparse (ct), - exprNode_unparse (e1), exprNode_unparse (e2)), - e1->loc); - } - } - - if (sRef_isGlobal (s2b)) - { - voptgenerror - (FLG_ASSIGNEXPOSE, - message ("Assignment of global %q to component of " - "abstract type %s exposes rep: %s = %s", - sRef_unparse (s2b), - ctype_unparse (ct), - exprNode_unparse (e1), exprNode_unparse (e2)), - e1->loc); - } - - sRefSet_realElements (aliases, ysr) - { - sRef base = sRef_getRootBase (ysr); - - if (sRef_similar (ysr, s2b) || sRef_similar (s1b, base) - || sRef_sameName (base, s1b)) - { - ; /* error already reported or same sref */ - } - else - { - checkOneRepExpose (ysr, base, e1, e2, ct, s2b); - } - } end_sRefSet_realElements; - } - sRefSet_free (aliases); - } - } - - donerepexpose: - - /* - ** function variables don't really work... - */ - - if (!ctype_isFunction (ctype_realType (e2->typ))) - { - if (isInit) - { - checkInitTransfer (e1, e2); - } - else - { - checkAssignTransfer (e1, e2); - } - } - else - { - sRef fref = e2->sref; - - sRef_setDefState (e1->sref, sRef_getDefState (fref), e1->loc); - sRef_setNullState (e1->sref, sRef_getNullState (fref), e1->loc); - - /* Need to typecheck the annotation on the parameters */ - - if (ctype_isRealFunction (e1->typ)) { - uentryList e1p = ctype_argsFunction (ctype_realType (e1->typ)); - uentryList e2p = ctype_argsFunction (ctype_realType (e2->typ)); - - if (!uentryList_isMissingParams (e1p) - && !uentryList_isMissingParams (e2p) - && uentryList_size (e1p) > 0) { - if (uentryList_size (e1p) == uentryList_size (e2p)) { - int n = 0; - - uentryList_elements (e1p, el1) { - uentry el2; - - el2 = uentryList_getN (e2p, n); - n++; - uentry_checkMatchParam (el1, el2, n, e2); - } end_uentryList_elements; - } - } - } - } - - if (isInit && sRef_isGlobal (e1->sref)) - { - ; - } - else - { - updateAliases (e1, e2); - } - updateEnvironment (e1, e2); -} - -static void -checkMacroParen (exprNode e) -{ - if (exprNode_isError (e) || e->kind == XPR_CAST) - { - ; - } - else - { - if (sRef_isUnsafe (e->sref) && !exprNode_isInParens (e)) - { - voptgenerror - (FLG_MACROPARENS, - message ("Macro parameter used without parentheses: %s", - exprNode_unparse (e)), - e->loc); - } - } -} - -static void -reflectNullTest (/*@notnull@*/ exprNode e, bool isnull) -{ - if (isnull) - { - e->guards = guardSet_addTrueGuard (e->guards, e->sref); - } - else - { - e->guards = guardSet_addFalseGuard (e->guards, e->sref); - } -} - -/* -** e1 <= e2 -** -** if e2 is a parameter or global derived location which -** can be modified (that is, e2 is a mutable abstract type, -** or a derived pointer), then e1 can alias e2. -** -** e1 can alias everything which e2 can alias. -** -** Also, if e1 is guarded, remove from guard sets! -*/ - -static void updateAliases (/*@notnull@*/ exprNode e1, /*@notnull@*/ exprNode e2) -{ - if (!context_inProtectVars ()) - { - /* - ** depends on types of e1 and e2 - */ - - sRef s1 = e1->sref; - sRef s2 = e2->sref; - ctype t1 = exprNode_getType (e1); - - /* handle pointer sRefs, record fields, arrays, etc... */ - - if (!ctype_isRealSU (t1)) - { - sRef_copyRealDerivedComplete (s1, s2); - } - - if (ctype_isMutable (t1) && sRef_isKnown (s1)) - { - usymtab_clearAlias (s1); - usymtab_addMustAlias (s1, s2); - } - - if (sRef_possiblyNull (s1) && usymtab_isGuarded (s1)) - { - usymtab_unguard (s1); - } - } -} - -exprNode exprNode_updateLocation (/*@returned@*/ exprNode e, /*@temp@*/ fileloc loc) -{ - if (exprNode_isDefined (e)) - { - e->loc = fileloc_update (e->loc, loc); - } - else - { - e = exprNode_createLoc (ctype_unknown, fileloc_copy (loc)); - } - - return (e); -} - -static void checkUniqueParams (exprNode fcn, - /*@notnull@*/ exprNode current, - exprNodeList args, - int paramno, uentry ucurrent) -{ - int iparamno = 0; - sRef thisref = exprNode_getSref (current); - - /* - ** Check if any argument could match this argument. - */ - - exprNodeList_elements (args, icurrent) - { - iparamno++; - - if (iparamno != paramno) - { - sRef sr = exprNode_getSref (icurrent); - - if (sRef_similarRelaxed (thisref, sr)) - { - if (!sRef_isConst (thisref) && !sRef_isConst (sr)) - { - voptgenerror - (FLG_ALIASUNIQUE, - message - ("Parameter %d (%s) to function %s is declared %s but " - "is aliased by parameter %d (%s)", - paramno, - exprNode_unparse (current), - exprNode_unparse (fcn), - alkind_unparse (uentry_getAliasKind (ucurrent)), - iparamno, exprNode_unparse (icurrent)), - current->loc); - } - } - else - { - sRefSet aliases = usymtab_canAlias (sr); - - sRefSet_allElements (aliases, asr) - { - if (ctype_isUnknown (sRef_getType (thisref))) - { - sRef_setType (thisref, uentry_getType (ucurrent)); - } - - if (sRef_similarRelaxed (thisref, asr)) - { - if (sRef_isExternal (asr)) - { - if (sRef_isLocalState (thisref)) - { - ; /* okay */ - } - else - { - sRef base = sRef_getRootBase (asr); - - if (!sRef_similar (sRef_getBase (asr), thisref)) - { - if (sRef_isUnique (base) || sRef_isOnly (base) - || sRef_isKept (base) - || (sRef_isAddress (asr) && sRef_isLocalVar (base)) - || (sRef_isAddress (thisref) - && sRef_isLocalVar (sRef_getRootBase (thisref)))) - { - ; /* okay, no error */ - } - else - { - voptgenerror - (FLG_MAYALIASUNIQUE, - message - ("Parameter %d (%s) to function %s is declared %s but " - "may be aliased externally by parameter %d (%s)", - paramno, - exprNode_unparse (current), - exprNode_unparse (fcn), - alkind_unparse (uentry_getAliasKind (ucurrent)), - iparamno, exprNode_unparse (icurrent)), - current->loc); - } - } - } - } - else - { - voptgenerror - (FLG_ALIASUNIQUE, - message - ("Parameter %d (%s) to function %s is declared %s but " - "is aliased externally by parameter %d (%s) through " - "alias %q", - paramno, - exprNode_unparse (current), - exprNode_unparse (fcn), - alkind_unparse (uentry_getAliasKind (ucurrent)), - iparamno, exprNode_unparse (icurrent), - sRef_unparse (asr)), - current->loc); - } - } - } end_sRefSet_allElements; - sRefSet_free (aliases); - } - } - } end_exprNodeList_elements; -} - -long exprNode_getLongValue (exprNode e) { - long value; - - if (exprNode_hasValue (e) - && multiVal_isInt (exprNode_getValue (e))) - { - value = multiVal_forceInt (exprNode_getValue (e)); - } - else - { - value = 0; - } - - return value; -} - -fileloc exprNode_getfileloc (exprNode p_e) -{ - if (p_e) - return fileloc_copy ( p_e->loc ); - else - return fileloc_undefined; -} - -fileloc exprNode_getNextSequencePoint (exprNode e) -{ - /* - ** Returns the location of the sequence point following e. - ** - ** Only works for statements (for now). - */ - - if (exprNode_isDefined (e) && e->kind == XPR_STMT) { - lltok t = exprData_getUopTok (e->edata); - return lltok_getLoc (t); - } else { - #warning fix - // llcontbug (message ("Cannot get next sequence point: %s", exprNode_unparse (e))); - return fileloc_undefined; - } - } - - -/*drl added - */ -exprNode exprNode_fakeCopy (exprNode e) -{ - /*@-temptrans@*/ /*@-retalias@*/ - return e; - /*@=temptrans@*/ /*@=retalias@*/ -} - -exprNode exprNode_createNew(ctype c) -{ - exprNode ret; - - ret = exprNode_createPlain (c); - - return ret; -} diff --git a/src/exprNodeList.c b/src/exprNodeList.c deleted file mode 100644 index 69c5dcc..0000000 --- a/src/exprNodeList.c +++ /dev/null @@ -1,202 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** exprNodeList.c -** -** based on list_template.c -** -** where T has T_equal (or change this) and T_unparse -*/ - -# include "lclintMacros.nf" -# include "basic.h" - -/*@only@*/ exprNodeList -exprNodeList_new () -{ - exprNodeList s = (exprNodeList) dmalloc (sizeof (*s)); - - s->nelements = 0; - s->nspace = exprNodeListBASESIZE; - s->elements = (exprNode *) - dmalloc (sizeof (*s->elements) * exprNodeListBASESIZE); - s->current = 0; - - return (s); -} - -static void -exprNodeList_grow (exprNodeList s) -{ - int i; - exprNode *newelements; - int numnew; - - if (s->nelements < exprNodeListBASESIZE) - { - numnew = exprNodeListBASESIZE; - } - else - { - numnew = s->nelements; - } - - s->nspace = numnew + s->nspace; - - newelements = (exprNode *) dmalloc (sizeof (*newelements) * (s->nelements + numnew)); - - if (newelements == (exprNode *) 0) - { - llfatalerror (cstring_makeLiteral ("exprNodeList_grow: out of memory!")); - } - - for (i = 0; i < s->nelements; i++) - { - newelements[i] = s->elements[i]; - } - - sfree (s->elements); - s->elements = newelements; -} - -void exprNodeList_addh (exprNodeList s, /*@only@*/ exprNode el) -{ - llassert (exprNodeListBASESIZE > 0); - - if (s->nspace <= 0) - exprNodeList_grow (s); - - s->nspace--; - s->elements[s->nelements] = el; - s->nelements++; -} - -void exprNodeList_reset (exprNodeList s) -{ - s->current = 0; -} - -void exprNodeList_advance (exprNodeList s) -{ - s->current++; - llassert (s->current <= s->nelements); -} - -/*@observer@*/ exprNode exprNodeList_head (exprNodeList s) -{ - llassert (s->nelements > 0); - return (s->elements[0]); -} - -/*@observer@*/ exprNode exprNodeList_current (exprNodeList s) -{ - llassert (s->current >= 0 && s->current < s->nelements); - return (s->elements[s->current]); -} - -exprNode exprNodeList_getN (exprNodeList s, int n) -{ - llassert (n >= 0 && n < s->nelements); - return (s->elements[n]); -} - -/*@only@*/ exprNodeList exprNodeList_singleton (/*@only@*/ exprNode e) -{ - exprNodeList s = (exprNodeList) dmalloc (sizeof (*s)); - - s->nelements = 1; - s->nspace = exprNodeListBASESIZE - 1; - s->elements = (exprNode *) dmalloc (sizeof (*s->elements) * exprNodeListBASESIZE); - s->elements[0] = e; - s->current = 0; - - return (s); -} - -exprNodeList exprNodeList_push (/*@returned@*/ exprNodeList args, /*@only@*/ exprNode e) -{ - exprNodeList_addh (args, e); - return (args); -} - -/*@exposed@*/ exprNode -exprNodeList_nth (exprNodeList args, int n) -{ - if (n >= exprNodeList_size (args) || n < 0) - { - llcontbug (message ("exprNodeList_nth: out of range: %q arg %d\n", - exprNodeList_unparse (args), n)); - return exprNode_undefined; - } - - return args->elements[n]; -} - -/*@only@*/ cstring -exprNodeList_unparse (exprNodeList s) -{ - int i; - cstring st = cstring_undefined; - - for (i = 0; i < s->nelements; i++) - { - if (i == 0) - { - st = cstring_copy (exprNode_unparse (s->elements[i])); - } - else - st = message ("%q, %s", st, exprNode_unparse (s->elements[i])); - } - - return st; -} - -void -exprNodeList_free (exprNodeList s) -{ - int i; - - for (i = 0; i < s->nelements; i++) - { - exprNode_free (s->elements[i]); - } - - sfree (s->elements); - sfree (s); -} - -void -exprNodeList_freeShallow (/*@only@*/ exprNodeList s) -{ - int i; - - for (i = 0; i < s->nelements; i++) - { - exprNode_freeShallow (s->elements[i]); - } - - sfree (s->elements); - sfree (s); -} - diff --git a/src/exprNodeSList.c b/src/exprNodeSList.c deleted file mode 100644 index 123da58..0000000 --- a/src/exprNodeSList.c +++ /dev/null @@ -1,138 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** exprNodeSList.c -** -** based on list_template.c -** -** where T has T_equal (or change this) and T_unparse -*/ - -# include "lclintMacros.nf" -# include "basic.h" -# include "exprNodeSList.h" - -exprNodeSList - exprNodeSList_new () -{ - exprNodeSList s = (exprNodeSList) dmalloc (sizeof (*s)); - - s->nelements = 0; - s->nspace = exprNodeSListBASESIZE; - s->elements = (exprNode *) - dmalloc (sizeof (*s->elements) * exprNodeSListBASESIZE); - - return (s); -} - -static void -exprNodeSList_grow (exprNodeSList s) -{ - int i; - exprNode *newelements; - - s->nspace += exprNodeSListBASESIZE; - - newelements = (exprNode *) dmalloc (sizeof (*newelements) - * (s->nelements + s->nspace)); - - if (newelements == (exprNode *) 0) - { - llfatalerror (cstring_makeLiteral ("exprNodeSList_grow: out of memory!")); - } - - for (i = 0; i < s->nelements; i++) - { - newelements[i] = s->elements[i]; - } - - sfree (s->elements); - s->elements = newelements; -} - -void exprNodeSList_addh (exprNodeSList s, /*@exposed@*/ /*@dependent@*/ exprNode el) -{ - llassert (exprNodeSListBASESIZE > 0); - - if (s->nspace <= 0) - exprNodeSList_grow (s); - - s->nspace--; - s->elements[s->nelements] = el; - s->nelements++; -} - -/* -** appends s2 to s1 -*/ - -exprNodeSList exprNodeSList_append (/*@returned@*/ exprNodeSList s1, /*@only@*/ exprNodeSList s2) -{ - exprNodeSList_elements (s2, x) - { - exprNodeSList_addh (s1, x); - } end_exprNodeSList_elements; - - exprNodeSList_free (s2); - return s1; -} - -/*@only@*/ exprNodeSList exprNodeSList_singleton (/*@exposed@*/ /*@dependent@*/ exprNode e) -{ - exprNodeSList s = (exprNodeSList) dmalloc (sizeof (*s)); - - s->nelements = 1; - s->nspace = exprNodeSListBASESIZE - 1; - s->elements = (exprNode *) dmalloc (sizeof (*s->elements) * exprNodeSListBASESIZE); - s->elements[0] = e; - - return (s); -} - -/*@only@*/ cstring -exprNodeSList_unparse (exprNodeSList s) -{ - int i; - cstring st = cstring_undefined; - - for (i = 0; i < s->nelements; i++) - { - if (i == 0) - { - st = cstring_copy (exprNode_unparse (s->elements[i])); - } - else - st = message ("%q, %s", st, exprNode_unparse (s->elements[i])); - } - - return st; -} - -void -exprNodeSList_free (exprNodeSList s) -{ - sfree (s->elements); - sfree (s); -} - diff --git a/src/fcnNodeList.c b/src/fcnNodeList.c deleted file mode 100644 index 8dfa917..0000000 --- a/src/fcnNodeList.c +++ /dev/null @@ -1,127 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** fcnNodeList.c -** -** based on list_template.c -** -** where T has T_equal (or change this) and T_unparse -*/ - -# include "lclintMacros.nf" -# include "llbasic.h" - -fcnNodeList - fcnNodeList_new () -{ - return fcnNodeList_undefined; -} - -static /*@notnull@*/ /*@only@*/ fcnNodeList -fcnNodeList_newEmpty (void) -{ - fcnNodeList s = (fcnNodeList) dmalloc (sizeof (*s)); - - s->nelements = 0; - s->nspace = fcnNodeListBASESIZE; - s->elements = (fcnNode *) dmalloc (sizeof (*s->elements) * fcnNodeListBASESIZE); - - return (s); -} - -static void -fcnNodeList_grow (/*@notnull@*/ fcnNodeList s) -{ - int i; - fcnNode *newelements; - - s->nspace += fcnNodeListBASESIZE; - newelements = (fcnNode *) dmalloc (sizeof (*newelements) - * (s->nelements + s->nspace)); - - if (newelements == (fcnNode *) 0) - { - llfatalerror (cstring_makeLiteral ("fcnNodeList_grow: out of memory!")); - } - - for (i = 0; i < s->nelements; i++) - { - newelements[i] = s->elements[i]; - } - - sfree (s->elements); - s->elements = newelements; -} - -fcnNodeList -fcnNodeList_add (fcnNodeList s, fcnNode el) -{ - if (fcnNodeList_isUndefined (s)) - { - s = fcnNodeList_newEmpty (); - } - - if (s->nspace <= 0) - fcnNodeList_grow (s); - - s->nspace--; - s->elements[s->nelements] = el; - s->nelements++; - - return s; -} - -/*@only@*/ cstring -fcnNodeList_unparse (fcnNodeList s) -{ - int i; - cstring st = cstring_undefined; - - if (fcnNodeList_isDefined (s)) - { - for (i = 0; i < s->nelements; i++) - { - st = message ("%q%q\n", st, fcnNode_unparse (s->elements[i])); - } - } - - return st; -} - -void -fcnNodeList_free (/*@null@*/ /*@only@*/ fcnNodeList s) -{ - if (s != NULL) - { - int i; - for (i = 0; i < s->nelements; i++) - { - fcnNode_free (s->elements[i]); - } - - sfree (s->elements); - sfree (s); - - } -} diff --git a/src/fileIdList.c b/src/fileIdList.c deleted file mode 100644 index 1a97e0b..0000000 --- a/src/fileIdList.c +++ /dev/null @@ -1,36 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** fileIdList.c -*/ - -# include "lclintMacros.nf" -# include "basic.h" -# include "fileIdList.h" - - - - - - diff --git a/src/fileTable.c b/src/fileTable.c deleted file mode 100644 index e974cfd..0000000 --- a/src/fileTable.c +++ /dev/null @@ -1,827 +0,0 @@ -/* -** LCLint - annotation-assisted static program checker -** Copyright (C) 1994-2000 University of Virginia, -** Massachusetts Institute of Technology -** -** This program is free software; you can redistribute it and/or modify it -** under the terms of the GNU General Public License as published by the -** Free Software Foundation; either version 2 of the License, or (at your -** option) any later version. -** -** This program is distributed in the hope that it will be useful, but -** WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -** General Public License for more details. -** -** The GNU General Public License is available from http://www.gnu.org/ or -** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -** MA 02111-1307, USA. -** -** For information on lclint: lclint-request@cs.virginia.edu -** To report a bug: lclint-bug@cs.virginia.edu -** For more information: http://lclint.cs.virginia.edu -*/ -/* -** fileTable.c -** -** replaces filenamemap.c -** based (loosely) on typeTable.c -** -** entries in the fileTable are: -** -** name - name of the file -** type - kind of file (a temp file to be deleted?) -** link - derived from this file -** -*/ -/* - * Herbert 04/1997: - * - Added conditional stuff (macros OS2 and MSDOS) to make names of temporary - * files under Windows or OS/2 not larger than 8+3 characters to avoid - * trouble with FAT file systems or Novell Netware volumes. - * - Added include of new header file portab.h containing OS dependent stuff. - * - Changed occurance of '/' as path delimiter to a macro. - * - Added conditional stuff (#define and #include) for IBM's compiler. - */ - -# include "lclintMacros.nf" -# include "llbasic.h" -# include "osd.h" -# include "llmain.h" -# include "portab.h" -# if defined(__IBMC__) && defined(OS2) -# include -# define getpid _getpid -# endif - -/*@access fileId*/ - -static bool fileTable_inRange (fileTable ft, fileId fid) /*@*/ -{ - return (fileTable_isDefined (ft) && (fid >= 0) && (fid < ft->nentries)); -} - -static fileId fileTable_internAddEntry (fileTable p_ft, /*@only@*/ ftentry p_e) - /*@modifies p_ft@*/ ; -static /*@only@*/ char *makeTempName (char *p_dir, char *p_pre, char *p_suf); - -static /*@only@*/ cstring -fileType_unparse (fileType ft) -{ - switch (ft) - { - case FILE_NORMAL: return cstring_makeLiteral ("normal"); - case FILE_NODELETE: return cstring_makeLiteral ("normal"); - case FILE_LSLTEMP: return cstring_makeLiteral ("ltemp"); - case FILE_HEADER: return cstring_makeLiteral ("header"); - case FILE_MACROS: return cstring_makeLiteral ("macros"); - } - - BADEXIT; -} - -static int -fileTable_getIndex (fileTable ft, cstring s) -{ - if (ft == NULL) return NOT_FOUND; - return (hashTable_lookup (ft->htable, s)); -} - -/*@only@*/ cstring -fileTable_unparse (fileTable ft) -{ - cstring s = cstring_undefined; - int i; - - if (fileTable_isUndefined (ft)) - { - return (cstring_makeLiteral ("")); - } - - for (i = 0; i < ft->nentries; i++) - { - if (fileId_isValid (ft->elements[i]->fder)) - { - s = message ("%s\n[%d] %s %q %d (%s)", - s, i, - ft->elements[i]->fname, - fileType_unparse (ft->elements[i]->ftype), - ft->elements[i]->fder, - ft->elements[ft->elements[i]->fder]->fname); - } - else - { - s = message ("%s\n[%d] %s %q", s, i, ft->elements[i]->fname, - fileType_unparse (ft->elements[i]->ftype)); - } - } - - return s; -} - -void fileTable_printTemps (fileTable ft) -{ - if (fileTable_isDefined (ft)) - { - int i; - - for (i = 0; i < ft->nentries; i++) - { - if (ft->elements[i]->ftemp) - { - if (fileId_isValid (ft->elements[i]->fder)) - { - fprintf (stderr, " %s:1\n\t%s:1\n", - cstring_toCharsSafe (ft->elements[ft->elements[i]->fder]->fname), - cstring_toCharsSafe (ft->elements[i]->fname)); - } - else - { - fprintf (stderr, "[no file]\n\t%s:1\n", - cstring_toCharsSafe (ft->elements[i]->fname)); - } - } - } - } -} - -/* -** loads in fileTable from fileTable_dump -*/ - -static /*@notnull@*/ ftentry -ftentry_create (/*@keep@*/ cstring tn, bool temp, fileType typ, fileId der) -{ - ftentry t = (ftentry) dmalloc (sizeof (*t)); - - if (cstring_isUndefined (tn)) - { - llbug (cstring_makeLiteral ("Undefined filename!")); - } - - t->fname = tn; - - t->basename = cstring_undefined; - t->ftemp = temp; - t->ftype = typ; - t->fder = der; - - /* Don't set these until the basename is needed. */ - t->fsystem = FALSE; - t->fspecial = FALSE; - - return t; -} - -static void -ftentry_free (/*@only@*/ ftentry t) -{ - cstring_free (t->fname); - cstring_free (t->basename); - sfree (t); -} - -/*@only@*/ /*@notnull@*/ fileTable -fileTable_create () -{ - fileTable ft = (fileTable) dmalloc (sizeof (*ft)); - - ft->nentries = 0; - ft->nspace = FTBASESIZE; - ft->elements = (ftentry *) dmalloc (FTBASESIZE * sizeof (*ft->elements)); - ft->htable = hashTable_create (FTHASHSIZE); - - return (ft); -} - -static void -fileTable_grow (fileTable ft) -{ - int i; - ftentry *newent; - - llassert (fileTable_isDefined (ft)); - - ft->nspace = FTBASESIZE; - - newent = (ftentry *) dmalloc ((ft->nentries + ft->nspace) * sizeof (*newent)); - - for (i = 0; i < ft->nentries; i++) - { - newent[i] = ft->elements[i]; - } - - sfree (ft->elements); - ft->elements = newent; -} - -static fileId -fileTable_internAddEntry (fileTable ft, /*@only@*/ ftentry e) -{ - llassert (fileTable_isDefined (ft)); - - if (ft->nspace <= 0) - fileTable_grow (ft); - - ft->nspace--; - - hashTable_insert (ft->htable, e->fname, ft->nentries); - ft->elements[ft->nentries] = e; - - ft->nentries++; - return (ft->nentries - 1); -} - -void fileTable_noDelete (fileTable ft, cstring name) -{ - fileId fid = fileTable_lookup (ft, name); - - if (fileId_isValid (fid)) { - llassert (fileTable_isDefined (ft)); - - ft->elements[fid]->ftype = FILE_NODELETE; - } -} - -static fileId -fileTable_addFilePrim (fileTable ft, /*@only@*/ cstring name, - bool temp, fileType typ, fileId der) - /*@modifies ft@*/ -{ - int tindex = fileTable_getIndex (ft, name); - - llassert (ft != fileTable_undefined); - - if (tindex != NOT_FOUND) - { - llcontbug (message ("fileTable_addFilePrim: duplicate entry: %q", name)); - - return tindex; - } - else - { - ftentry e = ftentry_create (name, temp, typ, der); - - if (der == fileId_invalid) - { - llassert (cstring_isUndefined (e->basename)); - - e->basename = cstring_fromChars - (removePathFree (removeAnyExtension - (cstring_toCharsSafe (name)))); - e->fsystem = context_isSystemDir (name); - e->fspecial = context_isSpecialFile (name); - - if (e->fspecial) - { - cstring srcname = cstring_concatFree (cstring_fromChars (removeAnyExtension (cstring_toCharsSafe (name))), cstring_makeLiteral (".c")); - fileId fid = fileTable_lookup (ft, srcname); - - cstring_free (srcname); - - if (fileId_isValid (fid)) - { - fileId derid = ft->elements[fid]->fder; - - ft->elements[fid]->fspecial = TRUE; - - if (fileId_isValid (derid)) - { - ft->elements[derid]->fspecial = TRUE; - } - } - } - } - else - { - ftentry de = ft->elements[der]; - - llassert (cstring_isUndefined (e->basename)); - e->basename = cstring_copy (de->basename); - e->fsystem = de->fsystem; - e->fspecial = de->fspecial; - } - - return (fileTable_internAddEntry (ft, e)); - } -} - -fileId -fileTable_addFile (fileTable ft, cstring name) -{ - /* while (*name == '.' && *(name + 1) == '/') name += 2; */ - return (fileTable_addFilePrim (ft, cstring_copy (name), - FALSE, FILE_NORMAL, fileId_invalid)); -} - -fileId -fileTable_addFileOnly (fileTable ft, /*@only@*/ cstring name) -{ - return (fileTable_addFilePrim (ft, name, FALSE, FILE_NORMAL, fileId_invalid)); -} - -fileId -fileTable_addHeaderFile (fileTable ft, cstring name) -{ - return (fileTable_addFilePrim (ft, cstring_copy (name), FALSE, - FILE_HEADER, fileId_invalid)); -} - -bool -fileTable_isHeader (fileTable ft, fileId fid) -{ - if (fileId_isInvalid (fid)) - { - return FALSE; - } - - llassert (fileTable_isDefined (ft) && fileTable_inRange (ft, fid)); - return (ft->elements[fid]->ftype == FILE_HEADER); -} - -bool -fileTable_isSystemFile (fileTable ft, fileId fid) -{ - if (fileId_isInvalid (fid)) - { - return FALSE; - } - - llassert (fileTable_isDefined (ft) && fileTable_inRange (ft, fid)); - return (ft->elements[fid]->fsystem); -} - -bool -fileTable_isSpecialFile (fileTable ft, fileId fid) -{ - if (fileId_isInvalid (fid)) - { - return FALSE; - } - - llassert (fileTable_isDefined (ft) && fileTable_inRange (ft, fid)); - return (ft->elements[fid]->fspecial); -} - -fileId -fileTable_addLibraryFile (fileTable ft, cstring name) -{ - return (fileTable_addFilePrim (ft, cstring_copy (name), - FALSE, FILE_HEADER, fileId_invalid)); -} - -# ifndef NOLCL -fileId -fileTable_addImportFile (fileTable ft, cstring name) -{ - return (fileTable_addFilePrim (ft, cstring_copy (name), - FALSE, FILE_HEADER, fileId_invalid)); -} - -fileId -fileTable_addLCLFile (fileTable ft, cstring name) -{ - return (fileTable_addFilePrim (ft, cstring_copy (name), - FALSE, FILE_HEADER, fileId_invalid)); -} -# endif - -# ifndef NOLCL -static int tmpcounter = 0; -# endif - -fileId -fileTable_addMacrosFile (fileTable ft) -{ - cstring newname = cstring_fromChars - (makeTempName (cstring_toCharsSafe (context_tmpdir ()), "lmx", ".llm")); - - return (fileTable_addFilePrim (ft, newname, TRUE, FILE_MACROS, fileId_invalid)); -} - -fileId -fileTable_addCTempFile (fileTable ft, fileId fid) -{ -# if FALSE - /* Can't control output file name for cl preprocessor */ - cstring newname = cstring_concatChars (removeAnyExtension (fileName (fid)), ".i"); -# else - cstring newname = cstring_fromChars - (makeTempName (cstring_toCharsSafe (context_tmpdir ()), "cl", ".c")); -# endif - - llassert (fileTable_isDefined (ft)); - - if (!fileId_isValid (ft->elements[fid]->fder)) - { - return (fileTable_addFilePrim (ft, newname, TRUE, FILE_NORMAL, fid)); - } - else - { - return (fileTable_addFilePrim (ft, newname, TRUE, FILE_NORMAL, - ft->elements[fid]->fder)); - } -} - -# ifndef NOLCL -fileId -fileTable_addltemp (fileTable ft) -{ - char *newname = makeTempName (cstring_toCharsSafe (context_tmpdir ()), - "ls", ".lsl"); - char *onewname; - fileId ret; - - if (cstring_hasNonAlphaNumBar (cstring_fromChars (newname))) - { - char *lastpath = (char *)NULL; - - if (tmpcounter == 0) - { - lldiagmsg - (message - ("Operating system generates tmp filename containing invalid charater: %s", - cstring_fromChars (newname))); - lldiagmsg (cstring_makeLiteral - ("Try cleaning up the tmp directory. Attempting to continue.")); - } - - lastpath = strrchr (newname, CONNECTCHAR); /* get the directory */ - llassert (lastpath != NULL); - *lastpath = '\0'; - - onewname = newname; - newname = cstring_toCharsSafe (message ("%s%hlsl%d.lsl", - cstring_fromChars (newname), - CONNECTCHAR, - tmpcounter)); - sfree (onewname); - tmpcounter++; - } - - /* - ** this is kind of yucky...need to make the result of cstring_fromChars - ** refer to the same storage as its argument. Of course, this loses, - ** since cstring is abstract. Should make it an only? - */ - - ret = fileTable_addFilePrim (ft, cstring_copy (cstring_fromChars (newname)), - TRUE, FILE_LSLTEMP, fileId_invalid); - sfree (newname); - return (ret); -} -# endif - -bool -fileTable_exists (fileTable ft, cstring s) -{ - int tindex = fileTable_getIndex (ft, s); - - if (tindex == NOT_FOUND) - return FALSE; - else - return TRUE; -} - -fileId -fileTable_lookup (fileTable ft, cstring s) -{ - int tindex = fileTable_getIndex (ft, s); - - if (tindex == NOT_FOUND) - { - return fileId_invalid; - } - else - { - return tindex; - } -} - -fileId -fileTable_lookupBase (fileTable ft, cstring base) -{ - int tindex = fileTable_getIndex (ft, base); - - if (tindex == NOT_FOUND) - { - - return fileId_invalid; - } - else - { - fileId der; - - llassert (fileTable_isDefined (ft)); - - der = ft->elements[tindex]->fder; - - if (!fileId_isValid (der)) - { - der = tindex; - } - - return der; - } -} - -cstring -fileTable_getName (fileTable ft, fileId fid) -{ - if (!fileId_isValid (fid)) - { - llcontbug - (message ("fileTable_getName: called with invalid type id: %d", fid)); - return cstring_makeLiteralTemp (""); - } - - llassert (fileTable_isDefined (ft)); - return (ft->elements[fid]->fname); -} - -cstring -fileTable_getRootName (fileTable ft, fileId fid) -{ - fileId fder; - - if (!fileId_isValid (fid)) - { - llcontbug (message ("fileTable_getName: called with invalid id: %d", fid)); - return cstring_makeLiteralTemp (""); - } - - if (!fileTable_isDefined (ft)) - { - return cstring_makeLiteralTemp (""); - } - - if (fid >= ft->nentries) - { - llcontbug (message ("fileTable_getName: called with invalid id: %d", fid)); - // fprintf(stderr, "\nbad\n"); - return cstring_makeLiteralTemp (""); - } - - fder = ft->elements[fid]->fder; - - if (fileId_isValid (fder)) - { - return (ft->elements[fder]->fname); - } - else - { - return (ft->elements[fid]->fname); - } -} - -cstring -fileTable_getNameBase (fileTable ft, fileId fid) -{ - if (!fileId_isValid (fid)) - { - llcontbug (message ("fileTable_getName: called with invalid id: %d", fid)); - return cstring_makeLiteralTemp (""); - } - - if (!fileTable_isDefined (ft)) - { - return cstring_makeLiteralTemp (""); - } - - return (ft->elements[fid]->basename); -} - -bool -fileTable_sameBase (fileTable ft, fileId f1, fileId f2) -{ - fileId fd1, fd2; - - if (!fileId_isValid (f1)) - { - return FALSE; - } - - if (!fileId_isValid (f2)) - { - return FALSE; - } - - llassert (fileTable_isDefined (ft)); - - if (f1 == f2) - { - return TRUE; - } - - fd1 = ft->elements[f1]->fder; - - if (!fileId_isValid (fd1)) - { - fd1 = f1; - } - - fd2 = ft->elements[f2]->fder; - - - if (!fileId_isValid (fd2)) - { - fd2 = f2; - } - - return (fd1 == fd2); -} - -void -fileTable_cleanup (fileTable ft) -{ - int i; - bool msg; - int skip; - - llassert (fileTable_isDefined (ft)); - - msg = ((ft->nentries > 40) && context_getFlag (FLG_SHOWSCAN)); - skip = ft->nentries / 10; - - if (msg) - { - (void) fflush (g_msgstream); - fprintf (stderr, "< cleaning"); - } - - for (i = 0; i < ft->nentries; i++) - { - ftentry fe = ft->elements[i]; - - if (fe->ftemp) - { - /* let's be real careful now, hon! */ - - /* - ** Make sure it is really a derived file - */ - - if (fe->ftype == FILE_LSLTEMP || fe->ftype == FILE_NODELETE) - { - ; /* already removed */ - } - else if (fileId_isValid (fe->fder)) - { - (void) osd_unlink (cstring_toCharsSafe (fe->fname)); - } - else if (fe->ftype == FILE_MACROS) - { - (void) osd_unlink (cstring_toCharsSafe (fe->fname)); - } - else - { - llbug (message ("Temporary file is not derivative: %s " - "(not deleted)", fe->fname)); - } - } - else - { - ; - } - - if (msg && ((i % skip) == 0)) - { - (void) fflush (g_msgstream); - - if (i == 0) { - fprintf (stderr, " "); - } else { - fprintf (stderr, "."); - } - - (void) fflush (stderr); - } - } - - if (msg) - { - fprintf (stderr, " >\n"); - } -} - -void -fileTable_free (/*@only@*/ fileTable f) -{ - int i = 0; - - if (f == (fileTable)NULL) - { - return; - } - - while ( i < f->nentries ) - { - ftentry_free (f->elements[i]); - i++; - } - - hashTable_free (f->htable); - sfree (f->elements); - sfree (f); -} - -/* -** unique temp filename are constructed from
.
-** requires:  must end in '/'
-*/
-
-static void nextMsg (char *msg)
-{
-  /*@+charint@*/
-  if (msg[0] < 'Z') 
-    {
-      msg[0]++; 
-    }
-  else 
-    {
-      msg[0] = 'A';
-      if (msg[1] < 'Z')
-	{ 
-	  msg[1]++; 
-	}
-      else
-	{
-	  msg[1] = 'A';
-	  if (msg[2] < 'Z') 
-	    {
-	      msg[2]++;
-	    }
-	  else
-	    {
-	      msg[2] = 'A';
-	      if (msg[3] < 'Z') 
-		{
-		  msg[3]++; 
-		}
-	      else
-		{
-		  llassertprint (FALSE, ("nextMsg: out of unique names!!!"));
-		}
-	    }
-	}
-    }
-  /*@-charint@*/
-}
-
-static /*@only@*/ char *makeTempName (char *dir, char *pre, char *suf)
-{
-  static int pid = 0; 
-  static /*@owned@*/ char *msg = NULL; 
-  static /*@only@*/ char *pidname = NULL;
-  size_t maxlen;
-  char *buf;
-
-  llassert (strlen (pre) <= 3);
-
-  /*
-  ** We limit the temp name to 8 characters:
-  **   pre: 3 or less
-  **   msg: 3
-  **   pid: 2  (% 100)
-  */
-
-  if (msg == NULL)
-    {
-      msg = mstring_copy ("AAA"); /* there are 26^3 temp names */
-    }
-
-  if (pid == 0) 
-    {
-      /*@+matchanyintegral@*/
-      pid = osd_getPid ();
-      /*@=matchanyintegral@*/
-    }
-
-  if (pidname == NULL) 
-    {
-      pidname = cstring_toCharsSafe (message ("%d", pid % 100));
-    }
-  else 
-    {
-      pidname = mstring_createEmpty ();
-    }
-  
-  maxlen = (strlen (dir) + strlen (pre) + strlen (msg) 
-	    + strlen (pidname) + strlen (suf) + 2);
-
-  buf = mstring_create (size_toInt (maxlen));
-
-  sprintf (buf, "%s%s%s%s%s", dir, pre, pidname, msg, suf);
-  nextMsg (msg);
-
-  while (osd_fileExists (buf))
-    {
-      sprintf (buf, "%s%s%s%s%s", dir, pre, pidname, msg, suf);
-      nextMsg (msg);
-    }
-
-  return buf;
-}
-  
-
-
diff --git a/src/fileloc.c b/src/fileloc.c
deleted file mode 100644
index bf21ba4..0000000
--- a/src/fileloc.c
+++ /dev/null
@@ -1,798 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** fileloc.c
-*/
-/*
- * Modified by Herbert 04/19/97:
- * - added new include file portab.h.
- * - added new private function fileloc_filenameForCpp() to handle
- *   filenames belonging to "#line" statements for OS/2 and MSDOS. It
- *   gets called by fileloc_lineMarker() and fileloc_previousLineMarker()
- *   instead of fileloc_unparseFilename().
- */
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "fileIdList.h"
-# include "portab.h"
-
-static /*@only@*/ fileloc fileloc_createPrim (flkind p_kind, fileId p_fid, int p_line, int p_col);
-
-static flkind fileId_kind (fileId s)
-{
-  cstring fname = rootFileName (s);
-  
-  if (isLCLfile (fname))
-    {
-      return (FL_SPEC);
-    }
-  else if (cstring_equalPrefix (fname, SYSTEM_LIBDIR))
-    {
-      return (FL_STDHDR); 
-    }
-  else
-    {
-      return (FL_NORMAL);
-    }
-}  
-
-fileloc
-fileloc_decColumn (fileloc f, int x)
-{
-  fileloc ret = fileloc_copy (f);
-  if (x > 0 && fileloc_isDefined (ret))
-    {
-      llassertprint (ret->column > x, ("decColumn: %d", x));
-      ret->column -= x;
-    }
-
-  return ret;
-}
-
-fileloc
-fileloc_noColumn (fileloc f)
-{
-  if (fileloc_isDefined (f))
-    {
-      fileloc ret = fileloc_copy (f);
-
-      if (fileloc_isDefined (ret))
-	{
-	  ret->column = 0;
-	}
-
-      return ret;
-    }
-  else
-    {
-      return fileloc_undefined;
-    }
-}
-
-void
-fileloc_subColumn (fileloc f, int x)
-{
-  if (x > 0 && fileloc_isDefined (f))
-    {
-      llassert (f->column > x);
-      f->column -= x;
-    }
-}
-
-fileloc fileloc_copy (fileloc f)
-{
-  if (fileloc_isDefined (f))
-    {
-      if (fileloc_isBuiltin (f) || fileloc_isExternal (f))
-	{
-	  /*
-	  ** Legitimate (spurious) errors reported since no copy
-	  ** is made.
-	  */
-
-	  /*@i3@*/ return f; /* No copy is necessary. */
-	}
-      else
-	{
-	  return (fileloc_createPrim (f->kind, f->fid, f->lineno, f->column));
-	}
-    }
-  else
-    {
-      return fileloc_undefined;
-    }
-}
-
-fileloc fileloc_update (/*@only@*/ fileloc old, fileloc fnew)
-{
-  if (fileloc_isUndefined (fnew))
-    {
-      fileloc_free (old);
-      return fileloc_undefined;
-    }
-  else if (fileloc_isUndefined (old) || fileloc_isBuiltin (old) || fileloc_isExternal (old))
-    {
-      return (fileloc_copy (fnew));
-    }
-  else
-    {
-      old->kind   = fnew->kind;
-      old->fid    = fnew->fid; 
-      old->lineno = fnew->lineno;
-      old->column = fnew->column;
-
-      return old;
-    }
-}
-
-fileloc fileloc_updateFileId (/*@only@*/ fileloc old, fileId s)
-{
-  if (fileloc_isUndefined (old) || fileloc_isBuiltin (old) || fileloc_isExternal (old))
-    {
-      return (fileloc_create (s, 1, 1));
-    }
-  else
-    {
-      old->kind   = fileId_kind (s);
-      old->fid    = s; 
-      old->lineno = 1;
-      old->column = 1;
-
-      return old;
-    }
-}
-
-void
-fileloc_free (/*@only@*/ fileloc f)
-{
-  if (fileloc_isDefined (f))
-    {
-      if (f != g_currentloc)
-	{
-	  if (fileloc_isBuiltin (f) || fileloc_isExternal (f))
-	    {
-	      ; /* don't free */
-	    }
-	  else
-	    {
-	      	      sfree (f);  
-	      /*@-branchstate@*/ 
-	    } 
-	}
-      else
-	{
-	  	}
-      /*@=branchstate@*/
-    }
-}
-
-void
-fileloc_reallyFree (/*@only@*/ fileloc f)
-{
-  if (fileloc_isDefined (f))
-    {
-      if (fileloc_isBuiltin (f) || fileloc_isExternal (f))
-	{
-	  ; /* don't free */
-	}
-      else
-	{
-	  sfree (f);  
-	/*@-branchstate@*/ } /*@=branchstate@*/
-    }
-}
-
-cstring fileloc_getBase (fileloc f)
-{
-  llassert (fileloc_isDefined (f));
-
-  return (fileNameBase (f->fid));
-}
-
-bool
-fileloc_equal (fileloc f1, fileloc f2)
-{
-  return ((f1 == f2)
-	  || (fileloc_isDefined (f1) && fileloc_isDefined (f2) 
-	      && ((f1->column == f2->column) && 
-		  (f1->lineno == f2->lineno) && fileloc_sameFile (f1, f2))));
-}
-
-int
-fileloc_compare (fileloc f1, fileloc f2)
-{
-  if (fileloc_isUndefined (f1))
-    {
-      if (fileloc_isUndefined (f2)) return 0;
-      return -1;
-    }
-  
-  if (fileloc_isUndefined (f2))
-    return 1;
-
-  /*@access fileId@*/ 
-  INTCOMPARERETURN (f1->fid, f2->fid); 
-  /*@noaccess fileId@*/
-
-  INTCOMPARERETURN (f1->column, f2->column);
-  INTCOMPARERETURN (f1->lineno, f2->lineno); 
-
-  return 0;
-}
-
-bool
-fileloc_withinLines (fileloc f1, fileloc f2, int n)
-{
-  
-  return (fileloc_isDefined (f1) && 
-	  fileloc_isDefined (f2) &&
-	  ((f2->lineno <= f1->lineno + n) 
-	   && (f2->lineno >= f1->lineno)
-	   && fileloc_sameFile (f1, f2)));
-}
-
-bool
-fileloc_lessthan (fileloc f1, fileloc f2)
-{
-  /*@access fileId*/
-  return ((fileloc_isDefined (f1) && fileloc_isDefined (f2))
-	  && ((f1->fid < f2->fid)
-	      || ((f1->fid == f2->fid)
-		  && ((f1->lineno < f2->lineno)
-		      || ((f1->lineno == f2->lineno)
-			  && (f1->column < f2->column))))));
-  /*@noaccess fileId*/
-}
-
-/*
-** returns true if f1 and f2 are different files,
-** or f1 is before f2 in same file
-*/
-
-bool
-fileloc_notAfter (fileloc f1, fileloc f2)
-{
-  /*@access fileId*/
-  return ((fileloc_isDefined (f1) && fileloc_isDefined (f2))
-	  && ((f1->fid != f2->fid)
-	      || ((f1->lineno < f2->lineno)
-		  || ((f1->lineno == f2->lineno)
-		      && (f1->column <= f2->column)))));
-  /*@noaccess fileId@*/
-}
-
-# ifndef NOLCL
-bool
-fileloc_isStandardLibrary (fileloc f)
-{
-  cstring s = fileloc_getBase (f);
-
-  return (cstring_equalLit (s, LLSTDLIBS_NAME)
-	  || cstring_equalLit (s, LLSTRICTLIBS_NAME)
-	  || cstring_equalLit (s, LLUNIXLIBS_NAME)
-	  || cstring_equalLit (s, LLUNIXSTRICTLIBS_NAME)
-	  || cstring_equalLit (s, LLPOSIXSTRICTLIBS_NAME)
-	  || cstring_equalLit (s, LLPOSIXLIBS_NAME));
-}
-# endif
-
-bool
-fileloc_sameFile (fileloc f1, fileloc f2)
-{
-  if ((fileloc_isUndefined (f1) || (fileloc_isUndefined (f2)) 
-       || (fileloc_isLib (f1)) || (fileloc_isLib (f2))))
-    {
-      return FALSE;
-    }
-  else
-    {
-      return (fileId_equal (f1->fid, f2->fid));
-    }
-}
-
-bool
-fileloc_sameModule (fileloc f1, fileloc f2)
-{
-  if (fileloc_isUndefined (f1))
-    {
-      return (fileloc_isUndefined (f2));
-    }
-  else if (fileloc_isUndefined (f2))
-    {
-      return (FALSE);
-    }
-  else
-    {
-      if (fileloc_isBuiltin (f1) || fileloc_isBuiltin (f2)
-	  || fileloc_isExternal (f1) || fileloc_isExternal (f2))
-	{
-	  return fileloc_sameFile (f1, f2);
-	}
-      else
-	{
-	  cstring s1 = fileloc_getBase (f1);
-	  cstring s2 = fileloc_getBase (f2);
-	  
-	  return (cstring_equal (s1, s2));
-	}
-    }
-}
-
-bool
-fileloc_sameBaseFile (fileloc f1, fileloc f2)
-{
-  if (fileloc_isUndefined (f1))
-    {
-      return (fileloc_isUndefined (f2));
-    }
-  else if (fileloc_isUndefined (f2))
-    {
-      return (FALSE);
-    }
-  else
-    {
-      return (fileId_baseEqual (f1->fid, f2->fid));
-    }
-}
-
-bool fileloc_isSystemFile (fileloc f1)
-{
-  if (fileloc_isDefined (f1)
-      && !fileloc_isBuiltin (f1)
-      && !fileloc_isExternal (f1))
-    {
-      return (fileTable_isSystemFile (context_fileTable (), f1->fid));
-    }
-
-  return FALSE;
-}
-
-bool
-fileloc_almostSameFile (fileloc f1, fileloc f2)
-{
-  if ((fileloc_isUndefined (f1) || (fileloc_isUndefined (f2)) 
-       || (fileloc_isLib (f1)) || (fileloc_isLib (f2))))
-    {
-      return FALSE;
-    }
-  else
-    {
-      if (fileId_baseEqual (f1->fid, f2->fid))
-	{
-	  return TRUE;
-	}
-      else if (fileTable_isSystemFile (context_fileTable (), f1->fid)
-	       || fileTable_isSystemFile (context_fileTable (), f2->fid))
-	{
-	  return TRUE;
-	}
-      else if (fileTable_isSpecialFile (context_fileTable (), f1->fid)
-	       || fileTable_isSpecialFile (context_fileTable (), f2->fid))
-	{
-	  return (cstring_equal (fileloc_getBase (f1), 
-				 fileloc_getBase (f2)));
-	}
-      else 
-	{
-	  return FALSE;
-	}
-    }
-}
-
-# ifndef NOLCL
-/*@only@*/ fileloc
-fileloc_fromTok (ltoken t) 
-{
-  cstring fname = ltoken_fileName (t);
-  fileId fid = fileTable_lookup (context_fileTable (), fname);
-  fileloc fl;
-
-  if (!fileId_isValid (fid))
-    {
-      fid = fileTable_addLCLFile (context_fileTable (), fname);
-    }
-  
-  fl = fileloc_create (fid, (int) ltoken_getLine (t), (int) ltoken_getCol (t));
-  
-  return (fl);
-}
-# endif
-
-/*@only@*/ fileloc
-fileloc_createLib (cstring ln)
-{
-  flkind fk = FL_LIB;
-  fileId fid = fileTable_lookup (context_fileTable (), ln);
-
-  if (!fileId_isValid (fid))
-    {
-      fid = fileTable_addLibraryFile (context_fileTable (), ln);
-    }
-
-  if (cstring_equalPrefix (ln, SYSTEM_LIBDIR))
-    {
-      fk = FL_STDLIB;
-    }
-
-  return (fileloc_createPrim (fk, fid, 0, 0));
-}
-
-fileloc fileloc_createRc (cstring name)
-{
-  fileId fid = fileTable_addFile (context_fileTable (), name);
-
-  return (fileloc_createPrim (FL_RC, fid, 0, 0));
-}
-
-fileloc fileloc_createExternal (void)
-{
-  /*@i@*/ return (fileloc_getExternal ()); 
-}
-
-fileloc fileloc_getExternal (void)
-{
-  static /*@owned@*/ fileloc res = fileloc_undefined;
-
-  if (res == fileloc_undefined) 
-    {
-      res = fileloc_createPrim (FL_EXTERNAL, fileId_invalid, 0, 0);
-    }
-
-  return res;
-}
-
-fileloc fileloc_observeBuiltin ()
-{
-  /*@-onlytrans@*/ return (fileloc_getBuiltin ()); /*@=onlytrans@*/
-}
-
-fileloc fileloc_getBuiltin ()
-{
-  static /*@owned@*/ fileloc res = fileloc_undefined;
-
-  if (res == fileloc_undefined)
-    {
-      res = fileloc_createPrim (FL_BUILTIN, fileId_invalid, 0, 0); 
-    }
-
-  return res;
-}
-
-fileloc
-fileloc_makePreproc (fileloc loc)
-{
-  if (fileloc_isDefined (loc))
-    {
-      return (fileloc_createPrim (FL_PREPROC, loc->fid, 
-				  loc->lineno, loc->column));
-    }
-
-  return (fileloc_createPrim (FL_PREPROC, fileId_invalid, 0, 0));
-}
-
-fileloc
-fileloc_makePreprocPrevious (fileloc loc)
-{
-  if (fileloc_isDefined (loc))
-    {
-      if (loc->lineno > 1)
-	{
-	  return (fileloc_createPrim (FL_PREPROC, loc->fid,
-				      loc->lineno - 1, 0));
-	}
-      else
-	{
-	  return (fileloc_createPrim (FL_PREPROC, loc->fid,
-				      loc->lineno, 0));
-	}
-    }
-
-  return (fileloc_createPrim (FL_PREPROC, fileId_invalid, 0, 0));
-}
-
-/*@only@*/ fileloc
-fileloc_createBuiltin ()
-{
-  return (fileloc_createPrim (FL_BUILTIN, fileId_invalid, 0, 0)); 
-}
-
-# ifndef NOLCL
-/*@only@*/ fileloc
-fileloc_createImport (cstring fname, int lineno)
-{
-  fileId fid = fileTable_lookup (context_fileTable (), fname);
-
-  if (!fileId_isValid (fid))
-    {
-      fid = fileTable_addImportFile (context_fileTable (), fname);
-    }
-
-  return (fileloc_createPrim (FL_IMPORT, fid, lineno, 0));
-}
-# endif
-
-static /*@only@*/ fileloc
-fileloc_createPrim (flkind kind, fileId fid, int line, int col)
-{
-  fileloc f = (fileloc) dmalloc (sizeof (*f));
-  
-  f->kind   = kind;
-  f->fid    = fid; 
-  f->lineno = line;
-  f->column = col;
-  
-  return (f);
-}
-
-# ifndef NOLCL
-/*@only@*/ fileloc
-fileloc_createSpec (fileId fid, int line, int col)
-{
-  return (fileloc_createPrim (FL_SPEC, fid, line, col));
-}
-# endif
-
-fileloc fileloc_create (fileId fid, int line, int col)
-{
-  return (fileloc_createPrim (fileId_kind (fid), fid, line, col));
-}
-
-/*@observer@*/ cstring
-fileloc_filename (fileloc f)
-{
-  return (fileloc_isDefined (f)
-	  ? rootFileName (f->fid) : cstring_makeLiteralTemp (""));
-}
-
-cstring
-fileloc_unparseFilename (fileloc f)
-{
-  if (fileloc_isDefined (f))
-    {
-      switch (f->kind)
-	{
-	case FL_LIB:
-	  return (message ("load file %s", fileloc_filename (f)));
-	case FL_BUILTIN:
-	  return (cstring_makeLiteral ("# builtin #"));
-	case FL_IMPORT:
-	  return (message ("import file %s", fileloc_filename (f)));
-	case FL_EXTERNAL:
-	  return (cstring_makeLiteral (""));
-	default: 
-	  return (cstring_copy (fileloc_filename (f)));
-	}
-    }
-  return cstring_undefined;
-}
-
-int
-fileloc_lineno (fileloc f)
-{
-  return (fileloc_isDefined (f) ? f->lineno : -1);
-}
-
-int
-fileloc_column (fileloc f)
-{
-  return (fileloc_isDefined (f) ? f->column : -1);
-}
-
-/*@only@*/ cstring
-fileloc_unparse (fileloc f)
-{
-  bool parenFormat = context_getFlag (FLG_PARENFILEFORMAT); 
-
-  if (fileloc_isDefined (f))
-    {
-      switch (f->kind)
-	{
-	case FL_LIB:
-	  return (message ("load file %s", rootFileName (f->fid)));
-	case FL_BUILTIN:
-	  return (cstring_makeLiteral ("Command Line"));
-	case FL_IMPORT:
-	  if (parenFormat)
-	    {
-	      return (message ("import file %s(%d)", rootFileName (f->fid), f->lineno));
-	    }
-	  else
-	    {
-	      return (message ("import file %s:%d", rootFileName (f->fid), f->lineno));
-	    }
-	case FL_PREPROC:
-	  if (parenFormat)
-	    {
-	      return (message ("%s(%d)", rootFileName (f->fid), f->lineno));
-	    }
-	  else
-	    {
-	      return (message ("%s:%d", rootFileName (f->fid), f->lineno));
-	    }
-	case FL_EXTERNAL:
-	  return (cstring_makeLiteral (""));
-	default:
-	  if (context_getFlag (FLG_SHOWCOL))
-	    {
-	      if (fileloc_linenoDefined (f))
-		{
-		  if (fileloc_columnDefined (f))
-		    {
-		      if (parenFormat)
-			{
-			  return (message ("%s(%d,%d)", 
-					   rootFileName (f->fid),
-					   f->lineno, f->column));
-			}
-		      else
-			{
-			  return (message ("%s:%d:%d", 
-					   rootFileName (f->fid),
-					   f->lineno, f->column));
-			}
-		    }
-		  else
-		    {
-		      if (parenFormat)
-			{
-			  return (message ("%s(%d)", rootFileName (f->fid), f->lineno));
-			}
-		      else
-			{
-			  return (message ("%s:%d", rootFileName (f->fid), f->lineno));
-			}
-		    }
-		}
-	      return (cstring_copy (rootFileName (f->fid)));
-	    }
-	  else if (fileloc_linenoDefined (f))
-	    {
-	      if (parenFormat)
-		{
-		  return (message ("%s(%d)",
-				   rootFileName (f->fid), f->lineno));
-		}
-	      else
-		{
-		  return (message ("%s:%d", rootFileName (f->fid), f->lineno));
-		}
-	    }
-	  else
-	    {
-	      return (cstring_copy (rootFileName (f->fid)));
-	    }
-	}
-    }
-  return (cstring_makeLiteral ("< Location unknown >"));
-}
-
-/*@only@*/ cstring
-fileloc_unparseRaw (cstring fname, int lineno)
-{
-  bool parenFormat = context_getFlag (FLG_PARENFILEFORMAT); 
-
-  if (parenFormat)
-    {
-      return (message ("%s(%d)", fname, lineno));
-    }
-  else
-    {
-      return (message ("%s:%d", fname, lineno));
-    }
-}
-
-/*@only@*/ cstring
-fileloc_unparseRawCol (cstring fname, int lineno, int col)
-{
-  if (context_getFlag (FLG_SHOWCOL)) 
-    {
-      bool parenFormat = context_getFlag (FLG_PARENFILEFORMAT); 
-      
-      if (parenFormat)
-	{
-	  return (message ("%s(%d,%d)", fname, lineno, col));
-	}
-      else
-	{
-	  return (message ("%s:%d:%d", fname, lineno, col));
-	}
-    }
-  else
-    {
-      return fileloc_unparseRaw (fname, lineno);
-    }
-}
-
-bool fileloc_isSpecialFile (fileloc f)
-{
-  if (fileloc_isDefined (f) 
-      && fileId_isValid (f->fid))
-    {
-      return (fileTable_isSpecialFile (context_fileTable (), f->fid));
-    }
-  else
-    {
-      return FALSE;
-    }
-}
-
-bool fileloc_isHeader (fileloc f)
-{
-  /* returns true if is not a .c file */
-
-  return (fileloc_isDefined (f) && fileId_isValid (f->fid)
-	  && fileId_isHeader (f->fid));
-}
-
-bool fileloc_isSpec (fileloc f)
-{
-  return (fileloc_isDefined (f) && 
-	  (f->kind == FL_LIB || f->kind == FL_STDLIB || f->kind == FL_SPEC));
-}
-
-bool fileloc_isRealSpec (fileloc f)
-{
-  return (fileloc_isDefined (f) && (f->kind == FL_SPEC));
-}
-
-bool fileloc_isRealLib (fileloc f)
-{
-  return (fileloc_isDefined (f) && f->kind == FL_LIB);
-}
-
-bool fileloc_isLib (fileloc f)
-{
-  return (fileloc_isDefined (f) 
-	  && (f->kind == FL_LIB || f->kind == FL_STDHDR || f->kind == FL_STDLIB));
-}
-
-bool fileloc_isStandardLib (fileloc f)
-{
-  return (fileloc_isDefined (f) && f->kind == FL_STDLIB);
-}
-
-/*@only@*/ cstring fileloc_unparseDirect (fileloc fl)
-{
-  if (fileloc_isDefined (fl))
-    {
-      return (message ("%d:%d:%d",
-		       /*@access fileId@*/ (int) fl->fid, /*@noaccess fileId@*/
-		       fl->lineno, fl->column));
-    }
-  else
-    {
-      return (cstring_makeLiteral (""));
-    }
-}
-
-bool fileloc_isUser (fileloc f)
-{
-  return (fileloc_isDefined (f) 
-	  && f->kind == FL_NORMAL);
-}
-
-
-
-
diff --git a/src/filelocList.c b/src/filelocList.c
deleted file mode 100644
index 8c3b4c2..0000000
--- a/src/filelocList.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** filelocList.c (from slist_template.c)
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-# include "filelocList.h"
-
-/*
-** Invariant:  If any member of the list is fileloc_undefined, then
-**             the 0th member is fileloc_undefined.
-*/
-
-filelocList
-filelocList_new ()
-{
-  return (filelocList_undefined);
-}
-
-static /*@notnull@*/ /*@only@*/ filelocList
-filelocList_newEmpty (void)
-{
-  filelocList s = (filelocList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->free = filelocListBASESIZE;
-  s->elements = (fileloc *) dmalloc (sizeof (*s->elements) * filelocListBASESIZE);
-
-  return (s);
-}
-
-static void
-filelocList_grow (/*@notnull@*/ filelocList s)
-{
-  int i;
-  o_fileloc *oldelements = s->elements;
-  
-  s->free += filelocListBASESIZE; 
-  s->elements = (fileloc *) dmalloc (sizeof (*s->elements) 
-				     * (s->nelements + s->free));
-    
-  for (i = 0; i < s->nelements; i++)
-    {
-      s->elements[i] = oldelements[i];
-    }
-  
-  sfree (oldelements);
-}
-
-filelocList 
-filelocList_append (/*@returned@*/ filelocList s, /*@only@*/ filelocList t)
-{
-  llassert (NOALIAS (s, t));
-
-  if (filelocList_isUndefined (t) || filelocList_isEmpty (t)) return s;
-
-  if (filelocList_isUndefined (s)) 
-    {
-      s = filelocList_newEmpty ();
-    }
-
-  filelocList_elements (t, fl)
-    {
-      /* Okay to use exposed storage here, t is begin eaten. */
-
-      /*@-exposetrans@*/ /*@-dependenttrans@*/
-      s = filelocList_add (s, fl);
-      /*@=exposetrans@*/ /*@=dependenttrans@*/
-    } end_filelocList_elements;
-
-  sfree (t->elements);
-  sfree (t);
-
-  return s;
-}
-
-filelocList 
-  filelocList_addUndefined (/*@returned@*/ filelocList s)
-{
-  if (filelocList_isUndefined (s) 
-      || s->nelements == 0
-      || fileloc_isDefined (s->elements[0]))
-    {
-      return (filelocList_add (s, fileloc_undefined));
-    }
-  else
-    {
-      return s;
-    }
-}
-
-static bool filelocList_hasUndefinedLoc (filelocList s)
-{
-  return (filelocList_isDefined (s) 
-	  && s->nelements > 0
-	  && fileloc_isUndefined (s->elements[0]));
-}
-  
-filelocList 
-  filelocList_addDifferentFile (/*@returned@*/ filelocList s,
-				fileloc where,
-				fileloc loc)
-{
-  if (filelocList_hasUndefinedLoc (s) || filelocList_size (s) >= 2)
-    {
-      return s;
-    }
-  else
-    {
-      if (fileloc_sameModule (where, loc))
-	{
-	  if (filelocList_isEmpty (s))
-	    {
-	      return filelocList_add (s, fileloc_copy (loc));
-	    }
-	  else
-	    {
-	      return s;
-	    }
-	}
-      else
-	{
-	  return filelocList_addUndefined (s);
-	}
-    }
-}
-
-filelocList 
-  filelocList_add (/*@returned@*/ filelocList s, /*@only@*/ fileloc el)
-{
-  if (filelocList_isUndefined (s))
-    {
-      s = filelocList_newEmpty ();
-    }
-
-  if (s->free <= 0)
-    {
-      filelocList_grow (s);
-    }
-  
-  s->free--;
-  s->elements[s->nelements] = el;
-
-  if (fileloc_isUndefined (el))
-    {
-      s->elements[s->nelements] = s->elements[0];
-      s->elements[0] = fileloc_undefined;
-    }
-
-  s->nelements++;
-  return s;
-}
-
-/*@only@*/ cstring
-filelocList_unparse (filelocList s)
-{
-   int i;
-   cstring st = cstring_makeLiteral ("[");
-
-   if (filelocList_isDefined (s))
-     {
-       for (i = 0; i < filelocList_size (s); i++)
-	 {
-	   if (i == 0)
-	     {
-	       st = message ("%q %q", st, fileloc_unparse (s->elements[i]));
-	     }
-	   else
-	     st = message ("%q, %q", st, fileloc_unparse (s->elements[i]));
-	 }
-     }
-   
-   st = message ("%q ]", st);
-   return st;
-}
-
-int filelocList_realSize (filelocList s)
-{
-  int size = 0;
-
-  filelocList_elements (s, el)
-    {
-      if (fileloc_isDefined (el))
-	{
-	  size++;
-	}
-    } end_filelocList_elements;
-
-  return size;
-}
-
-cstring filelocList_unparseUses (filelocList s)
-{
-  int i;
-  int linelen = 0;
-  int maxlen = context_getLineLen () - 3;
-  cstring st = cstring_undefined;
-  fileId lastFile = fileId_invalid;
-
-  if (filelocList_isDefined (s))
-    {
-      bool firstone = TRUE;
-
-      for (i = 0; i < filelocList_size (s); i++)
-	{
-	  if (fileloc_isDefined (s->elements[i]))
-	    {
-	      if (firstone)
-		{
-		  st = fileloc_unparse (s->elements[i]);
-		  lastFile = fileloc_fileId (s->elements[i]);
-		  linelen = 3 + cstring_length (st);
-		  firstone = FALSE;
-		}
-	      else
-		{
-		  if (fileId_equal (fileloc_fileId (s->elements[i]), lastFile))
-		    {
-		      if (linelen + 7 > maxlen)
-			{
-			  st = message ("%q\n      ", st);
-			  linelen = 6;
-			}
-		      else
-			{
-			  st = message ("%q, ", st);
-			}
-		      
-		      st = message ("%q%d,%d", 
-				    st, fileloc_lineno (s->elements[i]), 
-				    fileloc_column (s->elements[i]));
-		      linelen += 3 + int_log (fileloc_lineno (s->elements[i])) 
-			+ int_log (fileloc_column (s->elements[i]));
-		    }
-		  else
-		    {
-		      cstring fl = fileloc_unparse (s->elements[i]);
-		      st = message ("%q\n   %s", st, fl);
-		      lastFile = fileloc_fileId (s->elements[i]);
-		      linelen = 3 + cstring_length (fl);
-		      cstring_free (fl);
-		    }
-		}
-	    }
-	}
-    }
-  
-  return st;
-}
-
-void
-filelocList_free (/*@only@*/ filelocList s)
-{
-  if (filelocList_isDefined (s))
-    {
-      int i;
-      for (i = 0; i < s->nelements; i++)
-	{
-	  fileloc_free (s->elements[i]); 
-	}
-      
-      sfree (s->elements); 
-      sfree (s);
-    }
-}
-
-
-
-
-
-
diff --git a/src/filelocStack.c b/src/filelocStack.c
deleted file mode 100644
index 354488f..0000000
--- a/src/filelocStack.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** filelocStack.c (from slist_template.c)
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-# include "filelocStack.h"
-
-static /*@notnull@*/ /*@only@*/ filelocStack
-filelocStack_newEmpty (void)
-{
-  filelocStack s = (filelocStack) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->free = filelocStackBASESIZE;
-  s->elements = (fileloc *) dmalloc (sizeof (*s->elements) * filelocStackBASESIZE);
-
-  return (s);
-}
-
-filelocStack
-filelocStack_new ()
-{
-  return (filelocStack_newEmpty ());
-}
-
-static void
-filelocStack_grow (/*@notnull@*/ filelocStack s)
-{
-  o_fileloc *oldelements = s->elements;
-  int i;
-  
-  s->free += filelocStackBASESIZE; 
-  s->elements = (fileloc *) dmalloc (sizeof (*s->elements) 
-				     * (s->nelements + s->free));
-    
-  for (i = 0; i < s->nelements; i++)
-    {
-      s->elements[i] = oldelements[i];
-    }
-  
-  sfree (oldelements);
-}
-
-static void 
-  filelocStack_push (/*@returned@*/ filelocStack s, /*@keep@*/ fileloc el)
-  /*@modifies s@*/
-{
-  llassert (filelocStack_isDefined (s));
-
-  if (s->free <= 0)
-    {
-      filelocStack_grow (s);
-    }
-  
-  s->free--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-}
-
-fileloc filelocStack_nextTop (filelocStack s)
-{
-  llassert (filelocStack_isDefined (s) && s->nelements > 1);
-
-  return (s->elements[s->nelements - 2]);
-}
-
-void filelocStack_clear (filelocStack s)
-{
-  if (filelocStack_isDefined (s))
-    {
-      int i;
-
-      for (i = 0; i < s->nelements; i++)
-	{
-	  fileloc_free (s->elements[i]);
-	}
-
-      s->free += s->nelements;
-      s->nelements = 0;
-    }
-}
-
-/*
-** Returns TRUE of el is a new file.
-*/
-
-bool filelocStack_popPushFile (filelocStack s, fileloc el)
-{
-  int i;
-
-  llassert (filelocStack_isDefined (s));
-
-  for (i = s->nelements - 1; i >= 0; i--)
-    {
-      if (fileloc_sameBaseFile (s->elements[i], el))
-	{
-	  int j;
-	  
-	  for (j = i; j < s->nelements; j++)
-	    {
-	      fileloc_free (s->elements[j]);
-	    }
-
-	  s->elements[i] = el;
-	  s->nelements = i + 1;
-	  return FALSE;
-	}
-    }
-
-  filelocStack_push (s, el);
-  return TRUE;
-}
-
-/*@only@*/ cstring
-filelocStack_unparse (filelocStack s)
-{
-   int i;
-   cstring st = cstring_makeLiteral ("[");
-
-   if (filelocStack_isDefined (s))
-     {
-       for (i = s->nelements - 1; i >= 0; i--)
-	 {
-	   if (i == s->nelements - 1)
-	     {
-	       st = message ("%q %q", st, fileloc_unparse (s->elements[i]));
-	     }
-	   else
-	     {
-	       st = message ("%q, %q", st, fileloc_unparse (s->elements[i]));
-	     }
-	 }
-     }
-   
-   st = message ("%q ]", st);
-   return st;
-}
-
-int filelocStack_includeDepth (filelocStack s)
-{
-  int depth = 0;
-  int i;
-
-  if (filelocStack_isDefined (s))
-    {
-      /* the zeroth element doesn't count! */
-      for (i = s->nelements - 1; i > 0; i--)
-	{
-	  if (!fileloc_isSpecialFile (s->elements[i]))
-	    {
-	      depth++;
-	    }
-	}
-    }
-
-  return depth;
-}
-
-void
-filelocStack_printIncludes (filelocStack s)
-{
-  if (filelocStack_isDefined (s))
-    {
-      int i;
-      bool prep = context_isPreprocessing ();
-      
-      if (prep)
-	{
-	  /* need to do this for messages */
-	  context_clearPreprocessing ();
-	}
-
-      /* don't show last two files pushed */
-      for (i = s->nelements - 3; i >= 0; i--)
-	{
-	  if (i == 0 || !fileloc_isSpecialFile (s->elements[i]))
-	    {
-	      llgenindentmsg (cstring_makeLiteral ("Include site"),
-			      s->elements[i]);
-	    }
-	}
-
-      if (prep)
-	{
-	  context_setPreprocessing ();
-	}
-    }
-}
-
-void
-filelocStack_free (/*@only@*/ filelocStack s)
-{
-  if (filelocStack_isDefined (s))
-    {
-      int i;
-      for (i = 0; i < s->nelements; i++)
-	{
-	  fileloc_free (s->elements[i]); 
-	}
-      
-      sfree (s->elements); 
-      sfree (s);
-    }
-}
-
-
-
-
-
-
diff --git a/src/flagMarker.c b/src/flagMarker.c
deleted file mode 100644
index 86b0ca8..0000000
--- a/src/flagMarker.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** flagMarker.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-flagMarker flagMarker_createLocalSet (flagcode code, ynm set, fileloc loc)
-{
-  flagMarker c = (flagMarker) dmalloc (sizeof (*c));
-  
-  c->kind = FMK_LOCALSET;
-  c->code = code;
-  c->info.set = set;
-  c->loc = fileloc_copy (loc); 
-
-  return c;
-}
-
-flagMarker flagMarker_createSuppress (flagcode code, fileloc loc)
-{
-  flagMarker c = (flagMarker) dmalloc (sizeof (*c));
-  
-  c->kind = FMK_SUPPRESS;
-  c->code = code;
-  c->loc = fileloc_copy (loc); 
-
-  return c;
-}
-
-flagMarker flagMarker_createIgnoreOn (fileloc loc)
-{
-  flagMarker c = (flagMarker) dmalloc (sizeof (*c));
-  
-  c->kind = FMK_IGNOREON;
-  c->code = INVALID_FLAG;
-  c->loc = fileloc_copy (loc); 
-
-  return c;
-}
-
-flagMarker flagMarker_createIgnoreCount (int count, fileloc loc)
-{
-  flagMarker c = (flagMarker) dmalloc (sizeof (*c));
-  
-  c->kind = FMK_IGNORECOUNT;
-  c->code = INVALID_FLAG;
-  c->info.nerrors = count;
-  c->loc = fileloc_copy (loc); 
-
-  return c;
-}
-
-flagMarker flagMarker_createIgnoreOff (fileloc loc)
-{
-  flagMarker c = (flagMarker) dmalloc (sizeof (*c));
-  
-  c->kind = FMK_IGNOREOFF;
-  c->code = INVALID_FLAG;
-  c->loc = fileloc_copy (loc); 
-
-  return c;
-}
-
-ynm flagMarker_getSet (flagMarker f)
-{
-  llassert (f->kind == FMK_LOCALSET);
-
-  return f->info.set;
-}
-
-flagcode flagMarker_getCode (flagMarker f)
-{
-  llassert (f->kind == FMK_LOCALSET|| f->kind == FMK_SUPPRESS);
-
-  return f->code;
-}
-
-int flagMarker_getCount (flagMarker f)
-{
-  llassert (f->kind == FMK_IGNORECOUNT);
-
-  return f->info.nerrors;
-}
-
-cstring flagMarker_unparse (flagMarker c)
-{
-  switch (c->kind)
-    {
-    case FMK_LOCALSET:
-      return (message ("%q: %s%s", 
-		       fileloc_unparse (c->loc), ynm_unparseCode (c->info.set), 
-		       flagcode_name (c->code)));
-    case FMK_IGNORECOUNT:
-      return (message ("%q: ignore count %d", 
-		       fileloc_unparse (c->loc), c->info.nerrors));
-    case FMK_IGNOREON:
-      return (message ("%q: ignore on", 
-		       fileloc_unparse (c->loc)));
-    case FMK_IGNOREOFF:
-      return (message ("%q: ignore off", 
-		       fileloc_unparse (c->loc)));
-    case FMK_SUPPRESS:
-      return (message ("%q: suppress %s", 
-		       fileloc_unparse (c->loc),
-		       flagcode_name (c->code)));
-    }
-
-  BADBRANCH;
-}
-  
-void flagMarker_free (/*@only@*/ flagMarker c)
-{
-  sfree (c);
-}
-
-bool flagMarker_sameFile (flagMarker c, fileloc loc)
-{
-  return (fileloc_almostSameFile (c->loc, loc));
-}
-
-/*
-** return true if loc is before c->loc
-*/
-
-bool flagMarker_beforeMarker (flagMarker c, fileloc loc)
-{
-  return  (!fileloc_notAfter (c->loc, loc));
-}
-
-
-
diff --git a/src/flagMarkerList.c b/src/flagMarkerList.c
deleted file mode 100644
index cd3fe67..0000000
--- a/src/flagMarkerList.c
+++ /dev/null
@@ -1,541 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** flagMarkerList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-**
-** invariant: flagMarker's are listed in order
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-flagMarkerList
-  flagMarkerList_new ()
-{
-  flagMarkerList s = (flagMarkerList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = flagMarkerListBASESIZE; 
-  s->elements = (flagMarker *)
-    dmalloc (sizeof (*s->elements) * flagMarkerListBASESIZE);
-
-  return (s);
-}
-
-static void
-flagMarkerList_grow (flagMarkerList s)
-{
-  int i;
-  flagMarker *newelements;
-  
-  s->nspace += flagMarkerListBASESIZE; 
-
-  newelements = (flagMarker *) dmalloc (sizeof (*newelements) 
-					* (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-  
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-void flagMarkerList_add (flagMarkerList s, flagMarker fm)
-{
-  int i = s->nelements - 1;
-
-  
-  if (i > 0)
-    {
-      flagMarker last = s->elements[i];
-
-      
-      if (flagMarker_isIgnoreCount (last))
-	{
-	  if (!flagMarker_isIgnoreOff (fm))
-	    {
-	      if (flagMarker_isLocalSet (fm))
-		{
-		  llforceerror 
-		    (FLG_WARNFLAGS,
-		     cstring_makeLiteral ("Cannot set flag inside ignore "
-					  "count region."),
-		     flagMarker_getLoc (fm));
-		  llgenindentmsg 
-		    (cstring_makeLiteral ("Ignore count region starts"),
-		     flagMarker_getLoc (last));
-
-		}
-	      else 
-		{
-		  if (flagMarker_isIgnoreOn (fm)) 
-		    {
-		      llforceerror 
-			(FLG_WARNFLAGS,
-			 cstring_makeLiteral ("Cannot nest ignore regions."),
-			 flagMarker_getLoc (fm));
-		      llgenindentmsg 
-			(cstring_makeLiteral ("Previous ignore region starts"),
-			 flagMarker_getLoc (last));
-		    }
-		}
-
-	      flagMarker_free (fm);
-	      return;
-	    }
-	}
-      else 
-	{
-	  if (flagMarker_isIgnoreOff (last))
-	    {
-	      flagMarker nlast = s->elements [i - 1];
-	      
-	      if (flagMarker_isIgnoreCount (nlast))
-		{
-		  if (fileloc_sameFile (flagMarker_getLoc (fm),
-					flagMarker_getLoc (last))
-		      && fileloc_notAfter (flagMarker_getLoc (fm), 
-					   flagMarker_getLoc (last)))
-		    {
-		      if (flagMarker_isLocalSet (fm))
-			{
-			  llforceerror 
-			    (FLG_WARNFLAGS,
-			     cstring_makeLiteral ("Cannot set flag inside ignore "
-						  "count region."),
-			     flagMarker_getLoc (fm));
-			  llgenindentmsg 
-			    (cstring_makeLiteral ("Ignore count region starts"),
-			     flagMarker_getLoc (nlast));
-			  
-			}
-		      else 
-			{
-			  if (flagMarker_isIgnoreOn (fm)) 
-			    {
-			      llforceerror 
-				(FLG_WARNFLAGS,
-				 cstring_makeLiteral ("Cannot nest ignore regions."),
-				 flagMarker_getLoc (fm));
-			      llgenindentmsg 
-				(cstring_makeLiteral ("Previous ignore region starts"),
-				 flagMarker_getLoc (nlast));
-			    }
-			}
-		      
-		      flagMarker_free (fm);
-		      return;
-		    }
-		}
-	    }
-	}
-    }
-
-  
-  /*
-  ** all this code is necessary to check the invariant is preserved
-  */
-
-  while (i > 0
-	 && !flagMarker_sameFile (s->elements[i],
-				  flagMarker_getLoc (fm))) 
-    {
-      i--;
-    }
-
-  /*
-  ** reprocessing header file, okay to be out of order
-  */
-
-  if (i >= 0 && !fileloc_isHeader (flagMarker_getLoc (fm)))
-    {
-                  
-      /*
-      llassert (!flagMarker_beforeMarker (s->elements[i], 
-					  flagMarker_getLoc (fm)));
-					  */
-    }
-
-  if (s->nspace <= 0)
-    {
-      flagMarkerList_grow (s);
-    }
-  
-  s->nspace--;
-  s->elements[s->nelements] = fm;
-  s->nelements++;
-  }
-
-void flagMarkerList_checkSuppressCounts (flagMarkerList s)
-{
-  int nexpected = 0;
-  int nsuppressed = 0;
-  fileloc loc = fileloc_undefined;
-  bool inCount = FALSE;
-  int i;
-
-  
-  for (i = 0; i < s->nelements; i++)
-    {
-      flagMarker current = s->elements[i];
-
-      if (flagMarker_isIgnoreCount (current))
-	{
-	  llassert (!inCount);
-	  inCount = TRUE;
-	  nexpected = flagMarker_getCount (current);
-	  loc = flagMarker_getLoc (current);
-	  nsuppressed = 0;
-	  	}
-      else if (flagMarker_isIgnoreOff (current))
-	{
-	  if (inCount)
-	    {
-	      inCount = FALSE;
-	      llassert (fileloc_isDefined (loc));
-
-	      if (nexpected > 0 && nexpected != nsuppressed)
-		{
-		  llforceerror 
-		    (FLG_SUPCOUNTS,
-		     message 
-		     ("Line expects to suppress %d error%p, found %d error%p",
-		      nexpected, nsuppressed),
-		     loc);
-		}
-	    }
-	}
-      else if (flagMarker_isSuppress (current))
-	{
-	  nsuppressed++;
-	}
-      else
-	{
-	  ;
-	}
-    }
-
-  llassert (!inCount);
-}
-
-static void flagMarkerList_splice (flagMarkerList s, 
-				   int index,
-				   /*@keep@*/ flagMarker fm)
-{
-  fileloc loc = flagMarker_getLoc (fm);
-  fileloc beforeloc, afterloc;
-  int i;
-
-  llassert (index >= 0 && (index + 1 < s->nelements));
-  
-  beforeloc = flagMarker_getLoc (s->elements[index]);
-  afterloc = flagMarker_getLoc (s->elements[index + 1]);;
-  
-  llassert (fileloc_sameFile (beforeloc, loc));
-  llassert (fileloc_sameFile (afterloc, loc));
-
-  if (s->nspace <= 0)
-    {
-      flagMarkerList_grow (s);
-    }
-  
-  for (i = s->nelements; i > index + 1; i--)
-    {
-      s->elements[i] = s->elements[i - 1];
-    }
-
-  s->elements[index + 1] = fm;
-  s->nelements++;
-  s->nspace--;
-
-  }
-
-/*@only@*/ cstring
-flagMarkerList_unparse (flagMarkerList s)
-{
-   int i;
-   cstring st = cstring_makeLiteral ("[");
-
-   for (i = 0; i < s->nelements; i++)
-     {
-       if (i == 0)
-	 {
-	   st = message ("%q %q", st, flagMarker_unparse (s->elements[i]));
-	 }
-       else
-	 st = message ("%q, %q", st, flagMarker_unparse (s->elements[i]));
-     }
-   
-   st = message ("%q ]", st);
-   return st;
-}
-
-void
-flagMarkerList_free (flagMarkerList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-      flagMarker_free (s->elements[i]);
-    }
-  
-  sfree (s->elements); 
-  sfree (s);
-}
-
-/*
-** returns YES iff
-**    > in ignore region (there is an ignore ON marker not followed by OFF)
-**    > code is OFF (-)
-**
-** returns NO iff
-**    > not in ignore region
-**    > code is ON (+)
-**
-** returns MAYBE iff
-**    > not in ignore region
-**    > code is unset or =
-**
-** requires: invariant for flagMarkerList:
-**    flagMarker's are sorted by line and col
-*/
-
-static int
-flagMarkerList_lastBeforeLoc (flagMarkerList s, fileloc loc)
-{
-  int i;
-
-  for (i = s->nelements - 1; i >= 0; i--) 
-    {
-      flagMarker current = s->elements[i];
-      
-      if (fileloc_sameFile (current->loc, loc) 
-	  && (!flagMarker_beforeMarker (current, loc)))
-	{
-	  return i;
-	}
-/*
-      if (flagMarker_sameFile (current, loc) 
-	  && (!flagMarker_beforeMarker (current, loc)))
-	{
-	  return i;
-	}
-*/
-    }
-
-  return -1;
-}
-	  
-ynm
-flagMarkerList_suppressError (flagMarkerList s, flagcode code, fileloc loc)
-{
-  int i;
-  bool ignoreOff = FALSE;
-  bool nameChecksOff = FALSE;
-  bool flagOff = FALSE;
-  ynm flagSet = MAYBE;
-  bool islib = FALSE;
-  bool isNameChecksFlag = flagcode_isNameChecksFlag (code);
-
-  if (fileloc_isLib (loc))
-    {
-      i = s->nelements - 1;
-      islib = TRUE;
-    }
-  else
-    {
-      i = flagMarkerList_lastBeforeLoc (s, loc);
-    }
-
-  
-  if (i < 0)
-    {
-      return MAYBE;
-    }
-  
-  /*
-  ** Go backwards through the remaining flagMarkers in this file.
-  */
-
-  for (; i >= 0; i--) 
-    {
-      flagMarker current = s->elements[i];
-
-      
-      if (!islib && !flagMarker_sameFile (current, loc))
-	{
-	  break;
-	}
-
-      if (flagMarker_isIgnoreOff (current))
-	{
-	  ignoreOff = TRUE;
-	}
-      else if (flagMarker_isIgnoreOn (current))
-	{
-	  if (!ignoreOff)
-	    {
-	      return YES;
-	    }
-	}
-      else if (flagMarker_isIgnoreCount (current))
-	{
-	  if (!ignoreOff)
-	    {
-	      flagMarkerList_splice (s, i,
-				     flagMarker_createSuppress (code, loc));
-	      return YES;
-	    }
-	}
-      else if (flagMarker_isLocalSet (current))
-	{
-	  
-	  if (!flagOff && flagMarker_getCode (current) == code)
-	    {
-	      ynm set  = flagMarker_getSet (current);
-	      
-	      if (ynm_isOff (set))
-		{
-		  return YES;
-		}
-	      else
-		{
-		  if (ynm_isOn (set))
-		    {
-		      flagOff = TRUE;
-		      flagSet = NO;
-		    }
-		  else
-		    {
-		      		      flagOff = TRUE;
-		      flagSet = MAYBE;
-		    }
-		  
-		  if (ignoreOff)
-		    {
-		      if (isNameChecksFlag && !nameChecksOff)
-			{
-			  ;
-			}
-		      else
-			{
-			  return flagSet;
-			}
-		    }
-		}
-	    }
-	  
-	  if (flagMarker_getCode (current) == FLG_NAMECHECKS
-	      && !nameChecksOff && isNameChecksFlag)
-	    {
-	      ynm set  = flagMarker_getSet (current);
-	      
-	      if (ynm_isOff (set))
-		{
-		  return YES;
-		}
-	      else
-		{
-		  if (ynm_isOn (set))
-		    {
-		      nameChecksOff = TRUE;
-		      flagSet = NO;
-		    }
-		  else
-		    {
-		      		      nameChecksOff = TRUE;
-		      flagSet = MAYBE;
-		    }
-		  
-		  if (ignoreOff && flagOff)
-		    {
-		      return flagSet;
-		    }
-		}
-	    }
-	}
-      else
-	{
-	  llassert (flagMarker_isSuppress (current));
-	}
-    }
-  
-  return flagSet;
-}
-
-bool
-flagMarkerList_inIgnore (flagMarkerList s, fileloc loc)
-{
-  int i;
-
-  if (fileloc_isLib (loc))
-    {
-      return FALSE;
-    }
-
-  i = flagMarkerList_lastBeforeLoc (s, loc);
-  
-  /*
-  ** Go backwards through the remaining flagMarkers in this file.
-  */
-
-  for (; i >= 0; i--) 
-    {
-      flagMarker current = s->elements[i];
-      
-      if (!flagMarker_sameFile (current, loc))
-	{
-	  break;
-	}
-
-      if (flagMarker_isIgnoreOff (current))
-	{
-	  return FALSE;;
-	}
-      else if (flagMarker_isIgnoreOn (current))
-	{
-	  return TRUE;
-	}
-      else if (flagMarker_isIgnoreCount (current))
-	{
-	  flagMarkerList_splice (s, i,
-				 flagMarker_createSuppress (SKIP_FLAG, loc));
-	  return TRUE;
-	}
-      else
-	{
-	  llassert (flagMarker_isLocalSet (current)
-		    || flagMarker_isSuppress (current));
-	}
-    }
-  
-  return FALSE;
-}
-
diff --git a/src/flags.c b/src/flags.c
deleted file mode 100644
index 4b70fa6..0000000
--- a/src/flags.c
+++ /dev/null
@@ -1,1213 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** flags.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-# include "portab.h"
-
-/*
-** from the CC man page:
-**
-**  -Idir          Search for #include files whose names do not begin with a
-**                    slash (/) in the following order: (1) in the directory of
-**                    the dir argument, (2) in the directories specified by -I
-**                    options, (3) in the standard directory (/usr/include).
-*/
-
-/* needed for string literals literals */
-
-typedef struct { 
-  flagkind kind;
-  /*@null@*/ /*@observer@*/ char *name;
-  /*@null@*/ /*@observer@*/ char *describe;
-} flagcatinfo;
-
-static flagcatinfo categories[] =
-{
-  { FK_ABSTRACT, "abstract", "abstraction violations, representation access" } ,
-  { FK_ALIAS, "aliasing", "unexpected or dangerous aliasing" } ,
-  { FK_USE, "alluse", "all declarations are used" } ,
-  { FK_ANSI, "ansi", "violations of constraints imposed by ANSI/ISO standard" } ,
-  { FK_ARRAY, "arrays", "special checking involving arrays" } ,
-  { FK_BOOL, "booleans", "checking and naming of boolean types" } ,
-  { FK_COMMENTS, "comments", "interpretation of stylized comments" } ,
-  { FK_COMPLETE, "complete", "completely defined, used, or specified system" } ,
-  { FK_CONTROL, "controlflow", "suspicious control structures" } ,
-  { FK_DECL, "declarations", "consistency of declarations" } ,
-  { FK_DEF, "definition", "undefined storage errors" } ,
-  { FK_DIRECT, "directories", "set directores" } ,
-  { FK_DISPLAY, "display", "control what is displayed" } ,
-  { FK_EFFECT, "effect", "statements with no effects" } ,
-  { FK_ERRORS, "errors", "control expected errors, summary reporting" } ,
-  { FK_EXPORT, "export", "control what may be exported" } ,
-  { FK_EXPOSURE, "exposure", "representation exposure" } ,
-  { FK_FILES, "files", "control system files" } ,
-  { FK_FORMAT, "format", "control format of warning messages" } ,
-  { FK_GLOBALS, "globals", "use of global and file static variables" },
-  { FK_HEADERS, "headers", "control inclusion and generation of header files" },
-  { FK_HELP, "help", "on-line help" },
-  { FK_IMPLICIT, "implicit", "control implicit annotations and interpretations" } ,
-  { FK_INIT, "initializations", "initialization files" } ,
-  { FK_ITER, "iterators", "checking iterator definitions and uses" } ,
-  { FK_LEAK, "leaks", "memory leaks" } ,
-  { FK_LIBS, "libraries", "loading and dumping of user and standard libraries" } ,
-  { FK_LIMITS, "limits", "violations of set limits" } ,
-  { FK_MACROS, "macros", "expansion, definition and use of macros" },
-  { FK_MEMORY, "memory", "memory management" } ,
-  { FK_MODIFIES, "modification", "modification errors" } ,
-  { FK_NAMES, "names", "naming conventions and limits" } ,
-  { FK_NULL, "null", "misuses of null pointers" } ,
-  { FK_NUMBERS, "numbers", "control type-checking of numeric types" } ,
-  { FK_OPS, "operations", "checking of primitive operations" } ,
-  { FK_PARAMS, "parameters", "function and macro parameters" } ,
-  { FK_SPEED, "performance", "speeding up checking" } ,
-  { FK_POINTER, "pointers", "pointers" } ,
-  { FK_PRED, "predicates", "condition test expressions" } ,
-  { FK_PREFIX, "prefixes", "set naming prefixes and control checking" } ,
-  { FK_PREPROC, "preproc", "defines and undefines for the preprocessor" } ,
-  { FK_PROTOS, "prototypes", "function prototypes" } ,
-  { FK_DEAD, "released", "using storage that has been deallocated" } ,
-  { FK_IGNORERET, "returnvals", "ignored return values" },
-  { FK_SPEC, "specifications", "checks involving .lcl specifications" } ,
-  { FK_SUPPRESS, "suppress", "local and global suppression of messages" } ,
-  { FK_TYPEEQ, "typeequivalence", "control what types are equivalent" } ,
-  { FK_BEHAVIOR, "undefined", "code with undefined or implementation-defined behavior" } ,
-  { FK_UNRECOG, "unrecognized", "unrecognized identifiers" } ,
-  { FK_UNSPEC, "unconstrained", "checking in the presence of unconstrained functions" } ,
-  { FK_DEBUG, NULL, NULL } ,
-  { FK_SYNTAX, NULL, NULL } ,
-  { FK_TYPE, NULL, NULL } ,
-  { FK_SECRET, NULL, NULL } ,
-  { FK_OBSOLETE, NULL, NULL } ,
-  { FK_NONE, NULL, NULL }  /* must be last */
-} ; 
-
-typedef enum {
-  ARG_NONE,
-  ARG_VALUE,
-  ARG_STRING,
-  ARG_SPECIAL
-} argcode;
-
-typedef struct { 
-  flagkind main;
-  flagkind sub;
-  bool isSpecial;  /* setting this flag may set other flags (or values) */
-  bool isIdem;     /* idempotent - always sets to TRUE */
-  bool isGlobal;   /* cannot be set locally (using control comments) */
-  bool isModeFlag; /* set by modes */
-  argcode argtype;
-  /*@observer@*/ char *flag;
-  flagcode code; 
-  /*@observer@*/ /*@null@*/ char *desc;
-  bn_mstring hint; 
-  int nreported; 
-  int nsuppressed; 
-} fflag;
-
-typedef fflag flaglist[];
-
-# include "flags.def"
-
-/*@iter allFlags (yield observer fflag f); @*/
-# define allFlags(m_f) \
-  { /*@+enumint@*/ flagcode m_i; for (m_i = 0; m_i < NUMFLAGS; m_i++) { fflag m_f = flags[m_i]; /*@=enumint@*/
-# define end_allFlags }}
-
-static bn_mstring mode_names[] =
-{ 
-  "weak", "standard", "checks", "strict", NULL, 
-};
-
-/*@iter allModes (yield bn_mstring modename)@*/
-# define allModes(m_m) \
-  { int m_ii = 0; while (mstring_isDefined (mode_names[m_ii])) \
-      { bn_mstring m_m = mode_names[m_ii]; m_ii++; 
-
-# define end_allModes }}
-
-/*@+enumint@*/
-
-static cstring describeFlagCode (flagcode p_flag) /*@*/ ;
-static cstringSList sortedFlags (void) /*@*/ ;
-static /*@observer@*/ cstring categoryName (flagkind p_kind) /*@*/ ;
-static /*@unused@*/ cstring listModes (void) /*@*/ ;
-
-bool flagcode_isSpecialFlag (flagcode f)
-{
-  return (flags[f].isSpecial);
-}
-
-bool flagcode_isGlobalFlag (flagcode f)
-{
-  return (flags[f].isGlobal);
-}
-
-bool flagcode_isIdemFlag (flagcode f)
-{
-  return (flags[f].isIdem);
-}
-
-bool flagcode_isModeFlag (flagcode f)
-{
-  return (flags[f].isModeFlag);
-}
-
-bool flagcode_isNameChecksFlag (flagcode f)
-{
-  return (flags[f].main == FK_NAMES);
-}
-
-/*
-** Internal consistency check on the flags.
-*/
-
-void flags_initMod ()
-{
-  allFlagCodes (code)
-    {
-      /*@+enumint@*/
-      if (flags[code].code != code)
-	{
-	  llbug (message ("*** ERROR: inconsistent flag %s / %d / %d", 
-			  cstring_fromChars (flags[code].flag),
-			  flags[code].code, code));
-	}
-      /*@=enumint@*/
-    } end_allFlagCodes;
-}
-
-void
-summarizeErrors ()
-{
-  bool hadOne = FALSE;
-  int sumrep = 0;
-  int sumsup = 0;
-
-  char *buf = mstring_create (128);
-
-  allFlags (f)
-    {
-      if (f.nreported > 0 || f.nsuppressed > 0)
-	{
-	  int nrep = f.nreported;
-	  int nsup = f.nsuppressed;
-	  cstring fs = cstring_fill (cstring_fromChars (f.flag), 23);
-
-	  if (!hadOne)
-	    {
-	      llmsgplain (cstring_makeLiteral
-			  ("\nError Type                Reported  Suppressed\n"
-			   "===================       ========  ========="));
-	      hadOne = TRUE;
-	    }
-
-	  sprintf (buf, "%s%7d   %9d", cstring_toCharsSafe (fs), nrep, nsup);
-
-	  sumrep += nrep;
-	  sumsup += nsup;
-	  
-	  cstring_free (fs);
-	  llmsg (cstring_copy (cstring_fromChars (buf)));
-	}
-    } end_allFlags;
-
-  if (hadOne)
-    {
-      cstring ts = cstring_fill (cstring_makeLiteralTemp ("Total"), 23);
-
-      llmsglit ("                          ========  =========");
-
-      sprintf (buf, "%s%7d   %9d", cstring_toCharsSafe (ts), sumrep, sumsup);
-      cstring_free (ts);
-      llmsgplain (cstring_copy (cstring_fromChars (buf)));
-    }
-
-  sfree (buf);
-}
-
-/*@+enumindex@*/
-
-void
-flagcode_recordError (flagcode f)
-{
-  if (f != INVALID_FLAG)
-    {
-      if (f == FLG_WARNFLAGS)
-	{
-	  ; /* don't count these */
-	}
-      else
-	{
-	  flags[f].nreported = flags[f].nreported + 1;
-	}
-    }
-  else
-    {
-      llcontbug (message ("flagcode_recordError: invalid flag: %d", (int) f));
-    }
-}
-
-void
-flagcode_recordSuppressed (flagcode f)
-{
-  llassertprint (f != INVALID_FLAG, ("flagcode: %s", flagcode_unparse (f)));
-
-  flags[f].nsuppressed = flags[f].nsuppressed + 1;
-}
-
-int
-flagcode_numReported (flagcode f)
-{
-  llassert (f != INVALID_FLAG);
-
-  return (flags[f].nreported);
-}
-
-/*@observer@*/ cstring
-flagcodeHint (flagcode f)
-{
-  llassert (f != INVALID_FLAG);
-
-  if (mstring_isDefined (flags[f].hint))
-    {
-      return (cstring_fromChars (flags[f].hint));
-    }
-  else
-    {
-      return (cstring_fromChars (flags[f].desc));
-    }
-}
-
-static int categorySize (flagkind kind) /*@*/ 
-{
-  int n = 0;
-
-  
-  allFlags (f)
-    {
-      if (f.main == kind || f.sub == kind)
-	{
-	  	  n++;
-	}
-    } end_allFlags;
-
-  return n;
-}
-
-flagkind identifyCategory (cstring s)
-{
-  int i;
-
-  for (i = 0; categories[i].kind != FK_NONE; i++)
-    {
-      if (mstring_isDefined (categories[i].name))
-	{
-	  if (cstring_equalLit (s, categories[i].name))
-	    {
-	      return categories[i].kind;
-	    }
-	}
-    }
-
-  return FK_NONE;
-}
-
-static /*@observer@*/ cstring categoryName (flagkind kind)
-{
-  int i;
-
-  for (i = 0; categories[i].kind != FK_NONE; i++)
-    {
-      if (categories[i].kind == kind)
-	{
-	  return (cstring_fromChars (categories[i].name));
-	}
-    }
-  
-  return (cstring_makeLiteralTemp (""));
-}
-
-static int categoryIndex (flagkind kind)
-{
-  int i;
-
-  for (i = 0; categories[i].kind != FK_NONE; i++)
-    {
-      if (categories[i].kind == kind)
-	{
-	  return i;
-	}
-    }
-
-  return -1;
-}
-
-void printCategory (flagkind kind)
-{
-  int index = categoryIndex (kind);
-
-  llassert (index >= 0);
-
-  llmsg (message ("%s (%d flags)\n\3%s\n\n", 
-		  cstring_fromChars (categories[index].name), 
-		  categorySize (kind),
-		  cstring_fromChars (categories[index].describe)));
-
-  allFlags (f)
-    {
-      if (f.main == kind || f.sub == kind)
-	{
-	  llmsg (message ("   %s\n\6%q", cstring_fromChars (f.flag), 
-			  describeFlagCode (f.code)));
-	}
-    } end_allFlags;
-}
-
-void 
-listAllCategories (void)
-{
-  int i;
-
-  for (i = 0; categories[i].kind != FK_NONE; i++)
-    {
-      flagkind kind = categories[i].kind ;
-
-      if (categories[i].describe != NULL)
-	{
-	  llmsg (message ("%s (%d flags)\n\3%s", 
-			  categoryName (kind), 
-			  categorySize (kind),
-			  cstring_fromChars (categories[i].describe)));
-	}
-    }
-}
-
-void
-printAllFlags (bool desc, bool full)
-{
-  if (full)
-    {
-      cstringSList fl = sortedFlags ();
-
-      cstringSList_elements (fl, el)
-	{
-	  llmsg (message ("%q\n\n", describeFlag (el)));
-	} end_cstringSList_elements ;
-
-      cstringSList_free (fl);
-    }
-  else
-    {
-      allFlags (f)
-	{
-	  if (f.code != INVALID_FLAG && f.main != FK_OBSOLETE)
-	    {
-	      if (mstring_isDefined (f.desc))
-		{
-		  if (desc)
-		    {
-		      llmsg (message ("%s --- %s", cstring_fromChars (f.flag),
-				      cstring_fromChars (f.desc)));
-		    }
-		}
-	    }
-	} end_allFlags;
-    }
-}
-
-cstring
-describeFlagCode (flagcode flag)
-{
-  cstring ret = cstring_undefined;
-  fflag f;
-
-  if (flagcode_isInvalid (flag))
-    {
-      return (cstring_makeLiteral (""));
-    }
-
-  context_resetAllFlags ();
-  
-  f = flags[flag];
-  ret = cstring_copy (cstring_fromChars (f.desc));
-
-  
-  if (f.sub != FK_NONE)
-    {
-      ret = message ("%q\nCategories: %s, %s",
-		     ret, 
-		     categoryName (f.main),
-		     categoryName (f.sub));
-    }
-  else 
-    {
-      if (f.main != FK_NONE)
-	{
-	  cstring cname = categoryName (f.main);
-	  
-	  if (cstring_isDefined (cname))
-	    {
-	      ret = message ("%q\nCategory: %s",
-			     ret, cname);
-	    }
-	}
-    }
-
-  if (f.isModeFlag)
-    {
-      bool first = TRUE;
-
-      allModes (mname)
-	{
-	  context_setMode (cstring_fromChars (mname));
-
-	  if (first)
-	    {
-	      ret = message ("%q\nMode Settings: %s %s",
-			     ret, cstring_fromChars (mname), 
-			     cstring_makeLiteralTemp 
-			     (context_getFlag (flag) ? "+" : "-"));
-	      first = FALSE;
-	    }
-	  else
-	    {
-	      ret = message ("%q, %s %s",
-			     ret, cstring_fromChars (mname),
-			     cstring_makeLiteralTemp 
-			     (context_getFlag (flag) ? "+" : "-"));
-	    }
-	} end_allModes;
-    }
-  else
-    {
-      ret = message ("%q\nDefault Setting: %s",
-		     ret, 
-		     cstring_makeLiteralTemp 
-		     (context_getFlag (flag) ? "+" : "-"));
-    }
-
-  if (f.isGlobal)
-    {
-      ret = message("%q\nSet globally only", ret);
-    }
-  else
-    {
-      ret = message("%q\nSet locally", ret);
-    }
-
-  switch (f.argtype)
-    {
-    case ARG_NONE:
-    case ARG_SPECIAL:
-      break;
-    case ARG_VALUE:
-      if (flag == FLG_COMMENTCHAR)
-	{
-	  ret = message("%q\nCharacter Argument.  Default: %h",
-			ret, (char) context_getValue (flag));
-	}
-      else
-	{
-	  ret = message("%q\nNumeric Argument.  Default: %d",
-			ret,
-			context_getValue (flag));
-	}
-      break;
-    case ARG_STRING:
-      if (cstring_isDefined (context_getString (flag)))
-	{
-	  ret = message("%q\nString Argument.  Default: %s",
-			ret,
-			context_getString (flag));
-	}
-      else
-	{
-	  ret = message("%q\nString Argument.  No default.", ret);
-	}
-      break;
-    }
-
-  if (mstring_isDefined (f.hint))
-    {
-      ret = message("%q\n\3%s", ret, cstring_fromChars (f.hint));
-    }
-
-  return ret;
-}
-
-cstring
-describeFlag (cstring flagname)
-{
-  cstring oflagname = cstring_copy (flagname);
-  flagcode f = identifyFlag (flagname);
-
-  if (flagcode_isSkip (f))
-    {
-      cstring_free (oflagname);
-      return cstring_undefined;
-    }
-  else if (flagcode_isValid (f))
-    {
-      if (cstring_equal (flagname, oflagname))
-	{
-	  cstring_free (oflagname);
-	  return (message ("%s\n\3%q", flagname, describeFlagCode (f)));
-	}
-      else
-	{
-	  return (message ("%q (standardized name: %s)\n\3%q",
-			   oflagname, flagname, describeFlagCode (f)));
-	}
-    }
-  else
-    {
-      if (isMode (flagname))
-	{
-	  cstring_free (oflagname);
-
-	  return
-	    (message ("%s: predefined mode (see User's Guide for information)",
-		      flagname));
-	}
-      else
-	{
-	  return (message ("%q: ", oflagname));
-	}
-    }
-}
-
-static cstringSList
-sortedFlags (void)
-{
-  cstringSList s = cstringSList_new ();
-
-  allFlags (f)
-    {
-      if (f.desc != NULL)
-	{
-	  s = cstringSList_add (s, cstring_fromChars (f.flag));
-	}
-    } end_allFlags;
-
-  cstringSList_alphabetize (s);
-
-  return s;
-}
-
-void printAlphaFlags ()
-{
-  cstringSList fl = sortedFlags ();
-
-  cstringSList_printSpaced (fl, 3, 1, context_getLineLen () - 25); 
-  cstringSList_free (fl);
-}
-/*@observer@*/ cstring
-flagcode_name (flagcode code)
-{
-  return cstring_fromChars (flags[code].flag);
-}
-
-/*
-** Transforms a flag into its cannonical form.
-**
-** The following transformations are made:
-**
-**    function      -> fcn
-**    variable      -> var
-**    constant      -> const
-**    iterator      -> iter
-**    parameter     -> param
-**    unrecognized  -> unrecog
-**    qualifier     -> qual         
-**    declaration   -> decl
-**    globalias     -> (no change)
-**    global        -> glob
-**    modifies      -> mods
-**    modify        -> mod
-**    pointer       -> ptr
-**    implies       -> imp
-**    implicit      -> imp
-**    implied       -> imp
-**    unconstrained -> unspec       
-**    unconst       -> unspec
-**    memory        -> mem
-**    length        -> len
-*/
-
-static void
-canonicalizeFlag (cstring s)
-{
-  int i = 0;
-  static bn_mstring transform[] = 
-    { 
-      "function", "fcn",
-      "variable", "var",
-      "constant", "const",
-      "iterator", "iter",
-      "parameter", "param",
-      "unrecognized", "unrecog",
-      "qualifier", "qual",
-      "declaration", "decl",
-      "globals", "globs", 
-      "modifies", "mods", 
-      "modify", "mod",
-      "pointer", "ptr",
-      "implies", "imp",
-      "implicit", "imp",
-      "implied", "imp",
-      "unconstrained", "uncon",
-      "unconst", "uncon",
-      "memory", "mem",
-      "length", "len",
-      "return", "ret",
-      "system", "sys",
-      NULL
-      } ;
-  char *current;
-
-  while ((current = transform[i]) != NULL)
-    {
-      if (cstring_containsLit (s, current))
-	{
-	  cstring_replaceLit (s, current, transform[i+1]);
-	}
-      i += 2;
-    }
-
-  /* remove whitespace, -'s, and _'s */
-  cstring_stripChars (s, " -_");
-}
-
-flagcode
-identifyFlag (cstring s)
-{
-  if (cstring_length (s) == 0) {
-    /* evs 2000-06-25: A malformed flag. */
-    return INVALID_FLAG;
-  }
-
-  if (cstring_firstChar (s) == 'I')
-    {
-      return FLG_INCLUDEPATH; /* no space after -I */
-    }
-
-  if (cstring_firstChar (s) == 'S') 
-    {
-      return FLG_SPECPATH;    /* no space after -S */
-    }
-
-  if (cstring_firstChar (s) == 'D') 
-    {
-      return FLG_DEFINE;      /* no space after -D */
-    }
-
-  if (cstring_firstChar (s) == 'U') 
-    {
-      return FLG_UNDEFINE;    /* no space after -D */
-    }
-
-  canonicalizeFlag (s);
-
-  allFlags (f)
-    {
-      if (cstring_equal (cstring_fromChars (f.flag), s))
-	{
-	  return (f.code);
-	}
-    } end_allFlags;
-
-  /*
-  ** Synonyms
-  */
-
-  if (cstring_equalLit (s, "pred"))
-    {
-      return FLG_PREDBOOL;
-    }
-
-  if (cstring_equalLit (s, "modobserverstrict"))
-    {
-      return FLG_MODOBSERVERUNCON;
-    }
-
-  if (cstring_equalLit (s, "czechnames"))
-    {
-      return FLG_CZECH;
-    }
-
-  if (cstring_equalLit (s, "slovaknames"))
-    {
-      return FLG_SLOVAK;
-    }
-
-  if (cstring_equalLit (s, "czechoslovaknames"))
-    {
-      return FLG_CZECHOSLOVAK;
-    }
-
-  if (cstring_equalLit (s, "globunspec")
-	   || cstring_equalLit (s, "globuncon"))
-    {
-      return FLG_GLOBUNSPEC;
-    }
-
-  if (cstring_equalLit (s, "modglobsunspec")
-	   || cstring_equalLit (s, "modglobsuncon")
-	   || cstring_equalLit (s, "modglobsnomods"))
-    {
-      return FLG_MODGLOBSUNSPEC;
-    }
-
-  if (cstring_equalLit (s, "export"))
-    {
-      return FLG_EXPORTANY;
-    }
-
-  if (cstring_equalLit (s, "macrospec"))
-    {
-      return FLG_MACRODECL;
-    }
-  
-  if (cstring_equalLit (s, "ansireservedlocal"))
-    {
-      return FLG_ANSIRESERVEDLOCAL;
-    }
-
-  if (cstring_equalLit (s, "warnposix"))
-    {
-      return FLG_WARNPOSIX;
-    }
-
-  if (cstring_equalLit (s, "defuse"))
-    {
-      return FLG_USEDEF;
-    }
-
-  if (cstring_equalLit (s, "macroundef"))
-    {
-      return FLG_MACROUNDEF;
-    }
-
-  if (cstring_equalLit (s, "showcol"))
-    {
-      return FLG_SHOWCOL;
-    }
-
-  if (cstring_equalLit (s, "intbool"))
-    {
-      return FLG_BOOLINT;
-    }
-
-  if (cstring_equalLit (s, "intchar"))
-    {
-      return FLG_CHARINT;
-    }
-
-  if (cstring_equalLit (s, "intenum"))
-    {
-      return FLG_ENUMINT;
-    }
-
-  /*
-  ** For our European friends...
-  */
-
-  if (cstring_equalLit (s, "isolib"))
-    {
-      return FLG_ANSILIB;
-    }
-
-  if (cstring_equalLit (s, "isostrictlib"))
-    {
-      return FLG_STRICTLIB;
-    }
-
-  if (cstring_equalLit (s, "ansistrictlib"))
-    {
-      return FLG_STRICTLIB;
-    }
-
-  if (cstring_equalLit (s, "skipisoheaders"))
-    {
-      return FLG_SKIPANSIHEADERS;
-    }
-
-  if (cstring_equalLit (s, "isoreserved"))
-    {
-      return FLG_ANSIRESERVED;
-    }
-
-  if (cstring_equalLit (s, "isoreservedinternal"))
-    {
-      return FLG_ANSIRESERVEDLOCAL;
-    }
-
-  if (cstring_equalLit (s, "isolimits"))
-    {
-      return FLG_ANSILIMITS;
-    }
-
-  /*
-  ** Obsolete Flags
-  */
-  
-  if (cstring_equalLit (s, "accessunspec"))
-    {
-      flagWarning 
-	(cstring_makeLiteralTemp
-	 ("accessunspec flag is not supported by LCLint version 2.0 or "
-	  "later.  It has been replaced by accessmodule, accessfile and "
-	  "accessfunction to provide more precise control of accessibility "
-	  "of representations.  For more information, "
-	  "see lclint -help accessmodule"));
-      
-      return SKIP_FLAG;
-    }
-
-  if (cstring_equalLit (s, "staticmods"))
-    {
-      flagWarning 
-	(cstring_makeLiteralTemp
-	 ("staticmods flag is obsolete.  You probably "
-	  "want impcheckmodstatics.  For more information, "
-	  "see lclint -help impcheckmodstatics"));
-      
-      return SKIP_FLAG;
-    }
-
-  if (cstring_equalLit (s, "bool"))
-    {
-      flagWarning
-	(cstring_makeLiteralTemp ("bool flag is obsolete.  It never really "
-				  "made sense in the first place."));
-      
-      return SKIP_FLAG;
-    }
-  
-  if (cstring_equalLit (s, "ansi"))
-    {
-      flagWarning
-	(cstring_makeLiteralTemp ("ansi flag is obsolete.  You probably "
-				  "want noparams and/or oldstyle."));
-      
-      return SKIP_FLAG;
-    }
-    
-  if (cstring_equalLit (s, "stdio"))
-    {
-      flagWarning 
-	(cstring_makeLiteralTemp
-	 ("stdio flag is obsolete.  You may "
-	  "want strictlib or one of the gloabls "
-	  "checking flags.  For more information, "
-	  "see lclint -help strictlib or lclint -help flags globals"));
-      
-      return SKIP_FLAG;
-    }
-
-  return INVALID_FLAG;
-}
-
-void setValueFlag (flagcode opt, cstring arg)
-{
-  switch (opt)
-    {
-    case FLG_EXPECT:
-    case FLG_LCLEXPECT:
-    case FLG_LIMIT:  
-    case FLG_LINELEN:
-    case FLG_EXTERNALNAMELEN:
-    case FLG_INTERNALNAMELEN:
-    case FLG_CONTROLNESTDEPTH:
-    case FLG_STRINGLITERALLEN:
-    case FLG_NUMSTRUCTFIELDS:
-    case FLG_NUMENUMMEMBERS:
-    case FLG_INCLUDENEST:
-      {
-	int val = cstring_toPosInt (arg);
-
-	if (val < 0)
-	  {
-	    llerror 
-	      (FLG_BADFLAG,
-	       message 
-	       ("Flag %s must be followed by a positive number number.  "
-		"Followed by %s",
-		flagcode_unparse (opt), arg));
-	  }
-	else
-	  {
-	    	    context_setValueAndFlag (opt, val);
-	  }
-      }
-      break;
-    case FLG_COMMENTCHAR:
-      {
-	if (cstring_length (arg) != 1)
-	  {
-	    llfatalerrorLoc
-	      (message
-	       ("Flag %s should be followed by a single character.  Followed by %s",
-		flagcode_unparse (opt), arg));
-	  }
-	else
-	  {
-	    context_setCommentMarkerChar (cstring_firstChar (arg));
-	  }
-      }
-      break;
-    BADDEFAULT;
-    }
-}
-
-void setStringFlag (flagcode opt, /*@only@*/ cstring arg)
-{
-  switch (opt)
-    {
-    case FLG_TMPDIR:
-      {
-	if (cstring_lastChar (arg) == CONNECTCHAR)
-	  {
-	    context_setString (opt, arg);
-	  }
-	else
-	  {
-	    context_setString (opt, cstring_appendChar (arg, CONNECTCHAR));
-	  }
-	break;
-      }
-    default:
-      {
-	context_setString (opt, arg);
-	break;
-      }
-    }
-}
-
-cstring
-describeModes ()
-{
-  cstring s = cstring_makeLiteral ("Flag                    ");
-  cstringSList sflags = sortedFlags ();
-
-  allModes (modename)
-    {
-      s = message ("%q%9s", s, cstring_fromChars (modename));
-    } end_allModes;
-  
-  s = message ("%q\n", s);
-
-  cstringSList_elements (sflags, flagname)
-    {
-      flagcode code = identifyFlag (flagname);
-      fflag currentflag = flags[code];
-      
-      if (mstring_isDefined (currentflag.desc) && flagcode_isModeFlag (code))
-	{
-	  s = message ("%q\n%27s", s, 
-		       cstring_fromChars (currentflag.flag));
-	  
-	  allModes (modename)
-	    {
-	      context_setMode (cstring_fromChars (modename));
-	      
-	      if (context_getFlag (code))
-		{
-		  s = message ("%q%9s", s, cstring_makeLiteralTemp ("+"));
-		}
-	      else
-		{
-		  s = message ("%q%9s", s, cstring_makeLiteralTemp (" "));
-		}
-
-	      context_resetModeFlags ();
-	    } end_allModes;
-	}
-    } end_cstringSList_elements;
-  
-  cstringSList_free (sflags);
-
-  s = cstring_appendChar (s, '\n');
-
-  return (s);
-}
-
-static cstring
-listModes (void)
-{
-  cstring s = cstring_makeLiteral ("\t");
-  int i = 0;
-
-  allModes (modename)
-    {
-      if (i != 0 && (i % 4 == 0))
-	{
-	  s = message ("%q\n\t%15s", s, cstring_fromChars (modename));
-	}
-      else
-	{
-	  s = message ("%q%15s", s, cstring_fromChars (modename));
-	}
-      i++;
-    } end_allModes;
-
-  return s;
-}
-
-bool
-isMode (cstring s)
-{
-  allModes (modename)
-    {
-      if (mstring_isDefined (modename))
-	{
-	  if (cstring_equalLit (s, modename))
-	    {
-	      return TRUE;
-	    }
-	}
-     } end_allModes;
-
-  return FALSE;
-}
-
-extern bool flagcode_hasArgument (flagcode f)
-{
-  return (flags[f].argtype != ARG_NONE);
-}
-
-extern bool flagcode_hasValue (flagcode f)
-{
-  return (flags[f].argtype == ARG_VALUE);
-}
-
-extern bool flagcode_hasString (flagcode f)
-{
-  return (flags[f].argtype == ARG_STRING);
-}
-
-extern int flagcode_valueIndex (flagcode f)
-{
-  /*@unchecked@*/ static bool initialized = FALSE;
-  int i;
-  /*@unchecked@*/ static flagcode valueFlags[NUMVALUEFLAGS];
-
-  
-  if (!initialized)
-    {
-      int nv = 0;
-
-      allFlagCodes (code)
-	{
-	  if (flagcode_hasValue (code))
-	    {
-	      llassert (nv < NUMVALUEFLAGS);
-	      valueFlags[nv] = code;
-	      	      nv++;
-	    }
-	} end_allFlagCodes;
-
-      llassertprint (nv == NUMVALUEFLAGS,
-		     ("number of value flags: %d (expected %d)",
-		      nv, NUMVALUEFLAGS));
-      initialized = TRUE;
-    }
-
-  for (i = 0; i < NUMVALUEFLAGS; i++)
-    {
-      /* static valueFlags must be defined */
-      /*@-usedef@*/ if (f == valueFlags[i]) /*@=usedef@*/
-	{
-	  return i;
-	}
-    }
-
-  BADEXIT;
-}
-
-extern int flagcode_stringIndex (flagcode f)
-{
-  /*@unchecked@*/ static bool initialized = FALSE;
-  /*@unchecked@*/ static flagcode stringFlags[NUMSTRINGFLAGS];
-  int i;
-
-
-  if (!initialized)
-    {
-      int nv = 0;
-
-      allFlagCodes (code)
-	{
-	  if (flagcode_hasString (code))
-	    {
-	      llassertprint (nv < NUMSTRINGFLAGS, ("Incorrect number of string flags: %d (need at least %d)", NUMSTRINGFLAGS, nv));
-	      stringFlags[nv] = code;
-	      nv++;
-	    }
-	} end_allFlagCodes;
-
-      llassertprint (nv == NUMSTRINGFLAGS,
-		     ("number of string flags: %d (expected %d)",
-		      nv, NUMSTRINGFLAGS));
-      initialized = TRUE;
-    }
-
-  for (i = 0; i < NUMSTRINGFLAGS; i++)
-    {
-      /*@-usedef@*/ if (f == stringFlags[i]) /*@=usedef@*/
-	{
-	  return i;
-	}
-    }
-
-  llbug (message ("Bad string flag: %s", flagcode_unparse (f)));
-  BADEXIT;
-}
-
-bool flagcode_isNamePrefixFlag (flagcode f)
-{
-  switch (f)
-    {
-    case FLG_MACROVARPREFIX:
-    case FLG_TAGPREFIX:
-    case FLG_ENUMPREFIX:
-    case FLG_FILESTATICPREFIX:
-    case FLG_GLOBPREFIX:
-    case FLG_TYPEPREFIX:
-    case FLG_EXTERNALPREFIX:
-    case FLG_LOCALPREFIX:
-    case FLG_UNCHECKEDMACROPREFIX:
-    case FLG_CONSTPREFIX:
-    case FLG_ITERPREFIX:
-    case FLG_DECLPARAMPREFIX:
-      return TRUE;
-    default:
-      return FALSE;
-    }
-}
-	
diff --git a/src/general.c b/src/general.c
deleted file mode 100644
index d8e2fb6..0000000
--- a/src/general.c
+++ /dev/null
@@ -1,736 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** general.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-# undef malloc
-# undef realloc
-# undef calloc
-
-# ifdef USEDMALLOC
-# include "dmalloc.h"
-# endif
-
-# include "portab.h"
-
-/*
-** redefine undef'd memory ops
-*/
-
-# ifndef USEDMALLOC
-# include  
-
-/*@-mustdefine@*/
-
-void sfree (void *x)
-{
-  if (x != NULL)
-    {
-      /*
-      fprintf (stderr, "Freeing: %ld\n", x);
-      if ((unsigned long) x < 136000000 && (unsigned long) x > 135000000) {
-	fprintf (stderr, "Looks bad!\n");
-      }
-      */
-      free (x);
-      /* fprintf (stderr, "Done.\n"); */
-    }
-}
-# endif
-
-void sfreeEventually (void *x)
-{
-  if (x != NULL)
-    {
-      ; /* should keep in a table */
-    }
-/*@-mustfree@*/
-} /*@=mustfree@*/
-
-/*
-** all memory should be allocated from dimalloc
-*/
-
-static long unsigned size_toLongUnsigned (size_t x)
-{
-  long unsigned res = (long unsigned) x;
-
-  llassert ((size_t) res == x);
-  return res;
-}
-
-/*@out@*/ void *dimalloc (size_t size, char *name, int line)
-{
-  /*
-  static void *lastaddr = 0;
-  static int numallocs = 0;
-  static int numbad = 0;
-  */
-
-  /* was malloc, use calloc to initialize to zero */
-  void *ret = (void *) calloc (1, size);
-
-  /*
-  numallocs++;
-
-  if (ret < lastaddr)
-    {
-      numbad++;
-      fprintf (stderr, "Bad alloc: %d / %d\n", numbad, numallocs);
-    }
-
-  lastaddr = ret;
-  */
-
-  if (ret == NULL)
-    {
-      if (size == 0)
-	{
-	  llbug (message ("Zero allocation at %q.",
-			  fileloc_unparseRaw (cstring_fromChars (name), line)));
-	}
-      else
-	{
-	  llfatalerrorLoc
-	    (message ("Out of memory.  Allocating %w bytes at %s:%d.", 
-		      size_toLongUnsigned (size),
-		      cstring_fromChars (name), line));
-	}
-    }
-      
-  /*@-null@*/ /* null okay for size = 0 */
-  return ret; 
-  /*@=null@*/
-}
-
-void *dicalloc (size_t num, size_t size, char *name, int line)
-{
-  void *ret = (void *) calloc (num, size);
-
-  if (ret == NULL)
-    {
-      llfatalerrorLoc 
-	(message ("Out of memory.  Allocating %w bytes at %s:%d.", 
-		  size_toLongUnsigned (size),
-		  cstring_fromChars (name), line));
-    }
-  
-  return ret;
-}
-
-void *direalloc (/*@out@*/ /*@null@*/ void *x, size_t size, 
-		 char *name, int line)
-{
-  void *ret;
-
-  if (x == NULL)
-    {				       
-      ret = (void *) dmalloc (size);
-    }
-  else
-    {
-      ret = (void *) realloc (x, size);
-    }
-
-  if (ret == NULL)
-    {
-      llfatalerrorLoc
-	(message ("Out of memory.  Allocating %w bytes at %s:%d.", 
-		  size_toLongUnsigned (size),
-		  cstring_fromChars (name), line));
-    }
-  
-  return ret;
-}
-
-/*@=mustdefine@*/
-
-# ifndef NOLCL
-char *FormatInt (int i)
-{
-  char temp[255]; /* assume the integer has at most 254 digits */
-  char *outs;
-
-  sprintf (temp, "%i", i);
-  outs = (char *) dmalloc (sizeof (*outs) * (1 + strlen (temp)));
-  strcpy (outs, temp);
-
-  return (outs);
-}
-# endif
-
-bool
-isCext (char *ext)
-{
-  return (!mstring_equal (ext, ".lcl") && 
-	  !mstring_equal (ext, ".spc") &&
-	  !mstring_equal (ext, ".ll"));
-}
-
-bool
-isLCLfile (cstring s)
-{
-  char *ext;
-
-  ext = filenameExtension (cstring_toCharsSafe (s));
-
-  if (ext != NULL)
-    {
-      return (!(isCext (ext)));
-    }
-
-  return (TRUE);
-}
-
-char *removeExtension (/*@temp@*/ char *s, const char *suffix)
-{
-  char *t = strrchr (s, '.');
-  char *s2;
-
-  if (t == (char *) 0 || !mstring_equal (t, suffix))
-    {
-      return mstring_copy (s);
-    }
-
-  /*@-mods@*/ 
-  *t = '\0';
-  s2 = mstring_copy (s);
-  *t = '.';
-  /*@=mods@*/  /* Modification is undone. */
-  return s2;
-}
-
-# ifndef NOLCL
-bool firstWord (char *s, char *w)
-{
-  llassert (s != NULL);
-  llassert (w != NULL);
-  
-  for (; *w != '\0'; w++, s++)
-    {
-      if (*w != *s || *s == '\0')
-	return FALSE;
-    }
-  return TRUE;
-}
-# endif
-
-# ifndef NOLCL
-/*@only@*/ char *removePath (char *s)
-{
-  char *t = strrchr (s, CONNECTCHAR);
-
-  if (t == NULL) return (mstring_copy (s));
-  else return (mstring_copy (t + 1));
-}
-# endif
-
-/*@only@*/ char *
-removePathFree (/*@only@*/ char *s)
-{
-  char *t = strrchr (s, CONNECTCHAR);
-
-# ifdef ALTCONNECTCHAR
-  {
-    char *at = strrchr (s, ALTCONNECTCHAR);
-    if (t == NULL || (at > t)) {
-      t = at;
-    }
-  }
-# endif
-
-  if (t == NULL) 
-    {
-      return (s);
-    }
-  else
-    {
-      char *res = mstring_copy (t + 1);
-      mstring_free (s);
-      return res;
-    }
-}
-
-void mstring_markFree (char *s)
-{
-    sfreeEventually (s);
-}
-
-/*@only@*/ char *
-removeAnyExtension (char *s)
-{
-  char *ret;
-  char *t = strrchr (s, '.');
-
-  if (t == (char *) 0)
-    {
-      return mstring_copy (s);
-    }
-
-  /*@-mods@*/
-  *t = '\0';
-  ret = mstring_copy (s);
-  *t = '.';
-  /*@=mods@*/ /* modification is undone */
-
-  return ret;
-}
-
-/*@only@*/ char *
-addExtension (char *s, const char *suffix)
-{
-  if (strrchr (s, '.') == (char *) 0)
-    {
-      /* <<< was mstring_concatFree1 --- bug detected by lclint >>> */
-      return (mstring_concat (s, suffix));
-    }
-  else
-    {
-      return mstring_copy (s);
-    }
-}
-
-int
-getInt (char **s)
-{
-  bool gotOne = FALSE;
-  int i = 0;
-
-  while (**s == ' ')
-    {
-      (*s)++;
-    }
-
-  if (**s == '-')
-    {
-      (*s)++;
-      if (**s < '0' || **s > '9')
-	{
-	  llbug (message ("getInt: bad int: %s", cstring_fromChars (*s))); 
-	}
-      else
-	{
-	  i = -1 * (int) (**s - '0');
-	  gotOne = TRUE;
-	}
-
-      (*s)++;
-    }
-
-  while (**s >= '0' && **s <= '9')
-    {
-      i *= 10;
-      i += (int) (**s - '0');
-      (*s)++;
-      gotOne = TRUE;
-    }
-
-  if (!gotOne)
-    {
-      llbug (message ("No int to read: %s", cstring_fromChars (*s)));
-    }
-
-  while (**s == '\n' || **s == ' ' || **s == '\t')
-    {
-      (*s)++;
-    }
-
-  return i;
-}
-
-char
-loadChar (char **s)
-{
-  char ret;
-
-  while (**s == ' ')
-    {
-      (*s)++;
-    }
-  
-  ret = **s;
-  (*s)++;
-  return ret;
-}
-
-/*
-** not sure if this works...
-*/
-
-double
-getDouble (char **s)
-{
-  char *end = mstring_createEmpty ();
-  double ret;
-
-  ret = strtod (*s, &end);
-
-  *s = end;
-  return ret;
-}
-
-/*
-** read to ' ', '\t'. '\n', '#', ',' or '\0'
-*/
-
-char *
-getWord (char **s)
-{
-  char *res;
-  char *t = *s;
-  char c;
-
-  while ((c = **s) != '\0' && (c != ' ') && (c != ',') 
-	 && (c != '\n') && (c != '\t') && (c != '#'))
-    {
-      (*s)++;
-    }
-
-  if (*s == t)  
-    {
-      return NULL;
-    }
-
-  **s = '\0';
-  res = mstring_copy (t);
-  **s = c;
-  return res;
-}
-
-bool
-optCheckChar (char **s, char c)
-{
-  if (**s == c)
-    {
-      (*s)++;
-      return TRUE;
-    }
-  else
-    {
-      return FALSE;
-    }
-}
-
-void
-docheckChar (char **s, char c, char *file, int line)
-{
-  /*@unchecked@*/ static int nbadchars = 0;
-
-  if (**s == c)
-    {
-      (*s)++;
-    }
-  else
-    {
-      nbadchars++;
-
-      if (nbadchars > 5)
-	{
-	  llfatalbug (cstring_makeLiteral 
-		      ("checkChar: Too many errors.  Check library is up to date."));
-	}
-      else
-	{
-	  llbug (message ("checkChar: %q: Bad char, expecting %h: %s",
-			  fileloc_unparseRaw (cstring_fromChars (file), line),
-			  c,
-			  cstring_fromChars (*s)));
-	}
-    }
-}
-
-char *mstring_spaces (int n)
-{
-  int i;
-  char *ret;
-  char *ptr;
-
-  llassert (n >= 0);
-
-  ret = (char *) dmalloc (size_fromInt (n + 1));
-  ptr = ret;
-
-  for (i = 0; i < n; i++)
-    {
-      *ptr++ = ' ';
-    }
-
-  *ptr = '\0';
-
-  return ret;
-}
- 
-char *mstring_concat (const char *s1, const char *s2)
-{
-  char *s = (char *) dmalloc (strlen (s1) + strlen (s2) + 1);
-  strcpy (s, s1);
-  strcat (s, s2);
-  return s;
-}
-
-extern /*@only@*/ char *
-mstring_concatFree (/*@only@*/ char *s1, /*@only@*/ char *s2)
-{
-  /* like mstring_concat but deallocates old strings */
-  char *s = (char *) dmalloc (strlen (s1) + strlen (s2) + 1);
-  strcpy (s, s1);
-  strcat (s, s2);
-
-  sfree (s1);
-  sfree (s2);
-  return s;
-}
-
-extern /*@only@*/ char *
-mstring_concatFree1 (/*@only@*/ char *s1, const char *s2)
-{
-  char *s = (char *) dmalloc (strlen (s1) + strlen (s2) + 1);
-  strcpy (s, s1);
-  strcat (s, s2);
-  sfree (s1);
-
-  return s;
-}
-
-extern /*@only@*/ char *
-mstring_append (/*@only@*/ char *s1, char c)
-{
-  size_t l = strlen (s1);
-  char *s;
-
-  s = (char *) dmalloc (sizeof (*s) * (l + 2));
-
-  strcpy (s, s1);
-  *(s + l) = c;
-  *(s + l + 1) = '\0';
-  sfree (s1); 
-  return s;
-}
-
-extern 
-char *mstring_copy (char *s1)
-{
-  if (s1 == NULL)
-    {
-      return NULL;
-    }
-  else
-    {
-      char *s = (char *) dmalloc ((strlen (s1) + 1) * sizeof (*s));
-      strcpy (s, s1);
-      return s;
-    }
-}
-
-extern
-char *mstring_safePrint (char *s)
-{
-  if (s == NULL)
-    {
-      return ("");
-    }
-  else
-    {
-      return s;
-    }
-}
-
-extern
-char *mstring_create (int n)
-{
-  char *s;
-
-  s = dmalloc (sizeof (*s) * (n + 1));
-  *s = '\0';
-  return s;
-}
-
-void
-fputline (FILE *out, char *s)
-{
-  if (strlen (s) > 0) 
-    {
-      check (fputs (s, out) != EOF);
-    }
-
-  check (fputc ('\n', out) == (int) '\n');
-}
-
-int int_log (int x)
-{
-  int ret = 1;
-
-  while (x > 10)
-    {
-      ret++;
-      x /= 10;
-    }
-
-  return ret;
-}
-
-/*@-czechfcns@*/
-long unsigned int 
-longUnsigned_fromInt (int x)
-{
-  llassert (x >= 0);
-  
-  return (long unsigned) x;
-}
-
-size_t size_fromInt (int x)
-{
-  size_t res = (size_t) x;
-
-  llassert ((int) res == x);
-  return res;
-}
-
-int size_toInt (size_t x)
-{
-  int res = (int) x;
-
-  llassert ((size_t) res == x);
-  return res;
-}
-
-long size_toLong (size_t x)
-{
-  long res = (long) x;
-
-  llassert ((size_t) res == x);
-  return res;
-}
-
-/*@=czechfcns@*/
-
-char
-char_fromInt (int x)
-{
-  llassert ((x >= (int)'\0') && (x <= (int)'~'));
-
-  return ((char) x);
-}
-
-/*@-czechfcns@*/
-int
-longUnsigned_toInt (long unsigned int x)
-{
-  int res = (int) x;
-
-  llassert ((long unsigned) res == x);
-  return res;
-}
-
-int
-long_toInt (long int x)
-{
-  int res = (int) x;
-
-  /*@+ignorequals@*/ llassert (res == x); /*@=ignorequals@*/
-  return res;
-}
-
-/*@+czechfcns@*/
-
-bool mstring_equalPrefix (const char *c1, const char *c2)
-{
-  llassert (c1 != NULL);
-  llassert (c2 != NULL);
-
-  if (strncmp(c1, c2, strlen(c2)) == 0)
-    {
-      return TRUE;
-    }
-  else
-    {
-      return FALSE;
-    }
-}
-
-bool mstring_equal (/*@null@*/ const char *s1, /*@null@*/ const char *s2)
-{
-  if (s1 == NULL)
-    {
-      return (s2 == NULL);
-    }
-  else
-    {
-      if (s2 == NULL)
-	{
-	  return FALSE;
-	}
-      else
-	{
-	  return (strcmp(s1, s2) == 0);
-	}
-    }
-}
-
-/*@observer@*/ char *filenameExtension (/*@returned@*/ char *s)
-{
-  llassert (s != NULL);
-
-  return (strrchr(s, '.'));
-}
-
-char *removePreDirs (char *s)
-{
-  while (*s == '.' && *(s + 1) == CONNECTCHAR) 
-    {
-      s += 2;
-    }
-
-# if defined(OS2) || defined(MSDOS)
-  /* remove remainders from double path delimiters... */
-  while (*s == CONNECTCHAR) 
-    {
-      ++s;
-    }
-# endif /* !defined(OS2) && !defined(MSDOS) */
-
-  return s;
-}
-
-void checkUngetc (int c, FILE *f)
-{
-  int res;
-
-  llassert (c != EOF);
-  res = ungetc (c, f);
-  llassert (res == c);
-}
-
-bool isHeaderFile (cstring fname)
-{
-  char *ext = filenameExtension (cstring_toCharsSafe (fname));
-  
-  return (mstring_equal (ext, ".h")
-	  || mstring_equal (ext, ".H")
-	  || mstring_equal (ext, ".lh"));
-}
-
diff --git a/src/globSet.c b/src/globSet.c
deleted file mode 100644
index 70e67ff..0000000
--- a/src/globSet.c
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** globSet.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-globSet
-globSet_new ()
-{
-  return (globSet_undefined);
-}
-
-void
-globSet_clear (globSet g)
-{
-  sRefSet_clear (g);
-}
-
-globSet
-globSet_insert (/*@returned@*/ globSet s, sRef el)
-{
-  if (sRef_isKnown (el) && !sRef_isConst (el) && !sRef_isType (el))
-    {
-      llassertprint (sRef_isGlobal (el) || sRef_isKindSpecial (el),
-		     ("el: %s", sRef_unparse (el)));
-      
-      return (sRefSet_insert (s, el));
-    }
-  else
-    {
-      return s;
-    }
-}
-
-globSet
-  globSet_copy (/*@returned@*/ globSet s1, /*@exposed@*/ globSet s2)
-{
-  return (sRefSet_copy (s1, s2));
-}
-
-/*@only@*/ globSet
-globSet_newCopy (globSet s)
-{
-  return (sRefSet_newCopy (s));
-}
-
-bool
-globSet_member (globSet s, sRef el)
-{
-  return (sRefSet_member (s, el));
-}
-
-/*@exposed@*/ sRef globSet_lookup (globSet s, sRef el)
-{
-  sRefSet_allElements (s, e)
-    {
-      if (sRef_similar (e, el))
-	{
-	  return e;
-	}
-    } end_sRefSet_allElements;
-
-  return sRef_undefined;
-}
-
-bool
-globSet_hasStatic (globSet s)
-{
-  sRefSet_allElements (s, el)
-    {
-      if (sRef_isFileStatic (el))
-	{
-	  return TRUE;
-	}
-    } end_sRefSet_allElements;
-
-  return FALSE;
-}
-
-void
-globSet_free (/*@only@*/ globSet s)
-{
-  sRefSet_free (s);
-}
-
-/*@only@*/ cstring
-globSet_dump (globSet lset)
-{
-  cstring st = cstring_undefined;
-  bool first = TRUE;
-
-  
-  sRefSet_allElements (lset, el)
-    {
-      if (!first)
-	{
-	  st = cstring_appendChar (st, ',');
-	}
-      else
-	{
-	  first = FALSE;
-	}
-
-      st = cstring_concatFree (st, sRef_dumpGlobal (el));
-    } end_sRefSet_allElements;
-
-  return st;
-}
-
-globSet
-globSet_undump (char **s)
-{
-  char c;
-  sRefSet sl = sRefSet_new ();
-
-  while ((c = **s) != '#' && c != '@' && c != '$' && c != '&')
-    {
-      sl = sRefSet_insert (sl, sRef_undumpGlobal (s));
-
-      
-      if (**s == ',')
-	{
-	  (*s)++;
-	}
-    }
-
-    return sl;
-}
-
-/*@only@*/ cstring
-globSet_unparse (globSet ll)
-{
-  return (sRefSet_unparse (ll));
-}
-
-int 
-globSet_compare (globSet l1, globSet l2)
-{
-  return (sRefSet_compare (l1, l2));
-}
-
diff --git a/src/globals.c b/src/globals.c
deleted file mode 100644
index e4ff1a1..0000000
--- a/src/globals.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** globals.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-fileloc g_currentloc;
-
-# ifndef NOLCL
-symtable g_symtab;
-/*@only@*/ lsymbolSet g_currentImports = lsymbolSet_undefined;
-# endif
-
-cstring g_codeFile = cstring_undefined;
-int g_codeLine = 0;
-
-cstring g_prevCodeFile = cstring_undefined;
-int g_prevCodeLine = 0;
-FILE *g_msgstream;
-
-/*
-** These were in llmain.c.  Most should not be globals...
-*/
-
-/*@observer@*/ char *g_localSpecPath = ".";
-
-# ifndef NOLCL
-/*@only@*/ cstring g_currentSpec;
-/*@only@*/ char *g_currentSpecName;
-# endif
-
-void printCodePoint (void)
-{
-  static bool incode = FALSE;
-
-  if (incode) {
-    fprintf (stderr, "[[[ in code! ]]]\n");
-  }
-
-  incode = TRUE;
-
-  if (cstring_isDefined (g_codeFile))
-    {
-      cstring temps = fileloc_unparseRaw (g_codeFile, g_codeLine);
-
-      fprintf (stderr, "*** Last code point: %s\n", 
-	       cstring_toCharsSafe (temps));
-
-      cstring_free (temps);
-
-      if (cstring_isDefined (g_prevCodeFile))
-	{
-	  temps = fileloc_unparseRaw (g_prevCodeFile, g_prevCodeLine);
-	  fprintf (stderr, "*** Previous code point: %s\n", 
-		   cstring_toCharsSafe (temps));
-
-	  cstring_free (temps);
-	}
-    }
-
-  incode = FALSE;
-}
-
-# ifdef WIN32
-int yywrap (void)
-{
-  return 1;
-}
-# endif
-
-
-
diff --git a/src/guardSet.c b/src/guardSet.c
deleted file mode 100644
index e898a6c..0000000
--- a/src/guardSet.c
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** guardSet.c
-**
-** if x is in true guards, then x is not null on this branch,
-**                          and x is "probably" null on the other branch.
-** if x is in false guards, then x is "probably" null on this branch,
-**                          and x is not null on the other branch.
-**
-** Either guards is obsolete and should be removed soon.
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-guardSet guardSet_new ()
-{
-  return guardSet_undefined;
-}
-
-static /*@notnull@*/ /*@special@*/ guardSet guardSet_newEmpty (void)
-   /*@defines result@*/
-   /*@post:isnull result->tguard, result->fguard@*/
-{
-  guardSet g = (guardSet) dmalloc (sizeof (*g));
-
-  g->tguard = sRefSet_undefined;
-  g->fguard = sRefSet_undefined;
-
-  return g;
-}
-
-sRefSet guardSet_getTrueGuards (guardSet g)
-{
-  
-  if (guardSet_isDefined (g))
-    {
-      return (g->tguard);
-    }
-  else
-    {
-      return (sRefSet_undefined);
-    }
-}
-
-void guardSet_delete (guardSet g, sRef s) 
-{
-  bool res;
-  llassert (guardSet_isDefined (g));
-  res = sRefSet_delete (g->tguard, s);
-  
-  /*
-  ** This assertion is no longer always true:
-  ** llassert (res);
-  */
-}
-
-/*@dependent@*/ /*@exposed@*/ sRefSet guardSet_getFalseGuards (guardSet g)
-{
-  if (guardSet_isDefined (g))
-    { 
-      return (g->fguard);
-    }
-  else
-    {
-      return (sRefSet_undefined);
-    }
-}
-
-guardSet guardSet_or (/*@returned@*/ /*@unique@*/ guardSet s, guardSet t)
-{
-  
-  llassert (NOALIAS (s, t));
-
-  if (s == guardSet_undefined)
-    {
-      if (t == guardSet_undefined)
-	{
-	  return s;
-	}
-
-      s = guardSet_newEmpty ();
-    }
-
-  if (t == guardSet_undefined)
-    {
-      sRefSet_free (s->tguard);
-      s->tguard = sRefSet_new ();
-    }
-  else
-    {
-      sRefSet last;
-
-      s->tguard = sRefSet_intersect (last = s->tguard, t->tguard);
-      sRefSet_free (last);
-      s->fguard = sRefSet_union (s->fguard, t->fguard);
-    }
-  
-  
-  return s;
-}
-
-guardSet guardSet_and (/*@returned@*/ /*@unique@*/ guardSet s, guardSet t)
-{
-  llassert (NOALIAS (s, t));
-
-  if (s == guardSet_undefined)
-    {
-      if (t == guardSet_undefined)
-	{
-	  return s;
-	}
-
-      s = guardSet_newEmpty ();
-    }
-
-  if (t == guardSet_undefined)
-    {
-      sRefSet_free (s->fguard);
-      s->fguard = sRefSet_new ();
-    }
-  else
-    {
-      sRefSet last;
-
-      s->tguard = sRefSet_union (s->tguard, t->tguard);
-
-      s->fguard = sRefSet_intersect (last = s->fguard, t->fguard);
-      sRefSet_free (last);
-    }
-  
-  return s;
-}
-
-/*@only@*/ guardSet guardSet_union (/*@only@*/ guardSet s, guardSet t)
-{
-  if (t == guardSet_undefined) return s; 
-
-  llassert (NOALIAS (s, t));
-
-  if (guardSet_isDefined (s)) 
-    {
-      s->tguard = sRefSet_union (s->tguard, t->tguard);
-      s->fguard = sRefSet_union (s->fguard, t->fguard);
-    }
-  else
-    {
-      s = guardSet_newEmpty ();
-
-      s->tguard = sRefSet_newCopy (t->tguard);
-      s->fguard = sRefSet_newCopy (t->fguard);
-    }
-
-  return s;
-}
-
-guardSet guardSet_levelUnion (/*@only@*/ guardSet s, guardSet t, int lexlevel)
-{
-  if (t == guardSet_undefined) return s;
-
-  llassert (NOALIAS (s, t));
-
-  if (guardSet_isDefined (s))
-    {
-      s->tguard = sRefSet_levelUnion (s->tguard, t->tguard, lexlevel);
-      s->fguard = sRefSet_levelUnion (s->fguard, t->fguard, lexlevel);
-    }
-  else
-    {
-      s = guardSet_newEmpty ();
-
-      /* should be necessary! */
-
-      sRefSet_free (s->tguard);
-      sRefSet_free (s->fguard);
-
-      s->tguard = sRefSet_levelCopy (t->tguard, lexlevel);
-      s->fguard = sRefSet_levelCopy (t->fguard, lexlevel);
-    }
-
-  return s;
-}
-
-guardSet 
-  guardSet_levelUnionFree (/*@returned@*/ /*@unique@*/ guardSet s,
-			   /*@only@*/ guardSet t, int lexlevel)
-{
-  if (t == guardSet_undefined) return s;
-
-  if (guardSet_isDefined (s))
-    {
-      s->tguard = sRefSet_levelUnion (s->tguard, t->tguard, lexlevel);
-      s->fguard = sRefSet_levelUnion (s->fguard, t->fguard, lexlevel);
-    }
-  else
-    {
-      s = guardSet_newEmpty ();
-
-      /* should be necessary! */
-
-      sRefSet_free (s->tguard);
-      sRefSet_free (s->fguard);
-
-      s->tguard = sRefSet_levelCopy (t->tguard, lexlevel);
-      s->fguard = sRefSet_levelCopy (t->fguard, lexlevel);
-    }
-
-  guardSet_free (t);
-  return s;
-}
-
-void guardSet_flip (guardSet g)
-{
-  if (g != guardSet_undefined)
-    {
-      sRefSet tmp = g->tguard;
-
-      g->tguard = g->fguard;      
-      g->fguard = tmp;
-    }
-}
-
-/*@only@*/ guardSet guardSet_invert (/*@temp@*/ guardSet g)
-{
-  if (g != guardSet_undefined)
-    {
-      guardSet ret = guardSet_newEmpty ();
-
-      ret->tguard = sRefSet_newCopy (g->fguard);      
-      ret->fguard = sRefSet_newCopy (g->tguard);
-
-      return ret;
-    }
-  return guardSet_undefined;
-}
-
-/*@only@*/ guardSet guardSet_copy (/*@temp@*/ guardSet g)
-{
-  if (g != guardSet_undefined)
-    {
-      guardSet ret = guardSet_newEmpty ();
-
-      ret->tguard = sRefSet_newCopy (g->tguard);      
-      ret->fguard = sRefSet_newCopy (g->fguard);
-
-      return ret;
-    }
-  return guardSet_undefined;
-}
-  
-guardSet guardSet_addTrueGuard (/*@returned@*/ guardSet g, sRef s)
-{
-  if (sRef_isMeaningful (s))
-    {
-      if (g == guardSet_undefined)
-	{
-	  g = guardSet_newEmpty ();
-	}
-      
-      g->tguard = sRefSet_insert (g->tguard, s);
-    }
-
-  return g;
-}
-
-guardSet guardSet_addFalseGuard (/*@returned@*/ guardSet g, sRef s)
-{
-  if (sRef_isMeaningful (s))
-    {
-      if (g == guardSet_undefined)
-	{
-	  g = guardSet_newEmpty ();
-	}
-      
-      g->fguard = sRefSet_insert (g->fguard, s);
-    }
-
-  return g;
-}
-
-/*@only@*/ cstring guardSet_unparse (guardSet g)
-{
-  if (g == guardSet_undefined)
-    {
-      return (cstring_makeLiteral (""));
-    }
-  else
-    {
-      return (message ("not null: %q / prob null: %q",
-		       sRefSet_unparseDebug (g->tguard),
-		       sRefSet_unparseDebug (g->fguard)));
-    }
-}
-
-void guardSet_free (/*@only@*/ guardSet g)
-{
-  if (g == guardSet_undefined) return;
-
-  sRefSet_free (g->tguard);
-  sRefSet_free (g->fguard);
-  
-  sfree (g);
-}
-
-bool
-guardSet_isGuarded (guardSet g, sRef s)
-{
-  if (g == guardSet_undefined) return FALSE;
-  
-  return (sRefSet_member (g->tguard, s));
-}
-
-bool
-guardSet_isProbableNull (guardSet g, sRef s)
-{
-  bool ret;
-
-  if (g == guardSet_undefined) return FALSE;
-
-  ret = sRefSet_member (g->fguard, s);
-  return ret;
-}
-
-bool guardSet_isEmpty (guardSet g)
-{
-  if (guardSet_isDefined (g))
-    {
-      return (sRefSet_isEmpty (g->tguard) && sRefSet_isEmpty (g->fguard));
-    }
-  else
-    {
-      return TRUE;
-    }
-}
diff --git a/src/hashTable.c b/src/hashTable.c
deleted file mode 100644
index 39914e4..0000000
--- a/src/hashTable.c
+++ /dev/null
@@ -1,469 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** hashTable.c
-**
-** Since hsearch defined in  only allows one hash table,
-** I'll implement my own.
-**
-** Try to find a decent hash function, etc. later...
-**
-** hashTable is from string -> unsigned
-**
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-/*@constant null hbucket hbucket_undefined; @*/
-# define hbucket_undefined 0
-
-static /*@truenull@*/ bool hbucket_isNull (/*@null@*/ hbucket h) 
-{ 
-  return (h == hbucket_undefined); 
-}
-
-static hentry
-hentry_create (cstring key, int val)
-{
-  hentry h;
-
-  h.key = key;
-  h.val = val;
-  return (h);
-}
-
-static bool
-hbucket_isEmpty (hbucket h)
-{
-  return (h == hbucket_undefined || h->size == 0);
-}
-
-static cstring
-hbucket_unparse (hbucket h)
-{
-  cstring s = cstring_undefined;
-
-  if (!hbucket_isNull (h))
-    {
-      int i;
-      
-      for (i = 0; i < h->size; i++)
-	{
-	  s = message ("%q %s:%d", s, h->entries[i].key, h->entries[i].val);
-	}
-    }
-
-  return s;
-}
-
-static hbucket
-hbucket_single (hentry e)
-{
-  hbucket h = (hbucket) dmalloc (sizeof (*h));
-  
-  h->size = 1;
-  h->nspace = HBUCKET_BASESIZE - 1;
-  h->entries = (hentry *) dmalloc (HBUCKET_BASESIZE * sizeof (*h->entries));
-  h->entries[0] = e;
-  
-  return (h);
-}
-
-static void
-hbucket_grow (/*@notnull@*/ hbucket h)
-{
-  int i;
-  hentry *newentries; 
-  
-  h->nspace += HBUCKET_BASESIZE;
-
-  newentries = (hentry *) 
-    dmalloc ((h->size + HBUCKET_BASESIZE) * sizeof (*newentries));
-  
-  for (i = 0; i < h->size; i++) 
-    {
-      newentries[i] = h->entries[i]; 
-    }
-  
-  sfree (h->entries);
-  h->entries = newentries; 
-}
-
-static int hbucket_lookup (hbucket p_h, cstring p_key);
-
-/*
-** bizarre duplicate behaviour
-** required for duplicate entries
-*/
-
-static void
-hbucket_add (/*@notnull@*/ hbucket h, hentry e)
-{
-  int exloc = hbucket_lookup (h, e.key);
-
-  
-  if (exloc != HBUCKET_DNE)
-    {
-      h->entries[exloc].key = e.key;
-      h->entries[exloc].val = e.val;
-      return;
-    }
-
-  if (h->nspace == 0)
-    {
-            hbucket_grow (h);
-    }
-
-  h->entries[h->size] = e;
-  h->size++;
-  h->nspace--;
-}
-
-static int
-hbucket_ncollisions (hbucket h)
-{
-  if (!hbucket_isNull (h) && (h->size > 1))
-    return (h->size - 1);
-  else
-    return 0;
-}
-
-int
-hbucket_lookup (hbucket h, cstring key)
-{
-  if (!hbucket_isNull (h))
-    {
-      int i;
-      
-      for (i = 0; i < h->size; i++)
-	{
-	  if (cstring_equal (h->entries[i].key, key))
-	    {
-	      return h->entries[i].val;
-	    }
-	}
-    }
-
-  return HBUCKET_DNE;
-}
-
-static
-void hbucket_free (/*@only@*/ hbucket h)
-{
-  if (!hbucket_isNull (h))
-    {
-      sfree (h->entries);
-      sfree (h);
-    }
-}
-
-void 
-hashTable_free (/*@only@*/ hashTable h)
-{
-  int i;
-
-  for (i = 0; i < h->size; i++)
-    {
-      hbucket_free (h->buckets[i]);
-    }
-
-  sfree (h->buckets);
-  sfree (h);
-}
-  
-static int
-hashTable_countCollisions (hashTable h)
-{
-  int nc = 0;
-  int i;
-
-  for (i = 0; i < h->size; i++)
-    {
-      nc += hbucket_ncollisions (h->buckets[i]);
-    }
-
-  return (nc);
-}
-
-
-static int
-hashTable_countEmpty (hashTable h)
-{
-  int nc = 0;
-  int i;
-
-  for (i = 0; i < h->size; i++)
-    {
-      if (hbucket_isEmpty (h->buckets[i]))
-	{
-	  nc++;
-	}
-    }
-
-  return (nc);
-}
-
-/*
-** hash function snarfed from quake/hash.c Hash_String
-** by Stephen Harrison
-*/
-
-/*
- * Here are 256 random numbers for use in the hash function
- */
-
-/*@+ignoresigns@*/
-static unsigned int RandomNumbers[256] =
-{
-#include "256_random_numbers.nf"
-};
-/*@=ignoresigns@*/
-
-static unsigned int 
-hashTable_hashValue (hashTable h, cstring key)
-{
-  char *p;
-  unsigned int hash_value = 0;
-
-  for (p = cstring_toCharsSafe (key); *p != '\0'; p++)
-    {
-      hash_value = (hash_value << 1) ^ RandomNumbers[*p % 256];
-    }
-
-  return (hash_value % h->size);
-}
-
-static /*@exposed@*/ hbucket
-hashTable_hash (hashTable h, cstring key)
-{
-  return h->buckets[hashTable_hashValue (h, key)];
-}
-
-
-/*@only@*/ hashTable
-hashTable_create (int size)
-{
-  int i;
-  hashTable h = (hashTable) dmalloc (sizeof (*h));
-  
-  h->size = size;
-  h->nentries = 0;
-  h->buckets = (hbucket *) dmalloc (sizeof (*h->buckets) * size);
-  
-  /*@+loopexec@*/
-  for (i = 0; i < size; i++)
-    {
-      h->buckets[i] = hbucket_undefined;
-    }
-  /*@-loopexec@*/
-  return h;
-}
-
-/*@-mustfree@*/
-static /*@unused@*/ void
-hashTable_print (hashTable h)
-{
-  int i;
-
-  for (i = 0; i < h->size; i++)
-    {
-      hbucket hb = h->buckets[i];
-
-      if (hb != NULL)
-	{
-	  llmsg (message ("%d. %s\n", i, hbucket_unparse (hb)));
-	}
-    }
-
-  llmsg (message ("size: %d, collisions: %d, empty: %d", 
-		  h->size, 
-		  hashTable_countCollisions (h),
-		  hashTable_countEmpty (h)));
-}
-/*@=mustfree@*/
-
-/*@only@*/ cstring
-hashTable_stats (hashTable h)
-{
-  return (message ("size: %d, collisions: %d, empty: %d\n", 
-			h->size, hashTable_countCollisions (h),
-			hashTable_countEmpty (h)));
-}
-
-static void
-hashTable_addEntry (hashTable h, hentry e)
-{
-  unsigned int hindex = hashTable_hashValue (h, e.key);
-  /*
-  ** using
-  **   hbucket hb = h->buckets[hindex];  
-  ** instead reveals a bug I don't want to deal with right now!
-  */
-
-  h->nentries++;
-  
-  if (hbucket_isNull (h->buckets[hindex]))
-    {
-      h->buckets[hindex] = hbucket_single (e); 
-    }
-  else
-    {
-      hbucket_add (h->buckets[hindex], e);
-    }
-}
-
-void
-hashTable_insert (hashTable h, cstring key, int value)
-{
-  unsigned int hindex;
-  hbucket hb;
-  hentry e;  
-
-  
-  h->nentries++;
-
-  /*
-  ** rehashing based (loosely) on code by Steve Harrison
-  */
-
-  if (h->nentries * 162 > h->size * 100) 
-    {
-      int i;
-      int oldsize = h->size;
-      int newsize = 1 + ((oldsize * 26244) / 10000); /* 26244 = 162^2 */
-      hbucket *oldbuckets = h->buckets;
-
-      
-      h->size = newsize;  
-      h->nentries = 0;
-      h->buckets = (hbucket *) dmalloc (sizeof (*h->buckets) * newsize);
-
-      /*@+loopexec@*/
-      for (i = 0; i < newsize; i++)
-	{
-	  h->buckets[i] = hbucket_undefined;
-	}
-      /*@=loopexec@*/
-      
-      for (i = 0; i < oldsize; i++)
-	{
-	  hbucket bucket = oldbuckets[i];
-	  
-	  if (!hbucket_isNull (bucket))
-	    {
-	      int j;
-
-	      for (j = 0; j < bucket->size; j++)
-		{
-		  hashTable_addEntry (h, bucket->entries[j]);
-		}
-
-	      sfree (bucket);
-	    }
-	}
-
-      sfree (oldbuckets);
-    }
-
-  
-  e = hentry_create (key, value);
-  hindex = hashTable_hashValue (h, key);
-  hb = h->buckets[hindex];
-  
-  if (hbucket_isNull (hb))
-    {
-            h->buckets[hindex] = hbucket_single (e);
-    }
-  else
-    {
-            hbucket_add (hb, e);
-    }
-
-  }
-
-int
-hashTable_lookup (hashTable h, cstring key)
-{
-  hbucket hb = hashTable_hash (h, key);
-
-  return (hbucket_lookup (hb, key));
-}
-
-/*
-** This is needed if oldkey is going to be released.
-*/
-
-void
-hashTable_replaceKey (hashTable h, cstring oldkey, /*@dependent@*/ cstring newkey)
-{
-  hbucket hb = hashTable_hash (h, oldkey);
-
-  llassert (cstring_equal (oldkey, newkey));
-
-  if (!hbucket_isNull (hb))
-    {
-      int i;
-      
-      for (i = 0; i < hb->size; i++)
-	{
-	  if (cstring_equal (hb->entries[i].key, oldkey))
-	    {
-	      hb->entries[i].key = newkey;
-	      return;
-	    }
-	}
-    }
-
-  llbug (message ("hashTable_replaceKey: %s not found", oldkey));
-}
-
-void
-hashTable_remove (hashTable h, cstring key)
-{
-  hbucket hb = hashTable_hash (h, key);
-
-  if (!hbucket_isNull (hb))
-    {
-      int i;
-      
-      for (i = 0; i < hb->size; i++)
-	{
-	  if (cstring_equal (hb->entries[i].key, key))
-	    {
-	      if (i < hb->size - 1)
-		{
-		  hb->entries[i] = hb->entries[hb->size - 1];
-		}
-	      
-	      hb->size--;
-	      return;
-	    }
-	}
-    }
-
-  llbug (message ("hashTable_removeKey: %s not found", key));
-}
-
-
diff --git a/src/idDecl.c b/src/idDecl.c
deleted file mode 100644
index fb66c43..0000000
--- a/src/idDecl.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** idDecl.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-/*@only@*/ idDecl
-  idDecl_create (/*@only@*/ cstring s, /*@only@*/ qtype t)
-{
-  idDecl d = (idDecl) dmalloc (sizeof (*d));
-
-  d->id = s;
-  d->typ = t;
-
-  return (d);
-}
-
-void
-idDecl_free (idDecl t)
-{
-  if (idDecl_isDefined (t))
-    {
-      cstring_free (t->id);
-      qtype_free (t->typ);
-      sfree (t);
-    }
-}
-
-cstring
-idDecl_unparse (idDecl d)
-{
-  if (idDecl_isDefined (d))
-    {
-      return (message ("%s : %q", d->id, qtype_unparse (d->typ)));
-    }
-  else
-    {
-      return (cstring_makeLiteral (""));
-    }
-}
-
-/*@observer@*/ cstring
-idDecl_observeId (idDecl d)
-{
-  if (idDecl_isDefined (d))
-    {
-      return (d->id);
-    }
-  else
-    {
-      return cstring_undefined;
-    }
-}
-
-qtype
-idDecl_getTyp (idDecl d)
-{
-  llassert (idDecl_isDefined (d));
-
-  return d->typ;
-}
-
-ctype
-idDecl_getCtype (idDecl d)
-{
-  if (idDecl_isDefined (d))
-    {
-      return (qtype_getType (d->typ));
-    }
-  else
-    {
-      return ctype_unknown;
-    }
-}
-
-qualList
-idDecl_getQuals (idDecl d)
-{
-  if (idDecl_isDefined (d))
-    {
-      return (qtype_getQuals (d->typ));
-    }
-  else
-    {
-      return qualList_undefined;
-    }
-}
-
-void
-idDecl_addQual (idDecl d, qual q)
-{
-  llassert (idDecl_isDefined (d));
-
-  (void) qtype_addQual (d->typ, q);
-}
-
-void
-idDecl_setTyp (idDecl d, qtype c)
-{
-  llassert (idDecl_isDefined (d));
-
-  qtype_free (d->typ);
-  d->typ = c;
-}
-
-idDecl
-idDecl_replaceCtype (/*@returned@*/ idDecl d, ctype c)
-{
-  llassert (idDecl_isDefined (d));
-
-  qtype_setType (d->typ, c);
-  return d;
-}
-
-idDecl
-idDecl_fixBase (/*@returned@*/ idDecl t, qtype b)
-{
-  llassert (idDecl_isDefined (t));
-
-  t->typ = qtype_newQbase (t->typ, b);
-  return t;
-}
-
-idDecl
-idDecl_fixParamBase (/*@returned@*/ idDecl t, qtype b)
-{
-  qtype q;
-  ctype c;
-
-  llassert (idDecl_isDefined (t));
-
-  q = qtype_newQbase (t->typ, b);
-  c = qtype_getType (q);
-
-  /*
-  ** For some reason, C adds an implicit pointer to function
-  ** parameters.  It is "optional" syntax.
-  */
-
-  if (ctype_isFunction (c) && !ctype_isPointer (c))
-    {
-      qtype_setType (q, ctype_makePointer (c));
-    }
-
-  t->typ = q;
-  /* LCLint thinks t->typ is kept. */
-  /*@-compmempass@*/ return t; /*@=compmempass@*/
-}
-
-idDecl
-idDecl_expectFunction (/*@returned@*/ idDecl d)
-{
-  llassert (idDecl_isDefined (d));
-
-  qtype_setType (d->typ, ctype_expectFunction (qtype_getType (d->typ)));
-  return d;
-}
diff --git a/src/idDeclList.c b/src/idDeclList.c
deleted file mode 100644
index 8f51887..0000000
--- a/src/idDeclList.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** idDeclList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-idDeclList
-  idDeclList_singleton (/*@only@*/ idDecl e)
-{
-  idDeclList s = (idDeclList) dmalloc (sizeof (*s));
-  
-  s->nelements = 1;
-  s->nspace = idDeclListBASESIZE - 1; 
-  s->elements = (idDecl *) dmalloc (sizeof (*s->elements) * idDeclListBASESIZE);
-  s->elements[0] = e;
-  return (s);
-}
-
-static void
-idDeclList_grow (idDeclList s)
-{
-  int i;
-  idDecl *newelements;
-  
-  s->nspace += idDeclListBASESIZE; 
-  newelements = (idDecl *) dmalloc (sizeof (*newelements) 
-				    * (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i]; 
-    }
-  
-  sfree (s->elements); 
-  s->elements = newelements;
-}
-
-idDeclList idDeclList_add (idDeclList s, /*@only@*/ idDecl el)
-{
-  if (s->nspace <= 0)
-    idDeclList_grow (s);
-  
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-
-  return s;
-}
-
-/*@only@*/ cstring
-idDeclList_unparse (idDeclList s)
-{
-   int i;
-   cstring st = cstring_makeLiteral ("[");
-
-   for (i = 0; i < s->nelements; i++)
-     {
-       if (i == 0)
-	 {
-	   st = message ("%q %q", st, idDecl_unparse (s->elements[i]));
-	 }
-       else
-	 st = message ("%q, %q", st, idDecl_unparse (s->elements[i]));
-     }
-   
-   st = message ("%q ]", st);
-   return st;
-}
-
-void
-idDeclList_free (idDeclList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-      idDecl_free (s->elements[i]);
-    }
-  
-  sfree (s->elements);
-  sfree (s);
-}
diff --git a/src/importNodeList.c b/src/importNodeList.c
deleted file mode 100644
index d8eb700..0000000
--- a/src/importNodeList.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** importNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ importNodeList
-importNodeList_new ()
-{
-  importNodeList s = (importNodeList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = importNodeListBASESIZE;
-  s->elements = (importNode *) 
-    dmalloc (sizeof (*s->elements) * importNodeListBASESIZE);
-  
-  return (s);
-}
-
-static void
-importNodeList_grow (importNodeList s)
-{
-  int i;
-  importNode *newelements;
-
-  s->nspace += importNodeListBASESIZE;
-
-  newelements = (importNode *) dmalloc (sizeof (*newelements) 
-					* (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-importNodeList
-importNodeList_add (importNodeList s, importNode el)
-{
-  if (s->nspace <= 0)
-    importNodeList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-  return s;
-}
-
-/*@only@*/ cstring
-importNodeList_unparse (importNodeList s)
-{
-  bool first = TRUE;
-  cstring st = cstring_undefined;
-
-  importNodeList_elements (s, current)
-  {
-    if (first)
-      {
-	st = cstring_copy (ltoken_unparse (current->val));
-	first = FALSE;
-      }
-    else
-      {
-	st = message ("%q, %s", st, ltoken_unparse (current->val));
-      }
-  } end_importNodeList_elements;
-
-  return st;
-}
-
-void
-importNodeList_free (importNodeList s)
-{
-  int i;
-  
-  for (i = 0; i < s->nelements; i++)
-    {
-      importNode_free (s->elements[i]); 
-    }
-  
-  sfree (s->elements);
-  sfree (s);
-}
diff --git a/src/imports.c b/src/imports.c
deleted file mode 100644
index 209957e..0000000
--- a/src/imports.c
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** imports.c
-**
-** module for importing LCL specs.
-**
-**  AUTHOR:
-**	Yang Meng Tan,
-**         Massachusetts Institute of Technology
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h" 
-# include "osd.h"
-# include "llgrammar.h" /* need simpleOp, MULOP and logicalOp in makeInfixTermNode */
-# include "lclscan.h"
-# include "checking.h"
-# include "imports.h"
-# include "lslparse.h"
-# include "lh.h"
-# include "llmain.h"
-# include "portab.h"
-# include "herald.h"
-
-void
-outputLCSFile (char *path, char *msg, char *specname)
-{
-  static bool haserror = FALSE;
-  char *sfile = mstring_concat (specname, ".lcs");
-  char *outfile = mstring_concat (path, sfile);
-  char *s;
-  FILE *outfptr = fopen (outfile, "w");
-  sfree (sfile);
-
-  DPRINTF (("Output lcl file: %s / %s / %s", path, specname, outfile));
-  
-  /* check write permission */
-  
-  if (outfptr == 0)
-    {				/* fopen fails */
-      if (!haserror)
-	{
-	  lclplainerror (message ("Cannot write to output file: %s", 
-				  cstring_fromChars (outfile)));
-	  haserror = TRUE;
-	}
-      sfree (outfile);
-      return;
-    }
-
-  fprintf (outfptr, msg);
-  fprintf (outfptr, "%s\n", LCL_PARSE_VERSION);
-  
-  /* output line %LCLimports foo bar ... */
-  fprintf (outfptr, "%%LCLimports ");
-
-  lsymbolSet_elements (g_currentImports, sym)
-    {
-      s = lsymbol_toChars (sym);
-
-      if (s != NULL && !mstring_equal (s, specname))
-	{
-	  fprintf (outfptr, "%s ", s);
-	}
-    } end_lsymbolSet_elements;
-  
-  fprintf (outfptr, "\n");
-  
-  sort_dump (outfptr, TRUE);
-  symtable_dump (g_symtab, outfptr, TRUE);
-
-  check (fclose (outfptr) == 0);  
-  sfree (outfile);  
-}
-
-void
-importCTrait (void)
-{
-  char **infile = (char **) dmalloc (sizeof (*infile));
-  filestatus status = osd_findOnLarchPath (CTRAITSYMSNAME, infile);
-
-  
-  switch (status)
-    {
-    case OSD_FILEFOUND:
-      /*
-      ** This line was missing before version 2.3f.  Bug fix by Mike Smith.
-      **    This looks like a bug - infile is already fully qualified path  
-      **    parseSignatures() adds another path to the front and fails to   
-      **    open the file.                                                  
-      */
-	   
-      (void) parseSignatures (cstring_fromChars (CTRAITSYMSNAME));
-      (void) parseSignatures (cstring_fromChars (*infile));
-      break;
-    case OSD_FILENOTFOUND:
-      /* try spec name */
-      status = osd_findOnLarchPath (CTRAITSPECNAME, infile);
-
-      if (status == OSD_FILEFOUND)
-	{
-	  callLSL (CTRAITSPECNAME,
-		   cstring_toCharsSafe
-		   (message ("includes %s (%s for String)",
-			     cstring_fromChars (CTRAITFILENAMEN), 
-			     cstring_fromChars (sort_getName (sort_cstring)))));
-	  break;
-	}
-      else
-	{
-	  lldiagmsg 
-	    (message ("Unable to find %s or %s.  Check LARCH_PATH environment variable.",
-		      cstring_fromChars (CTRAITSYMSNAME), 
-		      cstring_fromChars (CTRAITSPECNAME)));
-	  llexit (LLFAILURE);
-	}
-    case OSD_PATHTOOLONG:
-      lclbug (message ("importCTrait: the concatenated directory and file "
-		       "name are too long: %s: "
-		       "continuing without it", 
-		       cstring_fromChars (CTRAITSPECNAME)));
-      break;
-    }
-
-  sfree (*infile);
-  sfree (infile);
-}
-
-/*
-** processImport --- load imports from file
-**
-**    impkind: IMPPLAIN  file on SPEC_PATH
-**                       # include "./file.h" if it exists,
-**			 # include "/file.h" if not.
-**			   (warn if neither exists)
-**            IMPBRACKET file in default LCL imports directory
-**                       # include 
-**            IMPQUOTE   file directly
-**                       # include "file.h"
-*/
-
-void
-processImport (lsymbol importSymbol, ltoken tok, impkind kind)
-{
-  bool readableP, oldexporting;
-  bool oldFormat = FALSE;
-  tsource *imported, *imported2, *lclsource;
-  char *bufptr, *tmpbufptr, *cptr;
-  char *name;
-  lsymbol sym;
-  char importName[MAX_NAME_LENGTH + 1], *importFileName, *realfname;
-  char *path;
-  char *fpath, *fpath2;
-  mapping *map;
-  filestatus ret;
-
-  importFileName = lsymbol_toCharsSafe (importSymbol);
-  name = mstring_concat (importFileName, IO_SUFFIX);
-  realfname = name;
-
-  /*
-  ** find .lcs file
-  */
-  
-  switch (kind)
-    {
-    case IMPPLAIN:
-      path = cstring_toCharsSafe 
-	(message ("%s%c%s", cstring_fromChars (g_localSpecPath), SEPCHAR, context_getLarchPath ()));
-      
-      break;
-    case IMPBRACKET:
-      path = mstring_copy (cstring_toCharsSafe (context_getLCLImportDir ()));
-      break;
-    case IMPQUOTE:
-      path = mstring_copy (g_localSpecPath);
-      break;
-    default:
-      path = mstring_createEmpty (); /* suppress gcc error message */
-      llbuglit ("bad imports case\n");
-    }
-
-  if ((ret = osd_getPath (path, realfname, &fpath)) != OSD_FILEFOUND)
-    {
-      char *fname2;
-      
-      if (ret == OSD_PATHTOOLONG)
-	{
-	  llfatalerrorLoc (cstring_makeLiteral ("Path too long"));
-	}
-      
-      imported2 = tsource_create (importFileName, LCL_SUFFIX, FALSE);
-      fname2 = tsource_fileName (imported2);
-      
-      
-
-      if (osd_getPath (path, fname2, &fpath2) == OSD_FILEFOUND)
-	{
-	  llfatalerrorLoc
-	    (message ("Specs must be processed before it can be imported: %s", 
-		      cstring_fromChars (fpath2)));
-	}
-      else
-	{
-	  if (kind == IMPPLAIN || kind == IMPQUOTE)
-	    llfatalerrorLoc (message ("Cannot find file to import: %s", 
-				       cstring_fromChars (realfname)));
-	  else
-	    llfatalerrorLoc (message ("Cannot find standard import file: %s",
-				       cstring_fromChars (realfname)));
-	}
-    }
-
-  
-  imported = tsource_create (fpath, IO_SUFFIX, FALSE);
-  
-  
-  readableP = tsource_open (imported);
-    
-  if (!readableP)
-    {			/* can't read ? */
-      llfatalerrorLoc (message ("Cannot open import file for reading: %s",
-				 cstring_fromChars (tsource_fileName (imported))));
-    }
-
-  bufptr = tsource_nextLine (imported);
-
-  if (bufptr == 0)
-    {
-      llerror (FLG_SYNTAX, message ("Import file is empty: %s", 
-				    cstring_fromChars (tsource_fileName (imported))));
-      sfree (name);
-      (void) tsource_close (imported);
-      tsource_free (imported);
-
-      sfree (path);
-      return;
-    }
-
-  /* was it processed successfully ? */
-  if (firstWord (bufptr, "%FAILED"))
-    {
-      llfatalerrorLoc
-	(message ("Imported file was not checked successfully: %s.", 
-		  cstring_fromChars (name)));
-    }
-  
-  /** is it generated by the right version of the checker? 
-   **
-   ** old .lcs files start with %PASSED
-   ** new (compressed) files start with %LCS 
-   */
-  
-  if (firstWord (bufptr, "%PASSED"))
-    {
-      /* %PASSED Output from LCP Version 2.* and 3.* */
-      /*                     1234567890123*/
-      /*                                 +*/
-
-      cptr = strstr (bufptr, "LCP Version");
-      
-      if (cptr != NULL)
-	{
-	  cptr += 12;
-	  if (*cptr != '2' && *cptr != '3')
-	    {
-	      llfatalerrorLoc (message ("Imported file is obsolete: %s.",
-					 cstring_fromChars (bufptr)));
-	    }
-	}
-      oldFormat = TRUE;
-    }
-  else 
-    {
-      if (!firstWord (bufptr, "%LCS"))
-	{
-	  llfatalerrorLoc (message ("Imported file is not in correct format: %s.",
-				    cstring_fromChars (bufptr)));
-	}
-    }
-  
-  /* push the imported LCL spec onto g_currentImports */
-
-  context_enterImport ();
-  
-  bufptr = tsource_nextLine (imported);
-  llassert (bufptr != NULL);
-
-  tmpbufptr = bufptr;
-
-    /* expect %LCLimports foo bar ... */
-  if (firstWord (bufptr, "%LCLimports "))
-    {
-      bufptr = bufptr + strlen ("%LCLimports ");
-      while (sscanf (bufptr, "%s", importName) == 1)
-	{
-	  bufptr = bufptr + strlen (importName) + 1;	/* 1 for space */
-	  sym = lsymbol_fromChars (importName);
-	  if (sym == importSymbol || 
-	      lsymbolSet_member (g_currentImports, sym))
-	    {
-	      /* ensure that the import list does not contain itself: an
-		 invariant useful for checking imports cycles. */
-	      lclsource = LCLScanSource ();
-	      lclfatalerror (tok, 
-			     message ("Imports cycle: %s.lcl imports %s",
-				      cstring_fromChars (importFileName),
-				      cstring_fromChars (importName)));
-	    }	  
-	  /* push them onto g_currentImports */
-	  /* evs - 94 Apr 3:  I don't think it should do this! */
-	  /* (void) lsymbolSet_insert (g_currentImports, sym); */
-	}
-    }
-  else
-    {
-      lclsource = LCLScanSource ();
-      lclfatalerror (tok, message ("Unexpected line in imported file %s: %s", 
-				   cstring_fromChars (name), 
-				   cstring_fromChars (bufptr)));
-    }
-	  
-  /* read in the imported info */
-  oldexporting = sort_setExporting (TRUE);
-
-  map = mapping_create ();
-
-  /* tok for error line numbering */
-
-  if (oldFormat)
-    {
-            sort_import (imported, tok, map);	
-    }
-
-  (void) sort_setExporting (oldexporting);
-
-  /* sort_import updates a mapping of old anonymous sorts to new
-     anonymous sort that is needed in symtable_import */
-  /* mapping_print (map); */
-  
-  if (oldFormat)
-    {
-      symtable_import (imported, tok, map);
-    }
-  else
-    {
-      /* symtable_loadImport (imported, tok, map); */
-    }
-  
-  check (tsource_close (imported));
-  tsource_free (imported);
-
-  sfree (map);
-  sfree (name);
-  sfree (path);
-
-  context_leaveImport ();  
-}
-
-
-
diff --git a/src/initDeclNodeList.c b/src/initDeclNodeList.c
deleted file mode 100644
index 9ac30c7..0000000
--- a/src/initDeclNodeList.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** initDeclNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ initDeclNodeList
-initDeclNodeList_new ()
-{
-  initDeclNodeList s = (initDeclNodeList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = initDeclNodeListBASESIZE;
-  s->elements = (initDeclNode *)
-    dmalloc (sizeof (*s->elements) * initDeclNodeListBASESIZE);
-
-  return (s);
-}
-
-static void
-initDeclNodeList_grow (initDeclNodeList s)
-{
-  int i;
-  initDeclNode *newelements;
-
-  s->nspace += initDeclNodeListBASESIZE;
-  newelements = (initDeclNode *) dmalloc (sizeof (*newelements)
-					  * (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-initDeclNodeList
-initDeclNodeList_add (initDeclNodeList s, initDeclNode el)
-{
-  if (s->nspace <= 0)
-    initDeclNodeList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-
-  return s;
-}
-
-/*@only@*/ cstring
-initDeclNodeList_unparse (initDeclNodeList s)
-{
-  cstring st = cstring_undefined;
-  bool first = TRUE;
-
-  initDeclNodeList_elements (s, current)
-  {
-    if (first)
-      {
-	first = FALSE;
-	st = declaratorNode_unparse (current->declarator);
-      }
-    else
-      {
-	st = message ("%q, %q", st, declaratorNode_unparse (current->declarator));
-      }
-
-    if (current->value != (termNode) 0)
-      {
-	st = message ("%q = %q", st, termNode_unparse (current->value));
-      }
-  } end_initDeclNodeList_elements;
-
-  return st;
-}
-
-void
-initDeclNodeList_free (initDeclNodeList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-      initDeclNode_free (s->elements[i]);
-    }
-
-  sfree (s->elements);
-  sfree (s);
-}
diff --git a/src/intSet.c b/src/intSet.c
deleted file mode 100644
index 7fdf0b3..0000000
--- a/src/intSet.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** intSet.c
-**
-** based on set_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-# include "intSet.h"
-
-/*@only@*/ intSet
-intSet_new ()
-{
-  intSet s = (intSet) dmalloc (sizeof (*s));
-  
-  s->entries = 0;
-  s->nspace = intSetBASESIZE;
-  s->elements = (int *) dmalloc (sizeof (*s->elements) * intSetBASESIZE);
-
-  return (s);
-}
-
-static void
-intSet_grow (intSet s)
-{
-  int i;
-  int *newelements;
-
-  s->nspace = intSetBASESIZE;
-  newelements = (int *) dmalloc (sizeof (*newelements) * (s->entries + s->nspace));
-
-  for (i = 0; i < s->entries; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements); 
-  s->elements = newelements; 
-}
-
-/*
-** Ensures: if *e \in *s
-**          then unchanged (*s) & result = false
-**          else *s' = insert (*s, *e) & result = true
-** Modifies: *s
-*/
-
-bool
-intSet_insert (intSet s, int el)
-{
-  int i;
-
-  for (i = 0; i < s->entries; i++)
-    {
-      if (s->elements[i] >= el)
-	break;
-    }
-
-  if (s->entries > 0 && s->elements[i] == el)
-    {
-      return FALSE;
-    }
-  else
-    {
-      if (s->nspace <= 0)
-	intSet_grow (s);
-
-      s->nspace--;
-
-      if (i == (s->entries - 1))
-	{
-	  s->elements[s->entries] = el;
-	}
-      else
-	{
-	  int j;
-	  
-	  for (j = s->entries; j > i; j--)
-	    {
-	      s->elements[j] = s->elements[j-1];
-	    }
-	  s->elements[i] = el;
-	}
-      
-      s->entries++;      
-      return TRUE;
-    }
-}
-
-bool
-intSet_member (intSet s, int el)
-{
-  int i;
-
-  for (i = 0; i < s->entries; i++)
-    {
-      if (el == s->elements[i])
-	{
-	  return TRUE;
-	}
-      if (el > s->elements[i]) 
-	{
-	  return FALSE;
-	}
-    }
-  return FALSE;
-}
-
-# ifndef NOLCL
-/*@only@*/ cstring
-intSet_unparseText (intSet s)
-{
-  int i;
-  cstring st = cstring_undefined;
-  int lastentry = s->entries - 1;
-
-  for (i = 0; i < s->entries; i++)
-    {
-      if (i == 0)
-	st = message ("%d", s->elements[i]);
-      else if (i == lastentry)
-	st = message ("%q or %d", st, s->elements[i]);
-      else
-	st = message ("%q, %d", st, s->elements[i]);
-    }
-
-  return st;
-}
-# endif
-
-/*@only@*/ cstring
-intSet_unparse (intSet s)
-{
-  int i;
-  cstring st = cstring_makeLiteral ("{");
-
-  for (i = 0; i < s->entries; i++)
-    {
-      st = message ("%q %d", st, s->elements[i]);
-    }
-
-  st = message ("%q}", st);
-  return st;
-}
-
-void
-intSet_free (intSet s)
-{
-  sfree (s->elements); 
-  sfree (s);
-}
diff --git a/src/interfaceNodeList.c b/src/interfaceNodeList.c
deleted file mode 100644
index ec708a0..0000000
--- a/src/interfaceNodeList.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** interfaceNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ interfaceNodeList
-interfaceNodeList_new ()
-{
-  interfaceNodeList s = (interfaceNodeList) dmalloc (sizeof (*s));
-
-  s->nelements = 0;
-  s->nspacelow = interfaceNodeListGROWLOW;
-  s->nspacehigh = interfaceNodeListGROWHI;
-  s->elementsroot = (interfaceNode *) dmalloc (sizeof (*s->elements)
-					       * interfaceNodeListBASESIZE);
-  s->elements = s->elementsroot + interfaceNodeListGROWLOW;
-
-  return (s);
-}
-
-static void
-interfaceNodeList_grow (interfaceNodeList s)
-{
-  int i;
-  interfaceNode *newelements; 
-  
-  newelements = (interfaceNode *) dmalloc 
-    (sizeof (*newelements) * (s->nelements + interfaceNodeListBASESIZE));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i + interfaceNodeListGROWLOW] = s->elements[i];
-    }
-  
-  s->nspacelow = interfaceNodeListGROWLOW;
-  s->nspacehigh = interfaceNodeListGROWHI; 
-  
-  sfree (s->elementsroot);  
-  s->elementsroot = newelements;
-
-  s->elements = newelements + s->nspacelow;
-}
-
-interfaceNodeList
-interfaceNodeList_addh (interfaceNodeList s, interfaceNode el)
-{
-  llassert (interfaceNodeListGROWHI > 0);
-
-  if (s->nspacehigh <= 0)
-    interfaceNodeList_grow (s);
-
-  s->nspacehigh--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-
-  return s;
-}
-
-void 
-interfaceNodeList_addl (interfaceNodeList s, /*@keep@*/ interfaceNode el)
-{
-  llassert (interfaceNodeListGROWLOW > 0);
-
-  if (s->nspacelow <= 0)
-    interfaceNodeList_grow (s);
-
-  s->nspacelow--;
-  s->elements--;
-  s->elements[0] = el;
-  s->nelements++;
-}
-
-void
-interfaceNodeList_free (interfaceNodeList s)
-{
-  int i;
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      interfaceNode_free (s->elements[i]);
-    }
-
-  sfree (s->elementsroot);
-  sfree (s);
-}
diff --git a/src/lclctypes.c b/src/lclctypes.c
deleted file mode 100644
index 7880cb3..0000000
--- a/src/lclctypes.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** lclctypes.c
-**
-** This contains definitions used in processing C builtin types.
-**
-** WARNING: there is a different file ctype.c for handling types
-**          in the C checking of lclint.  This is only for handling
-**          C builtin types in LCL files.
-**
-**  AUTHORS:
-**
-**      Gary Feldman, Technical Languages and Environements, DECspec project
-**	Joe Wild, Technical Languages and Environements, DECspec project
-**
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-typedef struct
-{
-  bits pt;
-  TypeSpec ts;
-} Lclctype2sortType;
-
-static Lclctype2sortType lclctype2type[] =
-{
-  { fixBits (TS_VOID, 0), TYS_VOID},
-  { fixBits (TS_UNKNOWN, 0), TYS_NONE},
-  { fixBits (TS_CHAR, 0), TYS_CHAR},
-  { fixBits (TS_SIGNED, fixBits (TS_CHAR, 0)), TYS_SCHAR},
-  { fixBits (TS_UNSIGNED, fixBits (TS_CHAR, 0)), TYS_UCHAR},
-
-  { fixBits (TS_SIGNED, fixBits (TS_SHORT, fixBits (TS_INT, 0))), TYS_SSINT},
-  { fixBits (TS_SIGNED, fixBits (TS_SHORT, 0)), TYS_SSINT},
-  { fixBits (TS_SHORT, fixBits (TS_INT, 0)), TYS_SSINT},
-  { fixBits (TS_SHORT, 0), TYS_SSINT},
-
-  { fixBits (TS_UNSIGNED, fixBits (TS_SHORT, fixBits (TS_INT, 0))), TYS_USINT},
-  { fixBits (TS_UNSIGNED, fixBits (TS_SHORT, 0)), TYS_USINT},
-
-  { fixBits (TS_SIGNED, fixBits (TS_INT, 0)), TYS_SINT},
-  { fixBits (TS_SIGNED, 0), TYS_SINT},
-
-  { fixBits (TS_INT, 0), TYS_INT},
-  { 0, TYS_INT},
-
-  { fixBits (TS_UNSIGNED, fixBits (TS_INT, 0)), TYS_UINT},
-  { fixBits (TS_UNSIGNED, 0), TYS_UINT},
-
-  { fixBits (TS_SIGNED, fixBits (TS_LONG, fixBits (TS_INT, 0))), TYS_SLINT},
-  { fixBits (TS_SIGNED, fixBits (TS_LONG, 0)), TYS_SLINT},
-  { fixBits (TS_LONG, fixBits (TS_INT, 0)), TYS_SLINT},
-  { fixBits (TS_LONG, 0), TYS_SLINT},
-
-  { fixBits (TS_UNSIGNED, fixBits (TS_LONG, fixBits (TS_INT, 0))), TYS_ULINT},
-  { fixBits (TS_UNSIGNED, fixBits (TS_LONG, 0)), TYS_ULINT},
-
-  { fixBits (TS_FLOAT, 0), TYS_FLOAT},
-  { fixBits (TS_DOUBLE, 0), TYS_DOUBLE},
-  { fixBits (TS_LONG, fixBits (TS_DOUBLE, 0)), TYS_LDOUBLE},
-
-  { fixBits (TS_STRUCT, 0), TYS_STRUCT},
-  { fixBits (TS_UNION, 0), TYS_UNION},
-  { fixBits (TS_ENUM, 0), TYS_ENUM},
-  { fixBits (TS_TYPEDEF, 0), TYS_TYPENAME}
-};
-
-lsymbol
-lclctype_toSortDebug (bits t)
-{
-  int i;
-  int lsize;
-  static ob_mstring OLD_Type2sortName[] =
-    {
-      "error",			/* TYS_NONE 	*/
-      "void",			/* TYS_VOID  	*/
-      "char",			/* TYS_CHAR  	*/
-      "signed_char",		/* TYS_SCHAR 	*/
-      "char",			/* TYS_UCHAR 	*/
-      "short_int",		/* TYS_SSINT	*/
-      "unsigned_short_int",	/* TYS_USINT	*/
-      "int",			/* TYS_INT        */
-      "int",			/* TYS_SINT 	*/
-      "unsigned_int",		/* TYS_UINT 	*/
-      "long_int",		/* TYS_SLINT	*/
-      "unsigned_long_int",	/* TYS_ULINT	*/
-      "float",			/* TYS_FLOAT	*/
-      "double",		        /* TYS_DOUBLE	*/
-      "long_double",		/* TYS_LDOUBLE 	*/
-      "error",			/* TYS_ENUM 	*/
-      "error",			/* TYS_STRUCT 	*/
-      "error",			/* TYS_UNION 	*/
-      "error"			/* TYS_TYPENAME */
-      };
-
-  lsize = size_toInt (sizeof (lclctype2type) / sizeof (lclctype2type[0]));
-
-  for (i = 0; i < lsize; i++)
-    {
-      if (lclctype2type[i].pt == t)
-	{
-	  return lsymbol_fromChars (OLD_Type2sortName[(int)lclctype2type[i].ts]);
-	}
-    }
-  return lsymbol_fromChars ("_error");
-}
-
-
-lsymbol
-lclctype_toSort (bits t)
-{
-  int i;
-  static ob_mstring Type2sortName[] =
-    {
-      /* _error must have underscore, LSL/LCL interface convention */
-      "_error",		        /* TYS_NONE 	*/
-      "void",			/* TYS_VOID  	*/
-      "char",			/* TYS_CHAR  	*/
-      "char",			/* TYS_SCHAR 	*/
-      "char",			/* TYS_UCHAR 	*/
-      "int",			/* TYS_SSINT	*/
-      "int",			/* TYS_USINT	*/
-      "int",			/* TYS_INT	*/
-      "int",			/* TYS_SINT 	*/
-      "int",			/* TYS_UINT 	*/
-      "int",			/* TYS_SLINT	*/
-      "int",			/* TYS_ULINT	*/
-      "double",		        /* TYS_FLOAT	*/
-      "double",		        /* TYS_DOUBLE	*/
-      "double",		        /* TYS_LDOUBLE 	*/
-      "error",			/* TYS_ENUM 	*/
-      "error",			/* TYS_STRUCT 	*/
-      "error",			/* TYS_UNION 	*/
-      "error"			/* TYS_TYPENAME 	*/
-      };
-
-  int lsize = size_toInt (sizeof (lclctype2type) / sizeof (lclctype2type[0]));
-
-  for (i = 0; i < lsize; i++)
-    {
-      if (lclctype2type[i].pt == t)
-	{
-	  return lsymbol_fromChars (Type2sortName[(int)lclctype2type[i].ts]);
-	}
-    }
-
-  return lsymbol_fromChars ("_error");
-}
diff --git a/src/lclinit.c b/src/lclinit.c
deleted file mode 100644
index 2535200..0000000
--- a/src/lclinit.c
+++ /dev/null
@@ -1,1557 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** lslinit.c
-**
-** Processor for Larch Shared Language Init Files
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "gram.h"
-# include "lclscan.h"
-# include "scanline.h"
-# include "lclscanline.h"
-# include "lcltokentable.h"
-# include "lclsyntable.h"
-# include "lslinit.h"
-# include "lclinit.h"
-# include "shift.h"
-
-# if 0
-/*@notfunction@*/
-# define TRACE(rule) printf ("Reducing: %s\n", rule)
-# else
-/*@notfunction@*/
-# define TRACE(rule)
-# endif
-
-static /*@dependent@*/ ltoken nextToken;
-static void InitLines (void) /*@modifies nextToken@*/ ;
-static void InitLine (void) /*@modifies nextToken@*/;
-static void Classification (void) /*@modifies nextToken@*/;
-static void CharClass (void) /*@modifies nextToken@*/;
-
-static void EndCommentChars (void) /*@modifies nextToken@*/ ;
-static void IdChars (void) /*@modifies nextToken@*/ ;
-static void OpChars (void) /*@modifies nextToken@*/ ;
-static void ExtensionChar (void) /*@modifies nextToken@*/ ;
-static void SingChars (void) /*@modifies nextToken@*/ ;
-static void WhiteChars (void) /*@modifies nextToken@*/ ;
-static void EndCommentChar (void) /*@modifies nextToken@*/ ;
-static void IdChar (void) /*@modifies nextToken@*/ ;
-static void OpChar (void) /*@modifies nextToken@*/ ;
-static void SingChar (void) /*@modifies nextToken@*/ ;
-static void WhiteChar (void) /*@modifies nextToken@*/ ;
-
-static void TokenClass (void) /*@modifies nextToken@*/ ;
-static void QuantifierSymToks (void) /*@modifies nextToken@*/ ;
-static void LogicalOpToks (void) /*@modifies nextToken@*/ ;
-static void EqOpToks (void) /*@modifies nextToken@*/ ;
-static void EquationSymToks (void) /*@modifies nextToken@*/ ;
-static void EqSepSymToks (void) /*@modifies nextToken@*/ ;
-static void SelectSymToks (void) /*@modifies nextToken@*/ ;
-static void OpenSymToks (void) /*@modifies nextToken@*/ ;
-static void SepSymToks (void) /*@modifies nextToken@*/ ;
-static void CloseSymToks (void) /*@modifies nextToken@*/ ;
-static void SimpleIdToks (void) /*@modifies nextToken@*/ ;
-static void MapSymToks (void) /*@modifies nextToken@*/ ;
-static void MarkerSymToks (void) /*@modifies nextToken@*/ ;
-static void CommentSymToks (void) /*@modifies nextToken@*/ ;
-static void QuantifierSymTok (void) /*@modifies nextToken@*/ ;
-static void LogicalOpTok (void) /*@modifies nextToken@*/ ;
-static void EqOpTok (void) /*@modifies nextToken@*/ ;
-static void EquationSymTok (void) /*@modifies nextToken@*/ ;
-static void EqSepSymTok (void) /*@modifies nextToken@*/ ;
-static void SelectSymTok (void) /*@modifies nextToken@*/ ;
-static void OpenSymTok (void) /*@modifies nextToken@*/ ;
-static void SepSymTok (void) /*@modifies nextToken@*/ ;
-static void CloseSymTok (void) /*@modifies nextToken@*/ ;
-static void SimpleIdTok (void) /*@modifies nextToken@*/ ;
-static void MapSymTok (void) /*@modifies nextToken@*/ ;
-static void MarkerSymTok (void) /*@modifies nextToken@*/ ;
-static void CommentSymTok (void) /*@modifies nextToken@*/ ;
-static void SynClass (void) /*@modifies nextToken@*/ ;
-static void OldToken (void) /*@modifies nextToken@*/ ;
-static void NewToken (void) /*@modifies nextToken@*/ ;
-static void Token (void) /*@modifies nextToken@*/ ;
-
-static void InitReduce (LCLInitRuleCode p_rule) /*@modifies nextToken@*/ ;
-static void UpdateXCharKeywords (charCode p_xChar) /*@modifies nextToken@*/ ;
-static void ProcessExtensionChar (void) /*@modifies nextToken@*/ ;
-static void ProcessEndCommentChar (void) /*@modifies nextToken@*/ ;
-static void ProcessSingleChar (charCode p_code) /*@modifies nextToken@*/ ;
-static void ProcessToken (ltokenCode p_code) /*@modifies nextToken@*/ ;
-static void ProcessSynonym (void) /*@modifies nextToken@*/ ;
-
-static void
-  LocalUserError (/*@unused@*/ ltoken p_t, /*@temp@*/ char *p_msg)
-  /*@modifies *g_msgstream@*/ ;
-
-/* If TRUE character has been redefined as a singleChar. */
-static bool defineSingleChar[LASTCHAR + 1];
-
-static charCode currentExtensionChar;
-
-/* LSL init file keyword tokens.  */
-
-static /*@exposed@*/ ltoken endCommentCharToken;
-static /*@exposed@*/ ltoken idCharToken;
-static /*@exposed@*/ ltoken opCharToken;
-static /*@exposed@*/ ltoken extensionCharToken;
-static /*@exposed@*/ ltoken singleCharToken;
-static /*@exposed@*/ ltoken whiteCharToken;
-
-static /*@exposed@*/ ltoken quantifierSymToken;
-static /*@exposed@*/ ltoken logicalOpToken;
-static /*@exposed@*/ ltoken eqOpToken;
-static /*@exposed@*/ ltoken equationSymToken;
-static /*@exposed@*/ ltoken eqSepSymToken;
-static /*@exposed@*/ ltoken selectSymToken;
-static /*@exposed@*/ ltoken openSymToken;
-static /*@exposed@*/ ltoken sepSymToken;
-static /*@exposed@*/ ltoken closeSymToken;
-static /*@exposed@*/ ltoken simpleIdToken;
-static /*@exposed@*/ ltoken mapSymToken;
-static /*@exposed@*/ ltoken markerSymToken;
-static /*@exposed@*/ ltoken commentSymToken;
-
-static /*@exposed@*/ ltoken synonymToken;
-
-static /*@exposed@*/ ltoken
-insertSimpleToken (char *s) /*@modifies internalState@*/ 
-{
-    return (LCLInsertToken (simpleId, lsymbol_fromChars (s), 0, FALSE));
-}
-
-static bool
-hasFirstChar (ltoken tok) /*@*/ 
-{
-  return (ltoken_isChar (tok)
-	  && ltoken_isSingleChar (cstring_firstChar (ltoken_unparse (tok))));
-}
-
-void
-LCLProcessInitFile (void)
-{
-  InitLines ();
-
-  InitReduce (INITFILE1);
-
-  if (ltoken_getCode (nextToken) != LEOFTOKEN)
-    {
-      LocalUserError (nextToken, "unexpected tokens after end-of-file");
-    }
-}
-
-static void
-InitLines (void)
-{
-  setCodePoint ();
-  InitReduce (INITLINES1);
-
-  
-
-  if (ltoken_getCode (nextToken) != LEOFTOKEN)
-    {
-      InitLine ();
-      InitReduce (INITLINES2);
-    }
-
-  while (ltoken_getCode (nextToken) != LEOFTOKEN)
-    {
-      InitLine ();
-      InitReduce (INITLINES3);
-    }
-}
-
-static void
-InitLine (void)
-{
-  
-  if (ltoken_getCode (nextToken) == LLT_EOL)
-    {
-      /* Nothing on line. */
-            InitReduce (INITLINE1);
-    }
-  else
-    {
-            Classification ();
-      InitReduce (INITLINE2);
-    }
-
-  if (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      LocalUserError (nextToken, "Unexpected tokens on line");
-    }
-
-  nextToken = LCLScanNextToken (); /* Discard EOL	*/
-  }
-
-static void
-Classification (void)
-{
-  lsymbol ntext = ltoken_getRawText (nextToken);  
-
-    
-  if (ntext == ltoken_getText (endCommentCharToken)
-      || ntext == ltoken_getText (idCharToken)
-      || ntext == ltoken_getText (opCharToken)
-      || ntext == ltoken_getText (extensionCharToken)
-      || ntext == ltoken_getText (singleCharToken)
-      || ntext == ltoken_getText (whiteCharToken))
-    {
-      CharClass ();
-      InitReduce (CLASSIFICATION1);
-    }
-  else if (ntext == ltoken_getText (quantifierSymToken)
-	   || ntext == ltoken_getText (logicalOpToken)
-	   || ntext == ltoken_getText (eqOpToken)
-	   || ntext == ltoken_getText (equationSymToken)
-	   || ntext == ltoken_getText (eqSepSymToken)
-	   || ntext == ltoken_getText (selectSymToken)
-	   || ntext == ltoken_getText (openSymToken)
-	   || ntext == ltoken_getText (sepSymToken)
-	   || ntext == ltoken_getText (closeSymToken)
-	   || ntext == ltoken_getText (simpleIdToken)
-	   || ntext == ltoken_getText (mapSymToken)
-	   || ntext == ltoken_getText (markerSymToken)
-	   || ntext == ltoken_getText (commentSymToken))
-    {
-      TokenClass ();
-      InitReduce (CLASSIFICATION2);
-    }
-  else if (ntext == ltoken_getText (synonymToken))
-    {
-      SynClass ();
-      InitReduce (CLASSIFICATION3);
-    }
-  else
-    {
-      llbug (message ("Expected character, token, or synonym classification: %s",
-		      ltoken_getRawString (nextToken)));
-     /* pop off all tokens on this line */
-    }
-}
-
-static void
-CharClass (void)
-{
-  ltoken charClassToken;
-
-  charClassToken = nextToken;
-
-  nextToken = LCLScanNextToken ();		/* Discard char class keyword. */
-
-  if (ltoken_getRawText (charClassToken) == ltoken_getText (endCommentCharToken))
-    {
-      EndCommentChars ();
-      InitReduce (CHARCLASS1);
-    }
-  else if (ltoken_getRawText (charClassToken) == ltoken_getText (idCharToken))
-    {
-      IdChars ();
-      InitReduce (CHARCLASS2);
-    }
-  else if (ltoken_getRawText (charClassToken) == ltoken_getText (opCharToken))
-    {
-      OpChars ();
-      InitReduce (CHARCLASS3);
-    }
-  else if (ltoken_getRawText (charClassToken)
-	   == ltoken_getText (extensionCharToken))
-    {
-      ExtensionChar ();
-      InitReduce (CHARCLASS4);
-    }
-  else if (ltoken_getRawText (charClassToken) == ltoken_getText (singleCharToken))
-    {
-      SingChars ();
-      InitReduce (CHARCLASS5);
-    }
-  else if (ltoken_getRawText (charClassToken) == ltoken_getText (whiteCharToken))
-    {
-      WhiteChars ();
-      InitReduce (CHARCLASS6);
-    }
-  else
-    {
-      LocalUserError (nextToken, "expected character classification");
-    }
-}
-
-static void
-EndCommentChars (void)
-{
-  EndCommentChar ();
-  InitReduce (LRC_ENDCOMMENT1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      EndCommentChar ();
-      InitReduce (LRC_ENDCOMMENT2);
-    }
-
-}
-
-static void IdChars (void) /*@modifies nextToken@*/
-{
-  IdChar ();
-  InitReduce (IDCHARS1);
-  
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      IdChar ();
-      InitReduce (IDCHARS2);
-    }
-}
-
-static void OpChars (void) /*@modifies nextToken@*/
-{
-  OpChar ();
-  InitReduce (OPCHARS1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      OpChar ();
-      InitReduce (OPCHARS2);
-    }
-}
-
-static void ExtensionChar (void) /*@modifies nextToken@*/
-{
-  if (hasFirstChar (nextToken))
-    {
-      LSLGenShift (nextToken);
-      nextToken = LCLScanNextToken ();
-      InitReduce (LRC_EXTENSIONCHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "expected only one character");
-    }
-}
-
-static void SingChars (void) /*@modifies nextToken@*/
-{
-  SingChar ();
-  InitReduce (SINGCHARS1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      SingChar ();
-      InitReduce (SINGCHARS2);
-    }
-}
-
-static void WhiteChars (void) /*@modifies nextToken@*/
-{
-  WhiteChar ();
-  InitReduce (WHITECHARS1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      WhiteChar ();
-      InitReduce (WHITECHARS2);
-    }
-}
-
-static void EndCommentChar (void) /*@modifies nextToken@*/
-{
-  if (ltoken_isChar (nextToken))
-    {
-      LSLGenShift (nextToken);
-      nextToken = LCLScanNextToken ();
-      InitReduce (LRC_ENDCOMMENTCHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "expected only one character");
-    }
-}
-
-static void IdChar (void) /*@modifies nextToken@*/
-{
-  if (hasFirstChar (nextToken))
-    {
-      LSLGenShift (nextToken);
-      nextToken = LCLScanNextToken ();
-      InitReduce (IDCHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken,
-		      "Character is already defined, cannot redefine");
-    }
-}
-
-static void OpChar (void) /*@modifies nextToken@*/
-{
-  if (hasFirstChar (nextToken))
-    {
-      LSLGenShift (nextToken);
-      nextToken = LCLScanNextToken ();
-      InitReduce (OPCHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, 
-		      "Character is already defined, cannot redefine");
-    }
-}
-
-static void SingChar (void) /*@modifies nextToken@*/
-{
-  if (hasFirstChar (nextToken))
-    {
-      LSLGenShift (nextToken);
-      nextToken = LCLScanNextToken ();
-      InitReduce (SINGCHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, 
-		      "Character is already defined, cannot redefine");
-    }
-}
-
-static void WhiteChar (void) /*@modifies nextToken@*/
-{
-  if (hasFirstChar (nextToken))
-    {
-      LSLGenShift (nextToken);
-      nextToken = LCLScanNextToken ();
-      InitReduce (WHITECHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "Character is already defined, cannot redefine");
-    }
-}
-
-static void
-  TokenClass (void) /*@modifies nextToken@*/
-{
-  ltoken tokenClassToken;
-  lsymbol ttext = ltoken_getRawText (nextToken);
-
-  tokenClassToken = nextToken;
-
-  /* Discard token class keyword. */
-  nextToken = LCLScanNextToken ();
-
-  if (ttext == ltoken_getText (quantifierSymToken))
-    {
-      QuantifierSymToks ();
-      InitReduce (TOKENCLASS1);
-    }
-  else if (ttext == ltoken_getText (logicalOpToken))
-    {
-      LogicalOpToks ();
-      InitReduce (TOKENCLASS2);
-    }
-  else if (ttext == ltoken_getText (eqOpToken))
-    {
-      EqOpToks ();
-      InitReduce (TOKENCLASS3);
-    }
-  else if (ttext == ltoken_getText (equationSymToken))
-    {
-      EquationSymToks ();
-      InitReduce (TOKENCLASS4);
-    }
-  else if (ttext == ltoken_getText (eqSepSymToken))
-    {
-      EqSepSymToks ();
-      InitReduce (TOKENCLASS5);
-    }
-  else if (ttext == ltoken_getText (selectSymToken))
-    {
-      SelectSymToks ();
-      InitReduce (TOKENCLASS6);
-    }
-  else if (ttext == ltoken_getText (openSymToken))
-    {
-      OpenSymToks ();
-      InitReduce (TOKENCLASS7);
-    }
-  else if (ttext == ltoken_getText (sepSymToken))
-    {
-      SepSymToks ();
-      InitReduce (TOKENCLASS8);
-    }
-  else if (ttext == ltoken_getText (closeSymToken))
-    {
-      CloseSymToks ();
-      InitReduce (TOKENCLASS9);
-    }
-  else if (ttext == ltoken_getText (simpleIdToken))
-    {
-      SimpleIdToks ();
-      InitReduce (TOKENCLASS10);
-    }
-  else if (ttext == ltoken_getText (mapSymToken))
-    {
-      MapSymToks ();
-      InitReduce (TOKENCLASS11);
-    }
-  else if (ttext == ltoken_getText (markerSymToken))
-    {
-      MarkerSymToks ();
-      InitReduce (TOKENCLASS12);
-    }
-  else if (ttext == ltoken_getText (commentSymToken))
-    {
-            CommentSymToks ();
-      InitReduce (TOKENCLASS13);
-    }
-  else
-    {
-      LocalUserError (nextToken, "expected token classification");
-    }
-}
-
-static void
-QuantifierSymToks (void) /*@modifies nextToken@*/
-{
-  QuantifierSymTok ();
-  InitReduce (QUANTIFIERSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      QuantifierSymTok ();
-      InitReduce (QUANTIFIERSYMTOKS2);
-    }
-}
-
-static void
-LogicalOpToks (void) /*@modifies nextToken@*/
-{
-  LogicalOpTok ();
-  InitReduce (LOGICALOPTOKS1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      LogicalOpTok ();
-      InitReduce (LOGICALOPTOKS2);
-    }
-}
-
-static void
-EqOpToks (void) /*@modifies nextToken@*/
-{
-  EqOpTok ();
-  InitReduce (LRC_EQOPTOKS1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      EqOpTok ();
-      InitReduce (LRC_EQOPTOKS2);
-    }
-}
-
-static void
-EquationSymToks (void) /*@modifies nextToken@*/
-{
-  EquationSymTok ();
-  InitReduce (LRC_EQUATIONSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      EquationSymTok ();
-      InitReduce (LRC_EQUATIONSYMTOKS2);
-    }
-}
-
-static void
-EqSepSymToks (void) /*@modifies nextToken@*/
-{
-  EqSepSymTok ();
-  InitReduce (LRC_EQSEPSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      EqSepSymTok ();
-      InitReduce (LRC_EQSEPSYMTOKS2);
-    }
-}
-
-static void
-SelectSymToks (void) /*@modifies nextToken@*/
-{
-  SelectSymTok ();
-  InitReduce (SELECTSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      SelectSymTok ();
-      InitReduce (SELECTSYMTOKS2);
-    }
-}
-
-static void
-OpenSymToks (void) /*@modifies nextToken@*/
-{
-  OpenSymTok ();
-  InitReduce (OPENSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      OpenSymTok ();
-      InitReduce (OPENSYMTOKS2);
-    }
-}
-
-static void
-SepSymToks (void) /*@modifies nextToken@*/
-{
-  SepSymTok ();
-  InitReduce (SEPSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      SepSymTok ();
-      InitReduce (SEPSYMTOKS2);
-    }
-}
-
-static void
-CloseSymToks (void) /*@modifies nextToken@*/
-{
-  CloseSymTok ();
-  InitReduce (CLOSESYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      CloseSymTok ();
-      InitReduce (CLOSESYMTOKS2);
-    }
-}
-
-static void
-SimpleIdToks (void) /*@modifies nextToken@*/
-{ 
-  SimpleIdTok ();
-  InitReduce (SIMPLEIDTOKS1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      SimpleIdTok ();
-      InitReduce (SIMPLEIDTOKS2);
-    }
-}
-
-static void
-MapSymToks (void) /*@modifies nextToken@*/
-{
-  MapSymTok ();
-  InitReduce (MAPSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      MapSymTok ();
-      InitReduce (MAPSYMTOKS2);
-    }
-}
-
-static void
-MarkerSymToks (void) /*@modifies nextToken@*/
-{
-  MarkerSymTok ();
-  InitReduce (MARKERSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-      MarkerSymTok ();
-      InitReduce (MARKERSYMTOKS2);
-    }
-}
-
-static void
-CommentSymToks (void) /*@modifies nextToken@*/
-{
-  CommentSymTok ();
-    InitReduce (COMMENTSYMTOKS1);
-  
-  while (ltoken_getCode (nextToken) != LLT_EOL)
-    {
-            CommentSymTok ();
-            InitReduce (COMMENTSYMTOKS2);
-    }
-}
-
-static void
-QuantifierSymTok (void) /*@modifies nextToken@*/
-{
-  Token ();
-  InitReduce (QUANTIFIERSYMTOK1);
-}
-
-static void
-LogicalOpTok (void) /*@modifies nextToken@*/
-{
-  Token ();
-  InitReduce (LOGICALOPTOK1);
-}
-
-static void
-EqOpTok (void) /*@modifies nextToken@*/
-{
-  Token ();
-  InitReduce (LRC_EQOPTOK1);
-}
-
-static void EquationSymTok (void) /*@modifies nextToken@*/
-{
-  Token ();
-  InitReduce (LRC_EQUATIONSYMTOK1);
-}
-
-static void EqSepSymTok (void) /*@modifies nextToken@*/
-{
-  Token ();
-  InitReduce (LRC_EQSEPSYMTOK1);
-
-}
-
-static void SelectSymTok (void) /*@modifies nextToken@*/
-{
-  Token ();
-  InitReduce (SELECTSYMTOK1);
-}
-
-static void OpenSymTok (void) /*@modifies nextToken@*/
-{
-  Token ();
-  InitReduce (OPENSYMTOK1);
-}
-
-static void SepSymTok (void) /*@modifies nextToken@*/
-{
-  Token ();
-  InitReduce (SEPSYMTOK1);
-}
-
-static void CloseSymTok (void) /*@modifies nextToken@*/
-{
-  Token ();
-  InitReduce (CLOSESYMTOK1);
-}
-
-static void SimpleIdTok (void) /*@modifies nextToken@*/
-{
-  Token ();
-  InitReduce (SIMPLEIDTOK1);
-}
-
-static void
-MapSymTok (void) /*@modifies nextToken@*/
-{
-  Token ();
-  InitReduce (MAPSYMTOK1);
-}
-
-static void
-MarkerSymTok (void) /*@modifies nextToken@*/
-{
-  Token ();
-  InitReduce (MARKERSYMTOK1);
-
-}
-
-static void
-CommentSymTok (void) /*@modifies nextToken@*/
-{
-  Token ();
-  InitReduce (COMMENTSYMTOK1);
-}
-
-
-static void
-SynClass (void) /*@modifies nextToken@*/
-{
-  if (ltoken_getRawText (nextToken) == ltoken_getText (synonymToken))
-    {
-      nextToken = LCLScanNextToken ();
-
-      OldToken ();
-      NewToken ();
-
-      InitReduce (SYNCLASS1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "expected synonym classification");
-    }
-
-}
-
-static void
-OldToken (void) /*@modifies nextToken@*/
-{
-  Token ();
-  InitReduce (OLDTOKEN1);
-
-}
-
-static void
-NewToken (void) /*@modifies nextToken@*/
-{
-  Token ();
-  InitReduce (NEWTOKEN1);
-
-}
-
-static void
-Token (void) /*@modifies nextToken@*/
-{
-  if (ltoken_getCode (nextToken) == LLT_EOL
-      || ltoken_getCode (nextToken) == LEOFTOKEN)
-    {
-      LocalUserError (nextToken, "unexpected end-of-line or end-of-file");
-    }
-  else
-    {
-      LSLGenShift (nextToken);
-      nextToken = LCLScanNextToken ();
-    }
-}
-
-/*
-** Init File Processing Routines, these routines use the shift-reduce sequence
-** produced by the init file parser and update the necessary tables for the
-** scanner.
-**
-** The same shift stack is used that LSL parser uses.  A different reduce
-** procedure is used because the init file grammar is different from the LSL
-** grammar.
-*/
-
-static void
-InitReduce (LCLInitRuleCode rule) /*@modifies nextToken@*/
-{
-  switch (rule)
-    {
-    case INITFILE1:
-      TRACE ("INITFILE1");
-      break;
-      
-    case INITLINES1:
-      TRACE ("INITLINES1");
-      break;
-      
-    case INITLINES2:
-      TRACE ("INITLINES2");
-      break;
-
-    case INITLINES3:
-      TRACE ("INITLINES3");
-      break;
-
-    case INITLINE1:
-      TRACE ("INITLINE1");
-      break;
-
-    case INITLINE2:
-      TRACE ("INITLINE2");
-      break;
-
-    case CLASSIFICATION1:
-      TRACE ("CLASSIFICATION1");
-      break;
-
-    case CLASSIFICATION2:
-      TRACE ("CLASSIFICATION2");
-      break;
-
-    case CLASSIFICATION3:
-      TRACE ("CLASSIFICATION3");
-      break;
-
-    case CHARCLASS1:
-      TRACE ("CHARCLASS1");
-      break;
-
-    case CHARCLASS2:
-      TRACE ("CHARCLASS2");
-      break;
-
-    case CHARCLASS3:
-      TRACE ("CHARCLASS3");
-      break;
-
-    case CHARCLASS4:
-      TRACE ("CHARCLASS4");
-      break;
-
-    case CHARCLASS5:
-      TRACE ("CHARCLASS5");
-      break;
-
-    case CHARCLASS6:
-      TRACE ("CHARCLASS6");
-      break;
-
-    case LRC_ENDCOMMENT1:
-      TRACE ("LRC_ENDCOMMENT1");
-      break;
-
-    case LRC_ENDCOMMENT2:
-      TRACE ("LRC_ENDCOMMENT2");
-      break;
-
-    case IDCHARS1:
-      TRACE ("IDCHARS1");
-      break;
-
-    case IDCHARS2:
-      TRACE ("IDCHARS2");
-      break;
-
-    case OPCHARS1:
-      TRACE ("OPCHARS1");
-      break;
-
-    case OPCHARS2:
-      TRACE ("OPCHARS2");
-      break;
-
-    case LRC_EXTENSIONCHAR1:
-      TRACE ("LRC_EXTENSIONCHAR1");
-      ProcessExtensionChar ();
-      break;
-
-    case SINGCHARS1:
-      TRACE ("SINGCHARS1");
-      break;
-
-    case SINGCHARS2:
-      TRACE ("SINGCHARS2");
-      break;
-
-    case WHITECHARS1:
-      TRACE ("WHITECHARS1");
-      break;
-
-    case WHITECHARS2:
-      TRACE ("WHITECHARS2");
-      break;
-
-    case LRC_ENDCOMMENTCHAR1:
-      TRACE ("LRC_ENDCOMMENTCHAR1");
-      ProcessEndCommentChar ();
-      break;
-
-    case IDCHAR1:
-      TRACE ("IDCHAR1");
-      ProcessSingleChar (IDCHAR);
-      break;
-
-    case OPCHAR1:
-      TRACE ("OPCHAR1");
-      ProcessSingleChar (OPCHAR);
-      break;
-
-    case SINGCHAR1:
-      TRACE ("SINGCHAR1");
-      ProcessSingleChar (SINGLECHAR);
-      break;
-
-    case WHITECHAR1:
-      TRACE ("CHAR1");
-      ProcessSingleChar (WHITECHAR);
-      break;
-
-    case TOKENCLASS1:
-      TRACE ("TOKENCLASS1");
-      break;
-
-    case TOKENCLASS2:
-      TRACE ("TOKENCLASS2");
-      break;
-
-    case TOKENCLASS3:
-      TRACE ("TOKENCLASS3");
-      break;
-
-    case TOKENCLASS4:
-      TRACE ("TOKENCLASS4");
-      break;
-
-    case TOKENCLASS5:
-      TRACE ("TOKENCLASS5");
-      break;
-
-    case TOKENCLASS6:
-      TRACE ("TOKENCLASS6");
-      break;
-
-    case TOKENCLASS7:
-      TRACE ("TOKENCLASS7");
-      break;
-
-    case TOKENCLASS8:
-      TRACE ("TOKENCLASS8");
-      break;
-
-    case TOKENCLASS9:
-      TRACE ("TOKENCLASS9");
-      break;
-
-    case TOKENCLASS10:
-      TRACE ("TOKENCLASS10");
-      break;
-
-    case TOKENCLASS11:
-      TRACE ("TOKENCLASS11");
-      break;
-
-    case TOKENCLASS12:
-      TRACE ("TOKENCLASS12");
-      break;
-
-    case TOKENCLASS13:
-      TRACE ("TOKENCLASS13");
-      break;
-
-    case QUANTIFIERSYMTOKS1:
-      TRACE ("QUALIFERSYMTOKS1");
-      break;
-
-    case QUANTIFIERSYMTOKS2:
-      TRACE ("QUANTIFIERSYMTOKS2");
-      break;
-
-    case LOGICALOPTOKS1:
-      TRACE ("LOGICALOPTOKS1");
-      break;
-
-    case LOGICALOPTOKS2:
-      TRACE ("LOGICALOPTOKS2");
-      break;
-
-    case LRC_EQOPTOKS1:
-      TRACE ("LRC_EQOPTOKS1");
-      break;
-
-    case LRC_EQOPTOKS2:
-      TRACE ("LRC_EQOPTOKS2");
-      break;
-
-    case LRC_EQUATIONSYMTOKS1:
-      TRACE ("LRC_EQUATIONSYMTOKS1");
-      break;
-
-    case LRC_EQUATIONSYMTOKS2:
-      TRACE ("LRC_EQUATIONSYMTOKS2");
-      break;
-
-    case LRC_EQSEPSYMTOKS1:
-      TRACE ("LRC_EQSEPSYMTOKS1");
-      break;
-
-    case LRC_EQSEPSYMTOKS2:
-      TRACE ("LRC_EQSEPSYMTOKS2");
-      break;
-
-    case SELECTSYMTOKS1:
-      TRACE ("SELECTSYMTOKS1");
-      break;
-
-    case SELECTSYMTOKS2:
-      TRACE ("SELECTSYMTOKS2");
-      break;
-
-    case OPENSYMTOKS1:
-      TRACE ("OPENSYMTOKS1");
-      break;
-
-    case OPENSYMTOKS2:
-      TRACE ("OPENSYMTOKS2");
-      break;
-
-    case SEPSYMTOKS1:
-      TRACE ("SEPSYMTOKS1");
-      break;
-
-    case SEPSYMTOKS2:
-      TRACE ("SEPSYMTOKS2");
-      break;
-
-    case CLOSESYMTOKS1:
-      TRACE ("CLOSESYMTOKS1");
-      break;
-
-    case CLOSESYMTOKS2:
-      TRACE ("CLOSESYMTOKS2");
-      break;
-
-    case SIMPLEIDTOKS1:
-      TRACE ("SIMPLEIDTOKS1");
-      break;
-
-    case SIMPLEIDTOKS2:
-      TRACE ("SIMPLEIDTOKS2");
-      break;
-
-    case MAPSYMTOKS1:
-      TRACE ("MAPSYMTOKS1");
-      break;
-
-    case MAPSYMTOKS2:
-      TRACE ("MAPSYMTOKS2");
-      break;
-
-    case MARKERSYMTOKS1:
-      TRACE ("MARKERSYMTOKS1");
-      break;
-
-    case MARKERSYMTOKS2:
-      TRACE ("MARKERSYMTOKS2");
-      break;
-
-    case COMMENTSYMTOKS1:
-      TRACE ("COMMENTSYMTOKS1");
-      break;
-
-    case COMMENTSYMTOKS2:
-      TRACE ("COMMENTSYMTOKS2");
-      break;
-
-    case QUANTIFIERSYMTOK1:
-      TRACE ("QUANTIFERSYMTOK1");
-      ProcessToken (quantifierSym);
-      break;
-
-    case LOGICALOPTOK1:
-      TRACE ("LOGICALOPTOK1");
-      ProcessToken (logicalOp);
-      break;
-
-    case LRC_EQOPTOK1:
-      TRACE ("LRC_EQOPTOK1");
-      ProcessToken (eqOp);
-      break;
-
-    case LRC_EQUATIONSYMTOK1:
-      TRACE ("LRC_EQUATIONSYMTOK1");
-      ProcessToken (equationSym);
-      break;
-
-    case LRC_EQSEPSYMTOK1:
-      TRACE ("LRC_EQSEPSYMTOK1");
-      ProcessToken (eqSepSym);
-      break;
-
-    case SELECTSYMTOK1:
-      TRACE ("SELECTSYMTOK1");
-      ProcessToken (selectSym);
-      break;
-
-    case OPENSYMTOK1:
-      TRACE ("OPENSYMTOK1");
-      ProcessToken (openSym);
-      break;
-
-    case SEPSYMTOK1:
-      TRACE ("SEPSYMTOK1");
-      ProcessToken (sepSym);
-      break;
-
-    case CLOSESYMTOK1:
-      TRACE ("CLOSESYMTOK1");
-      ProcessToken (closeSym);
-      break;
-
-    case SIMPLEIDTOK1:
-      TRACE ("SIMPLEIDTOK1");
-      ProcessToken (simpleId);
-      break;
-
-    case MAPSYMTOK1:
-      TRACE ("MAPSYMTOK1");
-      ProcessToken (mapSym);
-      break;
-
-    case MARKERSYMTOK1:
-      TRACE ("MARKERSYMTOK1");
-      ProcessToken (markerSym);
-      break;
-
-    case COMMENTSYMTOK1:
-      TRACE ("COMMENTSYMTOK1");
-      ProcessToken (commentSym);
-      break;
-
-    case SYNCLASS1:
-      TRACE ("SYNCLASS1");
-      ProcessSynonym ();
-      break;
-
-    case OLDTOKEN1:
-      TRACE ("OLDTOKEN1");
-      break;
-
-    case NEWTOKEN1:
-      TRACE ("NEWTOKEN1");
-      break;
-
-    default:
-      llcontbuglit ("InitReduce: bad case");
-      break;
-    }
-}	
-
-/*
-** Reset the first character of the predefined extensionChar keywords when  
-** the extensionChar changes.  e.g. "extensionChar @" changes "\forall" to  
-** "@forall".								    
-*/
-
-static void
-UpdateXCharKeywords (charCode xChar)
-{
-  char *str;
-  char xchar = (char)xChar;
-
-  str = ltoken_getTextChars (ltoken_forall);
-  *str = xchar;
-
-  str = ltoken_getTextChars (ltoken_and);
-  *str = xchar;
-
-  str = ltoken_getTextChars (ltoken_or);
-  *str = xchar;
-
-  str = ltoken_getTextChars (ltoken_implies);
-  *str = xchar;
-
-  str = ltoken_getTextChars (ltoken_eq);
-  *str = xchar;
-
-  str = ltoken_getTextChars (ltoken_neq);
-  *str = xchar;
-
-  str = ltoken_getTextChars (ltoken_equals);
-  *str = xchar;
-
-  str = ltoken_getTextChars (ltoken_eqsep);
-  *str = xchar;
-
-  str = ltoken_getTextChars (ltoken_select);
-  *str = xchar;
-
-  str = ltoken_getTextChars (ltoken_open);
-  *str = xchar;
-
-  str = ltoken_getTextChars (ltoken_sep);
-  *str = xchar;
-
-  str = ltoken_getTextChars (ltoken_close);
-  *str = xchar;
-
-  str = ltoken_getTextChars (ltoken_id);
-  *str = xchar;
-
-  str = ltoken_getTextChars (ltoken_arrow);
-  *str = xchar;
-
-  str = ltoken_getTextChars (ltoken_marker);
-  *str = xchar;
-
-  str = ltoken_getTextChars (ltoken_comment);
-  *str = xchar;
-}
-
-/* Different from ProcessCharClass because only allow one extension	    */
-/* character. Therefore, the present extension character must be set to a   */
-/* singleChar.								    */
-
-static void
-ProcessExtensionChar (void)
-{
-  ltoken stackToken = LSLGenTopPopShiftStack ();
-  char firstChar = cstring_firstChar (ltoken_unparse (stackToken));
-
-  if (!defineSingleChar[(int)firstChar]
-      && ltoken_isSingleChar (firstChar))
-    {
-      /*
-      ** Is a single character that has not been defined before.	   
-      ** Can only have one extension char.  Release old one. 
-      */
-
-      LCLSetCharClass (firstChar, CHC_EXTENSION);
-      LCLSetCharClass ((char) currentExtensionChar, SINGLECHAR);
-      currentExtensionChar = (charCode) firstChar;
-      UpdateXCharKeywords (currentExtensionChar);
-    }
-  else
-    {
-      /* Already redefined.  Don't allow to be redefined. */
-      LocalUserError (stackToken, "Character is already defined, cannot redefine");
-    }
-
-  ltoken_free (stackToken);
-}
-
-/* Different from ProcessSingleChar because allow any characters to be	    */
-/* endCommentChar and also set a different part of the scanner structure.   */
-
-static void
-ProcessEndCommentChar (void)
-{
-  ltoken stackToken = LSLGenTopPopShiftStack ();
-  char firstChar = cstring_firstChar (ltoken_unparse (stackToken));
-
-  if (LCLIsEndComment (firstChar))
-    {
-      LocalUserError (stackToken,
-		    "already defined as a endCommentChar, cannot redefine");
-    }
-  else
-    {
-      LCLSetEndCommentChar (firstChar, TRUE);
-    }
-  ltoken_free (stackToken);
-}
-
-static void
-ProcessSingleChar (charCode code)
-{
-  ltoken stackToken = LSLGenTopPopShiftStack ();
-  char firstChar = cstring_firstChar (ltoken_unparse (stackToken));
-
-  if (!defineSingleChar[(int)firstChar]
-      && ltoken_isSingleChar (firstChar))
-    {
-      /* Is a single character that has not been defined before.	    */
-      /* It's OK to redefine once. */
-      LCLSetCharClass (firstChar, code);
-      /* OK to mark as a defined singleChar even if not.  Only check	    */
-      /* defineSingleChar[] if defining a singleChar.			    */
-      defineSingleChar[(int)(firstChar)] = TRUE;
-    }
-  else
-    {
-      LocalUserError (stackToken, "Character is already defined, cannot redefine");
-    }
-  
-  ltoken_free (stackToken);
-}
-
-static void
-ProcessToken (ltokenCode code)
-{
-  ltoken stackToken, ptok;
-
-  stackToken = LSLGenTopPopShiftStack ();
-
-  
-  if (LCLIsSyn (ltoken_getText (stackToken)))
-    {
-      LocalUserError (stackToken, "already defined as a synonym, cannot redefine");
-    }
-
-  /*
-  ** Get the token from the token table, so can check if the token    
-  ** was updated by a previous token.				    
-  */
-
-  ptok = LCLGetToken (ltoken_getText (stackToken));
-
-  if (ltoken_isStateDefined (ptok))
-    {
-            LocalUserError (stackToken, "already defined, cannot redefine");
-    }
-
-    LCLUpdateToken (code, ltoken_getText (stackToken), TRUE);
-  ltoken_free (stackToken);
-}
-
-
-static void
-ProcessSynonym (void)
-{
-  ltoken newtok;
-  ltoken oldtok;
-
-  
-  newtok = LSLGenTopPopShiftStack ();
-  oldtok = LSLGenTopPopShiftStack ();
-
-  
- /* ignore synonyms: Bool -> bool
-    and:             bool -> Bool */
- /*
-     if ((ltoken_getText (newtok) == lsymbol_Bool ||
-          ltoken_getText (newtok) == lsymbol_bool) &&
-         (ltoken_getText (oldtok) == lsymbol_Bool ||
-          ltoken_getText (oldtok) == lsymbol_bool)) return;
- */
-
-  if (ltoken_wasSyn (newtok))
-    {
-     /*
-     ** The token has a synonym.  This means that the synonym was in the 
-     ** init file, so complain about redefining as a synonym again	 
-     */
-
-      LocalUserError (newtok, "already is a synonym, cannot redefine");
-    }
-
-  if (ltoken_hasSyn (newtok))
-    {
-      /*
-      ** newtok already has a synonym defined for it.  Do not allow	   
-      ** synonyms to be chained.					    
-      */
-
-      LocalUserError (newtok,
-		      "newtok already has a synonym, cannot chain synonyms");
-    }
-
-  if (ltoken_isStateDefined (newtok))
-    {
-      LocalUserError (newtok, "newtok already defined, cannot redefine");
-    }
-
-    LCLAddSyn (ltoken_getText (newtok), ltoken_getText (oldtok));
-
-  ltoken_free (newtok);
-  ltoken_free (oldtok); 
-}
-
-
-/*
-** Utilities, in alphabetical order
-*/
-
-static void
-  LocalUserError (ltoken t, char *msg)
-{
-  lclplainerror (message ("%s %s in the LCL init file.  Ignoring line.", 
-			  ltoken_unparse (t), cstring_fromChars (msg)));
-
-  /* discard the whole current line */
-
-  nextToken = LCLScanNextToken ();		/* Discard bad token	*/
-
-  while (ltoken_getCode (nextToken) != LLT_EOL 
-	 && ltoken_getCode (nextToken) != LEOFTOKEN)
-    {
-      nextToken = LCLScanNextToken ();
-    }
-}
-
-
-/*
- *  Required initialization and cleanup routines
- */
-
-void
-LCLProcessInitFileInit (void)
-{
-  int i;
-
-  LSLGenInit (FALSE);		/* parsing LCLinit, not LSLinit */
-  
-  /*
-  ** Insert the init file keywords into the token table as undefined	    
-  ** SIMPLEIDs.  They are defined as simpleIds since they must be treated 
-  ** that way if they do not appear as the first token on a line, and	    
-  ** they must be treated that way for the actual LSL parsing. Save the   
-  ** tokens so can recognize as init file keywords when necessary.	    
-  */
-
-  endCommentCharToken = insertSimpleToken ("endCommentChar");
-  idCharToken = insertSimpleToken ("idChar");
-  opCharToken = insertSimpleToken ("opChar");
-  extensionCharToken = insertSimpleToken ("extensionChar");
-  singleCharToken = insertSimpleToken ("singleChar");
-  whiteCharToken = insertSimpleToken ("whiteChar");
-
-  quantifierSymToken = insertSimpleToken ("quantifierSym");
-  logicalOpToken = insertSimpleToken ("logicalOp");
-  eqOpToken = insertSimpleToken ("eqOp");
-  equationSymToken = insertSimpleToken ("equationSym");
-  eqSepSymToken = insertSimpleToken ("eqSepSym");
-  selectSymToken = insertSimpleToken ("selectSym");
-  openSymToken = insertSimpleToken ("openSym");
-  sepSymToken = insertSimpleToken ("sepSym");
-  closeSymToken = insertSimpleToken ("closeSym");
-  simpleIdToken = insertSimpleToken ("simpleId");
-  mapSymToken = insertSimpleToken ("mapSym");
-  markerSymToken = insertSimpleToken ("markerSym");
-  commentSymToken = insertSimpleToken ("commentSym");
-
-  synonymToken = insertSimpleToken ("synonym");
-
-  /*
-  ** Initialize defineSingleChar array to all FALSE to signal that no	    
-  ** characters have been redefined as singleChar. 
-  */
-
-  for (i = 0; i <= LASTCHAR; i++)
-    {
-      defineSingleChar[i] = FALSE;
-    }
-
-  /* 
-  ** Record the current extension character so can redefine back to	    
-  ** singleChar if a new extension character is redefined.		    
-  */
-
-  currentExtensionChar = (charCode) CHAREXTENDER;
-  
-  /* Init file processing needs to have EOL reported. */
-
-  LCLReportEolTokens (TRUE);
-
-  /* Not: context_getBoolName () */
-
-  LCLAddSyn (lsymbol_fromChars ("Bool"),
-	     lsymbol_fromChars ("bool"));
-}
-
-void
-LCLProcessInitFileReset (void)
-{
-  nextToken = LCLScanNextToken ();	  
-}
-
-void
-LCLProcessInitFileCleanup (void)
-{
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/src/lcllib.c b/src/lcllib.c
deleted file mode 100644
index a7a5140..0000000
--- a/src/lcllib.c
+++ /dev/null
@@ -1,565 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** lcllib.c
-**
-** routines for loading and creating library files
-**
-** this is a brute-force implementation, a more efficient
-** representation should be designed.
-**
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-# include "osd.h"
-
-# ifndef NOLCL
-# include "gram.h"
-
-# include "lclscan.h"
-# endif
-
-
-# include "herald.h"
-# include "lcllib.h"
-# include "llmain.h"
-# include "portab.h"
-
-/*@-incondefs@*/ /*@-redecl@*/
-extern /*@dependent@*/ FILE *yyin;
-/*@=incondefs@*/ /*@=redecl@*/
-
-/*@constant int NUMLIBS; @*/
-# define NUMLIBS 17
-
-/*@constant int NUMPOSIXLIBS; @*/
-# define NUMPOSIXLIBS 12
-
-static ob_mstring posixlibs[NUMPOSIXLIBS] = 
-{
-  "sys/stat",
-  "sys/types",
-  "dirent",
-  "fcntl",
-  "grp",
-  "pwd",
-  "sys/times",
-  "sys/utsname",
-  "sys/wait",
-  "termios",
-  "unistd",
-  "utime"
-} ;
-
-static ob_mstring stdlibs[NUMLIBS] =
-{
-  "assert", 
-  "ctype",
-  "errno",
-  "float", 
-  "limits",
-  "locale",
-  "math", 
-  "setjmp",
-  "signal",
-  "stdarg",
-  "stddef",
-  "stdio",
-  "stdlib",
-  "strings", 
-  "string",
-  "time",
-  "wchar"
-} ;
-
-static bool loadStateFile (FILE * p_f, cstring p_name);
-
-bool
-lcllib_isSkipHeader (cstring sname)
-{
-  int i;
-  bool posixlib = FALSE;
-  char *libname;
-  char *name = cstring_toCharsSafe (sname);
-  char *matchname;
-
-  llassert (cstring_isDefined (sname));
-  name = removeExtension (name, ".h");
-
-  libname = strrchr (name, CONNECTCHAR);
-  matchname = libname;
-
-  if (libname == NULL) 
-    {
-      libname = name;
-    }
-  else
-    {
-      libname++;
-      /*@-branchstate@*/
-    }
-  /*@=branchstate@*/
-
-  if (mstring_equal (libname, "varargs"))
-    {
-      fileloc tmp = fileloc_makePreprocPrevious (g_currentloc);
-      
-      voptgenerror 
-	(FLG_USEVARARGS,
-	 message ("Include file <%s> is inconsistent with "
-		  "ANSI library (should use )",
-		  cstring_fromChars (libname)),
-	 tmp);
-      
-      fileloc_free (tmp);
-      sfree (name);
-      return TRUE;
-    }
-
-  if (context_getFlag (FLG_SKIPANSIHEADERS)
-      && context_usingAnsiLibrary ())
-    {
-      
-      for (i = 0; i < NUMLIBS; i++)
-	{
-	  if (mstring_equal (libname, stdlibs[i]))
-	    {
-	      sfree (name);
-	      return TRUE;
-	    }
-	}
-    }
-
-  for (i = 0; i < NUMPOSIXLIBS; i++)
-    {
-      if (strchr (posixlibs[i], CONNECTCHAR) != NULL)
-	{
-	  char *ptr;
-	  
-	  if ((ptr = strstr (name, posixlibs[i])) != NULL) 
-	    {
-	      if (ptr[strlen (posixlibs[i])] == '\0')
-		{
-		  posixlib = TRUE;
-		  matchname = ptr;
-		  break;
-		}
-	      else
-		{
-		  ; /* no match */
-		}
-	    }
-	}
-      else
-	{
-	  if (mstring_equal (libname, posixlibs[i]))
-	    {
-	      posixlib = TRUE;
-	      matchname = libname;
-	      break;
-	    }
-	  /*@-branchstate@*/ 
-	}
-    } /*@=branchstate@*/
-  
-  if (posixlib)
-    {
-      if (context_usingPosixLibrary ())
-	{
-	  if (context_getFlag (FLG_SKIPPOSIXHEADERS))
-	    {
-	      sfree (name);
-	      return TRUE;
-	    }
-	}
-      else
-	{	
-	  fileloc tmp = fileloc_makePreprocPrevious (g_currentloc);	      
-	  
-	  voptgenerror 
-	    (FLG_WARNPOSIX,
-	     message ("Include file <%s> matches the name of a "
-		      "POSIX library, but the POSIX library is "
-		      "not being used.  Consider using +posixlib "
-		      "or +posixstrictlib to select the POSIX "
-		      "library, or -warnposix "
-		      "to suppress this message.",
-		      cstring_fromChars (matchname)),
-	     tmp);
-	  
-	  fileloc_free (tmp);
-	}
-    }
-
-  sfree (name);
-  return FALSE;
-}
-
-static void printDot (void)
-{
-  if (context_getFlag (FLG_SHOWSCAN)) 
-    {
-      (void) fflush (g_msgstream);
-      fprintf (stderr, "."); 
-      (void) fflush (stderr);
-    }
-}
-
-void
-dumpState (cstring cfname)
-{
-  FILE *f;
-  char *fname = cstring_toCharsSafe (cfname);
-  
-  fname = addExtension (fname, DUMP_SUFFIX);
-  
-  f = fopen (fname, "w");
-
-  if (context_getFlag (FLG_SHOWSCAN))
-    {
-      fprintf (stderr, "< Dumping to %s ", fname); 
-    }
-  
-  if (f == NULL)
-    {
-      llgloberror (message ("Cannot open dump file for writing: %s", cfname));
-    }
-  else
-    {
-      /*
-      ** sequence is convulted --- must call usymtab_prepareDump before
-      **    dumping ctype table to convert type uid's
-      */
-
-      printDot ();
-
-      usymtab_prepareDump ();
-
-      /*
-      ** Be careful, these lines must match loadStateFile checking.
-      */
-
-      fprintf (f, ";;LCLint Dump: %s\n", fname);
-      fprintf (f, ";;%s\n", LCL_VERSION);
-      fprintf (f, ";;lib:%d\n", (int) context_getLibrary ());
-      fprintf (f, ";;ctTable\n");
-
-      printDot ();
-            ctype_dumpTable (f);
-      printDot ();
-
-      fprintf (f, ";;tistable\n");
-      typeIdSet_dumpTable (f);
-      printDot ();
-
-            fprintf (f, ";;symTable\n");
-      usymtab_dump (f);
-      printDot ();
-
-      fprintf (f, ";; Modules access\n");
-      context_dumpModuleAccess (f);
-      fprintf (f, ";;End\n");
-      check (fclose (f) == 0);
-    }
-
-  if (context_getFlag (FLG_SHOWSCAN))
-    {
-      fprintf (g_msgstream, " >\n");
-    }
-
-  sfree (fname);
-}
-
-bool
-loadStandardState ()
-{
-  char *fpath;
-  FILE *stdlib;
-  bool result;
-  char *libname = addExtension (context_selectedLibrary (), DUMP_SUFFIX);
-  
-  
-  if (osd_findOnLarchPath (libname, &fpath) != OSD_FILEFOUND)
-    {
-      lldiagmsg (message ("Cannot find %sstandard library: %s", 
-			  cstring_makeLiteralTemp 
-			  (context_getFlag (FLG_STRICTLIB) ? "strict " 
-			   : (context_getFlag (FLG_UNIXLIB) ? "unix " : "")),
-			  cstring_makeLiteralTemp (libname)));
-      lldiagmsg (cstring_makeLiteral ("     Check LARCH_PATH environment variable."));
-      result = FALSE;
-    }
-  else
-    {
-      stdlib = fopen (fpath, "r");
-
-      if (stdlib == NULL)
-	{
-	  lldiagmsg (message ("Cannot read standard library: %s",
-			  cstring_fromChars (fpath)));
-	  lldiagmsg (cstring_makeLiteral ("     Check LARCH_PATH environment variable."));
-
-	  result = FALSE;
-	}
-      else
-	{
-	  if (context_getFlag (FLG_WHICHLIB))
-	    {
-	      char *t = mstring_create (MAX_NAME_LENGTH);
-	      char *ot = t;
-
-	      if (fgets (t, MAX_NAME_LENGTH, stdlib) == NULL)
-		{
-		  llfatalerror (cstring_makeLiteral ("Standard library format invalid"));
-		}
-
-	      if (fgets (t, MAX_NAME_LENGTH, stdlib) != NULL)
-		{
-		  if (*t == ';' && *(t + 1) == ';') 
-		    {
-		      t += 2;
-		    }
-		}
-
-	      if (t == NULL)
-		{
-		  lldiagmsg (message ("Standard library: %s ", 
-				  cstring_fromChars (fpath)));
-		}
-	      else
-		{
-		  char *tt;
-
-		  tt = strrchr (t, '\n');
-		  if (tt != NULL)
-		    *tt = '\0';
-
-		  lldiagmsg (message ("Standard library: %s", cstring_fromChars (fpath)));
-		  lldiagmsg (message ("   (created using %s)", cstring_fromChars (t)));
-		}
-
-	      sfree (ot);
-	      
-	      check (fclose (stdlib) == 0);
-	      stdlib = fopen (fpath, "r");
-	    }
-
-	  llassert (stdlib != NULL);
-
-	  fileloc_reallyFree (g_currentloc);
-	  g_currentloc = fileloc_createLib (cstring_makeLiteralTemp (libname));
-
-	  if (context_getDebug (FLG_SHOWSCAN))
-	    {
-	      context_hideShowscan ();
-	      result = loadStateFile (stdlib, cstring_fromChars (fpath));
-	      context_unhideShowscan ();
-	    }
-	  else
-	    {
-	      result = loadStateFile (stdlib, cstring_fromChars (fpath));
-	    }
-
-	  check (fclose (stdlib) == 0);
-	}
-    }
-
-  sfree (libname);
-  return result;
-}
-
-/*@constant int BUFLEN;@*/
-# define BUFLEN 128
-
-static bool
-loadStateFile (FILE *f, cstring name)
-{
-  char buf[BUFLEN];
-  
-  /*
-  ** Check version.  Should be >= LCL_MIN_VERSION
-  */
-
-  if ((fgets (buf, BUFLEN, f) == NULL)
-      || !mstring_equalPrefix (buf, ";;LCLint Dump:"))
-    {
-      loadllmsg (message ("Load library %s is not in LCLint library format.  Attempting "
-		      "to continue without library.", name));
-      return FALSE;
-    }
-  
-  if (fgets (buf, BUFLEN, f) != NULL)
-    {
-      if (!mstring_equalPrefix (buf, ";;"))
-	{
-	  loadllmsg (message ("Load library %s is not in LCLint library format.  Attempting "
-			  "to continue without library.", name));
-	  return FALSE;
-	}
-      else if (mstring_equalPrefix (buf, ";;ctTable"))
-	{
-	  loadllmsg (message ("Load library %s is in obsolete LCLint library format.  Attempting "
-			  "to continue anyway, but results may be incorrect.  Rebuild "
-			  "the library with this version of lclint.", 
-			  name));
-	}
-      else 
-	{
-	  float version = 0.0;
-
-	  if (sscanf (buf, ";;LCLint %f", &version) != 1)
-	    {
-	      loadllmsg (message ("Load library %s is not in LCLint library format (missing version "
-			      "number).  Attempting "
-			      "to continue without library.", name));
-	      return FALSE;
-	    }
-	  else
-	    {
-	      if ((LCL_MIN_VERSION - version) >= FLT_EPSILON)
-		{
-		  cstring vname;
-		  char *nl = strchr (buf, '\n');
-
-		  *nl = '\0';
-
-		  vname = cstring_fromChars (buf + 9);
-
-		  loadllmsg (message ("Load library %s is in obsolete LCLint library "
-				      "format (version %s).  Attempting "
-				      "to continue anyway, but results may be incorrect.  Rebuild "
-				      "the library with this version of lclint.", 
-				      name, vname));
-		}
-	      else
-		{
-		  if ((fgets (buf, BUFLEN, f) == NULL))
-		    {
-		      loadllmsg (message ("Load library %s is not in LCLint library "
-					  "format (missing library code). Attempting "
-					  "to continue without library.", name));
-		      return FALSE;
-		    }
-		  else 
-		    {
-		      int lib;
-		      
-		      if (sscanf (buf, ";;lib:%d", &lib) != 1)
-			{
-			  loadllmsg (message ("Load library %s is not in LCLint library "
-					      "format (missing library code). Attempting "
-					      "to continue without library.", name));
-			  return FALSE;
-			}
-		      else
-			{
-			  flagcode code = (flagcode) lib;
-
-			  if (flagcode_isLibraryFlag (code))
-			    {
-			      if (context_doMerge ()) 
-				{
-				  context_setLibrary (code);
-				}
-			    }
-			  else
-			    {
-			      loadllmsg (message ("Load library %s has invalid library code.  "
-						  "Attempting to continue without library.",
-						  name));
-			      
-			      return FALSE;
-			    }
-			}
-		    }
-		}
-	    }
-	}
-    }
-  else
-    {
-      loadllmsg (message ("Load library %s is not in LCLint library format (missing lines).  "
-			  "Attempting to continue without library.", name));
-      return FALSE;
-    }
-  
-  ctype_loadTable (f);
-  printDot ();
-  
-  typeIdSet_loadTable (f);
-  printDot ();
-  
-  usymtab_load (f);
-  printDot ();
-  
-  context_loadModuleAccess (f);
-  printDot ();
-  
-  return TRUE;
-}
-
-/*
-** load state from file created by dumpState
-*/
-
-void
-loadState (cstring cfname)
-{
-  FILE *f;
-  char *fname = cstring_toCharsSafe (cfname);
-  cstring ofname = cstring_copy (cfname);
-
-  fname = addExtension (fname, DUMP_SUFFIX);
-
-  f = fopen (fname, "r");
-
-  if (f == NULL)
-    {
-      if (context_getDebug (FLG_SHOWSCAN))
-	fprintf (g_msgstream, " >\n");
-
-      llfatalerror (message ("Cannot open dump file for loading: %s", cfname));
-    }
-  else
-    {
-      fileloc_reallyFree (g_currentloc);
-      g_currentloc = fileloc_createLib (ofname);
-
-      if (!loadStateFile (f, ofname)) 
-	{
-	  if (!loadStandardState ()) 
-	    {
-	      ctype_initTable ();
-	    }
-	}
-      
-      check (fclose (f) == 0);
-    }
-
-  cstring_free (ofname);
-  sfree (fname);
-}
-
diff --git a/src/lclscan.c b/src/lclscan.c
deleted file mode 100644
index 86abdd9..0000000
--- a/src/lclscan.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** lclscan.c
-**
-** Deliver tokens one at a time
-**
-**	METHOD:
-**	The input arrives via LSLScanFreshToken ().
-**	The output is reported via LSLScanNextToken ().
-**
-**	The tokens are built in module ScanLine.
-**	The tokens are delivered from this module.
-**	Meantimes, they are saved in a static array.
-**
-**	The tokenizing is split off from the delivery of tokens
-**	to facilitate incremental scanning at a later date.
-**	The essential is that scanline () can be called or not
-**	if the input text is dirty or not.  Clean lines cause
-**	tokens to be played out from the saved token list (not
-**	yet implemented in this version).
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@-redecl@*/ /* from llgrammar.y */
-extern bool g_inTypeDef;
-/*@=redecl@*/
-
-/*@ignore@*/
-# include "llgrammar2.h" /* hack to force real include */
-/*@end@*/
-
-# include "lclscan.h"
-# include "scanline.h"
-# include "lclscanline.h"
-# include "lcltokentable.h"
-
-static tsource *scanFile;	/* file to scan		*/
-static o_ltoken TokenList[MAXLINE];	/* available tokens	*/
-static bool restore = FALSE;      /* wasn't static! */
-static YYSTYPE restoretok;
-static int nextToken;	        /* next available token */
-static int lastToken;		/* next available slot	*/
-
-static /*@dependent@*/ /*@null@*/ char *line;  /* input text */
-static unsigned int lineNumber;	               /* current line number */
-
-ltokenCode yllex (void)
-  /*@globals killed restoretok@*/ 
-{
-  lsymbol tokenSym;
-
-  if (restore)
-    {
-      yllval = restoretok;
-      restore = FALSE;
-    }
-  else
-    {
-      yllval.ltok = ltoken_copy (LCLScanNextToken ());
-    }
-
-  tokenSym = ltoken_getText (yllval.ltok);
-
-  if (ltoken_getCode (yllval.ltok) == simpleId)
-    {
-      if (g_inTypeDef)
-	{
-	  ltoken_setCode (yllval.ltok, LLT_TYPEDEF_NAME);
-	  LCLUpdateToken (LLT_TYPEDEF_NAME, tokenSym, 
-			  ltoken_isStateDefined (yllval.ltok));
-	}
-      else
-	{
-	 /* or if it is already declared as a type, so
-            typedef int foo; typedef foo bar;      works*/
-	  if (symtable_exists (g_symtab, tokenSym))
-	    {
-	      if (typeInfo_exists (symtable_typeInfo (g_symtab, tokenSym)))
-		{
-		  ltoken_setCode (yllval.ltok, LLT_TYPEDEF_NAME);
-		  LCLUpdateToken (LLT_TYPEDEF_NAME, tokenSym, 
-				  ltoken_isStateDefined (yllval.ltok));
-		}
-	    }
-	}
-    }
-
-  return (ltoken_getCode (yllval.ltok));
-}
-
-/* useful for scanning LCL init files and LSL init files ? */
-
-/*@dependent@*/ ltoken
-LCLScanNextToken (void)
-{
-  ltoken ret;
-
-  if (nextToken < lastToken)
-    {			
-      ret = TokenList[nextToken++];
-    }
-  else
-    {
-      lastToken = 0;
-      lineNumber++;
-      line = tsource_nextLine (scanFile);	
-
-      if (line != (char *) 0)
-	{
-	  
-	  LCLScanLine (line);	
-	  nextToken = 0;
-	  ret = LCLScanNextToken ();	
-	  return ret;
-	}
-      else
-	{
-	  ret = LCLScanEofToken ();
-	}
-    }
-
-
-    return ret;
-}
-
-static /*@exposed@*/ /*@dependent@*/ ltoken
-LCLScanLookAhead (void)
-{
-  if (nextToken < lastToken)
-    {			
-      return TokenList[nextToken];
-    }
-  else
-    {
-      lastToken = 0;	
-      line = tsource_nextLine (scanFile);
-      if (line != (char *) 0)
-	{
-	  LCLScanLine (line);	
-	  nextToken = 0;	
-	  return LCLScanLookAhead ();
-	}
-      else
-	{
-	  return LCLScanEofToken ();	
-	}
-    }
-}
-
-void
-LCLScanFreshToken (/*@only@*/ ltoken tok)
-{
-  if (lastToken < MAXLINE)
-    {		
-      TokenList[lastToken++] = tok;
-    }
-  else
-    {
-      llbugexitlit ("LCLScanFreshToken: out of range");
-    }
-}
-
-tsource *LCLScanSource (void)
-{
-  return scanFile;
-}
-
-
-void
-LCLScanInit (void)
-{
-}
-
-void
-LCLScanReset (tsource * s)
-{
-  scanFile = s;
-  lastToken = 0;
-  nextToken = lastToken + 1;	
-  lineNumber = 0;
-}
-
-void
-LCLScanCleanup (void)
-{
-}
-
-
diff --git a/src/lclscanline.c b/src/lclscanline.c
deleted file mode 100644
index 0500b50..0000000
--- a/src/lclscanline.c
+++ /dev/null
@@ -1,1945 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** scanline.c
-**
-**  MODULE DESCRIPTION:
-**
-**	This module scans one line of Larch C Interface Language (LCL) input at
-**	a time.
-**
-**	The input is source text, line at a time.   The output is a sequence
-**	of tokens, reported by call-out LSLScanFreshToken.
-**
-**	This organization allows implementation of line-at-a-time incremental
-**	scanning.  The incremental mechanism is in the driving module scan.c.
-**
-**	The main loop of the scanner keys on the leading character.
-**	Within the loop are actions which collect the rest of the
-**	token starting with the character.  Various careful hacks
-**	show up to disambiguate tokens that break the general pattern
-**	(Examples, \/ and /\).  White space is passed and the loop
-**	goes once again without calling LSLScanFreshToken ().
-**	The line ends with a null.
-**
-**  AUTHORS:
-**
-**    JPW, GAF, Yang Meng Tan
-*/
-
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "gram.h"
-# include "lclscan.h"
-# include "scanline.h"
-# include "lclscanline.h"
-# include "lcltokentable.h"
-# include "lclsyntable.h"
-
-/*@constant int CHARSIZE;@*/
-# define CHARSIZE    256		/* on an 8-bit machine  */
-
-/*@notfunction@*/
-# define LCLMOVECHAR() \
-   do { *bufPtr++ = currentChar; currentChar = *currentLine++; \
-	colNumber++; } while (FALSE)
-
-/*@notfunction@*/
-# define LOOKAHEADCHAR()      (*currentLine)
-
-/*@notfunction@*/
-# define LOOKAHEADTWICECHAR() (*(currentLine + 1))
-
-/*@constant static int MAXCHAR;@*/
-# define MAXCHAR     512	/* storage for a lexeme     */
-
-/*
-** Printname for the TokenCode NOTTOKEN   (also 1st one reserved)
-** Printname for the TokenCode BADTOKEN   (also last one reserved)
-*/
-
-/*@constant static observer char *FIRSTRESERVEDNAME;@*/
-# define FIRSTRESERVEDNAME "?"
-
-/*
-** The scanner establishes lexical boundaries by first switching	    
-** on the leading character of the pending lexeme.			    
-*/
-
-typedef enum
-{
-  STARTCNUM,			/* First character of a C number. */
-  STARTCNUMDOT,			/* "." only starts a C number if digit follows*/
-  STARTCSTR,			/* First character of a C string. */
-  STARTCCHAR,			/* First character of a C character. */
-  STARTWIDE,			/* slash L starts both string and character. */
-  STARTSLASH,			/* "/" starts caret, comment comment, operator */
-  STARTOTHER			/* Everything else. */
-} StartCharType;
-
-static void ScanCComment (void);
-static void ScanEscape (void);
-static void ScanCString (void);
-static void ScanCChar (void);
-static void ScanCNumber (void);
-static void LocalUserError (/*@temp@*/ char *);
-
-/*
-** Array to store character class defintions and record end-of-comment	    
-** characters.								    
-*/
-
-static charClassData LCLcharClass[LASTCHAR + 1];
-
-/*
-** Data shared between routines LCLScanLine, ScanCString, ScanCChar,	    
-** ScanCNumber.  LCLScanLine was getting too big for one routine and	    
-** passing this data was rather cumbersome.  Making this data global seemed 
-** to be the simpliest solution.					    
-*/
-
-/* evs - sounds bogus to me! */
-
-static unsigned int colNumber;	
-static unsigned int startCol;	
-static char *currentLine;      
-static char currentChar;	
-static ltokenCode tokenCode;	
-static lsymbol tokenSym;	
-static char *bufPtr;		
-
-static bool inComment;	
-static /*@only@*/ ltoken commentTok;	
-static ltokenCode prevTokenCode; /* to disambiguate '        */
-
-static StartCharType startClass[CHARSIZE] =
-{
-  STARTOTHER,			/*	^@			    00x */
-  STARTOTHER,			/*	^a			    01x */
-  STARTOTHER,			/*	^b			    02x */
-  STARTOTHER,			/*	^c			    03x */
-  STARTOTHER,			/*	^d			    04x */
-  STARTOTHER,			/*	^e			    05x */
-  STARTOTHER,			/*	^f			    06x */
-  STARTOTHER,			/*	^g  BELL		    07x */
-
-  STARTOTHER,			/*	^h  BACKSPACE		    08x */
-  STARTOTHER,			/*	^i  TAB			    09x */
-  STARTOTHER,			/*	^j  NEWLINE		    0Ax */
-  STARTOTHER,			/*	^k			    0Bx */
-  STARTOTHER,			/*	^l  FORMFEED		    0Cx */
-  STARTOTHER,			/*	^m  RETURN		    0Dx */
-  STARTOTHER,			/*	^n			    0Ex */
-  STARTOTHER,			/*	^o			    0Fx */
-
-  STARTOTHER,			/*	^p			    10x */
-  STARTOTHER,			/*	^q			    11x */
-  STARTOTHER,			/*	^r			    12x */
-  STARTOTHER,			/*	^s			    13x */
-  STARTOTHER,			/*	^t			    14x */
-  STARTOTHER,			/*	^u			    15x */
-  STARTOTHER,			/*	^v			    16x */
-  STARTOTHER,			/*	^w			    17x */
-
-  STARTOTHER,			/*	^x			    18x */
-  STARTOTHER,			/*	^y			    19x */
-  STARTOTHER,			/*	^z			    1Ax */
-  STARTOTHER,			/*	^[ ESC			    1Bx */
-  STARTOTHER,			/*	^slash			    1Cx */
-  STARTOTHER,			/*	^]			    1Dx */
-  STARTOTHER,			/*	^^			    1Ex */
-  STARTOTHER,			/*	^_			    1Fx */
-
-  STARTOTHER,			/*	BLANK			    20x */
-  STARTOTHER,			/*	!			    21x */
-  STARTCSTR,			/*	"			    22x */
-  STARTOTHER,			/*	#			    23x */
-  STARTOTHER,			/*	$ (may be changed in reset) 24x */
-  STARTOTHER,			/*	%			    25x */
-  STARTOTHER,			/*	&			    26x */
-  STARTCCHAR,			/*	'			    27x */
-
-  STARTOTHER,			/*	(			    28x */
-  STARTOTHER,			/*	)			    29x */
-  STARTOTHER,			/*	*			    2Ax */
-  STARTOTHER,			/*	+			    2Bx */
-  STARTOTHER,			/*	,			    2Cx */
-  STARTOTHER,			/*	-			    2Dx */
-  STARTCNUMDOT,			/*	.			    2Ex */
-  STARTSLASH,			/*	/			    2Fx */
-
-  STARTCNUM,			/*	0			    30x */
-  STARTCNUM,			/*	1			    31x */
-  STARTCNUM,			/*	2			    32x */
-  STARTCNUM,			/*	3			    33x */
-  STARTCNUM,			/*	4			    34x */
-  STARTCNUM,			/*	5			    35x */
-  STARTCNUM,			/*	6			    36x */
-  STARTCNUM,			/*	7			    37x */
-
-  STARTCNUM,			/*	8			    38x */
-  STARTCNUM,			/*	9			    39x */
-  STARTOTHER,			/*	:			    3Ax */
-  STARTOTHER,			/*	;			    3Bx */
-  STARTOTHER,			/*	<			    3Cx */
-  STARTOTHER,			/*	=			    3Dx */
-  STARTOTHER,			/*	>			    3Ex */
-  STARTOTHER,			/*	?			    3Fx */
-
-  STARTOTHER,			/*	@			    40x */
-  STARTOTHER,			/*	A			    41x */
-  STARTOTHER,			/*	B			    42x */
-  STARTOTHER,			/*	C			    43x */
-  STARTOTHER,			/*	D			    44x */
-  STARTOTHER,			/*	E			    45x */
-  STARTOTHER,			/*	F			    46x */
-  STARTOTHER,			/*	G			    47x */
-
-  STARTOTHER,			/*	H			    48x */
-  STARTOTHER,			/*	I			    49x */
-  STARTOTHER,			/*	J			    4Ax */
-  STARTOTHER,			/*	K			    4Bx */
-  STARTOTHER,			/*	L			    4Cx */
-  STARTOTHER,			/*	M			    4Dx */
-  STARTOTHER,			/*	N			    4Ex */
-  STARTOTHER,			/*	O			    4Fx */
-
-  STARTOTHER,			/*	P			    50x */
-  STARTOTHER,			/*	Q			    51x */
-  STARTOTHER,			/*	R			    52x */
-  STARTOTHER,			/*	S			    53x */
-  STARTOTHER,			/*	T			    54x */
-  STARTOTHER,			/*	U			    55x */
-  STARTOTHER,			/*	V			    56x */
-  STARTOTHER,			/*	W			    57x */
-
-  STARTOTHER,			/*	X			    58x */
-  STARTOTHER,			/*	Y			    59x */
-  STARTOTHER,			/*	Z			    5Ax */
-  STARTOTHER,			/*	[			    5Bx */
-  STARTWIDE,			/*	slash			    5Cx */
-  STARTOTHER,			/*	]			    5Dx */
-  STARTOTHER,			/*	^			    5Ex */
-  STARTOTHER,			/*	_			    5Fx */
-
-  STARTOTHER,			/*	`			    60x */
-  STARTOTHER,			/*	a			    61x */
-  STARTOTHER,			/*	b			    62x */
-  STARTOTHER,			/*	c			    63x */
-  STARTOTHER,			/*	d			    64x */
-  STARTOTHER,			/*	e			    65x */
-  STARTOTHER,			/*	f			    66x */
-  STARTOTHER,			/*	g			    67x */
-
-  STARTOTHER,			/*	h			    68x */
-  STARTOTHER,			/*	i			    69x */
-  STARTOTHER,			/*	j			    6Ax */
-  STARTOTHER,			/*	k			    6Bx */
-  STARTOTHER,			/*	l			    6Cx */
-  STARTOTHER,			/*	m			    6Dx */
-  STARTOTHER,			/*	n			    6Ex */
-  STARTOTHER,			/*	o			    6Fx */
-
-  STARTOTHER,			/*	p			    70x */
-  STARTOTHER,			/*	q			    71x */
-  STARTOTHER,			/*	r			    72x */
-  STARTOTHER,			/*	s			    73x */
-  STARTOTHER,			/*	t			    74x */
-  STARTOTHER,			/*	u			    75x */
-  STARTOTHER,			/*	v			    76x */
-  STARTOTHER,			/*	w			    77x */
-
-  STARTOTHER,			/*	x			    78x */
-  STARTOTHER,			/*	y			    79x */
-  STARTOTHER,			/*	z			    7Ax */
-  STARTOTHER,			/*	{			    7Dx */
-  STARTOTHER,			/*	|			    7Cx */
-  STARTOTHER,			/*	}			    7Dx */
-  STARTOTHER,			/*	~			    7Ex */
-  STARTOTHER,
-  STARTOTHER			/*	RUBOUT			    7Fx */
-};
-
-/*
-** Given a character code, its status as part of an decimal escape sequence
-** can be derived from this table.  Digits 0-9 allowed.
-*/
-
-static bool isDigit[CHARSIZE] =
-{
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, 
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, 
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, 
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, 
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, 
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
-};
-
-/*
- * Given a character code, its status as part of an octal escape sequence
- * can be derived from this table.  Digits 0-7 allowed.
- */
-
-static bool isOigit[CHARSIZE] =
-{
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, 
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, 
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, 
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, 
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
-};
-
-/*
- * Given a character code, its status as part of a hex escape sequence
- * can be derived from this table.  Digits, a-f, A-F allowed.
- */
-
-static bool isXigit[CHARSIZE] =
-{
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
-  TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-
-  FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-
-  FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
-};
-
-
-/*
- * Given a character code, its status as part of a C string
- * can be derived from this table.  Everything but quotes and newline
- * are allowed.
- */
-
-static bool isStrChar[CHARSIZE] =
-{
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, 
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
-  TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, 
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, 
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE,
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, 
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE
-};
-
-/*
- * Given a character code, its status as part of a C Character
- * can be derived from this table.  Everything but quotes and newline
- * are allowed.
- */
-
-static bool isCharChar[CHARSIZE] =
-{
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE,
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, 
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE,
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
-  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE
-};
-
-/*
-** Given a character code, its status as part of a string or character
-** simple escape sequence ('slash'', 'slash"', 'slash?', 'slashslash', 
-** 'slasha', 'slashb', 'slashf', 'slashn', 'slasht', and 'slashv')
-** can be derived from this table.  ''', '"', '?', 'slash', 'a',
-** 'b', 'f', 'n', 't', and 'v' are allowed.
-*/
-
-static bool isSimpleEscape[CHARSIZE] =
-{
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
-  FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE,
-  FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE,
-  FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE
-};
-
-static bool reportEOL;		
-static bool reportComments;	
-static lsymbol firstReserved;  
-
-static char tokenBuffer[MAXCHAR];
-
-static const charClassData charClassDef[] =
-{
-  /* Control characters	*/
-
-  { SINGLECHAR, FALSE },		/*	 0 NULL			    */
-  { SINGLECHAR, FALSE },		/*	 1 CTRL-A		    */
-  { SINGLECHAR, FALSE },		/*	 2 CTRL-B		    */
-  { SINGLECHAR, FALSE },		/*	 3 CTRL-C		    */
-  { SINGLECHAR, FALSE },		/*	 4 CTRL-D		    */
-  { SINGLECHAR, FALSE },		/*	 5 CTRL-E		    */
-  { SINGLECHAR, FALSE },		/*	 6 CTRL-F		    */
-  { SINGLECHAR, FALSE },		/*	 7 CTRL-G		    */
-  { SINGLECHAR, FALSE },		/*	 8 CTRL-H		    */
-
-  /* defined formatting characters */
-  { WHITECHAR, FALSE },		        /*	 9 CTRL-I   TAB		    */
-  { CHC_NULL, TRUE },		/*	10 CTRL-J   EOL		    */
-
-  /* more control characters */
-  { SINGLECHAR, FALSE },		/*	11 CTRL-K		    */
-  { WHITECHAR, FALSE },		        /*	12 CTRL-L		    */
-  { SINGLECHAR, FALSE },		/*	13 CTRL-M		    */
-  { SINGLECHAR, FALSE },		/*	14 CTRL-N		    */
-  { SINGLECHAR, FALSE },		/*	15 CTRL-O		    */
-  { SINGLECHAR, FALSE },		/*	16 CTRL-P		    */
-  { SINGLECHAR, FALSE },		/*	17 CTRL-Q		    */
-  { SINGLECHAR, FALSE },		/*	18 CTRL-R		    */
-  { SINGLECHAR, FALSE },		/*	19 CTRL-S		    */
-  { SINGLECHAR, FALSE },		/*	20 CTRL-T		    */
-  { SINGLECHAR, FALSE },		/*	21 CTRL-U		    */
-  { SINGLECHAR, FALSE },		/*	22 CTRL-V		    */
-  { SINGLECHAR, FALSE },		/*	23 CTRL-W		    */
-  { SINGLECHAR, FALSE },		/*	24 CTRL-X		    */
-  { SINGLECHAR, FALSE },		/*	25 CTRL-Y		    */
-  { SINGLECHAR, FALSE },		/*	26 CTRL-Z		    */
-  { SINGLECHAR, FALSE },		/*	27 CTRL-[   ESC		    */
-  { SINGLECHAR, FALSE },		/*	28 CTRL-slash   FS    	    */
-  { SINGLECHAR, FALSE },		/*	29 CTRL-]   GS		    */
-  { SINGLECHAR, FALSE },		/*	30 CTRL-^   RS		    */
-  { SINGLECHAR, FALSE },		/*	31 CTRL-_   US		    */
-
-  /* Special printing characters */
-  { WHITECHAR, FALSE },		        /*	32 space		    */
-  { SINGLECHAR, FALSE },		/*	33 !			    */
-  { SINGLECHAR, FALSE },		/*	34 "			    */
-  { SINGLECHAR, FALSE },		/*	35 #			    */
-  { SINGLECHAR, FALSE },		/*	36 $			    */
-  { SINGLECHAR, FALSE },		/*	37 %			    */
-  { SINGLECHAR, FALSE },		/*	38 &			    */
-  { SINGLECHAR, FALSE },		/*	39 '			    */
-
-  /* Reserved characters */
-  { PERMCHAR, FALSE },		        /*	40 (			    */
-  { PERMCHAR, FALSE },		        /*	41 )			    */
-  { PERMCHAR, FALSE },		        /*	42 *			    */
-  { OPCHAR, FALSE },		        /*	43 +			    */
-  { PERMCHAR, FALSE },		        /*	44 ,			    */
-  { OPCHAR, FALSE },		        /*	45 -			    */
-  { OPCHAR, FALSE },		        /*	46 .			    */
-  { OPCHAR, FALSE },		        /*	47 /			    */
-
-/* Numbers							    */
-  { IDCHAR, FALSE },		/*	48 0			    */
-  { IDCHAR, FALSE },		/*	49 1			    */
-  { IDCHAR, FALSE },		/*	50 2			    */
-  { IDCHAR, FALSE },		/*	51 3			    */
-  { IDCHAR, FALSE },		/*	52 4			    */
-  { IDCHAR, FALSE },		/*	53 5			    */
-  { IDCHAR, FALSE },		/*	54 6			    */
-  { IDCHAR, FALSE },		/*	55 7			    */
-  { IDCHAR, FALSE },		/*	56 8			    */
-  { IDCHAR, FALSE },		/*	57 9			    */
-
-  /* More reserved and special printing characters		    */
-  { PERMCHAR, FALSE },		/*	58 :			    */
-  { PERMCHAR, FALSE },		/*	59;			    */
-  { OPCHAR, FALSE },		/*	60 <			    */
-  { OPCHAR, FALSE },		/*	61 =			    */
-  { OPCHAR, FALSE },		/*	62 >			    */
-  { SINGLECHAR, FALSE },	/*	63 ?			    */
-  { SINGLECHAR, FALSE },	/*	64 @			    */
-
-  /* Uppercase Alphabetics					    */
-  { IDCHAR, FALSE },		/*      65 A			    */
-  { IDCHAR, FALSE },		/*      66 B			    */
-  { IDCHAR, FALSE },		/*      67 C			    */
-  { IDCHAR, FALSE },		/*      68 D			    */
-  { IDCHAR, FALSE },		/*      69 E			    */
-  { IDCHAR, FALSE },		/*	70 F			    */
-  { IDCHAR, FALSE },		/*	71 G			    */
-  { IDCHAR, FALSE },		/*	72 H			    */
-  { IDCHAR, FALSE },		/*	73 I			    */
-  { IDCHAR, FALSE },		/*	74 J			    */
-  { IDCHAR, FALSE },		/*	75 K			    */
-  { IDCHAR, FALSE },		/*	76 L			    */
-  { IDCHAR, FALSE },		/*	77 M			    */
-  { IDCHAR, FALSE },		/*	78 N			    */
-  { IDCHAR, FALSE },		/*	79 O			    */
-  { IDCHAR, FALSE },		/*	80 P			    */
-  { IDCHAR, FALSE },		/*	81 Q			    */
-  { IDCHAR, FALSE },		/*	82 R			    */
-  { IDCHAR, FALSE },		/*	83 S			    */
-  { IDCHAR, FALSE },		/*	84 T			    */
-  { IDCHAR, FALSE },		/*	85 U			    */
-  { IDCHAR, FALSE },		/*	86 V			    */
-  { IDCHAR, FALSE },		/*	87 W			    */
-  { IDCHAR, FALSE },		/*	88 X			    */
-  { IDCHAR, FALSE },		/*	89 Y			    */
-  { IDCHAR, FALSE },		/*	90 Z			    */
-
-  /* Still more reserved and special printing characters	    */
-  { PERMCHAR, FALSE },		/*	91 [			    */
-  { CHC_EXTENSION, FALSE },	/*	92 slash	            */
-  { PERMCHAR, FALSE },		/*	93 ]			    */
-  { SINGLECHAR, FALSE },	/*	94 ^			    */
-  { IDCHAR, FALSE },		/*	95 _			    */
-  { SINGLECHAR, FALSE },	/*	96 `			    */
-
-  /* Lowercase alphabetics					    */
-  { IDCHAR, FALSE },		/*	97 a			    */
-  { IDCHAR, FALSE },		/*	98 b			    */
-  { IDCHAR, FALSE },		/*	99 c			    */
-  { IDCHAR, FALSE },		/*	100 d			    */
-  { IDCHAR, FALSE },		/*	101 e			    */
-  { IDCHAR, FALSE },		/*	102 f			    */
-  { IDCHAR, FALSE },		/*	103 g			    */
-  { IDCHAR, FALSE },		/*	104 h			    */
-  { IDCHAR, FALSE },		/*	105 i			    */
-  { IDCHAR, FALSE },		/*	106 j			    */
-  { IDCHAR, FALSE },		/*	107 k			    */
-  { IDCHAR, FALSE },		/*	108 l			    */
-  { IDCHAR, FALSE },		/*	109 m			    */
-  { IDCHAR, FALSE },		/*	110 n			    */
-  { IDCHAR, FALSE },		/*	111 o			    */
-  { IDCHAR, FALSE },		/*	112 p			    */
-  { IDCHAR, FALSE },		/*	113 q			    */
-  { IDCHAR, FALSE },		/*	114 r			    */
-  { IDCHAR, FALSE },		/*	115 s			    */
-  { IDCHAR, FALSE },		/*	116 t			    */
-  { IDCHAR, FALSE },		/*	117 u			    */
-  { IDCHAR, FALSE },		/*	118 v			    */
-  { IDCHAR, FALSE },		/*	119 w			    */
-  { IDCHAR, FALSE },		/*	120 x			    */
-  { IDCHAR, FALSE },		/*	121 y			    */
-  { IDCHAR, FALSE },		/*      122 z			    */
-
-  { SINGLECHAR, FALSE },	/*	123 {			    */
-  { SINGLECHAR, FALSE },	/*	124 |			    */
-  { SINGLECHAR, FALSE },	/*	125 }			    */
-  { SINGLECHAR, FALSE },	/*	126 ~			    */
-  { SINGLECHAR, FALSE },	/*	127 DEL			    */
-
-  /* MCS - unused in English					    */
-  { SINGLECHAR, FALSE },	/*	128			    */
-  { SINGLECHAR, FALSE },	/*	129			    */
-  { SINGLECHAR, FALSE },	/*	130			    */
-  { SINGLECHAR, FALSE },	/*	131			    */
-  { SINGLECHAR, FALSE },	/*	132			    */
-  { SINGLECHAR, FALSE },	/*	133			    */
-  { SINGLECHAR, FALSE },	/*	134			    */
-  { SINGLECHAR, FALSE },	/*	135			    */
-  { SINGLECHAR, FALSE },	/*	136			    */
-  { SINGLECHAR, FALSE },	/*	137			    */
-  { SINGLECHAR, FALSE },	/*	138			    */
-  { SINGLECHAR, FALSE },	/*	139			    */
-  { SINGLECHAR, FALSE },	/*	140			    */
-  { SINGLECHAR, FALSE },	/*	141			    */
-  { SINGLECHAR, FALSE },	/*	142			    */
-  { SINGLECHAR, FALSE },	/*	143			    */
-  { SINGLECHAR, FALSE },	/*	144			    */
-  { SINGLECHAR, FALSE },	/*	145			    */
-  { SINGLECHAR, FALSE },	/*	146			    */
-  { SINGLECHAR, FALSE },	/*	147			    */
-  { SINGLECHAR, FALSE },	/*	148			    */
-  { SINGLECHAR, FALSE },	/*	149			    */
-  { SINGLECHAR, FALSE },	/*	150			    */
-  { SINGLECHAR, FALSE },	/*	151			    */
-  { SINGLECHAR, FALSE },	/*	152			    */
-  { SINGLECHAR, FALSE },	/*	153			    */
-  { SINGLECHAR, FALSE },	/*	154			    */
-  { SINGLECHAR, FALSE },	/*	155			    */
-  { SINGLECHAR, FALSE },	/*	156			    */
-  { SINGLECHAR, FALSE },	/*	157			    */
-  { SINGLECHAR, FALSE },	/*	158			    */
-  { SINGLECHAR, FALSE },	/*	159			    */
-  { SINGLECHAR, FALSE },	/*	160			    */
-  { SINGLECHAR, FALSE },	/*	161			    */
-  { SINGLECHAR, FALSE },	/*	162			    */
-  { SINGLECHAR, FALSE },	/*	163			    */
-  { SINGLECHAR, FALSE },	/*	164			    */
-  { SINGLECHAR, FALSE },	/*	165			    */
-  { SINGLECHAR, FALSE },	/*	166			    */
-  { SINGLECHAR, FALSE },	/*	167			    */
-  { SINGLECHAR, FALSE },	/*	168			    */
-  { SINGLECHAR, FALSE },	/*	169			    */
-  { SINGLECHAR, FALSE },	/*	170			    */
-  { SINGLECHAR, FALSE },	/*	171			    */
-  { SINGLECHAR, FALSE },	/*	172			    */
-  { SINGLECHAR, FALSE },	/*	173			    */
-  { SINGLECHAR, FALSE },	/*	174			    */
-  { SINGLECHAR, FALSE },	/*	175			    */
-  { SINGLECHAR, FALSE },	/*	176			    */
-  { SINGLECHAR, FALSE },	/*	177			    */
-  { SINGLECHAR, FALSE },	/*	178			    */
-  { SINGLECHAR, FALSE },	/*	179			    */
-  { SINGLECHAR, FALSE },	/*	180			    */
-  { SINGLECHAR, FALSE },	/*	181			    */
-  { SINGLECHAR, FALSE },	/*	182			    */
-  { SINGLECHAR, FALSE },	/*	183			    */
-  { SINGLECHAR, FALSE },	/*	184			    */
-  { SINGLECHAR, FALSE },	/*	185			    */
-  { SINGLECHAR, FALSE },	/*	186			    */
-  { SINGLECHAR, FALSE },	/*	187			    */
-  { SINGLECHAR, FALSE },	/*	188			    */
-  { SINGLECHAR, FALSE },	/*	189			    */
-  { SINGLECHAR, FALSE },	/*	190			    */
-  { SINGLECHAR, FALSE },	/*	191			    */
-  { SINGLECHAR, FALSE },	/*	192			    */
-  { SINGLECHAR, FALSE },	/*	193			    */
-  { SINGLECHAR, FALSE },	/*	194			    */
-  { SINGLECHAR, FALSE },	/*	195			    */
-  { SINGLECHAR, FALSE },	/*	196			    */
-  { SINGLECHAR, FALSE },	/*	197			    */
-  { SINGLECHAR, FALSE },	/*	198			    */
-  { SINGLECHAR, FALSE },	/*	199			    */
-  { SINGLECHAR, FALSE },	/*	200			    */
-  { SINGLECHAR, FALSE },	/*	201			    */
-  { SINGLECHAR, FALSE },	/*	202			    */
-  { SINGLECHAR, FALSE },	/*	203			    */
-  { SINGLECHAR, FALSE },	/*	204			    */
-  { SINGLECHAR, FALSE },	/*	205			    */
-  { SINGLECHAR, FALSE },	/*	206			    */
-  { SINGLECHAR, FALSE },	/*	207			    */
-  { SINGLECHAR, FALSE },	/*	208			    */
-  { SINGLECHAR, FALSE },	/*	209			    */
-  { SINGLECHAR, FALSE },	/*	210			    */
-  { SINGLECHAR, FALSE },	/*	211			    */
-  { SINGLECHAR, FALSE },	/*	212			    */
-  { SINGLECHAR, FALSE },	/*	213			    */
-  { SINGLECHAR, FALSE },	/*	214			    */
-  { SINGLECHAR, FALSE },	/*	215			    */
-  { SINGLECHAR, FALSE },	/*	216			    */
-  { SINGLECHAR, FALSE },	/*	217			    */
-  { SINGLECHAR, FALSE },	/*	218			    */
-  { SINGLECHAR, FALSE },	/*	219			    */
-  { SINGLECHAR, FALSE },	/*	220			    */
-  { SINGLECHAR, FALSE },	/*	221			    */
-  { SINGLECHAR, FALSE },	/*	222			    */
-  { SINGLECHAR, FALSE },	/*	223			    */
-  { SINGLECHAR, FALSE },	/*	224			    */
-  { SINGLECHAR, FALSE },	/*	225			    */
-  { SINGLECHAR, FALSE },	/*	226			    */
-  { SINGLECHAR, FALSE },	/*	227			    */
-  { SINGLECHAR, FALSE },	/*	228			    */
-  { SINGLECHAR, FALSE },	/*	229			    */
-  { SINGLECHAR, FALSE },	/*	230			    */
-  { SINGLECHAR, FALSE },	/*	231			    */
-  { SINGLECHAR, FALSE },	/*	232			    */
-  { SINGLECHAR, FALSE },	/*	233			    */
-  { SINGLECHAR, FALSE },	/*	234			    */
-  { SINGLECHAR, FALSE },	/*	235			    */
-  { SINGLECHAR, FALSE },	/*	236			    */
-  { SINGLECHAR, FALSE },	/*	237			    */
-  { SINGLECHAR, FALSE },	/*	238			    */
-  { SINGLECHAR, FALSE },	/*	239			    */
-  { SINGLECHAR, FALSE },	/*	240			    */
-  { SINGLECHAR, FALSE },	/*	241			    */
-  { SINGLECHAR, FALSE },	/*	242			    */
-  { SINGLECHAR, FALSE },	/*	243			    */
-  { SINGLECHAR, FALSE },	/*	244			    */
-  { SINGLECHAR, FALSE },	/*	245			    */
-  { SINGLECHAR, FALSE },	/*	246			    */
-  { SINGLECHAR, FALSE },	/*	247			    */
-  { SINGLECHAR, FALSE },	/*	248			    */
-  { SINGLECHAR, FALSE },	/*	249			    */
-  { SINGLECHAR, FALSE },	/*	250			    */
-  { SINGLECHAR, FALSE },	/*	251			    */
-  { SINGLECHAR, FALSE },	/*	252			    */
-  { SINGLECHAR, FALSE },	/*	253			    */
-  { SINGLECHAR, FALSE },	/*	254			    */
-  { SINGLECHAR, FALSE }		/*	255			    */
-};
-
-void
-ScanCComment (void)
-{
-  inComment = TRUE;
-  for (;;)
-    {
-      switch (currentChar)
-	{
-	case '*':
-	  LCLMOVECHAR ();
-	  if (currentChar == '/')
-	    {
-	      LCLMOVECHAR ();
-	      inComment = FALSE;
-	      return;
-	    }
-	  /*@switchbreak@*/ break;
-	case '\n':
-	  return;
-	default:
-	  LCLMOVECHAR ();
-	}
-    }
-}
-
-void
-ScanEscape (void)
-{
-  if (isSimpleEscape[(int)currentChar])
-    {
-      LCLMOVECHAR ();		/* discard simple escape character. */
-    }
-  else if (currentChar == 'x')
-    {
-      LCLMOVECHAR ();		/* discard 'x'. */
-      if (!isXigit[(int)currentChar])
-	{
-	  LocalUserError ("at least one hex digit must follow '\\x'");
-	}
-      while (isXigit[(int)currentChar])
-	{
-	  LCLMOVECHAR ();		/* discard hex digits. */
-	}
-    }
-  else if (isOigit[(int)currentChar])
-    {
-      LCLMOVECHAR ();		/* discard first hex digit. */
-      if (isOigit[(int)currentChar])
-	{
-	  LCLMOVECHAR ();		/* discard second hex digit. */
-	}
-      if (isOigit[(int)currentChar])
-	{
-	  LCLMOVECHAR ();		/* discard third hex digit. */
-	}
-    }
-  else
-    {
-      LocalUserError ("invalid escape sequence in a C string or character");
-    }
-}
-
-void
-ScanCString (void)
-{
-  if (currentChar == '\\' && LOOKAHEADCHAR () == 'L')
-    {
-      LCLMOVECHAR ();		/* discard slash */
-      LCLMOVECHAR ();		/* discard 'L'. */
-    }
-
-  if (currentChar == '\"')
-    {
-      LCLMOVECHAR ();		/* discard opening quote. */
-
-      while (currentChar != '\"')
-	{
-	  if (isStrChar[(int)currentChar])
-	    {
-	      LCLMOVECHAR ();	/* discard string character. */
-	    }
-	  else if (currentChar == '\\')
-	    {
-	      LCLMOVECHAR ();	/* discard slash */
-	      ScanEscape ();
-	    }
-	  else if (currentChar == '\n')
-	    {
-	      LocalUserError ("unterminated C string");
-	    }
-	  else
-	    {
-	      LocalUserError ("invalid character in C string");
-	    }
-	}
-      LCLMOVECHAR ();		/* discard closing quote */
-
-    }
-  else
-    {
-      LocalUserError ("C string must start with '\"'");
-    }
-
-
-  *bufPtr = '\0';		/* null terminate in buffer */
-  tokenSym = lsymbol_fromChars (&tokenBuffer[0]);
-  tokenCode = LLT_LCSTRING;
-}
-
-void
-ScanCChar (void)
-{
-  if (currentChar == '\\' && LOOKAHEADCHAR () == 'L')
-    {
-      LCLMOVECHAR ();		/* discard slash */
-      LCLMOVECHAR ();		/* discard 'L'. */
-    }
-
-  if (currentChar == '\'')
-    {
-      LCLMOVECHAR ();		/* discard opening quote */
-
-      while (currentChar != '\'')
-	{
-	  if (isCharChar[(int)currentChar])
-	    {
-	      LCLMOVECHAR ();	/* discard string character. */
-	    }
-	  else if (currentChar == '\\')
-	    {
-	      LCLMOVECHAR ();	/* discard slash */
-	      ScanEscape ();
-	    }
-	  else if (currentChar == '\n')
-	    {
-	      LocalUserError ("unterminated C character constant");
-	    }
-	  else
-	    {
-	      LocalUserError ("invalid character in C character");
-	    }
-	}
-      LCLMOVECHAR ();		/* discard closing quote */
-
-    }
-  else
-    {
-      LocalUserError ("invalid C character");
-    }
-
-
-  *bufPtr = '\0';		/* null terminate in buffer */
-  tokenSym = lsymbol_fromChars (&tokenBuffer[0]);
-  tokenCode = LLT_CCHAR;
-}
-
-void
-ScanCNumber (void)
-{
-  tokenCode = LLT_CINTEGER;
-  
-  switch (currentChar)
-    {
-    case '.':
-      LCLMOVECHAR ();		
-      tokenCode = LLT_CFLOAT;
-      if (!isDigit[(int)currentChar])
-	{
-	  LocalUserError ("at least one digit must follow '.'");
-	}
-      while (isDigit[(int)currentChar])
-	{
-	  LCLMOVECHAR ();
-	}
-      if (currentChar == 'e' || currentChar == 'E')
-	{
-	  LCLMOVECHAR ();		/* discard 'e' or 'E'. */
-	  if (currentChar == '+' || currentChar == '-')
-	    {
-	      LCLMOVECHAR ();
-	    }
-	  if (!isDigit[(int)currentChar])
-	    {
-	      LocalUserError ("digit must follow exponent");
-	    }
-	  while (isDigit[(int)currentChar])
-	    {
-	      LCLMOVECHAR ();
-	    }
-	}
-      if (currentChar == 'f' || currentChar == 'l' ||
-	  currentChar == 'F' || currentChar == 'L')
-	{
-	  LCLMOVECHAR ();
-	}
-      break;
-      
-    case '0':
-      LCLMOVECHAR ();		/* discard '0'. */
-      switch (currentChar)
-	{
-	case 'x':
-	case 'X':
-	  LCLMOVECHAR ();
-	  if (!isXigit[(int)currentChar])
-	    {
-	      LocalUserError ("hex digit must follow 'x' or 'X'");
-	    }
-	  while (isXigit[(int)currentChar])
-	    {
-	      LCLMOVECHAR ();
-	    }
-	  /*@switchbreak@*/ break;
-
-	default:
-	  /*
-	  ** Could either be an octal number or a floating point  
-	  ** number.  Scan decimal digits so don't run into	    
-	  ** problems if turns out problems if it is an fp	    
-	  ** number.  Let converter/parser catch bad octal	    
-	  ** numbers.   e.g. 018 not caught by scanner.	    
-	  */
-	  
-	  while (isDigit[(int)currentChar])
-	    {
-	      LCLMOVECHAR ();
-	    }
-	  switch (currentChar)
-	    {
-	    case '.':
-	      LCLMOVECHAR ();	/* discard '.'. */
-	      tokenCode = LLT_CFLOAT;
-	      while (isDigit[(int)currentChar])
-		{
-		  LCLMOVECHAR ();
-		}
-	      if (currentChar == 'e' || currentChar == 'E')
-		{
-		  LCLMOVECHAR ();	/* discard 'e' or 'E'. */
-		  if (currentChar == '+' || currentChar == '-')
-		    {
-		      LCLMOVECHAR ();
-		    }
-		  if (!isDigit[(int)currentChar])
-		    {
-		      LocalUserError ("digit must follow exponent");
-		    }
-		  while (isDigit[(int)currentChar])
-		    {
-		      LCLMOVECHAR ();
-		    }
-		}
-	      if (currentChar == 'f' ||
-		  currentChar == 'l' ||
-		  currentChar == 'F' ||
-		  currentChar == 'L')
-		{
-		  LCLMOVECHAR ();
-		}
-	      /*@switchbreak@*/ break;
-
-	    case 'e':
-	    case 'E':
-	      LCLMOVECHAR ();	
-	      tokenCode = LLT_CFLOAT;
-	      if (currentChar == '+' || currentChar == '-')
-		{
-		  LCLMOVECHAR ();
-		}
-	      if (!isDigit[(int)currentChar])
-		{
-		  LocalUserError ("digit must follow exponent");
-		}
-	      while (isDigit[(int)currentChar])
-		{
-		  LCLMOVECHAR ();
-		}
-	      if (currentChar == 'f' ||
-		  currentChar == 'l' ||
-		  currentChar == 'F' ||
-		  currentChar == 'L')
-		{
-		  LCLMOVECHAR ();
-		}
-	      /*@switchbreak@*/ break;
-
-	    default:
-	      /* Scan integer suffix. */
-	      switch (currentChar)
-		{
-		case 'u':
-		case 'U':
-		  LCLMOVECHAR ();	
-		  if (currentChar == 'l' || currentChar == 'L')
-		    {
-		      LCLMOVECHAR ();
-		    }
-		  /*@switchbreak@*/ break;
-		case 'l':
-		case 'L':
-		  LCLMOVECHAR ();	
-		  if (currentChar == 'u' || currentChar == 'U')
-		    {
-		      LCLMOVECHAR ();
-		    }
-		  
-		  /*@switchbreak@*/ break;
-		}	
-	      /*@switchbreak@*/ break;
-	    }		
-	}		       
-      
-      /* Scan integer suffix. */
-      switch (currentChar)
-	{
-	case 'u':
-	case 'U':
-	  LCLMOVECHAR ();		
-	  if (currentChar == 'l' || currentChar == 'L')
-	    {
-	      LCLMOVECHAR ();	
-	    }
-	  /*@switchbreak@*/ break;
-	case 'l':
-	case 'L':
-	  LCLMOVECHAR ();		
-	  if (currentChar == 'u' || currentChar == 'U')
-	    {
-	      LCLMOVECHAR ();	
-	    }
-	  /*@switchbreak@*/ break;
-	}		
-      break;
-      
-    default:
-      if (isDigit[(int)currentChar])
-	{
-	  while (isDigit[(int)currentChar])
-	    {
-	      LCLMOVECHAR ();
-	    }
-	  switch (currentChar)
-	    {
-	    case '.':
-	      LCLMOVECHAR ();	/* discard '.'. */
-	      tokenCode = LLT_CFLOAT;
-	      while (isDigit[(int)currentChar])
-		{
-		  LCLMOVECHAR ();
-		}
-	      if (currentChar == 'e' || currentChar == 'E')
-		{
-		  LCLMOVECHAR ();
-		  if (currentChar == '+' || currentChar == '-')
-		    {
-		      LCLMOVECHAR ();
-		    }
-		  if (!isDigit[(int)currentChar])
-		    {
-		      LocalUserError ("digit must follow exponent");
-		    }
-		  while (isDigit[(int)currentChar])
-		    {
-		      LCLMOVECHAR ();
-		    }
-		}
-	      if (currentChar == 'f' ||
-		  currentChar == 'l' ||
-		  currentChar == 'F' ||
-		  currentChar == 'L')
-		{
-		  LCLMOVECHAR ();
-		}
-	      /*@switchbreak@*/ break;
-
-	    case 'e':
-	    case 'E':
-	      LCLMOVECHAR ();	
-	      tokenCode = LLT_CFLOAT;
-	      if (currentChar == '+' || currentChar == '-')
-		{
-		  LCLMOVECHAR ();
-		}
-	      if (!isDigit[(int)currentChar])
-		{
-		  LocalUserError ("digit must follow exponent");
-		}
-	      while (isDigit[(int)currentChar])
-		{
-		  LCLMOVECHAR ();
-		}
-	      if (currentChar == 'f' ||
-		  currentChar == 'l' ||
-		  currentChar == 'F' ||
-		  currentChar == 'L')
-		{
-		  LCLMOVECHAR ();
-		}
-
-	      /*@switchbreak@*/ break;
-	    default:
-	      switch (currentChar)
-		{
-		case 'u':
-		case 'U':
-		  LCLMOVECHAR (); 
-		  if (currentChar == 'l' || currentChar == 'L')
-		    {
-		      LCLMOVECHAR ();
-		    }
-		  /*@switchbreak@*/ break;
-		case 'l':
-		case 'L':
-		  LCLMOVECHAR ();	
-		  if (currentChar == 'u' || currentChar == 'U')
-		    {
-		      LCLMOVECHAR ();
-		    }
-		  /*@switchbreak@*/ break;
-		}		
-	      /*@switchbreak@*/ break;
-	    }			
-	}
-      else
-	{
-	  LocalUserError ("invalid C number");
-	}
-      break;
-
-
-    }	
-
-  *bufPtr = '\0';
-  tokenSym = lsymbol_fromChars (&tokenBuffer[0]);
-}
-
-static void ScanOther (void)
-{
-  switch (LCLScanCharClass (currentChar))
-    {			      
-    case CHC_NULL:	
-      tokenSym = lsymbol_fromChars ("E O L");
-      tokenCode = LLT_EOL;
-      break;
-      
-      /* identifiers */
-      
-    case IDCHAR:
-      
-      while (LCLScanCharClass (currentChar) == IDCHAR)
-	{			/* identifier: find end	    */
-	  LCLMOVECHAR ();
-	}
-      
-      *bufPtr = '\0';		/* null terminate in buffer */
-      tokenSym = lsymbol_fromChars (&tokenBuffer[0]);
-      tokenCode = simpleId;
-            break;
-      
-      /* one-character tokens */
-      
-    case SINGLECHAR:
-    case PERMCHAR:		
-      LCLMOVECHAR ();
-      *bufPtr = '\0';		
-      tokenSym = lsymbol_fromChars (&tokenBuffer[0]);
-      tokenCode = simpleOp;
-      break;
-
-     /* operator symbols */
-
-    case OPCHAR:
-
-      if (currentChar == '.' &&  LOOKAHEADCHAR () == '.'  &&
-	  LOOKAHEADTWICECHAR () == '.')
-	{
-	  LCLMOVECHAR ();
-	  LCLMOVECHAR ();
-	  LCLMOVECHAR ();
-	  *bufPtr = '\0';
-	  tokenSym = lsymbol_fromChars ("...");
-	  tokenCode = LLT_TELIPSIS;
-	}
-      else
-	{
-	  if (currentChar == '/' && LOOKAHEADCHAR () == '\\')
-	    {			
-	      LCLMOVECHAR ();
-	      LCLMOVECHAR ();
-	    }
-	  else
-	    {			
-	      while (LCLScanCharClass (currentChar) == OPCHAR)
-		{	
-		  LCLMOVECHAR ();
-		}
-	    }
-	  
-	  *bufPtr = '\0';
-	  tokenSym = lsymbol_fromChars (&tokenBuffer[0]);
-	  tokenCode = simpleOp;
-	}
-      break;
-      
-      /* white space */
-    case WHITECHAR:
-      /*@-loopswitchbreak@*/
-      /*@-switchswitchbreak@*/
-      switch (currentChar)
-	{
-	case '\t':
-	  LCLMOVECHAR (); /* tabs only count as one character */
-	  break;
-
-	case '\v':
-	case '\f':
-	  LCLMOVECHAR ();
-	  colNumber--;		/* does not change column   */
-	  break;
-
-	default:
-	  LCLMOVECHAR ();
-	  break;
-	}
-      /*@=switchswitchbreak@*/
-
-      *bufPtr = '\0';	
-      tokenSym = lsymbol_fromChars (&tokenBuffer[0]);
-      tokenCode = LLT_WHITESPACE;
-      break;
-
-     /* symbols */
-
-    case CHC_EXTENSION:	
-      LCLMOVECHAR ();
-
-      /*@-switchswitchbreak@*/
-      switch (currentChar)
-	{		
-	 /* open and close */
-	case '(':		
-	  LCLMOVECHAR ();
-	  while (LCLScanCharClass (currentChar) == IDCHAR)
-	    {			
-	      LCLMOVECHAR ();
-	    }
-	  *bufPtr = '\0';	
-	  tokenSym = lsymbol_fromChars (&tokenBuffer[0]);
-	  tokenCode = openSym;
-	  break;
-
-	case ')':		
-	  LCLMOVECHAR ();
-	  while (LCLScanCharClass (currentChar) == IDCHAR)
-	    {			
-	      LCLMOVECHAR ();
-	    }
-	  *bufPtr = '\0';	
-	  tokenSym = lsymbol_fromChars (&tokenBuffer[0]);
-	  tokenCode = closeSym;
-	  break;
-
-	 /* separator */
-	case ',':	
-	  LCLMOVECHAR ();
-	  while (LCLScanCharClass (currentChar) == IDCHAR)
-	    {		
-	      LCLMOVECHAR ();
-	    }
-	  *bufPtr = '\0';
-	  tokenSym = lsymbol_fromChars (&tokenBuffer[0]);
-	  tokenCode = sepSym;
-	  break;
-
-	 /* simpleid */
-	case ':':	
-	  LCLMOVECHAR ();
-	  while (LCLScanCharClass (currentChar) == IDCHAR)
-	    {		
-	      LCLMOVECHAR ();
-	    }
-	  *bufPtr = '\0';
-	  tokenSym = lsymbol_fromChars (&tokenBuffer[0]);
-	  tokenCode = simpleId;
-	  break;
-
-	default:		
-	  if (LCLScanCharClass (currentChar) == IDCHAR)
-	    {
-	      do
-		{
-		  LCLMOVECHAR ();
-		}
-	      while (LCLScanCharClass (currentChar) == IDCHAR);
-	      *bufPtr = '\0';	
-	      tokenSym = lsymbol_fromChars (&tokenBuffer[0]);
-	      tokenCode = simpleOp;
-	    }
-	  else
-	    {
-	      /*
-	      ** Meets none of the above.  Take the extension	    
-	      ** character and the character following and treat	   
-	      ** together as a SINGLECHAR.  SINGLECHARs tranlate into 
-	      ** SIMPLEOPs.					    
-	      */
-
-	      LCLMOVECHAR ();
-	      *bufPtr = '\0';	
-	      tokenSym = lsymbol_fromChars (&tokenBuffer[0]);
-	      tokenCode = simpleOp;
-	    }
-	  break;
-	  /*@=switchswitchbreak@*/
-	}
-      break;			
-
-    default:
-      LocalUserError ("unexpected character in input");
-      return;
-    }
-  /*@=loopswitchbreak@*/
-}
-
-static bool
-nextCanBeCharLiteral (ltokenCode c)
-{
-  switch (c)
-    {
-      /* A ' following these tokens starts a C character literal. */
-    case logicalOp:		
-    case equationSym:		
-    case eqSepSym:		
-    case openSym:		
-    case sepSym:		
-    case simpleOp:		
-    case LLT_COMMA:		        
-    case LLT_EQUALS:		
-    case LLT_LBRACE:		
-    case LLT_LBRACKET:		
-    case LLT_LPAR:			
-    case eqOp:			
-    case LLT_BE:			
-    case LLT_ELSE:			
-    case LLT_ENSURES:		
-    case LLT_IF:			
-    case LLT_CONSTRAINT:		
-    case LLT_REQUIRES:		
-    case LLT_CHECKS:                
-    case LLT_BODY:			
-    case LLT_THEN:			
-      return (TRUE);
-
-     /* A ' following these tokens means post */
-    case selectSym:		
-    case closeSym:		
-    case simpleId:		
-    case preSym:		
-    case anySym:		
-    case postSym:		
-    case LLT_QUOTE:		        
-    case LLT_RBRACE:		
-    case LLT_RBRACKET:		
-    case LLT_RPAR:			
-    case LLT_RESULT:		
-      return (FALSE);
-
-     /* Neither a C character literal nor post should follow these tokens */
-    case quantifierSym:	        
-    case mapSym:		
-    case markerSym:		
-    case LLT_COLON:	        	
-    case LLT_SEMI:			
-    case LLT_VERTICALBAR:		
-    case LLT_MULOP:  		
-    case LLT_CCHAR:		        
-    case LLT_CFLOAT:		
-    case LLT_CINTEGER:		
-    case LLT_LCSTRING:		
-    case LLT_ALL:			
-    case LLT_ANYTHING:		
-    case LLT_CONSTANT:		
-    case LLT_FOR:			
-    case LLT_IMMUTABLE:		
-    case LLT_OBJ:			
-    case LLT_OUT:			
-    case LLT_IMPORTS:		
-    case LLT_ISSUB: 		
-    case LLT_LET:			
-    case LLT_MODIFIES:
-    case LLT_CLAIMS:
-    case LLT_MUTABLE:		
-    case LLT_FRESH:
-    case LLT_NOTHING:		
-    case LLT_PRIVATE:		
-    case LLT_SPEC:			
-    case LLT_SIZEOF:		
-    case LLT_TAGGEDUNION:		
-    case LLT_TYPE:			
-    case LLT_UNCHANGED:		
-    case LLT_USES:			
-    case LLT_CHAR:			
-    case LLT_CONST:		        
-    case LLT_DOUBLE:		
-    case LLT_ENUM:			
-    case LLT_FLOAT:		        
-    case LLT_INT:			
-    case LLT_TYPEDEF_NAME:		
-    case LLT_LONG:			
-    case LLT_SHORT:		        
-    case LLT_STRUCT:		
-    case LLT_SIGNED:		
-    case LLT_UNKNOWN:		
-    case LLT_UNION:		        
-    case LLT_UNSIGNED:		
-    case LLT_VOID:			
-    case LLT_VOLATILE:		
-      return (FALSE);
-
-     /* These tokens should have been ignored */
-    case NOTTOKEN:
-    case commentSym:		
-    case LLT_WHITESPACE:
-    case LLT_EOL:
-    case LEOFTOKEN:
-      llcontbuglit ("scanline: nextCanBeChar");
-      return FALSE;
-    BADDEFAULT;
-    }
-
-  BADEXIT;
-}
-
-void
-LCLScanLine (char *line)
-{
-  ltoken newToken;
-  lsymbol CCommentSym = lsymbol_fromChars ("/*");
-  size_t linelength = strlen (line);
-  static bool inSpecComment = FALSE;
-
-    line[(int)linelength] = '\n';
-
-  currentLine = line;
-  currentChar = *currentLine++;	
-  context_processedSpecLine ();
-
-  incLine ();
-  colNumber = 1;		
-
-  if (inComment)
-    {
-      ScanCComment ();
-
-      if (reportComments)
-	{
-	  *bufPtr = '\0';
-	  newToken = ltoken_createRaw (simpleId, lsymbol_fromChars (&tokenBuffer[0]));
-	  LCLScanFreshToken (newToken);
-	}
-    }
-
-  if (inSpecComment)
-    {
-      if (currentChar == '*' &&
-	  LOOKAHEADCHAR () == '/')
-	{
-	  LCLMOVECHAR ();
-	  LCLMOVECHAR ();
-	  inSpecComment = FALSE;
-	}
-    }
-
-  /*@+loopexec@*/ 
-  for (;;)
-    {
-      if (inSpecComment && currentChar == '*' && LOOKAHEADCHAR () == '/')
-	{
-	  LCLMOVECHAR ();
-	  LCLMOVECHAR ();
-	  inSpecComment = FALSE;
-	}
-
-      bufPtr = &tokenBuffer[0];	
-      startCol = colNumber;	
-
-      
-      /*@-loopswitchbreak@*/
-      switch (startClass[(int)currentChar])
-	{
-	case STARTCNUM:
-	  ScanCNumber ();
-	  break;
-
-	case STARTCNUMDOT:
-	  if (isDigit[(int) LOOKAHEADCHAR ()])
-	    {
-	      ScanCNumber ();
-	    }
-	  else
-	    {
-	      ScanOther ();
-	    }
-	  break;
-
-	case STARTCSTR:
-	  ScanCString ();
-	  break;
-
-	case STARTCCHAR:
-	  	  if (nextCanBeCharLiteral (prevTokenCode))
-	    {
-	      ScanCChar ();
-	    }
-	  else
-	    {
-	      	      ScanOther ();
-	    }
-	  break;
-
-	case STARTWIDE:
-	  if (LOOKAHEADCHAR () == 'L' && LOOKAHEADTWICECHAR () == '\"')
-	    {
-	      ScanCString ();
-	    }
-	  else if (LOOKAHEADCHAR () == 'L' && LOOKAHEADTWICECHAR () == '\'')
-	    {
-	      ScanCChar ();
-	    }
-	  else
-	    {
-	      ScanOther ();
-	    }
-	  break;
-
-	case STARTSLASH:
-	  if (LOOKAHEADCHAR () == '*')
-	    {
-	      LCLMOVECHAR ();
-	      LCLMOVECHAR ();
-
-	      if (currentChar == '@')
-		{
-		  char *s = mstring_createEmpty ();
-
-		  LCLMOVECHAR ();
-
-		  while (currentChar != '\0' && currentChar != ' ' 
-			 && currentChar != '*' && currentChar != '\t' &&
-			 currentChar != '\n')
-		    {
-		      s = mstring_append (s, currentChar);
-		      LCLMOVECHAR ();
-		    }
-
-		  if (mstring_equal (s, "alt"))
-		    {
-		      tokenCode = LLT_VERTICALBAR;
-		      tokenSym = lsymbol_fromChars ("|");
-		      inSpecComment = TRUE;
-		    }
-		  else
-		    {
-		      ScanCComment ();
-		      tokenCode = commentSym;
-		      tokenSym = CCommentSym;
-		    }
-
-		  sfree (s);
-		  break;
-		}
-	      else
-		{
-		  ScanCComment ();
-		  tokenCode = commentSym;
-		  tokenSym = CCommentSym;
-		  break;
-		}
-	    }
-	  else
-	    {
-	      ScanOther ();
-	    } break;
-
-	case STARTOTHER:
-	  ScanOther ();
-	  break;
-
-	default:
-	  llcontbuglit ("LCLScanLine: bad case");
-	  break;
-
-	}
-      /*@=loopswitchbreak@*/
-      
-     /*
-     ** Above code only "guessed" at token type.  Insert it into the 
-     ** TokenTable.  If the token already exists, it is returned as	    
-     ** previously defined.  If it does not exist, it is inserted as the 
-     ** token code computed above.					    
-     */
-      
-      newToken = LCLInsertToken (tokenCode, tokenSym, lsymbol_undefined, FALSE);
-      
-                  
-      if (LCLIsSyn (ltoken_getText (newToken)))
-	{
-	  /*
-	  ** Token is a synonym.  Get the actual token and set the raw    
-	  ** text to the synonym name.				    
-	  */
-
-	  newToken = ltoken_copy (LCLGetTokenForSyn (ltoken_getText (newToken)));
-
-	  ltoken_setRawText (newToken, tokenSym);
-	}
-      else
-	{
-	  newToken = ltoken_copy (newToken);
-	}
-
-      ltoken_setCol (newToken, startCol);
-      ltoken_setLine (newToken, tsource_thisLineNumber (LCLScanSource ()));
-      ltoken_setFileName (newToken, tsource_fileName (LCLScanSource ()));
-
-      if (ltoken_getCode (newToken) == commentSym)
-	{
-	  if (tokenSym == CCommentSym)
-	    { /* C-style comment   */
-	      ltoken_free (commentTok);
-	      commentTok = ltoken_copy (newToken);
-
-	      if (!inComment && reportComments)
-		{
-		  *bufPtr = '\0';
-		  ltoken_setRawText (newToken, 
-				     lsymbol_fromChars (&tokenBuffer[0]));
-		  LCLScanFreshToken (newToken);
-		}
-	      else
-		{
-		  ltoken_free (newToken); 
-		}
-	    }
-	  else
-	    { /* LSL-style comment */
-	      bufPtr = &tokenBuffer[0];
-	      while (!LCLIsEndComment (currentChar))
-		{
-		  LCLMOVECHAR ();
-		}
-	      if (LCLScanCharClass (currentChar) != CHC_NULL)
-		{
-		  /* Not EOL character.  Toss it out. */
-		  LCLMOVECHAR ();
-		}
-
-	      if (reportComments)
-		{
-		  *bufPtr = '\0';
-		  ltoken_setRawText (newToken, 
-				     lsymbol_fromChars (&tokenBuffer[0]));
-		  LCLScanFreshToken (newToken);
-		}
-	      else
-		{
-		  ltoken_free (newToken);
-		}
-	    }
-	}
-      else if (ltoken_getCode (newToken) == LLT_EOL)
-	{
-	  if (reportEOL)
-	    {
-	      LCLScanFreshToken (newToken);
-	    }
-	  else
-	    {
-	      ltoken_free (newToken); 
-	    }
-
-	  line[(int) linelength] = '\0';
-	  return;
-	}
-      else if (ltoken_getCode (newToken) != LLT_WHITESPACE)
-	{
-	  prevTokenCode = ltoken_getCode (newToken);
-	  LCLScanFreshToken (newToken);
-	}
-      else
-	{
-	  ltoken_free (newToken);
-	}
-    } /*@=loopexec@*/
-}
-
-/*@exposed@*/ ltoken
-LCLScanEofToken (void)
-{
-  ltoken t = LCLInsertToken (LEOFTOKEN, lsymbol_fromChars ("E O F"), 0, TRUE);
-
-  if (inComment)
-    {
-      lclerror (commentTok, cstring_makeLiteral ("Unterminated comment"));
-    }
-
-  ltoken_setCol (t, colNumber);
-  ltoken_setLine (t, tsource_thisLineNumber (LCLScanSource ()));
-  ltoken_setFileName (t, tsource_fileName (LCLScanSource ()));
-
-  return t;
-}
-
-void
-LCLReportEolTokens (bool setting)
-{
-  reportEOL = setting;
-}
-
-static void
-LocalUserError (char *msg)
-{
-  tsource *s = LCLScanSource ();
-  llfatalerror (message ("%s:%u,%u: %s", 
-			 cstring_fromChars (tsource_fileName (s)), 
-			 tsource_thisLineNumber (s),
-			 colNumber,
-			 cstring_fromChars (msg)));
-}
-
-void
-LCLScanLineInit (void)
-{
-  int i;
-
-  setCodePoint ();
-  reportEOL = FALSE;
-  reportComments = FALSE;
-
-  for (i = 0; i <= LASTCHAR; i++)
-    {
-      LCLcharClass[i] = charClassDef[i];
-    }
-
-  setCodePoint ();
-
-  /*
-  ** Make sure first postion is never used because use the 0th index to   
-  ** mean empty. 
-  */
-
-  firstReserved = lsymbol_fromChars (FIRSTRESERVEDNAME);
-  setCodePoint ();
-
-  /* Predefined LSL Tokens */
-  
-  ltoken_forall = LCLReserveToken (quantifierSym, "\\forall");
-  setCodePoint ();
-  ltoken_exists = LCLReserveToken (quantifierSym, "\\exists");
-  ltoken_implies = LCLReserveToken (logicalOp, "\\implies");
-  ltoken_eqsep = LCLReserveToken (eqSepSym, "\\eqsep");
-  ltoken_select = LCLReserveToken (selectSym, "\\select");
-  ltoken_open = LCLReserveToken (openSym, "\\open");
-  ltoken_sep = LCLReserveToken (sepSym, "\\,");
-  ltoken_close = LCLReserveToken (closeSym, "\\close");
-  ltoken_id = LCLReserveToken (simpleId, "\\:");
-  ltoken_arrow = LCLReserveToken (mapSym, "\\arrow");
-  ltoken_marker = LCLReserveToken (markerSym, "\\marker");
-  ltoken_pre = LCLReserveToken (preSym, "\\pre");
-  ltoken_post = LCLReserveToken (postSym, "\\post");
-  ltoken_comment = LCLReserveToken (commentSym, "\\comment");
-  ltoken_any = LCLReserveToken (anySym, "\\any");
-
-  ltoken_result = LCLReserveToken (LLT_RESULT, "result");
-  ltoken_typename = LCLReserveToken (LLT_TYPEDEF_NAME, "TYPEDEF_NAME");
-  ltoken_setIdType (ltoken_typename, SID_TYPE);
-
-  /*
-  ** Not context_getBoolName () --- "bool" is built in to LCL.
-  ** This is bogus, but necessary for a lot of old lcl files.
-  */
-
-  ltoken_bool = LCLReserveToken (LLT_TYPEDEF_NAME, "bool");
-
-  ltoken_lbracked = LCLReserveToken (LLT_LBRACKET, "[");
-  ltoken_rbracket = LCLReserveToken (LLT_RBRACKET, "]");
-
-  (void) LCLReserveToken (LLT_COLON, ":");
-  (void) LCLReserveToken (LLT_COMMA, ",");
-
-  (void) LCLReserveToken (LLT_EQUALS, "=");
-  (void) LCLReserveToken (LLT_LBRACE, "{");
-  (void) LCLReserveToken (LLT_LPAR, "(");
-  (void) LCLReserveToken (LLT_RBRACE, "}");
-  (void) LCLReserveToken (LLT_RPAR, ")");
-  (void) LCLReserveToken (LLT_SEMI, ";");
-  (void) LCLReserveToken (LLT_VERTICALBAR, "|");
-
-  (void) LCLReserveToken (LLT_MULOP, "*");
-
-  (void) LCLReserveToken (LLT_WHITESPACE, " ");
-  (void) LCLReserveToken (LLT_WHITESPACE, "\t");
-  (void) LCLReserveToken (LLT_WHITESPACE, "\f");
-  (void) LCLReserveToken (LLT_WHITESPACE, "\n");
-
-  (void) LCLReserveToken (LEOFTOKEN, "E O F");
-  (void) LCLReserveToken (LLT_EOL, "E O L");
-
-  /* LSL Keywords */
-  ltoken_and = LCLReserveToken (logicalOp, "\\and");
-  ltoken_or = LCLReserveToken (logicalOp, "\\or");
-
-  ltoken_equals = LCLReserveToken (equationSym, "\\equals");
-
-  ltoken_eq = LCLReserveToken (eqOp, "\\eq");
-  ltoken_neq = LCLReserveToken (eqOp, "\\neq");
-
-  ltoken_not = LCLReserveToken (simpleOp, "\\not");
-  ltoken_true = LCLReserveToken (simpleId, "true");
-  ltoken_false = LCLReserveToken (simpleId, "false");
-
-  /* LCL Keywords */
-  (void) LCLReserveToken (LLT_ALL, "all");
-  (void) LCLReserveToken (LLT_ANYTHING, "anything");
-  (void) LCLReserveToken (LLT_BE, "be");
-  (void) LCLReserveToken (LLT_CONSTANT, "constant");
-  (void) LCLReserveToken (LLT_CHECKS, "checks");
-  (void) LCLReserveToken (LLT_ELSE, "else");
-  (void) LCLReserveToken (LLT_ENSURES, "ensures");
-  (void) LCLReserveToken (LLT_FOR, "for");
-  (void) LCLReserveToken (LLT_IF, "if");
-  (void) LCLReserveToken (LLT_IMMUTABLE, "immutable");
-  (void) LCLReserveToken (LLT_OBJ, "obj");
-  (void) LCLReserveToken (LLT_OUT, "out");
-  (void) LCLReserveToken (LLT_ITER, "iter"); 
-  (void) LCLReserveToken (LLT_YIELD, "yield"); 
-  (void) LCLReserveToken (LLT_PARTIAL, "partial");
-  (void) LCLReserveToken (LLT_ONLY, "only");
-  (void) LCLReserveToken (LLT_UNDEF, "undef");
-  (void) LCLReserveToken (LLT_KILLED, "killed");
-  (void) LCLReserveToken (LLT_OWNED, "owned");
-  (void) LCLReserveToken (LLT_DEPENDENT, "dependent");
-  (void) LCLReserveToken (LLT_PARTIAL, "partial");
-  (void) LCLReserveToken (LLT_RELDEF, "reldef");
-  (void) LCLReserveToken (LLT_KEEP, "keep");
-  (void) LCLReserveToken (LLT_KEPT, "kept");
-  (void) LCLReserveToken (LLT_TEMP, "temp");
-  (void) LCLReserveToken (LLT_SHARED, "shared");
-  (void) LCLReserveToken (LLT_RELNULL, "relnull");
-  (void) LCLReserveToken (LLT_RELDEF, "reldef");
-  (void) LCLReserveToken (LLT_CHECKED, "checked");
-  (void) LCLReserveToken (LLT_UNCHECKED, "unchecked");
-  (void) LCLReserveToken (LLT_CHECKEDSTRICT, "checkedstrict");
-  (void) LCLReserveToken (LLT_CHECKMOD, "checkmod");
-  (void) LCLReserveToken (LLT_TRUENULL, "truenull");
-  (void) LCLReserveToken (LLT_FALSENULL, "falsenull");
-  (void) LCLReserveToken (LLT_LNULL, "null");
-  (void) LCLReserveToken (LLT_LNOTNULL, "notnull");
-  (void) LCLReserveToken (LLT_RETURNED, "returned");
-  (void) LCLReserveToken (LLT_OBSERVER, "observer");
-  (void) LCLReserveToken (LLT_EXPOSED, "exposed");
-  (void) LCLReserveToken (LLT_REFCOUNTED, "refcounted");
-  (void) LCLReserveToken (LLT_REFS, "refs");
-  (void) LCLReserveToken (LLT_NEWREF, "newref");
-  (void) LCLReserveToken (LLT_TEMPREF, "tempref");
-  (void) LCLReserveToken (LLT_KILLREF, "killref");
-  (void) LCLReserveToken (LLT_NULLTERMINATED, "nullterminated");
-  (void) LCLReserveToken (LLT_EXITS, "exits");
-  (void) LCLReserveToken (LLT_MAYEXIT, "mayexit");
-  (void) LCLReserveToken (LLT_TRUEEXIT, "trueexit");
-  (void) LCLReserveToken (LLT_FALSEEXIT, "falseexit");
-  (void) LCLReserveToken (LLT_NEVEREXIT, "neverexit");
-  (void) LCLReserveToken (LLT_SEF, "sef");
-  (void) LCLReserveToken (LLT_UNUSED, "unused");
-  (void) LCLReserveToken (LLT_UNIQUE, "unique");
-  (void) LCLReserveToken (LLT_IMPORTS, "imports");
-  (void) LCLReserveToken (LLT_CONSTRAINT, "constraint");
-  (void) LCLReserveToken (LLT_LET, "let");
-  (void) LCLReserveToken (LLT_MODIFIES, "modifies");
-  (void) LCLReserveToken (LLT_CLAIMS, "claims");
-  (void) LCLReserveToken (LLT_BODY, "body");
-  (void) LCLReserveToken (LLT_MUTABLE, "mutable");
-  (void) LCLReserveToken (LLT_FRESH, "fresh");
-  (void) LCLReserveToken (LLT_NOTHING, "nothing");
-  (void) LCLReserveToken (LLT_INTERNAL, "internalState");
-  (void) LCLReserveToken (LLT_FILESYS, "fileSystem");
-  (void) LCLReserveToken (LLT_PRIVATE, "private");
-  (void) LCLReserveToken (LLT_SPEC, "spec");
-  (void) LCLReserveToken (LLT_REQUIRES, "requires");
-  (void) LCLReserveToken (LLT_SIZEOF, "sizeof");
-  (void) LCLReserveToken (LLT_TAGGEDUNION, "taggedunion");
-  (void) LCLReserveToken (LLT_THEN, "then");
-  (void) LCLReserveToken (LLT_TYPE, "type");
-  (void) LCLReserveToken (LLT_TYPEDEF, "typedef");
-  (void) LCLReserveToken (LLT_UNCHANGED, "unchanged");
-  (void) LCLReserveToken (LLT_USES, "uses");
-  (void) LCLReserveToken (LLT_PRINTFLIKE, "printflike");
-  (void) LCLReserveToken (LLT_SCANFLIKE, "scanflike");
-  (void) LCLReserveToken (LLT_MESSAGELIKE, "messagelike");
-
-  /* LCL C Keywords */
-  (void) LCLReserveToken (LLT_CHAR, "char");
-  (void) LCLReserveToken (LLT_CONST, "const");
-  (void) LCLReserveToken (LLT_DOUBLE, "double");
-  (void) LCLReserveToken (LLT_ENUM, "enum");
-
-  /* comment out so we can add in lclinit.lci: synonym double float */
-  /* LCLReserveToken (LLT_FLOAT,		    "float"); */
-  /* But we need to make the scanner parse "float" not as a simpleId, but
-     as a TYPEDEF_NAME.  This is done later in abstract_init  */
-  
-  (void) LCLReserveToken (LLT_INT, "int");
-  (void) LCLReserveToken (LLT_LONG, "long");
-  (void) LCLReserveToken (LLT_SHORT, "short");
-  (void) LCLReserveToken (LLT_STRUCT, "struct");
-  (void) LCLReserveToken (LLT_SIGNED, "signed");
-  (void) LCLReserveToken (LLT_UNION, "union");
-  (void) LCLReserveToken (LLT_UNKNOWN, "__unknown");
-  (void) LCLReserveToken (LLT_UNSIGNED, "unsigned");
-  (void) LCLReserveToken (LLT_VOID, "void");
-  (void) LCLReserveToken (LLT_VOLATILE, "volatile");
-  setCodePoint ();
-}
-
-void
-LCLScanLineReset (void)
-{
-  inComment = FALSE;
-  prevTokenCode = LLT_LPAR;		/* Presume first ' starts literal */
-}
-
-void
-LCLScanLineCleanup (void)
-{
-}
-
-bool LCLIsEndComment (char c)
-{
-  return LCLcharClass[(int)(c)].endCommentChar;
-}
-
-charCode LCLScanCharClass (char c)
-{
-  return LCLcharClass[(int)(c)].code;
-}
-
-void LCLSetCharClass (char c, charCode cod) 
-{
-  LCLcharClass[(int)(c)].code = (cod);
-}
-
-void LCLSetEndCommentChar (char c, bool flag) 
-{
-  LCLcharClass[(int)(c)].endCommentChar = flag;
-}
-
diff --git a/src/lclsyntable.c b/src/lclsyntable.c
deleted file mode 100644
index 01193b1..0000000
--- a/src/lclsyntable.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** syntable.c
-**
-** Larch/C Interface language synonym table
-**
-**	This table stores synonyms for the Larch/C Interface Language.  It is
-**	essentially an array of token-handles indexed by string-handles.
-**	Therefore, synonyms (strings) can be converted to the actual token.
-**
-**  AUTHORS:
-**	J.P. Wild
-**
-**
-**  CREATION DATE:  90.08.10
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-# include "lcltokentable.h"
-# include "lclsyntable.h"
-
-static long unsigned MaxSyn;	/* size of SynTable[]              */
-static /*@only@*/ /*@reldef@*/ /*@null@*/ lsymbol *SynTable;
-static void
-  AllocSynTable (void)
-  /*@globals SynTable, MaxSyn@*/
-  /*@modifies *SynTable, MaxSyn@*/;
-
-void
-LCLAddSyn (lsymbol ntok, lsymbol otok)
-{
-  while (otok >= MaxSyn)
-    {
-      /* No more space available.  Allocate more. */
-      AllocSynTable ();
-    }
-
-  llassert (SynTable != NULL);
-
-  if (SynTable[ntok] == 0)
-    {
-     /* Entry is empty. Fill it in. */
-      SynTable[ntok] = otok;
-
-      /* Mark oldToken as having a synonym. */
-      LCLSetTokenHasSyn (otok, TRUE);
-    }
-  else
-    {
-      llbuglit ("LCLAddSyn: invalid argument");
-    }
-}
-
-/*@exposed@*/ ltoken
-LCLGetTokenForSyn (lsymbol ntok)
-{
-  llassert (SynTable != NULL);
-
-  if (!((ntok < MaxSyn) || (SynTable[ntok] != 0)))
-    llbuglit ("LCLGetSyn: bad argument");
-
-  return LCLGetToken (SynTable[ntok]);
-}
-
-bool
-LCLIsSyn (lsymbol str)
-{
-  if (MaxSyn == 0)
-    {
-      return FALSE;
-    }
-  else
-    {
-      llassert (SynTable != NULL);
-
-      if (str < MaxSyn)
-	{
-	  /* Check for synonym entry in table. */
-	  return (SynTable[str] != 0);
-	}
-      else
-	{
-	  /* No token for synonym.  Return FALSE. */
-	  return FALSE;
-	}
-    }
-}
-  
-static void
-AllocSynTable (void) /*@globals SynTable; @*/
-{
-  long unsigned newSize, oldSize;
-  long unsigned int i;
-
-  oldSize = MaxSyn;
-
-  if (oldSize == 0)
-    {
-      /* First time SynTable allocated.  Set initial size. */
-      newSize = INITSYNTABLE;
-      SynTable = (lsymbol *) dmalloc (newSize * sizeof (*SynTable));
-    }
-  else
-    {
-      lsymbol *oldSynTable = SynTable; 
-
-      llassert (oldSynTable != NULL);
-
-      /* Synonym table already allocated.  Calulate extension size. */
-      newSize = (unsigned long) (DELTASYNTABLE * oldSize);
-      SynTable = (lsymbol *) dmalloc (newSize * sizeof (*SynTable));
-
-      for (i = 0; i < oldSize; i++)
-	{
-	  SynTable[i] = oldSynTable[i];
-	}
-      
-      sfree (oldSynTable);
-    }
-
-  /* Zero out new allocated space.  Need to detect when cells are empty     */
-  /* and do this by checking that SynTable[x] == 0.			    */
-
-  /* ###  Should the "for" loop be replaced with the following?	            */
-  /* #if VMS								    */
-  /* # include ;						    */
-  /* #else								    */
-  /* # include ;						    */
-  /*									    */
-  /* memset (SynTable[oldSize], 0,					    */
-  /*	      (newSize - oldSize) * sizeof (*SynTable));		            */
-  
-  for (i = oldSize; i < newSize; i++)
-    {
-      SynTable[i] = 0;
-    }
-
-  MaxSyn = newSize;
-}
-
-
-void
-LCLSynTableInit (void)
-{
-  MaxSyn = 0;
-}
-
-void
-LCLSynTableReset (void)
-{
-}
-
-void
-LCLSynTableCleanup (void)
-{
-  sfree (SynTable);
-  SynTable = NULL;
-}
diff --git a/src/lcltokentable.c b/src/lcltokentable.c
deleted file mode 100644
index b1e124d..0000000
--- a/src/lcltokentable.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** tokentable.c
-**
-** Larch processors token table
-** This table stores predefined tokens for LCL.
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "lcltokentable.h"
-
-static long unsigned MaxToken; 
-static /*@only@*/ /*@null@*/ o_ltoken *LCLTokenTable = NULL;    
-
-static void AllocTokenTable (void) 
-   /*@globals LCLTokenTable@*/
-   /*@modifies LCLTokenTable, MaxToken@*/;
-
-ltoken 
-  LCLInsertToken (ltokenCode cod, lsymbol sym, lsymbol rTxt,
-		  bool isPredefined)
-{
-  /*
-  ** If the token is already in the token table, it is returned.  Otherwise,
-  ** the token is inserted into the table and then returned.
-  **
-  ** A new TokenTable is allocated when:
-  **   . The TokenTable[] is empty (initial case)
-  **   . The location where to insert the token is not in TokenTable[]
-  */
-
-  setCodePoint ();
-
-  while (sym >= MaxToken)
-    {
-      setCodePoint ();
-      /* No more space available.  Allocate more. */
-      AllocTokenTable ();
-    }
-  
-  llassert (LCLTokenTable != NULL);
-
-  if (ltoken_isUndefined (LCLTokenTable[sym]))
-    {
-      LCLTokenTable[sym] = ltoken_create (cod, sym);      
-      ltoken_setRawText (LCLTokenTable[sym], rTxt);
-      ltoken_setDefined (LCLTokenTable[sym], isPredefined);
-            return LCLTokenTable[sym];
-    }
-
-    return LCLTokenTable[sym];
-}
-
-void LCLUpdateToken (ltokenCode cod, lsymbol sym, bool def)
-{
-  llassert (LCLTokenTable != NULL);
-
-  if (!ltoken_isUndefined (LCLTokenTable[sym]))
-    {
-      ltoken_setCode (LCLTokenTable[sym], cod);
-      ltoken_setDefined (LCLTokenTable[sym], def);
-    }
-  else
-    {
-      llfatalbug (message ("LCLUpdateToken: %s", 
-			   cstring_fromChars (lsymbol_toChars (sym))));
-    }
-}
-
-void LCLSetTokenHasSyn (lsymbol sym, bool syn)
-{
-  llassert (LCLTokenTable != NULL);
-
-  if (!ltoken_isUndefined (LCLTokenTable[sym]))
-    {
-      ltoken_setHasSyn (LCLTokenTable[sym], syn);
-    }
-  else
-    {
-      llfatalbug (message ("LCLSetTokenHasSyn: null token (%d)", (int)sym));
-    }
-}
-
-ltoken LCLGetToken (lsymbol sym)
-{
-  llassert (LCLTokenTable != NULL);
-  llassert (sym < MaxToken);
-
-  return LCLTokenTable[sym];
-}
-
-#if 0
-bool LCLTokenTableContainsToken (ltoken tok)
-{
-  unsigned long i;
-
-  if (LCLTokenTable != NULL) {
-    for (i = 0; i < MaxToken; i++) {
-      if (LCLTokenTable[i] == tok) {
-	return TRUE;
-      }
-    }
-  }
-
-  return FALSE;
-}
-# endif
-
-/*@exposed@*/ ltoken
-LCLReserveToken (ltokenCode cod, char *txt)
-{
-  /*
-  ** The same context that was active when the string-handle
-  ** was derived by a previous call to lsymbol_fromChars (),
-  ** must be established.
-  */
-  lsymbol sym;
-
-  setCodePoint ();
-  sym = lsymbol_fromChars (txt);
-  
-  /* 
-  ** Reserved tokens never have raw text like synonyms.
-  */
-
-    return (LCLInsertToken (cod, sym, lsymbol_undefined, TRUE));
-}
-
-static void
-  AllocTokenTable (void) /*@globals LCLTokenTable; @*/ 
-{
-  long unsigned oldSize, newSize;
-  long unsigned int i;
-  
-  oldSize = MaxToken;
-
-  if (oldSize == 0)
-    {
-      newSize = INITTOKENTABLE;
-      llassert (LCLTokenTable == NULL);
-      LCLTokenTable = (ltoken *) dmalloc (newSize * sizeof (*LCLTokenTable));
-    }
-  else
-    {
-      o_ltoken *oldLCLTokenTable = LCLTokenTable;
-
-      llassert (oldLCLTokenTable != NULL);
-
-      newSize = (long unsigned) (DELTATOKENTABLE * oldSize);
-      LCLTokenTable = (ltoken *) dmalloc (newSize * sizeof (*LCLTokenTable));
-
-      for (i = 0; i < oldSize; i++)
-	{
-	  LCLTokenTable[i] = oldLCLTokenTable[i];
-	}
-      
-      sfree (oldLCLTokenTable);
-    }
-
-  MaxToken = newSize;
-  
-  /*@+loopexec@*/
-  for (i = oldSize; i < newSize; i++)
-    {
-      LCLTokenTable[i] = ltoken_undefined;
-    }
-  /*@=loopexec@*/
-/*@-compdef@*/ } /*=compdef@*/
-
-void
-LCLTokenTableInit (void)
-{
-    MaxToken = 0;
-}
-
-void
-LCLTokenTableCleanup (void)
-{
-    
-  if (LCLTokenTable != NULL)
-    {
-      long unsigned i;
-      
-      for (i = 0; i < MaxToken; i++)
-	{
-	  ltoken tok = LCLTokenTable[i];
-	  
-	  LCLTokenTable[i] = NULL;
-	  /*@-dependenttrans@*/ ltoken_free (tok);
-	  /*@=dependenttrans@*/
-	}
-      
-      sfree (LCLTokenTable); 
-      LCLTokenTable = NULL;
-    }
-
-  }
-
-
-
-
-
-
-
-
-
-
diff --git a/src/letDeclNodeList.c b/src/letDeclNodeList.c
deleted file mode 100644
index 4bc9fb9..0000000
--- a/src/letDeclNodeList.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** letDeclNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ letDeclNodeList
-letDeclNodeList_new ()
-{
-  letDeclNodeList s = (letDeclNodeList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = letDeclNodeListBASESIZE;
-  s->elements = (letDeclNode *)
-    dmalloc (sizeof (*s->elements) * letDeclNodeListBASESIZE);
-
-  return (s);
-}
-
-static void
-letDeclNodeList_grow (letDeclNodeList s)
-{
-  int i;
-  letDeclNode *newelements;
-
-  s->nspace += letDeclNodeListBASESIZE;
-
-  newelements = (letDeclNode *) dmalloc (sizeof (*newelements)
-					 * (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements); 
-  s->elements = newelements;
-}
-
-letDeclNodeList
-letDeclNodeList_add (letDeclNodeList s, letDeclNode el)
-{
-  llassert (letDeclNodeListBASESIZE > 0);
-
-  if (s->nspace <= 0)
-    letDeclNodeList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-
-  return s;
-}
-
-/*@only@*/ cstring
-letDeclNodeList_unparse (letDeclNodeList s)
-{
-  cstring st = cstring_undefined;
-
-  letDeclNodeList_elements (s, current)
-  {
-    st = message ("%qlet %s", st, ltoken_getRawString (current->varid));
-
-    if (current->sortspec != NULL)
-      {
-	st = message ("%q: %q", st, lclTypeSpecNode_unparse (current->sortspec));
-      }
-    else
-      {
-	st = message ("%q ", st);
-      }
-    st = message ("%q = %q\n", st, termNode_unparse (current->term));
-  } end_letDeclNodeList_elements;
-
-  return st;
-}
-
-void
-letDeclNodeList_free (letDeclNodeList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-      letDeclNode_free (s->elements[i]); 
-    }
-
-  sfree (s->elements);
-  sfree (s);
-}
diff --git a/src/lex.yy.c b/src/lex.yy.c
deleted file mode 100644
index 3d4a731..0000000
--- a/src/lex.yy.c
+++ /dev/null
@@ -1,5400 +0,0 @@
-/* A lexical scanner generated by flex */
-
-/* Scanner skeleton version:
- * $Header$
- */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-
-#include 
-
-
-/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
-#ifdef c_plusplus
-#ifndef __cplusplus
-#define __cplusplus
-#endif
-#endif
-
-
-#ifdef __cplusplus
-
-#include 
-#include 
-
-/* Use prototypes in function declarations. */
-#define YY_USE_PROTOS
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else	/* ! __cplusplus */
-
-#if __STDC__
-
-#define YY_USE_PROTOS
-#define YY_USE_CONST
-
-#endif	/* __STDC__ */
-#endif	/* ! __cplusplus */
-
-#ifdef __TURBOC__
- #pragma warn -rch
- #pragma warn -use
-#include 
-#include 
-#define YY_USE_CONST
-#define YY_USE_PROTOS
-#endif
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-
-#ifdef YY_USE_PROTOS
-#define YY_PROTO(proto) proto
-#else
-#define YY_PROTO(proto) ()
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index.  If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN yy_start = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START ((yy_start - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart( yyin )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#define YY_BUF_SIZE 16384
-
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-
-extern int yyleng;
-extern FILE *yyin, *yyout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-/* The funky do-while in the following #define is used to turn the definition
- * int a single C statement (which needs a semi-colon terminator).  This
- * avoids problems with code like:
- *
- * 	if ( condition_holds )
- *		yyless( 5 );
- *	else
- *		do_something_else();
- *
- * Prior to using the do-while the compiler would get upset at the
- * "else" because it interpreted the "if" statement as being all
- * done when it reached the ';' after the yyless() call.
- */
-
-/* Return all but the first 'n' matched characters back to the input stream. */
-
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-		*yy_cp = yy_hold_char; \
-		YY_RESTORE_YY_MORE_OFFSET \
-		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
-		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
-		} \
-	while ( 0 )
-
-#define unput(c) yyunput( c, yytext_ptr )
-
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-typedef unsigned int yy_size_t;
-
-
-struct yy_buffer_state
-	{
-	FILE *yy_input_file;
-
-	char *yy_ch_buf;		/* input buffer */
-	char *yy_buf_pos;		/* current position in input buffer */
-
-	/* Size of input buffer in bytes, not including room for EOB
-	 * characters.
-	 */
-	yy_size_t yy_buf_size;
-
-	/* Number of characters read into yy_ch_buf, not including EOB
-	 * characters.
-	 */
-	int yy_n_chars;
-
-	/* Whether we "own" the buffer - i.e., we know we created it,
-	 * and can realloc() it to grow it, and should free() it to
-	 * delete it.
-	 */
-	int yy_is_our_buffer;
-
-	/* Whether this is an "interactive" input source; if so, and
-	 * if we're using stdio for input, then we want to use getc()
-	 * instead of fread(), to make sure we stop fetching input after
-	 * each newline.
-	 */
-	int yy_is_interactive;
-
-	/* Whether we're considered to be at the beginning of a line.
-	 * If so, '^' rules will be active on the next match, otherwise
-	 * not.
-	 */
-	int yy_at_bol;
-
-	/* Whether to try to fill the input buffer when we reach the
-	 * end of it.
-	 */
-	int yy_fill_buffer;
-
-	int yy_buffer_status;
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
-	/* When an EOF's been seen but there's still some text to process
-	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-	 * shouldn't try reading from the input source any more.  We might
-	 * still have a bunch of tokens to match, though, because of
-	 * possible backing-up.
-	 *
-	 * When we actually see the EOF, we change the status to "new"
-	 * (via yyrestart()), so that the user can continue scanning by
-	 * just pointing yyin at a new input file.
-	 */
-#define YY_BUFFER_EOF_PENDING 2
-	};
-
-static YY_BUFFER_STATE yy_current_buffer = 0;
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- */
-#define YY_CURRENT_BUFFER yy_current_buffer
-
-
-/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
-
-static int yy_n_chars;		/* number of characters read into yy_ch_buf */
-
-
-int yyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 1;		/* whether we need to initialize */
-static int yy_start = 0;	/* start state number */
-
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin.  A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void yyrestart YY_PROTO(( FILE *input_file ));
-
-void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
-void yy_load_buffer_state YY_PROTO(( void ));
-YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
-void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
-void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
-#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
-
-YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
-YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
-YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
-
-static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
-static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
-static void yy_flex_free YY_PROTO(( void * ));
-
-#define yy_new_buffer yy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
-	{ \
-	if ( ! yy_current_buffer ) \
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-	yy_current_buffer->yy_is_interactive = is_interactive; \
-	}
-
-#define yy_set_bol(at_bol) \
-	{ \
-	if ( ! yy_current_buffer ) \
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
-	yy_current_buffer->yy_at_bol = at_bol; \
-	}
-
-#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
-
-typedef unsigned char YY_CHAR;
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-typedef int yy_state_type;
-extern char *yytext;
-#define yytext_ptr yytext
-
-static yy_state_type yy_get_previous_state YY_PROTO(( void ));
-static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
-static int yy_get_next_buffer YY_PROTO(( void ));
-static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
-	yytext_ptr = yy_bp; \
-	yyleng = (int) (yy_cp - yy_bp); \
-	yy_hold_char = *yy_cp; \
-	*yy_cp = '\0'; \
-	yy_c_buf_p = yy_cp;
-
-#define YY_NUM_RULES 180
-#define YY_END_OF_BUFFER 181
-static yyconst short int yy_accept[529] =
-    {   0,
-        0,    0,  181,  179,  159,  160,  147,  179,    3,   82,
-      153,  146,  179,  141,  142,  151,  150,  138,  149,  145,
-      152,   97,   97,  139,  135,  154,  140,  155,  158,  179,
-       82,  143,  178,  144,  156,   82,   82,   82,   82,   82,
-       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
-       82,   82,   82,   82,   82,   82,  136,  157,  137,  148,
-      134,    0,   42,    0,    2,   82,  120,  176,  177,  129,
-      121,    0,    0,  118,  126,  116,  127,  117,  128,    0,
-      110,    1,  119,  113,   90,    0,   99,   98,    0,   97,
-      125,  131,  133,  132,  124,    0,    0,    0,   82,  122,
-
-       82,   82,   82,   82,   82,   82,   82,   82,    9,   82,
-       82,   82,   82,   82,   82,   82,   13,   44,   82,   82,
-       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
-       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
-       82,   82,   82,   82,   82,   82,  123,  130,    0,    0,
-        2,  104,    4,    0,  108,  109,  110,    0,  111,  112,
-       92,   91,    0,  107,  100,  101,  101,   83,  115,  114,
-      166,  167,  164,  169,  174,  165,  175,  170,  173,  168,
-      171,  172,    0,    0,   82,   82,   82,   82,   82,   82,
-       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
-
-       82,   82,   11,   82,   82,   27,   82,   82,   82,   82,
-       82,   82,   82,   82,   82,   82,   43,   82,   82,   82,
-       82,   82,   82,   74,   82,   82,   82,   82,   82,   82,
-       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
-       82,   82,   82,   82,   82,    0,   42,    0,    0,  110,
-        0,  108,  109,    0,  113,   93,   94,   94,  105,  106,
-      103,  102,   84,   86,  163,    0,    0,   82,   82,   82,
-       82,   39,   82,    6,   29,   82,   82,   82,   82,   82,
-       82,   10,   25,   82,   82,   82,   82,   12,   82,   82,
-       82,   51,   82,   31,   82,   82,   52,   82,   82,   68,
-
-       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
-       82,   82,   82,   82,   82,   82,   82,   82,   82,   82,
-       82,   82,   82,   82,   82,   26,   82,   82,   82,    0,
-      110,   96,   95,   85,   87,   87,    0,  162,   82,   82,
-       82,   82,    5,   82,   36,   82,   82,   82,   82,   82,
-       82,   82,   30,   82,   82,   82,   82,   82,   82,   82,
-       82,   82,   82,   69,   82,   82,   82,   82,   82,   82,
-       82,   32,   82,   82,   82,   82,   82,   82,   82,   82,
-       82,   82,   77,   24,   82,   82,   82,   82,   82,   18,
-       76,   89,   88,  161,   82,   80,   82,   82,   82,   82,
-
-       82,   82,   82,   28,   82,   38,   82,   21,   82,   54,
-       78,   82,   60,   82,   82,   82,   82,   82,   82,   82,
-       58,   82,   14,   75,   34,   15,   82,   41,   22,   17,
-       82,   82,   82,   82,   82,   72,   19,   20,   82,   81,
-       37,   47,   64,   82,   82,    8,   82,   59,   82,   82,
-       82,   62,   53,   82,   82,   82,   45,   82,   82,   57,
-       82,   46,   61,   82,   23,   82,   82,   82,   82,   65,
-        7,   82,   73,   82,   82,   82,   70,   16,   82,   40,
-       82,   55,   82,   33,   35,   82,   71,   56,   82,   82,
-       82,   82,   67,   82,   82,   82,   82,   63,   82,   82,
-
-       82,   82,   82,   82,   82,   82,   48,   82,   82,   82,
-       66,   82,   82,   82,   79,   82,   82,   82,   82,   82,
-       82,   82,   82,   50,   82,   82,   49,    0
-    } ;
-
-static yyconst int yy_ec[256] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
-        4,    4,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    2,    5,    6,    7,    8,    9,   10,   11,   12,
-       13,   14,   15,   16,   17,   18,   19,   20,   21,   21,
-       21,   21,   21,   21,   21,   21,   21,   22,   23,   24,
-       25,   26,   27,   28,   29,   30,   31,   30,   32,   33,
-       34,    8,    8,    8,   35,   36,   37,    8,    8,    8,
-       38,   39,   40,   41,   42,    8,   43,   44,    8,   45,
-       46,   47,   48,   49,   50,    1,   51,   52,   53,   54,
-
-       55,   56,   57,   58,   59,    8,   60,   61,   62,   63,
-       64,   65,    8,   66,   67,   68,   69,   70,   71,   72,
-       73,   74,   75,   76,   77,   78,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1
-    } ;
-
-static yyconst int yy_meta[79] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    2,    1,    1,
-        3,    1,    1,    1,    1,    1,    1,    1,    1,    4,
-        4,    1,    1,    1,    1,    1,    1,    1,    5,    5,
-        5,    5,    5,    2,    2,    2,    2,    2,    2,    2,
-        2,    2,    2,    2,    2,    1,    1,    1,    1,    2,
-        5,    5,    5,    5,    5,    5,    2,    2,    2,    2,
-        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
-        2,    2,    2,    2,    1,    1,    1,    1
-    } ;
-
-static yyconst short int yy_base[536] =
-    {   0,
-        0,    0,  678,  679,  679,  679,  652,   73,    0,    0,
-       55,   71,  629,  679,  679,  650,   67,  679,   68,   66,
-       74,   80,   85,  679,  679,   65,  649,   82,  679,   91,
-      622,  679,  679,  679,  647,  621,   28,  604,   67,   40,
-       65,   72,  605,   88,   55,  604,   79,  101,  616,  611,
-      103,   90,  602,   51,  606,  604,  679,  113,  679,  679,
-      679,  133,  163,  659,    0,    0,  679,  679,  679,  679,
-      679,  100,  139,  679,  679,  679,  679,  679,  679,  643,
-      155,  679,  679,  162,  172,  164,  160,  142,    0,  204,
-      635,  679,  679,  679,  634,  245,  621,  621,  584,  679,
-
-      602,  581,  585,  597,  584,  122,  587,  141,  580,  581,
-      578,  144,  585,  581,  578,  575,    0,   99,  579,  586,
-      579,  576,  567,  569,  575,  568,  578,  572,  564,  568,
-      564,  174,  573,  135,  158,  573,  154,  568,  564,  556,
-      559,  184,  573,  167,  563,  566,  679,  679,  242,  153,
-        0,  679,  679,  235,  679,  679,  251,  243,  679,  679,
-      233,  230,  241,  272,  165,  679,  234,  261,  679,  679,
-      679,  579,  679,  679,  679,  679,  679,  679,  679,  679,
-      679,  679,  580,  581,  228,  553,  548,  551,  563,  558,
-      546,  558,  231,  559,  554,  556,  552,  544,  541,  549,
-
-      536,  551,    0,  537,  541,  544,  529,  532,  535,  538,
-      528,  530,  531,  536,  523,  516,    0,  533,  519,  533,
-      526,  246,  515,    0,  517,  516,  518,  525,  526,  510,
-      508,  508,  510,  519,  518,  514,  516,  506,  510,  501,
-      203,  513,  515,  504,  503,  271,  308,  560,  295,  299,
-      306,  679,  679,  304,  316,  262,  679,  277,  679,  679,
-      679,  679,  298,  281,  679,  534,  522,  505,  504,  495,
-      484,    0,  496,    0,    0,  495,  486,  494,  483,  488,
-      489,    0,    0,  482,  482,  492,  478,    0,  482,  487,
-      482,    0,  284,    0,  487,  472,  472,  473,  483,    0,
-
-      483,  477,  471,  467,  478,  463,  465,  475,  461,  473,
-      463,  467,  466,  471,  470,  456,  458,  466,  464,  462,
-      454,  459,  460,  448,  460,    0,  444,  456,  456,  323,
-      325,  679,  679,  287,  679,  305,  481,  679,  457,  439,
-      439,  440,    0,  292,    0,  441,  442,  448,  446,  445,
-      436,  435,    0,  442,  430,  434,  440,  438,  436,  430,
-      435,  419,  420,    0,  436,  417,  417,  428,  422,  419,
-      427,    0,  426,  423,  427,  424,  408,  417,  419,  404,
-      417,  418,    0,    0,  407,  415,  411,  406,  407,    0,
-        0,  679,  679,  679,  411,    0,  396,  408,  408,  397,
-
-      391,  391,  403,    0,  403,  405,  386,    0,  403,    0,
-        0,  397,    0,  391,  385,  395,  385,  387,  384,  391,
-        0,  384,    0,    0,  385,    0,  382,    0,    0,    0,
-      386,  380,  384,  379,  383,    0,    0,    0,  376,    0,
-        0,    0,  369,  381,  379,    0,  370,    0,  371,  370,
-      369,    0,    0,  367,  362,  371,    0,  358,  359,    0,
-      361,    0,    0,  362,    0,  367,  367,  365,  351,    0,
-        0,  350,    0,  356,  348,  347,    0,    0,  347,    0,
-      329,    0,  340,  334,    0,  319,    0,    0,  311,  320,
-      328,  325,    0,  316,  319,  311,  324,    0,  317,  305,
-
-      318,  315,  301,  302,  310,  296,    0,  308,  311,  300,
-        0,  299,  290,  282,    0,  233,  245,  176,  186,  174,
-      151,  158,  128,    0,   48,   28,    0,  679,  386,  390,
-      394,  399,  403,  405,  410
-    } ;
-
-static yyconst short int yy_def[536] =
-    {   0,
-      528,    1,  528,  528,  528,  528,  528,  529,  530,  531,
-      528,  528,  532,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      531,  528,  528,  528,  528,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  528,  528,  528,  528,
-      528,  529,  528,  529,  533,  531,  528,  528,  528,  528,
-      528,  532,  532,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  534,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  531,  528,
-
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  528,  528,  528,  535,
-      533,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  534,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  535,  528,  535,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  528,  528,  528,  531,  531,  531,  531,  531,  531,
-
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
-      531,  531,  531,  531,  531,  531,  531,    0,  528,  528,
-      528,  528,  528,  528,  528
-    } ;
-
-static yyconst short int yy_nxt[758] =
-    {   0,
-        4,    5,    6,    5,    7,    8,    9,   10,   11,   12,
-       13,   14,   15,   16,   17,   18,   19,   20,   21,   22,
-       23,   24,   25,   26,   27,   28,   29,   30,   10,   10,
-       10,   10,   10,   10,   10,   10,   31,   10,   10,   10,
-       10,   10,   10,   10,   10,   32,   33,   34,   35,   36,
-       37,   38,   39,   40,   41,   42,   43,   10,   44,   45,
-       46,   10,   47,   48,   49,   50,   51,   52,   53,   54,
-       55,   10,   56,   10,   57,   58,   59,   60,   63,   67,
-       70,   75,  527,   80,   77,   81,   81,   82,   91,   92,
-      102,   76,   78,   79,  108,   71,  103,   84,   83,   85,
-
-       85,  143,   84,  109,   90,   90,   94,   95,   96,  120,
-      152,   86,  526,  121,  144,   87,   86,  105,   97,   64,
-       87,   88,  113,   89,  106,  110,   88,  111,   98,   68,
-      107,   69,  114,  123,   86,  115,  112,  147,   63,   86,
-       87,  528,  124,  117,  139,   87,   73,  125,   88,   72,
-      118,   89,  126,   88,  119,  140,  127,  133,  247,  205,
-      134,  135,  141,  128,  149,  149,  206,  136,  150,  129,
-      137,  130,  191,  138,   81,   81,  192,  167,  163,   64,
-      163,  157,  157,  164,  164,  225,  154,  155,  148,   84,
-      156,   85,   85,  158,  159,  165,  194,  160,  226,  248,
-
-      525,  166,  167,   86,  230,  195,  261,  161,  199,  154,
-      155,  200,  524,  162,  227,  156,  158,  159,  523,  231,
-      165,   84,  160,   90,   90,  242,   86,  243,  166,  220,
-      221,  228,  161,  261,  222,   86,  236,  237,  522,   87,
-      162,  223,  238,  149,  149,   88,  521,  150,  520,  249,
-      239,  249,  240,  324,  250,  250,  325,  254,   86,  254,
-      164,  164,  255,  255,   87,  258,  268,  269,  256,  262,
-      157,  157,   88,  171,  257,  172,  247,  173,  174,  175,
-      176,  177,  251,  252,  178,  179,  253,  180,  181,  182,
-      258,  164,  164,  256,  262,  519,  263,  277,  278,  305,
-
-      518,  257,  264,  332,  259,  251,  252,  260,  306,  149,
-      149,  253,  333,  150,  250,  250,  336,  248,  250,  250,
-      330,  263,  330,  255,  255,  331,  331,  259,  392,  264,
-      332,  155,  260,  334,  156,  255,  255,  333,  357,  335,
-      393,  336,  331,  331,  331,  331,  399,  517,  159,  358,
-      516,  160,  515,  400,  155,  392,  514,  252,  334,  156,
-      253,  513,  512,  511,  510,  393,  335,  509,  508,  507,
-      506,  159,  505,  504,  503,  502,  160,  501,  500,  499,
-      252,  498,  497,  496,  495,  253,   62,   62,   62,   62,
-       62,   65,  494,  493,   65,   66,  492,   66,   66,   72,
-
-       72,  491,   72,   72,  151,  490,  151,  151,  168,  168,
-      246,  246,  246,  246,  246,  489,  488,  487,  486,  485,
-      484,  483,  482,  481,  480,  479,  478,  477,  476,  475,
-      474,  473,  472,  471,  470,  469,  468,  467,  466,  465,
-      464,  463,  462,  461,  460,  459,  458,  457,  456,  455,
-      454,  453,  452,  451,  450,  449,  448,  447,  446,  445,
-      444,  443,  442,  441,  440,  439,  438,  437,  436,  435,
-      434,  433,  432,  431,  430,  429,  428,  427,  426,  425,
-      424,  423,  422,  421,  420,  419,  418,  417,  416,  415,
-      414,  413,  412,  411,  410,  409,  408,  407,  406,  405,
-
-      404,  403,  402,  401,  398,  397,  396,  395,  394,  391,
-      390,  389,  388,  387,  386,  385,  384,  383,  382,  381,
-      380,  379,  378,  377,  376,  375,  374,  373,  372,  371,
-      370,  369,  368,  367,  366,  365,  364,  363,  362,  361,
-      360,  359,  356,  355,  354,  353,  352,  351,  350,  349,
-      348,  347,  346,  345,  344,  343,  342,  341,  340,  339,
-      338,  337,  528,  329,  328,  327,  326,  323,  322,  321,
-      320,  319,  318,  317,  316,  315,  314,  313,  312,  311,
-      310,  309,  308,  307,  304,  303,  302,  301,  300,  299,
-      298,  297,  296,  295,  294,  293,  292,  291,  290,  289,
-
-      288,  287,  286,  285,  284,  283,  282,  281,  280,  279,
-      276,  275,  274,  273,  272,  271,  270,  267,  266,  265,
-      245,  244,  241,  235,  234,  233,  232,  229,  224,  219,
-      218,  217,  216,  215,  214,  213,  212,  211,  210,  209,
-      208,  207,  204,  203,  202,  201,  198,  197,  196,  193,
-      190,  189,  188,  187,  186,  185,  184,  183,  170,  169,
-      153,  528,  146,  145,  142,  132,  131,  122,  116,  104,
-      101,  100,   99,   93,   74,   73,   61,  528,    3,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528
-    } ;
-
-static yyconst short int yy_chk[758] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    8,   11,
-       12,   17,  526,   20,   19,   20,   20,   21,   26,   26,
-       37,   17,   19,   19,   40,   12,   37,   22,   21,   22,
-
-       22,   54,   23,   40,   23,   23,   28,   28,   30,   45,
-       72,   22,  525,   45,   54,   22,   23,   39,   30,    8,
-       23,   22,   42,   22,   39,   41,   23,   41,   30,   11,
-       39,   11,   42,   47,   22,   42,   41,   58,   62,   23,
-       22,   73,   47,   44,   52,   23,   72,   47,   22,   73,
-       44,   22,   48,   23,   44,   52,   48,   51,  150,  118,
-       51,   51,   52,   48,   63,   63,  118,   51,   63,   48,
-       51,   48,  106,   51,   81,   81,  106,   88,   86,   62,
-       86,   84,   84,   86,   86,  134,   81,   81,   58,   85,
-       81,   85,   85,   84,   84,   87,  108,   84,  134,  150,
-
-      523,   87,   88,   85,  137,  108,  165,   85,  112,   81,
-       81,  112,  522,   85,  135,   81,   84,   84,  521,  137,
-       87,   90,   84,   90,   90,  144,   85,  144,   87,  132,
-      132,  135,   85,  165,  132,   90,  142,  142,  520,   90,
-       85,  132,  142,  149,  149,   90,  519,  149,  518,  154,
-      142,  154,  142,  241,  154,  154,  241,  158,   90,  158,
-      163,  163,  158,  158,   90,  162,  185,  185,  161,  167,
-      157,  157,   90,   96,  161,   96,  246,   96,   96,   96,
-       96,   96,  157,  157,   96,   96,  157,   96,   96,   96,
-      162,  164,  164,  161,  167,  517,  168,  193,  193,  222,
-
-      516,  161,  168,  256,  164,  157,  157,  164,  222,  247,
-      247,  157,  258,  247,  249,  249,  264,  246,  250,  250,
-      251,  168,  251,  254,  254,  251,  251,  164,  334,  168,
-      256,  250,  164,  263,  250,  255,  255,  258,  293,  263,
-      336,  264,  330,  330,  331,  331,  344,  514,  255,  293,
-      513,  255,  512,  344,  250,  334,  510,  331,  263,  250,
-      331,  509,  508,  506,  505,  336,  263,  504,  503,  502,
-      501,  255,  500,  499,  497,  496,  255,  495,  494,  492,
-      331,  491,  490,  489,  486,  331,  529,  529,  529,  529,
-      529,  530,  484,  483,  530,  531,  481,  531,  531,  532,
-
-      532,  479,  532,  532,  533,  476,  533,  533,  534,  534,
-      535,  535,  535,  535,  535,  475,  474,  472,  469,  468,
-      467,  466,  464,  461,  459,  458,  456,  455,  454,  451,
-      450,  449,  447,  445,  444,  443,  439,  435,  434,  433,
-      432,  431,  427,  425,  422,  420,  419,  418,  417,  416,
-      415,  414,  412,  409,  407,  406,  405,  403,  402,  401,
-      400,  399,  398,  397,  395,  389,  388,  387,  386,  385,
-      382,  381,  380,  379,  378,  377,  376,  375,  374,  373,
-      371,  370,  369,  368,  367,  366,  365,  363,  362,  361,
-      360,  359,  358,  357,  356,  355,  354,  352,  351,  350,
-
-      349,  348,  347,  346,  342,  341,  340,  339,  337,  329,
-      328,  327,  325,  324,  323,  322,  321,  320,  319,  318,
-      317,  316,  315,  314,  313,  312,  311,  310,  309,  308,
-      307,  306,  305,  304,  303,  302,  301,  299,  298,  297,
-      296,  295,  291,  290,  289,  287,  286,  285,  284,  281,
-      280,  279,  278,  277,  276,  273,  271,  270,  269,  268,
-      267,  266,  248,  245,  244,  243,  242,  240,  239,  238,
-      237,  236,  235,  234,  233,  232,  231,  230,  229,  228,
-      227,  226,  225,  223,  221,  220,  219,  218,  216,  215,
-      214,  213,  212,  211,  210,  209,  208,  207,  206,  205,
-
-      204,  202,  201,  200,  199,  198,  197,  196,  195,  194,
-      192,  191,  190,  189,  188,  187,  186,  184,  183,  172,
-      146,  145,  143,  141,  140,  139,  138,  136,  133,  131,
-      130,  129,  128,  127,  126,  125,  124,  123,  122,  121,
-      120,  119,  116,  115,  114,  113,  111,  110,  109,  107,
-      105,  104,  103,  102,  101,   99,   98,   97,   95,   91,
-       80,   64,   56,   55,   53,   50,   49,   46,   43,   38,
-       36,   35,   31,   27,   16,   13,    7,    3,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528,  528,  528,  528,
-      528,  528,  528,  528,  528,  528,  528
-    } ;
-
-static yy_state_type yy_last_accepting_state;
-static char *yy_last_accepting_cpos;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
-#line 1 "cscanner.l"
-#define INITIAL 0
-/*;-*-C-*-; 
-** Copyright (c) Massachusetts Institute of Technology 1994-1998.
-**          All Rights Reserved.
-**          Unpublished rights reserved under the copyright laws of
-**          the United States.
-**
-** THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
-** OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
-**
-** This code is distributed freely and may be used freely under the 
-** following conditions:
-**
-**     1. This notice may not be removed or altered.
-**
-**     2. Works derived from this code are not distributed for
-**        commercial gain without explicit permission from MIT 
-**        (for permission contact lclint-request@sds.lcs.mit.edu).
-*/
-/*
- * Modified by Herbert 08/19/97:
- * - added #include for IBM's OS/2 compiler.
- * - fixed weird bug with lookup of tmp files (OS/2 and MSDOS only).
- */
-/*
- * Modified by Mike Smith 
- * Corrected missing 'line' in scanf() calls in handleSpecial().
- * Without this, I get an error when LCLint hits a '#line' directive
- * in the pre-pre-processed source files. For safety, I have made these
- * conditional on OS2 and MSDOS because I don't understand why noone else
- * has seen this problem.
- *
- * Modified by Mike Smith, 4th June 1997
- * Finally resolved the #line problem.  The scanf() calls have been fixed to
- * allow the following #line forms:-
- *
- *        #line 123 "filename"
- *        #line 123
- *        # 123 "filename"
- *        # 123
- *
- * The last two are generated by the GNU pre-processor, apparently
- */
-#line 56 "cscanner.l"
-/*
-** based on original C lexer by Nate Osgood
-**    from hacrat@catfish.lcs.mit.edu Mon Jun 14 13:06:32 1993
-**
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-# include "cgrammar.h"
-# include "cgrammar_tokens.h"
-
-# include "fileIdList.h"
-# include "portab.h"
-
-# if defined(OS2) && defined(__IBMC__)
-   /* needed for isatty()... */
-# include 
-# endif
-
-static bool lastWasString = FALSE;
-static char savechar = '\0';
-
-/*@notfunction@*/
-# define yyinput() (incColumn (), getc (yyin))
-
-/*@-noparams@*/
-/*@-incondefs@*/
-extern /*@external@*/ int read ();
-/*@=incondefs@*/
-/*@=noparams@*/
-
-static /*@owned@*/ cstring lastidprocessed = cstring_undefined;
-
-static int lminput (void);
-static int tokLength = 0;
-static bool inSpecPart = FALSE;
-static bool continueLine = FALSE;
-
-static int ninput (void);
-static char processChar (void);
-static double processFloat (void);
-static /*@only@*/ exprNode processString (void);
-static long processDec (void);
-static long processHex (void);
-static long processOctal (void);
-static int processIdentifier (/*@only@*/ cstring)
-   /*@globals undef lastidprocessed@*/ ;
-static bool processHashIdentifier (/*@only@*/ cstring)
-   /*@globals undef lastidprocessed@*/ ;
-
-static int processSpec (int);
-static bool handleSpecial (char *);
-static int handleLlSpecial (void);
-static void handleMacro (void);
-static bool processMacro (void);
-static /*@only@*/ cstring makeIdentifier (char *);
-
-/* yes, this is exported! */
-bool g_expectingTypeName = TRUE; /* beginning of file can be type name! */
-
-static int returnInt (ctype, long);
-static int returnFloat (ctype, double);
-static int returnChar (char);
-static void setTokLength (int) /*@modifies g_currentloc@*/ ;
-static void setTokLengthT (size_t) /*@modifies g_currentloc@*/ ;
-
-static void advanceLine (void)
-{
-  tokLength = 0;
-  beginLine ();
-}
-    
-/*@-allmacros@*/
-# define RETURN_INT(c,i) \
-  do { lastWasString = FALSE; \
-       return (returnInt (c, i)); } while (FALSE)
-
-# define RETURN_FLOAT(c,f) \
-  do { lastWasString = FALSE; \
-       return (returnFloat (c, f)); \
-       } while (FALSE)
-
-# define RETURN_CHAR(c) \
-  do { lastWasString = FALSE; \
-       return (returnChar (c)); \
-     } while (FALSE)
-
-# define RETURN_TOK(t) \
-  do { yylval.tok = lltok_create (t, fileloc_decColumn (g_currentloc, tokLength)); \
-       tokLength = 0; \
-       lastWasString = FALSE; \
-       return (t); } while (FALSE)
-
-# define RETURN_TYPE(t, ct) \
-  do { yylval.ctyp = ct; tokLength = 0; return (t); } while (FALSE)
-
-/* don't fileloc_decColumn (g_currentloc, tokLength));  
-   the string could have \n's in it!
-*/
-
-# define RETURN_STRING(c) \
- do { yylval.expr = exprNode_stringLiteral (c, fileloc_decColumn (g_currentloc, tokLength)); \
-      tokLength = 0; \
-      lastWasString = TRUE; \
-      return (CCONSTANT); } while (FALSE)
-
-# define RETURN_EXPR(e) \
- do { yylval.expr = e; \
-      tokLength = 0; \
-      lastWasString = TRUE; \
-      return (CCONSTANT); } while (FALSE)
-
-/*@=allmacros@*/
-
-static void setTokLength (int len) 
-{
-  addColumn (len);
-  tokLength = len;
-}
-
-static void setTokLengthT (size_t len)
-{
-  setTokLength (size_toInt (len));
-}
-
-# include "flex.head"
-#line 877 "lex.yy.c"
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap YY_PROTO(( void ));
-#else
-extern int yywrap YY_PROTO(( void ));
-#endif
-#endif
-
-#ifndef YY_NO_UNPUT
-static void yyunput YY_PROTO(( int c, char *buf_ptr ));
-#endif
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen YY_PROTO(( yyconst char * ));
-#endif
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-static int yyinput YY_PROTO(( void ));
-#else
-static int input YY_PROTO(( void ));
-#endif
-#endif
-
-#if YY_STACK_USED
-static int yy_start_stack_ptr = 0;
-static int yy_start_stack_depth = 0;
-static int *yy_start_stack = 0;
-#ifndef YY_NO_PUSH_STATE
-static void yy_push_state YY_PROTO(( int new_state ));
-#endif
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state YY_PROTO(( void ));
-#endif
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state YY_PROTO(( void ));
-#endif
-
-#else
-#define YY_NO_PUSH_STATE 1
-#define YY_NO_POP_STATE 1
-#define YY_NO_TOP_STATE 1
-#endif
-
-#ifdef YY_MALLOC_DECL
-YY_MALLOC_DECL
-#else
-#if __STDC__
-#ifndef __cplusplus
-#include 
-#endif
-#else
-/* Just try to get by without declaring the routines.  This will fail
- * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
- * or sizeof(void*) != sizeof(int).
- */
-#endif
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
-#endif
-
-/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
-	if ( yy_current_buffer->yy_is_interactive ) \
-		{ \
-		int c = '*', n; \
-		for ( n = 0; n < max_size && \
-			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
-			buf[n] = (char) c; \
-		if ( c == '\n' ) \
-			buf[n++] = (char) c; \
-		if ( c == EOF && ferror( yyin ) ) \
-			YY_FATAL_ERROR( "input in flex scanner failed" ); \
-		result = n; \
-		} \
-	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
-		  && ferror( yyin ) ) \
-		YY_FATAL_ERROR( "input in flex scanner failed" );
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL int yylex YY_PROTO(( void ))
-#endif
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
-	YY_USER_ACTION
-
-YY_DECL
-	{
-	register yy_state_type yy_current_state;
-	register char *yy_cp, *yy_bp;
-	register int yy_act;
-
-#line 185 "cscanner.l"
-
-
-#line 1031 "lex.yy.c"
-
-	if ( yy_init )
-		{
-		yy_init = 0;
-
-#ifdef YY_USER_INIT
-		YY_USER_INIT;
-#endif
-
-		if ( ! yy_start )
-			yy_start = 1;	/* first start state */
-
-		if ( ! yyin )
-			yyin = stdin;
-
-		if ( ! yyout )
-			yyout = stdout;
-
-		if ( ! yy_current_buffer )
-			yy_current_buffer =
-				yy_create_buffer( yyin, YY_BUF_SIZE );
-
-		yy_load_buffer_state();
-		}
-
-	while ( 1 )		/* loops until end-of-file is reached */
-		{
-		yy_cp = yy_c_buf_p;
-
-		/* Support of yytext. */
-		*yy_cp = yy_hold_char;
-
-		/* yy_bp points to the position in yy_ch_buf of the start of
-		 * the current run.
-		 */
-		yy_bp = yy_cp;
-
-		yy_current_state = yy_start;
-yy_match:
-		do
-			{
-			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-			if ( yy_accept[yy_current_state] )
-				{
-				yy_last_accepting_state = yy_current_state;
-				yy_last_accepting_cpos = yy_cp;
-				}
-			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-				{
-				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 529 )
-					yy_c = yy_meta[(unsigned int) yy_c];
-				}
-			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-			++yy_cp;
-			}
-		while ( yy_base[yy_current_state] != 679 );
-
-yy_find_action:
-		yy_act = yy_accept[yy_current_state];
-		if ( yy_act == 0 )
-			{ /* have to back up */
-			yy_cp = yy_last_accepting_cpos;
-			yy_current_state = yy_last_accepting_state;
-			yy_act = yy_accept[yy_current_state];
-			}
-
-		YY_DO_BEFORE_ACTION;
-
-
-do_action:	/* This label is used only to access EOF actions. */
-
-
-		switch ( yy_act )
-	{ /* beginning of action switch */
-			case 0: /* must back up */
-			/* undo the effects of YY_DO_BEFORE_ACTION */
-			*yy_cp = yy_hold_char;
-			yy_cp = yy_last_accepting_cpos;
-			yy_current_state = yy_last_accepting_state;
-			goto yy_find_action;
-
-case 1:
-YY_RULE_SETUP
-#line 187 "cscanner.l"
-{ llfatalbug (cstring_makeLiteral ("Comment in pre-processor output")); }
-	YY_BREAK
-case 2:
-YY_RULE_SETUP
-#line 189 "cscanner.l"
-{ 
-                 context_saveLocation (); 
-                 setTokLength (longUnsigned_toInt (mstring_length (yytext))); 
-
-                 if (processHashIdentifier (makeIdentifier (yytext + 1)))
-                   {
-		     if (lastWasString)
-		       {
-			 ;
-		       }
-		     else
-		       {
-			 RETURN_STRING (cstring_makeLiteral ("\"\""));
-		       }
-		   }
-                 else
-                   { 
-		     if (handleSpecial (yytext)) 
-                       { 
-			 setTokLength (1); 
-			 RETURN_TOK (0); 
-		       }
-		   }
-                } 
-	YY_BREAK
-case 3:
-YY_RULE_SETUP
-#line 213 "cscanner.l"
-{ if (handleSpecial (yytext)) 
-                    { 
-                       setTokLength (1); RETURN_TOK (0); 
-                     }
-                }
-	YY_BREAK
-case 4:
-YY_RULE_SETUP
-#line 218 "cscanner.l"
-{ setTokLength (3); RETURN_TOK (CTOK_ELIPSIS); }
-	YY_BREAK
-case 5:
-YY_RULE_SETUP
-#line 219 "cscanner.l"
-{ setTokLength (5); RETURN_TOK (BREAK); }
-	YY_BREAK
-case 6:
-YY_RULE_SETUP
-#line 220 "cscanner.l"
-{ setTokLength (4); RETURN_TOK (CASE); }
-	YY_BREAK
-case 7:
-YY_RULE_SETUP
-#line 221 "cscanner.l"
-{ setTokLength (8); RETURN_TOK (CONTINUE); }
-	YY_BREAK
-case 8:
-YY_RULE_SETUP
-#line 222 "cscanner.l"
-{ setTokLength (7); RETURN_TOK (DEFAULT); }
-	YY_BREAK
-case 9:
-YY_RULE_SETUP
-#line 223 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (DO); }
-	YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 224 "cscanner.l"
-{ setTokLength (4); RETURN_TOK (CELSE); }
-	YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 225 "cscanner.l"
-{ setTokLength (3); RETURN_TOK (CFOR); }
-	YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 226 "cscanner.l"
-{ setTokLength (4); RETURN_TOK (GOTO); }
-	YY_BREAK
-case 13:
-YY_RULE_SETUP
-#line 227 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (CIF); }
-	YY_BREAK
-case 14:
-YY_RULE_SETUP
-#line 228 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (RETURN); }
-	YY_BREAK
-case 15:
-YY_RULE_SETUP
-#line 229 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (CSIZEOF); }
-	YY_BREAK
-case 16:
-YY_RULE_SETUP
-#line 230 "cscanner.l"
-{ setTokLength (8); RETURN_TOK (COFFSETOF); }
-	YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 231 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (SWITCH); }
-	YY_BREAK
-case 18:
-YY_RULE_SETUP
-#line 232 "cscanner.l"
-{ setTokLength (5); RETURN_TOK (WHILE); }
-	YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 233 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (VA_ARG); }   
-	YY_BREAK
-case 20:
-YY_RULE_SETUP
-#line 234 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (VA_DCL); }   
-	YY_BREAK
-case 21:
-YY_RULE_SETUP
-#line 235 "cscanner.l"
-{ 
-                  /* gcc extension...this might not be appropriate */
-                  setTokLength (6); RETURN_TOK (QINLINE); }
-	YY_BREAK
-case 22:
-YY_RULE_SETUP
-#line 239 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (CSTRUCT); }  
-	YY_BREAK
-case 23:
-YY_RULE_SETUP
-#line 240 "cscanner.l"
-{ setTokLength (7); RETURN_TOK (CTYPEDEF); }
-	YY_BREAK
-case 24:
-YY_RULE_SETUP
-#line 242 "cscanner.l"
-{ setTokLength (5); RETURN_TOK (CUNION); }
-	YY_BREAK
-case 25:
-YY_RULE_SETUP
-#line 243 "cscanner.l"
-{ setTokLength (4); RETURN_TOK (CENUM); }
-	YY_BREAK
-case 26:
-YY_RULE_SETUP
-#line 245 "cscanner.l"
-{ setTokLength (4); RETURN_TYPE (CVOID, ctype_void); }
-	YY_BREAK
-case 27:
-YY_RULE_SETUP
-#line 246 "cscanner.l"
-{ setTokLength (3); RETURN_TYPE (CINT, ctype_int); }
-	YY_BREAK
-case 28:
-YY_RULE_SETUP
-#line 247 "cscanner.l"
-{ setTokLength (6); RETURN_TYPE (CDOUBLE, ctype_double); }
-	YY_BREAK
-case 29:
-YY_RULE_SETUP
-#line 248 "cscanner.l"
-{ setTokLength (4); RETURN_TYPE (CGCHAR, ctype_char); }
-	YY_BREAK
-case 30:
-YY_RULE_SETUP
-#line 249 "cscanner.l"
-{ setTokLength (5); RETURN_TYPE (CGFLOAT, ctype_float); }
-	YY_BREAK
-case 31:
-YY_RULE_SETUP
-#line 251 "cscanner.l"
-{ setTokLength (4); RETURN_TOK (QLONG); }
-	YY_BREAK
-case 32:
-YY_RULE_SETUP
-#line 252 "cscanner.l"
-{ setTokLength (5); RETURN_TOK (QSHORT); }
-	YY_BREAK
-case 33:
-YY_RULE_SETUP
-#line 253 "cscanner.l"
-{ setTokLength (8); RETURN_TOK (QUNSIGNED); }
-	YY_BREAK
-case 34:
-YY_RULE_SETUP
-#line 254 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (QSIGNED); }
-	YY_BREAK
-case 35:
-YY_RULE_SETUP
-#line 256 "cscanner.l"
-{ setTokLength (8); RETURN_TOK (QVOLATILE); }
-	YY_BREAK
-case 36:
-YY_RULE_SETUP
-#line 257 "cscanner.l"
-{ setTokLength (5); RETURN_TOK (QCONST); }
-	YY_BREAK
-/* some systems expect this! [gack!] */ 
-case 37:
-YY_RULE_SETUP
-#line 260 "cscanner.l"
-{ setTokLength (7); RETURN_TOK (QCONST); }
-	YY_BREAK
-case 38:
-YY_RULE_SETUP
-#line 262 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (QEXTERN); }
-	YY_BREAK
-case 39:
-YY_RULE_SETUP
-#line 263 "cscanner.l"
-{ setTokLength (4); RETURN_TOK (QAUTO); }
-	YY_BREAK
-case 40:
-YY_RULE_SETUP
-#line 264 "cscanner.l"
-{ setTokLength (8); RETURN_TOK (QREGISTER); }
-	YY_BREAK
-case 41:
-YY_RULE_SETUP
-#line 265 "cscanner.l"
-{ setTokLength (6); RETURN_TOK (QSTATIC); }
-	YY_BREAK
-case 42:
-YY_RULE_SETUP
-#line 267 "cscanner.l"
-{ RETURN_EXPR (processString ()); }
-	YY_BREAK
-case 43:
-YY_RULE_SETUP
-#line 268 "cscanner.l"
-{ return (processSpec (QOUT)); }
-	YY_BREAK
-case 44:
-YY_RULE_SETUP
-#line 269 "cscanner.l"
-{ return (processSpec (QIN)); }
-	YY_BREAK
-case 45:
-YY_RULE_SETUP
-#line 270 "cscanner.l"
-{ return (processSpec (QPARTIAL)); }
-	YY_BREAK
-case 46:
-YY_RULE_SETUP
-#line 271 "cscanner.l"
-{ return (processSpec (QSPECIAL)); }
-	YY_BREAK
-case 47:
-YY_RULE_SETUP
-#line 272 "cscanner.l"
-{ return (processSpec (QANYTYPE)); }
-	YY_BREAK
-case 48:
-YY_RULE_SETUP
-#line 273 "cscanner.l"
-{ return (processSpec (QINTEGRALTYPE)); }
-	YY_BREAK
-case 49:
-YY_RULE_SETUP
-#line 274 "cscanner.l"
-{ return (processSpec (QUNSIGNEDINTEGRALTYPE)); }
-	YY_BREAK
-case 50:
-YY_RULE_SETUP
-#line 275 "cscanner.l"
-{ return (processSpec (QSIGNEDINTEGRALTYPE)); }
-	YY_BREAK
-case 51:
-YY_RULE_SETUP
-#line 276 "cscanner.l"
-{ return (processSpec (QKEEP)); }
-	YY_BREAK
-case 52:
-YY_RULE_SETUP
-#line 277 "cscanner.l"
-{ return (processSpec (QNULL)); } 
-	YY_BREAK
-case 53:
-YY_RULE_SETUP
-#line 278 "cscanner.l"
-{ return (processSpec (QNOTNULL)); } 
-	YY_BREAK
-case 54:
-YY_RULE_SETUP
-#line 279 "cscanner.l"
-{ return (processSpec (QISNULL)); } 
-	YY_BREAK
-case 55:
-YY_RULE_SETUP
-#line 280 "cscanner.l"
-{ return (processSpec (QTRUENULL)); } 
-	YY_BREAK
-case 56:
-YY_RULE_SETUP
-#line 281 "cscanner.l"
-{ return (processSpec (QFALSENULL)); } 
-	YY_BREAK
-case 57:
-YY_RULE_SETUP
-#line 282 "cscanner.l"
-{ return (processSpec (QRELNULL)); }
-	YY_BREAK
-case 58:
-YY_RULE_SETUP
-#line 283 "cscanner.l"
-{ return (processSpec (QRELDEF)); }
-	YY_BREAK
-case 59:
-YY_RULE_SETUP
-#line 284 "cscanner.l"
-{ return (processSpec (QEXPOSED)); }
-	YY_BREAK
-case 60:
-YY_RULE_SETUP
-#line 285 "cscanner.l"
-{ return (processSpec (QNEWREF)); }
-	YY_BREAK
-case 61:
-YY_RULE_SETUP
-#line 286 "cscanner.l"
-{ return (processSpec (QTEMPREF)); }
-	YY_BREAK
-case 62:
-YY_RULE_SETUP
-#line 287 "cscanner.l"
-{ return (processSpec (QKILLREF)); }
-	YY_BREAK
-case 63:
-YY_RULE_SETUP
-#line 288 "cscanner.l"
-{ return (processSpec (QREFCOUNTED)); }
-	YY_BREAK
-case 64:
-YY_RULE_SETUP
-#line 289 "cscanner.l"
-{ return (processSpec (QCHECKED)); }
-	YY_BREAK
-case 65:
-YY_RULE_SETUP
-#line 290 "cscanner.l"
-{ return (processSpec (QCHECKMOD)); }
-	YY_BREAK
-case 66:
-YY_RULE_SETUP
-#line 291 "cscanner.l"
-{ return (processSpec (QCHECKEDSTRICT)); }
-	YY_BREAK
-case 67:
-YY_RULE_SETUP
-#line 292 "cscanner.l"
-{ return (processSpec (QUNCHECKED)); }
-	YY_BREAK
-case 68:
-YY_RULE_SETUP
-#line 293 "cscanner.l"
-{ return (processSpec (QONLY)); }
-	YY_BREAK
-case 69:
-YY_RULE_SETUP
-#line 294 "cscanner.l"
-{ return (processSpec (QOWNED)); }
-	YY_BREAK
-case 70:
-YY_RULE_SETUP
-#line 295 "cscanner.l"
-{ return (processSpec (QOBSERVER)); }
-	YY_BREAK
-case 71:
-YY_RULE_SETUP
-#line 296 "cscanner.l"
-{ return (processSpec (QDEPENDENT)); }
-	YY_BREAK
-case 72:
-YY_RULE_SETUP
-#line 297 "cscanner.l"
-{ return (processSpec (QUNUSED)); }
-	YY_BREAK
-case 73:
-YY_RULE_SETUP
-#line 298 "cscanner.l"
-{ return (processSpec (QEXTERNAL)); }
-	YY_BREAK
-case 74:
-YY_RULE_SETUP
-#line 299 "cscanner.l"
-{ return (processSpec (QSEF)); }
-	YY_BREAK
-case 75:
-YY_RULE_SETUP
-#line 300 "cscanner.l"
-{ return (processSpec (QSHARED)); }
-	YY_BREAK
-case 76:
-YY_RULE_SETUP
-#line 301 "cscanner.l"
-{ return (processSpec (QYIELD)); }
-	YY_BREAK
-case 77:
-YY_RULE_SETUP
-#line 302 "cscanner.l"
-{ return (processSpec (QUNDEF)); }
-	YY_BREAK
-case 78:
-YY_RULE_SETUP
-#line 303 "cscanner.l"
-{ return (processSpec (QKILLED)); }
-	YY_BREAK
-case 79:
-YY_RULE_SETUP
-#line 304 "cscanner.l"
-{ return (processSpec (QNULLTERMINATED));}
-	YY_BREAK
-case 80:
-YY_RULE_SETUP
-#line 305 "cscanner.l"
-{ return (processSpec (QMAXSET));}
-	YY_BREAK
-case 81:
-YY_RULE_SETUP
-#line 306 "cscanner.l"
-{ return (processSpec (QMAXREAD));}
-	YY_BREAK
-case 82:
-YY_RULE_SETUP
-#line 308 "cscanner.l"
-{ int tok; 
-			      context_saveLocation (); 
-			      setTokLength (longUnsigned_toInt (mstring_length (yytext))); 
-			      tok = processIdentifier (makeIdentifier (yytext)); 
-			      if (tok != BADTOK)
-				{
-				  return (tok);
-				}
-			    }
-	YY_BREAK
-case 83:
-YY_RULE_SETUP
-#line 317 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-                          RETURN_INT (ctype_int, processHex ());  /* evs 2000-05-17 was ctype_uint */
-			}
-	YY_BREAK
-case 84:
-YY_RULE_SETUP
-#line 320 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-			  RETURN_INT (ctype_lint, processHex ()); }
-	YY_BREAK
-case 85:
-YY_RULE_SETUP
-#line 322 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-			  RETURN_INT (ctype_llint, processHex ()); }
-	YY_BREAK
-case 86:
-YY_RULE_SETUP
-#line 324 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-                          RETURN_INT (ctype_uint, processHex ()); }
-	YY_BREAK
-case 87:
-YY_RULE_SETUP
-#line 326 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-			  RETURN_INT (ctype_ulint, processHex ()); }
-	YY_BREAK
-case 88:
-YY_RULE_SETUP
-#line 328 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-			  RETURN_INT (ctype_ullint, processHex ()); }
-	YY_BREAK
-case 89:
-YY_RULE_SETUP
-#line 330 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-			  RETURN_INT (ctype_ullint, processHex ()); }
-	YY_BREAK
-case 90:
-YY_RULE_SETUP
-#line 332 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-			  RETURN_INT (ctype_int, processOctal ()); } 
-	YY_BREAK
-case 91:
-YY_RULE_SETUP
-#line 334 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-		 	  RETURN_INT (ctype_uint, processOctal ()); } 
-	YY_BREAK
-case 92:
-YY_RULE_SETUP
-#line 336 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
- 		          RETURN_INT (ctype_lint, processOctal ()); } 
-	YY_BREAK
-case 93:
-YY_RULE_SETUP
-#line 338 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
- 		          RETURN_INT (ctype_llint, processOctal ()); } 
-	YY_BREAK
-case 94:
-YY_RULE_SETUP
-#line 340 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-	   	          RETURN_INT (ctype_ulint, processOctal ()); } 
-	YY_BREAK
-case 95:
-YY_RULE_SETUP
-#line 342 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-	   	          RETURN_INT (ctype_ullint, processOctal ()); } 
-	YY_BREAK
-case 96:
-YY_RULE_SETUP
-#line 344 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-	   	          RETURN_INT (ctype_ullint, processOctal ()); } 
-	YY_BREAK
-case 97:
-YY_RULE_SETUP
-#line 346 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-		         RETURN_INT (ctype_int, processDec ()); } 
-	YY_BREAK
-case 98:
-YY_RULE_SETUP
-#line 348 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-		         RETURN_INT (ctype_uint, processDec ()); } 
-	YY_BREAK
-case 99:
-YY_RULE_SETUP
-#line 350 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-	      	         RETURN_INT (ctype_lint, processDec ()); } 
-	YY_BREAK
-case 100:
-YY_RULE_SETUP
-#line 352 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-	      	         RETURN_INT (ctype_llint, processDec ()); } 
-	YY_BREAK
-case 101:
-YY_RULE_SETUP
-#line 354 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-	    	         RETURN_INT (ctype_ulint, processDec ()); } 
-	YY_BREAK
-case 102:
-YY_RULE_SETUP
-#line 356 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-	    	         RETURN_INT (ctype_ullint, processDec ()); } 
-	YY_BREAK
-case 103:
-YY_RULE_SETUP
-#line 358 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-	    	         RETURN_INT (ctype_ullint, processDec ()); } 
-	YY_BREAK
-case 104:
-YY_RULE_SETUP
-#line 360 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-                         RETURN_CHAR (processChar ()); }
-	YY_BREAK
-case 105:
-YY_RULE_SETUP
-#line 362 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-			 RETURN_FLOAT (ctype_float, processFloat ()); }
-	YY_BREAK
-case 106:
-YY_RULE_SETUP
-#line 364 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-			 RETURN_FLOAT (ctype_ldouble, processFloat ()); }
-	YY_BREAK
-case 107:
-YY_RULE_SETUP
-#line 366 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-			 RETURN_FLOAT (ctype_double, processFloat ()); }
-	YY_BREAK
-case 108:
-YY_RULE_SETUP
-#line 369 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-				RETURN_FLOAT (ctype_float, processFloat ()); }
-	YY_BREAK
-case 109:
-YY_RULE_SETUP
-#line 371 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-				RETURN_FLOAT (ctype_ldouble, processFloat ()); }
-	YY_BREAK
-case 110:
-YY_RULE_SETUP
-#line 373 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-				RETURN_FLOAT (ctype_double, processFloat ()); }
-	YY_BREAK
-case 111:
-YY_RULE_SETUP
-#line 376 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-				  RETURN_FLOAT (ctype_float, processFloat ()); }
-	YY_BREAK
-case 112:
-YY_RULE_SETUP
-#line 378 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-				  RETURN_FLOAT (ctype_ldouble, processFloat ()); }
-	YY_BREAK
-case 113:
-YY_RULE_SETUP
-#line 380 "cscanner.l"
-{ setTokLengthT (mstring_length (yytext)); 
-				  RETURN_FLOAT (ctype_double, processFloat ()); }
-	YY_BREAK
-case 114:
-YY_RULE_SETUP
-#line 383 "cscanner.l"
-{ setTokLength (3); RETURN_TOK (RIGHT_ASSIGN); }
-	YY_BREAK
-case 115:
-YY_RULE_SETUP
-#line 384 "cscanner.l"
-{ setTokLength (3); RETURN_TOK (LEFT_ASSIGN); }
-	YY_BREAK
-case 116:
-YY_RULE_SETUP
-#line 385 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (ADD_ASSIGN); }
-	YY_BREAK
-case 117:
-YY_RULE_SETUP
-#line 386 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (SUB_ASSIGN); }
-	YY_BREAK
-case 118:
-YY_RULE_SETUP
-#line 387 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (MUL_ASSIGN); }
-	YY_BREAK
-case 119:
-YY_RULE_SETUP
-#line 388 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (DIV_ASSIGN); }
-	YY_BREAK
-case 120:
-YY_RULE_SETUP
-#line 389 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (MOD_ASSIGN); }
-	YY_BREAK
-case 121:
-YY_RULE_SETUP
-#line 390 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (AND_ASSIGN); }
-	YY_BREAK
-case 122:
-YY_RULE_SETUP
-#line 391 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (XOR_ASSIGN); }
-	YY_BREAK
-case 123:
-YY_RULE_SETUP
-#line 392 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (OR_ASSIGN); }
-	YY_BREAK
-case 124:
-YY_RULE_SETUP
-#line 393 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (RIGHT_OP); }
-	YY_BREAK
-case 125:
-YY_RULE_SETUP
-#line 394 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (LEFT_OP); }
-	YY_BREAK
-case 126:
-YY_RULE_SETUP
-#line 395 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (INC_OP); }
-	YY_BREAK
-case 127:
-YY_RULE_SETUP
-#line 396 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (DEC_OP); }
-	YY_BREAK
-case 128:
-YY_RULE_SETUP
-#line 397 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (ARROW_OP); }
-	YY_BREAK
-case 129:
-YY_RULE_SETUP
-#line 398 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (AND_OP); }
-	YY_BREAK
-case 130:
-YY_RULE_SETUP
-#line 399 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (OR_OP); }
-	YY_BREAK
-case 131:
-YY_RULE_SETUP
-#line 400 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (LE_OP); }
-	YY_BREAK
-case 132:
-YY_RULE_SETUP
-#line 401 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (GE_OP); }
-	YY_BREAK
-case 133:
-YY_RULE_SETUP
-#line 402 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (EQ_OP); }
-	YY_BREAK
-case 134:
-YY_RULE_SETUP
-#line 403 "cscanner.l"
-{ setTokLength (2); RETURN_TOK (NE_OP); }
-	YY_BREAK
-case 135:
-YY_RULE_SETUP
-#line 404 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TSEMI); }
-	YY_BREAK
-case 136:
-YY_RULE_SETUP
-#line 405 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TLBRACE); }
-	YY_BREAK
-case 137:
-YY_RULE_SETUP
-#line 406 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TRBRACE); }
-	YY_BREAK
-case 138:
-YY_RULE_SETUP
-#line 407 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TCOMMA); }
-	YY_BREAK
-case 139:
-YY_RULE_SETUP
-#line 408 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TCOLON); }
-	YY_BREAK
-case 140:
-YY_RULE_SETUP
-#line 409 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TASSIGN); }
-	YY_BREAK
-case 141:
-YY_RULE_SETUP
-#line 410 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TLPAREN); }
-	YY_BREAK
-case 142:
-YY_RULE_SETUP
-#line 411 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TRPAREN); }
-	YY_BREAK
-case 143:
-YY_RULE_SETUP
-#line 412 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TLSQBR); }
-	YY_BREAK
-case 144:
-YY_RULE_SETUP
-#line 413 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TRSQBR); }
-	YY_BREAK
-case 145:
-YY_RULE_SETUP
-#line 414 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TDOT); }
-	YY_BREAK
-case 146:
-YY_RULE_SETUP
-#line 415 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TAMPERSAND); }
-	YY_BREAK
-case 147:
-YY_RULE_SETUP
-#line 416 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TEXCL); }
-	YY_BREAK
-case 148:
-YY_RULE_SETUP
-#line 419 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TTILDE); }
-	YY_BREAK
-case 149:
-YY_RULE_SETUP
-#line 420 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TMINUS); }
-	YY_BREAK
-case 150:
-YY_RULE_SETUP
-#line 421 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TPLUS); }
-	YY_BREAK
-case 151:
-YY_RULE_SETUP
-#line 422 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TMULT); }
-	YY_BREAK
-case 152:
-YY_RULE_SETUP
-#line 423 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TDIV); }
-	YY_BREAK
-case 153:
-YY_RULE_SETUP
-#line 424 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TPERCENT); }
-	YY_BREAK
-case 154:
-YY_RULE_SETUP
-#line 425 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TLT); }
-	YY_BREAK
-case 155:
-YY_RULE_SETUP
-#line 426 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TGT); }
-	YY_BREAK
-case 156:
-YY_RULE_SETUP
-#line 427 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TCIRC); }
-	YY_BREAK
-case 157:
-YY_RULE_SETUP
-#line 428 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TBAR); }
-	YY_BREAK
-case 158:
-YY_RULE_SETUP
-#line 429 "cscanner.l"
-{ setTokLength (1); RETURN_TOK (TQUEST); }
-	YY_BREAK
-case 159:
-YY_RULE_SETUP
-#line 431 "cscanner.l"
-{ incColumn (); }
-	YY_BREAK
-case 160:
-YY_RULE_SETUP
-#line 432 "cscanner.l"
-{ context_incLineno ();
-		  if (continueLine)
-		    {
-		      continueLine = FALSE;
-		    }
-                 else 
-		   {
-		     if (context_inMacro ())
-		       {
-			 /* Don't use RETURN_TOK */
-			 yylval.tok = lltok_create (TENDMACRO, g_currentloc);
-			 lastWasString = FALSE;
-			 return (TENDMACRO);
-		       }  
-		   }
-		}
-	YY_BREAK
-case 161:
-YY_RULE_SETUP
-#line 448 "cscanner.l"
-{ setTokLength (6); 
-		  
-		  if (processMacro ()) {
-		    if (context_inIterDef ()) 
-		      { 
-			RETURN_TOK (LLMACROITER); 
-		      }
-		    if (context_inIterEnd ())
-		      {
-			RETURN_TOK (LLMACROEND); 
-		      }
-		    if (context_inMacro ())
-		      {
-			RETURN_TOK (LLMACRO); 
-		      }
-		  }
-		}
-	YY_BREAK
-case 162:
-YY_RULE_SETUP
-#line 465 "cscanner.l"
-{ if (context_inHeader () || context_inFunction ())
-		    { 
-		      handleMacro ();
-		    }
-                  else
-		    {
-		      int nspchar = ninput ();
-		      int nspaces;
-
-		      /* 
-		      ** This is a hack to get the column number correct.
-		      */
-
-		      llassert (nspchar >= '0' && nspchar <= '9');
-		      
-		      nspaces = nspchar - '0';
-
-		      setTokLength (5 + nspaces); 
-		      
-		      if (processMacro ()) 
-			{
-			  if (context_inIterDef ()) 
-			    {
-			      RETURN_TOK (LLMACROITER); 
-			    }
-			  if (context_inIterEnd ())
-			    {
-			      RETURN_TOK (LLMACROEND); 
-			    }
-			  if (context_inMacro ())
-			    { 
-			      RETURN_TOK (LLMACRO); 
-			    }
-			}
-		    }
-		}
-	YY_BREAK
-case 163:
-YY_RULE_SETUP
-#line 501 "cscanner.l"
-{ setTokLength (4); lldiagmsg (ctype_unparseTable ()); }
-	YY_BREAK
-case 164:
-YY_RULE_SETUP
-#line 502 "cscanner.l"
-{ setTokLength (3); 
-		  lldiagmsg (message ("%q: *** marker ***", fileloc_unparse (g_currentloc)));
-		}
-	YY_BREAK
-case 165:
-YY_RULE_SETUP
-#line 505 "cscanner.l"
-{ setTokLength (3); usymtab_printLocal (); }
-	YY_BREAK
-case 166:
-YY_RULE_SETUP
-#line 506 "cscanner.l"
-{ setTokLength (3); lldiagmsg (usymtab_unparseAliases ()); }
-	YY_BREAK
-case 167:
-YY_RULE_SETUP
-#line 507 "cscanner.l"
-{ setTokLength (3); lldiagmsg (context_unparse ()); }
-	YY_BREAK
-case 168:
-YY_RULE_SETUP
-#line 508 "cscanner.l"
-{ setTokLength (3); lldiagmsg (context_unparseClauses ()); }
-	YY_BREAK
-case 169:
-YY_RULE_SETUP
-#line 509 "cscanner.l"
-{ setTokLength (3); usymtab_printGuards (); }
-	YY_BREAK
-case 170:
-YY_RULE_SETUP
-#line 510 "cscanner.l"
-{ setTokLength (3); usymtab_printOut (); }
-	YY_BREAK
-case 171:
-YY_RULE_SETUP
-#line 511 "cscanner.l"
-{ setTokLength (3); usymtab_printAll (); }
-	YY_BREAK
-case 172:
-YY_RULE_SETUP
-#line 512 "cscanner.l"
-{ setTokLength (3); usymtab_printComplete (); }
-	YY_BREAK
-case 173:
-YY_RULE_SETUP
-#line 513 "cscanner.l"
-{ setTokLength (3); usymtab_printTypes (); }
-	YY_BREAK
-case 174:
-YY_RULE_SETUP
-#line 514 "cscanner.l"
-{ setTokLength (3); lldiagmsg (usymtab_unparseStack ()); }
-	YY_BREAK
-case 175:
-YY_RULE_SETUP
-#line 515 "cscanner.l"
-{ setTokLength (3); 
-		  lldiagmsg (message ("Can modify: %q", 
-				  sRefSet_unparse (context_modList ()))); 
-		}
-	YY_BREAK
-case 176:
-YY_RULE_SETUP
-#line 519 "cscanner.l"
-{ /* BEFORE_COMMENT_MARKER */
-                  int tok; 
-		  incColumn (); incColumn ();
-		  tok = handleLlSpecial (); 
-		  if (tok != BADTOK)
-		    {
-		      RETURN_TOK (tok); 
-		    }
-		}
-	YY_BREAK
-case 177:
-YY_RULE_SETUP
-#line 528 "cscanner.l"
-{ /* AFTER_COMMENT_MARKER */ 
-                  setTokLength (2);
-		  inSpecPart = FALSE;
-		  RETURN_TOK (QENDMACRO); }
-	YY_BREAK
-case 178:
-YY_RULE_SETUP
-#line 532 "cscanner.l"
-{ incColumn (); continueLine = TRUE; }
-	YY_BREAK
-case 179:
-YY_RULE_SETUP
-#line 533 "cscanner.l"
-{ incColumn (); 
-		  voptgenerror
-		    (FLG_SYNTAX, 
-		     message ("Invalid character (ascii: %d), skipping character",
-			      (int)(*yytext)),
-		     g_currentloc);
-		}
-	YY_BREAK
-case 180:
-YY_RULE_SETUP
-#line 540 "cscanner.l"
-ECHO;
-	YY_BREAK
-#line 2172 "lex.yy.c"
-case YY_STATE_EOF(INITIAL):
-	yyterminate();
-
-	case YY_END_OF_BUFFER:
-		{
-		/* Amount of text matched not including the EOB char. */
-		int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
-
-		/* Undo the effects of YY_DO_BEFORE_ACTION. */
-		*yy_cp = yy_hold_char;
-		YY_RESTORE_YY_MORE_OFFSET
-
-		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
-			{
-			/* We're scanning a new file or input source.  It's
-			 * possible that this happened because the user
-			 * just pointed yyin at a new source and called
-			 * yylex().  If so, then we have to assure
-			 * consistency between yy_current_buffer and our
-			 * globals.  Here is the right place to do so, because
-			 * this is the first action (other than possibly a
-			 * back-up) that will match for the new input source.
-			 */
-			yy_n_chars = yy_current_buffer->yy_n_chars;
-			yy_current_buffer->yy_input_file = yyin;
-			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
-			}
-
-		/* Note that here we test for yy_c_buf_p "<=" to the position
-		 * of the first EOB in the buffer, since yy_c_buf_p will
-		 * already have been incremented past the NUL character
-		 * (since all states make transitions on EOB to the
-		 * end-of-buffer state).  Contrast this with the test
-		 * in input().
-		 */
-		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
-			{ /* This was really a NUL. */
-			yy_state_type yy_next_state;
-
-			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
-
-			yy_current_state = yy_get_previous_state();
-
-			/* Okay, we're now positioned to make the NUL
-			 * transition.  We couldn't have
-			 * yy_get_previous_state() go ahead and do it
-			 * for us because it doesn't know how to deal
-			 * with the possibility of jamming (and we don't
-			 * want to build jamming into it because then it
-			 * will run more slowly).
-			 */
-
-			yy_next_state = yy_try_NUL_trans( yy_current_state );
-
-			yy_bp = yytext_ptr + YY_MORE_ADJ;
-
-			if ( yy_next_state )
-				{
-				/* Consume the NUL. */
-				yy_cp = ++yy_c_buf_p;
-				yy_current_state = yy_next_state;
-				goto yy_match;
-				}
-
-			else
-				{
-				yy_cp = yy_c_buf_p;
-				goto yy_find_action;
-				}
-			}
-
-		else switch ( yy_get_next_buffer() )
-			{
-			case EOB_ACT_END_OF_FILE:
-				{
-				yy_did_buffer_switch_on_eof = 0;
-
-				if ( yywrap() )
-					{
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF(YY_START);
-					goto do_action;
-					}
-
-				else
-					{
-					if ( ! yy_did_buffer_switch_on_eof )
-						YY_NEW_FILE;
-					}
-				break;
-				}
-
-			case EOB_ACT_CONTINUE_SCAN:
-				yy_c_buf_p =
-					yytext_ptr + yy_amount_of_matched_text;
-
-				yy_current_state = yy_get_previous_state();
-
-				yy_cp = yy_c_buf_p;
-				yy_bp = yytext_ptr + YY_MORE_ADJ;
-				goto yy_match;
-
-			case EOB_ACT_LAST_MATCH:
-				yy_c_buf_p =
-				&yy_current_buffer->yy_ch_buf[yy_n_chars];
-
-				yy_current_state = yy_get_previous_state();
-
-				yy_cp = yy_c_buf_p;
-				yy_bp = yytext_ptr + YY_MORE_ADJ;
-				goto yy_find_action;
-			}
-		break;
-		}
-
-	default:
-		YY_FATAL_ERROR(
-			"fatal flex scanner internal error--no action found" );
-	} /* end of action switch */
-		} /* end of scanning one token */
-	} /* end of yylex */
-
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- *	EOB_ACT_LAST_MATCH -
- *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *	EOB_ACT_END_OF_FILE - end of file
- */
-
-static int yy_get_next_buffer()
-	{
-	register char *dest = yy_current_buffer->yy_ch_buf;
-	register char *source = yytext_ptr;
-	register int number_to_move, i;
-	int ret_val;
-
-	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
-		YY_FATAL_ERROR(
-		"fatal flex scanner internal error--end of buffer missed" );
-
-	if ( yy_current_buffer->yy_fill_buffer == 0 )
-		{ /* Don't try to fill the buffer, so this is an EOF. */
-		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
-			{
-			/* We matched a single character, the EOB, so
-			 * treat this as a final EOF.
-			 */
-			return EOB_ACT_END_OF_FILE;
-			}
-
-		else
-			{
-			/* We matched some text prior to the EOB, first
-			 * process it.
-			 */
-			return EOB_ACT_LAST_MATCH;
-			}
-		}
-
-	/* Try to read more data. */
-
-	/* First move last chars to start of buffer. */
-	number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
-
-	for ( i = 0; i < number_to_move; ++i )
-		*(dest++) = *(source++);
-
-	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-		/* don't do the read, it's not guaranteed to return an EOF,
-		 * just force an EOF
-		 */
-		yy_current_buffer->yy_n_chars = yy_n_chars = 0;
-
-	else
-		{
-		int num_to_read =
-			yy_current_buffer->yy_buf_size - number_to_move - 1;
-
-		while ( num_to_read <= 0 )
-			{ /* Not enough room in the buffer - grow it. */
-#ifdef YY_USES_REJECT
-			YY_FATAL_ERROR(
-"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
-#else
-
-			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = yy_current_buffer;
-
-			int yy_c_buf_p_offset =
-				(int) (yy_c_buf_p - b->yy_ch_buf);
-
-			if ( b->yy_is_our_buffer )
-				{
-				int new_size = b->yy_buf_size * 2;
-
-				if ( new_size <= 0 )
-					b->yy_buf_size += b->yy_buf_size / 8;
-				else
-					b->yy_buf_size *= 2;
-
-				b->yy_ch_buf = (char *)
-					/* Include room in for 2 EOB chars. */
-					yy_flex_realloc( (void *) b->yy_ch_buf,
-							 b->yy_buf_size + 2 );
-				}
-			else
-				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = 0;
-
-			if ( ! b->yy_ch_buf )
-				YY_FATAL_ERROR(
-				"fatal error - scanner input buffer overflow" );
-
-			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-			num_to_read = yy_current_buffer->yy_buf_size -
-						number_to_move - 1;
-#endif
-			}
-
-		if ( num_to_read > YY_READ_BUF_SIZE )
-			num_to_read = YY_READ_BUF_SIZE;
-
-		/* Read in more data. */
-		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
-			yy_n_chars, num_to_read );
-
-		yy_current_buffer->yy_n_chars = yy_n_chars;
-		}
-
-	if ( yy_n_chars == 0 )
-		{
-		if ( number_to_move == YY_MORE_ADJ )
-			{
-			ret_val = EOB_ACT_END_OF_FILE;
-			yyrestart( yyin );
-			}
-
-		else
-			{
-			ret_val = EOB_ACT_LAST_MATCH;
-			yy_current_buffer->yy_buffer_status =
-				YY_BUFFER_EOF_PENDING;
-			}
-		}
-
-	else
-		ret_val = EOB_ACT_CONTINUE_SCAN;
-
-	yy_n_chars += number_to_move;
-	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
-	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
-	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
-
-	return ret_val;
-	}
-
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-static yy_state_type yy_get_previous_state()
-	{
-	register yy_state_type yy_current_state;
-	register char *yy_cp;
-
-	yy_current_state = yy_start;
-
-	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
-		{
-		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-		if ( yy_accept[yy_current_state] )
-			{
-			yy_last_accepting_state = yy_current_state;
-			yy_last_accepting_cpos = yy_cp;
-			}
-		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-			{
-			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 529 )
-				yy_c = yy_meta[(unsigned int) yy_c];
-			}
-		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-		}
-
-	return yy_current_state;
-	}
-
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- *	next_state = yy_try_NUL_trans( current_state );
- */
-
-#ifdef YY_USE_PROTOS
-static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
-#else
-static yy_state_type yy_try_NUL_trans( yy_current_state )
-yy_state_type yy_current_state;
-#endif
-	{
-	register int yy_is_jam;
-	register char *yy_cp = yy_c_buf_p;
-
-	register YY_CHAR yy_c = 1;
-	if ( yy_accept[yy_current_state] )
-		{
-		yy_last_accepting_state = yy_current_state;
-		yy_last_accepting_cpos = yy_cp;
-		}
-	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-		{
-		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 529 )
-			yy_c = yy_meta[(unsigned int) yy_c];
-		}
-	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 528);
-
-	return yy_is_jam ? 0 : yy_current_state;
-	}
-
-
-#ifndef YY_NO_UNPUT
-#ifdef YY_USE_PROTOS
-static void yyunput( int c, register char *yy_bp )
-#else
-static void yyunput( c, yy_bp )
-int c;
-register char *yy_bp;
-#endif
-	{
-	register char *yy_cp = yy_c_buf_p;
-
-	/* undo effects of setting up yytext */
-	*yy_cp = yy_hold_char;
-
-	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
-		{ /* need to shift things up to make room */
-		/* +2 for EOB chars. */
-		register int number_to_move = yy_n_chars + 2;
-		register char *dest = &yy_current_buffer->yy_ch_buf[
-					yy_current_buffer->yy_buf_size + 2];
-		register char *source =
-				&yy_current_buffer->yy_ch_buf[number_to_move];
-
-		while ( source > yy_current_buffer->yy_ch_buf )
-			*--dest = *--source;
-
-		yy_cp += (int) (dest - source);
-		yy_bp += (int) (dest - source);
-		yy_current_buffer->yy_n_chars =
-			yy_n_chars = yy_current_buffer->yy_buf_size;
-
-		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
-			YY_FATAL_ERROR( "flex scanner push-back overflow" );
-		}
-
-	*--yy_cp = (char) c;
-
-
-	yytext_ptr = yy_bp;
-	yy_hold_char = *yy_cp;
-	yy_c_buf_p = yy_cp;
-	}
-#endif	/* ifndef YY_NO_UNPUT */
-
-
-#ifdef __cplusplus
-static int yyinput()
-#else
-static int input()
-#endif
-	{
-	int c;
-
-	*yy_c_buf_p = yy_hold_char;
-
-	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
-		{
-		/* yy_c_buf_p now points to the character we want to return.
-		 * If this occurs *before* the EOB characters, then it's a
-		 * valid NUL; if not, then we've hit the end of the buffer.
-		 */
-		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
-			/* This was really a NUL. */
-			*yy_c_buf_p = '\0';
-
-		else
-			{ /* need more input */
-			int offset = yy_c_buf_p - yytext_ptr;
-			++yy_c_buf_p;
-
-			switch ( yy_get_next_buffer() )
-				{
-				case EOB_ACT_LAST_MATCH:
-					/* This happens because yy_g_n_b()
-					 * sees that we've accumulated a
-					 * token and flags that we need to
-					 * try matching the token before
-					 * proceeding.  But for input(),
-					 * there's no matching to consider.
-					 * So convert the EOB_ACT_LAST_MATCH
-					 * to EOB_ACT_END_OF_FILE.
-					 */
-
-					/* Reset buffer status. */
-					yyrestart( yyin );
-
-					/* fall through */
-
-				case EOB_ACT_END_OF_FILE:
-					{
-					if ( yywrap() )
-						return EOF;
-
-					if ( ! yy_did_buffer_switch_on_eof )
-						YY_NEW_FILE;
-#ifdef __cplusplus
-					return yyinput();
-#else
-					return input();
-#endif
-					}
-
-				case EOB_ACT_CONTINUE_SCAN:
-					yy_c_buf_p = yytext_ptr + offset;
-					break;
-				}
-			}
-		}
-
-	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
-	*yy_c_buf_p = '\0';	/* preserve yytext */
-	yy_hold_char = *++yy_c_buf_p;
-
-
-	return c;
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yyrestart( FILE *input_file )
-#else
-void yyrestart( input_file )
-FILE *input_file;
-#endif
-	{
-	if ( ! yy_current_buffer )
-		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
-
-	yy_init_buffer( yy_current_buffer, input_file );
-	yy_load_buffer_state();
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
-#else
-void yy_switch_to_buffer( new_buffer )
-YY_BUFFER_STATE new_buffer;
-#endif
-	{
-	if ( yy_current_buffer == new_buffer )
-		return;
-
-	if ( yy_current_buffer )
-		{
-		/* Flush out information for old buffer. */
-		*yy_c_buf_p = yy_hold_char;
-		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
-		yy_current_buffer->yy_n_chars = yy_n_chars;
-		}
-
-	yy_current_buffer = new_buffer;
-	yy_load_buffer_state();
-
-	/* We don't actually know whether we did this switch during
-	 * EOF (yywrap()) processing, but the only time this flag
-	 * is looked at is after yywrap() is called, so it's safe
-	 * to go ahead and always set it.
-	 */
-	yy_did_buffer_switch_on_eof = 1;
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_load_buffer_state( void )
-#else
-void yy_load_buffer_state()
-#endif
-	{
-	yy_n_chars = yy_current_buffer->yy_n_chars;
-	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
-	yyin = yy_current_buffer->yy_input_file;
-	yy_hold_char = *yy_c_buf_p;
-	}
-
-
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
-#else
-YY_BUFFER_STATE yy_create_buffer( file, size )
-FILE *file;
-int size;
-#endif
-	{
-	YY_BUFFER_STATE b;
-
-	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-	b->yy_buf_size = size;
-
-	/* yy_ch_buf has to be 2 characters longer than the size given because
-	 * we need to put in 2 end-of-buffer characters.
-	 */
-	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
-	if ( ! b->yy_ch_buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-	b->yy_is_our_buffer = 1;
-
-	yy_init_buffer( b, file );
-
-	return b;
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_delete_buffer( YY_BUFFER_STATE b )
-#else
-void yy_delete_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-	{
-	if ( ! b )
-		return;
-
-	if ( b == yy_current_buffer )
-		yy_current_buffer = (YY_BUFFER_STATE) 0;
-
-	if ( b->yy_is_our_buffer )
-		yy_flex_free( (void *) b->yy_ch_buf );
-
-	yy_flex_free( (void *) b );
-	}
-
-
-#ifndef YY_ALWAYS_INTERACTIVE
-#ifndef YY_NEVER_INTERACTIVE
-extern int isatty YY_PROTO(( int ));
-#endif
-#endif
-
-#ifdef YY_USE_PROTOS
-void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
-#else
-void yy_init_buffer( b, file )
-YY_BUFFER_STATE b;
-FILE *file;
-#endif
-
-
-	{
-	yy_flush_buffer( b );
-
-	b->yy_input_file = file;
-	b->yy_fill_buffer = 1;
-
-#if YY_ALWAYS_INTERACTIVE
-	b->yy_is_interactive = 1;
-#else
-#if YY_NEVER_INTERACTIVE
-	b->yy_is_interactive = 0;
-#else
-	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
-#endif
-#endif
-	}
-
-
-#ifdef YY_USE_PROTOS
-void yy_flush_buffer( YY_BUFFER_STATE b )
-#else
-void yy_flush_buffer( b )
-YY_BUFFER_STATE b;
-#endif
-
-	{
-	if ( ! b )
-		return;
-
-	b->yy_n_chars = 0;
-
-	/* We always need two end-of-buffer characters.  The first causes
-	 * a transition to the end-of-buffer state.  The second causes
-	 * a jam in that state.
-	 */
-	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
-	b->yy_buf_pos = &b->yy_ch_buf[0];
-
-	b->yy_at_bol = 1;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	if ( b == yy_current_buffer )
-		yy_load_buffer_state();
-	}
-
-
-#ifndef YY_NO_SCAN_BUFFER
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
-#else
-YY_BUFFER_STATE yy_scan_buffer( base, size )
-char *base;
-yy_size_t size;
-#endif
-	{
-	YY_BUFFER_STATE b;
-
-	if ( size < 2 ||
-	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
-	     base[size-1] != YY_END_OF_BUFFER_CHAR )
-		/* They forgot to leave room for the EOB's. */
-		return 0;
-
-	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
-	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
-	b->yy_buf_pos = b->yy_ch_buf = base;
-	b->yy_is_our_buffer = 0;
-	b->yy_input_file = 0;
-	b->yy_n_chars = b->yy_buf_size;
-	b->yy_is_interactive = 0;
-	b->yy_at_bol = 1;
-	b->yy_fill_buffer = 0;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	yy_switch_to_buffer( b );
-
-	return b;
-	}
-#endif
-
-
-#ifndef YY_NO_SCAN_STRING
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
-#else
-YY_BUFFER_STATE yy_scan_string( yy_str )
-yyconst char *yy_str;
-#endif
-	{
-	int len;
-	for ( len = 0; yy_str[len]; ++len )
-		;
-
-	return yy_scan_bytes( yy_str, len );
-	}
-#endif
-
-
-#ifndef YY_NO_SCAN_BYTES
-#ifdef YY_USE_PROTOS
-YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
-#else
-YY_BUFFER_STATE yy_scan_bytes( bytes, len )
-yyconst char *bytes;
-int len;
-#endif
-	{
-	YY_BUFFER_STATE b;
-	char *buf;
-	yy_size_t n;
-	int i;
-
-	/* Get memory for full buffer, including space for trailing EOB's. */
-	n = len + 2;
-	buf = (char *) yy_flex_alloc( n );
-	if ( ! buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
-	for ( i = 0; i < len; ++i )
-		buf[i] = bytes[i];
-
-	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
-
-	b = yy_scan_buffer( buf, n );
-	if ( ! b )
-		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
-
-	/* It's okay to grow etc. this buffer, and we should throw it
-	 * away when we're done.
-	 */
-	b->yy_is_our_buffer = 1;
-
-	return b;
-	}
-#endif
-
-
-#ifndef YY_NO_PUSH_STATE
-#ifdef YY_USE_PROTOS
-static void yy_push_state( int new_state )
-#else
-static void yy_push_state( new_state )
-int new_state;
-#endif
-	{
-	if ( yy_start_stack_ptr >= yy_start_stack_depth )
-		{
-		yy_size_t new_size;
-
-		yy_start_stack_depth += YY_START_STACK_INCR;
-		new_size = yy_start_stack_depth * sizeof( int );
-
-		if ( ! yy_start_stack )
-			yy_start_stack = (int *) yy_flex_alloc( new_size );
-
-		else
-			yy_start_stack = (int *) yy_flex_realloc(
-					(void *) yy_start_stack, new_size );
-
-		if ( ! yy_start_stack )
-			YY_FATAL_ERROR(
-			"out of memory expanding start-condition stack" );
-		}
-
-	yy_start_stack[yy_start_stack_ptr++] = YY_START;
-
-	BEGIN(new_state);
-	}
-#endif
-
-
-#ifndef YY_NO_POP_STATE
-static void yy_pop_state()
-	{
-	if ( --yy_start_stack_ptr < 0 )
-		YY_FATAL_ERROR( "start-condition stack underflow" );
-
-	BEGIN(yy_start_stack[yy_start_stack_ptr]);
-	}
-#endif
-
-
-#ifndef YY_NO_TOP_STATE
-static int yy_top_state()
-	{
-	return yy_start_stack[yy_start_stack_ptr - 1];
-	}
-#endif
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-#ifdef YY_USE_PROTOS
-static void yy_fatal_error( yyconst char msg[] )
-#else
-static void yy_fatal_error( msg )
-char msg[];
-#endif
-	{
-	(void) fprintf( stderr, "%s\n", msg );
-	exit( YY_EXIT_FAILURE );
-	}
-
-
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-		yytext[yyleng] = yy_hold_char; \
-		yy_c_buf_p = yytext + n; \
-		yy_hold_char = *yy_c_buf_p; \
-		*yy_c_buf_p = '\0'; \
-		yyleng = n; \
-		} \
-	while ( 0 )
-
-
-/* Internal utility routines. */
-
-#ifndef yytext_ptr
-#ifdef YY_USE_PROTOS
-static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
-#else
-static void yy_flex_strncpy( s1, s2, n )
-char *s1;
-yyconst char *s2;
-int n;
-#endif
-	{
-	register int i;
-	for ( i = 0; i < n; ++i )
-		s1[i] = s2[i];
-	}
-#endif
-
-#ifdef YY_NEED_STRLEN
-#ifdef YY_USE_PROTOS
-static int yy_flex_strlen( yyconst char *s )
-#else
-static int yy_flex_strlen( s )
-yyconst char *s;
-#endif
-	{
-	register int n;
-	for ( n = 0; s[n]; ++n )
-		;
-
-	return n;
-	}
-#endif
-
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_alloc( yy_size_t size )
-#else
-static void *yy_flex_alloc( size )
-yy_size_t size;
-#endif
-	{
-	return (void *) malloc( size );
-	}
-
-#ifdef YY_USE_PROTOS
-static void *yy_flex_realloc( void *ptr, yy_size_t size )
-#else
-static void *yy_flex_realloc( ptr, size )
-void *ptr;
-yy_size_t size;
-#endif
-	{
-	/* The cast to (char *) in the following accommodates both
-	 * implementations that use char* generic pointers, and those
-	 * that use void* generic pointers.  It works with the latter
-	 * because both ANSI C and C++ allow castless assignment from
-	 * any pointer type to void*, and deal with argument conversions
-	 * as though doing an assignment.
-	 */
-	return (void *) realloc( (char *) ptr, size );
-	}
-
-#ifdef YY_USE_PROTOS
-static void yy_flex_free( void *ptr )
-#else
-static void yy_flex_free( ptr )
-void *ptr;
-#endif
-	{
-	free( ptr );
-	}
-
-#if YY_MAIN
-int main()
-	{
-	yylex();
-	return 0;
-	}
-#endif
-#line 540 "cscanner.l"
-
-
-struct skeyword
-{
-  /*@null@*/ /*@observer@*/ char *name;
-  int token;
-} ;
-
-/*
-** These tokens are followed by syntax that is parsed by the 
-** grammar proper.
-*/
-
-struct skeyword s_parsetable[] = {
-  { "modifies", QMODIFIES } ,
-  { "globals", QGLOBALS } ,
-  { "alt", QALT } ,
-  { "constant", QCONSTANT } ,
-  { "function", QFUNCTION } ,
-  { "iter", QITER } ,
-  { "defines", QDEFINES } ,
-  { "uses", QUSES } ,
-  { "allocates", QALLOCATES } ,
-  { "sets", QSETS } ,
-  { "releases", QRELEASES } ,
-  { "pre", QPRECLAUSE } ,
-  { "post", QPOSTCLAUSE } ,
-  {"setBufferSize", QSETBUFFERSIZE},
-  {"bufferConstraint", QBUFFERCONSTRAINT},
-  {"ensuresConstraint", QENSURESCONSTRAINT},
-  {"setStringLength", QSETSTRINGLENGTH},
-  {"testinRange", QTESTINRANGE},
-  { NULL, BADTOK }
-} ;
-
-/*
-** These tokens are either stand-alone tokens, or followed by 
-** token-specific text.
-*/
-
-struct skeyword s_keytable[] = {
-  { "anytype", QANYTYPE } ,
-  { "integraltype", QINTEGRALTYPE } ,
-  { "unsignedintegraltype", QUNSIGNEDINTEGRALTYPE } ,
-  { "signedintegraltype", QSIGNEDINTEGRALTYPE } ,
-  { "out", QOUT } ,
-  { "in", QIN } ,
-  { "only", QONLY } , 
-  { "owned", QOWNED } ,
-  { "dependent", QDEPENDENT } ,
-  { "partial", QPARTIAL } ,
-  { "special", QSPECIAL } ,
-  { "truenull", QTRUENULL } ,
-  { "falsenull", QFALSENULL } ,
-  { "keep", QKEEP } ,
-  { "kept", QKEPT } ,
-  { "notnull", QNOTNULL } ,
-  { "abstract", QABSTRACT } ,
-  { "concrete", QCONCRETE } ,
-  { "mutable", QMUTABLE } ,
-  { "immutable", QIMMUTABLE } ,
-  { "unused", QUNUSED } ,
-  { "external", QEXTERNAL } ,
-  { "sef", QSEF } ,
-  { "unique", QUNIQUE } ,
-  { "returned", QRETURNED } ,
-  { "exposed", QEXPOSED } ,
-  { "refcounted", QREFCOUNTED } ,
-  { "refs", QREFS } ,
-  { "newref", QNEWREF } ,
-  { "tempref", QTEMPREF } ,
-  { "killref", QKILLREF } ,
-  { "null", QNULL } ,
-  { "relnull", QRELNULL } ,
-  { "nullterminated", QNULLTERMINATED }, 
-  { "setBufferSize", QSETBUFFERSIZE },
-  { "bufferConstraint", QBUFFERCONSTRAINT },
-  { "ensuresConstraint", QENSURESCONSTRAINT },
-  { "testInRange", QTESTINRANGE},
-  { "MaxSet", QMAXSET},
-  { "MaxRead", QMAXREAD},
-  { "reldef", QRELDEF } ,
-  { "observer", QOBSERVER } ,
-  { "exits", QEXITS } ,
-  { "mayexit", QMAYEXIT } ,
-  { "trueexit", QTRUEEXIT } ,
-  { "falseexit", QFALSEEXIT } ,
-  { "neverexit", QNEVEREXIT } ,
-  { "temp", QTEMP } ,
-  { "shared", QSHARED } ,
-  { "ref", QREF } ,
-  { "unchecked", QUNCHECKED } ,
-  { "checked", QCHECKED } ,
-  { "checkmod", QCHECKMOD } ,
-  { "checkedstrict", QCHECKEDSTRICT } ,
-  { "innercontinue", QINNERCONTINUE } ,
-  { "innerbreak", QINNERBREAK } ,
-  { "loopbreak", QLOOPBREAK } ,
-  { "switchbreak", QSWITCHBREAK } ,
-  { "safebreak", QSAFEBREAK } , 
-  { "fallthrough", QFALLTHROUGH } ,
-  { "l_fallthrou", QLINTFALLTHROUGH } , 
-  { "l_fallth", QLINTFALLTHRU } ,
-  { "notreached", QNOTREACHED } ,
-  { "l_notreach", QLINTNOTREACHED } ,
-  { "printflike", QPRINTFLIKE } ,
-  { "l_printfli", QLINTPRINTFLIKE } ,
-  { "scanflike", QSCANFLIKE } ,
-  { "messagelike", QMESSAGELIKE } ,
-  { "l_argsus", QARGSUSED } ,
-  { NULL, BADTOK } 
-} ;
-
-/*
-** would be better if these weren't hard coded...
-*/
-
-static bool isArtificial (cstring s)
-{
-  return (cstring_equalLit (s, "modifies") 
-	  || cstring_equalLit (s, "globals") 
-	  || cstring_equalLit (s, "alt"));
-}
-
-void swallowMacro (void)
-{
-  int i;
-  bool skipnext = FALSE;
-
-  while ((i = lminput ()) != EOF)
-    {
-      char c = (char) i;
-      
-      
-      if (c == '\\')
-	{
-	  skipnext = TRUE;
-	}
-      else if (c == '\n')
-	{
-	  if (skipnext)
-	    {
-	      skipnext = FALSE;
-	    }
-	  else
-	    {
-	      checkUngetc (i, yyin);
-	      return;
-	    }
-	}
-    }
-
-  if (i != EOF)
-    {
-      checkUngetc (i, yyin);
-    }
-}
-
-static int commentMarkerToken (cstring s)
-{
-  int i = 0;
-  
-  while (s_parsetable[i].name != NULL) 
-    {
-      if (cstring_equalLit (s, s_parsetable[i].name))
-	{
-	  return s_parsetable[i].token;
-	}
-
-      i++;
-    }
-
-  return BADTOK;
-}
-
-static int tokenMacroCode (cstring s)
-{
-  int i = 0;
-  
-  while (s_keytable[i].name != NULL) 
-    {
-      if (cstring_equalLit (s, s_keytable[i].name)) 
-	{
-	  if (s_keytable[i].token == QLINTFALLTHROUGH) 
-	    {
-	      voptgenerror
-		(FLG_WARNLINTCOMMENTS,
-		 cstring_makeLiteral
-		 ("Traditional lint comment /*FALLTHROUGH*/ used.  "
-		  "This is interpreted by "
-		  "LCLint in the same way as most Unix lints, but it is "
-		  "preferable to replace it with the /*@fallthrough@*/ "
-		  "stylized comment"),
-		 g_currentloc);
-	      return QFALLTHROUGH;	      
-	    }
-	  else if (s_keytable[i].token == QLINTFALLTHRU)
-	    {
-	      voptgenerror 
-		(FLG_WARNLINTCOMMENTS,
-		 cstring_makeLiteral
-		 ("Traditional lint comment /*FALLTHRU*/ used.  "
-		  "This is interpreted by "
-		  "LCLint in the same way as most Unix lints, but it is "
-		  "preferable to replace it with the /*@fallthrough@*/ "
-		  "stylized comment"),
-		 g_currentloc);
-	      return QFALLTHROUGH;
-	    }
-	  else if (s_keytable[i].token == QLINTNOTREACHED)
-	    {
-	      voptgenerror 
-		(FLG_WARNLINTCOMMENTS,
-		 cstring_makeLiteral
-		 ("Traditional lint comment /*NOTREACHED*/ used.  "
-		  "This is interpreted by "
-		  "LCLint in the same way as most Unix lints, but it is "
-		  "preferable to replace it with the /*@notreached@*/ "
-		  "stylized comment."),
-		 g_currentloc);
-	      
-	      return QNOTREACHED;
-	    }
-	  else if (s_keytable[i].token == QPRINTFLIKE)
-	    {
-	      setSpecialFunction (QU_PRINTFLIKE);
-	      return SKIPTOK;
-	    }
-	  else if (s_keytable[i].token == QLINTPRINTFLIKE)
-	    {	      
-	      voptgenerror 
-		(FLG_WARNLINTCOMMENTS,
-		 cstring_makeLiteral
-		 ("Traditional lint comment /*PRINTFLIKE*/ used.  "
-		  "This is interpreted by "
-		  "LCLint in the same way as most Unix lints, but it is "
-		  "preferable to replace it with either /*@printflike@*/, "
-		  "/*@scanflike@*/ or /*@messagelike@*/."),
-		 g_currentloc);
-	      
-	      setSpecialFunction (QU_PRINTFLIKE);
-	      return SKIPTOK;
-	    }
-	  else if (s_keytable[i].token == QSCANFLIKE)
-	    {
-	      setSpecialFunction (QU_SCANFLIKE);
-	      return SKIPTOK;
-	    }
-	  else if (s_keytable[i].token == QMESSAGELIKE)
-	    {
-	      setSpecialFunction (QU_MESSAGELIKE);
-	      return SKIPTOK;
-	    }
-	  else if (s_keytable[i].token == QARGSUSED)
-	    {
-	      voptgenerror
-		(FLG_WARNLINTCOMMENTS,
-		 cstring_makeLiteral
-		 ("Traditional lint comment /*ARGSUSED*/ used.  "
-		  "This is interpreted by "
-		  "LCLint in the same way as most Unix lints, but it is "
-		  "preferable to use /*@unused@*/ annotations on "
-		  "the unused parameters."),
-		 g_currentloc);
-	      
-	      setArgsUsed ();
-	      return SKIPTOK;
-	    }
-	  
-	  return s_keytable[i].token;
-	}
-      
-      i++;
-    }
-  
-  return BADTOK;
-}
-
-static int lminput ()
-{
-  if (savechar == '\0')
-    {
-      incColumn ();
-      return (input ());
-    }
-  else
-    {
-      int save = (int) savechar;
-      savechar = '\0';
-      return save;
-    }
-}
-
-static void lmsavechar (char c)
-{
-  if (savechar == '\0') savechar = c;
-  else
-    {
-      llbuglit ("lmsavechar: override");
-    }
-}
-
-static int returnFloat (ctype ct, double f)
-{
-  yylval.expr = exprNode_floatLiteral (f, ct, cstring_fromChars (yytext), 
-				       fileloc_decColumn (g_currentloc, tokLength));
-  tokLength = 0; 
-  return (CCONSTANT);
-}
-
-static int returnInt (ctype ct, long i)
-{
-  ctype c = ct;
-
-  if (ctype_equal (ct, ctype_int))
-    {
-      if (i == 0)
-	{
-	  c = context_typeofZero ();
-	}
-      else if (i == 1)
-	{
-	  c = context_typeofOne ();
-	}
-    }
-  
-  yylval.expr = exprNode_numLiteral (c, cstring_fromChars (yytext), 
-				     fileloc_decColumn (g_currentloc, tokLength), i);   
-  tokLength = 0; 
-  return (CCONSTANT);
-}
-
-static int returnChar (char c)
-{
-  yylval.expr = exprNode_charLiteral (c, cstring_fromChars (yytext), 
-				      fileloc_decColumn (g_currentloc, tokLength));
-  tokLength = 0; 
-  return (CCONSTANT);
-}
-
-static int ninput ()  
-{
-  int c = lminput ();
-
-  if (c != EOF && ((char)c == '\n'))
-    {
-      context_incLineno ();
-    }
-
-  return c;
-}
-
-static char macro_nextChar ()
-{
-  static bool in_quote = FALSE, in_escape = FALSE, in_char = FALSE;
-  int ic;
-  char c;
-
-  ic = lminput ();
-  c = char_fromInt (ic);
-  
-  if (!in_quote && !in_char && (c == '\\' || c == BEFORE_COMMENT_MARKER[0]))
-    {
-      if (c == '\\')
-	{
-	  while ((c = char_fromInt (lminput ())) != '\0' && c != '\n')
-	    {
-	      ; /* skip to newline */
-	    }
-	  
-	  context_incLineno ();
-	  
-	  if (c != '\0')
-	    {
-	      return macro_nextChar ();
-	    }
-	  else 
-	    {
-	      return c;
-	    }
-	}
-      else /* if (c == '@') */
-	{
-	  if (handleLlSpecial () != BADTOK)
-	    {
-	      llerrorlit (FLG_SYNTAX, "Macro cannot use special syntax");
-	    }
-
-	  return macro_nextChar ();
-	}
-    }
-  else if (!in_escape && c == '\"')
-    {
-      in_quote = !in_quote;
-    }
-  else if (!in_escape && c == '\'')
-    {
-      in_char = !in_char;
-    }
-  else if ((in_quote || in_char) && c == '\\')
-    {
-      in_escape = !in_escape;
-    }
-  else if ((in_quote || in_char) && in_escape)
-    {
-      in_escape = FALSE;
-    }
-  else if (!in_quote && c == '/')
-    {
-      char c2;
-      
-      if ((c2 = char_fromInt (lminput ())) == '*')
-	{
-	  while (c2 != '\0')
-	    {
-	      while ((c2 = char_fromInt (lminput ())) != '\0'
-		     && c2 != '\n' && c2 != '*')
-		{
-		  ;
-		}
-	      
-	      if (c2 == '*')
-		{
-		  while ((c2 = char_fromInt (lminput ())) != '\0' 
-			 && c2 == '*')
-		    {
-		      ;
-		    }
-
-		  if (c2 == '/')
-		    {
-		      goto outofcomment;
-		    }
-		}
-	      else 
-		{
-		  llfatalerror (cstring_makeLiteral ("Macro: bad comment!"));
-		}
-	    }
-	outofcomment:
-	  return macro_nextChar ();
-	}
-      else
-	{
-          /*** putchar does not work!  why?  puts to stdio...??! ***/
-          lmsavechar (c2);
-	}
-    }
-  return c;
-}
-
-/*
-** keeps stylized comments
-*/
-
-static char macro_nextCharC ()
-{
-  static bool in_quote = FALSE, in_escape = FALSE, in_char = FALSE;
-  char c;
-
-  c = char_fromInt (lminput ());
-
-  if (!in_quote && !in_char && c == '\\')
-    {
-      while ((c = char_fromInt (lminput ())) != '\0' && c != '\n')
-	{
-	  ; /* skip to newline */
-	}
-      
-      context_incLineno ();
-      
-      if (c != '\0')
-	{
-	  return macro_nextCharC ();
-	}
-      else
-	{
-	  return c;
-	}
-    }
-  else if (!in_escape && c == '\"')
-    {
-      in_quote = !in_quote;
-    }
-  else if (!in_escape && c == '\'')
-    {
-      in_char = !in_char;
-    }
-  else if ((in_quote || in_char) && c == '\\')
-    {
-      in_escape = !in_escape;
-    }
-  else if ((in_quote || in_char) && in_escape)
-    {
-      in_escape = FALSE;
-    }
-  else if (!in_quote && c == '/')
-    {
-      char c2;
-      
-      if ((c2 = char_fromInt (lminput ())) == '*')
-	{
-	  while (c2 != '\0')
-	    {
-	      while ((c2 = char_fromInt (lminput ())) != '\0' 
-		     && c2 != '\n' && c2 != '*')
-		{
-		  ;
-		}
-	      
-	      if (c2 == '*')
-		{
-		  while ((c2 = char_fromInt (lminput ())) != '\0'
-			 && c2 == '*')
-		    {
-		      ;
-		    }
-
-		  if (c2 == '/') 
-		    {
-		      goto outofcomment;
-		    }
-		}
-	      else 
-		{
-		  llfatalerror (cstring_makeLiteral ("Macro: bad comment!"));
-		}
-	    }
-	outofcomment:
-	  return macro_nextCharC ();
-	}
-      else
-	{
-	  lmsavechar (c2);
-	}
-    }
-  return c;
-}
-
-/*
-** skips whitespace (handles line continuations)
-** returns first non-whitespace character
-*/
-
-static char skip_whitespace ()
-{
-  char c;
-
-  while ((c = macro_nextChar ()) == ' ' || c == '\t')
-    {
-      ;
-    }
-
-  return c;
-}
-
-static void handleMacro ()
-{
-  cstring mac = cstring_undefined;
-  int macrocode;
-  char c;
-
-  while (currentColumn () > 2)
-    {
-      mac = cstring_appendChar (mac, ' ');
-      setTokLength (-1);
-    }
-
-  c = macro_nextCharC ();
-
-  if (c >= '0' && c <= '9')
-    {
-      int i;
-
-      for (i = 0; i < ((c - '0') + 1); i++)
-	{
-	  mac = cstring_appendChar (mac, ' ');
-	}
-    }
-  else
-    {
-      BADBRANCH;
-    }
-
-  while (((c = macro_nextCharC ()) != '\0') && (c != '\n'))
-    {
-      mac = cstring_appendChar (mac, c);
-    }
-
-  
-  macrocode = tokenMacroCode (mac);
-
-  if (macrocode == BADTOK && !isArtificial (mac))
-    {
-      DPRINTF (("Add macro: %s", mac));
-      context_addMacroCache (mac);
-    }
-  else
-    {
-      cstring_free (mac);
-    }
-
-  if (c == '\n')
-    {
-      context_incLineno ();
-    }
-}
-
-static bool processMacro (void)
-{
-  uentry e2;
-  ctype ct;
-  int noparams = 0;
-  cstring fname = cstring_undefined;
-  bool res = TRUE;
-  bool isspecfcn = FALSE;
-  bool isiter = FALSE;
-  bool skipparam = FALSE;
-  bool isenditer = FALSE;
-  bool unknownm = FALSE;
-  bool hasParams = FALSE;
-  bool emptyMacro = FALSE;
-  char c = skip_whitespace ();
-  fileloc loc = fileloc_noColumn (g_currentloc);
-
-  /* are both of these necessary?  what do they mean? */
-  uentryList specparams = uentryList_undefined;
-  uentryList pn = uentryList_undefined;
-
-  context_resetMacroMissingParams ();
-
-  if (c == '\0' || c == '\n')
-    {
-      llcontbug (cstring_makeLiteral ("Bad macro"));
-      fileloc_free (loc);
-      return FALSE;
-    }
-  
-  fname = cstring_appendChar (fname, c);  
-
-  while ((c = macro_nextChar ()) != '(' && c != '\0'
-	 && c != ' ' && c != '\t' && c != '\n')
-    {
-      fname = cstring_appendChar (fname, c);
-    }
-
-  if (c == ' ' || c == '\t' || c == '\n')
-    {
-      char oldc = c;
-
-      if (c != '\n')
-	{
-	  while (c == ' ' || c == '\t')
-	    {
-	      c = macro_nextChar ();
-	    }
-	  unput (c);
-	}
-
-      if (c == '\n')
-	{
-	  emptyMacro = TRUE;
-	  unput (c);
-	}
-
-      c = oldc;
-    }
-
-  hasParams = (c == '(');
-
-  
-  if (usymtab_exists (fname))
-    {
-      e2 = usymtab_lookupExpose (fname);
-      ct = uentry_getType (e2);
-
-      
-      if (uentry_isCodeDefined (e2) 
-	  && fileloc_isUser (uentry_whereDefined (e2)))
-	{
-	  if (optgenerror 
-	      (FLG_MACROREDEF,
-	       message ("Macro %s already defined", fname),
-	       loc))
-	    {
-	      uentry_showWhereDefined (e2);
-	      uentry_clearDefined (e2);
-	    }
-
-	  if (uentry_isFunction (e2))
-	    {
-	      uentry_setType (e2, ctype_unknown);
-	      ct = ctype_unknown;
-	      unknownm = TRUE;
-	      context_enterUnknownMacro (e2); 
-	    }
-	  else
-	    {
-	      context_enterConstantMacro (e2);
-	    }
-	}
-      else
-	{
-	  if (uentry_isForward (e2) && uentry_isFunction (e2))
-	    {
-	      unknownm = TRUE;
-
-	      voptgenerror 
-		(FLG_MACROFCNDECL,
-		 message
-		 ("Parameterized macro has no prototype or specification: %s ", 
-		  fname),
-		 loc);
-	      
-	      ct = ctype_unknown;
-	      uentry_setType (e2, ctype_unknown);
-	      uentry_setFunctionDefined (e2, loc); 
-	      uentry_setUsed (e2, fileloc_undefined);
-	      context_enterUnknownMacro (e2); 
-	    }
-	  else
-	    {
-	      if (uentry_isIter (e2))
-		{
-		  isiter = TRUE;
-		  specparams = uentry_getParams (e2);
-		  noparams = uentryList_size (specparams);
-		  uentry_setDefined (e2, loc);
-		  context_enterIterDef (e2); 
-		}
-	      else if (uentry_isEndIter (e2))
-		{
-		  isenditer = TRUE;
-		  uentry_setDefined (e2, loc);
-		  context_enterIterEnd (e2); /* don't care about it now */
-		  /* but should parse like an iter! */
-		}
-	      else if (uentry_isConstant (e2))
-		{
-		  if (hasParams)
-		    {
-		      voptgenerror 
-			(FLG_INCONDEFS, 
-			 message ("Constant %s implemented as parameterized macro",
-				  fname),
-			 g_currentloc);
-		      
-		      uentry_showWhereSpecified (e2);
-		      uentry_setType (e2, ctype_unknown);
-		      uentry_makeVarFunction (e2);
-		      uentry_setDefined (e2, g_currentloc);
-		      uentry_setFunctionDefined (e2, g_currentloc);
-		      context_enterUnknownMacro (e2); 
-		    }
-		  else
-		    {
-		      if (!uentry_isSpecified (e2))
-			{
-			  fileloc oloc = uentry_whereDeclared (e2);
-
-			  if (fileloc_isLib (oloc))
-			    {
-			      ;
-			    }
-			  else if (fileloc_isUndefined (oloc)
-				   || fileloc_isPreproc (oloc))
-			    {
-			      if (!emptyMacro)
-				{
-				  voptgenerror
-				    (FLG_MACROCONSTDECL,
-				     message 
-				     ("Macro constant %q not declared",
-				      uentry_getName (e2)),
-				     loc);			 
-				}
-			    }
-			  else if (!fileloc_withinLines (oloc, loc, 2))
-			    { /* bogus!  will give errors if there is too much whitespace */
-			      voptgenerror
-				(FLG_SYNTAX,
-				 message 
-				 ("Macro constant name %s does not match name in "
-				  "previous constant declaration.  This constant "
-				  "is declared at %q", fname, 
-				  fileloc_unparse (oloc)),
-				 loc);
-			    }
-			}
-
-		      context_enterConstantMacro (e2);	      
-		      cstring_free (fname);
-		      fileloc_free (loc);
-		      return res;
-		    }
-
-		}
-	      else if (ctype_isFunction (ct))
-		{
-		  isspecfcn = TRUE;
-		  specparams = ctype_argsFunction (ct);
-		  noparams = uentryList_size (specparams);
-		  
-		  uentry_setFunctionDefined (e2, loc); 
-		  context_enterMacro (e2);
-		}
-	      else if (uentry_isVar (e2))
-		{
-		  if (hasParams)
-		    {
-		      voptgenerror
-			(FLG_INCONDEFS,
-			 message ("Variable %s implemented as parameterized macro", 
-				  fname),
-			 loc);
-
-		      uentry_showWhereSpecified (e2);
-		      uentry_setType (e2, ctype_unknown);
-		      uentry_makeVarFunction (e2);
-		      uentry_setDefined (e2, g_currentloc);
-		      uentry_setFunctionDefined (e2, g_currentloc);
-		      context_enterUnknownMacro (e2); 
-		    }
-		  else
-		    {
-		      uentry ucons = uentry_makeConstant (fname,
-							  ctype_unknown,
-							  loc);
-		      if (uentry_isExpandedMacro (e2))
-			{
-			  ; /* okay */
-			}
-		      else
-			{
-			  if (optgenerror 
-			      (FLG_INCONDEFS,
-			       message ("Variable %s implemented by a macro",
-					fname),
-			       loc))
-			    {
-			      uentry_showWhereSpecified (e2);
-			    }
-			}
-
-		      uentry_setDefined (e2, loc);
-		      uentry_setUsed (ucons, loc);
-
-		      context_enterConstantMacro (ucons);
-		      uentry_markOwned (ucons);
-		      cstring_free (fname);
-		      return res;
-		    }
-		}
-	      else
-		{
-		  if (uentry_isDatatype (e2))
-		    {
-		      vgenhinterror 
-			(FLG_SYNTAX,
-			 message ("Type implemented as macro: %x", 
-				  uentry_getName (e2)),
-			 message ("A type is implemented using a macro definition.  A "
-				  "typedef should be used instead."),
-			 g_currentloc);
-
-		      swallowMacro ();
-		      /* Must exit scope (not sure why a new scope was entered?) */
-		      usymtab_quietExitScope (g_currentloc);
-		      uentry_setDefined (e2, g_currentloc);
-		      res = FALSE;
-		    }
-		  else
-		    {
-		      llcontbug 
-			(message ("Unexpanded macro not function or constant: %q", 
-				  uentry_unparse (e2)));
-		      uentry_setType (e2, ctype_unknown);
-		      
-		      if (hasParams)
-			{
-			  uentry_makeVarFunction (e2);
-			  uentry_setDefined (e2, g_currentloc);
-			  uentry_setFunctionDefined (e2, g_currentloc);
-			  context_enterUnknownMacro (e2); 
-			}
-		    }
-		}
-	    }
-	}
-    }
-  else
-    {
-      uentry ce;
-
-      voptgenerror 
-	(FLG_MACROMATCHNAME,
-	 message ("Unexpanded macro %s does not match name of a constant "
-		  "or iter declaration.  The name used in the control "
-		  "comment on the previous line should match.  "
-		  "(Assuming macro defines a constant.)", 
-		  fname),
-	 loc);
-
-
-      ce = uentry_makeConstant (fname, ctype_unknown, fileloc_undefined);      
-      uentry_setUsed (ce, loc); /* perhaps bogus? */
-      e2 = usymtab_supEntryReturn (ce);
-      
-      context_enterConstantMacro (e2);	      
-      cstring_free (fname);
-      fileloc_free (loc);
-      return res;
-    }
-  
-  /* in macros, ( must follow immediatetly after name */
-  
-  if (hasParams)
-    {
-      int paramno = 0;
-      
-      c = skip_whitespace ();
-
-      while (c != ')' && c != '\0')
-	{
-	  uentry  param;
-	  bool    suppress = context_inSuppressRegion ();
-	  cstring paramname = cstring_undefined;
-
-	  /*
-	  ** save the parameter location
-	  */
-
-	  decColumn ();
-	  context_saveLocation ();
-	  incColumn ();
-
-	  while (c != ' ' && c != '\t' && c != ',' && c != '\0' && c != ')')
-	    {
-	      paramname = cstring_appendChar (paramname, c);
-	      c = macro_nextChar ();
-	    }
-	  
-	  if (c == ' ' || c == '\t') c = skip_whitespace ();
-
-	  if (c == ',')
-	    {
-	      c = macro_nextChar ();
-	      if (c == ' ' || c == '\t') c = skip_whitespace ();
-	    }
-	  
-	  if (c == '\0')
-	    {
-	      llfatalerror (cstring_makeLiteral
-			    ("Bad macro syntax: uentryList"));
-	    }
-	  
-	  if ((isspecfcn || isiter) && (paramno < noparams)
-	      && !uentry_isElipsisMarker (uentryList_getN 
-					  (specparams, paramno)))
-	    {
-	      uentry decl = uentryList_getN (specparams, paramno);
-	      sRef sr;
-	      
-	      param = uentry_nameCopy (paramname, decl);
-
-	      	      	      
-	      uentry_setParam (param);
-	      sr = sRef_makeParam (paramno, uentry_getType (param));
-
-	      if (sRef_getNullState (sr) == NS_ABSNULL)
-		{
-		  ctype pt = ctype_realType (uentry_getType (param));
-
-		  if (ctype_isUser (pt))
-		    {
-		      uentry te = usymtab_getTypeEntrySafe (ctype_typeId (pt));
-		      
-		      if (uentry_isValid (te))
-			{
-			  sRef_setStateFromUentry (sr, te);
-			}
-		    }
-		  else
-		    {
-		      sRef_setNullState (sr, NS_UNKNOWN, g_currentloc);
-		    }
-		}
-
-	      uentry_setSref (param, sr);
-	      uentry_setDeclaredForceOnly (param, context_getSaveLocation ());
-
-	      skipparam = isiter && uentry_isOut (uentryList_getN (specparams, paramno));
-	    }
-	  else
-	    {
-	      fileloc sloc = context_getSaveLocation ();
-
-	      param = uentry_makeVariableSrefParam 
-		(paramname, ctype_unknown, sRef_makeParam (paramno, ctype_unknown));
-	      cstring_free (paramname);
-
-	      sRef_setPosNull  (uentry_getSref (param), sloc);
-
-	      uentry_setDeclaredForce (param, sloc);
-
-	      skipparam = FALSE;
-	      fileloc_free (sloc);
-	    }
-
-	  if (!skipparam)
-	    {
-	      llassert (!uentry_isElipsisMarker (param));
-
-	      if (!suppress)
-		{
-		  sRef_makeUnsafe (uentry_getSref (param));
-		}
-	      
-	      pn = uentryList_add (pn, uentry_copy (param));
-	      usymtab_supEntry (param);
-	    }
-	  else
-	    {
-	      /* don't add param */
-	      uentry_free (param);
-	    }
-
-	  if (c == ',') 
-	    {
-	      (void) macro_nextChar ();
-	      c = skip_whitespace ();
-	    }
-
-	  paramno++;
-	}
-      
-      if (c == ')')
-	{
-	  if (isspecfcn || isiter)
-	    {
-	      if (paramno != noparams && noparams >= 0)
-		{
-		  advanceLine ();
-
-		  voptgenerror 
-		    (FLG_INCONDEFS,
-		     message ("Macro %s specified with %d args, defined with %d", 
-			      fname, noparams, paramno),
-		     g_currentloc);
-
-		  uentry_showWhereSpecified (e2);
-		  uentry_resetParams (e2, pn);
-		}
-	    }
-	  else
-	    {
-	      uentry_resetParams (e2, pn);
-	    }
-	}
-    }
-  else
-    {
-      /*
-      ** the form should be:
-      **
-      ** # define newname oldname
-      ** where oldname refers to a function matching the specification
-      ** of newname.
-      */
-
-      if (unknownm)
-	{
-	  sRef_setGlobalScope ();
-	  usymtab_supGlobalEntry (uentry_makeVariableLoc (fname, ctype_unknown));
-	  sRef_clearGlobalScope ();
-	}
-      else
-	{
-	  context_setMacroMissingParams ();
-	}
-    }
-  
-  
-  /* context_setuentryList (pn); */
-  usymtab_enterScope ();
-
-  fileloc_free (loc);
-  cstring_free (fname);
-
-  return res;
-}
-
-static bool handleSpecial (char *yyt)
-{
-  char *l = mstring_create (MAX_NAME_LENGTH);
-  static bool reportcpp = FALSE;
-  int lineno = 0;
-  char c;
-  char *ol;
-  cstring olc;
-  
-  strcpy (l, yyt + 1);
-
-  /* Need to safe original l for deallocating. */
-  ol = l;
-
-  l += strlen (yyt) - 1;
-  
-  while ((c = char_fromInt (lminput ())) != '\n' && c != '\0')
-    {
-      *l++ = c;
-    }
-
-  *l = '\0';
-  olc = cstring_fromChars (ol);
-  
-  if (cstring_equalPrefix (olc, "pragma"))
-    {
-      char *pname = mstring_create (longUnsigned_fromInt (MAX_PRAGMA_LEN));
-      char *opname = pname;
-      char *ptr = ol + 6; /* pragma is six characters, plus space */
-      int len = 0;
-      
-      
-      /* skip whitespace */
-      while (((c = *ptr) != '\0') && isspace (c))
-	{
-	  ptr++;
-	}
-
-      
-      while (((c = *ptr) != '\0') && !isspace (c))
-	{
-	  len++;
-
-	  if (len > MAX_PRAGMA_LEN)
-	    {
-	      break;
-	    }
-
-	  ptr++;
-	  *pname++ = c;
-	}
-
-      *pname = '\0';
-      
-      if (len == PRAGMA_LEN_EXPAND 
-	  && mstring_equal (opname, PRAGMA_EXPAND))
-	{
-	  cstring exname = cstring_undefined;
-	  uentry ue;
-	  
-	  ptr++; 
-	  while (((c = *ptr) != '\0') && !isspace (c))
-	    {
-	      exname = cstring_appendChar (exname, c);
-	      ptr++;
-	    }
-	     
-	  
-	  ue = usymtab_lookupExposeGlob (exname);
-	  
-	  if (uentry_isExpandedMacro (ue))
-	    {
-	      if (fileloc_isPreproc (uentry_whereDefined (ue)))
-		{
-		  fileloc_setColumn (g_currentloc, 1);
-		  uentry_setDefined (ue, g_currentloc);
-		}
-	    }
-
-	  cstring_free (exname);
-	}
-    }
-  else if (cstring_equalPrefix (olc, "ident"))
-    {
-      /* Some pre-processors will leave these in the code.  Ignore rest of line */
-    }
-  /*
-  ** Yuk...Win32 filenames can have spaces in them...we need to read
-  ** to the matching end quote.
-  */
-  else if ((sscanf (ol, "line %d \"", &lineno) == 1)
-	   || (sscanf (ol, " %d \"", &lineno) == 1))
-    {
-      char *tmp = ol;
-      char *fname;
-      fileId fid;
-
-      while (*tmp != '\"' && *tmp != '\0')
-	{
-	  tmp++;
-	}
-
-      llassert (*tmp == '\"');
-
-      tmp++;
-      fname = tmp;
-      
-      while (*tmp != '\"' && *tmp != '\0')
-	{
-	  tmp++;
-	}
-
-      llassert (*tmp == '\"');
-
-      *tmp = '\0';
-
-      DPRINTF (("fname: %s", fname));
-
-# if defined(OS2) || defined(MSDOS) || defined(WIN32)
-
-      /*
-      ** DOS-like path delimiters get delivered in pairs, something like 
-      ** \"..\\\\file.h\", so we have to make it normal again. We do NOT
-      ** remove the pre dirs yet as we usually specify tmp paths relative
-      ** to the current directory, so tmp files would not get found in
-      ** the hash table.  If this method fails we try it again later. 
-      */
-
-      {
-	char *stmp = fname;
-	
-	/*
-	** Skip past the drive marker.
-	*/
-	
-	DPRINTF (("stmp: %s / %s", stmp, fname));
-	
-	if (strchr (stmp, ':') != NULL)
-	  {
-	    stmp = strchr (stmp, ':') + 1;
-	  }
-	
-	DPRINTF (("stmp: %s / %s", stmp, fname));
-	
-	while ((stmp = strchr (stmp, CONNECTCHAR)) != NULL )
-	  {
-	    if (*(stmp+1) == CONNECTCHAR)
-	      {
-		memmove (stmp, stmp+1, strlen (stmp));
-	      }
-	    
-	    stmp++;
-	    DPRINTF (("stmp: %s / %s", stmp, fname));
-	  }
-	
-	DPRINTF (("Now: base = %s", fname));
-	
-	fid = fileTable_lookupBase (context_fileTable (),
-				    cstring_fromChars (fname));
-	if (!(fileId_isValid (fid)))
-	  {
-	    fname = removePreDirs (fname);
-	    fid = fileTable_lookupBase (context_fileTable (),
-					cstring_fromChars (fname));
-	  }
-      }
-# else  /* !defined(OS2) && !defined(MSDOS) */
-      fname = removePreDirs (fname);
-      fid = fileTable_lookupBase (context_fileTable (),
-				  cstring_fromChars (fname));
-# endif /* !defined(OS2) && !defined(MSDOS) */
-      
-      if (!(fileId_isValid (fid)))
-	{
-	  if (isHeaderFile (cstring_fromChars (fname)))
-	    {
-	      fid = fileTable_addHeaderFile (context_fileTable (), 
-					     cstring_fromChars (fname));
-	    }
-	  else
-	    {
-	      fid = fileTable_addFile (context_fileTable (), 
-				       cstring_fromChars (fname));
-	    }
-	}
-      
-      setFileLine (fid, lineno);
-    }
-  else if ((sscanf (ol, "line %d", &lineno) == 1) 
-	   || (sscanf (ol, " %d", &lineno) == 1))
-    {
-      setLine (lineno); /* next line is  */
-    }
-  else
-    {
-      if (mstring_equal (ol, "")) {
-	DPRINTF (("Empty pp command!"));
-	/*
-	** evs 2000-05-16: This is a horrible kludge, to get around a bug (well, difficulty) in the pre-processor.
-	** We handle a plain # in the input file, by echoing it, and ignoring it in the post-pp-file.
-	*/
-	mstring_free (ol);
-	return FALSE;
-      } else {
-	if (!reportcpp)
-	  {
-	    
-	  } else {
-	    llbug (message ("File contains preprocessor command: #%s", 
-			    cstring_fromChars (ol)));
-	    reportcpp = TRUE;
-	  }
-      }
-      
-      sfree (ol);
-      return TRUE;
-    }
-
-  sfree (ol);
-  return FALSE;
-}
-  
-static int handleLlSpecial ()
-{ 
-  int ic; 
-  char c;
-  char *s = mstring_createEmpty ();
-  char *os; 
-  int tok;
-  int charsread = 0;
-
-  while (((ic = ninput ()) != 0) && isalpha (ic))
-    {
-      c = (char) ic;
-      s = mstring_append (s, c);
-      charsread++;
-    }
-
-  os = s;
-
-  if (charsread == 0 && ic == (int) AFTER_COMMENT_MARKER[0])
-    {
-      ic = ninput ();
-
-      llassert (ic == AFTER_COMMENT_MARKER[1]);
-
-            
-      if (isProcessingGlobMods () && (*s == '\0'))
-	{
-	  sfree (os);
-	  return QNOMODS; /* special token no modifications token */
-	}
-      else
-	{
-	  ;
-	}
-    }
-  
-  tok = commentMarkerToken (cstring_fromChars (os));
-
-  if (tok != BADTOK)
-    {
-      tokLength = charsread;
-      sfree (os);
-      inSpecPart = TRUE;
-      return tok;
-    }
-  
-  /* Add rest of the comment */
-  
-  if (ic != 0 && ic != EOF)
-    {
-      c = (char) ic;
-
-      
-      s = mstring_append (s, c);
-      charsread++;
-
-      while (((ic = ninput ()) != 0) && (ic != EOF)
-	     && (ic != AFTER_COMMENT_MARKER[0]))
-	{
-	  c = (char) ic;
-	  s = mstring_append (s, c);
-	  charsread++;
-	}
-    }
-
-  if (ic == AFTER_COMMENT_MARKER[0]) 
-    {
-      int nc = ninput ();
-      llassert ((char) nc ==  AFTER_COMMENT_MARKER[1]);
-      charsread++;
-    }
-
-  
-  os = s;
-
-  while (*s == ' ' || *s == '\t' || *s == '\n') 
-    {
-      s++;
-    }
-
-  if (*s == '-' || *s == '+' || *s == '=') /* setting flags */
-    {
-      c = *s;
-
-      while (c == '-' || c == '+' || c == '=')
-	{
-	  ynm set = ynm_fromCodeChar (c);
-	  cstring thisflag;
-
-	  s++;
-	  
-	  thisflag = cstring_fromChars (s);
-	  
-	  while ((c = *s) != '\0' && (c != '-') && (c != '=')
-		 && (c != '+') && (c != ' ') && (c != '\t') && (c != '\n'))
-	    {
-	      s++;
-	    }
-
-	  *s = '\0';
-
-	  if (!context_getFlag (FLG_NOCOMMENTS))
-	    {
-	      cstring flagname = thisflag;
-	      flagcode fflag = identifyFlag (flagname);
-		
-	      if (flagcode_isSkip (fflag))
-		{
-		  ;
-		}
-	      else if (flagcode_isInvalid (fflag))
-		{
-		  if (isMode (flagname))
-		    {
-		      if (ynm_isMaybe (set))
-			{
-			  llerror
-			    (FLG_BADFLAG, 
-			     message 
-			     ("Stylized comment attempts to restore flag %s.  "
-			      "A mode flag cannot be restored.",
-			      flagname));
-			}
-		      else
-			{
-			  context_setMode (flagname);
-			}
-		    }
-		  else
-		    {
-		      llerror
-			(FLG_BADFLAG, 
-			 message ("Unrecognized option in stylized comment: %s", 
-				  flagname));
-		    }
-		}
-	      else if (flagcode_isGlobalFlag (fflag))
-		{
-		  llerror
-		    (FLG_BADFLAG, 
-		     message 
-		     ("Stylized comment attempts to set global flag %s.  "
-		      "A global flag cannot be set locally.",
-		      flagname));
-		}
-	      else
-		{
-		  context_fileSetFlag (fflag, set);
-		  
-		  if (flagcode_hasArgument (fflag))
-		    {
-		      if (ynm_isMaybe (set))
-			{
-			  llerror
-			    (FLG_BADFLAG, 
-			     message 
-			     ("Stylized comment attempts to restore flag %s.  "
-			      "A flag for setting a value cannot be restored.",
-			      flagname));
-			}
-		      else
-			{ /* cut-and-pastied from llmain...blecch */
-			  cstring extra = cstring_undefined;
-			  char *rest;
-			  char *orest;
-			  char rchar;
-			  
-			  *s = c;
-			  rest = mstring_copy (s);
-			  orest = rest;
-			  *s = '\0';
-			  
-			  while ((rchar = *rest) != '\0'
-				 && (isspace (rchar)))
-			    {
-			      rest++;
-			      s++;
-			    }
-			  
-			  while ((rchar = *rest) != '\0'
-				 && !isspace (rchar))
-			    {
-			      extra = cstring_appendChar (extra, rchar);
-			      rest++; 
-			      s++;
-			    }
-			  
-			  sfree (orest);
-			  
-			  if (cstring_isUndefined (extra))
-			    {
-			      llerror 
-				(FLG_BADFLAG,
-				 message
-				 ("Flag %s (in stylized comment) must be followed by an argument",
-				  flagcode_unparse (fflag)));
-			    }
-			  else
-			    {
-			      s--;
-			      
-			      if (flagcode_hasValue (fflag))
-				{
-				  setValueFlag (fflag, extra);
-				}
-			      else if (flagcode_hasString (fflag))
-				{
-				  setStringFlag (fflag, extra);
-				}
-			      else
-				{
-				  BADEXIT;
-				}
-			    }
-			}
-		    }
-		}
-	    }
-	  else
-	    {
-	      ;
-	    }
-
-	  *s = c;
-	  while ((c == ' ') || (c == '\t') || (c == '\n'))
-	    {
-	      c = *(++s);
-	    }
-	} 
-
-      if (context_inHeader () && !isArtificial (cstring_fromChars (os)))
-	{
-	  	  context_addComment (cstring_fromCharsNew (os));
-	}
-      else
-	{
-	  ;
-	}
-    }
-  else
-    {
-      char *t = s;
-      int macrocode;
-      char tchar = '\0';
-
-      while (*s != '\0' && *s != ' ' && *s != '\t' && *s != '\n') 
-	{
-	  s++;
-	}
-
-      if (*s != '\0') 
-	{
-	  tchar = *s;
-	  *s = '\0';
-	  s++;
-	}
-      
-      t = cstring_toCharsSafe (cstring_downcase (cstring_fromChars (t)));
-      macrocode = tokenMacroCode (cstring_fromChars (t));
-
-      if (macrocode != BADTOK)
-	{
-	  tokLength = mstring_length (t);
-
-	  
-	  sfree (t);
-	  sfree (os);
-
-	  if (macrocode == SKIPTOK)
-	    {
-	      return BADTOK;
-	    }
-
-	  return macrocode;
-	}
-      
-      if (context_inHeader ())
-	{
-	  if (tchar != '\0')
-	    {
-	      *(s-1) = tchar;
-	    }
-	  
-	  if ((context_inMacro () || context_inGlobalContext ())
-	      && macrocode != SKIPTOK
-	      && !isArtificial (cstring_fromChars (os))) 
-	    {
-	      context_addComment (cstring_fromCharsNew (os));
-	    }
-	  else
-	    {
-	      ; 
-	    }
-	  
-	  if (tchar != '\0')
-	    {
-	      *(s-1) = '\0';
-	    }
-	}
-
-      if (mstring_equal (t, "ignore"))
-	{
-	  if (!context_getFlag (FLG_NOCOMMENTS))
-	    {
-	      context_enterSuppressRegion ();
-	    }
-	}
-      else if ((*t == 'i' || *t == 't')
-	       && (*(t + 1) == '\0'))
-	{
-	  if (!context_getFlag (FLG_NOCOMMENTS)
-	      && (*t == 'i' || context_getFlag (FLG_TMPCOMMENTS)))
-	    {
-	      context_enterSuppressLine (-1); /* infinite suppression */
-	    }
-	}
-      else if (((*t == 'i') || (*t == 't'))
-	       && ((*(t + 1) >= '0' && *(t + 1) <= '9')))
-	{
-	  bool tmpcomment = (*t == 't');
-	  int val = -1; 
-	  char *tt = t; /* don't mangle t, since it is free'd */
-	  char lc = *(++tt);
-
-	  if (lc >= '0' && lc <= '9')
-	    {
-	      val = (int)(lc - '0');
-	      
-	      lc = *(++tt);	  
-	      while (lc >= '0' && lc <= '9')
-		{
-		  val *= 10;
-		  val += lc - '0';
-		  lc = *(++tt);
-		}
-	    }
-
-	  
-	  if (!context_getFlag (FLG_NOCOMMENTS)
-	      && (!tmpcomment || context_getFlag (FLG_TMPCOMMENTS)))
-	    {
-	      context_enterSuppressLine (val);
-	    }
-	}
-      else if (mstring_equal (t, "end"))
-	{
-	  if (!context_getFlag (FLG_NOCOMMENTS))
-	    {
-	      context_exitSuppressRegion ();
-	    }
-	}
-      else if (mstring_equal (t, "notfunction"))
-	{
-	 ; /* handled by pcpp */
-	}
-      else if (mstring_equal (t, "access"))
-	{
-	  cstring tname;
-	  
-	  while (TRUE)
-	    {
-	      while ((c = *s) && (c == ' ' || c == '\t' || c == '\n'))
-		{
-		  s++;
-		}
-	      
-	      if (c == '\0')
-		{
-                   break;
-		}
-
-	      tname = cstring_fromChars (s);
-	      
-	      while ((c = *s) != '\0' && c != ' ' 
-		     && c != '\t' && c != '\n' && c != ',') 
-		{
-		  s++;
-		}
-
-	      *s = '\0';
-
-	      
-	      if (!context_getFlag (FLG_NOCOMMENTS) 
-		  && !context_getFlag (FLG_NOACCESS))
-		{
-		  if (usymtab_existsType (tname))
-		    {
-		      usymId uid = usymtab_getTypeId (tname);
-		      context_addFileAccessType (uid);
-		    }
-		  else
-		    {
-		      if (!(context_inSuppressRegion ()
-			    || context_inSuppressZone (g_currentloc)))
-			{
-			  llmsg 
-			    (message
-			     ("%q: Unrecognized type %s used in access comment",
-			      fileloc_unparse (g_currentloc), tname));
-			}
-		    }
-		}
-	      
-	      if (c != '\0') 
-		{
-		  s++;
-		}
-	      
-	      if (c != ',' && c != ' ')
-		{
-		  break;
-		}
-	    }
-	}
-      else if (mstring_equal (t, "noaccess"))
-	{
-	  cstring tname;
-	  char lc;
-	  
-	  while (TRUE)
-	    {
-	      while ((lc = *s) && (lc == ' ' || lc == '\t' || lc == '\n')) 
-		{
-		  s++;
-		}
-	      
-	      if (lc == '\0')
-		{
-		 break;
-		}
-
-	      tname = cstring_fromChars (s);
-	      
-	      while ((lc = *s) != '\0' && lc != ' ' && lc != '\t' 
-		     && lc != '\n' && lc != ',') 
-		{
-		  s++;
-		}
-
-	      *s = '\0';
-
-	      if (!context_getFlag (FLG_NOCOMMENTS) 
-		  && !context_getFlag (FLG_NOACCESS))
-		{
-		  if (usymtab_existsType (tname))
-		    {
-		      typeId tuid = usymtab_getTypeId (tname);
-		      
-		      if (context_couldHaveAccess (tuid))
-			{
-			  context_removeFileAccessType (tuid);
-			}
-		      else
-			{
-			  if (!(context_inSuppressRegion () 
-				|| context_inSuppressZone (g_currentloc)))
-			    {
-			      uentry ue = usymtab_getTypeEntry (tuid);
-			      
-			      if (uentry_isAbstractDatatype (ue))
-				{
-				  llmsg
-				    (message
-				     ("%q: Non-accessible abstract type %s used in noaccess comment",
-				      fileloc_unparse (g_currentloc), tname));
-				}
-			      else
-				{
-				  llmsg
-				    (message
-				     ("%q: Non-abstract type %s used in noaccess comment",
-				      fileloc_unparse (g_currentloc), tname));
-				}
-			    }
-			}
-		    }
-		  else
-		    {
-		      if (!(context_inSuppressRegion () 
-			    || context_inSuppressZone (g_currentloc)))
-			{
-			  llmsg
-			    (message
-			     ("%q: Unrecognized type %s used in noaccess comment",
-			      fileloc_unparse (g_currentloc), tname));
-			}
-		    }
-		}
-	      
-	      if (lc != '\0') 
-		{
-		  s++;
-		}
-	      
-	      if (lc != ',' && lc != ' ')
-		{
-		  break;
-		}
-	    }
-	}
-      else
-	{
-	  setTokLength (- (2 + charsread));
-
-	  voptgenerror (FLG_UNRECOGCOMMENTS, 
-			message ("Stylized comment unrecognized: %s", 
-				 cstring_fromChars (os)), 
-			g_currentloc);
-	}
-
-      sfree (t);
-    }
-  
-  sfree (os); 
-  return BADTOK;
-}
-
-static /*@only@*/ cstring makeIdentifier (char *s)
-{
-  char *c = mstring_create (size_toInt (strlen (s)) + 1);
-  cstring id = cstring_fromChars (c);
-
-  while (isalnum (*s) || (*s == '_') || (*s == '$')) 
-    {
-      *c++ = *s++;
-    }
-
-  *c = '\0';
-  return (id);
-}
-
-/*@observer@*/ /*@dependent@*/ uentry coerceId (cstring cn)
-{
-  if (!(usymtab_exists (cn)))
-    {
-      fileloc loc = fileloc_createExternal ();
-      
-      /*
-      ** We need to put this in a global scope, otherwise the sRef will be deallocated.
-      */
-      
-      uentry ce = uentry_makeUnrecognized (cn, loc);
-      
-      if (!context_inIterEnd ())
-	{
-	  voptgenerror 
-	    (FLG_SYSTEMUNRECOG, 
-	     message ("Unrecognized (possibly system) identifier: %q", 
-		      uentry_getName (ce)), 
-	     g_currentloc);
-	}
-      
-      return ce;
-    }
-  
-  return (usymtab_lookup (cn));
-}
-
-/*
-** like, coerceId, but doesn't supercede for iters
-*/
-
-/*@observer@*/ uentry coerceIterId (cstring cn)
-{
-  if (!(usymtab_exists (cn)))
-    {
-      return uentry_undefined;
-    }
-  
-  return (usymtab_lookup (cn));
-}
-
-/*@observer@*/ cstring LastIdentifier ()
-{
-  return (lastidprocessed);
-}
-
-static int processIdentifier (cstring id)
-{
-  uentry le;
-
-  DPRINTF (("Process identifier: %s", id));
-
-  context_clearJustPopped ();
-  lastidprocessed = id; 
-
-  if (context_inFunctionDecl ())
-    {
-      int tok = commentMarkerToken (id);
-
-      if (tok != BADTOK)
-	{
-	  return tok;
-	}
-      else 
-	{
-	  tok = tokenMacroCode (id);
-
-	  if (tok != BADTOK)
-	    {
-	      return tok;
-	    }
-	}
-    }
-
-  /* Consider handling: Defined by C99 as static const char __func__[] */
-
-  if (context_getFlag (FLG_GNUEXTENSIONS))
-    {
-      int tok = BADTOK;
-      
-      if (cstring_equalLit (id, "__stdcall")
-	  || cstring_equalLit (id, "__cdecl")
-	  || cstring_equalLit (id, "__extension__"))
-	{
-	  return BADTOK;
-	}
-      else if (cstring_equalLit (id, "__volatile__"))
-	{
-	  tok = QVOLATILE;
-	}
-      else if (cstring_equalLit (id, "__signed"))
-	{
-	  tok = QSIGNED;
-	}
-      else if (cstring_equalLit (id, "__unsigned"))
-	{
-	  tok = QUNSIGNED;
-	}
-      else if (cstring_equalLit (id, "__const__"))
-	{
-	  tok = QCONST;
-	}
-      else if (cstring_equalLit (id, "__alignof__")) 
-	{
-	  tok = CALIGNOF; /* alignof is parsed like sizeof */
-	}
-      else if (cstring_equalLit (id, "__FUNCTION__")
-	       || cstring_equalLit (id, "__PRETTY_FUNCTION__")) 
-	{
-	  /* These tokens hold the name of the current function as strings */
-	  yylval.expr = exprNode_stringLiteral (id, fileloc_copy (g_currentloc));
-	  tokLength = 0;
-	  lastWasString = TRUE;
-	  tok = CCONSTANT;
-	  return tok;
-	}
-      else if (cstring_equalLit (id, "__attribute__")
-	       || cstring_equalLit (id, "__asm__")
-	       || cstring_equalLit (id, "_asm")
-	       || cstring_equalLit (id, "__asm")
-	       || cstring_equalLit (id, "__declspec"))
-	{
-	  int depth = 0;
-	  bool useparens = FALSE;
-	  bool usebraces = FALSE;
-	  bool inquote = FALSE;
-	  bool inescape = FALSE;
-	  int ic;
-
-	  while ((ic = input ()) != EOF)
-	    {
-	      		      
-	      if (inescape)
-		{
-		  inescape = FALSE;
-		}
-	      else if (ic == '\\')
-		{
-		  inescape = TRUE;
-		}
-	      else if (ic == '\"')
-		{
-		  inquote = !inquote;
-		}
-	      else if (!inquote)
-		{
-		  if (ic == '(')
-		    {
-		      if (!useparens)
-			{
-			  if (!usebraces)
-			    {
-			      useparens = TRUE;
-			    }
-			}
-
-		      if (useparens)
-			{
-			  depth++;
-			}
-		    }
-		  else if (ic == '{')
-		    {
-		      if (!usebraces)
-			{
-			  if (!useparens)
-			    {
-			      usebraces = TRUE;
-			    }
-			}
-
-		      if (usebraces)
-			{
-			  depth++;
-			}
-		    }
-		  else if (ic == ')' && useparens)
-		    {
-		      depth--;
-		      if (depth == 0) break;
-		    }
-		  else if (ic == '}' && usebraces)
-		    {
-		      depth--;
-		      if (depth == 0) break;
-		    }
-		  else if (ic == '}' 
-			   && !usebraces && !useparens
-			   && cstring_equalLit (id, "__asm"))
-		    {
-		      /*
-		      ** We need this because some MS VC++ include files
-		      ** have __asm mov ... }
-		      ** Its a kludge, but otherwise would need to parse
-		      ** the asm code!
-		      */ 
-		      return TRBRACE;
-		    }
-		}
-
-	      if (ic == '\n')
-		{
-		  context_incLineno ();
-
-		  if (cstring_equalLit (id, "__asm")
-		      && !useparens && !usebraces)
-		    {
-		      break;
-		    }
-		}
-	    }
-	  
-	  llassert ((useparens && ic == ')')
-		    || (usebraces && ic == '}')
-		    || (!useparens && !usebraces));
-
-	  return BADTOK;
-	}
-      else if (cstring_equalLit (id, "inline")
-	       || cstring_equalLit (id, "__inline")
-	       || cstring_equalLit (id, "_inline")
-	       || cstring_equalLit (id, "__inline__"))
-	{
-	  tok = QINLINE;
-	}
-      
-      if (tok != BADTOK)
-	{
-	  RETURN_TOK (tok);
-	}
-    }
-
-  le = usymtab_lookupSafe (id);
-
-  /*@-dependenttrans@*/
-  
-  if (uentry_isIter (le))
-    {
-      yylval.entry = le;
-      return (ITER_NAME);
-    }
-  else if (uentry_isEndIter (le))
-    {
-      yylval.entry = le;
-      return (ITER_ENDNAME);
-    }
-  else if (uentry_isUndefined (le))
-    {
-      yylval.cname = id;
-
-      /* avoid parse errors for certain system built ins */
-
-      if (g_expectingTypeName && (cstring_firstChar (id) == '_')
-	  && (cstring_secondChar (id) == '_'))
-	{
-	  return (TYPE_NAME_OR_ID);
-	}
-
-      return (NEW_IDENTIFIER);
-    }
-  else if (!uentry_isDeclared (le) && !uentry_isCodeDefined (le))
-    {
-      if (uentry_isDatatype (le))
-	{
-	  yylval.cname = id;
-	  return (NEW_IDENTIFIER);
-	}
-      else
-	{
-	  yylval.entry = le;	  	  
-	  return (IDENTIFIER); 
-	}
-    }
-  else if (uentry_isDatatype (le))
-    {
-      if (!g_expectingTypeName)
-	{
-	  yylval.cname = id;
-
-	  return (NEW_IDENTIFIER);
-	}
-      else
-	{
-	  yylval.ctyp = uentry_getAbstractType (le);
-	  
-	  uentry_setUsed (le, g_currentloc);
-	  return (TYPE_NAME);
-	}
-    }
-  else
-    {
-      yylval.entry = le;            
-      return (IDENTIFIER); 
-    }
-
-  /*@=dependenttrans@*/
-}
-
-static bool processHashIdentifier (/*@only@*/ cstring id)
-{
-  if (context_inMacro () || context_inIterDef () ||
-      context_inIterEnd ())
-    {
-      uentry le;
-      
-      context_clearJustPopped ();
-
-      lastidprocessed = id; 
-      le = usymtab_lookupSafe (id);
-
-      if (uentry_isParam (le) || uentry_isRefParam (le))
-	{
-	  return TRUE;
-	}
-      else
-	{
-	  return FALSE;
-	}
-    }
-  else
-    {
-      cstring_free (id);
-      return FALSE;
-    }
-}
-
-
-static /*@only@*/ exprNode processString ()
-{
-  exprNode res;
-  fileloc loc;
-  char *nl = strchr (yytext, '\n');
-  cstring ns = cstring_fromCharsNew (yytext);
-
-  if (nl == NULL)
-    {
-      loc = fileloc_copy (g_currentloc);
-      addColumn (cstring_length (ns));
-    }
-  else
-    {
-      char *lastnl = nl;
-
-      loc = fileloc_copy (g_currentloc);
-
-      context_incLineno ();
-      
-      while ((nl = strchr ((nl + 1), '\n')) != NULL)
-	{
-	  context_incLineno ();
-	  lastnl = nl;
-	}
-    }
-
-    
-  res = exprNode_stringLiteral (ns, loc);
-  return (res);
-}
-
-static 
-char processChar ()
-{
-  char fchar;
-  char next;
-
-  llassert (*yytext != '\0');
-  fchar = *(yytext + 1);
-  if (fchar != '\\') return fchar;
-  
-  next = *(yytext + 2);
-  
-  switch (next)
-    {
-    case 'n': return '\n';
-    case 't': return '\t';
-    case '\"': return '\"';
-    case '\'': return '\'';
-    case '\\': return '\\';
-    default: return '\0';
-    }
-}
-
-static
-double processFloat ()
-{
-  double ret = atof (yytext);
-
-    return (ret);
-}
-
-static
-long processHex ()
-{
-  int index = 2;
-  long val = 0;
-
-  llassert (yytext[0] == '0'
-	    && (yytext[1] == 'X' || yytext[1] == 'x'));
-
-  while (yytext[index] != '\0') {
-    int tval;
-    char c = yytext[index];
-
-    if (c >= '0' && c <= '9') {
-      tval = (int) c - (int) '0';
-    } else if (c >= 'A' && c <= 'F') {
-      tval = (int) c - (int) 'A' + 10;
-    } else if (c >= 'a' && c <= 'f') {
-      tval = (int) c - (int) 'a' + 10;
-    } else if (c == 'U' || c == 'L' || c == 'u' || c == 'l') {
-      index++;
-      while (yytext[index] != '\0') {
-	if (c == 'U' || c == 'L' || c == 'u' || c == 'l') {
-	  ;
-	} else {
-	  voptgenerror
-	    (FLG_SYNTAX, 
-	     message ("Invalid character (%c) following specifier in hex constant: %s",
-		      c, cstring_fromChars (yytext)),
-	     g_currentloc);
-	}
-	index++;
-      }
-
-      break;
-    } else {
-      voptgenerror
-	(FLG_SYNTAX, 
-	 message ("Invalid character (%c) in hex constant: %s",
-		  c, cstring_fromChars (yytext)),
-	 g_currentloc);
-      break;
-    }
-
-    val = (val * 16) + tval;
-    index++;
-  }
-
-  DPRINTF (("Hex constant: %s = %ld", yytext, val));
-  return val;
-}
-
-static
-long processOctal ()
-{
-  int index = 1;
-  long val = 0;
-
-  llassert (yytext[0] == '0' && yytext[1] != 'X' && yytext[1] != 'x');
-    
-  while (yytext[index] != '\0') {
-    int tval;
-    char c = yytext[index];
-    
-    if (c >= '0' && c <= '7') {
-      tval = (int) c - (int) '0';
-    } else {
-      voptgenerror
-	(FLG_SYNTAX, 
-	 message ("Invalid character (%c) in octal constant: %s",
-		  c, cstring_fromChars (yytext)),
-	 g_currentloc);
-      break;
-    }
-
-    val = (val * 8) + tval;
-    index++;
-  }
-
-  DPRINTF (("Octal constant: %s = %ld", yytext, val));
-  return val;
-}
-
-static
-long processDec ()
-{
-  return (atol (yytext));
-}
-
-static int
-processSpec (int tok)
-{
-  size_t length = strlen (yytext);
-
-  
-  if (inSpecPart)
-    {
-      setTokLengthT (length);
-      RETURN_TOK (tok);
-    }
-  else
-    {
-      
-      context_saveLocation ();
-      setTokLengthT (length);
-      return (processIdentifier (makeIdentifier (yytext)));
-    }
-}
diff --git a/src/lh.c b/src/lh.c
deleted file mode 100644
index bde0e58..0000000
--- a/src/lh.c
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** lh.c
-**
-**  MODULE DESCRIPTION:
-**
-**      This module contains the I/O routines for writing out the .lh file
-**	generated from the .lcl file.
-**
-**  AUTHORS:
-**
-**      Gary Feldman, Technical Languages and Environments, DECspec project
-**      Yang Meng Tan, MIT.
-**
-**  CREATION DATE:  9 April 91
-**
-**	The lh.c module controls formatting policy.
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "osd.h"
-# include "herald.h"
-# include "lh.h"
-# include "llmain.h"
-
-/*@constant static char TABCH; @*/
-# define TABCH 		'\1'
-
-/*@constant static char TABINCH; @*/
-# define TABINCH 	'\2'
-
-/*@constant static char TABOUTCH; @*/
-# define TABOUTCH	'\3'
-
-/*@constant static observer char *LHTMP_SUFFIX; @*/
-# define LHTMP_SUFFIX ".lh_tmp"
-
-/*
-  # define TAB 		        fputc (TABCH, 	LhFile.f);
-  # define TABIN		fputc (TABINCH, 	LhFile.f);
-  # define TABOUT		fputc (TABOUTCH, LhFile.f);
-*/
-
-typedef struct
-{
-  /*@dependent@*/ /*@null@*/ /*@reldef@*/ FILE *f;
-  /*@reldef@*/ char *name;
-} outFile;
-
-static bool genLh;
-static outFile LhFile;
-static bool needIncludeBool = FALSE;
-
-/*
-**
-**  FORWARD FUNCTIONS
-**
-*/
-
-/* static int colpos (int startcol, cstring line); */
-
-static cstring lhTypeSpecNode (lclTypeSpecNode p_typespec);
-static /*@only@*/ cstring lhTypeExpr (/*@null@*/ typeExpr p_x);
-static /*@only@*/ cstring lhDeclaratorNode (declaratorNode p_x);
-
-static /*@dependent@*/ /*@null@*/ FILE *out_open (char *name, char *suffix) /*@modifies fileSystem@*/
-{
-  char *fullname = (char *)
-    mstring_create (size_toInt (strlen (name) + strlen (suffix)));
-  FILE *ret;
-
-  strcpy (fullname, name);
-  strcat (fullname, suffix);
-  ret = fopen (fullname, "w+");
-  sfree (fullname);
-  return ret;
-}
-
-/*@only@*/ cstring 
-lhFunction (lclTypeSpecNode lclTypeSpec, declaratorNode declarator)
-{
-  cstring s;
-
-  if (!genLh)
-    return cstring_undefined;
-  
-  s = message ("extern %q\1%q;", lhTypeSpecNode (lclTypeSpec),
-	       lhDeclaratorNode (declarator));
-  
-  return s;
-}
-
-static /*@only@*/ cstring
-lhDeclaratorNode (declaratorNode x)
-{
-  return (lhTypeExpr (x->type));
-}
-
-static /*@only@*/ cstring lhTypeExpr (/*@null@*/ typeExpr x)
-{
-  cstring s = cstring_undefined; /* print out types in order of appearance in source */
-  paramNodeList params;
-  int i;
-
-  if (x != (typeExpr) 0)
-    {
-      cstring front = cstring_undefined;
-      cstring back  = cstring_undefined;
-
-      for (i = x->wrapped; i >= 1; i--)
-	{
-	  front = cstring_appendChar (front, '(');
-	  back  = cstring_appendChar (back, ')');
-	}
-
-      switch (x->kind)
-	{
-	case TEXPR_BASE:
-	  s = message ("%q%s", s, ltoken_getRawString (x->content.base));
-	  break;
-	case TEXPR_PTR:
-	  s = message ("%q*%q", s, lhTypeExpr (x->content.pointer));
-	  break;
-	case TEXPR_ARRAY:
-	  s = message ("%q%q[%q]", s, 
-		       lhTypeExpr (x->content.array.elementtype),
-		       termNode_unparse (x->content.array.size));
-	  break;
-	case TEXPR_FCN:
-	  s = message ("%q%q (", s, lhTypeExpr (x->content.function.returntype));
-	  params = x->content.function.args;
-
-	  if (!paramNodeList_empty (params))
-	    {
-	      s = message ("%q%q", s, 
-			   paramNodeList_unparseComments (x->content.function.args));
-	    }
-
-	  s = message ("%q)", s);
-	  break;
-	}
-      s = message ("%q%q%q", front, s, back);
-    }
-  else
-    {
-      s = cstring_makeLiteral ("?");
-    }
-
-  return s;
-}
-
-extern void
-lhForwardStruct (ltoken t)
-{
-  if (!genLh)
-    return;
-
-  lhOutLine (message ("struct %s;", ltoken_unparse (t)));
-}
-
-
-extern void
-lhForwardUnion (ltoken t)
-{
-  if (!genLh)
-    return;
-
-  lhOutLine (message ("union %s;", ltoken_unparse (t)));
-}
-
-extern /*@only@*/ cstring 
-lhType (typeNode t)
-{
-  if (!genLh)
-    return cstring_undefined;
-
-  if (t->kind == TK_EXPOSED)
-    {
-      exposedNode n = t->content.exposed;
-
-      if (n != (exposedNode) 0)
-	{
-	  if (declaratorInvNodeList_size (n->decls) == 0)
-	    {
-	      /* 
-	      ** Forward struct or union declaration
-	      */
-
-	      return (cstring_appendChar (lhTypeSpecNode (n->type), ';'));
-	    }
-	  else
-	    {
-	      cstring s = cstring_undefined;
-
-	      declaratorInvNodeList_elements (n->decls, d)
-		{
-		  cstring name = declaratorNode_unparse (d->declarator);
-		  cstring pname = declaratorNode_unparseCode (d->declarator); 
-		  
-		  s = message ("%q\n# ifndef EXPOSED_TYPE_%q\ntypedef %q %q;\n# endif\n", 
-			       s, pname, lhTypeSpecNode (n->type), name);
-		} end_declaratorInvNodeList_elements;
-	      
-	      return s;
-	    }
-	}
-    }
-
-  return cstring_undefined;
-}
-
-static /*@only@*/ cstring 
-lhTypeSpecNode (lclTypeSpecNode typespec)
-{
-  if (!genLh)
-    {
-      return cstring_undefined;
-    }
-
-  return (lclTypeSpecNode_unparseComments (typespec));
-}
-
-/*@only@*/ cstring
-lhVarDecl (lclTypeSpecNode lclTypeSpec, initDeclNodeList initDecls,
-	   qualifierKind qualifier)
-{
-  bool first = TRUE;
-  cstring s;
-
-  if (!genLh)
-    return cstring_undefined;
-
-  s = cstring_makeLiteral ("extern");
-
-  switch (qualifier)
-    {
-    case QLF_NONE:
-      break;
-    case QLF_CONST:
-      s = message ("%q const", s);
-      break;
-    case QLF_VOLATILE:
-      s = message ("%q volatile", s);
-      break;
-    default:			/* ignore it */
-      break;
-    }
-  
-  s = message ("%q %q\1", s, lhTypeSpecNode (lclTypeSpec));
-
-  initDeclNodeList_elements (initDecls, i)
-  {
-    if (first)
-      {
-	s = message ("%q %q", s, declaratorNode_unparse (i->declarator));
-	first = FALSE;
-      }
-    else
-      {
-	s = message ("%q, %q", s, declaratorNode_unparse (i->declarator));
-      }
-  } end_initDeclNodeList_elements;
-  
-  return (message ("%q;", s));
-}
-
-extern void
-lhCleanup (void)
-   /*@modifies fileSystem@*/
-{
-  if (!genLh)
-    {
-      return;
-    }
-  else
-    {
-      FILE *f;
-      int c, col = 0, tabcol = 0;
-      char *fullname;
-
-      
-      fullname = mstring_create 
-	(size_toInt (strlen (LhFile.name) + strlen (LHTMP_SUFFIX)));
-
-      f = out_open (LhFile.name, LH_SUFFIX);
-      llassert (LhFile.f != NULL);
-
-      strcpy (fullname, LhFile.name);
-      strcat (fullname, LHTMP_SUFFIX);
-
-      if (f == NULL)
-	{
-	  lldiagmsg (message ("Cannot open lh file for output: %s", 
-			      cstring_fromChars (fullname)));
-	}
-      else
-	{
-	  fprintf (f, "/* Output from %s */\n", LCL_PARSE_VERSION);
-
-	  rewind (LhFile.f);
-
-	  while (EOF != (c = getc (LhFile.f)))
-	    {
-	      switch (c)
-		{
-		case TABCH:
-		  if (col == 0)
-		    {
-		      if (tabcol > 0)
-			fprintf (f, "%*s", tabcol, "");
-		    }
-		  else
-		    {
-		      check (fputc (' ', f) == (int) ' ');
-		    }
-		  /*@switchbreak@*/ break;
-		  
-		case TABINCH:
-		  tabcol += 4;
-		  /*@switchbreak@*/ break;
-		  
-		case TABOUTCH:
-		  tabcol -= 4;
-		  /*@switchbreak@*/ break;
-		  
-		case '\n':
-		  col = 0;
-		  check (fputc (c, f) == (int) c);
-		  /*@switchbreak@*/ break;
-		  
-		default:
-		  col++;
-		  check (fputc (c, f) == (int) c);
-		  /*@switchbreak@*/ break;
-		}
-	    }
-
-	  check (fclose (f) == 0);
-	  check (fclose (LhFile.f) == 0);
-
-	  (void) osd_unlink (fullname);
-	  LhFile.f = NULL;
-	}
-      
-      sfree (fullname);
-    }
-}
-
-/* Write an #include of bool.h if we have't done so already.  */
-extern void
-lhIncludeBool (void)
-{
-  needIncludeBool = TRUE;
-}
-
-/*
-**++
-**  FUNCTIONAL DESCRIPTION:
-**
-**      Initialize the .lh file processing.
-**
-**  FORMAL PARAMETERS:
-**
-**      source * f: The source file, from which we compute the name of
-**	the .lh file.
-**
-**	bool outputLh: If true, produce a .lh file, otherwise don't.
-**
-**  RETURN VALUE:
-**
-**      None
-**
-**  SIDE EFFECTS:
-**
-**      The .lh file may be opened.
-**
-**
-**--
-*/
-
-void lhInit (tsource * f) /*@globals undef LhFile; @*/
-{
-  static bool lherror = FALSE;
-  
-  genLh = context_msgLh ();
-  needIncludeBool = FALSE;
-
-  if (!genLh)
-    {
-      return;
-    }
-  
-  LhFile.name = LSLRootName (tsource_fileName (f));
-  LhFile.f = out_open (LhFile.name, LHTMP_SUFFIX);
-
-  if (LhFile.f == NULL)
-    {
-      genLh = FALSE;
-      if (!lherror)
-	{
-	  lclplainerror (message ("Cannot write .lh file: %s.lh", 
-				  cstring_fromChars (LhFile.name)));
-	  lherror = TRUE;
-	}
-    } 
-} 
-
-void lhOutLine (/*@only@*/ cstring s)
-{
-  if (genLh)
-    {
-      llassert (LhFile.f != NULL);
-
-      if (cstring_length (s) > 0) 
-	{
-	  check (fputs (cstring_toCharsSafe (s), LhFile.f) != EOF); 
-	}
-
-      check (fputc ('\n', LhFile.f) == (int) '\n'); 
-    }
-
-  cstring_free (s);
-}
-
-void lhExternals (interfaceNodeList x)
-{
-  if (genLh)
-    {
-      llassert (LhFile.f != NULL);
-
-      /*
-      ** Need to make sure all standard library includes come first.
-      */
-
-      interfaceNodeList_elements (x, el)
-	{
-	  if (el->kind == INF_IMPORTS)
-	    {
-	      importNodeList imps = el->content.imports;
-
-	      importNodeList_elements (imps, il)
-		{
-		  if (il->kind == IMPBRACKET)
-		    {
-		      lhOutLine (message ("# include <%s.h>", 
-					  ltoken_getRawString (il->val)));
-		    }
-		} end_importNodeList_elements ;
-	    }
-	} end_interfaceNodeList_elements;
-
-      lhOutLine (cstring_makeLiteral ("# include \"bool.h\""));
-      
-      interfaceNodeList_elements (x, el)
-	{
-	  if (el->kind == INF_IMPORTS)
-	    {
-	      importNodeList imps = el->content.imports;
-
-	      importNodeList_elements (imps, il)
-		{
-		  if (il->kind != IMPBRACKET)
-		    {
-		      lhOutLine (message ("# include \"%s.h\"", 
-					  ltoken_getRawString (il->val)));
-		    }
-		} end_importNodeList_elements ;
-	    }
-	} end_interfaceNodeList_elements;
-
-      lhOutLine (cstring_undefined);
-    }
-}
-
-
-
diff --git a/src/llerror.c b/src/llerror.c
deleted file mode 100644
index 6807d83..0000000
--- a/src/llerror.c
+++ /dev/null
@@ -1,1666 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** llerror.c
-**
-** error reporting procedures
-*/
-
-# include "lclintMacros.nf"
-# include 
-# include 
-# include "llbasic.h"
-# include "llmain.h"
-# include "version.h"
-
-static void printIndentMessage (FILE *p_stream, /*@only@*/ cstring p_sc, int p_indent)
-   /*@modifies *p_stream@*/ ;
-
-# ifndef NOLCL
-static int lclerrors = 0;
-# endif
-
-static int lastfileloclen = 10;
-static /*@only@*/ cstring lastmsg = cstring_undefined;
-static int mcount = 0;
-static /*@only@*/ cstring saveOneMessage = cstring_undefined;
-static /*@only@*/ fileloc lastparseerror = fileloc_undefined;
-static /*@only@*/ fileloc lastbug = fileloc_undefined;
-static bool llgenerrorreal (/*@only@*/ cstring p_s, fileloc p_fl, bool p_iserror, bool p_indent)
-                 /*@modifies g_msgstream@*/ ;
-static bool llgenerroraux (/*@only@*/ cstring p_s, fileloc p_fl, bool p_iserror, bool p_indent)
-                 /*@modifies g_msgstream@*/ ;
-static void printError (FILE *p_stream, /*@only@*/ cstring p_sc)
-   /*@globals lastfileloclen @*/
-   /*@modifies *p_stream@*/ ;
-static void printMessage (FILE *p_stream, /*@only@*/ cstring p_s)
-   /*@modifies *p_stream@*/ ;
-
-static /*@null@*/ char *
-maxcp (/*@null@*/ /*@returned@*/ char *a, /*@null@*/ /*@returned@*/ char *b)
-{
-  if (a > b) return a;
-  else return b;
-}
-
-static void
-printBugReport (void)
-{
-  fprintf (stderr, "     *** Please report bug to %s ***\n",
-	   LCLINT_MAINTAINER);
-  llflush ();
-  /* don't exit (EXIT_FAILURE); */
-}
-
-static bool s_needsPrepare = TRUE;
-
-void prepareMessage (void)
-{
-  if (context_isPreprocessing ()
-      && s_needsPrepare
-      && context_getDebug (FLG_SHOWSCAN))
-    {
-      llflush ();
-      fprintf (stderr, " >\n");
-      s_needsPrepare = FALSE;
-    }
-
-  llflush ();
-}
-
-void closeMessage (void)
-{
-  if (context_isPreprocessing ()
-      && context_getDebug (FLG_SHOWSCAN))
-    {
-      llflush ();
-      fprintf (stderr, "< more preprocessing .");
-
-      llassert (!s_needsPrepare);
-      s_needsPrepare = TRUE;
-    }
-  else
-    {
-      llflush ();
-    }
-}
-
-void
-llmsg (/*@only@*/ cstring s)
-{
-  context_setNeednl ();
-  prepareMessage ();
-  printMessage (g_msgstream, s);
-  closeMessage ();
-}
-
-void
-lldiagmsg (/*@only@*/ cstring s)
-{
-  context_setNeednl ();
-  prepareMessage ();
-  printMessage (stderr, s);
-  closeMessage ();
-}
-
-void
-llmsgplain (/*@only@*/ cstring s)
-{
-  context_setNeednl ();
-  prepareMessage ();
-  printMessage (g_msgstream, s);
-  closeMessage ();
-}
-
-void flagWarning (cstring s)
-{
-  if (context_getFlag (FLG_WARNFLAGS))
-    {
-      showHerald ();
-
-      if (fileloc_isBuiltin (g_currentloc))
-	{
-	  llmsg (message ("Warning: %s", s));
-	}
-      else
-	{
-	  llgenmsg (message ("Warning: %s", s), g_currentloc);
-	}
-    }
-}
-
-static void
-llgenhint (/*@only@*/ cstring s) /*@modifies g_msgstream@*/
-{
-  context_setNeednl ();
-  printIndentMessage (g_msgstream, s, 2);
-}
-
-void
-llhint (cstring s)
-{
-  if (context_getFlag (FLG_HINTS) &&
-      !(context_inSuppressRegion () || context_inSuppressZone (g_currentloc)))
-    {
-      llgenhint (s);
-    }
-  else
-    {
-      cstring_free (s);
-    }
-}
-
-static void
-llshowhint (flagcode f)
-{
-  if (context_getFlag (FLG_HINTS))
-    {
-      if ((flagcode_numReported (f) == 0) || context_getFlag (FLG_FORCEHINTS))
-	{
-	  cstring desc = flagcodeHint (f);
-
-	  if (cstring_isDefined (desc))
-	    {
-	      llgenhint (cstring_copy (desc));
-	    }
-	}
-    }
-}
-
-
-static void
-llsuppresshint (char c, flagcode f)
-{
-
-  if (context_getFlag (FLG_HINTS))
-    {
-      if ((flagcode_numReported (f) == 0) || context_getFlag (FLG_FORCEHINTS))
-	{
-	  cstring desc = flagcodeHint (f);
-	  context_setNeednl ();
-	  lastfileloclen = 8;
-
-	  if (flagcode_isNamePrefixFlag (f))
-	    {
-	      f = FLG_NAMECHECKS;
-	    }
-
-	  if (cstring_isDefined (desc))
-	    {
-	      llgenhint (message ("%s (%h%s will suppress message)", desc, c,
-				  flagcode_name (f)));
-	    }
-	  else
-	    {
-	      llgenhint (message ("(%h%s will suppress message)", c,
-				  flagcode_name (f)));
-	    }
-	}
-    }
-}
-
-static void
-llnosuppresshint (flagcode f)
-{
-
-  if (context_getFlag (FLG_FORCEHINTS))
-    {
-      cstring desc = flagcodeHint (f);
-      context_setNeednl ();
-      lastfileloclen = 8;
-
-      if (cstring_isDefined (desc))
-	{
-	  printError (g_msgstream, message ("    %s", desc));
-	}
-    }
-}
-
-/*@constant int MAXSEARCH; @*/
-# define MAXSEARCH 20
-
-/*@constant int MINLINE; @*/
-# define MINLINE 35
-
-typedef /*@null@*/ /*@dependent@*/ char *nd_charp;
-
-static void
-mstring_split (/*@returned@*/ char **sp,
-	       /*@out@*/ nd_charp *tp,
-	       int maxline, /*@in@*/ int *indentchars)
-{
-  char *nl;
-  char *t;
-  char *s = *sp;
-
-  *tp = NULL;
-
-  if (maxline < MINLINELEN)
-    {
-      maxline = MINLINELEN;
-    }
-
-  if (*indentchars > 0)
-    {
-      s = *sp = mstring_concatFree1 (mstring_spaces (*indentchars), s);
-    }
-
-  nl = strchr (s, '\n');
-
-  /*
-  ** splitting:
-  **
-  **    if there is a newline in first maxline characters, split there
-  **    if line len is <= maxline, return no split
-  **    if there is a ':' or ';' followed by ' ' in first maxline characters,
-  **       split there unless the ' ' is followed by a '}', then
-  **       split after '}'
-  **       of the ';' is inside quotation marks
-  **    if there is a space or tab in last maxsearch characters, split there
-  **    else, split at maxline
-  **
-  **    special code: slash [1-9] after a newline means indent the rest  chars
-  **
-  */
-
-  if ((nl != NULL) && ((nl - s) < maxline))
-    {
-      *nl = '\0';
-      t = nl + 1;
-
-      if (*t == '\0')
-	{
-	  return;
-	}
-
-      if (*t >= '\1' && *t <= '\7')
-	{
-	  *indentchars += (int) (*t - '\1') + 1;
-	  t++;
-	  	}
-
-      *tp = t;
-      return;
-    }
-  else if (size_toInt (strlen (s)) < maxline)
-    {
-      return;
-    }
-  else
-    {
-      int i = 0;
-      char savechar;
-      char *lcolon, *lsemi, *splitat;
-
-      splitat = NULL;
-
-      t = s + maxline - 1;
-      savechar = *t;
-
-      *t = '\0';
-      lcolon = strrchr (s, ':');
-      lsemi = strrchr (s, ';');
-      *t = savechar;
-
-      splitat = maxcp (lcolon, lsemi);
-
-      if (splitat != NULL && ((int)(splitat - s) > MINLINE)
-	  && *(splitat + 1) == ' ' && *(splitat + 2) != '}')
-	{
-	  *(splitat + 1) = '\0';
-	  t = splitat + 2;
-	  *tp = t;
-	  return;
-	}
-
-      while (*t != ' ' && *t != '\t' && i < MAXSEARCH)
-	{
-	  t--;
-	  i++;
-	}
-
-      if (*t != ' ' && *t != '\t')
-	{
-	  t = mstring_copy (s + maxline);
-	  *(s + maxline) = '\0';
-
-	  if (*t == '\0')
-	    {
-	      sfree (t);
-	      return;
-	    }
-
-	  mstring_markFree (t);
-	  *tp = t;
-	  return;
-	}
-      else
-	{
-	  *t = '\0';
-	  t++;
-
-	  if (*t == '\0') return;
-
-	  /*
-	  ** returns unqualified as only
-	  */
-
-	  *tp = t;
-	  return;
-	}
-    }
-}
-
-static
-void limitmessage (/*@only@*/ cstring s, fileloc loc)
-{
-  if (mcount > context_getLimit () + 1)
-    {
-      cstring_free (s);
-    }
-  else
-    {
-      cstring flstring = fileloc_unparse (loc);
-
-      lastfileloclen = cstring_length (flstring);
-      cstring_free (saveOneMessage);
-      saveOneMessage = message ("%q: %q", flstring, s);
-    }
-}
-
-static int parseerrorcount = 0;
-
-void cleanupMessages ()
-{
-  parseerrorcount = 0;
-
-  if (context_unlimitedMessages ())
-    {
-     ;
-    }
-  else
-    {
-      int unprinted = mcount - context_getLimit ();
-
-      if (unprinted > 0)
-	{
-	  if (unprinted == 1 && cstring_isDefined (saveOneMessage))
-	    {
-	      prepareMessage ();
-	      printError (g_msgstream, saveOneMessage);
-	      closeMessage ();
-	      saveOneMessage = cstring_undefined;
-	    }
-	  else
-	    {
-	      if (cstring_isDefined (saveOneMessage))
-		{
-		  /* cstring_free (saveOneMessage); */
-		  saveOneMessage = cstring_undefined;
-		}
-
-	      fprintf (g_msgstream, "%s: (%d more similar errors unprinted)\n",
-		       cstring_toCharsSafe (fileloc_filename (g_currentloc)),
-		       mcount - context_getLimit ());
-	    }
-	}
-    }
-
-  mcount = 0;
-}
-
-void
-llgenmsg (/*@only@*/ cstring s, fileloc fl)
-{
-  cstring flstring = fileloc_unparse (fl);
-  lastfileloclen = cstring_length (flstring);
-
-  prepareMessage ();
-  (void) printError (g_msgstream, message ("%q: %q", flstring, s));
-  closeMessage ();
-}
-
-void
-llgenindentmsg (/*@only@*/ cstring s, fileloc fl)
-{
-  cstring flstring = fileloc_unparse (fl);
-
-  prepareMessage ();
-  (void) printIndentMessage (g_msgstream, message ("%q: %q", flstring, s), 3);
-  closeMessage ();
-}
-
-void
-llgenindentmsgnoloc (/*@only@*/ cstring s)
-{
-  prepareMessage ();
-  (void) printIndentMessage (g_msgstream, s, 3);
-  closeMessage ();
-}
-
-static bool
-  llgentypeerroraux (flagcode ocode, ctype t1, exprNode e1, ctype t2, exprNode e2,
-		     /*@only@*/ cstring s, fileloc fl)
-{
-  cstring hint = cstring_undefined;
-  flagcode code = ocode;
-  flagcode hcode = INVALID_FLAG;
-  ctype ut1 = t1;
-  ctype ut2 = t2;
-
-  DPRINTF (("Type error: %s / %s : %s / %s",
-	    exprNode_unparse (e1), exprNode_unparse (e2),
-	    ctype_unparse (t1), ctype_unparse (t2)));
-  
-  DPRINTF (("Bool: %s / %s",
-	    bool_unparse (ctype_isBool (t1)),
-	    bool_unparse (ctype_isBool (t2))));
-
-  /* 
-  ** Set the flag using the underlying types that didn't match.
-  */
-
-  while (ctype_isPointer (ut1) && ctype_isPointer (ut2)) {
-    ut1 = ctype_baseArrayPtr (ut1);
-    ut2 = ctype_baseArrayPtr (ut2);
-  }
-
-  if ((ctype_isFloat (ut1) && ctype_isDouble (ut2))
-      || (ctype_isFloat (ut1) && ctype_isDouble (ut2)))
-    {
-      hcode = FLG_FLOATDOUBLE;
-    }
-  else if ((exprNode_isCharLit (e1) && ctype_isInt (ut2))
-	   || (exprNode_isCharLit (e2) && ctype_isInt (ut1)))
-    {
-      hcode = FLG_CHARINTLITERAL;
-    }
-  else if ((exprNode_isNumLit (e1) && ctype_isReal (ut2))
-	   || (exprNode_isNumLit (e2) && ctype_isReal (ut1)))
-    {
-      hcode = FLG_NUMLITERAL;
-    }
-  else if ((ctype_isManifestBool (ut1) && ctype_isInt (ut2))
-	   || (ctype_isInt (ut1) && ctype_isManifestBool (ut2)))
-    /* evs 2000-07-24: was ctype_isDirectBool */
-    {
-      hcode = FLG_BOOLINT;
-    }
-  else if (((ctype_isChar (ut1) && !ctype_isInt (ut1)) && ctype_isInt (ut2))
-	   || ((ctype_isInt (ut1) && (ctype_isChar (ut2) && !ctype_isInt (ut2)))))
-    {
-      hcode = FLG_CHARINT;
-    }
-  else if ((ctype_isInt (ut1) && ctype_isInt (ut2))
-	   || (ctype_isChar (ut1) && ctype_isChar (ut2))
-	   || (ctype_isDouble (ut1) && ctype_isDouble (ut2)))
-    {
-      if (!bool_equal (ctype_isSigned (ut1), ctype_isSigned (ut2)))
-	{
-	  hcode = FLG_IGNORESIGNS;
-	}
-      else
-	{
-	  hcode = FLG_IGNOREQUALS;
-	}
-    }
-  else if (ctype_isArbitraryIntegral (ctype_realType (ut1)))
-    {
-      if (ctype_isArbitraryIntegral (ctype_realType (ut2)))
-	{
-	  hcode = FLG_MATCHANYINTEGRAL;
-	}
-      else if (ctype_match (ut2, ctype_ulint))
-	{
-	  hcode = FLG_LONGUNSIGNEDINTEGRAL;
-	}
-      else if (ctype_match (ut2, ctype_lint))
-	{
-	  hcode = FLG_LONGINTEGRAL;
-	}
-      else if (ctype_isInt (ut2))
-	{
-	  hcode = FLG_MATCHANYINTEGRAL;
-	}
-      else
-	{
-	  ;
-	}
-    }
-  else if (ctype_isArbitraryIntegral (ctype_realType (ut2)))
-    {
-      ctype tr = ctype_realType (ut1);
-
-      if (ctype_isArbitraryIntegral (tr))
-	{
-	  hcode = FLG_MATCHANYINTEGRAL;
-	}
-      else if (ctype_match (ut1, ctype_ulint))
-	{
-	  if (ctype_isUnsignedIntegral (tr))
-	    {
-	      hcode = FLG_LONGUNSIGNEDUNSIGNEDINTEGRAL;
-	    }
-	  else if (ctype_isSignedIntegral (tr))
-	    {
-	      ;
-	    }
-	  else
-	    {
-	      hcode = FLG_LONGUNSIGNEDINTEGRAL;
-	    }
-	}
-      else if (ctype_match (ut1, ctype_lint))
-	{
-	  if (ctype_isSignedIntegral (tr))
-	    {
-	      hcode = FLG_LONGSIGNEDINTEGRAL;
-	    }
-	  else if (ctype_isSignedIntegral (tr))
-	    {
-	      ;
-	    }
-	  else
-	    {
-	      hcode = FLG_LONGINTEGRAL;
-	    }
-	}
-      else if (ctype_isInt (ut1))
-	{
-	  hcode = FLG_MATCHANYINTEGRAL;
-	}
-      else
-	{
-	  ;
-	}
-    }
-  else if (ctype_isAbstract (ut1) && !ctype_isAbstract (ut2))
-    {
-      uentry ue1 = usymtab_getTypeEntry (ctype_typeId (ut1));
-      ctype ct = uentry_getType (ue1);
-
-      if (ctype_match (ct, ut2))
-	{
-	  code = FLG_ABSTRACT;
-	  hint = message ("Underlying types match, but %s is an "
-			  "abstract type that is not accessible here.",
-			  ctype_unparse (t1));
-	}
-    }
-  else if (ctype_isAbstract (ut2) && !ctype_isAbstract (ut1))
-    {
-      uentry ue = usymtab_getTypeEntry (ctype_typeId (ut2));
-      ctype ct = uentry_getType (ue);
-
-      if (ctype_match (ct, ut1))
-	{
-	  code = FLG_ABSTRACT;
-	  hint = message ("Underlying types match, but %s is an "
-			  "abstract type that is not accessible here.",
-			  ctype_unparse (t2));
-	}
-    }
-  else if ((ctype_isEnum (ut1) && ctype_isArbitraryIntegral (ut2))
-	   || (ctype_isEnum (ut2) && ctype_isArbitraryIntegral (ut1))) 
-    {
-      code = FLG_ENUMINT;
-    }
-  else if ((ctype_isEnum (ut1) && ctype_isArbitraryIntegral (ut2))
-	   || (ctype_isEnum (ut2) && ctype_isArbitraryIntegral (ut1))) 
-    {
-      code = FLG_ENUMINT;
-    }
-  else if ((ctype_isSignedChar (ut1) && ctype_isUnsignedChar (ut2))
-	   || (ctype_isUnsignedChar (ut1) && ctype_isSignedChar (ut2)))
-    {
-      code = FLG_CHARUNSIGNEDCHAR;
-    }
-  else if (ctype_isNumeric (ut1) && ctype_isNumeric (ut2)) 
-    {
-      code = FLG_RELAXTYPES;
-    }
-  else
-    {
-      DPRINTF (("No special type rule: %s / %s", ctype_unparse (ut1),
-		ctype_unparse (ut2)));
-    }
-
-  if (cstring_isDefined (hint))
-    {
-      if (!context_suppressFlagMsg (ocode, fl))
-	{
-	  return llgenhinterror (code, s, hint, fl);
-	}
-      else
-	{
-	  cstring_free (s);
-	  cstring_free (hint);
-	  return FALSE;
-	}
-    }
-  else
-    {
-      if (llgenerroraux (s, fl, TRUE, FALSE))
-	{
-	  if (hcode != INVALID_FLAG && hcode != ocode)
-	    {
-	      code = hcode;
-	      llshowhint (code);
-
-	    }
-	  else
-	    {
-	      llsuppresshint ('-', code);
-	    }
-
-	  flagcode_recordError (code);
-	  return TRUE;
-	}
-
-      return FALSE;
-    }
-}
-
-bool
-llgentypeerror (ctype t1, exprNode e1, ctype t2, exprNode e2,
-		/*@only@*/ cstring s, fileloc fl)
-{
-  return llgentypeerroraux (FLG_TYPE, t1, e1, t2, e2, s, fl);
-}
-
-bool
-llgenformattypeerror (ctype t1, exprNode e1, ctype t2, exprNode e2,
-		      /*@only@*/ cstring s, fileloc fl)
-{
-  return llgentypeerroraux (FLG_FORMATTYPE, t1, e1, t2, e2, s, fl);
-}
-
-bool
-llgenerror (flagcode o, /*@only@*/ cstring s, fileloc fl)
-{
-  if (llgenerroraux (s, fl, TRUE, FALSE))
-    {
-      llnosuppresshint (o);
-      flagcode_recordError (o);
-      closeMessage ();
-      return TRUE;
-    }
-  else
-    {
-      flagcode_recordSuppressed (o);
-      return FALSE;
-    }
-}
-
-bool
-llgenhinterror (flagcode o, /*@only@*/ cstring s, /*@only@*/ cstring hint,
-		fileloc fl)
-{
-  if (!context_suppressFlagMsg (o, fl))
-    {
-      if (llgenerroraux (s, fl, TRUE, FALSE))
-	{
-	  flagcode_recordError (o);
-
-	  if (context_getFlag (FLG_HINTS))
-	    {
-	      llgenhint (hint);
-	    }
-	  else
-	    {
-	      cstring_free (hint);
-	    }
-
-	  closeMessage ();
-	  return TRUE;
-	}
-
-      cstring_free (hint);
-    }
-  else
-    {
-      cstring_free (hint);
-      cstring_free (s);
-    }
-
-  flagcode_recordSuppressed (o);
-  return FALSE;
-}
-
-static bool
-llrealerror (/*@only@*/ cstring s, fileloc fl)
-{
-  return (llgenerrorreal (s, fl, TRUE, FALSE));
-}
-
-static bool
-llgenerroraux (/*@only@*/ cstring s, fileloc fl, bool iserror, bool indent)
-{
-
-  if (context_inSuppressZone (fl))
-    {
-      cstring_free (s);
-      return FALSE;
-    }
-  else
-    {
-      ;
-    }
-
-  return (llgenerrorreal (s, fl, iserror, indent));
-}
-
-void
-llforceerror (flagcode code, /*@only@*/ cstring s, fileloc fl)
-{
-  flagcode_recordError (code);
-  (void) llgenerrorreal (s, fl, TRUE, FALSE);
-  closeMessage ();
-}
-
-static bool
-llgenerrorreal (/*@only@*/ cstring s, fileloc fl, bool iserror, bool indent)
-{
-  cstring flstring;
-
-  /* duplicate message (rescanning a header file */
-
-  if (!messageLog_add (context_messageLog (), fl, s))
-    {
-      cstring_free (s);
-      return FALSE;
-    }
-
-  if (iserror) context_hasError ();
-
-  if (context_unlimitedMessages ())
-    {
-      ;
-    }
-  else
-    {
-      /*
-      ** suppress excessive messages:
-      **    check up to ':'
-      **
-      */
-
-      char *sc = cstring_toCharsSafe (s);
-      char *tmpmsg = strchr (sc, ':');
-
-      if (tmpmsg == NULL)
-	{
-	  tmpmsg = sc;
-	}
-      else
-	{
-	  char *savechar = tmpmsg;
-	  *tmpmsg = '\0';
-	  tmpmsg = sc;
-	  *savechar = ':';
-	}
-
-      if (cstring_equal (lastmsg, cstring_fromChars (tmpmsg)))
-	{
-	  mcount++;
-	  if (mcount == (context_getLimit () + 1))
-	    {
-	      limitmessage (s, fl);
-	      return FALSE;
-	    }
-
-	  if (mcount > (context_getLimit ()))
-	    {
-	      cstring_free (s);
-	      return FALSE;
-	    }
-	}
-      else
-	{
-	  cleanupMessages ();
-	  mcount = 0;
-	  cstring_free (lastmsg);
-	  lastmsg = cstring_fromCharsNew (tmpmsg);
-	}
-    }
-
-  if (context_hasAliasAnnote ())
-    {
-      char *sc = cstring_toCharsSafe (s);
-      char *fcolon = strchr (sc, ':');
-      cstring a = context_getAliasAnnote ();
-
-
-      if (fcolon == NULL)
-	{
-	  s = message ("%q (%q)", s, a);
-	}
-      else
-	{
-	  cstring afterColon;
-
-	  *fcolon = '\0';
-	  afterColon = cstring_fromCharsNew (fcolon + 1);
-
-	  s = message ("%q (%q):%q", s, a, afterColon);
-	}
-          }
-
-  if (context_hasMessageAnnote ())
-    {
-      char *fcolon = strchr (cstring_toCharsSafe (s), ':');
-
-
-      if (fcolon == NULL)
-	{
-	  /*@-dependenttrans@*/ /* s becomes dependent for fcolon */
-	  s = message ("%q (%q)", s, context_getMessageAnnote ());
-	  /*@=dependenttrans@*/
-	}
-      else
-	{
-	  cstring afterColon;
-
-	  *fcolon = '\0';
-	  afterColon = cstring_fromCharsNew (fcolon + 1);
-
-	  /*@-dependenttrans@*/ /* s becomes dependent for fcolon */
-	  s = message ("%q (%q):%q", s,
-		       context_getMessageAnnote (), afterColon);
-	  /*@=dependenttrans@*/
-	}
-     }
-
-  context_setNeednl ();
-  prepareMessage ();
-
-  if (context_showFunction ())
-    {
-      cstring fname = fileloc_unparseFilename (g_currentloc);
-
-      if (context_inIterDef ())
-	{
-	  fprintf (g_msgstream, "%s: (in iter %s)\n",
-		   cstring_toCharsSafe (fname),
-		   cstring_toCharsSafe (context_inFunctionName ()));
-	}
-      else if (context_inIterEnd ())
-	{
-	  fprintf (g_msgstream, "%s: (in iter finalizer %s)\n",
-		   cstring_toCharsSafe (fname),
-		   cstring_toCharsSafe (context_inFunctionName ()));
-	}
-      else if (context_inMacro ())
-	{
-	  fprintf (g_msgstream, "%s: (in macro %s)\n", cstring_toCharsSafe (fname),
-		   cstring_toCharsSafe (context_inFunctionName ()));
-	}
-      else
-	{
-	  fprintf (g_msgstream, "%s: (in function %s)\n",
-		   cstring_toCharsSafe (fname),
-		   cstring_toCharsSafe (context_inFunctionName ()));
-	}
-
-      cstring_free (fname);
-      context_setShownFunction ();
-    }
-
-  flstring = fileloc_unparse (fl);
-
-  lastfileloclen = cstring_length (flstring);
-
-  if (indent)
-    {
-      printError (g_msgstream, message ("   %q: %q", flstring, s));
-    }
-  else
-    {
-      printError (g_msgstream, message ("%q: %q", flstring, s));
-    }
-
-  return TRUE;
-}
-
-/*
-** printMessage
-**
-** message contains no '\n'
-**    message fits in one line: print it
-**    message fits in two lines with 3-space indent after fileloc: print it
-**    split line with 5-space indent from left margin: print it
-**
-*/
-
-static
-void printMessage (FILE *stream, /*@only@*/ cstring s)
-{
-  printIndentMessage (stream, s, 0);
-}
-
-static
-void printIndentMessage (FILE *stream, /*@only@*/ cstring sc, int indent)
-{
-  int maxlen = context_getLineLen ();
-  char *s = cstring_toCharsSafe (sc);
-
-
-  do
-    {
-      char *t = NULL;
-      char *st = s;
-
-      mstring_split (&st, &t, maxlen, &indent);
-      fprintf (stream, "%s\n", st);
-      llassert (t != s);
-      s = t;
-    } while (s != NULL) ;
-
-  cstring_free (sc);
-}
-
-static
-void printError (FILE *stream, /*@only@*/ cstring sc)
-{
-  int maxlen = context_getLineLen ();
-  int nspaces = lastfileloclen + 5;
-  int nextlen = maxlen - nspaces;
-  int len = cstring_length (sc);
-  int indent = 0;
-  char *s = cstring_toCharsSafe (sc);
-  char *os = s;
-  char *t = NULL;
-
-  if (len < (maxlen + nextlen) && (strchr (s, '\n') == NULL))
-    {
-      mstring_split (&s, &t, maxlen, &indent);
-
-      fprintf (stream, "%s\n", s);
-
-      if (t != NULL)
-	{
-	  len = mstring_length (t);
-
-	  if (len < (maxlen - 3) && (strchr (t, '\n') == NULL)
-	      && len > (nextlen - 1))
-	    {
-	      fprintf (stream, "    %s\n", t);
-	    }
-	  else
-	    {
-	      char *spaces = (char *) dmalloc ((nspaces + 1) * sizeof (*spaces));
-	      int i;
-
-	      for (i = 0; i < nspaces; i++)
-		{
-		  spaces[i] = ' ';
-		}
-
-	      spaces[nspaces] = '\0';
-
-	      while (t != NULL)
-		{
-		  char *st = t;
-		  mstring_split (&st, &t, nextlen, &indent);
-		  fprintf (stream, "%s%s\n", spaces, st);
-		}
-
-	      sfree (spaces);
-	    }
-	}
-    }
-  else
-    {
-      if (len < (maxlen + maxlen - 1) && (strchr (s, '\n') != NULL))
-	{
-	  nspaces = ((maxlen + maxlen - 1) - len) / 2;
-
-	  if (nspaces < 1) nspaces = 1;
-
-	  nextlen = maxlen - nspaces;
-
-	  mstring_split (&s, &t, maxlen, &indent);
-
-	  fprintf (stream, "%s\n", s);
-
-	  if (t != NULL)
-	    {
-	      char *spaces = (char *) dmalloc ((nspaces + 1) * sizeof (*spaces));
-	      int i;
-
-	      for (i = 0; i < nspaces; i++)
-		{
-		  spaces[i] = ' ';
-		}
-
-	      spaces[nspaces] = '\0';
-
-	      while (t != NULL)
-		{
-		  char *st = t;
-
-		  mstring_split (&st, &t, nextlen, &indent);
-		  fprintf (stream, "%s%s\n", spaces, st);
-		}
-
-	      sfree (spaces);
-	    }
-	}
-      else
-	{
-	  nspaces = 4;
-	  nextlen = maxlen - nspaces;
-
-	  mstring_split (&s, &t, maxlen, &indent);
-
-	  fprintf (stream, "%s\n", s);
-
-	  if (t != NULL)
-	    {
-  	      char *spaces = (char *) dmalloc ((nspaces + 1) * sizeof (*spaces));
-	      int i;
-
-	      for (i = 0; i < nspaces; i++)
-		{
-		  spaces[i] = ' ';
-		}
-
-	      spaces[nspaces] = '\0';
-
-	      while (t != NULL)
-		{
-		  char *st = t;
-		  mstring_split (&st, &t, nextlen, &indent);
-		  fprintf (stream, "%s%s\n", spaces, st);
-		}
-
-	      sfree (spaces);
-	    }
-	}
-    }
-
-  sfree (os);
-}
-
-void
-llfatalbug (/*@only@*/ cstring s)
-{
-  prepareMessage ();
-  printError (stderr, message ("%q: *** Fatal bug: %q",
-			       fileloc_unparse (g_currentloc), s));
-  printCodePoint ();
-  printBugReport ();
-  llexit (LLFAILURE);
-}
-
-# ifndef NOLCL
-void
-lclfatalbug (char *msg)
-{
-  prepareMessage ();
-  printError (stderr,
-	      message ("*** Fatal Bug: %s", cstring_fromChars (msg)));
-  printCodePoint ();
-  printBugReport ();
-  llexit (LLFAILURE);
-}
-# endif
-
-void
-checkParseError (void)
-{
-  if (fileloc_withinLines (lastparseerror, g_currentloc, 10))
-    {
-      llfatalerror (message ("%q: Cannot recover from parse error.",
-			     fileloc_unparse (g_currentloc)));
-    }
-}
-
-void llbugaux (cstring file, int line, /*@only@*/ cstring s)
-{
-  /*@unchecked@*/
-  static int numbugs = 0;
-  static bool inbug = FALSE;
-
-  if (inbug)
-    {
-      cstring temps = fileloc_unparseRaw (file, line);
-
-      fprintf (stderr, "%s: Recursive bug detected: %s\n",
-	       cstring_toCharsSafe (temps),
-	       cstring_toCharsSafe (s));
-      cstring_free (temps);
-
-      llexit (LLFAILURE);
-    }
-
-  inbug = TRUE;
-
-  prepareMessage ();
-
-  if (fileloc_isRealLib (g_currentloc))
-    {
-      llfatalerror (message ("%q: Library file appears to be corrupted.  Error: %q:%s",
-			     fileloc_unparse (g_currentloc), 
-			     fileloc_unparseRaw (file, line), s));
-    }
-
-  if (fileloc_withinLines (lastparseerror, g_currentloc, 7))
-    {
-      llfatalerror (message ("%q: Cannot recover from parse error.",
-			     fileloc_unparse (g_currentloc)));
-    }
-
-  (void) fflush (g_msgstream);
-  printError (stderr, message ("%q: *** Internal Bug at %q: %q [errno: %d]",
-			       fileloc_unparse (g_currentloc),
-			       fileloc_unparseRaw (file, line),
-			       s, errno));
-  printCodePoint ();
-
-  (void) fflush (stderr);
-  perror ("Possible system error diagnostic: ");
-  (void) fflush (stderr);
-
-  printBugReport ();
-
-  numbugs++;
-
-  if (numbugs > 5 && fileloc_withinLines (lastbug, g_currentloc, 2))
-    {
-      llfatalerror (message ("%q: Cannot recover from last bug.",
-			     fileloc_unparse (g_currentloc)));
-    }
-
-  fprintf (stderr, "       (attempting to continue, results may be incorrect)\n");
-  fileloc_free (lastbug);
-  lastbug = fileloc_copy (g_currentloc);
-  closeMessage ();
-
-  (void) fflush (stderr);
-  inbug = FALSE;
-}
-
-# ifndef NOLCL
-void
-lclbug (/*@only@*/ cstring s)
-{
-  prepareMessage ();
-  printError (stderr, message ("*** Internal Bug: %q", s));
-  printCodePoint ();
-  printBugReport ();
-  fprintf (stderr, "       (attempting to continue, results may be incorrect)\n");
-  closeMessage ();
-}
-# endif
-
-void
-llfatalerror (cstring s)
-{
-  prepareMessage ();
-  printError (stderr, s);
-  printError (stderr, cstring_makeLiteral ("*** Cannot continue."));
-  llexit (LLFAILURE);
-}
-
-void
-llfatalerrorLoc (/*@only@*/ cstring s)
-{
-  prepareMessage ();
-  (void) fflush (g_msgstream);
-  printError (stderr, message ("%q: %q", fileloc_unparse (g_currentloc), s));
-  printError (stderr, cstring_makeLiteral ("*** Cannot continue."));
-  llexit (LLFAILURE);
-}
-
-/*
-** free's s!
-*/
-
-void
-llgloberror (/*@only@*/ cstring s)
-{
-  if (context_inSuppressRegion ())
-    {
-      cstring_free (s);
-    }
-  else
-    {
-      context_setNeednl ();
-      prepareMessage ();
-      context_hasError ();
-      flagcode_recordError (FLG_SPECIAL);
-      printError (g_msgstream, s);
-      closeMessage ();
-    }
-}
-
-# ifndef NOLCL
-bool
-lclHadError (void)
-{
-  return (lclerrors > 0);
-}
-
-bool
-lclHadNewError (void)
-{
-  static int lastcall = 0;
-
-  if (lclerrors > lastcall)
-    {
-      lastcall = lclerrors;
-      return TRUE;
-    }
-  else
-    {
-      return FALSE;
-    }
-}
-
-int
-lclNumberErrors (void)
-{
-  return (lclerrors);
-}
-
-void
-lclerror (ltoken t, /*@only@*/ cstring msg)
-{
-  lclerrors++;
-
-  if (ltoken_getCode (t) != NOTTOKEN)
-    {
-      cstring loc = ltoken_unparseLoc (t);
-
-      lastfileloclen = cstring_length (loc);
-
-      printError (g_msgstream, message ("%q: %q", loc, msg));
-    }
-  else
-    {
-      printError (g_msgstream, msg);
-    }
-}
-
-void
-lclplainerror (/*@only@*/ cstring msg)
-{
-  lclerrors++;
-
-  printError (g_msgstream, msg);
-}
-
-void
-lclfatalerror (ltoken t, /*@only@*/ cstring msg)
-{
-  lclerror (t, msg);
-  (void) fflush (g_msgstream);
-  printError (stderr, cstring_makeLiteral ("*** Cannot continue"));
-  llexit (LLFAILURE);
-}
-
-void
-lclplainfatalerror (/*@only@*/ cstring msg)
-{
-  (void) fflush (g_msgstream);
-  printError (stderr, message ("*** Cannot continue: %q", msg));
-  llexit (LLFAILURE);
-}
-
-void
-lclRedeclarationError (ltoken id)
-{
-  cstring s = ltoken_getRawString (id);
-
-
-  if (usymtab_existsEither (s))
-    {
-      uentry le = usymtab_lookupEither (s);
-
-      lclerror (id, message ("Respecification of %s", s));
-      llgenindentmsg (message ("Previous specification of %q",
-			       uentry_getName (le)),
-		uentry_whereSpecified (le));
-    }
-  else
-    {
-      lclerror (id, message ("Identifier redeclared: %s", s));
-    }
-}
-# endif
-
-void genppllerror (flagcode code, /*@only@*/ cstring s)
-{
-  if (context_inSuppressZone (g_currentloc))
-    {
-      cstring_free (s);
-    }
-  else
-    {
-      if (context_getFlag (code))
-	{
-	  if (context_getFlag (FLG_SHOWSCAN) && !context_isInCommandLine ())
-	    {
-	      fprintf (g_msgstream, " >\n");
-	    }
-
-	  llerror (code, s);
-
-	  if (code != FLG_PREPROC)
-	    {
-	      llsuppresshint ('-', code);
-	    }
-
-	  if (context_getFlag (FLG_SHOWSCAN) && !context_isInCommandLine ())
-	    {
-	      fprintf (stderr, "< more preprocessing .");
-	    }
-	}
-      else
-	{
-	  cstring_free (s);
-	}
-    }
-}
-
-void genppllerrorhint (flagcode code, /*@only@*/ cstring s,
-		       /*@only@*/ cstring hint)
-{
-  if (context_inSuppressZone (g_currentloc))
-    {
-      cstring_free (s);
-      cstring_free (hint);
-    }
-  else
-    {
-      if (context_getFlag (code))
-	{
-	  prepareMessage ();
-	  context_clearPreprocessing ();
-	  llerror (code, s);
-	  llgenhint (hint);
-	  context_setPreprocessing ();
-	  closeMessage ();
-	}
-      else
-	{
-	  cstring_free (s);
-	  cstring_free (hint);
-	}
-    }
-}
-
-void ppllerror (/*@only@*/ cstring s)
-{
-  genppllerror (FLG_PREPROC, s);
-}
-
-void pplldiagmsg (cstring s)
-{
-  if (context_getDebug (FLG_SHOWSCAN) && !context_isInCommandLine ())
-    {
-      fprintf (stderr, " >\n");
-      lldiagmsg (s);
-      fprintf (stderr, "< more preprocessing .");
-    }
-  else
-    {
-      lldiagmsg (s);
-    }
-}
-
-void loadllmsg (cstring s)
-{
-  if (context_getDebug (FLG_SHOWSCAN))
-    {
-      fprintf (stderr, " >\n");
-      lldiagmsg (s);
-      fprintf (stderr, "< .");
-    }
-  else
-    {
-      lldiagmsg (s);
-    }
-}
-
-static void llreportparseerror (/*@only@*/ cstring s)
-{
-  if (fileloc_withinLines (lastparseerror, g_currentloc, 5))
-    {
-      cstring_free (s);
-    }
-  else
-    {
-      llerror (FLG_SYNTAX, s);
-
-      fileloc_free (lastparseerror);
-      lastparseerror = fileloc_copy (g_currentloc);
-    }
-}
-
-bool lloptgenerror (flagcode o, /*@only@*/ cstring s, fileloc loc)
-{
-  if (llrealerror (s, loc))
-    {
-      llsuppresshint ('-', o);
-      closeMessage ();
-      flagcode_recordError (o);
-      return TRUE;
-    }
-
-  flagcode_recordSuppressed (o);
-  return FALSE;
-}
-
-bool optgenerror2 (flagcode f1, flagcode f2, /*@only@*/ cstring s, fileloc loc)
-{
-  if (context_suppressFlagMsg (f1, loc))
-    {
-      flagcode_recordSuppressed (f1);
-      cstring_free (s);
-    }
-  else
-    {
-      if (context_suppressFlagMsg (f2, loc))
-	{
-	  flagcode_recordSuppressed (f2);
-	  cstring_free (s);
-	}
-      else
-	{
-	  if (llrealerror (s, loc))
-	    {
-	      llsuppresshint ('-', f2);
-	      flagcode_recordError (f2);
-	      closeMessage ();
-	      return TRUE;
-	    }
-
-	  flagcode_recordSuppressed (f2);
-	}
-    }
-  return FALSE;
-}
-
-bool optgenerror2n (flagcode f1, flagcode f2, /*@only@*/ cstring s, fileloc loc)
-{
-
-  if (context_suppressFlagMsg (f1, loc))
-    {
-      flagcode_recordSuppressed (f1);
-      cstring_free (s);
-    }
-  else
-    {
-      if (context_suppressNotFlagMsg (f2, loc))
-	{
-	  flagcode_recordSuppressed (f2);
-	  cstring_free (s);
-	}
-      else
-	{
-	  if (llrealerror (s, loc))
-	    {
-	      llsuppresshint ('+', f2);
-	      flagcode_recordError (f2);
-	      closeMessage ();
-	      return TRUE;
-	    }
-
-	  flagcode_recordSuppressed (f2);
-	}
-    }
-  return FALSE;
-}
-
-bool llnoptgenerror (flagcode o, /*@only@*/ cstring s, fileloc loc)
-{
-  if (llrealerror (s, loc))
-    {
-      llsuppresshint ('+', o);
-      flagcode_recordError (o);
-      closeMessage ();
-      return TRUE;
-    }
-
-  flagcode_recordSuppressed (o);
-  return FALSE;
-}
-
-void llparseerror (cstring s)
-{
-  if (context_getFlag (FLG_TRYTORECOVER))
-    {
-      parseerrorcount++;
-
-      if (parseerrorcount > GIVEUPPARSE)
-	{
-	  if (cstring_isDefined (s))
-	    {
-	      llfatalerror (message ("%q: Parse Error: %q.  "
-				     "Too many errors, giving up.",
-				     fileloc_unparse (g_currentloc), s));
-	    }
-	  else
-	    {
-	      llfatalerror (message ("%q: Parse Error.  Too many errors, giving up.",
-				     fileloc_unparse (g_currentloc)));
-	    }
-	}
-      else
-	{
-	  if (cstring_isDefined (s))
-	    {
-	      llreportparseerror (message ("Parse Error: %q. Attempting to continue.",
-					   s));
-	    }
-	  else
-	    {
-	      llreportparseerror (message ("Parse Error. Attempting to continue."));
-	    }
-	}
-    }
-  else
-    {
-      cstring msg;
-
-      if (cstring_isDefined (s))
-	{
-	  msg = message ("Parse Error: %q.", s);
-	}
-      else
-	{
-	  msg = message ("Parse Error.");
-	}
-
-      llfatalerror
-	(message ("%q: %s (For help on parse errors, "
-		  "see lclint -help parseerrors.)",
-		  fileloc_unparse (g_currentloc), msg));
-    }
-}
-
-bool doCheck (bool x, cstring pred, cstring file, int line)
-{
-  if (!x) {
-    llbug (message ("%q: Check Failed: %s",
-		    fileloc_unparseRaw (file, line),
-		    pred));
-  }
-
-  return x;
-}
-
-/*@observer@*/ cstring lldecodeerror (/*@unused@*/ int errnum)
-{
-  char *result;
-
-#ifndef VMS
-#ifndef HAVE_STRERROR
-  result = NULL;
-#else
-  result = strerror (errnum);
-#endif
-#else	/* VMS */
-  /* VAXCRTL's strerror() takes an optional second argument, which only
-     matters when the first argument is EVMSERR.  However, it's simplest
-     just to pass it unconditionally.  `vaxc$errno' is declared in
-     , and maintained by the library in parallel with `errno'.
-     We assume that caller's `errnum' either matches the last setting of
-     `errno' by the library or else does not have the value `EVMSERR'.  */
-
-  result = strerror (errnum, vaxc$errno);
-#endif
-
-  if (result == NULL)
-    {
-      result = cstring_toCharsSafe (message ("undocumented I/O error: %d", errnum));
-    }
-
-  return cstring_fromChars (result);
-}
-
-void llquietbugaux (cstring s, /*@unused@*/ cstring file, /*@unused@*/ int line)
-{
-# if 0
-# ifdef HOMEVERSION
-  llflush ();
-  printError (stderr, message ("%q: *** Internal Bug at %q: %q [errno: %d]",
-			       fileloc_unparse (g_currentloc),
-			       fileloc_unparseRaw (file, line),
-			       s, errno));
-  printCodePoint ();
-  llflush ();
-# endif
-# else
-  cstring_free (s);
-# endif
-}
-
-void llflush (void)
-{
-  (void) fflush (g_msgstream);
-  (void) fflush (stderr);
-}
diff --git a/src/llgrammar.c b/src/llgrammar.c
deleted file mode 100644
index f9c3d67..0000000
--- a/src/llgrammar.c
+++ /dev/null
@@ -1,3902 +0,0 @@
-/*
-** Inserted at beginning of c files generated by bison
-** REMEMBER:  Change bison.reset too.
-*/
-
-/*@-allmacros@*/
-/*@+boolint@*/
-/*@+charint@*/
-/*@-macroparams@*/
-/*@-macroundef@*/
-/*@-unreachable@*/
-/*@-macrospec@*/
-/*@-varuse@*/
-/*@+ignorequals@*/
-/*@-macrostmt@*/
-/*@-noeffect@*/
-/*@-shadow@*/
-/*@-exitarg@*/
-/*@-macroredef@*/
-/*@-uniondef@*/
-/*@-compdef@*/
-/*@-matchfields@*/
-/*@-exportlocal@*/
-/*@-evalorderuncon@*/
-/*@-exportheader@*/
-/*@-typeuse@*/
-/*@-redecl@*/
-/*@-redef@*/
-/*@-noparams@*/
-/*@-ansireserved@*/
-/*@-fielduse@*/
-/*@-ifblock@*/
-/*@-elseifcomplete@*/
-/*@-whileblock@*/
-/*@-forblock@*/
-/*@-branchstate@*/
-/*@-readonlytrans@*/
-/*@-namechecks@*/
-/*@-usedef@*/
-/*@-systemunrecog@*/
-/*@-dependenttrans@*/
-/*@-unqualifiedtrans@*/
-/*@-nullassign@*/
-
-/* < end of bison.head > */
-
-
-/*  A Bison parser, made from llgrammar.y
-    by GNU Bison version 1.28  */
-
-#define YYBISON 1  /* Identify Bison output.  */
-
-#define yyparse ylparse
-#define yylex yllex
-#define yyerror ylerror
-#define yylval yllval
-#define yychar ylchar
-#define yydebug yldebug
-#define yynerrs ylnerrs
-#define	simpleOp	257
-#define	PREFIX_OP	258
-#define	POSTFIX_OP	259
-#define	LLT_MULOP	260
-#define	LLT_SEMI	261
-#define	LLT_VERTICALBAR	262
-#define	ITERATION_OP	263
-#define	LLT_LPAR	264
-#define	LLT_LBRACKET	265
-#define	selectSym	266
-#define	LLT_IF_THEN_ELSE	267
-#define	logicalOp	268
-#define	eqSepSym	269
-#define	equationSym	270
-#define	commentSym	271
-#define	LLT_WHITESPACE	272
-#define	LLT_EOL	273
-#define	LLT_TYPEDEF_NAME	274
-#define	quantifierSym	275
-#define	openSym	276
-#define	closeSym	277
-#define	sepSym	278
-#define	simpleId	279
-#define	mapSym	280
-#define	markerSym	281
-#define	preSym	282
-#define	postSym	283
-#define	anySym	284
-#define	LLT_COLON	285
-#define	LLT_COMMA	286
-#define	LLT_EQUALS	287
-#define	LLT_LBRACE	288
-#define	LLT_RBRACE	289
-#define	LLT_RBRACKET	290
-#define	LLT_RPAR	291
-#define	LLT_QUOTE	292
-#define	eqOp	293
-#define	LLT_CCHAR	294
-#define	LLT_CFLOAT	295
-#define	LLT_CINTEGER	296
-#define	LLT_LCSTRING	297
-#define	LLT_ALL	298
-#define	LLT_ANYTHING	299
-#define	LLT_BE	300
-#define	LLT_BODY	301
-#define	LLT_CLAIMS	302
-#define	LLT_CHECKS	303
-#define	LLT_CONSTANT	304
-#define	LLT_ELSE	305
-#define	LLT_ENSURES	306
-#define	LLT_FOR	307
-#define	LLT_FRESH	308
-#define	LLT_IF	309
-#define	LLT_IMMUTABLE	310
-#define	LLT_IMPORTS	311
-#define	LLT_CONSTRAINT	312
-#define	LLT_ISSUB	313
-#define	LLT_LET	314
-#define	LLT_MODIFIES	315
-#define	LLT_MUTABLE	316
-#define	LLT_NOTHING	317
-#define	LLT_INTERNAL	318
-#define	LLT_FILESYS	319
-#define	LLT_OBJ	320
-#define	LLT_OUT	321
-#define	LLT_SEF	322
-#define	LLT_ONLY	323
-#define	LLT_PARTIAL	324
-#define	LLT_OWNED	325
-#define	LLT_DEPENDENT	326
-#define	LLT_KEEP	327
-#define	LLT_KEPT	328
-#define	LLT_TEMP	329
-#define	LLT_SHARED	330
-#define	LLT_UNIQUE	331
-#define	LLT_UNUSED	332
-#define	LLT_EXITS	333
-#define	LLT_MAYEXIT	334
-#define	LLT_NEVEREXIT	335
-#define	LLT_TRUEEXIT	336
-#define	LLT_FALSEEXIT	337
-#define	LLT_UNDEF	338
-#define	LLT_KILLED	339
-#define	LLT_CHECKMOD	340
-#define	LLT_CHECKED	341
-#define	LLT_UNCHECKED	342
-#define	LLT_CHECKEDSTRICT	343
-#define	LLT_TRUENULL	344
-#define	LLT_FALSENULL	345
-#define	LLT_LNULL	346
-#define	LLT_LNOTNULL	347
-#define	LLT_RETURNED	348
-#define	LLT_OBSERVER	349
-#define	LLT_EXPOSED	350
-#define	LLT_REFCOUNTED	351
-#define	LLT_REFS	352
-#define	LLT_RELNULL	353
-#define	LLT_RELDEF	354
-#define	LLT_KILLREF	355
-#define	LLT_NULLTERMINATED	356
-#define	LLT_TEMPREF	357
-#define	LLT_NEWREF	358
-#define	LLT_PRIVATE	359
-#define	LLT_REQUIRES	360
-#define	LLT_RESULT	361
-#define	LLT_SIZEOF	362
-#define	LLT_SPEC	363
-#define	LLT_TAGGEDUNION	364
-#define	LLT_THEN	365
-#define	LLT_TYPE	366
-#define	LLT_TYPEDEF	367
-#define	LLT_UNCHANGED	368
-#define	LLT_USES	369
-#define	LLT_CHAR	370
-#define	LLT_CONST	371
-#define	LLT_DOUBLE	372
-#define	LLT_ENUM	373
-#define	LLT_FLOAT	374
-#define	LLT_INT	375
-#define	LLT_ITER	376
-#define	LLT_YIELD	377
-#define	LLT_LONG	378
-#define	LLT_SHORT	379
-#define	LLT_SIGNED	380
-#define	LLT_UNKNOWN	381
-#define	LLT_STRUCT	382
-#define	LLT_TELIPSIS	383
-#define	LLT_UNION	384
-#define	LLT_UNSIGNED	385
-#define	LLT_VOID	386
-#define	LLT_VOLATILE	387
-#define	LLT_PRINTFLIKE	388
-#define	LLT_SCANFLIKE	389
-#define	LLT_MESSAGELIKE	390
-
-#line 36 "llgrammar.y"
-
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "lclscan.h"
-# include "checking.h"
-# include "lslparse.h" 
-# include "lh.h"
-# include "usymtab_interface.h"
-
-/*@-noparams@*/
-static /*@unused@*/ void yyprint ();
-/*@=noparams@*/
-
-/*@-redecl@*/
-void ylerror (char *) /*@modifies *g_msgstream@*/ ;
-/*@=redecl@*/
-
-bool g_inTypeDef = FALSE;
-
-/*@constant int YYDEBUG;@*/
-# define YYDEBUG 1
-
-/*@notfunction@*/
-# define YYPRINT(file, type, value) yyprint (file, type, value)
-
-/*
-** This is necessary, or else when the bison-generated code #include's malloc.h,
-** there will be a parse error.
-**
-** Unfortunately, it means the error checking on malloc, etc. is lost for allocations
-** in bison-generated files under Win32.
-*/
-
-# ifdef WIN32
-# undef malloc
-# undef calloc
-# undef realloc
-# endif
-
-
-#line 78 "llgrammar.y"
-typedef union 
-{
-  ltoken ltok;  /* a leaf is also an ltoken */
-  qual typequal;
-  unsigned int count;
-  /*@only@*/ ltokenList ltokenList;
-  /*@only@*/ abstDeclaratorNode abstDecl; 
-  /*@only@*/ declaratorNode declare;
-  /*@only@*/ declaratorNodeList declarelist;
-  /*@only@*/ typeExpr typeexpr;
-  /*@only@*/ arrayQualNode array;
-  /*@only@*/ quantifierNode quantifier;
-  /*@only@*/ quantifierNodeList quantifiers;
-  /*@only@*/ varNode var;
-  /*@only@*/ varNodeList vars;
-  /*@only@*/ storeRefNode storeref;
-  /*@only@*/ storeRefNodeList storereflist;
-  /*@only@*/ termNode term;
-  /*@only@*/ termNodeList termlist;
-  /*@only@*/ programNode program; 
-  /*@only@*/ stmtNode stmt;
-  /*@only@*/ claimNode claim;
-  /*@only@*/ typeNode type;
-  /*@only@*/ iterNode iter;
-  /*@only@*/ fcnNode fcn;
-  /*@only@*/ fcnNodeList fcns;
-  /*@only@*/ letDeclNode letdecl;
-  /*@only@*/ letDeclNodeList letdecls;
-  /*@only@*/ lclPredicateNode lclpredicate;
-  /*@only@*/ modifyNode modify;
-  /*@only@*/ paramNode param;
-  /*@only@*/ paramNodeList paramlist;
-  /*@only@*/ declaratorInvNodeList declaratorinvs;	
-  /*@only@*/ declaratorInvNode declaratorinv;	
-  /*@only@*/ abstBodyNode abstbody;
-  /*@only@*/ abstractNode abstract;
-  /*@only@*/ exposedNode exposed;
-  /*    taggedUnionNode taggedunion; */
-  /*@only@*/ globalList globals;
-  /*@only@*/ constDeclarationNode constdeclaration;
-  /*@only@*/ varDeclarationNode vardeclaration;
-  /*@only@*/ varDeclarationNodeList vardeclarationlist;
-  /*@only@*/ initDeclNodeList initdecls;
-  /*@only@*/ initDeclNode initdecl;
-  /*@only@*/ stDeclNodeList structdecls;
-  /*@only@*/ stDeclNode structdecl;
-  /*@only@*/ strOrUnionNode structorunion;
-  /*@only@*/ enumSpecNode enumspec; 
-  /*@only@*/ lclTypeSpecNode lcltypespec;
-  /*@only@*/ typeNameNode typname;
-  /*@only@*/ opFormNode opform;
-  /*@only@*/ sigNode signature;
-  /*@only@*/ nameNode name;
-  /*@only@*/ typeNameNodeList namelist;
-  /*@only@*/ replaceNode replace;	
-  /*@only@*/ replaceNodeList replacelist;
-  /*@only@*/ renamingNode renaming;
-  /*@only@*/ traitRefNode traitref;
-  /*@only@*/ traitRefNodeList traitreflist;
-  /*@only@*/ importNode import;
-  /*@only@*/ importNodeList importlist;
-  /*@only@*/ interfaceNode iface;
-  /*@only@*/ interfaceNodeList interfacelist; 
-  /*@only@*/ CTypesNode ctypes;
-} YYSTYPE;
-#ifndef YYDEBUG
-#define YYDEBUG 1
-#endif
-
-#include 
-
-#ifndef __cplusplus
-#ifndef __STDC__
-#define const
-#endif
-#endif
-
-
-
-#define	YYFINAL		684
-#define	YYFLAG		-32768
-#define	YYNTBASE	137
-
-#define YYTRANSLATE(x) ((unsigned)(x) <= 390 ? yytranslate[x] : 291)
-
-static const short yytranslate[] = {     0,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
-     7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
-    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
-    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
-    37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
-    47,    48,    49,    50,    51,    52,    53,    54,    55,    56,
-    57,    58,    59,    60,    61,    62,    63,    64,    65,    66,
-    67,    68,    69,    70,    71,    72,    73,    74,    75,    76,
-    77,    78,    79,    80,    81,    82,    83,    84,    85,    86,
-    87,    88,    89,    90,    91,    92,    93,    94,    95,    96,
-    97,    98,    99,   100,   101,   102,   103,   104,   105,   106,
-   107,   108,   109,   110,   111,   112,   113,   114,   115,   116,
-   117,   118,   119,   120,   121,   122,   123,   124,   125,   126,
-   127,   128,   129,   130,   131,   132,   133,   134,   135,   136
-};
-
-#if YYDEBUG != 0
-static const short yyprhs[] = {     0,
-     0,     1,     5,     6,     9,    11,    13,    14,    17,    20,
-    21,    24,    26,    28,    30,    34,    38,    40,    42,    44,
-    46,    48,    50,    57,    58,    60,    62,    66,    69,    71,
-    72,    76,    78,    80,    82,    84,    89,    93,    98,   103,
-   105,   107,   109,   111,   113,   114,   128,   129,   144,   145,
-   159,   164,   165,   166,   173,   174,   175,   183,   184,   185,
-   193,   194,   195,   202,   203,   204,   211,   214,   217,   219,
-   223,   225,   229,   231,   233,   237,   239,   241,   245,   247,
-   252,   256,   263,   265,   269,   271,   273,   277,   279,   283,
-   285,   289,   293,   297,   302,   304,   306,   308,   310,   312,
-   316,   318,   322,   323,   326,   330,   333,   336,   337,   340,
-   345,   346,   350,   352,   356,   362,   366,   368,   369,   373,
-   374,   378,   379,   383,   387,   391,   393,   397,   399,   401,
-   404,   406,   408,   409,   413,   414,   418,   419,   421,   423,
-   425,   429,   431,   435,   436,   441,   447,   449,   453,   456,
-   460,   464,   469,   473,   479,   486,   488,   492,   494,   496,
-   499,   502,   506,   510,   514,   519,   521,   525,   530,   534,
-   535,   538,   539,   541,   542,   549,   551,   555,   556,   560,
-   561,   565,   567,   569,   571,   573,   575,   577,   579,   581,
-   583,   585,   587,   590,   592,   594,   596,   598,   600,   602,
-   604,   606,   608,   610,   612,   614,   616,   618,   620,   622,
-   624,   626,   628,   630,   632,   634,   636,   638,   640,   642,
-   644,   646,   648,   650,   652,   654,   656,   658,   660,   662,
-   664,   666,   668,   670,   672,   675,   681,   683,   686,   688,
-   691,   692,   699,   700,   707,   710,   713,   714,   716,   718,
-   721,   725,   727,   731,   732,   734,   741,   744,   746,   750,
-   752,   754,   756,   760,   763,   766,   770,   775,   777,   781,
-   784,   787,   791,   796,   798,   801,   804,   808,   813,   816,
-   819,   822,   825,   829,   831,   832,   834,   838,   841,   843,
-   845,   848,   852,   856,   861,   864,   868,   875,   877,   880,
-   883,   887,   891,   896,   901,   907,   911,   916,   921,   927,
-   930,   933,   937,   941,   943,   945,   947,   949,   951,   953,
-   955,   956,   958,   960,   964,   966,   968,   973,   974,   976,
-   978,   982,   984,   986,   993,   995,   999,  1001,  1006,  1010,
-  1014,  1016,  1019,  1022,  1024,  1026,  1028,  1031,  1033,  1036,
-  1039,  1043,  1045,  1047,  1050,  1053,  1057,  1059,  1062,  1066,
-  1068,  1074,  1078,  1083,  1086,  1090,  1093,  1095,  1099,  1103,
-  1105,  1110,  1112,  1115,  1119,  1123,  1127,  1132,  1136,  1138,
-  1142,  1144,  1146,  1148,  1150,  1152,  1154,  1159,  1164,  1169,
-  1174,  1181,  1186,  1188,  1190,  1192,  1194,  1196,  1199,  1200,
-  1204,  1206,  1210,  1214,  1219,  1221,  1223,  1225,  1227,  1229,
-  1231,  1233,  1235
-};
-
-static const short yyrhs[] = {    -1,
-   139,   138,   141,     0,     0,   139,   140,     0,   144,     0,
-   145,     0,     0,   146,   142,     0,   151,   142,     0,     0,
-   142,   143,     0,   146,     0,   151,     0,   145,     0,    57,
-   175,     7,     0,   115,   179,     7,     0,   154,     0,   155,
-     0,   156,     0,   158,     0,   161,     0,   147,     0,   122,
-   285,    10,   148,    37,     7,     0,     0,   149,     0,   150,
-     0,   149,    32,   150,     0,   123,   244,     0,   244,     0,
-     0,   109,   152,   153,     0,   154,     0,   155,     0,   156,
-     0,   158,     0,    50,   227,   189,     7,     0,   227,   189,
-     7,     0,   117,   227,   189,     7,     0,   133,   227,   189,
-     7,     0,   163,     0,   172,     0,   134,     0,   135,     0,
-   136,     0,     0,   227,   240,   191,   159,    34,   193,   195,
-   199,   200,   201,   204,   205,    35,     0,     0,   157,   227,
-   240,   191,   160,    34,   193,   195,   199,   200,   201,   204,
-   205,    35,     0,     0,    48,   287,    10,   206,    37,   191,
-   162,    34,   195,   200,   209,   204,    35,     0,    48,   284,
-   287,     7,     0,     0,     0,    62,   164,   112,    20,   165,
-   214,     0,     0,     0,    62,   166,    97,   112,    20,   167,
-   214,     0,     0,     0,    97,    62,   168,   112,    20,   169,
-   214,     0,     0,     0,    56,   170,   112,    20,   171,   214,
-     0,     0,     0,   113,   227,   173,   219,   174,     7,     0,
-   230,     7,     0,   238,     7,     0,   176,     0,   175,    32,
-   176,     0,   178,     0,     3,   178,     3,     0,    43,     0,
-   178,     0,   177,    32,   178,     0,   283,     0,   180,     0,
-   179,    32,   180,     0,   289,     0,   289,    10,   182,    37,
-     0,    10,   181,    37,     0,    10,   181,    37,    10,   182,
-    37,     0,   289,     0,   181,    32,   289,     0,   184,     0,
-   183,     0,   183,    32,   184,     0,   245,     0,   183,    32,
-   245,     0,   185,     0,   184,    32,   185,     0,   245,    53,
-   223,     0,   245,    53,   186,     0,   245,    53,   186,   256,
-     0,   290,     0,   249,     0,   188,     0,   260,     0,   190,
-     0,   189,    32,   190,     0,   240,     0,   240,    33,   187,
-     0,     0,   191,   192,     0,   227,   189,     7,     0,    64,
-     7,     0,    65,     7,     0,     0,   193,   194,     0,   105,
-   227,   189,     7,     0,     0,    60,   196,     7,     0,   197,
-     0,   196,    32,   197,     0,   285,    31,   198,    46,   260,
-     0,   285,    46,   260,     0,   227,     0,     0,    49,   259,
-     7,     0,     0,   106,   259,     7,     0,     0,    61,    63,
-     7,     0,    61,    45,     7,     0,    61,   202,     7,     0,
-   203,     0,   202,    32,   203,     0,   260,     0,   228,     0,
-    66,   228,     0,    64,     0,    65,     0,     0,    52,   259,
-     7,     0,     0,    48,   259,     7,     0,     0,   207,     0,
-   208,     0,   129,     0,   208,    32,   129,     0,   244,     0,
-   208,    32,   244,     0,     0,    47,    34,   210,    35,     0,
-    47,    34,   210,     7,    35,     0,   211,     0,    10,   210,
-    37,     0,   210,     6,     0,   210,     8,   210,     0,   210,
-     7,   210,     0,   284,    10,   212,    37,     0,   284,    10,
-    37,     0,   285,    33,   284,    10,    37,     0,   285,    33,
-   284,    10,   212,    37,     0,   213,     0,   212,    32,   213,
-     0,   277,     0,   285,     0,     3,   213,     0,   213,     3,
-     0,   213,     3,   213,     0,    10,   213,    37,     0,   284,
-    10,    37,     0,   284,    10,   212,    37,     0,     7,     0,
-    34,   215,    35,     0,    34,   177,    35,     7,     0,    34,
-    35,     7,     0,     0,   215,   158,     0,     0,   217,     0,
-     0,    58,   218,   279,    10,   259,    37,     0,   220,     0,
-   219,    32,   220,     0,     0,   240,   221,   222,     0,     0,
-    34,   216,    35,     0,   132,     0,   116,     0,   118,     0,
-   120,     0,   121,     0,   124,     0,   125,     0,   126,     0,
-   131,     0,   127,     0,   223,     0,   224,   223,     0,    20,
-     0,   224,     0,    67,     0,    78,     0,    68,     0,    69,
-     0,    71,     0,    72,     0,    73,     0,    74,     0,    95,
-     0,    79,     0,    80,     0,    82,     0,    83,     0,    81,
-     0,    75,     0,    76,     0,    77,     0,    87,     0,    88,
-     0,    89,     0,    90,     0,    91,     0,    99,     0,   100,
-     0,    97,     0,    98,     0,   104,     0,   101,     0,    92,
-     0,    93,     0,    94,     0,    96,     0,    70,     0,   102,
-     0,    84,     0,    85,     0,   225,     0,   230,     0,   238,
-     0,   226,   227,     0,     8,   228,    31,   228,     8,     0,
-   227,     0,   227,   229,     0,     6,     0,   229,     6,     0,
-     0,   128,   233,   231,    34,   234,    35,     0,     0,   130,
-   233,   232,    34,   234,    35,     0,   128,   286,     0,   130,
-   286,     0,     0,   286,     0,   235,     0,   234,   235,     0,
-   227,   236,     7,     0,   240,     0,   236,    32,   240,     0,
-     0,    32,     0,   119,   233,    34,   239,   237,    35,     0,
-   119,   286,     0,    25,     0,   239,    32,    25,     0,   242,
-     0,   241,     0,   285,     0,    10,   241,    37,     0,     6,
-   241,     0,   241,   248,     0,   241,    10,    37,     0,   241,
-    10,   207,    37,     0,    20,     0,    10,   242,    37,     0,
-     6,   242,     0,   242,   248,     0,   242,    10,    37,     0,
-   242,    10,   207,    37,     0,    20,     0,     6,   243,     0,
-   243,   248,     0,   243,    10,    37,     0,   243,    10,   207,
-    37,     0,   227,   243,     0,   227,   241,     0,   227,   246,
-     0,   227,   246,     0,    66,   227,   246,     0,   249,     0,
-     0,   247,     0,    10,   247,    37,     0,     6,   247,     0,
-     6,     0,   248,     0,   247,   248,     0,   247,    10,    37,
-     0,    10,   207,    37,     0,   247,    10,   207,    37,     0,
-    11,    36,     0,    11,   188,    36,     0,    55,    27,   111,
-    27,    51,    27,     0,   252,     0,    27,   252,     0,   252,
-    27,     0,    27,   252,    27,     0,   250,   253,   251,     0,
-    27,   250,   253,   251,     0,   250,   253,   251,    27,     0,
-    27,   250,   253,   251,    27,     0,    11,   253,    36,     0,
-    11,   253,    36,    27,     0,    27,    11,   253,    36,     0,
-    27,    11,   253,    36,    27,     0,    12,   283,     0,    26,
-   283,     0,    27,    12,   283,     0,    27,    26,   283,     0,
-    22,     0,    34,     0,    23,     0,    35,     0,   264,     0,
-    14,     0,    39,     0,     0,   254,     0,    27,     0,   254,
-   255,    27,     0,    32,     0,    24,     0,    31,   257,    26,
-   288,     0,     0,   258,     0,   288,     0,   258,    32,   288,
-     0,   260,     0,   261,     0,    55,   261,   111,   261,    51,
-   261,     0,   262,     0,   261,    14,   261,     0,   263,     0,
-   278,    10,   259,    37,     0,   263,    39,   263,     0,   263,
-    33,   263,     0,   265,     0,   268,   266,     0,   268,   267,
-     0,     3,     0,     6,     0,   268,     0,   264,   265,     0,
-   264,     0,   266,   264,     0,   264,   268,     0,   267,   264,
-   268,     0,   273,     0,   269,     0,   269,   273,     0,   273,
-   269,     0,   273,   269,   273,     0,   270,     0,   270,   273,
-     0,   271,    31,   288,     0,   271,     0,    11,   272,    36,
-    31,   288,     0,    11,   272,    36,     0,    11,    36,    31,
-   288,     0,    11,    36,     0,   250,   272,   251,     0,   250,
-   251,     0,   260,     0,   272,   255,   260,     0,    10,   261,
-    37,     0,   285,     0,   290,    10,   274,    37,     0,   276,
-     0,   273,   275,     0,   273,    12,   283,     0,   273,    26,
-   283,     0,   273,    11,    36,     0,   273,    11,   274,    36,
-     0,   273,    31,   288,     0,   261,     0,   274,    32,   261,
-     0,    28,     0,    29,     0,    30,     0,    38,     0,   277,
-     0,   107,     0,    54,    10,   274,    37,     0,   114,    10,
-    44,    37,     0,   114,    10,   202,    37,     0,   108,    10,
-   260,    37,     0,    59,    10,   260,    32,   260,    37,     0,
-   108,    10,   227,    37,     0,    42,     0,    43,     0,    40,
-     0,    41,     0,   279,     0,   278,   279,     0,     0,    21,
-   280,   281,     0,   282,     0,   281,    32,   282,     0,   285,
-    31,   198,     0,   285,    31,    66,   198,     0,    25,     0,
-    20,     0,    25,     0,    25,     0,   283,     0,   283,     0,
-   283,     0,   283,     0,   283,     0
-};
-
-#endif
-
-#if YYDEBUG != 0
-static const short yyrline[] = { 0,
-   383,   384,   387,   388,   391,   392,   395,   396,   397,   400,
-   401,   404,   405,   406,   409,   415,   419,   421,   423,   425,
-   427,   429,   433,   437,   438,   441,   443,   447,   448,   451,
-   452,   455,   457,   459,   461,   465,   469,   471,   473,   477,
-   478,   481,   482,   483,   486,   487,   494,   496,   507,   509,
-   512,   516,   516,   517,   518,   518,   520,   521,   522,   523,
-   524,   524,   525,   528,   529,   530,   531,   533,   549,   551,
-   555,   556,   558,   561,   562,   565,   569,   571,   575,   577,
-   579,   581,   585,   586,   589,   591,   593,   596,   598,   601,
-   603,   606,   607,   608,   612,   613,   615,   617,   620,   622,
-   626,   627,   630,   632,   636,   637,   638,   641,   642,   645,
-   649,   650,   653,   654,   657,   658,   660,   663,   664,   667,
-   668,   671,   672,   673,   674,   677,   678,   681,   682,   683,
-   684,   685,   688,   689,   692,   693,   696,   697,   700,   701,
-   702,   705,   706,   709,   710,   711,   714,   715,   718,   723,
-   729,   737,   739,   741,   743,   747,   748,   751,   752,   753,
-   754,   755,   756,   757,   759,   763,   764,   765,   766,   769,
-   770,   773,   774,   777,   777,   786,   787,   791,   792,   795,
-   796,   799,   800,   801,   802,   803,   804,   805,   806,   807,
-   808,   816,   817,   822,   824,   830,   831,   832,   833,   834,
-   835,   836,   837,   838,   839,   840,   841,   842,   843,   844,
-   845,   846,   847,   848,   849,   850,   851,   852,   853,   854,
-   855,   856,   857,   858,   859,   860,   861,   862,   863,   864,
-   865,   868,   870,   872,   874,   876,   885,   886,   891,   892,
-   895,   897,   899,   901,   903,   905,   909,   910,   913,   914,
-   919,   922,   924,   928,   929,   932,   934,   938,   939,   949,
-   950,   953,   954,   955,   956,   957,   958,   961,   962,   963,
-   964,   965,   966,   975,   976,   977,   978,   979,   985,   986,
-   987,   997,   998,   999,  1004,  1005,  1008,  1009,  1010,  1011,
-  1012,  1013,  1014,  1015,  1018,  1019,  1022,  1024,  1026,  1028,
-  1030,  1033,  1035,  1037,  1039,  1041,  1043,  1051,  1053,  1055,
-  1058,  1061,  1064,  1069,  1070,  1073,  1074,  1077,  1078,  1079,
-  1082,  1083,  1086,  1087,  1090,  1091,  1094,  1097,  1098,  1101,
-  1102,  1105,  1108,  1114,  1116,  1117,  1120,  1121,  1126,  1128,
-  1132,  1133,  1134,  1137,  1138,  1141,  1142,  1145,  1146,  1149,
-  1150,  1153,  1154,  1155,  1156,  1157,  1158,  1159,  1162,  1163,
-  1166,  1169,  1171,  1175,  1179,  1180,  1183,  1184,  1187,  1189,
-  1191,  1193,  1194,  1196,  1198,  1200,  1203,  1205,  1209,  1210,
-  1213,  1214,  1215,  1216,  1219,  1220,  1221,  1222,  1223,  1224,
-  1229,  1235,  1245,  1246,  1247,  1248,  1251,  1253,  1257,  1261,
-  1264,  1265,  1268,  1269,  1272,  1273,  1276,  1277,  1278,  1279,
-  1280,  1281,  1282
-};
-#endif
-
-
-#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
-
-static const char * const yytname[] = {   "$","error","$undefined.","simpleOp",
-"PREFIX_OP","POSTFIX_OP","LLT_MULOP","LLT_SEMI","LLT_VERTICALBAR","ITERATION_OP",
-"LLT_LPAR","LLT_LBRACKET","selectSym","LLT_IF_THEN_ELSE","logicalOp","eqSepSym",
-"equationSym","commentSym","LLT_WHITESPACE","LLT_EOL","LLT_TYPEDEF_NAME","quantifierSym",
-"openSym","closeSym","sepSym","simpleId","mapSym","markerSym","preSym","postSym",
-"anySym","LLT_COLON","LLT_COMMA","LLT_EQUALS","LLT_LBRACE","LLT_RBRACE","LLT_RBRACKET",
-"LLT_RPAR","LLT_QUOTE","eqOp","LLT_CCHAR","LLT_CFLOAT","LLT_CINTEGER","LLT_LCSTRING",
-"LLT_ALL","LLT_ANYTHING","LLT_BE","LLT_BODY","LLT_CLAIMS","LLT_CHECKS","LLT_CONSTANT",
-"LLT_ELSE","LLT_ENSURES","LLT_FOR","LLT_FRESH","LLT_IF","LLT_IMMUTABLE","LLT_IMPORTS",
-"LLT_CONSTRAINT","LLT_ISSUB","LLT_LET","LLT_MODIFIES","LLT_MUTABLE","LLT_NOTHING",
-"LLT_INTERNAL","LLT_FILESYS","LLT_OBJ","LLT_OUT","LLT_SEF","LLT_ONLY","LLT_PARTIAL",
-"LLT_OWNED","LLT_DEPENDENT","LLT_KEEP","LLT_KEPT","LLT_TEMP","LLT_SHARED","LLT_UNIQUE",
-"LLT_UNUSED","LLT_EXITS","LLT_MAYEXIT","LLT_NEVEREXIT","LLT_TRUEEXIT","LLT_FALSEEXIT",
-"LLT_UNDEF","LLT_KILLED","LLT_CHECKMOD","LLT_CHECKED","LLT_UNCHECKED","LLT_CHECKEDSTRICT",
-"LLT_TRUENULL","LLT_FALSENULL","LLT_LNULL","LLT_LNOTNULL","LLT_RETURNED","LLT_OBSERVER",
-"LLT_EXPOSED","LLT_REFCOUNTED","LLT_REFS","LLT_RELNULL","LLT_RELDEF","LLT_KILLREF",
-"LLT_NULLTERMINATED","LLT_TEMPREF","LLT_NEWREF","LLT_PRIVATE","LLT_REQUIRES",
-"LLT_RESULT","LLT_SIZEOF","LLT_SPEC","LLT_TAGGEDUNION","LLT_THEN","LLT_TYPE",
-"LLT_TYPEDEF","LLT_UNCHANGED","LLT_USES","LLT_CHAR","LLT_CONST","LLT_DOUBLE",
-"LLT_ENUM","LLT_FLOAT","LLT_INT","LLT_ITER","LLT_YIELD","LLT_LONG","LLT_SHORT",
-"LLT_SIGNED","LLT_UNKNOWN","LLT_STRUCT","LLT_TELIPSIS","LLT_UNION","LLT_UNSIGNED",
-"LLT_VOID","LLT_VOLATILE","LLT_PRINTFLIKE","LLT_SCANFLIKE","LLT_MESSAGELIKE",
-"interface","@1","externals","external","optDeclarations","declarations","declaration",
-"imports","uses","export","iter","iterParamList","realIterParamList","iterParam",
-"private","@2","private2","constDeclaration","varDeclaration","type","special",
-"fcn","@3","@4","claim","@5","abstract","@6","@7","@8","@9","@10","@11","@12",
-"@13","exposed","@14","@15","importNameList","importName","interfaceNameList",
-"interfaceName","traitRefNodeList","traitRef","traitIdList","renaming","nameList",
-"replaceNodeList","replace","name","initializer","constLclExpr","initDecls",
-"initDecl","globals","globalDecl","privateInits","privateInit","optLetDecl",
-"beDeclList","beDecl","sortSpec","optChecks","optRequire","optModify","storeRefList",
-"storeRef","optEnsure","optClaim","optParamList","realParamList","paramList",
-"optBody","callExpr","stmt","valueList","value","abstBody","fcns","optTypeInv",
-"typeInv","@16","declaratorInvs","declaratorInv","@17","optExposedBody","CType",
-"CTypes","typeSpecifier","specialQualifier","lclTypeSpec","lclType","pointers",
-"structOrUnionSpec","@18","@19","optTagId","structDecls","structDecl","declaratorList",
-"optCOMMA","enumSpec","enumeratorList","declarator","notype_decl","after_type_decl",
-"parameter_decl","param","typeName","optAbstDeclarator","abstDeclarator","arrayQual",
-"opForm","open","close","anyOp","middle","placeList","separator","signature",
-"domain","sortList","lclPredicate","term","term0","equalityTerm","simpleOpTerm",
-"simpleOp2","prefixOpTerm","postfixOps","infixOpPart","secondary","bracketed",
-"sqBracketed","matched","args","primary","termList","stateFcn","lclPrimary",
-"cLiteral","quantifiers","quantifier","@20","quantifiedList","quantified","simpleIdOrTypedefName",
-"fcnId","varId","tagId","claimId","sortId","traitId","opId", NULL
-};
-#endif
-
-static const short yyr1[] = {     0,
-   138,   137,   139,   139,   140,   140,   141,   141,   141,   142,
-   142,   143,   143,   143,   144,   145,   146,   146,   146,   146,
-   146,   146,   147,   148,   148,   149,   149,   150,   150,   152,
-   151,   153,   153,   153,   153,   154,   155,   155,   155,   156,
-   156,   157,   157,   157,   159,   158,   160,   158,   162,   161,
-   161,   164,   165,   163,   166,   167,   163,   168,   169,   163,
-   170,   171,   163,   173,   174,   172,   172,   172,   175,   175,
-   176,   176,   176,   177,   177,   178,   179,   179,   180,   180,
-   180,   180,   181,   181,   182,   182,   182,   183,   183,   184,
-   184,   185,   185,   185,   186,   186,   187,   188,   189,   189,
-   190,   190,   191,   191,   192,   192,   192,   193,   193,   194,
-   195,   195,   196,   196,   197,   197,   198,   199,   199,   200,
-   200,   201,   201,   201,   201,   202,   202,   203,   203,   203,
-   203,   203,   204,   204,   205,   205,   206,   206,   207,   207,
-   207,   208,   208,   209,   209,   209,   210,   210,   210,   210,
-   210,   211,   211,   211,   211,   212,   212,   213,   213,   213,
-   213,   213,   213,   213,   213,   214,   214,   214,   214,   215,
-   215,   216,   216,   218,   217,   219,   219,   221,   220,   222,
-   222,   223,   223,   223,   223,   223,   223,   223,   223,   223,
-   223,   224,   224,   225,   225,   226,   226,   226,   226,   226,
-   226,   226,   226,   226,   226,   226,   226,   226,   226,   226,
-   226,   226,   226,   226,   226,   226,   226,   226,   226,   226,
-   226,   226,   226,   226,   226,   226,   226,   226,   226,   226,
-   226,   227,   227,   227,   227,   227,   228,   228,   229,   229,
-   231,   230,   232,   230,   230,   230,   233,   233,   234,   234,
-   235,   236,   236,   237,   237,   238,   238,   239,   239,   240,
-   240,   241,   241,   241,   241,   241,   241,   242,   242,   242,
-   242,   242,   242,   243,   243,   243,   243,   243,   244,   244,
-   244,   245,   245,   245,   246,   246,   247,   247,   247,   247,
-   247,   247,   247,   247,   248,   248,   249,   249,   249,   249,
-   249,   249,   249,   249,   249,   249,   249,   249,   249,   249,
-   249,   249,   249,   250,   250,   251,   251,   252,   252,   252,
-   253,   253,   254,   254,   255,   255,   256,   257,   257,   258,
-   258,   259,   260,   261,   261,   261,   262,   262,   262,   262,
-   263,   263,   263,   264,   264,   265,   265,   266,   266,   267,
-   267,   268,   268,   268,   268,   268,   268,   268,   269,   269,
-   270,   270,   270,   270,   271,   271,   272,   272,   273,   273,
-   273,   273,   273,   273,   273,   273,   273,   273,   274,   274,
-   275,   275,   275,   275,   276,   276,   276,   276,   276,   276,
-   276,   276,   277,   277,   277,   277,   278,   278,   280,   279,
-   281,   281,   282,   282,   283,   283,   284,   285,   286,   287,
-   288,   289,   290
-};
-
-static const short yyr2[] = {     0,
-     0,     3,     0,     2,     1,     1,     0,     2,     2,     0,
-     2,     1,     1,     1,     3,     3,     1,     1,     1,     1,
-     1,     1,     6,     0,     1,     1,     3,     2,     1,     0,
-     3,     1,     1,     1,     1,     4,     3,     4,     4,     1,
-     1,     1,     1,     1,     0,    13,     0,    14,     0,    13,
-     4,     0,     0,     6,     0,     0,     7,     0,     0,     7,
-     0,     0,     6,     0,     0,     6,     2,     2,     1,     3,
-     1,     3,     1,     1,     3,     1,     1,     3,     1,     4,
-     3,     6,     1,     3,     1,     1,     3,     1,     3,     1,
-     3,     3,     3,     4,     1,     1,     1,     1,     1,     3,
-     1,     3,     0,     2,     3,     2,     2,     0,     2,     4,
-     0,     3,     1,     3,     5,     3,     1,     0,     3,     0,
-     3,     0,     3,     3,     3,     1,     3,     1,     1,     2,
-     1,     1,     0,     3,     0,     3,     0,     1,     1,     1,
-     3,     1,     3,     0,     4,     5,     1,     3,     2,     3,
-     3,     4,     3,     5,     6,     1,     3,     1,     1,     2,
-     2,     3,     3,     3,     4,     1,     3,     4,     3,     0,
-     2,     0,     1,     0,     6,     1,     3,     0,     3,     0,
-     3,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-     1,     1,     2,     1,     1,     1,     1,     1,     1,     1,
-     1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-     1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-     1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-     1,     1,     1,     1,     2,     5,     1,     2,     1,     2,
-     0,     6,     0,     6,     2,     2,     0,     1,     1,     2,
-     3,     1,     3,     0,     1,     6,     2,     1,     3,     1,
-     1,     1,     3,     2,     2,     3,     4,     1,     3,     2,
-     2,     3,     4,     1,     2,     2,     3,     4,     2,     2,
-     2,     2,     3,     1,     0,     1,     3,     2,     1,     1,
-     2,     3,     3,     4,     2,     3,     6,     1,     2,     2,
-     3,     3,     4,     4,     5,     3,     4,     4,     5,     2,
-     2,     3,     3,     1,     1,     1,     1,     1,     1,     1,
-     0,     1,     1,     3,     1,     1,     4,     0,     1,     1,
-     3,     1,     1,     6,     1,     3,     1,     4,     3,     3,
-     1,     2,     2,     1,     1,     1,     2,     1,     2,     2,
-     3,     1,     1,     2,     2,     3,     1,     2,     3,     1,
-     5,     3,     4,     2,     3,     2,     1,     3,     3,     1,
-     4,     1,     2,     3,     3,     3,     4,     3,     1,     3,
-     1,     1,     1,     1,     1,     1,     4,     4,     4,     4,
-     6,     4,     1,     1,     1,     1,     1,     2,     0,     3,
-     1,     3,     3,     4,     1,     1,     1,     1,     1,     1,
-     1,     1,     1
-};
-
-static const short yydefact[] = {     3,
-     1,     0,     0,     7,     4,     5,     6,     0,   406,   405,
-    73,     0,    69,    71,    76,     0,     0,    77,   412,    79,
-     0,   194,     0,     0,    61,    52,   196,   198,   199,   228,
-   200,   201,   202,   203,   210,   211,   212,   197,   205,   206,
-   209,   207,   208,   230,   231,   213,   214,   215,   216,   217,
-   224,   225,   226,   204,   227,   220,   221,   218,   219,   223,
-   229,   222,    30,     0,   183,     0,   184,   247,   185,   186,
-     0,   187,   188,   189,   191,   247,   247,   190,   182,     0,
-    42,    43,    44,     2,    10,    22,    10,    17,    18,    19,
-     0,    20,    21,    40,    41,   192,   195,   232,     0,     0,
-   233,   234,     0,    15,     0,     0,    83,    16,     0,     0,
-   220,   237,     0,   233,   234,   407,   410,     0,     0,     0,
-     0,     0,     0,    58,     0,    64,     0,     0,   409,   257,
-   408,     0,   241,   245,   243,   246,     0,     8,     9,     0,
-   193,   235,     0,     0,   268,     0,    99,   103,   261,   260,
-   262,    67,    68,    72,    70,     0,    81,    78,   344,   345,
-   321,     0,   319,   314,     0,     0,   315,   320,     0,     0,
-     0,    86,    85,    90,   285,    88,   284,   321,   298,   318,
-   239,   238,     0,     0,   137,     0,   101,     0,     0,     0,
-     0,    31,    32,    33,    34,    35,     0,     0,     0,    24,
-     0,     0,     0,    11,    14,    12,    13,   103,   264,   270,
-     0,     0,    37,     0,     0,    45,     0,     0,   265,     0,
-   271,    84,     0,   323,     0,   322,   310,   311,   321,     0,
-     0,   321,   299,     0,   285,    80,     0,     0,   289,     0,
-   282,   286,   290,     0,     0,   300,   240,     0,    51,   140,
-     0,   138,   139,   285,   142,    36,    62,    53,     0,     0,
-    65,   176,   178,    38,   258,   254,     0,     0,    25,    26,
-    29,     0,     0,    39,    47,   263,   269,   100,     0,     0,
-   399,   408,   395,   396,   393,   394,     0,     0,     0,   386,
-     0,     0,   102,    97,     0,    98,   333,   335,   337,     0,
-   341,   346,   353,   357,   360,   352,   372,   385,     0,   397,
-   413,   370,     0,     0,     0,     0,   104,     0,   266,     0,
-   295,     0,   272,     0,     0,   306,   326,   325,     0,     0,
-   312,   313,     0,   301,     0,   283,    87,    89,    91,     0,
-   288,     0,     0,     0,   291,    93,    92,    96,    95,   316,
-   317,   302,   236,   103,     0,   289,     0,   274,   280,   279,
-   281,     0,     0,    56,    59,     0,     0,   180,   255,     0,
-    28,     0,     0,     0,     0,   249,     0,     0,     0,   364,
-   367,     0,     0,     0,     0,     0,     0,     0,   366,     0,
-     0,     0,     0,   347,   346,   348,   342,   343,   354,   358,
-     0,     0,     0,     0,   381,   382,   383,     0,   384,   355,
-   373,     0,   398,     0,   106,   107,   108,     0,   267,   296,
-   273,    82,   307,   324,   308,   303,     0,   293,   287,   292,
-     0,   328,    94,   304,    49,   141,   143,   275,   289,     0,
-   276,   166,   170,    63,    54,     0,     0,   177,    66,   172,
-   179,   259,   256,    23,    27,     0,   252,   242,   250,   244,
-   108,   369,     0,   362,     0,   400,   401,     0,   379,     0,
-     0,     0,   194,     0,     0,     0,   131,   132,     0,     0,
-   126,   129,   128,   365,   336,   340,   339,   350,   349,     0,
-   411,   359,   376,     0,   374,   375,   378,   356,     0,   332,
-     0,   111,   105,   309,   305,     0,   294,     0,   329,   330,
-     0,   277,     0,     0,     0,    74,     0,    57,    60,   174,
-     0,   173,   251,     0,   111,   363,     0,   368,     0,     0,
-     0,   387,     0,     0,   392,   390,   388,   130,     0,   389,
-   351,   377,   338,   371,     0,     0,   109,   118,   297,     0,
-     0,   111,   278,   169,     0,     0,   167,   171,     0,     0,
-   181,   253,   118,   361,   402,     0,   403,   117,   380,     0,
-     0,   127,     0,   113,     0,     0,     0,   120,   327,   331,
-   120,    75,   168,   103,     0,   120,   404,   334,   391,   112,
-     0,     0,     0,     0,     0,     0,   122,   144,     0,   122,
-   114,     0,   116,   110,   119,     0,     0,   133,     0,   133,
-     0,   133,     0,   121,     0,     0,     0,     0,   135,     0,
-     0,   175,   135,   115,   124,   123,   125,     0,     0,     0,
-     0,   408,     0,   147,     0,     0,    50,     0,   134,     0,
-    46,     0,   149,     0,     0,   145,     0,     0,    48,   136,
-     0,   148,   146,   151,   150,     0,     0,   153,     0,   156,
-   158,     0,   159,   407,     0,   160,     0,     0,   152,   161,
-     0,     0,   163,   157,   162,   164,     0,   154,     0,   165,
-   155,     0,     0,     0
-};
-
-static const short yydefgoto[] = {   682,
-     4,     1,     5,    84,   138,   204,     6,   205,   206,    86,
-   268,   269,   270,   207,   125,   192,    88,    89,    90,    91,
-    92,   316,   378,    93,   511,    94,   122,   363,   123,   446,
-   191,   447,   121,   362,    95,   197,   367,    12,    13,   515,
-    14,    17,    18,   106,   171,   172,   173,   174,   346,   293,
-   294,   146,   147,   216,   317,   502,   547,   548,   573,   574,
-   567,   578,   597,   608,   480,   481,   619,   630,   251,   342,
-   253,   610,   654,   634,   659,   660,   444,   517,   521,   522,
-   560,   261,   262,   368,   451,    96,    97,    98,    99,   254,
-   482,   182,   114,   201,   202,   128,   375,   376,   456,   370,
-   115,   266,   187,   149,   150,   360,   255,   176,   241,   242,
-   243,   177,   295,   352,   179,   225,   226,   465,   433,   508,
-   509,   499,   500,   297,   298,   299,   300,   301,   397,   398,
-   302,   303,   304,   305,   382,   306,   470,   411,   307,   308,
-   309,   310,   383,   466,   467,   311,   662,   312,   130,   119,
-   492,    20,   313
-};
-
-static const short yypact[] = {-32768,
-   -25,   136,   368,  1350,-32768,-32768,-32768,   181,-32768,-32768,
--32768,    94,-32768,-32768,-32768,   181,   110,-32768,-32768,    33,
-  2903,-32768,   182,  2903,-32768,    17,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,   -11,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,  2903,-32768,  2903,-32768,   181,-32768,-32768,
-   108,-32768,-32768,-32768,-32768,   181,   181,-32768,-32768,  2903,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-  2903,-32768,-32768,-32768,-32768,-32768,   399,-32768,  2903,   408,
-   155,   192,   205,-32768,   136,   204,-32768,-32768,   368,  1152,
--32768,   233,   223,-32768,-32768,   266,-32768,   181,   305,   408,
-   211,   235,   264,-32768,  1445,-32768,   408,   339,-32768,   347,
--32768,   377,-32768,   347,-32768,   347,   408,  1247,  1247,   408,
--32768,-32768,   408,   408,-32768,   196,-32768,   259,   322,   409,
--32768,-32768,-32768,-32768,-32768,   181,   387,-32768,-32768,-32768,
-   386,   181,-32768,-32768,   181,   534,-32768,-32768,   403,  2903,
-   410,   445,   453,-32768,   360,   439,-32768,   386,   474,-32768,
--32768,   496,  2903,   497,  2319,   239,   470,   486,   492,   401,
-   404,-32768,-32768,-32768,-32768,-32768,   408,   282,   493,  2414,
-   488,   494,   288,-32768,-32768,-32768,-32768,-32768,   322,   409,
-   121,   141,-32768,   408,  3200,  1836,  1933,  3059,-32768,  2030,
--32768,-32768,  1152,-32768,   499,   122,-32768,-32768,   386,   181,
-   181,   386,   502,   421,   360,-32768,  1152,  1152,   360,  1741,
--32768,   454,-32768,   328,    80,-32768,-32768,   525,-32768,-32768,
-   504,-32768,   507,   380,-32768,-32768,-32768,-32768,   522,   524,
-   515,-32768,-32768,-32768,-32768,   518,  2903,   514,   520,-32768,
--32768,  2903,  2903,-32768,  1836,-32768,-32768,-32768,  3200,  3109,
--32768,   266,-32768,-32768,-32768,-32768,   544,  3200,   545,-32768,
-   549,   551,-32768,-32768,  3033,-32768,   550,-32768,   114,  3226,
--32768,   374,   382,   382,   535,   193,-32768,-32768,   273,-32768,
--32768,-32768,   555,   560,   562,   536,-32768,   408,-32768,   537,
--32768,   539,-32768,   540,   541,   552,-32768,-32768,   553,   547,
--32768,-32768,    80,-32768,   554,-32768,   453,   439,-32768,   439,
-   454,   548,   177,  2127,-32768,   556,-32768,-32768,-32768,-32768,
--32768,   557,-32768,-32768,  2509,   380,  1644,-32768,   322,   469,
--32768,    47,    47,-32768,-32768,   408,   564,   538,   561,   559,
--32768,   569,  2414,   408,  2611,-32768,  2713,   558,    36,   565,
--32768,   293,   108,  3200,    10,  3200,  1022,   762,-32768,   220,
-  3200,  3226,  3226,-32768,-32768,   268,   374,   374,   275,   275,
-   181,  3150,   181,   181,-32768,-32768,-32768,   181,-32768,   382,
--32768,  3200,-32768,  3200,-32768,-32768,-32768,   314,-32768,-32768,
--32768,-32768,-32768,-32768,   563,   568,   566,-32768,-32768,-32768,
-   573,   181,-32768,-32768,  1836,-32768,-32768,   469,   354,  2224,
--32768,-32768,   165,-32768,-32768,    47,    47,-32768,-32768,   530,
--32768,-32768,-32768,-32768,-32768,   317,-32768,-32768,-32768,-32768,
--32768,-32768,   181,   567,  3200,   570,-32768,   572,   550,   362,
-  3200,   579,   581,   575,   577,   578,-32768,-32768,  2903,   384,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   268,
--32768,-32768,-32768,   157,-32768,-32768,-32768,   275,   583,-32768,
-   397,    -8,-32768,-32768,-32768,   574,-32768,   590,   591,-32768,
-   571,-32768,   587,   592,   363,-32768,  1547,-32768,-32768,-32768,
-   594,-32768,-32768,   408,    -8,-32768,   181,-32768,   108,  2808,
-  3200,-32768,    28,  3200,-32768,-32768,-32768,-32768,   892,-32768,
--32768,-32768,-32768,-32768,   108,  2903,-32768,   582,-32768,   181,
-   181,   576,-32768,-32768,   181,   593,-32768,-32768,   408,   605,
--32768,-32768,   582,-32768,-32768,  2903,-32768,-32768,   550,  3200,
-   600,-32768,   331,-32768,   103,   408,  3200,   521,-32768,-32768,
-   521,-32768,-32768,-32768,   629,   521,-32768,   550,-32768,-32768,
-   108,  2903,  3200,   336,   634,  3200,   584,   597,  3200,   584,
--32768,   601,-32768,-32768,-32768,   639,   632,   596,   615,   596,
-   613,   596,  3200,-32768,   644,   648,   337,  3200,   608,    49,
-   623,-32768,   608,-32768,-32768,-32768,-32768,   652,  3200,   625,
-    49,   651,    50,-32768,   653,   631,-32768,   627,-32768,   658,
--32768,    63,-32768,   272,    49,-32768,   208,   642,-32768,-32768,
-    49,-32768,-32768,   660,-32768,   222,   222,-32768,   419,   666,
--32768,   661,-32768,-32768,   668,-32768,    41,   222,-32768,   316,
-   432,   468,-32768,   666,-32768,-32768,   426,-32768,   430,-32768,
--32768,   670,   676,-32768
-};
-
-static const short yypgoto[] = {-32768,
--32768,-32768,-32768,-32768,   595,-32768,-32768,   678,   677,-32768,
--32768,-32768,   307,   679,-32768,-32768,   610,   612,   616,-32768,
-  -121,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   580,-32768,
-    -6,-32768,   585,-32768,   461,-32768,   451,   452,-32768,-32768,
-   471,  -108,   478,  -188,-32768,   232,-32768,  -458,-32768,   127,
-  -473,   175,  -169,   142,   137,   206,  -206,   120,-32768,  -180,
--32768,-32768,  -507,-32768,  -190,  -230,  -318,-32768,-32768,-32768,
--32768,-32768,   381,-32768,-32768,   -89,-32768,-32768,-32768,    -3,
-   -18,-32768,    32,-32768,-32768,   407,   476,    68,-32768,-32768,
-    56,-32768,   -93,  -127,   344,   398,  -187,   257,  -182,  -213,
-  -101,   511,    30,  -267,   603,  -137,-32768,   586,-32768,-32768,
--32768,  -531,  -204,  -254,-32768,   105,   -46,   466,-32768,-32768,
-  -278,   455,-32768,-32768,   472,  -265,  -205,-32768,-32768,  -372,
--32768,  -303,-32768,-32768,   242,     7,   -23,   -38,   423,   656,
-  -377,    19,   531
-};
-
-
-#define	YYLAST		3340
-
-
-static const short yytable[] = {   118,
-   100,   103,   113,   196,   252,   413,   148,   141,    15,    19,
-   296,   186,   271,   296,    15,   209,   211,   112,   198,   275,
-   120,   395,    19,   391,   379,   341,   343,   389,   203,   117,
-   497,     2,   132,   385,   107,   101,   320,   399,   400,   324,
-   245,   391,   110,   670,   445,   595,   208,   219,   221,   391,
-   124,   545,   336,   442,   510,   643,   644,   645,   631,   102,
-   126,   151,   127,   180,   606,   426,   563,   611,   643,   651,
-   645,   361,   462,   632,   129,   381,   137,   673,   570,   371,
-   443,   151,   129,   129,   646,   526,   628,   140,   151,     3,
-   381,   330,   587,   581,   333,   142,   546,   640,   151,   652,
-   104,   151,   350,   263,   151,   151,   175,   219,   221,   219,
-   221,    15,   633,   -55,   351,    19,   108,   488,   602,   180,
-   471,   100,   484,   642,   117,   105,   359,   518,   519,   469,
-   217,   218,   131,   592,   100,   100,   485,   655,     8,   178,
-   345,   109,   341,   343,   498,   327,   392,   469,   593,   564,
-   220,   218,   393,   328,   347,     9,   101,   276,   151,   469,
-    10,   152,    19,   431,   248,   435,   235,   437,   227,   101,
-   101,   228,   579,   580,   222,   151,   180,   277,    11,   112,
-   102,   472,   475,   483,     9,   271,   344,   218,   531,    10,
-   180,   180,   542,   102,   102,   232,   494,   180,   153,   514,
-     9,     9,   213,   402,   403,    10,   116,   154,   501,   418,
-   656,   541,   318,   429,   164,   151,   533,   657,   404,   175,
-   405,   406,   407,   408,   656,   341,   167,   214,   209,   211,
-   409,   657,   632,   175,   175,   156,   331,   332,   181,   345,
-   157,   345,   350,   327,   658,   256,   632,   283,   284,   285,
-   286,   328,   178,   183,   351,   396,   585,   219,   441,   513,
-   528,   283,   284,   285,   286,  -101,   178,   178,   374,   374,
-   214,   318,   263,   178,   661,  -405,   569,   279,   280,   151,
-   457,   631,   412,   661,   661,   402,   403,     9,   264,   164,
-  -101,   215,   282,   281,   274,   661,   632,   661,   661,   661,
-   404,   167,   405,   406,   407,   408,   653,   283,   284,   285,
-   286,   209,   409,   214,   185,   588,   327,   151,   151,   214,
-   503,   287,   188,   523,   328,   657,   289,   151,   464,   571,
-   159,   217,   218,   160,   483,   151,   441,   590,   161,   162,
-   632,   163,   604,   627,   468,   214,   189,     9,   524,   164,
-   489,   490,    10,   165,   166,   283,   284,   285,   286,   439,
-   190,   167,   591,   357,   218,   239,   168,   214,   539,   240,
-   218,   374,   199,   374,   290,   291,   159,    16,   131,   160,
-  -248,   292,   169,   474,   112,   356,   200,     9,   603,   357,
-   218,   279,    10,   531,   555,   558,   223,   556,   532,   358,
-   151,     9,   483,   621,   131,   623,   282,   491,   624,   495,
-   496,   598,   224,   143,   491,   539,   600,   144,   220,   218,
-   540,   283,   284,   285,   286,   666,   667,   145,   531,   234,
-   562,   318,   131,   544,   656,   287,   516,   674,   491,   675,
-   289,   657,   459,    65,   459,    67,   236,    69,    70,    15,
-   668,    72,    73,    74,    75,   669,   632,   668,    78,    79,
-   538,   668,   680,   344,   218,   584,   681,   594,   676,   491,
-   656,   283,   284,   285,   286,   112,   237,   657,   440,   218,
-   677,   679,   133,   135,   238,   151,   210,   212,   290,   291,
-   468,   244,   632,   338,   340,   292,   486,   487,   134,   136,
-   246,   247,   215,   249,   678,   257,   575,   283,   284,   285,
-   286,   258,   259,   559,    65,   260,    67,   265,    69,    70,
-   151,   272,    72,    73,    74,    75,   568,   273,   334,    78,
-    79,   335,   353,   491,   326,   112,   159,   151,   355,   160,
-   354,   364,   576,   365,   229,   230,   366,   163,   582,   369,
-   372,   373,   575,   384,   386,   164,   491,   491,   387,   231,
-   388,    15,   568,   391,   414,   401,   415,   167,   416,   417,
-   449,   450,   168,   419,   420,   454,   421,   422,   423,   424,
-   427,   636,   425,   434,   428,   452,   432,   520,   568,   504,
-  -406,   461,   636,   453,   505,   463,   635,   527,   554,   583,
-   549,   529,   530,   112,   552,   636,   636,   635,   663,   507,
-   534,   535,   636,   536,   537,   550,   506,   663,   663,   543,
-   635,   635,   551,   553,   665,   281,   596,   635,   561,   663,
-   577,   663,   663,   663,   159,   545,   589,   160,   599,    21,
-   605,   279,   280,   609,   607,   614,   613,   618,   620,   622,
-   625,   473,   281,   164,   626,   629,   282,   637,   639,   641,
-  -407,   649,   647,   648,   650,   167,   664,   645,   670,   683,
-   671,   283,   284,   285,   286,   684,   615,   672,     7,   455,
-    85,   139,    87,   325,   155,   287,   288,   337,   322,   339,
-   289,   278,   525,   158,   616,   477,   478,   479,    27,    28,
-    29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
-    39,    40,    41,    42,    43,    44,    45,   601,    46,    47,
-    48,    49,    50,    51,    52,    53,    54,    55,   111,    57,
-    58,    59,    60,    61,   193,    62,   194,   586,   290,   291,
-   195,   612,   638,   617,   572,   292,   448,    65,   377,    67,
-    68,    69,    70,   438,   348,    72,    73,    74,    75,    76,
-   410,    77,    78,    79,   159,   394,   390,   160,   233,    21,
-   565,   279,   280,   184,   349,     0,     0,     0,     0,     0,
-     0,   473,   281,   164,     0,     0,   282,     0,     0,     0,
-     0,     0,     0,     0,     0,   167,     0,     0,     0,     0,
-     0,   283,   284,   285,   286,   476,     0,     0,     0,     0,
-     0,   329,     0,     0,     0,   287,   288,     0,     0,     0,
-   289,     0,     0,     0,     0,   477,   478,   479,    27,    28,
-    29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
-    39,    40,    41,    42,    43,    44,    45,     0,    46,    47,
-    48,    49,    50,    51,    52,    53,    54,    55,   111,    57,
-    58,    59,    60,    61,     0,    62,     0,     0,   290,   291,
-     0,     0,     0,     0,     0,   292,     0,    65,     0,    67,
-    68,    69,    70,     0,     0,    72,    73,    74,    75,    76,
-     0,    77,    78,    79,   159,     0,     0,   160,     0,    21,
-     0,   279,   280,     0,     0,     0,     0,     0,     0,     0,
-     0,   473,   281,   164,     0,     0,   282,     0,     0,     0,
-     0,     0,     0,     0,     0,   167,     0,     0,     0,     0,
-     0,   283,   284,   285,   286,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,   287,   288,     0,     0,     0,
-   289,     0,     0,     0,     0,   477,   478,   479,    27,    28,
-    29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
-    39,    40,    41,    42,    43,    44,    45,     0,    46,    47,
-    48,    49,    50,    51,    52,    53,    54,    55,   111,    57,
-    58,    59,    60,    61,     0,    62,     0,     0,   290,   291,
-     0,     0,     0,     0,     0,   292,     0,    65,     0,    67,
-    68,    69,    70,     0,     0,    72,    73,    74,    75,    76,
-     0,    77,    78,    79,   159,     0,     0,   160,     0,    21,
-     0,   279,   280,     0,     0,     0,     0,     0,     0,     0,
-     0,   473,   281,   164,     0,     0,   282,     0,     0,     0,
-     0,     0,     0,     0,     0,   167,     0,     0,     0,     0,
-     0,   283,   284,   285,   286,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,   287,   288,     0,     0,     0,
-   289,     0,     0,     0,     0,     0,     0,     0,    27,    28,
-    29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
-    39,    40,    41,    42,    43,    44,    45,     0,    46,    47,
-    48,    49,    50,    51,    52,    53,    54,    55,   111,    57,
-    58,    59,    60,    61,     0,    62,     0,     0,   290,   291,
-     0,     0,     0,     0,     0,   292,     0,    65,     0,    67,
-    68,    69,    70,     0,     0,    72,    73,    74,    75,    76,
-     0,    77,    78,    79,   159,     0,     0,   160,     0,    21,
-     0,     0,   161,   162,     0,   163,     0,     0,     0,     0,
-     0,    22,     0,   164,     0,     0,     0,   165,   166,     0,
-     0,     0,     0,     0,     0,   167,     0,     0,     0,     0,
-   168,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,   169,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,   170,    27,    28,
-    29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
-    39,    40,    41,    42,    43,    44,    45,     0,    46,    47,
-    48,    49,    50,    51,    52,    53,    54,    55,   111,    57,
-    58,    59,    60,    61,    21,    62,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,    22,    65,     0,    67,
-    68,    69,    70,     0,     0,    72,    73,    74,    75,    76,
-     0,    77,    78,    79,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,    23,     0,    24,     0,     0,     0,
-     0,     0,    25,     0,     0,     0,     0,     0,    26,     0,
-     0,     0,     0,    27,    28,    29,    30,    31,    32,    33,
-    34,    35,    36,    37,    38,    39,    40,    41,    42,    43,
-    44,    45,     0,    46,    47,    48,    49,    50,    51,    52,
-    53,    54,    55,    56,    57,    58,    59,    60,    61,     0,
-    62,     0,     0,     0,     0,    63,     0,    21,     0,    64,
-     0,     3,    65,    66,    67,    68,    69,    70,    71,    22,
-    72,    73,    74,    75,    76,     0,    77,    78,    79,    80,
-    81,    82,    83,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,    23,     0,    24,
-     0,     0,     0,     0,     0,    25,     0,     0,     0,     0,
-     0,    26,     0,     0,     0,     0,    27,    28,    29,    30,
-    31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
-    41,    42,    43,    44,    45,     0,    46,    47,    48,    49,
-    50,    51,    52,    53,    54,    55,    56,    57,    58,    59,
-    60,    61,    21,    62,     0,     0,     0,     0,    63,     0,
-     0,     0,    64,     0,    22,    65,    66,    67,    68,    69,
-    70,    71,     0,    72,    73,    74,    75,    76,     0,    77,
-    78,    79,    80,    81,    82,    83,     0,     0,     0,     0,
-     0,     0,     0,     0,    24,     0,     0,     0,     0,     0,
-    25,     0,     0,     0,     0,     0,    26,     0,     0,     0,
-     0,    27,    28,    29,    30,    31,    32,    33,    34,    35,
-    36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
-     0,    46,    47,    48,    49,    50,    51,    52,    53,    54,
-    55,    56,    57,    58,    59,    60,    61,     0,    62,     0,
-     0,     0,     0,     0,    21,     0,     0,    64,     0,     0,
-    65,    66,    67,    68,    69,    70,    22,     0,    72,    73,
-    74,    75,    76,     0,    77,    78,    79,    80,    81,    82,
-    83,   557,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,    27,    28,    29,    30,    31,    32,    33,
-    34,    35,    36,    37,    38,    39,    40,    41,    42,    43,
-    44,    45,     0,    46,    47,    48,    49,    50,    51,    52,
-    53,    54,    55,   111,    57,    58,    59,    60,    61,   439,
-    62,    21,     0,   357,   218,     0,     0,     0,     0,     0,
-     0,     0,    65,    22,    67,    68,    69,    70,   131,     0,
-    72,    73,    74,    75,    76,     0,    77,    78,    79,     0,
-    81,    82,    83,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
-    37,    38,    39,    40,    41,    42,    43,    44,    45,     0,
-    46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
-   111,    57,    58,    59,    60,    61,   239,    62,    21,     0,
-   240,   218,     0,     0,     0,     0,     0,     0,     0,    65,
-    22,    67,    68,    69,    70,     0,     0,    72,    73,    74,
-    75,    76,   250,    77,    78,    79,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,    27,    28,    29,
-    30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
-    40,    41,    42,    43,    44,    45,     0,    46,    47,    48,
-    49,    50,    51,    52,    53,    54,    55,   111,    57,    58,
-    59,    60,    61,    21,    62,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,    22,    65,     0,    67,    68,
-    69,    70,     0,     0,    72,    73,    74,    75,    76,   250,
-    77,    78,    79,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,   314,
-   315,     0,    27,    28,    29,    30,    31,    32,    33,    34,
-    35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
-    45,     0,    46,    47,    48,    49,    50,    51,    52,    53,
-    54,    55,   111,    57,    58,    59,    60,    61,     0,    62,
-    21,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,    65,    22,    67,    68,    69,    70,     0,     0,    72,
-    73,    74,    75,    76,     0,    77,    78,    79,     0,   319,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,    27,
-    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
-    38,    39,    40,    41,    42,    43,    44,    45,     0,    46,
-    47,    48,    49,    50,    51,    52,    53,    54,    55,   111,
-    57,    58,    59,    60,    61,     0,    62,    21,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,    65,    22,
-    67,    68,    69,    70,     0,     0,    72,    73,    74,    75,
-    76,   250,    77,    78,    79,     0,   323,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,    27,    28,    29,    30,
-    31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
-    41,    42,    43,    44,    45,     0,    46,    47,    48,    49,
-    50,    51,    52,    53,    54,    55,   111,    57,    58,    59,
-    60,    61,     0,    62,    21,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,    65,    22,    67,    68,    69,
-    70,     0,     0,    72,    73,    74,    75,    76,   250,    77,
-    78,    79,     0,   430,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,    27,    28,    29,    30,    31,    32,    33,
-    34,    35,    36,    37,    38,    39,    40,    41,    42,    43,
-    44,    45,     0,    46,    47,    48,    49,    50,    51,    52,
-    53,    54,    55,   111,    57,    58,    59,    60,    61,     0,
-    62,    21,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,    65,    22,    67,    68,    69,    70,     0,     0,
-    72,    73,    74,    75,    76,   250,    77,    78,    79,     0,
-   512,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
-    37,    38,    39,    40,    41,    42,    43,    44,    45,     0,
-    46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
-   111,    57,    58,    59,    60,    61,    21,    62,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,    22,    65,
-     0,    67,    68,    69,    70,     0,     0,    72,    73,    74,
-    75,    76,   250,    77,    78,    79,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,    27,    28,    29,    30,    31,
-    32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
-    42,    43,    44,    45,     0,    46,    47,    48,    49,    50,
-    51,    52,    53,    54,    55,   111,    57,    58,    59,    60,
-    61,    21,    62,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,    22,    65,     0,    67,    68,    69,    70,
-     0,     0,    72,    73,    74,    75,    76,   250,    77,    78,
-    79,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
-    37,    38,    39,    40,    41,    42,    43,    44,    45,     0,
-    46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
-   111,    57,    58,    59,    60,    61,    21,    62,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,    22,    65,
-     0,    67,    68,    69,    70,     0,   267,    72,    73,    74,
-    75,    76,     0,    77,    78,    79,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,    27,    28,    29,    30,    31,
-    32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
-    42,    43,    44,    45,     0,    46,    47,    48,    49,    50,
-    51,    52,    53,    54,    55,   111,    57,    58,    59,    60,
-    61,     0,    62,     0,     0,     0,     0,     0,    21,     0,
-     0,     0,     0,     0,    65,     0,    67,    68,    69,    70,
-    22,     0,    72,    73,    74,    75,    76,   436,    77,    78,
-    79,     0,     0,     0,     0,   458,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,    27,    28,    29,
-    30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
-    40,    41,    42,    43,    44,    45,     0,    46,    47,    48,
-    49,    50,    51,    52,    53,    54,    55,   111,    57,    58,
-    59,    60,    61,     0,    62,     0,     0,     0,     0,     0,
-    21,     0,     0,     0,     0,     0,    65,     0,    67,    68,
-    69,    70,    22,     0,    72,    73,    74,    75,    76,     0,
-    77,    78,    79,     0,     0,     0,     0,   460,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,    27,
-    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
-    38,    39,    40,    41,    42,    43,    44,    45,     0,    46,
-    47,    48,    49,    50,    51,    52,    53,    54,    55,   111,
-    57,    58,    59,    60,    61,    21,    62,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,    22,    65,     0,
-    67,    68,    69,    70,     0,     0,    72,    73,    74,    75,
-    76,     0,    77,    78,    79,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,   566,    27,    28,    29,    30,    31,    32,
-    33,    34,    35,    36,    37,    38,    39,    40,    41,    42,
-    43,    44,    45,     0,    46,    47,    48,    49,    50,    51,
-    52,    53,    54,    55,   111,    57,    58,    59,    60,    61,
-    21,    62,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,    22,    65,     0,    67,    68,    69,    70,     0,
-     0,    72,    73,    74,    75,    76,     0,    77,    78,    79,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,    27,
-    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
-    38,    39,    40,    41,    42,    43,    44,    45,     0,    46,
-    47,    48,    49,    50,    51,    52,    53,    54,    55,   111,
-    57,    58,    59,    60,    61,     0,    62,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,    65,     0,
-    67,    68,    69,    70,     0,     0,    72,    73,    74,    75,
-    76,     0,    77,    78,    79,   159,     0,     0,   160,     0,
-     0,     0,   279,   280,     0,     0,     0,     0,     0,     0,
-     0,     0,     9,   281,   164,   350,     0,   282,     0,     0,
-     0,   159,     0,     0,   160,     0,   167,   351,   279,   280,
-     0,     0,   283,   284,   285,   286,     0,     0,     9,   281,
-   164,     0,     0,   282,     0,     0,   287,   288,     0,     0,
-     0,   289,   167,     0,   321,     0,     0,     0,   283,   284,
-   285,   286,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,   159,   287,   288,   160,     0,     0,   289,   279,   280,
-     0,     0,     0,     0,     0,     0,     0,     0,     9,   281,
-   164,     0,     0,   282,     0,     0,     0,     0,     0,   290,
-   291,     0,   167,     0,   380,     0,   292,     0,   283,   284,
-   285,   286,   159,     0,     0,   160,     0,     0,     0,   279,
-   280,     0,   287,   288,     0,   290,   291,   289,     0,     9,
-   281,   164,   292,     0,   282,     0,     0,     0,     0,     0,
-     0,     0,     0,   167,     0,   493,     0,     0,     0,   283,
-   284,   285,   286,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,   159,   287,   288,   160,     0,     0,   289,   279,
-   280,     0,     0,     0,     0,   290,   291,     0,     0,     9,
-   281,   164,   292,     0,   282,     0,     0,     0,   159,     0,
-     0,   160,     0,   167,     0,   279,   280,     0,     0,   283,
-   284,   285,   286,     0,     0,     9,     0,   164,     0,     0,
-   282,     0,     0,   287,   288,     0,   290,   291,   289,   167,
-     0,     0,     0,   292,     0,   283,   284,   285,   286,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,   287,
-     0,     0,     0,     0,   289,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,   290,   291,     0,     0,
-     0,     0,     0,   292,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,   290,   291,     0,     0,     0,     0,     0,   292
-};
-
-static const short yycheck[] = {    23,
-     4,     8,    21,   125,   185,   309,   100,    97,     2,     3,
-   215,   120,   200,   218,     8,   143,   144,    21,   127,   208,
-    24,   300,    16,    14,   279,   239,   240,   295,   137,    23,
-   408,    57,    71,   288,    16,     4,   217,   303,   304,   220,
-   178,    14,    10,     3,   363,   577,   140,   149,   150,    14,
-    62,    60,   235,     7,   432,     6,     7,     8,    10,     4,
-    64,   100,    66,   110,   596,   333,   525,   599,     6,     7,
-     8,   254,    37,    25,    68,   280,    80,    37,    51,   267,
-    34,   120,    76,    77,    35,   463,   618,    91,   127,   115,
-   295,   229,   566,   552,   232,    99,   105,   629,   137,    37,
-     7,   140,    23,   197,   143,   144,   110,   209,   210,   211,
-   212,   105,   620,    97,    35,   109,     7,   396,   592,   166,
-   111,   125,   390,   631,   118,    32,   254,   446,   447,   384,
-    10,    11,    25,    31,   138,   139,   391,   645,     3,   110,
-   242,    32,   356,   357,   410,    24,    33,   402,    46,   527,
-    10,    11,    39,    32,   244,    20,   125,    37,   197,   414,
-    25,     7,   156,   344,   183,   354,   170,   355,   162,   138,
-   139,   165,   550,   551,   156,   214,   223,    37,    43,   183,
-   125,   386,   387,   388,    20,   373,    10,    11,    32,    25,
-   237,   238,    36,   138,   139,   166,   402,   244,     7,    35,
-    20,    20,     7,    11,    12,    25,    25,     3,   414,   318,
-     3,   490,   216,    37,    22,   254,   471,    10,    26,   223,
-    28,    29,    30,    31,     3,   439,    34,    32,   356,   357,
-    38,    10,    25,   237,   238,    32,   230,   231,     6,   341,
-    37,   343,    23,    24,    37,     7,    25,    40,    41,    42,
-    43,    32,   223,    31,    35,   302,   560,   359,   360,   440,
-   465,    40,    41,    42,    43,     7,   237,   238,   272,   273,
-    32,   275,   366,   244,   647,    10,   531,    10,    11,   318,
-   374,    10,    10,   656,   657,    11,    12,    20,     7,    22,
-    32,    33,    25,    21,     7,   668,    25,   670,   671,   672,
-    26,    34,    28,    29,    30,    31,    35,    40,    41,    42,
-    43,   439,    38,    32,    10,   570,    24,   356,   357,    32,
-     7,    54,   112,     7,    32,    10,    59,   366,    36,   534,
-     3,    10,    11,     6,   539,   374,   438,     7,    11,    12,
-    25,    14,     7,     7,   383,    32,   112,    20,    32,    22,
-   397,   398,    25,    26,    27,    40,    41,    42,    43,     6,
-    97,    34,    32,    10,    11,     6,    39,    32,    32,    10,
-    11,   375,    34,   377,   107,   108,     3,    10,    25,     6,
-    34,   114,    55,   387,   388,     6,    10,    20,   593,    10,
-    11,    10,    25,    32,    32,   517,    10,    35,    37,    20,
-   439,    20,   607,   610,    25,   612,    25,   401,   613,   403,
-   404,   581,    27,     6,   408,    32,   586,    10,    10,    11,
-    37,    40,    41,    42,    43,   656,   657,    20,    32,    27,
-   524,   435,    25,    37,     3,    54,   443,   668,   432,   670,
-    59,    10,   375,   116,   377,   118,    37,   120,   121,   443,
-    32,   124,   125,   126,   127,    37,    25,    32,   131,   132,
-   479,    32,    37,    10,    11,   559,    37,   576,    37,   463,
-     3,    40,    41,    42,    43,   479,    32,    10,    10,    11,
-   671,   672,    76,    77,    32,   524,   143,   144,   107,   108,
-   529,    53,    25,   237,   238,   114,   392,   393,    76,    77,
-    27,     6,    33,     7,    37,    20,   545,    40,    41,    42,
-    43,    20,   112,   517,   116,   112,   118,    25,   120,   121,
-   559,    34,   124,   125,   126,   127,   530,    34,    27,   131,
-   132,   111,     8,   527,    36,   539,     3,   576,    32,     6,
-    37,    20,   546,    20,    11,    12,    32,    14,   555,    32,
-    37,    32,   591,    10,    10,    22,   550,   551,    10,    26,
-    10,   555,   566,    14,    10,    31,     7,    34,     7,    34,
-     7,    34,    39,    37,    36,     7,    37,    37,    27,    27,
-    27,   620,    36,    27,    37,    25,    31,    58,   592,    27,
-    10,    34,   631,    35,    27,    31,   620,    31,     7,     7,
-    27,    32,    31,   607,    34,   644,   645,   631,   647,    37,
-    32,    37,   651,    37,    37,    26,    51,   656,   657,    37,
-   644,   645,    32,    37,   648,    21,   106,   651,    35,   668,
-    49,   670,   671,   672,     3,    60,    37,     6,    10,     8,
-     7,    10,    11,    47,    61,     7,    46,    52,    34,    37,
-     7,    20,    21,    22,     7,    48,    25,    35,     7,    35,
-    10,    35,    10,    33,     7,    34,    25,     8,     3,     0,
-    10,    40,    41,    42,    43,     0,    45,    10,     1,   373,
-     4,    87,     4,   223,   105,    54,    55,   237,   218,   238,
-    59,   214,   461,   109,    63,    64,    65,    66,    67,    68,
-    69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
-    79,    80,    81,    82,    83,    84,    85,   591,    87,    88,
-    89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
-    99,   100,   101,   102,   125,   104,   125,   563,   107,   108,
-   125,   600,   623,   607,   539,   114,   366,   116,   273,   118,
-   119,   120,   121,   356,   244,   124,   125,   126,   127,   128,
-   306,   130,   131,   132,     3,   300,   295,     6,   166,     8,
-   529,    10,    11,   118,   244,    -1,    -1,    -1,    -1,    -1,
-    -1,    20,    21,    22,    -1,    -1,    25,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    34,    -1,    -1,    -1,    -1,
-    -1,    40,    41,    42,    43,    44,    -1,    -1,    -1,    -1,
-    -1,   226,    -1,    -1,    -1,    54,    55,    -1,    -1,    -1,
-    59,    -1,    -1,    -1,    -1,    64,    65,    66,    67,    68,
-    69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
-    79,    80,    81,    82,    83,    84,    85,    -1,    87,    88,
-    89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
-    99,   100,   101,   102,    -1,   104,    -1,    -1,   107,   108,
-    -1,    -1,    -1,    -1,    -1,   114,    -1,   116,    -1,   118,
-   119,   120,   121,    -1,    -1,   124,   125,   126,   127,   128,
-    -1,   130,   131,   132,     3,    -1,    -1,     6,    -1,     8,
-    -1,    10,    11,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    20,    21,    22,    -1,    -1,    25,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    34,    -1,    -1,    -1,    -1,
-    -1,    40,    41,    42,    43,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    54,    55,    -1,    -1,    -1,
-    59,    -1,    -1,    -1,    -1,    64,    65,    66,    67,    68,
-    69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
-    79,    80,    81,    82,    83,    84,    85,    -1,    87,    88,
-    89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
-    99,   100,   101,   102,    -1,   104,    -1,    -1,   107,   108,
-    -1,    -1,    -1,    -1,    -1,   114,    -1,   116,    -1,   118,
-   119,   120,   121,    -1,    -1,   124,   125,   126,   127,   128,
-    -1,   130,   131,   132,     3,    -1,    -1,     6,    -1,     8,
-    -1,    10,    11,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    20,    21,    22,    -1,    -1,    25,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    34,    -1,    -1,    -1,    -1,
-    -1,    40,    41,    42,    43,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    54,    55,    -1,    -1,    -1,
-    59,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    67,    68,
-    69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
-    79,    80,    81,    82,    83,    84,    85,    -1,    87,    88,
-    89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
-    99,   100,   101,   102,    -1,   104,    -1,    -1,   107,   108,
-    -1,    -1,    -1,    -1,    -1,   114,    -1,   116,    -1,   118,
-   119,   120,   121,    -1,    -1,   124,   125,   126,   127,   128,
-    -1,   130,   131,   132,     3,    -1,    -1,     6,    -1,     8,
-    -1,    -1,    11,    12,    -1,    14,    -1,    -1,    -1,    -1,
-    -1,    20,    -1,    22,    -1,    -1,    -1,    26,    27,    -1,
-    -1,    -1,    -1,    -1,    -1,    34,    -1,    -1,    -1,    -1,
-    39,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    55,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    66,    67,    68,
-    69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
-    79,    80,    81,    82,    83,    84,    85,    -1,    87,    88,
-    89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
-    99,   100,   101,   102,     8,   104,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    20,   116,    -1,   118,
-   119,   120,   121,    -1,    -1,   124,   125,   126,   127,   128,
-    -1,   130,   131,   132,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    48,    -1,    50,    -1,    -1,    -1,
-    -1,    -1,    56,    -1,    -1,    -1,    -1,    -1,    62,    -1,
-    -1,    -1,    -1,    67,    68,    69,    70,    71,    72,    73,
-    74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
-    84,    85,    -1,    87,    88,    89,    90,    91,    92,    93,
-    94,    95,    96,    97,    98,    99,   100,   101,   102,    -1,
-   104,    -1,    -1,    -1,    -1,   109,    -1,     8,    -1,   113,
-    -1,   115,   116,   117,   118,   119,   120,   121,   122,    20,
-   124,   125,   126,   127,   128,    -1,   130,   131,   132,   133,
-   134,   135,   136,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    48,    -1,    50,
-    -1,    -1,    -1,    -1,    -1,    56,    -1,    -1,    -1,    -1,
-    -1,    62,    -1,    -1,    -1,    -1,    67,    68,    69,    70,
-    71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
-    81,    82,    83,    84,    85,    -1,    87,    88,    89,    90,
-    91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
-   101,   102,     8,   104,    -1,    -1,    -1,    -1,   109,    -1,
-    -1,    -1,   113,    -1,    20,   116,   117,   118,   119,   120,
-   121,   122,    -1,   124,   125,   126,   127,   128,    -1,   130,
-   131,   132,   133,   134,   135,   136,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    50,    -1,    -1,    -1,    -1,    -1,
-    56,    -1,    -1,    -1,    -1,    -1,    62,    -1,    -1,    -1,
-    -1,    67,    68,    69,    70,    71,    72,    73,    74,    75,
-    76,    77,    78,    79,    80,    81,    82,    83,    84,    85,
-    -1,    87,    88,    89,    90,    91,    92,    93,    94,    95,
-    96,    97,    98,    99,   100,   101,   102,    -1,   104,    -1,
-    -1,    -1,    -1,    -1,     8,    -1,    -1,   113,    -1,    -1,
-   116,   117,   118,   119,   120,   121,    20,    -1,   124,   125,
-   126,   127,   128,    -1,   130,   131,   132,   133,   134,   135,
-   136,    35,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    67,    68,    69,    70,    71,    72,    73,
-    74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
-    84,    85,    -1,    87,    88,    89,    90,    91,    92,    93,
-    94,    95,    96,    97,    98,    99,   100,   101,   102,     6,
-   104,     8,    -1,    10,    11,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,   116,    20,   118,   119,   120,   121,    25,    -1,
-   124,   125,   126,   127,   128,    -1,   130,   131,   132,    -1,
-   134,   135,   136,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    67,    68,    69,    70,    71,    72,    73,    74,    75,    76,
-    77,    78,    79,    80,    81,    82,    83,    84,    85,    -1,
-    87,    88,    89,    90,    91,    92,    93,    94,    95,    96,
-    97,    98,    99,   100,   101,   102,     6,   104,     8,    -1,
-    10,    11,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   116,
-    20,   118,   119,   120,   121,    -1,    -1,   124,   125,   126,
-   127,   128,   129,   130,   131,   132,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    67,    68,    69,
-    70,    71,    72,    73,    74,    75,    76,    77,    78,    79,
-    80,    81,    82,    83,    84,    85,    -1,    87,    88,    89,
-    90,    91,    92,    93,    94,    95,    96,    97,    98,    99,
-   100,   101,   102,     8,   104,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    20,   116,    -1,   118,   119,
-   120,   121,    -1,    -1,   124,   125,   126,   127,   128,   129,
-   130,   131,   132,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    64,
-    65,    -1,    67,    68,    69,    70,    71,    72,    73,    74,
-    75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
-    85,    -1,    87,    88,    89,    90,    91,    92,    93,    94,
-    95,    96,    97,    98,    99,   100,   101,   102,    -1,   104,
-     8,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,   116,    20,   118,   119,   120,   121,    -1,    -1,   124,
-   125,   126,   127,   128,    -1,   130,   131,   132,    -1,    37,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    67,
-    68,    69,    70,    71,    72,    73,    74,    75,    76,    77,
-    78,    79,    80,    81,    82,    83,    84,    85,    -1,    87,
-    88,    89,    90,    91,    92,    93,    94,    95,    96,    97,
-    98,    99,   100,   101,   102,    -1,   104,     8,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   116,    20,
-   118,   119,   120,   121,    -1,    -1,   124,   125,   126,   127,
-   128,   129,   130,   131,   132,    -1,    37,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    67,    68,    69,    70,
-    71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
-    81,    82,    83,    84,    85,    -1,    87,    88,    89,    90,
-    91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
-   101,   102,    -1,   104,     8,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,   116,    20,   118,   119,   120,
-   121,    -1,    -1,   124,   125,   126,   127,   128,   129,   130,
-   131,   132,    -1,    37,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    67,    68,    69,    70,    71,    72,    73,
-    74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
-    84,    85,    -1,    87,    88,    89,    90,    91,    92,    93,
-    94,    95,    96,    97,    98,    99,   100,   101,   102,    -1,
-   104,     8,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,   116,    20,   118,   119,   120,   121,    -1,    -1,
-   124,   125,   126,   127,   128,   129,   130,   131,   132,    -1,
-    37,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    67,    68,    69,    70,    71,    72,    73,    74,    75,    76,
-    77,    78,    79,    80,    81,    82,    83,    84,    85,    -1,
-    87,    88,    89,    90,    91,    92,    93,    94,    95,    96,
-    97,    98,    99,   100,   101,   102,     8,   104,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    20,   116,
-    -1,   118,   119,   120,   121,    -1,    -1,   124,   125,   126,
-   127,   128,   129,   130,   131,   132,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    67,    68,    69,    70,    71,
-    72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
-    82,    83,    84,    85,    -1,    87,    88,    89,    90,    91,
-    92,    93,    94,    95,    96,    97,    98,    99,   100,   101,
-   102,     8,   104,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    20,   116,    -1,   118,   119,   120,   121,
-    -1,    -1,   124,   125,   126,   127,   128,   129,   130,   131,
-   132,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    67,    68,    69,    70,    71,    72,    73,    74,    75,    76,
-    77,    78,    79,    80,    81,    82,    83,    84,    85,    -1,
-    87,    88,    89,    90,    91,    92,    93,    94,    95,    96,
-    97,    98,    99,   100,   101,   102,     8,   104,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    20,   116,
-    -1,   118,   119,   120,   121,    -1,   123,   124,   125,   126,
-   127,   128,    -1,   130,   131,   132,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    67,    68,    69,    70,    71,
-    72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
-    82,    83,    84,    85,    -1,    87,    88,    89,    90,    91,
-    92,    93,    94,    95,    96,    97,    98,    99,   100,   101,
-   102,    -1,   104,    -1,    -1,    -1,    -1,    -1,     8,    -1,
-    -1,    -1,    -1,    -1,   116,    -1,   118,   119,   120,   121,
-    20,    -1,   124,   125,   126,   127,   128,   129,   130,   131,
-   132,    -1,    -1,    -1,    -1,    35,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    67,    68,    69,
-    70,    71,    72,    73,    74,    75,    76,    77,    78,    79,
-    80,    81,    82,    83,    84,    85,    -1,    87,    88,    89,
-    90,    91,    92,    93,    94,    95,    96,    97,    98,    99,
-   100,   101,   102,    -1,   104,    -1,    -1,    -1,    -1,    -1,
-     8,    -1,    -1,    -1,    -1,    -1,   116,    -1,   118,   119,
-   120,   121,    20,    -1,   124,   125,   126,   127,   128,    -1,
-   130,   131,   132,    -1,    -1,    -1,    -1,    35,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    67,
-    68,    69,    70,    71,    72,    73,    74,    75,    76,    77,
-    78,    79,    80,    81,    82,    83,    84,    85,    -1,    87,
-    88,    89,    90,    91,    92,    93,    94,    95,    96,    97,
-    98,    99,   100,   101,   102,     8,   104,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    20,   116,    -1,
-   118,   119,   120,   121,    -1,    -1,   124,   125,   126,   127,
-   128,    -1,   130,   131,   132,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    66,    67,    68,    69,    70,    71,    72,
-    73,    74,    75,    76,    77,    78,    79,    80,    81,    82,
-    83,    84,    85,    -1,    87,    88,    89,    90,    91,    92,
-    93,    94,    95,    96,    97,    98,    99,   100,   101,   102,
-     8,   104,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    20,   116,    -1,   118,   119,   120,   121,    -1,
-    -1,   124,   125,   126,   127,   128,    -1,   130,   131,   132,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    67,
-    68,    69,    70,    71,    72,    73,    74,    75,    76,    77,
-    78,    79,    80,    81,    82,    83,    84,    85,    -1,    87,
-    88,    89,    90,    91,    92,    93,    94,    95,    96,    97,
-    98,    99,   100,   101,   102,    -1,   104,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   116,    -1,
-   118,   119,   120,   121,    -1,    -1,   124,   125,   126,   127,
-   128,    -1,   130,   131,   132,     3,    -1,    -1,     6,    -1,
-    -1,    -1,    10,    11,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    20,    21,    22,    23,    -1,    25,    -1,    -1,
-    -1,     3,    -1,    -1,     6,    -1,    34,    35,    10,    11,
-    -1,    -1,    40,    41,    42,    43,    -1,    -1,    20,    21,
-    22,    -1,    -1,    25,    -1,    -1,    54,    55,    -1,    -1,
-    -1,    59,    34,    -1,    36,    -1,    -1,    -1,    40,    41,
-    42,    43,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,     3,    54,    55,     6,    -1,    -1,    59,    10,    11,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    20,    21,
-    22,    -1,    -1,    25,    -1,    -1,    -1,    -1,    -1,   107,
-   108,    -1,    34,    -1,    36,    -1,   114,    -1,    40,    41,
-    42,    43,     3,    -1,    -1,     6,    -1,    -1,    -1,    10,
-    11,    -1,    54,    55,    -1,   107,   108,    59,    -1,    20,
-    21,    22,   114,    -1,    25,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    34,    -1,    36,    -1,    -1,    -1,    40,
-    41,    42,    43,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,     3,    54,    55,     6,    -1,    -1,    59,    10,
-    11,    -1,    -1,    -1,    -1,   107,   108,    -1,    -1,    20,
-    21,    22,   114,    -1,    25,    -1,    -1,    -1,     3,    -1,
-    -1,     6,    -1,    34,    -1,    10,    11,    -1,    -1,    40,
-    41,    42,    43,    -1,    -1,    20,    -1,    22,    -1,    -1,
-    25,    -1,    -1,    54,    55,    -1,   107,   108,    59,    34,
-    -1,    -1,    -1,   114,    -1,    40,    41,    42,    43,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    54,
-    -1,    -1,    -1,    -1,    59,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,   107,   108,    -1,    -1,
-    -1,    -1,    -1,   114,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,   107,   108,    -1,    -1,    -1,    -1,    -1,   114
-};
-/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
-#line 3 "/usr/lib/bison.simple"
-/* This file comes from bison-1.28.  */
-
-/* Skeleton output parser for bison,
-   Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
-
-/* This is the parser code that is written into each bison parser
-  when the %semantic_parser declaration is not specified in the grammar.
-  It was written by Richard Stallman by simplifying the hairy parser
-  used when %semantic_parser is specified.  */
-
-#ifndef YYSTACK_USE_ALLOCA
-#ifdef alloca
-#define YYSTACK_USE_ALLOCA
-#else /* alloca not defined */
-#ifdef __GNUC__
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#else /* not GNU C.  */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
-#define YYSTACK_USE_ALLOCA
-#include 
-#else /* not sparc */
-/* We think this test detects Watcom and Microsoft C.  */
-/* This used to test MSDOS, but that is a bad idea
-   since that symbol is in the user namespace.  */
-#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
-#if 0 /* No need for malloc.h, which pollutes the namespace;
-	 instead, just don't use alloca.  */
-#include 
-#endif
-#else /* not MSDOS, or __TURBOC__ */
-#if defined(_AIX)
-/* I don't know what this was needed for, but it pollutes the namespace.
-   So I turned it off.   rms, 2 May 1997.  */
-/* #include   */
- #pragma alloca
-#define YYSTACK_USE_ALLOCA
-#else /* not MSDOS, or __TURBOC__, or _AIX */
-#if 0
-#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
-		 and on HPUX 10.  Eventually we can turn this on.  */
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#endif /* __hpux */
-#endif
-#endif /* not _AIX */
-#endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc */
-#endif /* not GNU C */
-#endif /* alloca not defined */
-#endif /* YYSTACK_USE_ALLOCA not defined */
-
-#ifdef YYSTACK_USE_ALLOCA
-#define YYSTACK_ALLOC alloca
-#else
-#define YYSTACK_ALLOC malloc
-#endif
-
-/* Note: there must be only one dollar sign in this file.
-   It is replaced by the list of actions, each action
-   as one case of the switch.  */
-
-#define yyerrok		(yyerrstatus = 0)
-#define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		-2
-#define YYEOF		0
-#define YYACCEPT	goto yyacceptlab
-#define YYABORT 	goto yyabortlab
-#define YYERROR		goto yyerrlab1
-/* Like YYERROR except do call yyerror.
-   This remains here temporarily to ease the
-   transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
-#define YYFAIL		goto yyerrlab
-#define YYRECOVERING()  (!!yyerrstatus)
-#define YYBACKUP(token, value) \
-do								\
-  if (yychar == YYEMPTY && yylen == 1)				\
-    { yychar = (token), yylval = (value);			\
-      yychar1 = YYTRANSLATE (yychar);				\
-      YYPOPSTACK;						\
-      goto yybackup;						\
-    }								\
-  else								\
-    { yyerror ("syntax error: cannot back up"); YYERROR; }	\
-while (0)
-
-#define YYTERROR	1
-#define YYERRCODE	256
-
-#ifndef YYPURE
-#define YYLEX		yylex()
-#endif
-
-#ifdef YYPURE
-#ifdef YYLSP_NEEDED
-#ifdef YYLEX_PARAM
-#define YYLEX		yylex(&yylval, &yylloc, YYLEX_PARAM)
-#else
-#define YYLEX		yylex(&yylval, &yylloc)
-#endif
-#else /* not YYLSP_NEEDED */
-#ifdef YYLEX_PARAM
-#define YYLEX		yylex(&yylval, YYLEX_PARAM)
-#else
-#define YYLEX		yylex(&yylval)
-#endif
-#endif /* not YYLSP_NEEDED */
-#endif
-
-/* If nonreentrant, generate the variables here */
-
-#ifndef YYPURE
-
-int	yychar;			/*  the lookahead symbol		*/
-YYSTYPE	yylval;			/*  the semantic value of the		*/
-				/*  lookahead symbol			*/
-
-#ifdef YYLSP_NEEDED
-YYLTYPE yylloc;			/*  location data for the lookahead	*/
-				/*  symbol				*/
-#endif
-
-int yynerrs;			/*  number of parse errors so far       */
-#endif  /* not YYPURE */
-
-#if YYDEBUG != 0
-int yydebug;			/*  nonzero means print parse trace	*/
-/* Since this is uninitialized, it does not stop multiple parsers
-   from coexisting.  */
-#endif
-
-/*  YYINITDEPTH indicates the initial size of the parser's stacks	*/
-
-#ifndef	YYINITDEPTH
-#define YYINITDEPTH 200
-#endif
-
-/*  YYMAXDEPTH is the maximum size the stacks can grow to
-    (effective only if the built-in stack extension method is used).  */
-
-#if YYMAXDEPTH == 0
-#undef YYMAXDEPTH
-#endif
-
-#ifndef YYMAXDEPTH
-#define YYMAXDEPTH 10000
-#endif
-
-/* Define __yy_memcpy.  Note that the size argument
-   should be passed with type unsigned int, because that is what the non-GCC
-   definitions require.  With GCC, __builtin_memcpy takes an arg
-   of type size_t, but it can handle unsigned int.  */
-
-#if __GNUC__ > 1		/* GNU C and GNU C++ define this.  */
-#define __yy_memcpy(TO,FROM,COUNT)	__builtin_memcpy(TO,FROM,COUNT)
-#else				/* not GNU C or C++ */
-#ifndef __cplusplus
-
-/* This is the most reliable way to avoid incompatibilities
-   in available built-in functions on various systems.  */
-static void
-__yy_memcpy (to, from, count)
-     char *to;
-     char *from;
-     unsigned int count;
-{
-  register char *f = from;
-  register char *t = to;
-  register int i = count;
-
-  while (i-- > 0)
-    *t++ = *f++;
-}
-
-#else /* __cplusplus */
-
-/* This is the most reliable way to avoid incompatibilities
-   in available built-in functions on various systems.  */
-static void
-__yy_memcpy (char *to, char *from, unsigned int count)
-{
-  register char *t = to;
-  register char *f = from;
-  register int i = count;
-
-  while (i-- > 0)
-    *t++ = *f++;
-}
-
-#endif
-#endif
-
-#line 217 "/usr/lib/bison.simple"
-
-/* The user can define YYPARSE_PARAM as the name of an argument to be passed
-   into yyparse.  The argument should have type void *.
-   It should actually point to an object.
-   Grammar actions can access the variable by casting it
-   to the proper pointer type.  */
-
-#ifdef YYPARSE_PARAM
-#ifdef __cplusplus
-#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL
-#else /* not __cplusplus */
-#define YYPARSE_PARAM_ARG YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
-#endif /* not __cplusplus */
-#else /* not YYPARSE_PARAM */
-#define YYPARSE_PARAM_ARG
-#define YYPARSE_PARAM_DECL
-#endif /* not YYPARSE_PARAM */
-
-/* Prevent warning if -Wstrict-prototypes.  */
-#ifdef __GNUC__
-#ifdef YYPARSE_PARAM
-int yyparse (void *);
-#else
-int yyparse (void);
-#endif
-#endif
-
-int
-yyparse(YYPARSE_PARAM_ARG)
-     YYPARSE_PARAM_DECL
-{
-  register int yystate;
-  register int yyn;
-  register short *yyssp;
-  register YYSTYPE *yyvsp;
-  int yyerrstatus;	/*  number of tokens to shift before error messages enabled */
-  int yychar1 = 0;		/*  lookahead token as an internal (translated) token number */
-
-  short	yyssa[YYINITDEPTH];	/*  the state stack			*/
-  YYSTYPE yyvsa[YYINITDEPTH];	/*  the semantic value stack		*/
-
-  short *yyss = yyssa;		/*  refer to the stacks thru separate pointers */
-  YYSTYPE *yyvs = yyvsa;	/*  to allow yyoverflow to reallocate them elsewhere */
-
-#ifdef YYLSP_NEEDED
-  YYLTYPE yylsa[YYINITDEPTH];	/*  the location stack			*/
-  YYLTYPE *yyls = yylsa;
-  YYLTYPE *yylsp;
-
-#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
-#else
-#define YYPOPSTACK   (yyvsp--, yyssp--)
-#endif
-
-  int yystacksize = YYINITDEPTH;
-  int yyfree_stacks = 0;
-
-#ifdef YYPURE
-  int yychar;
-  YYSTYPE yylval;
-  int yynerrs;
-#ifdef YYLSP_NEEDED
-  YYLTYPE yylloc;
-#endif
-#endif
-
-  YYSTYPE yyval;		/*  the variable used to return		*/
-				/*  semantic values from the action	*/
-				/*  routines				*/
-
-  int yylen;
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Starting parse\n");
-#endif
-
-  yystate = 0;
-  yyerrstatus = 0;
-  yynerrs = 0;
-  yychar = YYEMPTY;		/* Cause a token to be read.  */
-
-  /* Initialize stack pointers.
-     Waste one element of value and location stack
-     so that they stay on the same level as the state stack.
-     The wasted elements are never initialized.  */
-
-  yyssp = yyss - 1;
-  yyvsp = yyvs;
-#ifdef YYLSP_NEEDED
-  yylsp = yyls;
-#endif
-
-/* Push a new state, which is found in  yystate  .  */
-/* In all cases, when you get here, the value and location stacks
-   have just been pushed. so pushing a state here evens the stacks.  */
-yynewstate:
-
-  *++yyssp = yystate;
-
-  if (yyssp >= yyss + yystacksize - 1)
-    {
-      /* Give user a chance to reallocate the stack */
-      /* Use copies of these so that the &'s don't force the real ones into memory. */
-      YYSTYPE *yyvs1 = yyvs;
-      short *yyss1 = yyss;
-#ifdef YYLSP_NEEDED
-      YYLTYPE *yyls1 = yyls;
-#endif
-
-      /* Get the current used size of the three stacks, in elements.  */
-      int size = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-      /* Each stack pointer address is followed by the size of
-	 the data in use in that stack, in bytes.  */
-#ifdef YYLSP_NEEDED
-      /* This used to be a conditional around just the two extra args,
-	 but that might be undefined if yyoverflow is a macro.  */
-      yyoverflow("parser stack overflow",
-		 &yyss1, size * sizeof (*yyssp),
-		 &yyvs1, size * sizeof (*yyvsp),
-		 &yyls1, size * sizeof (*yylsp),
-		 &yystacksize);
-#else
-      yyoverflow("parser stack overflow",
-		 &yyss1, size * sizeof (*yyssp),
-		 &yyvs1, size * sizeof (*yyvsp),
-		 &yystacksize);
-#endif
-
-      yyss = yyss1; yyvs = yyvs1;
-#ifdef YYLSP_NEEDED
-      yyls = yyls1;
-#endif
-#else /* no yyoverflow */
-      /* Extend the stack our own way.  */
-      if (yystacksize >= YYMAXDEPTH)
-	{
-	  yyerror("parser stack overflow");
-	  if (yyfree_stacks)
-	    {
-	      free (yyss);
-	      free (yyvs);
-#ifdef YYLSP_NEEDED
-	      free (yyls);
-#endif
-	    }
-	  return 2;
-	}
-      yystacksize *= 2;
-      if (yystacksize > YYMAXDEPTH)
-	yystacksize = YYMAXDEPTH;
-#ifndef YYSTACK_USE_ALLOCA
-      yyfree_stacks = 1;
-#endif
-      yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
-      __yy_memcpy ((char *)yyss, (char *)yyss1,
-		   size * (unsigned int) sizeof (*yyssp));
-      yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
-      __yy_memcpy ((char *)yyvs, (char *)yyvs1,
-		   size * (unsigned int) sizeof (*yyvsp));
-#ifdef YYLSP_NEEDED
-      yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
-      __yy_memcpy ((char *)yyls, (char *)yyls1,
-		   size * (unsigned int) sizeof (*yylsp));
-#endif
-#endif /* no yyoverflow */
-
-      yyssp = yyss + size - 1;
-      yyvsp = yyvs + size - 1;
-#ifdef YYLSP_NEEDED
-      yylsp = yyls + size - 1;
-#endif
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Stack size increased to %d\n", yystacksize);
-#endif
-
-      if (yyssp >= yyss + yystacksize - 1)
-	YYABORT;
-    }
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Entering state %d\n", yystate);
-#endif
-
-  goto yybackup;
- yybackup:
-
-/* Do appropriate processing given the current state.  */
-/* Read a lookahead token if we need one and don't already have one.  */
-/* yyresume: */
-
-  /* First try to decide what to do without reference to lookahead token.  */
-
-  yyn = yypact[yystate];
-  if (yyn == YYFLAG)
-    goto yydefault;
-
-  /* Not known => get a lookahead token if don't already have one.  */
-
-  /* yychar is either YYEMPTY or YYEOF
-     or a valid token in external form.  */
-
-  if (yychar == YYEMPTY)
-    {
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Reading a token: ");
-#endif
-      yychar = YYLEX;
-    }
-
-  /* Convert token to internal form (in yychar1) for indexing tables with */
-
-  if (yychar <= 0)		/* This means end of input. */
-    {
-      yychar1 = 0;
-      yychar = YYEOF;		/* Don't call YYLEX any more */
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Now at end of input.\n");
-#endif
-    }
-  else
-    {
-      yychar1 = YYTRANSLATE(yychar);
-
-#if YYDEBUG != 0
-      if (yydebug)
-	{
-	  fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
-	  /* Give the individual parser a way to print the precise meaning
-	     of a token, for further debugging info.  */
-#ifdef YYPRINT
-	  YYPRINT (stderr, yychar, yylval);
-#endif
-	  fprintf (stderr, ")\n");
-	}
-#endif
-    }
-
-  yyn += yychar1;
-  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
-    goto yydefault;
-
-  yyn = yytable[yyn];
-
-  /* yyn is what to do for this token type in this state.
-     Negative => reduce, -yyn is rule number.
-     Positive => shift, yyn is new state.
-       New state is final state => don't bother to shift,
-       just return success.
-     0, or most negative number => error.  */
-
-  if (yyn < 0)
-    {
-      if (yyn == YYFLAG)
-	goto yyerrlab;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-  else if (yyn == 0)
-    goto yyerrlab;
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-  /* Shift the lookahead token.  */
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
-#endif
-
-  /* Discard the token being shifted unless it is eof.  */
-  if (yychar != YYEOF)
-    yychar = YYEMPTY;
-
-  *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
-  *++yylsp = yylloc;
-#endif
-
-  /* count tokens shifted since error; after three, turn off error status.  */
-  if (yyerrstatus) yyerrstatus--;
-
-  yystate = yyn;
-  goto yynewstate;
-
-/* Do the default action for the current state.  */
-yydefault:
-
-  yyn = yydefact[yystate];
-  if (yyn == 0)
-    goto yyerrlab;
-
-/* Do a reduction.  yyn is the number of a rule to reduce with.  */
-yyreduce:
-  yylen = yyr2[yyn];
-  if (yylen > 0)
-    yyval = yyvsp[1-yylen]; /* implement default value of the action */
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      int i;
-
-      fprintf (stderr, "Reducing via rule %d (line %d), ",
-	       yyn, yyrline[yyn]);
-
-      /* Print the symbols being reduced, and their result.  */
-      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
-	fprintf (stderr, "%s ", yytname[yyrhs[i]]);
-      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
-    }
-#endif
-
-
-  switch (yyn) {
-
-case 1:
-#line 383 "llgrammar.y"
-{ lhExternals (yyvsp[0].interfacelist); ;
-    break;}
-case 2:
-#line 384 "llgrammar.y"
-{ interfaceNodeList_free (yyvsp[-2].interfacelist); interfaceNodeList_free (yyvsp[0].interfacelist); ;
-    break;}
-case 3:
-#line 387 "llgrammar.y"
-{ yyval.interfacelist = interfaceNodeList_new (); ;
-    break;}
-case 4:
-#line 388 "llgrammar.y"
-{ yyval.interfacelist = interfaceNodeList_addh (yyvsp[-1].interfacelist, yyvsp[0].iface);;
-    break;}
-case 7:
-#line 395 "llgrammar.y"
-{ yyval.interfacelist = interfaceNodeList_new (); ;
-    break;}
-case 8:
-#line 396 "llgrammar.y"
-{ yyval.interfacelist = consInterfaceNode (yyvsp[-1].iface, yyvsp[0].interfacelist);;
-    break;}
-case 9:
-#line 397 "llgrammar.y"
-{ yyval.interfacelist = consInterfaceNode (yyvsp[-1].iface, yyvsp[0].interfacelist);;
-    break;}
-case 10:
-#line 400 "llgrammar.y"
-{ yyval.interfacelist = interfaceNodeList_new (); ;
-    break;}
-case 11:
-#line 401 "llgrammar.y"
-{ yyval.interfacelist = interfaceNodeList_addh (yyvsp[-1].interfacelist, yyvsp[0].iface);;
-    break;}
-case 15:
-#line 410 "llgrammar.y"
-{ yyval.iface = makeInterfaceNodeImports (yyvsp[-1].importlist);
-     /* assume subspecs are already processed, symbol table info in external file */
-   ;
-    break;}
-case 16:
-#line 416 "llgrammar.y"
-{ yyval.iface = makeInterfaceNodeUses (yyvsp[-1].traitreflist); readlsignatures (yyval.iface);;
-    break;}
-case 17:
-#line 420 "llgrammar.y"
-{ declareConstant (yyvsp[0].constdeclaration); yyval.iface = interfaceNode_makeConst (yyvsp[0].constdeclaration); ;
-    break;}
-case 18:
-#line 422 "llgrammar.y"
-{ declareVar (yyvsp[0].vardeclaration); yyval.iface = interfaceNode_makeVar (yyvsp[0].vardeclaration); ;
-    break;}
-case 19:
-#line 424 "llgrammar.y"
-{ declareType (yyvsp[0].type); yyval.iface = interfaceNode_makeType (yyvsp[0].type); ;
-    break;}
-case 20:
-#line 426 "llgrammar.y"
-{ declareFcn (yyvsp[0].fcn, typeId_invalid); yyval.iface = interfaceNode_makeFcn (yyvsp[0].fcn); ;
-    break;}
-case 21:
-#line 428 "llgrammar.y"
-{ yyval.iface = interfaceNode_makeClaim (yyvsp[0].claim); ;
-    break;}
-case 22:
-#line 430 "llgrammar.y"
-{ declareIter (yyvsp[0].iter); yyval.iface = interfaceNode_makeIter (yyvsp[0].iter); ;
-    break;}
-case 23:
-#line 434 "llgrammar.y"
-{ yyval.iter = makeIterNode (yyvsp[-4].ltok, yyvsp[-2].paramlist); ;
-    break;}
-case 24:
-#line 437 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_new (); ;
-    break;}
-case 25:
-#line 438 "llgrammar.y"
-{ yyval.paramlist = yyvsp[0].paramlist; ;
-    break;}
-case 26:
-#line 442 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_add (paramNodeList_new (), yyvsp[0].param); ;
-    break;}
-case 27:
-#line 444 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_add (yyvsp[-2].paramlist,yyvsp[0].param); ;
-    break;}
-case 28:
-#line 447 "llgrammar.y"
-{ yyval.param = markYieldParamNode (yyvsp[0].param); ;
-    break;}
-case 29:
-#line 448 "llgrammar.y"
-{ yyval.param = yyvsp[0].param; ;
-    break;}
-case 30:
-#line 451 "llgrammar.y"
-{ symtable_export (g_symtab, FALSE); ;
-    break;}
-case 31:
-#line 452 "llgrammar.y"
-{ yyval.iface = yyvsp[0].iface; symtable_export (g_symtab, TRUE); ;
-    break;}
-case 32:
-#line 456 "llgrammar.y"
-{ declarePrivConstant (yyvsp[0].constdeclaration); yyval.iface =  interfaceNode_makePrivConst (yyvsp[0].constdeclaration); ;
-    break;}
-case 33:
-#line 458 "llgrammar.y"
-{ declarePrivVar (yyvsp[0].vardeclaration); yyval.iface = interfaceNode_makePrivVar (yyvsp[0].vardeclaration); ;
-    break;}
-case 34:
-#line 460 "llgrammar.y"
-{ declarePrivType (yyvsp[0].type); yyval.iface = interfaceNode_makePrivType (yyvsp[0].type); ;
-    break;}
-case 35:
-#line 462 "llgrammar.y"
-{ declarePrivFcn (yyvsp[0].fcn, typeId_invalid); yyval.iface = interfaceNode_makePrivFcn (yyvsp[0].fcn); ;
-    break;}
-case 36:
-#line 466 "llgrammar.y"
-{ yyval.constdeclaration = makeConstDeclarationNode (yyvsp[-2].lcltypespec, yyvsp[-1].initdecls); ;
-    break;}
-case 37:
-#line 470 "llgrammar.y"
-{ yyval.vardeclaration = makeVarDeclarationNode (yyvsp[-2].lcltypespec, yyvsp[-1].initdecls, FALSE, FALSE); yyval.vardeclaration->qualifier = QLF_NONE; ;
-    break;}
-case 38:
-#line 472 "llgrammar.y"
-{ yyval.vardeclaration = makeVarDeclarationNode (yyvsp[-2].lcltypespec, yyvsp[-1].initdecls, FALSE, FALSE); yyval.vardeclaration->qualifier = QLF_CONST; ;
-    break;}
-case 39:
-#line 474 "llgrammar.y"
-{ yyval.vardeclaration = makeVarDeclarationNode (yyvsp[-2].lcltypespec, yyvsp[-1].initdecls, FALSE, FALSE); yyval.vardeclaration->qualifier = QLF_VOLATILE; ;
-    break;}
-case 40:
-#line 477 "llgrammar.y"
-{ yyval.type = makeAbstractTypeNode (yyvsp[0].abstract); ;
-    break;}
-case 41:
-#line 478 "llgrammar.y"
-{ yyval.type = makeExposedTypeNode (yyvsp[0].exposed); ;
-    break;}
-case 42:
-#line 481 "llgrammar.y"
-{ yyval.typequal = qual_createPrintfLike (); ;
-    break;}
-case 43:
-#line 482 "llgrammar.y"
-{ yyval.typequal = qual_createScanfLike (); ;
-    break;}
-case 44:
-#line 483 "llgrammar.y"
-{ yyval.typequal = qual_createMessageLike (); ;
-    break;}
-case 45:
-#line 486 "llgrammar.y"
-{ enteringFcnScope (yyvsp[-2].lcltypespec, yyvsp[-1].declare, yyvsp[0].globals); ;
-    break;}
-case 46:
-#line 488 "llgrammar.y"
-{ yyval.fcn = makeFcnNode (qual_createUnknown (), yyvsp[-12].lcltypespec, yyvsp[-11].declare, yyvsp[-10].globals, yyvsp[-7].vardeclarationlist, yyvsp[-6].letdecls, 
-		       yyvsp[-5].lclpredicate, yyvsp[-4].lclpredicate, yyvsp[-3].modify, yyvsp[-2].lclpredicate, yyvsp[-1].lclpredicate); 
-     /* type, declarator, glovbls, privateinits,
-	lets, checks, requires, modifies, ensures, claims */
-     symtable_exitScope (g_symtab);
-   ;
-    break;}
-case 47:
-#line 494 "llgrammar.y"
-{ enteringFcnScope (yyvsp[-2].lcltypespec, yyvsp[-1].declare, yyvsp[0].globals); ;
-    break;}
-case 48:
-#line 498 "llgrammar.y"
-{ yyval.fcn = makeFcnNode (yyvsp[-13].typequal, yyvsp[-12].lcltypespec, yyvsp[-11].declare, yyvsp[-10].globals, yyvsp[-7].vardeclarationlist, 
-		       yyvsp[-6].letdecls, yyvsp[-5].lclpredicate, yyvsp[-4].lclpredicate, yyvsp[-3].modify, yyvsp[-2].lclpredicate, yyvsp[-1].lclpredicate); 
-     /* type, declarator, glovbls, privateinits,
-	lets, checks, requires, modifies, ensures, claims */
-     symtable_exitScope (g_symtab);
-   ;
-    break;}
-case 49:
-#line 508 "llgrammar.y"
-{ enteringClaimScope (yyvsp[-2].paramlist, yyvsp[0].globals); ;
-    break;}
-case 50:
-#line 510 "llgrammar.y"
-{      yyval.claim = makeClaimNode (yyvsp[-11].ltok, yyvsp[-9].paramlist, yyvsp[-7].globals, yyvsp[-4].letdecls, yyvsp[-3].lclpredicate, yyvsp[-2].program, yyvsp[-1].lclpredicate); 
-     symtable_exitScope (g_symtab); ;
-    break;}
-case 51:
-#line 513 "llgrammar.y"
-{ yyval.claim = (claimNode) 0; ;
-    break;}
-case 52:
-#line 516 "llgrammar.y"
-{g_inTypeDef = TRUE; ;
-    break;}
-case 53:
-#line 516 "llgrammar.y"
-{g_inTypeDef = FALSE; ;
-    break;}
-case 54:
-#line 517 "llgrammar.y"
-{ yyval.abstract = makeAbstractNode (yyvsp[-5].ltok, yyvsp[-2].ltok, TRUE, FALSE, yyvsp[0].abstbody); ;
-    break;}
-case 55:
-#line 518 "llgrammar.y"
-{g_inTypeDef = TRUE; ;
-    break;}
-case 56:
-#line 519 "llgrammar.y"
-{g_inTypeDef = FALSE; ;
-    break;}
-case 57:
-#line 520 "llgrammar.y"
-{ yyval.abstract = makeAbstractNode (yyvsp[-6].ltok, yyvsp[-2].ltok, TRUE, TRUE, yyvsp[0].abstbody); ;
-    break;}
-case 58:
-#line 521 "llgrammar.y"
-{g_inTypeDef = TRUE; ;
-    break;}
-case 59:
-#line 522 "llgrammar.y"
-{g_inTypeDef = FALSE; ;
-    break;}
-case 60:
-#line 523 "llgrammar.y"
-{ yyval.abstract = makeAbstractNode (yyvsp[-5].ltok, yyvsp[-2].ltok, TRUE, TRUE, yyvsp[0].abstbody); ;
-    break;}
-case 61:
-#line 524 "llgrammar.y"
-{g_inTypeDef = TRUE; ;
-    break;}
-case 62:
-#line 524 "llgrammar.y"
-{g_inTypeDef = FALSE; ;
-    break;}
-case 63:
-#line 525 "llgrammar.y"
-{ yyval.abstract = makeAbstractNode (yyvsp[-5].ltok, yyvsp[-2].ltok, FALSE, FALSE, yyvsp[0].abstbody); ;
-    break;}
-case 64:
-#line 528 "llgrammar.y"
-{ g_inTypeDef = TRUE; setExposedType (yyvsp[0].lcltypespec); ;
-    break;}
-case 65:
-#line 529 "llgrammar.y"
-{ g_inTypeDef = FALSE; ;
-    break;}
-case 66:
-#line 530 "llgrammar.y"
-{ yyval.exposed = makeExposedNode (yyvsp[-5].ltok, yyvsp[-4].lcltypespec, yyvsp[-2].declaratorinvs); /* to support mutually recursive types */ ;
-    break;}
-case 67:
-#line 532 "llgrammar.y"
-{ yyval.exposed = makeExposedNode (yyvsp[0].ltok, makeLclTypeSpecNodeSU (yyvsp[-1].structorunion), declaratorInvNodeList_new ()); ;
-    break;}
-case 68:
-#line 534 "llgrammar.y"
-{ yyval.exposed = makeExposedNode (yyvsp[0].ltok, makeLclTypeSpecNodeEnum (yyvsp[-1].enumspec), declaratorInvNodeList_new ()); ;
-    break;}
-case 69:
-#line 550 "llgrammar.y"
-{ yyval.importlist = importNodeList_add (importNodeList_new (), yyvsp[0].import); ;
-    break;}
-case 70:
-#line 552 "llgrammar.y"
-{ yyval.importlist = importNodeList_add (yyvsp[-2].importlist, yyvsp[0].import); ;
-    break;}
-case 71:
-#line 555 "llgrammar.y"
-{ yyval.import = importNode_makePlain (yyvsp[0].ltok); ;
-    break;}
-case 72:
-#line 557 "llgrammar.y"
-{ checkBrackets (yyvsp[-2].ltok, yyvsp[0].ltok); yyval.import = importNode_makeBracketed (yyvsp[-1].ltok); ;
-    break;}
-case 73:
-#line 558 "llgrammar.y"
-{ yyval.import = importNode_makeQuoted (yyvsp[0].ltok); ;
-    break;}
-case 74:
-#line 561 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
-    break;}
-case 75:
-#line 562 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 77:
-#line 570 "llgrammar.y"
-{ yyval.traitreflist = traitRefNodeList_add (traitRefNodeList_new (), yyvsp[0].traitref); ;
-    break;}
-case 78:
-#line 572 "llgrammar.y"
-{ yyval.traitreflist = traitRefNodeList_add (yyvsp[-2].traitreflist, yyvsp[0].traitref); ;
-    break;}
-case 79:
-#line 576 "llgrammar.y"
-{ yyval.traitref = makeTraitRefNode (ltokenList_singleton (yyvsp[0].ltok), (renamingNode)0); ;
-    break;}
-case 80:
-#line 578 "llgrammar.y"
-{ yyval.traitref = makeTraitRefNode (ltokenList_singleton (yyvsp[-3].ltok), yyvsp[-1].renaming); ;
-    break;}
-case 81:
-#line 580 "llgrammar.y"
-{ yyval.traitref = makeTraitRefNode (yyvsp[-1].ltokenList, (renamingNode)0); ;
-    break;}
-case 82:
-#line 582 "llgrammar.y"
-{ yyval.traitref = makeTraitRefNode (yyvsp[-4].ltokenList, yyvsp[-1].renaming); ;
-    break;}
-case 83:
-#line 585 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
-    break;}
-case 84:
-#line 586 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 85:
-#line 590 "llgrammar.y"
-{ yyval.renaming = makeRenamingNode (typeNameNodeList_new (), yyvsp[0].replacelist); ;
-    break;}
-case 86:
-#line 592 "llgrammar.y"
-{ yyval.renaming = makeRenamingNode (yyvsp[0].namelist, replaceNodeList_new ()); ;
-    break;}
-case 87:
-#line 593 "llgrammar.y"
-{ yyval.renaming = makeRenamingNode (yyvsp[-2].namelist, yyvsp[0].replacelist); ;
-    break;}
-case 88:
-#line 597 "llgrammar.y"
-{ yyval.namelist = typeNameNodeList_add (typeNameNodeList_new (), yyvsp[0].typname); ;
-    break;}
-case 89:
-#line 598 "llgrammar.y"
-{ yyval.namelist = typeNameNodeList_add (yyvsp[-2].namelist, yyvsp[0].typname); ;
-    break;}
-case 90:
-#line 602 "llgrammar.y"
-{ yyval.replacelist = replaceNodeList_add (replaceNodeList_new (), yyvsp[0].replace); ;
-    break;}
-case 91:
-#line 603 "llgrammar.y"
-{ yyval.replacelist = replaceNodeList_add (yyvsp[-2].replacelist, yyvsp[0].replace); ;
-    break;}
-case 92:
-#line 606 "llgrammar.y"
-{ yyval.replace = makeReplaceNode (yyvsp[-1].ltok, yyvsp[-2].typname, TRUE, yyvsp[0].ltok, NULL, NULL); ;
-    break;}
-case 93:
-#line 607 "llgrammar.y"
-{ yyval.replace = makeReplaceNameNode (yyvsp[-1].ltok, yyvsp[-2].typname, yyvsp[0].name); ;
-    break;}
-case 94:
-#line 608 "llgrammar.y"
-{ yyval.replace = makeReplaceNode (yyvsp[-2].ltok, yyvsp[-3].typname, FALSE, ltoken_undefined,
-							 yyvsp[-1].name, yyvsp[0].signature); ;
-    break;}
-case 95:
-#line 612 "llgrammar.y"
-{ yyval.name = makeNameNodeId (yyvsp[0].ltok); ;
-    break;}
-case 96:
-#line 613 "llgrammar.y"
-{ yyval.name = makeNameNodeForm (yyvsp[0].opform); ;
-    break;}
-case 99:
-#line 621 "llgrammar.y"
-{ yyval.initdecls = initDeclNodeList_add (initDeclNodeList_new (), yyvsp[0].initdecl); ;
-    break;}
-case 100:
-#line 623 "llgrammar.y"
-{ yyval.initdecls = initDeclNodeList_add (yyvsp[-2].initdecls, yyvsp[0].initdecl); ;
-    break;}
-case 101:
-#line 626 "llgrammar.y"
-{ yyval.initdecl = makeInitDeclNode (yyvsp[0].declare, (termNode)0); ;
-    break;}
-case 102:
-#line 627 "llgrammar.y"
-{ yyval.initdecl = makeInitDeclNode (yyvsp[-2].declare, yyvsp[0].term); ;
-    break;}
-case 103:
-#line 631 "llgrammar.y"
-{ yyval.globals = varDeclarationNodeList_new (); ;
-    break;}
-case 104:
-#line 633 "llgrammar.y"
-{ varDeclarationNodeList_addh (yyvsp[-1].globals, yyvsp[0].vardeclaration); yyval.globals = yyvsp[-1].globals; ;
-    break;}
-case 105:
-#line 636 "llgrammar.y"
-{ yyval.vardeclaration = makeVarDeclarationNode (yyvsp[-2].lcltypespec, yyvsp[-1].initdecls, TRUE, FALSE); ;
-    break;}
-case 106:
-#line 637 "llgrammar.y"
-{ yyval.vardeclaration = makeInternalStateNode (); ;
-    break;}
-case 107:
-#line 638 "llgrammar.y"
-{ yyval.vardeclaration = makeFileSystemNode (); ;
-    break;}
-case 108:
-#line 641 "llgrammar.y"
-{ yyval.vardeclarationlist = varDeclarationNodeList_new (); ;
-    break;}
-case 109:
-#line 642 "llgrammar.y"
-{ varDeclarationNodeList_addh (yyvsp[-1].vardeclarationlist, yyvsp[0].vardeclaration); yyval.vardeclarationlist = yyvsp[-1].vardeclarationlist; ;
-    break;}
-case 110:
-#line 646 "llgrammar.y"
-{ yyval.vardeclaration = makeVarDeclarationNode (yyvsp[-2].lcltypespec, yyvsp[-1].initdecls, FALSE, TRUE); ;
-    break;}
-case 111:
-#line 649 "llgrammar.y"
-{ yyval.letdecls = letDeclNodeList_new (); ;
-    break;}
-case 112:
-#line 650 "llgrammar.y"
-{ yyval.letdecls = yyvsp[-1].letdecls; ;
-    break;}
-case 113:
-#line 653 "llgrammar.y"
-{ yyval.letdecls = letDeclNodeList_add (letDeclNodeList_new (), yyvsp[0].letdecl); ;
-    break;}
-case 114:
-#line 654 "llgrammar.y"
-{ yyval.letdecls = letDeclNodeList_add (yyvsp[-2].letdecls, yyvsp[0].letdecl); ;
-    break;}
-case 115:
-#line 657 "llgrammar.y"
-{ yyval.letdecl = makeLetDeclNode (yyvsp[-4].ltok, yyvsp[-2].lcltypespec, yyvsp[0].term); ;
-    break;}
-case 116:
-#line 658 "llgrammar.y"
-{ yyval.letdecl = makeLetDeclNode (yyvsp[-2].ltok, (lclTypeSpecNode)0, yyvsp[0].term); ;
-    break;}
-case 118:
-#line 663 "llgrammar.y"
-{ yyval.lclpredicate = (lclPredicateNode)0; ;
-    break;}
-case 119:
-#line 664 "llgrammar.y"
-{ checkLclPredicate (yyvsp[-2].ltok, yyvsp[-1].lclpredicate); yyval.lclpredicate = makeChecksNode (yyvsp[-2].ltok, yyvsp[-1].lclpredicate); ;
-    break;}
-case 120:
-#line 667 "llgrammar.y"
-{ yyval.lclpredicate = (lclPredicateNode)0; ;
-    break;}
-case 121:
-#line 668 "llgrammar.y"
-{ checkLclPredicate (yyvsp[-2].ltok, yyvsp[-1].lclpredicate); yyval.lclpredicate = makeRequiresNode (yyvsp[-2].ltok, yyvsp[-1].lclpredicate);;
-    break;}
-case 122:
-#line 671 "llgrammar.y"
-{ yyval.modify = (modifyNode)0; ;
-    break;}
-case 123:
-#line 672 "llgrammar.y"
-{ yyval.modify = makeModifyNodeSpecial (yyvsp[-2].ltok, TRUE); ;
-    break;}
-case 124:
-#line 673 "llgrammar.y"
-{ yyval.modify = makeModifyNodeSpecial (yyvsp[-2].ltok, FALSE); ;
-    break;}
-case 125:
-#line 674 "llgrammar.y"
-{ yyval.modify = makeModifyNodeRef (yyvsp[-2].ltok, yyvsp[-1].storereflist); ;
-    break;}
-case 126:
-#line 677 "llgrammar.y"
-{ yyval.storereflist = storeRefNodeList_add (storeRefNodeList_new (), yyvsp[0].storeref); ;
-    break;}
-case 127:
-#line 678 "llgrammar.y"
-{ yyval.storereflist = storeRefNodeList_add (yyvsp[-2].storereflist, yyvsp[0].storeref); ;
-    break;}
-case 128:
-#line 681 "llgrammar.y"
-{ yyval.storeref = makeStoreRefNodeTerm (yyvsp[0].term); ;
-    break;}
-case 129:
-#line 682 "llgrammar.y"
-{ yyval.storeref = makeStoreRefNodeType (yyvsp[0].lcltypespec, FALSE); ;
-    break;}
-case 130:
-#line 683 "llgrammar.y"
-{ yyval.storeref = makeStoreRefNodeType (yyvsp[0].lcltypespec, TRUE); ;
-    break;}
-case 131:
-#line 684 "llgrammar.y"
-{ yyval.storeref = makeStoreRefNodeInternal (); ;
-    break;}
-case 132:
-#line 685 "llgrammar.y"
-{ yyval.storeref = makeStoreRefNodeSystem (); ;
-    break;}
-case 133:
-#line 688 "llgrammar.y"
-{ yyval.lclpredicate = (lclPredicateNode)0; ;
-    break;}
-case 134:
-#line 689 "llgrammar.y"
-{ checkLclPredicate (yyvsp[-2].ltok, yyvsp[-1].lclpredicate); yyval.lclpredicate = makeEnsuresNode (yyvsp[-2].ltok, yyvsp[-1].lclpredicate);;
-    break;}
-case 135:
-#line 692 "llgrammar.y"
-{ yyval.lclpredicate = (lclPredicateNode)0; ;
-    break;}
-case 136:
-#line 693 "llgrammar.y"
-{ checkLclPredicate (yyvsp[-2].ltok, yyvsp[-1].lclpredicate); yyval.lclpredicate = makeIntraClaimNode (yyvsp[-2].ltok, yyvsp[-1].lclpredicate);;
-    break;}
-case 137:
-#line 696 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_new (); ;
-    break;}
-case 138:
-#line 697 "llgrammar.y"
-{ yyval.paramlist = yyvsp[0].paramlist; ;
-    break;}
-case 140:
-#line 701 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_add (paramNodeList_new (), paramNode_elipsis ()); ;
-    break;}
-case 141:
-#line 702 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_add (yyvsp[-2].paramlist, paramNode_elipsis ()); ;
-    break;}
-case 142:
-#line 705 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_single (yyvsp[0].param); ;
-    break;}
-case 143:
-#line 706 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_add (yyvsp[-2].paramlist, yyvsp[0].param); ;
-    break;}
-case 144:
-#line 709 "llgrammar.y"
-{ yyval.program = (programNode)0; ;
-    break;}
-case 145:
-#line 710 "llgrammar.y"
-{ yyval.program = yyvsp[-1].program; ;
-    break;}
-case 146:
-#line 711 "llgrammar.y"
-{ yyval.program = yyvsp[-2].program; ;
-    break;}
-case 147:
-#line 714 "llgrammar.y"
-{ yyval.program = makeProgramNode (yyvsp[0].stmt); ;
-    break;}
-case 148:
-#line 717 "llgrammar.y"
-{ yyval.program = yyvsp[-1].program; yyval.program->wrapped = yyval.program->wrapped + 1; ;
-    break;}
-case 149:
-#line 719 "llgrammar.y"
-{ programNodeList x = programNodeList_new ();
-     programNodeList_addh (x, yyvsp[-1].program);
-     yyval.program = makeProgramNodeAction (x, ACT_ITER); 
-   ;
-    break;}
-case 150:
-#line 724 "llgrammar.y"
-{ programNodeList x = programNodeList_new ();
-     programNodeList_addh (x, yyvsp[-2].program);
-     programNodeList_addh (x, yyvsp[0].program);
-     yyval.program = makeProgramNodeAction (x, ACT_ALTERNATE); 
-   ;
-    break;}
-case 151:
-#line 730 "llgrammar.y"
-{ programNodeList x = programNodeList_new ();
-     programNodeList_addh (x, yyvsp[-2].program);
-     programNodeList_addh (x, yyvsp[0].program);
-     yyval.program = makeProgramNodeAction (x, ACT_SEQUENCE); 
-   ;
-    break;}
-case 152:
-#line 738 "llgrammar.y"
-{ yyval.stmt = makeStmtNode (ltoken_undefined, yyvsp[-3].ltok, yyvsp[-1].termlist); ;
-    break;}
-case 153:
-#line 740 "llgrammar.y"
-{ yyval.stmt = makeStmtNode (ltoken_undefined, yyvsp[-2].ltok, termNodeList_new ()); ;
-    break;}
-case 154:
-#line 742 "llgrammar.y"
-{ yyval.stmt = makeStmtNode (yyvsp[-4].ltok, yyvsp[-2].ltok, termNodeList_new ()); ;
-    break;}
-case 155:
-#line 744 "llgrammar.y"
-{ yyval.stmt = makeStmtNode (yyvsp[-5].ltok, yyvsp[-3].ltok, yyvsp[-1].termlist); ;
-    break;}
-case 156:
-#line 747 "llgrammar.y"
-{ yyval.termlist = termNodeList_push (termNodeList_new (), yyvsp[0].term); ;
-    break;}
-case 157:
-#line 748 "llgrammar.y"
-{ yyval.termlist = termNodeList_push (yyvsp[-2].termlist, yyvsp[0].term); ;
-    break;}
-case 159:
-#line 752 "llgrammar.y"
-{ yyval.term = makeSimpleTermNode (yyvsp[0].ltok); ;
-    break;}
-case 160:
-#line 753 "llgrammar.y"
-{ yyval.term = makePrefixTermNode (yyvsp[-1].ltok, yyvsp[0].term); ;
-    break;}
-case 161:
-#line 754 "llgrammar.y"
-{ yyval.term = makePostfixTermNode2 (yyvsp[-1].term, yyvsp[0].ltok); ;
-    break;}
-case 162:
-#line 755 "llgrammar.y"
-{ yyval.term = makeInfixTermNode (yyvsp[-2].term, yyvsp[-1].ltok, yyvsp[0].term); ;
-    break;}
-case 163:
-#line 756 "llgrammar.y"
-{ yyval.term = yyvsp[-1].term; yyval.term->wrapped = yyval.term->wrapped + 1; ;
-    break;}
-case 164:
-#line 758 "llgrammar.y"
-{ yyval.term = makeOpCallTermNode (yyvsp[-2].ltok, yyvsp[-1].ltok, termNodeList_new (), yyvsp[0].ltok); ;
-    break;}
-case 165:
-#line 760 "llgrammar.y"
-{ yyval.term = makeOpCallTermNode (yyvsp[-3].ltok, yyvsp[-2].ltok, yyvsp[-1].termlist, yyvsp[0].ltok); ;
-    break;}
-case 166:
-#line 763 "llgrammar.y"
-{ yyval.abstbody = (abstBodyNode)0; ;
-    break;}
-case 167:
-#line 764 "llgrammar.y"
-{ yyval.abstbody = makeAbstBodyNode (yyvsp[-2].ltok, yyvsp[-1].fcns); ;
-    break;}
-case 168:
-#line 765 "llgrammar.y"
-{ yyval.abstbody = makeAbstBodyNode2 (yyvsp[-3].ltok, yyvsp[-2].ltokenList); ;
-    break;}
-case 169:
-#line 766 "llgrammar.y"
-{ yyval.abstbody = (abstBodyNode)0; ;
-    break;}
-case 170:
-#line 769 "llgrammar.y"
-{ yyval.fcns = fcnNodeList_new (); ;
-    break;}
-case 171:
-#line 770 "llgrammar.y"
-{ yyval.fcns = fcnNodeList_add (yyvsp[-1].fcns, yyvsp[0].fcn); ;
-    break;}
-case 172:
-#line 773 "llgrammar.y"
-{ yyval.lclpredicate = (lclPredicateNode)0; ;
-    break;}
-case 174:
-#line 777 "llgrammar.y"
-{ g_inTypeDef = FALSE; ;
-    break;}
-case 175:
-#line 778 "llgrammar.y"
-{ yyvsp[-1].lclpredicate->tok = yyvsp[-5].ltok; yyvsp[-1].lclpredicate->kind = LPD_CONSTRAINT;
-     checkLclPredicate (yyvsp[-5].ltok, yyvsp[-1].lclpredicate);
-     yyval.lclpredicate = yyvsp[-1].lclpredicate;
-     symtable_exitScope (g_symtab); 
-     g_inTypeDef = TRUE;
-   ;
-    break;}
-case 176:
-#line 786 "llgrammar.y"
-{ yyval.declaratorinvs = declaratorInvNodeList_add (declaratorInvNodeList_new (), yyvsp[0].declaratorinv); ;
-    break;}
-case 177:
-#line 788 "llgrammar.y"
-{ yyval.declaratorinvs = declaratorInvNodeList_add (yyvsp[-2].declaratorinvs, yyvsp[0].declaratorinv); ;
-    break;}
-case 178:
-#line 791 "llgrammar.y"
-{ declareForwardType (yyvsp[0].declare); ;
-    break;}
-case 179:
-#line 792 "llgrammar.y"
-{ yyval.declaratorinv = makeDeclaratorInvNode (yyvsp[-2].declare, yyvsp[0].abstbody); ;
-    break;}
-case 180:
-#line 795 "llgrammar.y"
-{ yyval.abstbody = (abstBodyNode)0; ;
-    break;}
-case 181:
-#line 796 "llgrammar.y"
-{ yyval.abstbody = makeExposedBodyNode (yyvsp[-2].ltok, yyvsp[-1].lclpredicate); ;
-    break;}
-case 182:
-#line 799 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_VOID, 0)); ;
-    break;}
-case 183:
-#line 800 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_CHAR, 0)); ;
-    break;}
-case 184:
-#line 801 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_DOUBLE, 0)); ;
-    break;}
-case 185:
-#line 802 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_FLOAT, 0)); ;
-    break;}
-case 186:
-#line 803 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_INT, 0)); ;
-    break;}
-case 187:
-#line 804 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_LONG, 0)); ;
-    break;}
-case 188:
-#line 805 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_SHORT, 0)); ;
-    break;}
-case 189:
-#line 806 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_SIGNED, 0)); ;
-    break;}
-case 190:
-#line 807 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_UNSIGNED, 0)); ;
-    break;}
-case 191:
-#line 808 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_UNKNOWN, 0)); ;
-    break;}
-case 192:
-#line 816 "llgrammar.y"
-{ yyval.ctypes = makeCTypesNode ((CTypesNode)0, yyvsp[0].ltok); ;
-    break;}
-case 193:
-#line 817 "llgrammar.y"
-{ yyval.ctypes = makeCTypesNode (yyvsp[-1].ctypes, yyvsp[0].ltok); ;
-    break;}
-case 194:
-#line 823 "llgrammar.y"
-{ yyval.ctypes = makeTypeSpecifier (yyvsp[0].ltok); ;
-    break;}
-case 195:
-#line 825 "llgrammar.y"
-{ yyval.ctypes = yyvsp[0].ctypes; yyval.ctypes->sort = sort_lookupName (lclctype_toSort (yyvsp[0].ctypes->intfield)); ;
-    break;}
-case 196:
-#line 830 "llgrammar.y"
-{ yyval.typequal = qual_createOut (); ;
-    break;}
-case 197:
-#line 831 "llgrammar.y"
-{ yyval.typequal = qual_createUnused (); ;
-    break;}
-case 198:
-#line 832 "llgrammar.y"
-{ yyval.typequal = qual_createSef (); ;
-    break;}
-case 199:
-#line 833 "llgrammar.y"
-{ yyval.typequal = qual_createOnly (); ;
-    break;}
-case 200:
-#line 834 "llgrammar.y"
-{ yyval.typequal = qual_createOwned (); ;
-    break;}
-case 201:
-#line 835 "llgrammar.y"
-{ yyval.typequal = qual_createDependent (); ;
-    break;}
-case 202:
-#line 836 "llgrammar.y"
-{ yyval.typequal = qual_createKeep (); ;
-    break;}
-case 203:
-#line 837 "llgrammar.y"
-{ yyval.typequal = qual_createKept (); ;
-    break;}
-case 204:
-#line 838 "llgrammar.y"
-{ yyval.typequal = qual_createObserver (); ;
-    break;}
-case 205:
-#line 839 "llgrammar.y"
-{ yyval.typequal = qual_createExits (); ;
-    break;}
-case 206:
-#line 840 "llgrammar.y"
-{ yyval.typequal = qual_createMayExit (); ;
-    break;}
-case 207:
-#line 841 "llgrammar.y"
-{ yyval.typequal = qual_createTrueExit (); ;
-    break;}
-case 208:
-#line 842 "llgrammar.y"
-{ yyval.typequal = qual_createFalseExit (); ;
-    break;}
-case 209:
-#line 843 "llgrammar.y"
-{ yyval.typequal = qual_createNeverExit (); ;
-    break;}
-case 210:
-#line 844 "llgrammar.y"
-{ yyval.typequal = qual_createOnly (); ;
-    break;}
-case 211:
-#line 845 "llgrammar.y"
-{ yyval.typequal = qual_createShared (); ;
-    break;}
-case 212:
-#line 846 "llgrammar.y"
-{ yyval.typequal = qual_createUnique (); ;
-    break;}
-case 213:
-#line 847 "llgrammar.y"
-{ yyval.typequal = qual_createChecked (); ;
-    break;}
-case 214:
-#line 848 "llgrammar.y"
-{ yyval.typequal = qual_createUnchecked (); ;
-    break;}
-case 215:
-#line 849 "llgrammar.y"
-{ yyval.typequal = qual_createCheckedStrict (); ;
-    break;}
-case 216:
-#line 850 "llgrammar.y"
-{ yyval.typequal = qual_createTrueNull (); ;
-    break;}
-case 217:
-#line 851 "llgrammar.y"
-{ yyval.typequal = qual_createFalseNull (); ;
-    break;}
-case 218:
-#line 852 "llgrammar.y"
-{ yyval.typequal = qual_createRelNull (); ;
-    break;}
-case 219:
-#line 853 "llgrammar.y"
-{ yyval.typequal = qual_createRelDef (); ;
-    break;}
-case 220:
-#line 854 "llgrammar.y"
-{ yyval.typequal = qual_createRefCounted (); ;
-    break;}
-case 221:
-#line 855 "llgrammar.y"
-{ yyval.typequal = qual_createRefs (); ;
-    break;}
-case 222:
-#line 856 "llgrammar.y"
-{ yyval.typequal = qual_createNewRef (); ;
-    break;}
-case 223:
-#line 857 "llgrammar.y"
-{ yyval.typequal = qual_createKillRef (); ;
-    break;}
-case 224:
-#line 858 "llgrammar.y"
-{ yyval.typequal = qual_createNull (); ;
-    break;}
-case 225:
-#line 859 "llgrammar.y"
-{ yyval.typequal = qual_createNotNull (); ;
-    break;}
-case 226:
-#line 860 "llgrammar.y"
-{ yyval.typequal = qual_createReturned (); ;
-    break;}
-case 227:
-#line 861 "llgrammar.y"
-{ yyval.typequal = qual_createExposed (); ;
-    break;}
-case 228:
-#line 862 "llgrammar.y"
-{ yyval.typequal = qual_createPartial (); ;
-    break;}
-case 229:
-#line 863 "llgrammar.y"
-{ yyval.typequal = qual_createNullTerminated () ; ;
-    break;}
-case 230:
-#line 864 "llgrammar.y"
-{ yyval.typequal = qual_createUndef (); ;
-    break;}
-case 231:
-#line 865 "llgrammar.y"
-{ yyval.typequal = qual_createKilled (); ;
-    break;}
-case 232:
-#line 869 "llgrammar.y"
-{ yyval.lcltypespec = makeLclTypeSpecNodeType (yyvsp[0].ctypes); ;
-    break;}
-case 233:
-#line 871 "llgrammar.y"
-{ yyval.lcltypespec = makeLclTypeSpecNodeSU (yyvsp[0].structorunion); ;
-    break;}
-case 234:
-#line 873 "llgrammar.y"
-{ yyval.lcltypespec = makeLclTypeSpecNodeEnum (yyvsp[0].enumspec); ;
-    break;}
-case 235:
-#line 875 "llgrammar.y"
-{ yyval.lcltypespec = lclTypeSpecNode_addQual (yyvsp[0].lcltypespec, yyvsp[-1].typequal); ;
-    break;}
-case 236:
-#line 877 "llgrammar.y"
-{ yyval.lcltypespec = makeLclTypeSpecNodeConj (yyvsp[-3].lcltypespec, yyvsp[-1].lcltypespec); ;
-    break;}
-case 238:
-#line 887 "llgrammar.y"
-{ llassert (lclTypeSpecNode_isDefined (yyvsp[-1].lcltypespec));
-     yyvsp[-1].lcltypespec->pointers = yyvsp[0].count; yyval.lcltypespec = yyvsp[-1].lcltypespec; ;
-    break;}
-case 239:
-#line 891 "llgrammar.y"
-{ yyval.count = 1; ;
-    break;}
-case 240:
-#line 892 "llgrammar.y"
-{ yyval.count = yyvsp[-1].count + 1; ;
-    break;}
-case 241:
-#line 896 "llgrammar.y"
-{ (void) checkAndEnterTag (TAG_FWDSTRUCT, ltoken_copy (yyvsp[0].ltok)); ;
-    break;}
-case 242:
-#line 898 "llgrammar.y"
-{ yyval.structorunion = makestrOrUnionNode (yyvsp[-5].ltok, SU_STRUCT, yyvsp[-4].ltok, yyvsp[-1].structdecls); ;
-    break;}
-case 243:
-#line 900 "llgrammar.y"
-{ (void) checkAndEnterTag (TAG_FWDUNION, ltoken_copy (yyvsp[0].ltok)); ;
-    break;}
-case 244:
-#line 902 "llgrammar.y"
-{ yyval.structorunion = makestrOrUnionNode (yyvsp[-5].ltok, SU_UNION, yyvsp[-4].ltok, yyvsp[-1].structdecls); ;
-    break;}
-case 245:
-#line 904 "llgrammar.y"
-{ yyval.structorunion = makeForwardstrOrUnionNode (yyvsp[-1].ltok, SU_STRUCT, yyvsp[0].ltok); ;
-    break;}
-case 246:
-#line 906 "llgrammar.y"
-{ yyval.structorunion = makeForwardstrOrUnionNode (yyvsp[-1].ltok, SU_UNION, yyvsp[0].ltok); ;
-    break;}
-case 247:
-#line 909 "llgrammar.y"
-{ yyval.ltok = ltoken_undefined; ;
-    break;}
-case 249:
-#line 913 "llgrammar.y"
-{ yyval.structdecls = stDeclNodeList_add (stDeclNodeList_new (), yyvsp[0].structdecl); ;
-    break;}
-case 250:
-#line 914 "llgrammar.y"
-{ yyval.structdecls = stDeclNodeList_add (yyvsp[-1].structdecls, yyvsp[0].structdecl); ;
-    break;}
-case 251:
-#line 919 "llgrammar.y"
-{ yyval.structdecl = makestDeclNode (yyvsp[-2].lcltypespec, yyvsp[-1].declarelist); ;
-    break;}
-case 252:
-#line 923 "llgrammar.y"
-{ yyval.declarelist = declaratorNodeList_add (declaratorNodeList_new (), yyvsp[0].declare); ;
-    break;}
-case 253:
-#line 925 "llgrammar.y"
-{ yyval.declarelist = declaratorNodeList_add (yyvsp[-2].declarelist, yyvsp[0].declare); ;
-    break;}
-case 254:
-#line 928 "llgrammar.y"
-{ ; ;
-    break;}
-case 255:
-#line 929 "llgrammar.y"
-{ ; ;
-    break;}
-case 256:
-#line 933 "llgrammar.y"
-{ yyval.enumspec = makeEnumSpecNode (yyvsp[-5].ltok, yyvsp[-4].ltok, yyvsp[-2].ltokenList); ;
-    break;}
-case 257:
-#line 935 "llgrammar.y"
-{ yyval.enumspec = makeEnumSpecNode2 (yyvsp[-1].ltok, yyvsp[0].ltok); ;
-    break;}
-case 258:
-#line 938 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
-    break;}
-case 259:
-#line 939 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 260:
-#line 949 "llgrammar.y"
-{ yyval.declare = makeDeclaratorNode (yyvsp[0].typeexpr); ;
-    break;}
-case 261:
-#line 950 "llgrammar.y"
-{ yyval.declare = makeDeclaratorNode (yyvsp[0].typeexpr); ;
-    break;}
-case 262:
-#line 953 "llgrammar.y"
-{ yyval.typeexpr = makeTypeExpr (yyvsp[0].ltok); ;
-    break;}
-case 263:
-#line 954 "llgrammar.y"
-{ yyval.typeexpr = yyvsp[-1].typeexpr; yyval.typeexpr->wrapped = yyval.typeexpr->wrapped + 1; ;
-    break;}
-case 264:
-#line 955 "llgrammar.y"
-{ yyval.typeexpr = makePointerNode (yyvsp[-1].ltok, yyvsp[0].typeexpr); ;
-    break;}
-case 265:
-#line 956 "llgrammar.y"
-{ yyval.typeexpr = makeArrayNode (yyvsp[-1].typeexpr, yyvsp[0].array); ;
-    break;}
-case 266:
-#line 957 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-2].typeexpr, paramNodeList_new ()); ;
-    break;}
-case 267:
-#line 958 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-3].typeexpr, yyvsp[-1].paramlist); ;
-    break;}
-case 268:
-#line 961 "llgrammar.y"
-{ yyval.typeexpr = makeTypeExpr (yyvsp[0].ltok); ;
-    break;}
-case 269:
-#line 962 "llgrammar.y"
-{ yyval.typeexpr = yyvsp[-1].typeexpr; yyval.typeexpr->wrapped = yyval.typeexpr->wrapped + 1; ;
-    break;}
-case 270:
-#line 963 "llgrammar.y"
-{ yyval.typeexpr = makePointerNode (yyvsp[-1].ltok, yyvsp[0].typeexpr); ;
-    break;}
-case 271:
-#line 964 "llgrammar.y"
-{ yyval.typeexpr = makeArrayNode (yyvsp[-1].typeexpr, yyvsp[0].array); ;
-    break;}
-case 272:
-#line 965 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-2].typeexpr, paramNodeList_new ()); ;
-    break;}
-case 273:
-#line 966 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-3].typeexpr, yyvsp[-1].paramlist); ;
-    break;}
-case 274:
-#line 975 "llgrammar.y"
-{ yyval.typeexpr = makeTypeExpr (yyvsp[0].ltok); ;
-    break;}
-case 275:
-#line 976 "llgrammar.y"
-{ yyval.typeexpr = makePointerNode (yyvsp[-1].ltok, yyvsp[0].typeexpr); ;
-    break;}
-case 276:
-#line 977 "llgrammar.y"
-{ yyval.typeexpr = makeArrayNode (yyvsp[-1].typeexpr, yyvsp[0].array); ;
-    break;}
-case 277:
-#line 978 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-2].typeexpr, paramNodeList_new ()); ;
-    break;}
-case 278:
-#line 979 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-3].typeexpr, yyvsp[-1].paramlist); ;
-    break;}
-case 279:
-#line 985 "llgrammar.y"
-{ yyval.param = makeParamNode (yyvsp[-1].lcltypespec, yyvsp[0].typeexpr); ;
-    break;}
-case 280:
-#line 986 "llgrammar.y"
-{ yyval.param = makeParamNode (yyvsp[-1].lcltypespec, yyvsp[0].typeexpr); ;
-    break;}
-case 281:
-#line 987 "llgrammar.y"
-{ yyval.param = makeParamNode (yyvsp[-1].lcltypespec, yyvsp[0].abstDecl); ;
-    break;}
-case 282:
-#line 997 "llgrammar.y"
-{ yyval.typname = makeTypeNameNode (FALSE, yyvsp[-1].lcltypespec, yyvsp[0].abstDecl); ;
-    break;}
-case 283:
-#line 998 "llgrammar.y"
-{ yyval.typname = makeTypeNameNode (TRUE, yyvsp[-1].lcltypespec, yyvsp[0].abstDecl); ;
-    break;}
-case 284:
-#line 999 "llgrammar.y"
-{ yyval.typname = makeTypeNameNodeOp (yyvsp[0].opform); ;
-    break;}
-case 285:
-#line 1004 "llgrammar.y"
-{ yyval.abstDecl = (abstDeclaratorNode)0; ;
-    break;}
-case 286:
-#line 1005 "llgrammar.y"
-{ yyval.abstDecl = (abstDeclaratorNode)yyvsp[0].typeexpr; ;
-    break;}
-case 287:
-#line 1008 "llgrammar.y"
-{ yyval.typeexpr = yyvsp[-1].typeexpr; yyval.typeexpr->wrapped = yyval.typeexpr->wrapped + 1; ;
-    break;}
-case 288:
-#line 1009 "llgrammar.y"
-{ yyval.typeexpr = makePointerNode (yyvsp[-1].ltok, yyvsp[0].typeexpr); ;
-    break;}
-case 289:
-#line 1010 "llgrammar.y"
-{ yyval.typeexpr = makePointerNode (yyvsp[0].ltok, (typeExpr)0); ;
-    break;}
-case 290:
-#line 1011 "llgrammar.y"
-{ yyval.typeexpr = makeArrayNode ((typeExpr)0, yyvsp[0].array); ;
-    break;}
-case 291:
-#line 1012 "llgrammar.y"
-{ yyval.typeexpr = makeArrayNode (yyvsp[-1].typeexpr, yyvsp[0].array); ;
-    break;}
-case 292:
-#line 1013 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-2].typeexpr, paramNodeList_new ()); ;
-    break;}
-case 293:
-#line 1014 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode ((typeExpr)0, yyvsp[-1].paramlist); ;
-    break;}
-case 294:
-#line 1015 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-3].typeexpr, yyvsp[-1].paramlist); ;
-    break;}
-case 295:
-#line 1018 "llgrammar.y"
-{ yyval.array = makeArrayQualNode (yyvsp[-1].ltok, (termNode)0); ;
-    break;}
-case 296:
-#line 1019 "llgrammar.y"
-{ yyval.array = makeArrayQualNode (yyvsp[-2].ltok, yyvsp[-1].term); ;
-    break;}
-case 297:
-#line 1023 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-5].ltok, OPF_IF, opFormUnion_createMiddle (0), ltoken_undefined); ;
-    break;}
-case 298:
-#line 1025 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[0].ltok, OPF_ANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 299:
-#line 1027 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 300:
-#line 1029 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_ANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
-    break;}
-case 301:
-#line 1031 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MANYOPM, 
-			  opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
-    break;}
-case 302:
-#line 1034 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 303:
-#line 1036 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 304:
-#line 1038 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 305:
-#line 1040 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 306:
-#line 1042 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 307:
-#line 1044 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 308:
-#line 1052 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 309:
-#line 1054 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMMIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 310:
-#line 1056 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_SELECT, 
-			  opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 311:
-#line 1059 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MAP, 
-			  opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 312:
-#line 1062 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MSELECT, 
-			  opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 313:
-#line 1065 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMAP, 
-			  opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 321:
-#line 1082 "llgrammar.y"
-{ yyval.count = 0; ;
-    break;}
-case 323:
-#line 1086 "llgrammar.y"
-{ yyval.count = 1; ;
-    break;}
-case 324:
-#line 1087 "llgrammar.y"
-{ yyval.count = yyvsp[-2].count + 1; ;
-    break;}
-case 327:
-#line 1094 "llgrammar.y"
-{ yyval.signature = makesigNode (yyvsp[-3].ltok, yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 328:
-#line 1097 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_new (); ;
-    break;}
-case 330:
-#line 1101 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
-    break;}
-case 331:
-#line 1102 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 332:
-#line 1105 "llgrammar.y"
-{ yyval.lclpredicate = makeLclPredicateNode (ltoken_undefined, yyvsp[0].term, LPD_PLAIN);;
-    break;}
-case 333:
-#line 1108 "llgrammar.y"
-{ yyval.term = checkSort (yyvsp[0].term); ;
-    break;}
-case 334:
-#line 1115 "llgrammar.y"
-{ yyval.term = makeIfTermNode (yyvsp[-5].ltok,yyvsp[-4].term,yyvsp[-3].ltok,yyvsp[-2].term,yyvsp[-1].ltok,yyvsp[0].term); ;
-    break;}
-case 336:
-#line 1117 "llgrammar.y"
-{ yyval.term = makeInfixTermNode (yyvsp[-2].term, yyvsp[-1].ltok, yyvsp[0].term); ;
-    break;}
-case 338:
-#line 1123 "llgrammar.y"
-{ checkLclPredicate (yyvsp[-2].ltok, yyvsp[-1].lclpredicate); yyval.term = makeQuantifiedTermNode (yyvsp[-3].quantifiers, yyvsp[-2].ltok, yyvsp[-1].lclpredicate->predicate, yyvsp[0].ltok);
-     symtable_exitScope (g_symtab); 
-   ;
-    break;}
-case 339:
-#line 1127 "llgrammar.y"
-{ yyval.term = makeInfixTermNode (yyvsp[-2].term, yyvsp[-1].ltok, yyvsp[0].term);;
-    break;}
-case 340:
-#line 1129 "llgrammar.y"
-{ yyval.term = makeInfixTermNode (yyvsp[-2].term, yyvsp[-1].ltok, yyvsp[0].term);;
-    break;}
-case 342:
-#line 1133 "llgrammar.y"
-{ yyval.term = makePostfixTermNode (yyvsp[-1].term, yyvsp[0].ltokenList); ;
-    break;}
-case 343:
-#line 1134 "llgrammar.y"
-{ yyval.term = CollapseInfixTermNode (yyvsp[-1].term, yyvsp[0].termlist); ;
-    break;}
-case 347:
-#line 1142 "llgrammar.y"
-{ yyval.term = makePrefixTermNode (yyvsp[-1].ltok, yyvsp[0].term); ;
-    break;}
-case 348:
-#line 1145 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
-    break;}
-case 349:
-#line 1146 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_push (yyvsp[-1].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 350:
-#line 1149 "llgrammar.y"
-{ yyval.termlist = pushInfixOpPartNode (termNodeList_new (), yyvsp[-1].ltok, yyvsp[0].term); ;
-    break;}
-case 351:
-#line 1150 "llgrammar.y"
-{ yyval.termlist = pushInfixOpPartNode (yyvsp[-2].termlist, yyvsp[-1].ltok, yyvsp[0].term); ;
-    break;}
-case 353:
-#line 1154 "llgrammar.y"
-{ yyval.term = computePossibleSorts (yyvsp[0].term); ;
-    break;}
-case 354:
-#line 1155 "llgrammar.y"
-{ yyval.term = updateMatchedNode ((termNode)0, yyvsp[-1].term, yyvsp[0].term); ;
-    break;}
-case 355:
-#line 1156 "llgrammar.y"
-{ yyval.term = updateMatchedNode (yyvsp[-1].term, yyvsp[0].term, (termNode)0); ;
-    break;}
-case 356:
-#line 1157 "llgrammar.y"
-{ yyval.term = updateMatchedNode (yyvsp[-2].term, yyvsp[-1].term, yyvsp[0].term); ;
-    break;}
-case 357:
-#line 1158 "llgrammar.y"
-{ yyval.term = computePossibleSorts (yyvsp[0].term); ;
-    break;}
-case 358:
-#line 1159 "llgrammar.y"
-{ yyval.term = updateSqBracketedNode ((termNode)0, yyvsp[-1].term, yyvsp[0].term); ;
-    break;}
-case 359:
-#line 1162 "llgrammar.y"
-{ yyval.term = yyvsp[-2].term; yyval.term->sort = sort_lookupName (ltoken_getText (yyvsp[0].ltok)); ;
-    break;}
-case 361:
-#line 1167 "llgrammar.y"
-{ yyval.term = makeSqBracketedNode (yyvsp[-4].ltok, yyvsp[-3].termlist, yyvsp[-2].ltok); 
-     yyval.term->given = sort_lookupName (ltoken_getText (yyvsp[0].ltok)); ;
-    break;}
-case 362:
-#line 1170 "llgrammar.y"
-{ yyval.term = makeSqBracketedNode (yyvsp[-2].ltok, yyvsp[-1].termlist, yyvsp[0].ltok); ;
-    break;}
-case 363:
-#line 1172 "llgrammar.y"
-{ yyval.term = makeSqBracketedNode (yyvsp[-3].ltok, termNodeList_new (), yyvsp[-2].ltok); 
-     yyval.term->given = sort_lookupName (ltoken_getText (yyvsp[0].ltok)); 
-   ;
-    break;}
-case 364:
-#line 1176 "llgrammar.y"
-{ yyval.term = makeSqBracketedNode (yyvsp[-1].ltok, termNodeList_new (), yyvsp[0].ltok); ;
-    break;}
-case 365:
-#line 1179 "llgrammar.y"
-{ yyval.term = makeMatchedNode (yyvsp[-2].ltok, yyvsp[-1].termlist, yyvsp[0].ltok); ;
-    break;}
-case 366:
-#line 1180 "llgrammar.y"
-{ yyval.term = makeMatchedNode (yyvsp[-1].ltok, termNodeList_new (), yyvsp[0].ltok); ;
-    break;}
-case 367:
-#line 1183 "llgrammar.y"
-{ yyval.termlist = termNodeList_push (termNodeList_new (), yyvsp[0].term); ;
-    break;}
-case 368:
-#line 1184 "llgrammar.y"
-{ yyval.termlist = termNodeList_push (yyvsp[-2].termlist, yyvsp[0].term); ;
-    break;}
-case 369:
-#line 1188 "llgrammar.y"
-{ yyval.term = yyvsp[-1].term; yyval.term->wrapped = yyval.term->wrapped + 1; ;
-    break;}
-case 370:
-#line 1190 "llgrammar.y"
-{ yyval.term = makeSimpleTermNode (yyvsp[0].ltok); ;
-    break;}
-case 371:
-#line 1192 "llgrammar.y"
-{ yyval.term = makeOpCallTermNode (yyvsp[-3].ltok, yyvsp[-2].ltok, yyvsp[-1].termlist, yyvsp[0].ltok); ;
-    break;}
-case 373:
-#line 1195 "llgrammar.y"
-{ yyval.term = makePostfixTermNode2 (yyvsp[-1].term, yyvsp[0].ltok); ;
-    break;}
-case 374:
-#line 1197 "llgrammar.y"
-{ ltoken_markOwned (yyvsp[0].ltok); yyval.term = makeSelectTermNode (yyvsp[-2].term, yyvsp[-1].ltok, yyvsp[0].ltok); ;
-    break;}
-case 375:
-#line 1199 "llgrammar.y"
-{ ltoken_markOwned (yyvsp[0].ltok); yyval.term = makeMapTermNode (yyvsp[-2].term, yyvsp[-1].ltok, yyvsp[0].ltok); ;
-    break;}
-case 376:
-#line 1201 "llgrammar.y"
-{ yyval.term = updateSqBracketedNode (yyvsp[-2].term, makeSqBracketedNode (yyvsp[-1].ltok, termNodeList_new (), yyvsp[0].ltok), 
-				(termNode)0); ;
-    break;}
-case 377:
-#line 1204 "llgrammar.y"
-{ yyval.term = updateSqBracketedNode (yyvsp[-3].term, makeSqBracketedNode (yyvsp[-2].ltok, yyvsp[-1].termlist, yyvsp[0].ltok), (termNode)0); ;
-    break;}
-case 378:
-#line 1206 "llgrammar.y"
-{ yyval.term = yyvsp[-2].term; yyval.term->given = sort_lookupName (ltoken_getText (yyvsp[0].ltok)); ;
-    break;}
-case 379:
-#line 1209 "llgrammar.y"
-{ yyval.termlist = termNodeList_push (termNodeList_new (), yyvsp[0].term); ;
-    break;}
-case 380:
-#line 1210 "llgrammar.y"
-{ yyval.termlist = termNodeList_push (yyvsp[-2].termlist, yyvsp[0].term); ;
-    break;}
-case 386:
-#line 1220 "llgrammar.y"
-{ yyval.term = makeSimpleTermNode (yyvsp[0].ltok); ;
-    break;}
-case 387:
-#line 1221 "llgrammar.y"
-{ yyval.term = makeOpCallTermNode (yyvsp[-3].ltok, yyvsp[-2].ltok, yyvsp[-1].termlist, yyvsp[0].ltok); ;
-    break;}
-case 388:
-#line 1222 "llgrammar.y"
-{ yyval.term = makeUnchangedTermNode1 (yyvsp[-3].ltok, yyvsp[-1].ltok); ;
-    break;}
-case 389:
-#line 1223 "llgrammar.y"
-{ yyval.term = makeUnchangedTermNode2 (yyvsp[-3].ltok, yyvsp[-1].storereflist); ;
-    break;}
-case 390:
-#line 1225 "llgrammar.y"
-{ termNodeList x = termNodeList_new (); 
-     termNodeList_addh (x, yyvsp[-1].term);
-     yyval.term = makeOpCallTermNode (yyvsp[-3].ltok, yyvsp[-2].ltok, x, yyvsp[0].ltok); 
-   ;
-    break;}
-case 391:
-#line 1230 "llgrammar.y"
-{ termNodeList x = termNodeList_new ();
-     termNodeList_addh (x, yyvsp[-3].term);
-     termNodeList_addh (x, yyvsp[-1].term);
-     yyval.term = makeOpCallTermNode (yyvsp[-5].ltok, yyvsp[-4].ltok, x, yyvsp[0].ltok); 
-   ;
-    break;}
-case 392:
-#line 1235 "llgrammar.y"
-{ yyval.term = makeSizeofTermNode (yyvsp[-3].ltok, yyvsp[-1].lcltypespec); ;
-    break;}
-case 393:
-#line 1245 "llgrammar.y"
-{ yyval.term = makeLiteralTermNode (yyvsp[0].ltok, sort_int); ;
-    break;}
-case 394:
-#line 1246 "llgrammar.y"
-{ yyval.term = makeLiteralTermNode (yyvsp[0].ltok, sort_cstring); ;
-    break;}
-case 395:
-#line 1247 "llgrammar.y"
-{ yyval.term = makeLiteralTermNode (yyvsp[0].ltok, sort_char); ;
-    break;}
-case 396:
-#line 1248 "llgrammar.y"
-{ yyval.term = makeLiteralTermNode (yyvsp[0].ltok, sort_double); ;
-    break;}
-case 397:
-#line 1252 "llgrammar.y"
-{ yyval.quantifiers = quantifierNodeList_add (quantifierNodeList_new (), yyvsp[0].quantifier); ;
-    break;}
-case 398:
-#line 1254 "llgrammar.y"
-{ yyval.quantifiers = quantifierNodeList_add (yyvsp[-1].quantifiers, yyvsp[0].quantifier); ;
-    break;}
-case 399:
-#line 1257 "llgrammar.y"
-{ scopeInfo si = (scopeInfo) dmalloc (sizeof (*si));
-		   si->kind = SPE_QUANT;
-		   symtable_enterScope (g_symtab, si); ;
-    break;}
-case 400:
-#line 1261 "llgrammar.y"
-{ yyval.quantifier = makeQuantifierNode (yyvsp[0].vars, yyvsp[-2].ltok); ;
-    break;}
-case 401:
-#line 1264 "llgrammar.y"
-{ yyval.vars = varNodeList_add (varNodeList_new (), yyvsp[0].var); ;
-    break;}
-case 402:
-#line 1265 "llgrammar.y"
-{ yyval.vars = varNodeList_add (yyvsp[-2].vars, yyvsp[0].var); ;
-    break;}
-case 403:
-#line 1268 "llgrammar.y"
-{ yyval.var = makeVarNode (yyvsp[-2].ltok, FALSE, yyvsp[0].lcltypespec); ;
-    break;}
-case 404:
-#line 1269 "llgrammar.y"
-{ yyval.var = makeVarNode (yyvsp[-3].ltok, TRUE, yyvsp[0].lcltypespec); ;
-    break;}
-}
-   /* the action file gets copied in in place of this dollarsign */
-#line 543 "/usr/lib/bison.simple"
-
-  yyvsp -= yylen;
-  yyssp -= yylen;
-#ifdef YYLSP_NEEDED
-  yylsp -= yylen;
-#endif
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      short *ssp1 = yyss - 1;
-      fprintf (stderr, "state stack now");
-      while (ssp1 != yyssp)
-	fprintf (stderr, " %d", *++ssp1);
-      fprintf (stderr, "\n");
-    }
-#endif
-
-  *++yyvsp = yyval;
-
-#ifdef YYLSP_NEEDED
-  yylsp++;
-  if (yylen == 0)
-    {
-      yylsp->first_line = yylloc.first_line;
-      yylsp->first_column = yylloc.first_column;
-      yylsp->last_line = (yylsp-1)->last_line;
-      yylsp->last_column = (yylsp-1)->last_column;
-      yylsp->text = 0;
-    }
-  else
-    {
-      yylsp->last_line = (yylsp+yylen-1)->last_line;
-      yylsp->last_column = (yylsp+yylen-1)->last_column;
-    }
-#endif
-
-  /* Now "shift" the result of the reduction.
-     Determine what state that goes to,
-     based on the state we popped back to
-     and the rule number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
-  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTBASE];
-
-  goto yynewstate;
-
-yyerrlab:   /* here on detecting error */
-
-  if (! yyerrstatus)
-    /* If not already recovering from an error, report this error.  */
-    {
-      ++yynerrs;
-
-#ifdef YYERROR_VERBOSE
-      yyn = yypact[yystate];
-
-      if (yyn > YYFLAG && yyn < YYLAST)
-	{
-	  int size = 0;
-	  char *msg;
-	  int x, count;
-
-	  count = 0;
-	  /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
-	  for (x = (yyn < 0 ? -yyn : 0);
-	       x < (sizeof(yytname) / sizeof(char *)); x++)
-	    if (yycheck[x + yyn] == x)
-	      size += strlen(yytname[x]) + 15, count++;
-	  msg = (char *) malloc(size + 15);
-	  if (msg != 0)
-	    {
-	      strcpy(msg, "parse error");
-
-	      if (count < 5)
-		{
-		  count = 0;
-		  for (x = (yyn < 0 ? -yyn : 0);
-		       x < (sizeof(yytname) / sizeof(char *)); x++)
-		    if (yycheck[x + yyn] == x)
-		      {
-			strcat(msg, count == 0 ? ", expecting `" : " or `");
-			strcat(msg, yytname[x]);
-			strcat(msg, "'");
-			count++;
-		      }
-		}
-	      yyerror(msg);
-	      free(msg);
-	    }
-	  else
-	    yyerror ("parse error; also virtual memory exceeded");
-	}
-      else
-#endif /* YYERROR_VERBOSE */
-	yyerror("parse error");
-    }
-
-  goto yyerrlab1;
-yyerrlab1:   /* here on error raised explicitly by an action */
-
-  if (yyerrstatus == 3)
-    {
-      /* if just tried and failed to reuse lookahead token after an error, discard it.  */
-
-      /* return failure if at end of input */
-      if (yychar == YYEOF)
-	YYABORT;
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
-#endif
-
-      yychar = YYEMPTY;
-    }
-
-  /* Else will try to reuse lookahead token
-     after shifting the error token.  */
-
-  yyerrstatus = 3;		/* Each real token shifted decrements this */
-
-  goto yyerrhandle;
-
-yyerrdefault:  /* current state does not do anything special for the error token. */
-
-#if 0
-  /* This is wrong; only states that explicitly want error tokens
-     should shift them.  */
-  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
-  if (yyn) goto yydefault;
-#endif
-
-yyerrpop:   /* pop the current state because it cannot handle the error token */
-
-  if (yyssp == yyss) YYABORT;
-  yyvsp--;
-  yystate = *--yyssp;
-#ifdef YYLSP_NEEDED
-  yylsp--;
-#endif
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      short *ssp1 = yyss - 1;
-      fprintf (stderr, "Error: state stack now");
-      while (ssp1 != yyssp)
-	fprintf (stderr, " %d", *++ssp1);
-      fprintf (stderr, "\n");
-    }
-#endif
-
-yyerrhandle:
-
-  yyn = yypact[yystate];
-  if (yyn == YYFLAG)
-    goto yyerrdefault;
-
-  yyn += YYTERROR;
-  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
-    goto yyerrdefault;
-
-  yyn = yytable[yyn];
-  if (yyn < 0)
-    {
-      if (yyn == YYFLAG)
-	goto yyerrpop;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-  else if (yyn == 0)
-    goto yyerrpop;
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Shifting error token, ");
-#endif
-
-  *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
-  *++yylsp = yylloc;
-#endif
-
-  yystate = yyn;
-  goto yynewstate;
-
- yyacceptlab:
-  /* YYACCEPT comes here.  */
-  if (yyfree_stacks)
-    {
-      free (yyss);
-      free (yyvs);
-#ifdef YYLSP_NEEDED
-      free (yyls);
-#endif
-    }
-  return 0;
-
- yyabortlab:
-  /* YYABORT comes here.  */
-  if (yyfree_stacks)
-    {
-      free (yyss);
-      free (yyvs);
-#ifdef YYLSP_NEEDED
-      free (yyls);
-#endif
-    }
-  return 1;
-}
-#line 1284 "llgrammar.y"
-
-
-# include "bison.reset"
-
-/*
-** yytext is set in lex scanner 
-** extern YYSTYPE yylval;  
-** yylval is defined by code generated by bison 
-*/
-
-void ylerror (char *s) 
-{
-  /* 
-  ** This resetting of the left context is very important when multiple
-  ** files are to be parsed.  We do not want failures to propagate.
-  ** Lex/Yacc does not reset the flags when the parsing goes bad.  
-  ** BEGIN 0;        
-  **/
-
-  /*@-mustfree@*/
-  lclfatalerror (yllval.ltok,
-		 message ("%s: Token code: %s, Token String: %s", 
-			  cstring_fromChars (s), 
-			  ltoken_unparseCodeName (yllval.ltok), 
-			  ltoken_getRawString (yllval.ltok)));
-  /*@=mustfree@*/
-}
-
-static void yyprint (FILE *f, int t, YYSTYPE value) 
-{
-  fprintf (f, " type: %d (%s)", t, 
-	   cstring_toCharsSafe (ltoken_getRawString (value.ltok)));
-}
-
-
-
-
-
-
-
diff --git a/src/llgrammar.tab.c b/src/llgrammar.tab.c
deleted file mode 100644
index 0b3c623..0000000
--- a/src/llgrammar.tab.c
+++ /dev/null
@@ -1,3856 +0,0 @@
-
-/*  A Bison parser, made from llgrammar.y
-    by GNU Bison version 1.28  */
-
-#define YYBISON 1  /* Identify Bison output.  */
-
-#define yyparse ylparse
-#define yylex yllex
-#define yyerror ylerror
-#define yylval yllval
-#define yychar ylchar
-#define yydebug yldebug
-#define yynerrs ylnerrs
-#define	simpleOp	257
-#define	PREFIX_OP	258
-#define	POSTFIX_OP	259
-#define	LLT_MULOP	260
-#define	LLT_SEMI	261
-#define	LLT_VERTICALBAR	262
-#define	ITERATION_OP	263
-#define	LLT_LPAR	264
-#define	LLT_LBRACKET	265
-#define	selectSym	266
-#define	LLT_IF_THEN_ELSE	267
-#define	logicalOp	268
-#define	eqSepSym	269
-#define	equationSym	270
-#define	commentSym	271
-#define	LLT_WHITESPACE	272
-#define	LLT_EOL	273
-#define	LLT_TYPEDEF_NAME	274
-#define	quantifierSym	275
-#define	openSym	276
-#define	closeSym	277
-#define	sepSym	278
-#define	simpleId	279
-#define	mapSym	280
-#define	markerSym	281
-#define	preSym	282
-#define	postSym	283
-#define	anySym	284
-#define	LLT_COLON	285
-#define	LLT_COMMA	286
-#define	LLT_EQUALS	287
-#define	LLT_LBRACE	288
-#define	LLT_RBRACE	289
-#define	LLT_RBRACKET	290
-#define	LLT_RPAR	291
-#define	LLT_QUOTE	292
-#define	eqOp	293
-#define	LLT_CCHAR	294
-#define	LLT_CFLOAT	295
-#define	LLT_CINTEGER	296
-#define	LLT_LCSTRING	297
-#define	LLT_ALL	298
-#define	LLT_ANYTHING	299
-#define	LLT_BE	300
-#define	LLT_BODY	301
-#define	LLT_CLAIMS	302
-#define	LLT_CHECKS	303
-#define	LLT_CONSTANT	304
-#define	LLT_ELSE	305
-#define	LLT_ENSURES	306
-#define	LLT_FOR	307
-#define	LLT_FRESH	308
-#define	LLT_IF	309
-#define	LLT_IMMUTABLE	310
-#define	LLT_IMPORTS	311
-#define	LLT_CONSTRAINT	312
-#define	LLT_ISSUB	313
-#define	LLT_LET	314
-#define	LLT_MODIFIES	315
-#define	LLT_MUTABLE	316
-#define	LLT_NOTHING	317
-#define	LLT_INTERNAL	318
-#define	LLT_FILESYS	319
-#define	LLT_OBJ	320
-#define	LLT_OUT	321
-#define	LLT_SEF	322
-#define	LLT_ONLY	323
-#define	LLT_PARTIAL	324
-#define	LLT_OWNED	325
-#define	LLT_DEPENDENT	326
-#define	LLT_KEEP	327
-#define	LLT_KEPT	328
-#define	LLT_TEMP	329
-#define	LLT_SHARED	330
-#define	LLT_UNIQUE	331
-#define	LLT_UNUSED	332
-#define	LLT_EXITS	333
-#define	LLT_MAYEXIT	334
-#define	LLT_NEVEREXIT	335
-#define	LLT_TRUEEXIT	336
-#define	LLT_FALSEEXIT	337
-#define	LLT_UNDEF	338
-#define	LLT_KILLED	339
-#define	LLT_CHECKMOD	340
-#define	LLT_CHECKED	341
-#define	LLT_UNCHECKED	342
-#define	LLT_CHECKEDSTRICT	343
-#define	LLT_TRUENULL	344
-#define	LLT_FALSENULL	345
-#define	LLT_LNULL	346
-#define	LLT_LNOTNULL	347
-#define	LLT_RETURNED	348
-#define	LLT_OBSERVER	349
-#define	LLT_EXPOSED	350
-#define	LLT_REFCOUNTED	351
-#define	LLT_REFS	352
-#define	LLT_RELNULL	353
-#define	LLT_RELDEF	354
-#define	LLT_KILLREF	355
-#define	LLT_NULLTERMINATED	356
-#define	LLT_TEMPREF	357
-#define	LLT_NEWREF	358
-#define	LLT_PRIVATE	359
-#define	LLT_REQUIRES	360
-#define	LLT_RESULT	361
-#define	LLT_SIZEOF	362
-#define	LLT_SPEC	363
-#define	LLT_TAGGEDUNION	364
-#define	LLT_THEN	365
-#define	LLT_TYPE	366
-#define	LLT_TYPEDEF	367
-#define	LLT_UNCHANGED	368
-#define	LLT_USES	369
-#define	LLT_CHAR	370
-#define	LLT_CONST	371
-#define	LLT_DOUBLE	372
-#define	LLT_ENUM	373
-#define	LLT_FLOAT	374
-#define	LLT_INT	375
-#define	LLT_ITER	376
-#define	LLT_YIELD	377
-#define	LLT_LONG	378
-#define	LLT_SHORT	379
-#define	LLT_SIGNED	380
-#define	LLT_UNKNOWN	381
-#define	LLT_STRUCT	382
-#define	LLT_TELIPSIS	383
-#define	LLT_UNION	384
-#define	LLT_UNSIGNED	385
-#define	LLT_VOID	386
-#define	LLT_VOLATILE	387
-#define	LLT_PRINTFLIKE	388
-#define	LLT_SCANFLIKE	389
-#define	LLT_MESSAGELIKE	390
-
-#line 36 "llgrammar.y"
-
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "lclscan.h"
-# include "checking.h"
-# include "lslparse.h" 
-# include "lh.h"
-# include "usymtab_interface.h"
-
-/*@-noparams@*/
-static /*@unused@*/ void yyprint ();
-/*@=noparams@*/
-
-/*@-redecl@*/
-void ylerror (char *) /*@modifies *g_msgstream@*/ ;
-/*@=redecl@*/
-
-bool g_inTypeDef = FALSE;
-
-/*@constant int YYDEBUG;@*/
-# define YYDEBUG 1
-
-/*@notfunction@*/
-# define YYPRINT(file, type, value) yyprint (file, type, value)
-
-/*
-** This is necessary, or else when the bison-generated code #include's malloc.h,
-** there will be a parse error.
-**
-** Unfortunately, it means the error checking on malloc, etc. is lost for allocations
-** in bison-generated files under Win32.
-*/
-
-# ifdef WIN32
-# undef malloc
-# undef calloc
-# undef realloc
-# endif
-
-
-#line 78 "llgrammar.y"
-typedef union 
-{
-  ltoken ltok;  /* a leaf is also an ltoken */
-  qual typequal;
-  unsigned int count;
-  /*@only@*/ ltokenList ltokenList;
-  /*@only@*/ abstDeclaratorNode abstDecl; 
-  /*@only@*/ declaratorNode declare;
-  /*@only@*/ declaratorNodeList declarelist;
-  /*@only@*/ typeExpr typeexpr;
-  /*@only@*/ arrayQualNode array;
-  /*@only@*/ quantifierNode quantifier;
-  /*@only@*/ quantifierNodeList quantifiers;
-  /*@only@*/ varNode var;
-  /*@only@*/ varNodeList vars;
-  /*@only@*/ storeRefNode storeref;
-  /*@only@*/ storeRefNodeList storereflist;
-  /*@only@*/ termNode term;
-  /*@only@*/ termNodeList termlist;
-  /*@only@*/ programNode program; 
-  /*@only@*/ stmtNode stmt;
-  /*@only@*/ claimNode claim;
-  /*@only@*/ typeNode type;
-  /*@only@*/ iterNode iter;
-  /*@only@*/ fcnNode fcn;
-  /*@only@*/ fcnNodeList fcns;
-  /*@only@*/ letDeclNode letdecl;
-  /*@only@*/ letDeclNodeList letdecls;
-  /*@only@*/ lclPredicateNode lclpredicate;
-  /*@only@*/ modifyNode modify;
-  /*@only@*/ paramNode param;
-  /*@only@*/ paramNodeList paramlist;
-  /*@only@*/ declaratorInvNodeList declaratorinvs;	
-  /*@only@*/ declaratorInvNode declaratorinv;	
-  /*@only@*/ abstBodyNode abstbody;
-  /*@only@*/ abstractNode abstract;
-  /*@only@*/ exposedNode exposed;
-  /*    taggedUnionNode taggedunion; */
-  /*@only@*/ globalList globals;
-  /*@only@*/ constDeclarationNode constdeclaration;
-  /*@only@*/ varDeclarationNode vardeclaration;
-  /*@only@*/ varDeclarationNodeList vardeclarationlist;
-  /*@only@*/ initDeclNodeList initdecls;
-  /*@only@*/ initDeclNode initdecl;
-  /*@only@*/ stDeclNodeList structdecls;
-  /*@only@*/ stDeclNode structdecl;
-  /*@only@*/ strOrUnionNode structorunion;
-  /*@only@*/ enumSpecNode enumspec; 
-  /*@only@*/ lclTypeSpecNode lcltypespec;
-  /*@only@*/ typeNameNode typname;
-  /*@only@*/ opFormNode opform;
-  /*@only@*/ sigNode signature;
-  /*@only@*/ nameNode name;
-  /*@only@*/ typeNameNodeList namelist;
-  /*@only@*/ replaceNode replace;	
-  /*@only@*/ replaceNodeList replacelist;
-  /*@only@*/ renamingNode renaming;
-  /*@only@*/ traitRefNode traitref;
-  /*@only@*/ traitRefNodeList traitreflist;
-  /*@only@*/ importNode import;
-  /*@only@*/ importNodeList importlist;
-  /*@only@*/ interfaceNode iface;
-  /*@only@*/ interfaceNodeList interfacelist; 
-  /*@only@*/ CTypesNode ctypes;
-} YYSTYPE;
-#ifndef YYDEBUG
-#define YYDEBUG 1
-#endif
-
-#include 
-
-#ifndef __cplusplus
-#ifndef __STDC__
-#define const
-#endif
-#endif
-
-
-
-#define	YYFINAL		684
-#define	YYFLAG		-32768
-#define	YYNTBASE	137
-
-#define YYTRANSLATE(x) ((unsigned)(x) <= 390 ? yytranslate[x] : 291)
-
-static const short yytranslate[] = {     0,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
-     7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
-    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
-    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
-    37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
-    47,    48,    49,    50,    51,    52,    53,    54,    55,    56,
-    57,    58,    59,    60,    61,    62,    63,    64,    65,    66,
-    67,    68,    69,    70,    71,    72,    73,    74,    75,    76,
-    77,    78,    79,    80,    81,    82,    83,    84,    85,    86,
-    87,    88,    89,    90,    91,    92,    93,    94,    95,    96,
-    97,    98,    99,   100,   101,   102,   103,   104,   105,   106,
-   107,   108,   109,   110,   111,   112,   113,   114,   115,   116,
-   117,   118,   119,   120,   121,   122,   123,   124,   125,   126,
-   127,   128,   129,   130,   131,   132,   133,   134,   135,   136
-};
-
-#if YYDEBUG != 0
-static const short yyprhs[] = {     0,
-     0,     1,     5,     6,     9,    11,    13,    14,    17,    20,
-    21,    24,    26,    28,    30,    34,    38,    40,    42,    44,
-    46,    48,    50,    57,    58,    60,    62,    66,    69,    71,
-    72,    76,    78,    80,    82,    84,    89,    93,    98,   103,
-   105,   107,   109,   111,   113,   114,   128,   129,   144,   145,
-   159,   164,   165,   166,   173,   174,   175,   183,   184,   185,
-   193,   194,   195,   202,   203,   204,   211,   214,   217,   219,
-   223,   225,   229,   231,   233,   237,   239,   241,   245,   247,
-   252,   256,   263,   265,   269,   271,   273,   277,   279,   283,
-   285,   289,   293,   297,   302,   304,   306,   308,   310,   312,
-   316,   318,   322,   323,   326,   330,   333,   336,   337,   340,
-   345,   346,   350,   352,   356,   362,   366,   368,   369,   373,
-   374,   378,   379,   383,   387,   391,   393,   397,   399,   401,
-   404,   406,   408,   409,   413,   414,   418,   419,   421,   423,
-   425,   429,   431,   435,   436,   441,   447,   449,   453,   456,
-   460,   464,   469,   473,   479,   486,   488,   492,   494,   496,
-   499,   502,   506,   510,   514,   519,   521,   525,   530,   534,
-   535,   538,   539,   541,   542,   549,   551,   555,   556,   560,
-   561,   565,   567,   569,   571,   573,   575,   577,   579,   581,
-   583,   585,   587,   590,   592,   594,   596,   598,   600,   602,
-   604,   606,   608,   610,   612,   614,   616,   618,   620,   622,
-   624,   626,   628,   630,   632,   634,   636,   638,   640,   642,
-   644,   646,   648,   650,   652,   654,   656,   658,   660,   662,
-   664,   666,   668,   670,   672,   675,   681,   683,   686,   688,
-   691,   692,   699,   700,   707,   710,   713,   714,   716,   718,
-   721,   725,   727,   731,   732,   734,   741,   744,   746,   750,
-   752,   754,   756,   760,   763,   766,   770,   775,   777,   781,
-   784,   787,   791,   796,   798,   801,   804,   808,   813,   816,
-   819,   822,   825,   829,   831,   832,   834,   838,   841,   843,
-   845,   848,   852,   856,   861,   864,   868,   875,   877,   880,
-   883,   887,   891,   896,   901,   907,   911,   916,   921,   927,
-   930,   933,   937,   941,   943,   945,   947,   949,   951,   953,
-   955,   956,   958,   960,   964,   966,   968,   973,   974,   976,
-   978,   982,   984,   986,   993,   995,   999,  1001,  1006,  1010,
-  1014,  1016,  1019,  1022,  1024,  1026,  1028,  1031,  1033,  1036,
-  1039,  1043,  1045,  1047,  1050,  1053,  1057,  1059,  1062,  1066,
-  1068,  1074,  1078,  1083,  1086,  1090,  1093,  1095,  1099,  1103,
-  1105,  1110,  1112,  1115,  1119,  1123,  1127,  1132,  1136,  1138,
-  1142,  1144,  1146,  1148,  1150,  1152,  1154,  1159,  1164,  1169,
-  1174,  1181,  1186,  1188,  1190,  1192,  1194,  1196,  1199,  1200,
-  1204,  1206,  1210,  1214,  1219,  1221,  1223,  1225,  1227,  1229,
-  1231,  1233,  1235
-};
-
-static const short yyrhs[] = {    -1,
-   139,   138,   141,     0,     0,   139,   140,     0,   144,     0,
-   145,     0,     0,   146,   142,     0,   151,   142,     0,     0,
-   142,   143,     0,   146,     0,   151,     0,   145,     0,    57,
-   175,     7,     0,   115,   179,     7,     0,   154,     0,   155,
-     0,   156,     0,   158,     0,   161,     0,   147,     0,   122,
-   285,    10,   148,    37,     7,     0,     0,   149,     0,   150,
-     0,   149,    32,   150,     0,   123,   244,     0,   244,     0,
-     0,   109,   152,   153,     0,   154,     0,   155,     0,   156,
-     0,   158,     0,    50,   227,   189,     7,     0,   227,   189,
-     7,     0,   117,   227,   189,     7,     0,   133,   227,   189,
-     7,     0,   163,     0,   172,     0,   134,     0,   135,     0,
-   136,     0,     0,   227,   240,   191,   159,    34,   193,   195,
-   199,   200,   201,   204,   205,    35,     0,     0,   157,   227,
-   240,   191,   160,    34,   193,   195,   199,   200,   201,   204,
-   205,    35,     0,     0,    48,   287,    10,   206,    37,   191,
-   162,    34,   195,   200,   209,   204,    35,     0,    48,   284,
-   287,     7,     0,     0,     0,    62,   164,   112,    20,   165,
-   214,     0,     0,     0,    62,   166,    97,   112,    20,   167,
-   214,     0,     0,     0,    97,    62,   168,   112,    20,   169,
-   214,     0,     0,     0,    56,   170,   112,    20,   171,   214,
-     0,     0,     0,   113,   227,   173,   219,   174,     7,     0,
-   230,     7,     0,   238,     7,     0,   176,     0,   175,    32,
-   176,     0,   178,     0,     3,   178,     3,     0,    43,     0,
-   178,     0,   177,    32,   178,     0,   283,     0,   180,     0,
-   179,    32,   180,     0,   289,     0,   289,    10,   182,    37,
-     0,    10,   181,    37,     0,    10,   181,    37,    10,   182,
-    37,     0,   289,     0,   181,    32,   289,     0,   184,     0,
-   183,     0,   183,    32,   184,     0,   245,     0,   183,    32,
-   245,     0,   185,     0,   184,    32,   185,     0,   245,    53,
-   223,     0,   245,    53,   186,     0,   245,    53,   186,   256,
-     0,   290,     0,   249,     0,   188,     0,   260,     0,   190,
-     0,   189,    32,   190,     0,   240,     0,   240,    33,   187,
-     0,     0,   191,   192,     0,   227,   189,     7,     0,    64,
-     7,     0,    65,     7,     0,     0,   193,   194,     0,   105,
-   227,   189,     7,     0,     0,    60,   196,     7,     0,   197,
-     0,   196,    32,   197,     0,   285,    31,   198,    46,   260,
-     0,   285,    46,   260,     0,   227,     0,     0,    49,   259,
-     7,     0,     0,   106,   259,     7,     0,     0,    61,    63,
-     7,     0,    61,    45,     7,     0,    61,   202,     7,     0,
-   203,     0,   202,    32,   203,     0,   260,     0,   228,     0,
-    66,   228,     0,    64,     0,    65,     0,     0,    52,   259,
-     7,     0,     0,    48,   259,     7,     0,     0,   207,     0,
-   208,     0,   129,     0,   208,    32,   129,     0,   244,     0,
-   208,    32,   244,     0,     0,    47,    34,   210,    35,     0,
-    47,    34,   210,     7,    35,     0,   211,     0,    10,   210,
-    37,     0,   210,     6,     0,   210,     8,   210,     0,   210,
-     7,   210,     0,   284,    10,   212,    37,     0,   284,    10,
-    37,     0,   285,    33,   284,    10,    37,     0,   285,    33,
-   284,    10,   212,    37,     0,   213,     0,   212,    32,   213,
-     0,   277,     0,   285,     0,     3,   213,     0,   213,     3,
-     0,   213,     3,   213,     0,    10,   213,    37,     0,   284,
-    10,    37,     0,   284,    10,   212,    37,     0,     7,     0,
-    34,   215,    35,     0,    34,   177,    35,     7,     0,    34,
-    35,     7,     0,     0,   215,   158,     0,     0,   217,     0,
-     0,    58,   218,   279,    10,   259,    37,     0,   220,     0,
-   219,    32,   220,     0,     0,   240,   221,   222,     0,     0,
-    34,   216,    35,     0,   132,     0,   116,     0,   118,     0,
-   120,     0,   121,     0,   124,     0,   125,     0,   126,     0,
-   131,     0,   127,     0,   223,     0,   224,   223,     0,    20,
-     0,   224,     0,    67,     0,    78,     0,    68,     0,    69,
-     0,    71,     0,    72,     0,    73,     0,    74,     0,    95,
-     0,    79,     0,    80,     0,    82,     0,    83,     0,    81,
-     0,    75,     0,    76,     0,    77,     0,    87,     0,    88,
-     0,    89,     0,    90,     0,    91,     0,    99,     0,   100,
-     0,    97,     0,    98,     0,   104,     0,   101,     0,    92,
-     0,    93,     0,    94,     0,    96,     0,    70,     0,   102,
-     0,    84,     0,    85,     0,   225,     0,   230,     0,   238,
-     0,   226,   227,     0,     8,   228,    31,   228,     8,     0,
-   227,     0,   227,   229,     0,     6,     0,   229,     6,     0,
-     0,   128,   233,   231,    34,   234,    35,     0,     0,   130,
-   233,   232,    34,   234,    35,     0,   128,   286,     0,   130,
-   286,     0,     0,   286,     0,   235,     0,   234,   235,     0,
-   227,   236,     7,     0,   240,     0,   236,    32,   240,     0,
-     0,    32,     0,   119,   233,    34,   239,   237,    35,     0,
-   119,   286,     0,    25,     0,   239,    32,    25,     0,   242,
-     0,   241,     0,   285,     0,    10,   241,    37,     0,     6,
-   241,     0,   241,   248,     0,   241,    10,    37,     0,   241,
-    10,   207,    37,     0,    20,     0,    10,   242,    37,     0,
-     6,   242,     0,   242,   248,     0,   242,    10,    37,     0,
-   242,    10,   207,    37,     0,    20,     0,     6,   243,     0,
-   243,   248,     0,   243,    10,    37,     0,   243,    10,   207,
-    37,     0,   227,   243,     0,   227,   241,     0,   227,   246,
-     0,   227,   246,     0,    66,   227,   246,     0,   249,     0,
-     0,   247,     0,    10,   247,    37,     0,     6,   247,     0,
-     6,     0,   248,     0,   247,   248,     0,   247,    10,    37,
-     0,    10,   207,    37,     0,   247,    10,   207,    37,     0,
-    11,    36,     0,    11,   188,    36,     0,    55,    27,   111,
-    27,    51,    27,     0,   252,     0,    27,   252,     0,   252,
-    27,     0,    27,   252,    27,     0,   250,   253,   251,     0,
-    27,   250,   253,   251,     0,   250,   253,   251,    27,     0,
-    27,   250,   253,   251,    27,     0,    11,   253,    36,     0,
-    11,   253,    36,    27,     0,    27,    11,   253,    36,     0,
-    27,    11,   253,    36,    27,     0,    12,   283,     0,    26,
-   283,     0,    27,    12,   283,     0,    27,    26,   283,     0,
-    22,     0,    34,     0,    23,     0,    35,     0,   264,     0,
-    14,     0,    39,     0,     0,   254,     0,    27,     0,   254,
-   255,    27,     0,    32,     0,    24,     0,    31,   257,    26,
-   288,     0,     0,   258,     0,   288,     0,   258,    32,   288,
-     0,   260,     0,   261,     0,    55,   261,   111,   261,    51,
-   261,     0,   262,     0,   261,    14,   261,     0,   263,     0,
-   278,    10,   259,    37,     0,   263,    39,   263,     0,   263,
-    33,   263,     0,   265,     0,   268,   266,     0,   268,   267,
-     0,     3,     0,     6,     0,   268,     0,   264,   265,     0,
-   264,     0,   266,   264,     0,   264,   268,     0,   267,   264,
-   268,     0,   273,     0,   269,     0,   269,   273,     0,   273,
-   269,     0,   273,   269,   273,     0,   270,     0,   270,   273,
-     0,   271,    31,   288,     0,   271,     0,    11,   272,    36,
-    31,   288,     0,    11,   272,    36,     0,    11,    36,    31,
-   288,     0,    11,    36,     0,   250,   272,   251,     0,   250,
-   251,     0,   260,     0,   272,   255,   260,     0,    10,   261,
-    37,     0,   285,     0,   290,    10,   274,    37,     0,   276,
-     0,   273,   275,     0,   273,    12,   283,     0,   273,    26,
-   283,     0,   273,    11,    36,     0,   273,    11,   274,    36,
-     0,   273,    31,   288,     0,   261,     0,   274,    32,   261,
-     0,    28,     0,    29,     0,    30,     0,    38,     0,   277,
-     0,   107,     0,    54,    10,   274,    37,     0,   114,    10,
-    44,    37,     0,   114,    10,   202,    37,     0,   108,    10,
-   260,    37,     0,    59,    10,   260,    32,   260,    37,     0,
-   108,    10,   227,    37,     0,    42,     0,    43,     0,    40,
-     0,    41,     0,   279,     0,   278,   279,     0,     0,    21,
-   280,   281,     0,   282,     0,   281,    32,   282,     0,   285,
-    31,   198,     0,   285,    31,    66,   198,     0,    25,     0,
-    20,     0,    25,     0,    25,     0,   283,     0,   283,     0,
-   283,     0,   283,     0,   283,     0
-};
-
-#endif
-
-#if YYDEBUG != 0
-static const short yyrline[] = { 0,
-   383,   384,   387,   388,   391,   392,   395,   396,   397,   400,
-   401,   404,   405,   406,   409,   415,   419,   421,   423,   425,
-   427,   429,   433,   437,   438,   441,   443,   447,   448,   451,
-   452,   455,   457,   459,   461,   465,   469,   471,   473,   477,
-   478,   481,   482,   483,   486,   487,   494,   496,   507,   509,
-   512,   516,   516,   517,   518,   518,   520,   521,   522,   523,
-   524,   524,   525,   528,   529,   530,   531,   533,   549,   551,
-   555,   556,   558,   561,   562,   565,   569,   571,   575,   577,
-   579,   581,   585,   586,   589,   591,   593,   596,   598,   601,
-   603,   606,   607,   608,   612,   613,   615,   617,   620,   622,
-   626,   627,   630,   632,   636,   637,   638,   641,   642,   645,
-   649,   650,   653,   654,   657,   658,   660,   663,   664,   667,
-   668,   671,   672,   673,   674,   677,   678,   681,   682,   683,
-   684,   685,   688,   689,   692,   693,   696,   697,   700,   701,
-   702,   705,   706,   709,   710,   711,   714,   715,   718,   723,
-   729,   737,   739,   741,   743,   747,   748,   751,   752,   753,
-   754,   755,   756,   757,   759,   763,   764,   765,   766,   769,
-   770,   773,   774,   777,   777,   786,   787,   791,   792,   795,
-   796,   799,   800,   801,   802,   803,   804,   805,   806,   807,
-   808,   816,   817,   822,   824,   830,   831,   832,   833,   834,
-   835,   836,   837,   838,   839,   840,   841,   842,   843,   844,
-   845,   846,   847,   848,   849,   850,   851,   852,   853,   854,
-   855,   856,   857,   858,   859,   860,   861,   862,   863,   864,
-   865,   868,   870,   872,   874,   876,   885,   886,   891,   892,
-   895,   897,   899,   901,   903,   905,   909,   910,   913,   914,
-   919,   922,   924,   928,   929,   932,   934,   938,   939,   949,
-   950,   953,   954,   955,   956,   957,   958,   961,   962,   963,
-   964,   965,   966,   975,   976,   977,   978,   979,   985,   986,
-   987,   997,   998,   999,  1004,  1005,  1008,  1009,  1010,  1011,
-  1012,  1013,  1014,  1015,  1018,  1019,  1022,  1024,  1026,  1028,
-  1030,  1033,  1035,  1037,  1039,  1041,  1043,  1051,  1053,  1055,
-  1058,  1061,  1064,  1069,  1070,  1073,  1074,  1077,  1078,  1079,
-  1082,  1083,  1086,  1087,  1090,  1091,  1094,  1097,  1098,  1101,
-  1102,  1105,  1108,  1114,  1116,  1117,  1120,  1121,  1126,  1128,
-  1132,  1133,  1134,  1137,  1138,  1141,  1142,  1145,  1146,  1149,
-  1150,  1153,  1154,  1155,  1156,  1157,  1158,  1159,  1162,  1163,
-  1166,  1169,  1171,  1175,  1179,  1180,  1183,  1184,  1187,  1189,
-  1191,  1193,  1194,  1196,  1198,  1200,  1203,  1205,  1209,  1210,
-  1213,  1214,  1215,  1216,  1219,  1220,  1221,  1222,  1223,  1224,
-  1229,  1235,  1245,  1246,  1247,  1248,  1251,  1253,  1257,  1261,
-  1264,  1265,  1268,  1269,  1272,  1273,  1276,  1277,  1278,  1279,
-  1280,  1281,  1282
-};
-#endif
-
-
-#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
-
-static const char * const yytname[] = {   "$","error","$undefined.","simpleOp",
-"PREFIX_OP","POSTFIX_OP","LLT_MULOP","LLT_SEMI","LLT_VERTICALBAR","ITERATION_OP",
-"LLT_LPAR","LLT_LBRACKET","selectSym","LLT_IF_THEN_ELSE","logicalOp","eqSepSym",
-"equationSym","commentSym","LLT_WHITESPACE","LLT_EOL","LLT_TYPEDEF_NAME","quantifierSym",
-"openSym","closeSym","sepSym","simpleId","mapSym","markerSym","preSym","postSym",
-"anySym","LLT_COLON","LLT_COMMA","LLT_EQUALS","LLT_LBRACE","LLT_RBRACE","LLT_RBRACKET",
-"LLT_RPAR","LLT_QUOTE","eqOp","LLT_CCHAR","LLT_CFLOAT","LLT_CINTEGER","LLT_LCSTRING",
-"LLT_ALL","LLT_ANYTHING","LLT_BE","LLT_BODY","LLT_CLAIMS","LLT_CHECKS","LLT_CONSTANT",
-"LLT_ELSE","LLT_ENSURES","LLT_FOR","LLT_FRESH","LLT_IF","LLT_IMMUTABLE","LLT_IMPORTS",
-"LLT_CONSTRAINT","LLT_ISSUB","LLT_LET","LLT_MODIFIES","LLT_MUTABLE","LLT_NOTHING",
-"LLT_INTERNAL","LLT_FILESYS","LLT_OBJ","LLT_OUT","LLT_SEF","LLT_ONLY","LLT_PARTIAL",
-"LLT_OWNED","LLT_DEPENDENT","LLT_KEEP","LLT_KEPT","LLT_TEMP","LLT_SHARED","LLT_UNIQUE",
-"LLT_UNUSED","LLT_EXITS","LLT_MAYEXIT","LLT_NEVEREXIT","LLT_TRUEEXIT","LLT_FALSEEXIT",
-"LLT_UNDEF","LLT_KILLED","LLT_CHECKMOD","LLT_CHECKED","LLT_UNCHECKED","LLT_CHECKEDSTRICT",
-"LLT_TRUENULL","LLT_FALSENULL","LLT_LNULL","LLT_LNOTNULL","LLT_RETURNED","LLT_OBSERVER",
-"LLT_EXPOSED","LLT_REFCOUNTED","LLT_REFS","LLT_RELNULL","LLT_RELDEF","LLT_KILLREF",
-"LLT_NULLTERMINATED","LLT_TEMPREF","LLT_NEWREF","LLT_PRIVATE","LLT_REQUIRES",
-"LLT_RESULT","LLT_SIZEOF","LLT_SPEC","LLT_TAGGEDUNION","LLT_THEN","LLT_TYPE",
-"LLT_TYPEDEF","LLT_UNCHANGED","LLT_USES","LLT_CHAR","LLT_CONST","LLT_DOUBLE",
-"LLT_ENUM","LLT_FLOAT","LLT_INT","LLT_ITER","LLT_YIELD","LLT_LONG","LLT_SHORT",
-"LLT_SIGNED","LLT_UNKNOWN","LLT_STRUCT","LLT_TELIPSIS","LLT_UNION","LLT_UNSIGNED",
-"LLT_VOID","LLT_VOLATILE","LLT_PRINTFLIKE","LLT_SCANFLIKE","LLT_MESSAGELIKE",
-"interface","@1","externals","external","optDeclarations","declarations","declaration",
-"imports","uses","export","iter","iterParamList","realIterParamList","iterParam",
-"private","@2","private2","constDeclaration","varDeclaration","type","special",
-"fcn","@3","@4","claim","@5","abstract","@6","@7","@8","@9","@10","@11","@12",
-"@13","exposed","@14","@15","importNameList","importName","interfaceNameList",
-"interfaceName","traitRefNodeList","traitRef","traitIdList","renaming","nameList",
-"replaceNodeList","replace","name","initializer","constLclExpr","initDecls",
-"initDecl","globals","globalDecl","privateInits","privateInit","optLetDecl",
-"beDeclList","beDecl","sortSpec","optChecks","optRequire","optModify","storeRefList",
-"storeRef","optEnsure","optClaim","optParamList","realParamList","paramList",
-"optBody","callExpr","stmt","valueList","value","abstBody","fcns","optTypeInv",
-"typeInv","@16","declaratorInvs","declaratorInv","@17","optExposedBody","CType",
-"CTypes","typeSpecifier","specialQualifier","lclTypeSpec","lclType","pointers",
-"structOrUnionSpec","@18","@19","optTagId","structDecls","structDecl","declaratorList",
-"optCOMMA","enumSpec","enumeratorList","declarator","notype_decl","after_type_decl",
-"parameter_decl","param","typeName","optAbstDeclarator","abstDeclarator","arrayQual",
-"opForm","open","close","anyOp","middle","placeList","separator","signature",
-"domain","sortList","lclPredicate","term","term0","equalityTerm","simpleOpTerm",
-"simpleOp2","prefixOpTerm","postfixOps","infixOpPart","secondary","bracketed",
-"sqBracketed","matched","args","primary","termList","stateFcn","lclPrimary",
-"cLiteral","quantifiers","quantifier","@20","quantifiedList","quantified","simpleIdOrTypedefName",
-"fcnId","varId","tagId","claimId","sortId","traitId","opId", NULL
-};
-#endif
-
-static const short yyr1[] = {     0,
-   138,   137,   139,   139,   140,   140,   141,   141,   141,   142,
-   142,   143,   143,   143,   144,   145,   146,   146,   146,   146,
-   146,   146,   147,   148,   148,   149,   149,   150,   150,   152,
-   151,   153,   153,   153,   153,   154,   155,   155,   155,   156,
-   156,   157,   157,   157,   159,   158,   160,   158,   162,   161,
-   161,   164,   165,   163,   166,   167,   163,   168,   169,   163,
-   170,   171,   163,   173,   174,   172,   172,   172,   175,   175,
-   176,   176,   176,   177,   177,   178,   179,   179,   180,   180,
-   180,   180,   181,   181,   182,   182,   182,   183,   183,   184,
-   184,   185,   185,   185,   186,   186,   187,   188,   189,   189,
-   190,   190,   191,   191,   192,   192,   192,   193,   193,   194,
-   195,   195,   196,   196,   197,   197,   198,   199,   199,   200,
-   200,   201,   201,   201,   201,   202,   202,   203,   203,   203,
-   203,   203,   204,   204,   205,   205,   206,   206,   207,   207,
-   207,   208,   208,   209,   209,   209,   210,   210,   210,   210,
-   210,   211,   211,   211,   211,   212,   212,   213,   213,   213,
-   213,   213,   213,   213,   213,   214,   214,   214,   214,   215,
-   215,   216,   216,   218,   217,   219,   219,   221,   220,   222,
-   222,   223,   223,   223,   223,   223,   223,   223,   223,   223,
-   223,   224,   224,   225,   225,   226,   226,   226,   226,   226,
-   226,   226,   226,   226,   226,   226,   226,   226,   226,   226,
-   226,   226,   226,   226,   226,   226,   226,   226,   226,   226,
-   226,   226,   226,   226,   226,   226,   226,   226,   226,   226,
-   226,   227,   227,   227,   227,   227,   228,   228,   229,   229,
-   231,   230,   232,   230,   230,   230,   233,   233,   234,   234,
-   235,   236,   236,   237,   237,   238,   238,   239,   239,   240,
-   240,   241,   241,   241,   241,   241,   241,   242,   242,   242,
-   242,   242,   242,   243,   243,   243,   243,   243,   244,   244,
-   244,   245,   245,   245,   246,   246,   247,   247,   247,   247,
-   247,   247,   247,   247,   248,   248,   249,   249,   249,   249,
-   249,   249,   249,   249,   249,   249,   249,   249,   249,   249,
-   249,   249,   249,   250,   250,   251,   251,   252,   252,   252,
-   253,   253,   254,   254,   255,   255,   256,   257,   257,   258,
-   258,   259,   260,   261,   261,   261,   262,   262,   262,   262,
-   263,   263,   263,   264,   264,   265,   265,   266,   266,   267,
-   267,   268,   268,   268,   268,   268,   268,   268,   269,   269,
-   270,   270,   270,   270,   271,   271,   272,   272,   273,   273,
-   273,   273,   273,   273,   273,   273,   273,   273,   274,   274,
-   275,   275,   275,   275,   276,   276,   276,   276,   276,   276,
-   276,   276,   277,   277,   277,   277,   278,   278,   280,   279,
-   281,   281,   282,   282,   283,   283,   284,   285,   286,   287,
-   288,   289,   290
-};
-
-static const short yyr2[] = {     0,
-     0,     3,     0,     2,     1,     1,     0,     2,     2,     0,
-     2,     1,     1,     1,     3,     3,     1,     1,     1,     1,
-     1,     1,     6,     0,     1,     1,     3,     2,     1,     0,
-     3,     1,     1,     1,     1,     4,     3,     4,     4,     1,
-     1,     1,     1,     1,     0,    13,     0,    14,     0,    13,
-     4,     0,     0,     6,     0,     0,     7,     0,     0,     7,
-     0,     0,     6,     0,     0,     6,     2,     2,     1,     3,
-     1,     3,     1,     1,     3,     1,     1,     3,     1,     4,
-     3,     6,     1,     3,     1,     1,     3,     1,     3,     1,
-     3,     3,     3,     4,     1,     1,     1,     1,     1,     3,
-     1,     3,     0,     2,     3,     2,     2,     0,     2,     4,
-     0,     3,     1,     3,     5,     3,     1,     0,     3,     0,
-     3,     0,     3,     3,     3,     1,     3,     1,     1,     2,
-     1,     1,     0,     3,     0,     3,     0,     1,     1,     1,
-     3,     1,     3,     0,     4,     5,     1,     3,     2,     3,
-     3,     4,     3,     5,     6,     1,     3,     1,     1,     2,
-     2,     3,     3,     3,     4,     1,     3,     4,     3,     0,
-     2,     0,     1,     0,     6,     1,     3,     0,     3,     0,
-     3,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-     1,     1,     2,     1,     1,     1,     1,     1,     1,     1,
-     1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-     1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-     1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
-     1,     1,     1,     1,     2,     5,     1,     2,     1,     2,
-     0,     6,     0,     6,     2,     2,     0,     1,     1,     2,
-     3,     1,     3,     0,     1,     6,     2,     1,     3,     1,
-     1,     1,     3,     2,     2,     3,     4,     1,     3,     2,
-     2,     3,     4,     1,     2,     2,     3,     4,     2,     2,
-     2,     2,     3,     1,     0,     1,     3,     2,     1,     1,
-     2,     3,     3,     4,     2,     3,     6,     1,     2,     2,
-     3,     3,     4,     4,     5,     3,     4,     4,     5,     2,
-     2,     3,     3,     1,     1,     1,     1,     1,     1,     1,
-     0,     1,     1,     3,     1,     1,     4,     0,     1,     1,
-     3,     1,     1,     6,     1,     3,     1,     4,     3,     3,
-     1,     2,     2,     1,     1,     1,     2,     1,     2,     2,
-     3,     1,     1,     2,     2,     3,     1,     2,     3,     1,
-     5,     3,     4,     2,     3,     2,     1,     3,     3,     1,
-     4,     1,     2,     3,     3,     3,     4,     3,     1,     3,
-     1,     1,     1,     1,     1,     1,     4,     4,     4,     4,
-     6,     4,     1,     1,     1,     1,     1,     2,     0,     3,
-     1,     3,     3,     4,     1,     1,     1,     1,     1,     1,
-     1,     1,     1
-};
-
-static const short yydefact[] = {     3,
-     1,     0,     0,     7,     4,     5,     6,     0,   406,   405,
-    73,     0,    69,    71,    76,     0,     0,    77,   412,    79,
-     0,   194,     0,     0,    61,    52,   196,   198,   199,   228,
-   200,   201,   202,   203,   210,   211,   212,   197,   205,   206,
-   209,   207,   208,   230,   231,   213,   214,   215,   216,   217,
-   224,   225,   226,   204,   227,   220,   221,   218,   219,   223,
-   229,   222,    30,     0,   183,     0,   184,   247,   185,   186,
-     0,   187,   188,   189,   191,   247,   247,   190,   182,     0,
-    42,    43,    44,     2,    10,    22,    10,    17,    18,    19,
-     0,    20,    21,    40,    41,   192,   195,   232,     0,     0,
-   233,   234,     0,    15,     0,     0,    83,    16,     0,     0,
-   220,   237,     0,   233,   234,   407,   410,     0,     0,     0,
-     0,     0,     0,    58,     0,    64,     0,     0,   409,   257,
-   408,     0,   241,   245,   243,   246,     0,     8,     9,     0,
-   193,   235,     0,     0,   268,     0,    99,   103,   261,   260,
-   262,    67,    68,    72,    70,     0,    81,    78,   344,   345,
-   321,     0,   319,   314,     0,     0,   315,   320,     0,     0,
-     0,    86,    85,    90,   285,    88,   284,   321,   298,   318,
-   239,   238,     0,     0,   137,     0,   101,     0,     0,     0,
-     0,    31,    32,    33,    34,    35,     0,     0,     0,    24,
-     0,     0,     0,    11,    14,    12,    13,   103,   264,   270,
-     0,     0,    37,     0,     0,    45,     0,     0,   265,     0,
-   271,    84,     0,   323,     0,   322,   310,   311,   321,     0,
-     0,   321,   299,     0,   285,    80,     0,     0,   289,     0,
-   282,   286,   290,     0,     0,   300,   240,     0,    51,   140,
-     0,   138,   139,   285,   142,    36,    62,    53,     0,     0,
-    65,   176,   178,    38,   258,   254,     0,     0,    25,    26,
-    29,     0,     0,    39,    47,   263,   269,   100,     0,     0,
-   399,   408,   395,   396,   393,   394,     0,     0,     0,   386,
-     0,     0,   102,    97,     0,    98,   333,   335,   337,     0,
-   341,   346,   353,   357,   360,   352,   372,   385,     0,   397,
-   413,   370,     0,     0,     0,     0,   104,     0,   266,     0,
-   295,     0,   272,     0,     0,   306,   326,   325,     0,     0,
-   312,   313,     0,   301,     0,   283,    87,    89,    91,     0,
-   288,     0,     0,     0,   291,    93,    92,    96,    95,   316,
-   317,   302,   236,   103,     0,   289,     0,   274,   280,   279,
-   281,     0,     0,    56,    59,     0,     0,   180,   255,     0,
-    28,     0,     0,     0,     0,   249,     0,     0,     0,   364,
-   367,     0,     0,     0,     0,     0,     0,     0,   366,     0,
-     0,     0,     0,   347,   346,   348,   342,   343,   354,   358,
-     0,     0,     0,     0,   381,   382,   383,     0,   384,   355,
-   373,     0,   398,     0,   106,   107,   108,     0,   267,   296,
-   273,    82,   307,   324,   308,   303,     0,   293,   287,   292,
-     0,   328,    94,   304,    49,   141,   143,   275,   289,     0,
-   276,   166,   170,    63,    54,     0,     0,   177,    66,   172,
-   179,   259,   256,    23,    27,     0,   252,   242,   250,   244,
-   108,   369,     0,   362,     0,   400,   401,     0,   379,     0,
-     0,     0,   194,     0,     0,     0,   131,   132,     0,     0,
-   126,   129,   128,   365,   336,   340,   339,   350,   349,     0,
-   411,   359,   376,     0,   374,   375,   378,   356,     0,   332,
-     0,   111,   105,   309,   305,     0,   294,     0,   329,   330,
-     0,   277,     0,     0,     0,    74,     0,    57,    60,   174,
-     0,   173,   251,     0,   111,   363,     0,   368,     0,     0,
-     0,   387,     0,     0,   392,   390,   388,   130,     0,   389,
-   351,   377,   338,   371,     0,     0,   109,   118,   297,     0,
-     0,   111,   278,   169,     0,     0,   167,   171,     0,     0,
-   181,   253,   118,   361,   402,     0,   403,   117,   380,     0,
-     0,   127,     0,   113,     0,     0,     0,   120,   327,   331,
-   120,    75,   168,   103,     0,   120,   404,   334,   391,   112,
-     0,     0,     0,     0,     0,     0,   122,   144,     0,   122,
-   114,     0,   116,   110,   119,     0,     0,   133,     0,   133,
-     0,   133,     0,   121,     0,     0,     0,     0,   135,     0,
-     0,   175,   135,   115,   124,   123,   125,     0,     0,     0,
-     0,   408,     0,   147,     0,     0,    50,     0,   134,     0,
-    46,     0,   149,     0,     0,   145,     0,     0,    48,   136,
-     0,   148,   146,   151,   150,     0,     0,   153,     0,   156,
-   158,     0,   159,   407,     0,   160,     0,     0,   152,   161,
-     0,     0,   163,   157,   162,   164,     0,   154,     0,   165,
-   155,     0,     0,     0
-};
-
-static const short yydefgoto[] = {   682,
-     4,     1,     5,    84,   138,   204,     6,   205,   206,    86,
-   268,   269,   270,   207,   125,   192,    88,    89,    90,    91,
-    92,   316,   378,    93,   511,    94,   122,   363,   123,   446,
-   191,   447,   121,   362,    95,   197,   367,    12,    13,   515,
-    14,    17,    18,   106,   171,   172,   173,   174,   346,   293,
-   294,   146,   147,   216,   317,   502,   547,   548,   573,   574,
-   567,   578,   597,   608,   480,   481,   619,   630,   251,   342,
-   253,   610,   654,   634,   659,   660,   444,   517,   521,   522,
-   560,   261,   262,   368,   451,    96,    97,    98,    99,   254,
-   482,   182,   114,   201,   202,   128,   375,   376,   456,   370,
-   115,   266,   187,   149,   150,   360,   255,   176,   241,   242,
-   243,   177,   295,   352,   179,   225,   226,   465,   433,   508,
-   509,   499,   500,   297,   298,   299,   300,   301,   397,   398,
-   302,   303,   304,   305,   382,   306,   470,   411,   307,   308,
-   309,   310,   383,   466,   467,   311,   662,   312,   130,   119,
-   492,    20,   313
-};
-
-static const short yypact[] = {-32768,
-   -25,   136,   368,  1350,-32768,-32768,-32768,   181,-32768,-32768,
--32768,    94,-32768,-32768,-32768,   181,   110,-32768,-32768,    33,
-  2903,-32768,   182,  2903,-32768,    17,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,   -11,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,  2903,-32768,  2903,-32768,   181,-32768,-32768,
-   108,-32768,-32768,-32768,-32768,   181,   181,-32768,-32768,  2903,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-  2903,-32768,-32768,-32768,-32768,-32768,   399,-32768,  2903,   408,
-   155,   192,   205,-32768,   136,   204,-32768,-32768,   368,  1152,
--32768,   233,   223,-32768,-32768,   266,-32768,   181,   305,   408,
-   211,   235,   264,-32768,  1445,-32768,   408,   339,-32768,   347,
--32768,   377,-32768,   347,-32768,   347,   408,  1247,  1247,   408,
--32768,-32768,   408,   408,-32768,   196,-32768,   259,   322,   409,
--32768,-32768,-32768,-32768,-32768,   181,   387,-32768,-32768,-32768,
-   386,   181,-32768,-32768,   181,   534,-32768,-32768,   403,  2903,
-   410,   445,   453,-32768,   360,   439,-32768,   386,   474,-32768,
--32768,   496,  2903,   497,  2319,   239,   470,   486,   492,   401,
-   404,-32768,-32768,-32768,-32768,-32768,   408,   282,   493,  2414,
-   488,   494,   288,-32768,-32768,-32768,-32768,-32768,   322,   409,
-   121,   141,-32768,   408,  3200,  1836,  1933,  3059,-32768,  2030,
--32768,-32768,  1152,-32768,   499,   122,-32768,-32768,   386,   181,
-   181,   386,   502,   421,   360,-32768,  1152,  1152,   360,  1741,
--32768,   454,-32768,   328,    80,-32768,-32768,   525,-32768,-32768,
-   504,-32768,   507,   380,-32768,-32768,-32768,-32768,   522,   524,
-   515,-32768,-32768,-32768,-32768,   518,  2903,   514,   520,-32768,
--32768,  2903,  2903,-32768,  1836,-32768,-32768,-32768,  3200,  3109,
--32768,   266,-32768,-32768,-32768,-32768,   544,  3200,   545,-32768,
-   549,   551,-32768,-32768,  3033,-32768,   550,-32768,   114,  3226,
--32768,   374,   382,   382,   535,   193,-32768,-32768,   273,-32768,
--32768,-32768,   555,   560,   562,   536,-32768,   408,-32768,   537,
--32768,   539,-32768,   540,   541,   552,-32768,-32768,   553,   547,
--32768,-32768,    80,-32768,   554,-32768,   453,   439,-32768,   439,
-   454,   548,   177,  2127,-32768,   556,-32768,-32768,-32768,-32768,
--32768,   557,-32768,-32768,  2509,   380,  1644,-32768,   322,   469,
--32768,    47,    47,-32768,-32768,   408,   564,   538,   561,   559,
--32768,   569,  2414,   408,  2611,-32768,  2713,   558,    36,   565,
--32768,   293,   108,  3200,    10,  3200,  1022,   762,-32768,   220,
-  3200,  3226,  3226,-32768,-32768,   268,   374,   374,   275,   275,
-   181,  3150,   181,   181,-32768,-32768,-32768,   181,-32768,   382,
--32768,  3200,-32768,  3200,-32768,-32768,-32768,   314,-32768,-32768,
--32768,-32768,-32768,-32768,   563,   568,   566,-32768,-32768,-32768,
-   573,   181,-32768,-32768,  1836,-32768,-32768,   469,   354,  2224,
--32768,-32768,   165,-32768,-32768,    47,    47,-32768,-32768,   530,
--32768,-32768,-32768,-32768,-32768,   317,-32768,-32768,-32768,-32768,
--32768,-32768,   181,   567,  3200,   570,-32768,   572,   550,   362,
-  3200,   579,   581,   575,   577,   578,-32768,-32768,  2903,   384,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   268,
--32768,-32768,-32768,   157,-32768,-32768,-32768,   275,   583,-32768,
-   397,    -8,-32768,-32768,-32768,   574,-32768,   590,   591,-32768,
-   571,-32768,   587,   592,   363,-32768,  1547,-32768,-32768,-32768,
-   594,-32768,-32768,   408,    -8,-32768,   181,-32768,   108,  2808,
-  3200,-32768,    28,  3200,-32768,-32768,-32768,-32768,   892,-32768,
--32768,-32768,-32768,-32768,   108,  2903,-32768,   582,-32768,   181,
-   181,   576,-32768,-32768,   181,   593,-32768,-32768,   408,   605,
--32768,-32768,   582,-32768,-32768,  2903,-32768,-32768,   550,  3200,
-   600,-32768,   331,-32768,   103,   408,  3200,   521,-32768,-32768,
-   521,-32768,-32768,-32768,   629,   521,-32768,   550,-32768,-32768,
-   108,  2903,  3200,   336,   634,  3200,   584,   597,  3200,   584,
--32768,   601,-32768,-32768,-32768,   639,   632,   596,   615,   596,
-   613,   596,  3200,-32768,   644,   648,   337,  3200,   608,    49,
-   623,-32768,   608,-32768,-32768,-32768,-32768,   652,  3200,   625,
-    49,   651,    50,-32768,   653,   631,-32768,   627,-32768,   658,
--32768,    63,-32768,   272,    49,-32768,   208,   642,-32768,-32768,
-    49,-32768,-32768,   660,-32768,   222,   222,-32768,   419,   666,
--32768,   661,-32768,-32768,   668,-32768,    41,   222,-32768,   316,
-   432,   468,-32768,   666,-32768,-32768,   426,-32768,   430,-32768,
--32768,   670,   676,-32768
-};
-
-static const short yypgoto[] = {-32768,
--32768,-32768,-32768,-32768,   595,-32768,-32768,   678,   677,-32768,
--32768,-32768,   307,   679,-32768,-32768,   610,   612,   616,-32768,
-  -121,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
--32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   580,-32768,
-    -6,-32768,   585,-32768,   461,-32768,   451,   452,-32768,-32768,
-   471,  -108,   478,  -188,-32768,   232,-32768,  -458,-32768,   127,
-  -473,   175,  -169,   142,   137,   206,  -206,   120,-32768,  -180,
--32768,-32768,  -507,-32768,  -190,  -230,  -318,-32768,-32768,-32768,
--32768,-32768,   381,-32768,-32768,   -89,-32768,-32768,-32768,    -3,
-   -18,-32768,    32,-32768,-32768,   407,   476,    68,-32768,-32768,
-    56,-32768,   -93,  -127,   344,   398,  -187,   257,  -182,  -213,
-  -101,   511,    30,  -267,   603,  -137,-32768,   586,-32768,-32768,
--32768,  -531,  -204,  -254,-32768,   105,   -46,   466,-32768,-32768,
-  -278,   455,-32768,-32768,   472,  -265,  -205,-32768,-32768,  -372,
--32768,  -303,-32768,-32768,   242,     7,   -23,   -38,   423,   656,
-  -377,    19,   531
-};
-
-
-#define	YYLAST		3340
-
-
-static const short yytable[] = {   118,
-   100,   103,   113,   196,   252,   413,   148,   141,    15,    19,
-   296,   186,   271,   296,    15,   209,   211,   112,   198,   275,
-   120,   395,    19,   391,   379,   341,   343,   389,   203,   117,
-   497,     2,   132,   385,   107,   101,   320,   399,   400,   324,
-   245,   391,   110,   670,   445,   595,   208,   219,   221,   391,
-   124,   545,   336,   442,   510,   643,   644,   645,   631,   102,
-   126,   151,   127,   180,   606,   426,   563,   611,   643,   651,
-   645,   361,   462,   632,   129,   381,   137,   673,   570,   371,
-   443,   151,   129,   129,   646,   526,   628,   140,   151,     3,
-   381,   330,   587,   581,   333,   142,   546,   640,   151,   652,
-   104,   151,   350,   263,   151,   151,   175,   219,   221,   219,
-   221,    15,   633,   -55,   351,    19,   108,   488,   602,   180,
-   471,   100,   484,   642,   117,   105,   359,   518,   519,   469,
-   217,   218,   131,   592,   100,   100,   485,   655,     8,   178,
-   345,   109,   341,   343,   498,   327,   392,   469,   593,   564,
-   220,   218,   393,   328,   347,     9,   101,   276,   151,   469,
-    10,   152,    19,   431,   248,   435,   235,   437,   227,   101,
-   101,   228,   579,   580,   222,   151,   180,   277,    11,   112,
-   102,   472,   475,   483,     9,   271,   344,   218,   531,    10,
-   180,   180,   542,   102,   102,   232,   494,   180,   153,   514,
-     9,     9,   213,   402,   403,    10,   116,   154,   501,   418,
-   656,   541,   318,   429,   164,   151,   533,   657,   404,   175,
-   405,   406,   407,   408,   656,   341,   167,   214,   209,   211,
-   409,   657,   632,   175,   175,   156,   331,   332,   181,   345,
-   157,   345,   350,   327,   658,   256,   632,   283,   284,   285,
-   286,   328,   178,   183,   351,   396,   585,   219,   441,   513,
-   528,   283,   284,   285,   286,  -101,   178,   178,   374,   374,
-   214,   318,   263,   178,   661,  -405,   569,   279,   280,   151,
-   457,   631,   412,   661,   661,   402,   403,     9,   264,   164,
-  -101,   215,   282,   281,   274,   661,   632,   661,   661,   661,
-   404,   167,   405,   406,   407,   408,   653,   283,   284,   285,
-   286,   209,   409,   214,   185,   588,   327,   151,   151,   214,
-   503,   287,   188,   523,   328,   657,   289,   151,   464,   571,
-   159,   217,   218,   160,   483,   151,   441,   590,   161,   162,
-   632,   163,   604,   627,   468,   214,   189,     9,   524,   164,
-   489,   490,    10,   165,   166,   283,   284,   285,   286,   439,
-   190,   167,   591,   357,   218,   239,   168,   214,   539,   240,
-   218,   374,   199,   374,   290,   291,   159,    16,   131,   160,
-  -248,   292,   169,   474,   112,   356,   200,     9,   603,   357,
-   218,   279,    10,   531,   555,   558,   223,   556,   532,   358,
-   151,     9,   483,   621,   131,   623,   282,   491,   624,   495,
-   496,   598,   224,   143,   491,   539,   600,   144,   220,   218,
-   540,   283,   284,   285,   286,   666,   667,   145,   531,   234,
-   562,   318,   131,   544,   656,   287,   516,   674,   491,   675,
-   289,   657,   459,    65,   459,    67,   236,    69,    70,    15,
-   668,    72,    73,    74,    75,   669,   632,   668,    78,    79,
-   538,   668,   680,   344,   218,   584,   681,   594,   676,   491,
-   656,   283,   284,   285,   286,   112,   237,   657,   440,   218,
-   677,   679,   133,   135,   238,   151,   210,   212,   290,   291,
-   468,   244,   632,   338,   340,   292,   486,   487,   134,   136,
-   246,   247,   215,   249,   678,   257,   575,   283,   284,   285,
-   286,   258,   259,   559,    65,   260,    67,   265,    69,    70,
-   151,   272,    72,    73,    74,    75,   568,   273,   334,    78,
-    79,   335,   353,   491,   326,   112,   159,   151,   355,   160,
-   354,   364,   576,   365,   229,   230,   366,   163,   582,   369,
-   372,   373,   575,   384,   386,   164,   491,   491,   387,   231,
-   388,    15,   568,   391,   414,   401,   415,   167,   416,   417,
-   449,   450,   168,   419,   420,   454,   421,   422,   423,   424,
-   427,   636,   425,   434,   428,   452,   432,   520,   568,   504,
-  -406,   461,   636,   453,   505,   463,   635,   527,   554,   583,
-   549,   529,   530,   112,   552,   636,   636,   635,   663,   507,
-   534,   535,   636,   536,   537,   550,   506,   663,   663,   543,
-   635,   635,   551,   553,   665,   281,   596,   635,   561,   663,
-   577,   663,   663,   663,   159,   545,   589,   160,   599,    21,
-   605,   279,   280,   609,   607,   614,   613,   618,   620,   622,
-   625,   473,   281,   164,   626,   629,   282,   637,   639,   641,
-  -407,   649,   647,   648,   650,   167,   664,   645,   670,   683,
-   671,   283,   284,   285,   286,   684,   615,   672,     7,   455,
-    85,   139,    87,   325,   155,   287,   288,   337,   322,   339,
-   289,   278,   525,   158,   616,   477,   478,   479,    27,    28,
-    29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
-    39,    40,    41,    42,    43,    44,    45,   601,    46,    47,
-    48,    49,    50,    51,    52,    53,    54,    55,   111,    57,
-    58,    59,    60,    61,   193,    62,   194,   586,   290,   291,
-   195,   612,   638,   617,   572,   292,   448,    65,   377,    67,
-    68,    69,    70,   438,   348,    72,    73,    74,    75,    76,
-   410,    77,    78,    79,   159,   394,   390,   160,   233,    21,
-   565,   279,   280,   184,   349,     0,     0,     0,     0,     0,
-     0,   473,   281,   164,     0,     0,   282,     0,     0,     0,
-     0,     0,     0,     0,     0,   167,     0,     0,     0,     0,
-     0,   283,   284,   285,   286,   476,     0,     0,     0,     0,
-     0,   329,     0,     0,     0,   287,   288,     0,     0,     0,
-   289,     0,     0,     0,     0,   477,   478,   479,    27,    28,
-    29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
-    39,    40,    41,    42,    43,    44,    45,     0,    46,    47,
-    48,    49,    50,    51,    52,    53,    54,    55,   111,    57,
-    58,    59,    60,    61,     0,    62,     0,     0,   290,   291,
-     0,     0,     0,     0,     0,   292,     0,    65,     0,    67,
-    68,    69,    70,     0,     0,    72,    73,    74,    75,    76,
-     0,    77,    78,    79,   159,     0,     0,   160,     0,    21,
-     0,   279,   280,     0,     0,     0,     0,     0,     0,     0,
-     0,   473,   281,   164,     0,     0,   282,     0,     0,     0,
-     0,     0,     0,     0,     0,   167,     0,     0,     0,     0,
-     0,   283,   284,   285,   286,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,   287,   288,     0,     0,     0,
-   289,     0,     0,     0,     0,   477,   478,   479,    27,    28,
-    29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
-    39,    40,    41,    42,    43,    44,    45,     0,    46,    47,
-    48,    49,    50,    51,    52,    53,    54,    55,   111,    57,
-    58,    59,    60,    61,     0,    62,     0,     0,   290,   291,
-     0,     0,     0,     0,     0,   292,     0,    65,     0,    67,
-    68,    69,    70,     0,     0,    72,    73,    74,    75,    76,
-     0,    77,    78,    79,   159,     0,     0,   160,     0,    21,
-     0,   279,   280,     0,     0,     0,     0,     0,     0,     0,
-     0,   473,   281,   164,     0,     0,   282,     0,     0,     0,
-     0,     0,     0,     0,     0,   167,     0,     0,     0,     0,
-     0,   283,   284,   285,   286,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,   287,   288,     0,     0,     0,
-   289,     0,     0,     0,     0,     0,     0,     0,    27,    28,
-    29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
-    39,    40,    41,    42,    43,    44,    45,     0,    46,    47,
-    48,    49,    50,    51,    52,    53,    54,    55,   111,    57,
-    58,    59,    60,    61,     0,    62,     0,     0,   290,   291,
-     0,     0,     0,     0,     0,   292,     0,    65,     0,    67,
-    68,    69,    70,     0,     0,    72,    73,    74,    75,    76,
-     0,    77,    78,    79,   159,     0,     0,   160,     0,    21,
-     0,     0,   161,   162,     0,   163,     0,     0,     0,     0,
-     0,    22,     0,   164,     0,     0,     0,   165,   166,     0,
-     0,     0,     0,     0,     0,   167,     0,     0,     0,     0,
-   168,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,   169,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,   170,    27,    28,
-    29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
-    39,    40,    41,    42,    43,    44,    45,     0,    46,    47,
-    48,    49,    50,    51,    52,    53,    54,    55,   111,    57,
-    58,    59,    60,    61,    21,    62,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,    22,    65,     0,    67,
-    68,    69,    70,     0,     0,    72,    73,    74,    75,    76,
-     0,    77,    78,    79,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,    23,     0,    24,     0,     0,     0,
-     0,     0,    25,     0,     0,     0,     0,     0,    26,     0,
-     0,     0,     0,    27,    28,    29,    30,    31,    32,    33,
-    34,    35,    36,    37,    38,    39,    40,    41,    42,    43,
-    44,    45,     0,    46,    47,    48,    49,    50,    51,    52,
-    53,    54,    55,    56,    57,    58,    59,    60,    61,     0,
-    62,     0,     0,     0,     0,    63,     0,    21,     0,    64,
-     0,     3,    65,    66,    67,    68,    69,    70,    71,    22,
-    72,    73,    74,    75,    76,     0,    77,    78,    79,    80,
-    81,    82,    83,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,    23,     0,    24,
-     0,     0,     0,     0,     0,    25,     0,     0,     0,     0,
-     0,    26,     0,     0,     0,     0,    27,    28,    29,    30,
-    31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
-    41,    42,    43,    44,    45,     0,    46,    47,    48,    49,
-    50,    51,    52,    53,    54,    55,    56,    57,    58,    59,
-    60,    61,    21,    62,     0,     0,     0,     0,    63,     0,
-     0,     0,    64,     0,    22,    65,    66,    67,    68,    69,
-    70,    71,     0,    72,    73,    74,    75,    76,     0,    77,
-    78,    79,    80,    81,    82,    83,     0,     0,     0,     0,
-     0,     0,     0,     0,    24,     0,     0,     0,     0,     0,
-    25,     0,     0,     0,     0,     0,    26,     0,     0,     0,
-     0,    27,    28,    29,    30,    31,    32,    33,    34,    35,
-    36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
-     0,    46,    47,    48,    49,    50,    51,    52,    53,    54,
-    55,    56,    57,    58,    59,    60,    61,     0,    62,     0,
-     0,     0,     0,     0,    21,     0,     0,    64,     0,     0,
-    65,    66,    67,    68,    69,    70,    22,     0,    72,    73,
-    74,    75,    76,     0,    77,    78,    79,    80,    81,    82,
-    83,   557,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,    27,    28,    29,    30,    31,    32,    33,
-    34,    35,    36,    37,    38,    39,    40,    41,    42,    43,
-    44,    45,     0,    46,    47,    48,    49,    50,    51,    52,
-    53,    54,    55,   111,    57,    58,    59,    60,    61,   439,
-    62,    21,     0,   357,   218,     0,     0,     0,     0,     0,
-     0,     0,    65,    22,    67,    68,    69,    70,   131,     0,
-    72,    73,    74,    75,    76,     0,    77,    78,    79,     0,
-    81,    82,    83,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
-    37,    38,    39,    40,    41,    42,    43,    44,    45,     0,
-    46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
-   111,    57,    58,    59,    60,    61,   239,    62,    21,     0,
-   240,   218,     0,     0,     0,     0,     0,     0,     0,    65,
-    22,    67,    68,    69,    70,     0,     0,    72,    73,    74,
-    75,    76,   250,    77,    78,    79,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,    27,    28,    29,
-    30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
-    40,    41,    42,    43,    44,    45,     0,    46,    47,    48,
-    49,    50,    51,    52,    53,    54,    55,   111,    57,    58,
-    59,    60,    61,    21,    62,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,    22,    65,     0,    67,    68,
-    69,    70,     0,     0,    72,    73,    74,    75,    76,   250,
-    77,    78,    79,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,   314,
-   315,     0,    27,    28,    29,    30,    31,    32,    33,    34,
-    35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
-    45,     0,    46,    47,    48,    49,    50,    51,    52,    53,
-    54,    55,   111,    57,    58,    59,    60,    61,     0,    62,
-    21,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,    65,    22,    67,    68,    69,    70,     0,     0,    72,
-    73,    74,    75,    76,     0,    77,    78,    79,     0,   319,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,    27,
-    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
-    38,    39,    40,    41,    42,    43,    44,    45,     0,    46,
-    47,    48,    49,    50,    51,    52,    53,    54,    55,   111,
-    57,    58,    59,    60,    61,     0,    62,    21,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,    65,    22,
-    67,    68,    69,    70,     0,     0,    72,    73,    74,    75,
-    76,   250,    77,    78,    79,     0,   323,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,    27,    28,    29,    30,
-    31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
-    41,    42,    43,    44,    45,     0,    46,    47,    48,    49,
-    50,    51,    52,    53,    54,    55,   111,    57,    58,    59,
-    60,    61,     0,    62,    21,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,    65,    22,    67,    68,    69,
-    70,     0,     0,    72,    73,    74,    75,    76,   250,    77,
-    78,    79,     0,   430,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,    27,    28,    29,    30,    31,    32,    33,
-    34,    35,    36,    37,    38,    39,    40,    41,    42,    43,
-    44,    45,     0,    46,    47,    48,    49,    50,    51,    52,
-    53,    54,    55,   111,    57,    58,    59,    60,    61,     0,
-    62,    21,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,    65,    22,    67,    68,    69,    70,     0,     0,
-    72,    73,    74,    75,    76,   250,    77,    78,    79,     0,
-   512,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
-    37,    38,    39,    40,    41,    42,    43,    44,    45,     0,
-    46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
-   111,    57,    58,    59,    60,    61,    21,    62,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,    22,    65,
-     0,    67,    68,    69,    70,     0,     0,    72,    73,    74,
-    75,    76,   250,    77,    78,    79,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,    27,    28,    29,    30,    31,
-    32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
-    42,    43,    44,    45,     0,    46,    47,    48,    49,    50,
-    51,    52,    53,    54,    55,   111,    57,    58,    59,    60,
-    61,    21,    62,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,    22,    65,     0,    67,    68,    69,    70,
-     0,     0,    72,    73,    74,    75,    76,   250,    77,    78,
-    79,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
-    37,    38,    39,    40,    41,    42,    43,    44,    45,     0,
-    46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
-   111,    57,    58,    59,    60,    61,    21,    62,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,    22,    65,
-     0,    67,    68,    69,    70,     0,   267,    72,    73,    74,
-    75,    76,     0,    77,    78,    79,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,    27,    28,    29,    30,    31,
-    32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
-    42,    43,    44,    45,     0,    46,    47,    48,    49,    50,
-    51,    52,    53,    54,    55,   111,    57,    58,    59,    60,
-    61,     0,    62,     0,     0,     0,     0,     0,    21,     0,
-     0,     0,     0,     0,    65,     0,    67,    68,    69,    70,
-    22,     0,    72,    73,    74,    75,    76,   436,    77,    78,
-    79,     0,     0,     0,     0,   458,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,    27,    28,    29,
-    30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
-    40,    41,    42,    43,    44,    45,     0,    46,    47,    48,
-    49,    50,    51,    52,    53,    54,    55,   111,    57,    58,
-    59,    60,    61,     0,    62,     0,     0,     0,     0,     0,
-    21,     0,     0,     0,     0,     0,    65,     0,    67,    68,
-    69,    70,    22,     0,    72,    73,    74,    75,    76,     0,
-    77,    78,    79,     0,     0,     0,     0,   460,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,    27,
-    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
-    38,    39,    40,    41,    42,    43,    44,    45,     0,    46,
-    47,    48,    49,    50,    51,    52,    53,    54,    55,   111,
-    57,    58,    59,    60,    61,    21,    62,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,    22,    65,     0,
-    67,    68,    69,    70,     0,     0,    72,    73,    74,    75,
-    76,     0,    77,    78,    79,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,   566,    27,    28,    29,    30,    31,    32,
-    33,    34,    35,    36,    37,    38,    39,    40,    41,    42,
-    43,    44,    45,     0,    46,    47,    48,    49,    50,    51,
-    52,    53,    54,    55,   111,    57,    58,    59,    60,    61,
-    21,    62,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,    22,    65,     0,    67,    68,    69,    70,     0,
-     0,    72,    73,    74,    75,    76,     0,    77,    78,    79,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,    27,
-    28,    29,    30,    31,    32,    33,    34,    35,    36,    37,
-    38,    39,    40,    41,    42,    43,    44,    45,     0,    46,
-    47,    48,    49,    50,    51,    52,    53,    54,    55,   111,
-    57,    58,    59,    60,    61,     0,    62,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,    65,     0,
-    67,    68,    69,    70,     0,     0,    72,    73,    74,    75,
-    76,     0,    77,    78,    79,   159,     0,     0,   160,     0,
-     0,     0,   279,   280,     0,     0,     0,     0,     0,     0,
-     0,     0,     9,   281,   164,   350,     0,   282,     0,     0,
-     0,   159,     0,     0,   160,     0,   167,   351,   279,   280,
-     0,     0,   283,   284,   285,   286,     0,     0,     9,   281,
-   164,     0,     0,   282,     0,     0,   287,   288,     0,     0,
-     0,   289,   167,     0,   321,     0,     0,     0,   283,   284,
-   285,   286,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,   159,   287,   288,   160,     0,     0,   289,   279,   280,
-     0,     0,     0,     0,     0,     0,     0,     0,     9,   281,
-   164,     0,     0,   282,     0,     0,     0,     0,     0,   290,
-   291,     0,   167,     0,   380,     0,   292,     0,   283,   284,
-   285,   286,   159,     0,     0,   160,     0,     0,     0,   279,
-   280,     0,   287,   288,     0,   290,   291,   289,     0,     9,
-   281,   164,   292,     0,   282,     0,     0,     0,     0,     0,
-     0,     0,     0,   167,     0,   493,     0,     0,     0,   283,
-   284,   285,   286,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,   159,   287,   288,   160,     0,     0,   289,   279,
-   280,     0,     0,     0,     0,   290,   291,     0,     0,     9,
-   281,   164,   292,     0,   282,     0,     0,     0,   159,     0,
-     0,   160,     0,   167,     0,   279,   280,     0,     0,   283,
-   284,   285,   286,     0,     0,     9,     0,   164,     0,     0,
-   282,     0,     0,   287,   288,     0,   290,   291,   289,   167,
-     0,     0,     0,   292,     0,   283,   284,   285,   286,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,   287,
-     0,     0,     0,     0,   289,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,   290,   291,     0,     0,
-     0,     0,     0,   292,     0,     0,     0,     0,     0,     0,
-     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-     0,     0,   290,   291,     0,     0,     0,     0,     0,   292
-};
-
-static const short yycheck[] = {    23,
-     4,     8,    21,   125,   185,   309,   100,    97,     2,     3,
-   215,   120,   200,   218,     8,   143,   144,    21,   127,   208,
-    24,   300,    16,    14,   279,   239,   240,   295,   137,    23,
-   408,    57,    71,   288,    16,     4,   217,   303,   304,   220,
-   178,    14,    10,     3,   363,   577,   140,   149,   150,    14,
-    62,    60,   235,     7,   432,     6,     7,     8,    10,     4,
-    64,   100,    66,   110,   596,   333,   525,   599,     6,     7,
-     8,   254,    37,    25,    68,   280,    80,    37,    51,   267,
-    34,   120,    76,    77,    35,   463,   618,    91,   127,   115,
-   295,   229,   566,   552,   232,    99,   105,   629,   137,    37,
-     7,   140,    23,   197,   143,   144,   110,   209,   210,   211,
-   212,   105,   620,    97,    35,   109,     7,   396,   592,   166,
-   111,   125,   390,   631,   118,    32,   254,   446,   447,   384,
-    10,    11,    25,    31,   138,   139,   391,   645,     3,   110,
-   242,    32,   356,   357,   410,    24,    33,   402,    46,   527,
-    10,    11,    39,    32,   244,    20,   125,    37,   197,   414,
-    25,     7,   156,   344,   183,   354,   170,   355,   162,   138,
-   139,   165,   550,   551,   156,   214,   223,    37,    43,   183,
-   125,   386,   387,   388,    20,   373,    10,    11,    32,    25,
-   237,   238,    36,   138,   139,   166,   402,   244,     7,    35,
-    20,    20,     7,    11,    12,    25,    25,     3,   414,   318,
-     3,   490,   216,    37,    22,   254,   471,    10,    26,   223,
-    28,    29,    30,    31,     3,   439,    34,    32,   356,   357,
-    38,    10,    25,   237,   238,    32,   230,   231,     6,   341,
-    37,   343,    23,    24,    37,     7,    25,    40,    41,    42,
-    43,    32,   223,    31,    35,   302,   560,   359,   360,   440,
-   465,    40,    41,    42,    43,     7,   237,   238,   272,   273,
-    32,   275,   366,   244,   647,    10,   531,    10,    11,   318,
-   374,    10,    10,   656,   657,    11,    12,    20,     7,    22,
-    32,    33,    25,    21,     7,   668,    25,   670,   671,   672,
-    26,    34,    28,    29,    30,    31,    35,    40,    41,    42,
-    43,   439,    38,    32,    10,   570,    24,   356,   357,    32,
-     7,    54,   112,     7,    32,    10,    59,   366,    36,   534,
-     3,    10,    11,     6,   539,   374,   438,     7,    11,    12,
-    25,    14,     7,     7,   383,    32,   112,    20,    32,    22,
-   397,   398,    25,    26,    27,    40,    41,    42,    43,     6,
-    97,    34,    32,    10,    11,     6,    39,    32,    32,    10,
-    11,   375,    34,   377,   107,   108,     3,    10,    25,     6,
-    34,   114,    55,   387,   388,     6,    10,    20,   593,    10,
-    11,    10,    25,    32,    32,   517,    10,    35,    37,    20,
-   439,    20,   607,   610,    25,   612,    25,   401,   613,   403,
-   404,   581,    27,     6,   408,    32,   586,    10,    10,    11,
-    37,    40,    41,    42,    43,   656,   657,    20,    32,    27,
-   524,   435,    25,    37,     3,    54,   443,   668,   432,   670,
-    59,    10,   375,   116,   377,   118,    37,   120,   121,   443,
-    32,   124,   125,   126,   127,    37,    25,    32,   131,   132,
-   479,    32,    37,    10,    11,   559,    37,   576,    37,   463,
-     3,    40,    41,    42,    43,   479,    32,    10,    10,    11,
-   671,   672,    76,    77,    32,   524,   143,   144,   107,   108,
-   529,    53,    25,   237,   238,   114,   392,   393,    76,    77,
-    27,     6,    33,     7,    37,    20,   545,    40,    41,    42,
-    43,    20,   112,   517,   116,   112,   118,    25,   120,   121,
-   559,    34,   124,   125,   126,   127,   530,    34,    27,   131,
-   132,   111,     8,   527,    36,   539,     3,   576,    32,     6,
-    37,    20,   546,    20,    11,    12,    32,    14,   555,    32,
-    37,    32,   591,    10,    10,    22,   550,   551,    10,    26,
-    10,   555,   566,    14,    10,    31,     7,    34,     7,    34,
-     7,    34,    39,    37,    36,     7,    37,    37,    27,    27,
-    27,   620,    36,    27,    37,    25,    31,    58,   592,    27,
-    10,    34,   631,    35,    27,    31,   620,    31,     7,     7,
-    27,    32,    31,   607,    34,   644,   645,   631,   647,    37,
-    32,    37,   651,    37,    37,    26,    51,   656,   657,    37,
-   644,   645,    32,    37,   648,    21,   106,   651,    35,   668,
-    49,   670,   671,   672,     3,    60,    37,     6,    10,     8,
-     7,    10,    11,    47,    61,     7,    46,    52,    34,    37,
-     7,    20,    21,    22,     7,    48,    25,    35,     7,    35,
-    10,    35,    10,    33,     7,    34,    25,     8,     3,     0,
-    10,    40,    41,    42,    43,     0,    45,    10,     1,   373,
-     4,    87,     4,   223,   105,    54,    55,   237,   218,   238,
-    59,   214,   461,   109,    63,    64,    65,    66,    67,    68,
-    69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
-    79,    80,    81,    82,    83,    84,    85,   591,    87,    88,
-    89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
-    99,   100,   101,   102,   125,   104,   125,   563,   107,   108,
-   125,   600,   623,   607,   539,   114,   366,   116,   273,   118,
-   119,   120,   121,   356,   244,   124,   125,   126,   127,   128,
-   306,   130,   131,   132,     3,   300,   295,     6,   166,     8,
-   529,    10,    11,   118,   244,    -1,    -1,    -1,    -1,    -1,
-    -1,    20,    21,    22,    -1,    -1,    25,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    34,    -1,    -1,    -1,    -1,
-    -1,    40,    41,    42,    43,    44,    -1,    -1,    -1,    -1,
-    -1,   226,    -1,    -1,    -1,    54,    55,    -1,    -1,    -1,
-    59,    -1,    -1,    -1,    -1,    64,    65,    66,    67,    68,
-    69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
-    79,    80,    81,    82,    83,    84,    85,    -1,    87,    88,
-    89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
-    99,   100,   101,   102,    -1,   104,    -1,    -1,   107,   108,
-    -1,    -1,    -1,    -1,    -1,   114,    -1,   116,    -1,   118,
-   119,   120,   121,    -1,    -1,   124,   125,   126,   127,   128,
-    -1,   130,   131,   132,     3,    -1,    -1,     6,    -1,     8,
-    -1,    10,    11,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    20,    21,    22,    -1,    -1,    25,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    34,    -1,    -1,    -1,    -1,
-    -1,    40,    41,    42,    43,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    54,    55,    -1,    -1,    -1,
-    59,    -1,    -1,    -1,    -1,    64,    65,    66,    67,    68,
-    69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
-    79,    80,    81,    82,    83,    84,    85,    -1,    87,    88,
-    89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
-    99,   100,   101,   102,    -1,   104,    -1,    -1,   107,   108,
-    -1,    -1,    -1,    -1,    -1,   114,    -1,   116,    -1,   118,
-   119,   120,   121,    -1,    -1,   124,   125,   126,   127,   128,
-    -1,   130,   131,   132,     3,    -1,    -1,     6,    -1,     8,
-    -1,    10,    11,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    20,    21,    22,    -1,    -1,    25,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    34,    -1,    -1,    -1,    -1,
-    -1,    40,    41,    42,    43,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    54,    55,    -1,    -1,    -1,
-    59,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    67,    68,
-    69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
-    79,    80,    81,    82,    83,    84,    85,    -1,    87,    88,
-    89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
-    99,   100,   101,   102,    -1,   104,    -1,    -1,   107,   108,
-    -1,    -1,    -1,    -1,    -1,   114,    -1,   116,    -1,   118,
-   119,   120,   121,    -1,    -1,   124,   125,   126,   127,   128,
-    -1,   130,   131,   132,     3,    -1,    -1,     6,    -1,     8,
-    -1,    -1,    11,    12,    -1,    14,    -1,    -1,    -1,    -1,
-    -1,    20,    -1,    22,    -1,    -1,    -1,    26,    27,    -1,
-    -1,    -1,    -1,    -1,    -1,    34,    -1,    -1,    -1,    -1,
-    39,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    55,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    66,    67,    68,
-    69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
-    79,    80,    81,    82,    83,    84,    85,    -1,    87,    88,
-    89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
-    99,   100,   101,   102,     8,   104,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    20,   116,    -1,   118,
-   119,   120,   121,    -1,    -1,   124,   125,   126,   127,   128,
-    -1,   130,   131,   132,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    48,    -1,    50,    -1,    -1,    -1,
-    -1,    -1,    56,    -1,    -1,    -1,    -1,    -1,    62,    -1,
-    -1,    -1,    -1,    67,    68,    69,    70,    71,    72,    73,
-    74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
-    84,    85,    -1,    87,    88,    89,    90,    91,    92,    93,
-    94,    95,    96,    97,    98,    99,   100,   101,   102,    -1,
-   104,    -1,    -1,    -1,    -1,   109,    -1,     8,    -1,   113,
-    -1,   115,   116,   117,   118,   119,   120,   121,   122,    20,
-   124,   125,   126,   127,   128,    -1,   130,   131,   132,   133,
-   134,   135,   136,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    48,    -1,    50,
-    -1,    -1,    -1,    -1,    -1,    56,    -1,    -1,    -1,    -1,
-    -1,    62,    -1,    -1,    -1,    -1,    67,    68,    69,    70,
-    71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
-    81,    82,    83,    84,    85,    -1,    87,    88,    89,    90,
-    91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
-   101,   102,     8,   104,    -1,    -1,    -1,    -1,   109,    -1,
-    -1,    -1,   113,    -1,    20,   116,   117,   118,   119,   120,
-   121,   122,    -1,   124,   125,   126,   127,   128,    -1,   130,
-   131,   132,   133,   134,   135,   136,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    50,    -1,    -1,    -1,    -1,    -1,
-    56,    -1,    -1,    -1,    -1,    -1,    62,    -1,    -1,    -1,
-    -1,    67,    68,    69,    70,    71,    72,    73,    74,    75,
-    76,    77,    78,    79,    80,    81,    82,    83,    84,    85,
-    -1,    87,    88,    89,    90,    91,    92,    93,    94,    95,
-    96,    97,    98,    99,   100,   101,   102,    -1,   104,    -1,
-    -1,    -1,    -1,    -1,     8,    -1,    -1,   113,    -1,    -1,
-   116,   117,   118,   119,   120,   121,    20,    -1,   124,   125,
-   126,   127,   128,    -1,   130,   131,   132,   133,   134,   135,
-   136,    35,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    67,    68,    69,    70,    71,    72,    73,
-    74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
-    84,    85,    -1,    87,    88,    89,    90,    91,    92,    93,
-    94,    95,    96,    97,    98,    99,   100,   101,   102,     6,
-   104,     8,    -1,    10,    11,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,   116,    20,   118,   119,   120,   121,    25,    -1,
-   124,   125,   126,   127,   128,    -1,   130,   131,   132,    -1,
-   134,   135,   136,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    67,    68,    69,    70,    71,    72,    73,    74,    75,    76,
-    77,    78,    79,    80,    81,    82,    83,    84,    85,    -1,
-    87,    88,    89,    90,    91,    92,    93,    94,    95,    96,
-    97,    98,    99,   100,   101,   102,     6,   104,     8,    -1,
-    10,    11,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   116,
-    20,   118,   119,   120,   121,    -1,    -1,   124,   125,   126,
-   127,   128,   129,   130,   131,   132,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    67,    68,    69,
-    70,    71,    72,    73,    74,    75,    76,    77,    78,    79,
-    80,    81,    82,    83,    84,    85,    -1,    87,    88,    89,
-    90,    91,    92,    93,    94,    95,    96,    97,    98,    99,
-   100,   101,   102,     8,   104,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    20,   116,    -1,   118,   119,
-   120,   121,    -1,    -1,   124,   125,   126,   127,   128,   129,
-   130,   131,   132,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    64,
-    65,    -1,    67,    68,    69,    70,    71,    72,    73,    74,
-    75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
-    85,    -1,    87,    88,    89,    90,    91,    92,    93,    94,
-    95,    96,    97,    98,    99,   100,   101,   102,    -1,   104,
-     8,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,   116,    20,   118,   119,   120,   121,    -1,    -1,   124,
-   125,   126,   127,   128,    -1,   130,   131,   132,    -1,    37,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    67,
-    68,    69,    70,    71,    72,    73,    74,    75,    76,    77,
-    78,    79,    80,    81,    82,    83,    84,    85,    -1,    87,
-    88,    89,    90,    91,    92,    93,    94,    95,    96,    97,
-    98,    99,   100,   101,   102,    -1,   104,     8,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   116,    20,
-   118,   119,   120,   121,    -1,    -1,   124,   125,   126,   127,
-   128,   129,   130,   131,   132,    -1,    37,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    67,    68,    69,    70,
-    71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
-    81,    82,    83,    84,    85,    -1,    87,    88,    89,    90,
-    91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
-   101,   102,    -1,   104,     8,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,   116,    20,   118,   119,   120,
-   121,    -1,    -1,   124,   125,   126,   127,   128,   129,   130,
-   131,   132,    -1,    37,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    67,    68,    69,    70,    71,    72,    73,
-    74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
-    84,    85,    -1,    87,    88,    89,    90,    91,    92,    93,
-    94,    95,    96,    97,    98,    99,   100,   101,   102,    -1,
-   104,     8,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,   116,    20,   118,   119,   120,   121,    -1,    -1,
-   124,   125,   126,   127,   128,   129,   130,   131,   132,    -1,
-    37,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    67,    68,    69,    70,    71,    72,    73,    74,    75,    76,
-    77,    78,    79,    80,    81,    82,    83,    84,    85,    -1,
-    87,    88,    89,    90,    91,    92,    93,    94,    95,    96,
-    97,    98,    99,   100,   101,   102,     8,   104,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    20,   116,
-    -1,   118,   119,   120,   121,    -1,    -1,   124,   125,   126,
-   127,   128,   129,   130,   131,   132,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    67,    68,    69,    70,    71,
-    72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
-    82,    83,    84,    85,    -1,    87,    88,    89,    90,    91,
-    92,    93,    94,    95,    96,    97,    98,    99,   100,   101,
-   102,     8,   104,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    20,   116,    -1,   118,   119,   120,   121,
-    -1,    -1,   124,   125,   126,   127,   128,   129,   130,   131,
-   132,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    67,    68,    69,    70,    71,    72,    73,    74,    75,    76,
-    77,    78,    79,    80,    81,    82,    83,    84,    85,    -1,
-    87,    88,    89,    90,    91,    92,    93,    94,    95,    96,
-    97,    98,    99,   100,   101,   102,     8,   104,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    20,   116,
-    -1,   118,   119,   120,   121,    -1,   123,   124,   125,   126,
-   127,   128,    -1,   130,   131,   132,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    67,    68,    69,    70,    71,
-    72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
-    82,    83,    84,    85,    -1,    87,    88,    89,    90,    91,
-    92,    93,    94,    95,    96,    97,    98,    99,   100,   101,
-   102,    -1,   104,    -1,    -1,    -1,    -1,    -1,     8,    -1,
-    -1,    -1,    -1,    -1,   116,    -1,   118,   119,   120,   121,
-    20,    -1,   124,   125,   126,   127,   128,   129,   130,   131,
-   132,    -1,    -1,    -1,    -1,    35,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    67,    68,    69,
-    70,    71,    72,    73,    74,    75,    76,    77,    78,    79,
-    80,    81,    82,    83,    84,    85,    -1,    87,    88,    89,
-    90,    91,    92,    93,    94,    95,    96,    97,    98,    99,
-   100,   101,   102,    -1,   104,    -1,    -1,    -1,    -1,    -1,
-     8,    -1,    -1,    -1,    -1,    -1,   116,    -1,   118,   119,
-   120,   121,    20,    -1,   124,   125,   126,   127,   128,    -1,
-   130,   131,   132,    -1,    -1,    -1,    -1,    35,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    67,
-    68,    69,    70,    71,    72,    73,    74,    75,    76,    77,
-    78,    79,    80,    81,    82,    83,    84,    85,    -1,    87,
-    88,    89,    90,    91,    92,    93,    94,    95,    96,    97,
-    98,    99,   100,   101,   102,     8,   104,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    20,   116,    -1,
-   118,   119,   120,   121,    -1,    -1,   124,   125,   126,   127,
-   128,    -1,   130,   131,   132,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    66,    67,    68,    69,    70,    71,    72,
-    73,    74,    75,    76,    77,    78,    79,    80,    81,    82,
-    83,    84,    85,    -1,    87,    88,    89,    90,    91,    92,
-    93,    94,    95,    96,    97,    98,    99,   100,   101,   102,
-     8,   104,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    20,   116,    -1,   118,   119,   120,   121,    -1,
-    -1,   124,   125,   126,   127,   128,    -1,   130,   131,   132,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    67,
-    68,    69,    70,    71,    72,    73,    74,    75,    76,    77,
-    78,    79,    80,    81,    82,    83,    84,    85,    -1,    87,
-    88,    89,    90,    91,    92,    93,    94,    95,    96,    97,
-    98,    99,   100,   101,   102,    -1,   104,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,   116,    -1,
-   118,   119,   120,   121,    -1,    -1,   124,   125,   126,   127,
-   128,    -1,   130,   131,   132,     3,    -1,    -1,     6,    -1,
-    -1,    -1,    10,    11,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    20,    21,    22,    23,    -1,    25,    -1,    -1,
-    -1,     3,    -1,    -1,     6,    -1,    34,    35,    10,    11,
-    -1,    -1,    40,    41,    42,    43,    -1,    -1,    20,    21,
-    22,    -1,    -1,    25,    -1,    -1,    54,    55,    -1,    -1,
-    -1,    59,    34,    -1,    36,    -1,    -1,    -1,    40,    41,
-    42,    43,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,     3,    54,    55,     6,    -1,    -1,    59,    10,    11,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    20,    21,
-    22,    -1,    -1,    25,    -1,    -1,    -1,    -1,    -1,   107,
-   108,    -1,    34,    -1,    36,    -1,   114,    -1,    40,    41,
-    42,    43,     3,    -1,    -1,     6,    -1,    -1,    -1,    10,
-    11,    -1,    54,    55,    -1,   107,   108,    59,    -1,    20,
-    21,    22,   114,    -1,    25,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    34,    -1,    36,    -1,    -1,    -1,    40,
-    41,    42,    43,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,     3,    54,    55,     6,    -1,    -1,    59,    10,
-    11,    -1,    -1,    -1,    -1,   107,   108,    -1,    -1,    20,
-    21,    22,   114,    -1,    25,    -1,    -1,    -1,     3,    -1,
-    -1,     6,    -1,    34,    -1,    10,    11,    -1,    -1,    40,
-    41,    42,    43,    -1,    -1,    20,    -1,    22,    -1,    -1,
-    25,    -1,    -1,    54,    55,    -1,   107,   108,    59,    34,
-    -1,    -1,    -1,   114,    -1,    40,    41,    42,    43,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    54,
-    -1,    -1,    -1,    -1,    59,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,   107,   108,    -1,    -1,
-    -1,    -1,    -1,   114,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
-    -1,    -1,   107,   108,    -1,    -1,    -1,    -1,    -1,   114
-};
-/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
-#line 3 "/usr/lib/bison.simple"
-/* This file comes from bison-1.28.  */
-
-/* Skeleton output parser for bison,
-   Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
-
-/* This is the parser code that is written into each bison parser
-  when the %semantic_parser declaration is not specified in the grammar.
-  It was written by Richard Stallman by simplifying the hairy parser
-  used when %semantic_parser is specified.  */
-
-#ifndef YYSTACK_USE_ALLOCA
-#ifdef alloca
-#define YYSTACK_USE_ALLOCA
-#else /* alloca not defined */
-#ifdef __GNUC__
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#else /* not GNU C.  */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
-#define YYSTACK_USE_ALLOCA
-#include 
-#else /* not sparc */
-/* We think this test detects Watcom and Microsoft C.  */
-/* This used to test MSDOS, but that is a bad idea
-   since that symbol is in the user namespace.  */
-#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
-#if 0 /* No need for malloc.h, which pollutes the namespace;
-	 instead, just don't use alloca.  */
-#include 
-#endif
-#else /* not MSDOS, or __TURBOC__ */
-#if defined(_AIX)
-/* I don't know what this was needed for, but it pollutes the namespace.
-   So I turned it off.   rms, 2 May 1997.  */
-/* #include   */
- #pragma alloca
-#define YYSTACK_USE_ALLOCA
-#else /* not MSDOS, or __TURBOC__, or _AIX */
-#if 0
-#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
-		 and on HPUX 10.  Eventually we can turn this on.  */
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#endif /* __hpux */
-#endif
-#endif /* not _AIX */
-#endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc */
-#endif /* not GNU C */
-#endif /* alloca not defined */
-#endif /* YYSTACK_USE_ALLOCA not defined */
-
-#ifdef YYSTACK_USE_ALLOCA
-#define YYSTACK_ALLOC alloca
-#else
-#define YYSTACK_ALLOC malloc
-#endif
-
-/* Note: there must be only one dollar sign in this file.
-   It is replaced by the list of actions, each action
-   as one case of the switch.  */
-
-#define yyerrok		(yyerrstatus = 0)
-#define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		-2
-#define YYEOF		0
-#define YYACCEPT	goto yyacceptlab
-#define YYABORT 	goto yyabortlab
-#define YYERROR		goto yyerrlab1
-/* Like YYERROR except do call yyerror.
-   This remains here temporarily to ease the
-   transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
-#define YYFAIL		goto yyerrlab
-#define YYRECOVERING()  (!!yyerrstatus)
-#define YYBACKUP(token, value) \
-do								\
-  if (yychar == YYEMPTY && yylen == 1)				\
-    { yychar = (token), yylval = (value);			\
-      yychar1 = YYTRANSLATE (yychar);				\
-      YYPOPSTACK;						\
-      goto yybackup;						\
-    }								\
-  else								\
-    { yyerror ("syntax error: cannot back up"); YYERROR; }	\
-while (0)
-
-#define YYTERROR	1
-#define YYERRCODE	256
-
-#ifndef YYPURE
-#define YYLEX		yylex()
-#endif
-
-#ifdef YYPURE
-#ifdef YYLSP_NEEDED
-#ifdef YYLEX_PARAM
-#define YYLEX		yylex(&yylval, &yylloc, YYLEX_PARAM)
-#else
-#define YYLEX		yylex(&yylval, &yylloc)
-#endif
-#else /* not YYLSP_NEEDED */
-#ifdef YYLEX_PARAM
-#define YYLEX		yylex(&yylval, YYLEX_PARAM)
-#else
-#define YYLEX		yylex(&yylval)
-#endif
-#endif /* not YYLSP_NEEDED */
-#endif
-
-/* If nonreentrant, generate the variables here */
-
-#ifndef YYPURE
-
-int	yychar;			/*  the lookahead symbol		*/
-YYSTYPE	yylval;			/*  the semantic value of the		*/
-				/*  lookahead symbol			*/
-
-#ifdef YYLSP_NEEDED
-YYLTYPE yylloc;			/*  location data for the lookahead	*/
-				/*  symbol				*/
-#endif
-
-int yynerrs;			/*  number of parse errors so far       */
-#endif  /* not YYPURE */
-
-#if YYDEBUG != 0
-int yydebug;			/*  nonzero means print parse trace	*/
-/* Since this is uninitialized, it does not stop multiple parsers
-   from coexisting.  */
-#endif
-
-/*  YYINITDEPTH indicates the initial size of the parser's stacks	*/
-
-#ifndef	YYINITDEPTH
-#define YYINITDEPTH 200
-#endif
-
-/*  YYMAXDEPTH is the maximum size the stacks can grow to
-    (effective only if the built-in stack extension method is used).  */
-
-#if YYMAXDEPTH == 0
-#undef YYMAXDEPTH
-#endif
-
-#ifndef YYMAXDEPTH
-#define YYMAXDEPTH 10000
-#endif
-
-/* Define __yy_memcpy.  Note that the size argument
-   should be passed with type unsigned int, because that is what the non-GCC
-   definitions require.  With GCC, __builtin_memcpy takes an arg
-   of type size_t, but it can handle unsigned int.  */
-
-#if __GNUC__ > 1		/* GNU C and GNU C++ define this.  */
-#define __yy_memcpy(TO,FROM,COUNT)	__builtin_memcpy(TO,FROM,COUNT)
-#else				/* not GNU C or C++ */
-#ifndef __cplusplus
-
-/* This is the most reliable way to avoid incompatibilities
-   in available built-in functions on various systems.  */
-static void
-__yy_memcpy (to, from, count)
-     char *to;
-     char *from;
-     unsigned int count;
-{
-  register char *f = from;
-  register char *t = to;
-  register int i = count;
-
-  while (i-- > 0)
-    *t++ = *f++;
-}
-
-#else /* __cplusplus */
-
-/* This is the most reliable way to avoid incompatibilities
-   in available built-in functions on various systems.  */
-static void
-__yy_memcpy (char *to, char *from, unsigned int count)
-{
-  register char *t = to;
-  register char *f = from;
-  register int i = count;
-
-  while (i-- > 0)
-    *t++ = *f++;
-}
-
-#endif
-#endif
-
-#line 217 "/usr/lib/bison.simple"
-
-/* The user can define YYPARSE_PARAM as the name of an argument to be passed
-   into yyparse.  The argument should have type void *.
-   It should actually point to an object.
-   Grammar actions can access the variable by casting it
-   to the proper pointer type.  */
-
-#ifdef YYPARSE_PARAM
-#ifdef __cplusplus
-#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL
-#else /* not __cplusplus */
-#define YYPARSE_PARAM_ARG YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
-#endif /* not __cplusplus */
-#else /* not YYPARSE_PARAM */
-#define YYPARSE_PARAM_ARG
-#define YYPARSE_PARAM_DECL
-#endif /* not YYPARSE_PARAM */
-
-/* Prevent warning if -Wstrict-prototypes.  */
-#ifdef __GNUC__
-#ifdef YYPARSE_PARAM
-int yyparse (void *);
-#else
-int yyparse (void);
-#endif
-#endif
-
-int
-yyparse(YYPARSE_PARAM_ARG)
-     YYPARSE_PARAM_DECL
-{
-  register int yystate;
-  register int yyn;
-  register short *yyssp;
-  register YYSTYPE *yyvsp;
-  int yyerrstatus;	/*  number of tokens to shift before error messages enabled */
-  int yychar1 = 0;		/*  lookahead token as an internal (translated) token number */
-
-  short	yyssa[YYINITDEPTH];	/*  the state stack			*/
-  YYSTYPE yyvsa[YYINITDEPTH];	/*  the semantic value stack		*/
-
-  short *yyss = yyssa;		/*  refer to the stacks thru separate pointers */
-  YYSTYPE *yyvs = yyvsa;	/*  to allow yyoverflow to reallocate them elsewhere */
-
-#ifdef YYLSP_NEEDED
-  YYLTYPE yylsa[YYINITDEPTH];	/*  the location stack			*/
-  YYLTYPE *yyls = yylsa;
-  YYLTYPE *yylsp;
-
-#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
-#else
-#define YYPOPSTACK   (yyvsp--, yyssp--)
-#endif
-
-  int yystacksize = YYINITDEPTH;
-  int yyfree_stacks = 0;
-
-#ifdef YYPURE
-  int yychar;
-  YYSTYPE yylval;
-  int yynerrs;
-#ifdef YYLSP_NEEDED
-  YYLTYPE yylloc;
-#endif
-#endif
-
-  YYSTYPE yyval;		/*  the variable used to return		*/
-				/*  semantic values from the action	*/
-				/*  routines				*/
-
-  int yylen;
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Starting parse\n");
-#endif
-
-  yystate = 0;
-  yyerrstatus = 0;
-  yynerrs = 0;
-  yychar = YYEMPTY;		/* Cause a token to be read.  */
-
-  /* Initialize stack pointers.
-     Waste one element of value and location stack
-     so that they stay on the same level as the state stack.
-     The wasted elements are never initialized.  */
-
-  yyssp = yyss - 1;
-  yyvsp = yyvs;
-#ifdef YYLSP_NEEDED
-  yylsp = yyls;
-#endif
-
-/* Push a new state, which is found in  yystate  .  */
-/* In all cases, when you get here, the value and location stacks
-   have just been pushed. so pushing a state here evens the stacks.  */
-yynewstate:
-
-  *++yyssp = yystate;
-
-  if (yyssp >= yyss + yystacksize - 1)
-    {
-      /* Give user a chance to reallocate the stack */
-      /* Use copies of these so that the &'s don't force the real ones into memory. */
-      YYSTYPE *yyvs1 = yyvs;
-      short *yyss1 = yyss;
-#ifdef YYLSP_NEEDED
-      YYLTYPE *yyls1 = yyls;
-#endif
-
-      /* Get the current used size of the three stacks, in elements.  */
-      int size = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-      /* Each stack pointer address is followed by the size of
-	 the data in use in that stack, in bytes.  */
-#ifdef YYLSP_NEEDED
-      /* This used to be a conditional around just the two extra args,
-	 but that might be undefined if yyoverflow is a macro.  */
-      yyoverflow("parser stack overflow",
-		 &yyss1, size * sizeof (*yyssp),
-		 &yyvs1, size * sizeof (*yyvsp),
-		 &yyls1, size * sizeof (*yylsp),
-		 &yystacksize);
-#else
-      yyoverflow("parser stack overflow",
-		 &yyss1, size * sizeof (*yyssp),
-		 &yyvs1, size * sizeof (*yyvsp),
-		 &yystacksize);
-#endif
-
-      yyss = yyss1; yyvs = yyvs1;
-#ifdef YYLSP_NEEDED
-      yyls = yyls1;
-#endif
-#else /* no yyoverflow */
-      /* Extend the stack our own way.  */
-      if (yystacksize >= YYMAXDEPTH)
-	{
-	  yyerror("parser stack overflow");
-	  if (yyfree_stacks)
-	    {
-	      free (yyss);
-	      free (yyvs);
-#ifdef YYLSP_NEEDED
-	      free (yyls);
-#endif
-	    }
-	  return 2;
-	}
-      yystacksize *= 2;
-      if (yystacksize > YYMAXDEPTH)
-	yystacksize = YYMAXDEPTH;
-#ifndef YYSTACK_USE_ALLOCA
-      yyfree_stacks = 1;
-#endif
-      yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
-      __yy_memcpy ((char *)yyss, (char *)yyss1,
-		   size * (unsigned int) sizeof (*yyssp));
-      yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
-      __yy_memcpy ((char *)yyvs, (char *)yyvs1,
-		   size * (unsigned int) sizeof (*yyvsp));
-#ifdef YYLSP_NEEDED
-      yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
-      __yy_memcpy ((char *)yyls, (char *)yyls1,
-		   size * (unsigned int) sizeof (*yylsp));
-#endif
-#endif /* no yyoverflow */
-
-      yyssp = yyss + size - 1;
-      yyvsp = yyvs + size - 1;
-#ifdef YYLSP_NEEDED
-      yylsp = yyls + size - 1;
-#endif
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Stack size increased to %d\n", yystacksize);
-#endif
-
-      if (yyssp >= yyss + yystacksize - 1)
-	YYABORT;
-    }
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Entering state %d\n", yystate);
-#endif
-
-  goto yybackup;
- yybackup:
-
-/* Do appropriate processing given the current state.  */
-/* Read a lookahead token if we need one and don't already have one.  */
-/* yyresume: */
-
-  /* First try to decide what to do without reference to lookahead token.  */
-
-  yyn = yypact[yystate];
-  if (yyn == YYFLAG)
-    goto yydefault;
-
-  /* Not known => get a lookahead token if don't already have one.  */
-
-  /* yychar is either YYEMPTY or YYEOF
-     or a valid token in external form.  */
-
-  if (yychar == YYEMPTY)
-    {
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Reading a token: ");
-#endif
-      yychar = YYLEX;
-    }
-
-  /* Convert token to internal form (in yychar1) for indexing tables with */
-
-  if (yychar <= 0)		/* This means end of input. */
-    {
-      yychar1 = 0;
-      yychar = YYEOF;		/* Don't call YYLEX any more */
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Now at end of input.\n");
-#endif
-    }
-  else
-    {
-      yychar1 = YYTRANSLATE(yychar);
-
-#if YYDEBUG != 0
-      if (yydebug)
-	{
-	  fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
-	  /* Give the individual parser a way to print the precise meaning
-	     of a token, for further debugging info.  */
-#ifdef YYPRINT
-	  YYPRINT (stderr, yychar, yylval);
-#endif
-	  fprintf (stderr, ")\n");
-	}
-#endif
-    }
-
-  yyn += yychar1;
-  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
-    goto yydefault;
-
-  yyn = yytable[yyn];
-
-  /* yyn is what to do for this token type in this state.
-     Negative => reduce, -yyn is rule number.
-     Positive => shift, yyn is new state.
-       New state is final state => don't bother to shift,
-       just return success.
-     0, or most negative number => error.  */
-
-  if (yyn < 0)
-    {
-      if (yyn == YYFLAG)
-	goto yyerrlab;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-  else if (yyn == 0)
-    goto yyerrlab;
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-  /* Shift the lookahead token.  */
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
-#endif
-
-  /* Discard the token being shifted unless it is eof.  */
-  if (yychar != YYEOF)
-    yychar = YYEMPTY;
-
-  *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
-  *++yylsp = yylloc;
-#endif
-
-  /* count tokens shifted since error; after three, turn off error status.  */
-  if (yyerrstatus) yyerrstatus--;
-
-  yystate = yyn;
-  goto yynewstate;
-
-/* Do the default action for the current state.  */
-yydefault:
-
-  yyn = yydefact[yystate];
-  if (yyn == 0)
-    goto yyerrlab;
-
-/* Do a reduction.  yyn is the number of a rule to reduce with.  */
-yyreduce:
-  yylen = yyr2[yyn];
-  if (yylen > 0)
-    yyval = yyvsp[1-yylen]; /* implement default value of the action */
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      int i;
-
-      fprintf (stderr, "Reducing via rule %d (line %d), ",
-	       yyn, yyrline[yyn]);
-
-      /* Print the symbols being reduced, and their result.  */
-      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
-	fprintf (stderr, "%s ", yytname[yyrhs[i]]);
-      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
-    }
-#endif
-
-
-  switch (yyn) {
-
-case 1:
-#line 383 "llgrammar.y"
-{ lhExternals (yyvsp[0].interfacelist); ;
-    break;}
-case 2:
-#line 384 "llgrammar.y"
-{ interfaceNodeList_free (yyvsp[-2].interfacelist); interfaceNodeList_free (yyvsp[0].interfacelist); ;
-    break;}
-case 3:
-#line 387 "llgrammar.y"
-{ yyval.interfacelist = interfaceNodeList_new (); ;
-    break;}
-case 4:
-#line 388 "llgrammar.y"
-{ yyval.interfacelist = interfaceNodeList_addh (yyvsp[-1].interfacelist, yyvsp[0].iface);;
-    break;}
-case 7:
-#line 395 "llgrammar.y"
-{ yyval.interfacelist = interfaceNodeList_new (); ;
-    break;}
-case 8:
-#line 396 "llgrammar.y"
-{ yyval.interfacelist = consInterfaceNode (yyvsp[-1].iface, yyvsp[0].interfacelist);;
-    break;}
-case 9:
-#line 397 "llgrammar.y"
-{ yyval.interfacelist = consInterfaceNode (yyvsp[-1].iface, yyvsp[0].interfacelist);;
-    break;}
-case 10:
-#line 400 "llgrammar.y"
-{ yyval.interfacelist = interfaceNodeList_new (); ;
-    break;}
-case 11:
-#line 401 "llgrammar.y"
-{ yyval.interfacelist = interfaceNodeList_addh (yyvsp[-1].interfacelist, yyvsp[0].iface);;
-    break;}
-case 15:
-#line 410 "llgrammar.y"
-{ yyval.iface = makeInterfaceNodeImports (yyvsp[-1].importlist);
-     /* assume subspecs are already processed, symbol table info in external file */
-   ;
-    break;}
-case 16:
-#line 416 "llgrammar.y"
-{ yyval.iface = makeInterfaceNodeUses (yyvsp[-1].traitreflist); readlsignatures (yyval.iface);;
-    break;}
-case 17:
-#line 420 "llgrammar.y"
-{ declareConstant (yyvsp[0].constdeclaration); yyval.iface = interfaceNode_makeConst (yyvsp[0].constdeclaration); ;
-    break;}
-case 18:
-#line 422 "llgrammar.y"
-{ declareVar (yyvsp[0].vardeclaration); yyval.iface = interfaceNode_makeVar (yyvsp[0].vardeclaration); ;
-    break;}
-case 19:
-#line 424 "llgrammar.y"
-{ declareType (yyvsp[0].type); yyval.iface = interfaceNode_makeType (yyvsp[0].type); ;
-    break;}
-case 20:
-#line 426 "llgrammar.y"
-{ declareFcn (yyvsp[0].fcn, typeId_invalid); yyval.iface = interfaceNode_makeFcn (yyvsp[0].fcn); ;
-    break;}
-case 21:
-#line 428 "llgrammar.y"
-{ yyval.iface = interfaceNode_makeClaim (yyvsp[0].claim); ;
-    break;}
-case 22:
-#line 430 "llgrammar.y"
-{ declareIter (yyvsp[0].iter); yyval.iface = interfaceNode_makeIter (yyvsp[0].iter); ;
-    break;}
-case 23:
-#line 434 "llgrammar.y"
-{ yyval.iter = makeIterNode (yyvsp[-4].ltok, yyvsp[-2].paramlist); ;
-    break;}
-case 24:
-#line 437 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_new (); ;
-    break;}
-case 25:
-#line 438 "llgrammar.y"
-{ yyval.paramlist = yyvsp[0].paramlist; ;
-    break;}
-case 26:
-#line 442 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_add (paramNodeList_new (), yyvsp[0].param); ;
-    break;}
-case 27:
-#line 444 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_add (yyvsp[-2].paramlist,yyvsp[0].param); ;
-    break;}
-case 28:
-#line 447 "llgrammar.y"
-{ yyval.param = markYieldParamNode (yyvsp[0].param); ;
-    break;}
-case 29:
-#line 448 "llgrammar.y"
-{ yyval.param = yyvsp[0].param; ;
-    break;}
-case 30:
-#line 451 "llgrammar.y"
-{ symtable_export (g_symtab, FALSE); ;
-    break;}
-case 31:
-#line 452 "llgrammar.y"
-{ yyval.iface = yyvsp[0].iface; symtable_export (g_symtab, TRUE); ;
-    break;}
-case 32:
-#line 456 "llgrammar.y"
-{ declarePrivConstant (yyvsp[0].constdeclaration); yyval.iface =  interfaceNode_makePrivConst (yyvsp[0].constdeclaration); ;
-    break;}
-case 33:
-#line 458 "llgrammar.y"
-{ declarePrivVar (yyvsp[0].vardeclaration); yyval.iface = interfaceNode_makePrivVar (yyvsp[0].vardeclaration); ;
-    break;}
-case 34:
-#line 460 "llgrammar.y"
-{ declarePrivType (yyvsp[0].type); yyval.iface = interfaceNode_makePrivType (yyvsp[0].type); ;
-    break;}
-case 35:
-#line 462 "llgrammar.y"
-{ declarePrivFcn (yyvsp[0].fcn, typeId_invalid); yyval.iface = interfaceNode_makePrivFcn (yyvsp[0].fcn); ;
-    break;}
-case 36:
-#line 466 "llgrammar.y"
-{ yyval.constdeclaration = makeConstDeclarationNode (yyvsp[-2].lcltypespec, yyvsp[-1].initdecls); ;
-    break;}
-case 37:
-#line 470 "llgrammar.y"
-{ yyval.vardeclaration = makeVarDeclarationNode (yyvsp[-2].lcltypespec, yyvsp[-1].initdecls, FALSE, FALSE); yyval.vardeclaration->qualifier = QLF_NONE; ;
-    break;}
-case 38:
-#line 472 "llgrammar.y"
-{ yyval.vardeclaration = makeVarDeclarationNode (yyvsp[-2].lcltypespec, yyvsp[-1].initdecls, FALSE, FALSE); yyval.vardeclaration->qualifier = QLF_CONST; ;
-    break;}
-case 39:
-#line 474 "llgrammar.y"
-{ yyval.vardeclaration = makeVarDeclarationNode (yyvsp[-2].lcltypespec, yyvsp[-1].initdecls, FALSE, FALSE); yyval.vardeclaration->qualifier = QLF_VOLATILE; ;
-    break;}
-case 40:
-#line 477 "llgrammar.y"
-{ yyval.type = makeAbstractTypeNode (yyvsp[0].abstract); ;
-    break;}
-case 41:
-#line 478 "llgrammar.y"
-{ yyval.type = makeExposedTypeNode (yyvsp[0].exposed); ;
-    break;}
-case 42:
-#line 481 "llgrammar.y"
-{ yyval.typequal = qual_createPrintfLike (); ;
-    break;}
-case 43:
-#line 482 "llgrammar.y"
-{ yyval.typequal = qual_createScanfLike (); ;
-    break;}
-case 44:
-#line 483 "llgrammar.y"
-{ yyval.typequal = qual_createMessageLike (); ;
-    break;}
-case 45:
-#line 486 "llgrammar.y"
-{ enteringFcnScope (yyvsp[-2].lcltypespec, yyvsp[-1].declare, yyvsp[0].globals); ;
-    break;}
-case 46:
-#line 488 "llgrammar.y"
-{ yyval.fcn = makeFcnNode (qual_createUnknown (), yyvsp[-12].lcltypespec, yyvsp[-11].declare, yyvsp[-10].globals, yyvsp[-7].vardeclarationlist, yyvsp[-6].letdecls, 
-		       yyvsp[-5].lclpredicate, yyvsp[-4].lclpredicate, yyvsp[-3].modify, yyvsp[-2].lclpredicate, yyvsp[-1].lclpredicate); 
-     /* type, declarator, glovbls, privateinits,
-	lets, checks, requires, modifies, ensures, claims */
-     symtable_exitScope (g_symtab);
-   ;
-    break;}
-case 47:
-#line 494 "llgrammar.y"
-{ enteringFcnScope (yyvsp[-2].lcltypespec, yyvsp[-1].declare, yyvsp[0].globals); ;
-    break;}
-case 48:
-#line 498 "llgrammar.y"
-{ yyval.fcn = makeFcnNode (yyvsp[-13].typequal, yyvsp[-12].lcltypespec, yyvsp[-11].declare, yyvsp[-10].globals, yyvsp[-7].vardeclarationlist, 
-		       yyvsp[-6].letdecls, yyvsp[-5].lclpredicate, yyvsp[-4].lclpredicate, yyvsp[-3].modify, yyvsp[-2].lclpredicate, yyvsp[-1].lclpredicate); 
-     /* type, declarator, glovbls, privateinits,
-	lets, checks, requires, modifies, ensures, claims */
-     symtable_exitScope (g_symtab);
-   ;
-    break;}
-case 49:
-#line 508 "llgrammar.y"
-{ enteringClaimScope (yyvsp[-2].paramlist, yyvsp[0].globals); ;
-    break;}
-case 50:
-#line 510 "llgrammar.y"
-{      yyval.claim = makeClaimNode (yyvsp[-11].ltok, yyvsp[-9].paramlist, yyvsp[-7].globals, yyvsp[-4].letdecls, yyvsp[-3].lclpredicate, yyvsp[-2].program, yyvsp[-1].lclpredicate); 
-     symtable_exitScope (g_symtab); ;
-    break;}
-case 51:
-#line 513 "llgrammar.y"
-{ yyval.claim = (claimNode) 0; ;
-    break;}
-case 52:
-#line 516 "llgrammar.y"
-{g_inTypeDef = TRUE; ;
-    break;}
-case 53:
-#line 516 "llgrammar.y"
-{g_inTypeDef = FALSE; ;
-    break;}
-case 54:
-#line 517 "llgrammar.y"
-{ yyval.abstract = makeAbstractNode (yyvsp[-5].ltok, yyvsp[-2].ltok, TRUE, FALSE, yyvsp[0].abstbody); ;
-    break;}
-case 55:
-#line 518 "llgrammar.y"
-{g_inTypeDef = TRUE; ;
-    break;}
-case 56:
-#line 519 "llgrammar.y"
-{g_inTypeDef = FALSE; ;
-    break;}
-case 57:
-#line 520 "llgrammar.y"
-{ yyval.abstract = makeAbstractNode (yyvsp[-6].ltok, yyvsp[-2].ltok, TRUE, TRUE, yyvsp[0].abstbody); ;
-    break;}
-case 58:
-#line 521 "llgrammar.y"
-{g_inTypeDef = TRUE; ;
-    break;}
-case 59:
-#line 522 "llgrammar.y"
-{g_inTypeDef = FALSE; ;
-    break;}
-case 60:
-#line 523 "llgrammar.y"
-{ yyval.abstract = makeAbstractNode (yyvsp[-5].ltok, yyvsp[-2].ltok, TRUE, TRUE, yyvsp[0].abstbody); ;
-    break;}
-case 61:
-#line 524 "llgrammar.y"
-{g_inTypeDef = TRUE; ;
-    break;}
-case 62:
-#line 524 "llgrammar.y"
-{g_inTypeDef = FALSE; ;
-    break;}
-case 63:
-#line 525 "llgrammar.y"
-{ yyval.abstract = makeAbstractNode (yyvsp[-5].ltok, yyvsp[-2].ltok, FALSE, FALSE, yyvsp[0].abstbody); ;
-    break;}
-case 64:
-#line 528 "llgrammar.y"
-{ g_inTypeDef = TRUE; setExposedType (yyvsp[0].lcltypespec); ;
-    break;}
-case 65:
-#line 529 "llgrammar.y"
-{ g_inTypeDef = FALSE; ;
-    break;}
-case 66:
-#line 530 "llgrammar.y"
-{ yyval.exposed = makeExposedNode (yyvsp[-5].ltok, yyvsp[-4].lcltypespec, yyvsp[-2].declaratorinvs); /* to support mutually recursive types */ ;
-    break;}
-case 67:
-#line 532 "llgrammar.y"
-{ yyval.exposed = makeExposedNode (yyvsp[0].ltok, makeLclTypeSpecNodeSU (yyvsp[-1].structorunion), declaratorInvNodeList_new ()); ;
-    break;}
-case 68:
-#line 534 "llgrammar.y"
-{ yyval.exposed = makeExposedNode (yyvsp[0].ltok, makeLclTypeSpecNodeEnum (yyvsp[-1].enumspec), declaratorInvNodeList_new ()); ;
-    break;}
-case 69:
-#line 550 "llgrammar.y"
-{ yyval.importlist = importNodeList_add (importNodeList_new (), yyvsp[0].import); ;
-    break;}
-case 70:
-#line 552 "llgrammar.y"
-{ yyval.importlist = importNodeList_add (yyvsp[-2].importlist, yyvsp[0].import); ;
-    break;}
-case 71:
-#line 555 "llgrammar.y"
-{ yyval.import = importNode_makePlain (yyvsp[0].ltok); ;
-    break;}
-case 72:
-#line 557 "llgrammar.y"
-{ checkBrackets (yyvsp[-2].ltok, yyvsp[0].ltok); yyval.import = importNode_makeBracketed (yyvsp[-1].ltok); ;
-    break;}
-case 73:
-#line 558 "llgrammar.y"
-{ yyval.import = importNode_makeQuoted (yyvsp[0].ltok); ;
-    break;}
-case 74:
-#line 561 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
-    break;}
-case 75:
-#line 562 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 77:
-#line 570 "llgrammar.y"
-{ yyval.traitreflist = traitRefNodeList_add (traitRefNodeList_new (), yyvsp[0].traitref); ;
-    break;}
-case 78:
-#line 572 "llgrammar.y"
-{ yyval.traitreflist = traitRefNodeList_add (yyvsp[-2].traitreflist, yyvsp[0].traitref); ;
-    break;}
-case 79:
-#line 576 "llgrammar.y"
-{ yyval.traitref = makeTraitRefNode (ltokenList_singleton (yyvsp[0].ltok), (renamingNode)0); ;
-    break;}
-case 80:
-#line 578 "llgrammar.y"
-{ yyval.traitref = makeTraitRefNode (ltokenList_singleton (yyvsp[-3].ltok), yyvsp[-1].renaming); ;
-    break;}
-case 81:
-#line 580 "llgrammar.y"
-{ yyval.traitref = makeTraitRefNode (yyvsp[-1].ltokenList, (renamingNode)0); ;
-    break;}
-case 82:
-#line 582 "llgrammar.y"
-{ yyval.traitref = makeTraitRefNode (yyvsp[-4].ltokenList, yyvsp[-1].renaming); ;
-    break;}
-case 83:
-#line 585 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
-    break;}
-case 84:
-#line 586 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 85:
-#line 590 "llgrammar.y"
-{ yyval.renaming = makeRenamingNode (typeNameNodeList_new (), yyvsp[0].replacelist); ;
-    break;}
-case 86:
-#line 592 "llgrammar.y"
-{ yyval.renaming = makeRenamingNode (yyvsp[0].namelist, replaceNodeList_new ()); ;
-    break;}
-case 87:
-#line 593 "llgrammar.y"
-{ yyval.renaming = makeRenamingNode (yyvsp[-2].namelist, yyvsp[0].replacelist); ;
-    break;}
-case 88:
-#line 597 "llgrammar.y"
-{ yyval.namelist = typeNameNodeList_add (typeNameNodeList_new (), yyvsp[0].typname); ;
-    break;}
-case 89:
-#line 598 "llgrammar.y"
-{ yyval.namelist = typeNameNodeList_add (yyvsp[-2].namelist, yyvsp[0].typname); ;
-    break;}
-case 90:
-#line 602 "llgrammar.y"
-{ yyval.replacelist = replaceNodeList_add (replaceNodeList_new (), yyvsp[0].replace); ;
-    break;}
-case 91:
-#line 603 "llgrammar.y"
-{ yyval.replacelist = replaceNodeList_add (yyvsp[-2].replacelist, yyvsp[0].replace); ;
-    break;}
-case 92:
-#line 606 "llgrammar.y"
-{ yyval.replace = makeReplaceNode (yyvsp[-1].ltok, yyvsp[-2].typname, TRUE, yyvsp[0].ltok, NULL, NULL); ;
-    break;}
-case 93:
-#line 607 "llgrammar.y"
-{ yyval.replace = makeReplaceNameNode (yyvsp[-1].ltok, yyvsp[-2].typname, yyvsp[0].name); ;
-    break;}
-case 94:
-#line 608 "llgrammar.y"
-{ yyval.replace = makeReplaceNode (yyvsp[-2].ltok, yyvsp[-3].typname, FALSE, ltoken_undefined,
-							 yyvsp[-1].name, yyvsp[0].signature); ;
-    break;}
-case 95:
-#line 612 "llgrammar.y"
-{ yyval.name = makeNameNodeId (yyvsp[0].ltok); ;
-    break;}
-case 96:
-#line 613 "llgrammar.y"
-{ yyval.name = makeNameNodeForm (yyvsp[0].opform); ;
-    break;}
-case 99:
-#line 621 "llgrammar.y"
-{ yyval.initdecls = initDeclNodeList_add (initDeclNodeList_new (), yyvsp[0].initdecl); ;
-    break;}
-case 100:
-#line 623 "llgrammar.y"
-{ yyval.initdecls = initDeclNodeList_add (yyvsp[-2].initdecls, yyvsp[0].initdecl); ;
-    break;}
-case 101:
-#line 626 "llgrammar.y"
-{ yyval.initdecl = makeInitDeclNode (yyvsp[0].declare, (termNode)0); ;
-    break;}
-case 102:
-#line 627 "llgrammar.y"
-{ yyval.initdecl = makeInitDeclNode (yyvsp[-2].declare, yyvsp[0].term); ;
-    break;}
-case 103:
-#line 631 "llgrammar.y"
-{ yyval.globals = varDeclarationNodeList_new (); ;
-    break;}
-case 104:
-#line 633 "llgrammar.y"
-{ varDeclarationNodeList_addh (yyvsp[-1].globals, yyvsp[0].vardeclaration); yyval.globals = yyvsp[-1].globals; ;
-    break;}
-case 105:
-#line 636 "llgrammar.y"
-{ yyval.vardeclaration = makeVarDeclarationNode (yyvsp[-2].lcltypespec, yyvsp[-1].initdecls, TRUE, FALSE); ;
-    break;}
-case 106:
-#line 637 "llgrammar.y"
-{ yyval.vardeclaration = makeInternalStateNode (); ;
-    break;}
-case 107:
-#line 638 "llgrammar.y"
-{ yyval.vardeclaration = makeFileSystemNode (); ;
-    break;}
-case 108:
-#line 641 "llgrammar.y"
-{ yyval.vardeclarationlist = varDeclarationNodeList_new (); ;
-    break;}
-case 109:
-#line 642 "llgrammar.y"
-{ varDeclarationNodeList_addh (yyvsp[-1].vardeclarationlist, yyvsp[0].vardeclaration); yyval.vardeclarationlist = yyvsp[-1].vardeclarationlist; ;
-    break;}
-case 110:
-#line 646 "llgrammar.y"
-{ yyval.vardeclaration = makeVarDeclarationNode (yyvsp[-2].lcltypespec, yyvsp[-1].initdecls, FALSE, TRUE); ;
-    break;}
-case 111:
-#line 649 "llgrammar.y"
-{ yyval.letdecls = letDeclNodeList_new (); ;
-    break;}
-case 112:
-#line 650 "llgrammar.y"
-{ yyval.letdecls = yyvsp[-1].letdecls; ;
-    break;}
-case 113:
-#line 653 "llgrammar.y"
-{ yyval.letdecls = letDeclNodeList_add (letDeclNodeList_new (), yyvsp[0].letdecl); ;
-    break;}
-case 114:
-#line 654 "llgrammar.y"
-{ yyval.letdecls = letDeclNodeList_add (yyvsp[-2].letdecls, yyvsp[0].letdecl); ;
-    break;}
-case 115:
-#line 657 "llgrammar.y"
-{ yyval.letdecl = makeLetDeclNode (yyvsp[-4].ltok, yyvsp[-2].lcltypespec, yyvsp[0].term); ;
-    break;}
-case 116:
-#line 658 "llgrammar.y"
-{ yyval.letdecl = makeLetDeclNode (yyvsp[-2].ltok, (lclTypeSpecNode)0, yyvsp[0].term); ;
-    break;}
-case 118:
-#line 663 "llgrammar.y"
-{ yyval.lclpredicate = (lclPredicateNode)0; ;
-    break;}
-case 119:
-#line 664 "llgrammar.y"
-{ checkLclPredicate (yyvsp[-2].ltok, yyvsp[-1].lclpredicate); yyval.lclpredicate = makeChecksNode (yyvsp[-2].ltok, yyvsp[-1].lclpredicate); ;
-    break;}
-case 120:
-#line 667 "llgrammar.y"
-{ yyval.lclpredicate = (lclPredicateNode)0; ;
-    break;}
-case 121:
-#line 668 "llgrammar.y"
-{ checkLclPredicate (yyvsp[-2].ltok, yyvsp[-1].lclpredicate); yyval.lclpredicate = makeRequiresNode (yyvsp[-2].ltok, yyvsp[-1].lclpredicate);;
-    break;}
-case 122:
-#line 671 "llgrammar.y"
-{ yyval.modify = (modifyNode)0; ;
-    break;}
-case 123:
-#line 672 "llgrammar.y"
-{ yyval.modify = makeModifyNodeSpecial (yyvsp[-2].ltok, TRUE); ;
-    break;}
-case 124:
-#line 673 "llgrammar.y"
-{ yyval.modify = makeModifyNodeSpecial (yyvsp[-2].ltok, FALSE); ;
-    break;}
-case 125:
-#line 674 "llgrammar.y"
-{ yyval.modify = makeModifyNodeRef (yyvsp[-2].ltok, yyvsp[-1].storereflist); ;
-    break;}
-case 126:
-#line 677 "llgrammar.y"
-{ yyval.storereflist = storeRefNodeList_add (storeRefNodeList_new (), yyvsp[0].storeref); ;
-    break;}
-case 127:
-#line 678 "llgrammar.y"
-{ yyval.storereflist = storeRefNodeList_add (yyvsp[-2].storereflist, yyvsp[0].storeref); ;
-    break;}
-case 128:
-#line 681 "llgrammar.y"
-{ yyval.storeref = makeStoreRefNodeTerm (yyvsp[0].term); ;
-    break;}
-case 129:
-#line 682 "llgrammar.y"
-{ yyval.storeref = makeStoreRefNodeType (yyvsp[0].lcltypespec, FALSE); ;
-    break;}
-case 130:
-#line 683 "llgrammar.y"
-{ yyval.storeref = makeStoreRefNodeType (yyvsp[0].lcltypespec, TRUE); ;
-    break;}
-case 131:
-#line 684 "llgrammar.y"
-{ yyval.storeref = makeStoreRefNodeInternal (); ;
-    break;}
-case 132:
-#line 685 "llgrammar.y"
-{ yyval.storeref = makeStoreRefNodeSystem (); ;
-    break;}
-case 133:
-#line 688 "llgrammar.y"
-{ yyval.lclpredicate = (lclPredicateNode)0; ;
-    break;}
-case 134:
-#line 689 "llgrammar.y"
-{ checkLclPredicate (yyvsp[-2].ltok, yyvsp[-1].lclpredicate); yyval.lclpredicate = makeEnsuresNode (yyvsp[-2].ltok, yyvsp[-1].lclpredicate);;
-    break;}
-case 135:
-#line 692 "llgrammar.y"
-{ yyval.lclpredicate = (lclPredicateNode)0; ;
-    break;}
-case 136:
-#line 693 "llgrammar.y"
-{ checkLclPredicate (yyvsp[-2].ltok, yyvsp[-1].lclpredicate); yyval.lclpredicate = makeIntraClaimNode (yyvsp[-2].ltok, yyvsp[-1].lclpredicate);;
-    break;}
-case 137:
-#line 696 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_new (); ;
-    break;}
-case 138:
-#line 697 "llgrammar.y"
-{ yyval.paramlist = yyvsp[0].paramlist; ;
-    break;}
-case 140:
-#line 701 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_add (paramNodeList_new (), paramNode_elipsis ()); ;
-    break;}
-case 141:
-#line 702 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_add (yyvsp[-2].paramlist, paramNode_elipsis ()); ;
-    break;}
-case 142:
-#line 705 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_single (yyvsp[0].param); ;
-    break;}
-case 143:
-#line 706 "llgrammar.y"
-{ yyval.paramlist = paramNodeList_add (yyvsp[-2].paramlist, yyvsp[0].param); ;
-    break;}
-case 144:
-#line 709 "llgrammar.y"
-{ yyval.program = (programNode)0; ;
-    break;}
-case 145:
-#line 710 "llgrammar.y"
-{ yyval.program = yyvsp[-1].program; ;
-    break;}
-case 146:
-#line 711 "llgrammar.y"
-{ yyval.program = yyvsp[-2].program; ;
-    break;}
-case 147:
-#line 714 "llgrammar.y"
-{ yyval.program = makeProgramNode (yyvsp[0].stmt); ;
-    break;}
-case 148:
-#line 717 "llgrammar.y"
-{ yyval.program = yyvsp[-1].program; yyval.program->wrapped = yyval.program->wrapped + 1; ;
-    break;}
-case 149:
-#line 719 "llgrammar.y"
-{ programNodeList x = programNodeList_new ();
-     programNodeList_addh (x, yyvsp[-1].program);
-     yyval.program = makeProgramNodeAction (x, ACT_ITER); 
-   ;
-    break;}
-case 150:
-#line 724 "llgrammar.y"
-{ programNodeList x = programNodeList_new ();
-     programNodeList_addh (x, yyvsp[-2].program);
-     programNodeList_addh (x, yyvsp[0].program);
-     yyval.program = makeProgramNodeAction (x, ACT_ALTERNATE); 
-   ;
-    break;}
-case 151:
-#line 730 "llgrammar.y"
-{ programNodeList x = programNodeList_new ();
-     programNodeList_addh (x, yyvsp[-2].program);
-     programNodeList_addh (x, yyvsp[0].program);
-     yyval.program = makeProgramNodeAction (x, ACT_SEQUENCE); 
-   ;
-    break;}
-case 152:
-#line 738 "llgrammar.y"
-{ yyval.stmt = makeStmtNode (ltoken_undefined, yyvsp[-3].ltok, yyvsp[-1].termlist); ;
-    break;}
-case 153:
-#line 740 "llgrammar.y"
-{ yyval.stmt = makeStmtNode (ltoken_undefined, yyvsp[-2].ltok, termNodeList_new ()); ;
-    break;}
-case 154:
-#line 742 "llgrammar.y"
-{ yyval.stmt = makeStmtNode (yyvsp[-4].ltok, yyvsp[-2].ltok, termNodeList_new ()); ;
-    break;}
-case 155:
-#line 744 "llgrammar.y"
-{ yyval.stmt = makeStmtNode (yyvsp[-5].ltok, yyvsp[-3].ltok, yyvsp[-1].termlist); ;
-    break;}
-case 156:
-#line 747 "llgrammar.y"
-{ yyval.termlist = termNodeList_push (termNodeList_new (), yyvsp[0].term); ;
-    break;}
-case 157:
-#line 748 "llgrammar.y"
-{ yyval.termlist = termNodeList_push (yyvsp[-2].termlist, yyvsp[0].term); ;
-    break;}
-case 159:
-#line 752 "llgrammar.y"
-{ yyval.term = makeSimpleTermNode (yyvsp[0].ltok); ;
-    break;}
-case 160:
-#line 753 "llgrammar.y"
-{ yyval.term = makePrefixTermNode (yyvsp[-1].ltok, yyvsp[0].term); ;
-    break;}
-case 161:
-#line 754 "llgrammar.y"
-{ yyval.term = makePostfixTermNode2 (yyvsp[-1].term, yyvsp[0].ltok); ;
-    break;}
-case 162:
-#line 755 "llgrammar.y"
-{ yyval.term = makeInfixTermNode (yyvsp[-2].term, yyvsp[-1].ltok, yyvsp[0].term); ;
-    break;}
-case 163:
-#line 756 "llgrammar.y"
-{ yyval.term = yyvsp[-1].term; yyval.term->wrapped = yyval.term->wrapped + 1; ;
-    break;}
-case 164:
-#line 758 "llgrammar.y"
-{ yyval.term = makeOpCallTermNode (yyvsp[-2].ltok, yyvsp[-1].ltok, termNodeList_new (), yyvsp[0].ltok); ;
-    break;}
-case 165:
-#line 760 "llgrammar.y"
-{ yyval.term = makeOpCallTermNode (yyvsp[-3].ltok, yyvsp[-2].ltok, yyvsp[-1].termlist, yyvsp[0].ltok); ;
-    break;}
-case 166:
-#line 763 "llgrammar.y"
-{ yyval.abstbody = (abstBodyNode)0; ;
-    break;}
-case 167:
-#line 764 "llgrammar.y"
-{ yyval.abstbody = makeAbstBodyNode (yyvsp[-2].ltok, yyvsp[-1].fcns); ;
-    break;}
-case 168:
-#line 765 "llgrammar.y"
-{ yyval.abstbody = makeAbstBodyNode2 (yyvsp[-3].ltok, yyvsp[-2].ltokenList); ;
-    break;}
-case 169:
-#line 766 "llgrammar.y"
-{ yyval.abstbody = (abstBodyNode)0; ;
-    break;}
-case 170:
-#line 769 "llgrammar.y"
-{ yyval.fcns = fcnNodeList_new (); ;
-    break;}
-case 171:
-#line 770 "llgrammar.y"
-{ yyval.fcns = fcnNodeList_add (yyvsp[-1].fcns, yyvsp[0].fcn); ;
-    break;}
-case 172:
-#line 773 "llgrammar.y"
-{ yyval.lclpredicate = (lclPredicateNode)0; ;
-    break;}
-case 174:
-#line 777 "llgrammar.y"
-{ g_inTypeDef = FALSE; ;
-    break;}
-case 175:
-#line 778 "llgrammar.y"
-{ yyvsp[-1].lclpredicate->tok = yyvsp[-5].ltok; yyvsp[-1].lclpredicate->kind = LPD_CONSTRAINT;
-     checkLclPredicate (yyvsp[-5].ltok, yyvsp[-1].lclpredicate);
-     yyval.lclpredicate = yyvsp[-1].lclpredicate;
-     symtable_exitScope (g_symtab); 
-     g_inTypeDef = TRUE;
-   ;
-    break;}
-case 176:
-#line 786 "llgrammar.y"
-{ yyval.declaratorinvs = declaratorInvNodeList_add (declaratorInvNodeList_new (), yyvsp[0].declaratorinv); ;
-    break;}
-case 177:
-#line 788 "llgrammar.y"
-{ yyval.declaratorinvs = declaratorInvNodeList_add (yyvsp[-2].declaratorinvs, yyvsp[0].declaratorinv); ;
-    break;}
-case 178:
-#line 791 "llgrammar.y"
-{ declareForwardType (yyvsp[0].declare); ;
-    break;}
-case 179:
-#line 792 "llgrammar.y"
-{ yyval.declaratorinv = makeDeclaratorInvNode (yyvsp[-2].declare, yyvsp[0].abstbody); ;
-    break;}
-case 180:
-#line 795 "llgrammar.y"
-{ yyval.abstbody = (abstBodyNode)0; ;
-    break;}
-case 181:
-#line 796 "llgrammar.y"
-{ yyval.abstbody = makeExposedBodyNode (yyvsp[-2].ltok, yyvsp[-1].lclpredicate); ;
-    break;}
-case 182:
-#line 799 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_VOID, 0)); ;
-    break;}
-case 183:
-#line 800 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_CHAR, 0)); ;
-    break;}
-case 184:
-#line 801 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_DOUBLE, 0)); ;
-    break;}
-case 185:
-#line 802 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_FLOAT, 0)); ;
-    break;}
-case 186:
-#line 803 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_INT, 0)); ;
-    break;}
-case 187:
-#line 804 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_LONG, 0)); ;
-    break;}
-case 188:
-#line 805 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_SHORT, 0)); ;
-    break;}
-case 189:
-#line 806 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_SIGNED, 0)); ;
-    break;}
-case 190:
-#line 807 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_UNSIGNED, 0)); ;
-    break;}
-case 191:
-#line 808 "llgrammar.y"
-{ yyval.ltok = yyvsp[0].ltok; ltoken_setIntField (yyval.ltok, fixBits (TS_UNKNOWN, 0)); ;
-    break;}
-case 192:
-#line 816 "llgrammar.y"
-{ yyval.ctypes = makeCTypesNode ((CTypesNode)0, yyvsp[0].ltok); ;
-    break;}
-case 193:
-#line 817 "llgrammar.y"
-{ yyval.ctypes = makeCTypesNode (yyvsp[-1].ctypes, yyvsp[0].ltok); ;
-    break;}
-case 194:
-#line 823 "llgrammar.y"
-{ yyval.ctypes = makeTypeSpecifier (yyvsp[0].ltok); ;
-    break;}
-case 195:
-#line 825 "llgrammar.y"
-{ yyval.ctypes = yyvsp[0].ctypes; yyval.ctypes->sort = sort_lookupName (lclctype_toSort (yyvsp[0].ctypes->intfield)); ;
-    break;}
-case 196:
-#line 830 "llgrammar.y"
-{ yyval.typequal = qual_createOut (); ;
-    break;}
-case 197:
-#line 831 "llgrammar.y"
-{ yyval.typequal = qual_createUnused (); ;
-    break;}
-case 198:
-#line 832 "llgrammar.y"
-{ yyval.typequal = qual_createSef (); ;
-    break;}
-case 199:
-#line 833 "llgrammar.y"
-{ yyval.typequal = qual_createOnly (); ;
-    break;}
-case 200:
-#line 834 "llgrammar.y"
-{ yyval.typequal = qual_createOwned (); ;
-    break;}
-case 201:
-#line 835 "llgrammar.y"
-{ yyval.typequal = qual_createDependent (); ;
-    break;}
-case 202:
-#line 836 "llgrammar.y"
-{ yyval.typequal = qual_createKeep (); ;
-    break;}
-case 203:
-#line 837 "llgrammar.y"
-{ yyval.typequal = qual_createKept (); ;
-    break;}
-case 204:
-#line 838 "llgrammar.y"
-{ yyval.typequal = qual_createObserver (); ;
-    break;}
-case 205:
-#line 839 "llgrammar.y"
-{ yyval.typequal = qual_createExits (); ;
-    break;}
-case 206:
-#line 840 "llgrammar.y"
-{ yyval.typequal = qual_createMayExit (); ;
-    break;}
-case 207:
-#line 841 "llgrammar.y"
-{ yyval.typequal = qual_createTrueExit (); ;
-    break;}
-case 208:
-#line 842 "llgrammar.y"
-{ yyval.typequal = qual_createFalseExit (); ;
-    break;}
-case 209:
-#line 843 "llgrammar.y"
-{ yyval.typequal = qual_createNeverExit (); ;
-    break;}
-case 210:
-#line 844 "llgrammar.y"
-{ yyval.typequal = qual_createOnly (); ;
-    break;}
-case 211:
-#line 845 "llgrammar.y"
-{ yyval.typequal = qual_createShared (); ;
-    break;}
-case 212:
-#line 846 "llgrammar.y"
-{ yyval.typequal = qual_createUnique (); ;
-    break;}
-case 213:
-#line 847 "llgrammar.y"
-{ yyval.typequal = qual_createChecked (); ;
-    break;}
-case 214:
-#line 848 "llgrammar.y"
-{ yyval.typequal = qual_createUnchecked (); ;
-    break;}
-case 215:
-#line 849 "llgrammar.y"
-{ yyval.typequal = qual_createCheckedStrict (); ;
-    break;}
-case 216:
-#line 850 "llgrammar.y"
-{ yyval.typequal = qual_createTrueNull (); ;
-    break;}
-case 217:
-#line 851 "llgrammar.y"
-{ yyval.typequal = qual_createFalseNull (); ;
-    break;}
-case 218:
-#line 852 "llgrammar.y"
-{ yyval.typequal = qual_createRelNull (); ;
-    break;}
-case 219:
-#line 853 "llgrammar.y"
-{ yyval.typequal = qual_createRelDef (); ;
-    break;}
-case 220:
-#line 854 "llgrammar.y"
-{ yyval.typequal = qual_createRefCounted (); ;
-    break;}
-case 221:
-#line 855 "llgrammar.y"
-{ yyval.typequal = qual_createRefs (); ;
-    break;}
-case 222:
-#line 856 "llgrammar.y"
-{ yyval.typequal = qual_createNewRef (); ;
-    break;}
-case 223:
-#line 857 "llgrammar.y"
-{ yyval.typequal = qual_createKillRef (); ;
-    break;}
-case 224:
-#line 858 "llgrammar.y"
-{ yyval.typequal = qual_createNull (); ;
-    break;}
-case 225:
-#line 859 "llgrammar.y"
-{ yyval.typequal = qual_createNotNull (); ;
-    break;}
-case 226:
-#line 860 "llgrammar.y"
-{ yyval.typequal = qual_createReturned (); ;
-    break;}
-case 227:
-#line 861 "llgrammar.y"
-{ yyval.typequal = qual_createExposed (); ;
-    break;}
-case 228:
-#line 862 "llgrammar.y"
-{ yyval.typequal = qual_createPartial (); ;
-    break;}
-case 229:
-#line 863 "llgrammar.y"
-{ yyval.typequal = qual_createNullTerminated () ; ;
-    break;}
-case 230:
-#line 864 "llgrammar.y"
-{ yyval.typequal = qual_createUndef (); ;
-    break;}
-case 231:
-#line 865 "llgrammar.y"
-{ yyval.typequal = qual_createKilled (); ;
-    break;}
-case 232:
-#line 869 "llgrammar.y"
-{ yyval.lcltypespec = makeLclTypeSpecNodeType (yyvsp[0].ctypes); ;
-    break;}
-case 233:
-#line 871 "llgrammar.y"
-{ yyval.lcltypespec = makeLclTypeSpecNodeSU (yyvsp[0].structorunion); ;
-    break;}
-case 234:
-#line 873 "llgrammar.y"
-{ yyval.lcltypespec = makeLclTypeSpecNodeEnum (yyvsp[0].enumspec); ;
-    break;}
-case 235:
-#line 875 "llgrammar.y"
-{ yyval.lcltypespec = lclTypeSpecNode_addQual (yyvsp[0].lcltypespec, yyvsp[-1].typequal); ;
-    break;}
-case 236:
-#line 877 "llgrammar.y"
-{ yyval.lcltypespec = makeLclTypeSpecNodeConj (yyvsp[-3].lcltypespec, yyvsp[-1].lcltypespec); ;
-    break;}
-case 238:
-#line 887 "llgrammar.y"
-{ llassert (lclTypeSpecNode_isDefined (yyvsp[-1].lcltypespec));
-     yyvsp[-1].lcltypespec->pointers = yyvsp[0].count; yyval.lcltypespec = yyvsp[-1].lcltypespec; ;
-    break;}
-case 239:
-#line 891 "llgrammar.y"
-{ yyval.count = 1; ;
-    break;}
-case 240:
-#line 892 "llgrammar.y"
-{ yyval.count = yyvsp[-1].count + 1; ;
-    break;}
-case 241:
-#line 896 "llgrammar.y"
-{ (void) checkAndEnterTag (TAG_FWDSTRUCT, ltoken_copy (yyvsp[0].ltok)); ;
-    break;}
-case 242:
-#line 898 "llgrammar.y"
-{ yyval.structorunion = makestrOrUnionNode (yyvsp[-5].ltok, SU_STRUCT, yyvsp[-4].ltok, yyvsp[-1].structdecls); ;
-    break;}
-case 243:
-#line 900 "llgrammar.y"
-{ (void) checkAndEnterTag (TAG_FWDUNION, ltoken_copy (yyvsp[0].ltok)); ;
-    break;}
-case 244:
-#line 902 "llgrammar.y"
-{ yyval.structorunion = makestrOrUnionNode (yyvsp[-5].ltok, SU_UNION, yyvsp[-4].ltok, yyvsp[-1].structdecls); ;
-    break;}
-case 245:
-#line 904 "llgrammar.y"
-{ yyval.structorunion = makeForwardstrOrUnionNode (yyvsp[-1].ltok, SU_STRUCT, yyvsp[0].ltok); ;
-    break;}
-case 246:
-#line 906 "llgrammar.y"
-{ yyval.structorunion = makeForwardstrOrUnionNode (yyvsp[-1].ltok, SU_UNION, yyvsp[0].ltok); ;
-    break;}
-case 247:
-#line 909 "llgrammar.y"
-{ yyval.ltok = ltoken_undefined; ;
-    break;}
-case 249:
-#line 913 "llgrammar.y"
-{ yyval.structdecls = stDeclNodeList_add (stDeclNodeList_new (), yyvsp[0].structdecl); ;
-    break;}
-case 250:
-#line 914 "llgrammar.y"
-{ yyval.structdecls = stDeclNodeList_add (yyvsp[-1].structdecls, yyvsp[0].structdecl); ;
-    break;}
-case 251:
-#line 919 "llgrammar.y"
-{ yyval.structdecl = makestDeclNode (yyvsp[-2].lcltypespec, yyvsp[-1].declarelist); ;
-    break;}
-case 252:
-#line 923 "llgrammar.y"
-{ yyval.declarelist = declaratorNodeList_add (declaratorNodeList_new (), yyvsp[0].declare); ;
-    break;}
-case 253:
-#line 925 "llgrammar.y"
-{ yyval.declarelist = declaratorNodeList_add (yyvsp[-2].declarelist, yyvsp[0].declare); ;
-    break;}
-case 254:
-#line 928 "llgrammar.y"
-{ ; ;
-    break;}
-case 255:
-#line 929 "llgrammar.y"
-{ ; ;
-    break;}
-case 256:
-#line 933 "llgrammar.y"
-{ yyval.enumspec = makeEnumSpecNode (yyvsp[-5].ltok, yyvsp[-4].ltok, yyvsp[-2].ltokenList); ;
-    break;}
-case 257:
-#line 935 "llgrammar.y"
-{ yyval.enumspec = makeEnumSpecNode2 (yyvsp[-1].ltok, yyvsp[0].ltok); ;
-    break;}
-case 258:
-#line 938 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
-    break;}
-case 259:
-#line 939 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 260:
-#line 949 "llgrammar.y"
-{ yyval.declare = makeDeclaratorNode (yyvsp[0].typeexpr); ;
-    break;}
-case 261:
-#line 950 "llgrammar.y"
-{ yyval.declare = makeDeclaratorNode (yyvsp[0].typeexpr); ;
-    break;}
-case 262:
-#line 953 "llgrammar.y"
-{ yyval.typeexpr = makeTypeExpr (yyvsp[0].ltok); ;
-    break;}
-case 263:
-#line 954 "llgrammar.y"
-{ yyval.typeexpr = yyvsp[-1].typeexpr; yyval.typeexpr->wrapped = yyval.typeexpr->wrapped + 1; ;
-    break;}
-case 264:
-#line 955 "llgrammar.y"
-{ yyval.typeexpr = makePointerNode (yyvsp[-1].ltok, yyvsp[0].typeexpr); ;
-    break;}
-case 265:
-#line 956 "llgrammar.y"
-{ yyval.typeexpr = makeArrayNode (yyvsp[-1].typeexpr, yyvsp[0].array); ;
-    break;}
-case 266:
-#line 957 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-2].typeexpr, paramNodeList_new ()); ;
-    break;}
-case 267:
-#line 958 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-3].typeexpr, yyvsp[-1].paramlist); ;
-    break;}
-case 268:
-#line 961 "llgrammar.y"
-{ yyval.typeexpr = makeTypeExpr (yyvsp[0].ltok); ;
-    break;}
-case 269:
-#line 962 "llgrammar.y"
-{ yyval.typeexpr = yyvsp[-1].typeexpr; yyval.typeexpr->wrapped = yyval.typeexpr->wrapped + 1; ;
-    break;}
-case 270:
-#line 963 "llgrammar.y"
-{ yyval.typeexpr = makePointerNode (yyvsp[-1].ltok, yyvsp[0].typeexpr); ;
-    break;}
-case 271:
-#line 964 "llgrammar.y"
-{ yyval.typeexpr = makeArrayNode (yyvsp[-1].typeexpr, yyvsp[0].array); ;
-    break;}
-case 272:
-#line 965 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-2].typeexpr, paramNodeList_new ()); ;
-    break;}
-case 273:
-#line 966 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-3].typeexpr, yyvsp[-1].paramlist); ;
-    break;}
-case 274:
-#line 975 "llgrammar.y"
-{ yyval.typeexpr = makeTypeExpr (yyvsp[0].ltok); ;
-    break;}
-case 275:
-#line 976 "llgrammar.y"
-{ yyval.typeexpr = makePointerNode (yyvsp[-1].ltok, yyvsp[0].typeexpr); ;
-    break;}
-case 276:
-#line 977 "llgrammar.y"
-{ yyval.typeexpr = makeArrayNode (yyvsp[-1].typeexpr, yyvsp[0].array); ;
-    break;}
-case 277:
-#line 978 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-2].typeexpr, paramNodeList_new ()); ;
-    break;}
-case 278:
-#line 979 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-3].typeexpr, yyvsp[-1].paramlist); ;
-    break;}
-case 279:
-#line 985 "llgrammar.y"
-{ yyval.param = makeParamNode (yyvsp[-1].lcltypespec, yyvsp[0].typeexpr); ;
-    break;}
-case 280:
-#line 986 "llgrammar.y"
-{ yyval.param = makeParamNode (yyvsp[-1].lcltypespec, yyvsp[0].typeexpr); ;
-    break;}
-case 281:
-#line 987 "llgrammar.y"
-{ yyval.param = makeParamNode (yyvsp[-1].lcltypespec, yyvsp[0].abstDecl); ;
-    break;}
-case 282:
-#line 997 "llgrammar.y"
-{ yyval.typname = makeTypeNameNode (FALSE, yyvsp[-1].lcltypespec, yyvsp[0].abstDecl); ;
-    break;}
-case 283:
-#line 998 "llgrammar.y"
-{ yyval.typname = makeTypeNameNode (TRUE, yyvsp[-1].lcltypespec, yyvsp[0].abstDecl); ;
-    break;}
-case 284:
-#line 999 "llgrammar.y"
-{ yyval.typname = makeTypeNameNodeOp (yyvsp[0].opform); ;
-    break;}
-case 285:
-#line 1004 "llgrammar.y"
-{ yyval.abstDecl = (abstDeclaratorNode)0; ;
-    break;}
-case 286:
-#line 1005 "llgrammar.y"
-{ yyval.abstDecl = (abstDeclaratorNode)yyvsp[0].typeexpr; ;
-    break;}
-case 287:
-#line 1008 "llgrammar.y"
-{ yyval.typeexpr = yyvsp[-1].typeexpr; yyval.typeexpr->wrapped = yyval.typeexpr->wrapped + 1; ;
-    break;}
-case 288:
-#line 1009 "llgrammar.y"
-{ yyval.typeexpr = makePointerNode (yyvsp[-1].ltok, yyvsp[0].typeexpr); ;
-    break;}
-case 289:
-#line 1010 "llgrammar.y"
-{ yyval.typeexpr = makePointerNode (yyvsp[0].ltok, (typeExpr)0); ;
-    break;}
-case 290:
-#line 1011 "llgrammar.y"
-{ yyval.typeexpr = makeArrayNode ((typeExpr)0, yyvsp[0].array); ;
-    break;}
-case 291:
-#line 1012 "llgrammar.y"
-{ yyval.typeexpr = makeArrayNode (yyvsp[-1].typeexpr, yyvsp[0].array); ;
-    break;}
-case 292:
-#line 1013 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-2].typeexpr, paramNodeList_new ()); ;
-    break;}
-case 293:
-#line 1014 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode ((typeExpr)0, yyvsp[-1].paramlist); ;
-    break;}
-case 294:
-#line 1015 "llgrammar.y"
-{ yyval.typeexpr = makeFunctionNode (yyvsp[-3].typeexpr, yyvsp[-1].paramlist); ;
-    break;}
-case 295:
-#line 1018 "llgrammar.y"
-{ yyval.array = makeArrayQualNode (yyvsp[-1].ltok, (termNode)0); ;
-    break;}
-case 296:
-#line 1019 "llgrammar.y"
-{ yyval.array = makeArrayQualNode (yyvsp[-2].ltok, yyvsp[-1].term); ;
-    break;}
-case 297:
-#line 1023 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-5].ltok, OPF_IF, opFormUnion_createMiddle (0), ltoken_undefined); ;
-    break;}
-case 298:
-#line 1025 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[0].ltok, OPF_ANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 299:
-#line 1027 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 300:
-#line 1029 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_ANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
-    break;}
-case 301:
-#line 1031 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MANYOPM, 
-			  opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
-    break;}
-case 302:
-#line 1034 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 303:
-#line 1036 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 304:
-#line 1038 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 305:
-#line 1040 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 306:
-#line 1042 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 307:
-#line 1044 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 308:
-#line 1052 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 309:
-#line 1054 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMMIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 310:
-#line 1056 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_SELECT, 
-			  opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 311:
-#line 1059 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MAP, 
-			  opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 312:
-#line 1062 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MSELECT, 
-			  opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 313:
-#line 1065 "llgrammar.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMAP, 
-			  opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 321:
-#line 1082 "llgrammar.y"
-{ yyval.count = 0; ;
-    break;}
-case 323:
-#line 1086 "llgrammar.y"
-{ yyval.count = 1; ;
-    break;}
-case 324:
-#line 1087 "llgrammar.y"
-{ yyval.count = yyvsp[-2].count + 1; ;
-    break;}
-case 327:
-#line 1094 "llgrammar.y"
-{ yyval.signature = makesigNode (yyvsp[-3].ltok, yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 328:
-#line 1097 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_new (); ;
-    break;}
-case 330:
-#line 1101 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
-    break;}
-case 331:
-#line 1102 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 332:
-#line 1105 "llgrammar.y"
-{ yyval.lclpredicate = makeLclPredicateNode (ltoken_undefined, yyvsp[0].term, LPD_PLAIN);;
-    break;}
-case 333:
-#line 1108 "llgrammar.y"
-{ yyval.term = checkSort (yyvsp[0].term); ;
-    break;}
-case 334:
-#line 1115 "llgrammar.y"
-{ yyval.term = makeIfTermNode (yyvsp[-5].ltok,yyvsp[-4].term,yyvsp[-3].ltok,yyvsp[-2].term,yyvsp[-1].ltok,yyvsp[0].term); ;
-    break;}
-case 336:
-#line 1117 "llgrammar.y"
-{ yyval.term = makeInfixTermNode (yyvsp[-2].term, yyvsp[-1].ltok, yyvsp[0].term); ;
-    break;}
-case 338:
-#line 1123 "llgrammar.y"
-{ checkLclPredicate (yyvsp[-2].ltok, yyvsp[-1].lclpredicate); yyval.term = makeQuantifiedTermNode (yyvsp[-3].quantifiers, yyvsp[-2].ltok, yyvsp[-1].lclpredicate->predicate, yyvsp[0].ltok);
-     symtable_exitScope (g_symtab); 
-   ;
-    break;}
-case 339:
-#line 1127 "llgrammar.y"
-{ yyval.term = makeInfixTermNode (yyvsp[-2].term, yyvsp[-1].ltok, yyvsp[0].term);;
-    break;}
-case 340:
-#line 1129 "llgrammar.y"
-{ yyval.term = makeInfixTermNode (yyvsp[-2].term, yyvsp[-1].ltok, yyvsp[0].term);;
-    break;}
-case 342:
-#line 1133 "llgrammar.y"
-{ yyval.term = makePostfixTermNode (yyvsp[-1].term, yyvsp[0].ltokenList); ;
-    break;}
-case 343:
-#line 1134 "llgrammar.y"
-{ yyval.term = CollapseInfixTermNode (yyvsp[-1].term, yyvsp[0].termlist); ;
-    break;}
-case 347:
-#line 1142 "llgrammar.y"
-{ yyval.term = makePrefixTermNode (yyvsp[-1].ltok, yyvsp[0].term); ;
-    break;}
-case 348:
-#line 1145 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
-    break;}
-case 349:
-#line 1146 "llgrammar.y"
-{ yyval.ltokenList = ltokenList_push (yyvsp[-1].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 350:
-#line 1149 "llgrammar.y"
-{ yyval.termlist = pushInfixOpPartNode (termNodeList_new (), yyvsp[-1].ltok, yyvsp[0].term); ;
-    break;}
-case 351:
-#line 1150 "llgrammar.y"
-{ yyval.termlist = pushInfixOpPartNode (yyvsp[-2].termlist, yyvsp[-1].ltok, yyvsp[0].term); ;
-    break;}
-case 353:
-#line 1154 "llgrammar.y"
-{ yyval.term = computePossibleSorts (yyvsp[0].term); ;
-    break;}
-case 354:
-#line 1155 "llgrammar.y"
-{ yyval.term = updateMatchedNode ((termNode)0, yyvsp[-1].term, yyvsp[0].term); ;
-    break;}
-case 355:
-#line 1156 "llgrammar.y"
-{ yyval.term = updateMatchedNode (yyvsp[-1].term, yyvsp[0].term, (termNode)0); ;
-    break;}
-case 356:
-#line 1157 "llgrammar.y"
-{ yyval.term = updateMatchedNode (yyvsp[-2].term, yyvsp[-1].term, yyvsp[0].term); ;
-    break;}
-case 357:
-#line 1158 "llgrammar.y"
-{ yyval.term = computePossibleSorts (yyvsp[0].term); ;
-    break;}
-case 358:
-#line 1159 "llgrammar.y"
-{ yyval.term = updateSqBracketedNode ((termNode)0, yyvsp[-1].term, yyvsp[0].term); ;
-    break;}
-case 359:
-#line 1162 "llgrammar.y"
-{ yyval.term = yyvsp[-2].term; yyval.term->sort = sort_lookupName (ltoken_getText (yyvsp[0].ltok)); ;
-    break;}
-case 361:
-#line 1167 "llgrammar.y"
-{ yyval.term = makeSqBracketedNode (yyvsp[-4].ltok, yyvsp[-3].termlist, yyvsp[-2].ltok); 
-     yyval.term->given = sort_lookupName (ltoken_getText (yyvsp[0].ltok)); ;
-    break;}
-case 362:
-#line 1170 "llgrammar.y"
-{ yyval.term = makeSqBracketedNode (yyvsp[-2].ltok, yyvsp[-1].termlist, yyvsp[0].ltok); ;
-    break;}
-case 363:
-#line 1172 "llgrammar.y"
-{ yyval.term = makeSqBracketedNode (yyvsp[-3].ltok, termNodeList_new (), yyvsp[-2].ltok); 
-     yyval.term->given = sort_lookupName (ltoken_getText (yyvsp[0].ltok)); 
-   ;
-    break;}
-case 364:
-#line 1176 "llgrammar.y"
-{ yyval.term = makeSqBracketedNode (yyvsp[-1].ltok, termNodeList_new (), yyvsp[0].ltok); ;
-    break;}
-case 365:
-#line 1179 "llgrammar.y"
-{ yyval.term = makeMatchedNode (yyvsp[-2].ltok, yyvsp[-1].termlist, yyvsp[0].ltok); ;
-    break;}
-case 366:
-#line 1180 "llgrammar.y"
-{ yyval.term = makeMatchedNode (yyvsp[-1].ltok, termNodeList_new (), yyvsp[0].ltok); ;
-    break;}
-case 367:
-#line 1183 "llgrammar.y"
-{ yyval.termlist = termNodeList_push (termNodeList_new (), yyvsp[0].term); ;
-    break;}
-case 368:
-#line 1184 "llgrammar.y"
-{ yyval.termlist = termNodeList_push (yyvsp[-2].termlist, yyvsp[0].term); ;
-    break;}
-case 369:
-#line 1188 "llgrammar.y"
-{ yyval.term = yyvsp[-1].term; yyval.term->wrapped = yyval.term->wrapped + 1; ;
-    break;}
-case 370:
-#line 1190 "llgrammar.y"
-{ yyval.term = makeSimpleTermNode (yyvsp[0].ltok); ;
-    break;}
-case 371:
-#line 1192 "llgrammar.y"
-{ yyval.term = makeOpCallTermNode (yyvsp[-3].ltok, yyvsp[-2].ltok, yyvsp[-1].termlist, yyvsp[0].ltok); ;
-    break;}
-case 373:
-#line 1195 "llgrammar.y"
-{ yyval.term = makePostfixTermNode2 (yyvsp[-1].term, yyvsp[0].ltok); ;
-    break;}
-case 374:
-#line 1197 "llgrammar.y"
-{ ltoken_markOwned (yyvsp[0].ltok); yyval.term = makeSelectTermNode (yyvsp[-2].term, yyvsp[-1].ltok, yyvsp[0].ltok); ;
-    break;}
-case 375:
-#line 1199 "llgrammar.y"
-{ ltoken_markOwned (yyvsp[0].ltok); yyval.term = makeMapTermNode (yyvsp[-2].term, yyvsp[-1].ltok, yyvsp[0].ltok); ;
-    break;}
-case 376:
-#line 1201 "llgrammar.y"
-{ yyval.term = updateSqBracketedNode (yyvsp[-2].term, makeSqBracketedNode (yyvsp[-1].ltok, termNodeList_new (), yyvsp[0].ltok), 
-				(termNode)0); ;
-    break;}
-case 377:
-#line 1204 "llgrammar.y"
-{ yyval.term = updateSqBracketedNode (yyvsp[-3].term, makeSqBracketedNode (yyvsp[-2].ltok, yyvsp[-1].termlist, yyvsp[0].ltok), (termNode)0); ;
-    break;}
-case 378:
-#line 1206 "llgrammar.y"
-{ yyval.term = yyvsp[-2].term; yyval.term->given = sort_lookupName (ltoken_getText (yyvsp[0].ltok)); ;
-    break;}
-case 379:
-#line 1209 "llgrammar.y"
-{ yyval.termlist = termNodeList_push (termNodeList_new (), yyvsp[0].term); ;
-    break;}
-case 380:
-#line 1210 "llgrammar.y"
-{ yyval.termlist = termNodeList_push (yyvsp[-2].termlist, yyvsp[0].term); ;
-    break;}
-case 386:
-#line 1220 "llgrammar.y"
-{ yyval.term = makeSimpleTermNode (yyvsp[0].ltok); ;
-    break;}
-case 387:
-#line 1221 "llgrammar.y"
-{ yyval.term = makeOpCallTermNode (yyvsp[-3].ltok, yyvsp[-2].ltok, yyvsp[-1].termlist, yyvsp[0].ltok); ;
-    break;}
-case 388:
-#line 1222 "llgrammar.y"
-{ yyval.term = makeUnchangedTermNode1 (yyvsp[-3].ltok, yyvsp[-1].ltok); ;
-    break;}
-case 389:
-#line 1223 "llgrammar.y"
-{ yyval.term = makeUnchangedTermNode2 (yyvsp[-3].ltok, yyvsp[-1].storereflist); ;
-    break;}
-case 390:
-#line 1225 "llgrammar.y"
-{ termNodeList x = termNodeList_new (); 
-     termNodeList_addh (x, yyvsp[-1].term);
-     yyval.term = makeOpCallTermNode (yyvsp[-3].ltok, yyvsp[-2].ltok, x, yyvsp[0].ltok); 
-   ;
-    break;}
-case 391:
-#line 1230 "llgrammar.y"
-{ termNodeList x = termNodeList_new ();
-     termNodeList_addh (x, yyvsp[-3].term);
-     termNodeList_addh (x, yyvsp[-1].term);
-     yyval.term = makeOpCallTermNode (yyvsp[-5].ltok, yyvsp[-4].ltok, x, yyvsp[0].ltok); 
-   ;
-    break;}
-case 392:
-#line 1235 "llgrammar.y"
-{ yyval.term = makeSizeofTermNode (yyvsp[-3].ltok, yyvsp[-1].lcltypespec); ;
-    break;}
-case 393:
-#line 1245 "llgrammar.y"
-{ yyval.term = makeLiteralTermNode (yyvsp[0].ltok, sort_int); ;
-    break;}
-case 394:
-#line 1246 "llgrammar.y"
-{ yyval.term = makeLiteralTermNode (yyvsp[0].ltok, sort_cstring); ;
-    break;}
-case 395:
-#line 1247 "llgrammar.y"
-{ yyval.term = makeLiteralTermNode (yyvsp[0].ltok, sort_char); ;
-    break;}
-case 396:
-#line 1248 "llgrammar.y"
-{ yyval.term = makeLiteralTermNode (yyvsp[0].ltok, sort_double); ;
-    break;}
-case 397:
-#line 1252 "llgrammar.y"
-{ yyval.quantifiers = quantifierNodeList_add (quantifierNodeList_new (), yyvsp[0].quantifier); ;
-    break;}
-case 398:
-#line 1254 "llgrammar.y"
-{ yyval.quantifiers = quantifierNodeList_add (yyvsp[-1].quantifiers, yyvsp[0].quantifier); ;
-    break;}
-case 399:
-#line 1257 "llgrammar.y"
-{ scopeInfo si = (scopeInfo) dmalloc (sizeof (*si));
-		   si->kind = SPE_QUANT;
-		   symtable_enterScope (g_symtab, si); ;
-    break;}
-case 400:
-#line 1261 "llgrammar.y"
-{ yyval.quantifier = makeQuantifierNode (yyvsp[0].vars, yyvsp[-2].ltok); ;
-    break;}
-case 401:
-#line 1264 "llgrammar.y"
-{ yyval.vars = varNodeList_add (varNodeList_new (), yyvsp[0].var); ;
-    break;}
-case 402:
-#line 1265 "llgrammar.y"
-{ yyval.vars = varNodeList_add (yyvsp[-2].vars, yyvsp[0].var); ;
-    break;}
-case 403:
-#line 1268 "llgrammar.y"
-{ yyval.var = makeVarNode (yyvsp[-2].ltok, FALSE, yyvsp[0].lcltypespec); ;
-    break;}
-case 404:
-#line 1269 "llgrammar.y"
-{ yyval.var = makeVarNode (yyvsp[-3].ltok, TRUE, yyvsp[0].lcltypespec); ;
-    break;}
-}
-   /* the action file gets copied in in place of this dollarsign */
-#line 543 "/usr/lib/bison.simple"
-
-  yyvsp -= yylen;
-  yyssp -= yylen;
-#ifdef YYLSP_NEEDED
-  yylsp -= yylen;
-#endif
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      short *ssp1 = yyss - 1;
-      fprintf (stderr, "state stack now");
-      while (ssp1 != yyssp)
-	fprintf (stderr, " %d", *++ssp1);
-      fprintf (stderr, "\n");
-    }
-#endif
-
-  *++yyvsp = yyval;
-
-#ifdef YYLSP_NEEDED
-  yylsp++;
-  if (yylen == 0)
-    {
-      yylsp->first_line = yylloc.first_line;
-      yylsp->first_column = yylloc.first_column;
-      yylsp->last_line = (yylsp-1)->last_line;
-      yylsp->last_column = (yylsp-1)->last_column;
-      yylsp->text = 0;
-    }
-  else
-    {
-      yylsp->last_line = (yylsp+yylen-1)->last_line;
-      yylsp->last_column = (yylsp+yylen-1)->last_column;
-    }
-#endif
-
-  /* Now "shift" the result of the reduction.
-     Determine what state that goes to,
-     based on the state we popped back to
-     and the rule number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
-  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTBASE];
-
-  goto yynewstate;
-
-yyerrlab:   /* here on detecting error */
-
-  if (! yyerrstatus)
-    /* If not already recovering from an error, report this error.  */
-    {
-      ++yynerrs;
-
-#ifdef YYERROR_VERBOSE
-      yyn = yypact[yystate];
-
-      if (yyn > YYFLAG && yyn < YYLAST)
-	{
-	  int size = 0;
-	  char *msg;
-	  int x, count;
-
-	  count = 0;
-	  /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
-	  for (x = (yyn < 0 ? -yyn : 0);
-	       x < (sizeof(yytname) / sizeof(char *)); x++)
-	    if (yycheck[x + yyn] == x)
-	      size += strlen(yytname[x]) + 15, count++;
-	  msg = (char *) malloc(size + 15);
-	  if (msg != 0)
-	    {
-	      strcpy(msg, "parse error");
-
-	      if (count < 5)
-		{
-		  count = 0;
-		  for (x = (yyn < 0 ? -yyn : 0);
-		       x < (sizeof(yytname) / sizeof(char *)); x++)
-		    if (yycheck[x + yyn] == x)
-		      {
-			strcat(msg, count == 0 ? ", expecting `" : " or `");
-			strcat(msg, yytname[x]);
-			strcat(msg, "'");
-			count++;
-		      }
-		}
-	      yyerror(msg);
-	      free(msg);
-	    }
-	  else
-	    yyerror ("parse error; also virtual memory exceeded");
-	}
-      else
-#endif /* YYERROR_VERBOSE */
-	yyerror("parse error");
-    }
-
-  goto yyerrlab1;
-yyerrlab1:   /* here on error raised explicitly by an action */
-
-  if (yyerrstatus == 3)
-    {
-      /* if just tried and failed to reuse lookahead token after an error, discard it.  */
-
-      /* return failure if at end of input */
-      if (yychar == YYEOF)
-	YYABORT;
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
-#endif
-
-      yychar = YYEMPTY;
-    }
-
-  /* Else will try to reuse lookahead token
-     after shifting the error token.  */
-
-  yyerrstatus = 3;		/* Each real token shifted decrements this */
-
-  goto yyerrhandle;
-
-yyerrdefault:  /* current state does not do anything special for the error token. */
-
-#if 0
-  /* This is wrong; only states that explicitly want error tokens
-     should shift them.  */
-  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
-  if (yyn) goto yydefault;
-#endif
-
-yyerrpop:   /* pop the current state because it cannot handle the error token */
-
-  if (yyssp == yyss) YYABORT;
-  yyvsp--;
-  yystate = *--yyssp;
-#ifdef YYLSP_NEEDED
-  yylsp--;
-#endif
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      short *ssp1 = yyss - 1;
-      fprintf (stderr, "Error: state stack now");
-      while (ssp1 != yyssp)
-	fprintf (stderr, " %d", *++ssp1);
-      fprintf (stderr, "\n");
-    }
-#endif
-
-yyerrhandle:
-
-  yyn = yypact[yystate];
-  if (yyn == YYFLAG)
-    goto yyerrdefault;
-
-  yyn += YYTERROR;
-  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
-    goto yyerrdefault;
-
-  yyn = yytable[yyn];
-  if (yyn < 0)
-    {
-      if (yyn == YYFLAG)
-	goto yyerrpop;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-  else if (yyn == 0)
-    goto yyerrpop;
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Shifting error token, ");
-#endif
-
-  *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
-  *++yylsp = yylloc;
-#endif
-
-  yystate = yyn;
-  goto yynewstate;
-
- yyacceptlab:
-  /* YYACCEPT comes here.  */
-  if (yyfree_stacks)
-    {
-      free (yyss);
-      free (yyvs);
-#ifdef YYLSP_NEEDED
-      free (yyls);
-#endif
-    }
-  return 0;
-
- yyabortlab:
-  /* YYABORT comes here.  */
-  if (yyfree_stacks)
-    {
-      free (yyss);
-      free (yyvs);
-#ifdef YYLSP_NEEDED
-      free (yyls);
-#endif
-    }
-  return 1;
-}
-#line 1284 "llgrammar.y"
-
-
-# include "bison.reset"
-
-/*
-** yytext is set in lex scanner 
-** extern YYSTYPE yylval;  
-** yylval is defined by code generated by bison 
-*/
-
-void ylerror (char *s) 
-{
-  /* 
-  ** This resetting of the left context is very important when multiple
-  ** files are to be parsed.  We do not want failures to propagate.
-  ** Lex/Yacc does not reset the flags when the parsing goes bad.  
-  ** BEGIN 0;        
-  **/
-
-  /*@-mustfree@*/
-  lclfatalerror (yllval.ltok,
-		 message ("%s: Token code: %s, Token String: %s", 
-			  cstring_fromChars (s), 
-			  ltoken_unparseCodeName (yllval.ltok), 
-			  ltoken_getRawString (yllval.ltok)));
-  /*@=mustfree@*/
-}
-
-static void yyprint (FILE *f, int t, YYSTYPE value) 
-{
-  fprintf (f, " type: %d (%s)", t, 
-	   cstring_toCharsSafe (ltoken_getRawString (value.ltok)));
-}
-
-
-
-
-
-
-
diff --git a/src/llmain.c b/src/llmain.c
deleted file mode 100644
index ab163de..0000000
--- a/src/llmain.c
+++ /dev/null
@@ -1,2404 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** llmain.c
-**
-** Main module for LCLint checker
-*/
-
-# include 
-
-/*
-** Ensure that WIN32 and _WIN32 are both defined or both undefined.
-*/
-
-# ifdef WIN32
-# ifndef _WIN32
-# error "Inconsistent definitions."
-# endif
-# else
-# ifdef _WIN32
-# error "Inconsistent definitions."
-# endif
-# endif
-
-# ifdef WIN32
-# include 
-# include 
-# endif
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "osd.h"
-
-# ifndef NOLCL
-# include "gram.h"
-# include "lclscan.h"
-# include "scanline.h"
-# include "lclscanline.h"
-# include "lclsyntable.h"
-# include "lcltokentable.h"
-# include "lslparse.h"
-# include "scan.h"
-# include "syntable.h"
-# include "tokentable.h"
-# include "lslinit.h"
-# include "lclinit.h"
-# include "lh.h"
-# include "imports.h"
-# endif
-
-# include "version.h"
-# include "herald.h"
-# include "fileIdList.h"
-# include "lcllib.h"
-# include "cgrammar.h"
-# include "llmain.h"
-# include "portab.h"
-# include "cpp.h"
-# include 
-
-extern /*@external@*/ int yydebug;
-
-static void printMail (void);
-static void printMaintainer (void);
-static void printReferences (void);
-static void printFlags (void);
-static void printAnnotations (void);
-static void printParseErrors (void);
-static void printComments (void);
-static void describePrefixCodes (void);
-static void cleanupFiles (void);
-static void showHelp (void);
-static void interrupt (int p_i);
-static void loadrc (FILE *p_rcfile, cstringSList *p_passThroughArgs);
-static void describeVars (void);
-static bool specialFlagsHelp (char *p_next);
-static bool hasShownHerald = FALSE;
-
-static bool anylcl = FALSE;
-static clock_t inittime;
-
-static /*@only@*/ /*@null@*/ tsource *initFile = (tsource *) 0;
-
-static fileIdList preprocessFiles (fileIdList)
-  /*@modifies fileSystem@*/ ;
-
-# ifndef NOLCL
-
-static
-void lslCleanup (void)
-   /*@globals killed g_symtab@*/
-   /*@modifies internalState, g_symtab@*/
-{
-  /*
-  ** Cleanup all the LCL/LSL.
-  */
-
-  static bool didCleanup = FALSE;
-
-  llassert (!didCleanup);
-  llassert (anylcl);
-
-  didCleanup = TRUE;
-
-  lsymbol_destroyMod ();
-  LCLSynTableCleanup ();
-  LCLTokenTableCleanup ();
-  LCLScanLineCleanup ();
-  LCLScanCleanup ();
-
-  /* clean up LSL parsing */
-
-  lsynTableCleanup ();
-  ltokenTableCleanup ();
-  lscanLineCleanup ();
-  LSLScanCleanup ();
-
-  symtable_free (g_symtab);
-  sort_destroyMod (); 
-}
-
-static
-  void lslInit (void)
-  /*@globals undef g_symtab; @*/
-  /*@modifies g_symtab, internalState, fileSystem; @*/
-{
-  /*
-  ** Open init file provided by user, or use the default LCL init file 
-  */
-  
-  cstring larchpath = context_getLarchPath ();
-  tsource *LSLinitFile = (tsource *) 0;
-
-  setCodePoint ();
-
-  if (initFile == (tsource *) 0)
-    {
-      initFile = tsource_create (INITFILENAME, LCLINIT_SUFFIX, FALSE);
-      
-      if (!tsource_getPath (cstring_toCharsSafe (larchpath), initFile))
-	{
-	  lldiagmsg (message ("Continuing without LCL init file: %s",
-			      cstring_fromChars (tsource_fileName (initFile))));
-	}
-      else 
-	{
-	  if (!tsource_open (initFile))
-	    {
-	      lldiagmsg (message ("Continuing without LCL init file: %s",
-				  cstring_fromChars (tsource_fileName (initFile))));
-	    }
-	}
-    }
-  else 
-    {
-      if (!tsource_open (initFile))
-	{
-	  lldiagmsg (message ("Continuing without LCL init file: %s",
-			      cstring_fromChars (tsource_fileName (initFile))));
-	}
-    }
-
-  /* Initialize checker */
-
-  lsymbol_initMod ();
-  LCLSynTableInit ();
-
-  setCodePoint ();
-
-  LCLSynTableReset ();
-  LCLTokenTableInit ();
-
-  setCodePoint ();
-
-  LCLScanLineInit ();
-  setCodePoint ();
-  LCLScanLineReset ();
-  setCodePoint ();
-  LCLScanInit ();
-
-  setCodePoint ();
-
-  /* need this to initialize LCL checker */
-  llassert (initFile != NULL);
-      
-  if (tsource_isOpen (initFile))
-    {
-      setCodePoint ();
-
-      LCLScanReset (initFile);
-      LCLProcessInitFileInit ();
-      LCLProcessInitFileReset ();
-
-      setCodePoint ();
-      LCLProcessInitFile ();
-      LCLProcessInitFileCleanup ();
-
-      setCodePoint ();
-      check (tsource_close (initFile));
-    }
-  
-  /* Initialize LSL init files, for parsing LSL signatures from LSL */
-  
-  LSLinitFile = tsource_create ("lslinit.lsi", ".lsi", FALSE);
-  
-  if (!tsource_getPath (cstring_toCharsSafe (larchpath), LSLinitFile))
-    {
-      lldiagmsg (message ("Continuing without LSL init file: %s",
-			  cstring_fromChars (tsource_fileName (LSLinitFile))));
-    }
-  else 
-    {
-      if (!tsource_open (LSLinitFile))
-	{
-	  lldiagmsg (message ("Continuing without LSL init file: %s",
-			      cstring_fromChars (tsource_fileName (LSLinitFile))));
-	}
-    }
-      
-  setCodePoint ();
-  lsynTableInit ();
-  lsynTableReset ();
-
-  setCodePoint ();
-  ltokenTableInit ();
-
-  setCodePoint ();
-  lscanLineInit ();
-  lscanLineReset ();
-  LSLScanInit ();
-
-  if (tsource_isOpen (LSLinitFile))
-    {
-      setCodePoint ();
-      LSLScanReset (LSLinitFile);
-      LSLProcessInitFileInit ();
-      setCodePoint ();
-      LSLProcessInitFile ();
-      setCodePoint ();
-      check (tsource_close (LSLinitFile));
-    }
-      
-  tsource_free (LSLinitFile);
-  
-  if (lclHadError ())
-    {
-      lclplainerror 
-	(cstring_makeLiteral ("LSL init file error.  Attempting to continue."));
-    }
-  
-  setCodePoint ();
-  g_symtab = symtable_new ();
-  
-  /* 
-  ** sort_init must come after symtab has been initialized 
-  */
-  sort_init ();
-  abstract_init ();
-  setCodePoint ();
-  
-  inittime = clock ();
-  
-  /* 
-  ** Equivalent to importing old spec_csupport.lcl
-  ** define immutable LCL type "bool" and bool constants TRUE and FALSE
-  ** and initialized them to be equal to LSL's "true" and "false".
-  **
-  ** Reads in CTrait.syms (derived from CTrait.lsl) on LARCH_PATH.
-  */
-      
-  LCLBuiltins (); 
-  LCLReportEolTokens (FALSE);
-}
-
-static void
-lslProcess (fileIdList lclfiles)
-   /*@globals undef g_currentSpec, undef g_currentSpecName, g_currentloc,
-              undef killed g_symtab; @*/
-   /*@modifies g_currentSpec, g_currentSpecName, g_currentloc, internalState, fileSystem; @*/
-{
-  char *path = NULL;
-  bool parser_status = FALSE;
-  bool overallStatus = FALSE;
-  
-  lslInit ();
-  
-  context_resetSpecLines ();
-
-  fileIdList_elements (lclfiles, fid)
-    {
-      char *actualName = (char *) dmalloc (sizeof (*actualName));
-      char *oactualName = actualName;
-      char *fname = cstring_toCharsSafe (fileName (fid));
-      
-      if (osd_getPath (g_localSpecPath, fname, &actualName) == OSD_FILENOTFOUND)
-	{
-	  if (mstring_equal (g_localSpecPath, "."))
-	    {
-	      lldiagmsg (message ("Spec file not found: %s",
-				  cstring_fromChars (fname)));
-	    }
-	  else
-	    {
-	      lldiagmsg (message ("Spec file not found: %s (on %s)", 
-				  cstring_fromChars (fname), 
-				  cstring_fromChars (g_localSpecPath)));
-	    }
-	}
-      else
-	{
-	  tsource *specFile;
-	  
-	  while (*actualName == '.' && *(actualName + 1) == CONNECTCHAR) 
-	    {
-	      actualName += 2;
-	    }
-	  
-	  specFile = tsource_create (actualName, LCL_SUFFIX, TRUE);
-	  llassert (specFile != (tsource *) 0);
-	  
-	  g_currentSpec = cstring_fromChars (mstring_copy (actualName));
-
-	  g_currentSpecName = specFullName 
-	    (cstring_toCharsSafe (g_currentSpec),
-	     &path);
-
-	  setSpecFileId (fid);
-	  	  
-	  if (context_getFlag (FLG_SHOWSCAN))
-	    {
-	      lldiagmsg (message ("< reading spec %s >", g_currentSpec));
-	    }
-	  
-	  /* Open source file */
-	  
-	  if (!tsource_open (specFile))
-	    {
-	      lldiagmsg (message ("Cannot open file: %s",
-				  cstring_fromChars (tsource_fileName (specFile))));
-	      tsource_free (specFile);
-	    }
-	  else
-	    {
-	      scopeInfo dummy_scope = (scopeInfo) dmalloc (sizeof (*dummy_scope));
-	      dummy_scope->kind = SPE_INVALID;
-	      
-	      lhInit (specFile);
-	      LCLScanReset (specFile);
-	      
-	      /* 
-              ** Minor hacks to allow more than one LCL file to
-	      ** be scanned, while keeping initializations
-	      */
-	      
-	      symtable_enterScope (g_symtab, dummy_scope);
-	      resetImports (cstring_fromChars (g_currentSpecName));
-	      context_enterLCLfile ();
-	      (void) lclHadNewError ();
-	      
-	      parser_status = (ylparse () != 0);
-	      context_exitLCLfile ();
-	      lhCleanup ();
-	      overallStatus = parser_status || lclHadNewError (); 
-
-	      if (context_getFlag (FLG_DOLCS))
-		{
-		  if (overallStatus)
-		    {
- 		      outputLCSFile (path, "%%FAILED Output from ",
-				     g_currentSpecName);
-		    }
-		  else
-		    {
-		      outputLCSFile (path, "%%PASSED Output from ", 
-				     g_currentSpecName);
-		    }
-		}
-
-	      (void) tsource_close (specFile);
-	      tsource_free (specFile);
-
-	      symtable_exitScope (g_symtab);
-	    }
-	}
-      
-      sfree (oactualName);
-    } end_fileIdList_elements; 
-  
-    /* Can cleanup lsl stuff right away */
-
-      lslCleanup ();
-  
-  g_currentSpec = cstring_undefined;
-  g_currentSpecName = NULL;
-}
-# endif
-
-static void handlePassThroughFlag (char *arg)
-{
-  char *curarg = arg;
-  char *quotechar = strchr (curarg, '\"');
-  int offset = 0;
-  bool open = FALSE;
-
-  while (quotechar != NULL)
-    {
-      if (*(quotechar - 1) == '\\')
-	{
-	  char *tp = quotechar - 2;
-	  bool escape = TRUE;
-
-	  while (*tp == '\\')
-	    {
-	      escape = !escape;
-	      tp--;
-	    }
-	  
-	  if (escape)
-	    {
-	      curarg = quotechar + 1;
-	      quotechar = strchr (curarg, '\"');
-	      continue;
-	    }
-	}
-      
-      *quotechar = '\0';
-      offset = (quotechar - arg) + 2;
-      
-      if (open)
-	{
-	  arg = cstring_toCharsSafe
-	    (message ("%s\"\'%s", 
-		      cstring_fromChars (arg), 
-		      cstring_fromChars (quotechar + 1))); 
-	  open = FALSE;
-	}
-      else
-	{
-	  arg = cstring_toCharsSafe
-	    (message ("%s\'\"%s", 
-		      cstring_fromChars (arg), 
-		      cstring_fromChars (quotechar + 1)));
-	  open = TRUE;
-	}
-      
-      curarg = arg + offset;
-      quotechar = strchr (curarg, '\"');
-    }
-
-  if (open)
-    {
-      showHerald ();
-      llerror (FLG_BADFLAG,
-	       message ("Unclosed quote in flag: %s",
-			cstring_fromChars (arg)));
-    }
-  else
-    {
-      if (arg[0] == 'D') {
-	cstring def;
-	
-	/* 
-	** If the value is surrounded by single quotes ('), remove
-	** them.  This is an artifact of UNIX command line?
-	*/
-
-	def = osd_fixDefine (arg + 1);
-	DPRINTF (("Do define: %s", def));
-	cppDoDefine (def);
-	DPRINTF (("After define"));
-	cstring_free (def);
-      } else if (arg[0] == 'U') {
-	cppDoUndefine (cstring_fromChars (arg + 1));
-      } else {
-	BADBRANCH;
-      }
-    }
-}
-
-void showHerald (void)
-{
-  if (hasShownHerald || context_getFlag (FLG_QUIET)) return;
-
-  else
-    {
-      fprintf (g_msgstream, "%s\n\n", LCL_VERSION);
-      hasShownHerald = TRUE;
-      llflush ();
-    }
-}
-
-static void addFile (fileIdList files, /*@only@*/ cstring s)
-{
-  if (fileTable_exists (context_fileTable (), s))
-    {
-      showHerald ();
-      lldiagmsg (message ("File listed multiple times: %s", s));
-      cstring_free (s);
-    }
-  else
-    {
-      fileIdList_add (files, fileTable_addFileOnly (context_fileTable (), s));
-    }
-}
-
-/*
-** Disable MSVC++ warning about return value.  Methinks humbly lclint control
-** comments are a mite more legible.
-*/
-
-# ifdef WIN32
-# pragma warning (disable:4035) 
-# endif
-
-int main (int argc, char *argv[])
-# ifdef NOLCL
-  /*@globals killed undef g_currentloc,
-	     killed undef yyin,
-                    undef g_msgstream;
-   @*/
-  /*@modifies g_currentloc, fileSystem,
-	      yyin; 
-  @*/
-# else
-  /*@globals killed undef g_currentloc,
-	     killed undef initFile,
-	     killed       g_localSpecPath,  
-	     killed undef g_currentSpec,
-	     killed undef g_currentSpecName,
-	     killed undef yyin,
-                    undef g_msgstream;
-   @*/
-  /*@modifies g_currentloc, initFile, 
-              g_localSpecPath, g_currentSpec, g_currentSpecName, fileSystem,
-	      yyin; 
-  @*/
-# endif
-{
-  bool first_time = TRUE;
-  bool showhelp = FALSE;
-  bool allhelp = TRUE;
-  bool expsuccess;
-  tsource *sourceFile = (tsource *) 0;
- 
-  fileIdList dercfiles;
-  cstringSList fl = cstringSList_undefined;
-  cstringSList passThroughArgs = cstringSList_undefined;
-  fileIdList cfiles;
-  fileIdList lclfiles;
-  clock_t before, lcltime, libtime, pptime, cptime, rstime;
-  int i = 0;
-
-  g_msgstream = stdout;
-
-  (void) signal (SIGINT, interrupt);
-  (void) signal (SIGSEGV, interrupt); 
-
-  cfiles = fileIdList_create ();
-  lclfiles = fileIdList_create ();
-
-  flags_initMod ();
-  typeIdSet_initMod ();
-  cppReader_initMod ();
-
-  setCodePoint ();
-
-  g_currentloc = fileloc_createBuiltin ();
-
-  before = clock ();
-  context_initMod ();
-  context_setInCommandLine ();
-
-  if (argc <= 1)
-    {
-      showHelp ();
-      llexit (LLGIVEUP);
-    }
-
-  setCodePoint ();
-  yydebug = 0;
-
-  /*
-  ** Add include directories from environment.
-  */
-
-  {
-    char *incval = mstring_copy (osd_getEnvironmentVariable (INCLUDE_VAR));
-
-    if (incval != NULL)
-      {
-	/*
-	** Each directory on the include path is a system include directory.
-	*/
-
-	DPRINTF (("include: %s", incval));
-	context_setString (FLG_SYSTEMDIRS, cstring_fromCharsNew (incval));
-
-	while (incval != NULL)
-	  {
-	    char *nextsep = strchr (incval, SEPCHAR);
-
-	    if (nextsep != NULL)
-	      {
-		cstring dir;
-		*nextsep = '\0';
-		dir = cstring_fromCharsNew (incval);
-
-		if (cstring_length (dir) == 0
-		    || !isalpha ((int) cstring_firstChar (dir)))
-		  {
-		    /* 
-		    ** win32 environment values can have special values,
-		    ** ignore them
-		    */
-		  }
-		else
-		  {
-		    DPRINTF (("Add include: %s", dir));
-		    cppAddIncludeDir (dir);
-		  }
-
-		*nextsep = SEPCHAR;
-		incval = nextsep + 1;
-		cstring_free (dir);
-	      }
-	    else
-	      {
-		break;
-	      }
-	  }
-      }
-  }
-
-  /*
-  ** check RCFILE for default flags
-  */
-
-  {
-    cstring home = cstring_fromChars (osd_getHomeDir ());
-    char *fname  = NULL;
-    FILE *rcfile;
-    bool defaultf = TRUE;
-    bool nof = FALSE;
-
-    for (i = 1; i < argc; i++)
-      {
-	char *thisarg;
-	thisarg = argv[i];
-	
-	if (*thisarg == '-' || *thisarg == '+')
-	  {
-	    thisarg++;
-
-	    if (mstring_equal (thisarg, "nof"))
-	      {
-		nof = TRUE;
-	      }
-	    else if (mstring_equal (thisarg, "f"))
-	      {
-		if (++i < argc)
-		  {
-		    defaultf = FALSE;
-		    fname = argv[i];
-		    rcfile = fopen (fname, "r");
-
-		    if (rcfile != NULL)
-		      {
-			fileloc oloc = g_currentloc;
-			
-			g_currentloc = fileloc_createRc (cstring_fromChars (fname));
-			loadrc (rcfile, &passThroughArgs);
-			fileloc_reallyFree (g_currentloc); 
-			g_currentloc = oloc;
-		      }
-		    else 
-		      {
-			showHerald ();
-			lldiagmsg (message ("Options file not found: %s", 
-					    cstring_fromChars (fname)));
-		      }
-		  }
-		else
-		  llfatalerror
-		    (cstring_makeLiteral ("Flag f to select options file "
-					  "requires an argument"));
-	      }
-	    else
-	      {
-		; /* wait to process later */
-	      }
-	  }
-      }
-    
-    if (fname == NULL)
-      {
-	if (!cstring_isEmpty (home)) {
-	  fname = cstring_toCharsSafe (message ("%s%h%s", home, CONNECTCHAR,
-						cstring_fromChars (RCFILE)));
-	  mstring_markFree (fname);
-	}
-      }
-
-    setCodePoint ();
-
-    if (!nof && defaultf)
-      {
-	if (!mstring_isEmpty (fname)) {
-	  rcfile = fopen (fname, "r");
-	  
-	  if (rcfile != NULL)
-	    {
-	      fileloc oloc = g_currentloc;
-	      
-	      g_currentloc = fileloc_createRc (cstring_fromChars (fname));
-	      loadrc (rcfile, &passThroughArgs);
-	      fileloc_reallyFree (g_currentloc);
-	      g_currentloc = oloc;
-	    }
-	}
-
-# if defined(MSDOS) || defined(OS2)
-	fname = cstring_toCharsSafe (message ("%s",
-					      cstring_fromChars (RCFILE)));
-# else
-	fname = cstring_toCharsSafe (message ("./%s", 
-					      cstring_fromChars (RCFILE)));
-# endif
-
-	rcfile = fopen (fname, "r");
-
-	if (rcfile != NULL)
-	  {
-	    fileloc oloc = g_currentloc;
-
-	    g_currentloc = fileloc_createRc (cstring_fromChars (fname));
-	    loadrc (rcfile, &passThroughArgs);
-	    fileloc_reallyFree (g_currentloc);
-	    g_currentloc = oloc;
-	  }
-
-	sfree (fname); 
-      }
-  }
-  
-  setCodePoint ();
-  
-  for (i = 1; i < argc; i++)
-    {
-      char *thisarg;
-      flagcode opt;
-      
-      thisarg = argv[i];
-      
-      if (showhelp)
-	{
-	  if (allhelp)
-	    {
-	      showHerald ();
-	    }
-	  
-	  allhelp = FALSE;
-	  
-	  if (*thisarg == '-' || *thisarg == '+')
-	    {
-	      thisarg++;	/* skip '-' */
-	    }
-	  if (mstring_equal (thisarg, "modes"))
-	    {
-	      llmsg (describeModes ());
-	    }
-	  else if (mstring_equal (thisarg, "vars")
-		   || mstring_equal (thisarg, "env"))
-	    {
-	      describeVars ();
-	    }
-	  else if (mstring_equal (thisarg, "annotations"))
-	    {
-	      printAnnotations ();
-	    }
-	  else if (mstring_equal (thisarg, "parseerrors"))
-	    {
-	      printParseErrors ();
-	    }
-	  else if (mstring_equal (thisarg, "comments"))
-	    {
-	      printComments ();
-	    }
-	  else if (mstring_equal (thisarg, "prefixcodes"))
-	    {
-	      describePrefixCodes ();
-	    }
-	  else if (mstring_equal (thisarg, "references") 
-		   || mstring_equal (thisarg, "refs"))
-	    {
-	      printReferences ();
-	    }
-	  else if (mstring_equal (thisarg, "mail"))
-	    {
-	      printMail ();
-	    }
-	  else if (mstring_equal (thisarg, "maintainer")
-		   || mstring_equal (thisarg, "version"))
-	    {
-	      printMaintainer ();
-	    }
-	  else if (mstring_equal (thisarg, "flags"))
-	    {
-	      if (i + 1 < argc)
-		{
-		  char *next = argv[i + 1];
-		  
-		  if (specialFlagsHelp (next))
-		    {
-		      i++;
-		    }
-		  else
-		    {
-		      flagkind k = identifyCategory (cstring_fromChars (next));
-		      
-		      if (k != FK_NONE)
-			{
-			  printCategory (k);
-			  i++;
-			}
-		    }
-		}
-	      else
-		{
-		  printFlags ();
-		}
-	    }
-	  else
-	    {
-	      cstring s = describeFlag (cstring_fromChars (thisarg));
-	      
-	      if (cstring_isDefined (s))
-		{
-		  llmsg (s);
-		}
-	    }
-	}
-      else
-	{
-	  if (*thisarg == '-' || *thisarg == '+')
-	    {
-	      bool set = (*thisarg == '+');
-	      cstring flagname;
-	      
-	      thisarg++;	/* skip '-' */
-	      flagname = cstring_fromChars (thisarg);
-	      
-	      opt = identifyFlag (flagname);
-	      
-	      if (flagcode_isSkip (opt))
-		{
-		  ;
-		}
-	      else if (flagcode_isInvalid (opt))
-		{
-		  if (isMode (flagname))
-		    {
-		      context_setMode (flagname);
-		    }
-		  else
-		    {
-		      llgloberror (message ("Unrecognized option: %s", 
-					    cstring_fromChars (thisarg)));
-		    }
-		}
-	      else
-		{
-		  context_userSetFlag (opt, set);
-		  
-		  if (flagcode_hasArgument (opt))
-		    {
-		      if (opt == FLG_HELP)
-			{
-			  showhelp = TRUE;
-			}
-		      else if (flagcode_isPassThrough (opt)) /* -D or -U */
-			{ 
-			  passThroughArgs = cstringSList_add 
-			    (passThroughArgs, cstring_fromChars (thisarg));
-			}
-		      else if (flagcode_hasValue (opt))
-			{
-			  if (++i < argc)
-			    {
-			      setValueFlag (opt, cstring_fromChars (argv[i]));
-			    }
-			  else
-			    {
-			      llfatalerror 
-				(message
-				 ("Flag %s must be followed by a number",
-				  flagcode_unparse (opt)));
-			    }
-			} 
-		      else if (opt == FLG_INCLUDEPATH || opt == FLG_SPECPATH)
-			{
-			  cstring dir = cstring_suffix (cstring_fromChars (thisarg), 1); /* skip over I */
-			  
-			  switch (opt)
-			    {
-			    case FLG_INCLUDEPATH:
-			      cppAddIncludeDir (dir);
-			      /*@switchbreak@*/ break;
-			    case FLG_SPECPATH:
-			      /*@-mustfree@*/
-			      g_localSpecPath = cstring_toCharsSafe
-				(message ("%s%h%s", 
-					  cstring_fromChars (g_localSpecPath), 
-					  SEPCHAR,
-					  dir));
-			      /*@=mustfree@*/
-			      /*@switchbreak@*/ break;
-			      BADDEFAULT;
-			    }
-			}
-		      else if (flagcode_hasString (opt)
-			       || opt == FLG_INIT || opt == FLG_OPTF)
-			{
-			  if (++i < argc)
-			    {
-			      cstring arg = cstring_fromChars (argv[i]);
-			      
-			      if (opt == FLG_OPTF)
-				{
-				  ; /* -f already processed */
-				}
-			      else if (opt == FLG_INIT)
-				{
-# ifndef NOLCL
-				  initFile = tsource_create 
-				    (cstring_toCharsSafe (arg), 
-				     LCLINIT_SUFFIX, FALSE);
-# endif
-				  break;
-				}
-			      else
-				{
-				  setStringFlag (opt, arg);
-				}
-			    }
-			  else
-			    {
-			      llfatalerror 
-				(message
-				 ("Flag %s must be followed by a string",
-				  flagcode_unparse (opt)));
-			    }
-			}
-		      else
-			{
-			  /* no argument */
-			}
-		    }
-		}
-	    }
-	  else /* its a filename */
-	    {
-	      fl = cstringSList_add (fl, cstring_fromChars (thisarg));
-	    }
-	}
-    }
-
-  setCodePoint ();  
-
-  /*
-  ** create lists of C and LCL files
-  */
-
-  cstringSList_elements (fl, current)
-    {
-      char *fname = cstring_toCharsSafe (current);
-      char *ext = strrchr (fname, '.');
-
-      if (ext == NULL)
-	{
-	  /* no extension --- both C and LCL with default extensions */
-	  
-	  addFile (cfiles, message ("%s.c", cstring_fromChars (fname)));
-	  addFile (lclfiles, message ("%s.lcl", cstring_fromChars (fname)));
-	}
-      else if (isCext (ext))
-	{
-	  addFile (cfiles, cstring_fromCharsNew (fname));
-	}
-      else 
-	{
-	  if (!mstring_equal (ext, ".lcl"))
-	    {
-	      lldiagmsg (message ("Unrecognized file extension: %s (assuming lcl)", 
-				  cstring_fromChars (ext)));
-	    }
-
-	  addFile (lclfiles, cstring_fromCharsNew (fname));
-	}
-    } end_cstringSList_elements;
-  
-  
-  showHerald ();
-
-  
-  if (showhelp)
-    {
-      if (allhelp)
-	{
-	  showHelp ();
-	}
-      fprintf (g_msgstream, "\n");
-
-      fileIdList_free (cfiles);
-      fileIdList_free (lclfiles);
-      
-      llexit (LLSUCCESS);
-    }
-
-# ifdef DOANNOTS
-  initAnnots ();
-# endif
-
-  inittime = clock ();
-
-  context_resetErrors ();
-  context_clearInCommandLine ();
-
-  anylcl = !fileIdList_isEmpty (lclfiles);
-
-  if (context_doMerge ())
-    {
-      cstring m = context_getMerge ();
-
-      if (context_getFlag (FLG_SHOWSCAN))
-	{
-	  fprintf (g_msgstream, "< loading %s ", cstring_toCharsSafe (m));
-	}
-
-      loadState (m);
-
-      if (context_getFlag (FLG_SHOWSCAN))
-	{
-	  fprintf (g_msgstream, " >\n");
-	}
-
-      if (!usymtab_existsType (context_getBoolName ()))
-	{
-	  usymtab_initBool (); 
-	}
-    }
-  else
-    {
-      if (!context_getFlag (FLG_NOLIB) && loadStandardState ())
-	{
-	  ;
-	}
-      else
-	{
-	  ctype_initTable ();
-	}
-
-      /* setup bool type and constants */
-      usymtab_initBool (); 
-    }
-
-  fileloc_free (g_currentloc);
-  g_currentloc = fileloc_createBuiltin ();
-
-  libtime = clock ();
-  
-  if (anylcl)
-    {
-# ifdef NOLCL
-      llfatalerror (cstring_makeLiteral ("This version of LCLint does not handle LCL files."));
-# else
-      lslProcess (lclfiles);
-# endif
-    }
-
-  /*
-  ** pre-processing
-  **
-  ** call the pre-preprocessor and /lib/cpp to generate appropriate
-  ** files
-  **
-  */
-
-  context_setInCommandLine ();
-
-  cppReader_initialize ();
-
-  DPRINTF (("Pass through: %s", cstringSList_unparse (passThroughArgs)));
-  
-  cstringSList_elements (passThroughArgs, thisarg) {
-    handlePassThroughFlag (cstring_toCharsSafe (thisarg));
-  } end_cstringSList_elements;
-
-  cstringSList_free (passThroughArgs);
-
-  cleanupMessages ();
-
-  cppReader_saveDefinitions ();
-  
-  context_clearInCommandLine ();
-
-  if (!context_getFlag (FLG_NOPP))
-    {
-      llflush ();
-
-      if (context_getFlag (FLG_SHOWSCAN))
-	{
-	  fprintf (stderr, "< preprocessing"); 
-	}
-      
-      lcltime = clock ();
-
-      context_setPreprocessing ();
-      dercfiles = preprocessFiles (cfiles);
-      context_clearPreprocessing ();
-
-      fileIdList_free (cfiles);
-
-      if (context_getFlag (FLG_SHOWSCAN))
-	{
-	  fprintf (stderr, " >\n");
-	}
-      
-      pptime = clock ();
-    }
-  else
-    {
-      lcltime = clock ();
-      dercfiles = cfiles;
-      pptime = clock ();
-    }
-  
-  /*
-  ** now, check all the corresponding C files
-  **
-  ** (for now these are just .c, but after pre-processing
-  **  will be ..c)
-  */
-
-  {
-# ifdef WIN32
-    int nfiles = /*@-unrecog@*/ _fcloseall (); /*@=unrecog@*/
-
-    if (nfiles != 0) 
-      {
-	llbug (message ("Files unclosed: %d", nfiles));
-      }
-# endif
-  }
-
-  exprNode_initMod ();
-
-  fileIdList_elements (dercfiles, fid)
-    {
-      sourceFile = tsource_create (cstring_toCharsSafe (fileName (fid)),
-				   C_SUFFIX, TRUE);
-      context_setFileId (fid);
-      
-      /* Open source file  */
-      
-      if (sourceFile == (tsource *) 0 || (!tsource_open (sourceFile)))
-	{
-	  /* previously, this was ignored  ?! */
-	  llbug (message ("Could not open temp file: %s", fileName (fid)));
-	}
-      else
-	{
-	  yyin = sourceFile->file; /*< shared <- only */
-	
-	  llassert (yyin != NULL);
-
-	  if (context_getFlag (FLG_SHOWSCAN))
-	    {
-	      	      lldiagmsg (message ("< checking %s >", rootFileName (fid)));
-	    }
-	  
-	  /*
-	  ** Every time, except the first time, through the loop,
-	  ** need to call yyrestart to clean up the parse buffer.
-	  */
-
-	  if (!first_time)
-	    {
-	      (void) yyrestart (yyin);	
-	    }
-	  else
-	    {
-	      first_time = FALSE;
-	    }
-	  
-	  context_enterFile ();
-	  (void) yyparse ();
-	  context_exitFile ();
-		    
-	  (void) tsource_close (sourceFile);
-	}
-      
-    } end_fileIdList_elements;
-
-  cptime = clock ();
-  
-  /* process any leftover macros */
-
-  context_processAllMacros ();
-  
-  /* check everything that was specified was defined */
-  
-  /* don't check if no c files were processed ?
-  **   is this correct behaviour?
-  */
-  
-  if (context_getFlag (FLG_SHOWSCAN))
-    {
-      lldiagmsg (cstring_makeLiteral ("< global checks >"));
-    }
-
-  cleanupMessages ();
-  
-  if (context_getLinesProcessed () > 0)
-    {
-      usymtab_allDefined ();
-    }
-
-  if (context_maybeSet (FLG_TOPUNUSED))
-    {
-      uentry ue = usymtab_lookupSafe (cstring_makeLiteralTemp ("main"));
-
-      if (uentry_isValid (ue))
-	{
-	  uentry_setUsed (ue, fileloc_observeBuiltin ());
-	}
-
-      usymtab_allUsed ();
-    }
-
-  if (context_maybeSet (FLG_EXPORTLOCAL))
-    {
-      usymtab_exportLocal ();
-    }
-
-  
-  if (context_maybeSet (FLG_EXPORTHEADER))
-    {
-      usymtab_exportHeader ();
-    }
-
-  if (context_getFlag (FLG_SHOWUSES))
-    {
-      usymtab_displayAllUses ();
-    }
-
-  context_checkSuppressCounts ();
-
-  if (context_doDump ())
-    {
-      cstring dump = context_getDump ();
-
-      dumpState (dump);
-    }
-
-# ifdef DOANNOTS
-  printAnnots ();
-# endif
-
-  cleanupFiles ();
-
-  if (context_getFlag (FLG_SHOWSUMMARY))
-    {
-      summarizeErrors (); 
-    }
-
-  
-  {
-    bool isQuiet = context_getFlag (FLG_QUIET);
-    cstring specErrors = cstring_undefined;
-# ifndef NOLCL
-    int nspecErrors = lclNumberErrors ();
-# endif
-    
-    expsuccess = TRUE;
-
-    if (context_neednl ())
-      fprintf (g_msgstream, "\n");
-    
-# ifndef NOLCL
-    if (nspecErrors > 0)
-      {
-	if (nspecErrors == context_getLCLExpect ())
-	  {
-	    specErrors = 
-	      message ("%d spec error%p found, as expected\n       ", 
-		       nspecErrors);
-	  }
-	else
-	  {
-	    if (context_getLCLExpect () > 0)
-	      {
-		specErrors = 
-		  message ("%d spec error%p found, expected %d\n       ", 
-			   nspecErrors,
-			   (int) context_getLCLExpect ());
-	      }
-	    else
-	      {
-		specErrors = message ("%d spec error%p found\n       ",
-				      nspecErrors);
-		expsuccess = FALSE;
-	      }
-	  }
-      }
-    else
-	{
-	  if (context_getLCLExpect () > 0)
-	    {
-	      specErrors = message ("No spec errors found, expected %d\n       ", 
-				    (int) context_getLCLExpect ());
-	      expsuccess = FALSE;
-	    }
-	}
-# endif
-
-      if (context_anyErrors ())
-	{
-	  if (context_numErrors () == context_getExpect ())
-	    {
-	      if (!isQuiet) {
-		llmsg (message ("Finished LCLint checking --- "
-				"%s%d code error%p found, as expected",
-				specErrors, context_numErrors ()));
-	      }
-	    }
-	  else
-	    {
-	      if (context_getExpect () > 0)
-		{
-		  if (!isQuiet) {
-		    llmsg (message 
-			   ("Finished LCLint checking --- "
-			    "%s%d code error%p found, expected %d",
-			    specErrors, context_numErrors (), 
-			    (int) context_getExpect ()));
-		  }
-
-		  expsuccess = FALSE;
-		}
-	      else
-		{
-		  
-		  if (!isQuiet) {
-		    llmsg (message ("Finished LCLint checking --- "
-				    "%s%d code error%p found", 
-				    specErrors, context_numErrors ()));
-		  }
-
-		  expsuccess = FALSE;
-		}
-	    }
-	}
-      else
-	{
-	  if (context_getExpect () > 0)
-	    {
-	      if (!isQuiet) {
-		llmsg (message
-		       ("Finished LCLint checking --- "
-			"%sno code errors found, expected %d", 
-			specErrors,
-			(int) context_getExpect ()));
-	      }
-
-	      expsuccess = FALSE;
-	    }
-	  else
-	    {
-	      if (context_getLinesProcessed () > 0)
-		{
-		  if (!isQuiet) {
-		    llmsg (message ("Finished LCLint checking --- %sno code errors found", 
-				    specErrors));
-		  }
-		}
-	      else
-		{
-		  if (!isQuiet) {
-		    llmsg (message ("Finished LCLint checking --- %sno code processed", 
-				    specErrors));
-		  }
-		}
-	    }
-	}
-
-      cstring_free (specErrors);
-  }
-  
-  if (context_getFlag (FLG_STATS))
-    {
-      clock_t ttime = clock () - before;
-      int specLines = context_getSpecLinesProcessed ();
-      
-      rstime = clock ();
-      
-      if (specLines > 0)
-	{
-	  fprintf (g_msgstream, "%d spec, ", specLines);
-	}
-      
-# ifndef CLOCKS_PER_SEC
-      fprintf (g_msgstream, "%d source lines in %ld time steps (steps/sec unknown)\n", 
-	       context_getLinesProcessed (), 
-	       (long) ttime);
-# else
-      fprintf (g_msgstream, "%d source lines in %.2f s.\n", 
-	       context_getLinesProcessed (), 
-	       (double) ttime / CLOCKS_PER_SEC);
-# endif
-    }
-  else
-    {
-      rstime = clock ();
-    }
-  
-  if (context_getFlag (FLG_TIMEDIST))
-    {
-      clock_t ttime = clock () - before;
-      
-      if (ttime > 0)
-	{
-	  char *msg = (char *) dmalloc (256 * sizeof (*msg));
-	  
-	  if (anylcl)
-	    {
-	      sprintf (msg, 
-		       "Time distribution (percent): initialize %.2f / lcl %.2f / "
-		       "pre-process %.2f / c check %.2f / finalize %.2f \n", 
-		       (100.0 * (double) (libtime - before) / ttime),
-		       (100.0 * (double) (lcltime - libtime) / ttime),
-		       (100.0 * (double) (pptime - lcltime) / ttime),
-		       (100.0 * (double) (cptime - pptime) / ttime),
-		       (100.0 * (double) (rstime - cptime) / ttime));
-	    }
-	  else
-	    {
-	      sprintf (msg, 
-		       "Time distribution (percent): initialize %.2f / "
-		       "pre-process %.2f / c check %.2f / finalize %.2f \n", 
-		       (100.0 * (double) (libtime - before) / ttime),
-		       (100.0 * (double) (pptime - libtime) / ttime),
-		       (100.0 * (double) (cptime - pptime) / ttime),
-		       (100.0 * (double) (rstime - cptime) / ttime));
-	    }
-	  
-	  llgenindentmsgnoloc (cstring_fromCharsO (msg));
-	}
-    }
-
-  llexit (expsuccess ? LLSUCCESS : LLFAILURE);
-}
-
-/*
-** Reenable return value warnings.
-*/
-
-#pragma warning (default:4035)
-
-void
-showHelp (void)
-{
-  showHerald ();
-  
-  llmsglit ("Source files are .c, .h and .lcl files.  If there is no suffix,");
-  llmsglit ("   LCLint will look for .c and .lcl.");
-  llmsglit ("");
-  llmsglit ("Use lclint -help  for more information");
-  llmsglit ("");
-  llmsglit ("Topics:");
-  llmsglit ("");
-  llmsglit ("   annotations (describes source-code annotations)");
-  llmsglit ("   comments (describes control comments)");
-  llmsglit ("   flags (describes flag categories)");
-  llmsglit ("   flags  (describes flags in category)");
-  llmsglit ("   flags all (short description of all flags)");
-  llmsglit ("   flags alpha (list all flags alphabetically)");
-  llmsglit ("   flags full (full description of all flags)");
-  llmsglit ("   mail (information on mailing lists)");
-  llmsglit ("   modes (show mode settings)");
-  llmsglit ("   parseerrors (help on handling parser errors)");
-  llmsglit ("   prefixcodes (character codes in namespace prefixes)");
-  llmsglit ("   references (sources for more information)");
-  llmsglit ("   vars (environment variables)"); 
-  llmsglit ("   version (information on compilation, maintainer)");
-  llmsglit ("");
-}
-
-static bool
-specialFlagsHelp (char *next)
-{
-  if ((next != NULL) && (*next != '-') && (*next != '+'))
-    {
-      if (mstring_equal (next, "alpha"))
-	{
-	  printAlphaFlags ();
-	  return TRUE;
-	}
-      else if (mstring_equal (next, "all"))
-	{
-	  printAllFlags (TRUE, FALSE);
-	  return TRUE;
-	}
-      else if (mstring_equal (next, "categories")
-	       || mstring_equal (next, "cats"))
-	{
-	  listAllCategories ();
-	  return TRUE;
-	}
-      else if (mstring_equal (next, "full"))
-	{
-	  printAllFlags (FALSE, TRUE);
-	  return TRUE;
-	}
-      else
-	{
-	  return FALSE;
-	}
-    }
-  else
-    {
-      return FALSE;
-    }
-}
-
-void
-printParseErrors (void)
-{
-  llmsglit ("Parse Errors");
-  llmsglit ("------------");
-  llmsglit ("");
-  llmsglit ("LCLint will sometimes encounter a parse error for code that "
-	    "can be parsed with a local compiler. There are a few likely "
-	    "causes for this and a number of techniques that can be used "
-	    "to work around the problem.");
-  llmsglit ("");
-  llmsglit ("Compiler extensions --- compilers sometimes extend the C "
-	    "language with compiler-specific keywords and syntax. While "
-	    "it is not advisible to use these, oftentimes one has no choice "
-	    "when the system header files use compiler extensions. ");
-  llmsglit ("");
-  llmsglit ("LCLint supports some of the GNU (gcc) compiler extensions, "
-	    "if the +gnuextensions flag is set. You may be able to workaround "
-	    "other compiler extensions by using a pre-processor define. "
-	    "Alternately, you can surround the unparseable code with");
-  llmsglit ("");
-  llmsglit ("   # ifndef __LCLINT__");
-  llmsglit ("   ...");
-  llmsglit ("   # endif");
-  llmsglit ("");
-  llmsglit ("Missing type definitions --- an undefined type name will usually "
-	    "lead to a parse error. This ofter occurs when a standard header "
-	    "file defines some type that is not part of the standard library. ");
-  llmsglit ("By default, LCLint does not process the local files corresponding "
-	    "to standard library headers, but uses a library specification "
-	    "instead so dependencies on local system headers can be detected. "
-	    "If another system header file that does not correspond to a "
-	    "standard library header uses one of these superfluous types, "
-	    "a parse error will result.");
-  llmsglit ("");
-  llmsglit ("If the parse error is inside a posix standard header file, the "
-	    "first thing to try is +posixlib. This make LCLint use "
-	    "the posix library specification instead of reading the posix "
-	    "header files.");
-  llmsglit ("");
-  llmsglit ("Otherwise, you may need to either manually define the problematic "
-	    "type (e.g., add -Dmlink_t=int to your .lclintrc file) or force "
-	    "lclint to process the header file that defines it. This is done "
-	    "by setting -skipansiheaders or -skipposixheaders before "
-	    "the file that defines the type is #include'd.");
-  llmsglit ("(See lclint -help "
-	    "skipansiheaders and lclint -help skipposixheaders for a list of "
-	    "standard headers.)  For example, if  uses a type "
-	    "defined by posix header  but not defined by the "
-	    "posix library, we might do: ");
-  llmsglit ("");
-  llmsglit ("   /*@-skipposixheaders@*/");
-  llmsglit ("   # include ");
-  llmsglit ("   /*@=skipposixheaders@*/");
-  llmsglit ("   # include ");
-  llmsglit ("");
-  llmsglit ("to force LCLint to process .");
-  llmsglit ("");
-  llmsglit ("At last resort, +trytorecover can be used to make LCLint attempt "
-	    "to continue after a parse error.  This is usually not successful "
-	    "and the author does not consider assertion failures when +trytorecover "
-	    "is used to be bugs.");
-}
-
-void
-printAnnotations (void)
-{
-  llmsglit ("Annotations");
-  llmsglit ("-----------");
-  llmsglit ("");
-  llmsglit ("Annotations are stylized comments that document certain "
-	    "assumptions about functions, variables, parameters, and types. ");
-  llmsglit ("");
-  llmsglit ("They may be used to indicate where the representation of a "
-	    "user-defined type is hidden, to limit where a global variable may "
-	    "be used or modified, to constrain what a function implementation "
-            "may do to its parameters, and to express checked assumptions about "
-	    "variables, types, structure fields, function parameters, and "
-	    "function results.");
-  llmsglit ("");
-  llmsglit ("Annotations are introduced by \"/*@\". The role of the @ may be "
-	    "played by any printable character, selected using -commentchar .");
-  llmsglit ("");
-  llmsglit ("Consult the User's Guide for descriptions of checking associated with each annotation.");
-  llmsglit ("");
-  llmsglit ("Globals: (in function declarations)");
-  llmsglit ("   /*@globals ,+ @*/");
-  llmsglit ("      globitem is an identifier, internalState or fileSystem");
-  llmsglit ("");
-  llmsglit ("Modifies: (in function declarations)");
-  llmsglit ("   /*@modifies ,+ @*/");
-  llmsglit ("      moditem is an lvalue");
-  llmsglit ("   /*@modifies nothing @*/");
-  llmsglit ("   /*@*/   (Abbreviation for no globals and modifies nothing.)");
-  llmsglit ("");
-  llmsglit ("Iterators:");
-  llmsglit ("   /*@iter  () @*/ - declare an iterator");
-  llmsglit ("");
-  llmsglit ("Constants:");
-  llmsglit ("   /*@constant  @*/ - declares a constant");
-  llmsglit ("");
-  llmsglit ("Alternate Types:");
-  llmsglit ("   /*@alt ,+ @*/");
-  llmsglit ("   (e.g., int /*@alt char@*/ is a type matching either int or char)");
-  llmsglit ("");
-  llmsglit ("Declarator Annotations");
-  llmsglit ("");
-  llmsglit ("Type Definitions:");
-  llmsglit ("   /*@abstract@*/ - representation is hidden from clients");
-  llmsglit ("   /*@concrete@*/ - representation is visible to clients");
-  llmsglit ("   /*@immutable@*/ - instances of the type cannot change value");
-  llmsglit ("   /*@mutable@*/ - instances of the type can change value");
-  llmsglit ("   /*@refcounted@*/ - reference counted type");
-  llmsglit ("");
-  llmsglit ("Global Variables:");
-  llmsglit ("   /*@unchecked@*/ - weakest checking for global use");
-  llmsglit ("   /*@checkmod@*/ - check modification by not use of global");
-  llmsglit ("   /*@checked@*/ - check use and modification of global");
-  llmsglit ("   /*@checkedstrict@*/ - check use of global strictly");
-  llmsglit ("");
-  llmsglit ("Memory Management:");
-  llmsglit ("   /*@dependent@*/ - a reference to externally-owned storage");
-  llmsglit ("   /*@keep@*/ - a parameter that is kept by the called function");
-  llmsglit ("   /*@killref@*/ - a refcounted parameter, killed by the call");
-  llmsglit ("   /*@only@*/ - an unshared reference");
-  llmsglit ("   /*@owned@*/ - owner of storage that may be shared by /*@dependent@*/ references");
-  llmsglit ("   /*@shared@*/ - shared reference that is never deallocated");
-  llmsglit ("   /*@temp@*/ - temporary parameter");
-  llmsglit ("");
-  llmsglit ("Aliasing:");
-  llmsglit ("   /*@unique@*/ - may not be aliased by any other visible reference");
-  llmsglit ("   /*@returned@*/ - may be aliased by the return value");
-  llmsglit ("");
-  llmsglit ("Exposure:");
-  llmsglit ("   /*@observer@*/ - reference that cannot be modified");
-  llmsglit ("   /*@exposed@*/ - exposed reference to storage in another object");
-  llmsglit ("");
-  llmsglit ("Definition State:");
-  llmsglit ("   /*@out@*/ - storage reachable from reference need not be defined");
-  llmsglit ("   /*@in@*/ - all storage reachable from reference must be defined");
-  llmsglit ("   /*@partial@*/ - partially defined, may have undefined fields");
-  llmsglit ("   /*@reldef@*/ - relax definition checking");
-  llmsglit ("");
-  llmsglit ("Global State: (for globals lists, no /*@, since list is already in /*@\'s)");
-  llmsglit ("   undef - variable is undefined before the call");
-  llmsglit ("   killed - variable is undefined after the call");
-  llmsglit ("");
-  llmsglit ("Null State:");
-  llmsglit ("   /*@null@*/ - possibly null pointer");
-  llmsglit ("   /*@notnull@*/ - non-null pointer");
-  llmsglit ("   /*@relnull@*/ - relax null checking");
-  llmsglit ("");
-  llmsglit ("Null Predicates:");
-  llmsglit ("   /*@truenull@*/ - if result is TRUE, first parameter is NULL");
-  llmsglit ("   /*@falsenull@*/ - if result is TRUE, first parameter is not NULL");
-  llmsglit ("");
-  llmsglit ("Execution:");
-  llmsglit ("   /*@exits@*/ - function never returns");
-  llmsglit ("   /*@mayexit@*/ - function may or may not return");
-  llmsglit ("   /*@trueexit@*/ - function does not return if first parameter is TRUE");
-  llmsglit ("   /*@falseexit@*/ - function does not return if first parameter if FALSE");
-  llmsglit ("   /*@neverexit@*/ - function always returns");
-  llmsglit ("");
-  llmsglit ("Side-Effects:");
-  llmsglit ("   /*@sef@*/ - corresponding actual parameter has no side effects");
-  llmsglit ("");
-  llmsglit ("Declaration:");
-  llmsglit ("   /*@unused@*/ - need not be used (no unused errors reported)");
-  llmsglit ("   /*@external@*/ - defined externally (no undefined error reported)");
-  llmsglit ("");
-  llmsglit ("Case:");
-  llmsglit ("   /*@fallthrough@*/ - fall-through case");
-  llmsglit ("");
-  llmsglit ("Break:");
-  llmsglit ("   /*@innerbreak@*/ - break is breaking an inner loop or switch");
-  llmsglit ("   /*@loopbreak@*/ - break is breaking a loop");
-  llmsglit ("   /*@switchbreak@*/ - break is breaking a switch");
-  llmsglit ("   /*@innercontinue@*/ - continue is continuing an inner loop");
-  llmsglit ("");
-  llmsglit ("Unreachable Code:");
-  llmsglit ("   /*@notreached@*/ - statement may be unreachable.");
-  llmsglit ("");
-  llmsglit ("Special Functions:");
-  llmsglit ("   /*@printflike@*/ - check variable arguments like printf");
-  llmsglit ("   /*@scanflike@*/ - check variable arguments like scanf");
-}
-
-void
-printComments (void)
-{
-  llmsglit ("Control Comments");
-  llmsglit ("----------------");
-  llmsglit ("");
-  llmsglit ("Setting Flags");
-  llmsglit ("");
-  llmsglit ("Most flags (all except those characterized as \"globally-settable only\") can be set locally using control comments. A control comment can set flags locally to override the command line settings. The original flag settings are restored before processing the next file.");
-  llmsglit ("");
-  llmsglit ("The syntax for setting flags in control comments is the same as that of the command line, except that flags may also be preceded by = to restore their setting to the original command-line value. For instance,");
-  llmsglit ("   /*@+boolint -modifies =showfunc@*/");
-  llmsglit ("sets boolint on (this makes bool and int indistinguishable types), sets modifies off (this prevents reporting of modification errors), and sets showfunc to its original setting (this controls  whether or not the name of a function is displayed before a message).");
-  llmsglit ("");
-  llmsglit ("Error Suppression");
-  llmsglit ("");
-  llmsglit ("Several comments are provided for suppressing messages. In general, it is usually better to use specific flags to suppress a particular error permanently, but the general error suppression flags may be more convenient for quickly suppressing messages for code that will be corrected or documented later.");
-  llmsglit ("");
-  llmsglit ("/*@ignore@*/ ... /*@end@*/");
-  llgenindentmsgnoloc
-    (cstring_makeLiteral 
-     ("No errors will be reported in code regions between /*@ignore@*/ and /*@end@*/. These comments can be used to easily suppress an unlimited number of messages."));
-  llmsglit ("/*@i@*/");
-    llgenindentmsgnoloc
-    (cstring_makeLiteral 
-     ("No errors will be reported from an /*@i@*/ comment to the end of the line."));
-  llmsglit ("/*@i@*/");
-  llgenindentmsgnoloc
-    (cstring_makeLiteral 
-     ("No errors will be reported from an /*@i@*/ (e.g., /*@i3@*/) comment to the end of the line. If there are not exactly n errors suppressed from the comment point to the end of the line, LCLint will report an error."));
-  llmsglit ("/*@t@*/, /*@t@*/");
-  llgenindentmsgnoloc
-    (cstring_makeLiteral 
-     ("Like i and i, except controlled by +tmpcomments flag. These can be used to temporarily suppress certain errors. Then, -tmpcomments can be set to find them again."));
-  llmsglit ("");
-  llmsglit ("Type Access");
-  llmsglit ("");
-  llmsglit ("/*@access @*/"); 
-  llmsglit ("   Allows the following code to access the representation of ");
-  llmsglit ("/*@noaccess @*/");
-  llmsglit ("   Hides the representation of ");
-  llmsglit ("");
-  llmsglit ("Macro Expansion");
-  llmsglit ("");
-  llmsglit ("/*@notfunction@*/");
-  llgenindentmsgnoloc 
-    (cstring_makeLiteral
-     ("Indicates that the next macro definition is not intended to be a "
-      "function, and should be expanded in line instead of checked as a "
-      "macro function definition."));
-}
-
-  
-void
-printFlags (void)
-{
-  llmsglit ("Flag Categories");
-  llmsglit ("---------------");
-  listAllCategories ();
-  llmsglit ("\nTo see the flags in a flag category, do\n   lclint -help flags ");
-  llmsglit ("To see a list of all flags in alphabetical order, do\n   lclint -help flags alpha");
-  llmsglit ("To see a full description of all flags, do\n   lclint -help flags full");
-}
-
-void
-printMaintainer (void)
-{
-  llmsg (message ("Maintainer: %s", cstring_makeLiteralTemp (LCLINT_MAINTAINER)));
-  llmsglit (LCL_COMPILE);
-}
-
-void
-printMail (void)
-{
-  llmsglit ("Mailing Lists");
-  llmsglit ("-------------");
-  llmsglit ("");
-  llmsglit ("There are two mailing lists associated with LCLint: ");
-  llmsglit ("");
-  llmsglit ("   lclint-announce@virginia.edu");
-  llmsglit ("");
-  llmsglit ("      Reserved for announcements of new releases and bug fixes.");
-  llmsglit ("      To subscribe, send a message to majordomo@virginia.edu with body: ");
-  llmsglit ("           subscribe lclint-announce");
-  llmsglit ("");
-  llmsglit ("   lclint-interest@virginia.edu");
-  llmsglit ("");
-  llmsglit ("      Informal discussions on the use and development of lclint.");
-  llmsglit ("      To subscribe, send a message to majordomo@virginia.edu with body: ");
-  llmsglit ("           subscribe lclint-interest");
-}
-
-void
-printReferences (void)
-{
-  llmsglit ("References");
-  llmsglit ("----------");
-  llmsglit ("");
-  llmsglit ("The LCLint web site is http://lclint.cs.virginia.edu");
-  llmsglit ("");
-  llmsglit ("Technical papers relating to LCLint include:");
-  llmsglit ("");
-  llmsglit ("   David Evans. \"Static Detection of Dynamic Memory Errors\".");  
-  llmsglit ("   SIGPLAN Conference on Programming Language Design and ");
-  llmsglit ("   Implementation (PLDI '96), Philadelphia, PA, May 1996.");
-  llmsglit ("");
-  llmsglit ("   David Evans, John Guttag, Jim Horning and Yang Meng Tan. ");
-  llmsglit ("   \"LCLint: A Tool for Using Specifications to Check Code\".");
-  llmsglit ("   SIGSOFT Symposium on the Foundations of Software Engineering,");
-  llmsglit ("   December 1994.");
-  llmsglit ("");
-  llmsglit ("A general book on Larch is:");
-  llmsglit ("");
-  llmsglit ("   Guttag, John V., Horning, James J., (with Garland, S. J., Jones, ");
-  llmsglit ("   K. D., Modet, A., and Wing, J. M.), \"Larch: Languages and Tools ");
-  llmsglit ("   for Formal Specification\", Springer-Verlag, 1993.");
-}
-
-void
-describePrefixCodes (void)
-{
-  llmsglit ("Prefix Codes");
-  llmsglit ("------------");
-  llmsglit ("");
-  llmsglit ("These characters have special meaning in name prefixes:");
-  llmsglit ("");
-  llmsg (message ("   %h  Any uppercase letter [A-Z]", PFX_UPPERCASE));
-  llmsg (message ("   %h  Any lowercase letter [a-z]", PFX_LOWERCASE));
-  llmsg (message ("   %h  Any character (valid in a C identifier)", PFX_ANY));
-  llmsg (message ("   %h  Any digit [0-9]", PFX_DIGIT));
-  llmsg (message ("   %h  Any non-uppercase letter [a-z0-9_]", PFX_NOTUPPER));
-  llmsg (message ("   %h  Any non-lowercase letter [A-Z0-9_]", PFX_NOTLOWER));
-  llmsg (message ("   %h  Any letter [A-Za-z]", PFX_ANYLETTER));
-  llmsg (message ("   %h  Any letter or digit [A-Za-z0-9]", PFX_ANYLETTERDIGIT));
-  llmsglit ("   *  Zero or more repetitions of the previous character class until the end of the name");
-}
-
-void
-describeVars (void)
-{
-  cstring eval;
-  char *def;
-
-  eval = context_getLarchPath ();
-  def = osd_getEnvironmentVariable (LARCH_PATH);
-
-  if (def != NULL || 
-      !cstring_equal (eval, cstring_fromChars (DEFAULT_LARCHPATH)))
-    {
-      llmsg (message ("LARCH_PATH = %s", eval));
-    }
-  else
-    {
-      llmsg (message ("LARCH_PATH =  (default = %s)",
-		      cstring_fromChars (DEFAULT_LARCHPATH)));
-    }
-  
-  llmsglit ("   --- path used to find larch initialization files and LSL traits");
-
-  eval = context_getLCLImportDir ();
-  def = osd_getEnvironmentVariable (LCLIMPORTDIR);
-
-  if (def != NULL ||
-      !cstring_equal (eval, cstring_fromChars (DEFAULT_LCLIMPORTDIR)))
-    {
-      llmsg (message ("%q = %s", cstring_makeLiteral (LCLIMPORTDIR), eval));
-    }
-  else
-    {
-      llmsg (message ("%s = ", cstring_makeLiteralTemp (LCLIMPORTDIR), 
-		      cstring_makeLiteralTemp (DEFAULT_LCLIMPORTDIR))); 
-    }
-  
-  llmsglit ("   --- directory containing lcl standard library files "
-	    "(import with < ... >)");;
-
-  {
-    cstring dirs = context_getString (FLG_SYSTEMDIRS);
-    llmsg (message 
-	   ("systemdirs = %s (set by include envirnoment variable or -systemdirs)",
-	    dirs));
-
-  }
-}
-
-void
-interrupt (int i)
-{
-  switch (i)
-    {
-    case SIGINT:
-      fprintf (stderr, "*** Interrupt\n");
-      llexit (LLINTERRUPT);
-    case SIGSEGV:
-      {
-	cstring loc;
-	
-	/* Cheat when there are parse errors */
-	checkParseError (); 
-	
-	fprintf (stderr, "*** Segmentation Violation\n");
-	
-	/* Don't catch it if fileloc_unparse causes a signal */
-	(void) signal (SIGSEGV, NULL);
-
-	loc = fileloc_unparse (g_currentloc);
-	
-	fprintf (stderr, "*** Location (not trusted): %s\n", 
-		 cstring_toCharsSafe (loc));
-	cstring_free (loc);
-	printCodePoint ();
-	fprintf (stderr, "*** Please report bug to %s\n", LCLINT_MAINTAINER);
-	exit (LLGIVEUP);
-      }
-    default:
-      fprintf (stderr, "*** Signal: %d\n", i);
-      /*@-mustfree@*/
-      fprintf (stderr, "*** Location (not trusted): %s\n", 
-	       cstring_toCharsSafe (fileloc_unparse (g_currentloc)));
-      /*@=mustfree@*/
-      printCodePoint ();
-      fprintf (stderr, "*** Please report bug to %s ***\n", LCLINT_MAINTAINER);
-      exit (LLGIVEUP);
-    }
-}
-
-void
-cleanupFiles (void)
-{
-  static bool doneCleanup = FALSE;
-
-  /* make sure this is only called once! */
-
-  if (doneCleanup) return;
-
-  setCodePoint ();
-
-  if (context_getFlag (FLG_KEEP))
-    {
-      check (fputs ("Temporary files kept:\n", stderr) != EOF);
-      fileTable_printTemps (context_fileTable ());
-    }
-  else
-    {
-# ifdef WIN32
-      int nfiles = /*@-unrecog@*/ _fcloseall (); /*@=unrecog@*/
-      
-      if (nfiles != 0) 
-	{
-	  llbug (message ("Files unclosed: %d", nfiles));
-	}
-# endif
-      fileTable_cleanup (context_fileTable ());
-    }
-
-  doneCleanup = TRUE;
-}
-
-/*
-** cleans up temp files (if necessary)
-** exits lclint
-*/
-
-/*@exits@*/ void
-llexit (int status)
-{
-  DPRINTF (("llexit: %d", status));
-
-# ifdef WIN32
-  if (status == LLFAILURE) 
-    {
-      _fcloseall ();
-    }
-# endif
-
-  cleanupFiles ();
-
-  if (status != LLFAILURE)
-    {
-      context_destroyMod ();
-      exprNode_destroyMod ();
-      
-      sRef_destroyMod ();
-      uentry_destroyMod ();
-      typeIdSet_destroyMod ();
-      
-# ifdef USEDMALLOC
-      dmalloc_shutdown ();
-# endif
-    }
-
-  exit ((status == LLSUCCESS) ? EXIT_SUCCESS : EXIT_FAILURE);
-}
-
-void
-loadrc (FILE *rcfile, cstringSList *passThroughArgs)
-{
-  char *s = mstring_create (MAX_LINE_LENGTH);
-  char *os = s;
-
-  DPRINTF (("Pass through: %s", cstringSList_unparse (*passThroughArgs)));
-
-  s = os;
-
-  while (fgets (s, MAX_LINE_LENGTH, rcfile) != NULL)
-    {
-      char c;
-      bool set = FALSE;	    
-      char *thisflag;
-      flagcode opt;
-
-      DPRINTF (("Line: %s", s));
-      DPRINTF (("Pass through: %s", cstringSList_unparse (*passThroughArgs)));
-      incLine ();
-            
-      while (*s == ' ' || *s == '\t' || *s == '\n') 
-	{
-	  s++;
-	  incColumn ();
-	}
-      
-      while (*s != '\0')
-	{
-	  bool escaped = FALSE;
-	  bool quoted = FALSE;
-	  c = *s;
-
-	  DPRINTF (("Process: %s", s));
-	  DPRINTF (("Pass through: %s", cstringSList_unparse (*passThroughArgs)));
-	  /* comment characters */
-	  if (c == '#' || c == ';' || c == '\n') 
-	    {
-	      /*@innerbreak@*/
-	      break;
-	    }
-	  
-	  if (c == '-' || c == '+')
-	    {
-	      set = (c == '+');
-	    }
-	  else
-	    {
-	      showHerald ();
-	      llerror (FLG_SYNTAX, 
-		       message ("Bad flag syntax (+ or - expected, "
-				"+ is assumed): %s", 
-				cstring_fromChars (s)));
-	      s--;
-	      set = TRUE;
-	    }
-	  
-	  s++;
-	  incColumn ();
-	  
-	  thisflag = s;
-	  
-	  while ((c = *s) != '\0')
-	    { /* remember to handle spaces and quotes in -D and -U ... */
-	      if (escaped)
-		{
-		  escaped = FALSE;
-		}
-	      else if (quoted)
-		{
-		  if (c == '\\')
-		    {
-		      escaped = TRUE;
-		    }
-		  else if (c == '\"')
-		    {
-		      quoted = FALSE;
-		    }
-		  else
-		    {
-		      ;
-		    }
-		}
-	      else if (c == '\"')
-		{
-		  quoted = TRUE;
-		}
-	      else
-		{
-		 if (c == ' ' || c == '\t' || c == '\n')
-		   {
-		     /*@innerbreak@*/ break;
-		   }
-	       }
-		  
-	      s++; 
-	      incColumn ();
-	    }
-
-	  DPRINTF (("Nulling: %c", *s));
-	  *s = '\0';
-
-	  if (mstring_isEmpty (thisflag))
-	    {
-	      llfatalerror (message ("Missing flag: %s",
-				     cstring_fromChars (os)));
-	    }
-
-	  DPRINTF (("Flag: %s", thisflag));
-
-	  opt = identifyFlag (cstring_fromChars (thisflag));
-	  
-	  if (flagcode_isSkip (opt))
-	    {
-	      ;
-	    }
-	  else if (flagcode_isInvalid (opt))
-	    {
-	      if (isMode (cstring_fromChars (thisflag)))
-		{
-		  context_setMode (cstring_fromChars (thisflag));
-		}
-	      else
-		{
-		  llerror (FLG_BADFLAG,
-			   message ("Unrecognized option: %s", 
-				    cstring_fromChars (thisflag)));
-		}
-	    }
-	  else
-	    {
-	      context_userSetFlag (opt, set);
-
-	      if (flagcode_hasArgument (opt))
-		{
-		  if (opt == FLG_HELP)
-		    {
-		      showHerald ();
-		      llerror (FLG_BADFLAG,
-			       message ("Cannot use help in rc files"));
-		    }
-		  else if (flagcode_isPassThrough (opt)) /* -D or -U */
-		    {
-		      cstring arg = cstring_fromCharsNew (thisflag);
-		      cstring_markOwned (arg);
-		      *passThroughArgs = cstringSList_add (*passThroughArgs, arg);
-		      DPRINTF (("Pass through: %s",
-				cstringSList_unparse (*passThroughArgs)));
-		    }
-		  else if (opt == FLG_INCLUDEPATH 
-			   || opt == FLG_SPECPATH)
-		    {
-		      cstring dir = cstring_suffix (cstring_fromChars (thisflag), 1); /* skip over I/S */
-		      		      
-		      switch (opt)
-			{
-			case FLG_INCLUDEPATH:
-			  cppAddIncludeDir (dir);
-			  /*@switchbreak@*/ break;
-			case FLG_SPECPATH:
-			  /*@-mustfree@*/
-			  g_localSpecPath = cstring_toCharsSafe
-			    (message ("%s:%s", cstring_fromChars (g_localSpecPath), dir));
-			  /*@=mustfree@*/
-			  /*@switchbreak@*/ break;
-			  BADDEFAULT;
-			}
-		    }
-		  else if (flagcode_hasString (opt)
-			   || flagcode_hasValue (opt)
-			   || opt == FLG_INIT || opt == FLG_OPTF)
-		    {
-		      cstring extra = cstring_undefined;
-		      char *rest, *orest;
-		      char rchar;
-		      
-		      *s = c;
-		      rest = mstring_copy (s);
-		      DPRINTF (("Here: rest = %s", rest));
-		      orest = rest;
-		      *s = '\0';
-		      
-		      while ((rchar = *rest) != '\0'
-			     && (isspace ((int) rchar)))
-			{
-			  rest++;
-			  s++;
-			}
-		      
-		      DPRINTF (("Yo: %s", rest));
-
-		      while ((rchar = *rest) != '\0' 
-			     && !isspace ((int) rchar))
-			{
-			  extra = cstring_appendChar (extra, rchar);
-			  rest++; 
-			  s++;
-			}
-		      
-		      DPRINTF (("Yo: %s", extra));
-		      sfree (orest);
-
-		      if (cstring_isUndefined (extra))
-			{
-			  showHerald ();
-			  llerror 
-			    (FLG_BADFLAG,
-			     message
-			     ("Flag %s must be followed by an argument",
-			      flagcode_unparse (opt)));
-			}
-		      else
-			{
-			  s--;
-			  
-			  DPRINTF (("Here we are: %s", extra));
-
-			  if (flagcode_hasValue (opt))
-			    {
-			      DPRINTF (("Set value flag: %s", extra));
-			      setValueFlag (opt, extra);
-			      cstring_free (extra);
-			    }
-			  else if (opt == FLG_OPTF)
-			    {
-			      FILE *innerf = fopen (cstring_toCharsSafe (extra), "r");
-			      cstring_markOwned (extra);
-			      
-			      if (innerf != NULL)
-				{
-				  fileloc fc = g_currentloc;
-				  g_currentloc = fileloc_createRc (extra);
-				  loadrc (innerf, passThroughArgs);
-				  fileloc_reallyFree (g_currentloc);
-				  g_currentloc = fc;
-				}
-			      else 
-				{
-				  showHerald ();
-				  llerror
-				    (FLG_SYNTAX, 
-				     message ("Options file not found: %s", 
-					      extra));
-				}
-			    }
-			  else if (opt == FLG_INIT)
-			    {
-# ifndef NOLCL
-			      llassert (initFile == NULL);
-			      
-			      initFile = tsource_create 
-				(cstring_toCharsSafe (extra), 
-				 LCLINIT_SUFFIX, FALSE);
-			      cstring_markOwned (extra);
-# else
-			      cstring_free (extra);
-# endif
-			    }
-			  else if (flagcode_hasString (opt))
-			    {
-			      if (cstring_firstChar (extra) == '"')
-				{
-				  if (cstring_lastChar (extra) == '"')
-				    {
-				      char *extras = cstring_toCharsSafe (extra);
-				      
-				      llassert (extras[strlen(extras) - 1] == '"');
-				      extras[strlen(extras) - 1] = '\0';
-				      extra = cstring_fromChars (extras + 1); 
-				      DPRINTF (("Remove quites: %s", extra));
-				    }
-				  else
-				    {
-				      llerror
-					(FLG_SYNTAX, 
-					 message ("Unmatched \" in option string: %s", 
-						  extra));
-				    }
-				}
-			      
-			      setStringFlag (opt, extra);
-			    }
-			  else
-			    {
-			      cstring_free (extra);
-			      BADEXIT;
-			    }
-			}
-		    }
-		  else
-		    {
-		      BADEXIT;
-		    }
-		}
-	    }
-	  
-	  *s = c;
-	  DPRINTF (("Pass through: %s", cstringSList_unparse (*passThroughArgs)));
-	  while ((c == ' ') || (c == '\t'))
-	    {
-	      c = *(++s);
-	      incColumn ();
-	    } 
-	}
-      DPRINTF (("Pass through: %s", cstringSList_unparse (*passThroughArgs)));
-      s = os;
-    }
-
-  DPRINTF (("Pass through: %s", cstringSList_unparse (*passThroughArgs)));
-  sfree (os); 
-  check (fclose (rcfile) == 0);
-}
-
-static fileIdList preprocessFiles (fileIdList fl)
-  /*@modifies fileSystem@*/
-{
-  bool msg = (context_getFlag (FLG_SHOWSCAN) && fileIdList_size (fl) > 10);
-  int skip = (fileIdList_size (fl) / 5);
-  int filesprocessed = 0;
-  fileIdList dfiles = fileIdList_create ();
-
-  fileloc_free (g_currentloc);
-  g_currentloc = fileloc_createBuiltin ();
-
-  fileIdList_elements (fl, fid)
-    {
-      char *ppfname = cstring_toCharsSafe (fileName (fid));
-
-      if (!(osd_fileIsReadable (ppfname)))
-	{
-	  lldiagmsg (message ("Cannot open file: %s",
-			      cstring_fromChars (ppfname)));
-	}
-      else
-	{
-	  fileId  dfile = fileTable_addCTempFile (context_fileTable (), fid);
-	  
-	  llassert (!mstring_isEmpty (ppfname));
-	  
-	  if (msg)
-	    {
-	      if ((filesprocessed % skip) == 0) 
-		{
-		  if (filesprocessed == 0) {
-		    fprintf (stderr, " ");
-		  }
-		  else {
-		    fprintf (stderr, ".");
-		  }
-		  
-		  (void) fflush (stderr);
-		}
-	      filesprocessed++;
-	    }
-
-	  if (cppProcess (cstring_fromChars (ppfname), 
-			  fileName (dfile)) != 0) 
-	    {
-	      llfatalerror (message ("Preprocessing error for file: %s", 
-				     rootFileName (fid)));
-	    }
-	  
-	  fileIdList_add (dfiles, dfile);
-	}
-    } end_fileIdList_elements; 
-    
-    return dfiles;
-}
diff --git a/src/lltok.c b/src/lltok.c
deleted file mode 100644
index 63e94a4..0000000
--- a/src/lltok.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** lltok.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-# include "cgrammar.h"
-# include "cgrammar_tokens.h"
-
-bool
-lltok_isSemi (lltok tok)
-{
-  return (tok.tok == TSEMI);
-}
-
-bool
-lltok_isMult (lltok tok)
-{
-  return (tok.tok == TMULT);
-}
-
-bool lltok_isInc_Op (lltok tok)
-{
-  return (tok.tok == INC_OP);
-}
-
-bool lltok_isDec_Op  (lltok tok)
-{
-  return (tok.tok == DEC_OP);
-}
-
-
-/* DRL added this function 10/23/2000 for boolean stuff */
-bool lltok_isEq_Op (lltok tok)
-{
-  return (tok.tok == EQ_OP);
-}
-
-/* DRL added this function 10/25/2000 for boolean stuff */
-bool lltok_isAnd_Op (lltok tok)
-{
-  return (tok.tok == AND_OP);
-}
-
-bool lltok_isOr_Op (lltok tok)
-{
-  return (tok.tok == OR_OP);
-}
-
-bool lltok_isNot_Op (lltok tok)
-{
-  return (tok.tok ==  TEXCL);
-}
-/*drl7x added this function 11/20/00 */
-
-bool lltok_isLt_Op (lltok tok)
-{
-  return (tok.tok ==  TLT);
-}
-
-bool lltok_isGt_Op (lltok tok)
-{
-  return (tok.tok ==  TGT);
-}
-  
-bool lltok_isGe_Op (lltok tok)
-{
-  return (tok.tok ==  GE_OP);
-}
-
-bool lltok_isLe_Op (lltok tok)
-{
-  return (tok.tok ==  LE_OP);
-}
-
-/* end drl7x added */
-
-
-/*drl7x added 11 30 2000*/
-bool  lltok_isPlus_Op (lltok tok)
-{
-  return (tok.tok ==  TPLUS);
-}
-
-bool  lltok_isMinus_Op (lltok tok)
-{
-  return (tok.tok ==  TMINUS);
-}
-
-/*end drl added */
-
-cstring
-lltok_unparse (lltok tok)
-{
-  char *lit;
-
-  switch (tok.tok)
-    {
-    case BREAK:      lit = "break"; break;
-    case CASE:       lit = "case"; break;
-    case CONTINUE:   lit = "continue"; break;
-    case DEFAULT:    lit = "default"; break;
-    case DO:         lit = "do"; break;
-    case CDOUBLE:    lit = "double"; break;
-    case CELSE:      lit = "else"; break;
-    case CFOR:       lit = "for"; break;
-    case GOTO:       lit = "goto"; break;
-    case CIF:        lit = "if"; break;
-    case RETURN:     lit = "return"; break;
-    case CSIZEOF:    lit = "sizeof"; break;
-    case SWITCH:     lit = "switch"; break;
-    case WHILE:      lit = "while"; break;
-    case CSTRUCT:    lit = "struct"; break;
-    case CTYPEDEF:   lit = "typedef"; break;
-    case CUNION:     lit = "union"; break;
-    case CENUM:      lit = "enum"; break;
-    case QEXTERN:     lit = "extern"; break;
-    case QAUTO:       lit = "auto"; break;
-    case QSTATIC:     lit = "static"; break;
-    case RIGHT_ASSIGN: lit = ">>="; break;
-    case LEFT_ASSIGN:  lit = "<<="; break;
-    case ADD_ASSIGN: lit = "+="; break;
-    case SUB_ASSIGN: lit = "-="; break;
-    case MUL_ASSIGN: lit = "*="; break;
-    case DIV_ASSIGN: lit = "/="; break;
-    case MOD_ASSIGN: lit = "%="; break;
-    case AND_ASSIGN: lit = "&="; break;
-    case XOR_ASSIGN: lit = "^="; break;
-    case OR_ASSIGN:  lit = "|="; break;
-    case RIGHT_OP:   lit = ">>"; break;
-    case LEFT_OP:    lit = "<<"; break;
-    case INC_OP:     lit = "++"; break; 
-    case DEC_OP:     lit = "--"; break;
-    case ARROW_OP:   lit = "->"; break;
-    case AND_OP:     lit = "&&"; break;
-    case OR_OP:      lit = "||"; break;
-    case LE_OP:      lit = "<="; break;
-    case GE_OP:      lit = ">="; break;
-    case EQ_OP:      lit = "=="; break;
-    case NE_OP:      lit = "!="; break;
-    case TSEMI:      lit = ";"; break;
-    case TLBRACE:    lit = "{"; break;
-    case TRBRACE:    lit = "}"; break;
-    case TCOMMA:     lit = ","; break;
-    case TCOLON:     lit = ":"; break;
-    case TASSIGN:        lit = "="; break;
-    case TLPAREN:    lit = "("; break;
-    case TRPAREN:    lit = ")"; break;
-    case TLSQBR:     lit = "["; break;
-    case TRSQBR:     lit = "]"; break;
-    case TDOT:       lit = "."; break;
-    case TAMPERSAND: lit = "&"; break;
-    case TEXCL:      lit = "!"; break;
-    case TTILDE:     lit = "~"; break;
-    case TMINUS:     lit = "-"; break;
-    case TPLUS:      lit = "+"; break;
-    case TMULT:      lit = "*"; break;
-    case TDIV:       lit = "/"; break;
-    case TPERCENT:   lit = "%"; break;
-    case TLT:        lit = "<"; break;
-    case TGT:        lit = ">"; break;
-    case TCIRC:      lit = "^"; break;
-    case TBAR:       lit = "|"; break;
-    case TQUEST:     lit = "?"; break;  
-    case QOUT:       lit = "out"; break;
-    case QONLY:      lit = "only"; break;
-    case QKEEP:      lit = "keep"; break;
-    case QKEPT:      lit = "kept"; break;
-    case QTEMP:      lit = "temp"; break;
-    case QSHARED:    lit = "shared"; break;
-    case QUNIQUE:    lit = "unique"; break;
-    case QREF:       lit = "ref"; break;
-    case QCHECKED:   lit = "checked"; break;
-    case QCHECKEDSTRICT: lit = "checkedstrict"; break;
-    case QCHECKMOD:  lit = "checkmod"; break;
-    case QUNCHECKED: lit = "unchecked"; break;
-    case QTRUENULL:  lit = "truenull"; break;
-    case QFALSENULL: lit = "falsenull"; break;
-    case QRETURNED:  lit = "returned"; break;
-    case QEXPOSED:   lit = "exposed"; break;
-    case QNULL:      lit = "null"; break;
-    case QRELNULL:   lit = "refnull"; break;
-    case QOBSERVER:  lit = "observer"; break;
-    case QPARTIAL:   lit = "partial"; break;
-    case QSPECIAL:   lit = "special"; break;
-    case QUSES:      lit = "uses"; break;
-    case QDEFINES:   lit = "defines"; break;
-    case QALLOCATES: lit = "allocates"; break;
-    case QSETS:      lit = "sets"; break;
-    case QRELEASES:  lit = "releases"; break;
-    case QSETBUFFERSIZE: lit = "setBufferSize"; break;
-    case QSETSTRINGLENGTH: lit = "setStringLength"; break;
-    default:  lit = "bad "; break;
-      //  BADDEFAULT;
-    }
- 
-  return cstring_makeLiteralTemp (lit);
-}
-
-lltok
-lltok_create (int tok, fileloc loc)
-{
-  lltok l;
-
-  l.tok = tok;
-  l.loc = loc;
-
-  return (l);
-}
-
-void lltok_release (lltok t) 
-{
-  fileloc_free (t.loc);
-}
-
diff --git a/src/lslOpList.c b/src/lslOpList.c
deleted file mode 100644
index 5b5bfe6..0000000
--- a/src/lslOpList.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** lslOpList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ lslOpList
-lslOpList_new ()
-{
-  lslOpList s = (lslOpList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = lslOpListBASESIZE;
-  s->elements = (lslOp *)
-    dmalloc (sizeof (*s->elements) * lslOpListBASESIZE);
-
-  return (s);
-}
-
-static void
-lslOpList_grow (lslOpList s)
-{
-  int i;
-  lslOp *newelements; 
-
-  s->nspace += lslOpListBASESIZE;
-  
-  newelements = (lslOp *) dmalloc (sizeof (*newelements)
-					 * (s->nelements + s->nspace));
-  
-  if (newelements == (lslOp *) 0)
-    {
-      llfatalerror (cstring_makeLiteral ("lslOpList_grow: out of memory!"));
-    }
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-void 
-lslOpList_add (lslOpList s, lslOp el)
-{
-  llassert (lslOpListBASESIZE != 0);
-
-  if (s->nspace <= 0)
-    {
-      lslOpList_grow (s);
-    }
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-}
-
-/*@only@*/ cstring
-lslOpList_unparse (lslOpList s)
-{
-  int i;
-  cstring st = cstring_undefined;
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      st = message ("%q%q\n", st, lslOp_unparse (s->elements[i]));
-    }
-
-  return st;
-}
-
-void
-lslOpList_free (lslOpList s)
-{
-  sfree (s->elements);	
-  sfree (s);
-}
diff --git a/src/lslOpSet.c b/src/lslOpSet.c
deleted file mode 100644
index de9bd3d..0000000
--- a/src/lslOpSet.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-
-/*
-** lslOpSet.c
-**
-** based on set_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "checking.h"		/* for lslOp_equal */
-
-static bool lslOpSet_member (lslOpSet p_s, lslOp p_el);
-
-lslOpSet lslOpSet_new ()
-{
-  lslOpSet s = (lslOpSet) dmalloc (sizeof (*s));
-
-  s->entries = 0;
-  s->nspace = lslOpSetBASESIZE;
-  s->elements = (lslOp *)
-    dmalloc (sizeof (*s->elements) * lslOpSetBASESIZE);
-  
-  return (s);
-}
-
-static /*@only@*/ lslOpSet
-lslOpSet_predict (int size)
-{
-  lslOpSet s = (lslOpSet) dmalloc (sizeof (*s));
-  
-  s->entries = 0;
-
-  if (size > 0)
-    {
-      s->nspace = size;
-      s->elements = (lslOp *) dmalloc (sizeof (*s->elements) * size);
-    }
-  else
-    {
-      s->nspace = 0;
-      s->elements = NULL;
-    }
-
-  return (s);
-}
-
-static void
-lslOpSet_grow (/*@notnull@*/ lslOpSet s)
-{
-  int i;
-  lslOp *newelements;
-
-  s->nspace = lslOpSetBASESIZE;
-  newelements = (lslOp *) dmalloc (sizeof (*newelements)
-					 * (s->entries + s->nspace));
-
-  if (newelements == (lslOp *) 0)
-    {
-      llfatalerror (cstring_makeLiteral ("lslOpSet_grow: out of memory!"));
-    }
-
-  for (i = 0; i < s->entries; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements); 
-  s->elements = newelements;
-}
-
-/*
-** Ensures: if *e \in *s
-**          then unchanged (*s) & result = false
-**          else *s' = insert (*s, *e) & result = true
-** Modifies: *s
-*/
-
-bool
-lslOpSet_insert (lslOpSet s, /*@only@*/ lslOp el)
-{
-  llassert (lslOpSet_isDefined (s));
-
-  if (lslOpSet_member (s, el))
-    {
-      lslOp_free (el);
-      return FALSE;
-    }
-  else
-    {
-      if (s->nspace <= 0)
-	lslOpSet_grow (s);
-      s->nspace--;
-      s->elements[s->entries] = el;
-      s->entries++;
-      return TRUE;
-    }
-}
-
-static bool
-lslOpSet_member (lslOpSet s, lslOp el)
-{
-  if (lslOpSet_isDefined (s))
-    {
-      int i;
-      
-      for (i = 0; i < lslOpSet_size (s); i++)
-	{
-	  if (lslOp_equal (el, s->elements[i]))
-	    return TRUE;
-	}
-    }
-
-  return FALSE;
-}
-
-/*@only@*/ cstring
-lslOpSet_unparse (lslOpSet s)
-{
-  if (lslOpSet_isDefined (s))
-    {
-      int i;
-      cstring st = cstring_makeLiteral ("{");
-      
-      for (i = 0; i < lslOpSet_size (s); i++)
-	{
-	  st = message ("%q   %q", st, lslOp_unparse (s->elements[i]));
-	}
-      
-      st = message ("%q}", st);
-      return st;
-    }
-  else
-    {
-      return (cstring_makeLiteral ("{ }"));
-    }
-}
-
-/*@only@*/ lslOpSet
-lslOpSet_copy (lslOpSet s)
-{
-  if (lslOpSet_isDefined (s))
-    {
-      lslOpSet t = lslOpSet_predict (lslOpSet_size (s));
-      int i;
-      
-      for (i = 0; i < lslOpSet_size (s); i++)
-	{
-	  (void) lslOpSet_insert (t, lslOp_copy (s->elements[i])); 
-	}
-      
-      return t;
-    }
-  else
-    {
-      return lslOpSet_undefined;
-    }
-}
-
-void
-lslOpSet_free (lslOpSet s)
-{
-  if (lslOpSet_isDefined (s))
-    {
-      int i;
-      for (i = 0; i < s->entries; i++)
-	{
-	  lslOp_free (s->elements[i]); 
-	}
-      
-      sfree (s->elements); 
-      sfree (s);
-    }
-}
diff --git a/src/lslinit.c b/src/lslinit.c
deleted file mode 100644
index 9a3deb4..0000000
--- a/src/lslinit.c
+++ /dev/null
@@ -1,1555 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** lslinit.c
-**
-** Processor for Larch Shared Language Init Files
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "signature.h"
-# include "signature2.h"
-# include "scan.h"
-# include "scanline.h"
-# include "tokentable.h"
-# include "syntable.h"
-# include "lslinit.h"
-
-/* needed to parse init files */
-# include "shift.h"
-#if TRACING == 1
-/*@notfunction@*/
-# define LTRACE(rule) printf ("Reducing: %s\n", rule)
-#else
-/*@notfunction@*/
-# define LTRACE(rule)
-#endif
-
-static void LocalUserError (ltoken p_t, /*@temp@*/ char *p_msg)
-  /*@modifies *g_msgstream@*/;
-
-static /*@only@*/ ltoken nextToken;
-
-static void InitFile (void) /*@modifies nextToken@*/ ;
-static void InitLines (void) /*@modifies nextToken@*/ ;
-static void InitLine (void) /*@modifies nextToken@*/ ;
-static void Classification (void) /*@modifies nextToken@*/ ;
-static void CharClass (void) /*@modifies nextToken@*/ ;
-
-static void EndCommentChars (void) /*@modifies nextToken@*/ ;
-static void IdChars (void) /*@modifies nextToken@*/ ;
-static void OpChars (void) /*@modifies nextToken@*/ ;
-static void ExtensionChar (void) /*@modifies nextToken@*/ ;
-static void SingChars (void) /*@modifies nextToken@*/ ;
-static void WhiteChars (void) /*@modifies nextToken@*/ ;
-static void EndCommentChar (void) /*@modifies nextToken@*/ ;
-static void IdChar (void) /*@modifies nextToken@*/ ;
-static void OpChar (void) /*@modifies nextToken@*/ ;
-static void SingChar (void) /*@modifies nextToken@*/ ;
-static void WhiteChar (void) /*@modifies nextToken@*/ ;
-
-static void TokenClass (void) /*@modifies nextToken@*/ ;
-static void QuantifierSymToks (void) /*@modifies nextToken@*/ ;
-static void LogicalOpToks (void) /*@modifies nextToken@*/ ;
-static void EqOpToks (void) /*@modifies nextToken@*/ ;
-static void EquationSymToks (void) /*@modifies nextToken@*/ ;
-static void EqSepSymToks (void) /*@modifies nextToken@*/ ;
-static void SelectSymToks (void) /*@modifies nextToken@*/ ;
-static void OpenSymToks (void) /*@modifies nextToken@*/ ;
-static void SepSymToks (void) /*@modifies nextToken@*/ ;
-static void CloseSymToks (void) /*@modifies nextToken@*/ ;
-static void SimpleIdToks (void) /*@modifies nextToken@*/ ;
-static void MapSymToks (void) /*@modifies nextToken@*/ ;
-static void MarkerSymToks (void) /*@modifies nextToken@*/ ;
-static void CommentSymToks (void) /*@modifies nextToken@*/ ;
-static void QuantifierSymTok (void) /*@modifies nextToken@*/ ;
-static void LogicalOpTok (void) /*@modifies nextToken@*/ ;
-static void EqOpTok (void) /*@modifies nextToken@*/ ;
-static void EquationSymTok (void) /*@modifies nextToken@*/ ;
-static void EqSepSymTok (void) /*@modifies nextToken@*/ ;
-static void SelectSymTok (void) /*@modifies nextToken@*/ ;
-static void OpenSymTok (void) /*@modifies nextToken@*/ ;
-static void SepSymTok (void) /*@modifies nextToken@*/ ;
-static void CloseSymTok (void) /*@modifies nextToken@*/ ;
-static void SimpleIdTok (void) /*@modifies nextToken@*/ ;
-static void MapSymTok (void) /*@modifies nextToken@*/ ;
-static void MarkerSymTok (void) /*@modifies nextToken@*/ ;
-static void CommentSymTok (void) /*@modifies nextToken@*/ ;
-static void SynClass (void) /*@modifies nextToken@*/ ;
-static void OldToken (void) /*@modifies nextToken@*/ ;
-static void NewToken (void) /*@modifies nextToken@*/ ;
-static void Token (void) /*@modifies nextToken@*/ ;
-
-static void InitReduce (LSLInitRuleCode p_rule) /*@modifies nextToken@*/ ;
-static void UpdateXCharKeywords (charCode) /*@modifies nextToken@*/ ;
-static void ProcessExtensionChar (void) /*@modifies nextToken@*/ ;
-static void ProcessEndCommentChar (void) /*@modifies nextToken@*/ ;
-static void ProcessSingleChar (charCode p_code) /*@modifies nextToken@*/ ;
-static void ProcessToken (ltokenCode p_code) /*@modifies nextToken@*/ ;
-static void ProcessSynonym (void) /*@modifies nextToken@*/ ;
-
-/* If TRUE character has been redefined as a singleChar. */
-static bool defineSingleChar[LASTCHAR + 1];
-
-static charCode currentExtensionChar;
-
-/* LSL init file keyword tokens.  */
-
-static /*@dependent@*/ ltoken endCommentCharToken;
-static /*@dependent@*/ ltoken idCharToken;
-static /*@dependent@*/ ltoken opCharToken;
-static /*@dependent@*/ ltoken extensionCharToken;
-static /*@dependent@*/ ltoken singleCharToken;
-static /*@dependent@*/ ltoken whiteCharToken;
-static /*@dependent@*/ ltoken quantifierSymToken;
-static /*@dependent@*/ ltoken logicalOpToken;
-static /*@dependent@*/ ltoken eqOpToken;
-static /*@dependent@*/ ltoken equationSymToken;
-static /*@dependent@*/ ltoken eqSepSymToken;
-static /*@dependent@*/ ltoken selectSymToken;
-static /*@dependent@*/ ltoken openSymToken;
-static /*@dependent@*/ ltoken sepSymToken;
-static /*@dependent@*/ ltoken closeSymToken;
-static /*@dependent@*/ ltoken simpleIdToken;
-static /*@dependent@*/ ltoken mapSymToken;
-static /*@dependent@*/ ltoken markerSymToken;
-static /*@dependent@*/ ltoken commentSymToken;
-static /*@dependent@*/ ltoken synonymToken;
-
-static bool
-hasFirstChar (ltoken tok)
-{
-  return (ltoken_isChar (tok)
-	  && lscanCharClass (cstring_firstChar (ltoken_unparse (tok))) == SINGLECHAR);
-}
-
-void
-LSLProcessInitFile (void)
-{
-  InitFile ();
-}
-
-/*
-**
-**  Parsing functions for init file processing, in the same order as the
-**  grammar file lslinit.cfg.  This is top-down order, as much as possible.
-**
-*/
-
-static void
-InitFile (void)
-{
-  InitLines ();
-  InitReduce (INITFILE1);
-
-  if (ltoken_getCode (nextToken) != LEOFTOKEN)
-    {
-      LocalUserError (nextToken, "unexpected tokens after end-of-file");
-    }
-}
-
-static void
-InitLines (void)
-{
-  InitReduce (INITLINES1);
-
-  if (ltoken_getCode (nextToken) != LEOFTOKEN)
-    {
-      InitLine ();
-      InitReduce (INITLINES2);
-    }
-
-  while (ltoken_getCode (nextToken) != LEOFTOKEN)
-    {
-      InitLine ();
-      InitReduce (INITLINES3);
-    }
-
-}
-
-static void
-InitLine (void)
-{
-  if (ltoken_getCode (nextToken) == LST_EOL)
-    {
-     /* Nothing on line. */
-      InitReduce (INITLINE1);
-    }
-  else
-    {
-      Classification ();
-      InitReduce (INITLINE2);
-    }
-
-  if (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      LocalUserError (nextToken, "Unexpected tokens on line");
-    }
-
-  ltoken_free (nextToken);
-  nextToken = LSLScanNextToken ();	       
-}
-
-static void
-Classification (void)
-{
-  if (ltoken_getRawText (nextToken) == ltoken_getText (endCommentCharToken)
-      || ltoken_getRawText (nextToken) == ltoken_getText (idCharToken)
-      || ltoken_getRawText (nextToken) == ltoken_getText (opCharToken)
-      || ltoken_getRawText (nextToken) == ltoken_getText (extensionCharToken)
-      || ltoken_getRawText (nextToken) == ltoken_getText (singleCharToken)
-      || ltoken_getRawText (nextToken) == ltoken_getText (whiteCharToken))
-    {
-      CharClass ();
-      InitReduce (CLASSIFICATION1);
-    }
-  else if (ltoken_getRawText (nextToken) == ltoken_getText (quantifierSymToken)
-	   || ltoken_getRawText (nextToken) == ltoken_getText (logicalOpToken)
-	   || ltoken_getRawText (nextToken) == ltoken_getText (eqOpToken)
-	   || ltoken_getRawText (nextToken) == ltoken_getText (equationSymToken)
-	   || ltoken_getRawText (nextToken) == ltoken_getText (eqSepSymToken)
-	   || ltoken_getRawText (nextToken) == ltoken_getText (selectSymToken)
-	   || ltoken_getRawText (nextToken) == ltoken_getText (openSymToken)
-	   || ltoken_getRawText (nextToken) == ltoken_getText (sepSymToken)
-	   || ltoken_getRawText (nextToken) == ltoken_getText (closeSymToken)
-	   || ltoken_getRawText (nextToken) == ltoken_getText (simpleIdToken)
-	   || ltoken_getRawText (nextToken) == ltoken_getText (mapSymToken)
-	   || ltoken_getRawText (nextToken) == ltoken_getText (markerSymToken)
-	   || ltoken_getRawText (nextToken) == ltoken_getText (commentSymToken))
-    {
-      TokenClass ();
-      InitReduce (CLASSIFICATION2);
-    }
-  else if (ltoken_getRawText (nextToken) == ltoken_getText (synonymToken))
-    {
-      SynClass ();
-      InitReduce (CLASSIFICATION3);
-    }
-  else
-    {
-      LocalUserError (nextToken,
-		      "expected character, token, or synonym classification");
-    }
-}
-
-static void
-CharClass (void)
-{
-  ltoken charClassToken;
-
-  charClassToken = nextToken;
-
-  nextToken = LSLScanNextToken ();		/* Discard char class keyword. */
-
-  if (ltoken_getRawText (charClassToken) == ltoken_getText (endCommentCharToken))
-    {
-      EndCommentChars ();
-      InitReduce (CHARCLASS1);
-    }
-  else if (ltoken_getRawText (charClassToken) == ltoken_getText (idCharToken))
-    {
-      IdChars ();
-      InitReduce (CHARCLASS2);
-    }
-  else if (ltoken_getRawText (charClassToken) == ltoken_getText (opCharToken))
-    {
-      OpChars ();
-      InitReduce (CHARCLASS3);
-    }
-  else if (ltoken_getRawText (charClassToken)
-	   == ltoken_getText (extensionCharToken))
-    {
-      ExtensionChar ();
-      InitReduce (CHARCLASS4);
-    }
-  else if (ltoken_getRawText (charClassToken) == ltoken_getText (singleCharToken))
-    {
-      SingChars ();
-      InitReduce (CHARCLASS5);
-    }
-  else if (ltoken_getRawText (charClassToken) == ltoken_getText (whiteCharToken))
-    {
-      WhiteChars ();
-      InitReduce (CHARCLASS6);
-    }
-  else
-    {
-      LocalUserError (nextToken, "expected character classification");
-    }
-
-  ltoken_free (charClassToken);
-}
-
-static void
-EndCommentChars (void)
-{
-  EndCommentChar ();
-  InitReduce (LRC_ENDCOMMENT1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      EndCommentChar ();
-      InitReduce (LRC_ENDCOMMENT2);
-    }
-
-}
-
-static void
-IdChars (void)
-{
-  IdChar ();
-  InitReduce (IDCHARS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      IdChar ();
-      InitReduce (IDCHARS2);
-    }
-}
-
-static void
-OpChars (void)
-{
-  OpChar ();
-  InitReduce (OPCHARS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      OpChar ();
-      InitReduce (OPCHARS2);
-    }
-}
-
-static void
-ExtensionChar (void)
-{
-  if (ltoken_isChar (nextToken)
-      && lscanCharClass (cstring_firstChar (ltoken_unparse (nextToken))) == SINGLECHAR)
-    {
-      LSLGenShiftOnly (nextToken);
-      nextToken = LSLScanNextToken ();
-      InitReduce (LRC_EXTENSIONCHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "expected only one character");
-    }
-}
-
-static void
-SingChars (void)
-{
-  SingChar ();
-  InitReduce (SINGCHARS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      SingChar ();
-      InitReduce (SINGCHARS2);
-    }
-}
-
-static void
-WhiteChars (void)
-{
-  WhiteChar ();
-  InitReduce (WHITECHARS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      WhiteChar ();
-      InitReduce (WHITECHARS2);
-    }
-}
-
-static void
-EndCommentChar (void)
-{
-  if (ltoken_isChar (nextToken))
-    {
-      LSLGenShiftOnly (nextToken);
-      nextToken = LSLScanNextToken ();
-      InitReduce (LRC_ENDCOMMENTCHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "expected only one character");
-    }
-}
-
-static void
-IdChar (void)
-{
-  if (hasFirstChar (nextToken))
-    {
-      LSLGenShiftOnly (nextToken);
-      nextToken = LSLScanNextToken ();
-      InitReduce (IDCHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "character is already defined, cannot redefine");
-    }
-}
-
-static void
-OpChar (void)
-{
-  if (hasFirstChar (nextToken))
-    {
-      LSLGenShiftOnly (nextToken);
-      nextToken = LSLScanNextToken ();
-      InitReduce (OPCHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "character is already defined, cannot redefine");
-    }
-}
-
-static void
-SingChar (void)
-{
-  if (hasFirstChar (nextToken))
-    {
-      LSLGenShiftOnly (nextToken);
-      nextToken = LSLScanNextToken ();
-      InitReduce (SINGCHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "character is already defined, cannot redefine");
-    }
-}
-
-static void
-WhiteChar (void)
-{
-  if (hasFirstChar (nextToken))
-    {
-      LSLGenShiftOnly (nextToken);
-      nextToken = LSLScanNextToken ();
-      InitReduce (WHITECHAR1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "character is already defined, cannot redefine");
-    }
-}
-
-static void
-TokenClass (void)
-{
-  ltoken tokenClassToken;
-
-  tokenClassToken = nextToken;
-
-  nextToken = LSLScanNextToken ();
-
-  if (ltoken_getRawText (tokenClassToken) == ltoken_getText (quantifierSymToken))
-    {
-      QuantifierSymToks ();
-      InitReduce (TOKENCLASS1);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (logicalOpToken))
-    {
-      LogicalOpToks ();
-      InitReduce (TOKENCLASS2);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (eqOpToken))
-    {
-      EqOpToks ();
-      InitReduce (TOKENCLASS3);
-    }
-  else if (ltoken_getRawText (tokenClassToken)
-	   == ltoken_getText (equationSymToken))
-    {
-      EquationSymToks ();
-      InitReduce (TOKENCLASS4);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (eqSepSymToken))
-    {
-      EqSepSymToks ();
-      InitReduce (TOKENCLASS5);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (selectSymToken))
-    {
-      SelectSymToks ();
-      InitReduce (TOKENCLASS6);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (openSymToken))
-    {
-      OpenSymToks ();
-      InitReduce (TOKENCLASS7);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (sepSymToken))
-    {
-      SepSymToks ();
-      InitReduce (TOKENCLASS8);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (closeSymToken))
-    {
-      CloseSymToks ();
-      InitReduce (TOKENCLASS9);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (simpleIdToken))
-    {
-      SimpleIdToks ();
-      InitReduce (TOKENCLASS10);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (mapSymToken))
-    {
-      MapSymToks ();
-      InitReduce (TOKENCLASS11);
-    }
-  else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (markerSymToken))
-    {
-      MarkerSymToks ();
-      InitReduce (TOKENCLASS12);
-    }
-  else if (ltoken_getRawText (tokenClassToken)
-	   == ltoken_getText (commentSymToken))
-    {
-      CommentSymToks ();
-      InitReduce (TOKENCLASS13);
-    }
-  else
-    {
-      LocalUserError (nextToken, "expected token classification");
-    }
-
-  ltoken_free (tokenClassToken);
-}
-
-static void
-QuantifierSymToks (void)
-{
-  QuantifierSymTok ();
-  InitReduce (QUANTIFIERSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      QuantifierSymTok ();
-      InitReduce (QUANTIFIERSYMTOKS2);
-    }
-}
-
-static void
-LogicalOpToks (void)
-{
-  LogicalOpTok ();
-  InitReduce (LOGICALOPTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      LogicalOpTok ();
-      InitReduce (LOGICALOPTOKS2);
-    }
-}
-
-static void
-EqOpToks (void)
-{
-  EqOpTok ();
-  InitReduce (LRC_EQOPTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      EqOpTok ();
-      InitReduce (LRC_EQOPTOKS2);
-    }
-}
-
-static void
-EquationSymToks (void)
-{
-  EquationSymTok ();
-  InitReduce (LRC_EQUATIONSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      EquationSymTok ();
-      InitReduce (LRC_EQUATIONSYMTOKS2);
-    }
-}
-
-static void
-EqSepSymToks (void)
-{
-  EqSepSymTok ();
-  InitReduce (LRC_EQSEPSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      EqSepSymTok ();
-      InitReduce (LRC_EQSEPSYMTOKS2);
-    }
-}
-
-static void
-SelectSymToks (void)
-{
-  SelectSymTok ();
-  InitReduce (SELECTSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      SelectSymTok ();
-      InitReduce (SELECTSYMTOKS2);
-    }
-}
-
-static void
-OpenSymToks (void)
-{
-  OpenSymTok ();
-  InitReduce (OPENSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      OpenSymTok ();
-      InitReduce (OPENSYMTOKS2);
-    }
-}
-
-static void
-SepSymToks (void)
-{
-  SepSymTok ();
-  InitReduce (SEPSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      SepSymTok ();
-      InitReduce (SEPSYMTOKS2);
-    }
-}
-
-static void
-CloseSymToks (void)
-{
-  CloseSymTok ();
-  InitReduce (CLOSESYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      CloseSymTok ();
-      InitReduce (CLOSESYMTOKS2);
-    }
-}
-
-static void
-SimpleIdToks (void)
-{
-  SimpleIdTok ();
-  InitReduce (SIMPLEIDTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      SimpleIdTok ();
-      InitReduce (SIMPLEIDTOKS2);
-    }
-}
-
-static void
-MapSymToks (void)
-{
-  MapSymTok ();
-  InitReduce (MAPSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      MapSymTok ();
-      InitReduce (MAPSYMTOKS2);
-    }
-}
-
-static void
-MarkerSymToks (void)
-{
-  MarkerSymTok ();
-  InitReduce (MARKERSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      MarkerSymTok ();
-      InitReduce (MARKERSYMTOKS2);
-    }
-}
-
-static void
-CommentSymToks (void)
-{
-  CommentSymTok ();
-  InitReduce (COMMENTSYMTOKS1);
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      CommentSymTok ();
-      InitReduce (COMMENTSYMTOKS2);
-    }
-}
-
-static void
-QuantifierSymTok (void)
-{
-  Token ();
-  InitReduce (QUANTIFIERSYMTOK1);
-}
-
-static void
-LogicalOpTok (void)
-{
-  Token ();
-  InitReduce (LOGICALOPTOK1);
-}
-
-static void
-EqOpTok (void)
-{
-  Token ();
-  InitReduce (LRC_EQOPTOK1);
-}
-
-static void
-EquationSymTok (void)
-{
- /* ### EquationSymTok (); ### */
-  Token ();
-  InitReduce (LRC_EQUATIONSYMTOK1);
-}
-
-static void
-EqSepSymTok (void)
-{
-  Token ();
-  InitReduce (LRC_EQSEPSYMTOK1);
-
-}
-
-static void
-SelectSymTok (void)
-{
-  Token ();
-  InitReduce (SELECTSYMTOK1);
-}
-
-static void
-OpenSymTok (void)
-{
-  Token ();
-  InitReduce (OPENSYMTOK1);
-}
-
-static void
-SepSymTok (void)
-{
-  Token ();
-  InitReduce (SEPSYMTOK1);
-}
-
-static void
-CloseSymTok (void)
-{
-  Token ();
-  InitReduce (CLOSESYMTOK1);
-}
-
-static void
-SimpleIdTok (void)
-{
-  Token ();
-  InitReduce (SIMPLEIDTOK1);
-}
-
-static void
-MapSymTok (void)
-{
-  Token ();
-  InitReduce (MAPSYMTOK1);
-}
-
-static void
-MarkerSymTok (void)
-{
-  Token ();
-  InitReduce (MARKERSYMTOK1);
-
-}
-
-static void
-CommentSymTok (void)
-{
-  Token ();
-  InitReduce (COMMENTSYMTOK1);
-}
-
-
-static void
-SynClass (void)
-{
-  if (ltoken_getRawText (nextToken) == ltoken_getText (synonymToken))
-    {
-      ltoken_free (nextToken);
-      nextToken = LSLScanNextToken ();
-
-      OldToken ();
-      NewToken ();
-
-      InitReduce (SYNCLASS1);
-    }
-  else
-    {
-      LocalUserError (nextToken, "expected synonym classification");
-    }
-
-}
-
-static void
-OldToken (void)
-{
-  Token ();
-  InitReduce (OLDTOKEN1);
-
-}
-
-static void
-NewToken (void)
-{
-  Token ();
-  InitReduce (NEWTOKEN1);
-
-}
-
-static void
-Token (void)
-{
-  if (ltoken_getCode (nextToken) == LST_EOL
-      || ltoken_getCode (nextToken) == LEOFTOKEN)
-    {
-      LocalUserError (nextToken, "unexpected end-of-line or end-of-file");
-    }
-  else
-    {
-      LSLGenShiftOnly (nextToken);
-      nextToken = LSLScanNextToken ();
-    }
-}
-
-/*
-** Init File Processing Routines, these routines use the shift-reduce sequence
-** produced by the init file parser and update the necessary tables for the
-** scanner.
-**
-** The same shift stack is used that LSL parser uses.  A different reduce
-** procedure is used because the init file grammar is different from the LSL
-** grammar.
-**
-*/
-
-static void
-InitReduce (LSLInitRuleCode rule)
-{
-  switch (rule)
-    {
-      case INITFILE1:
-      LTRACE ("INITFILE1");
-      break;
-
-    case INITLINES1:
-      LTRACE ("INITLINES1");
-      break;
-
-    case INITLINES2:
-      LTRACE ("INITLINES2");
-      break;
-
-    case INITLINES3:
-      LTRACE ("INITLINES3");
-      break;
-
-    case INITLINE1:
-      LTRACE ("INITLINE1");
-      break;
-
-    case INITLINE2:
-      LTRACE ("INITLINE2");
-      break;
-
-    case CLASSIFICATION1:
-      LTRACE ("CLASSIFICATION1");
-      break;
-
-    case CLASSIFICATION2:
-      LTRACE ("CLASSIFICATION2");
-      break;
-
-    case CLASSIFICATION3:
-      LTRACE ("CLASSIFICATION3");
-      break;
-
-    case CHARCLASS1:
-      LTRACE ("CHARCLASS1");
-      break;
-
-    case CHARCLASS2:
-      LTRACE ("CHARCLASS2");
-      break;
-
-    case CHARCLASS3:
-      LTRACE ("CHARCLASS3");
-      break;
-
-    case CHARCLASS4:
-      LTRACE ("CHARCLASS4");
-      break;
-
-    case CHARCLASS5:
-      LTRACE ("CHARCLASS5");
-      break;
-
-    case CHARCLASS6:
-      LTRACE ("CHARCLASS6");
-      break;
-
-    case LRC_ENDCOMMENT1:
-      LTRACE ("LRC_ENDCOMMENT1");
-      break;
-
-    case LRC_ENDCOMMENT2:
-      LTRACE ("LRC_ENDCOMMENT2");
-      break;
-
-    case IDCHARS1:
-      LTRACE ("IDCHARS1");
-      break;
-
-    case IDCHARS2:
-      LTRACE ("IDCHARS2");
-      break;
-
-    case OPCHARS1:
-      LTRACE ("OPCHARS1");
-      break;
-
-    case OPCHARS2:
-      LTRACE ("OPCHARS2");
-      break;
-
-    case LRC_EXTENSIONCHAR1:
-      LTRACE ("LRC_EXTENSIONCHAR1");
-      ProcessExtensionChar ();
-      break;
-
-    case SINGCHARS1:
-      LTRACE ("SINGCHARS1");
-      break;
-
-    case SINGCHARS2:
-      LTRACE ("SINGCHARS2");
-      break;
-
-    case WHITECHARS1:
-      LTRACE ("WHITECHARS1");
-      break;
-
-    case WHITECHARS2:
-      LTRACE ("WHITECHARS2");
-      break;
-
-    case LRC_ENDCOMMENTCHAR1:
-      LTRACE ("LRC_ENDCOMMENTCHAR1");
-      ProcessEndCommentChar ();
-      break;
-
-    case IDCHAR1:
-      LTRACE ("IDCHAR1");
-      ProcessSingleChar (IDCHAR);
-      break;
-
-    case OPCHAR1:
-      LTRACE ("OPCHAR1");
-      ProcessSingleChar (OPCHAR);
-      break;
-
-    case SINGCHAR1:
-      LTRACE ("SINGCHAR1");
-      ProcessSingleChar (SINGLECHAR);
-      break;
-
-    case WHITECHAR1:
-      LTRACE ("CHAR1");
-      ProcessSingleChar (WHITECHAR);
-      break;
-
-    case TOKENCLASS1:
-      LTRACE ("TOKENCLASS1");
-      break;
-
-    case TOKENCLASS2:
-      LTRACE ("TOKENCLASS2");
-      break;
-
-    case TOKENCLASS3:
-      LTRACE ("TOKENCLASS3");
-      break;
-
-    case TOKENCLASS4:
-      LTRACE ("TOKENCLASS4");
-      break;
-
-    case TOKENCLASS5:
-      LTRACE ("TOKENCLASS5");
-      break;
-
-    case TOKENCLASS6:
-      LTRACE ("TOKENCLASS6");
-      break;
-
-    case TOKENCLASS7:
-      LTRACE ("TOKENCLASS7");
-      break;
-
-    case TOKENCLASS8:
-      LTRACE ("TOKENCLASS8");
-      break;
-
-    case TOKENCLASS9:
-      LTRACE ("TOKENCLASS9");
-      break;
-
-    case TOKENCLASS10:
-      LTRACE ("TOKENCLASS10");
-      break;
-
-    case TOKENCLASS11:
-      LTRACE ("TOKENCLASS11");
-      break;
-
-    case TOKENCLASS12:
-      LTRACE ("TOKENCLASS12");
-      break;
-
-    case TOKENCLASS13:
-      LTRACE ("TOKENCLASS13");
-      break;
-
-    case QUANTIFIERSYMTOKS1:
-      LTRACE ("QUALIFERSYMTOKS1");
-      break;
-
-    case QUANTIFIERSYMTOKS2:
-      LTRACE ("QUANTIFIERSYMTOKS2");
-      break;
-
-    case LOGICALOPTOKS1:
-      LTRACE ("LOGICALOPTOKS1");
-      break;
-
-    case LOGICALOPTOKS2:
-      LTRACE ("LOGICALOPTOKS2");
-      break;
-
-    case LRC_EQOPTOKS1:
-      LTRACE ("LRC_EQOPTOKS1");
-      break;
-
-    case LRC_EQOPTOKS2:
-      LTRACE ("LRC_EQOPTOKS2");
-      break;
-
-    case LRC_EQUATIONSYMTOKS1:
-      LTRACE ("LRC_EQUATIONSYMTOKS1");
-      break;
-
-    case LRC_EQUATIONSYMTOKS2:
-      LTRACE ("LRC_EQUATIONSYMTOKS2");
-      break;
-
-    case LRC_EQSEPSYMTOKS1:
-      LTRACE ("LRC_EQSEPSYMTOKS1");
-      break;
-
-    case LRC_EQSEPSYMTOKS2:
-      LTRACE ("LRC_EQSEPSYMTOKS2");
-      break;
-
-    case SELECTSYMTOKS1:
-      LTRACE ("SELECTSYMTOKS1");
-      break;
-
-    case SELECTSYMTOKS2:
-      LTRACE ("SELECTSYMTOKS2");
-      break;
-
-    case OPENSYMTOKS1:
-      LTRACE ("OPENSYMTOKS1");
-      break;
-
-    case OPENSYMTOKS2:
-      LTRACE ("OPENSYMTOKS2");
-      break;
-
-    case SEPSYMTOKS1:
-      LTRACE ("SEPSYMTOKS1");
-      break;
-
-    case SEPSYMTOKS2:
-      LTRACE ("SEPSYMTOKS2");
-      break;
-
-    case CLOSESYMTOKS1:
-      LTRACE ("CLOSESYMTOKS1");
-      break;
-
-    case CLOSESYMTOKS2:
-      LTRACE ("CLOSESYMTOKS2");
-      break;
-
-    case SIMPLEIDTOKS1:
-      LTRACE ("SIMPLEIDTOKS1");
-      break;
-
-    case SIMPLEIDTOKS2:
-      LTRACE ("SIMPLEIDTOKS2");
-      break;
-
-    case MAPSYMTOKS1:
-      LTRACE ("MAPSYMTOKS1");
-      break;
-
-    case MAPSYMTOKS2:
-      LTRACE ("MAPSYMTOKS2");
-      break;
-
-    case MARKERSYMTOKS1:
-      LTRACE ("MARKERSYMTOKS1");
-      break;
-
-    case MARKERSYMTOKS2:
-      LTRACE ("MARKERSYMTOKS2");
-      break;
-
-    case COMMENTSYMTOKS1:
-      LTRACE ("COMMENTSYMTOKS1");
-      break;
-
-    case COMMENTSYMTOKS2:
-      LTRACE ("COMMENTSYMTOKS2");
-      break;
-
-    case QUANTIFIERSYMTOK1:
-      LTRACE ("QUANTIFERSYMTOK1");
-      ProcessToken (LST_QUANTIFIERSYM);
-      break;
-
-    case LOGICALOPTOK1:
-      LTRACE ("LOGICALOPTOK1");
-      ProcessToken (LST_LOGICALOP);
-      break;
-
-    case LRC_EQOPTOK1:
-      LTRACE ("LRC_EQOPTOK1");
-      ProcessToken (LST_EQOP);
-      break;
-
-    case LRC_EQUATIONSYMTOK1:
-      LTRACE ("LRC_EQUATIONSYMTOK1");
-      ProcessToken (LST_EQUATIONSYM);
-      break;
-
-    case LRC_EQSEPSYMTOK1:
-      LTRACE ("LRC_EQSEPSYMTOK1");
-      ProcessToken (LST_EQSEPSYM);
-      break;
-
-    case SELECTSYMTOK1:
-      LTRACE ("SELECTSYMTOK1");
-      ProcessToken (LST_SELECTSYM);
-      break;
-
-    case OPENSYMTOK1:
-      LTRACE ("OPENSYMTOK1");
-      ProcessToken (LST_OPENSYM);
-      break;
-
-    case SEPSYMTOK1:
-      LTRACE ("SEPSYMTOK1");
-      ProcessToken (LST_SEPSYM);
-      break;
-
-    case CLOSESYMTOK1:
-      LTRACE ("CLOSESYMTOK1");
-      ProcessToken (LST_CLOSESYM);
-      break;
-
-    case SIMPLEIDTOK1:
-      LTRACE ("SIMPLEIDTOK1");
-      ProcessToken (LST_SIMPLEID);
-      break;
-
-    case MAPSYMTOK1:
-      LTRACE ("MAPSYMTOK1");
-      ProcessToken (LST_MAPSYM);
-      break;
-
-    case MARKERSYMTOK1:
-      LTRACE ("MARKERSYMTOK1");
-      ProcessToken (LST_MARKERSYM);
-      break;
-
-    case COMMENTSYMTOK1:
-      LTRACE ("COMMENTSYMTOK1");
-      ProcessToken (LST_COMMENTSYM);
-      break;
-
-    case SYNCLASS1:
-      LTRACE ("SYNCLASS1");
-      ProcessSynonym ();
-      break;
-
-    case OLDTOKEN1:
-      LTRACE ("OLDTOKEN1");
-      break;
-
-    case NEWTOKEN1:
-      LTRACE ("NEWTOKEN1");
-      break;
-
-    default:
-      llcontbuglit ("InitReduce: bad switch");
-      break;
-
-    }				/* end switch	    */
-}				/* end InitReduce () */
-
-
-
-/* Reset the first character of the predefined extensionChar keywords when  */
-/* the extensionChar changes.  e.g. "extensionChar @" changes "forall" to   */
-/* "@forall".								    */
-
-static void
-UpdateXCharKeywords (charCode xCharCode)
-{
-  char xChar = (char) xCharCode;
-  char *str;
-
-  str = ltoken_getTextChars (ltoken_forall);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_and);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_or);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_implies);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_eq);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_neq);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_equals);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_eqsep);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_select);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_open);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_sep);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_close);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_id);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_arrow);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_marker);
-  *str = xChar;
-
-  str = ltoken_getTextChars (ltoken_comment);
-  *str = xChar;
-
-}
-
-/* Different from ProcessCharClass because only allow one extension	    */
-/* character. Therefore, the present extension character must be set to a   */
-/* singleChar.								    */
-
-static void
-ProcessExtensionChar (void)
-{
-  ltoken stackToken = LSLGenTopPopShiftStack ();
-  char firstChar = cstring_firstChar (ltoken_unparse (stackToken));
-
-  if (!defineSingleChar[(int)firstChar]
-      && lscanCharClass (firstChar) == SINGLECHAR)
-    {
-     /* Is a single character that has not been defined before.	    */
-     /* Can only have one extension char.  Release old one. */
-      lsetCharClass (firstChar, CHC_EXTENSION);
-      
-      /* this is a (bogus) type bug! caught by lclint */
-      /* lsetCharClass (currentExtensionChar, SINGLECHAR); */
-
-      lsetCharClass ((char) currentExtensionChar, SINGLECHAR);
-
-      currentExtensionChar = (charCode) firstChar;
-      UpdateXCharKeywords (currentExtensionChar);
-    }
-  else
-    {
-     /* Already redefined.  Don't allow to be redefined. */
-      LocalUserError (stackToken, "character is already defined, cannot redefine");
-    }
-  ltoken_free (stackToken);
-}
-
-/* Different from ProcessSingleChar because allow any characters to be	    */
-/* endCommentChar and also set a different part of the scanner structure.   */
-
-static void
-ProcessEndCommentChar (void)
-{
-  ltoken stackToken = LSLGenTopPopShiftStack ();
-  char firstChar = cstring_firstChar (ltoken_unparse (stackToken));
-
-  if (LSLIsEndComment (firstChar))
-    {
-      LocalUserError (stackToken,
-		    "already defined as a endCommentChar, cannot redefine");
-    }
-  else
-    {
-      lsetEndCommentChar (firstChar, TRUE);
-    }
-  ltoken_free (stackToken);
-}
-
-static void
-ProcessSingleChar (charCode code)
-{
-  ltoken stackToken = LSLGenTopPopShiftStack ();
-  char firstChar = cstring_firstChar (ltoken_unparse (stackToken));
-
-  if (!defineSingleChar[(int)firstChar]
-      && lscanCharClass (firstChar) == SINGLECHAR)
-    {
-      /* Is a single character that has not been defined before.	    */
-      /* It's OK to redefine once. */
-      lsetCharClass (firstChar, code);
-      /* OK to mark as a defined singleChar even if not.  Only check	    */
-      /* defineSingleChar[] if defining a singleChar.			    */
-      defineSingleChar[(int)firstChar] = TRUE;
-    }
-  else
-    {
-      LocalUserError (stackToken, "character is already defined, cannot redefine");
-    }
-  ltoken_free (stackToken);
-}
-
-static void
-ProcessToken (ltokenCode code)
-{
-  ltoken stackToken, temp;
-  lsymbol sym;
-
-  stackToken = LSLGenTopPopShiftStack ();
-  sym = ltoken_getText (stackToken);
-
-  if (LSLIsSyn (sym))
-    {
-      LocalUserError (stackToken,
-		      "already defined as a synonym, cannot redefine");
-    }
-
-  /* Get the token from the token table, so can check if the token    */
-  /* was updated by a previous token.				    */
-  temp = LSLGetToken (sym);
-  
-  if (ltoken_isStateDefined (temp))
-    {
-      if ((code == LST_OPENSYM && sym == lsymbol_fromChars ("[")) ||
-	  (code == LST_CLOSESYM && sym == lsymbol_fromChars ("]")))
-	{
-	  /* ignore "openSym [" and "closeSym ]" TokenClass */
-	  ltoken_free (stackToken);
-	  return;
-	}
-      else
-	{
-	  LocalUserError (stackToken, "already defined, cannot redefine");
-	  PrintToken (temp);
-	}
-    }
-  
-  LSLUpdateToken (code, ltoken_getText (stackToken), TRUE);
-  ltoken_free (stackToken);
-}
-
-
-static void
-ProcessSynonym (void)
-{
-  ltoken newtok;
-  ltoken oldtok;
-
-  newtok = LSLGenTopPopShiftStack ();
-  oldtok = LSLGenTopPopShiftStack ();
-
-  if (ltoken_wasSyn (newtok))
-    {
-     /* The token has a synonym.  This means that the synonym was in the */
-     /* init file, so complain about redefining as a synonym again	    */
-      LocalUserError (newtok, "newtok already is a synonym, cannot redefine");
-    }
-
-  if (ltoken_hasSyn (newtok))
-    {
-      /*
-      ** newtok already has a synonym defined for it.  Do not allow	    
-      ** synonyms to be chained.					    
-      */
-
-      LocalUserError (newtok,
-		      "newtok already has a synonym, cannot chain synonyms");
-    }
-
-  if (ltoken_isStateDefined (newtok))
-    {
-      LocalUserError (newtok, "newtok already defined, cannot redefine");
-    }
-
-  LSLAddSyn (ltoken_getText (newtok), ltoken_getText (oldtok));
-  ltoken_free (oldtok);
-  ltoken_free (newtok);
-}
-
-
-/*
- * Utilities, in alphabetical order
- */
-
-static void
-LocalUserError (ltoken t, /*@temp@*/ char *msg)
-{
-  lldiagmsg (message ("%s %s in the LSL init file:", 
-		      ltoken_unparse (t), cstring_fromChars (msg)));
-
-  ltoken_free (nextToken);
-  nextToken = LSLScanNextToken ();	       
-
-  while (ltoken_getCode (nextToken) != LST_EOL)
-    {
-      ltoken_free (nextToken);
-      nextToken = LSLScanNextToken ();
-    }
-}
-
-/*
-**  Required initialization and cleanup routines
-*/
-
-static /*@exposed@*/ ltoken insertSimpleToken (char *text) 
-  /*@modifies internalState@*/
-{
-  return (LSLInsertToken (LST_SIMPLEID, lsymbol_fromChars (text), 0, FALSE));
-}
-
-void
-LSLProcessInitFileInit (void)
-{
-  int i;
-
-  LSLGenInit (TRUE);		/* parsing LSLinit not LCLinit */
-
-  /*
-  ** Insert the init file keywords into the token table as undefined	    
-  ** SIMPLEIDs.  They are defined as simpleIds since they must be treated 
-  ** that way if they do not appear as the first token on a line, and	    
-  ** they must be treated that way for the actual LSL parsing. Save the   
-  ** tokens so can recognize as init file keywords when necessary.	 
-  */
-
-  endCommentCharToken = insertSimpleToken ("endCommentChar");
-  idCharToken = insertSimpleToken ("idChar");			     
-  opCharToken = insertSimpleToken ("opChar");			     
-  extensionCharToken = insertSimpleToken ("extensionChar");    
-  singleCharToken = insertSimpleToken ("singleChar");	
-  whiteCharToken = insertSimpleToken ("whiteChar");
-
-  quantifierSymToken = insertSimpleToken ("quantifierSym");
-  logicalOpToken = insertSimpleToken ("logicalOp");
-  eqOpToken = insertSimpleToken ("eqOp");			   
-  equationSymToken = insertSimpleToken ("equationSym");
-  eqSepSymToken = insertSimpleToken ("eqSepSym");			       
-  selectSymToken = insertSimpleToken ("selectSym");
-  openSymToken = insertSimpleToken ("openSym");			      
-  sepSymToken = insertSimpleToken ("sepSym");			     
-  closeSymToken = insertSimpleToken ("closeSym");			       
-  simpleIdToken = insertSimpleToken ("simpleId");			       
-  mapSymToken = insertSimpleToken ("mapSym");			     
-  markerSymToken = insertSimpleToken ("markerSym");
-  commentSymToken = insertSimpleToken ("commentSym"); 
-  synonymToken = insertSimpleToken ("synonym");			      
-
-  for (i = 0; i <= LASTCHAR; i++)
-    {
-      defineSingleChar[i] = FALSE;
-    }
-  
-  /*
-  ** Record the current extension character so can redefine back to	    
-  ** singleChar if a new extension character is redefined.		    
-  */
-
-  currentExtensionChar = (charCode) CHAREXTENDER;
-
-  LSLReportEolTokens (TRUE);
-  ltoken_free (nextToken);
-  nextToken = LSLScanNextToken ();	       
-}
-
-
-
-
-
-
-
-
diff --git a/src/lslparse.c b/src/lslparse.c
deleted file mode 100644
index 01ddf6b..0000000
--- a/src/lslparse.c
+++ /dev/null
@@ -1,512 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** lslparse.c
-**
-** Module for calling LSL checker.
-**
-**  AUTHOR:
-**	Yang Meng Tan,
-**         Massachusetts Institute of Technology
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "lclscan.h"
-# include "signature.h"
-# include "signature2.h"
-# include "scan.h"
-# include "scanline.h"
-# include "syntable.h"
-# include "tokentable.h"
-# include "lslinit.h"
-# include "lslparse.h"
-# include "llmain.h"
-
-/*@+ignorequals@*/
-
-/*@dependent@*/ /*@null@*/ lslOp g_importedlslOp = NULL;
-bool g_lslParsingTraits = FALSE;
-
-static void invokeLSL (char *p_infile, char *p_outfile, bool p_deletep);
-
-int
-parseSignatures (cstring infile)
-{
-  char *cinfile = cstring_toCharsSafe (infile);
-  tsource *sourceFile;
-  ltoken *id = (ltoken *) dmalloc (sizeof (*id));
-  int status = 0;
-
-  /* parse traits */
-  *id = LSLInsertToken (LST_SIMPLEID, lsymbol_fromChars (cinfile), 0, FALSE);
-  ltoken_setFileName (*id, cinfile);
-  ltoken_setLine (*id, 0);
-  ltoken_setCol (*id, 0);
-
-  sourceFile = tsource_create (cinfile, "", FALSE);
-
-  if (!tsource_getPath (cstring_toCharsSafe (context_getLarchPath ()), sourceFile))
-    {
-      lclplainerror 
-	(message ("LSL signature parsing: can't find file %s containing trait",
-		  cstring_fromChars (tsource_fileName (sourceFile))));
-      status = 1;
-
-      sfree (id);
-      tsource_free (sourceFile);
-      return status;
-    }
-
-  if (!tsource_open (sourceFile))
-    {
-      lclplainerror 
-	(cstring_makeLiteral ("LSL parsing: can't open file containing trait"));
-      status = 2;
-      sfree (id);
-      tsource_free (sourceFile);
-
-      return status;
-    }
-
-  lsldebug = 0;
-  g_lslParsingTraits = TRUE;
-  LSLScanReset (sourceFile);
-  LSLReportEolTokens (FALSE);
-
-  status = lslparse ();
-
-  /* symtable_dump (symtab, stdout, TRUE); */
-  g_lslParsingTraits = FALSE;
-
-  (void) tsource_close (sourceFile);
-  tsource_free (sourceFile);
-
-  sfree (id);
-
-  
-  return status;
-}
-
-/*@only@*/ lslOp
-parseOpLine (char *fname, char *line)
-{
-  tsource *sourceFile;
-  bool status;
-
-  sourceFile = tsource_fromString (fname, line);
-  
-  if (check (tsource_open (sourceFile)))
-    {
-      LSLScanReset (sourceFile);
-      LSLReportEolTokens (FALSE); /* 0 by default, lslParsingTraits = 0; */
-      
-      /*
-      ** lsl parsing and importing .lcs files are expected to be mutually
-      ** exclusive. 
-      **
-      ** lslparse sets importedlslOp
-      */
-      
-      status = (lslparse () != 0);
-      
-      if (status)
-	{
-	  lclplainfatalerror (message ("Error in parsing line: %s", 
-				       cstring_fromChars (line)));
-	}
-      
-      (void) tsource_close (sourceFile);
-    }
-
-  tsource_free (sourceFile);
-  
-  llassert (g_importedlslOp != NULL);
-  return (lslOp_copy (g_importedlslOp));
-}
-
-lsymbol
-processTraitSortId (lsymbol sortid)
-{
-  lsymbol out = lsymbol_sortFromType (g_symtab, sortid);
-  if (out == sortid)
-    { /* may be a new sort */
-      (void) sort_fromLsymbol (sortid);
-    }
-  return out;
-}
-
-/* formerly from check.c module */
-
-static /*@only@*/ cstring
-printTypeName2 (typeNameNode n)
-{
-  cstring s = cstring_undefined;
-  sortNode sn;
-  lsymbol lclSort;
-  ltoken err;
-
-  if (n != (typeNameNode) 0)
-    {
-      if (n->isTypeName)
-	{
-	  /* does not process opForm renaming, pass on to LSL
-	     and hope that it works for now. */
-	  typeNamePack p = n->typename;
-
-	  llassert (p != NULL);
-
-	  /* get the LCL type, assume LCL type has already been mentioned. */
-	  lclSort = lclTypeSpecNode2sort (p->type);
-	  lclSort = sort_getUnderlying (lclSort);
-	  /* lclsource = LCLSLScanSource (); */
-	  if (!sort_isValidSort (lclSort))
-	    {
-	      err = lclTypeSpecNode_errorToken (p->type);
-	      /* errorShowPoint (tsource_thisLine (lclsource), ltoken_getCol (err)); */
-	      lclerror (err, message ("Unrecognized type in uses: %q", 
-				      typeNameNode_unparse (n)));
-	    }
-	  else
-	    {
-	      /* 
-              ** Below is necessary because this is one place where an LCL mutable
-	      ** type name is mapped directly into its value sort, not obj sort.
-	      ** Allows us to support only one qualifying "obj", rather
-	      ** than "val" as well. 
-	      */
-	      
-	      lclSort = typeExpr2ptrSort (lclSort, p->abst);
-	      lclSort = sort_makeVal (lclSort);
-	      
-	      /*
-	      ** Check that lclSort is not a HOFSort ...
-	      ** Propagation of HOFSort should stop here.  
-	      */
-
-	      if (sort_isHOFSortKind (lclSort))
-		{
-		  err = lclTypeSpecNode_errorToken (p->type);
-		  
-		  lclfatalerror
-		    (err, 
-		     cstring_makeLiteral 
-		     ("LCL uses cannot handle higher-order types"));
-		}
-	      if (p->isObj)
-		lclSort = sort_makeObj (lclSort);
-	      
-	      /*	if (!p->isObj) {
-			lclSort = sort_makeVal (lclSort);
-			} */
-	      
-	      sn = sort_lookup (lclSort);
-	      s = cstring_copy (cstring_fromChars (lsymbol_toChars (sn.name)));
-	      /* s = string_paste (s, AbstDeclaratorNode_unparse (p->abst)); */
-	    }
-	}
-      else
-	{
-	  /* s = OpFormNode_unparse (n->opform); */
-	  if (n->opform != 0)
-	    {
-	      lclfatalerror 
-		(n->opform->tok,
-		 cstring_makeLiteral ("Attempt to rename operator with uses: "
-				     "use LSL includes renaming facility"));
-	    }
-	  else
-	    {		
-	      BADEXIT;
-	    }
-	}
-    }
-  return s;
-}
-
-static /*@only@*/ cstring
-replaceNode_unparseAlt (replaceNode x)
-{
-  cstring s = cstring_undefined;
-
-  if (x != (replaceNode) 0)
-    {
-      s = printTypeName2 (x->typename);
-      s = cstring_concatChars (s, " for ");
-
-      if (x->isCType)
-	{
-	  s = cstring_concatFree1 (s, ltoken_unparse (x->content.ctype));
-	}
-      else
-	{
-	  s = cstring_concatFree (s, nameNode_unparse (x->content.renamesortname.name));
-	  s = cstring_concatFree (s, 
-				  sigNode_unparse (x->content.renamesortname.signature));
-	}
-    }
-
-  return s;
-}
-
-static /*@only@*/ cstring
-replaceNodeList_unparseAlt (replaceNodeList x)
-{
-  cstring s = cstring_undefined;
-  bool first = TRUE;
-
-  replaceNodeList_elements (x, i)
-    {
-      if (first)
-	{
-	  s = replaceNode_unparseAlt (i);
-	  first = FALSE;
-	}
-      else
-	{
-	  s = message ("%q, %q", s, replaceNode_unparseAlt (i));
-	}
-    } end_replaceNodeList_elements;
-
-  return s;
-}
-
-static /*@only@*/ cstring
-printNameList2 (typeNameNodeList x)
-{
-  /* printing a list of typeNameNode's, not nameNode's */
-  bool first = TRUE;
-  cstring s = cstring_undefined;
-
-  typeNameNodeList_elements (x, i)
-  {
-    if (first)
-      {
-	s = printTypeName2 (i);
-	first = FALSE;
-      }
-    else
-      {
-	s = message ("%q, %q", s, printTypeName2 (i));
-      }
-    } end_typeNameNodeList_elements; 
-
-  return s;
-}
-
-static /*@only@*/ cstring
-printRenamingNode2 (renamingNode x)
-{
-  cstring s = cstring_undefined;
-
-  if (x != (renamingNode) 0)
-    {
-      if (x->is_replace)
-	{
-	  replaceNodeList r = x->content.replace;
-	  s = replaceNodeList_unparseAlt (r);
-	}
-      else
-	{
-	  nameAndReplaceNode n = x->content.name;
-	  bool printComma = TRUE;
-	  if (typeNameNodeList_size (n->namelist) == 0)
-	    {
-	      printComma = FALSE;
-	    }
-	  s = printNameList2 (n->namelist);
-	  if (printComma)
-	    if (replaceNodeList_isDefined (n->replacelist) &&
-		replaceNodeList_size (n->replacelist) != 0)
-	      {
-		s = cstring_appendChar (s, ',');
-		s = cstring_appendChar (s, ' ');
-	      }
-	  s = cstring_concatFree (s, replaceNodeList_unparseAlt (n->replacelist));
-	}
-    }
-  return s;
-}
-
-static /*@only@*/ cstring
-printTraitRefList2 (traitRefNodeList x)
-{
-  cstring s = cstring_undefined;
-
-  traitRefNodeList_elements (x, i)
-  {
-    s = message ("%qincludes (%q)", s, printRawLeaves2 (i->traitid));
-
-    if (i->rename != 0)
-      {
-	s = message ("%q(%q)", s, printRenamingNode2 (i->rename));
-      }
-    s = message ("%q\n", s);
-  } end_traitRefNodeList_elements;
-
-  return s;
-}
-
-void
-callLSL (/*@unused@*/ char *specfile, /*@only@*/ char *text)
-{
-  /* specfile is the name of the LCL file that contains "uses"
-     Create an intermediate file named
-     specfile_..
-     put text in the file, run lsl on it and direct
-     output to specfile_..
-     specfile can be a full pathname.
-     Note: LSL does not support traitnames that are pathnames, only
-     symbols. 
-     */
-
-  char *infile, *outfile;
-  char *tmp1, *tmp2;
-  FILE *inptr;
-
-  infile = cstring_toCharsSafe (fileName (fileTable_addltemp (context_fileTable ())));
-  
-  inptr = fopen (infile, "w");
-  
-  if (inptr == NULL)
-    {
-      /* fopen fails */
-      llfatalerror (message ("Unable to write intermediate file: %s", 
-			     cstring_fromChars (infile)));
-    }
-  
-  tmp1 = removePath (infile);
-  tmp2 = removeAnyExtension (tmp1);
-
-  fprintf (inptr, "%s : trait\n", tmp2);
-  sfree (tmp1);
-  sfree (tmp2);
-
-  fprintf (inptr, "%s", text);
-  check (fclose (inptr) == 0);
-
-  /* the default is to delete the input file */
-
-  outfile = cstring_toCharsSafe (fileName (fileTable_addltemp (context_fileTable ())));
-  invokeLSL (infile, outfile, context_getFlag (FLG_KEEP));
-  sfree (text);
-}
-
-static void invokeLSL (char *infile, char *outfile, bool deletep)
-{
-  /* run lsl on infile and leave result in outfile */
-  FILE *outptr;
-  filestatus status;
-  int callstatus;
-  cstring call;
-  char *returnPath = NULL;
-  
-  /*
-  ** Ensures that outfile can be written into, should find a better
-  ** way to do this. 
-  */
-  
-  outptr = fopen (outfile, "w");
-
-  if (outptr == NULL)
-    {			
-      /* fopen fails */
-      llfatalerror (message ("Unable to write intermediate file: %s", 
-			     cstring_fromChars (outfile)));
-    }
-  
-  check (fclose (outptr) == 0);
-
-  /* set call to the right command */
-  status = osd_getExePath ("PATH", "lsl", &returnPath);
-    
-
-  if (status == OSD_FILEFOUND)
-    {
-      call = message ("%s -syms %s > %s", cstring_fromChars (returnPath), 
-		      cstring_fromChars (infile), cstring_fromChars (outfile));
-      
-      /* before calling, make sure old file is removed */
-      (void) osd_unlink (outfile);
-
-      callstatus = osd_system (cstring_toCharsSafe (call));
-      
-      cstring_free (call);
-
-      if (callstatus != CALL_SUCCESS)
-	{
-	  /*
-	  ** lsl errors: call lsl again without -syms, sending output to stdout
-          */
-	  cstring syscal = message ("%s %s", cstring_fromChars (returnPath), 
-				    cstring_fromChars (infile));
-
-	  (void) osd_system (cstring_toCharsSafe (syscal));
-	  cstring_free (syscal);
-
-	  llfatalerror (cstring_makeLiteral ("LSL trait used contains errors.")); 
-	}
-      else
-	{			/* ok, go ahead */
-	 /* Now parse the LSL output and store info in symbol table */
-	  callstatus = parseSignatures (cstring_fromChars (outfile));
-
-	  if (callstatus == 0)
-	    {	
-	      /* all went well */
-	      if (!context_getFlag (FLG_KEEP))
-		{
-		  /* delete temporary files */
-		  if (deletep)
-		    {
-		      (void) osd_unlink (infile);
-		    }
-		  
-		  (void) osd_unlink (outfile);
-		}
-	    }
-	}
-    }
-  else if (status == OSD_FILENOTFOUND)
-    {
-      llfatalerror 
-	(cstring_makeLiteral ("Cannot find LSL checker: check your command search path."));
-    }
-  else				/* must be (status == OSD_PATHTOOLONG) */
-    {
-      lclfatalbug ("invokeLSL: lsl plus directory from search path is too long");
-    }
-}
-
-/* callLSL ("MySet", "includes Set (CC for C, EE for E)");  */
-
-void
-readlsignatures (interfaceNode n)
-{
-  /* assume n->kind = usesKIND */
-  char *content;
-  
-  content = cstring_toCharsSafe (printTraitRefList2 (n->content.uses));
-  callLSL (cstring_toCharsSafe (g_currentSpec), content);
-}
diff --git a/src/lsymbol.c b/src/lsymbol.c
deleted file mode 100644
index 9b3654a..0000000
--- a/src/lsymbol.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** lsymbol.c
-**
-** String manager
-**
-**	This module implements an abstraction for efficiently managing
-**      string comparisons.  It alloctes and manages a string context,
-**      which consists of three major data structures:
-**       - a StringEntry table
-**       - a character-string table
-**       - a hash table
-**
-**      A StringEntry table is made of of StringEntries. StringEntries
-**      are linked in hash-chains to support fast lookup. Every
-**      allocated StringEntry corresponds to a unique character-string
-**	in the character-string table. StringEntries can be referenced
-**      via Symbol values.
-**
-**	A character-string table is composed of character-strings. A
-**      character-string is a variable length byte array that is always
-**	null-terminated ('\0').
-**
-**	A hash table manages the start of each hash-list of StringEntries.
-**	StringEntries are entered into the hash-list by hashing on its
-**      character-string representation.
-**
-**	This module provides routines for retrieving a unique Symbol for a
-**	given character-string, and returning the character-string given its
-**	corresponding Symbol. An item is allocated in both tables whenever a
-**	new character-string is encountered, otherwise the Symbol for the
-**	character-string is found and returned.
-**
-**  AUTHORS:
-**
-**      Shota Aki
-**
-**  MODIFICATION HISTORY:
-**
-**	{0} Aki      at Digital -- 89.08.07 -- original
-**	{1} Aki      at Digital -- 89.11.13 -- context switchable
-**	{2} Aki      at Digital -- 89.11.28 -- removed use of TABLES interface
-**	{3} Aki      at Digital -- 89.11.29 -- moved to RC
-**	{4} Aki	     at Digital -- 90.04.10 -- support primary-context
-**	{5} McKeeman at Digital -- 90.05.08 -- C to Larch SL
-**	{6} Wild     at Digital	-- 91.06.26 -- Update copyright notice.
-**	{n} Who	     at Where   -- yy.mm.dd -- what
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-/*@+ignorequals@*/
-
-/*@constant int NULLFACTOR; @*/
-# define NULLFACTOR 1
-
-typedef Handle CharIndex;     
-
-typedef struct
-{
-  lsymbol HashNext;	
-  CharIndex i;			
-} StringEntry;
-
-static void AllocCharSpace (unsigned p_newSize) /*@modifies internalState@*/ ;
-static CharIndex AllocChar (/*@unique@*/ char *p_name) /*@modifies internalState@*/ ;
-static void AllocEntrySpace (unsigned p_newSize) /*@modifies internalState@*/ ;
-static lsymbol AllocEntry (char *p_name, long unsigned p_hashValue)
-   /*@modifies internalState@*/ ;
-
-static /*@only@*/ /*@null@*/ lsymbol *hashArray = NULL; 
-
-static long unsigned MaxChar;	
-static CharIndex FreeChar;	
-static /*@only@*/ /*@null@*/ char *CharString;
-
-static long unsigned MaxEntry;	
-static lsymbol FreeEntry;	
-static /*@only@*/ /*@null@*/ StringEntry *Entry;	
-
-lsymbol
-lsymbol_fromString (cstring s)
-{
-  if (cstring_isUndefined (s))
-    {
-      return lsymbol_undefined;
-    }
-  else
-    {
-      return (lsymbol_fromChars (cstring_toCharsSafe (s)));
-    }
-}
-
-lsymbol
-lsymbol_fromChars (/*@temp@*/ char *name)
-{
-  lsymbol ss;
-  long unsigned hashValue;	
-  unsigned h = 0;            
-  char *p = name;
-
-  while (*p != '\0')
-    { 
-      h = (h << 1) + (unsigned) (*p++); 
-    } 
-  
-  hashValue = h & HASHMASK;         
-
-  if (hashArray == NULL) /* evs - was MaxIndex == 0 */
-    {
-      /* nothing initialized */
-      ss = AllocEntry (name, hashValue);	
-    }
-  else
-    {
-      ss = hashArray[hashValue]; /* start of hash chain */
-
-      if (ss == lsymbol_undefined)
-	{
-	  /* hash not initialized */
-	  ss = AllocEntry (name, hashValue);
-	}
-      else
-	{
-	 /*
-          * Traverse hash-chain. Loop terminates when
-          * a match is found or end of chain is encountered.
-          */
-
-	  llassert (Entry != NULL);
-	  llassert (CharString != NULL);
-
-	  while (strcmp (&CharString[Entry[ss].i], name) != 0)
-	    {
-	      if (lsymbol_undefined == (ss = Entry[ss].HashNext))
-		{
-		  ss = AllocEntry (name, hashValue);
-		  break;
-		}
-	    }
-	}
-    }
-
-  return ss;
-}
-
-cstring lsymbol_toString (lsymbol ss)
-{
-  return (cstring_fromChars (lsymbol_toChars (ss)));
-}
-
-char *
-lsymbol_toCharsSafe (lsymbol ss)
-{
-  char *ret = lsymbol_toChars (ss);
-
-  if (ret == NULL) 
-    {
-      ret = mstring_create (0);
-    } 
-
-  return ret;
-}
-
-char *lsymbol_toChars (lsymbol ss)
-{
-  if (lsymbol_isDefined (ss))
-    {
-      if (ss >= FreeEntry)
-	{
-	  llcontbug (message ("lsymbol_toChars: invalid lsymbol: %d", ss));
-	  return NULL;
-	}
-      
-      llassert (Entry != NULL);
-      llassert (CharString != NULL);
-      
-      return &CharString[Entry[ss].i];
-    }
-  else
-    {
-      return NULL;
-    }
-}
-
-static void
-AllocCharSpace (unsigned newSize)
-{
-  llassert (newSize > MaxChar);
-  
-  CharString = (char *) drealloc ((void *) CharString, newSize * sizeof (*CharString));
-  MaxChar = newSize;
-/*@-compdef@*/
-} /*@=compdef@*/
-
-static CharIndex
-AllocChar (/*@unique@*/ char *name)
-{
-  int namelength;
-  CharIndex retVal;
-  long unsigned size;
-  CharIndex unused;
-
-  namelength = size_toInt (strlen (name));
-  unused = FreeChar;
-  size = MaxChar;
-
-  if ((unused + namelength + NULLFACTOR) > size)
-    {
-      if (size == 0)
-	size = INITCHARSTRING;
-      else
-	size = (unsigned) (DELTACHARSTRING * size);
-
-      AllocCharSpace (size);
-    }
-
-  llassert (CharString != NULL);
-
-  retVal = unused;		
-  strcpy (&CharString[unused], name);	
-  unused += namelength;
-  CharString[unused] = '\0';	
-  unused += 1;
-
-  FreeChar = unused;
-  return retVal;
-}
-
-static void
-AllocEntrySpace (unsigned newSize)
-{
-  llassert (newSize > MaxEntry);
-
-  /* Casts mess up checking here. */
-  /*@-mustfree@*/
-  Entry = (StringEntry *) drealloc ((void *) Entry, newSize * sizeof (*Entry));
-  /*@=mustfree@*/
-
-  if (MaxEntry == 0) MaxEntry = 1;
-
-  FreeEntry = MaxEntry;
-  MaxEntry = newSize;
-/*@-compdef@*/
-} /*@=compdef@*/
-
-static lsymbol AllocEntry (char *name, long unsigned hashValue)
-{
-  lsymbol retVal;
-  long unsigned size;
-
-  size = MaxEntry;
-
-  if ((retVal = FreeEntry) == size)
-    {
-      if (size == 0)
-	{
-	  size = INITSTRINGENTRY;
-	}
-      else
-	{
-	  size = (unsigned) (DELTASTRINGENTRY * size);
-	}
-
-      AllocEntrySpace (size);
-      retVal = FreeEntry;
-    }
-  
-  FreeEntry = retVal + 1;
-
-  llassert (hashArray != NULL);
-  llassert (Entry != NULL);
-  
-  Entry[retVal].HashNext = hashArray[hashValue];
-  hashArray[hashValue] = retVal;
-  Entry[retVal].i = AllocChar (name);
-  
-  return retVal;
-}
-
-void
-lsymbol_initMod (void)
-   /*@globals undef CharString, undef Entry; @*/
-{
-  int i;
-
-  if (hashArray != NULL)
-    {
-      sfree (hashArray); 
-    }
-  
-  hashArray = (lsymbol *) dmalloc (HASHSIZE * sizeof (*hashArray));
-
-  for (i = 0; i < HASHSIZE; i++)
-    {
-      hashArray[i] = lsymbol_undefined;
-    } 
-
-  MaxChar = 0;
-  MaxEntry = 0;
-
-  FreeChar = 0;
-  FreeEntry = 0; 
-
-  CharString = (char *) 0;
-  Entry = (StringEntry *) 0;
-/*@-compdef@*/ 
-} 
-/*@=compdef@*/ 
-
-void
-lsymbol_destroyMod (void)
-   /*@globals killed Entry, killed CharString, killed hashArray@*/
-{
-   sfree (Entry);      
-   sfree (CharString); 
-   sfree (hashArray); 
-}
-
-void
-lsymbol_printStats (void)
-{
-  /* only for debugging */
-  printf ("Number of lsymbols generated = %d\n", (int) FreeEntry);
-}
-
-/*
-** note lsymbol_setbool, etc. defined in abstract.c
-*/
-
-
-
-
-
-
-
-
diff --git a/src/lsymbolList.c b/src/lsymbolList.c
deleted file mode 100644
index fee5c1a..0000000
--- a/src/lsymbolList.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** lsymbolList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ lsymbolList
-lsymbolList_new ()
-{
-  lsymbolList s = (lsymbolList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-
-  s->nspace = lsymbolListBASESIZE;
-  s->elements = (lsymbol *) dmalloc (sizeof (*s->elements) * lsymbolListBASESIZE);
-
-  return (s);
-}
-
-static void
-lsymbolList_grow (lsymbolList s)
-{
-  int i;
-  lsymbol *newelements;
-
-  s->nspace += lsymbolListBASESIZE;
-  
-   newelements = (lsymbol *) dmalloc (sizeof (*newelements) * (s->nelements + s->nspace));
-
-  if (newelements == (lsymbol *) 0)
-    {
-      llfatalerror (cstring_makeLiteral ("lsymbolList_grow: out of memory!"));
-    }
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-void 
-lsymbolList_addh (lsymbolList s, lsymbol el)
-{
-  if (s->nspace <= 0)
-    lsymbolList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-}
-
-void
-lsymbolList_free (lsymbolList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-     /*      lsymbol_free (s->elements[i]); */
-    }
-
-  sfree (s->elements);	     
-  sfree (s);
-}
-
diff --git a/src/lsymbolSet.c b/src/lsymbolSet.c
deleted file mode 100644
index d40a6fd..0000000
--- a/src/lsymbolSet.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** lsymbolSet.c
-**
-** based on set_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
- 
-lsymbolSet lsymbolSet_new ()
-{
-  lsymbolSet s = (lsymbolSet) dmalloc (sizeof (*s));
-
-  s->entries = 0;
-  s->nspace = lsymbolSetBASESIZE;
-  s->elements = (lsymbol *) dmalloc (sizeof (*s->elements) * lsymbolSetBASESIZE);
-
-  return (s);
-}
-
-static void
-lsymbolSet_grow (lsymbolSet s)
-{
-  int i;
-  lsymbol *newelements; 
-
-  llassert (lsymbolSet_isDefined (s));
-
-  s->nspace = lsymbolSetBASESIZE;
-  newelements = (lsymbol *) dmalloc (sizeof (*newelements) 
-				       * (s->entries + s->nspace));
-
-  if (newelements == (lsymbol *) 0)
-    {
-      llfatalerror (cstring_makeLiteral ("lsymbolSet_grow: out of memory!"));
-    }
-
-  for (i = 0; i < s->entries; i++)
-    {
-      newelements[i] = s->elements[i]; 
-    }
-
-  sfree (s->elements); 
-  s->elements = newelements;
-}
-
-/*
-** Ensures: if *e \in *s
-**          then unchanged (*s) & result = false
-**          else *s' = insert (*s, *e) & result = true
-** Modifies: *s
-*/
-
-bool
-lsymbolSet_insert (lsymbolSet s, lsymbol el)
-{
-  llassert (lsymbolSet_isDefined (s));
-
-  if (lsymbolSet_member (s, el))
-    {
-      return FALSE;
-    }
-  else
-    {
-      if (s->nspace <= 0)
-	lsymbolSet_grow (s);
-      s->nspace--;
-      s->elements[s->entries] = el;
-      s->entries++;
-      return TRUE;
-    }
-}
-
-bool
-lsymbolSet_member (lsymbolSet s, lsymbol el)
-{
-  if (lsymbolSet_isDefined (s))
-    {
-      int i;
-      
-      for (i = 0; i < s->entries; i++)
-	{
-	  /* was: &el == &s->elements[i] ! */
-
-	  if (lsymbol_equal (el, s->elements[i]))
-	    {
-	      return TRUE;
-	    }
-	}
-    }
-
-  return FALSE;
-}
-
-/*@only@*/ cstring
-lsymbolSet_unparse (lsymbolSet s)
-{
-  if (lsymbolSet_isDefined (s))
-    {
-      int i;
-      cstring st = cstring_makeLiteral ("{");
-      
-      for (i = 0; i < s->entries; i++)
-	{
-	  if (i == 0)
-	    {
-	      st = message ("%q %s", st, 
-			    cstring_fromChars (lsymbol_toChars (s->elements[i])));
-	    }
-	  else
-	    st = message ("%q, %s", st, 
-			  cstring_fromChars (lsymbol_toChars (s->elements[i])));
-	}
-      
-      st = message ("%q }", st);
-      return st;
-    }
-  else
-    {
-      return (cstring_makeLiteral ("{ }"));
-    }
-}
-
-void
-lsymbolSet_free (/*@null@*/ lsymbolSet s)
-{
-  if (lsymbolSet_isDefined (s))
-    {
-      sfree (s->elements); 
-      sfree (s);
-    }
-}
diff --git a/src/ltoken.c b/src/ltoken.c
deleted file mode 100644
index 8694393..0000000
--- a/src/ltoken.c
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** ltoken.c
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "llgrammar.h"
-# include "scanline.h"
-# include "lclscanline.h"
-
-/* 
-** Place to store the \keyword (\forall ...) tokens.  These tokens will	    
-** have to be modified when the extensionChar ("\") changes. 		    
-** set in LCLScanLineInit of lclscanline.c or in scanline.c 
-*/
-
-/*@-namechecks@*/
-ltoken ltoken_forall;
-ltoken ltoken_exists;
-ltoken ltoken_true;
-ltoken ltoken_false;
-ltoken ltoken_not;
-ltoken ltoken_and;
-ltoken ltoken_or;
-ltoken ltoken_implies;
-ltoken ltoken_eq;
-ltoken ltoken_neq;
-ltoken ltoken_equals;
-ltoken ltoken_eqsep;
-ltoken ltoken_select;
-ltoken ltoken_open;
-ltoken ltoken_sep;
-ltoken ltoken_close;
-ltoken ltoken_id;
-ltoken ltoken_arrow;
-ltoken ltoken_marker;
-ltoken ltoken_pre;
-ltoken ltoken_post;
-ltoken ltoken_comment;
-ltoken ltoken_any;
-ltoken ltoken_compose;
-ltoken ltoken_if;
-ltoken ltoken_result;
-ltoken ltoken_typename;
-ltoken ltoken_bool;
-ltoken ltoken_farrow;
-ltoken ltoken_lbracked;
-ltoken ltoken_rbracket;
-/*@=namechecks@*/
-
-static /*@notnull@*/ ltoken ltoken_new (void)
-{
-  ltoken tok = (ltoken) dmalloc (sizeof (*tok));
-
-  tok->code = NOTTOKEN;
-  tok->col = 0;
-  tok->line = 0;
-  tok->text = lsymbol_undefined;
-  tok->fname = lsymbol_undefined;
-  tok->rawText = lsymbol_undefined;
-  tok->defined = FALSE;
-  tok->hasSyn = FALSE;
-
-  return tok;
-}
-
-ltoken ltoken_create (unsigned int code, lsymbol text)
-{
-  ltoken tok = ltoken_new ();
-
-  tok->code = code;
-  tok->text = text;
-  
-  return tok;
-}
-
-ltoken ltoken_createRaw (unsigned int code, lsymbol text)
-{
-  ltoken tok = ltoken_new ();
-
-  tok->code = code;
-  tok->rawText = text;
-
-  return tok;
-}
-
-ltoken ltoken_createType (unsigned int code, SimpleIdCode idtype, lsymbol text)
-{
-  ltoken tok = ltoken_new ();
-
-  /* no...what's the real llassert (code == simpleId); */
-
-  tok->code = code;
-  tok->idtype = idtype;
-  tok->text = text;
-  
-  return tok;
-}
-
-ltoken ltoken_createFull (unsigned int code, lsymbol text, 
-			  cstring file, unsigned int line, 
-			  unsigned int col)
-{
-  ltoken tok = (ltoken) dmalloc (sizeof (*tok));
-  
-  tok->code = code;
-  tok->text = text;
-  tok->fname = lsymbol_fromString (file);
-  tok->line = line;
-  tok->col = col;
-  tok->rawText = lsymbol_undefined;
-  tok->defined = FALSE;
-  tok->hasSyn = FALSE;
-  
-  return tok;
-}
-
-static /*@only@*/ cstring LCLTokenCode_unparseCodeName (unsigned int t)
-{
-  switch (t)
-    {
-    case NOTTOKEN:         return cstring_makeLiteral ("*** NOTTOKEN ***");
-    case quantifierSym:    return cstring_makeLiteral ("QUANTIFIERSYM");      
-    case logicalOp:        return cstring_makeLiteral ("LOGICALOP");
-    case selectSym:        return cstring_makeLiteral ("SELECTSYM");    
-    case openSym:          return cstring_makeLiteral ("OPENSYM");
-    case preSym:           return cstring_makeLiteral ("\\pre");
-    case postSym:          return cstring_makeLiteral ("\\post");
-    case anySym:           return cstring_makeLiteral ("\\any");
-    case sepSym:           return cstring_makeLiteral ("SEPSYM");
-    case closeSym:         return cstring_makeLiteral ("CLOSESYM");
-    case simpleId:         return cstring_makeLiteral ("simpleId");
-    case LLT_TYPEDEF_NAME:     return cstring_makeLiteral ("TYPEDEF_NAME");
-    case mapSym:           return cstring_makeLiteral ("MAPSYM");
-    case markerSym:        return cstring_makeLiteral ("MARKERSYM");
-    case commentSym:       return cstring_makeLiteral ("COMMENTSYM");
-    case simpleOp:         return cstring_makeLiteral ("SIMPLEOP");
-    case LLT_COLON:            return cstring_makeLiteral ("COLON");
-    case LLT_COMMA:            return cstring_makeLiteral ("COMMA");
-    case LLT_EQUALS:           return cstring_makeLiteral ("LLT_EQUALS");
-    case LLT_LBRACE:           return cstring_makeLiteral ("LBRACE");
-    case LLT_LBRACKET:         return cstring_makeLiteral ("LBRACKET");
-    case LLT_LPAR:             return cstring_makeLiteral ("LPAR");
-    case LLT_QUOTE:            return cstring_makeLiteral ("QUOTE");
-    case LLT_RBRACE:           return cstring_makeLiteral ("RBRACE");
-    case LLT_RBRACKET:         return cstring_makeLiteral ("RBRACKET");
-    case LLT_RPAR:             return cstring_makeLiteral ("RPAR");
-    case LLT_SEMI:             return cstring_makeLiteral ("SEMI");
-    case LLT_VERTICALBAR:      return cstring_makeLiteral ("VERTICALBAR");
-    case eqOp:             return cstring_makeLiteral ("EQOP");
-    case LLT_MULOP:            return cstring_makeLiteral ("MULOP");
-    case LLT_WHITESPACE:       return cstring_makeLiteral ("WHITESPACE,");
-    case LEOFTOKEN:        return cstring_makeLiteral ("EOFTOKEN");
-    case LLT_EOL:         return cstring_makeLiteral ("LLT_EOL");
-    case LLT_CCHAR:            return cstring_makeLiteral ("CCHAR");
-    case LLT_CFLOAT:           return cstring_makeLiteral ("CFLOAT");
-    case LLT_CINTEGER:         return cstring_makeLiteral ("CINTEGER");
-    case LLT_LCSTRING:         return cstring_makeLiteral ("CSTRING");
-    case LLT_ALL:              return cstring_makeLiteral ("allTOKEN");
-    case LLT_ANYTHING:         return cstring_makeLiteral ("anythingTOKEN");
-    case LLT_BE:               return cstring_makeLiteral ("beTOKEN");
-    case LLT_CONSTANT:         return cstring_makeLiteral ("constantTOKEN");
-    case LLT_ELSE:         return cstring_makeLiteral ("elseTOKEN");
-    case LLT_ENSURES:      return cstring_makeLiteral ("ensuresTOKEN");
-    case LLT_IF:               return cstring_makeLiteral ("ifTOKEN");
-    case LLT_IMMUTABLE:        return cstring_makeLiteral ("immutableTOKEN");
-    case LLT_OBJ:              return cstring_makeLiteral ("objTOKEN");
-    case LLT_IMPORTS:          return cstring_makeLiteral ("importsTOKEN");
-    case LLT_CONSTRAINT:       return cstring_makeLiteral ("constraintTOKEN");
-    case LLT_LET:              return cstring_makeLiteral ("letTOKEN");
-    case LLT_MODIFIES:         return cstring_makeLiteral ("modifiesTOKEN");
-    case LLT_CLAIMS:           return cstring_makeLiteral ("claimsTOKEN");
-    case LLT_MUTABLE:          return cstring_makeLiteral ("mutableTOKEN");
-    case LLT_FRESH:            return cstring_makeLiteral ("freshTOKEN");
-    case LLT_NOTHING:          return cstring_makeLiteral ("nothingTOKEN");
-    case LLT_PRIVATE:          return cstring_makeLiteral ("privateTOKEN");
-    case LLT_SPEC:             return cstring_makeLiteral ("specTOKEN");
-    case LLT_REQUIRES:         return cstring_makeLiteral ("requiresTOKEN");
-    case LLT_BODY:             return cstring_makeLiteral ("bodyTOKEN");
-    case LLT_RESULT:           return cstring_makeLiteral ("resultTOKEN");
-    case LLT_SIZEOF:           return cstring_makeLiteral ("sizeofTOKEN");
-    case LLT_THEN:             return cstring_makeLiteral ("thenTOKEN");
-    case LLT_TYPE:             return cstring_makeLiteral ("typeTOKEN");
-    case LLT_TYPEDEF:          return cstring_makeLiteral ("typedefTOKEN");
-    case LLT_UNCHANGED:        return cstring_makeLiteral ("unchangedTOKEN");
-    case LLT_USES:             return cstring_makeLiteral ("usesTOKEN");
-    case LLT_CHAR:             return cstring_makeLiteral ("charTOKEN");
-    case LLT_CONST:            return cstring_makeLiteral ("constTOKEN");
-    case LLT_DOUBLE:           return cstring_makeLiteral ("doubleTOKEN");
-    case LLT_ENUM:         return cstring_makeLiteral ("enumTOKEN");
-    case LLT_FLOAT:            return cstring_makeLiteral ("floatTOKEN");
-    case LLT_INT:              return cstring_makeLiteral ("intTOKEN");
-    case LLT_LONG:             return cstring_makeLiteral ("longTOKEN");
-    case LLT_SHORT:            return cstring_makeLiteral ("shortTOKEN");
-    case LLT_STRUCT:           return cstring_makeLiteral ("structTOKEN");
-    case LLT_SIGNED:       return cstring_makeLiteral ("signedTOKEN");
-    case LLT_UNION:            return cstring_makeLiteral ("unionTOKEN");
-    case LLT_UNKNOWN:          return cstring_makeLiteral ("unknownTOKEN");
-    case LLT_UNSIGNED:         return cstring_makeLiteral ("unsignedTOKEN");
-    case LLT_VOID:             return cstring_makeLiteral ("voidTOKEN");
-    case LLT_VOLATILE:         return cstring_makeLiteral ("volatileTOKEN");
-    case LLT_TELIPSIS:         return cstring_makeLiteral ("elipsisTOKEN");
-    case LLT_ITER:             return cstring_makeLiteral ("iterTOKEN");
-    case LLT_YIELD:            return cstring_makeLiteral ("yieldTOKEN");
-    default:               return cstring_makeLiteral ("*** invalid token code ***"); 
-    } /* end switch */
-}
-
-cstring ltoken_unparseCodeName (ltoken tok)
-{
-  return LCLTokenCode_unparseCodeName (ltoken_getCode (tok));
-}
-
-/*@observer@*/ cstring ltoken_unparse (ltoken s)
-{
-  if (ltoken_isValid (s))
-    {
-      return (lsymbol_toString (s->text));
-    }
-  else
-    {
-      return cstring_undefined;
-    }
-}
-
-ltoken ltoken_copy (ltoken tok)
-{
-  if (ltoken_isValid (tok))
-    {
-      ltoken ret = (ltoken) dmalloc (sizeof (*ret));
-      
-      ret->code = tok->code;
-      ret->text = tok->text;
-      ret->fname = tok->fname;
-      ret->line = tok->line;
-      ret->col = tok->col;
-      ret->rawText = tok->rawText;
-      ret->defined = tok->defined;
-      ret->hasSyn = tok->hasSyn;
-      ret->idtype = tok->idtype;
-      ret->intfield = tok->intfield;
-      
-      return ret;
-    }
-  else
-    {
-      return ltoken_undefined;
-    }
-}
-
-lsymbol ltoken_getRawText (ltoken tok)
-{
-  if (ltoken_isValid (tok))
-    {
-      lsymbol ret = tok->rawText;
-
-      if (lsymbol_isUndefined (ret))
-	{
-	  ret = tok->text;
-	}
-      
-      return ret;
-    }
-  else
-    {
-      return lsymbol_undefined;
-    }
-}
-
-/*@only@*/ cstring ltoken_unparseLoc (ltoken t)
-{
-  if (ltoken_getCode (t) != NOTTOKEN)
-    {
-      if (context_getFlag (FLG_SHOWCOL))
-	{
-	  return (message ("%s:%u,%u", ltoken_fileName (t), 
-			   ltoken_getLine (t), ltoken_getCol (t)));
-	}
-      else
-	{
-	  return (message ("%s:%u", ltoken_fileName (t), ltoken_getLine (t)));
-	}
-    }
-  else
-    {
-      return cstring_makeLiteral ("*** Not Token ***"); 
-    }
-}
-
-void ltoken_markOwned (/*@owned@*/ ltoken tok)
-{
-    sfreeEventually (tok);
-}
-
-void ltoken_free (/*@only@*/ ltoken tok)
-{
-  sfree (tok); 
-}
-
-bool ltoken_isSingleChar (char c)
-{
-  return (LCLScanCharClass (c) == SINGLECHAR);
-}
diff --git a/src/ltokenList.c b/src/ltokenList.c
deleted file mode 100644
index 8e764ef..0000000
--- a/src/ltokenList.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** ltokenList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@notnull@*/ /*@only@*/ ltokenList
-ltokenList_new ()
-{
-  ltokenList s = (ltokenList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = ltokenListBASESIZE;
-  s->elements = (ltoken *) 
-    dmalloc (sizeof (*s->elements) * ltokenListBASESIZE);
-  s->current = 0;
-
-  return (s);
-}
-
-/*@notnull@*/ /*@only@*/ ltokenList
-ltokenList_singleton (ltoken l)
-{
-  ltokenList s = (ltokenList) dmalloc (sizeof (*s));
-
-  s->nelements = 1;
-  s->nspace = ltokenListBASESIZE - 1;
-  s->elements = (ltoken *) dmalloc (sizeof (*s->elements) * ltokenListBASESIZE);
-  s->elements[0] = l;
-  s->current = 0;
-
-  return (s);
-}
-
-static void
-ltokenList_grow (/*@notnull@*/ ltokenList s)
-{
-  int i;
-  ltoken *newelements;
-
-  s->nspace += ltokenListBASESIZE;
-
-  newelements = (ltoken *) dmalloc (sizeof (*newelements)
-				    * (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] =  s->elements[i]; 
-    }
-
-  sfree (s->elements); 
-  s->elements = newelements;
-}
-
-ltokenList 
-ltokenList_push (/*@returned@*/ ltokenList s, ltoken el)
-{
-  ltokenList_addh (s, el);
-  return s;
-}
-
-void 
-ltokenList_addh (ltokenList s, ltoken el)
-{
-  llassert (ltokenList_isDefined (s));
-
-  if (s->nspace <= 0)
-    ltokenList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-}
-
-void 
-ltokenList_reset (ltokenList s)
-{
-  if (ltokenList_isDefined (s))
-    {
-      s->current = 0;
-    }
-}
-
-bool
-ltokenList_isFinished (ltokenList s)
-{
-  return (ltokenList_isUndefined(s) || (s->current == s->nelements));
-}
-
-void 
-ltokenList_advance (ltokenList s)
-{
-  if (ltokenList_isDefined (s))
-    {
-      s->current++;
-      llassert (s->current <= s->nelements);
-    }
-}
-
-ltoken 
-ltokenList_head (ltokenList s)
-{
-  llassert (ltokenList_isDefined (s) && s->nelements > 0);
-  return (s->elements[0]);
-}
-
-bool 
-ltokenList_equal (ltokenList s1, ltokenList s2)
-{
-  if (ltokenList_isUndefined (s1))
-    {
-      return (ltokenList_isEmpty (s2));
-    }
-  else
-    {
-      if (ltokenList_isUndefined (s2))
-	{
-	  return ltokenList_isEmpty (s1);
-	}
-      else
-	{
-	  int i;
-	  int size = s1->nelements;
-	  
-	  if (s2->nelements != size)
-	    return FALSE;
-	  
-	  for (i = 0; i < size; i++)
-	    {
-	      if (!ltoken_similar (s1->elements[i], s2->elements[i]))
-		return FALSE;
-	    }
-	  return TRUE;
-	}
-    }
-}
-
-/*@only@*/ ltokenList 
-ltokenList_copy (ltokenList s)
-{
-  ltokenList r = ltokenList_new ();
-
-  ltokenList_elements (s, x)
-  {
-    ltokenList_addh (r, ltoken_copy (x));
-  } end_ltokenList_elements;
-
-  return r;
-}
-
-void
-ltokenList_removeCurrent (ltokenList s)
-{
-  int i;
-  llassert (ltokenList_isDefined (s) && s->current >= 0 && s->current < s->nelements);
-
-  for (i = s->current; i < s->nelements - 1; i++)
-    {
-      s->elements[i] = s->elements[i+1];
-    }
-
-  s->nelements--;
-  s->nspace++;
-}
-
-ltoken 
-ltokenList_current (ltokenList s)
-{
-  llassert (ltokenList_isDefined (s) && s->current >= 0 && s->current < s->nelements);
-  return (s->elements[s->current]);
-}
-
-/*@only@*/ cstring
-ltokenList_unparse (ltokenList s)
-{
-  int i;
-  cstring st = cstring_undefined;
-
-  if (ltokenList_isDefined (s))
-    {
-      for (i = 0; i < s->nelements; i++)
-	{
-	  if (i == 0)
-	    {
-	      st = cstring_copy (ltoken_unparse (s->elements[i]));
-	    }
-	  else
-	    st = message ("%q, %s", st, ltoken_unparse (s->elements[i]));
-	}
-    }
-
-  return st;
-}
-
-void
-ltokenList_free (ltokenList s)
-{
-  if (ltokenList_isDefined (s))
-    {
-      sfree (s->elements);
-      sfree (s);
-    }
-}
diff --git a/src/macrocache.c b/src/macrocache.c
deleted file mode 100644
index 2db8944..0000000
--- a/src/macrocache.c
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** macrocache.c
-**
-** rep Invariant:
-**     no two fileloc's may be equal
-**
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "llmain.h"
-
-/*@constant int MCEBASESIZE;@*/
-# define MCEBASESIZE 8
-
-/*@constant int DNE;@*/
-# define DNE -1
-
-/*
-** Temporary file used for processing macros.
-*/
-
-static /*@null@*/ FILE *s_macFile = NULL;
-
-/*
-** mcDisable is set to TRUE when a macro is being processed, so
-** its contents are not added to the macrocache again, creating
-** a nasty infinite loop.
-*/
-
-static bool mcDisable = TRUE;
-static void macrocache_grow (macrocache p_s);
-static int macrocache_exists (macrocache p_s, fileloc p_fl);
-static void macrocache_processMacro (macrocache p_m, int p_i);
-
-static /*@only@*/ mce
-  mce_create (/*@only@*/ fileloc fl, /*@only@*/ cstring def, bool comment)
-{
-  mce m = (mce) dmalloc (sizeof (*m));
-  m->fl = fl;
-  m->def = def; /*< had a copy here! check this carefully */
-  m->defined = FALSE;
-  m->scomment = comment;
-  return m;
-}
-
-static void mce_free (/*@only@*/ mce m)
-{
-  fileloc_free (m->fl);
-  cstring_free (m->def);
-  sfree (m);
-}
-
-/*@only@*/ macrocache
-macrocache_create (void)
-{
-  macrocache s = (macrocache) dmalloc (sizeof (*s));
-
-  s->entries = 0;
-  s->nspace = MCEBASESIZE;
-  s->contents = (mce *) dmalloc (sizeof (*s->contents) * MCEBASESIZE);
-
-  mcDisable = FALSE;
-
-  return (s);
-}
-
-void
-macrocache_free (macrocache s)
-{
-  int i;
-
-  llassert (s_macFile == NULL);
-
-  for (i = 0; i < s->entries; i++)
-    {
-      mce_free (s->contents[i]);
-    }
-
-  sfree (s->contents);
-  sfree (s);
-}
-
-static void
-macrocache_grow (macrocache s)
-{
-  int i;
-  o_mce *oldcontents = s->contents;
-
-  s->nspace = MCEBASESIZE;
-  s->contents = (mce *) dmalloc (sizeof (*s->contents) * (s->entries + s->nspace)); 
-
-  for (i = 0; i < s->entries; i++)
-    {
-      s->contents[i] = oldcontents[i];
-    }
-
-  sfree (oldcontents);
-}
-
-static void
-macrocache_addGenEntry (macrocache s, /*@only@*/ fileloc fl,
-			/*@only@*/ cstring def, bool sup)
-{
-  int i;
-
-  if (mcDisable)
-    {
-      fileloc_free (fl);
-      cstring_free (def);
-      return;
-    }
-
-  if ((i = macrocache_exists (s, fl)) != DNE)
-    {
-      if (cstring_equal (def, s->contents[i]->def))
-	{
-	  fileloc_free (fl);
-	  cstring_free (def);
-
-	  return;
-	}
-      else
-	{
-	  /*
-	  ** macro definition contained macro that is expanded
-	  ** replace with def
-	  **
-	  ** how do we know which is better??
-	  */
-	  
-	  cstring_free (s->contents[i]->def);
-	  s->contents[i]->def = def;
-
-	  fileloc_free (fl);
-	  return;
-	}
-    }
-
-  if (s->nspace <= 0) {
-    macrocache_grow (s);
-  }
-
-  s->nspace--;
-  s->contents[s->entries] = mce_create (fl, def, sup);
-  s->entries++;
-}
-
-void
-macrocache_addEntry (macrocache s, /*@only@*/ fileloc fl, /*@only@*/ cstring def)
-{
-  macrocache_addGenEntry (s, fl, def, FALSE);
-}
-
-
-void
-macrocache_addComment (macrocache s, /*@only@*/ fileloc fl, /*@only@*/ cstring def)
-{
-  macrocache_addGenEntry (s, fl, def, TRUE);
-}
-
-static int
-macrocache_exists (macrocache s, fileloc fl)
-{
-  int i;
-
-  for (i = 0; i < s->entries; i++)
-    {
-      if (fileloc_equal (s->contents[i]->fl, fl))
-	return (i);
-    }
-
-  return (DNE);
-}
-
-/*@only@*/ cstring
-macrocache_unparse (macrocache m)
-{
-  cstring s = cstring_undefined;
-  int i;
-
-  for (i = 0; i < m->entries; i++)
-    {
-      fileloc fl = m->contents[i]->fl;
-      cstring def = m->contents[i]->def;
-      bool defined = m->contents[i]->defined;
-      
-      s = message ("%q%q: %s [%s]\n", s, fileloc_unparse (fl), def, 
-		   bool_unparse (defined));
-    }
-  
-  return (s);
-}
-
-/*
-** needs to call lex by hand...yuk!
-**
-** modifies gc fileloc!
-*/
-
-/*
-** there's gotta be a better way of doing this!
-*/
-
-static void pushString (/*@only@*/ cstring s)
-{
-  static fileId mtid = fileId_invalid;
-  long floc;
-
-  if (s_macFile == NULL)
-    {
-      cstring fname;
-      mtid = fileTable_addMacrosFile (context_fileTable ());
-      
-      fname = fileName (mtid);
-      s_macFile = fopen (cstring_toCharsSafe (fname), "wb+");
-      
-      if (s_macFile == NULL)
-	{
-	  llcontbug (message ("Cannot open tmp file %s needed to process macro: %s", 
-			      fname, s));
-	  cstring_free (s);
-	  return;
-    	}
-    }
-
-  llassert (s_macFile != NULL);
-
-  /* SunOS, others? don't define SEEK_CUR and SEEK_SET */
-# ifndef SEEK_CUR 
-# define SEEK_CUR 1
-# endif
-  check (fseek (s_macFile, 0, SEEK_CUR) == 0);
-
-  floc = ftell (s_macFile);
-
-  if (cstring_length (s) > 0) {
-    check (fputs (cstring_toCharsSafe (s), s_macFile) != EOF);
-  }
-
-  check (fputc ('\n', s_macFile) == (int) '\n');
-
-# ifndef SEEK_SET 
-# define SEEK_SET 0
-# endif
-  check (fseek (s_macFile, floc, SEEK_SET) == 0);
-
-  yyin = s_macFile;
-  (void) yyrestart (yyin);
-  cstring_free (s);
-}
-
-static void
-macrocache_processMacro (macrocache m, int i)
-{
-  fileloc fl = m->contents[i]->fl;
-   
-  m->contents[i]->defined = TRUE;
-
-  if (!fileId_equal (currentFile (), fileloc_fileId (fl)))
-    {
-      g_currentloc = fileloc_update (g_currentloc, fl);
-      context_enterMacroFile ();
-    }
-  else
-    {
-      setLine (fileloc_lineno (fl));
-    }
-
-  beginLine ();
-
-  DPRINTF (("Process macro: %s", m->contents[i]->def));
-
-  if (m->contents[i]->scomment)
-    {
-      pushString (message ("%s%s%s", 
-			   cstring_fromChars (BEFORE_COMMENT_MARKER),
-			   m->contents[i]->def,
-			   cstring_fromChars (AFTER_COMMENT_MARKER)));
-      (void) yyparse ();
-    }
-  else
-    {
-      bool insup = context_inSuppressRegion ();
-
-      pushString (message ("%s %s", 
-			   cstring_makeLiteralTemp (PPMRCODE),
-			   m->contents[i]->def));
-      (void) yyparse ();
-
-      if (context_inSuppressRegion () && !insup)
-	{
-	  llerrorlit (FLG_SYNTAX, "Macro ends in ignore region");
-	}
-    }
-  
-  incLine ();  
-  context_exitMacroCache ();
-}
-
-extern void macrocache_processUndefinedElements (macrocache m)
-{
-  fileloc lastfl = fileloc_undefined;
-  int i;
- 
-  mcDisable = TRUE;
-
-  DPRINTF (("Processing undefined elements"));
-
-  if (!context_getFlag (FLG_PARTIAL))
-    {
-      for (i = 0; i < m->entries; i++) 
-	{
-	  if (m->contents[i]->defined)
-	    {
-	      ;
-	    }
-	  else 
-	    { 
-	      fileloc fl = m->contents[i]->fl; 
-	      
-	      if (fileloc_isDefined (lastfl) && fileloc_sameFile (fl, lastfl)) 
-		{
-		  ;
-		}
-	      else
-		{
-		  if (context_getFlag (FLG_SHOWSCAN))
-		    {
-		      if (!fileloc_isLib (fl))
-			{
-			  lldiagmsg (message ("< checking macros %s >", fileloc_filename (fl)));
-			}
-		    }
-		  
-		  lastfl = fl;
-		  cleanupMessages ();
-		}
-	      
-	      macrocache_processMacro (m, i);	
-	    }
-	}
-    }
-
-  mcDisable = FALSE;
-}
-
-extern /*@observer@*/ fileloc macrocache_processFileElements (macrocache m, cstring base)
-{
-  fileloc lastfl = fileloc_undefined;
-  int i;
- 
-  mcDisable = TRUE;
-
-  for (i = 0; i < m->entries; i++) 
-    {
-      if (m->contents[i]->defined)
-	{
-	  ;
-	}
-      else 
-        { 
-	  fileloc fl = m->contents[i]->fl;  /* should be dependent! */
-	  cstring fb = fileloc_getBase (fl);
-
-	  if (cstring_equal (fb, base))
-	    {
-	      lastfl = fl;
-	      macrocache_processMacro (m, i);	
-	    }
-	}
-    }
-
-  mcDisable = FALSE;
-  return lastfl;
-}
-
-void macrocache_finalize (void)
-{
-  if (s_macFile != NULL)
-    {
-      check (fclose (s_macFile) == 0);
-      s_macFile = NULL;
-    }
-}
diff --git a/src/mapping.c b/src/mapping.c
deleted file mode 100644
index 65589c3..0000000
--- a/src/mapping.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** mapping.c
-**
-** Module for lsymbol maps.
-**
-**  AUTHOR:
-**	Yang Meng Tan,
-**         Massachusetts Institute of Technology
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@constant int MAPPING_SIZE; @*/
-# define MAPPING_SIZE 127
-
-/* use lower-order bits by masking out higher order bits */
-
-/*@-macrofcndecl@*/
-# define MMASH(key)  ((unsigned int) ((key) & MAPPING_SIZE))
-/*@=macrofcndecl@*/
-
-static void mappair_free (/*@null@*/ /*@only@*/ mappair *p)
-{
-  if (p == NULL) 
-    {
-      return;
-    }
-  else
-    {
-      mappair_free (p->next);
-      sfree (p);
-    }
-}
-
-void mapping_free (/*@only@*/ mapping *m)
-{
-  int i;
-
-  for (i = 0; i <= MAPPING_SIZE; i++)
-    {
-      mappair_free (m->buckets[i]);
-    }
-  
-  sfree (m->buckets);
-  sfree (m);
-}
-
-/*@only@*/ mapping *
-mapping_create (void)
-{
-  int i;
-  mapping *t = (mapping *) dmalloc (sizeof (*t));
-
-  t->buckets = (mappair **) dmalloc ((MAPPING_SIZE + 1) * sizeof (*t->buckets));
-  t->count = 0;
-
-  for (i = 0; i <= MAPPING_SIZE; i++)
-    {
-      t->buckets[i] = (mappair *) 0;
-    }
-
-  return t;
-}
-
-lsymbol
-mapping_find (mapping * t, lsymbol domain)
-{
-  mappair *entry;
-  unsigned int key;
-
-  key = MMASH (domain);
-  entry = t->buckets[key];
-  for (; entry != NULL; entry = entry->next)
-    {
-      if (entry->domain == domain)
-	return entry->range;
-    }
-
-  return lsymbol_undefined;
-}
-
-void
-mapping_bind (mapping *t, lsymbol domain, lsymbol range)
-{
-  /* add the binding (domain -> range) to t */
-  /* can assume that the binding is a new one in m, so no need
-     to check. */
-  mappair *entry;
-  mappair *newentry = (mappair *) dmalloc (sizeof (*newentry));
-  unsigned int key;
-
-  key = MMASH (domain);
-  /*@-deparrays@*/ entry = t->buckets[key]; /*@=deparrays@*/
-  newentry->domain = domain;
-  newentry->range = range;
-  newentry->next = entry;
-
-  t->buckets[key] = newentry; 
-  t->count++;
-}
diff --git a/src/message.c b/src/message.c
deleted file mode 100644
index 53fe670..0000000
--- a/src/message.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** message.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
- 
-/* patch for linux? solaris? */
-
-static char strbuf[64];
-static int modcode;
-
-typedef enum
-{
-  XINVALID, 
-  XCHAR, XSTRING, XSTRINGFREE, XTSTRINGFREE, XINT, XFLOAT, XBOOL, XUENTRY,
-  XPERCENT, XCTYPE, XPLURAL, XREPREFIX, XFILELOC
-} ccode;
-
-/* char *s, anytype v */
-/*@notfunction@*/
-# define GETPRINTF(s,v) (sprintf (strbuf, s, v), mstring_copy (strbuf))
-
-/*
-** returns control code indicated by *c, and
-** advances *c to next character.
-*/
-
-static ccode
-  identify_control (char **s)
-{
-  char c;
-
-  modcode = 0;
-
-  c = **s;
-  if (c == '\0')
-    {
-      return (XINVALID);
-    }
-
-  if (c >= '0' && c <= '9')
-    {
-      modcode = getInt (s);
-    }
-
-  c = **s;
-
-  (*s)++;
-
- /*
- ** handle single-char codes
- */
-
-  switch (c)
-    {
-    case '%':
-      return (XPERCENT);
-    case 'h':
-    case 'c':
-      return (XCHAR);
-    case 's':
-      return (XSTRING);
-    case 'q':
-      return (XSTRINGFREE);
-    case 'x':
-      return (XSTRINGFREE);
-    case 'd':
-      return (XINT);
-    case 'u':
-      return (XINT); /* unsigned */
-    case 'w':
-      return (XINT); /* unsigned long */
-    case 'f':
-      return (XFLOAT);
-    case 'b':
-      return (XBOOL);
-    case 't':
-      return (XCTYPE);
-    case 'l':
-      return (XFILELOC);
-    case 'p':
-      return (XPLURAL);
-    case 'r':
-      return (XREPREFIX);
-    default:
-      llcontbug (message ("Message: invalid code: %h (%s)", c, 
-			  cstring_fromChars (*s)));
-      return (XINVALID);
-    }
-}
-
-/*
-** message
-**
-** returns a cstring containing the message, as formated by s.
-**
-** the format codes are similar to printf:
-**
-**         %s    cstring (don't free after print)
-**         %q    cstring (free after print)
-**         %d    int
-**         %f    float
-**         %b    bool     (uses bool_unparse)
-**         %u    uentry
-**         %l    fileloc
-**         %t    ctype
-*/
-
-
-# if USEVARARGS
-cstring
-message (fmt, va_alist)
-     char *fmt;
-     va_dcl
-# else
-/*@messagelike@*/ /*@only@*/ cstring
-message (/*@temp@*/ char *fmt, ...)
-# endif
-{
-  char c;
-  int lastint = 0;
-  char *ret = mstring_createEmpty ();
-  char *ofmt = fmt;
-  va_list pvar;
-
-# if USEVARARGS
-  va_start (pvar);
-# else
-  va_start (pvar, fmt);
-# endif  
-
-  while ((c = *fmt++) != '\0')
-    {
-      if (c == '%')
-	{
-	  /*@-loopswitchbreak@*/
-
-	  switch (identify_control (&fmt))
-	    {
-	    case XPERCENT:
-	      {
-		ret = mstring_concatFree1 (ret, "%");
-		break;
-	      }
-	    case XCHAR:
-	      {
-		/*
-                ** some systems don't handle char va_arg correctly, so it must be
-		** passed as an int here
-		*/
-
-		char lc = (char) va_arg (pvar, int);
-
-		ret = mstring_append (ret, lc);
-		break;
-	      }
-	    case XSTRING:
-	      {
-		cstring s = va_arg (pvar, cstring);
-		
-		if (modcode != 0)
-		  {
-		    ret = mstring_concatFree (ret, cstring_toCharsSafe 
-					  (cstring_fill (s, modcode)));
-		  }
-		else
-		  {
-		    if (cstring_isDefined (s))
-		      {
-			ret = mstring_concatFree1 (ret, cstring_toCharsSafe (s));
-		      }
-		  }
-	      }
-	      break;
-	    case XSTRINGFREE:
-	    case XTSTRINGFREE:
-	      {
-		cstring s = va_arg (pvar, cstring);
-		
-		if (modcode != 0)
-		  {
-		    ret = mstring_concatFree (ret, cstring_toCharsSafe 
-					      (cstring_fill (s, modcode)));
-		  }
-		else
-		  {
-		    if (cstring_isDefined (s))
-		      {
-			ret = mstring_concatFree 
-			  (ret, cstring_toCharsSafe (s));
-		      }
-		  }
-	      }
-	      break;
-	    case XREPREFIX:
-	      lastint = va_arg (pvar, int);
-
-	      if (lastint != 0)
-		{
-		  ret = mstring_concatFree1 (ret, "re");
-		}
-	      break;
-	    case XPLURAL:
-	      if (lastint != 1)
-		{
-		  ret = mstring_concatFree1 (ret, "s");
-		}
-	      break;
-	    case XINT:
-	      lastint = va_arg (pvar, int);
-	      ret = mstring_concatFree (ret, GETPRINTF ("%d", lastint));
-	      break;
-	    case XFLOAT:
-	      ret = mstring_concatFree (ret, GETPRINTF ("%e", va_arg (pvar, double)));
-	      break;
-	    case XBOOL:
-	      ret = mstring_concatFree1 (ret, cstring_toCharsSafe 
-				    (bool_unparse (va_arg (pvar, bool))));
-	      break;
-	    case XUENTRY:
-	      ret = mstring_concatFree (ret, cstring_toCharsSafe 
-				   (uentry_unparse (va_arg (pvar, uentry))));
-	      break;
-	    case XCTYPE:
-	      /* cannot free ctype_unparse */
-	      ret = mstring_concatFree1 (ret, cstring_toCharsSafe 
-				   (ctype_unparse (va_arg (pvar, ctype)))); 
-	      break;
-	    case XFILELOC:
-	      ret = mstring_concatFree (ret, cstring_toCharsSafe 
-				   (fileloc_unparse (va_arg (pvar, fileloc))));
-	      break;
-	    case XINVALID:
-	    default:
-	      llcontbug (cstring_makeLiteral ("message: bad control flag"));
-	      fprintf (stdout, "\tFormat string: %s", ofmt);
-	    }
-	  /*@=loopswitchbreak@*/
-	}
-      else
-	{
-	  ret = mstring_append (ret, c);
-	}
-    }
-
-  va_end (pvar);
-
-  /*
-  ** cstring_fromChars returns the same storage (exposed)
-  */
-
-  /*@-mustfree@*/ return (cstring_fromChars (ret)); /*@=mustfree@*/
-}
diff --git a/src/messageLog.c b/src/messageLog.c
deleted file mode 100644
index 56470da..0000000
--- a/src/messageLog.c
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** messageLog.c (from slist_template.c)
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-/*@only@*/ messageLog
-messageLog_new ()
-{
-  messageLog s = (messageLog) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = messageLogBASESIZE;
-  s->elements = (msgentry *) dmalloc (sizeof (*s->elements) * messageLogBASESIZE);
-
-  return (s);
-}
-
-static /*@only@*/ msgentry
-msgentry_create (fileloc loc, cstring mess)
-{
-  msgentry msg = (msgentry) dmalloc (sizeof (*msg));
-
-  msg->loc = fileloc_copy (loc);
-  msg->msg = cstring_copy (mess);
-
-  return msg;
-}
-
-static void msgentry_free (/*@only@*/ msgentry msg)
-{
-  fileloc_free (msg->loc);
-  cstring_free (msg->msg);
-  sfree (msg);
-}
-
-/*
-** returns TRUE if m1 < m2
-*/
-
-static bool
-msgentry_lessthan (msgentry m1, msgentry m2)
-{
-  return (fileloc_lessthan (m1->loc, m2->loc)
-	  || (fileloc_equal (m1->loc, m2->loc) 
-	      && (cstring_lessthan (m1->msg, m2->msg))));
-}
-
-static bool
-msgentry_equal (msgentry m1, msgentry m2)
-{
-  return (fileloc_equal (m1->loc, m2->loc) &&
-	  cstring_equal (m1->msg, m2->msg));
-}
-
-/*
-** returns highest index of element less than msg
-*/
-
-static int
-messageLog_index (messageLog s, msgentry msg)
-{
-  int high;
-  int low  = 0;
-
-  llassert (messageLog_isDefined (s));
-
-  high = s->nelements - 1;
-
-  for (low = high; low >= 0; low--)
-    {
-      if (msgentry_lessthan (s->elements[low], msg))
-	{
-	  return low;
-	}
-    }
-
-  return -1;
-# if 0      
-  while (low < high)
-    {
-      int mid = (low + high + 1) / 2;
-
-      if (msgentry_lessthan (s->elements[mid], msg)) /* mid < msg */
-	{
-	  if (high == mid) break;
-	  high = mid;
-	}
-      else
-	{
-	  if (low == mid) break;
-	  low = mid;
-	}
-    }
-
-  return low - 1;
-# endif
-}
-
-static void
-messageLog_grow (/*@notnull@*/ messageLog s)
-{
-  int i;
-  msgentry *newelements;
-  
-  s->nspace += messageLogBASESIZE; 
-  newelements = (msgentry *) dmalloc (sizeof (*newelements) * (s->nelements + s->nspace));
-  
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-  
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-bool messageLog_add (messageLog s, fileloc fl, cstring mess)
-{
-  msgentry msg = msgentry_create (fl, mess);
-  int ind, i;
-
-  llassert (messageLog_isDefined (s));
-
-  ind = messageLog_index (s, msg);
-
-  if (ind + 1 < s->nelements)
-    {
-      if (msgentry_equal (msg, s->elements[ind + 1]))
-	{
-	  msgentry_free (msg);
-	  return FALSE;
-	}
-    }
-
-  if (s->nspace <= 0) {
-    messageLog_grow (s);
-  }
-
-  for (i = s->nelements; i > ind + 1; i--)
-    {
-      s->elements[i] = s->elements[i-1];
-    }
-  
-  s->elements[ind + 1] = msg;
-  s->nspace--;
-  s->nelements++;
-
-  return TRUE;
-}
-
-/*@only@*/ cstring
-messageLog_unparse (messageLog s)
-{
-   int i;
-   cstring st = cstring_makeLiteral ("[");
-
-   if (messageLog_isDefined (s))
-     {
-       for (i = 0; i < s->nelements; i++)
-	 {
-	   if (i == 0)
-	     {
-	       st = message ("%q %q", st, fileloc_unparseDirect (s->elements[i]->loc));
-	     }
-	   else
-	     st = message ("%q, %q", st, fileloc_unparseDirect (s->elements[i]->loc));
-	 }
-     }
-
-   st = message ("%q ]", st);
-   return st;
-}
-
-void
-messageLog_free (messageLog s)
-{
-  if (s != NULL)
-    {
-      int i;
-
-      for (i = 0; i < s->nelements; i++)
-	{
-	  msgentry_free (s->elements[i]);
-	}
-      
-      sfree (s->elements); 
-      sfree (s);
-    }
-}
diff --git a/src/multiVal.c b/src/multiVal.c
deleted file mode 100644
index cf054be..0000000
--- a/src/multiVal.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** multiVal.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-/*@only@*/ multiVal multiVal_unknown ()
-{
-  return multiVal_undefined;
-}
-
-static /*@special@*/ /*@notnull@*/ multiVal multiVal_create (mvkind kind)
-   /*@defines result->kind@*/
-{
-  multiVal mv = (multiVal) dmalloc (sizeof (*mv));
-
-  mv->kind = kind;
-  return mv;
-}
-
-/*@only@*/ multiVal multiVal_makeInt (long x)
-{
-  multiVal mv = multiVal_create (MVLONG);
-
-  mv->value.ival = x;
-  return mv;
-}
-
-/*@only@*/ multiVal multiVal_makeChar (char x)
-{
-  multiVal mv = multiVal_create (MVCHAR);
-    mv->value.cval = x;
-    return mv;
-}
-
-/*@only@*/ multiVal multiVal_makeDouble (double x)
-{
-  multiVal mv = multiVal_create (MVDOUBLE);
-
-    mv->value.fval = x;
-    return mv;
-}
-
-/*@only@*/ multiVal multiVal_makeString (/*@only@*/ cstring s)
-{
-  multiVal mv = multiVal_create (MVSTRING);
-
-  mv->value.sval = s;
-  return mv;
-}
-
-
-/*@only@*/ multiVal multiVal_copy (multiVal m)
-{
-  multiVal r;
-
-  if (multiVal_isUndefined (m))
-    {
-      return multiVal_undefined;
-    }
-
-  r = multiVal_create (m->kind);
-      
-  switch (m->kind)
-    {
-    case MVLONG:
-      r->value.ival = m->value.ival;
-      break;
-    case MVCHAR:
-      r->value.cval = m->value.cval;
-      break;
-    case MVDOUBLE:
-      r->value.fval = m->value.fval;
-      break;
-    case MVSTRING:
-      r->value.sval = cstring_copy (m->value.sval);
-      break;
-    }
-  
-  return r;
-}
-
-multiVal multiVal_invert (multiVal m)
-{
-  if (multiVal_isUndefined (m))
-    {
-      return multiVal_undefined;
-    }
-      
-  switch (m->kind)
-    {
-    case MVLONG:
-      return multiVal_makeInt (-1 * m->value.ival);
-    case MVCHAR:
-      BADBRANCHCONT;
-      return multiVal_undefined;
-    case MVDOUBLE:
-      return multiVal_makeDouble (-1.0 * m->value.fval);
-    case MVSTRING:
-      BADBRANCHCONT;
-      return multiVal_undefined;
-    }
-
-  BADEXIT;
-}
-
-long multiVal_forceInt (multiVal m)
-{
-  llassert (multiVal_isInt (m));
-
-  return m->value.ival;
-}
-
-char multiVal_forceChar (multiVal m)
-{
-  llassert (multiVal_isChar (m));
-  
-  return m->value.cval;
-}
-
-double multiVal_forceDouble (multiVal m)
-{
-  llassert (multiVal_isDouble (m));
-
-  return m->value.fval;
-}
-
-/*@dependent@*/ /*@observer@*/ cstring multiVal_forceString (multiVal m)
-{
-  llassert (multiVal_isString (m));
-
-  return m->value.sval;
-}
-
-bool multiVal_isInt (multiVal m)
-{
-  return (multiVal_isDefined (m) && m->kind == MVLONG);
-}
-
-bool multiVal_isChar (multiVal m)
-{
-  return (multiVal_isDefined (m) && m->kind == MVCHAR);
-}
-
-bool multiVal_isDouble (multiVal m)
-{
-  return (multiVal_isDefined (m) && m->kind == MVDOUBLE);
-}
-
-bool multiVal_isString (multiVal m)
-{
-  return (multiVal_isDefined (m) && m->kind == MVSTRING);
-}
-
-/*@only@*/ cstring multiVal_unparse (multiVal m)
-{
-  if (multiVal_isDefined (m))
-    {
-      switch (m->kind)
-	{
-	case MVLONG:
-	  return message ("%d", (int)m->value.ival);
-	case MVCHAR:
-	  	  return message ("'%h'", m->value.cval);
-	case MVDOUBLE:
-	  return message ("%f", (float)m->value.fval);
-	case MVSTRING:
-	  return message ("%s", m->value.sval);
-	}
-      BADEXIT;
-    }
-  else
-    {
-      return (cstring_makeLiteral ("?"));
-    }
-}
-
-/*@only@*/ cstring multiVal_dump (multiVal m)
-{
-  if (multiVal_isDefined (m))
-    {
-      switch (m->kind)
-	{
-	case MVLONG:
-	  return (message ("i%d", (int)m->value.ival));
-	case MVCHAR:
-	  return (message ("c%d", (int)m->value.cval));
-	case MVDOUBLE:
-	  return (message ("d%f", (float)m->value.fval));
-	case MVSTRING:
-	  return (message ("s%s", m->value.sval));
-	}
-      BADEXIT;
-    }
-  else
-    {
-      return (cstring_undefined);
-    }
-}
-
-/*@only@*/ multiVal multiVal_undump (char **s)
-{
-  char tchar = **s;
-
-  switch (tchar)
-    {
-    case 'i':
-      (*s)++;
-      return multiVal_makeInt (getInt (s));
-    case 'c':
-      (*s)++;
-      return multiVal_makeChar ((char) getInt (s));
-    case 'd':
-      (*s)++;
-      return multiVal_makeDouble (getDouble (s));
-    case 's':
-      {
-	cstring st = cstring_undefined;
-
-	(*s)++;
-	while (**s != '#')
-	  {
-	    st = cstring_appendChar (st, **s);
-	    (*s)++;
-	  }
-
-	return multiVal_makeString (st);
-      }
-    case '@':
-    case '#':
-      return multiVal_unknown ();
-    BADDEFAULT;
-    }
-  
-  BADEXIT;
-}
-
-int multiVal_compare (multiVal m1, multiVal m2)
-{
-  if (multiVal_isUndefined (m1))
-    {
-      if (multiVal_isUndefined (m2)) 
-	{
-	  return 0;
-	}
-
-      else return -1;
-    }
-  if (multiVal_isUndefined (m2))
-    {
-      return -1;
-    }
-
-  COMPARERETURN (generic_compare (m1->kind, m2->kind));
-
-  switch (m1->kind)
-    {
-    case MVLONG:   return (generic_compare (m1->value.ival, m2->value.ival));
-    case MVCHAR:   return (generic_compare (m1->value.cval, m2->value.cval));
-    case MVDOUBLE: return (generic_compare (m1->value.fval, m2->value.fval));
-    case MVSTRING: return (cstring_compare (m1->value.sval, m2->value.sval));
-    }
-
-  BADEXIT;
-}
-
-void multiVal_free (/*@only@*/ multiVal m)
-{
-  if (multiVal_isDefined (m))
-    {
-      if (m->kind == MVSTRING)
-	{
-	  cstring_free (m->value.sval);
-	}
-      
-      sfree (m);
-    }
-}
-
-
-
-
diff --git a/src/nameChecks.c b/src/nameChecks.c
deleted file mode 100644
index 0d1318e..0000000
--- a/src/nameChecks.c
+++ /dev/null
@@ -1,1462 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** nameChecks.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-# include "nameChecks.h"
-
-static bool checkCzechName (uentry p_ue, flagcode p_czechflag, bool p_report)
-  /*@modifies p_ue, g_msgstream@*/ ;
-
-static bool checkSlovakName (uentry p_ue, flagcode p_slovakflag, bool p_report)
-  /*@modifies p_ue, g_msgstream@*/ ;
-
-static cstring czechPrefix (cstring name)
-{
-  return (cstring_beforeChar (name, '_'));
-}
-
-static cstring slovakPrefix (cstring name)
-{
-  int i = 0;
-
-  cstring_chars (name, c)
-    {
-      if (isupper ((unsigned char) c))
-	{
-	  return (cstring_prefix (name, i));
-	}
-      i++;
-    } end_cstring_chars;
-
-  return cstring_undefined;
-}
-
-static flagcode excludeCodes [] = 
- {
-   FLG_MACROVARPREFIXEXCLUDE,
-   FLG_TAGPREFIXEXCLUDE,
-   FLG_ENUMPREFIXEXCLUDE,
-   FLG_FILESTATICPREFIXEXCLUDE,
-   FLG_GLOBPREFIXEXCLUDE,
-   FLG_TYPEPREFIXEXCLUDE,
-   FLG_EXTERNALPREFIXEXCLUDE,
-   FLG_UNCHECKEDMACROPREFIXEXCLUDE,
-   FLG_LOCALPREFIXEXCLUDE,
-   INVALID_FLAG
-   } ;
-
-/*@iter excludeFlagCodes (yield flagcode code);@*/
-# define excludeFlagCodes(m_c) \
-  { int m_i = 0; while (flagcode_isValid (excludeCodes[m_i])) \
-      { flagcode m_c = excludeCodes[m_i]; m_i++; 
-
-# define end_excludeFlagCodes }}
-
-static bool matchPrefixChar (int nc, int pc)
-{
-  if (nc == pc)
-    {
-      return TRUE;
-    }
-  else
-    {
-      switch (pc)
-	{
-	case PFX_UPPERCASE: 
-	  return isupper (nc);
-	case PFX_LOWERCASE:
-	  return islower (nc);
-	case PFX_ANY:
-	  return TRUE;
-	case PFX_DIGIT:
-	  return isdigit (nc);
-	case PFX_NOTUPPER:
-	  return !isupper (nc);
-	case PFX_NOTLOWER:
-	  return !islower (nc);
-	case PFX_ANYLETTER:
-	  return isalpha (nc);
-	case PFX_ANYLETTERDIGIT: 
-	  return (isdigit (nc) || isalpha (nc));
-	default: return FALSE;
-	}
-    }
-
-  BADEXIT;
-}
-
-static bool matchPrefix (cstring name, cstring prefix)
-{
-  if (cstring_isUndefined (name)
-      || cstring_isUndefined (prefix))
-    {
-      return TRUE;
-    }
-  else
-    {
-      int namelen = cstring_length (name);
-      int last = (int) '\0';
-      int n = 1;
-
-      cstring_chars (prefix, pc)
-	{
-	  int nc;
-
-	  if (pc == '*')
-	    {
-	      n++;
-
-	      
-	      while (n <= namelen)
-		{
-		  nc = (int) cstring_getChar (name, n);
-
-		  if (!matchPrefixChar (nc, last))
-		    {
-		      return FALSE;
-		    }
-		  n++;
-		}
-
-	      return TRUE;
-	    }
-	  else
-	    {
-	      if (n > namelen)
-		{
-		  if ((cstring_length (prefix) >= n + 1)
-		      && cstring_getChar (prefix, n + 1) == '*')
-		    {
-		      return TRUE;
-		    }
-		  else
-		    {
-		      return FALSE;
-		    }
-		}
-	      
-	      nc = (int) cstring_getChar (name, n);
-	      
-	      if (!matchPrefixChar (nc, (int) pc))
-		{
-		  return FALSE;
-		}
-	    }
-	
-	  last = (int) pc;
-	  n++;
-	} end_cstring_chars;
-
-      return TRUE;
-    }
-}
-
-static flagcode
-namespaceExcluded (flagcode code) /*@*/ 
-{
-  switch (code)
-    {
-    case FLG_MACROVARPREFIXEXCLUDE:
-      return (FLG_MACROVARPREFIX);
-    case FLG_TAGPREFIXEXCLUDE:
-      return (FLG_TAGPREFIX);
-    case FLG_ENUMPREFIXEXCLUDE:
-      return (FLG_ENUMPREFIX);
-    case FLG_FILESTATICPREFIXEXCLUDE:
-      return (FLG_FILESTATICPREFIX);
-    case FLG_GLOBPREFIXEXCLUDE:
-      return (FLG_GLOBPREFIX);
-    case FLG_TYPEPREFIXEXCLUDE:
-      return (FLG_TYPEPREFIX);
-    case FLG_EXTERNALPREFIXEXCLUDE:
-      return (FLG_EXTERNALPREFIX);
-    case FLG_UNCHECKEDMACROPREFIXEXCLUDE:
-      return (FLG_UNCHECKEDMACROPREFIX);
-    case FLG_LOCALPREFIXEXCLUDE:
-      return (FLG_LOCALPREFIX);
-    case FLG_ITERPREFIXEXCLUDE:
-      return (FLG_ITERPREFIX);
-    case FLG_CONSTPREFIXEXCLUDE:
-      return (FLG_CONSTPREFIX);
-    BADDEFAULT;
-    }
-}
-
-static /*@observer@*/ cstring
-namespaceName (flagcode flag) /*@*/
-{
-  switch (flag)
-    {
-    case FLG_MACROVARPREFIX: 
-      return cstring_makeLiteralTemp ("macro variable");
-    case FLG_TAGPREFIX:  
-      return cstring_makeLiteralTemp ("tag");
-    case FLG_ENUMPREFIX:  
-      return cstring_makeLiteralTemp ("enum member");
-    case FLG_TYPEPREFIX:     
-      return cstring_makeLiteralTemp ("user-defined type");
-    case FLG_FILESTATICPREFIX:
-      return cstring_makeLiteralTemp ("file static");
-    case FLG_GLOBPREFIX: 
-      return cstring_makeLiteralTemp ("global variable");
-    case FLG_EXTERNALPREFIX: 
-      return cstring_makeLiteralTemp ("external");
-    case FLG_LOCALPREFIX: 
-      return cstring_makeLiteralTemp ("local variable");
-    case FLG_CONSTPREFIX: 
-      return cstring_makeLiteralTemp ("constant");
-    case FLG_ITERPREFIX: 
-      return cstring_makeLiteralTemp ("iter");
-    case FLG_UNCHECKEDMACROPREFIX: 
-      return cstring_makeLiteralTemp ("unchecked macro");
-    BADDEFAULT;
-    }
-}
-
-void 
-checkPrefix (uentry ue)
-{
-  cstring name = cstring_undefined;
-  flagcode flag;
-
-  if (uentry_isExpandedMacro (ue))
-    {
-      flag = FLG_UNCHECKEDMACROPREFIX;
-    }
-  else if (uentry_isAnyTag (ue))
-    {
-      flag = FLG_TAGPREFIX;
-    }
-  else if (uentry_isEnumConstant (ue))
-    {
-      flag = FLG_ENUMPREFIX;
-    }
-  else if (uentry_isDatatype (ue))
-    {
-      flag = FLG_TYPEPREFIX;
-    }
-  else if (uentry_isFileStatic (ue))
-    {
-      flag = FLG_FILESTATICPREFIX;
-    }
-  else if (uentry_isGlobal (ue))
-    {
-      flag = FLG_GLOBPREFIX;
-    }
-  else if (uentry_isVariable (ue))
-    {
-      if (uentry_isRefParam (ue))
-	{
-	  return; /* already checked param */
-	}
-
-      if (context_inMacro ())
-	{
-	  if (uentry_isAnyParam (ue))
-	    {
-	      if (uentry_isYield (ue))
-		{
-		  flag = FLG_MACROVARPREFIX;
-		}
-	      else
-		{
-		  flag = FLG_LOCALPREFIX;
-		}
-	    }
-	  else
-	    {
-	      flag = FLG_MACROVARPREFIX;
-	    }
-	}
-      else
-	{
-	  flag = FLG_LOCALPREFIX;
-	}
-    }
-  else if (uentry_isConstant (ue))
-    {
-      flag = FLG_CONSTPREFIX;
-    }
-  else if (uentry_isIter (ue))
-    {
-      flag = FLG_ITERPREFIX;
-    }
-  else if (uentry_isExported (ue))
-    {
-      flag = FLG_EXTERNALPREFIX;
-    }
-  else
-    {
-      llcontbug (message ("What is it: %q", uentry_unparseFull (ue)));
-      return;
-    }
-
-  if (flag == FLG_TYPEPREFIX || flag == FLG_GLOBPREFIX
-      || flag == FLG_ENUMPREFIX || flag == FLG_CONSTPREFIX)
-    {
-      if (flag == FLG_ENUMPREFIX)
-	{
-	  if (!context_getFlag (flag))
-	    {
-	      flag = FLG_CONSTPREFIX;
-	    }
-	}
-
-      if (!context_getFlag (flag))
-	{
-	  flag = FLG_EXTERNALPREFIX;
-	}
-    }
-
-  if (context_getFlag (flag))
-    {
-      name = uentry_getName (ue);
-      
-      
-      if (!matchPrefix (name, context_getString (flag)))
-	{
-	  if (optgenerror
-	      (flag,
-	       message ("%s %s name is not consistent with %s "
-			"namespace prefix \"%s\"",
-			uentry_ekindName (ue),
-			name,
-			namespaceName (flag),
-			context_getString (flag)),
-	       uentry_whereLast (ue)))
-	    {
-	      uentry_setHasNameError (ue);
-	    }
-	}
-    }  
-
-  excludeFlagCodes (code)
-    {
-      bool check = FALSE;
-
-      if (context_getFlag (code))
-	{
-	  /*@-loopswitchbreak@*/
-	  switch (code)
-	    {
-	    case FLG_MACROVARPREFIXEXCLUDE:
-	      check = (flag != FLG_MACROVARPREFIX);
-	      break;
-	    case FLG_TAGPREFIXEXCLUDE:
-	      check = (flag != FLG_TAGPREFIX);
-	      break;
-	    case FLG_ENUMPREFIXEXCLUDE:
-	      check = (flag != FLG_ENUMPREFIX);
-	      break;
-	    case FLG_FILESTATICPREFIXEXCLUDE:
-	      check = (flag != FLG_FILESTATICPREFIX);
-	      break;
-	    case FLG_GLOBPREFIXEXCLUDE:
-	      check = (flag != FLG_GLOBPREFIX);
-	      break;
-	    case FLG_TYPEPREFIXEXCLUDE:
-	      check = (flag != FLG_TYPEPREFIX);
-	      break;
-	    case FLG_EXTERNALPREFIXEXCLUDE:
-	      check = (flag != FLG_EXTERNALPREFIX
-		       && flag != FLG_GLOBPREFIX
-		       && flag != FLG_TYPEPREFIX
-		       && flag != FLG_UNCHECKEDMACROPREFIX);
-	      break;
-	    case FLG_UNCHECKEDMACROPREFIXEXCLUDE:
-	      check = (flag != FLG_UNCHECKEDMACROPREFIX);
-	      break;
-	    case FLG_LOCALPREFIXEXCLUDE:
-	      check = (flag != FLG_LOCALPREFIX);
-	      break;
-	    case FLG_CONSTPREFIXEXCLUDE:
-	      check = (flag != FLG_CONSTPREFIX);
-	      break;
-	    case FLG_ITERPREFIXEXCLUDE:
-	      check = (flag != FLG_ITERPREFIX);
-	      break;
-	    BADDEFAULT;
-	    }
-	  /*@=loopswitchbreak@*/
-
-	  if (check)
-	    {
-	      flagcode rcode = namespaceExcluded (code);
-	      cstring pstring = context_getString (rcode);
-
-	      if (cstring_isDefined (pstring))
-		{
-		  if (cstring_isUndefined (name))
-		    {
-		      name = uentry_getName (ue);
-		    }
-		  
-		  if (matchPrefix (name, context_getString (rcode)))
-		    {
-		      if (optgenerror
-			  (code,
-			   message
-			   ("%s %s name is not a %s (it is a %s), "
-			    "but matches the %s "
-			    "namespace prefix \"%s\"",
-			    uentry_ekindName (ue),
-			    name,
-			    namespaceName (rcode),
-			    namespaceName (flag),
-			    namespaceName (rcode),
-			    context_getString (rcode)),
-			   uentry_whereLast (ue)))
-			{
-			  uentry_setHasNameError (ue);
-			}
-		    }
-		}
-	    }
-	} 
-    } end_excludeFlagCodes ;
-
-  cstring_free (name);
-}
-
-static void
-checkNationalName (uentry ue)
-{
-  flagcode czechflag;
-  flagcode slovakflag;
-  flagcode czechoslovakflag;
-  bool gcf, gsf, gcsf;
-
-  
-  if (uentry_isFunction (ue)
-      || uentry_isIter (ue)
-      || uentry_isEndIter (ue))
-    {
-      czechflag = FLG_CZECHFUNCTIONS;
-      slovakflag = FLG_SLOVAKFUNCTIONS;
-      czechoslovakflag = FLG_CZECHOSLOVAKFUNCTIONS;
-    }
-  else if (uentry_isExpandedMacro (ue))
-    {
-      czechflag = FLG_CZECHMACROS;
-      slovakflag = FLG_SLOVAKMACROS;
-      czechoslovakflag = FLG_CZECHOSLOVAKMACROS;
-    }
-  else if (uentry_isVariable (ue))
-    {
-      if (uentry_isGlobal (ue) && context_getFlag (FLG_GLOBPREFIX))
-	{
-	  /* prefix checks supercede national naming checks */
-	  return;
-	}
-
-      czechflag = FLG_CZECHVARS;
-      slovakflag = FLG_SLOVAKVARS;
-      czechoslovakflag = FLG_CZECHOSLOVAKVARS;
-    }
-  else if (uentry_isConstant (ue))
-    {
-      if (uentry_isGlobal (ue) && context_getFlag (FLG_CONSTPREFIX))
-	{
-	  /* prefix checks supercede national naming checks */
-	  return;
-	}
-
-      czechflag = FLG_CZECHCONSTANTS;
-      slovakflag = FLG_SLOVAKCONSTANTS;
-      czechoslovakflag = FLG_CZECHOSLOVAKCONSTANTS;
-    }
-  else
-    {
-      if (uentry_isAnyTag (ue) || uentry_isEnumConstant (ue))
-	{
-	  return; /* no errors for tags */
-	}
-      
-      llassert (uentry_isDatatype (ue));
-
-      czechflag = FLG_CZECHTYPES;
-      slovakflag = FLG_SLOVAKTYPES;
-      czechoslovakflag = FLG_CZECHOSLOVAKTYPES;
-    }
-
-  gcf = context_getFlag (czechflag);
-  gsf = context_getFlag (slovakflag);
-  gcsf = context_getFlag (czechoslovakflag);
-
-  if (gcf || (uentry_isFunction (ue) 
-	      && context_getFlag (FLG_ACCESSCZECH)))
-    {
-            (void) checkCzechName (ue, czechflag, gcf);
-    }
-
-  if (gsf || (uentry_isFunction (ue) 
-	      && context_getFlag (FLG_ACCESSSLOVAK)))
-    {
-      (void) checkSlovakName (ue, slovakflag, gsf);
-    }
-
-  if (gcsf)
-    {
-      if (uentry_isDatatype (ue))
-	{
-	  /* May not have either _'s or uppercase letter */
-	  cstring name = uentry_rawName (ue);
-	  int charno = 1;
-
-	  cstring_chars (name, c)
-	    {
-	      if (isupper ((unsigned char) c))
-		{
-		  if (optgenerror
-		      (FLG_CZECHOSLOVAKTYPES,
-		       message
-		       ("%s %q name violates Czechoslovak naming convention.  "
-			"Czechoslovak datatype names should not use uppercase "
-			"letters.",
-			uentry_ekindName (ue),
-			uentry_getName (ue)),
-		       uentry_whereLast (ue)))
-		    {
-		      uentry_setHasNameError (ue);
-		    }
-		  break;
-		}
-
-	      if (c == '_' && charno != 2 && charno != 3)
-		{
-		  if (optgenerror
-		      (FLG_CZECHOSLOVAKTYPES,
-		       message ("%s %q name violates Czechoslovak naming "
-				"convention.  Czechoslovak datatype names "
-				"should not use the _ charater.",
-				uentry_ekindName (ue),
-				uentry_getName (ue)),
-		       uentry_whereLast (ue)))
-		    {
-		      uentry_setHasNameError (ue);
-		    }
-		  break;
-		}
-	      
-	      charno++;
-	    } end_cstring_chars;
-	}
-      else
-	{
-	  bool okay = checkCzechName (ue, czechflag, FALSE);
-	  
-	  /* still need to call, to set access */
-	  okay |= checkSlovakName (ue, slovakflag, FALSE);
-	  
-	  if (!okay)
-	    {
-	      if (optgenerror
-		  (czechoslovakflag,
-		   message ("%s %q name is not consistent with Czechoslovak "
-			    "naming convention.",
-			    uentry_ekindName (ue),
-			    uentry_getName (ue)),
-		   uentry_whereLast (ue)))
-		{
-		  uentry_setHasNameError (ue);
-		}
-	    }
-	}
-    }
-}
-
-static bool checkCzechName (uentry ue, flagcode czechflag, bool report)
-{
-  if (uentry_isDatatype (ue))
-    {
-      /*
-      ** Czech datatypes may not have _'s, except if there are 1 or 2 characters
-      ** before the only _.
-      */
-
-      cstring name = uentry_rawName (ue);
-      int charno = 1;
-      
-      cstring_chars (name, c)
-	{
-	  if (c == '_' && charno != 2 && charno != 3)
-	    {
-	      if (report)
-		{
-		  if (optgenerror
-		      (FLG_CZECHTYPES,
-		       message 
-		       ("%s %q name violates Czech naming convention.  "
-			"Czech datatype names should not use the _ charater.",
-			uentry_ekindName (ue),
-			uentry_getName (ue)),
-		       uentry_whereLast (ue)))
-		    {
-		      uentry_setHasNameError (ue);
-		    }
-		}
-
-	      return FALSE;
-	    }
-	  
-	  charno++;
-	} end_cstring_chars;
-    }
-  else
-    {
-      typeIdSet acc = context_fileAccessTypes ();
-      cstring pfx = czechPrefix (uentry_rawName (ue));
-
-      if (cstring_isEmpty (pfx))
-	{
-	  if (uentry_isVariable (ue) || uentry_isConstant (ue))
-	    {
-	      ctype ct = uentry_getType (ue);
-	      
-	      if (ctype_isAbstract (ct)
-		  && context_hasAccess (ctype_typeId (ct)))
-		{
-		  if (report)
-		    {
-		      if (optgenerror
-			  (czechflag,
-			   message ("%s %q name is not consistent with Czech "
-				    "naming convention.  The name should "
-				    "begin with %s_",
-				    uentry_ekindName (ue),
-				    uentry_getName (ue),
-				    ctype_unparse (ct)),
-			   uentry_whereLast (ue)))
-			{
-			  uentry_setHasNameError (ue);
-			}
-		    }
-
-		  cstring_free (pfx);
-		  return FALSE;
-		}
-	    }
-	  else if (uentry_isFunction (ue) || uentry_isIter (ue))
-	    {
-	      if (typeIdSet_isEmpty (acc))
-		{
-		  ; /* okay - should not be czech name */
-		}
-	      else
-		{
-		  if (report)
-		    {
-		      if (optgenerror
-			  (czechflag,
-			   message ("%s %q name is not consistent with Czech "
-				    "naming convention.  Accessible types: %q",
-				    uentry_ekindName (ue),
-				    uentry_getName (ue),
-				    typeIdSet_unparse (acc)),
-			   uentry_whereLast (ue)))
-			{
-			  uentry_setHasNameError (ue);
-			}
-		    }
-
-		  cstring_free (pfx);
-		  return FALSE;
-		}
-	    }
-	  else
-	    {
-	      ;
-	    }
-	}
-      else
-	{
-	  if (usymtab_existsTypeEither (pfx))
-	    {
-	      ctype ct = usymtab_lookupAbstractType (pfx);
-	      typeId tid;
-	      
-	      if (ctype_isUA (ct))
-		{
-		  tid = ctype_typeId (ct);
-		  
-		  if (ctype_isUser (ct) || context_hasAccess (tid))
-		    {
-		      ;
-		    }
-		  else
-		    {
-		      if (context_getFlag (FLG_ACCESSCZECH)
-			  || context_getFlag (FLG_ACCESSCZECHOSLOVAK))
-			{
-			  if (!uentry_isVar (ue))
-			    {
-			      uentry_addAccessType (ue, tid);
-			    }
-			}
-		      else
-			{
-			  if (report)
-			    {
-			      if (llgenhinterror
-				  (czechflag,
-				   message 
-				   ("%s %q name violates Czech naming "
-				    "convention. Czech prefix %s names "
-				    "an abstract type that is "
-				    "not accessible.",
-				    uentry_ekindName (ue),
-				    uentry_getName (ue),
-				    pfx),
-				   cstring_makeLiteral 
-				   ("Use +accessczech to allow access to "
-				    "type  in functions "
-				    "named _."), 
-				   uentry_whereLast (ue)))
-				{
-				  uentry_setHasNameError (ue);
-				}
-			    }
-			  
-			  cstring_free (pfx);
-			  return FALSE;
-			}
-		    }
-		}
-	      else if (ctype_isManifestBool (ct))
-		{
-		  if (context_canAccessBool ())
-		    {
-		      ;
-		    }
-		  else
-		    {
-		      if (context_getFlag (FLG_ACCESSCZECH)
-			  || context_getFlag (FLG_ACCESSCZECHOSLOVAK))
-			{
-			  if (!uentry_isVar (ue))
-			    {
-			      tid = usymtab_getTypeId (context_getBoolName ());
-			      uentry_addAccessType (ue, tid);
-			    }
-			}
-		      else
-			{
-			  if (report)
-			    {
-			      if (llgenhinterror
-				  (czechflag,
-				   message
-				   ("%s %q name violates Czech naming "
-				    "convention. Type bool is not accessible.",
-				    uentry_ekindName (ue),
-				    uentry_getName (ue)),
-				   cstring_makeLiteral 
-				   ("Use +accessczech to allow access to "
-				    "type  in functions named _."), 
-				   uentry_whereLast (ue)))
-				{
-				  uentry_setHasNameError (ue);
-				}
-			    }
-			  
-			  cstring_free (pfx);
-			  return FALSE;
-			}
-		    }
-		}
-	      else
-		{
-		  ;
-		}
-	    }
-	  else
-	    {
-	      if (cstring_equalLit (pfx, "int")
-		  || cstring_equalLit (pfx, "char")
-		  || cstring_equalLit (pfx, "short")
-		  || cstring_equalLit (pfx, "long")
-		  || cstring_equalLit (pfx, "unsigned")
-		  || cstring_equalLit (pfx, "signed")
-		  || cstring_equalLit (pfx, "float")
-		  || cstring_equalLit (pfx, "double"))
-		{
-		  ; /* built-in types */
-		}
-	      else
-		{
-		  /* no accessible types, could match module name */
-		  
-		  if (cstring_equal (pfx, context_moduleName ()))
-		    {
-		      ;
-		    }
-		  else
-		    {
-		      if (report)
-			{
-			  if (optgenerror
-			      (czechflag,
-			       message 
-			       ("%s %q name violates Czech naming convention.  "
-				"Czech prefix %s is not the name of a type.",
-				uentry_ekindName (ue),
-				uentry_getName (ue),
-				pfx),
-			       uentry_whereLast (ue)))
-			    {
-			      uentry_setHasNameError (ue);
-			    }
-			}
-
-		      cstring_free (pfx);		      
-		      return FALSE;
-		    }
-		}
-	    }
-	}
-      cstring_free (pfx);
-    }
-
-  return TRUE;
-}
-
-static bool checkSlovakName (uentry ue, flagcode slovakflag, bool report)
-{
-  if (uentry_isDatatype (ue))
-    {
-      /*
-      ** Slovak datatypes may not have uppercase letters.
-      */
-
-      if (context_getFlag (FLG_SLOVAK))
-	{
-	  cstring name = uentry_rawName (ue);
-
-	  cstring_chars (name, c)
-	    {
-	      if (isupper ((unsigned char) c))
-		{
-		  if (report)
-		    {
-		      if (optgenerror
-			  (FLG_SLOVAKTYPES,
-			   message 
-			   ("%s %q name violates Slovak naming convention.  "
-			    "Slovak datatype names should not use uppercase "
-			    "letters.",
-			    uentry_ekindName (ue),
-			    uentry_getName (ue)),
-			   uentry_whereLast (ue)))
-			{
-			  uentry_setHasNameError (ue);
-			}
-		    }
-		  return FALSE;
-		}
-	    } end_cstring_chars;
-	}
-    }
-  else
-    {
-      typeIdSet acc = context_fileAccessTypes ();
-      cstring pfx = slovakPrefix (uentry_rawName (ue));
-      
-      if (cstring_isEmpty (pfx))
-	{
-	  if (typeIdSet_isEmpty (acc))
-	    {
-	      ; /* okay - should not be slovak name */
-	    }
-	  else
-	    {
-	      if (uentry_isFunction (ue))
-		{
-		  if (report)
-		    {
-		      if (optgenerror
-			  (slovakflag,
-			   message ("%s %q name is not consistent with Slovak "
-				    "naming convention.  Accessible types: %q",
-				    uentry_ekindName (ue),
-				    uentry_getName (ue),
-				    typeIdSet_unparse (acc)),
-			   uentry_whereLast (ue)))
-			{
-			  uentry_setHasNameError (ue);
-			}
-		    }
-		  
-		  cstring_free (pfx);
-		  return FALSE;
-		}
-	      else
-		{
-		  ctype ct = uentry_getType (ue);
-		  
-		  if (ctype_isUA (ct))
-		    {
-		      if (report)
-			{
-			  if (optgenerror
-			      (slovakflag,
-			       message ("%s %q name is not consistent with "
-					"Slovak naming convention.  The "
-					"name should begin with %s followed "
-					"by an uppercase letter.",
-					uentry_ekindName (ue),
-					uentry_getName (ue),
-					ctype_unparse (ct)),
-			       uentry_whereLast (ue)))
-			    {
-			      uentry_setHasNameError (ue);
-			    }	
-			}
-		      
-		      cstring_free (pfx);
-		      return FALSE;
-		    }
-		}
-	    }
-	}
-      else
-	{
-	  if (usymtab_existsTypeEither (pfx))
-	    {
-	      ctype ct = usymtab_lookupAbstractType (pfx);
-	      typeId tid;
-	      
-	      if (ctype_isUA (ct))
-		{
-		  tid = ctype_typeId (ct);
-		  
-		  if (ctype_isUser (ct) || context_hasAccess (tid))
-		    {
-		      ;
-		    }
-		  else
-		    {
-		      if (context_getFlag (FLG_ACCESSSLOVAK)
-			  || context_getFlag (FLG_ACCESSCZECHOSLOVAK))
-			{
-			  if (!uentry_isVar (ue))
-			    {
-			      uentry_addAccessType (ue, tid);
-			    }
-			}
-		      else
-			{
-			  if (report)
-			    {
-			      if (llgenhinterror
-				  (slovakflag,
-				   message 
-				   ("%s %q name violates Slovak naming "
-				    "convention. Slovak prefix %s names "
-				    "an abstract type that is not accessible.",
-				    uentry_ekindName (ue),
-				    uentry_getName (ue),
-				    pfx),
-				   cstring_makeLiteral 
-				   ("Use +accessslovak to allow access to "
-				    "type  in functions named _."), 
-				   uentry_whereLast (ue)))
-				{
-				  uentry_setHasNameError (ue);
-				}
-			    }
-			  
-			  cstring_free (pfx);
-			  return FALSE;
-			}
-		    }
-		}
-	      else if (ctype_isManifestBool (ct))
-		{
-		  if (context_canAccessBool ())
-		    {
-		      ;
-		    }
-		  else
-		    {
-		      if (context_getFlag (FLG_ACCESSSLOVAK)
-			  || context_getFlag (FLG_ACCESSCZECHOSLOVAK))
-			{
-			  if (!uentry_isVar (ue))
-			    {
-			      tid = usymtab_getTypeId (context_getBoolName ());
-			      uentry_addAccessType (ue, tid);
-			    }
-			}
-		      else
-			{
-			  if (report)
-			    {
-			      if (llgenhinterror
-				  (slovakflag,
-				   message
-				   ("%s %q name violates Slovak naming convention.  "
-				    "Type bool is not accessible.",
-				    uentry_ekindName (ue),
-				    uentry_getName (ue)),
-				   cstring_makeLiteral
-				   ("Use +accessslovak to allow access to "
-				    "type  in functions named _."),
-				   uentry_whereLast (ue)))
-				{
-				  uentry_setHasNameError (ue);
-				}
-			    }
-			  
-			  cstring_free (pfx);
-			  return FALSE;
-			}
-		    }
-		}
-	      else
-		{
-		  ;
-		}
-	    }
-	  else
-	    {
-	      if (cstring_equalLit (pfx, "int")
-		  || cstring_equalLit (pfx, "char")
-		  || cstring_equalLit (pfx, "short")
-		  || cstring_equalLit (pfx, "long")
-		  || cstring_equalLit (pfx, "unsigned")
-		  || cstring_equalLit (pfx, "signed")
-		  || cstring_equalLit (pfx, "float")
-		  || cstring_equalLit (pfx, "double"))
-		{
-		  ; /* built-in types */
-		}
-	      else
-		{
-		  /* no accessible types, could match module name */
-		  
-		  if (cstring_equal (pfx, context_moduleName ()))
-		    {
-		      ;
-		    }
-		  else
-		    {
-		      if (report)
-			{
-			  if (optgenerror
-			      (slovakflag,
-			       message 
-			       ("%s %q name violates Slovak naming convention.  "
-				"Slovak prefix %s is not the name of a type.",
-				uentry_ekindName (ue),
-				uentry_getName (ue),
-				pfx),
-			       uentry_whereLast (ue)))
-			    {
-			      uentry_setHasNameError (ue);
-			    }
-			}
-
-		      cstring_free (pfx);
-		      return FALSE;
-		    }
-		}
-	    }
-	}
-
-      cstring_free (pfx);
-    }
-
-  return TRUE;
-}
-
-void
-checkGlobalName (uentry ue)
-{
-  if (!uentry_isStatic (ue) && uentry_hasName (ue))
-    {
-      checkNationalName (ue);
-    }
-  else
-    {
-      ;
-    }
-}
-
-void
-checkLocalName (/*@unused@*/ uentry ue)
-{
-  ;
-}
-
-/*
-** Checks a name used by user source is not reserved by ANSI 
-** (or for future library functions).
-**
-** The restrictions are described in X3.159-1989: 4.13
-*/
-
-/*@constant int NRESERVEDNAMES; @*/
-# define NRESERVEDNAMES 201
-
-/*@constant int NCPPNAMES@*/
-# define NCPPNAMES 39
-
-bool checkCppName (cstring name, fileloc loc)
-{
-  static ob_mstring cppNames[NCPPNAMES] =
-    {
-      "and", "and_eq", "asm", 
-      "bitand", "bitor", "bool", /* gasp: "bool", is special for lclint */
-      "catch", "class", "compl", "const_class",
-      "delete", "dynamic_cast", "false", "friend",
-      "inline", "mutable", "namespace", "new",
-      "not", "not_eq",
-      "operator", "or", "or_eq", "overload",
-      "private", "protected", "public",
-      "reinterpret_cast", "static_cast",
-      "template", "this", "throw", "true", "try",
-      "typeid", "using", "virtual", "xor", "xor_eq"
-      } ;
-  
-  if (cstring_isDefined (cstring_bsearch (name, &cppNames[0],
-					  NCPPNAMES)))
-    {
-      return (optgenerror
-	      (FLG_CPPNAMES,
-	       message ("Name %s is a keyword or reserved word in C++",
-			name),
-	       loc));
-    }
-
-  return FALSE;
-}
-
-bool
-checkAnsiName (cstring name, fileloc loc)
-{
-  bool hasError = FALSE;
-  int length = cstring_length (name);
-  char fchar = (length >= 1) ? cstring_firstChar (name) : '\0';
-  char schar = (length >= 2) ? cstring_secondChar (name) : '\0';
-  char tchar = (length >= 3) ? cstring_getChar (name, 3) : '\0';
-  char rchar = (length >= 4) ? cstring_getChar (name, 4) : '\0';
-
-  /* 
-  ** reservedNames
-  **   taken from Linden, "Expert C Programming", p. 126-8. 
-  **   invariant:  must be sorted (case-insensitive, lexicographically)
-  **               must end with NULL
-  */
-
-  static ob_mstring reservedNames[NRESERVEDNAMES] =
-    { 
-# include "reservedNames.nf"
-    } ;
-
-  if (fileloc_isSystemFile (loc) || fileloc_isBuiltin (loc))
-    {
-      return FALSE;  /* no errors for system files */
-    }
-
-# if 0
-  {
-    int i = 0;
-    char *lastname = NULL;
-    char *name;
-    
-    while ((name = reservedNames[i]) != NULL)
-      {
-	llassertprint (lastname == NULL
-		       || strcmp (name, lastname) > 0,
-		       ("%s / %s", lastname, name));
-	lastname = name;
-	i++;
-      }
-    
-    nreservedNames = i - 1;
-  }
-# endif
-  
-  if (cstring_isDefined (cstring_bsearch (name, &reservedNames[0],
-					  NRESERVEDNAMES)))
-    {
-      return (optgenerror
-	      (FLG_ANSIRESERVED,
-	       message ("Name %s is reserved for the standard library",
-			name),
-	       loc));
-    }
-
-  if (fchar == '_')
-    {
-      hasError = optgenerror
-	(FLG_ANSIRESERVED,
-	 message 
-	 ("Name %s is in the implementation name space (any identifier "
-	  "beginning with underscore)", 
-	  name),
-	 loc);
-    }
-
-  /*
-  ** 4.13.1 Errors 
-  **
-  ** Macros that begin with E and a digit or E and an uppercase letter ...
-  */
-
-  else if (fchar == 'E' && (isdigit ((int) schar) 
-			    || isupper ((int) schar)))
-    {
-      hasError = optgenerror
-	(FLG_ANSIRESERVED,
-	 message 
-	 ("Name %s is reserved for future ANSI library extensions. "
-	  "Macros beginning with E and a digit or uppercase letter "
-	  "may be added to . (See ANSI, Section 4.13.1)",
-	  name),
-	 loc);
-    }
-  
-  /*
-  ** 4.13.2 Character Handling 
-  **
-  ** Function names that begin with either "is" or "to" and a lowercase letter ...
-  */
-
-  else if (((fchar == 'i' && schar == 's') 
-	    || (fchar == 't' && schar == 'o'))
-	   && (islower ((int) tchar)))
-    {
-      hasError = optgenerror
-	(FLG_ANSIRESERVED,
-	 message
-	 ("Name %s is reserved for future ANSI library extensions.  "
-	  "Functions beginning with \"is\" or \"to\" and a lowercase "
-	  "letter may be added to . (See ANSI, Section 4.13.2)",
-	  name),
-	 loc);
-    }
-  
-  /*
-  ** 4.13.3 Localization 
-  **
-  ** Macros that begin with LC_ and an uppercase letter ...
-  */
-
-  else if (length >= 4 
-	   && ((fchar == 'L')
-	       && (schar == 'C')
-	       && (tchar == '_'))
-	   && (isupper ((int) rchar)))
-    {
-      hasError = optgenerror
-	(FLG_ANSIRESERVED,
-	 message
-	 ("Name %s is reserved for future ANSI library extensions.  "
-	  "Macros beginning with \"LC_\" and an uppercase letter may "
-	  "be added to . (See ANSI, Section 4.13.3)",
-	  name),
-	 loc);
-    }
-  
-  /*
-  ** 4.13.4 Mathematics 
-  **
-  ** The names of all existing functions declared in the  header, 
-  ** suffixed with f or l...
-  */
-
-  else if ((cstring_lastChar (name) == 'f' || cstring_lastChar (name) == 'l')
-	   && 
-	   (((length == 4)
-	     && ((cstring_equalPrefix (name, "cos") ||
-		  cstring_equalPrefix (name, "sin") ||
-		  cstring_equalPrefix (name, "tan") ||
-		  cstring_equalPrefix (name, "exp") ||
-		  cstring_equalPrefix (name, "log") ||
-		  cstring_equalPrefix (name, "pow"))))
-	    || ((length == 5)
-		&& ((cstring_equalPrefix (name, "acos") ||
-		     cstring_equalPrefix (name, "asin") ||
-		     cstring_equalPrefix (name, "atan") ||
-		     cstring_equalPrefix (name, "cosh") ||
-		     cstring_equalPrefix (name, "sinh") ||
-		     cstring_equalPrefix (name, "sqrt") ||
-		     cstring_equalPrefix (name, "ceil") ||
-		     cstring_equalPrefix (name, "fabs") ||
-		     cstring_equalPrefix (name, "fmod") ||
-		     cstring_equalPrefix (name, "tanh") ||
-		     cstring_equalPrefix (name, "modf"))))
-	    || ((length == 6)
-		&& ((cstring_equalPrefix (name, "atan2") ||
-		     cstring_equalPrefix (name, "floor") ||
-		     cstring_equalPrefix (name, "frexp") ||
-		     cstring_equalPrefix (name, "ldexp") ||
-		     cstring_equalPrefix (name, "log10"))))))
-    {
-      hasError = optgenerror
-	(FLG_ANSIRESERVED,
-	 message
-	 ("Name %s is reserved for future ANSI library extensions.  "
-	  "The names of all existing functions in  suffixed "
-	  "with 'f' or 'l' may be added to . (See ANSI, Section 4.13.4)",
-	  name),
-	 loc);
-    }
-  
-  /*
-  ** 4.13.5 Signal Handling 
-  **
-  ** Macros that begin with either SIG or SIG_ and an uppercase letter or...
-  */
-
-  else if (fchar == 'S' && schar == 'I' && tchar == 'G'
-	   && ((rchar == '_' && ((length >= 5 
-				  && isupper ((int) cstring_getChar (name, 5)))))
-	       || (isupper ((int) rchar))))
-    {
-      hasError = optgenerror
-	(FLG_ANSIRESERVED,
-	 message
-	 ("Name %s is reserved for future ANSI library extensions.  "
-	  "Macros that begin with SIG and an uppercase letter or SIG_ "
-	  "and an uppercase letter may be added to "
-	  ". (See ANSI, Section 4.13.5)",
-	  name),
-	 loc);
-    }
-  
-  /*
-  ** 4.13.6 Input/Output 
-  **
-  ** (nothing to check)
-  */
-
-  /*
-  ** 4.13.7 General Utilities 
-  **
-  ** Functions names that begin with str and a lowercase letter may be added to .
-  */
-
-  else if (fchar == 's' && schar == 't' && tchar == 'r' 
-	   && (islower ((int) rchar)))
-    {
-      hasError = optgenerror
-	(FLG_ANSIRESERVED,
-	 message
-	 ("Name %s is reserved for future ANSI library extensions.  "
-	  "Functions that begin with \"str\" and a lowercase letter "
-	  "may be added to  or . (See ANSI, Section 4.13.7)",
-	  name),
-	 loc);
-    }
-  
-  /*
-  ** 4.13.8 String Handling 
-  **
-  ** Function names that begin with str, mem, or wcs and a lowercase letter ...
-  **
-  ** (Note: already checked "str" above.)
-  */
-
-  else if (((fchar == 'm' && schar == 'e' && tchar == 'm')
-	    || (fchar == 'w' && schar == 'c' && tchar == 's'))
-	   && (islower ((int) rchar)))
-    {
-      hasError = optgenerror
-	(FLG_ANSIRESERVED,
-	 message
-	 ("Name %s is reserved for future ANSI library extensions.  "
-	  "Functions that begin with \"mem\" or \"wcs\" and a "
-	  "lowercase letter letter may be added to . (See ANSI, Section 4.13.8)",
-	  name),
-	 loc);
-    }
-  else
-    {
-      ;
-    }
-
-  return hasError;
-}
-
-void checkParamNames (uentry ue)
-{
-  cstring fpfx = context_getString (FLG_DECLPARAMPREFIX);
-  bool noformal = context_getFlag (FLG_DECLPARAMNAME);
-
-  llassert (uentry_isFunction (ue));
-  
-  if (cstring_isDefined (fpfx) || noformal)
-    {
-      uentryList params = uentry_getParams (ue);
-      
-      uentryList_elements (params, p)
-	{
-	  if (uentry_hasName (p))
-	    {
-	      if (noformal && !cstring_isDefined (fpfx))
-		{
-		  if (optgenerror
-		      (FLG_DECLPARAMNAME, 
-		       message ("Declaration parameter has name: %q",
-				uentry_getName (p)),
-		       uentry_whereLast (p)))
-		    {
-		      uentry_setHasNameError (p);
-		    }
-		}
-	      else
-		{
-		  cstring pname = uentry_getName (p);
-		  
-		  if (!cstring_equalPrefix (pname, cstring_toCharsSafe (fpfx)))
-		    {
-		      if (context_getFlag (FLG_NAMECHECKS))
-			{
-			  if (optgenerror
-			      (FLG_DECLPARAMPREFIX, 
-			       message ("Declaration parameter name %s does not begin "
-					"with protoparamprefix (%s)",
-					pname, fpfx),
-			       uentry_whereLast (p)))
-			    {
-			      uentry_setHasNameError (p);
-			    }
-			}
-		    }
-		  cstring_free (pname);
-		}
-	    }
-	} end_uentryList_elements ;
-    }
-}
-
-
-
-
diff --git a/src/osd.c b/src/osd.c
deleted file mode 100644
index 171223b..0000000
--- a/src/osd.c
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** osd.c
-**
-** Provide a system-independent interface to system-dependent
-** file operations.
-*/
-
-/*
- * Modified by Herbert 04/19/97:
- * - added conditional 'OS2' to conditional 'MSDOS'
- * - added include of new header portab.h.
- * - changed '/' to macro.
- * - added DOS / OS/2 specific stuff in osd_getPath.
- * Herbert 06/12/2000:
- * - added OS/2 specific includes before osd_getPid()
- * - handle files like in WIN32 for OS/2 in osd_fileExists()
- */
-
-/*@-allmacros*/
-/*@ignore@*/
-# include 
-# include 
-/* Fix suggested by Lars Rasmussen */
-# include 
-/*@end@*/
-/*@=allmacros*/
-# include "lclintMacros.nf"
-# include "basic.h"
-# include "osd.h"
-# include "portab.h"
-
-/* from stat.h */
-/*@ignore@*/
-extern int stat (const char *, /*@out@*/ struct stat *);
-/*@end@*/
-
-static bool osd_executableFileExists (char *);
-
-static bool nextdir (char **p_current_dir, /*@out@*/ char **p_dir, 
-		     /*@out@*/ size_t *p_len);
-
-extern char *LSLRootName (char *filespec)
-{
-  char *result, *startName, *tail;
-  size_t nameLength;
-
-  tail = strrchr (filespec, CONNECTCHAR);
-  startName = (tail == NULL ? filespec : &tail[1]);
-  tail = strrchr (startName, '.');
-  nameLength = (tail == NULL ? strlen (startName) 
-		: size_fromInt (tail - startName));
-  result = dmalloc (nameLength + 1);
-  strncpy (result, startName, nameLength);
-  result[(int) nameLength] = '\0';
-  return result;
-}
-
-extern /*@observer@*/ char *
-osd_getEnvironment (char *env, /*@returned@*/ char *def)
-{
-  char *ret = osd_getEnvironmentVariable (env);
-
-  if (ret == NULL)
-    {
-      return def;
-    }
-  else
-    {
-      return ret;
-    }
-}
-
-
-/*
-**++
-**  FUNCTIONAL DESCRIPTION:
-**
-**      This function attempts to locate a file in a search list.  On VMS, it
-**	just concatinates the path and file names, and then lets RMS do the
-**	searching.  On Ultrix, it searches for the file on the path.
-**
-**  FORMAL PARAMETERS:
-**
-**      path:	    search path where to look for the file.
-**	file:	    name of file to search for.
-**	returnPath: if a file is found, this is where the concatenated
-**		    directory and file name are returned.
-**
-**  RETURN VALUE:
-**
-**      OSD_FILEFOUND:	    the file was found on the search list.
-**	OSD_FILENOTFOUND    the file was not found.
-**	OSD_PATHTOOLONG	    the concatenated directory and file name are too
-**			    long.
-**
-**  SIDE EFFECTS:
-**
-**      None
-**
-**  PRECONDITIONS:
-**
-**  	Requires that parameters, path and file, are valid C strings.
-**
-**
-**--
-*/
-
-extern /*@null@*/ /*@observer@*/ char *
-  osd_getHomeDir ()
-{
-  /* Would something different be better for windows? */
-  return (osd_getEnvironmentVariable ("HOME"));
-}
-
-filestatus osd_findOnLarchPath (char *file, char **returnPath)
-{
-  return (osd_getPath (cstring_toCharsSafe (context_getLarchPath ()), file, returnPath));
-}
-
-extern filestatus
-osd_getPath (char *path, char *file, char **returnPath)
-{
-  char *fullPath;
-  char *dirPtr;
-  size_t dirLen;
-  char aPath[MAXPATHLEN];
-  filestatus rVal = OSD_FILENOTFOUND;	/* assume file not found. */
-
-  fullPath = path;
-
-  if (fullPath == NULL || 
-# if defined(OS2) || defined(MSDOS) || defined(WIN32)
-    /* under OS/2 and MSDOS the includePath may be empty, if so, search 
-     * the current directory. */
-    *fullPath == '\0' || 
-    (*file == CONNECTCHAR || (file[0] != '\0' && file[1] == ':')))
-# else
-     (*file == CONNECTCHAR))
-# endif
-    {
-     /* No path specified. Look for it in the current directory.	    */
-
-      strcpy (&aPath[0], file);
-
-      if (osd_fileExists (&aPath[0]))
-	{
-	  rVal = OSD_FILEFOUND;
-   	  *returnPath = dmalloc (strlen (&aPath[0]) + 1);
-	  strcpy (*returnPath, &aPath[0]);
-	}
-    }
-  else
-    {
-     /* Path specified. Loop through directories in path looking for the */
-     /* first occurrence of the file.				    */
-
-      while (nextdir (&fullPath, &dirPtr, &dirLen) &&
-	     rVal == OSD_FILENOTFOUND)
-	{
-	  if ((dirLen + strlen (file) + 2) <= MAXPATHLEN)
-	    {
-	     /* Cat directory and filename, and see if file exists.  */
-	      strncpy (&aPath[0], dirPtr, dirLen);
-	      strcpy (&aPath[0] + dirLen, "");	/* Null terminate aPath. */
-	      strcat (&aPath[0], CONNECTSTR);
-	      strcat (&aPath[0], file);
-
-	      if (osd_fileExists (&aPath[0]))
-		{
-		  rVal = OSD_FILEFOUND;
-   		  *returnPath = (char *) dmalloc (strlen (&aPath[0]) + 1);
-		  strcpy (*returnPath, &aPath[0]);
-		}
-	    }
-	  else
-	    {
-	      rVal = OSD_PATHTOOLONG;
-	    }
-	}	
-    }
-
-  return rVal;
-}
-
-extern filestatus
-osd_getExePath (char *path, char *file, char **returnPath)
-{
-  char *fullPath;
-  char *dirPtr;
-  size_t dirLen;
-  char aPath[MAXPATHLEN];
-  filestatus rVal = OSD_FILENOTFOUND;	/* assume file not found. */
-  
-  fullPath = osd_getEnvironmentVariable (path);
-
-  if (fullPath == NULL)
-    {
-     /* No path specified. Look for it in the current directory. */
-
-      strcpy (&aPath[0], file);
-
-      if (osd_fileExists (&aPath[0]))
-	{
-	  rVal = OSD_FILEFOUND;
-   	  *returnPath = dmalloc (strlen (&aPath[0]) + 1);
-	  strcpy (*returnPath, &aPath[0]);
-	}
-    }
-  else
-    {
-     /* 
-     ** Path specified. Loop through directories in path looking
-     ** for the first occurrence of the file.				    
-     */
-
-      while (nextdir (&fullPath, &dirPtr, &dirLen) &&
-	     rVal == OSD_FILENOTFOUND)
-	{
-	  if ((dirLen + strlen (file) + 2) <= MAXPATHLEN)
-	    {
-	      /* Cat directory and filename, and see if file exists.  */
-	      strncpy (&aPath[0], dirPtr, dirLen);
-	      strcpy (&aPath[0] + dirLen, ""); /* Null terminate aPath. */
-	      strcat (&aPath[0], CONNECTSTR);
-	      strcat (&aPath[0], file);
-
-	      if (osd_executableFileExists (&aPath[0]))
-		{
-		  rVal = OSD_FILEFOUND;
-   		  *returnPath = dmalloc (strlen (&aPath[0]) + 1);
-		  strcpy (*returnPath, &aPath[0]);
-		}
-	    }
-	  else
-	    {
-	      rVal = OSD_PATHTOOLONG;
-	    }
-	}
-    }
-
-  return rVal;
-}
-
-bool
-osd_fileExists (char *filespec)
-{
-# ifdef UNIX
-  struct stat buf;
-  return (stat (filespec, &buf) == 0);
-# else
-# if defined (WIN32) || defined (OS2)
-  FILE *test = fopen (filespec, "r");
-  if (test != NULL) 
-  {
-	(void) fclose (test);
-	return TRUE;
-  } 
-  else
-  { 
-	  return FALSE;
-  }
-# else 
-  return FALSE;
-# endif
-# endif
-}
-
-bool
-osd_executableFileExists (/*@unused@*/ char *filespec)
-{
-# ifdef UNIX
-	struct stat buf;
-# if defined(__IBMC__) && defined(OS2)
-# define S_IFMT (unsigned short)0xFFFF
-# endif
-  if (stat (filespec, &buf) == 0)
-    { 
-      /* mask by file type */
-      /*@-unrecog@*/ /* S_IFMT is not defined */
-      if ((buf.st_mode & S_IFMT) != S_IFDIR /*@=unrecog@*/) /* not a directory */
-	{
-	  /* as long as it is an executable file */
-# if defined(__IBMC__) && defined(OS2)
-      int com_or_exe_pos = strlen( filespec) - 4;
-      return stricmp( &filespec[com_or_exe_pos], ".exe") == 0
-        || stricmp( &filespec[com_or_exe_pos], ".com") == 0
-        || stricmp( &filespec[com_or_exe_pos], ".bat") == 0
-        || stricmp( &filespec[com_or_exe_pos], ".cmd") == 0;
-# else
-	  return (((buf.st_mode & S_IXUSR)
-# if !defined(MSDOS) && !defined(OS2) 
-		   | (buf.st_mode & S_IXGRP) |
-		   (buf.st_mode & S_IXOTH)
-# endif
-		   ) != 0);
-# endif
-	}
-    }
-
-# endif
-  return (FALSE);
-
-}
-
-/*
-**++
-**  FUNCTIONAL DESCRIPTION:
-**
-**      Find the next directory from a directory path.
-**
-**  FORMAL PARAMETERS:
-**
-**      char ** current_dir :
-**	    Points to the current position in the path string.  The first time
-**	    you call this routine, this should point to the first character of
-**	    the path.  On return, this will be updated to point to the
-**	    terminating \0 or : of the first directory found.  You can then pass
-**	    it unchanged for subsequent calls; this routine will correctly skip
-**	    over the :.
-**
-**	char ** dir :
-**	    On exit, this will point to the first character of the directory
-**	    that was found.  This will be a pointer directly into the client's
-**	    path string.
-**
-**	unsigned int * len :
-**	    On exit, this will contain the length of the directory that was
-**	    found, not counting any terminating \0 or :.  If no directory was
-**	    found, this will be 0.
-**
-**  RETURN VALUE:
-**	TRUE if we found another directory.
-**	FALSE otherwise.
-**
-**  DESIGN:
-**
-**      We return a pointer and length, rather than a string, because of a)
-**	historical reasons; and b) this avoids having to allocate storage.
-**
-**
-**
-**--
-*/
-
-static bool
-nextdir (d_char *current_dir, d_char *dir, size_t *len)
-{
-  char *tchar;
-
-  if (**current_dir == '\0')
-    {
-      *len = 0;
-      return FALSE;
-    }
-
-  *dir = (**current_dir == SEPCHAR ? *current_dir + 1 : *current_dir);
-  
-  /* Find next ':' or end of string */
-  for (tchar = *dir; *tchar != '\0' && *tchar != SEPCHAR; tchar++)
-    {
-      ;
-    }
-  
-  *current_dir = tchar;
-  *len = size_fromInt (tchar - *dir);
-  return TRUE;
-}
-
-/*@observer@*/ /*@null@*/ char *osd_getEnvironmentVariable (char *var)
-{
-# ifdef UNIX
-	return getenv (var);
-# else
-# if defined(OS2) || defined(MSDOS)
-	return getenv (var);
-# else
-# if defined(WIN32)
-	return getenv (var);
-# else
-	return NULL;
-# endif
-# endif
-# endif
-}
-
-# ifndef NOLCL
-
-# ifdef WIN32
-extern /*@external@*/ int _flushall (void) /*@modifies fileSystem@*/ ;
-# endif
-
-# ifndef system
-extern /*@external@*/ int system (const char *) /*@modifies fileSystem@*/ ;
-# endif
-int osd_system (const char *cmd)
-{
-  int res;
-    /* system ("printenv"); */
-# ifdef WIN32
-  (void) _flushall (); 
-# endif
-
-  res = system (cmd);
-  return res;
-}
-# endif
-
-# ifndef unlink
-/*@-redecl@*/
-extern /*@external@*/ int unlink (const char *) /*@modifies fileSystem@*/ ;
-/*@=redecl@*/
-# endif
-
-int osd_unlink (const char *fname)
-{
-  int res;
-
-  res = unlink (fname);
-
-  if (res != 0)
-    {
-      llcontbug (message ("Cannot remove temporary file: %s (%s)",
-			  cstring_fromChars (fname),
-			  cstring_fromChars (strerror (errno))));
-    }
-  
-  return res;
-}
-
-# if defined (WIN32) || (defined(OS2) && defined(__IBMC__))
-# include 
-# elif defined OS2
-# include 
-# endif
-
-# if defined (WIN32) || defined (OS2) && defined (__IBMC__)
-int
-# else
-int /* pid_t */
-# endif
-osd_getPid ()
-{
-# if defined (WIN32) || defined (OS2) && defined (__IBMC__)
-  int pid = _getpid ();
-# else
-  pid_t pid = getpid ();
-# endif
-
-  return (int) pid;
-}
-  
-cstring osd_fixDefine (char *x)
-{
-# ifdef UNIX
-  if (strchr (x, '\'') != NULL) {
-    /*
-    ** If there is a single quote, check for ='' and 
-    ** produce =
-    */
-
-    char *eqs = strchr (x, '=');
-
-    if (eqs != NULL) {
-      if (eqs[1] == '\'') {
-	char *endqu = strrchr (x, '\'');
-
-	if (endqu != NULL) {
-	  if (*(endqu - 1) != '\\') {
-	    if (*(endqu + 1) == '\0') {
-	      cstring res;
-	      cstring def;
-
-	      *endqu = '\0';
-	      def = cstring_fromChars (eqs + 2);
-	      eqs[1] = '\0';
-	      res = cstring_concat (cstring_fromChars (x), def);
-	      	      return res;
-	    }
-	  }
-	}
-      }
-    }
-  } 
-
-# endif
-
-  return cstring_fromCharsNew (x);
-}
-
-bool osd_fileIsReadable (char *f)
-{
-  FILE *fl = fopen (f, "r");
-
-  if (fl != (FILE *) 0)
-    {
-      check (fclose (fl) == 0);
-      return (TRUE);
-    }
-  else
-    {
-      return (FALSE);
-    }
-}
-
-bool osd_isConnectChar (char c)
-{
-  if (c == CONNECTCHAR) 
-    {
-      return TRUE;
-    }
-
-# ifdef HASALTCONNECTCHAR
-  if (c == ALTCONNECTCHAR)
-    {
-      return TRUE;
-    }
-# endif
-
-  return FALSE;
-}
-
diff --git a/src/pairNodeList.c b/src/pairNodeList.c
deleted file mode 100644
index 2ee744b..0000000
--- a/src/pairNodeList.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** pairNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ pairNodeList
-pairNodeList_new ()
-{
-  pairNodeList s = (pairNodeList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = pairNodeListBASESIZE;
-  s->elements = (pairNode *) 
-    dmalloc (sizeof (*s->elements) * pairNodeListBASESIZE);
-
-  return (s);
-}
-
-static void
-pairNodeList_grow (/*@notnull@*/ pairNodeList s)
-{
-  int i;
-  pairNode *newelements; 
-
-  s->nspace += pairNodeListBASESIZE;
-  newelements = (pairNode *) dmalloc (sizeof (*newelements) 
-				      * (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements); 
-  s->elements = newelements;
-}
-
-void 
-pairNodeList_addh (pairNodeList s, pairNode el)
-{
-  llassert (pairNodeList_isDefined (s));
-  llassert (pairNodeListBASESIZE > 0);
-
-  if (s->nspace <= 0)
-    pairNodeList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-}
-
-/*@only@*/ cstring
-pairNodeList_unparse (pairNodeList s)
-{
-  cstring st = cstring_undefined;
-  
-  if (s != (pairNodeList)0)
-    {
-      pairNodeList_elements (s, current)
-	{
-	  if (current != NULL)
-	    {
-	      st = message ("%q%s %s; ", st, 
-			    sort_unparseName (current->sort), 
-			    ltoken_getRawString (current->tok));
-	    }
-	} end_pairNodeList_elements;
-    }
-
-  return st;
-}
-
-void
-pairNodeList_free (/*@only@*/ pairNodeList s)
-{
-  if (pairNodeList_isDefined (s))
-    {
-      int i;
-      for (i = 0; i < s->nelements; i++)
-	{
-	  pairNode_free (s->elements[i]); 
-	}
-      
-      sfree (s->elements); 
-      sfree (s);
-    }
-}
diff --git a/src/paramNodeList.c b/src/paramNodeList.c
deleted file mode 100644
index 3e7ed07..0000000
--- a/src/paramNodeList.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** paramNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ paramNodeList
-paramNodeList_new ()
-{
-  paramNodeList s = (paramNodeList) dmalloc (sizeof (*s));
-
-  s->nelements = 0;
-  s->nspace = paramNodeListBASESIZE;
-  s->elements = (paramNode *) 
-    dmalloc (sizeof (*s->elements) * paramNodeListBASESIZE);
-
-  return (s);
-}
-
-/*@only@*/ paramNodeList
-paramNodeList_single (/*@keep@*/ paramNode p)
-{
-  paramNodeList s = (paramNodeList) dmalloc (sizeof (*s));
-  
-  s->nelements = 1;
-  s->nspace = paramNodeListBASESIZE - 1;
-  s->elements = (paramNode *) dmalloc (sizeof (*s->elements) * paramNodeListBASESIZE);
-  s->elements[0] = p;
-
-  return (s);
-}
-
-static void
-paramNodeList_grow (/*@notnull@*/ paramNodeList s)
-{
-  int i;
-  paramNode *newelements;
-
-  s->nspace += paramNodeListBASESIZE;
-
-  newelements = (paramNode *) dmalloc (sizeof (*newelements)
-				       * (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-paramNodeList
-paramNodeList_add (paramNodeList s, paramNode el)
-{
-  llassert (paramNodeList_isDefined (s));
-
-  if (s->nspace <= 0)
-    paramNodeList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  
-  s->nelements++;
-  return s;
-}
-
-/*@only@*/ paramNodeList 
-paramNodeList_copy (paramNodeList s)
-{
-  paramNodeList r = paramNodeList_new ();
-
-  paramNodeList_elements (s, x)
-  {
-    r = paramNodeList_add (r, paramNode_copy (x));
-  } end_paramNodeList_elements;
-
-  return r;
-}
-
-/*@only@*/ cstring
-paramNodeList_unparse (paramNodeList s)
-{
-  bool first = TRUE;
-  cstring st = cstring_undefined;
-
-  paramNodeList_elements (s, current)
-  {
-    if (first)
-      {
-	st = paramNode_unparse (current);
-	first = FALSE;
-      }
-    else
-      {
-	st = message ("%q, %q", st, paramNode_unparse (current));
-      }
-  } end_paramNodeList_elements;
-
-  return st;
-}
-
-/*@only@*/ cstring
-paramNodeList_unparseComments (paramNodeList s)
-{
-  bool first = TRUE;
-  cstring st = cstring_undefined;
-
-  paramNodeList_elements (s, current)
-  {
-    if (first)
-      {
-	st = paramNode_unparseComments (current);
-	first = FALSE;
-      }
-    else
-      {
-	st = message ("%q, %q", st, paramNode_unparseComments (current));
-      }
-  } end_paramNodeList_elements;
-
-  return st;
-}
-
-void
-paramNodeList_free (/*@only@*/ paramNodeList s)
-{
-  if (paramNodeList_isDefined (s))
-    {
-      int i;
-      for (i = 0; i < s->nelements; i++)
-	{
-	  paramNode_free (s->elements[i]); 
-	}
-      
-      sfree (s->elements); 
-      sfree (s);
-    }
-}
diff --git a/src/programNodeList.c b/src/programNodeList.c
deleted file mode 100644
index 6357ea9..0000000
--- a/src/programNodeList.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** programNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ programNodeList
-programNodeList_new ()
-{
-  programNodeList s = (programNodeList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = programNodeListBASESIZE;
-  s->elements = (programNode *) 
-    dmalloc (sizeof (*s->elements) * programNodeListBASESIZE);
-
-  return (s);
-}
-
-static void
-programNodeList_grow (programNodeList s)
-{
-  int i;
-  programNode *newelements;
-
-  s->nspace += programNodeListBASESIZE;
-  newelements = (programNode *) dmalloc (sizeof (*newelements)
-					 * (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements); 
-  s->elements = newelements;
-}
-
-void 
-programNodeList_addh (programNodeList s, /*@keep@*/ programNode el)
-{
-  if (s->nspace <= 0)
-    programNodeList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-}
-
-/*@only@*/ cstring
-programNodeList_unparse (programNodeList s)
-{
-  bool first = TRUE;
-  cstring st = cstring_undefined;
-
-  programNodeList_elements (s, current)
-  {
-    if (first)
-      {
-	st = programNode_unparse (current);
-	first = FALSE;
-      }
-    else
-      {
-	st = message ("%q; %q", st, programNode_unparse (current));
-      }
-  } end_programNodeList_elements;
-
-  return st;
-}
-
-void
-programNodeList_free (programNodeList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-      programNode_free (s->elements[i]); 
-    }
-
-  sfree (s->elements); 
-  sfree (s);
-}
diff --git a/src/qtype.c b/src/qtype.c
deleted file mode 100644
index 854114b..0000000
--- a/src/qtype.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** qtype.c
-**
-** Qualified types: a type qualifier list, and a ctype.
-** qtypes are mutable
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-/*@notnull@*/ qtype qtype_create (ctype c)
-{
-  qtype q = (qtype) dmalloc (sizeof (*q));
-
-  q->type = c;
-  q->quals = qualList_new ();
-  return q;
-}
-
-void qtype_free (/*@only@*/ qtype q)
-{
-  if (qtype_isDefined (q))
-    {
-      qualList_free (q->quals);
-      sfree (q);
-    }
-}
-
-qtype qtype_unknown ()
-{
-  return (qtype_create (ctype_unknown));
-}
-
-qtype qtype_addQual (qtype qt, qual q)
-{
-  if (qtype_isDefined (qt))
-    {
-      qt->quals = qualList_add (qt->quals, q);
-    }
-
-  return qt;
-}
-
-# ifndef NOLCL
-qtype qtype_addQualList (/*@returned@*/ qtype qt, qualList ql)
-{
-  if (qtype_isDefined (qt))
-    {
-      qt->quals = qualList_appendList (qt->quals, ql);
-    }
-
-  return qt;
-}
-# endif
-
-static void checkAltQuals (qtype q)
-{
-  if (qtype_isDefined (q))
-    {
-      qualList badQuals = qualList_undefined;
-      
-      qualList_elements (q->quals, qu)
-	{
-	  if (!qual_isCQual (qu) && !qual_isImplied (qu))
-	    {
-	      badQuals = qualList_add (badQuals, qu);
-	    }
-	} end_qualList_elements ;
-      
-      if (!qualList_isEmpty (badQuals))
-	{
-	  voptgenerror (FLG_SYNTAX,
-			message 
-			("Alternate type cannot use annotations %q: %q",
-			 qualList_unparse (badQuals),
-			 qtype_unparse (q)),
-			g_currentloc);
-	}
-    }
-}
-
-# ifndef NOLCL
-qtype qtype_mergeImplicitAlt (/*@returned@*/ qtype q1, /*@only@*/ qtype q2)
-{
-  if (qtype_isDefined (q1) && qtype_isDefined (q2))
-    {
-      q1->type = ctype_makeConj (q1->type, q2->type);
-      
-      if (!qualList_isEmpty (q2->quals))
-	{
-	  checkAltQuals (q2);
-	}
-    }
-
-  qtype_free (q2);
-  return q1;
-}
-# endif
-
-qtype qtype_mergeAlt (/*@returned@*/ qtype q1, /*@only@*/ qtype q2)
-{
-  if (qtype_isDefined (q1) && qtype_isDefined (q2))
-    {
-      if (context_getFlag (FLG_IMPCONJ))
-	{
-	  q1->type = ctype_makeConj (q1->type, q2->type);
-	}
-      else
-	{
-	  q1->type = ctype_makeExplicitConj (q1->type, q2->type);
-	}
-
-      
-      if (!qualList_isEmpty (q2->quals))
-	{
-	  checkAltQuals (q2);
-	}
-    }
-  
-  qtype_free (q2);
-  return q1;
-}
-
-qtype qtype_combine (/*@returned@*/ qtype q1, ctype ct)
-{
-  if (qtype_isDefined (q1))
-    {
-      /* ct is modifier (or q1->type is unknown) */
-      q1->type = ctype_combine (q1->type, ct); 
-    }
-
-  return q1;
-}
-
-qtype qtype_resolve (/*@returned@*/ qtype q)
-{
-  if (qtype_isDefined (q))
-    {
-      q->type = ctype_resolve (q->type);
-    }
-
-  return q;
-}
-
-cstring qtype_unparse (qtype q)
-{
-  if (qtype_isDefined (q))
-    {
-      return (message ("%q%s", qualList_unparse (q->quals), 
-		       ctype_unparse (q->type)));
-    }
-  else
-    {
-      return (cstring_makeLiteral (""));
-    }
-}
-
-qtype qtype_newBase (/*@returned@*/ qtype q, ctype ct)
-{
-  if (qtype_isDefined (q))
-    {
-      q->type = ctype_newBase (ct, q->type);
-    }
-
-  return q;
-}
-
-qtype qtype_newQbase (qtype q1, qtype q2)
-{
-  if (qtype_isDefined (q1) && qtype_isDefined (q2))
-    {
-      q1->type = ctype_newBase (q1->type, q2->type);
-      q1->quals = qualList_appendList (q1->quals, q2->quals);
-    }
-
-  return q1;
-}
-
-void qtype_adjustPointers (int n, qtype q)
-{
-  if (qtype_isDefined (q))
-    {
-      q->type = ctype_adjustPointers (n, q->type);
-    }
-}
-
-# ifndef NOLCL
-qtype qtype_copy (qtype q)
-{
-  if (qtype_isDefined (q))
-    {
-      qtype r = qtype_create (q->type);
-      
-      qualList_free (r->quals);
-      r->quals = qualList_copy (q->quals);
-      return r;
-    }
-  else
-    {
-      return qtype_undefined;
-    }
-}
-# endif
diff --git a/src/qual.c b/src/qual.c
deleted file mode 100644
index 0e52b66..0000000
--- a/src/qual.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** qual.c
-**
-** representation of type qualifiers
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-static bool qual_isValid (int q)
-{
-  return ((qual)q >= QU_UNKNOWN 
-	  && ((qual)q < QU_LAST));
-}
-
-qual qual_fromInt (int q)
-{
-  llassertprint (qual_isValid (q), ("Invalid qual: %d", q));
-  return (qual) q;
-}
-
-cstring qual_unparse (qual q)
-{
-  switch (q)
-    {
-    case QU_UNKNOWN:    return cstring_makeLiteralTemp ("unknown");
-    case QU_ABSTRACT:   return cstring_makeLiteralTemp ("abstract");
-    case QU_CONCRETE:   return cstring_makeLiteralTemp ("concrete");
-    case QU_MUTABLE:    return cstring_makeLiteralTemp ("mutable");
-    case QU_IMMUTABLE:  return cstring_makeLiteralTemp ("immutable");
-    case QU_SHORT:      return cstring_makeLiteralTemp ("short");
-    case QU_LONG:       return cstring_makeLiteralTemp ("long");
-    case QU_SIGNED:     return cstring_makeLiteralTemp ("signed");
-    case QU_UNSIGNED:   return cstring_makeLiteralTemp ("unsigned");
-    case QU_CONST:      return cstring_makeLiteralTemp ("const");
-    case QU_VOLATILE:   return cstring_makeLiteralTemp ("volatile");
-    case QU_INLINE:     return cstring_makeLiteralTemp ("inline");
-    case QU_EXTERN:     return cstring_makeLiteralTemp ("extern");
-    case QU_STATIC:     return cstring_makeLiteralTemp ("static");
-    case QU_AUTO:       return cstring_makeLiteralTemp ("auto");
-    case QU_REGISTER:   return cstring_makeLiteralTemp ("register");
-    case QU_OUT:        return cstring_makeLiteralTemp ("out");
-    case QU_IN:         return cstring_makeLiteralTemp ("in");
-    case QU_RELDEF:     return cstring_makeLiteralTemp ("reldef");
-    case QU_ONLY:       return cstring_makeLiteralTemp ("only");
-    case QU_IMPONLY:    return cstring_makeLiteralTemp ("only");
-    case QU_PARTIAL:    return cstring_makeLiteralTemp ("partial");
-    case QU_SPECIAL:    return cstring_makeLiteralTemp ("special");
-    case QU_KEEP:       return cstring_makeLiteralTemp ("keep");
-    case QU_KEPT:       return cstring_makeLiteralTemp ("kept");
-    case QU_YIELD:      return cstring_makeLiteralTemp ("yield");
-    case QU_TEMP:       return cstring_makeLiteralTemp ("temp");
-    case QU_SHARED:     return cstring_makeLiteralTemp ("shared");
-    case QU_UNIQUE:     return cstring_makeLiteralTemp ("unique");
-    case QU_UNCHECKED:  return cstring_makeLiteralTemp ("unchecked");
-    case QU_CHECKED:    return cstring_makeLiteralTemp ("checked");
-    case QU_CHECKMOD:   return cstring_makeLiteralTemp ("checkmod");
-    case QU_CHECKEDSTRICT: return cstring_makeLiteralTemp ("checkedstrict");
-    case QU_TRUENULL:   return cstring_makeLiteralTemp ("truenull");
-    case QU_FALSENULL:  return cstring_makeLiteralTemp ("falsenull");
-    case QU_NULL:       return cstring_makeLiteralTemp ("null");
-    case QU_RELNULL:    return cstring_makeLiteralTemp ("relnull");
-    case QU_NOTNULL:    return cstring_makeLiteralTemp ("notnull");
-    case QU_NULLTERMINATED: return cstring_makeLiteralTemp ("nullterminated");
-    case QU_RETURNED:   return cstring_makeLiteralTemp ("  returned");
-    case QU_EXPOSED:    return cstring_makeLiteralTemp ("exposed");
-    case QU_EXITS:      return cstring_makeLiteralTemp ("exits");
-    case QU_MAYEXIT:    return cstring_makeLiteralTemp ("mayexit");
-    case QU_UNUSED:     return cstring_makeLiteralTemp ("unused");
-    case QU_EXTERNAL:   return cstring_makeLiteralTemp ("external");
-    case QU_SEF:        return cstring_makeLiteralTemp ("sef");
-    case QU_OBSERVER:   return cstring_makeLiteralTemp ("observer");
-    case QU_REFCOUNTED: return cstring_makeLiteralTemp ("refcounted"); 
-    case QU_REFS:       return cstring_makeLiteralTemp ("refs"); 
-    case QU_NEWREF:     return cstring_makeLiteralTemp ("newref"); 
-    case QU_KILLREF:    return cstring_makeLiteralTemp ("killref"); 
-    case QU_TEMPREF:    return cstring_makeLiteralTemp ("tempref"); 
-    case QU_OWNED:      return cstring_makeLiteralTemp ("owned");
-    case QU_DEPENDENT:  return cstring_makeLiteralTemp ("dependent");
-    case QU_NEVEREXIT:  return cstring_makeLiteralTemp ("neverexit");
-    case QU_TRUEEXIT:   return cstring_makeLiteralTemp ("trueexit");
-    case QU_FALSEEXIT:  return cstring_makeLiteralTemp ("falseexit");
-    case QU_UNDEF:      return cstring_makeLiteralTemp ("undef");
-    case QU_KILLED:     return cstring_makeLiteralTemp ("killed");
-    case QU_PRINTFLIKE: return cstring_makeLiteralTemp ("printflike");
-    case QU_SCANFLIKE:  return cstring_makeLiteralTemp ("scanflike");
-    case QU_MESSAGELIKE:return cstring_makeLiteralTemp ("messagelike");
-    case QU_LAST:       return cstring_makeLiteralTemp ("< last >");
-    case  QU_SETBUFFERSIZE: return cstring_makeLiteralTemp("");
-    }
-
-  BADEXIT;
-}
-
diff --git a/src/qualList.c b/src/qualList.c
deleted file mode 100644
index 29d1e6f..0000000
--- a/src/qualList.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** qualList.c (from slist_template.c)
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-qualList
-qualList_new ()
-{
-  return qualList_undefined;
-}
-
-static /*@only@*/ /*@notnull@*/ qualList
-qualList_newEmpty (void)
-{
-  qualList s = (qualList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->free = qualListBASESIZE;
-  s->elements = (qual *) dmalloc (sizeof (*s->elements) * qualListBASESIZE);
-
-  return (s);
-}
-
-void
-qualList_clear (qualList q)
-{
-  if (qualList_isDefined (q))
-    {
-      q->free += q->nelements;
-      q->nelements = 0;
-    }
-}
-
-static void
-qualList_grow (/*@notnull@*/ qualList s)
-{
-  int i;
-  qual *oldelements = s->elements;
-  
-  s->free += qualListBASESIZE; 
-
-  s->elements = (qual *) dmalloc (sizeof (*s->elements) * (s->nelements + s->free));
-    
-  for (i = 0; i < s->nelements; i++)
-    {
-      s->elements[i] = oldelements[i];
-    }
-  
-  sfree (oldelements);
-}
-
-qualList qualList_add (qualList s, qual el)
-{
-  if (qualList_isUndefined (s))
-    {
-      s = qualList_newEmpty ();
-    }
-  
-  if (s->free <= 0)
-    qualList_grow (s);
-  
-  s->free--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-
-  return (s);
-}
-
-qualList qualList_appendList (qualList s, qualList t)
-{
-  qualList_elements (t, current)
-    {
-      s = qualList_add (s, current);
-    } end_qualList_elements;
-
-  return s;
-}
-
-# ifndef NOLCL
-qualList qualList_copy (qualList s)
-{
-  qualList t = qualList_new ();
-
-  qualList_elements (s, current)
-    {
-      t = qualList_add (t, current);
-    } end_qualList_elements;
-
-  return t;
-}
-# endif
-
-/*@only@*/ cstring
-qualList_unparse (qualList s)
-{
-   int i;
-   cstring st = cstring_undefined;
-
-   if (qualList_isDefined (s))
-     {
-       for (i = 0; i < qualList_size (s); i++)
-	 {
-	   if (i == 0)
-	     {
-	       st = message ("%q%s ", st, qual_unparse (s->elements[i]));
-	     }
-	   else
-	     st = message ("%q%s ", st, qual_unparse (s->elements[i]));
-	 }
-     }
-
-   return st;
-}
-
-# ifndef NOLCL
-/*@only@*/ cstring
-qualList_toCComments (qualList s)
-{
-   int i;
-   cstring st = cstring_undefined;
-
-   if (qualList_isDefined (s))
-     {
-       for (i = 0; i < qualList_size (s); i++)
-	 {
-	   if (i == 0)
-	     {
-	       st = message ("%q/*@%s@*/ ", st, qual_unparse (s->elements[i]));
-	     }
-	   else
-	     st = message ("%q/*@%s@*/ ", st, qual_unparse (s->elements[i]));
-	 }
-     }
-
-   return st;
-}
-# endif
-
-bool
-qualList_hasAliasQualifier (qualList s)
-{
-  if (qualList_isDefined (s))
-    {
-      qualList_elements (s, q)
-	{
-	  if (qual_isAliasQual (q)) return TRUE;
-	} end_qualList_elements;
-    }
-
-  return FALSE;
-}
-
-bool
-qualList_hasExposureQualifier (qualList s)
-{
-  if (qualList_isDefined (s))
-    {
-      qualList_elements (s, q)
-	{
-	  if (qual_isExQual (q)) return TRUE;
-	} end_qualList_elements;
-    }
-
-  return FALSE;
-}
-
-void
-qualList_free (/*@only@*/ qualList s)
-{
-  if (qualList_isDefined (s))
-    {
-      sfree (s->elements); 
-      sfree (s);
-    }
-}
-
-/* start modifications */
-/*
-requires: p is defined
-returns: true if qual is present in qualList
-modifies: none
-*/
-bool qualList_hasNullTerminatedQualifier(qualList q) {
-    qualList_elements(q, qu) {
-      if( qual_equal(qu, QU_NULLTERMINATED) ) return TRUE;
-    } end_qualList_elements ;
-   
-  return FALSE;
-}
-
-/* end modification/s */        
-
-
diff --git a/src/quantifierNodeList.c b/src/quantifierNodeList.c
deleted file mode 100644
index 2adf2a6..0000000
--- a/src/quantifierNodeList.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** quantifierNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ quantifierNodeList
-quantifierNodeList_new ()
-{
-  quantifierNodeList s = (quantifierNodeList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = quantifierNodeListBASESIZE;
-  s->elements = (quantifierNode *) 
-    dmalloc (sizeof (*s->elements) * quantifierNodeListBASESIZE);
-
-  return (s);
-}
-
-static void
-quantifierNodeList_grow (quantifierNodeList s)
-{
-  int i;
-  quantifierNode *newelements; 
-
-  s->nspace += quantifierNodeListBASESIZE;
-
-  newelements = (quantifierNode *) dmalloc (sizeof (*newelements)
-					    * (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i]; 
-    }
-
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-quantifierNodeList 
-quantifierNodeList_add (quantifierNodeList s, quantifierNode el)
-{
-  if (s->nspace <= 0)
-    quantifierNodeList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-
-  return s;
-}
-
-/*@only@*/ quantifierNodeList 
-quantifierNodeList_copy (quantifierNodeList s)
-{
-  quantifierNodeList r = quantifierNodeList_new ();
-
-  quantifierNodeList_elements (s, x)
-    {
-      r = quantifierNodeList_add (r, quantifierNode_copy (x));
-    } end_quantifierNodeList_elements;
-  
-  return r;
-}
-
-/*@only@*/ cstring
-quantifierNodeList_unparse (quantifierNodeList s)
-{
-  cstring st = cstring_undefined;
-
-  quantifierNodeList_elements (s, current)
-  {
-    st = message ("%q%s %q", 
-		  st, ltoken_getRawString (current->quant),
-		  varNodeList_unparse (current->vars));
-  } end_quantifierNodeList_elements;
-
-  return st;
-}
-
-void
-quantifierNodeList_free (quantifierNodeList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-      quantifierNode_free (s->elements[i]); 
-    }
-
-  sfree (s->elements); 
-  sfree (s);
-}
diff --git a/src/rangeTable.c b/src/rangeTable.c
deleted file mode 100644
index 2c8e407..0000000
--- a/src/rangeTable.c
+++ /dev/null
@@ -1,829 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** rangeTable.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-/*@constant int ATINVALID; @*/
-# define ATINVALID -1
-
-static sRefSet
-  rangeTable_canRangeAux (rangeTable p_s, sRef p_sr, int p_lim) /*@*/ ;
-static sRefSet
-  rangeTable_aliasedByLimit (rangeTable p_s, sRef p_sr, int p_lim) /*@*/ ;
-static sRefSet 
-  rangeTable_aliasedByAux (rangeTable p_s, sRef p_sr, int p_lim) /*@*/ ;
-
-rangeTable
-rangeTable_new ()
-{
-  return (rangeTable_undefined);
-}
-
-static /*@only@*/ /*@notnull@*/ rangeTable
-rangeTable_newEmpty (void)
-{
-  rangeTable s = (rangeTable) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = rangeTableBASESIZE;
-  s->keys     = (sRef *) dmalloc (sizeof (*s->keys) * rangeTableBASESIZE);
-  s->values   = (sRefSet *) dmalloc (sizeof (*s->values) * rangeTableBASESIZE);
-  s->ranges    = (sRefSet *) dmalloc (sizeof (*s->ranges) * rangeTableBASESIZE);
-  return (s);
-}
-
-static void
-rangeTable_grow (/*@notnull@*/ rangeTable s)
-{
-  int i;
-  o_sRefSet *oldvalues = s->values;
-  sRef    *oldkeys = s->keys;
-  RangeAt *oldranges = s->ranges;
-  
-  s->nspace += rangeTableBASESIZE; 
-
-  s->values = (sRefSet *) dmalloc (sizeof (*s->values)
-				   * (s->nelements + s->nspace));
-  s->keys = (sRef *) dmalloc (sizeof (*s->keys) * (s->nelements + rangeTableBASESIZE));
-
-  s->ranges = (sRef *) dmalloc (sizeof (*s->ranges) * (s->nelements + rangeTableBASESIZE));
-
-  
-  if (s->keys == (sRef *) 0 || s->values == (sRefSet *)0 || s->ranges = (range_At*) 0 )
-    {
-      llfatalerror (cstring_makeLiteral ("rangeTable_grow: out of memory!"));
-    }
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      s->values[i] = oldvalues[i];
-      s->keys[i] = oldkeys[i];
-      s->ranges[i] = oldranges[i];
-    }
-  
-  sfree (oldvalues);
-  sfree (oldkeys);
-}
-
-static int rangeTable_lookupRefs (/*@notnull@*/ rangeTable s, sRef sr)
-{
-  int i;
-
-  
-  for (i = 0; i < rangeTable_size (s); i++)
-    {
-      if (sRef_same (sr, s->keys[i])) 
-	{
-	  return i;
-	}
-    }
-
-  return ATINVALID;
-}
-
-/*
-** sr rangees al (and anything al rangees!)
-*/
-
-rangeTable
-rangeTable_addMustRange (/*@returned@*/ rangeTable s,
-			 /*@exposed@*/ sRef sr,
-			 sRef al)
-{
-  int ind;
-  sRefSet ss;
-  
-  llassert (NORANGE (sr, al));
-
-  if (rangeTable_isUndefined (s))
-    {
-      s = rangeTable_newEmpty ();
-      ind = ATINVALID;
-    }
-  else
-    {
-      ind = rangeTable_lookupRefs (s, sr);
-    }
-  
-  ss = rangeTable_canRange (s, al); 
-  
-  
-  if (ind == ATINVALID)
-    {
-      if (s->nspace <= 0) {
-	rangeTable_grow (s);
-      }
-
-      s->nspace--;
-      s->keys[s->nelements] = sr;
-      s->values[s->nelements] = sRefSet_single (al); 
-      ind = s->nelements;
-      s->nelements++;      
-    }
-  else
-    {
-      s->values[ind] = sRefSet_insert (s->values[ind], al); 
-    }
-  
-  s->values[ind] = sRefSet_unionExcept (s->values[ind], ss, s->keys[ind]); 
-
-  sRefSet_free (ss);
-  return s;
-}
-
-static rangeTable 
-  rangeTable_addSet (/*@returned@*/ rangeTable s,
-		     /*@exposed@*/ sRef key, /*@only@*/ sRefSet value)
-{
-  if (!sRefSet_isEmpty (value))
-    {
-      if (rangeTable_isUndefined (s))
-	{
-	  s = rangeTable_newEmpty ();
-	}
-      else
-	{
-	  if (s->nspace <= 0)
-	    {
-	      rangeTable_grow (s);
-	    }
-	}
-
-      s->nspace--;
-      s->keys[s->nelements] = key;
-      s->values[s->nelements] = value;
-      s->nelements++;      
-    }
-  else
-    {
-      sRefSet_free (value);
-    }
-
-  return s;
-}
-
-/*
-** When rangees are cleared:
-**
-**    o remove all entries for sr
-**    o replace all rangees for things which range sr with sr's rangees
-**
-** Clear rangees for sr; if sr is a direct param reference, clear its rangees too.
-*/
-
-static void rangeTable_clearRangeesAux (/*@notnull@*/ rangeTable p_s, sRef p_sr)
-   /*@modifies p_s@*/ ;
-
-void rangeTable_clearRangees (rangeTable s, sRef sr)
-{
-  if (rangeTable_isUndefined (s))
-    {
-      return;
-    }
-  else
-    {
-      sRef rb = sRef_getRootBase (sr);
-
-            
-      if (!sRef_isCvar (sr) && sRef_isLocalVar (rb))
-	{
-	  int ind = rangeTable_lookupRefs (s, rb);
-	  
-	  if (ind != ATINVALID)
-	    {
-	      sRefSet al = s->values[ind];
-	      
-	      	      
-	      sRefSet_realElements (al, el)
-		{
-		  		  
-		  if (sRef_isParam (el))
-		    {
-		      if (sRef_sameName (el, rb))
-			{
-			  sRef fb = sRef_fixBase (sr, el); 
-
-			  rangeTable_clearRangeesAux (s, fb); 
-			}
-		    }
-		} end_sRefSet_realElements ;
-	    }
-	}
-      
-      rangeTable_clearRangeesAux (s, sr); 
-    }  
-}
-
-static
-void rangeTable_clearRangeesAux (/*@notnull@*/ rangeTable s, sRef sr)
-{
-  int i;
-  
-  for (i = 0; i < s->nelements; i++)
-    {
-      sRef key = s->keys[i];
-      
-      if (sRef_includedBy (key, sr))
-	{
-	  sRefSet_clear (s->values[i]);
-	}
-      else
-	{
-	  (void) sRefSet_deleteBase (s->values[i], sr);   
-	}
-    }
-}
-
-/*
-** returns set of all sRefs that must range sr (but are different from sr)
-*/
-
-static /*@only@*/ sRefSet rangeTable_rangeedByAux (rangeTable s, sRef sr, int lim)
-{
-  static bool hadWarning = FALSE;
-  sRefSet res = sRefSet_undefined;
-  int i;
-
-  llassert (!sRef_isConj (sr));
-  
-  
-  if (rangeTable_isUndefined (s) || lim >= RANGESEARCHLIMIT)
-    {
-      if (lim >= RANGESEARCHLIMIT && !hadWarning)
-	{
-	  llquietbug
-	    (message ("Range search limit exceeded, checking %q. "
-		      "This either means there is a variable with at least "
-		      "%d indirections, or there is a bug in LCLint.",
-		      sRef_unparse (sr),
-		      RANGESEARCHLIMIT));
-	  
-	  hadWarning = TRUE;
-	}
-
-      return sRefSet_undefined;
-    }
-  else
-    {
-      sRefSet abl;
-
-      if (sRef_isPointer (sr))
-	{
-	  abl = rangeTable_rangeedByLimit (s, sRef_getBase (sr), lim);
-	  res = sRefSet_addIndirection (abl);
-	}
-      else if (sRef_isAddress (sr))
-	{
-	  abl = rangeTable_rangeedByLimit (s, sRef_getBase (sr), lim);
-	  res = sRefSet_removeIndirection (abl);
-	}
-      else if (sRef_isField (sr))
-	{
-	  abl = rangeTable_rangeedByLimit (s, sRef_getBase (sr), lim);
-	  res = sRefSet_accessField (abl, sRef_getField (sr));
-	}
-      else if (sRef_isArrayFetch (sr))
-	{
-	  abl = rangeTable_rangeedByLimit (s, sRef_getBase (sr), lim);
-
-	  if (sRef_isIndexKnown (sr))
-	    {
-	      int idx = sRef_getIndex (sr);
-	      
-	      res = sRefSet_fetchKnown (abl, idx);
-	    }
-	  else
-	    {
-	      res = sRefSet_fetchUnknown (abl);
-	    }
-	}
-      else
-	{
-	  abl = sRefSet_undefined;
-	}
-
-      sRefSet_free (abl);
-    }
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      sRef elem = s->keys[i];
-      
-      if (!sRef_same (sr, elem)) /* was sameName */
-	{
-	  	  
-	  sRefSet_realElements (s->values[i], current)
-	    {
-	      	      
-	      if (sRef_similar (sr, current))
-		{
-		  		  		  res = sRefSet_insert (res, sRef_fixOuterRef (elem));
-		  /*@innerbreak@*/ break;
-		}
-	    } end_sRefSet_realElements;
-	} 
-    }
-  
-    return res;
-}
-
-static /*@only@*/ sRefSet rangeTable_rangeedByLimit (rangeTable s, sRef sr, int lim)
-{
-  sRefSet res;
-  
-  
-  if (sRef_isConj (sr))
-    {
-      res = sRefSet_unionFree (rangeTable_rangeedByLimit (s, sRef_getConjA (sr), lim),
-			       rangeTable_rangeedByLimit (s, sRef_getConjB (sr), lim));
-    }
-  else
-    {
-      res = rangeTable_rangeedByAux (s, sr, lim + 1);
-    }
-  
-    return res;
-}
-
-/*@only@*/ sRefSet rangeTable_rangeedBy (rangeTable s, sRef sr)
-{ 
-  if (sRef_isConj (sr))
-    {
-      return (sRefSet_unionFree (rangeTable_rangeedBy (s, sRef_getConjA (sr)),
-				 rangeTable_rangeedBy (s, sRef_getConjB (sr))));
-    }
-
-  return (rangeTable_rangeedByAux (s, sr, 0));
-}
-
-/*@only@*/ sRefSet rangeTable_canRange (rangeTable s, sRef sr)
-{
-  sRefSet res;
-
-    
-  if (sRef_isConj (sr))
-    {
-      res = sRefSet_unionFree (rangeTable_canRange (s, sRef_getConjA (sr)),
-			       rangeTable_canRange (s, sRef_getConjB (sr)));
-    }
-  else
-    {
-      res = rangeTable_canRangeAux (s, sr, 0);
-          }
-
-    return res;
-}
-
-/*
-** need to limit the depth of rangeing searches 
-*/
-
-static /*@only@*/ sRefSet rangeTable_canRangeLimit (rangeTable s, sRef sr, int lim)
-{
-  sRefSet res;
-  
-  if (sRef_isConj (sr))
-    {
-      sRefSet a = rangeTable_canRangeLimit (s, sRef_getConjA (sr), lim);
-      sRefSet b = rangeTable_canRangeLimit (s, sRef_getConjB (sr), lim);
-
-      res = sRefSet_unionFree (a, b);
-    }
-  else
-    {
-      res = rangeTable_canRangeAux (s, sr, lim + 1);
-    }
-  
-  return res;
-}
-
-static /*@only@*/ sRefSet 
-  rangeTable_canRangeAux (rangeTable s, sRef sr, int lim)
-{
-  static bool hadWarning = FALSE;
-  llassert (!sRef_isConj (sr));
-  
-  
-  if (rangeTable_isUndefined (s) || lim >= RANGESEARCHLIMIT)
-    {
-      if (lim >= RANGESEARCHLIMIT && !hadWarning)
-	{
-	  llquietbug
-	    (message ("Range search limit exceeded, checking %q. "
-		      "This either means there is a variable with at least "
-		      "%d indirections, or there is a bug in LCLint.",
-		      sRef_unparse (sr),
-		      RANGESEARCHLIMIT));
-	  
-	  hadWarning = TRUE;
-	}
-
-      return sRefSet_undefined;
-    }
-  else
-    {
-      int ind = rangeTable_lookupRefs (s, sr);
-
-      if (sRef_isPointer (sr) || sRef_isAddress (sr) || sRef_isField (sr)
-	  || sRef_isArrayFetch (sr))
-	{
-	  sRef base = sRef_getBase (sr);
-	  sRefSet tmp = rangeTable_canRangeLimit (s, base, lim);
-	  sRefSet ret;
-
-	  if (sRef_isPointer (sr))
-	    {
-	      ret = sRefSet_addIndirection (tmp); 
-	    }
-	  else if (sRef_isAddress (sr))
-	    {
-	      ret = sRefSet_removeIndirection (tmp);
-	    }
-	  else if (sRef_isField (sr))
-	    {
-	      ret = sRefSet_accessField (tmp, sRef_getField (sr));
-	    }
-	  else if (sRef_isArrayFetch (sr))
-	    {
-	      if (sRef_isIndexKnown (sr))
-		{
-		  ret = sRefSet_fetchKnown (tmp, sRef_getIndex (sr));
-		}
-	      else
-		{
-		  ret = sRefSet_fetchUnknown (tmp);
-		}
-	    }
-	  else
-	    {
-	      BADBRANCH;
-	    }
-
-	  if (ind != ATINVALID)
-	    {
-	      ret = sRefSet_union (ret, s->values[ind]);
-	    }
-
-	  sRefSet_free (tmp);
-	  	  return ret;
-	}
-      
-      if (ind == ATINVALID) return sRefSet_undefined;      
-      
-      return sRefSet_newCopy (s->values[ind]);
-    }
-}
-
-rangeTable rangeTable_copy (rangeTable s)
-{
-  if (rangeTable_isEmpty (s))
-    {
-      return rangeTable_undefined;
-    }
-  else
-    {
-      rangeTable t = (rangeTable) dmalloc (sizeof (*s));
-      int i;
-
-      t->nelements = s->nelements;
-      t->nspace = 0;
-      t->keys = (sRef *) dmalloc (sizeof (*s->keys) * s->nelements);
-      t->values = (sRefSet *) dmalloc (sizeof (*s->values) * t->nelements);
-        
-      for (i = 0; i < s->nelements; i++)
-	{
-	  t->keys[i] = s->keys[i];
-	  t->values[i] = sRefSet_newCopy (s->values[i]);
-	}
-
-      return t;
-    }
-}
-
-static void
-rangeTable_levelPrune (rangeTable s, int lexlevel)
-{
-  
-  
-  if (rangeTable_isEmpty (s))
-    {
-      return;
-    }
-  else
-    {
-      int i;
-      int backcount = s->nelements - 1;
-      
-      for (i = 0; i <= backcount; i++)
-	{
-	  sRef key = s->keys[i];
-	  
-	  if (sRef_lexLevel (key) > lexlevel)
-	    {
-	      int j;
-	      for (j = backcount; j > i; j--)
-		{
-		  backcount--;
-		  s->nelements--;
-		  s->nspace++;
-		  
-		  if (sRef_lexLevel (s->keys[j]) <= lexlevel)
-		    {
-		      s->keys[i] = s->keys[j];
-		      s->values[i] = s->values[j];
-		      sRefSet_levelPrune (s->values[i], lexlevel);
-		      /*@innerbreak@*/ break;
-		    }
-		}
-	      if (backcount == i)
-		s->nelements--;
-	    }
-	  else
-	    {
-	      sRefSet_levelPrune (s->values[i], lexlevel);
-	    }
-	}
-    }
-}
-
-/*
-** levelUnionSeq
-**
-**    like level union, but know that t2 was executed after t1.  So if
-**    t1 has x -> { a, b } and t2 has x -> { a }, then result has x -> { a }.
-**
-** NOTE: t2 is "only".
-*/
-
-rangeTable rangeTable_levelUnionSeq (/*@returned@*/ rangeTable t1, 
-				     /*@only@*/ rangeTable t2, int level)
-{
-  if (rangeTable_isUndefined (t2))
-    {
-      return t1;
-    }
-
-  if (rangeTable_isUndefined (t1))
-    {
-      t1 = rangeTable_newEmpty ();
-    }
-  else
-    {
-      rangeTable_levelPrune (t1, level);
-    }
-
-  rangeTable_elements (t2, key, value)
-    {
-      if (sRef_lexLevel (key) <= level)
-	{
-	  int ind = rangeTable_lookupRefs (t1, key);
-
-	  sRefSet_levelPrune (value, level);
-	      
-	  if (ind == ATINVALID)
-	    {
-	      /* okay, t2 is killed */
-	      /*@-exposetrans@*/ /*@-dependenttrans@*/ 
-	      t1 = rangeTable_addSet (t1, key, value);
-	      /*@=exposetrans@*/ /*@=dependenttrans@*/ 
-	    }
-	  else
-	    {
-	      sRefSet_free (t1->values[ind]);
-
-	      /*@-dependenttrans@*/ /* okay, t2 is killed */
-	      t1->values[ind] = value;
-	      /*@=dependenttrans@*/
-	    } 
-	}
-      else
-	{
-	  /*@-exposetrans@*/ /*@-dependenttrans@*/ 
-	  sRefSet_free (value);
-	  /*@=exposetrans@*/ /*@=dependenttrans@*/ 
-	}
-
-    } end_rangeTable_elements;
-  
-  sfree (t2->keys);
-  sfree (t2->values);
-  sfree (t2);
-
-    return t1;
-}
-
-rangeTable 
-rangeTable_levelUnion (/*@returned@*/ rangeTable t1, rangeTable t2, int level)
-{
-  if (rangeTable_isUndefined (t1))
-    {
-      if (rangeTable_isUndefined (t2)) 
-	{
-	  return t1;
-	}
-      else
-	{
-	  t1 = rangeTable_newEmpty ();
-	}
-    }
-  else
-    {
-      rangeTable_levelPrune (t1, level);
-    }
-
-  rangeTable_elements (t2, key, cvalue)
-    {
-      sRefSet value = sRefSet_newCopy (cvalue);
-
-      if (sRef_lexLevel (key) <= level)
-	{
-	  sRefSet_levelPrune (value, level);
-
-	  if (sRefSet_size (value) > 0)
-	    {
-	      int ind = rangeTable_lookupRefs (t1, key);
-	      
-	      if (ind == ATINVALID)
-		{
-		  t1 = rangeTable_addSet (t1, key, value);
-		}
-	      else
-		{
-		  t1->values[ind] = sRefSet_union (t1->values[ind], value);
-		  sRefSet_free (value);
-		}
-	    }
-	  else
-	    {
-	      sRefSet_free (value); 
-	    }
-	}
-      else
-	{
-	  sRefSet_free (value); 
-	}
-    } end_rangeTable_elements;
-
-    return t1;
-}
-
-rangeTable rangeTable_levelUnionNew (rangeTable t1, rangeTable t2, int level)
-{
-  rangeTable ret = rangeTable_levelUnion (rangeTable_copy (t1), t2, level);
-
-  return ret;
-}
-
-/*@only@*/ cstring
-rangeTable_unparse (rangeTable s)
-{
-   cstring st = cstring_undefined;
-
-   if (rangeTable_isUndefined (s)) return (cstring_makeLiteral (""));
-
-   rangeTable_elements (s, key, value)
-     {
-       st = message ("%q\t%q -> %q\n", st, sRef_unparse (key), 
-		     sRefSet_unparse (value));
-     } end_rangeTable_elements;
-
-   return st;
-}
-
-/*
-** bogus!
-*/
-
-void
-rangeTable_fixSrefs (rangeTable s)
-{
-  int i;
-
-  if (rangeTable_isUndefined (s)) return;
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      sRef old = s->keys[i];
-
-      if (sRef_isLocalVar (old))
-	{
-	  s->keys[i] = uentry_getSref (sRef_getUentry (old));
-	}
-
-      sRefSet_fixSrefs (s->values[i]);
-    }
-}
-
-void
-rangeTable_free (/*@only@*/ rangeTable s)
-{
-  int i;
-  
-  if (rangeTable_isUndefined (s)) return;
-  
-  for (i = 0; i < s->nelements; i++)
-    {
-      sRefSet_free (s->values[i]); 
-    }
-  
-  sfree (s->values);
-  sfree (s->keys);
-  sfree (s);
-}
-
-void 
-rangeTable_checkGlobs (rangeTable t)
-{
-  rangeTable_elements (t, key, value)
-    {
-      sRef root = sRef_getRootBase (key);
-
-      if (sRef_isRangeCheckedGlobal (root))
-	{
-	  sRefSet_realElements (value, sr)
-	    {
-	      root = sRef_getRootBase (sr);
-
-	      if (((sRef_isRangeCheckedGlobal (root) 
-		    && !(sRef_similar (root, key)))
-		   || sRef_isAnyParam (root))
-		  && !sRef_isExposed (root))
-		{
-		  if (sRef_isRangeCheckedGlobal (key))
-		    {
-		      if (!(sRef_isShared (key) 
-			    && sRef_isShared (root)))
-			{
-			  voptgenerror 
-			    (FLG_GLOBRANGE,
-			     message 
-			     ("Function returns with %q variable %q rangeing %q %q",
-			      cstring_makeLiteral (sRef_isRealGlobal (key) 
-						   ? "global" : "file static"),
-			      sRef_unparse (key),
-			      cstring_makeLiteral (sRef_isAnyParam (root) 
-						   ? "parameter" : "global"),
-			      sRef_unparse (sr)),
-			     g_currentloc);
-			}
-		    }
-
-		}
-	    } end_sRefSet_realElements;
-	}
-      else if (sRef_isAnyParam (key) || sRef_isAnyParam (root))
-	{
-	  sRefSet_realElements (value, sr)
-	    {
-	      root = sRef_getRootBase (sr);
-	      
-	      if (sRef_isRangeCheckedGlobal (root) 
-		  && !sRef_isExposed (root)
-		  && !sRef_isDead (key)
-		  && !sRef_isShared (root))
-		{
-		  voptgenerror 
-		    (FLG_GLOBRANGE,
-		     message ("Function returns with parameter %q rangeing %q %q",
-			      sRef_unparse (key),
-			      cstring_makeLiteral (sRef_isRealGlobal (root) 
-						   ? "global" : "file static"),
-			      sRef_unparse (sr)),
-		     g_currentloc);
-		}
-	    } end_sRefSet_realElements;
-	}
-      else
-	{
-	  ;
-	}
-    } end_rangeTable_elements;
-}
-
-
-
diff --git a/src/replaceNodeList.c b/src/replaceNodeList.c
deleted file mode 100644
index affdc89..0000000
--- a/src/replaceNodeList.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** replaceNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ replaceNodeList
-replaceNodeList_new ()
-{
-  replaceNodeList s = (replaceNodeList) dmalloc (sizeof (*s));
-
-  s->nelements = 0;
-  s->nspace = replaceNodeListBASESIZE;
-  s->elements = (replaceNode *)
-    dmalloc (sizeof (*s->elements) * replaceNodeListBASESIZE);
-
-  return (s);
-}
-
-static void
-replaceNodeList_grow (replaceNodeList s)
-{
-  int i;
-  replaceNode *newelements; 
-
-  s->nspace += replaceNodeListBASESIZE;
-
-  newelements = (replaceNode *) dmalloc (sizeof (*newelements)
-					 * (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements); 
-  s->elements  = newelements;
-}
-
-replaceNodeList
-  replaceNodeList_add (replaceNodeList s, replaceNode el)
-{
-  if (s->nspace <= 0)
-    replaceNodeList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-
-  return s;
-}
-
-/*@only@*/ cstring
-replaceNodeList_unparse (replaceNodeList s)
-{
-  bool first = TRUE;
-  cstring st = cstring_undefined;
-
-  replaceNodeList_elements (s, current)
-  {
-    if (first)
-      {
-	st = replaceNode_unparse (current);
-	first = FALSE;
-      }
-    else
-      {
-	st = message ("%q, %q", st, replaceNode_unparse (current));
-      }
-  } end_replaceNodeList_elements;
-
-  return st;
-}
-
-void
-replaceNodeList_free (replaceNodeList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-      replaceNode_free (s->elements[i]); 
-    }
-
-  sfree (s->elements); 
-  sfree (s);
-}
diff --git a/src/sRef.c b/src/sRef.c
deleted file mode 100644
index c8d8a89..0000000
--- a/src/sRef.c
+++ /dev/null
@@ -1,9190 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** storeRef.c
-**
-** Memory management:
-**    storeRef's are kept in allRefs for each function scope, and all are
-**    free'd at the end of the function.  This relies on the constraint that
-**    no storeRef created while checking a function is used outside that
-**    function.
-**
-**    storeRefs in the file and global scopes are free'd by the uentry.
-**
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-# include "exprChecks.h"
-# include "aliasChecks.h"
-# include "sRefTable.h"
-# include "structNames.h"
-
-/*
-** Predicate functions that evaluate both arguments in order.
-*/
-
-/*@notfunction@*/
-# define OR(a,b)  (a ? (b, TRUE) : b)
-
-/*@notfunction@*/
-# define AND(a,b) (a ? b : (b, FALSE))
-
-static bool sRef_isDerived (sRef p_s) /*@*/ ;
-
-static /*@exposed@*/ sRef sRef_fixDirectBase (sRef p_s, sRef p_base) 
-   /*@modifies p_base@*/ ;
-
-static bool sRef_isAllocatedStorage (sRef p_s) /*@*/ ;
-static void sRef_setNullErrorLoc (sRef p_s, fileloc) /*@*/ ;
-
-static void
-  sRef_aliasSetComplete (void (p_predf) (sRef, fileloc), sRef p_s, fileloc p_loc)
-  /*@modifies p_s@*/ ;
-
-static int sRef_depth (sRef p_s) /*@*/ ;
-
-static void
-  sRef_innerAliasSetComplete (void (p_predf) (sRef, fileloc), sRef p_s, 
-			      fileloc p_loc)
-  /*@modifies p_s@*/ ;
-
-static void
-  sRef_innerAliasSetCompleteParam (void (p_predf) (sRef, sRef), sRef p_s, sRef p_t)
-  /*@modifies p_s@*/ ;
-
-static void
-  sRef_aliasSetCompleteParam (void (p_predf) (sRef, alkind, fileloc), sRef p_s, 
-			      alkind p_kind, fileloc p_loc)
-  /*@modifies p_s@*/ ;
-
-static speckind speckind_fromInt (int p_i);
-static bool sRef_equivalent (sRef p_s1, sRef p_s2);
-static bool sRef_isDeepUnionField (sRef p_s);
-static void sRef_addDeriv (/*@notnull@*/ sRef p_s, /*@notnull@*/ sRef p_t);
-static sRef sRef_makeResultType (ctype p_ct) /*@*/ ;
-static bool sRef_checkModify (sRef p_s, sRefSet p_sl) /*@*/ ;
-
-static bool skind_isSimple (skind sk)
-{
-  switch (sk)
-    {
-    case SK_PARAM: case SK_CVAR: case SK_CONST:
-    case SK_OBJECT: case SK_UNKNOWN: case SK_NEW:
-      return TRUE;
-    default:
-      return FALSE;
-    }
-}
-
-static void sinfo_free (/*@special@*/ /*@temp@*/ /*@notnull@*/ sRef p_s)
-   /*@uses p_s->kind, p_s->info@*/
-   /*@releases p_s->info@*/ ;
-
-static /*@null@*/ sinfo sinfo_copy (/*@notnull@*/ sRef p_s) /*@*/ ;
-static void sRef_setPartsFromUentry (sRef p_s, uentry p_ue)
-   /*@modifies p_s@*/ ;
-static bool checkDeadState (/*@notnull@*/ sRef p_el, bool p_tbranch, fileloc p_loc);
-static sRef sRef_constructPointerAux (/*@notnull@*/ /*@exposed@*/ sRef p_t) /*@*/ ;
-
-static void 
-  sRef_combineExKinds (/*@notnull@*/ sRef p_res, /*@notnull@*/ sRef p_other)
-  /*@modifies p_res@*/ ;
-
-static void 
-  sRef_combineAliasKinds (/*@notnull@*/ sRef p_res, /*@notnull@*/ sRef p_other, 
-			  clause p_cl, fileloc p_loc)
-  /*@modifies p_res@*/ ;
-
-static void
-  sRef_combineNullState (/*@notnull@*/ sRef p_res, /*@notnull@*/ sRef p_other)
-  /*@modifies p_res@*/ ;
-
-static void
-  sRef_combineDefState (/*@notnull@*/ sRef p_res, /*@notnull@*/ sRef p_other)
-  /*@modifies p_res@*/ ;
-
-static void sRef_setStateFromAbstractUentry (sRef p_s, uentry p_ue) 
-  /*@modifies p_s@*/ ;
-
-static void 
-  sinfo_update (/*@notnull@*/ /*@exposed@*/ sRef p_res, 
-		/*@notnull@*/ /*@exposed@*/ sRef p_other);
-static /*@only@*/ alinfo alinfo_makeRefLoc (/*@exposed@*/ sRef p_ref, fileloc p_loc);
-static void sRef_setDefinedAux (sRef p_s, fileloc p_loc, bool p_clear)
-   /*@modifies p_s@*/ ;
-static void sRef_setDefinedNoClear (sRef p_s, fileloc p_loc)
-   /*@modifies p_s@*/ ;
-static void sRef_setStateAux (sRef p_s, sstate p_ss, fileloc p_loc)
-   /*@modifies p_s@*/;
-
-static /*@exposed@*/ sRef 
-  sRef_buildNCField (/*@exposed@*/ sRef p_rec, /*@exposed@*/ cstring p_f);
-
-static void 
-  sRef_mergeStateAux (/*@notnull@*/ sRef p_res, /*@notnull@*/ sRef p_other, 
-		      clause p_cl, bool p_opt, fileloc p_loc,
-		      bool p_doDerivs)
-  /*@modifies p_res, p_other@*/ ;
-
-static /*@null@*/ sinfo sinfo_fullCopy (/*@notnull@*/ sRef p_s);
-static bool sRef_doModify (sRef p_s, sRefSet p_sl) /*@modifies p_s@*/ ;
-static bool sRef_doModifyVal (sRef p_s, sRefSet p_sl) /*@modifies p_s@*/;
-static bool sRef_checkModifyVal (sRef p_s, sRefSet p_sl) /*@*/ ;
-
-static /*@only@*/ sRefSet
-  sRef_mergeDerivs (/*@only@*/ sRefSet p_res, sRefSet p_other, 
-		    bool p_opt, clause p_cl, fileloc p_loc);
-
-static /*@only@*/ sRefSet
-  sRef_mergeUnionDerivs (/*@only@*/ sRefSet p_res, 
-			 /*@exposed@*/ sRefSet p_other,
-			 bool p_opt, clause p_cl, fileloc p_loc);
-
-static /*@only@*/ sRefSet 
-  sRef_mergePdefinedDerivs (/*@only@*/ sRefSet p_res, sRefSet p_other, bool p_opt,
-			    clause p_cl, fileloc p_loc);
-
-static /*@only@*/ cstring sRef_unparseWithArgs (sRef p_s, uentryList p_args);
-static /*@only@*/ cstring sRef_unparseNoArgs (sRef p_s);
-
-static /*@exposed@*/ sRef sRef_findDerivedPointer (sRef p_s);
-static /*@exposed@*/ sRef sRef_findDerivedField (/*@notnull@*/ sRef p_rec, cstring p_f);
-static /*@exposed@*/ sRef
-  sRef_getDeriv (/*@notnull@*/ /*@returned@*/ sRef p_set, sRef p_guide);
-
-static bool inFunction = FALSE;
-static /*@only@*/ sRefTable allRefs;
-
-/* # define DEBUGREFS  */
-
-# ifdef DEBUGREFS
-static nsrefs = 0;
-static totnsrefs = 0;
-static maxnsrefs = 0;
-static ntotrefers = 0;
-static nrefers = 0;
-# endif
-
-/*@constant null alinfo alinfo_undefined; @*/
-# define alinfo_undefined ((alinfo) NULL)
-
-static /*@only@*/ /*@notnull@*/ alinfo alinfo_makeLoc (fileloc p_loc);
-static /*@only@*/ alinfo alinfo_copy (alinfo p_a);
-
-static /*@checked@*/ bool protectDerivs = FALSE;
-
-void sRef_protectDerivs (void) /*@modifies protectDerivs@*/
-{
-  llassert (!protectDerivs);
-  protectDerivs = TRUE;
-}
-
-void sRef_clearProtectDerivs (void) /*@modifies protectDerivs@*/
-{
-  llassert (protectDerivs);
-  protectDerivs = FALSE;
-}
-
-/*
-** hmmm...here be kind of a hack.  This function mysteriously appeared
-** in my code, but I'm sure I didn't write it.
-*/
-
-bool
-sRef_isRecursiveField (sRef s)
-{
-  if (sRef_isField (s))
-    {
-      if (sRef_depth (s) > 13)
-	{
-	  sRef base;
-	  cstring fieldname;
-	  
-	  fieldname = sRef_getField (s);
-	  base = sRef_getBase (s);
-	  
-	  while (sRef_isValid (base))
-	    {
-	      if (sRef_isField (base))
-		{
-		  if (cstring_equal (fieldname, sRef_getField (base)))
-		    {
-		      return TRUE;
-		    }
-		}
-	      
-	      base = sRef_getBaseSafe (base);
-	    }
-	}
-    }
-
-  return FALSE;
-}
-
-static void
-sRef_addDeriv (/*@notnull@*/ sRef s, /*@notnull@*/ sRef t)
-{
-  if (!context_inProtectVars () 
-      && !protectDerivs
-      && sRef_isValid (s)
-      && sRef_isValid (t)
-      && !sRef_isConst (s))
-    {
-      int sd = sRef_depth (s);
-      int td = sRef_depth (t);
-      
-      if (sd >= td)
-	{
-	  return;
-	}
-
-      if (sRef_isGlobal (s))
-	{
-	  if (context_inFunctionLike () 
-	      && ctype_isKnown (sRef_getType (s))
-	      && !ctype_isFunction (sRef_getType (s)))
-	    {
-	      globSet g = context_getUsedGlobs ();
-
-	      if (!globSet_member (g, s))
-		{
-		  /* 
-		  ** don't report as a bug 
-		  ** 
-
-		  llcontbug 
-			(message ("sRef_addDeriv: global variable not in used "
-				  "globs: %q / %s / %q",
-				  sRef_unparse (s), 
-				  ctype_unparse (sRef_getType (s)),
-				  sRefSet_unparse (s->deriv)));
-		  */
-		}
-	      else
-		{
-		  s->deriv = sRefSet_insert (s->deriv, t);
-		}
-	    }
-	}
-      else
-	{
-	  s->deriv = sRefSet_insert (s->deriv, t);
-	}
-    }
-}
-
-bool
-sRef_deepPred (bool (predf) (sRef), sRef s)
-{
-  if (sRef_isValid (s))
-    {
-      if ((*predf)(s)) return TRUE;
-
-      switch  (s->kind)
-	{
-	case SK_PTR:
-	  return (sRef_deepPred (predf, s->info->ref));
-	case SK_ARRAYFETCH:
-	  return (sRef_deepPred (predf, s->info->arrayfetch->arr));
-	case SK_FIELD:
-	  return (sRef_deepPred (predf, s->info->field->rec));
-	case SK_CONJ:
-	  return (sRef_deepPred (predf, s->info->conj->a)
-		  || sRef_deepPred (predf, s->info->conj->b));
-	default:
-	  return FALSE;
-	}
-    }
-
-  return FALSE;
-}
-
-bool sRef_modInFunction (void)
-{
-  return inFunction;
-}
-
-void sRef_setStateFromType (sRef s, ctype ct)
-{
-  if (sRef_isValid (s))
-    {
-      if (ctype_isUser (ct))
-	{
-	  sRef_setStateFromUentry 
-	    (s, usymtab_getTypeEntry (ctype_typeId (ct)));
-	}
-      else if (ctype_isAbstract (ct))
-	{
-	  sRef_setStateFromAbstractUentry 
-	    (s, usymtab_getTypeEntry (ctype_typeId (ct)));
-	}
-      else
-	{
-	  ; /* not a user type */
-	}
-    }
-}
-
-static void sRef_setTypeState (sRef s)
-{
-  if (sRef_isValid (s))
-    {
-      sRef_setStateFromType (s, s->type);
-    }
-}
-
-static void alinfo_free (/*@only@*/ alinfo a)
-{
-  if (a != NULL)
-    {
-      fileloc_free (a->loc);
-      sfree (a);
-    }
-}
-
-static /*@only@*/ alinfo alinfo_update (/*@only@*/ alinfo old, alinfo newinfo)
-/*
-** returns an alinfo with the same value as new.  May reuse the
-** storage of old.  (i.e., same effect as copy, but more
-** efficient.)
-*/
-{
-  if (old == NULL) 
-    {
-      old = alinfo_copy (newinfo);
-    }
-  else if (newinfo == NULL)
-    {
-      alinfo_free (old);
-      return NULL;
-    }
-  else
-    {
-      old->loc = fileloc_update (old->loc, newinfo->loc);
-      old->ref = newinfo->ref;
-      old->ue = newinfo->ue;
-    }
-
-  return old;
-}
-
-static /*@only@*/ alinfo alinfo_updateLoc (/*@only@*/ alinfo old, fileloc loc)
-{
-  if (old == NULL) 
-    {
-      old = alinfo_makeLoc (loc);
-    }
-  else
-    {
-      old->loc = fileloc_update (old->loc, loc);
-      old->ue = uentry_undefined;
-      old->ref = sRef_undefined;
-    }
-
-  return old;
-}
-
-static /*@only@*/ alinfo 
-  alinfo_updateRefLoc (/*@only@*/ alinfo old, /*@dependent@*/ sRef ref, fileloc loc)
-{
-  if (old == NULL) 
-    {
-      old = alinfo_makeRefLoc (ref, loc);
-    }
-  else
-    {
-      old->loc = fileloc_update (old->loc, loc);
-      old->ue = uentry_undefined;
-      old->ref = ref;
-    }
-
-  return old;
-}
-
-static /*@only@*/ alinfo
-alinfo_copy (alinfo a)
-{
-  if (a == NULL)
-    {
-      return NULL;
-    }
-  else
-    {
-      alinfo ret = (alinfo) dmalloc (sizeof (*ret));
-      
-      ret->loc = fileloc_copy (a->loc); /*< should report bug without copy! >*/
-      ret->ue = a->ue;
-      ret->ref = a->ref;
-
-      return ret;
-    }
-}
-
-static bool
-  sRef_hasAliasInfoLoc (sRef s)
-{
-  return (sRef_isValid (s) && (s->aliasinfo != NULL)
-	  && (fileloc_isDefined (s->aliasinfo->loc)));
-}
-
-static /*@falsenull@*/ bool
-sRef_hasStateInfoLoc (sRef s)
-{
-  return (sRef_isValid (s) && (s->definfo != NULL) 
-	  && (fileloc_isDefined (s->definfo->loc)));
-}
-
-static /*@falsenull@*/ bool
-sRef_hasExpInfoLoc (sRef s)
-{
-  return (sRef_isValid (s) 
-	  && (s->expinfo != NULL) && (fileloc_isDefined (s->expinfo->loc)));
-}
-
-static bool
-sRef_hasNullInfoLoc (sRef s)
-{
-  return (sRef_isValid (s) && (s->nullinfo != NULL) 
-	  && (fileloc_isDefined (s->nullinfo->loc)));
-}
-
-bool
-sRef_hasAliasInfoRef (sRef s)
-{
-  return (sRef_isValid (s) && (s->aliasinfo != NULL) 
-	  && (sRef_isValid (s->aliasinfo->ref)));
-}
-
-static /*@observer@*/ fileloc
-sRef_getAliasInfoLoc (/*@exposed@*/ sRef s)
-{
-  llassert (sRef_isValid (s) && s->aliasinfo != NULL
-	    && (fileloc_isDefined (s->aliasinfo->loc)));
-  return (s->aliasinfo->loc);
-}
-
-static /*@observer@*/ fileloc
-sRef_getStateInfoLoc (/*@exposed@*/ sRef s)
-{
-  llassert (sRef_isValid (s) && s->definfo != NULL 
-	    && (fileloc_isDefined (s->definfo->loc)));
-  return (s->definfo->loc);
-}
-
-static /*@observer@*/ fileloc
-sRef_getExpInfoLoc (/*@exposed@*/ sRef s)
-{
-  llassert (sRef_isValid (s) && s->expinfo != NULL 
-	    && (fileloc_isDefined (s->expinfo->loc)));
-  return (s->expinfo->loc);
-}
-
-static /*@observer@*/ fileloc
-sRef_getNullInfoLoc (/*@exposed@*/ sRef s)
-{
-  llassert (sRef_isValid (s) && s->nullinfo != NULL 
-	    && (fileloc_isDefined (s->nullinfo->loc)));
-  return (s->nullinfo->loc);
-}
-
-/*@observer@*/ sRef
-  sRef_getAliasInfoRef (/*@exposed@*/ sRef s)
-{
-  llassert (sRef_isValid (s) && s->aliasinfo != NULL);
-  return (s->aliasinfo->ref);
-}
-
-static /*@only@*/ /*@notnull@*/ alinfo
-alinfo_makeLoc (fileloc loc)
-{
-  alinfo ret = (alinfo) dmalloc (sizeof (*ret));
-
-  ret->loc = fileloc_copy (loc); /* don't need to copy! */
-  ret->ue = uentry_undefined;
-  ret->ref = sRef_undefined;
-  
-  return ret;
-}
-
-static /*@only@*/ alinfo
-alinfo_makeRefLoc (/*@exposed@*/ sRef ref, fileloc loc)
-{
-  alinfo ret = (alinfo) dmalloc (sizeof (*ret));
-
-  ret->loc = fileloc_copy (loc);
-  ret->ref = ref;
-  ret->ue  = uentry_undefined;
-  
-  return ret;
-}
-
-/*
-** This function should be called before new sRefs are created
-** somewhere where they will have a lifetime greater than the
-** current function scope.
-*/
-
-void sRef_setGlobalScope ()
-{
-  llassert (inFunction);
-  inFunction = FALSE;
-}
-
-void sRef_clearGlobalScope ()
-{
-  llassert (!inFunction);
-  inFunction = TRUE;
-}
-
-static bool oldInFunction = FALSE;
-
-void sRef_setGlobalScopeSafe ()
-{
-    oldInFunction = inFunction;
-  inFunction = FALSE;
-}
-
-void sRef_clearGlobalScopeSafe ()
-{
-    inFunction = oldInFunction;
-}
-
-void sRef_enterFunctionScope ()
-{
-  llassert (!inFunction);
-  llassert (sRefTable_isEmpty (allRefs));
-  inFunction = TRUE;
-}
-
-void sRef_exitFunctionScope ()
-{
-  
-  if (inFunction)
-    {
-      sRefTable_clear (allRefs);
-      inFunction = FALSE;
-    }
-  else
-    {
-      llbuglit ("sRef_exitFunctionScope: not in function");
-    }
-}
-  
-void sRef_destroyMod () /*@globals killed allRefs;@*/
-{
-# ifdef DEBUGREFS  
-  llmsg (message ("Live: %d / %d ", nsrefs, totnsrefs));  
-# endif
-
-  sRefTable_free (allRefs);
-}
-
-/*
-** Result of sRef_alloc is dependent since allRefs may
-** reference it.  It is only if !inFunction.
-*/
-
-static /*@dependent@*/ /*@out@*/ /*@notnull@*/ sRef
-sRef_alloc (void)
-{
-  sRef s = (sRef) dmalloc (sizeof (*s));
-
-  if (inFunction)
-    {
-      allRefs = sRefTable_add (allRefs, s);
-      /*@-branchstate@*/ 
-    } 
-  /*@=branchstate@*/
-
-# ifdef DEBUGREFS
-  if (nsrefs >= maxnsrefs)
-    {
-      maxnsrefs = nsrefs;
-    }
-
-  totnsrefs++;
-  nsrefs++;
-# endif
-
-  /*@-mustfree@*/ /*@-freshtrans@*/
-  return s;
-  /*@=mustfree@*/ /*@=freshtrans@*/
-}
-
-static /*@dependent@*/ /*@notnull@*/ /*@special@*/ sRef
-  sRef_new (void)
-  /*@defines result@*/
-  /*@post:isnull result->aliasinfo, result->definfo, result->nullinfo, 
-                 result->expinfo, result->info, result->deriv@*/
-{
-  sRef s = sRef_alloc ();
-
-  s->kind = SK_UNKNOWN;
-  s->safe = TRUE;
-  s->modified = FALSE;
-  s->type = ctype_unknown;
-  s->defstate = SS_UNKNOWN;
-
-  /* start modifications */
-  s->bufinfo.bufstate = BB_NOTNULLTERMINATED;
-  /* end modifications */
-
-  s->aliaskind = AK_UNKNOWN;
-  s->oaliaskind = AK_UNKNOWN;
-
-  s->nullstate = NS_UNKNOWN;
-
-  s->expkind = XO_UNKNOWN;
-  s->oexpkind = XO_UNKNOWN;
-
-  s->aliasinfo = alinfo_undefined;
-  s->definfo = alinfo_undefined;
-  s->nullinfo = alinfo_undefined;
-  s->expinfo = alinfo_undefined;
-
-  s->info = NULL;
-  s->deriv = sRefSet_undefined;
-
-  return s;
-}
-
-static /*@notnull@*/ /*@exposed@*/ sRef
-sRef_fixConj (/*@notnull@*/ sRef s)
-{
-  if (sRef_isConj (s))
-    {
-      do {
-	s = sRef_getConjA (s);
-      } while (sRef_isConj (s));
-      
-      llassert (sRef_isValid (s));
-      return s; /* don't need to ref */
-    }
-  else
-    {
-      return s;
-    }
-}
-
-static bool 
-sRef_isExternallyVisibleAux (sRef s)
-{
-  bool res = FALSE;
-  sRef base = sRef_getRootBase (s);
-
-  if (sRef_isValid (base))
-    {
-      res = sRef_isParam (base) || sRef_isGlobal (base) || sRef_isExternal (base);
-    }
-
-  return res;
-}
-
-bool 
-  sRef_isExternallyVisible (sRef s)
-{
-  return (sRef_aliasCheckSimplePred (sRef_isExternallyVisibleAux, s));
-}
-
-/*@exposed@*/ uentry
-sRef_getBaseUentry (sRef s)
-{
-  sRef base = sRef_getRootBase (s);
-  uentry res = uentry_undefined;
-  
-  if (sRef_isValid (base))
-    {
-      switch (base->kind)
-	{
-	case SK_PARAM:
-	  res = usymtab_getRefQuiet (paramsScope, base->info->paramno);
-	  break;
-
-	case SK_CVAR:
-	  res = usymtab_getRefQuiet (base->info->cvar->lexlevel, 
-				     base->info->cvar->index);
-	  break;
-
-	default:
-	  break;
-	}  
-    }
-
-  return res;
-}
-
-/*
-** lookup the current uentry corresponding to s, and return the corresponding sRef.
-** yuk yuk yuk yuk yuk yuk yuk yuk
-*/
-
-/*@exposed@*/ sRef
-sRef_updateSref (sRef s)
-{
-  sRef inner;
-  sRef ret;
-  sRef res;
-
-  if (!sRef_isValid (s)) return sRef_undefined;
-
-  
-  switch (s->kind)
-    {
-    case SK_UNKNOWN:
-    case SK_OBJECT:
-    case SK_NEW:
-    case SK_TYPE:
-    case SK_EXTERNAL:
-    case SK_DERIVED:
-    case SK_UNCONSTRAINED:
-    case SK_CONST:
-    case SK_SPECIAL:
-    case SK_RESULT:
-      return s; 
-    case SK_PARAM:
-    case SK_CVAR:
-      {
-	uentry ue = sRef_getUentry (s);
-
-	/* must be raw name!  (need the marker) */
-	ue = usymtab_lookupSafe (uentry_rawName (ue));
-	
-	if (uentry_isUndefined (ue))
-	  {
-	    	    return s;
-	  }
-	else
-	  {
-	    	    return (uentry_getSref (ue));
-	  }
-      }
-    case SK_ARRAYFETCH:
-      /* special case if ind known */
-      inner = s->info->arrayfetch->arr;
-      ret = sRef_updateSref (inner);
-
-      if (ret == inner) 
-	{
-	  res = s; 
-	}
-      else 
-	{
-	  res = sRef_makeArrayFetch (ret);
-	}
-
-      return res;
-
-    case SK_FIELD:
-      inner = s->info->field->rec;
-      ret = sRef_updateSref (inner);
-
-      if (ret == inner) 
-	{
-	  res = s; 
-	}
-      else 
-	{
-	  res = (sRef_makeField (ret, s->info->field->field));
-	}
-
-      return (res);
-    case SK_PTR:
-      inner = s->info->ref;
-      ret = sRef_updateSref (inner);
-      if (ret == inner) 
-	{
-	  res = s; 
-	}
-      else
-	{
-	  res = sRef_makePointer (ret);
-	}
-
-      return (res);
-
-    case SK_ADR:
-      inner = s->info->ref;
-      ret = sRef_updateSref (inner);
-
-      if (ret == inner)
-	{
-	  res = s; 
-	}
-      else 
-	{
-	  res = sRef_makeAddress (ret);
-	}
-
-      return (res);
-
-    case SK_CONJ:
-      {
-	sRef innera = s->info->conj->a;
-	sRef innerb = s->info->conj->b;
-	sRef reta = sRef_updateSref (innera);
-	sRef retb = sRef_updateSref (innerb);
-
-	if (innera == reta && innerb == retb)
-	  {
-	    res = s;
-	  }
-	else 
-	  {
-	    res = sRef_makeConj (reta, retb);
-	  }
-
-	return (res);
-      }
-    }
-  
-  BADEXIT;
-}
-
-uentry
-sRef_getUentry (sRef s)
-{
-  llassert (sRef_isValid (s));
-
-  switch (s->kind)
-    {
-    case SK_PARAM:
-      return (usymtab_getRefQuiet (paramsScope, s->info->paramno));
-    case SK_CVAR:
-      return (usymtab_getRefQuiet (s->info->cvar->lexlevel, s->info->cvar->index));
-    case SK_CONJ:
-      {
-	if (sRef_isCvar (s->info->conj->a) || sRef_isParam (s->info->conj->a)
-	    || sRef_isConj (s->info->conj->a))
-	  {
-	    return sRef_getUentry (s->info->conj->a);
-	  }
-	else 
-	  {
-	    return sRef_getUentry (s->info->conj->b);
-	  }
-      }
-    case SK_UNKNOWN:
-    case SK_SPECIAL:
-      return uentry_undefined;
-    BADDEFAULT;
-    }
-}
-
-int
-sRef_getParam (sRef s)
-{
-  llassert (sRef_isValid (s));
-  llassert (s->kind == SK_PARAM);
-
-  return s->info->paramno;
-}
-
-bool
-sRef_isModified (sRef s)
-{
-    return (!sRef_isValid (s) || s->modified);
-}
-
-void sRef_setModified (sRef s)
-{
-  if (sRef_isValid (s))
-    {
-      s->modified = TRUE;
-
-      
-      if (sRef_isRefsField (s))
-	{
-	  sRef base = sRef_getBase (s);
-
-	  
-	  llassert (s->kind == SK_FIELD);
-
-	  
-	  if (sRef_isPointer (base))
-	    {
-	      base = sRef_getBase (base);
-	      	    }
-
-	  if (sRef_isRefCounted (base))
-	    {
-	      base->aliaskind = AK_NEWREF;
-	      	    }
-	}
-
-          }
-}
-
-/*
-** note: this side-effects sRefSet to set modified to TRUE
-** for any sRef similar to s.
-*/
-
-bool
-sRef_canModifyVal (sRef s, sRefSet sl)
-{
-  if (context_getFlag (FLG_MUSTMOD))
-    {
-      return (sRef_doModifyVal (s, sl));
-    }
-  else
-    {
-      return (sRef_checkModifyVal (s, sl));
-    }
-}
-
-bool
-sRef_canModify (sRef s, sRefSet sl)
-{
-  
-  if (context_getFlag (FLG_MUSTMOD))
-    {
-      return (sRef_doModify (s, sl));
-    }
-  else
-    {
-      return (sRef_checkModify (s, sl));
-    }
-}
-
-/*
-** No side-effects
-*/
-
-static
-bool sRef_checkModifyVal (sRef s, sRefSet sl)
-{
-  if (sRef_isInvalid (s))
-    {
-      return TRUE;
-    }
-  
-  switch (s->kind)
-    {
-    case SK_UNCONSTRAINED:
-    case SK_CONST:
-      return TRUE;
-    case SK_CVAR:
-      if (sRef_isGlobal (s))
-	{
-	  if (context_checkGlobMod (s))
-	    {
-	      return (sRefSet_member (sl, s));
-	    }
-
-	  return TRUE;
-	}
-      else
-	{
-	  return TRUE;
-	}
-    case SK_PARAM:
-            return (sRefSet_member (sl, s) 
-	      || alkind_isOnly (sRef_getOrigAliasKind (s)));
-    case SK_ARRAYFETCH: 
-      /* special case if ind known */
-      return (sRefSet_member (sl, s) ||
-	      sRef_checkModifyVal (s->info->arrayfetch->arr, sl));
-    case SK_FIELD:
-      return (sRefSet_member (sl, s) || sRef_checkModifyVal (s->info->field->rec, sl));
-    case SK_PTR:
-      return (sRefSet_member (sl, s) || sRef_checkModifyVal (s->info->ref, sl));
-    case SK_ADR:
-      return (sRefSet_member (sl, s) || sRef_checkModifyVal (s->info->ref, sl));
-    case SK_CONJ:
-      return ((sRef_checkModifyVal (s->info->conj->a, sl)) &&
-	      (sRef_checkModifyVal (s->info->conj->b, sl)));
-    case SK_UNKNOWN:
-    case SK_OBJECT:
-    case SK_NEW:
-    case SK_TYPE:
-    case SK_DERIVED:
-      return TRUE;
-    case SK_EXTERNAL:
-      return TRUE;
-    case SK_SPECIAL:
-      {
-	switch (s->info->spec)
-	  {
-	  case SR_NOTHING:   return TRUE;
-	  case SR_INTERNAL:  
-	    if (context_getFlag (FLG_INTERNALGLOBS))
-	      {
-		return (sRefSet_member (sl, s));
-	      }
-	    else
-	      {
-		return TRUE;
-	      }
-	  case SR_SPECSTATE: return TRUE;
-	  case SR_SYSTEM:    return (sRefSet_member (sl, s));
-	  }
-      }
-    case SK_RESULT: BADBRANCH;
-    }
-  BADEXIT;
-}
-
-/*
-** this should probably be elsewhere...
-**
-** returns TRUE iff sl indicates that s can be modified
-*/
-
-static bool sRef_checkModify (sRef s, sRefSet sl)
-{
-  llassert (sRef_isValid (s));
-
-  switch (s->kind)
-    {
-    case SK_UNCONSTRAINED:
-    case SK_CONST:
-      return TRUE;
-    case SK_CVAR:
-      if (sRef_isGlobal (s))
-	{
-	  if (context_checkGlobMod (s))
-	    {
-	      return (sRefSet_member (sl, s));
-	    }
-
-	  return TRUE;
-	}
-      else
-	{
-	  return TRUE;
-	}
-    case SK_PARAM:
-      return TRUE;
-    case SK_ARRAYFETCH:
-      return (sRefSet_member (sl, s) ||
-	      sRef_checkModifyVal (s->info->arrayfetch->arr, sl));
-    case SK_FIELD:
-      {
-	sRef sr = s->info->field->rec;
-
-	if (sr->kind == SK_PARAM)
-	  return TRUE; /* structs are copied on call */
-
-	return (sRefSet_member (sl, s) || sRef_checkModifyVal (s->info->field->rec, sl));
-      }
-    case SK_PTR:
-      {
-	bool sm;
-
-	sm = sRefSet_member (sl, s);
-
-	if (sm)
-	  return TRUE;
-	else
-	  return (sRef_checkModifyVal (s->info->ref, sl));
-      }
-    case SK_ADR:
-      return (sRefSet_member (sl, s) || sRef_checkModifyVal (s->info->ref, sl));
-    case SK_CONJ:
-      return ((sRef_checkModify (s->info->conj->a, sl)) &&
-	      (sRef_checkModify (s->info->conj->b, sl)));
-    case SK_NEW:
-    case SK_OBJECT:
-    case SK_UNKNOWN:
-    case SK_TYPE:
-    case SK_DERIVED:
-    case SK_EXTERNAL:
-      return TRUE;
-    case SK_SPECIAL:
-      {
-	switch (s->info->spec)
-	  {
-	  case SR_NOTHING:   return TRUE;
-	  case SR_INTERNAL:  
-	    if (context_getFlag (FLG_INTERNALGLOBS))
-	      {
-		return (sRefSet_member (sl, s));
-	      }
-	    else
-	      {
-		return TRUE;
-	      }
-	  case SR_SPECSTATE: return TRUE;
-	  case SR_SYSTEM:    return (sRefSet_member (sl, s));
-	  }
-      }
-    case SK_RESULT: BADBRANCH;
-    }
-  BADEXIT;
-}
-
-cstring sRef_stateVerb (sRef s)
-{
-  if (sRef_isDead (s))
-    {
-      return cstring_makeLiteralTemp ("released");
-    }
-  else if (sRef_isKept (s))
-    {
-      return cstring_makeLiteralTemp ("kept");
-    }
-  else if (sRef_isDependent (s))
-    {
-      return cstring_makeLiteralTemp ("dependent");
-    }
-  else
-    {
-      BADEXIT;
-    }
-}
-
-cstring sRef_stateAltVerb (sRef s)
-{
-  if (sRef_isDead (s))
-    {
-      return cstring_makeLiteralTemp ("live");
-    }
-  else if (sRef_isKept (s))
-    {
-      return cstring_makeLiteralTemp ("not kept");
-    }
-  else if (sRef_isDependent (s))
-    {
-      return cstring_makeLiteralTemp ("independent");
-    }
-  else
-    {
-      BADEXIT;
-    }
-}
-
-static 
-bool sRef_doModifyVal (sRef s, sRefSet sl)
-{
-  llassert (sRef_isValid (s));
-
-  
-  switch (s->kind)
-    {
-    case SK_UNCONSTRAINED:
-    case SK_CONST:
-      return TRUE;
-    case SK_CVAR:
-      if (sRef_isGlobal (s))
-	{
-	  
-	  if (context_checkGlobMod (s))
-	    {
-	      return (sRefSet_modifyMember (sl, s));
-	    }
-	  else
-	    {
-	      (void) sRefSet_modifyMember (sl, s);
-	    }
-
-	  	  return TRUE;
-	}
-      else
-	{
-	  return TRUE;
-	}      
-    case SK_PARAM:
-      return (sRefSet_modifyMember (sl, s) 
-	      || alkind_isOnly (sRef_getOrigAliasKind (s)));
-    case SK_ARRAYFETCH:
-      /* special case if ind known */
-      /* unconditional OR, need side effect */
-      return (OR (sRefSet_modifyMember (sl, s),
-		  sRef_doModifyVal (s->info->arrayfetch->arr, sl)));
-    case SK_FIELD:
-      return (OR (sRefSet_modifyMember (sl, s),
-		  sRef_doModifyVal (s->info->field->rec, sl)));
-    case SK_PTR:
-      return (OR (sRefSet_modifyMember (sl, s),
-		  sRef_doModifyVal (s->info->ref, sl)));
-    case SK_ADR:
-      return (OR (sRefSet_modifyMember (sl, s),
-		  sRef_doModifyVal (s->info->ref, sl)));
-    case SK_CONJ:
-      return (AND (sRef_doModifyVal (s->info->conj->a, sl) ,
-		   sRef_doModifyVal (s->info->conj->b, sl)));
-    case SK_OBJECT:
-    case SK_DERIVED:
-    case SK_EXTERNAL:
-    case SK_UNKNOWN:
-    case SK_NEW:
-    case SK_TYPE:
-      return TRUE;
-    case SK_SPECIAL:
-      {
-	switch (s->info->spec)
-	  {
-	  case SR_NOTHING:   return TRUE;
-	  case SR_INTERNAL:  
-	    if (context_getFlag (FLG_INTERNALGLOBS))
-	      {
-		return (sRefSet_modifyMember (sl, s));
-	      }
-	    else
-	      {
-		(void) sRefSet_modifyMember (sl, s);
-		return TRUE;
-	      }
-	  case SR_SPECSTATE: 
-	    {
-	      return TRUE;
-	    }
-	  case SR_SYSTEM:
-	    {
-	      return (sRefSet_modifyMember (sl, s));
-	    }
-	  }
-      }
-    case SK_RESULT: BADBRANCH;
-    }
-  BADEXIT;
-}
-
-/*
-** this should probably be elsewhere...
-**
-** returns TRUE iff sl indicates that s can be modified
-*/
-
-static 
-bool sRef_doModify (sRef s, sRefSet sl)
-{
-    llassert (sRef_isValid (s));
-  
-  switch (s->kind)
-    {
-    case SK_UNCONSTRAINED:
-    case SK_CONST:
-      return TRUE;
-    case SK_CVAR:
-      if (sRef_isGlobal (s))
-	{
-	  if (context_checkGlobMod (s))
-	    {
-	      return (sRefSet_modifyMember (sl, s));
-	    }
-	  else
-	    {
-	      (void) sRefSet_modifyMember (sl, s);
-	    }
-
-	  return TRUE;
-	}
-      else
-	{
-	  return TRUE;
-	}
-    case SK_PARAM:
-      return TRUE;
-    case SK_ARRAYFETCH:
-            return (OR (sRefSet_modifyMember (sl, s),
-		  sRef_doModifyVal (s->info->arrayfetch->arr, sl)));
-    case SK_FIELD:
-      {
-	sRef sr = s->info->field->rec;
-
-	if (sr->kind == SK_PARAM)
-	  {
-	    return TRUE; /* structs are shallow-copied on call */
-	  }
-	
-	return (OR (sRefSet_modifyMember (sl, s),
-		    sRef_doModifyVal (s->info->field->rec, sl)));
-      }
-    case SK_PTR:
-      {
-	return (OR (sRefSet_modifyMember (sl, s),
-		    sRef_doModifyVal (s->info->ref, sl)));
-      }
-    case SK_ADR:
-      return (OR (sRefSet_modifyMember (sl, s),
-		  sRef_doModifyVal (s->info->ref, sl)));
-    case SK_CONJ:
-      return (AND (sRef_doModify (s->info->conj->a, sl),
-		  (sRef_doModify (s->info->conj->b, sl))));
-    case SK_UNKNOWN:
-    case SK_NEW:
-    case SK_TYPE:
-      return TRUE;
-    case SK_OBJECT:
-    case SK_DERIVED:
-    case SK_EXTERNAL:
-      return TRUE;
-    case SK_SPECIAL:
-      {
-	switch (s->info->spec)
-	  {
-	  case SR_NOTHING:   return TRUE;
-	  case SR_INTERNAL:  return TRUE;
-	  case SR_SPECSTATE: return TRUE;
-	  case SR_SYSTEM:    return (sRefSet_modifyMember (sl, s));
-	  }
-      }
-    case SK_RESULT: BADBRANCH;
-    }
-  BADEXIT;
-}
-
-static /*@exposed@*/ sRef
-  sRef_leastCommon (/*@exposed@*/ sRef s1, sRef s2)
-{
-  llassert (sRef_similar (s1, s2));
-  
-  if (!sRef_isValid (s1)) return s1;
-  if (!sRef_isValid (s2)) return s1;
-
-  sRef_combineDefState (s1, s2);
-  sRef_combineNullState (s1, s2);
-  sRef_combineExKinds (s1, s2);
-  
-  if (s1->aliaskind != s2->aliaskind)
-    {
-      if (s1->aliaskind == AK_UNKNOWN)
-	{
-	  s1->aliaskind = s2->aliaskind;
-	}
-      else if (s2->aliaskind == AK_UNKNOWN)
-	{
-	  ;
-	}
-      else
-	{
-	  s1->aliaskind = AK_ERROR;
-	}
-    }
-
-  return s1;
-}
-
-int sRef_compare (sRef s1, sRef s2)
-{
-  if (s1 == s2) return 0;
-
-  if (sRef_isInvalid (s1)) return -1;
-  if (sRef_isInvalid (s2)) return 1;
-      
-  INTCOMPARERETURN (s1->kind, s2->kind);
-  INTCOMPARERETURN (s1->defstate, s2->defstate);
-  INTCOMPARERETURN (s1->aliaskind, s2->aliaskind);
-
-  COMPARERETURN (nstate_compare (s1->nullstate, s2->nullstate));
-
-  switch (s1->kind)
-    {
-    case SK_PARAM:
-      return (int_compare (s1->info->paramno, s2->info->paramno));
-    case SK_ARRAYFETCH:
-      {
-	COMPARERETURN (sRef_compare (s1->info->arrayfetch->arr, 
-				     s2->info->arrayfetch->arr));
-	
-	if (s1->info->arrayfetch->indknown && s2->info->arrayfetch->indknown)
-	  {
-	    return (int_compare (s1->info->arrayfetch->ind, 
-				 s2->info->arrayfetch->ind));
-	  }
-	if (!s1->info->arrayfetch->indknown && !s2->info->arrayfetch->indknown)
-	  return 0;
-	
-	return 1;
-      }
-    case SK_FIELD:
-      {
-	COMPARERETURN (sRef_compare (s1->info->field->rec, s2->info->field->rec));
-	
-	if (cstring_equal (s1->info->field->field, s2->info->field->field))
-	  return 0;
-
-	return 1;
-      }
-    case SK_PTR:
-    case SK_ADR:
-      return (sRef_compare (s1->info->ref, s2->info->ref));
-    case SK_CONJ:
-      COMPARERETURN (sRef_compare (s1->info->conj->a, s2->info->conj->a));
-      return (sRef_compare (s1->info->conj->b, s2->info->conj->b));
-    case SK_UNCONSTRAINED:
-      return (cstring_compare (s1->info->fname, s2->info->fname));
-    case SK_NEW:
-    case SK_CVAR:
-    case SK_UNKNOWN:
-    case SK_OBJECT:
-    case SK_TYPE:
-    case SK_DERIVED:
-    case SK_EXTERNAL:
-    case SK_CONST:
-    case SK_RESULT:
-      return 0;
-    case SK_SPECIAL:
-      return (generic_compare (s1->info->spec, s2->info->spec));
-    }
-  BADEXIT;
-}
-
-static bool cref_equal (cref c1, cref c2)
-{
-  return ((c1->lexlevel == c2->lexlevel) &&
-	  (usymId_equal (c1->index, c2->index)));
-}
-
-/*
-** returns true if s1 could be the same storage as s2.
-** i.e., a[?] ~ a[3].  Note its not symmetric ... s1
-** should be more specific.
-*/
-
-/*
-** like similar, but matches objects <-> non-objects
-*/
-
-static bool 
-sRef_uniqueReference (sRef s)
-{
-  return (sRef_isFresh (s) || sRef_isUnique (s) 
-	  || sRef_isOnly (s) || sRef_isStack (s)
-	  || sRef_isAddress (s)); 
-}
-
-static bool
-sRef_similarRelaxedAux (sRef s1, sRef s2)
-{
-  if (s1 == s2)
-    {
-      if (sRef_isUnknownArrayFetch (s1))
-	{
-	  return FALSE;
-	}
-      else
-	{
-	  return TRUE;
-	}
-    }
-
-  if (sRef_isInvalid (s1) || sRef_isInvalid (s2)) return FALSE;
-
-  if (sRef_isConj (s2)) 
-    return (sRef_similarRelaxedAux (s1, sRef_getConjA (s2)) ||
-	    sRef_similarRelaxedAux (s1, sRef_getConjB (s2)));
-
-  switch (s1->kind)
-    {
-    case SK_CVAR:
-      return ((s2->kind == SK_CVAR)
-	      && (cref_equal (s1->info->cvar, s2->info->cvar)));
-    case SK_PARAM:
-      return ((s2->kind == SK_PARAM)
-	      && (s1->info->paramno == s2->info->paramno));
-    case SK_ARRAYFETCH:
-      if (s2->kind == SK_ARRAYFETCH)
-	{
-	  if (sRef_similarRelaxedAux (s1->info->arrayfetch->arr,
-				      s2->info->arrayfetch->arr))
-	    {
-	      if (s1->info->arrayfetch->indknown)
-		{
-		  if (s2->info->arrayfetch->indknown)
-		    {
-		      return (s1->info->arrayfetch->ind == s2->info->arrayfetch->ind);
-		    }
-		  else 
-		    {
-		      return FALSE;
-		    }
-		}
-	      else
-		{
-		  return FALSE;
-		}
-	    }
-	}
-      return FALSE;
-    case SK_FIELD:
-      return ((s2->kind == SK_FIELD
-	       && (sRef_similarRelaxedAux (s1->info->field->rec,
-					   s2->info->field->rec)
-		   && cstring_equal (s1->info->field->field,
-				     s2->info->field->field))));
-    case SK_PTR:
-      return ((s2->kind == SK_PTR)
-	      && sRef_similarRelaxedAux (s1->info->ref, s2->info->ref));
-    case SK_ADR:
-      return ((s2->kind == SK_ADR)
-	      && sRef_similarRelaxedAux (s1->info->ref, s2->info->ref));
-    case SK_CONJ:
-      return ((sRef_similarRelaxedAux (s1->info->conj->a, s2) ||
-	      (sRef_similarRelaxedAux (s1->info->conj->b, s2))));
-    case SK_SPECIAL:
-      return (s1->info->spec == s2->info->spec);
-    case SK_UNCONSTRAINED:
-      return (cstring_equal (s1->info->fname, s2->info->fname));
-    case SK_DERIVED:
-    case SK_CONST:
-    case SK_TYPE:
-    case SK_NEW:
-    case SK_UNKNOWN:
-    case SK_OBJECT:
-    case SK_EXTERNAL:
-    case SK_RESULT:
-      return FALSE;
-    }
-  BADEXIT;
-}
-
-bool
-sRef_similarRelaxed (sRef s1, sRef s2)
-{
-  bool us1, us2;
-
-  if (s1 == s2) 
-    {
-      if (sRef_isThroughArrayFetch (s1))
-	{
-	  return FALSE;
-	}
-      else
-	{
-	  return TRUE;
-	}
-    }
-
-  if (sRef_isInvalid (s1) || sRef_isInvalid (s2)) return FALSE;
-
-  us1 = sRef_uniqueReference (s1);
-  us2 = sRef_uniqueReference (s2);
-
-  if ((s1->kind == SK_EXTERNAL && (s2->kind != SK_EXTERNAL && !us2))
-      || (s2->kind == SK_EXTERNAL && (s1->kind != SK_EXTERNAL && !us1)))
-    {
-      /*
-      ** Previously, also:
-      **   || (sRef_isExposed (s1) && !us2) || (sRef_isExposed (s2) && !us1)) ???? 
-      **
-      ** No clue why this was there?!
-      */
-
-
-      if (sRef_isExposed (s1) && sRef_isCvar (s1))
-	{
-	  uentry ue1 = sRef_getUentry (s1);
-
-	  if (uentry_isRefParam (ue1))
-	    {
-	      return sRef_similarRelaxedAux (s1, s2);
-	    }
-	}
-      
-      if (sRef_isExposed (s2) && sRef_isCvar (s2))
-	{
-	  uentry ue2 = sRef_getUentry (s2);
-
-	  if (uentry_isRefParam (ue2))
-	    {
-	      return sRef_similarRelaxedAux (s1, s2);
-	    }
-	}
-      
-            return (ctype_match (s1->type, s2->type));
-    }
-  else
-    {
-            return sRef_similarRelaxedAux (s1, s2);
-    }
-}
-
-bool
-sRef_similar (sRef s1, sRef s2)
-{
-  if (s1 == s2) return TRUE;
-  if (sRef_isInvalid (s1) || sRef_isInvalid (s2)) return FALSE;
-
-  if (sRef_isConj (s2)) 
-    {
-      return (sRef_similar (s1, sRef_getConjA (s2)) ||
-	      sRef_similar (s1, sRef_getConjB (s2)));
-    }
-
-  if (sRef_isDerived (s2))
-   {
-     return (sRef_includedBy (s1, s2->info->ref));
-   }
-
-  switch (s1->kind)
-    {
-    case SK_CVAR:
-      return ((s2->kind == SK_CVAR)
-	      && (cref_equal (s1->info->cvar, s2->info->cvar)));
-    case SK_PARAM:
-      return ((s2->kind == SK_PARAM)
-	      && (s1->info->paramno == s2->info->paramno));
-    case SK_ARRAYFETCH:
-      if (s2->kind == SK_ARRAYFETCH)
-	{
-	  if (sRef_similar (s1->info->arrayfetch->arr,
-			    s2->info->arrayfetch->arr))
-	    {
-	      if (s1->info->arrayfetch->indknown)
-		{
-		  if (s2->info->arrayfetch->indknown)
-		    {
-		      return (s1->info->arrayfetch->ind == s2->info->arrayfetch->ind);
-		    }
-		  else 
-		    {
-		      return TRUE;
-		    }
-		}
-	      else
-		{
-		  return TRUE;
-		}
-	    }
-	}
-      else 
-	{
-	  if (s2->kind == SK_PTR)
-	    {
-	      if (sRef_similar (s1->info->arrayfetch->arr,
-				s2->info->ref))
-		{
-		  return TRUE; 
-		}
-	    }
-	}
-
-      return FALSE;
-    case SK_FIELD:
-      return ((s2->kind == SK_FIELD
-	       && (sRef_similar (s1->info->field->rec,
-				 s2->info->field->rec)
-		   && cstring_equal (s1->info->field->field,
-				     s2->info->field->field))));
-    case SK_PTR:
-      if (s2->kind == SK_PTR)
-	{
-	  return sRef_similar (s1->info->ref, s2->info->ref);
-	}
-      else 
-	{
-	  if (s2->kind == SK_ARRAYFETCH)
-	    {
-	      if (sRef_similar (s2->info->arrayfetch->arr,
-				s1->info->ref))
-		{
-		  return TRUE; 
-		}
-	    }
-	}
-
-      return FALSE;
-    case SK_ADR:
-      return ((s2->kind == SK_ADR)
-	      && sRef_similar (s1->info->ref, s2->info->ref));
-    case SK_CONJ:
-      return ((sRef_similar (s1->info->conj->a, s2) ||
-	      (sRef_similar (s1->info->conj->b, s2))));
-    case SK_DERIVED:
-      return (sRef_includedBy (s2, s1->info->ref));
-    case SK_UNCONSTRAINED:
-      return (s2->kind == SK_UNCONSTRAINED
-	      && cstring_equal (s1->info->fname, s2->info->fname));
-    case SK_CONST:
-    case SK_TYPE:
-    case SK_NEW:
-    case SK_UNKNOWN:
-    case SK_OBJECT:
-    case SK_EXTERNAL:
-    case SK_RESULT:
-      return FALSE;
-    case SK_SPECIAL:
-      return (s2->kind == SK_SPECIAL 
-	      && (s1->info->spec == s2->info->spec));
-    }
-
-  /*@notreached@*/ DPRINTF (("Fell through for: %s / %s", sRef_unparse (s1), sRef_unparse (s2)));
-  BADEXIT;
-}
-
-/*
-** return TRUE iff small can be derived from big.
-**
-** (e.g. x, x.a is includedBy x;
-**       x.a is included By x.a;
-*/
-
-bool
-sRef_includedBy (sRef small, sRef big)
-{
-  if (small == big) return TRUE;
-  if (sRef_isInvalid (small) || sRef_isInvalid (big)) return FALSE;
-
-  if (sRef_isConj (big)) 
-    return (sRef_similar (small, sRef_getConjA (big)) ||
-	    sRef_similar (small, sRef_getConjB (big)));
-
-  switch (small->kind)
-    {
-    case SK_CVAR:
-    case SK_PARAM:
-      return (sRef_same (small, big));
-    case SK_ARRAYFETCH:
-      if (big->kind == SK_ARRAYFETCH)
-	{
-	  if (sRef_same (small->info->arrayfetch->arr, big->info->arrayfetch->arr))
-	    {
-	      if (small->info->arrayfetch->indknown)
-		{
-		  if (big->info->arrayfetch->indknown)
-		    {
-		      return (small->info->arrayfetch->ind == big->info->arrayfetch->ind);
-		    }
-		  else 
-		    {
-		      return TRUE;
-		    }
-		}
-	      else
-		{
-		  return TRUE;
-		}
-	    }
-	}
-      return (sRef_includedBy (small->info->arrayfetch->arr, big));
-    case SK_FIELD:
-      if (big->kind == SK_FIELD)
-	{
-	  return 
-	    (sRef_same (small->info->field->rec, big->info->field->rec) &&
-	     cstring_equal (small->info->field->field, big->info->field->field));
-	}
-      else
-	{
-	  return (sRef_includedBy (small->info->field->rec, big));
-	}
-
-    case SK_PTR:
-      if (big->kind == SK_PTR)
-	{
-	  return sRef_same (small->info->ref, big->info->ref);
-	}
-      else
-	{
-	  return (sRef_includedBy (small->info->ref, big));
-	}
-
-    case SK_ADR:
-      return ((big->kind == SK_ADR) && sRef_similar (small->info->ref, big->info->ref));
-    case SK_CONJ:
-      return ((sRef_includedBy (small->info->conj->a, big) ||
-	      (sRef_includedBy (small->info->conj->b, big))));
-    case SK_DERIVED:
-      return (sRef_includedBy (small->info->ref, big));
-    case SK_UNCONSTRAINED:
-    case SK_CONST:
-    case SK_TYPE:
-    case SK_NEW:
-    case SK_UNKNOWN:
-    case SK_OBJECT:
-    case SK_EXTERNAL:
-    case SK_RESULT:
-      return FALSE;
-    case SK_SPECIAL:
-      switch (small->info->spec)
-	{
-	case SR_NOTHING: return TRUE;
-	case SR_SPECSTATE:
-	case SR_INTERNAL: return (sRef_isSpecInternalState (big) ||
-				  sRef_isFileStatic (big));
-	case SR_SYSTEM: return (sRef_isSystemState (big));
-	}
-    }
-  BADEXIT;
-}
-
-/*
-** Same is similar to similar, but not quite the same. 
-** same and realSame aren't the same, but they are really similar.
-** similarly, same is the same as same. but realSame is
-** not really the same as same, or similar to similar.
-**
-** Similarly to similar, same checks if two sRefs are the same.
-** The similarities end, however, when same compares arrays
-** with unknown indexes.  Similar returns false; same returns true.
-**
-** Similarly to similar and same, realSame is the same as same,
-** except they do not behave the same when face with unknown
-** sRefs.  Same thinks they are not the same, but realSame thinks
-** the are.
-**
-*/
-
-bool
-sRef_realSame (sRef s1, sRef s2)
-{
-  if (s1 == s2) return TRUE;  
-  if (sRef_isInvalid (s1) || sRef_isInvalid (s2)) return FALSE;
-
-  switch (s1->kind)
-    {
-    case SK_CVAR:
-      return ((s2->kind == SK_CVAR) && (cref_equal (s1->info->cvar, s2->info->cvar)));
-    case SK_PARAM:
-      return ((s2->kind == SK_PARAM) && (s1->info->paramno == s2->info->paramno));
-    case SK_ARRAYFETCH:
-      if (s2->kind == SK_ARRAYFETCH)
-	{
-	  if (sRef_realSame (s1->info->arrayfetch->arr, s2->info->arrayfetch->arr))
-	    {
-	      if (s1->info->arrayfetch->indknown && s2->info->arrayfetch->indknown)
-		{
-		  return (s1->info->arrayfetch->ind == s2->info->arrayfetch->ind);
-		}
-	      if (!s1->info->arrayfetch->indknown && !s2->info->arrayfetch->indknown)
-		{
-		  return TRUE;
-		}
-	      return FALSE;
-	    }
-	}
-      return FALSE;
-    case SK_FIELD:
-      return ((s2->kind == SK_FIELD &&
-	       (sRef_realSame (s1->info->field->rec, s2->info->field->rec) &&
-		cstring_equal (s1->info->field->field, s2->info->field->field))));
-    case SK_PTR:
-      return ((s2->kind == SK_PTR) && sRef_realSame (s1->info->ref, s2->info->ref));
-    case SK_ADR:
-      return ((s2->kind == SK_ADR) && sRef_realSame (s1->info->ref, s2->info->ref));
-    case SK_CONJ:
-      return ((sRef_realSame (s1->info->conj->a, s2) ||
-	      (sRef_realSame (s1->info->conj->b, s2))));
-    case SK_OBJECT:
-      return ((s2->kind == SK_OBJECT) 
-	      && ctype_match (s1->info->object, s2->info->object));
-    case SK_EXTERNAL:
-      return ((s2->kind == SK_EXTERNAL) 
-	      && sRef_realSame (s1->info->ref, s2->info->ref));
-    case SK_SPECIAL:
-      return ((s2->kind == SK_SPECIAL) && s1->info->spec == s2->info->spec);
-    case SK_DERIVED:
-      return ((s2->kind == SK_DERIVED) && sRef_realSame (s1->info->ref, s2->info->ref));
-    case SK_UNCONSTRAINED:
-      return ((s2->kind == SK_UNCONSTRAINED) 
-	      && (cstring_equal (s1->info->fname, s2->info->fname)));
-    case SK_TYPE:
-    case SK_CONST:
-    case SK_NEW:
-    case SK_UNKNOWN:
-    case SK_RESULT:
-      return TRUE; /* changed this! was false */
-    }
-  BADEXIT;
-}
-
-/*
-** same is similar to similar, but not quite the same. 
-**
-** Similarly to similar, same checks is two sRefs are the same.
-** The similarities end, however, when same compares arrays
-** with unknown indexes.  Similar returns false; same returns true.
-*/
-
-bool
-sRef_same (sRef s1, sRef s2)
-{
-  if (s1 == s2) return TRUE;
-  if (sRef_isInvalid (s1) || sRef_isInvalid (s2)) return FALSE;
-
-  switch (s1->kind)
-    {
-    case SK_CVAR:
-      return ((s2->kind == SK_CVAR) && (cref_equal (s1->info->cvar, s2->info->cvar)));
-    case SK_PARAM:
-      return ((s2->kind == SK_PARAM) && (s1->info->paramno == s2->info->paramno));
-    case SK_ARRAYFETCH:
-      if (s2->kind == SK_ARRAYFETCH)
-	{
-	  llassert (s1->info->field->rec != s1);
-	  if (sRef_same (s1->info->arrayfetch->arr, s2->info->arrayfetch->arr))
-	    {
-	      if (s1->info->arrayfetch->indknown && s2->info->arrayfetch->indknown)
-		{
-		  return (s1->info->arrayfetch->ind == s2->info->arrayfetch->ind);
-		}
-	      return TRUE;
-	    }
-	}
-      return FALSE;
-    case SK_FIELD:
-      {
-	llassert (s1->info->field->rec != s1);
-	return ((s2->kind == SK_FIELD &&
-		 (sRef_same (s1->info->field->rec, s2->info->field->rec) &&
-		  cstring_equal (s1->info->field->field, s2->info->field->field))));
-      }
-    case SK_PTR:
-      {
-	llassert (s1->info->ref != s1);
-	return ((s2->kind == SK_PTR) && sRef_same (s1->info->ref, s2->info->ref));
-      }
-    case SK_ADR:
-      {
-	llassert (s1->info->ref != s1);
-	return ((s2->kind == SK_ADR) && sRef_same (s1->info->ref, s2->info->ref));
-      }
-    case SK_CONJ:
-      llassert (s1->info->conj->a != s1);
-      llassert (s1->info->conj->b != s1);
-      return ((sRef_same (s1->info->conj->a, s2)) && /* or or and? */
-	      (sRef_same (s1->info->conj->b, s2)));
-    case SK_SPECIAL:
-      return ((s2->kind == SK_SPECIAL) && s1->info->spec == s2->info->spec);
-    case SK_DERIVED:
-      llassert (s1->info->ref != s1);
-      return ((s2->kind == SK_DERIVED) && sRef_same (s1->info->ref, s2->info->ref));
-    case SK_CONST:
-    case SK_UNCONSTRAINED:
-    case SK_TYPE:
-    case SK_UNKNOWN:
-    case SK_NEW:
-    case SK_OBJECT:
-    case SK_EXTERNAL:
-    case SK_RESULT:
-      return FALSE; 
-    }
-  BADEXIT;
-}
-
-/*
-** sort of similar, for use in def/use
-*/
-
-static bool
-sRef_closeEnough (sRef s1, sRef s2)
-{
-  if (s1 == s2) return TRUE;
-  if (sRef_isInvalid (s1) || sRef_isInvalid (s2)) return FALSE;
-
-  switch (s1->kind)
-    {
-    case SK_CVAR:
-      return (((s2->kind == SK_CVAR) &&
-	       (cref_equal (s1->info->cvar, s2->info->cvar))) ||
-	      (s2->kind == SK_UNCONSTRAINED && s1->info->cvar->lexlevel == 0));
-    case SK_UNCONSTRAINED:
-      return (s2->kind == SK_UNCONSTRAINED
-	      || ((s2->kind == SK_CVAR) && (s2->info->cvar->lexlevel == 0)));
-    case SK_PARAM:
-      return ((s2->kind == SK_PARAM) 
-	      && (s1->info->paramno == s2->info->paramno));
-    case SK_ARRAYFETCH:
-      if (s2->kind == SK_ARRAYFETCH)
-	{
-	  if (sRef_closeEnough (s1->info->arrayfetch->arr, s2->info->arrayfetch->arr))
-	    {
-	      if (s1->info->arrayfetch->indknown && s2->info->arrayfetch->indknown)
-		{
-		  return (s1->info->arrayfetch->ind == s2->info->arrayfetch->ind);
-		}
-	      return TRUE;
-	    }
-	}
-      return FALSE;
-    case SK_FIELD:
-      return ((s2->kind == SK_FIELD &&
-	       (sRef_closeEnough (s1->info->field->rec, s2->info->field->rec) &&
-		cstring_equal (s1->info->field->field, s2->info->field->field))));
-    case SK_PTR:
-      return ((s2->kind == SK_PTR) && sRef_closeEnough (s1->info->ref, s2->info->ref));
-    case SK_ADR:
-      return ((s2->kind == SK_ADR) && sRef_closeEnough (s1->info->ref, s2->info->ref));
-    case SK_DERIVED:
-      return ((s2->kind == SK_DERIVED) && sRef_closeEnough (s1->info->ref, s2->info->ref));
-    case SK_CONJ:
-      return ((sRef_closeEnough (s1->info->conj->a, s2)) ||
-	      (sRef_closeEnough (s1->info->conj->b, s2)));
-    case SK_SPECIAL:
-      return ((s2->kind == SK_SPECIAL) && s1->info->spec == s2->info->spec);
-    case SK_TYPE:
-    case SK_CONST:
-    case SK_UNKNOWN:
-    case SK_NEW:
-    case SK_OBJECT:
-    case SK_EXTERNAL:
-    case SK_RESULT:
-
-      return FALSE;
-    }
-  BADEXIT;
-}
-
-/*
-  drl add 12/24/2000
-  s is an sRef of a formal paramenter in a function call constraint
-  we trys to return a constraint expression derived from the actual parementer of a function call.
-*/
-constraintExpr sRef_fixConstraintParam ( sRef s, exprNodeList args)
-{
-  constraintExpr ce;
-
-  if (sRef_isInvalid (s))
-    llfatalbug(("Invalid sRef"));
-
-  switch (s->kind)
-    {
-    case SK_RESULT:
-      {
-	ce = constraintExpr_makeTermsRef (s);
-	return ce;
-      }
-    case SK_FIELD:
-      {
-	sRef temp;
-	
-	temp = (sRef_makeField (sRef_fixBaseParam (s->info->field->rec, args),
-			      s->info->field->field));
-	ce = constraintExpr_makeTermsRef (temp);
-	return ce;
-    }
-    case SK_PTR:
-      {
-	sRef temp;
-	temp = (sRef_makePointer (sRef_fixBaseParam (s->info->ref, args)));
-	ce = constraintExpr_makeTermsRef (temp);
-	return ce;
-      }
-
-    case SK_ARRAYFETCH:
-       {
-	sRef temp;
-	temp = sRef_fixBaseParam (s, args);
-	ce = constraintExpr_makeTermsRef (temp);
-	return ce;
-      }
-    case SK_CVAR:
-       ce = constraintExpr_makeTermsRef (s);
-       return ce;
-    case SK_PARAM:
-      if (exprNodeList_size (args) > s->info->paramno)
-	{
-	  exprNode e = exprNodeList_nth (args, s->info->paramno);
-	  
-	  if (exprNode_isError (e))
-	    {
-	      llassert (FALSE);
-	    }
-	  
-	  ce = constraintExpr_makeExprNode (e);
-	}
-      else
-	{
-	  llassert(FALSE);
-	}
-      return ce;
-    default:
-      llcontbug ((message("Trying to do fixConstraintParam on nonparam, nonglobal: %s for function with arguments %s", sRef_unparse (s), exprNodeList_unparse(args) ) ));
-      ce = constraintExpr_makeTermsRef (s);
-      return ce;
-    }
-
-  
-
-}
-
-/*@exposed@*/ sRef
-sRef_fixBaseParam (/*@returned@*/ sRef s, exprNodeList args)
-{
-  if (sRef_isInvalid (s)) return (sRef_undefined);
-
-  switch (s->kind)
-    {
-    case SK_UNCONSTRAINED:
-    case SK_CVAR:
-      return s;
-    case SK_PARAM:
-      {
-	if (exprNodeList_size (args) > s->info->paramno)
-	  {
-	    exprNode e = exprNodeList_nth (args, s->info->paramno);
-
-	    if (exprNode_isError (e))
-	      {
-		return sRef_makeUnknown ();
-	      }
-	    
-	    return (exprNode_getSref (e));
-	  }
-	else
-	  {
-	    return sRef_makeUnknown ();
-	  }
-      }
-    case SK_ARRAYFETCH:
-
-      if (s->info->arrayfetch->indknown)
-	{
-	  return (sRef_makeArrayFetchKnown 
-		  (sRef_fixBaseParam (s->info->arrayfetch->arr, args),
-		   s->info->arrayfetch->ind));
-	}
-      else
-	{
-	  return (sRef_makeArrayFetch 
-		  (sRef_fixBaseParam (s->info->arrayfetch->arr, args)));
-	}
-    case SK_FIELD:
-      return (sRef_makeField (sRef_fixBaseParam (s->info->field->rec, args),
-			      s->info->field->field));
-
-    case SK_PTR:
-      return (sRef_makePointer (sRef_fixBaseParam (s->info->ref, args)));
-
-    case SK_ADR:
-      return (sRef_makeAddress (sRef_fixBaseParam (s->info->ref, args)));
-
-    case SK_CONJ:
-      return (sRef_makeConj (sRef_fixBaseParam (s->info->conj->a, args),
-			     sRef_fixBaseParam (s->info->conj->b, args)));
-    case SK_DERIVED:
-    case SK_SPECIAL:
-    case SK_TYPE:
-    case SK_CONST:
-    case SK_NEW:
-    case SK_UNKNOWN:
-    case SK_OBJECT:
-    case SK_EXTERNAL:
-    case SK_RESULT:
-      return s;
-    }
-  BADEXIT;
-}
-
-/*@exposed@*/ sRef
-sRef_undumpGlobal (char **c)
-{
-  char p = **c;
-
-  (*c)++;
-
-  switch (p)
-    {
-    case 'g':
-      {
-	usymId uid = usymId_fromInt (getInt (c));
-	sstate defstate;
-	nstate nullstate;
-	sRef ret;
-
-	checkChar (c, '@');
-	defstate = sstate_fromInt (getInt (c));
-
-	checkChar (c, '@');
-	nullstate = nstate_fromInt (getInt (c));
-
-	ret = sRef_makeGlobal (uid, ctype_unknown);
-	ret->nullstate = nullstate;
-	ret->defstate = defstate;
-	return ret;
-      }
-    case 's':
-      {
-	int i = getInt (c);
-	speckind sk = speckind_fromInt (i);
-
-	switch (sk)
-	  {
-	  case SR_NOTHING:   return (sRef_makeNothing ());
-	  case SR_INTERNAL:  return (sRef_makeInternalState ());
-	  case SR_SPECSTATE: return (sRef_makeSpecState ());
-	  case SR_SYSTEM:    return (sRef_makeSystemState ());
-	  }
-	BADEXIT;
-      }
-    case '-':
-      return sRef_undefined;
-    case 'u':
-      return sRef_makeUnknown ();
-    case 'x':
-      return sRef_makeUnknown ();
-    default:
-      llfatalerror (message ("sRef_undumpGlobal: bad line: %s",
-			     cstring_fromChars (*c)));
-    }
-  BADEXIT;
-}
-
-/*@exposed@*/ sRef
-sRef_undump (char **c)
-{
-  char p = **c;
-
-  (*c)++;
-
-  switch (p)
-    {
-    case 'g':
-      return (sRef_makeGlobal (usymId_fromInt (getInt (c)), ctype_unknown));
-    case 'p':
-      return (sRef_makeParam (getInt (c), ctype_unknown));
-    case 'r':
-      return (sRef_makeResultType (ctype_undump (c)));
-    case 'a':
-      {
-	if ((**c >= '0' && **c <= '9') || **c == '-')
-	  {
-	    int i = getInt (c);
-	    sRef arr = sRef_undump (c);
-	    sRef ret = sRef_buildArrayFetchKnown (arr, i);
-
-	    return ret;
-	  }
-	else
-	  {
-	    sRef arr = sRef_undump (c);
-	    sRef ret = sRef_buildArrayFetch (arr);
-
-	    return ret;
-	  }
-      }
-    case 'f':
-      {
-	cstring fname = cstring_undefined;
-	sRef ret;
-
-	while (**c != '.')
-	  {
-	    fname = cstring_appendChar (fname, **c);
-	    (*c)++;
-	  }
-	(*c)++;
-
-	ret = sRef_buildField (sRef_undump (c), fname);
-	cstring_markOwned (fname);
-	return (ret);
-      }
-    case 's':
-      {
-	int i = getInt (c);
-	speckind sk = speckind_fromInt (i);
-
-	switch (sk)
-	  {
-	  case SR_NOTHING:   return (sRef_makeNothing ());
-	  case SR_INTERNAL:  return (sRef_makeInternalState ());
-	  case SR_SPECSTATE: return (sRef_makeSpecState ());
-	  case SR_SYSTEM:    return (sRef_makeSystemState ());
-	  }
-	BADEXIT;
-      }
-    case 't':
-      {
-	sRef ptr = sRef_undump (c);
-	sRef ret = sRef_makePointer (ptr);
-
-	return (ret);
-      }
-    case 'd':
-      {
-	sRef adr = sRef_undump (c);
-	sRef ret = sRef_makeAddress (adr);
-
-	return (ret);
-      }
-    case 'o':
-      {
-	return (sRef_makeObject (ctype_undump (c)));
-      }
-    case 'c':
-      {
-	sRef s1 = sRef_undump (c);
-	sRef s2 = ((*c)++, sRef_undump (c));
-	sRef ret = sRef_makeConj (s1, s2);
-
-	return (ret);
-      }
-    case '-':
-      return sRef_undefined;
-    case 'u':
-      return sRef_makeUnknown ();
-    case 'x':
-      return sRef_makeUnknown ();
-    default:
-      llfatalerror (message ("sRef_undump: bad line: %s", cstring_fromChars (*c)));
-    }
-  BADEXIT;
-}
-
-/*@only@*/ cstring
-sRef_dump (sRef s)
-{
-  if (sRef_isInvalid (s))
-    {
-      return (cstring_makeLiteral ("-"));
-    }
-  else
-    {
-      switch (s->kind)
-	{
-	case SK_PARAM:
-	  return (message ("p%d", s->info->paramno));
-	case SK_ARRAYFETCH:
-	  if (s->info->arrayfetch->indknown)
-	    {
-	      return (message ("a%d%q", s->info->arrayfetch->ind,
-			       sRef_dump (s->info->arrayfetch->arr)));
-	    }
-	  else
-	    {
-	      return (message ("a%q", sRef_dump (s->info->arrayfetch->arr)));
-	    }
-	case SK_FIELD:
-	  return (message ("f%s.%q", s->info->field->field, 
-			   sRef_dump (s->info->field->rec)));
-	case SK_PTR:
-	  return (message ("t%q", sRef_dump (s->info->ref)));
-	case SK_ADR:
-	  return (message ("d%q", sRef_dump (s->info->ref)));
-	case SK_OBJECT:
-	  return (message ("o%q", ctype_dump (s->info->object)));
-	case SK_SPECIAL:
-	  return (message ("s%d", (int) s->info->spec));
-	case SK_CONJ:
-	  return (message ("c%q.%q",
-			   sRef_dump (s->info->conj->a),
-			   sRef_dump (s->info->conj->b)));
-	case SK_CVAR:
-	  if (sRef_isGlobal (s))
-	    {
-	      return (message ("g%d", 
-			       usymtab_convertId (s->info->cvar->index)));
-	    }
-	  else
-	    {
-	      llcontbug (message ("Dumping local variable: %q",
-				  sRef_unparseDebug (s)));
-	      return (cstring_makeLiteral ("u"));
-	    }
-	case SK_UNKNOWN:
-	  return (cstring_makeLiteral ("u"));
-	case SK_RESULT:
-	  return (message ("r%q", ctype_dump (s->type)));
-	case SK_TYPE:
-	case SK_CONST:
-	case SK_EXTERNAL:
-	case SK_DERIVED:
-	case SK_NEW:
-	case SK_UNCONSTRAINED:
-	  llcontbug (message ("sRef_dump: bad kind: %q",
-			      sRef_unparseFull (s)));
-	  return (cstring_makeLiteral ("x"));
-	}
-    }
-     
-  BADEXIT;
-}
-
-cstring sRef_dumpGlobal (sRef s)
-{
-  if (sRef_isInvalid (s))
-    {
-      return (cstring_makeLiteral ("-"));
-    }
-  else
-    {
-      switch (s->kind)
-	{
-	case SK_CVAR:
-	  if (sRef_isGlobal (s))
-	    {
-	      return (message ("g%d@%d@%d", 
-			       usymtab_convertId (s->info->cvar->index),
-			       (int) s->defstate,
-			       (int) s->nullstate));
-	    }
-	  else
-	    {
-	      llcontbug (message ("Dumping local variable: %q",
-				  sRef_unparseDebug (s)));
-	      return (cstring_makeLiteral ("u"));
-	    }
-	case SK_UNKNOWN:
-	  return (cstring_makeLiteral ("u"));
-	case SK_SPECIAL:
-	  return (message ("s%d", (int) s->info->spec));
-	default:
-	  llcontbug (message ("sRef_dumpGlobal: bad kind: %q",
-			      sRef_unparseFull (s)));
-	  return (cstring_makeLiteral ("x"));
-	}
-    }
-     
-  BADEXIT;
-}
-
-ctype
-sRef_deriveType (sRef s, uentryList cl)
-{
-  if (sRef_isInvalid (s)) return ctype_unknown;
-
-  switch (s->kind)
-    {
-    case SK_CVAR:
-      return (uentry_getType (usymtab_getRefQuiet (s->info->cvar->lexlevel, 
-					      s->info->cvar->index)));
-    case SK_UNCONSTRAINED:
-      return (ctype_unknown);
-    case SK_PARAM:
-      return uentry_getType (uentryList_getN (cl, s->info->paramno));
-    case SK_ARRAYFETCH:
-      {
-	ctype ca = sRef_deriveType (s->info->arrayfetch->arr, cl);
-	
-	if (ctype_isArray (ca))
-	  {
-	    return (ctype_baseArrayPtr (ca));
-	  }
-	else if (ctype_isUnknown (ca))
-	  {
-	    return (ca);
-	  }
-	else
-	  {
-	    llcontbuglit ("sRef_deriveType: inconsistent array type");
-	    return ca;
-	  }
-      }
-    case SK_FIELD:
-      {
-	ctype ct = sRef_deriveType (s->info->field->rec, cl);
-	
-	if (ctype_isStructorUnion (ct))
-	  {
-	    uentry ue = uentryList_lookupField (ctype_getFields (ct), 
-					       s->info->field->field);
-	    
-	    if (uentry_isValid (ue))
-	      {
-		return (uentry_getType (ue));
-	      }
-	    else
-	      {
-		llcontbuglit ("sRef_deriveType: bad field");
-		return ctype_unknown;
-	      }
-	  }
-	else if (ctype_isUnknown (ct))
-	  {
-	    return (ct);
-	  }
-	else
-	  {
-	    llcontbuglit ("sRef_deriveType: inconsistent field type");
-	    return (ct);
-	  }
-      }
-    case SK_PTR:
-      {
-	ctype ct = sRef_deriveType (s->info->ref, cl);
-	
-	if (ctype_isUnknown (ct)) return ct;
-	if (ctype_isPointer (ct)) return (ctype_baseArrayPtr (ct));
-	else
-	  {
-	    llcontbuglit ("sRef_deriveType: inconsistent pointer type");
-	    return (ct);
-	  }
-      }
-    case SK_ADR:
-      {
-	ctype ct = sRef_deriveType (s->info->ref, cl);
-	
-	if (ctype_isUnknown (ct)) return ct;
-	return ctype_makePointer (ct);
-      }
-    case SK_DERIVED:
-      {
-	return sRef_deriveType (s->info->ref, cl);
-      }
-    case SK_OBJECT:
-      {
-	return (s->info->object);
-      }
-    case SK_CONJ:
-      {
-	return (ctype_makeConj (sRef_deriveType (s->info->conj->a, cl),
-			       sRef_deriveType (s->info->conj->b, cl)));
-      }
-    case SK_RESULT:
-    case SK_CONST:
-    case SK_TYPE:
-      {
-	return (s->type);
-      }
-    case SK_SPECIAL:
-    case SK_UNKNOWN:
-    case SK_EXTERNAL:
-    case SK_NEW:
-      return ctype_unknown;
-    }
-  BADEXIT;
-}
-
-ctype
-sRef_getType (sRef s)
-{
-  if (sRef_isInvalid (s)) return ctype_unknown;
-  return s->type;
-}
-
-
-/*@only@*/ cstring
-sRef_unparseOpt (sRef s)
-{
-  sRef rb = sRef_getRootBase (s);
-
-  if (sRef_isMeaningful (rb) && !sRef_isConst (rb))
-    {
-      cstring ret = sRef_unparse (s);
-      
-      llassertprint (!cstring_equalLit (ret, "?"), ("print: %s", sRef_unparseDebug (s)));
-
-      if (!cstring_isEmpty (ret))
-	{
-	  return (cstring_appendChar (ret, ' '));
-	}
-      else
-	{
-	  return ret;
-	}
-    }
-
-  return cstring_undefined;
-}
-
-cstring
-sRef_unparsePreOpt (sRef s)
-{
-  sRef rb = sRef_getRootBase (s);
-
-  if (sRef_isMeaningful (rb) && !sRef_isConst (rb))
-    {
-      cstring ret = sRef_unparse (s);
-      
-      llassertprint (!cstring_equalLit (ret, "?"), ("print: %s", sRef_unparseDebug (s)));
-      return (cstring_prependCharO (' ', ret));
-    }
-
-  return cstring_undefined;
-}
-
-/*@only@*/ cstring
-sRef_unparse (sRef s)
-{
-  if (sRef_isInvalid (s)) return (cstring_makeLiteral ("?"));
-
-  if (context_inFunctionLike ())
-    {
-      return (sRef_unparseWithArgs (s, context_getParams ()));
-    }
-  else
-    {
-      return (sRef_unparseNoArgs (s));
-    }
-}
-
-static /*@only@*/ cstring
-sRef_unparseWithArgs (sRef s, uentryList args)
-{
-  if (sRef_isInvalid (s))
-    {
-      return (cstring_makeLiteral ("?"));
-    }
-
-  switch (s->kind)
-    {
-    case SK_CVAR:
-      return (uentry_getName (usymtab_getRefQuiet (s->info->cvar->lexlevel,
-						   s->info->cvar->index)));
-    case SK_UNCONSTRAINED:
-      return (cstring_copy (s->info->fname));
-    case SK_PARAM:
-      {
-	if (s->info->paramno < uentryList_size (args))
-	  {
-	    uentry ue = uentryList_getN (args, s->info->paramno);
-	    
-	    if (uentry_isValid (ue))
-	      return uentry_getName (ue);
-	  }
-
-	return (message ("info->arrayfetch->indknown)
-	{
-	  return (message ("%q[%d]", sRef_unparseWithArgs (s->info->arrayfetch->arr, args),
-				s->info->arrayfetch->ind));
-	}
-      else
-	{
-	  return (message ("%q[]", sRef_unparseWithArgs (s->info->arrayfetch->arr, args)));
-	}
-    case SK_FIELD:
-      if (s->info->field->rec->kind == SK_PTR)
-	{
-	  sRef ptr = s->info->field->rec;
-
-	  return (message ("%q->%s", sRef_unparseWithArgs (ptr->info->ref, args),
-			   s->info->field->field));	  
-	}
-      return (message ("%q.%s", sRef_unparseWithArgs (s->info->field->rec, args),
-		       s->info->field->field));
-
-    case SK_PTR:
-      {
-	sRef ref = sRef_fixConj (s->info->ref);
-	skind sk = ref->kind;
-	cstring ret;
-
-	if (sk == SK_NEW)
-	  {
-	    ret = message ("storage pointed to by %q",
-			   sRef_unparseWithArgs (ref, args));
-	  }
-	else if (skind_isSimple (sk) || sk == SK_PTR)
-	  {
-	    ret = message ("*%q", sRef_unparseWithArgs (ref, args));
-	  }
-	else
-	  {
-	    ret = message ("*(%q)", sRef_unparseWithArgs (ref, args));
-	  }
-
-	return ret;
-      }
-    case SK_ADR:
-      return (message ("&%q", sRef_unparseWithArgs (s->info->ref, args)));
-    case SK_OBJECT:
-      return (cstring_copy (ctype_unparse (s->info->object)));
-    case SK_CONJ:
-      return (sRef_unparseWithArgs (sRef_getConjA (s), args));
-    case SK_NEW:
-      if (cstring_isDefined (s->info->fname))
-	{
-	  return (message ("[result of %s]", s->info->fname));
-	}
-      else
-	{
-	  return (cstring_makeLiteral (""));
-	}
-    case SK_UNKNOWN:
-      return (cstring_makeLiteral ("?"));
-    case SK_DERIVED:
-      return (message ("", sRef_unparse (s->info->ref)));
-    case SK_EXTERNAL:
-      return (message ("", sRef_unparse (s->info->ref)));
-    case SK_TYPE:
-      return (message ("", ctype_unparse (s->type)));
-    case SK_CONST:
-      return (message ("", ctype_unparse (s->type)));
-    case SK_SPECIAL:
-      return (cstring_makeLiteral
-	      (s->info->spec == SR_NOTHING ? "nothing"
-	       : s->info->spec == SR_INTERNAL ? "internal state"
-	       : s->info->spec == SR_SPECSTATE ? "spec state"
-	       : s->info->spec == SR_SYSTEM ? "file system state"
-	       : ""));
-    case SK_RESULT:
-      return cstring_makeLiteral ("result");
-    default:
-      {
-	llbug (message ("Bad sref, kind = %d", (int) s->kind));
-      }
-    }
-
-  BADEXIT;
-}
-
-/*@only@*/ cstring
-sRef_unparseDebug (sRef s)
-{
-  if (sRef_isInvalid (s)) return (cstring_makeLiteral (""));
-
-  switch (s->kind)
-    {
-    case SK_UNCONSTRAINED:
-      return (message ("", s->info->fname));
-    case SK_CVAR:
-      {
-	uentry ce;
-
-	ce = usymtab_getRefQuiet (s->info->cvar->lexlevel, s->info->cvar->index);
-
-	if (uentry_isInvalid (ce))
-	  {
-	    return (message ("", 
-			     s->info->cvar->lexlevel,
-			     s->info->cvar->index));
-	  }
-	else
-	  {
-	    return (message ("", 
-			     s->info->cvar->lexlevel,
-			     s->info->cvar->index,
-			     uentry_getName (ce)));
-	  }
-
-      }
-    case SK_PARAM:
-      {
-	return (message ("", s->info->paramno + 1));
-      }
-    case SK_ARRAYFETCH:
-      if (s->info->arrayfetch->indknown)
-	{
-	  return (message ("%q[%d]", sRef_unparseDebug (s->info->arrayfetch->arr),
-			   s->info->arrayfetch->ind));
-	}
-      else
-	{
-	  return (message ("%q[]", sRef_unparseDebug (s->info->arrayfetch->arr)));
-	}
-    case SK_FIELD:
-      return (message ("%q.%s", sRef_unparseDebug (s->info->field->rec),
-		       s->info->field->field));
-    case SK_PTR:
-      return (message ("*(%q)", sRef_unparseDebug (s->info->ref)));
-    case SK_ADR:
-      return (message ("&%q", sRef_unparseDebug (s->info->ref)));
-    case SK_OBJECT:
-      return (message ("", ctype_unparse (s->info->object)));
-    case SK_CONJ:
-      return (message ("%q | %q", sRef_unparseDebug (s->info->conj->a),
-		       sRef_unparseDebug (s->info->conj->b)));
-    case SK_NEW:
-      return message ("", s->info->fname);
-    case SK_DERIVED:
-      return (message ("", sRef_unparseDebug (s->info->ref)));
-    case SK_EXTERNAL:
-      return (message ("", sRef_unparseDebug (s->info->ref)));
-    case SK_TYPE:
-      return (message ("", ctype_unparse (s->type)));
-    case SK_CONST:
-      return (message ("", ctype_unparse (s->type)));
-    case SK_RESULT:
-      return (message ("", ctype_unparse (s->type)));
-    case SK_SPECIAL:
-      return (message ("",
-		       cstring_makeLiteralTemp
-		       (s->info->spec == SR_NOTHING ? "nothing"
-			: s->info->spec == SR_INTERNAL ? "internalState"
-			: s->info->spec == SR_SPECSTATE ? "spec state"
-			: s->info->spec == SR_SYSTEM ? "fileSystem"
-			: "error")));
-    case SK_UNKNOWN:
-      return cstring_makeLiteral ("");
-    }
-
-  BADEXIT;
-}
-
-static /*@only@*/ cstring
-sRef_unparseNoArgs (sRef s)
-{
-  if (sRef_isInvalid (s)) return (cstring_makeLiteral ("?"));
-
-  switch (s->kind)
-    {
-    case SK_UNCONSTRAINED:
-      return (cstring_copy (s->info->fname));
-    case SK_CVAR:
-      {
-	uentry ce = usymtab_getRefQuiet (s->info->cvar->lexlevel, 
-					 s->info->cvar->index);
-
-	if (uentry_isInvalid (ce))
-	  {
-	    llcontbug (message ("sRef_unparseNoArgs: bad cvar: %q", sRef_unparseDebug (s)));
-	    return (sRef_unparseDebug (s)); 
-	  }
-	else
-	  {
-	    return (uentry_getName (ce));
-	  }
-      }
-    case SK_ARRAYFETCH:
-      if (s->info->arrayfetch->indknown)
-	{
-	  return (message ("%q[%d]", sRef_unparseNoArgs (s->info->arrayfetch->arr),
-			   s->info->arrayfetch->ind));
-	}
-      else
-	{
-	  return (message ("%q[]", sRef_unparseNoArgs (s->info->arrayfetch->arr)));
-	}
-    case SK_FIELD:
-      return (message ("%q.%s", sRef_unparseNoArgs (s->info->field->rec),
-		       s->info->field->field));
-    case SK_PTR:
-      {
-	sRef ref = sRef_fixConj (s->info->ref);
-	skind sk = ref->kind;
-	cstring ret;
-
-	if (skind_isSimple (sk) || sk == SK_PTR)
-	  {
-	    ret = message ("*%q", sRef_unparseNoArgs (ref));
-	  }
-	else
-	  {
-	    ret = message ("*(%q)", sRef_unparseNoArgs (ref));
-	  }
-
-	return (ret);
-      }
-    case SK_ADR:
-      return (message ("&%q", sRef_unparseNoArgs (s->info->ref)));
-    case SK_OBJECT:
-      return (cstring_copy (ctype_unparse (s->info->object)));
-    case SK_CONJ:
-      return (sRef_unparseNoArgs (s->info->conj->a));
-    case SK_NEW:
-      return (message ("result of %s", s->info->fname));
-    case SK_DERIVED:
-      return (message ("", sRef_unparseNoArgs (s->info->ref)));
-    case SK_EXTERNAL:
-      return message ("", sRef_unparseNoArgs (s->info->ref));
-    case SK_SPECIAL:
-      return (cstring_makeLiteral
-	      (s->info->spec == SR_NOTHING ? "nothing"
-	       : s->info->spec == SR_INTERNAL ? "internal state"
-	       : s->info->spec == SR_SPECSTATE ? "spec state"
-	       : s->info->spec == SR_SYSTEM ? "file system state"
-	       : ""));
-    case SK_RESULT:
-      return cstring_makeLiteral ("result");
-    case SK_CONST:
-    case SK_TYPE:
-    case SK_UNKNOWN:
-      return cstring_makeLiteral ("?");
-    case SK_PARAM:
-      /* llcontbug (message ("sRef_unparseNoArgs: bad case: %q", sRef_unparseDebug (s))); */
-      return (sRef_unparseDebug (s));
-    }
-  BADEXIT;
-}
-
-/*@dependent@*/ sRef sRef_makeUnconstrained (cstring fname)
-{
-  sRef s = sRef_new ();
-
-  s->kind = SK_UNCONSTRAINED;
-  s->info = (sinfo) dmalloc (sizeof (*s->info));
-  s->info->fname = fname;
-
-  return (s);
-}
-
-cstring sRef_unconstrainedName (sRef s)
-{
-  llassert (sRef_isUnconstrained (s));
-
-  return s->info->fname;
-}
-
-bool sRef_isUnconstrained (sRef s) 
-{
-  return (sRef_isValid(s) && s->kind == SK_UNCONSTRAINED);
-}
-
-static /*@dependent@*/ /*@notnull@*/ sRef 
-  sRef_makeCvarAux (int level, usymId index, ctype ct)
-{
-  sRef s = sRef_new ();
-
-    s->kind = SK_CVAR;
-  s->info = (sinfo) dmalloc (sizeof (*s->info));
-
-  s->info->cvar = (cref) dmalloc (sizeof (*s->info->cvar));
-  s->info->cvar->lexlevel = level;
-  s->info->cvar->index = index;
-
-  /* for now, all globals are defined; all locals, aren't */
-
-  if (level <= fileScope)
-    {
-      s->defstate = SS_UNKNOWN;
-    }
-  else 
-    {
-      ctype rct = ctype_realType (ct);
-
-      if (level != paramsScope
-	  && (ctype_isStructorUnion (rct) || ctype_isRealArray (rct)))
-	{
-	  s->defstate = SS_ALLOCATED; 
-	  s->oaliaskind = s->aliaskind = AK_STACK;
-	}
-      else
-	{
-	  s->defstate = SS_UNDEFINED;
-	  s->oaliaskind = s->aliaskind = AK_LOCAL;
-	}
-    }
-
-  s->type = ct;
-
-  llassert (level >= globScope);
-  llassert (usymId_isValid (index));
-
-  return s;
-}
-
-/*@dependent@*/ sRef sRef_makeCvar (int level, usymId index, ctype ct)
-{
-  return (sRef_makeCvarAux (level, index, ct));
-}
-
-int sRef_lexLevel (sRef s)
-{
-  if (sRef_isValid (s))
-    {
-      sRef conj;
-
-      conj = sRef_fixConj (s);
-      s = sRef_getRootBase (conj);
-      
-      if (sRef_isValid (s) && s->kind == SK_CVAR)
-	{
-	  return (s->info->cvar->lexlevel);
-	}
-    }
-
-  return globScope;
-}
-
-sRef
-sRef_makeGlobal (usymId l, ctype ct)
-{
-  return (sRef_makeCvar (globScope, l, ct));
-}
-
-void
-sRef_setParamNo (sRef s, int l)
-{
-  llassert (sRef_isValid (s) && s->kind == SK_PARAM);
-  s->info->paramno = l;
-}
-
-/*@dependent@*/ sRef
-sRef_makeParam (int l, ctype ct)
-{
-  sRef s = sRef_new ();
-
-  s->kind = SK_PARAM;
-  s->type = ct;
-
-  s->info = (sinfo) dmalloc (sizeof (*s->info));
-  s->info->paramno = l; 
-  s->defstate = SS_UNKNOWN; /* (probably defined, unless its an out parameter) */
-
-  return s;
-}
-
-bool
-sRef_isIndexKnown (sRef arr)
-{
-  bool res;
-
-  llassert (sRef_isValid (arr));
-  arr = sRef_fixConj (arr);
-  
-  llassert (arr->kind == SK_ARRAYFETCH);  
-  res = arr->info->arrayfetch->indknown;
-  return (res);
-}
-
-int
-sRef_getIndex (sRef arr)
-{
-  int result;
-
-  llassert (sRef_isValid (arr));
-  arr = sRef_fixConj (arr);
-
-  llassert (arr->kind == SK_ARRAYFETCH);  
-
-  if (!arr->info->arrayfetch->indknown)
-    {
-      llcontbug (message ("sRef_getIndex: unknown: %q", sRef_unparse (arr)));
-      result = 0; 
-    }
-  else
-    {
-      result = arr->info->arrayfetch->ind;
-    }
-
-  return result;
-}
-
-static bool sRef_isZerothArrayFetch (/*@notnull@*/ sRef s)
-{
-  return (s->kind == SK_ARRAYFETCH
-	  && s->info->arrayfetch->indknown
-	  && (s->info->arrayfetch->ind == 0));
-}
-
-/*@exposed@*/ sRef sRef_makeAddress (/*@exposed@*/ sRef t)
-{
-  
-  if (sRef_isInvalid (t)) return sRef_undefined;
-
-  if (sRef_isPointer (t))
-    {
-      return (t->info->ref);
-    }
-  else if (sRef_isZerothArrayFetch (t))
-    {
-      return (t->info->arrayfetch->arr);
-    }
-  else
-    {
-      sRef s = sRef_new ();
-      
-      s->kind = SK_ADR;
-      s->type = ctype_makePointer (t->type);
-      s->info = (sinfo) dmalloc (sizeof (*s->info));
-      s->info->ref = t;
-      
-      if (t->defstate == SS_UNDEFINED) 
-	/* no! it is allocated even still: && !ctype_isPointer (t->type)) */
-	{
-	  s->defstate = SS_ALLOCATED;
-	}
-      else
-	{
-	  s->defstate = t->defstate;
-	}
-
-      if (t->aliaskind == AK_LOCAL)
-	{
-	  if (sRef_isLocalVar (t))
-	    {
-	      s->aliaskind = AK_STACK;
-	    }
-	}
-
-      return s;
-    }
-}
-
-cstring sRef_getField (sRef s)
-{
-  cstring res;
-
-  llassert (sRef_isValid (s));
-  s = sRef_fixConj (s);
-
-  llassertprint (sRef_isValid (s) && (s->kind == SK_FIELD),
-		 ("s = %s", sRef_unparseDebug (s)));
-
-  res = s->info->field->field;
-  return (res);
-}
-
-sRef sRef_getBase (sRef s)
-{
-  sRef res;
-
-  if (sRef_isInvalid (s)) return (sRef_undefined);
-
-  s = sRef_fixConj (s);
-
-  switch (s->kind)
-    {
-    case SK_ADR:
-    case SK_PTR:
-    case SK_DERIVED:
-    case SK_EXTERNAL:
-      res = s->info->ref;
-      break;
-    case SK_FIELD:
-      res = s->info->field->rec;
-      break;
-
-    case SK_ARRAYFETCH:
-      res = s->info->arrayfetch->arr;
-      break;
-
-    default:
-      res = sRef_undefined; /* shouldn't need it */
-    }
-
-  return (res);
-}
-
-/*
-** same as getBase, except returns invalid
-** (and doesn't use adr's)                   
-*/
-
-sRef
-sRef_getBaseSafe (sRef s)
-{
-  sRef res;
-
-  if (sRef_isInvalid (s)) { return sRef_undefined; }
-
-  s = sRef_fixConj (s);
-
-  switch (s->kind)
-    {
-    case SK_PTR:
-            res = s->info->ref; 
-      break;
-    case SK_FIELD:
-            res = s->info->field->rec; break;
-    case SK_ARRAYFETCH:
-            res = s->info->arrayfetch->arr; 
-      break;
-    default:
-      res = sRef_undefined; break;
-    }
-
-  return res;
-}
-
-/*@constant int MAXBASEDEPTH;@*/
-# define MAXBASEDEPTH 25
-
-static /*@exposed@*/ sRef 
-sRef_getRootBaseAux (sRef s, int depth)
-{
-  if (sRef_isInvalid (s)) return sRef_undefined;
-
-  if (depth > MAXBASEDEPTH)
-    {
-      llgenmsg (message 
-		("Warning: reference base limit exceeded for %q. "
-		 "This either means there is a variable with at least "
-		 "%d indirections from this reference, or "
-		 "there is a bug in LCLint.",
-		 sRef_unparse (s),
-		 MAXBASEDEPTH),
-		g_currentloc);
-
-      return sRef_undefined;
-    }
-
-  switch (s->kind)
-    {
-    case SK_ADR:
-    case SK_PTR:
-      return (sRef_getRootBaseAux (s->info->ref, depth + 1));
-    case SK_FIELD:
-      return (sRef_getRootBaseAux (s->info->field->rec, depth + 1));
-    case SK_ARRAYFETCH:
-      return (sRef_getRootBaseAux (s->info->arrayfetch->arr, depth + 1));
-    case SK_CONJ:
-      return (sRef_getRootBaseAux (sRef_fixConj (s), depth + 1));
-    default:
-      return s;
-    }
-}
-
-sRef sRef_getRootBase (sRef s)
-{
-  return (sRef_getRootBaseAux (s, 0));
-}
-
-static bool sRef_isDeep (sRef s)
-{
-  if (sRef_isInvalid (s)) return FALSE;
-  
-  switch (s->kind)
-    {
-    case SK_ADR:
-    case SK_PTR:
-    case SK_FIELD:
-    case SK_ARRAYFETCH:
-      return TRUE;
-    case SK_CONJ:
-      return (sRef_isDeep (sRef_fixConj (s)));
-    default:
-      return FALSE;
-    }
-}
-
-static int sRef_depth (sRef s)
-{
-  if (sRef_isInvalid (s)) return 0;
-  
-  switch (s->kind)
-    {
-    case SK_ADR:
-    case SK_PTR:
-    case SK_DERIVED:
-    case SK_EXTERNAL:
-      return 1 + sRef_depth (s->info->ref);
-    case SK_FIELD:
-      return 1 + sRef_depth (s->info->field->rec);
-    case SK_ARRAYFETCH:
-      return 1 + sRef_depth (s->info->arrayfetch->arr);
-    case SK_CONJ:
-      return (sRef_depth (sRef_fixConj (s)));
-    default:
-      return 1;
-    }
-}
-
-sRef
-sRef_makeObject (ctype o)
-{
-  sRef s = sRef_new ();
-
-  s->kind = SK_OBJECT;
-  s->info = (sinfo) dmalloc (sizeof (*s->info));
-  s->info->object = o;
-  return s;
-}
-
-sRef sRef_makeExternal (/*@exposed@*/ sRef t)
-{
-  sRef s = sRef_new ();
-
-  llassert (sRef_isValid (t));
-
-  s->kind = SK_EXTERNAL;
-  s->info = (sinfo) dmalloc (sizeof (*s->info));
-  s->type = t->type;
-  s->info->ref = t;
-  return s;
-}
-
-sRef sRef_makeDerived (/*@exposed@*/ sRef t)
-{
-  if (sRef_isValid (t))
-    {
-      sRef s = sRef_new ();
-      
-      s->kind = SK_DERIVED;
-      s->info = (sinfo) dmalloc (sizeof (*s->info));
-      s->info->ref = t;
-      
-      s->type = t->type;
-      return s;
-    }
-  else
-    {
-      return sRef_undefined;
-    }
-}
-
-/*
-** definitely NOT symmetric:
-**
-**   res fills in unknown state information from other
-*/
-
-void
-sRef_mergeStateQuiet (sRef res, sRef other)
-{
-  llassert (sRef_isValid (res));
-  llassert (sRef_isValid (other));
-
-  res->modified = res->modified || other->modified;
-  res->safe = res->safe && other->safe;
-
-  if (res->defstate == SS_UNKNOWN) 
-    {
-      res->defstate = other->defstate;
-      res->definfo = alinfo_update (res->definfo, other->definfo);
-    }
-
-  if (res->aliaskind == AK_UNKNOWN || 
-      (res->aliaskind == AK_LOCAL && alkind_isKnown (other->aliaskind)))
-    {
-      res->aliaskind = other->aliaskind;
-      res->oaliaskind = other->oaliaskind;
-      res->aliasinfo = alinfo_update (res->aliasinfo, other->aliasinfo);
-    }
-
-  if (res->expkind == XO_UNKNOWN)
-    {
-      res->expkind = other->expkind;
-      res->oexpkind = other->oexpkind;
-      res->expinfo = alinfo_update (res->expinfo, other->expinfo);
-    }
-  
-  /* out takes precedence over implicitly defined */
-  if (res->defstate == SS_DEFINED && other->defstate != SS_UNKNOWN) 
-    {
-      res->defstate = other->defstate;
-      res->definfo = alinfo_update (res->definfo, other->definfo);
-    }
-
-  if (other->nullstate == NS_ERROR || res->nullstate == NS_ERROR) 
-    {
-      res->nullstate = NS_ERROR;
-    }
-  else
-    {
-      if (other->nullstate != NS_UNKNOWN 
-	  && (res->nullstate == NS_UNKNOWN || res->nullstate == NS_NOTNULL 
-	      || res->nullstate == NS_MNOTNULL))
-	{
-	  res->nullstate = other->nullstate;
-	  res->nullinfo = alinfo_update (res->nullinfo, other->nullinfo);
-	}
-    }
-}
-
-/*
-** definitely NOT symmetric:
-**
-**   res fills in known state information from other
-*/
-
-void
-sRef_mergeStateQuietReverse (sRef res, sRef other)
-{
-  bool changed = FALSE;
-
-  llassert (sRef_isValid (res));
-  llassert (sRef_isValid (other));
-
-  if (res->kind != other->kind)
-    {
-      changed = TRUE;
-
-      sinfo_free (res);
-
-      res->kind = other->kind;
-      res->type = other->type;
-      res->info = sinfo_fullCopy (other);
-    }
-  else
-    {
-      if (!ctype_equal (res->type, other->type))
-	{
-	  changed = TRUE;
-	  res->type = other->type;
-	}
-      
-      sinfo_update (res, other);
-    }
-
-  res->modified = res->modified || other->modified;
-  res->safe = res->safe && other->safe;
-
-  if (res->aliaskind != other->aliaskind
-      && (res->aliaskind == AK_UNKNOWN
-	  || ((res->aliaskind == AK_LOCAL 
-	       || (res->aliaskind == AK_REFCOUNTED
-		   && other->aliaskind != AK_LOCAL))
-	      && other->aliaskind != AK_UNKNOWN)))
-    {
-      changed = TRUE;
-      res->aliaskind = other->aliaskind;
-      res->oaliaskind = other->oaliaskind;
-      res->aliasinfo = alinfo_update (res->aliasinfo, other->aliasinfo);
-          }
-
-  if (other->expkind != XO_UNKNOWN && other->expkind != res->expkind)
-    {
-      changed = TRUE;
-      res->expkind = other->expkind;
-      res->expinfo = alinfo_update (res->expinfo, other->expinfo);
-    }
-
-  if (other->oexpkind != XO_UNKNOWN)
-    {
-      res->oexpkind = other->oexpkind;
-    }
-
-  /* out takes precedence over implicitly defined */
-
-  if (res->defstate != other->defstate)
-    {
-      if (other->defstate != SS_UNKNOWN)
-	{
-	  res->defstate = other->defstate;
-	}
-    }
-
-  if (other->nullstate == NS_ERROR || res->nullstate == NS_ERROR)
-    {
-      if (res->nullstate != NS_ERROR)
-	{
-	  res->nullstate = NS_ERROR;
-	  changed = TRUE;
-	}
-    }
-  else
-    {
-      if (other->nullstate != NS_UNKNOWN && other->nullstate != res->nullstate)
-	{
-	  changed = TRUE;
-	  res->nullstate = other->nullstate;
-	  res->nullinfo = alinfo_update (res->nullinfo, other->nullinfo);
-	}
-    }
-
-  if (changed)
-    {
-      sRef_clearDerived (res); 
-    }
-}
-
-void 
-sRef_mergeState (sRef res, sRef other, clause cl, fileloc loc)
-{
-  if (sRef_isValid (res) && sRef_isValid (other))
-    {
-      sRef_mergeStateAux (res, other, cl, FALSE, loc, TRUE);
-    }
-  else
-    {
-      if (sRef_isInvalid (res))
-	{
-	  llbug (message ("sRef_mergeState: invalid res sRef: %q", 
-			  sRef_unparseDebug (other)));
-	}
-      else 
-	{
-	  llbug (message ("sRef_mergeState: invalid other sRef: %q", 
-			  sRef_unparseDebug (res)));
-	}
-    }
-}
-
-void 
-sRef_mergeOptState (sRef res, sRef other, clause cl, fileloc loc)
-{
-  if (sRef_isValid (res) && sRef_isValid (other))
-    {
-      sRef_mergeStateAux (res, other, cl, TRUE, loc, TRUE);
-    }
-  else
-    {
-      if (sRef_isInvalid (res))
-	{
-	  llbug (message ("sRef_mergeOptState: invalid res sRef: %q", 
-			  sRef_unparseDebug (other)));
-	}
-      else 
-	{
-	  llbug (message ("sRef_mergeOptState: invalid other sRef: %q", 
-			  sRef_unparseDebug (res)));
-	}
-    }
-}
-
-static void
-sRef_mergeStateAux (/*@notnull@*/ sRef res, /*@notnull@*/ sRef other, 
-		    clause cl, bool opt, fileloc loc,
-		    bool doDerivs)
-   /*@modifies res@*/ 
-{
-  llassertfatal (sRef_isValid (res));
-  llassertfatal (sRef_isValid (other));
-  
-  res->modified = res->modified || other->modified;
-
-  if (res->kind == other->kind 
-      || (other->kind == SK_UNKNOWN || res->kind == SK_UNKNOWN))
-    {
-      sstate odef = other->defstate;
-      sstate rdef = res->defstate;
-      nstate onull = other->nullstate;
-      
-      /*
-      ** yucky stuff to handle 
-      **
-      **   if (s) free (s);
-      */
-
-      if (other->defstate == SS_DEAD 
-	  && ((sRef_isOnly (res) && sRef_definitelyNull (res))
-	      || (res->defstate == SS_UNDEFINED
-		  || res->defstate == SS_UNUSEABLE)))
-	{
-	  if (res->defstate == SS_UNDEFINED
-	      || res->defstate == SS_UNUSEABLE)
-	    {
-	      res->defstate = SS_UNUSEABLE;
-	    }
-	  else
-	    {
-	      res->defstate = SS_DEAD;
-	    }
-
-	  res->definfo = alinfo_update (res->definfo, other->definfo);
-	  sRef_clearDerived (other);
-	  sRef_clearDerived (res);
-	}
-      else if (res->defstate == SS_DEAD 
-	       && ((sRef_isOnly (other) && sRef_definitelyNull (other))
-		   || (other->defstate == SS_UNDEFINED
-		       || other->defstate == SS_UNUSEABLE)))
-	{
-	  if (other->defstate == SS_UNDEFINED
-	      || other->defstate == SS_UNUSEABLE)
-	    {
-	      res->defstate = SS_UNUSEABLE;
-	    }
-	  else
-	    {
-	      res->defstate = SS_DEAD;
-	    }
-	  
-	  sRef_clearDerived (other);
-	  sRef_clearDerived (res);
-	}
-      else if (res->defstate == SS_DEFINED 
-	       && (other->defstate == SS_ALLOCATED 
-		   && sRef_definitelyNull (other)))
-	{
-	  other->defstate = SS_DEFINED; /* definitely null! */
-	}
-      else if (other->defstate == SS_DEFINED
-	       && (res->defstate == SS_ALLOCATED && sRef_definitelyNull (res)))
-	{
-	  res->defstate = SS_DEFINED;
-	  res->definfo = alinfo_update (res->definfo, other->definfo);
-	}
-      else
-	{
-	  ; /* okay */
-	}
-
-      if (res->defstate == SS_DEAD && other->defstate == SS_DEAD)
-	{
-	  sRef_clearDerived (other);
-	  sRef_clearDerived (res);
-	}
-
-      /*
-      ** only & dead isn't really an only!
-      */
-
-      if (alkind_isOnly (other->aliaskind) && other->defstate == SS_DEAD)
-	{
-	  other->aliaskind = AK_UNKNOWN;
-	}
-
-      if (alkind_isOnly (res->aliaskind) && res->defstate == SS_DEAD)
-	{
-	  res->aliaskind = AK_UNKNOWN;
-	}
-
-      /*
-      ** Dead and dependent -> dead
-      */
-      
-      if (alkind_isDependent (other->aliaskind) && res->defstate == SS_DEAD)
-	{
-	  other->aliaskind = AK_UNKNOWN;
-	  other->defstate = SS_DEAD;
-	  sRef_clearDerived (res);
-	  sRef_clearDerived (other);
-	  	}
-
-      if (alkind_isDependent (res->aliaskind) && other->defstate == SS_DEAD)
-	{
-	  res->aliaskind = AK_UNKNOWN;
-	  res->defstate = SS_DEAD;
-	  sRef_clearDerived (res);
-	  sRef_clearDerived (other);
-	}
-
-      /*
-      ** must do alias combine first, since it depends on 
-      ** original values of state and null.
-      */
-
-      sRef_combineAliasKinds (res, other, cl, loc);
-      sRef_combineDefState (res, other);
-      sRef_combineNullState (res, other);
-
-      if (rdef == SS_ALLOCATED || rdef == SS_SPECIAL)
-	{
-	  if (odef == SS_DEFINED)
-	    {
-	      if (onull == NS_DEFNULL || onull == NS_CONSTNULL)
-		{
-		  res->deriv = sRefSet_copy (res->deriv, other->deriv);
-		}
-
-	      	      	      ; 
-	    }
-	  else if (odef == SS_ALLOCATED
-		   || odef == SS_SPECIAL)
-	    {
-	      
-	      if (doDerivs)
-		{
-		  if (ctype_isUnion (ctype_realType (sRef_getType (res))))
-		    {
-		      res->deriv = sRef_mergeUnionDerivs (res->deriv, 
-							  other->deriv, 
-							  opt, cl, loc);
-		    }
-		  else
-		    {
-		      		      res->deriv = sRef_mergeDerivs (res->deriv, other->deriv, 
-						     opt, cl, loc);
-		    }
-		}
-	    }
-	  else
-	    {
-	      if (doDerivs)
-		{
-		  		  res->deriv = sRef_mergeDerivs (res->deriv, other->deriv, 
-						 opt, cl, loc);
-		}
-	      else
-		{
-		  		}
-	    }
-	}
-      else
-	{
-	  if (rdef == SS_PDEFINED
-	      || (rdef == SS_DEFINED && odef == SS_PDEFINED))
-	    {
-	      if (doDerivs)
-		{
-		  		  res->deriv = sRef_mergePdefinedDerivs (res->deriv, other->deriv, 
-							 opt, cl, loc);
-		}
-	    }
-	  else
-	    {
-	      if ((rdef == SS_DEFINED  || rdef == SS_UNKNOWN)
-		  && res->defstate == SS_ALLOCATED)
-		{
-		  		  res->deriv = sRefSet_copy (res->deriv, other->deriv);
-		}
-	      else
-		{
-		  if (doDerivs)
-		    {
-		      		      res->deriv = sRef_mergeDerivs (res->deriv, other->deriv, 
-						     opt, cl, loc);
-		    }
-		}
-	    }
-	}
-
-      
-      sRef_combineExKinds (res, other);
-    }
-  else
-    {
-      if (res->kind == SK_ARRAYFETCH && other->kind == SK_PTR)
-	{
-	  sRef nother = sRef_buildArrayFetchKnown (sRef_getBase (other), 0);
-
-	  sRef_copyState (nother, other);
-	  sRef_mergeStateAux (res, nother, cl, opt, loc, doDerivs);
-	}
-      else if (res->kind == SK_PTR && other->kind == SK_ARRAYFETCH)
-	{
-	  sRef nother = sRef_buildPointer (sRef_getBase (other));
-
-	  if (sRef_isValid (nother))
-	    {
-	      sRef_copyState (nother, other);
-	      sRef_mergeStateAux (res, nother, cl, opt, loc, doDerivs);
-	    }
-	}
-      else
-	{
-	  llcontbug (message ("merge conj: %q / %q", sRef_unparseFull (res), 
-			      sRef_unparseFull (other)));
-	  
-	}
-    }
-  
-  }
-
-static sRefSet
-sRef_mergeUnionDerivs (/*@only@*/ sRefSet res, 
-		       /*@exposed@*/ sRefSet other, bool opt,
-		       clause cl, fileloc loc)
-{
-  if (sRefSet_isEmpty (res))
-    {
-      return sRefSet_copy (res, other);
-    }
-  else
-    {
-      sRefSet_allElements (other, el)
-	{
-	  if (sRef_isValid (el))
-	    {
-	      sRef e2 = sRefSet_lookupMember (other, el);
-	      
-	      if (sRef_isValid (e2))
-		{
-		  sRef_mergeStateAux (el, e2, cl, opt, loc, FALSE);
-		}
-	      else
-		{
-		  res = sRefSet_insert (res, el);
-		}
-	    }
-	} end_sRefSet_allElements ;
-
-      return res;
-    }
-}
-
-static /*@only@*/ sRefSet
-sRef_mergeDerivs (/*@only@*/ sRefSet res, sRefSet other, 
-		  bool opt, clause cl, fileloc loc)
-{
-  sRefSet ret = sRefSet_new ();
-  
-    
-  sRefSet_allElements (res, el)
-    {
-      if (sRef_isValid (el))
-	{
-	  sRef e2 = sRefSet_lookupMember (other, el);
-
-	  if (sRef_isValid (e2))
-	    {
-	      if (el->defstate == SS_ALLOCATED &&
-		  e2->defstate == SS_PDEFINED)
-		{
-		  e2->defstate = SS_ALLOCATED;
-		}
-	      else if (e2->defstate == SS_ALLOCATED &&
-		       el->defstate == SS_PDEFINED)
-		{
-		  el->defstate = SS_ALLOCATED;
-		  sRef_clearDerived (el);
-		}
-	      else if ((el->defstate == SS_DEAD || sRef_isKept (el)) &&
-		       (e2->defstate == SS_DEFINED && !sRef_isKept (e2)))
-		{
-		  
-		  if (checkDeadState (el, TRUE, loc))
-		    {
-		      if (sRef_isThroughArrayFetch (el))
-			{
-			  sRef_maybeKill (el, loc);
-			  sRef_maybeKill (e2, loc);
-			}
-		    }
-		}
-	      else if ((e2->defstate == SS_DEAD || sRef_isKept (e2)) &&
-		       (el->defstate == SS_DEFINED && !sRef_isKept (el)))
-		{
-		  
-		  if (checkDeadState (e2, FALSE, loc))
-		    {
-		      if (sRef_isThroughArrayFetch (el))
-			{
-			  sRef_maybeKill (el, loc);
-			  sRef_maybeKill (e2, loc);
-			}
-		    }
-		}
-	      else if (el->defstate == SS_DEFINED &&
-		       e2->defstate == SS_PDEFINED)
-		{
-		  el->defstate = SS_PDEFINED;
-		}
-	      else if (e2->defstate == SS_DEFINED &&
-		       el->defstate == SS_PDEFINED)
-		{
-		  e2->defstate = SS_PDEFINED;
-		}
-	      else
-		{
-		  ; /* okay */
-		}
-
-	      if (ctype_isUnion (ctype_realType (sRef_getType (el))))
-		{
-		  el->deriv = sRef_mergeUnionDerivs (el->deriv, e2->deriv, 
-						     opt, cl, loc); 
-		}
-	      else
-		{
-		  el->deriv = sRef_mergeDerivs (el->deriv, e2->deriv, opt, cl, loc); 
-		}
-	      
-	      if (sRef_equivalent (el, e2))
-		{
-		  		  ret = sRefSet_insert (ret, el);
-		}
-	      else
-		{
-		  sRef sr = sRef_leastCommon (el, e2);
-
-		  if (sRef_isValid (sr))
-		    {
-		      ret = sRefSet_insert (ret, sr);
-		    }
-		  else
-		    {
-		      ;
-		    }
-		}
-	      
-	      (void) sRefSet_delete (other, e2);
-	    }
-	  else /* not defined */
-	    {
-	      	      (void) checkDeadState (el, TRUE, loc);
-	    }
-	}
-    } end_sRefSet_allElements;
-
-  sRefSet_allElements (other, el)
-    {
-      if (sRef_isValid (el))
-	{
-	  (void) checkDeadState (el, FALSE, loc);
-	}
-    } end_sRefSet_allElements;
-  
-  sRefSet_free (res); 
-  return (ret);
-}
-
-/*
-** Returns TRUE is there is an error.
-*/
-
-static bool checkDeadState (/*@notnull@*/ sRef el, bool tbranch, fileloc loc)
-{
-  /*
-  ** usymtab_isGuarded --- the utab should still be in the
-  ** state of the alternate branch.
-  **
-  ** tbranch TRUE means el is released in the last branch, e.g.
-  **     if (x != NULL) { ; } else { sfree (x); }
-  ** so, if x is null in the other branch no error is reported.
-  **
-  ** tbranch FALSE means this is the other branch:
-  **     if (x != NULL) { sfree (x); } else { ; }
-  ** so, if x is null in this branch there is no error.
-  */
-
-  
-  if ((sRef_isDead (el) || sRef_isKept (el))
-      && !sRef_isDeepUnionField (el) && !sRef_isThroughArrayFetch (el))
-    {
-       
-      if (!tbranch)
-	{
-	  if (usymtab_isProbableDeepNull (el))
-	    {
-	      	      return TRUE;
-	    }
-	}
-      else
-	{
-	  if (usymtab_isAltProbablyDeepNull (el))
-	    {
-	      	      return TRUE;
-	    }
-	}
-
-      if (optgenerror
-	  (FLG_BRANCHSTATE,
-	   message ("Storage %q is %q in one path, but live in another.",
-		    sRef_unparse (el),
-		    cstring_makeLiteral (sRef_isKept (el) 
-					 ? "kept" : "released")),
-	   loc))
-	{
-	  	  
-	  if (sRef_isKept (el))
-	    {
-	      sRef_showAliasInfo (el);      
-	    }
-	  else
-	    {
-	      sRef_showStateInfo (el);
-	    }
-
-	  /* prevent further errors */
-	  el->defstate = SS_UNKNOWN; 
-	  sRef_setAliasKind (el, AK_ERROR, fileloc_undefined);
-	  
-	  return FALSE;
-	}
-    }
-
-  return TRUE;
-}
-
-static void 
-checkDerivDeadState (/*@notnull@*/ sRef el, bool tbranch, fileloc loc)
-{
-  
-  if (checkDeadState (el, tbranch, loc))
-    {
-      sRefSet_allElements (el->deriv, t)
-	{
-	  if (sRef_isValid (t))
-	    {
-	      	      checkDerivDeadState (t, tbranch, loc);
-	    }
-	} end_sRefSet_allElements;
-    }
-}
-
-static sRefSet
-  sRef_mergePdefinedDerivs (sRefSet res, sRefSet other, bool opt, 
-			    clause cl, fileloc loc)
-{
-  sRefSet ret = sRefSet_new ();
-
-  sRefSet_allElements (res, el)
-    {
-      if (sRef_isValid (el))
-	{
-	  sRef e2 = sRefSet_lookupMember (other, el);
-	  
-	  if (sRef_isValid (e2))
-	    {
-	      if (sRef_isAllocated (el) && !sRef_isAllocated (e2))
-		{
-		  ;
-		}
-	      else if (sRef_isAllocated (e2) && !sRef_isAllocated (el))
-		{
-		  el->deriv = sRefSet_copy (el->deriv, e2->deriv); 
-		}
-	      else
-		{
-		  el->deriv = sRef_mergePdefinedDerivs (el->deriv, e2->deriv, 
-							opt, cl, loc);
-		}
-
-	      sRef_mergeStateAux (el, e2, cl, opt, loc, FALSE);
-	      
-	      ret = sRefSet_insert (ret, el);
-	      (void) sRefSet_delete (other, e2);
-	    }
-	  else
-	    {
-	      if (!opt)
-		{
-		  		  checkDerivDeadState (el, (cl == FALSECLAUSE), loc);
-		}
-
-	      ret = sRefSet_insert (ret, el);
-	    }
-	}
-    } end_sRefSet_allElements;
-  
-  sRefSet_allElements (other, el)
-    {
-      if (sRef_isValid (el))
-	{
-	  if (!sRefSet_member (ret, el))
-	    {
-	      	      	      /* was cl == FALSECLAUSE */
-	      checkDerivDeadState (el, FALSE, loc);
-	      ret = sRefSet_insert (ret, el);
-	    }
-	  else
-	    {
-	      /*
-	      ** it's okay --- member is a different equality test 
-	      */
-	    }
-	}
-    } end_sRefSet_allElements;
-
-  sRefSet_free (res);
-  return (ret);
-}
-
-sRef sRef_makeConj (/*@exposed@*/ /*@returned@*/ sRef a, /*@exposed@*/ sRef b)
-{
-  llassert (sRef_isValid (a));
-  llassert (sRef_isValid (b));
-      
-  if (!sRef_equivalent (a, b))
-    {
-      sRef s = sRef_new ();
-      
-      s->kind = SK_CONJ;
-      s->info = (sinfo) dmalloc (sizeof (*s->info));
-      s->info->conj = (cjinfo) dmalloc (sizeof (*s->info->conj));
-      s->info->conj->a = a;
-      s->info->conj->b = b;
-      
-      if (ctype_equal (a->type, b->type)) s->type = a->type;
-      else s->type = ctype_makeConj (a->type, b->type);
-      
-      if (a->defstate == b->defstate)
-	{
-	  s->defstate = a->defstate;
-	}
-      else
-	{
-	  s->defstate = SS_UNKNOWN; 
-	}
-      
-      s->nullstate = NS_UNKNOWN;
-      
-      s->safe = a->safe && b->safe;
-      s->aliaskind = alkind_resolve (a->aliaskind, b->aliaskind);
-
-      return s;
-    }
-  else
-    {
-      /*@-exposetrans@*/ return a; /*@=exposetrans@*/
-    }
-}
-
-sRef
-sRef_makeUnknown ()
-{
-  sRef s = sRef_new ();
-
-  s->kind = SK_UNKNOWN;
-  return s;
-}
-
-static sRef
-sRef_makeSpecial (speckind sk) /*@*/
-{
-  sRef s = sRef_new ();
-
-  s->kind = SK_SPECIAL;
-  s->info = (sinfo) dmalloc (sizeof (*s->info));
-  s->info->spec = sk;
-  return s;
-}
-
-static sRef srnothing = sRef_undefined;
-static sRef srinternal = sRef_undefined;
-static sRef srsystem = sRef_undefined;
-static sRef srspec = sRef_undefined;
-
-sRef
-sRef_makeNothing (void)
-{
-  if (sRef_isInvalid (srnothing))
-    {
-      srnothing = sRef_makeSpecial (SR_NOTHING);
-    }
-
-  /*@-retalias@*/
-  return srnothing;
-  /*@=retalias@*/
-}
-
-sRef
-sRef_makeInternalState (void)
-{
-  if (sRef_isInvalid (srinternal))
-    {
-      srinternal = sRef_makeSpecial (SR_INTERNAL);
-    }
-
-  /*@-retalias@*/
-  return srinternal;
-  /*@=retalias@*/
-}
-
-sRef
-sRef_makeSpecState (void)
-{
-  if (sRef_isInvalid (srspec))
-    {
-      srspec = sRef_makeSpecial (SR_SPECSTATE);
-    }
-
-  /*@-retalias@*/
-  return srspec;
-  /*@=retalias@*/
-}
-
-sRef
-sRef_makeSystemState (void)
-{
-  if (sRef_isInvalid (srsystem))
-    {
-      srsystem = sRef_makeSpecial (SR_SYSTEM);
-    }
-
-  /*@-retalias@*/
-  return (srsystem);
-  /*@=retalias@*/
-}
-
-static sRef
-sRef_makeResultType (ctype ct)
-{
-  sRef res = sRef_makeResult ();
-
-  res->type = ct;
-  return res;
-}
-
-sRef
-sRef_makeResult ()
-{
-  sRef s = sRef_new ();
-  
-  s->kind = SK_RESULT;
-  s->type = ctype_unknown;
-  s->defstate = SS_UNKNOWN; 
-  s->aliaskind = AK_UNKNOWN;
-  s->nullstate = NS_UNKNOWN;
-  
-  return s;
-}
-
-
-bool
-sRef_isNothing (sRef s)
-{
-  return (sRef_isKindSpecial (s) && s->info->spec == SR_NOTHING);
-}
-
-bool
-sRef_isInternalState (sRef s)
-{
-  return (sRef_isKindSpecial (s) && s->info->spec == SR_INTERNAL);
-}
-
-bool
-sRef_isSpecInternalState (sRef s)
-{
-  return (sRef_isKindSpecial (s) 
-	  && (s->info->spec == SR_INTERNAL || s->info->spec == SR_SPECSTATE));
-}
-
-bool
-sRef_isSpecState (sRef s)
-{
-  return (sRef_isKindSpecial (s) && s->info->spec == SR_SPECSTATE);
-}
-
-bool
-sRef_isResult (sRef s)
-{
-  return (sRef_isValid (s) && s->kind == SK_RESULT);
-}
-
-bool
-sRef_isSystemState (sRef s)
-{
-  return (sRef_isKindSpecial (s) && s->info->spec == SR_SYSTEM);
-}
-
-usymId
-sRef_getScopeIndex (sRef s)
-{
-  llassert (sRef_isValid (s));
-  llassert (sRef_isCvar (s));
-
-  return (s->info->cvar->index);
-}
-
-void
-sRef_makeSafe (sRef s)
-{
-  if (sRef_isValid (s)) 
-    {
-      s->safe = TRUE;
-    }
-}
-
-void
-sRef_makeUnsafe (sRef s)
-{
-  if (sRef_isValid (s)) 
-    {
-      s->safe = FALSE;
-    }
-}
-
-/*
-** memory state operations
-*/
-
-/*@only@*/ cstring sRef_unparseFull (sRef s)
-{
-  if (sRef_isInvalid (s)) return (cstring_undefined);
-
-  return (message ("[%d] %q - %q [%s] { %q }", 
-		   (int) s,
-		   sRef_unparseDebug (s), 
-		   sRef_unparseState (s),
-		   exkind_unparse (s->oexpkind),
-		   sRefSet_unparseDebug (s->deriv)));
-}
-
-/*@unused@*/ cstring sRef_unparseDeep (sRef s)
-{
-  cstring st = cstring_undefined;
-
-  st = message ("%q:", sRef_unparseFull (s));
-
-  if (sRef_isValid (s))
-    {
-      sRefSet_allElements (s->deriv, el)
-	{
-	  st = message("%q\n%q", st, sRef_unparseDeep (el));
-	} end_sRefSet_allElements ;
-    }
-
-  return st;
-}
-
-/*@only@*/ cstring sRef_unparseState (sRef s)
-{
-  if (sRef_isConj (s))
-    {
-      return (message ("%q | %q", 
-		       sRef_unparseState (s->info->conj->a),
-		       sRef_unparseState (s->info->conj->b)));
-    }
-
-  if (sRef_isInvalid (s))
-    {
-      return (cstring_makeLiteral (""));
-    }
-
-  return (message ("%s.%s.%s.%s", 
-		   alkind_unparse (s->aliaskind), 
-		   nstate_unparse (s->nullstate),
-		   exkind_unparse (s->expkind),
-		   sstate_unparse (s->defstate)));
-}
-
-bool sRef_isNotUndefined (sRef s)
-{
-  return (sRef_isInvalid (s)
-	  || (s->defstate != SS_UNDEFINED
-	      && s->defstate != SS_UNUSEABLE
-	      && s->defstate != SS_DEAD));
-}
-
-ynm sRef_isWriteable (sRef s)
-{
-  if (sRef_isInvalid (s)) return MAYBE;
-
-  if (sRef_isConj (s) && s->defstate == SS_UNKNOWN)
-    {
-      if (ynm_toBoolStrict (sRef_isWriteable (sRef_getConjA (s))))
-	{
-	  if (ynm_toBoolStrict (sRef_isWriteable (sRef_getConjB (s))))
-	    {
-	      return YES;
-	    }
-	  return MAYBE;
-	}
-      else
-	{
-	  if (ynm_toBoolStrict (sRef_isWriteable (sRef_getConjB (s))))
-	    {
-	      return MAYBE;
-	    }
-	  return NO;
-	}
-    }
-
-  return (ynm_fromBool (s->defstate != SS_UNUSEABLE));
-}
-
-bool sRef_hasNoStorage (sRef s)
-{
-  return (!sRef_isAllocatedStorage (s) || sRef_isDefinitelyNull (s));
-}
-
-bool sRef_isStrictReadable (sRef s)
-{
-  return (ynm_toBoolStrict (sRef_isReadable (s)));
-}
-
-ynm sRef_isReadable (sRef s)
-{
-  sstate ss;
-
-  if (sRef_isInvalid (s)) return YES;
-
-  ss = s->defstate;
-  
-  if (sRef_isConj (s) && s->defstate == SS_UNKNOWN)
-    {
-      if (ynm_toBoolStrict (sRef_isReadable (sRef_getConjA (s))))
-	{
-	  if (ynm_toBoolStrict (sRef_isReadable (sRef_getConjB (s))))
-	    {
-	      return YES;
-	    }
-	  return MAYBE;
-	}
-      else
-	{
-	  if (ynm_toBoolStrict (sRef_isReadable (sRef_getConjB (s))))
-	    {
-	      return MAYBE;
-	    }
-	  return NO;
-	}
-    }
-  else if (ss == SS_HOFFA)
-    {
-      if (context_getFlag (FLG_STRICTUSERELEASED))
-	{
-	  return MAYBE;
-	}
-      else
-	{
-	  return YES;
-	}
-    }
-  else
-    {
-      return (ynm_fromBool (ss == SS_DEFINED 
-			    || ss == SS_FIXED 
-			    || ss == SS_RELDEF 
-			    || ss == SS_PDEFINED 
-			    || ss == SS_PARTIAL
-			    || ss == SS_SPECIAL
-			    || ss == SS_ALLOCATED
-			    || ss == SS_UNKNOWN));
-    }
-}
-
-static /*@exposed@*/ sRef whatUndefined (/*@exposed@*/ sRef fref, int depth)
-{
-  ctype ct;
-
-  
-  if (depth > MAXDEPTH)
-    {
-      llgenmsg (message 
-		("Warning: check definition limit exceeded, checking %q. "
-		 "This either means there is a variable with at least "
-		 "%d indirections apparent in the program text, or "
-		 "there is a bug in LCLint.",
-		 sRef_unparse (fref),
-		 MAXDEPTH),
-		g_currentloc);
-
-      return sRef_undefined;
-    }
-
-  if (!sRef_isKnown (fref) || sRef_isAnyDefined (fref))
-    {
-      return sRef_undefined;
-    }
-
-  if (sRef_isUnuseable (fref) || sRef_isStateUndefined (fref))
-    {
-      return fref;
-    }
-
-  ct = ctype_realType (sRef_getType (fref));
-  
-  if (ctype_isUnknown (ct))
-    {
-      return sRef_undefined;
-    }
-  else if (ctype_isPointer (ct) || ctype_isArray (ct))
-    {
-      if (sRef_isStateUnknown (fref))
-	{
-	  return sRef_undefined;
-	}
-      else
-	{
-	  sRef fptr = sRef_constructDeref (fref);
-
-	  return (whatUndefined (fptr, depth + 1));
-	}
-    }
-  else if (ctype_isStruct (ct))
-    {
-      bool hasOneDefined = FALSE;
-      
-      if (sRef_isStateUnknown (fref))
-	{
-	  return fref;
-	}
-	  
-      if (sRef_isPdefined (fref) || sRef_isAnyDefined (fref))
-	{
-	  sRefSet_realElements (sRef_derivedFields (fref), sr)
-	    {
-	      hasOneDefined = TRUE;
-	      
-	      if (sRef_isField (sr))
-		{
-		  cstring fieldname = sRef_getField (sr);
-		  sRef fldref = sRef_makeField (fref, fieldname);
-		  bool shouldCheck = !sRef_isRecursiveField (fldref);
-		  
-		  if (shouldCheck)
-		    {
-		      sRef wdef = whatUndefined (fldref, depth + 1);
-
-		      if (sRef_isValid (wdef))
-			{
-			  return wdef;
-			}
-		    }
-		}
-	    } end_sRefSet_realElements;
-	}
-      else if (sRef_isAllocated (fref))
-	{
-	  /*
-	  ** for structures, each field must be completely defined
-	  */
-	  
-	  uentryList fields = ctype_getFields (ct);
-	      
-	  uentryList_elements (fields, ue)
-	    {
-	      cstring name = uentry_getRealName (ue);
-	      sRef ffield = sRef_makeField (fref, name);
-	      bool shouldCheck = !sRef_isRecursiveField (ffield);
-
-	      if (sRef_isRelDef (uentry_getSref (ue)))
-		{
-		  ; /* no error */
-		}
-	      else
-		{
-		  if (shouldCheck)
-		    {
-		      sRef wdef = whatUndefined (ffield, depth + 1);
-
-		      if (sRef_isInvalid (wdef))
-			{
-			  return wdef;
-			}
-		    }
-		}
-	    } end_uentryList_elements;
-	}
-      else
-	{
-	  ;
-	}
-    }
-  else if (ctype_isUnion (ct))
-    {
-      ; 
-    }
-  else
-    {
-      ;
-    }
-
-  return sRef_undefined;
-}
-
-static bool checkDefined (sRef sr)
-{
-  return (sRef_isInvalid (whatUndefined (sr, 0)));
-}
-
-bool sRef_isReallyDefined (sRef s)
-{
-  if (sRef_isValid (s))
-    {
-      if (sRef_isAnyDefined (s))
-	{
-	  return TRUE;
-	}
-      else
-	{
-	  if (sRef_isAllocated (s) || sRef_isPdefined (s))
-	    {
-	      return checkDefined (s);
-	    }
-	  else
-	    {
-	      return FALSE;
-	    }
-	}
-    }
-  else
-    {
-      return TRUE;
-    }
-}
-
-void sRef_showNotReallyDefined (sRef s)
-{
-  if (sRef_isValid (s))
-    {
-      if (sRef_isAnyDefined (s))
-	{
-	  BADBRANCH;
-	}
-      else
-	{
-	  if (sRef_isAllocated (s) || sRef_isPdefined (s))
-	    {
-	      sRef ref = whatUndefined (s, 0);
-
-	      llassert (sRef_isValid (ref));
-
-	      if (ref != s)
-		{
-		  llgenindentmsgnoloc
-		    (message ("This sub-reference is %s: %q",
-			      sstate_unparse (sRef_getDefState (ref)),
-			      sRef_unparse (ref)));
-		}
-	    }
-	  else
-	    {
-	      ;
-	    }
-	}
-    }
-  else
-    {
-      BADBRANCH;
-    }
-}
-
-sstate sRef_getDefState (sRef s)
-{
-  if (sRef_isInvalid (s)) return (SS_UNKNOWN);
-  return (s->defstate);
-}
-
-void sRef_setDefState (sRef s, sstate defstate, fileloc loc)
-{
-  sRef_setStateAux (s, defstate, loc);
-}
-
-static void sRef_clearAliasStateAux (sRef s, fileloc loc)
-{
-  sRef_setAliasKind (s, AK_ERROR, loc);
-}
-
-void sRef_clearAliasState (sRef s, fileloc loc)
-{
-  sRef_aliasSetComplete (sRef_clearAliasStateAux, s, loc);
-}
-
-void sRef_setAliasKindComplete (sRef s, alkind kind, fileloc loc)
-{
-  sRef_aliasSetCompleteParam (sRef_setAliasKind, s, kind, loc);
-}
-
-void sRef_setAliasKind (sRef s, alkind kind, fileloc loc)
-{
-  if (sRef_isValid (s))
-    {
-      sRef_clearDerived (s);
-
-      if ((kind != s->aliaskind && kind != s->oaliaskind)
-	  && fileloc_isDefined (loc))
-	{
-	  s->aliasinfo = alinfo_updateLoc (s->aliasinfo, loc);
-	}
-      
-      s->aliaskind = kind;
-    }
-}
-
-void sRef_setOrigAliasKind (sRef s, alkind kind)
-{
-  if (sRef_isValid (s))
-    {
-      s->oaliaskind = kind;
-    }
-}
-
-exkind sRef_getExKind (sRef s)
-{
-  if (sRef_isValid (s))
-    {
-      return (s->expkind);
-    }
-  else
-    {
-      return XO_UNKNOWN;
-    }
-}
-
-exkind sRef_getOrigExKind (sRef s)
-{
-  if (sRef_isValid (s))
-    {
-      return (s->oexpkind);
-    }
-  else
-    {
-      return XO_UNKNOWN;
-    }
-}
-
-static void sRef_clearExKindAux (sRef s, fileloc loc)
-{
-  sRef_setExKind (s, XO_UNKNOWN, loc);
-}
-
-void sRef_setObserver (sRef s, fileloc loc) 
-{
-  sRef_setExKind (s, XO_OBSERVER, loc);
-}
-
-void sRef_setExposed (sRef s, fileloc loc) 
-{
-  sRef_setExKind (s, XO_EXPOSED, loc);
-}
-
-void sRef_clearExKindComplete (sRef s, fileloc loc)
-{
-  (void) sRef_aliasSetComplete (sRef_clearExKindAux, s, loc);
-}
-
-void sRef_setExKind (sRef s, exkind exp, fileloc loc)
-{
-  if (sRef_isValid (s))
-    {
-      if (s->expkind != exp)
-	{
-	  s->expinfo = alinfo_updateLoc (s->expinfo, loc);
-	}
-      
-      s->expkind = exp;
-    }
-}
-
-/*
-** s1->derived = s2->derived
-*/
-
-static void sRef_copyRealDerived (sRef s1, sRef s2)
-{
-  if (sRef_isValid (s1) && sRef_isValid (s2))
-    {
-      sRef sb = sRef_getRootBase (s1);
-
-      sRefSet_clear (s1->deriv);
-
-      sRefSet_allElements (s2->deriv, el)
-	{
-	  if (sRef_isValid (el))
-	    {
-	      sRef rb = sRef_getRootBase (el);
-	      
-	      if (!sRef_same (rb, sb))
-		{
-		  sRef fb = sRef_fixDirectBase (el, s1);
-		  
-		  if (sRef_isValid (fb))
-		    {
-		      sRef_copyRealDerived (fb, el);
-		      sRef_addDeriv (s1, fb);
-		    }
-		}
-	      else
-		{
-		  sRef_addDeriv (s1, el);
-		}
-	    }
-	} end_sRefSet_allElements ;
-    }
-  
-  }
-
-void sRef_copyRealDerivedComplete (sRef s1, sRef s2)
-{
-  sRef_innerAliasSetCompleteParam (sRef_copyRealDerived, s1, s2);
-}
-
-void sRef_setUndefined (sRef s, fileloc loc)
-{
-  if (sRef_isValid (s))
-    {
-      s->defstate = SS_UNDEFINED;
-
-      if (fileloc_isDefined (loc))
-	{
-	  s->definfo = alinfo_updateLoc (s->definfo, loc);
-	}
-
-      sRef_clearDerived (s);
-    }
-}
-
-static void sRef_setDefinedAux (sRef s, fileloc loc, bool clear)
-{
-  if (sRef_isInvalid (s)) return;
-
-  if (s->defstate != SS_DEFINED && fileloc_isDefined (loc))
-    {
-      s->definfo = alinfo_updateLoc (s->definfo, loc);
-    }
-  
-  s->defstate = SS_DEFINED;
-  
-  /* e.g., if x is allocated, *x = 3 defines x */
-  
-  if (s->kind == SK_PTR)
-    {
-      sRef p = s->info->ref;
-      
-      if (p->defstate == SS_ALLOCATED)
-	{
-	  sRef_setDefinedAux (p, loc, clear);
-	}
-    }
-  else if (s->kind == SK_ARRAYFETCH) 
-    {
-      if (!s->info->arrayfetch->indknown
-	  || (s->info->arrayfetch->ind == 0))
-	{
-	  sRef p = s->info->arrayfetch->arr;
-	  sRef ptr = sRef_constructPointer (p);
-	  
-	  if (sRef_isValid (ptr))
-	    {
-	      if (ptr->defstate == SS_ALLOCATED 
-		  || ptr->defstate == SS_UNDEFINED)
-		{
-		  sRef_setDefinedAux (ptr, loc, clear);
-		}
-	    }
-	  
-	  if (p->defstate == SS_RELDEF) 
-	    {
-	      ;
-	    }
-	  else if (p->defstate == SS_ALLOCATED || p->defstate == SS_PDEFINED)
-	    {
-	      p->defstate = SS_DEFINED;
-	    }
-	  else
-	    {
-	    }
-	}
-    }
-  else if (s->kind == SK_FIELD)
-    {
-      sRef parent = s->info->field->rec;
-      
-      if (sRef_isValid (parent))
-	{
-	  if (ctype_isUnion (ctype_realType (parent->type)))
-	    {
-	      /*
-	      ** Should not clear derived from here.
-	      */
-	      
-	      sRef_setDefinedNoClear (parent, loc);
-	    }
-	  else
-	    {
-	      ; /* Nothing to do for structures. */
-	    }
-	}
-
-          }
-  else
-    {
-      ;
-    }
-
-  if (clear)
-    {
-      sRef_clearDerived (s);
-    }  
-}
-
-static void sRef_setPartialDefined (sRef s, fileloc loc)
-{
-  if (!sRef_isPartial (s))
-    {
-      sRef_setDefined (s, loc);
-    }
-}
-
-void sRef_setPartialDefinedComplete (sRef s, fileloc loc)
-{
-  sRef_innerAliasSetComplete (sRef_setPartialDefined, s, loc);
-}
-
-void sRef_setDefinedComplete (sRef s, fileloc loc)
-{
-  sRef_innerAliasSetComplete (sRef_setDefined, s, loc);
-}
-
-void sRef_setDefined (sRef s, fileloc loc)
-{
-  sRef_setDefinedAux (s, loc, TRUE);
-}
-
-static void sRef_setDefinedNoClear (sRef s, fileloc loc)
-{
-  DPRINTF (("Defining: %s", sRef_unparseFull (s)));
-  sRef_setDefinedAux (s, loc, FALSE);
-  DPRINTF (("==> %s", sRef_unparseFull (s)));
-}
-
-void sRef_setDefinedNCComplete (sRef s, fileloc loc)
-{
-  DPRINTF (("Set Defined Complete: %s", sRef_unparseFull (s)));
-  sRef_innerAliasSetComplete (sRef_setDefinedNoClear, s, loc);
-  DPRINTF (("==> %s", sRef_unparseFull (s)));
-}
-
-static bool sRef_isDeepUnionField (sRef s)
-{
-  return (sRef_deepPred (sRef_isUnionField, s));
-}
-
-bool sRef_isUnionField (sRef s)
-{
-  if (sRef_isValid (s) && s->kind == SK_FIELD)
-    {
-      /*
-       ** defining one field of a union defines the union
-       */
-      
-      sRef base = s->info->field->rec;
-
-      if (sRef_isValid (base))
-	{
-	  return (ctype_isUnion (ctype_realType (base->type)));
-	}
-    }
-
-  return FALSE;
-}
-
-void sRef_setPdefined (sRef s, fileloc loc)
-{
-  if (sRef_isValid (s) && !sRef_isPartial (s))
-    {
-      sRef base = sRef_getBaseSafe (s);
-
-      if (s->defstate == SS_ALLOCATED)
-	{
-	  return;
-	}
-      
-      if (s->defstate != SS_PDEFINED && fileloc_isDefined (loc))
-	{
-	  s->definfo = alinfo_updateLoc (s->definfo, loc);
-	}
-
-      s->defstate = SS_PDEFINED;
-      
-      /* e.g., if x is allocated, *x = 3 defines x */
-      
-      while (sRef_isValid (base) && sRef_isKnown (base))
-	{
-	  if (base->defstate == SS_DEFINED)
-	    { 
-	      sRef nb;
-
-	      	      base->defstate = SS_PDEFINED; 
-	      nb = sRef_getBaseSafe (base); 
-	      base = nb;
-	    }
-	  else 
-	    { 
-	      break; 
-	    }
-	}      
-    }
-}
-
-static void sRef_setStateAux (sRef s, sstate ss, fileloc loc)
-{
-  if (sRef_isValid (s))
-    {
-      /* if (s->defstate == SS_RELDEF) return; */
-
-      if (s->defstate != ss && fileloc_isDefined (loc))
-	{
-	  s->definfo = alinfo_updateLoc (s->definfo, loc);
-	}
-
-      s->defstate = ss;
-      sRef_clearDerived (s); 
-
-      if (ss == SS_ALLOCATED)
-	{
-	  sRef base = sRef_getBaseSafe (s);
-	  
-	  while (sRef_isValid (base) && sRef_isKnown (base))
-	    {
-	      if (base->defstate == SS_DEFINED) 
-		{ 
-		  sRef nb;
-		  
-		  base->defstate = SS_PDEFINED; 
-		  
-		  nb = sRef_getBaseSafe (base); 
-		  base = nb;
-		}
-	      else 
-		{ 
-		  break; 
-		}
-	    }
-	}
-
-          }
-}
-
-void sRef_setAllocatedComplete (sRef s, fileloc loc)
-{
-  sRef_innerAliasSetComplete (sRef_setAllocated, s, loc);
-}
-
-static void sRef_setAllocatedShallow (sRef s, fileloc loc)
-{
-  if (sRef_isValid (s))
-    {
-      if (s->defstate == SS_DEAD || s->defstate == SS_UNDEFINED)
-	{
-	  s->defstate = SS_ALLOCATED;
-	  
-	  if (fileloc_isDefined (loc))
-	    {
-	      s->definfo = alinfo_updateLoc (s->definfo, loc);
-	    }
-	}
-    }
-}
-
-void sRef_setAllocatedShallowComplete (sRef s, fileloc loc)
-{
-  sRef_innerAliasSetComplete (sRef_setAllocatedShallow, s, loc);
-}
-
-void sRef_setAllocated (sRef s, fileloc loc)
-{
-  sRef_setStateAux (s, SS_ALLOCATED, loc);
-  }
-
-void sRef_setPartial (sRef s, fileloc loc)
-{
-  sRef_setStateAux (s, SS_PARTIAL, loc);
-  }
-
-void sRef_setShared (sRef s, fileloc loc)
-{
-  if (sRef_isValid (s))
-    {
-      if (s->aliaskind != AK_SHARED && fileloc_isDefined (loc))
-	{
-	  s->aliasinfo = alinfo_updateLoc (s->aliasinfo, loc);
-	}
-
-      s->aliaskind = AK_SHARED;
-      /* don't! sRef_clearDerived (s); */
-    }
-}
-
-void sRef_setLastReference (sRef s, sRef ref, fileloc loc)
-{
-  if (sRef_isValid (s))
-    {
-      s->aliaskind = sRef_getAliasKind (ref);
-      s->aliasinfo = alinfo_updateRefLoc (s->aliasinfo, ref, loc);
-    }
-}
-
-static
-void sRef_setNullStateAux (/*@notnull@*/ sRef s, nstate ns, fileloc loc)
-{
- s->nullstate = ns;
-
- if (fileloc_isDefined (loc))
-   {
-     s->nullinfo = alinfo_updateLoc (s->nullinfo, loc);
-   }
-}
-
-void sRef_setNotNull (sRef s, fileloc loc)
-{
-  if (sRef_isValid (s))
-    {
-      sRef_setNullStateAux (s, NS_NOTNULL, loc);
-    }
-}
-
-void sRef_setNullState (sRef s, nstate n, fileloc loc)
-{
-  if (sRef_isValid (s))
-    {
-      sRef_setNullStateAux (s, n, loc);
-    }
-}
-
-void sRef_setNullTerminatedStateInnerComplete (sRef s, struct _bbufinfo b, /*@unused@*/ fileloc loc) {
-   
-  switch (b.bufstate) {
-     case BB_NULLTERMINATED:
-	  sRef_setNullTerminatedState (s);
-          sRef_setLen (s, b.len);
-          break;
-     case BB_POSSIBLYNULLTERMINATED:
-          sRef_setPossiblyNullTerminatedState(s);
-          break;
-     case BB_NOTNULLTERMINATED:
-          sRef_setNotNullTerminatedState (s);
-          break;
-  }
-  sRef_setSize (s, b.size);
-
-  /* PL: TO BE DONE : Aliases are not modified right now, have to be similar to
-   * setNullStateInnerComplete.
-   */
-}
-
-void sRef_setNullStateInnerComplete (sRef s, nstate n, fileloc loc)
-{
-  sRef_setNullState (s, n, loc);
-
-  switch (n)
-    {
-    case NS_POSNULL:
-      sRef_innerAliasSetComplete (sRef_setPosNull, s, loc);
-      break;
-    case NS_DEFNULL:
-      sRef_innerAliasSetComplete (sRef_setDefNull, s, loc);
-      break;
-    case NS_UNKNOWN:
-      sRef_innerAliasSetComplete (sRef_setNullUnknown, s, loc);
-      break;
-    case NS_NOTNULL:
-      sRef_innerAliasSetComplete (sRef_setNotNull, s, loc);
-      break;
-    case NS_MNOTNULL:
-      sRef_innerAliasSetComplete (sRef_setNotNull, s, loc);
-      break;
-    case NS_RELNULL:
-      sRef_innerAliasSetComplete (sRef_setNullUnknown, s, loc);
-      break;
-    case NS_CONSTNULL:
-      sRef_innerAliasSetComplete (sRef_setDefNull, s, loc);
-      break;
-    case NS_ABSNULL:
-      sRef_innerAliasSetComplete (sRef_setNullUnknown, s, loc);
-      break;
-    case NS_ERROR:
-      sRef_innerAliasSetComplete (sRef_setNullErrorLoc, s, loc);
-      break;
-    }
-}
-
-void sRef_setPosNull (sRef s, fileloc loc)
-{
-  if (sRef_isValid (s))
-    {
-      sRef_setNullStateAux (s, NS_POSNULL, loc);
-    }
-}
-  
-void sRef_setDefNull (sRef s, fileloc loc)
-{
-  if (sRef_isValid (s))
-    {
-      sRef_setNullStateAux (s, NS_DEFNULL, loc);
-    }
-}
-
-void sRef_setNullUnknown (sRef s, fileloc loc)
-{
-  if (sRef_isValid (s))
-    {
-      sRef_setNullStateAux (s, NS_UNKNOWN, loc);
-    }
-}
-
-void sRef_setNullError (sRef s)
-{
-  if (sRef_isValid (s))
-    {
-      sRef_setNullStateAux (s, NS_UNKNOWN, fileloc_undefined);
-    }
-}
-
-void sRef_setNullErrorLoc (sRef s, /*@unused@*/ fileloc loc)
-{
-  sRef_setNullError (s);
-}
-
-void sRef_setOnly (sRef s, fileloc loc)
-{
-  if (sRef_isValid (s) && s->aliaskind != AK_ONLY)
-    {
-      s->aliaskind = AK_ONLY;
-      s->aliasinfo = alinfo_updateLoc (s->aliasinfo, loc);
-          }
-}
-
-void sRef_setDependent (sRef s, fileloc loc)
-{
-  if (sRef_isValid (s) && !sRef_isConst (s) && (s->aliaskind != AK_DEPENDENT))
-    {
-      s->aliaskind = AK_DEPENDENT;
-      s->aliasinfo = alinfo_updateLoc (s->aliasinfo, loc);
-          }
-}
-
-void sRef_setOwned (sRef s, fileloc loc)
-{
-  if (sRef_isValid (s) && !sRef_isConst (s) && (s->aliaskind != AK_OWNED))
-    {
-      s->aliaskind = AK_OWNED;
-      s->aliasinfo = alinfo_updateLoc (s->aliasinfo, loc);
-          }
-}
-
-void sRef_setKept (sRef s, fileloc loc)
-{
-  if (sRef_isValid (s) && !sRef_isConst (s) && (s->aliaskind != AK_KEPT))
-    {
-      sRef base = sRef_getBaseSafe (s);  
-      
-      while (sRef_isValid (base) && sRef_isKnown (base))
-	{
-	  if (base->defstate == SS_DEFINED) 
-	    {
-	      base->defstate = SS_PDEFINED; 
-	      	      base = sRef_getBaseSafe (base); 
-	    }
-	  else 
-	    {
-	      break; 
-	    }
-
-	}
-
-      s->aliaskind = AK_KEPT;
-      s->aliasinfo = alinfo_updateLoc (s->aliasinfo, loc);
-          }
-}
-
-static void sRef_setKeptAux (sRef s, fileloc loc)
-{
-  if (!sRef_isShared (s))
-    {
-      sRef_setKept (s, loc);
-    }
-}
-
-static void sRef_setDependentAux (sRef s, fileloc loc)
-{
-  if (!sRef_isShared (s))
-    {
-      sRef_setDependent (s, loc);
-    }
-}
-
-void sRef_setKeptComplete (sRef s, fileloc loc)
-{
-  sRef_aliasSetComplete (sRef_setKeptAux, s, loc);
-}
-
-void sRef_setDependentComplete (sRef s, fileloc loc)
-{
-  sRef_aliasSetComplete (sRef_setDependentAux, s, loc);
-}
-
-void sRef_setFresh (sRef s, fileloc loc)
-{
-  if (sRef_isValid (s))
-    {
-      s->aliaskind = AK_FRESH;
-      s->aliasinfo = alinfo_updateLoc (s->aliasinfo, loc);
-    }
-}
-
-void sRef_kill (sRef s, fileloc loc)
-{
-  DPRINTF (("Kill: %s", sRef_unparseFull (s)));
-
-  if (sRef_isValid (s) && !sRef_isShared (s) && !sRef_isConst (s))
-    {
-      sRef base = sRef_getBaseSafe (s);  
-      
-      while (sRef_isValid (base) && sRef_isKnown (base))
-	{
-	  if (base->defstate == SS_DEFINED) 
-	    {
-	      base->defstate = SS_PDEFINED; 
-	      base = sRef_getBaseSafe (base); 
-	    }
-	  else 
-	    {
-	      break; 
-	    }
-
-	}
-      
-      s->aliaskind = s->oaliaskind;
-      s->defstate = SS_DEAD;
-      s->definfo = alinfo_updateLoc (s->definfo, loc);
-
-      sRef_clearDerived (s);
-    }
-}
-
-void sRef_maybeKill (sRef s, fileloc loc)
-{
-        
-  if (sRef_isValid (s))
-    {
-      sRef base = sRef_getBaseSafe (s);  
-
-            
-      while (sRef_isValid (base) && sRef_isKnown (base))
-	{
-	  if (base->defstate == SS_DEFINED || base->defstate == SS_RELDEF)
-	    {
-	      base->defstate = SS_PDEFINED; 
-	      	      base = sRef_getBaseSafe (base); 
-	    }
-	  else 
-	    {
-	      	      break; 
-	    }
-	  
-	}
-      
-      s->aliaskind = s->oaliaskind;
-      s->defstate = SS_HOFFA; 
-      s->definfo = alinfo_updateLoc (s->definfo, loc);
-      sRef_clearDerived (s); 
-    }
-
-  }
-
-/*
-** just for type checking...
-*/
-
-static void sRef_killAux (sRef s, fileloc loc)
-{
-  if (sRef_isValid (s) && !sRef_isShared (s))
-    {
-      if (sRef_isUnknownArrayFetch (s))
-	{
-	  sRef_maybeKill (s, loc);
-	}
-      else
-	{
-	  	  sRef_kill (s, loc);
-	  	}
-    }
-}
-
-/*
-** kills s and all aliases to s
-*/
-
-void sRef_killComplete (sRef s, fileloc loc)
-{
-  DPRINTF (("Kill complete: %s", sRef_unparseFull (s)));
-  sRef_aliasSetComplete (sRef_killAux, s, loc);
-}
-
-static bool sRef_equivalent (sRef s1, sRef s2)
-{
-  return (sRef_compare (s1, s2) == 0);
-}
-
-/*
-** returns an sRef that will not be free'd on function exit.
-*/
-
-/*@only@*/ sRef sRef_saveCopy (sRef s)
-{
-  sRef ret;
-
-  if (sRef_isValid (s))
-    {
-      bool old = inFunction;
-
-      /*
-      ** Exit the function scope, so this sRef is not
-      ** stored in the deallocation table.
-      */
-      
-      inFunction = FALSE;
-      DPRINTF (("Copying sref: %s", sRef_unparseFull(s)));
-      ret = sRef_copy (s);
-      DPRINTF (("Copying ===>: %s", sRef_unparseFull(ret)));
-      inFunction = old;
-    }
-  else
-    {
-      ret = sRef_undefined;
-    }
-
-  /*@-dependenttrans@*/ 
-  return ret;
-  /*@=dependenttrans@*/ 
-}
-
-sRef sRef_copy (sRef s)
-{
-  if (sRef_isKindSpecial (s))
-    {
-      /*@-retalias@*/
-      return s; /* don't copy specials */
-      /*@=retalias@*/
-    }
-  
-  if (sRef_isValid (s))
-    {
-      sRef t = sRef_alloc ();
-
-      t->kind = s->kind;
-      t->safe = s->safe;
-      t->modified = s->modified;
-      t->type = s->type;
-
-            t->info = sinfo_copy (s);
-      
-      t->defstate = s->defstate;
-
-      t->nullstate = s->nullstate;
- 
-      /* start modifications */
-      t->bufinfo.bufstate = s->bufinfo.bufstate;
-      t->bufinfo.len = s->bufinfo.len;
-      t->bufinfo.size = s->bufinfo.size;
-      /* end modifications */
-
-      t->aliaskind = s->aliaskind;
-      t->oaliaskind = s->oaliaskind;
-
-      t->expkind = s->expkind;
-      t->oexpkind = s->oexpkind;
-
-      t->aliasinfo = alinfo_copy (s->aliasinfo);
-      t->definfo = alinfo_copy (s->definfo);
-      t->nullinfo = alinfo_copy (s->nullinfo);
-      t->expinfo = alinfo_copy (s->expinfo);
-
-      t->deriv = sRefSet_newDeepCopy (s->deriv);
-      
-      return t;
-    }
-  else
-    {
-      return sRef_undefined;
-    }
-}
-
-/*@notfunction@*/
-# define PREDTEST(func,s) \
-   do { if (sRef_isInvalid (s)) { return FALSE; } \
-        else { if (sRef_isConj (s)) \
-                  { return (func (sRef_getConjA (s)) \
-		            || func (sRef_getConjB (s))); }}} while (FALSE);
-
-bool sRef_isAddress (sRef s)
-{
-  PREDTEST (sRef_isAddress, s);
-  return (s->kind == SK_ADR);
-}
-	  
-/*
-** pretty weak... maybe a flag should control this.
-*/
-
-bool sRef_isThroughArrayFetch (sRef s)
-{
-  if (sRef_isValid (s))
-    {
-      sRef tref = s;
-
-      do 
-	{
-	  sRef lt;
-
-	  if (sRef_isArrayFetch (tref)) 
-	    {
-	      	      return TRUE;
-	    }
-	  
-	  lt = sRef_getBase (tref);
-	  tref = lt;
-	} while (sRef_isValid (tref));
-    } 
-
-  return FALSE;
-}
-
-bool sRef_isArrayFetch (sRef s)
-{
-  PREDTEST (sRef_isArrayFetch, s);
-  return (s->kind == SK_ARRAYFETCH);
-}
-
-bool sRef_isMacroParamRef (sRef s)
-{
-  if (context_inMacro () && sRef_isCvar (s))
-    {
-      uentry ue = sRef_getUentry (s);
-      cstring pname = makeParam (uentry_rawName (ue));
-      uentry mac = usymtab_lookupSafe (pname);
-
-      cstring_free (pname);
-      return (uentry_isValid (mac));
-    }
-
-  return FALSE;
-}
-      
-bool sRef_isCvar (sRef s) 
-{
-  PREDTEST (sRef_isCvar, s);
-  return (s->kind == SK_CVAR);
-}
-
-bool sRef_isConst (sRef s) 
-{
-  PREDTEST (sRef_isConst, s);
-  return (s->kind == SK_CONST);
-}
-
-bool sRef_isObject (sRef s) 
-{
-  PREDTEST (sRef_isObject, s);
-  return (s->kind == SK_OBJECT);
-}
-
-bool sRef_isExternal (sRef s) 
-{
-  PREDTEST (sRef_isExternal, s);
-  return (s->kind == SK_EXTERNAL);
-}
-
-static bool sRef_isDerived (sRef s) 
-{
-  PREDTEST (sRef_isDerived, s);
-  return (s->kind == SK_DERIVED);
-}
-
-bool sRef_isField (sRef s)
-{
-  PREDTEST (sRef_isField, s);
-  return (s->kind == SK_FIELD);
-}
-
-static bool sRef_isIndex (sRef s)
-{
-  PREDTEST (sRef_isIndex, s);
-  return (s->kind == SK_ARRAYFETCH);
-}
-
-bool sRef_isAnyParam (sRef s)
-{
-  PREDTEST (sRef_isAnyParam, s);
-  return (s->kind == SK_PARAM);  
-}
-
-bool sRef_isParam (sRef s)
-{
-  PREDTEST (sRef_isParam, s);
-  return (s->kind == SK_PARAM);
-}
-
-bool sRef_isDirectParam (sRef s)
-{
-  PREDTEST (sRef_isDirectParam, s);
-
-  return ((s->kind == SK_CVAR) &&
-	  (s->info->cvar->lexlevel == functionScope) &&
-	  (context_inFunction () && 
-	   (s->info->cvar->index <= uentryList_size (context_getParams ()))));
-}
-
-bool sRef_isPointer (sRef s)
-{
-  PREDTEST (sRef_isPointer, s);
-  return (s->kind == SK_PTR);
-}
-
-/*
-** returns true if storage referenced by s is visible
-*/
-
-bool sRef_isReference (sRef s)
-{
-  PREDTEST (sRef_isReference, s);
-
-  return (sRef_isPointer (s) || sRef_isIndex (s) || sRef_isGlobal (s)
-	  || (sRef_isField (s) && (sRef_isReference (s->info->field->rec))));
-}
-
-bool sRef_isIReference (sRef s)
-{
-  return (sRef_isPointer (s) || sRef_isAddress (s) || sRef_isIndex (s)
-	  || sRef_isField (s) || sRef_isArrayFetch (s));
-}
-
-bool sRef_isGlobal (sRef s)
-{
-  return (sRef_isCvar (s) && (s->info->cvar->lexlevel <= fileScope));
-}
-
-bool sRef_isRealGlobal (sRef s)
-{
-  return (sRef_isCvar (s) && (s->info->cvar->lexlevel == globScope));
-}
-
-bool sRef_isFileStatic (sRef s)
-{
-  return (sRef_isCvar (s) && (s->info->cvar->lexlevel == fileScope));
-}
-
-bool sRef_isAliasCheckedGlobal (sRef s)
-{
-  if (sRef_isGlobal (s))
-    {
-      uentry ue = sRef_getUentry (s);
-
-      return context_checkAliasGlob (ue);
-    }
-  else
-    {
-      return FALSE;
-    }
-}
-
-void sRef_free (/*@only@*/ sRef s)
-{
-  if (s != sRef_undefined && s->kind != SK_SPECIAL)
-    {
-      alinfo_free (s->expinfo);
-      alinfo_free (s->aliasinfo);
-      alinfo_free (s->definfo);
-      alinfo_free (s->nullinfo);
-      
-      sRefSet_free (s->deriv);
-      s->deriv = sRefSet_undefined;
-      sinfo_free (s);
-      
-      sfree (s); 
-    }
-}
-
-void sRef_setType (sRef s, ctype t)
-{
-  if (sRef_isValid (s))
-    {
-      s->type = t;
-    }
-}
-
-void sRef_setTypeFull (sRef s, ctype t)
-{
-  if (sRef_isValid (s))
-    {
-      s->type = t;
-
-      sRefSet_allElements (s->deriv, current)
-	{
-	  sRef_setTypeFull (current, ctype_unknown);
-	} end_sRefSet_allElements ;
-    }
-}
-
-/*@exposed@*/ sRef
-  sRef_buildField (sRef rec, /*@dependent@*/ cstring f)
-{
-  return (sRef_buildNCField (rec, f)); 
-}
-
-static /*@exposed@*/ sRef
-sRef_findDerivedField (/*@notnull@*/ sRef rec, cstring f)
-{
-  sRefSet_allElements (rec->deriv, sr)
-    {
-      if (sRef_isValid (sr))
-	{
-	  if (sr->kind == SK_FIELD && cstring_equal (sr->info->field->field, f))
-	    {
-	      return sr;
-	    }
-	}
-    } end_sRefSet_allElements;
-
-  return sRef_undefined;
-}
-
-/*@dependent@*/ /*@observer@*/ sRefSet
-  sRef_derivedFields (sRef rec)
-{
-  if (sRef_isValid (rec))
-    {
-      sRefSet ret;
-      ret = rec->deriv;
-      return (ret);
-    }
-  else
-    {
-      return (sRefSet_undefined);
-    }
-}
-
-static /*@exposed@*/ sRef
-  sRef_findDerivedPointer (sRef s)
-{
-  if (sRef_isValid (s))
-    {
-      sRefSet_realElements (s->deriv, sr)
-	{
-	  if (sRef_isValid (sr) && sr->kind == SK_PTR)
-	    {
-	      return sr;
-	    }
-	} end_sRefSet_realElements;
-    }
-
-  return sRef_undefined;
-}
-
-bool
-sRef_isUnknownArrayFetch (sRef s)
-{
-  return (sRef_isValid (s) 
-	  && s->kind == SK_ARRAYFETCH
-	  && !s->info->arrayfetch->indknown);
-}
-
-static /*@exposed@*/ sRef
-sRef_findDerivedArrayFetch (/*@notnull@*/ sRef s, bool isknown, int idx, bool dead)
-{
-  
-  if (isknown) 
-    {
-      sRefSet_realElements (s->deriv, sr)
-	{
-	  if (sRef_isValid (sr)
-	      && sr->kind == SK_ARRAYFETCH
-	      && sr->info->arrayfetch->indknown
-	      && (sr->info->arrayfetch->ind == idx))
-	    {
-	      return sr;
-	    }
-	} end_sRefSet_realElements;
-    }
-  else
-    {
-      sRefSet_realElements (s->deriv, sr)
-	{
-	  if (sRef_isValid (sr)
-	      && sr->kind == SK_ARRAYFETCH
-	      && (!sr->info->arrayfetch->indknown
-		  || (sr->info->arrayfetch->indknown && 
-		      sr->info->arrayfetch->ind == 0)))
-	    {
-	      if (sRef_isDead (sr) || sRef_isKept (sr))
-		{
-		  if (dead || context_getFlag (FLG_STRICTUSERELEASED))
-		    {
-		      return sr;
-		    }
-		}
-	      else
-		{
-		  return sr;
-		}
-	    }
-	} end_sRefSet_realElements;
-    }
-
-  return sRef_undefined;
-}
-
-static /*@exposed@*/ sRef 
-sRef_buildNCField (/*@exposed@*/ sRef rec, /*@exposed@*/ cstring f)
-{
-  sRef s;
-
-  if (sRef_isInvalid (rec))
-    {
-      return sRef_undefined;
-    }
-      
-  /*
-  ** check if the field already has been referenced 
-  */
-
-  s = sRef_findDerivedField (rec, f);
-  
-  if (sRef_isValid (s))
-    {
-            return s;
-    }
-  else
-    {
-      ctype ct = ctype_realType (rec->type);
-
-      s = sRef_new ();      
-      s->kind = SK_FIELD;
-      s->info = (sinfo) dmalloc (sizeof (*s->info));
-      s->info->field = (fldinfo) dmalloc (sizeof (*s->info->field));
-      s->info->field->rec = rec;
-      s->info->field->field = f; /* doesn't copy f */
-      
-      
-      if (ctype_isKnown (ct) && ctype_isSU (ct))
-	{
-	  uentry ue = uentryList_lookupField (ctype_getFields (ct), f);
-	
-	  if (!uentry_isUndefined (ue))
-	    {
-	      s->type = uentry_getType (ue);
-
-	      if (ctype_isMutable (s->type)
-		  && rec->aliaskind != AK_STACK 
-		  && !alkind_isStatic (rec->aliaskind))
-		{
-		  s->aliaskind = rec->aliaskind;
-		}
-	      else
-		{
-		  s->aliaskind = AK_UNKNOWN;
-		}
-
-	      if (sRef_isStateDefined (rec) || sRef_isStateUnknown (rec) 
-		  || sRef_isPdefined (rec))
-		{
-		  		  sRef_setStateFromUentry (s, ue);
-		  		}
-	      else
-		{
-		  sRef_setPartsFromUentry (s, ue);
-		  		}
-
-	      s->oaliaskind = s->aliaskind;
-	      s->oexpkind = s->expkind;
-	    }
-	  else
-	    {
-	      /*
-		Never report this as an error.  It can happen whenever there
-		is casting involved.
-
-	      if (report)
-		{
-		  llcontbug (message ("buildNCField --- no field %s: %q / %s",
-				      f, sRef_unparse (s), ctype_unparse (ct)));
-		}
-		*/
-
-	      return sRef_undefined;
-	    }
-	}
-      
-      if (rec->defstate == SS_DEFINED 
-	  && (s->defstate == SS_UNDEFINED || s->defstate == SS_UNKNOWN))
-	{
-	  s->defstate = SS_DEFINED;
-	}
-      else if (rec->defstate == SS_PARTIAL)
-	{
-	  s->defstate = SS_PARTIAL;
-	}
-      else if (rec->defstate == SS_ALLOCATED) 
-	{
-	  if (ctype_isStackAllocated (ct) && ctype_isStackAllocated (s->type))
-	    {
-	      s->defstate = SS_ALLOCATED;
-	    }
-	  else
-	    {
-	      s->defstate = SS_UNDEFINED;
-	    }
-	}
-      else if (s->defstate == SS_UNKNOWN)
-	{
-	  s->defstate = rec->defstate;
-	}
-      else
-	{
-	  ; /* no change */
-	}
-
-      if (s->defstate == SS_UNDEFINED)
-	{
-	  ctype rt = ctype_realType (s->type);
-	  
-	  if (ctype_isArray (rt) || ctype_isSU (rt))
-	    {
-	      	      s->defstate = SS_ALLOCATED;
-	    }
-	}
-
-      sRef_addDeriv (rec, s);
-
-      if (ctype_isInt (s->type) && cstring_equal (f, REFSNAME))
-	{
-	  s->aliaskind = AK_REFS;
-	  s->oaliaskind = AK_REFS;
-	}
-
-            return s;
-    }
-}
-
-bool
-sRef_isStackAllocated (sRef s)
-{
-  return (sRef_isValid(s) 
-	  && s->defstate == SS_ALLOCATED && ctype_isStackAllocated (s->type));
-}
-	  
-static
-void sRef_setArrayFetchState (/*@notnull@*/ /*@exposed@*/ sRef s, 
-			      /*@notnull@*/ /*@exposed@*/ sRef arr)
-{
-  if (ctype_isRealAP (arr->type))
-    {
-      s->type = ctype_baseArrayPtr (arr->type);
-    }
-
-  /* a hack, methinks... makeArrayFetch (&a[0]) ==> a[] */
-  if (sRef_isAddress (arr)) 
-    {
-      sRef t = arr->info->ref;
-      
-      if (sRef_isArrayFetch (t))
-	{
-	  s->info->arrayfetch->arr = t->info->arrayfetch->arr;
-	}
-    }
-  else if (ctype_isRealPointer (arr->type))
-    {
-      sRef sp = sRef_findDerivedPointer (arr);
-
-      
-      if (sRef_isValid (sp))
-	{
-	  
-	  if (ctype_isMutable (s->type))
-	    {
-	      sRef_setExKind (s, sRef_getExKind (sp), fileloc_undefined);
-
-	      	      
-	      s->aliaskind = sp->aliaskind;
-	    }
-
-	  s->defstate = sp->defstate;
-
-	  if (s->defstate == SS_DEFINED) 
-	    {
-	      if (!context_getFlag (FLG_STRICTDESTROY))
-		{
-		  s->defstate = SS_PARTIAL;
-		}
-	    }
-
-	  s->nullstate = sp->nullstate;
-	}
-      else
-	{
-	  if (arr->defstate == SS_UNDEFINED)
-	    {
-	      s->defstate = SS_UNUSEABLE;
-	    }
-	  else if ((arr->defstate == SS_ALLOCATED) && !ctype_isSU (s->type))
-	    {
-	      s->defstate = SS_UNDEFINED;
-	    }
-	  else
-	    {
-	      if (!context_getFlag (FLG_STRICTDESTROY))
-		{
-		  s->defstate = SS_PARTIAL;
-		}
-	      else
-		{
-		  s->defstate = SS_DEFINED;
-		}
-
-	      /*
-	      ** Very weak checking for array elements.
-	      ** Was:
-	      **     s->defstate = arr->defstate;
-	      */
-	    }
-
-	  sRef_setExKind (s, sRef_getExKind (arr), g_currentloc);
-
-	  if (arr->aliaskind == AK_LOCAL || arr->aliaskind == AK_FRESH)
-	    {
-	      s->aliaskind = AK_LOCAL;
-	    }
-	  else
-	    {
-	      s->aliaskind = AK_UNKNOWN;
-	    }
-	  
-	  sRef_setTypeState (s);
-	}
-    }
-  else
-    {
-      if (arr->defstate == SS_DEFINED)
-	{
-	  /*
-	  ** Very weak checking for array elements.
-	  ** Was:
-	  **     s->defstate = arr->defstate;
-	  */
-
-	  if (context_getFlag (FLG_STRICTDESTROY))
-	    {
-	      s->defstate = SS_DEFINED;
-	    }
-	  else
-	    {
-	      s->defstate = SS_PARTIAL;
-	    }
-	}
-      else if (arr->defstate == SS_ALLOCATED)
-	{
-	  if (ctype_isRealArray (s->type))
-	    {
-	      s->defstate = SS_ALLOCATED;
-	    }
-	  else 
-	    {
-	      if (!s->info->arrayfetch->indknown)
-		{
-		  /*
-		  ** is index is unknown, elements is defined or 
-		  ** allocated is any element is!
-		  */
-		  
-		  s->defstate = SS_UNDEFINED;
-		  
-		  sRefSet_allElements (arr->deriv, sr)
-		    {
-		      if (sRef_isValid (sr))
-			{
-			  if (sr->defstate == SS_ALLOCATED)
-			    {
-			      s->defstate = SS_ALLOCATED;
-			    }
-			  else 
-			    {
-			      if (sr->defstate == SS_DEFINED)
-				{
-				  if (context_getFlag (FLG_STRICTDESTROY))
-				    {
-				      s->defstate = SS_DEFINED;
-				    }
-				  else
-				    {
-				      s->defstate = SS_PARTIAL;
-				    }
-
-				  break;
-				}
-			    }
-			}
-		    } end_sRefSet_allElements;
-		  
-		  		}
-	      else
-		{
-		  s->defstate = SS_UNDEFINED;
-		}
-	    }
-	}
-      else
-	{
-	  s->defstate = arr->defstate;
-	}
-      
-      
-      /*
-      ** kludgey way to guess where aliaskind applies
-      */
-      
-      if (ctype_isMutable (s->type) 
-	  && !ctype_isPointer (arr->type) 
-	  && !alkind_isStatic (arr->aliaskind)
-	  && !alkind_isStack (arr->aliaskind)) /* evs - 2000-06-20: don't pass stack allocation to members */
-	{
-	  s->aliaskind = arr->aliaskind;
-	}
-      else
-	{
-	  s->aliaskind = AK_UNKNOWN;
-	}
-    
-      sRef_setTypeState (s);
-    }
-
-  if (sRef_isObserver (arr)) 
-    {
-      s->expkind = XO_OBSERVER;
-    }
-}  
-
-/*@exposed@*/ sRef sRef_buildArrayFetch (/*@exposed@*/ sRef arr)
-{
-  sRef s;
-
-  if (!sRef_isValid (arr)) {
-    /*@-nullret@*/ return arr /*@=nullret@*/;
-  }
-
-  if (ctype_isRealPointer (arr->type))
-    {
-      (void) sRef_buildPointer (arr); /* do this to define arr! */
-    }
-  
-  s = sRef_findDerivedArrayFetch (arr, FALSE, 0, FALSE);
-  
-  if (sRef_isValid (s))
-    {
-      sRef_setExKind (s, sRef_getExKind (arr), g_currentloc);
-      return s;
-    }
-  else
-    {
-      s = sRef_new ();
-
-      s->kind = SK_ARRAYFETCH;
-      s->info = (sinfo) dmalloc (sizeof (*s->info));
-      s->info->arrayfetch = (ainfo) dmalloc (sizeof (*s->info->arrayfetch));
-      s->info->arrayfetch->indknown = FALSE;
-      s->info->arrayfetch->ind = 0;
-      s->info->arrayfetch->arr = arr;
-      sRef_setArrayFetchState (s, arr);
-      s->oaliaskind = s->aliaskind;
-      s->oexpkind = s->expkind;
-
-      if (!context_inProtectVars ())
-	{
-	  sRef_addDeriv (arr, s);
-	}
-      
-      return (s);
-    }
-}
-
-/*@exposed@*/ sRef
-  sRef_buildArrayFetchKnown (/*@exposed@*/ sRef arr, int i)
-{
-  sRef s;
-
-  if (!sRef_isValid (arr)) {
-    /*@-nullret@*/ return arr /*@=nullret@*/;
-  }
-
-  if (ctype_isRealPointer (arr->type))
-    {
-       (void) sRef_buildPointer (arr); /* do this to define arr! */
-    }
-
-  s = sRef_findDerivedArrayFetch (arr, TRUE, i, FALSE);
-      
-  if (sRef_isValid (s))
-    {
-      sRef_setExKind (s, sRef_getExKind (arr), g_currentloc);      
-      return s;
-    }
-  else
-    {
-      s = sRef_new ();
-      
-      s->kind = SK_ARRAYFETCH;
-      s->info = (sinfo) dmalloc (sizeof (*s->info));
-      s->info->arrayfetch = (ainfo) dmalloc (sizeof (*s->info->arrayfetch));
-      s->info->arrayfetch->arr = arr;
-      s->info->arrayfetch->indknown = TRUE;
-      s->info->arrayfetch->ind = i;
-      
-      sRef_setArrayFetchState (s, arr);
-      
-      s->oaliaskind = s->aliaskind;
-      s->oexpkind = s->expkind;
-      sRef_addDeriv (arr, s);
-
-      return (s);
-    }
-}
-
-/*
-** sets everything except for defstate
-*/
-
-static void
-sRef_setPartsFromUentry (sRef s, uentry ue)
-{
-    
-  llassert (sRef_isValid (s));
-
-  s->aliaskind = alkind_derive (s->aliaskind, uentry_getAliasKind (ue));
-  s->oaliaskind = s->aliaskind;
-
-  if (s->expkind == XO_UNKNOWN)
-    {
-      s->expkind = uentry_getExpKind (ue);
-    }
-
-  s->oexpkind = s->expkind;
-
-  if (s->nullstate == NS_UNKNOWN)
-    {
-      s->nullstate = sRef_getNullState (uentry_getSref (ue));
-    }
-
-  if (s->aliaskind == AK_IMPONLY 
-      && (sRef_isExposed (s) || sRef_isObserver (s)))
-    {
-      s->oaliaskind = s->aliaskind = AK_IMPDEPENDENT;
-    }
-
-}
-
-static void
-sRef_setStateFromAbstractUentry (sRef s, uentry ue)
-{
-  llassert (sRef_isValid (s));
-  
-  sRef_setPartsFromUentry (s, ue);
-
-  s->aliaskind = alkind_derive (s->aliaskind, uentry_getAliasKind (ue));
-  s->oaliaskind = s->aliaskind;
-
-  if (s->expkind == XO_UNKNOWN)
-    {
-      s->expkind = uentry_getExpKind (ue);
-    }
-
-  s->oexpkind = s->expkind;
-}
-
-void
-sRef_setStateFromUentry (sRef s, uentry ue)
-{
-  sstate defstate;
-
-  llassert (sRef_isValid (s));
-  
-  sRef_setPartsFromUentry (s, ue);
-
-  defstate = uentry_getDefState (ue);
-
-  if (sstate_isKnown (defstate))
-    {
-      s->defstate = defstate;
-    }
-  else
-    {
-      ;
-    }
-}
-
-/*@exposed@*/ sRef
-  sRef_buildPointer (/*@exposed@*/ sRef t)
-{
-  DPRINTF (("build pointer: %s", sRef_unparse (t)));
-
-  if (sRef_isInvalid (t)) return sRef_undefined;
-
-  if (sRef_isAddress (t))
-    {
-      DPRINTF (("Return ref: %s", sRef_unparse (t->info->ref)));
-      return (t->info->ref);
-    }
-  else
-    {
-      sRef s = sRef_findDerivedPointer (t);
-
-      DPRINTF (("find derived: %s", sRef_unparse (s)));
-
-      if (sRef_isValid (s))
-	{
-	  
-	  sRef_setExKind (s, sRef_getExKind (t), g_currentloc);
-	  s->oaliaskind = s->aliaskind;
-	  s->oexpkind = s->expkind;
-
-	  return s;
-	}
-      else
-	{
-	  s = sRef_constructPointerAux (t);
-	  
-	  DPRINTF (("construct: %s", sRef_unparse (s)));
-
-	  if (sRef_isValid (s))
-	    {
-	      sRef_addDeriv (t, s);
-
-	      s->oaliaskind = s->aliaskind;
-	      s->oexpkind = s->expkind;
-	    }
-	  
-	  return s;
-	}
-    }
-}
-
-/*@exposed@*/ sRef
-sRef_constructPointer (sRef t)
-   /*@modifies t@*/
-{
-  return sRef_buildPointer (t);
-}
-
-static /*@exposed@*/ sRef sRef_constructDerefAux (sRef t, bool isdead)
-{
-  if (sRef_isValid (t))
-    {
-      sRef s;
-      
-      /*
-      ** if there is a derived t[?], return that.  Otherwise, *t.
-      */
-      
-            
-      s = sRef_findDerivedArrayFetch (t, FALSE, 0, isdead);
-      
-      if (sRef_isValid (s))
-	{
-	  	  return s;
-	}
-      else
-	{
-	  sRef ret = sRef_constructPointer (t);
-
-	  /*
-	  ** This is necessary to prevent infinite depth
-	  ** in checking complete destruction.  
-	  */
-
-	  
-	  if (isdead)
-	    {
-	      /* ret->defstate = SS_UNKNOWN;  */
-	      return ret; 
-	    }
-	  else
-	    {
-	      return ret;
-	    }
-	}
-    }
-  else
-    {
-      return sRef_undefined;
-    }
-}
-
-sRef sRef_constructDeref (sRef t)
-{
-  return sRef_constructDerefAux (t, FALSE);
-}
-
-sRef sRef_constructDeadDeref (sRef t)
-{
-  return sRef_constructDerefAux (t, TRUE);
-}
-
-static sRef
-sRef_constructPointerAux (/*@notnull@*/ /*@exposed@*/ sRef t)
-{
-  sRef s = sRef_new ();
-  ctype rt = t->type;
-  ctype st;
-  
-  s->kind = SK_PTR;
-  s->info = (sinfo) dmalloc (sizeof (*s->info));
-  s->info->ref = t;
-  
-  if (ctype_isRealAP (rt))
-    {
-      s->type = ctype_baseArrayPtr (rt);
-    }
-  
-  st = ctype_realType (s->type);
-  
-    
-  if (t->defstate == SS_UNDEFINED)
-    {
-      s->defstate = SS_UNUSEABLE;
-    }
-  else if ((t->defstate == SS_ALLOCATED) && !ctype_isSU (st))
-    {
-      s->defstate = SS_UNDEFINED;
-    }
-  else
-    {
-      s->defstate = t->defstate;
-    }
-  
-  if (t->aliaskind == AK_LOCAL || t->aliaskind == AK_FRESH)
-    {
-      s->aliaskind = AK_LOCAL;
-    }
-  else
-    {
-      s->aliaskind = AK_UNKNOWN;
-    }
-  
-  sRef_setExKind (s, sRef_getExKind (t), fileloc_undefined);
-  sRef_setTypeState (s);
-  
-  s->oaliaskind = s->aliaskind;
-  s->oexpkind = s->expkind;
-
-  return s;
-}
-
-bool sRef_hasDerived (sRef s)
-{
-  return (sRef_isValid (s) && !sRefSet_isEmpty (s->deriv));
-}
-
-void
-sRef_clearDerived (sRef s)
-{
-  if (sRef_isValid (s))
-    {
-            sRefSet_clear (s->deriv); 
-    }
-}
-
-void
-sRef_clearDerivedComplete (sRef s)
-{
-  
-  if (sRef_isValid (s))
-    {
-      sRef base = sRef_getBaseSafe (s);
-
-      while (sRef_isValid (base))
-	{
-	  sRefSet_clear (base->deriv); 
-	  base = sRef_getBaseSafe (base);
-	}
-
-      sRefSet_clear (s->deriv); 
-    }
-}
-
-/*@exposed@*/ sRef
-sRef_makePointer (sRef s)
-   /*@modifies s@*/
-{
-  sRef res = sRef_buildPointer (s); 
-
-  DPRINTF (("Res: %s", sRef_unparse (res)));
-  return res;
-}
-
-/*
-** &a[] => a (this is for out params)
-*/
-
-/*@exposed@*/ sRef
-sRef_makeAnyArrayFetch (/*@exposed@*/ sRef arr)
-{
-  
-  if (sRef_isAddress (arr))
-    {
-            return (arr->info->ref);
-    }
-  else
-    {
-      return (sRef_buildArrayFetch (arr));
-    }
-}
-
-/*@exposed@*/ sRef
-sRef_makeArrayFetch (sRef arr)
-{
-  return (sRef_buildArrayFetch (arr));
-}
-
-/*@exposed@*/ sRef
-sRef_makeArrayFetchKnown (sRef arr, int i)
-{
-  return (sRef_buildArrayFetchKnown (arr, i));
-}
-
-/*@exposed@*/ sRef
-sRef_makeField (sRef rec, /*@dependent@*/ cstring f)
-{
-  sRef ret;
-  ret = sRef_buildField (rec, f);
-  return ret;
-}
-
-/*@exposed@*/ sRef
-sRef_makeNCField (sRef rec, /*@dependent@*/ cstring f)
-{
-    return (sRef_buildNCField (rec, f));
-}
-
-/*@only@*/ cstring
-sRef_unparseKindName (sRef s)
-{
-  cstring result;
-
-  if (s == sRef_undefined) return cstring_makeLiteral ("");
-
-  s = sRef_fixConj (s);
-
-  switch (s->kind)
-    {
-    case SK_CVAR: 
-      if (sRef_isLocalVar (s)) 
-	{
-	  result = cstring_makeLiteral ("Variable");
-	}
-      else
-	{
-	  result = cstring_makeLiteral ("Undef global");
-	}
-      break;
-    case SK_PARAM:
-      result = cstring_makeLiteral ("Out parameter");
-      break;
-    case SK_ARRAYFETCH:
-      if (sRef_isAnyParam (s->info->arrayfetch->arr)) 
-	{
-	  result = cstring_makeLiteral ("Out parameter");
-	}
-      else if (sRef_isIndexKnown (s))
-	{
-	  result = cstring_makeLiteral ("Array element");
-	}
-      else
-	{
-	  result = cstring_makeLiteral ("Value");
-	}
-      break;
-    case SK_PTR:
-      if (sRef_isAnyParam (s->info->ref)) 
-	{
-	  result = cstring_makeLiteral ("Out parameter");
-	}
-      else
-	{
-	  result = cstring_makeLiteral ("Value");
-	}
-      break;
-    case SK_ADR:
-      result = cstring_makeLiteral ("Value");
-      break;
-    case SK_FIELD:
-      result = cstring_makeLiteral ("Field");
-      break;
-    case SK_OBJECT:
-      result = cstring_makeLiteral ("Object");
-      break;
-    case SK_UNCONSTRAINED:
-      result = cstring_makeLiteral ("");
-      break;
-    case SK_RESULT:
-    case SK_SPECIAL:
-    case SK_UNKNOWN:
-    case SK_EXTERNAL:
-    case SK_DERIVED:
-    case SK_CONST:
-    case SK_TYPE:
-      result = cstring_makeLiteral ("");
-      break;
-    case SK_CONJ:
-      result = cstring_makeLiteral ("");
-      break;
-    case SK_NEW:
-      result = cstring_makeLiteral ("Storage");
-      break;
-    }
-  
-  return result;
-}
-
-/*@only@*/ cstring
-sRef_unparseKindNamePlain (sRef s)
-{
-  cstring result;
-
-  if (s == sRef_undefined) return cstring_makeLiteral ("");
-
-  s = sRef_fixConj (s);
-
-  switch (s->kind)
-    {
-    case SK_CVAR: 
-      if (sRef_isLocalVar (s)) 
-	{
-	  result = cstring_makeLiteral ("Variable");
-	}
-      else 
-	{
-	  result = cstring_makeLiteral ("Global");
-	}
-      break;
-    case SK_PARAM:
-      result = cstring_makeLiteral ("Parameter");
-      break;
-    case SK_ARRAYFETCH:
-      if (sRef_isAnyParam (s->info->arrayfetch->arr)) 
-	{
-	  result = cstring_makeLiteral ("Parameter");
-	}
-      else if (sRef_isIndexKnown (s))
-	{
-	  result = cstring_makeLiteral ("Array element");
-	}
-      else 
-	{
-	  result = cstring_makeLiteral ("Value");
-	}
-      break;
-    case SK_PTR:
-      if (sRef_isAnyParam (s->info->ref))
-	{
-	  result = cstring_makeLiteral ("Parameter");
-	}
-      else
-	{
-	  result = cstring_makeLiteral ("Value");
-	}
-      break;
-    case SK_ADR:
-      result = cstring_makeLiteral ("Value");
-      break;
-    case SK_FIELD:
-      result = cstring_makeLiteral ("Field");
-      break;
-    case SK_OBJECT:
-      result = cstring_makeLiteral ("Object");
-      break;
-    case SK_NEW:
-      result = cstring_makeLiteral ("Storage");
-      break;
-    case SK_UNCONSTRAINED:
-      result = cstring_makeLiteral ("");
-      break;
-    case SK_RESULT:
-    case SK_TYPE:
-    case SK_CONST:
-    case SK_EXTERNAL:
-    case SK_DERIVED:
-    case SK_UNKNOWN:
-    case SK_SPECIAL:
-      result = cstring_makeLiteral ("");
-      break;
-    case SK_CONJ:
-      result = cstring_makeLiteral ("");
-      break;
-    }
-  
-  return result;
-}
-
-/*
-** s1 <- s2
-*/
-
-void
-sRef_copyState (sRef s1, sRef s2)
-{
-  if (sRef_isValid (s1) && sRef_isValid (s2))
-    {
-      s1->defstate = s2->defstate;
-      
-      s1->nullstate = s2->nullstate;
-      s1->nullinfo = alinfo_update (s1->nullinfo, s2->nullinfo);
-      
-      /* start modifications */
-      s1->bufinfo.bufstate = s2->bufinfo.bufstate;
-      s1->bufinfo.len = s2->bufinfo.len;
-      s1->bufinfo.size = s2->bufinfo.size;
-      /* end modifications */
-
-      s1->aliaskind = s2->aliaskind;
-      s1->aliasinfo = alinfo_update (s1->aliasinfo, s2->aliasinfo);
-
-      s1->expkind = s2->expkind;
-      s1->expinfo = alinfo_update (s1->expinfo, s2->expinfo);
-
-      s1->safe = s2->safe;
-          }
-}
-
-sRef
-sRef_makeNew (ctype ct, sRef t, cstring name)
-{
-  sRef s = sRef_new ();
-
-  s->kind = SK_NEW;
-  s->type = ct;
-
-  llassert (sRef_isValid (t));
-  s->defstate = t->defstate;
-
-  s->aliaskind = t->aliaskind;
-  s->oaliaskind = s->aliaskind;
-
-  s->nullstate = t->nullstate;
-
-  s->expkind = t->expkind;
-  s->oexpkind = s->expkind;
-
-  s->info = (sinfo) dmalloc (sizeof (*s->info));
-  s->info->fname = name;
-
-  /* start modifications */
-  s->bufinfo.bufstate = t->bufinfo.bufstate;
-  /* end modifications */
-
-    return s;
-}
-
-sRef
-sRef_makeType (ctype ct)
-{
-  sRef s = sRef_new ();
-  
-  s->kind = SK_TYPE;
-  s->type = ct;
-
-  s->defstate = SS_UNKNOWN; 
-  s->aliaskind = AK_UNKNOWN;
-  s->nullstate = NS_UNKNOWN;
-  /* start modification */
-  s->bufinfo.bufstate = BB_NOTNULLTERMINATED;
-  /* end modification */
-
-    
-  if (ctype_isUA (ct))
-    {
-      typeId uid = ctype_typeId (ct);
-      uentry ue = usymtab_getTypeEntrySafe (uid);
-
-      if (uentry_isValid (ue))
-	{
-	  sRef_mergeStateQuiet (s, uentry_getSref (ue));
-	}
-    }
-
-    s->oaliaskind = s->aliaskind;
-  s->oexpkind = s->expkind;
-
-  return s;
-}
-
-sRef
-sRef_makeConst (ctype ct)
-{
-  sRef s = sRef_new ();
-  
-  s->kind = SK_CONST;
-  s->type = ct;
-
-  s->defstate = SS_UNKNOWN;
-  s->aliaskind = AK_UNKNOWN;
-  s->nullstate = NS_UNKNOWN;
-  /* start modification */
-  s->bufinfo.bufstate = BB_NULLTERMINATED;
-  /* end modification */
-
-  
-  if (ctype_isUA (ct))
-    {
-      typeId uid = ctype_typeId (ct);
-      uentry te = usymtab_getTypeEntrySafe (uid);
-      
-      if (uentry_isValid (te))
-	{
-	  sRef_mergeStateQuiet (s, uentry_getSref (te));
-	}
-    }
-
-  
-  s->oaliaskind = s->aliaskind;
-  s->oexpkind = s->expkind;
-
-  return s;
-}
-
-bool sRef_hasName (sRef s)
-{
-  if (sRef_isInvalid (s))
-    {
-      return (FALSE);
-    }
-
-  switch (s->kind)
-    {
-    case SK_CVAR:
-      {
-	uentry u = usymtab_getRefQuiet (s->info->cvar->lexlevel,
-					 s->info->cvar->index);
-	return (uentry_hasName (u));
-      }
-    case SK_PARAM:
-      {
-	uentry u = uentryList_getN (context_getParams (), 
-				    s->info->paramno);
-
-	return (uentry_hasName (u));
-      }
-    default:
-      return TRUE;
-    }
-}
-
-bool sRef_sameObject (sRef s1, sRef s2)
-{
-  return sRef_sameName(s1, s2);
-}
-bool
-sRef_sameName (sRef s1, sRef s2)
-{
-  if (sRef_isInvalid (s1))
-    {
-      return sRef_isInvalid (s2);
-    }
-
-  if (sRef_isInvalid (s2))
-    {
-      return (FALSE);
-    }
-
-  switch (s1->kind)
-    {
-    case SK_CVAR:
-      if (s2->kind == SK_CVAR)
-	{
-	  return (s1->info->cvar->lexlevel == s2->info->cvar->lexlevel
-		  && s1->info->cvar->index == s2->info->cvar->index);
-	}
-      else if (s2->kind == SK_PARAM)
-	{
-	  if (context_inFunctionLike ())
-	    {
-	      uentry u1 = usymtab_getRefQuiet (s1->info->cvar->lexlevel,
-					       s1->info->cvar->index);
-	      uentry u2 = uentryList_getN (context_getParams (), 
-					   s2->info->paramno);
-	  
-	      return (cstring_equalFree (uentry_getName (u1),
-					 uentry_getName (u2)));
-	    }
-	  else 
-	    {
-	      return FALSE;
-	    }
-	}
-      else
-	{
-	  return FALSE;
-	}
-    case SK_PARAM:
-      {
-	if (s2->kind == SK_PARAM)
-	  {
-	    return (s1->info->paramno == s2->info->paramno);
-	  }
-	else if (s2->kind == SK_CVAR)
-	  {
-	    if (context_inFunctionLike ())
-	      {
-		uentry u1 = uentryList_getN (context_getParams (), 
-					     s1->info->paramno);
-		uentry u2 = usymtab_getRefQuiet (s2->info->cvar->lexlevel,
-						 s2->info->cvar->index);
-
-		
-		return (cstring_equalFree (uentry_getName (u1),
-					   uentry_getName (u2)));
-	      }
-	    else 
-	      {
-		return FALSE;
-	      }
-	  }
-	else
-	  {
-	    return FALSE;
-	  }
-      }
-
-    case SK_UNCONSTRAINED:
-      return FALSE;
-
-    case SK_ARRAYFETCH:
-      if (s2->kind == SK_ARRAYFETCH)
-	{
-	  if (bool_equal (s1->info->arrayfetch->indknown,
-			  s2->info->arrayfetch->indknown))
-	    {
-	      if (!s1->info->arrayfetch->indknown 
-		  || (s1->info->arrayfetch->ind == s2->info->arrayfetch->ind))
-		{
-		  return sRef_sameName (s1->info->arrayfetch->arr,
-					s2->info->arrayfetch->arr);
-		}
-	    }
-	}
-
-      return FALSE;
-    case SK_FIELD:
-      if (s2->kind == SK_FIELD)
-	{
-	  if (cstring_equal (s1->info->field->field,
-			     s2->info->field->field))
-	    {
-	      return sRef_sameName (s1->info->field->rec,
-				    s2->info->field->rec);
-	    }
-
-	}
-      return FALSE;
-    case SK_PTR:
-    case SK_ADR:
-    case SK_DERIVED:
-    case SK_EXTERNAL:
-      if (s2->kind == s1->kind)
-	{
-	  return sRef_sameName (s1->info->ref,
-				s2->info->ref);
-	}
-
-      return FALSE;
-    case SK_OBJECT:
-      return FALSE;
-    case SK_CONJ:
-      return sRef_sameName (sRef_getConjA (s1), s2);
-    case SK_NEW:
-      return FALSE;
-    case SK_UNKNOWN:
-      return (s2->kind == SK_UNKNOWN);
-    case SK_TYPE:
-    case SK_CONST:
-      if (s2->kind == s1->kind)
-	{
-	  return (ctype_equal (s1->type, s2->type));
-	}
-      
-      return FALSE;
-    case SK_SPECIAL:
-      if (s2->kind == SK_SPECIAL)
-	{
-	  return (s1->info->spec == s2->info->spec);
-	}
-      return FALSE;
-    case SK_RESULT:
-      return (s2->kind == SK_RESULT);
-    default:
-      return FALSE;
-    }
-  BADEXIT;
-}
-		
-sRef
-sRef_fixOuterRef (/*@returned@*/ sRef s)
-{
-  sRef root = sRef_getRootBase (s);
-
-  if (sRef_isCvar (root))
-    {
-      uentry ue = usymtab_getRefQuiet (root->info->cvar->lexlevel, 
-				       root->info->cvar->index);
-
-      if (uentry_isValid (ue))
-	{
-	  sRef uref = uentry_getSref (ue);
-	  sRef sr = sRef_fixBase (s, uref);
-
-	  return (sr);
-	}
-      else
-	{
-	  llcontbug (message ("sRef_fixOuterRef: undefined: %q", sRef_unparseDebug (s)));
-	  return (s);
-	}
-    }
-
-  return (s);
-}
-
-void
-sRef_storeState (sRef s)
-{
-  if (sRef_isInvalid (s)) return;
-
-  s->oaliaskind = s->aliaskind;
-  s->oexpkind = s->expkind;
-}
-  
-static void sRef_resetStateAux (sRef s, /*@unused@*/ fileloc loc)
-{
-  sRef_resetState (s);
-}
-
-void
-sRef_resetState (sRef s)
-{
-  bool changed = FALSE;
-  if (sRef_isInvalid (s)) return;
-
-  
-  if (s->oaliaskind == AK_KILLREF && !sRef_isParam (s))
-    {
-      /*
-      ** killref is used in a kludgey way, to save having to add
-      ** another alias kind (see usymtab_handleParams)
-      */
- 
-      if (s->expkind != s->oexpkind)
-	{
-	  changed = TRUE;
-	  s->expkind = s->oexpkind;
-	}
-    }
-  else
-    {
-      if (s->expkind != s->oexpkind)
-	{
-	  changed = TRUE;
-	  s->expkind = s->oexpkind;	  
-	}
-
-      if (s->aliaskind != s->oaliaskind
-	  && s->aliaskind != AK_REFCOUNTED
-	  && s->aliaskind != AK_REFS)
-	{
-	  changed = TRUE;
-	  s->aliaskind = s->oaliaskind;
-	  	}
-    }
-
-  if (changed)
-    {
-      sRef_clearDerived (s);
-    }
-  
-  }
-
-void
-sRef_resetStateComplete (sRef s)
-{
-  sRef_innerAliasSetComplete (sRef_resetStateAux, s, fileloc_undefined);
-}
-
-/*@exposed@*/ sRef
-sRef_fixBase (/*@returned@*/ sRef s, /*@returned@*/ sRef base)
-{
-  sRef tmp = sRef_undefined;
-  sRef ret;
-
-  if (sRef_isInvalid (s)) return s;
-  if (sRef_isInvalid (base)) return base;
-
-  switch (s->kind)
-    {
-    case SK_RESULT:
-    case SK_PARAM:
-    case SK_CVAR:
-      ret = base;
-      break;
-    case SK_ARRAYFETCH:
-      tmp = sRef_fixBase (s->info->arrayfetch->arr, base);
-
-      if (s->info->arrayfetch->indknown)
-	{
-	  ret = sRef_makeArrayFetchKnown (tmp, s->info->arrayfetch->ind);
-	}
-      else
-	{
-	  ret = sRef_makeArrayFetch (tmp);
-	}
-      break;
-    case SK_FIELD:
-      tmp = sRef_fixBase (s->info->field->rec, base);
-      ret = sRef_buildNCField (tmp, s->info->field->field);
-      break;
-    case SK_PTR:
-      tmp = sRef_fixBase (s->info->ref, base);
-      ret = sRef_makePointer (tmp);
-      break;
-    case SK_ADR:
-      tmp = sRef_fixBase (s->info->ref, base);
-      ret = sRef_makeAddress (tmp);
-      break;
-    case SK_CONJ:
-      {
-	sRef tmpb;
-
-	tmp = sRef_fixBase (s->info->conj->a, base);
-	tmpb = sRef_fixBase (s->info->conj->b, base);
-
-	ret = sRef_makeConj (tmp, tmpb);
-	break;
-      }
-      BADDEFAULT;
-    }
-
-  return ret;
-}
-
-static /*@exposed@*/ sRef 
-sRef_fixDirectBase (sRef s, sRef base)
-{
-  sRef ret;
-
-  
-  if (sRef_isInvalid (s))
-    {
-            return sRef_undefined;
-    }
-
-  switch (s->kind)
-    {
-    case SK_ARRAYFETCH:
-      if (s->info->arrayfetch->indknown)
-	{
-	  ret = sRef_makeArrayFetchKnown (base, s->info->arrayfetch->ind);
-	}
-      else
-	{
-	  ret = sRef_makeArrayFetch (base);
-	}
-      break;
-    case SK_FIELD:
-      ret = sRef_buildNCField (base, s->info->field->field);
-      break;
-    case SK_PTR:
-            ret = sRef_makePointer (base);
-            break;
-    case SK_ADR:
-      ret = sRef_makeAddress (base);
-      break;
-    case SK_CONJ:
-      {
-	sRef tmpa, tmpb;
-
-	tmpa = sRef_fixDirectBase (s->info->conj->a, base);
-	tmpb = sRef_fixDirectBase (s->info->conj->b, base);
-
-	ret = sRef_makeConj (tmpa, tmpb);
-	break;
-      }
-      BADDEFAULT;
-    }
-
-    sRef_copyState (ret, s);
-    return ret;
-}
-
-bool
-sRef_isAllocIndexRef (sRef s)
-{
-  return (sRef_isArrayFetch (s) && !(s->info->arrayfetch->indknown) 
-	  && sRef_isAllocated (s->info->arrayfetch->arr));
-}
-
-void
-sRef_showRefLost (sRef s)
-{
-  if (sRef_hasAliasInfoLoc (s))
-    {
-      llgenindentmsg (cstring_makeLiteral ("Original reference lost"),
-		sRef_getAliasInfoLoc (s));
-    }
-}
-
-void
-sRef_showRefKilled (sRef s)
-{
-  if (sRef_hasStateInfoLoc (s))
-    {
-      llgenindentmsg (message ("Storage %q released", 
-			       sRef_unparse (s)), sRef_getStateInfoLoc (s));
-    }
-}
-
-void
-sRef_showStateInconsistent (sRef s)
-{
-  if (sRef_hasStateInfoLoc (s))
-    {
-      llgenindentmsg
-	(message ("Storage %qbecomes inconsistent (released on one branch)",
-		  sRef_unparseOpt (s)), 
-	 sRef_getStateInfoLoc (s));
-    }
-}
-
-void
-sRef_showStateInfo (sRef s)
-{
-  if (sRef_hasStateInfoLoc (s))
-    {
-      if (s->defstate == SS_DEAD)
-	{
-	  llgenindentmsg 
-	    (message ("Storage %qis released", sRef_unparseOpt (s)),
-	     sRef_getStateInfoLoc (s));
-	}
-      else if (s->defstate == SS_ALLOCATED || s->defstate == SS_DEFINED)
-	{
-	  llgenindentmsg 
-	    (message ("Storage %qis %s", sRef_unparseOpt (s), 
-		      sstate_unparse (s->defstate)),
-	     sRef_getStateInfoLoc (s));
-	}
-      else if (s->defstate == SS_UNUSEABLE)
-	{
-	  llgenindentmsg 
-	    (message ("Storage %qbecomes inconsistent (clauses merge with"
-		      "%qreleased on one branch)",
-		      sRef_unparseOpt (s), 
-		      sRef_unparseOpt (s)),
-	     sRef_getStateInfoLoc (s));
-	}
-      else 
-	{
-	  llgenindentmsg (message ("Storage %qbecomes %s", 
-				   sRef_unparseOpt (s), 
-				   sstate_unparse (s->defstate)),
-			  sRef_getStateInfoLoc (s));
-	}
-    }
-}
-
-void
-sRef_showExpInfo (sRef s)
-{
-  if (sRef_hasExpInfoLoc (s))
-    {
-      llgenindentmsg (message ("Storage %qbecomes %s", sRef_unparseOpt (s), 
-			       exkind_unparse (s->expkind)),
-		      sRef_getExpInfoLoc (s));
-    }
-}
-
-void
-sRef_showNullInfo (sRef s)
-{
-  if (sRef_hasNullInfoLoc (s) && sRef_isKnown (s))
-    {
-      switch (s->nullstate)
-	{
-	case NS_CONSTNULL:
-	  {
-	    fileloc loc = sRef_getNullInfoLoc (s);
-	    
-	    if (fileloc_isDefined (loc) && !fileloc_isLib (loc))
-	      {
-		llgenindentmsg 
-		  (message ("Storage %qbecomes null", sRef_unparseOpt (s)),
-		   loc);
-	      }
-	    break;
-	  }
-	case NS_DEFNULL:
-	  {
-	    fileloc loc = sRef_getNullInfoLoc (s);
-	    
-	    if (fileloc_isDefined (loc) && !fileloc_isLib (loc))
-	      {
-		llgenindentmsg (message ("Storage %qbecomes null", sRef_unparseOpt (s)),
-				loc);
-	      }
-	    break;
-	  }
-	case NS_ABSNULL:
-	case NS_POSNULL:
-	  llgenindentmsg
-	    (message ("Storage %qmay become null", sRef_unparseOpt (s)),
-	     sRef_getNullInfoLoc (s));
-	  break;
-	case NS_NOTNULL:
-	case NS_MNOTNULL:
-	  llgenindentmsg
-	    (message ("Storage %qbecomes not null", sRef_unparseOpt (s)),
-	     sRef_getNullInfoLoc (s));
-	  break;
-	case NS_UNKNOWN:
-	  llgenindentmsg
-	    (message ("Storage %qnull state becomes unknown",
-		      sRef_unparseOpt (s)),
-	     sRef_getNullInfoLoc (s));
-	  break;
-
-	case NS_ERROR:
-	  BADBRANCHCONT;
-	  break;
-
-	default:
-	  llgenindentmsg
-	    (message (" Storage %q becomes %s",
-		      sRef_unparse (s), 
-		      nstate_unparse (s->nullstate)),
-	     sRef_getNullInfoLoc (s));
-	  
-	  break;
-	}
-    }
-}
-
-void
-sRef_showAliasInfo (sRef s)
-{
-  if (sRef_hasAliasInfoLoc (s))
-    {
-      if (sRef_isFresh (s))
-	{
-	  llgenindentmsg 
-	    (message ("Fresh storage %qallocated", sRef_unparseOpt (s)),
-	     sRef_getAliasInfoLoc (s));
-	}
-      else 
-	{
-	  if (!sRef_isRefCounted (s))
-	    {
-	      llgenindentmsg 
-		(message ("Storage %qbecomes %s", 
-			  sRef_unparseOpt (s),
-			  alkind_unparse (sRef_getAliasKind (s))),
-		 sRef_getAliasInfoLoc (s));
-	    }
-	}
-    }
-}
-
-void
-sRef_mergeNullState (sRef s, nstate n)
-{
-  if (sRef_isValid (s))
-    {
-      nstate old;
-      
-      old = s->nullstate;
-      
-      if (n != old && n != NS_UNKNOWN)
-	{
-	  	  
-	  s->nullstate = n;
-	  s->nullinfo = alinfo_updateLoc (s->nullinfo, g_currentloc);
-	}
-    }
-  else
-    {
-      llbuglit ("sRef_mergeNullState: invalid");
-    }
-}
-
-bool
-sRef_possiblyNull (sRef s)
-{
-  if (sRef_isValid (s))
-    {
-      if (s->nullstate == NS_ABSNULL)
-	{
-	  ctype rct = ctype_realType (s->type);
-
-	  if (ctype_isAbstract (rct))
-	    {
-	      return FALSE;
-	    }
-	  else
-	    {
-	      if (ctype_isUser (rct))
-		{
-		  uentry ue = usymtab_getTypeEntry (ctype_typeId (rct));
-		  
-		  return (nstate_possiblyNull
-			  (sRef_getNullState (uentry_getSref (ue))));
-		}
-	      else
-		{
-		  return FALSE;
-		}
-	    }
-	}
-      else
-	{
-	  return nstate_possiblyNull (s->nullstate);
-	}
-    }
-
-  return FALSE;
-}
-
-cstring
-sRef_getScopeName (sRef s)
-{
-  sRef base = sRef_getRootBase (s);
-
-  if (sRef_isRealGlobal (base))
-    {
-      return (cstring_makeLiteralTemp ("Global"));
-    }
-  else if (sRef_isFileStatic (base))
-    {
-      return (cstring_makeLiteralTemp ("Static"));
-    }
-  else
-    {
-      return (cstring_makeLiteralTemp ("Local"));
-    }
-}
-
-cstring
-sRef_unparseScope (sRef s)
-{
-  sRef base = sRef_getRootBase (s);
-
-  if (sRef_isRealGlobal (base))
-    {
-      return (cstring_makeLiteralTemp ("global"));
-    }
-  else if (sRef_isFileStatic (base))
-    {
-      return (cstring_makeLiteralTemp ("file static"));
-    }
-  else
-    {
-      BADEXIT;
-    }
-}
-
-int
-sRef_getScope (sRef s)
-{
-  llassert (sRef_isValid (s));
-
-  if (sRef_isCvar (s))
-    {
-      return s->info->cvar->lexlevel;
-    }
-  else if (sRef_isParam (s))
-    {
-      return paramsScope;
-    }
-  else
-    {
-      return fileScope;
-    }
-}
-
-bool
-sRef_isDead (sRef s)
-{
-  return (sRef_isValid (s) && (s)->defstate == SS_DEAD);
-}
-
-bool
-sRef_isDeadStorage (sRef s)
-{
-  if (sRef_isValid (s))
-    {
-      if (s->defstate == SS_DEAD
-	  || s->defstate == SS_UNUSEABLE
-	  || s->defstate == SS_UNDEFINED
-	  || s->defstate == SS_UNKNOWN)
-	{
-	  return TRUE;
-	}
-      else 
-	{
-	  return (sRef_isDefinitelyNull (s));
-	}
-    }
-  else
-    {
-      return FALSE;
-    }
-}
-
-bool
-sRef_isPossiblyDead (sRef s)
-{
-  return (sRef_isValid (s) && s->defstate == SS_HOFFA);
-}
-
-bool sRef_isStateLive (sRef s)
-{
-  if (sRef_isValid (s))
-    {
-      sstate ds = s->defstate;
-
-      return (!(ds == SS_UNDEFINED 
-		|| ds == SS_DEAD
-		|| ds == SS_UNUSEABLE
-		|| ds == SS_HOFFA));
-    }
-  else
-    {
-      return FALSE;
-    }
-}
-
-
-bool sRef_isStateUndefined (sRef s)
-{
-  return ((sRef_isValid(s)) && ((s)->defstate == SS_UNDEFINED));
-}
-
-bool sRef_isJustAllocated (sRef s)
-{
-  if (sRef_isAllocated (s))
-    {
-      sRefSet_allElements (s->deriv, el)
-	{
-	  if (!(sRef_isStateUndefined (el) || sRef_isUnuseable (el)))
-	    {
-	      return FALSE;
-	    }
-	} end_sRefSet_allElements ;
-
-      return TRUE;
-    }
-
-  return FALSE;
-}
-
-static bool
-sRef_isAllocatedStorage (sRef s)
-{
-  if (sRef_isValid (s) && ynm_toBoolStrict (sRef_isReadable (s)))
-    {
-      return (ctype_isVisiblySharable (sRef_getType (s)));
-    }
-  else
-    {
-      return FALSE;
-    }
-}
-
-bool
-sRef_isUnuseable (sRef s)
-{
-  return ((sRef_isValid(s)) && ((s)->defstate == SS_UNUSEABLE));
-}
-
-bool
-sRef_perhapsNull (sRef s)
-{
-  if (sRef_isValid (s))
-    {
-      if (s->nullstate == NS_ABSNULL)
-	{
-	  ctype rct = ctype_realType (s->type);
-
-	  if (ctype_isAbstract (rct))
-	    {
-	      return FALSE;
-	    }
-	  else
-	    {
-	      if (ctype_isUser (rct))
-		{
-		  uentry ue = usymtab_getTypeEntry (ctype_typeId (rct));
-
-		  return (nstate_perhapsNull 
-			  (sRef_getNullState (uentry_getSref (ue))));
-		}
-	      else
-		{
-		  return FALSE;
-		}
-	    }
-	}
-      else
-	{
-	  return nstate_perhapsNull (s->nullstate);
-	}
-    }
-
-  return FALSE;
-}
-
-/*
-** definitelyNull --- called when TRUE is good
-*/
-
-bool 
-sRef_definitelyNull (sRef s)
-{
-  return (sRef_isValid (s)
-	  && (s->nullstate == NS_DEFNULL || s->nullstate == NS_CONSTNULL));
-}
-
-/*
-** based on sRef_similar
-*/
-
-void
-sRef_setDerivNullState (sRef set, sRef guide, nstate ns)
-{
-  if (sRef_isValid (set))
-    {
-      sRef deriv = sRef_getDeriv (set, guide);
-      
-      if (sRef_isValid (deriv))
-	{
-	  deriv->nullstate = ns;
-	}
-    }
-}
-
-static /*@exposed@*/ sRef
-sRef_getDeriv (/*@returned@*/ /*@notnull@*/ sRef set, sRef guide)
-{
-  llassert (sRef_isValid (set));
-  llassert (sRef_isValid (guide));
-
-  switch (guide->kind)
-    {
-    case SK_CVAR:
-      llassert (set->kind == SK_CVAR);
-      
-      return set;
-
-    case SK_PARAM:
-      llassert (set->kind == guide->kind);
-      llassert (set->info->paramno == guide->info->paramno);
-
-      return set;
-
-    case SK_ARRAYFETCH:
-
-      if (set->kind == SK_ARRAYFETCH
-	  && (sRef_similar (set->info->arrayfetch->arr,
-			    guide->info->arrayfetch->arr)))
-	{
-	  return set;
-	}
-      else
-	{
-	  return (sRef_makeAnyArrayFetch 
-		  (sRef_getDeriv (set, guide->info->arrayfetch->arr)));
-	}
-
-    case SK_PTR:
-      
-      if (set->kind == SK_PTR && sRef_similar (set->info->ref, guide->info->ref))
-	{
-	  return set;
-	}
-      else
-	{
-	  return (sRef_makePointer (sRef_getDeriv (set, guide->info->ref)));
-	}
-      
-    case SK_FIELD:
-      
-      if ((set->kind == SK_FIELD &&
-	   (sRef_similar (set->info->field->rec, guide->info->field->rec) &&
-	    cstring_equal (set->info->field->field, guide->info->field->field))))
-	{
-	  return set;
-	}
-      else
-	{
-	  return (sRef_makeField (sRef_getDeriv (set, guide->info->field->rec),
-				  guide->info->field->field));
-	}
-    case SK_ADR:
-      
-      if ((set->kind == SK_ADR) && sRef_similar (set->info->ref, guide->info->ref))
-	{
-	  return set;
-	}
-      else
-	{
-	  return (sRef_makeAddress (sRef_getDeriv (set, guide->info->ref)));
-	}
-
-    case SK_CONJ:
-      
-            return sRef_undefined;
-
-    case SK_RESULT:
-    case SK_SPECIAL:
-    case SK_UNCONSTRAINED:
-    case SK_TYPE:
-    case SK_CONST:
-    case SK_NEW:
-    case SK_UNKNOWN:
-    case SK_OBJECT:
-    case SK_DERIVED:
-    case SK_EXTERNAL:
-      return sRef_undefined;
-    }
-
-  BADEXIT;
-}
-      
-/*
-** sRef_aliasCheckPred
-**
-** A confusing but spiffy function:
-**
-**    Calls predf (s, e, text, ) on s and all of s's aliases
-**    (unless checkAliases (s) is FALSE).
-**
-**    For alias calls, calls as
-**          predf (alias, e, text, s)
-*/
-
-void
-sRef_aliasCheckPred (bool (predf) (sRef, exprNode, sRef, exprNode),
-		     /*@null@*/ bool (checkAliases) (sRef),
-		     sRef s, exprNode e, exprNode err)
-{
-  bool error = (*predf)(s, e, sRef_undefined, err);
-  
-  
-  if (checkAliases != NULL && !(checkAliases (s)))
-    {
-      /* don't check aliases */
-    }
-  else
-    {
-      sRefSet aliases = usymtab_allAliases (s);
-
-      
-      sRefSet_realElements (aliases, current)
-	{
-	  if (sRef_isValid (current))
-	    {
-	      if (!sRef_similar (current, s)
-		  || (error && sRef_sameName (current, s)))
-		{
-		  (void) (*predf)(current, e, s, err);
-		}
-	      }
-	} end_sRefSet_realElements;
-
-      sRefSet_free (aliases);
-    }
-}
-
-/*
-** return TRUE iff predf (s) is true for s or any alias of s
-*/
-
-bool
-sRef_aliasCheckSimplePred (sRefTest predf, sRef s)
-{
-    
-  if ((*predf)(s))
-    {
-      return TRUE;
-    }
-  else
-    {
-      sRefSet aliases;
-
-      aliases = usymtab_allAliases (s);
-      
-      sRefSet_realElements (aliases, current)
-	{
-	  if (sRef_isValid (current))
-	    {
-	      sRef cref = sRef_updateSref (current);
-	      
-	      /* Whoa! a very kludgey way to make sure the right sref is used
-	      ** where there is a conditional symbol table.  I am beginning
-	      ** to think that having a conditional symbol table wasn't such
-	      ** a great idea.  ;(
-	      */
-	      
-	      	      
-	      if ((*predf)(cref))
-		{
-		  sRefSet_free (aliases);
-		  return TRUE;
-		}
-	    }
-	} end_sRefSet_realElements;
-
-      sRefSet_free (aliases);
-    }
-  return FALSE;
-}
-
-bool
-sRef_aliasCompleteSimplePred (bool (predf) (sRef), sRef s)
-{
-  sRefSet aliases;
-  bool result = FALSE;
-  
-  
-  aliases = usymtab_allAliases (s);
-  
-  if ((*predf)(s)) result = TRUE;
-
-  
-  sRefSet_realElements (aliases, current)
-    {
-      if (sRef_isValid (current))
-	{
-	  	  current = sRef_updateSref (current);
-	  	  if ((*predf)(current)) result = TRUE;
-	}
-    } end_sRefSet_realElements;
-  
-  sRefSet_free (aliases);
-  return result;
-}
-
-static void
-sRef_aliasSetComplete (void (predf) (sRef, fileloc), sRef s, fileloc loc)
-{
-  sRefSet aliases;
-  
-  aliases = usymtab_allAliases (s);
-
-  (*predf)(s, loc);
-
-  sRefSet_realElements (aliases, current)
-    {
-      if (sRef_isValid (current))
-	{
-	  current = sRef_updateSref (current);
-	  	  ((*predf)(current, loc));
-	}
-    } end_sRefSet_realElements;
-
-  sRefSet_free (aliases);
-}
-
-static void
-sRef_aliasSetCompleteParam (void (predf) (sRef, alkind, fileloc), sRef s, 
-			    alkind kind, fileloc loc)
-{
-  sRefSet aliases;
-
-  
-  if (sRef_isDeep (s))
-    {
-      aliases = usymtab_allAliases (s);
-    }
-  else
-    {
-      aliases = usymtab_aliasedBy (s);
-    }
-
-  (*predf)(s, kind, loc);
-
-  sRefSet_realElements (aliases, current)
-    {
-      if (sRef_isValid (current))
-	{
-	  current = sRef_updateSref (current);
-	  	  ((*predf)(current, kind, loc));
-	}
-    } end_sRefSet_realElements;
-
-  sRefSet_free (aliases);
-}
-
-static void
-sRef_innerAliasSetComplete (void (predf) (sRef, fileloc), sRef s, fileloc loc)
-{
-  sRef inner;
-  sRefSet aliases;
-  ctype ct;
-
-  if (!sRef_isValid (s)) return;
-
-  
-  /*
-  ** Type equivalence checking is necessary --- there might be casting.
-  */
-
-  (*predf)(s, loc);
-
-  switch (s->kind)
-    {
-    case SK_UNCONSTRAINED:
-    case SK_CVAR:
-    case SK_PARAM:
-      break;
-    case SK_PTR:
-      inner = s->info->ref;
-      aliases = usymtab_allAliases (inner);
-      ct = sRef_getType (inner);
-
-      
-      sRefSet_realElements (aliases, current)
-	{
-	  if (sRef_isValid (current))
-	    {
-	      current = sRef_updateSref (current);
-	      
-	      if (ctype_equal (ct, sRef_getType (current)))
-		{
-		  sRef ptr = sRef_makePointer (current);
-		  
-		  ((*predf)(ptr, loc));
-		}
-	    }
-	} end_sRefSet_realElements;
-
-      sRefSet_free (aliases);
-      break;
-    case SK_ARRAYFETCH:
-      inner = s->info->arrayfetch->arr;
-      aliases = usymtab_allAliases (inner);
-      ct = sRef_getType (inner);
-
-      sRefSet_realElements (aliases, current)
-	{
-	  if (sRef_isValid (current))
-	    {
-	      current = sRef_updateSref (current);
-	      
-	      if (ctype_equal (ct, sRef_getType (current)))
-		{
-		  		  
-		  if (s->info->arrayfetch->indknown)
-		    {
-		      sRef af = sRef_makeArrayFetchKnown (current, s->info->arrayfetch->ind);
-		      
-		      ((*predf)(af, loc));
-		    }
-		  else
-		    {
-		      sRef af = sRef_makeArrayFetch (current);
-		      
-		      ((*predf)(af, loc));
-		    }
-		}
-	    }
-	} end_sRefSet_realElements;
-
-      sRefSet_free (aliases);
-      break;
-    case SK_FIELD:
-      inner = s->info->field->rec;
-      aliases = usymtab_allAliases (inner);
-      ct = sRef_getType (inner);
-
-      
-      sRefSet_realElements (aliases, current)
-	{
-	  if (sRef_isValid (current))
-	    {
-	      current = sRef_updateSref (current);
-	      
-	      if (ctype_equal (ct, sRef_getType (current)))
-		{
-		  sRef f = sRef_makeField (current, s->info->field->field);
-		  
-		  ((*predf)(f, loc));
-		}
-	    }
-	} end_sRefSet_realElements;
-      
-      sRefSet_free (aliases);
-      break;
-    case SK_CONJ:
-      sRef_innerAliasSetComplete (predf, s->info->conj->a, loc);
-      sRef_innerAliasSetComplete (predf, s->info->conj->b, loc);
-      break;
-    case SK_SPECIAL:
-    case SK_ADR:
-    case SK_TYPE:
-    case SK_CONST:
-    case SK_NEW:
-    case SK_UNKNOWN:
-    case SK_OBJECT:
-    case SK_DERIVED:
-    case SK_EXTERNAL:
-    case SK_RESULT:
-      break;
-    }
-}
-
-static void
-sRef_innerAliasSetCompleteParam (void (predf) (sRef, sRef), sRef s, sRef t)
-{
-  sRef inner;
-  sRefSet aliases;
-  ctype ct;
-
-  if (!sRef_isValid (s)) return;
-
-  
-  /*
-  ** Type equivalence checking is necessary --- there might be casting.
-  */
-
-  (*predf)(s, t);
-
-  switch (s->kind)
-    {
-    case SK_UNCONSTRAINED:
-    case SK_CVAR:
-    case SK_PARAM:
-      break;
-    case SK_PTR:
-      inner = s->info->ref;
-      aliases = usymtab_allAliases (inner);
-      ct = sRef_getType (inner);
-      
-      
-      sRefSet_realElements (aliases, current)
-	{
-	  if (sRef_isValid (current))
-	    {
-	      current = sRef_updateSref (current);
-	      
-	      if (ctype_equal (ct, sRef_getType (current)))
-		{
-		  sRef ptr = sRef_makePointer (current);
-		  
-		  ((*predf)(ptr, t));
-		}
-	    }
-	} end_sRefSet_realElements;
-
-      sRefSet_free (aliases);
-      break;
-    case SK_ARRAYFETCH:
-      inner = s->info->arrayfetch->arr;
-      aliases = usymtab_allAliases (inner);
-      ct = sRef_getType (inner);
-
-      sRefSet_realElements (aliases, current)
-	{
-	  if (sRef_isValid (current))
-	    {
-	      current = sRef_updateSref (current);
-	      
-	      if (ctype_equal (ct, sRef_getType (current)))
-		{
-		  		  
-		  if (s->info->arrayfetch->indknown)
-		    {
-		      sRef af = sRef_makeArrayFetchKnown (current, s->info->arrayfetch->ind);
-		      
-		      ((*predf)(af, t));
-		    }
-		  else
-		    {
-		      sRef af = sRef_makeArrayFetch (current);
-		      
-		      ((*predf)(af, t));
-		    }
-		}
-	    }
-	} end_sRefSet_realElements;
-
-      sRefSet_free (aliases);
-      break;
-    case SK_FIELD:
-      inner = s->info->field->rec;
-      aliases = usymtab_allAliases (inner);
-      ct = sRef_getType (inner);
-
-      
-      sRefSet_realElements (aliases, current)
-	{
-	  if (sRef_isValid (current))
-	    {
-	      current = sRef_updateSref (current);
-	      
-	      if (ctype_equal (ct, sRef_getType (current)))
-		{
-		  sRef f = sRef_makeField (current, s->info->field->field);
-		  
-		  ((*predf)(f, t));
-		}
-	    }
-	} end_sRefSet_realElements;
-      
-      sRefSet_free (aliases);
-      break;
-    case SK_CONJ:
-      sRef_innerAliasSetCompleteParam (predf, s->info->conj->a, t);
-      sRef_innerAliasSetCompleteParam (predf, s->info->conj->b, t);
-      break;
-    case SK_SPECIAL:
-    case SK_ADR:
-    case SK_TYPE:
-    case SK_CONST:
-    case SK_NEW:
-    case SK_UNKNOWN:
-    case SK_OBJECT:
-    case SK_DERIVED:
-    case SK_EXTERNAL:
-    case SK_RESULT:
-      break;
-    }
-}
-
-static void sRef_combineExKinds (/*@notnull@*/ sRef res, /*@notnull@*/ sRef other)
-{
-  exkind a1 = sRef_getExKind (res);
-  exkind a2 = sRef_getExKind (other);
-
-  if (a1 == a2 || a2 == XO_UNKNOWN) 
-    {
-      ;
-    }
-  else if (a1 == XO_UNKNOWN) 
-    { 
-      res->expinfo = alinfo_update (res->expinfo, other->expinfo);
-      res->expkind = a2;
-    }
-  else
-    {
-      res->expkind = XO_OBSERVER;
-    }
-}
-
-/*
-** Currently, this is a very ad hoc implementation, with lots of fixes to
-** make real code work okay.  I need to come up with some more general
-** rules or principles here.
-*/
-
-static void 
-  sRef_combineAliasKindsError (/*@notnull@*/ sRef res, 
-			       /*@notnull@*/ sRef other, 
-			       clause cl, fileloc loc)
-{
-  bool hasError = FALSE;
-  alkind ares = sRef_getAliasKind (res);
-  alkind aother = sRef_getAliasKind (other);
-
-  if (alkind_isDependent (ares))
-    {
-      if (aother == AK_KEPT)
-	{
-	  res->aliasinfo = alinfo_update (res->aliasinfo, other->aliasinfo);
-	  res->aliaskind = AK_KEPT;      
-	}
-      else 
-	{
-	  if (aother == AK_LOCAL || aother == AK_STATIC 
-	      || alkind_isTemp (aother))
-	    {
-	      res->aliaskind = AK_DEPENDENT;
-	    }
-	}
-    }
-  else if (alkind_isDependent (aother))
-    {
-      if (ares == AK_KEPT)
-	{
-	  res->aliaskind = AK_KEPT;      
-	}
-      else 
-	{
-	  if (ares == AK_LOCAL || ares == AK_STATIC || alkind_isTemp (ares))
-	    {
-	      res->aliasinfo = alinfo_update (res->aliasinfo, other->aliasinfo);
-	      res->aliaskind = AK_DEPENDENT;
-	    }
-	}
-    }
-  else if ((ares == AK_LOCAL || ares == AK_UNIQUE
-	    || ares == AK_STATIC || alkind_isTemp (ares))
-	   && sRef_isFresh (other))
-    {
-      /*
-      ** cases like: if (s == NULL) s = malloc...;
-      **    don't generate errors
-      */
-      
-      if (usymtab_isAltProbablyDeepNull (res))
-	{
-	  res->aliaskind = ares;
-	}
-      else
-	{
-	  hasError = TRUE; 
-	}
-    }
-  else if ((aother == AK_LOCAL || aother == AK_UNIQUE
-	    || aother == AK_STATIC || alkind_isTemp (aother))
-	   && sRef_isFresh (res))
-    {
-      /*
-      ** cases like: if (s == NULL) s = malloc...;
-      **    don't generate errors
-      */
-      
-      if (usymtab_isProbableDeepNull (other))
-	{
-	  res->aliasinfo = alinfo_update (res->aliasinfo, other->aliasinfo);
-	  res->aliaskind = aother;
-	}
-      else
-	{
-	  hasError = TRUE;
-	}
-    }
-  else if (ares == AK_NEWREF && aother == AK_REFCOUNTED 
-	   && sRef_isConst (other))
-    {
-      res->aliaskind = AK_NEWREF;
-    }
-  else if (aother == AK_NEWREF && ares == AK_REFCOUNTED
-	   && sRef_isConst (res))
-    {
-      res->aliasinfo = alinfo_update (res->aliasinfo, other->aliasinfo);
-      res->aliaskind = AK_NEWREF;
-    }
-  else if (sRef_isLocalVar (res)
-	   && ((ares == AK_KEPT && aother == AK_LOCAL)
-	       || (aother == AK_KEPT && ares == AK_LOCAL)))
-    {
-      res->aliaskind = AK_KEPT;
-    }
-  else
-    {
-      hasError = TRUE;
-    }
-
-  if (hasError)
-    {
-      if (sRef_isThroughArrayFetch (res))
-	{
-	  if (optgenerror2 
-	      (FLG_BRANCHSTATE, FLG_STRICTBRANCHSTATE,
-	       message
-	       ("Clauses exit with %q possibly referencing %s storage %s, "
-		"%s storage %s", 
-		sRef_unparse (res),
-		alkind_unparse (aother),
-		clause_nameTaken (cl),
-		alkind_unparse (ares),
-		clause_nameAlternate (cl)),
-	       loc))
-	    {
-	      sRef_showAliasInfo (res);
-	      sRef_showAliasInfo (other);
-	      res->aliaskind = AK_ERROR;
-	    }
-	  else
-	    {
-	      if (ares == AK_KEPT || aother == AK_KEPT)
-		{
-		  sRef_maybeKill (res, loc);
-		  		}
-	    }
-	}
-      else 
-	{
-	  if (optgenerror 
-	      (FLG_BRANCHSTATE,
-	       message ("Clauses exit with %q referencing %s storage %s, "
-			"%s storage %s", 
-			sRef_unparse (res),
-			alkind_unparse (aother),
-			clause_nameTaken (cl),
-			alkind_unparse (ares),
-			clause_nameAlternate (cl)),
-	       loc))
-	    {
-	      sRef_showAliasInfo (res);
-	      sRef_showAliasInfo (other);
-	      
-	      res->aliaskind = AK_ERROR;
-	    }
-	}
-      
-      res->aliaskind = (sRef_isLocalVar (res) ? AK_LOCAL : AK_UNKNOWN);
-    }
-}
-
-static void 
-  sRef_combineAliasKinds (/*@notnull@*/ sRef res, /*@notnull@*/ sRef other, 
-			  clause cl, fileloc loc)
-{
-  alkind ares = sRef_getAliasKind (res);
-  alkind aother = sRef_getAliasKind (other);
-
-  if (alkind_equal (ares, aother)
-      || aother == AK_UNKNOWN
-      || aother == AK_ERROR)
-    {
-      ; /* keep current state */
-    }
-  else if (sRef_isDead (res) || sRef_isDead (other))
-    {
-      /* dead error reported (or storage is dead) */
-      res ->aliaskind = AK_ERROR; 
-    }
-  else if (ares == AK_UNKNOWN || ares == AK_ERROR
-	   || sRef_isStateUndefined (res))
-    { 
-      res->aliasinfo = alinfo_update (res->aliasinfo, other->aliasinfo);
-      res->aliaskind = aother;  
-    }
-  else if (sRef_isStateUndefined (other))
-    {
-      ;
-    }
-  else if (((ares == AK_UNIQUE || alkind_isTemp (ares))
-	    && aother == AK_LOCAL) 
-	   || ((aother == AK_UNIQUE || alkind_isTemp (aother))
-	       && ares == AK_LOCAL))
-    {
-      if (ares != AK_LOCAL)
-	{
-	  res->aliasinfo = alinfo_update (res->aliasinfo, other->aliasinfo);
-	}
-
-      res->aliaskind = AK_LOCAL;
-    }
-  else if ((ares == AK_OWNED && aother == AK_FRESH) 
-	   || (aother == AK_OWNED && ares == AK_FRESH))
-    {
-      if (ares != AK_FRESH)
-	{
-	  res->aliasinfo = alinfo_update (res->aliasinfo, other->aliasinfo);
-	}
-      
-      res->aliaskind = AK_FRESH;
-    }
-  else if ((ares == AK_KEEP && aother == AK_FRESH) ||
-	   (aother == AK_KEEP && ares == AK_FRESH))
-    {
-      if (ares != AK_KEEP)
-	{
-	  res->aliasinfo = alinfo_update (res->aliasinfo, other->aliasinfo);
-	}
-      
-      res->aliaskind = AK_KEEP;
-    }
-  else if ((ares == AK_LOCAL && aother == AK_STACK) ||
-	   (aother == AK_LOCAL && ares == AK_STACK))
-    {
-      if (ares != AK_STACK)
-	{
-	  res->aliasinfo = alinfo_update (res->aliasinfo, other->aliasinfo);
-	}
-
-      res->aliaskind = AK_STACK;
-    }
-  else if ((ares == AK_LOCAL
-	    && (aother == AK_OWNED && sRef_isLocalVar (other)))
-	   || (aother == AK_LOCAL 
-	       && (ares == AK_OWNED && sRef_isLocalVar (res))))
-    {
-      if (ares != AK_LOCAL)
-	{
-	  res->aliasinfo = alinfo_update (res->aliasinfo, other->aliasinfo);
-	}
-
-      res->aliaskind = AK_LOCAL;
-    }
-  else if ((ares == AK_FRESH && alkind_isOnly (aother))
-	   || (aother == AK_FRESH && alkind_isOnly (ares)))
-    {
-      res->aliaskind = AK_FRESH;
-    }
-  else if ((aother == AK_FRESH && sRef_definitelyNull (res))
-	   || (ares == AK_FRESH && sRef_definitelyNull (other)))
-    {
-      if (ares != AK_FRESH)
-	{
-	  res->aliasinfo = alinfo_update (res->aliasinfo, other->aliasinfo);
-	  res->aliaskind = AK_FRESH;
-	}
-    }
-  else if ((sRef_isFresh (res) && sRef_isConst (other))
-	   || (sRef_isFresh (other) && sRef_isConst (res)))
-    {
-      /*
-      ** for NULL constantants
-      ** this is bogus!
-      */
-
-      if (!sRef_isFresh (res))
-	{
-	  res->aliasinfo = alinfo_update (res->aliasinfo, other->aliasinfo);
-	}
-
-      res->aliaskind = AK_FRESH;
-    }
-  else if ((alkind_isStatic (aother) && sRef_isConst (res))
-	   || (alkind_isStatic (ares) && sRef_isConst (other)))
-    {
-      if (!alkind_isStatic (ares))
-	{
-	  res->aliasinfo = alinfo_update (res->aliasinfo, other->aliasinfo);
-	  res->aliaskind = AK_STATIC;
-	}
-    }
-  else
-    {
-      sRef_combineAliasKindsError (res, other, cl, loc);
-    }
-}
-
-static void sRef_combineDefState (/*@notnull@*/ sRef res, 
-				  /*@notnull@*/ sRef other)
-{
-  sstate s1 = res->defstate;
-  sstate s2 = other->defstate;
-  bool flip = FALSE;
-
-  if (s1 == s2 || s2 == SS_UNKNOWN)
-    {
-      ;
-    }
-  else if (s1 == SS_UNKNOWN)
-    {
-      flip = TRUE;
-    }
-  else
-    {
-      switch (s1)
-	{
-	case SS_FIXED:   
-	  if (s2 == SS_DEFINED) 
-	    {
-	      break;
-	    }
-	  else
-	    {
-	      llcontbuglit ("ssfixed: not implemented");
-	      flip = TRUE;
-	    }
-	  break;
-	case SS_DEFINED: 
-	  flip = TRUE;
-	  break;
-	case SS_PDEFINED:
-	case SS_ALLOCATED: 
-	  flip = (s2 != SS_DEFINED);
-	  break;
-	case SS_HOFFA:
-	case SS_RELDEF:
-	case SS_UNUSEABLE: 
-	case SS_UNDEFINED: 
-	case SS_PARTIAL:
-	case SS_UNDEFGLOB:
-	case SS_KILLED:
-	case SS_DEAD:      
-	case SS_SPECIAL: 
-	  break;
-	BADDEFAULT;
-	}
-    }
-
-  if (flip)
-    {
-      res->definfo = alinfo_update (res->definfo, other->definfo);
-      res->defstate = s2;
-    }
-}
-
-extern /*@notnull@*/ sRef sRef_getConjA (sRef s)
-{
-  sRef ret;
-  llassert (sRef_isConj (s));
-
-  ret = s->info->conj->a;
-  llassert (ret != NULL);
-  return ret;
-}
-
-extern /*@notnull@*/ sRef sRef_getConjB (sRef s)
-{
-  sRef ret;
-  llassert (sRef_isConj (s));
-
-  ret = s->info->conj->b;
-  llassert (ret != NULL);
-  return ret;
-}
-  
-extern /*@exposed@*/ sRef sRef_makeArrow (sRef s, /*@dependent@*/ cstring f)
-{
-  sRef p;
-  sRef ret;
-
-    p = sRef_makePointer (s);
-  ret = sRef_makeField (p, f);
-    return ret;
-}
-
-extern /*@exposed@*/ sRef sRef_buildArrow (sRef s, cstring f)
-{
-  sRef p;
-  sRef ret;
-
-  p = sRef_buildPointer (s);
-  ret = sRef_buildField (p, f);
-  
-  return ret;
-}
-
-static /*@null@*/ sinfo sinfo_copy (/*@notnull@*/ sRef s)
-{
-  sinfo ret;
-
-  switch (s->kind)
-    {
-    case SK_CVAR:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->cvar = (cref) dmalloc (sizeof (*ret->cvar));
-      ret->cvar->lexlevel = s->info->cvar->lexlevel; 
-      ret->cvar->index = s->info->cvar->index; 
-      break;
-
-    case SK_PARAM:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->paramno = s->info->paramno; 
-      break;
-
-    case SK_ARRAYFETCH:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->arrayfetch = (ainfo) dmalloc (sizeof (*ret->arrayfetch));
-      ret->arrayfetch->indknown = s->info->arrayfetch->indknown;
-      ret->arrayfetch->ind = s->info->arrayfetch->ind;
-      ret->arrayfetch->arr = s->info->arrayfetch->arr;
-      break;
-
-    case SK_FIELD:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->field = (fldinfo) dmalloc (sizeof (*ret->field));
-      ret->field->rec = s->info->field->rec;
-      ret->field->field = s->info->field->field; 
-      break;
-
-    case SK_OBJECT:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->object = s->info->object;
-      break;
-
-    case SK_PTR:
-    case SK_ADR:
-    case SK_DERIVED:
-    case SK_EXTERNAL:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->ref = s->info->ref;	 
-      break;
-
-    case SK_CONJ:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->conj = (cjinfo) dmalloc (sizeof (*ret->conj));
-      ret->conj->a = s->info->conj->a;
-      ret->conj->b = s->info->conj->b;
-      break;
-    case SK_SPECIAL:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->spec = s->info->spec;
-      break;
-    case SK_UNCONSTRAINED:
-    case SK_NEW:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->fname = s->info->fname;
-      break;
-    case SK_RESULT:
-    case SK_CONST:
-    case SK_TYPE:
-    case SK_UNKNOWN:
-      llassertprint (s->info == NULL, ("s = %s", sRef_unparse (s)));
-      ret = NULL;
-      break;
-    }
-
-  return ret;
-}
-
-static /*@null@*/ sinfo sinfo_fullCopy (/*@notnull@*/ sRef s)
-{
-  sinfo ret;
-
-  /*
-  ** Since its a full copy, only storage is assigned
-  ** to dependent fields.
-  */
-  /*@-onlytrans@*/
-
-  switch (s->kind)
-    {
-    case SK_CVAR:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->cvar = (cref) dmalloc (sizeof (*ret->cvar));
-      ret->cvar->lexlevel = s->info->cvar->lexlevel; 
-      ret->cvar->index = s->info->cvar->index; 
-      break;
-
-    case SK_PARAM:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->paramno = s->info->paramno; 
-      break;
-
-    case SK_ARRAYFETCH:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->arrayfetch = (ainfo) dmalloc (sizeof (*ret->arrayfetch));
-      ret->arrayfetch->indknown = s->info->arrayfetch->indknown;
-      ret->arrayfetch->ind = s->info->arrayfetch->ind;
-      ret->arrayfetch->arr = sRef_saveCopy (s->info->arrayfetch->arr);
-      break;
-
-    case SK_FIELD:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->field = (fldinfo) dmalloc (sizeof (*ret->field));
-      ret->field->rec = sRef_saveCopy (s->info->field->rec);
-      ret->field->field = s->info->field->field; 
-      break;
-
-    case SK_OBJECT:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->object = s->info->object;
-      break;
-
-    case SK_PTR:
-    case SK_ADR:
-    case SK_DERIVED:
-    case SK_EXTERNAL:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->ref = sRef_saveCopy (s->info->ref);	 
-      break;
-
-    case SK_CONJ:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->conj = (cjinfo) dmalloc (sizeof (*ret->conj));
-      ret->conj->a = sRef_saveCopy (s->info->conj->a);
-      ret->conj->b = sRef_saveCopy (s->info->conj->b);
-      break;
-    case SK_SPECIAL:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->spec = s->info->spec;
-      break;
-    case SK_NEW:
-    case SK_UNCONSTRAINED:
-      ret = (sinfo) dmalloc (sizeof (*ret));
-      ret->fname = s->info->fname;
-      break;
-    case SK_CONST:
-    case SK_TYPE:
-    case SK_RESULT:
-    case SK_UNKNOWN:
-      llassert (s->info == NULL);
-      ret = NULL;
-      break;
-    }
-  /*@=onlytrans@*/ 
-  return ret;
-}
-
-
-static void 
-  sinfo_update (/*@notnull@*/ /*@exposed@*/ sRef res, 
-		/*@notnull@*/ /*@exposed@*/ sRef other)
-{
-  llassert (res->kind == other->kind);
-
-  switch (res->kind)
-    {
-    case SK_CVAR:
-      res->info->cvar->lexlevel = other->info->cvar->lexlevel; 
-      res->info->cvar->index = other->info->cvar->index; 
-      break;
-
-    case SK_PARAM:
-      res->info->paramno = other->info->paramno; 
-      break;
-
-    case SK_ARRAYFETCH:
-      res->info->arrayfetch->indknown = other->info->arrayfetch->indknown;
-      res->info->arrayfetch->ind = other->info->arrayfetch->ind;
-      res->info->arrayfetch->arr = other->info->arrayfetch->arr;
-      break;
-
-    case SK_FIELD:
-      res->info->field->rec = other->info->field->rec;
-      res->info->field->field = other->info->field->field; 
-      break;
-
-    case SK_OBJECT:
-      res->info->object = other->info->object;
-      break;
-
-    case SK_PTR:
-    case SK_ADR:
-    case SK_DERIVED:
-    case SK_EXTERNAL:
-      res->info->ref = other->info->ref;	 
-      break;
-
-    case SK_CONJ:
-      res->info->conj->a = other->info->conj->a;
-      res->info->conj->b = other->info->conj->b;
-      break;
-
-    case SK_SPECIAL:
-      res->info->spec = other->info->spec;
-      break;
-
-    case SK_NEW:
-    case SK_UNCONSTRAINED:
-      res->info->fname = other->info->fname;
-      break;
-
-    case SK_CONST:
-    case SK_TYPE:
-    case SK_UNKNOWN:
-    case SK_RESULT:
-      llassert (res->info == NULL);
-      break;
-    }
-}
-
-static void sinfo_free (/*@special@*/ /*@temp@*/ /*@notnull@*/ sRef s)
-   /*@uses s->kind, s->info@*/
-   /*@releases s->info@*/ 
-{
-  switch (s->kind)
-    {
-    case SK_CVAR:
-      sfree (s->info->cvar);
-      break;
-
-    case SK_PARAM:
-      break;
-
-    case SK_ARRAYFETCH:
-      sfree (s->info->arrayfetch);
-      break;
-
-    case SK_FIELD:
-      sfree (s->info->field); 
-      break;
-
-    case SK_OBJECT:
-      break;
-
-    case SK_PTR:
-    case SK_ADR:
-    case SK_DERIVED:
-    case SK_EXTERNAL:
-      break;
-
-    case SK_CONJ:
-      sfree (s->info->conj);
-      break;
-
-    case SK_UNCONSTRAINED:
-    case SK_SPECIAL:
-    case SK_CONST:
-    case SK_NEW:
-    case SK_TYPE:
-    case SK_UNKNOWN:
-    case SK_RESULT:
-      break;
-    }
-
-  sfree (s->info);
-}
-
-bool sRef_isNSLocalVar (sRef s)  
-{
-  if (sRef_isLocalVar (s))
-    {
-      uentry ue = sRef_getUentry (s);
-
-      return (!uentry_isStatic (ue));
-    }
-  else
-    {
-      return FALSE;
-    }
-}
-
-bool sRef_isLocalVar (sRef s)  
-{
-  if (sRef_isValid(s))
-    {
-      return (s->kind == SK_CVAR 
-	      && (s->info->cvar->lexlevel > fileScope));
-    }
-  
-  return FALSE;
-}
-
-bool sRef_isRealLocalVar (sRef s)  
-{
-  if (sRef_isValid(s))
-    {
-      if (s->kind == SK_CVAR)
-	{
-	  if (s->info->cvar->lexlevel == functionScope)
-	    {
-	      uentry ue = sRef_getUentry (s);
-
-	      if (uentry_isAnyParam (ue)
-		  || uentry_isRefParam (ue))
-		{
-		  return FALSE;
-		}
-	      else
-		{
-		  return TRUE;
-		}
-	    }
-	  else
-	    {
-	      return (s->info->cvar->lexlevel > functionScope);
-	    }
-	}
-    }
-  
-  return FALSE;
-}
-
-bool sRef_isLocalParamVar (sRef s)  
-{
-  if (sRef_isValid(s))
-    {
-      return (s->kind == SK_PARAM
-	      || (s->kind == SK_CVAR 
-		  && (s->info->cvar->lexlevel > fileScope)));
-    }
-  
-  return FALSE;
-}
-
-static speckind speckind_fromInt (int i)
-{
-  /*@+enumint@*/ 
-  llassert (i >= SR_NOTHING && i <= SR_SYSTEM); 
-  /*@=enumint@*/
-
-  return ((speckind) i);
-}
-
-void sRef_combineNullState (/*@notnull@*/ sRef res, /*@notnull@*/ sRef other)
-{
-  nstate n1 = res->nullstate;
-  nstate n2 = other->nullstate;
-  bool flip = FALSE;
-  nstate nn = n1;
-
-  if (n1 == n2 || n2 == NS_UNKNOWN)
-    {
-      ;
-    }
-  else
-    {
-      /* note: n2 is not unknown or defnull */
-
-      switch (n1)
-	{
-	case NS_ERROR:   nn = NS_ERROR; break;
-	case NS_UNKNOWN: flip = TRUE; nn = n2; break; 
-	case NS_POSNULL: break;
-	case NS_DEFNULL: nn = NS_POSNULL; break;
-	case NS_RELNULL: break;
-	case NS_NOTNULL:  
-	  if (n2 == NS_MNOTNULL)
-	    {
-	      ;
-	    }
-	  else 
-	    { 
-	      flip = TRUE;
-	      nn = NS_POSNULL; 
-	    }
-	  break;
-	case NS_MNOTNULL: 
-	  if (n2 == NS_NOTNULL) 
-	    {
-	      nn = NS_NOTNULL; 
-	    }
-	  else 
-	    {
-	      flip = TRUE;
-	      nn = NS_POSNULL; 
-	    }
-	  break;
-	case NS_CONSTNULL:
-	case NS_ABSNULL:
-	  flip = TRUE;
-	  nn = n2;
-	}
-    }
-  
-  if (flip)
-    {
-      res->nullinfo = alinfo_update (res->nullinfo, other->nullinfo);      
-    }
-
-  res->nullstate = nn;
-}
-
-cstring sRef_nullMessage (sRef s)
-{
-  llassert (sRef_isValid (s));
-
-  switch (s->nullstate)
-    {
-    case NS_DEFNULL:
-    case NS_CONSTNULL:
-      return (cstring_makeLiteralTemp ("null"));
-    default:
-      return (cstring_makeLiteralTemp ("possibly null"));
-    }
-  BADEXIT;
-}
-
-/*@observer@*/ cstring sRef_ntMessage (sRef s)
-{
-  llassert (sRef_isValid (s));
-
-  switch (s->nullstate)
-    {
-    case NS_DEFNULL:
-    case NS_CONSTNULL:
-      return (cstring_makeLiteralTemp ("not nullterminated"));
-    default:
-      return (cstring_makeLiteralTemp ("possibly non-nullterminated"));
-    }
-  BADEXIT;
-}
-
-
-
-sRef sRef_fixResultType (/*@returned@*/ sRef s, ctype typ, uentry ue)
-{
-  sRef tmp = sRef_undefined;
-  sRef ret;
-
-  llassert (sRef_isValid (s));
-
-  switch (s->kind)
-    {
-    case SK_RESULT:
-      s->type = typ;
-      ret = s;
-      break;
-    case SK_ARRAYFETCH:
-      {
-	ctype ct;
-	tmp = sRef_fixResultType (s->info->arrayfetch->arr, typ, ue);
-
-	ct = ctype_realType (sRef_getType (tmp));
-
-	
-	if (ctype_isKnown (ct))
-	  {
-	    if (ctype_isAP (ct))
-	      {
-		;
-	      }
-	    else
-	      {
-		voptgenerror 
-		  (FLG_TYPE,
-		   message
-		   ("Special clause indexes non-array (%t): *%q",
-		    ct, sRef_unparse (s->info->arrayfetch->arr)),
-		   uentry_whereLast (ue));
-	      }
-	  }
-
-	tmp = sRef_fixResultType (s->info->arrayfetch->arr, typ, ue);
-
-	if (s->info->arrayfetch->indknown)
-	  {
-	    ret = sRef_makeArrayFetchKnown (tmp, s->info->arrayfetch->ind);
-	  }
-	else
-	  {
-	    ret = sRef_makeArrayFetch (tmp);
-	  }
-      }
-      break;
-    case SK_FIELD:
-      {
-	sRef rec = sRef_fixResultType (s->info->field->rec, typ, ue);
-	ctype ct = ctype_realType (sRef_getType (rec));
-
-	if (ctype_isKnown (ct))
-	  {
-	    if (ctype_isSU (ct))
-	      {
-		if (uentry_isValid (uentryList_lookupField (ctype_getFields (ct), 
-							    s->info->field->field)))
-		  {
-		    ;
-		  }
-		else
-		  {
-		    voptgenerror 
-		      (FLG_TYPE,
-		       message
-		       ("Special clause accesses non-existent field of result: %q.%s",
-			sRef_unparse (rec), s->info->field->field),
-		       uentry_whereLast (ue));
-		  }
-	      }
-	    else
-	      {
-		voptgenerror 
-		  (FLG_TYPE,
-		   message
-		   ("Special clause accesses field of non-struct or union result (%t): %q.%s",
-		    ct, sRef_unparse (rec), s->info->field->field),
-		   uentry_whereLast (ue));
-	      }
-	  }
-	
-	ret = sRef_makeField (tmp, s->info->field->field);
-	break;
-      }
-    case SK_PTR:
-      {
-	ctype ct;
-	tmp = sRef_fixResultType (s->info->ref, typ, ue);
-
-	ct = ctype_realType (sRef_getType (tmp));
-
-	if (ctype_isKnown (ct))
-	  {
-	    if (ctype_isAP (ct))
-	      {
-		;
-	      }
-	    else
-	      {
-		voptgenerror 
-		  (FLG_TYPE,
-		   message
-		   ("Special clause dereferences non-pointer (%t): *%q",
-		    ct, sRef_unparse (s->info->ref)),
-		   uentry_whereLast (ue));
-	      }
-	  }
-	
-	ret = sRef_makePointer (tmp);
-	break;
-      }
-    case SK_ADR:
-      voptgenerror 
-	(FLG_TYPE,
-	 message
-	 ("Special clause uses & operator (not allowed): &%q", sRef_unparse (s->info->ref)),
-	 uentry_whereLast (ue));
-      ret = s;
-      break;
-    BADDEFAULT;
-    }
-
-  return ret;
-}
-
-bool sRef_isOnly (sRef s)
-{
-  return (sRef_isValid(s) && alkind_isOnly (s->aliaskind));
-}
-
-bool sRef_isDependent (sRef s) 
-{
-  return (sRef_isValid(s) && alkind_isDependent (s->aliaskind));
-}
-
-bool sRef_isOwned (sRef s)
-{
-  return (sRef_isValid (s) && (s->aliaskind == AK_OWNED));
-}
-
-bool sRef_isKeep (sRef s) 
-{
-  return (sRef_isValid (s) && (s->aliaskind == AK_KEEP));
-}
-
-bool sRef_isTemp (sRef s)
-{
-  return (sRef_isValid (s) && alkind_isTemp (s->aliaskind));
-}
-
-bool sRef_isLocalState (sRef s) 
-{
-  return (sRef_isValid (s) && (s->aliaskind == AK_LOCAL));
-}
-
-bool sRef_isUnique (sRef s)
-{
-  return (sRef_isValid (s) && (s->aliaskind == AK_UNIQUE));
-}
-
-bool sRef_isShared (sRef s) 
-{
-  return (sRef_isValid (s) && (s->aliaskind == AK_SHARED));
-}
-
-bool sRef_isExposed (sRef s) 
-{
-  return (sRef_isValid (s) && (s->expkind == XO_EXPOSED));
-}
-
-bool sRef_isObserver (sRef s) 
-{
-  return (sRef_isValid (s) && (s->expkind == XO_OBSERVER));
-}
-
-bool sRef_isFresh (sRef s) 
-{
-  return (sRef_isValid (s) && (s->aliaskind == AK_FRESH));
-}
-
-bool sRef_isDefinitelyNull (sRef s) 
-{
-  return (sRef_isValid (s) && (s->nullstate == NS_DEFNULL 
-			       || s->nullstate == NS_CONSTNULL));
-}
-
-bool sRef_isAllocated (sRef s)
-{
-  return (sRef_isValid (s) && (s->defstate == SS_ALLOCATED));
-}
-
-bool sRef_isStack (sRef s)
-{
-  return (sRef_isValid (s) && (s->aliaskind == AK_STACK));
-}
-
-extern bool sRef_isNotNull (sRef s)
-{
-  return (sRef_isValid(s) && (s->nullstate == NS_MNOTNULL 
-			      || s->nullstate == NS_NOTNULL));
-}
-
-/* start modifications */
-struct _bbufinfo sRef_getNullTerminatedState (sRef p_s) {
-   struct _bbufinfo BUFSTATE_UNKNOWN;
-   BUFSTATE_UNKNOWN.bufstate = BB_NOTNULLTERMINATED;
-   BUFSTATE_UNKNOWN.size = 0;
-   BUFSTATE_UNKNOWN.len = 0;
-   
-   if (sRef_isValid(p_s))
-      return p_s->bufinfo;
-   return BUFSTATE_UNKNOWN; 
-}
-
-void sRef_setNullTerminatedState(sRef p_s) {
-   if(sRef_isValid (p_s)) {
-      p_s->bufinfo.bufstate = BB_NULLTERMINATED;
-   } else {
-      llfatalbug( message("sRef_setNT passed a invalid sRef\n"));
-   }
-}
-
-
-void sRef_setPossiblyNullTerminatedState(sRef p_s) {
-   if( sRef_isValid (p_s)) {
-      p_s->bufinfo.bufstate = BB_POSSIBLYNULLTERMINATED;
-   } else {
-      llfatalbug( message("sRef_setPossNT passed a invalid sRef\n"));
-   }
-}
-
-void sRef_setNotNullTerminatedState(sRef p_s) {
-   if( sRef_isValid (p_s)) {
-      p_s->bufinfo.bufstate = BB_NOTNULLTERMINATED;
-   } else {
-      llfatalbug( message("sRef_unsetNT passed a invalid sRef\n"));
-   }
-}
-
-void sRef_setLen(sRef p_s, int len) {
-   if( sRef_isValid (p_s) && sRef_isNullTerminated(p_s)) {
-      p_s->bufinfo.len = len;
-   } else {
-      llfatalbug( message("sRef_setLen passed a invalid sRef\n"));
-   }
-}
-    
-
-void sRef_setSize(sRef p_s, int size) {
-   if( sRef_isValid(p_s)) {
-       p_s->bufinfo.size = size;
-   } else {
-      llfatalbug( message("sRef_setSize passed a invalid sRef\n"));
-   }
-}
-
-void sRef_resetLen(sRef p_s) {
-	if (sRef_isValid (p_s)) {
-		p_s->bufinfo.len = 0;
-	} else {
-		llfatalbug (message ("sRef_setLen passed an invalid sRef\n"));
-	}
-}
-
-/*drl7x 11/28/2000 */
-
-bool sRef_isFixedArray (sRef p_s) {
-  ctype c;
-  c = sRef_getType (p_s);
-  return ( ctype_isFixedArray (c) );
-}
-
-int sRef_getArraySize (sRef p_s) {
-  ctype c;
-  llassert (sRef_isFixedArray(p_s) );
-
-  c = sRef_getType (p_s);
-
-  return (ctype_getArraySize (c) );
-}
-
-
-
diff --git a/src/sRefSet.c b/src/sRefSet.c
deleted file mode 100644
index 2bc16c9..0000000
--- a/src/sRefSet.c
+++ /dev/null
@@ -1,998 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** sRefSet.c
-**
-** based on set_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-sRefSet
-sRefSet_new ()
-{
-  return sRefSet_undefined;
-}
-
-static /*@notnull@*/ /*@only@*/ sRefSet
-sRefSet_newEmpty (void)
-{
-  sRefSet s = (sRefSet) dmalloc (sizeof (*s));
-  
-  s->entries = 0;
-  s->nspace = sRefSetBASESIZE;
-  s->elements = (sRef *) dmalloc (sizeof (*s->elements) * sRefSetBASESIZE);
-
-  return (s);
-}
-
-/*@only@*/ sRefSet
-sRefSet_single (/*@exposed@*/ sRef sr)
-{
-  sRefSet s = (sRefSet) dmalloc (sizeof (*s));
-  
-  s->entries = 1;
-  s->nspace = sRefSetBASESIZE - 1;
-  s->elements = (sRef *) dmalloc (sizeof (*s->elements) * sRefSetBASESIZE);
-  s->elements[0] = sr;
-
-    return (s);
-}
-
-static void
-sRefSet_grow (/*@notnull@*/ sRefSet s)
-{
-  int i;
-  sRef *newelements; 
-
-  s->nspace = sRefSetBASESIZE;
-  newelements = (sRef *) dmalloc (sizeof (*newelements) * (s->entries + s->nspace));
-
-  for (i = 0; i < s->entries; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-sRefSet
-sRefSet_insert (sRefSet s, /*@exposed@*/ sRef el)
-{
-  if (sRefSet_isUndefined (s))
-    {
-      s = sRefSet_newEmpty ();
-    }
-
-  
-  if (!sRefSet_isSameMember (s, el))
-    {
-      
-      if (s->nspace <= 0)
-	sRefSet_grow (s);
-
-      s->nspace--;
-
-      llassert (s->elements != NULL);
-      s->elements[s->entries] = el;
-
-            s->entries++;
-    }
-  else
-    {
-          }
-
-  return s;
-}
-
-void
-sRefSet_clear (sRefSet s)
-{
-  if (sRefSet_isDefined (s))
-    {
-      s->nspace += s->entries;
-      s->entries = 0;
-    }
-}
-
-/*
-** slow algorithm...but it doesn't matter
-*/
-
-void
-sRefSet_clearStatics (sRefSet s)
-{
-  if (sRefSet_isDefined (s))
-    {
-      int i;
-
-      for (i = 0; i < s->entries; i++)
-	{
-	  sRef current = s->elements[i];
-	  
-	  if (sRef_isFileStatic (sRef_getRootBase (current)))
-	    {
-	      int j;
-	      
-	      for (j = i; j < s->entries - 1; j++)
-		{
-		  s->elements[j] = s->elements[j+1];
-		}
-	      
-	      s->entries--;
-	      s->nspace++;
-	      i--;
-	    }
-	}
-    }
-}
-
-bool
-sRefSet_delete (sRefSet s, sRef el)
-{
-  int i;
-
-  if (sRefSet_isUndefined (s)) return FALSE;
-
-  if (s->elements != NULL)
-    {
-      for (i = 0; i < s->entries; i++)
-	{
-	  sRef current = s->elements[i];
-	  
-	  if (sRef_realSame (el, current))
-	    {
-	      int j;
-
-	      for (j = i; j < s->entries - 1; j++)
-		{
-		  s->elements[j] = s->elements[j+1];
-		}
-	      
-	      s->entries--;
-	      s->nspace++;
-	      return TRUE;
-	    }
-	}
-    }
-
-  return FALSE;
-}
-
-/*@exposed@*/ sRef
-sRefSet_choose (sRefSet s)
-{
-  llassert (sRefSet_isDefined (s));
-  llassert (s->entries > 0);
-  llassert (s->elements != NULL);
-
-  return (s->elements[0]);
-}
-
-sRef
-sRefSet_mergeIntoOne (sRefSet s)
-{
-  sRef res;
-  int i;
-
-  if (sRefSet_isUndefined (s)) return sRef_undefined;
-  if (s->entries == 0) return sRef_undefined;
-
-  llassert (s->elements != NULL);
-
-  res = s->elements[0];
-
-  for (i = 1; i < s->entries; i++)
-    {
-      sRef tmp;
-
-            tmp = sRef_makeConj (res, s->elements[i]);
-            res = tmp;
-    }
-
-  return res;
-}
-
-/*
-** this is really yucky...but it works...
-*/
-
-bool
-sRefSet_deleteBase (sRefSet s, sRef base)
-{
-  int i = 0;
-  int offset = 0;
-
-  if (sRefSet_isUndefined (s) || (s->elements == NULL))
-    {
-      return FALSE;
-    } ;
-
-  while (i + offset < s->entries)
-    {
-      sRef current = s->elements[i + offset];
-
-      while (sRef_includedBy (current, base))
-	{
-	  	  offset++;
-	  if (i + offset >= s->entries) goto doneLoop;
-	  current = s->elements [i + offset];
-	}
-      
-      if (offset > 0)
-	{
-	  	  s->elements [i] = current;
-	}
-      
-      i++;
-    }
-
- doneLoop:
-  s->entries -= offset;
-  s->nspace += offset;
-
-  return (offset > 0);
-}
-
-/*
-** modifies *s1
-*/
-
-sRefSet
-sRefSet_unionFree (/*@returned@*/ sRefSet s1, sRefSet s2)
-{
-  sRefSet res = sRefSet_union (s1, s2);
-
-  sRefSet_free (s2);
-  return res;
-}
-
-sRefSet
-sRefSet_union (/*@returned@*/ sRefSet s1, sRefSet s2)
-{
-  if (s1 == s2) 
-    {
-      return s1;
-    }
-
-  if (sRefSet_isEmpty (s1))
-    {
-      s1 = sRefSet_copy (s1, s2);
-    }
-  else
-    {
-      sRefSet_allElements (s2, el)
-	{
-	  s1 = sRefSet_insert (s1, el);
-	} end_sRefSet_allElements;
-    }
-
-  return s1;
-}
-
-/*
-** s1 <- s1 U (s2 - ex - params)
-*/
-
-sRefSet
-sRefSet_unionExcept (/*@returned@*/ sRefSet s1, sRefSet s2, sRef ex)
-{
-  if (s1 == s2) return s1;
-
-  sRefSet_allElements (s2, el)
-    {
-      if (sRef_same (el, ex))
-	{
-	  	}
-      else
-	{
-	  s1 = sRefSet_insert (s1, el);
-	}
-    } end_sRefSet_allElements;
-  
-  return s1;
-}
-
-/*@only@*/ sRefSet
-sRefSet_realNewUnion (sRefSet s1, sRefSet s2)
-{
-  llassert (NOALIAS (s1, s2));
-
-  if (sRefSet_isUndefined (s1))
-    {
-      return (sRefSet_newCopy (s2));
-    }
-  else
-    {
-      sRefSet ret = sRefSet_newCopy (s1);
-      
-      sRefSet_allElements (s2, el)
-	{
-	  ret = sRefSet_insert (ret, el);
-	} end_sRefSet_allElements;
-      
-      return ret;
-    }
-}
-
-/* slow! */
-
-/*@only@*/ sRefSet
-sRefSet_intersect (sRefSet s1, sRefSet s2)
-{
-  sRefSet s = sRefSet_new ();
-
-  llassert (NOALIAS (s1, s2));
-
-  sRefSet_allElements (s1, el)
-    {
-      if (sRefSet_member (s2, el))
-	{
-	  s = sRefSet_insert (s, el);
-	}
-    } end_sRefSet_allElements;
-  
-    return s;
-}
-
-sRefSet
-sRefSet_levelUnion (/*@returned@*/ sRefSet sr, sRefSet s, int lexlevel)
-{
-  llassert (NOALIAS (sr, s));
-
-  sRefSet_allElements (s, el)
-    {
-      if (sRef_lexLevel (el) <= lexlevel)
-	{
-	  sr = sRefSet_insert (sr, el);
-	}
-    } end_sRefSet_allElements;
-
-  return sr;
-}
-
-void
-sRefSet_levelPrune (sRefSet s, int lexlevel)
-{
-  if (sRefSet_isDefined (s))
-    {
-      int i;
-      int backcount = sRefSet_size (s) - 1;
-      
-      for (i = 0; i <= backcount; i++)
-	{
-	  sRef el = s->elements[i]; 
-	  
-	  if (sRef_lexLevel (el) > lexlevel)
-	    {
-	      int j;
-	      
-	      
-	      for (j = backcount; j > i; j--)
-		{
-		  backcount--;
-		  s->entries--;
-		  s->nspace++;
-		  
-		  if (sRef_lexLevel (s->elements[j]) <= lexlevel)
-		    {
-		      s->elements[i] = s->elements[j];
-		      
-		      if (backcount == i) s->entries++;
-		      /*@innerbreak@*/ break;
-		    }
-		}
-
-	      if (backcount == i)
-		{
-		  s->entries--;
-		}
-	    }
-	}
-    }
-}
-
-/*
-** s1 <- s2
-*/
-
-sRefSet
-  sRefSet_copy (/*@returned@*/ sRefSet s1, /*@exposed@*/ sRefSet s2)
-{
-  int origentries;
-  
-  llassert (NOALIAS (s1, s2));
-  
-  if (sRefSet_isUndefined (s1))
-    {
-      if (sRefSet_isEmpty (s2))
-	{
-	  return s1;
-	}
-      else
-	{
-	  s1 = sRefSet_newEmpty ();
-	}
-    } 
-
-  origentries = s1->entries;
-
-  s1->nspace = s1->entries + s1->nspace;
-  s1->entries = 0;
-
-  sRefSet_allElements (s2, el)
-    {
-      if (s1->nspace == 0)
-	{
-	  sRefSet_grow (s1);
-	}
-
-      s1->elements[s1->entries] = el; 
-      s1->nspace--;
-      s1->entries++;
-    } end_sRefSet_allElements;
-
-  return s1;
-}
-
-/*@only@*/ sRefSet
-  sRefSet_newCopy (/*@exposed@*/ sRefSet s)
-{
-  if (sRefSet_isEmpty (s))
-    {
-      return sRefSet_undefined;
-    }
-  else
-    {
-      sRefSet r = (sRefSet) dmalloc (sizeof (*r));
-      int i;
-      
-      r->entries = s->entries;
-      r->nspace = s->nspace;
-      r->elements = (sRef *) dmalloc (sizeof (*r->elements) * (s->entries + s->nspace));
-      
-      for (i = 0; i < s->entries; i++)
-	{
-	  r->elements[i] = s->elements[i]; 
-	}  
-      
-      return r;
-    }
-}
-
-/*@only@*/ sRefSet
-sRefSet_levelCopy (/*@exposed@*/ sRefSet s, int lexlevel)
-{
-  if (sRefSet_isEmpty (s))
-    {
-      return sRefSet_undefined;
-    }
-  else
-    {
-      sRefSet r = (sRefSet) dmalloc (sizeof (*r));
-      int i;
-      
-      r->nspace = s->entries;
-      r->entries = 0;
-      r->elements = (sRef *) dmalloc (sizeof (*r->elements) * (s->entries)); 
-
-      for (i = 0; i < s->entries; i++)
-	{
-	  if (sRef_lexLevel (s->elements[i]) <= lexlevel)
-	    {
-	      r->elements[r->entries] = s->elements[i];
-	      r->entries++;
-	      r->nspace--;
-	    }
-	}  
-      
-      return r;
-    }
-}
-
-/*@only@*/ sRefSet
-sRefSet_newDeepCopy (sRefSet s)
-{
-  if (sRefSet_isUndefined (s))
-    {
-      return sRefSet_newEmpty ();
-    }
-  else
-    {
-      sRefSet r = (sRefSet) dmalloc (sizeof (*r));
-      int i;
-      
-      r->entries = s->entries;
-      r->nspace = s->nspace;
-      r->elements = (sRef *) dmalloc (sizeof (*r->elements) * (s->entries + s->nspace));
-      
-      for (i = 0; i < s->entries; i++)
-	{
-	  r->elements[i] = sRef_copy (s->elements[i]);
-	}  
-      
-      return r;
-    }
-}
-
-static bool
-sRefSet_isElementCompare (bool (*test)(sRef, sRef), sRefSet s, sRef el)
-{
-  sRefSet_allElements (s, e)
-    {
-      if ((test)(el, e))
-	{
-	  return TRUE;
-	}
-    } end_sRefSet_allElements;
-
-  return FALSE;
-}
-
-static bool
-sRefSet_isElementTest (bool (*test)(sRef), sRefSet s)
-{
-  sRefSet_allElements (s, e)
-    {
-      if ((test)(e))
-	{
-	  return TRUE;
-	}
-    } end_sRefSet_allElements;
-
-  return FALSE;
-}
-
-bool
-sRefSet_hasRealElement (sRefSet s)
-{
-  sRefSet_allElements (s, e)
-    {
-      if (sRef_isMeaningful (e) && !sRef_isUnconstrained (e))
-	{
-	  return TRUE;
-	}
-    } end_sRefSet_allElements;
-
-  return FALSE;
-}
-
-bool
-sRefSet_isSameMember (sRefSet s, sRef el)
-{
-  return (sRefSet_isElementCompare (sRef_realSame, s, el));
-}
-
-bool
-sRefSet_isSameNameMember (sRefSet s, sRef el)
-{
-  return (sRefSet_isElementCompare (sRef_sameName, s, el));
-}
-
-bool
-sRefSet_member (sRefSet s, sRef el)
-{
-  return (sRefSet_isElementCompare (sRef_similar, s, el));
-}
-
-bool
-sRefSet_hasStatic (sRefSet s)
-{
-  return (sRefSet_isElementTest (sRef_isFileStatic, s));
-}
-
-bool
-sRefSet_hasUnconstrained (sRefSet s)
-{
-  return (sRefSet_isElementTest (sRef_isUnconstrained, s));
-}
-
-cstring
-  sRefSet_unparseUnconstrained (sRefSet s)
-{
-  int num = 0;
-  cstring res = cstring_undefined;
-  
-  sRefSet_allElements (s, el)
-    {
-      if (sRef_isUnconstrained (el))
-	{
-	  if (cstring_isUndefined (res))
-	    {
-	      res = cstring_copy (sRef_unconstrainedName (el));
-	    }
-	  else
-	    {
-	      res = message ("%q, %s", res, sRef_unconstrainedName (el));
-	    }
-	  
-	  num++;
-	}
-    } end_sRefSet_allElements ;
-  
-  if (num == 0)
-    {
-      llassert (cstring_isUndefined (res));
-      return (cstring_makeLiteral (""));
-    }
-  else if (num == 1)
-    {
-      return (message ("unconstrained function %q", res));
-    }
-  else
-    {
-      return (message ("unconstrained functions %q", res));
-    }
-}
-
-cstring
-sRefSet_unparseUnconstrainedPlain (sRefSet s)
-{
-  cstring res = cstring_undefined;
-
-  sRefSet_allElements (s, el)
-    {
-      if (sRef_isUnconstrained (el))
-	{
-	  if (cstring_isUndefined (res))
-	    {
-	      res = cstring_copy (sRef_unconstrainedName (el));
-	    }
-	  else
-	    {
-	      res = message ("%q, %s", res, sRef_unconstrainedName (el));
-	    }
-	}
-    } end_sRefSet_allElements ;
-
-  return res;
-}
-      
-bool
-sRefSet_modifyMember (sRefSet s, sRef m)
-{
-  bool ret = FALSE;
-
-  sRefSet_allElements (s, e)
-    {
-      if (sRef_similar (m, e))
-	{
-	  sRef_setModified (e);
-	  ret = TRUE;
-	}
-    } end_sRefSet_allElements;
-
-  
-  return ret;
-}
-
-/*@exposed@*/ sRef
-sRefSet_lookupMember (sRefSet s, sRef el)
-{
-  sRefSet_allElements (s, e)
-    {
-      if (sRef_similar (el, e))
-	{
-	  return e;
-	}
-    } end_sRefSet_allElements;
-  
-  return sRef_undefined;
-}
-
-int sRefSet_size (sRefSet s)
-{
-  if (sRefSet_isUndefined (s)) return 0;
-  return s->entries;
-}
-
-/*@only@*/ cstring
-sRefSet_unparse (sRefSet s)
-{
-  int i;
-  cstring st = cstring_makeLiteral ("{");
-
-  if (sRefSet_isDefined (s))
-    {
-      for (i = 0; i < sRefSet_size (s); i++)
-	{
-	  if (i == 0)
-	    st = message ("%q %q", st, sRef_unparse (s->elements[i]));
-	  else
-	    st = message ("%q, %q", st, sRef_unparse (s->elements[i]));
-	}
-    }
-  
-  st = message ("%q }", st);
-  return st;
-}
-
-cstring sRefSet_unparsePlain (sRefSet s)
-{
-  int i;
-  cstring st = cstring_undefined;
-
-  if (sRefSet_isDefined (s))
-    {
-      for (i = 0; i < sRefSet_size (s); i++)
-	{
-	  if (i == 0)
-	    st = sRef_unparse (s->elements[i]);
-	  else
-	    st = message ("%q, %q", st, sRef_unparse (s->elements[i]));
-	}
-    }
-  
-  return st;
-}
-
-cstring
-sRefSet_unparseDebug (sRefSet s)
-{
-  int i;
-  cstring st = cstring_makeLiteral ("{");
-
-  if (sRefSet_isDefined (s))
-    {
-      for (i = 0; i < sRefSet_size (s); i++)
-	{
-	  if (i == 0)
-	    {
-	      st = message ("%q %q", st, sRef_unparseDebug (s->elements[i]));
-	    }
-	  else
-	    {
-	      st = message ("%q, %q", st, sRef_unparseDebug (s->elements[i]));
-	    }
-	}
-    }
-  
-  st = message ("%q }", st);
-  return st;
-}
-
-void
-sRefSet_fixSrefs (sRefSet s)
-{
-  if (sRefSet_isDefined (s))
-    {
-      int i;
-      
-      for (i = 0; i < sRefSet_size (s); i++)
-	{
-	  sRef current = s->elements[i];
-
-	  if (sRef_isLocalVar (current))
-	    {
-	      s->elements[i] = uentry_getSref (sRef_getUentry (current));
-	      	    }
-	}
-    }
-}
-
-void
-sRefSet_free (/*@only@*/ sRefSet s)
-{
-  if (!sRefSet_isUndefined (s))
-    {
-      llassertprint (s->entries < 1000, ("sRefSet free size: %d", s->entries));
-
-      sfree (s->elements); 
-      sfree (s);
-    }
-}
-
-sRefSet sRefSet_removeIndirection (sRefSet s)
-{
-  /*
-  ** returns a NEW sRefSet containing references to all sRef's in s
-  */
-
-  sRefSet t = sRefSet_new ();
-  
-  
-  sRefSet_allElements (s, el)
-    {
-      if (!sRef_isAddress (el))
-	{
-	  t = sRefSet_insert (t, sRef_makeAddress (el));
-	}
-    } end_sRefSet_allElements;
-
-  return t;
-}
-
-sRefSet sRefSet_addIndirection (sRefSet s)
-{
-  /*
-  ** returns a NEW sRefSet containing references to all sRef's in s
-  */
-
-  sRefSet t = sRefSet_new ();
-  
-  
-  sRefSet_allElements (s, el)
-    {
-      ctype ct = ctype_realType (sRef_getType (el));
-
-      
-      if ((ctype_isArrayPtr (ct)))
-	{
-	  
-	  sRef a = sRef_constructPointer (el);
-
-	  t = sRefSet_insert (t, a);   
-	}
-    } end_sRefSet_allElements;
-
-    return t;
-}
-
-sRefSet sRefSet_accessField (sRefSet s, /*@observer@*/ cstring f)
-{
-  /*
-  ** returns a NEW sRefSet containing references to all sRef's in s
-  */
-
-  sRefSet t = sRefSet_new ();
-
-  
-  sRefSet_allElements (s, el)
-    {
-      ctype ct = ctype_realType (sRef_getType (el));
-
-      if ((ctype_isStruct (ct) || ctype_isUnion (ct))
-	  && (!uentry_isUndefined (uentryList_lookupField (ctype_getFields (ct), f))))
-	{
-	  t = sRefSet_insert (t, sRef_makeNCField (el, f));
-	}
-    } end_sRefSet_allElements;
-  
-    return t;
-}
-
-sRefSet sRefSet_fetchUnknown (sRefSet s)
-{
-  sRefSet t = sRefSet_new ();
-  
-  sRefSet_allElements (s, el)
-    {
-      ctype ct = ctype_realType (sRef_getType (el));
-      
-      if (ctype_isArrayPtr (ct))
-	{
-	  t = sRefSet_insert (t, sRef_makeArrayFetch (el));
-	}
-    } end_sRefSet_allElements;
-
-  return t;
-}
-
-sRefSet sRefSet_fetchKnown (sRefSet s, int i)
-{
-  sRefSet t = sRefSet_new ();
-  
-  sRefSet_allElements (s, el)
-    {
-      ctype ct = ctype_realType (sRef_getType (el));
-      
-      if (ctype_isArrayPtr (ct))
-	{
-	  t = sRefSet_insert (t, sRef_makeArrayFetchKnown (el, i));
-	}
-    } end_sRefSet_allElements;
-
-  return t;
-}
-
-int sRefSet_compare (sRefSet s1, sRefSet s2)
-{
-  sRefSet_allElements (s1, el)
-    {
-      if (!sRefSet_isSameMember (s2, el))
-	{
-	  return -1;
-	}
-    } end_sRefSet_allElements;
-
-  sRefSet_allElements (s2, el)
-    {
-      if (!sRefSet_isSameMember (s1, el))
-	{
-	  return 1;
-	}
-    } end_sRefSet_allElements;
-
-  return 0;
-}
-
-bool sRefSet_equal (sRefSet s1, sRefSet s2)
-{
-  sRefSet_allElements (s1, el)
-    {
-      if (!sRefSet_isSameMember (s2, el))
-	{
-	  return FALSE;
-	}
-    } end_sRefSet_allElements;
-
-  sRefSet_allElements (s2, el)
-    {
-      if (!sRefSet_isSameMember (s1, el))
-	{
-	  return FALSE;
-	}
-    } end_sRefSet_allElements;
-
-  return TRUE;
-}
-
-/*@only@*/ sRefSet
-sRefSet_undump (char **s)
-{
-  char c;
-  sRefSet sl = sRefSet_new ();
-
-  while ((c = **s) != '#' && c != '@' && c != '$' && c != '&')
-    {
-      sl = sRefSet_insert (sl, sRef_undump (s));
-
-      
-      if (**s == ',')
-	{
-	  (*s)++;
-	}
-    }
-
-    return sl;
-}
-
-/*@only@*/ cstring
-sRefSet_dump (sRefSet sl)
-{
-  cstring st = cstring_undefined;
-  bool first = TRUE;
-
-  
-  sRefSet_allElements (sl, el)
-    {
-      if (!first)
-	{
-	  st = cstring_appendChar (st, ',');
-	}
-      else
-	{
-	  first = FALSE;
-	}
-
-      st = cstring_concatFree (st, sRef_dump (el));
-    } end_sRefSet_allElements;
-
-  return st;
-}
-
diff --git a/src/sRefSetList.c b/src/sRefSetList.c
deleted file mode 100644
index 536b879..0000000
--- a/src/sRefSetList.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** sRefSetList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-static /*@notnull@*/ /*@only@*/ sRefSetList
-sRefSetList_newEmpty (void)
-{
-  sRefSetList s = (sRefSetList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = sRefSetListBASESIZE; 
-  s->elements = (sRefSet *) dmalloc (sizeof (*s->elements) * sRefSetListBASESIZE);
-
-  return (s);
-}
-
-static void
-sRefSetList_grow (/*@notnull@*/ sRefSetList s)
-{
-  int i;
-  sRefSet *newelements;
-  
-  s->nspace += sRefSetListBASESIZE; 
-
-  newelements = (sRefSet *) dmalloc (sizeof (*newelements) 
-				     * (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-  
-  sfree (s->elements); 
-  s->elements = newelements;
-}
-
-sRefSetList sRefSetList_add (sRefSetList s, /*@dependent@*/ sRefSet el)
-{
-  if (sRefSetList_isUndefined (s))
-    {
-      s = sRefSetList_newEmpty ();
-    }
-
-  if (s->nspace <= 0)
-    {
-      sRefSetList_grow (s);
-    }
-  
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-
-  return s;
-}
-
-void
-sRefSetList_clear (sRefSetList s)
-{
-  if (sRefSetList_isDefined (s))
-    {
-      s->nspace += s->nelements;
-      s->nelements = 0;
-    }
-}
-
-void
-sRefSetList_free (sRefSetList s)
-{
-  if (sRefSetList_isDefined (s))
-    {
-      sfree (s->elements);
-      sfree (s);
-    }
-}
diff --git a/src/sRefTable.c b/src/sRefTable.c
deleted file mode 100644
index fd36290..0000000
--- a/src/sRefTable.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** sRefTable.c
-**
-** based on table_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-# include "sRefTable.h"
-
-static /*@notnull@*/ /*@only@*/ sRefTable
-sRefTable_new (void)
-{
-  sRefTable s = (sRefTable) dmalloc (sizeof (*s));
-
-  s->entries = 0;
-  s->nspace = sRefTableBASESIZE;
-  s->elements = (sRef *) dmalloc (sizeof (*s->elements) * sRefTableBASESIZE);
-
-  return (s);
-}
-
-static void
-sRefTable_grow (/*@notnull@*/ sRefTable s)
-{
-  int i;
-  sRef *newelements; 
-
-  s->nspace = sRefTableBASESIZE;
-  newelements = (sRef *) dmalloc (sizeof (*newelements) * (s->entries + s->nspace));
-
-  for (i = 0; i < s->entries; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-sRefTable
-sRefTable_add (sRefTable s, /*@owned@*/ sRef el)
-{
-  if (sRefTable_isNull (s))
-    {
-      s = sRefTable_new ();
-    }
-
-  if (s->nspace <= 0)
-    {
-      sRefTable_grow (s);
-    }
-
-  s->nspace--;
-  
-  llassert (s->elements != NULL);
-  s->elements[s->entries] = el;
-  
-  s->entries++;
-
-  return s;
-}
-
-void
-sRefTable_clear (sRefTable s)
-{
-  if (sRefTable_isDefined (s))
-    {
-      int i;
-      
-      for (i = 0; i < s->entries; i++)
-	{
-	  	  sRef_free (s->elements[i]); 
-	}
-
-      s->nspace += s->entries;
-      s->entries = 0;
-    }
-}
-
-static int sRefTable_size (sRefTable s)
-{
-  if (sRefTable_isNull (s)) return 0;
-  return s->entries;
-}
-
-/*@only@*/ cstring
-sRefTable_unparse (sRefTable s)
-{
-  int i;
-  cstring st = cstring_undefined;
-
-  if (sRefTable_isDefined (s))
-    {
-      for (i = 0; i < sRefTable_size (s); i++)
-	{
-	  if (i == 0)
-	    st = message ("%4d. %q\n", i, sRef_unparse (s->elements[i]));
-	  else
-	    st = message ("%q%4d. %q\n", st, i, sRef_unparse (s->elements[i]));
-	}
-    }
-  return st;
-}
-
-void
-sRefTable_free (/*@only@*/ sRefTable s)
-{
-  if (sRefTable_isDefined (s))
-    {
-      int i;
-
-      for (i = 0; i < s->entries; i++)
-	{
-	  sRef_free (s->elements[i]);
-	}
-
-      sfree (s->elements); 
-      sfree (s);
-    }
-}
-
diff --git a/src/scan.c b/src/scan.c
deleted file mode 100644
index 05fce97..0000000
--- a/src/scan.c
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** scan.c
-**
-** Deliver tokens one at a time
-**
-**	METHOD:
-**	The input arrives via LSLScanFreshToken ().
-**	The output is reported via LSLScanNextToken ().
-**
-**	The tokens are built in module ScanLine.
-**	The tokens are delivered from this module.
-**	Meantimes, they are saved in a static array.
-**
-**	The tokenizing is split off from the delivery of tokens
-**	to facilitate incremental scanning at a later date.
-**	The essential is that scanline () can be called or not
-**	if the input text is dirty or not.  Clean lines cause
-**	tokens to be played out from the saved token list (not
-**	yet implemented in this version).
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "signature.h"
-# include "signature2.h"
-# include "scan.h"
-# include "scanline.h"
-
-extern /*@external@*/ /*@unused@*/ YYSTYPE lsllval;
-
-static /*@exposed@*/ ltoken LSLScanLookAhead (void);
-static tsource *scanFile;	  /* file to scan */
-static o_ltoken TokenList[MAXLINE]; /* available tokens */
-static int nextToken;		  /* next available token */
-static int lastToken;		  /* next available slot */
-
-static /*@dependent@*/ /*@null@*/ char *line;	/* input text */
-static unsigned int lineNumber;	/* current line number */
-
-unsigned int lsllex (YYSTYPE *lval)
-{
-  /* This is important!  Bison expects this */
-  lval->ltok = LSLScanNextToken ();
-  return (ltoken_getCode (lval->ltok));
-}
-
-ltoken LSLScanNextToken (void)
-{
-  
-  if (nextToken < lastToken)
-    {	
-      /*@-retalias@*/
-            return TokenList[nextToken++];
-      /*@=retalias@*/
-    }
-  else
-    {
-      lastToken = 0;		
-      lineNumber++;
-
-      line = tsource_nextLine (scanFile);       
-      
-      if (line != (char *) 0)
-	{
-	  	  lscanLine (line);	/* tokenize */
-	  nextToken = 0;
-	  return LSLScanNextToken ();	
-	}
-      else
-	{
-	  	  return LSLScanEofToken ();
-	}
-    }
-}
-
-static /*@exposed@*/ ltoken
-LSLScanLookAhead (void)
-{
-  if (nextToken < lastToken)
-    {		
-      return TokenList[nextToken];
-    }
-  else
-    {
-      lastToken = 0;		
-      line = tsource_nextLine (scanFile);
-
-      if (line != (char *) 0)
-	{
-	  lscanLine (line);	
-	  nextToken = 0;	
-	  return LSLScanLookAhead ();	
-	}
-      else
-	{
-	  /* 
-          ** This is a real memory leak.  Its only a few bytes
-	  ** per file though, and lsl files are hardly ever used.
-	  */
-
-	  /*@-onlytrans@*/ 
-	  return LSLScanEofToken ();
-	  /*@=onlytrans@*/
-	}
-    }
-}
-
-void
-LSLScanFreshToken (ltoken tok)
-{
-  if (lastToken < MAXLINE)
-    {				
-      TokenList[lastToken++] = ltoken_copy (tok);	
-    }
-  else
-    {
-      llfatalbug (message ("LSLScanFreshToken: out of range: %s", 
-			   cstring_fromChars (lsymbol_toChars (ltoken_getText (tok)))));
-    }
-}
-
-/*@exposed@*/ tsource *LSLScanSource (void)
-{
-  return scanFile;
-}
-
-
-void
-LSLScanInit (void)
-{
-}
-
-void
-LSLScanReset (tsource *s)
-{
-  scanFile = s;
-  lastToken = 0;
-  nextToken = lastToken + 1;	/* force call to scanline   */
-  lineNumber = 0;
-}
-
-void
-LSLScanCleanup (void)
-{
-}
diff --git a/src/scanline.c b/src/scanline.c
deleted file mode 100644
index d972215..0000000
--- a/src/scanline.c
+++ /dev/null
@@ -1,822 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** scanline.c
-**
-** Scan one line of Larch SL input at a time.
-**
-**	The input is source text, line at a time.   The output is a sequence
-**	of tokens, reported by call-out LSLScanFreshToken.
-**
-**	This organization allows implementation of line-at-a-time
-**	incremental scanning.  The incremental mechanism is in the
-**	driving module scan.c, which can save and replay tokens for
-**	unchanged lines.  This module works either way.
-**
-**	The main loop of the scanner keys on the leading character.
-**	Actions within the loop collect the token starting with the
-**	and determine its kind.
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "signature.h"
-# include "signature2.h"
-# include "scan.h"
-# include "scanline.h"
-# include "tokentable.h"
-# include "syntable.h"
-
-/*@notfunction@*/
-# define MOVECHAR()   do { *bufptr++ = c; c = *currentLine++; colNumber++; } while (FALSE) 
-
-/*@constant static int MAXCHAR;@*/
-# define MAXCHAR 512      
-
-/*@constant static int TABSIZE;@*/
-# define TABSIZE 8	
-
-static void LocalUserError (/*@temp@*/ char *p_msg);
-
-static charClassData charClass[LASTCHAR + 1];
-
-static unsigned int colNumber; 
-static unsigned int startCol;	
-static bool reportEOL;		
-static bool reportComments;	
-
-static char tokenBuffer[MAXCHAR];
-
-static const charClassData charClassDef[] =
-{
-  /* Control characters					 */
-
-  { CHC_NULL, TRUE },      /*  0 NULL		 */
-  { SINGLECHAR, FALSE },        /*  1 CTRL-A		 */
-  { SINGLECHAR, FALSE },	/*  2 CTRL-B		 */
-  { SINGLECHAR, FALSE },	/*  3 CTRL-C		 */
-  { SINGLECHAR, FALSE },	/*  4 CTRL-D		 */
-  { SINGLECHAR, FALSE },	/*  5 CTRL-E		 */
-  { SINGLECHAR, FALSE },	/*  6 CTRL-F		 */
-  { SINGLECHAR, FALSE },	/*  7 CTRL-G		 */
-  { SINGLECHAR, FALSE },	/*  8 CTRL-H		 */
-
-  /* defined formatting characters			 */
-
-  { WHITECHAR, FALSE },		/*  9 CTRL-I   TAB	 */
-  { WHITECHAR, TRUE },		/* 10 CTRL-J   EOL	 */
-
-  /* more control characters				 */
-
-  { SINGLECHAR, FALSE },	/* 11 CTRL-K		 */
-  { SINGLECHAR, FALSE },	/* 12 CTRL-L		 */
-  { SINGLECHAR, FALSE },	/* 13 CTRL-M		 */
-  { SINGLECHAR, FALSE },	/* 14 CTRL-N		 */
-  { SINGLECHAR, FALSE },	/* 15 CTRL-O		 */
-  { SINGLECHAR, FALSE },	/* 16 CTRL-P		 */
-  { SINGLECHAR, FALSE },	/* 17 CTRL-Q		 */
-  { SINGLECHAR, FALSE },	/* 18 CTRL-R		 */
-  { SINGLECHAR, FALSE },	/* 19 CTRL-S		 */
-  { SINGLECHAR, FALSE },	/* 20 CTRL-T		 */
-  { SINGLECHAR, FALSE },	/* 21 CTRL-U		 */
-  { SINGLECHAR, FALSE },	/* 22 CTRL-V		 */
-  { SINGLECHAR, FALSE },	/* 23 CTRL-W		 */
-  { SINGLECHAR, FALSE },	/* 24 CTRL-X		 */
-  { SINGLECHAR, FALSE },	/* 25 CTRL-Y		 */
-  { SINGLECHAR, FALSE },	/* 26 CTRL-Z		 */
-  { SINGLECHAR, FALSE },	/* 27 CTRL-[   ESC	 */
-  { SINGLECHAR, FALSE },	/* 28 CTRL-slash         */
-  { SINGLECHAR, FALSE },	/* 29 CTRL-]   GS	 */
-  { SINGLECHAR, FALSE },	/* 30 CTRL-^   RS	 */
-  { SINGLECHAR, FALSE },	/* 31 CTRL-_   US	 */
-
-  /* Special printing characters			 */
-
-  { WHITECHAR, FALSE },		/* 32 space		 */
-  { SINGLECHAR, FALSE },	/* 33 !			 */
-  { SINGLECHAR, FALSE },	/* 34 "			 */
-  { SINGLECHAR, FALSE },	/* 35 #			 */
-  { SINGLECHAR, FALSE },	/* 36 $			 */
-  { SINGLECHAR, FALSE },	/* 37 %			 */
-  { SINGLECHAR, FALSE },	/* 38 &			 */
-  { SINGLECHAR, FALSE },	/* 39 '			 */
-
-  /* Reserved characters				 */
-
-  { PERMCHAR, FALSE },		/* 40 (			 */
-  { PERMCHAR, FALSE },		/* 41 )			 */
-  { OPCHAR, FALSE },		/* 42 *			 */
-  { OPCHAR, FALSE },		/* 43 +			 */
-  { PERMCHAR, FALSE },		/* 44 ,			 */
-  { OPCHAR, FALSE },		/* 45 -			 */
-  { OPCHAR, FALSE },		/* 46 .			 */
-  { SLASHCHAR, FALSE },		/* 47 /			 */
-
-  /* Numbers						 */
-
-  { IDCHAR, FALSE },		/* 48 0			 */
-  { IDCHAR, FALSE },		/* 49 1			 */
-  { IDCHAR, FALSE },		/* 50 2			 */
-  { IDCHAR, FALSE },		/* 51 3			 */
-  { IDCHAR, FALSE },		/* 52 4			 */
-  { IDCHAR, FALSE },		/* 53 5			 */
-  { IDCHAR, FALSE },		/* 54 6			 */
-  { IDCHAR, FALSE },		/* 55 7			 */
-  { IDCHAR, FALSE },		/* 56 8			 */
-  { IDCHAR, FALSE },		/* 57 9			 */
-
-  /* More reserved and special printing characters	 */
-
-  { PERMCHAR, FALSE },		/* 58 :			 */
-  { SINGLECHAR, FALSE },	/* 59;			 */
-  { OPCHAR, FALSE },		/* 60 <			 */
-  { OPCHAR, FALSE },		/* 61 =			 */
-  { OPCHAR, FALSE },		/* 62 >			 */
-  { SINGLECHAR, FALSE },	/* 63 ?			 */
-  { SINGLECHAR, FALSE },	/* 64 @			 */
-
-  /* Uppercase Alphabetics				 */
-
-  { IDCHAR, FALSE },		/* 65 A 		 */
-  { IDCHAR, FALSE },		/* 66 B 		 */
-  { IDCHAR, FALSE },		/* 67 C 		 */
-  { IDCHAR, FALSE },		/* 68 D 	 	 */
-  { IDCHAR, FALSE },		/* 69 E 		 */
-  { IDCHAR, FALSE },		/* 70 F			 */
-  { IDCHAR, FALSE },		/* 71 G			 */
-  { IDCHAR, FALSE },		/* 72 H			 */
-  { IDCHAR, FALSE },		/* 73 I			 */
-  { IDCHAR, FALSE },		/* 74 J			 */
-  { IDCHAR, FALSE },		/* 75 K			 */
-  { IDCHAR, FALSE },		/* 76 L			 */
-  { IDCHAR, FALSE },		/* 77 M			 */
-  { IDCHAR, FALSE },		/* 78 N			 */
-  { IDCHAR, FALSE },		/* 79 O			 */
-  { IDCHAR, FALSE },		/* 80 P			 */
-  { IDCHAR, FALSE },		/* 81 Q			 */
-  { IDCHAR, FALSE },		/* 82 R			 */
-  { IDCHAR, FALSE },		/* 83 S			 */
-  { IDCHAR, FALSE },		/* 84 T			 */
-  { IDCHAR, FALSE },		/* 85 U			 */
-  { IDCHAR, FALSE },		/* 86 V			 */
-  { IDCHAR, FALSE },		/* 87 W			 */
-  { IDCHAR, FALSE },		/* 88 X			 */
-  { IDCHAR, FALSE },		/* 89 Y			 */
-  { IDCHAR, FALSE },		/* 90 Z			 */
-
-  /* Still more reserved and special printing characters */
-
-  { SINGLECHAR, FALSE },	/* 91 [			 */
-  { CHC_EXTENSION, FALSE },	/* 92 slash		 */
-  { SINGLECHAR, FALSE },	/* 93 ]			 */
-  { SINGLECHAR, FALSE },	/* 94 ^			 */
-  { IDCHAR, FALSE },		/* 95 _			 */
-  { SINGLECHAR, FALSE },	/* 96 `			 */
-  
-  /* Lowercase alphabetics				 */
-
-  { IDCHAR, FALSE },		/* 97 a			 */
-  { IDCHAR, FALSE },		/* 98 b			 */
-  { IDCHAR, FALSE },		/* 99 c			 */
-  { IDCHAR, FALSE },		/* 100 d		 */
-  { IDCHAR, FALSE },		/* 101 e		 */
-  { IDCHAR, FALSE },		/* 102 f		 */
-  { IDCHAR, FALSE },		/* 103 g		 */
-  { IDCHAR, FALSE },		/* 104 h		 */
-  { IDCHAR, FALSE },		/* 105 i		 */
-  { IDCHAR, FALSE },		/* 106 j		 */
-  { IDCHAR, FALSE },		/* 107 k		 */
-  { IDCHAR, FALSE },		/* 108 l		 */
-  { IDCHAR, FALSE },		/* 109 m		 */
-  { IDCHAR, FALSE },		/* 110 n		 */
-  { IDCHAR, FALSE },		/* 111 o		 */
-  { IDCHAR, FALSE },		/* 112 p		 */
-  { IDCHAR, FALSE },		/* 113 q		 */
-  { IDCHAR, FALSE },		/* 114 r		 */
-  { IDCHAR, FALSE },		/* 115 s		 */
-  { IDCHAR, FALSE },		/* 116 t		 */
-  { IDCHAR, FALSE },		/* 117 u		 */
-  { IDCHAR, FALSE },		/* 118 v		 */
-  { IDCHAR, FALSE },		/* 119 w		 */
-  { IDCHAR, FALSE },		/* 120 x		 */
-  { IDCHAR, FALSE },		/* 121 y		 */
-  { IDCHAR, FALSE },		/* 122 z		 */
-
-  { SINGLECHAR, FALSE },	/* 123 {		 */
-  { SINGLECHAR, FALSE },	/* 124 |		 */
-  { SINGLECHAR, FALSE },	/* 125 }		 */
-  { SINGLECHAR, FALSE },	/* 126 ~		 */
-  { SINGLECHAR, FALSE },	/* 127 DEL		 */
-
-  /* MCS - unused in English				 */
-
-  { SINGLECHAR, FALSE },	/* 128			 */
-  { SINGLECHAR, FALSE },	/* 129			 */
-  { SINGLECHAR, FALSE },	/* 130			 */
-  { SINGLECHAR, FALSE },	/* 131			 */
-  { SINGLECHAR, FALSE },	/* 132			 */
-  { SINGLECHAR, FALSE },	/* 133			 */
-  { SINGLECHAR, FALSE },	/* 134			 */
-  { SINGLECHAR, FALSE },	/* 135			 */
-  { SINGLECHAR, FALSE },	/* 136			 */
-  { SINGLECHAR, FALSE },	/* 137			 */
-  { SINGLECHAR, FALSE },	/* 138			 */
-  { SINGLECHAR, FALSE },	/* 139			 */
-  { SINGLECHAR, FALSE },	/* 140			 */
-  { SINGLECHAR, FALSE },	/* 141			 */
-  { SINGLECHAR, FALSE },	/* 142			 */
-  { SINGLECHAR, FALSE },	/* 143			 */
-  { SINGLECHAR, FALSE },	/* 144			 */
-  { SINGLECHAR, FALSE },	/* 145			 */
-  { SINGLECHAR, FALSE },	/* 146			 */
-  { SINGLECHAR, FALSE },	/* 147			 */
-  { SINGLECHAR, FALSE },	/* 148			 */
-  { SINGLECHAR, FALSE },	/* 149			 */
-  { SINGLECHAR, FALSE },	/* 150			 */
-  { SINGLECHAR, FALSE },	/* 151			 */
-  { SINGLECHAR, FALSE },	/* 152			 */
-  { SINGLECHAR, FALSE },	/* 153			 */
-  { SINGLECHAR, FALSE },	/* 154			 */
-  { SINGLECHAR, FALSE },	/* 155			 */
-  { SINGLECHAR, FALSE },	/* 156			 */
-  { SINGLECHAR, FALSE },	/* 157			 */
-  { SINGLECHAR, FALSE },	/* 158			 */
-  { SINGLECHAR, FALSE },	/* 159			 */
-  { SINGLECHAR, FALSE },	/* 160			 */
-  { SINGLECHAR, FALSE },	/* 161			 */
-  { SINGLECHAR, FALSE },	/* 162			 */
-  { SINGLECHAR, FALSE },	/* 163			 */
-  { SINGLECHAR, FALSE },	/* 164			 */
-  { SINGLECHAR, FALSE },	/* 165			 */
-  { SINGLECHAR, FALSE },	/* 166			 */
-  { SINGLECHAR, FALSE },	/* 167			 */
-  { SINGLECHAR, FALSE },	/* 168			 */
-  { SINGLECHAR, FALSE },	/* 169			 */
-  { SINGLECHAR, FALSE },	/* 170			 */
-  { SINGLECHAR, FALSE },	/* 171			 */
-  { SINGLECHAR, FALSE },	/* 172			 */
-  { SINGLECHAR, FALSE },	/* 173			 */
-  { SINGLECHAR, FALSE },	/* 174			 */
-  { SINGLECHAR, FALSE },	/* 175			 */
-  { SINGLECHAR, FALSE },	/* 176			 */
-  { SINGLECHAR, FALSE },	/* 177			 */
-  { SINGLECHAR, FALSE },	/* 178			 */
-  { SINGLECHAR, FALSE },	/* 179			 */
-  { SINGLECHAR, FALSE },	/* 180			 */
-  { SINGLECHAR, FALSE },	/* 181			 */
-  { SINGLECHAR, FALSE },	/* 182			 */
-  { SINGLECHAR, FALSE },	/* 183			 */
-  { SINGLECHAR, FALSE },	/* 184			 */
-  { SINGLECHAR, FALSE },	/* 185			 */
-  { SINGLECHAR, FALSE },	/* 186			 */
-  { SINGLECHAR, FALSE },	/* 187			 */
-  { SINGLECHAR, FALSE },	/* 188			 */
-  { SINGLECHAR, FALSE },	/* 189			 */
-  { SINGLECHAR, FALSE },	/* 190			 */
-  { SINGLECHAR, FALSE },	/* 191			 */
-  { SINGLECHAR, FALSE },	/* 192			 */
-  { SINGLECHAR, FALSE },	/* 193			 */
-  { SINGLECHAR, FALSE },	/* 194			 */
-  { SINGLECHAR, FALSE },	/* 195			 */
-  { SINGLECHAR, FALSE },	/* 196			 */
-  { SINGLECHAR, FALSE },	/* 197			 */
-  { SINGLECHAR, FALSE },	/* 198			 */
-  { SINGLECHAR, FALSE },	/* 199			 */
-  { SINGLECHAR, FALSE },	/* 200			 */
-  { SINGLECHAR, FALSE },	/* 201			 */
-  { SINGLECHAR, FALSE },	/* 202			 */
-  { SINGLECHAR, FALSE },	/* 203			 */
-  { SINGLECHAR, FALSE },	/* 204			 */
-  { SINGLECHAR, FALSE },	/* 205			 */
-  { SINGLECHAR, FALSE },	/* 206			 */
-  { SINGLECHAR, FALSE },	/* 207			 */
-  { SINGLECHAR, FALSE },	/* 208			 */
-  { SINGLECHAR, FALSE },	/* 209			 */
-  { SINGLECHAR, FALSE },	/* 210			 */
-  { SINGLECHAR, FALSE },	/* 211			 */
-  { SINGLECHAR, FALSE },	/* 212			 */
-  { SINGLECHAR, FALSE },	/* 213			 */
-  { SINGLECHAR, FALSE },	/* 214			 */
-  { SINGLECHAR, FALSE },	/* 215			 */
-  { SINGLECHAR, FALSE },	/* 216			 */
-  { SINGLECHAR, FALSE },	/* 217			 */
-  { SINGLECHAR, FALSE },	/* 218			 */
-  { SINGLECHAR, FALSE },	/* 219			 */
-  { SINGLECHAR, FALSE },	/* 220			 */
-  { SINGLECHAR, FALSE },	/* 221			 */
-  { SINGLECHAR, FALSE },	/* 222			 */
-  { SINGLECHAR, FALSE },	/* 223			 */
-  { SINGLECHAR, FALSE },	/* 224			 */
-  { SINGLECHAR, FALSE },	/* 225			 */
-  { SINGLECHAR, FALSE },	/* 226			 */
-  { SINGLECHAR, FALSE },	/* 227			 */
-  { SINGLECHAR, FALSE },	/* 228			 */
-  { SINGLECHAR, FALSE },	/* 229			 */
-  { SINGLECHAR, FALSE },	/* 230			 */
-  { SINGLECHAR, FALSE },	/* 231			 */
-  { SINGLECHAR, FALSE },	/* 232			 */
-  { SINGLECHAR, FALSE },	/* 233			 */
-  { SINGLECHAR, FALSE },	/* 234			 */
-  { SINGLECHAR, FALSE },	/* 235			 */
-  { SINGLECHAR, FALSE },	/* 236			 */
-  { SINGLECHAR, FALSE },	/* 237			 */
-  { SINGLECHAR, FALSE },	/* 238			 */
-  { SINGLECHAR, FALSE },	/* 239			 */
-  { SINGLECHAR, FALSE },	/* 240			 */
-  { SINGLECHAR, FALSE },	/* 241			 */
-  { SINGLECHAR, FALSE },	/* 242			 */
-  { SINGLECHAR, FALSE },	/* 243			 */
-  { SINGLECHAR, FALSE },	/* 244			 */
-  { SINGLECHAR, FALSE },	/* 245			 */
-  { SINGLECHAR, FALSE },	/* 246			 */
-  { SINGLECHAR, FALSE },	/* 247			 */
-  { SINGLECHAR, FALSE },	/* 248			 */
-  { SINGLECHAR, FALSE },	/* 249			 */
-  { SINGLECHAR, FALSE },	/* 250			 */
-  { SINGLECHAR, FALSE },	/* 251			 */
-  { SINGLECHAR, FALSE },	/* 252			 */
-  { SINGLECHAR, FALSE },	/* 253			 */
-  { SINGLECHAR, FALSE },	/* 254			 */
-  { SINGLECHAR, FALSE }		/* 255			 */
-};
-
-/*
-**++
-**  FUNCTION NAME:
-**
-**      lscanline ()
-**
-**  FORMAL PARAMETERS:
-**
-**      None
-**
-**  RETURN VALUE:
-**
-**      None
-**
-**  INVARIANTS:
-**
-**      [@description or none@]
-**
-**  DESCRIPTION:
-**
-**	One line of text is processed.
-**	Tokens are delivered via the call LSLScanFreshToken ().
-**
-**  EXCEPTIONS:
-**
-**--
-*/
-
-void
-lscanLine (char *currentLine)
-{
-  ltokenCode cod;	 
-  lsymbol sym;		
-  register char c;	
-  register char *bufptr;
-  ltoken newToken;	
-
-  c = *currentLine++;	
-  colNumber = 0;	
-
-  for (;;)
-    {			
-      bufptr = &tokenBuffer[0];	
-      startCol = colNumber;	
-
-      /*@-loopswitchbreak@*/
-      switch (lscanCharClass (c))
-	{			
-
-	case CHC_NULL:	
-	  sym = lsymbol_fromChars ("E O L");
-	  cod = LST_EOL;
-	  break;
-	  
-	 /* Identifiers */
-
-	case IDCHAR:
-
-	  while (lscanCharClass (c) == IDCHAR)
-	    {			
-	      MOVECHAR ();
-	    }
-
-	  *bufptr = '\0';	
-	  sym = lsymbol_fromChars (&tokenBuffer[0]);
-	  cod = LST_SIMPLEID;
-	  break;
-
-	 /* One-character tokens */
-
-	case SINGLECHAR:
-	case PERMCHAR:		
-	  MOVECHAR ();
-	  *bufptr = '\0';	
-	  sym = lsymbol_fromChars (&tokenBuffer[0]);
-	  cod = LST_SIMPLEOP;
-	  break;
-
-	case SLASHCHAR:
-	  if (*currentLine == '\\')
-	    {
-	      MOVECHAR ();
-	      MOVECHAR ();
-	      *bufptr = '\0';
-	      sym = lsymbol_fromChars (&tokenBuffer[0]);
-	      cod = LST_SIMPLEOP;
-	      break;
-	    }
-	  MOVECHAR ();
-	  /* We fall through to next case if we have / followed  */
-	  /* by anything else.					 */
-	  /*@fallthrough@*/
-	case OPCHAR: 
-
-	 /* Operator symbols */
-
-	 /* possible multi character */
-	  while (lscanCharClass (c) == OPCHAR)
-	    {			
-	      MOVECHAR ();
-	    }
-
-	  *bufptr = '\0';	/* null terminate in buffer */
-	  sym = lsymbol_fromChars (&tokenBuffer[0]);
-	  cod = LST_SIMPLEOP;
-	  break;
-
-	 /* White space */
-	case WHITECHAR:
-	  /*@-switchswitchbreak@*/
-	  switch (c)
-	    {
-	    case '\t':
-	      MOVECHAR ();
-	      colNumber--;
-	      colNumber += TABSIZE;
-	      colNumber -= (colNumber % TABSIZE);
-	      break;
-
-	    case '\v':
-	    case '\f':
-	      MOVECHAR ();
-	      colNumber--;
-	      break;
-
-	    default:
-	      MOVECHAR ();
-	      break;
-	    }
-	  *bufptr = '\0';	
-	  sym = lsymbol_fromChars (&tokenBuffer[0]);
-	  cod = LST_WHITESPACE;
-	  break;
-
-	case CHC_EXTENSION:	
-	  MOVECHAR ();
-
-	  switch (c)
-	    {			
-
-	     /* open and close */
-	    case '(':		
-	      MOVECHAR ();
-	      while (lscanCharClass (c) == IDCHAR)
-		{		
-		  MOVECHAR ();
-		}
-	      *bufptr = '\0';	
-	      sym = lsymbol_fromChars (&tokenBuffer[0]);
-	      cod = LST_OPENSYM;
-	      break;
-
-	    case ')':		
-	      MOVECHAR ();
-	      while (lscanCharClass (c) == IDCHAR)
-		{		
-		  MOVECHAR ();
-		}
-	      *bufptr = '\0';	
-	      sym = lsymbol_fromChars (&tokenBuffer[0]);
-	      cod = LST_CLOSESYM;
-	      break;
-
-	     /* separator */
-	    case ',':		
-	      MOVECHAR ();
-	      while (lscanCharClass (c) == IDCHAR)
-		{		
-		  MOVECHAR ();
-		}
-	      *bufptr = '\0';	
-	      sym = lsymbol_fromChars (&tokenBuffer[0]);
-	      cod = LST_SEPSYM;
-	      break;
-
-	      /* simpleid */
-	    case ':':		
-	      MOVECHAR ();
-	      while (lscanCharClass (c) == IDCHAR)
-		{		
-		  MOVECHAR ();
-		}
-	      *bufptr = '\0';	
-	      sym = lsymbol_fromChars (&tokenBuffer[0]);
-	      cod = LST_SIMPLEID;
-	      break;
-
-	    default:		
-	      if (lscanCharClass (c) == IDCHAR)
-		{
-		  do
-		    {
-		      MOVECHAR ();
-		    }
-		  while (lscanCharClass (c) == IDCHAR);
-		  *bufptr = '\0';
-		  sym = lsymbol_fromChars (&tokenBuffer[0]);
-		  cod = LST_SIMPLEOP;
-		}
-	      else
-		{
-		  /*
-                  ** Meets none of the above.  Take the extension	    
-		  ** character and the character following and treat	    
-		  ** together as a SINGLECHAR.  SINGLECHARs tranlate into 
-		  ** SIMPLEOPs.					    
-		  */
-
-		  MOVECHAR ();
-		  *bufptr = '\0';	
-		  sym = lsymbol_fromChars (&tokenBuffer[0]);
-		  cod = LST_SIMPLEOP;
-		}
-	      break;
-	    }
-	  /*@switchbreak@*/ break;	
-	  /*@=switchswitchbreak@*/
-	default:
-
-	  LocalUserError ("unexpected character in input");
-	  return;
-	}
-      /*@=loopswitchbreak@*/
-
-      /*
-      ** Above code only "guessed" at token type.  Insert it into the    
-      ** TokenTable.  If the token already exists, it is returned as
-      ** previously defined.  If it does not exist, it is inserted as the 
-      ** token code computed above.
-      */
-
-      newToken = LSLInsertToken (cod, sym, 0, FALSE);
-
-      if (LSLIsSyn (ltoken_getText (newToken)))
-	{
-	  /* 
-	  ** Token is a synonym.  Get the actual token and set the raw    
-	  ** text to the synonym name.				    
-	  */
-
-	  newToken = LSLGetTokenForSyn (ltoken_getText (newToken));
-	  ltoken_setRawText (newToken, sym);
-	}
-
-      ltoken_setCol (newToken, startCol);
-      ltoken_setLine (newToken, tsource_thisLineNumber (LSLScanSource ()));
-      ltoken_setFileName (newToken, tsource_fileName (LSLScanSource ()));
-      
-      if (ltoken_getCode (newToken) == LST_COMMENTSYM)
-	{
-	  bufptr = &tokenBuffer[0];
-
-	  while (!LSLIsEndComment (c))
-	    {
-	      MOVECHAR ();
-	    }
-	  if (lscanCharClass (c) != CHC_NULL)
-	    {
-	      MOVECHAR ();
-	    }
-	  if (reportComments)
-	    {
-	      *bufptr = '\0';
-	      ltoken_setRawText (newToken, lsymbol_fromChars (&tokenBuffer[0]));
-	      LSLScanFreshToken (newToken);
-	    }
-	}
-      else if (ltoken_getCode (newToken) == LST_EOL)
-	{
-	  if (reportEOL)
-	    {
-	      LSLScanFreshToken (newToken);
-	    }
-	  return;
-	}
-      else 
-	{
-	  if (cod != LST_WHITESPACE)
-	    {
-	      LSLScanFreshToken (newToken);
-	    }
-	}
-    }
-}
-
-ltoken
-LSLScanEofToken (void)
-{
-  ltoken t = ltoken_copy (LSLInsertToken (LEOFTOKEN, 
-					  lsymbol_fromChars ("E O F"),
-					  0, TRUE));
-  ltoken_setCol (t, colNumber);
-  ltoken_setLine (t, tsource_thisLineNumber (LSLScanSource ()));
-  ltoken_setFileName (t, tsource_fileName (LSLScanSource ()));
-  return t;
-}
-
-void
-LSLReportEolTokens (bool setting)
-{
-  reportEOL = setting;
-}
-
-static void
-  LocalUserError (char *msg)
-{
-  tsource *s = LSLScanSource ();
-  llfatalerror (message ("%s:%u,%u: %s", 
-			 cstring_fromChars (tsource_fileName (s)), 
-			 tsource_thisLineNumber (s), colNumber, 
-			 cstring_fromChars (msg)));
-}
-
-/*
-**++
-**  FUNCTION NAME:
-**
-**      lscanLineInit ()
-**
-**  FORMAL PARAMETERS:
-**
-**      None
-**
-**  RETURN VALUE:
-**
-**      None
-**
-**  INVARIANTS:
-**
-**      [@description or none@]
-**
-**  DESCRIPTION:
-**
-**      Initialize this module (should only be called once).
-**
-**  IMPLICIT INPUTS/OUTPUT:
-**
-**      GetNextLine - (output) initialized
-**	NullToken   - (output) initialized
-**      PrintName   - (output) array contents initialized
-**
-**  EXCEPTIONS:
-**
-**      None
-**--
-*/
-
-void
-lscanLineInit (void)
-{
-  int i;
-
-  reportEOL = FALSE;
-  reportComments = FALSE;
-
-  for (i = 0; i <= LASTCHAR; i++)
-    {
-      charClass[i] = charClassDef[i];
-    }
-
- /*
- ** NOTE: The following line ensures that all tokens have nonzero
- ** handles, so that a handle of zero can be used to indicate that a
- ** token does not have a synonym.
- */
-
-  (void) LSLReserveToken (LST_SIMPLEID, "dummy token");
-
-  ltoken_forall = LSLReserveToken (LST_QUANTIFIERSYM, "\\forall");
-  ltoken_true = LSLReserveToken (LST_SIMPLEID, "true");
-  ltoken_false = LSLReserveToken (LST_SIMPLEID, "false");
-  ltoken_not = LSLReserveToken (LST_SIMPLEOP, "\\not");
-  ltoken_and = LSLReserveToken (LST_LOGICALOP, "\\and");
-  ltoken_or = LSLReserveToken (LST_LOGICALOP, "\\or");
-  ltoken_implies = LSLReserveToken (LST_LOGICALOP, "\\implies");
-
-  ltoken_eq = LSLReserveToken (LST_EQOP, "\\eq");
-  ltoken_neq = LSLReserveToken (LST_EQOP, "\\neq");
-
-  ltoken_equals = LSLReserveToken (LST_EQUATIONSYM, "\\equals");
-  ltoken_eqsep = LSLReserveToken (LST_EQSEPSYM, "\\eqsep");
-  ltoken_select = LSLReserveToken (LST_SELECTSYM, "\\select");
-  ltoken_open = LSLReserveToken (LST_OPENSYM, "\\open");
-  ltoken_sep = LSLReserveToken (LST_SEPSYM, "\\,");
-  ltoken_close = LSLReserveToken (LST_CLOSESYM, "\\close");
-  ltoken_id = LSLReserveToken (LST_SIMPLEID, "\\:");
-  ltoken_arrow = LSLReserveToken (LST_MAPSYM, "\\arrow");
-  ltoken_farrow = LSLReserveToken (LST_FIELDMAPSYM, "\\field_arrow");
-
-  ltoken_marker = LSLReserveToken (LST_MARKERSYM, "\\marker");
-  ltoken_comment = LSLReserveToken (LST_COMMENTSYM, "\\comment");
-  ltoken_compose = LSLReserveToken (LST_COMPOSESYM, "\\composeSort");
-  ltoken_if = LSLReserveToken (LST_ifTOKEN, "if");
-
-  (void) LSLReserveToken (LST_LPAR, "(");
-  (void) LSLReserveToken (LST_RPAR, ")");
-  (void) LSLReserveToken (LST_COMMA, ",");
-  (void) LSLReserveToken (LST_COLON, ":");
-
-  (void) LSLReserveToken (LST_LBRACKET, "[");
-  (void) LSLReserveToken (LST_RBRACKET, "]");
-
-  (void) LSLReserveToken (LST_WHITESPACE, " ");
-  (void) LSLReserveToken (LST_WHITESPACE, "\t");
-  (void) LSLReserveToken (LST_WHITESPACE, "\n");
-
-  (void) LSLReserveToken (LEOFTOKEN, "E O F");
-  (void) LSLReserveToken (LST_EOL, "E O L");
-
-  (void) LSLReserveToken (LST_assertsTOKEN, "asserts");
-  (void) LSLReserveToken (LST_assumesTOKEN, "assumes");
-  (void) LSLReserveToken (LST_byTOKEN, "by");
-  (void) LSLReserveToken (LST_convertsTOKEN, "converts");
-  (void) LSLReserveToken (LST_elseTOKEN, "else");
-  (void) LSLReserveToken (LST_enumerationTOKEN, "enumeration");
-  (void) LSLReserveToken (LST_equationsTOKEN, "equations");
-  (void) LSLReserveToken (LST_exemptingTOKEN, "exempting");
-  (void) LSLReserveToken (LST_forTOKEN, "for");
-  (void) LSLReserveToken (LST_generatedTOKEN, "generated");
-  (void) LSLReserveToken (LST_impliesTOKEN, "implies");
-  (void) LSLReserveToken (LST_includesTOKEN, "includes");
-  (void) LSLReserveToken (LST_introducesTOKEN, "introduces");
-  (void) LSLReserveToken (LST_ofTOKEN, "of");
-  (void) LSLReserveToken (LST_partitionedTOKEN, "partitioned");
-  (void) LSLReserveToken (LST_thenTOKEN, "then");
-  (void) LSLReserveToken (LST_traitTOKEN, "trait");
-  (void) LSLReserveToken (LST_tupleTOKEN, "tuple");
-  (void) LSLReserveToken (LST_unionTOKEN, "union");
-}
-
-void
-lscanLineReset (void)
-{
-}
-
-void
-lscanLineCleanup (void)
-{
-}
-
-charCode lscanCharClass (char c)
-{
-  return charClass[(int)(c)].code;
-}
-
-bool LSLIsEndComment (char c)
-{
-  return charClass[(int)(c)].endCommentChar;
-}
-
-void lsetCharClass (char c, charCode cod)
-{
-  charClass[(int)(c)].code = cod;
-}
-
-void lsetEndCommentChar (char c, bool flag)
-{
-  charClass[(int)(c)].endCommentChar = flag;
-}
diff --git a/src/shift.c b/src/shift.c
deleted file mode 100644
index 3dac621..0000000
--- a/src/shift.c
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-
-/*
-** shift.c
-**
-** Larch shift sequence manager
-**
-**	Tokens are sent by the parser to this module.  Here they are saved
-**	for awhile in a stack, and delivered on demand during reduce actions.
-**	The coordination between what the parser sends here and what reduce
-**	consumes here must be maintained by the programmer.
-**
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "shift.h"
-
-/*@constant static int SHIFTMAX;@*/
-# define SHIFTMAX 200
-
-static o_ltoken Shifts[SHIFTMAX];
-static int shiftIndex;
-
-static bool Parsing_LSLinit = TRUE;
-
-static bool
-LSLGenIsEmptyShiftStack (void)
-{
-  return (shiftIndex == 0);
-}
-
-void LSLGenShift (ltoken tok)
-{
-  if (shiftIndex < SHIFTMAX)
-    {
-      Shifts[shiftIndex] = ltoken_copy (tok);
-      shiftIndex++;
-    }
-  else
-    {
-      llbuglit ("LSLGenShift: needs MoreMem ()");
-    }
-}
-
-extern void
-LSLGenShiftOnly (/*@only@*/ ltoken tok)
-{
-  if (shiftIndex < SHIFTMAX)
-    {
-      Shifts[shiftIndex] = tok;
-      shiftIndex++;
-    }
-  else
-    {
-      llbugexitlit ("LSLGenShift: needs MoreMem ()");
-    }
-}
-
-extern ltoken
-LSLGenTopPopShiftStack (void)
-{
-  if (LSLGenIsEmptyShiftStack ())
-    {
-      lclfatalbug ("LSLGenTopPopShiftStack: Empty stack");
-    }
-
-  /*@-retalias@*/
-  return Shifts[--shiftIndex];
-  /*@=retalias@*/
-}
-
-void
-LSLGenInit (bool LSLParse)
-{
-  Parsing_LSLinit = LSLParse;
-}
-
diff --git a/src/sigNodeSet.c b/src/sigNodeSet.c
deleted file mode 100644
index 5435d58..0000000
--- a/src/sigNodeSet.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** sigNodeSet.c
-**
-** based on set_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "intSet.h"
-
-static bool sigNodeSet_member (sigNodeSet p_s, sigNode p_el);
-
-/*@only@*/ sigNodeSet
-sigNodeSet_new ()
-{
-  sigNodeSet s = (sigNodeSet) dmalloc (sizeof (*s));
-
-  s->entries = 0;
-  s->nspace = sigNodeSetBASESIZE;
-  s->elements = (sigNode *) dmalloc (sizeof (*s->elements) * sigNodeSetBASESIZE);
-
-  return (s);
-}
-
-/*@only@*/ sigNodeSet
-sigNodeSet_singleton (sigNode el)
-{
-  sigNodeSet s = (sigNodeSet) dmalloc (sizeof (*s));
-
-  s->entries = 1;
-  s->nspace = sigNodeSetBASESIZE - 1;
-  s->elements = (sigNode *) dmalloc (sizeof (*s->elements) * sigNodeSetBASESIZE);
-  s->elements[0] = el;
-
-  return (s);
-}
-
-static void
-sigNodeSet_grow (/*@notnull@*/ sigNodeSet s)
-{
-  int i;
-  sigNode *newelements; 
-
-  s->nspace = sigNodeSetBASESIZE;
-  newelements = (sigNode *) dmalloc (sizeof (*newelements) 
-					   * (s->entries + s->nspace));
-  
-  for (i = 0; i < s->entries; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements); 
-  s->elements = newelements;
-}
-
-/*
-** Ensures: if *e \in *s
-**          then unchanged (*s) & result = false
-**          else *s' = insert (*s, *e) & result = true
-** Modifies: *s
-*/
-
-bool
-sigNodeSet_insert (sigNodeSet s, /*@owned@*/ sigNode el)
-{
-  llassert (sigNodeSet_isDefined (s));
-
-  if (sigNodeSet_member (s, el))
-    {
-      sigNode_free (el);
-      return FALSE;
-    }
-  else
-    {
-      if (s->nspace <= 0)
-	{
-	  sigNodeSet_grow (s);
-	}
-
-      s->nspace--;
-      s->elements[s->entries] = el;
-      s->entries++;
-      return TRUE;
-    }
-}
-
-static bool
-sigNodeSet_member (sigNodeSet s, sigNode el)
-{
-  if (sigNodeSet_isUndefined (s)) 
-    {
-      return FALSE;
-    }
-  else
-    {
-      int i;
-      
-      for (i = 0; i < s->entries; i++)
-	{
-	  if (sigNode_equal (el, s->elements[i]))
-	    return TRUE;
-	}
-      return FALSE;
-    }
-}
-
-/*@only@*/ cstring
-sigNodeSet_unparse (sigNodeSet s)
-{
-  int i;
-  cstring st = cstring_undefined;
-
-  if (sigNodeSet_isDefined (s))
-    {
-      for (i = 0; i < s->entries; i++)
-	{
-	  if (i == 0)
-	    {
-	      st = sigNode_unparse (s->elements[i]);
-	    }
-	  else
-	    st = message ("%q, %q", st, sigNode_unparse (s->elements[i]));
-	}
-    }
-     
-  return st;
-}
-
-/*@only@*/ cstring
-sigNodeSet_unparseSomeSigs (sigNodeSet s)
-{
-  int i;
-  cstring st = cstring_undefined;
-
-  if (sigNodeSet_isDefined (s))
-    {
-      for (i = 0; i < s->entries; i++)
-	{
-	  cstring t = sigNode_unparseText (s->elements[i]);
-	  
-	  if (i == 0)
-	    {
-	      st = cstring_copy (t);
-	      cstring_free (t);
-	    }
-	  else if (i > 5 && (s->entries > 8))
-	    {
-	      return (message ("%q; %q; ... (%d more signatures)",
-			       st, t, (s->entries - i - 1)));
-	    }
-	  else
-	    {
-	      st = message ("%q; %q", st, t);
-	    }
-	}
-    }
-     
-  return st;
-}
-
-/*@only@*/ cstring
-sigNodeSet_unparsePossibleAritys (sigNodeSet s)
-{
-  int i;
-  intSet is = intSet_new ();
-  cstring st;
-
-  if (sigNodeSet_isDefined (s))
-    {
-      for (i = 0; i < s->entries; i++)
-	{
-	  int arity = ltokenList_size ((s->elements[i])->domain);
-	  (void) intSet_insert (is, arity);
-	}
-    }
-
-  st = intSet_unparseText (is);
-  intSet_free (is);
-  return (st);
-}
-
-void
-sigNodeSet_free (sigNodeSet s)
-{
-  if (sigNodeSet_isDefined (s))
-    {
-      int i;
-      for (i = 0; i < s->entries; i++)
-	{
-	  sigNode_free (s->elements[i]); 
-	}
-      
-      sfree (s->elements); 
-      sfree (s);
-    }
-}
diff --git a/src/signature.c b/src/signature.c
deleted file mode 100644
index 2c47c6b..0000000
--- a/src/signature.c
+++ /dev/null
@@ -1,1323 +0,0 @@
-/*
-** Inserted at beginning of c files generated by bison
-** REMEMBER:  Change bison.reset too.
-*/
-
-/*@-allmacros@*/
-/*@+boolint@*/
-/*@+charint@*/
-/*@-macroparams@*/
-/*@-macroundef@*/
-/*@-unreachable@*/
-/*@-macrospec@*/
-/*@-varuse@*/
-/*@+ignorequals@*/
-/*@-macrostmt@*/
-/*@-noeffect@*/
-/*@-shadow@*/
-/*@-exitarg@*/
-/*@-macroredef@*/
-/*@-uniondef@*/
-/*@-compdef@*/
-/*@-matchfields@*/
-/*@-exportlocal@*/
-/*@-evalorderuncon@*/
-/*@-exportheader@*/
-/*@-typeuse@*/
-/*@-redecl@*/
-/*@-redef@*/
-/*@-noparams@*/
-/*@-ansireserved@*/
-/*@-fielduse@*/
-/*@-ifblock@*/
-/*@-elseifcomplete@*/
-/*@-whileblock@*/
-/*@-forblock@*/
-/*@-branchstate@*/
-/*@-readonlytrans@*/
-/*@-namechecks@*/
-/*@-usedef@*/
-/*@-systemunrecog@*/
-/*@-dependenttrans@*/
-/*@-unqualifiedtrans@*/
-/*@-nullassign@*/
-
-/* < end of bison.head > */
-
-
-/*  A Bison parser, made from signature.y
-    by GNU Bison version 1.28  */
-
-#define YYBISON 1  /* Identify Bison output.  */
-
-#define yyparse lslparse
-#define yylex lsllex
-#define yyerror lslerror
-#define yylval lsllval
-#define yychar lslchar
-#define yydebug lsldebug
-#define yynerrs lslnerrs
-#define	LST_SIMPLEID	257
-#define	LST_LOGICALOP	258
-#define	LST_EQOP	259
-#define	LST_SIMPLEOP	260
-#define	LST_MAPSYM	261
-#define	LST_FIELDMAPSYM	262
-#define	LST_MARKERSYM	263
-#define	LST_ifTOKEN	264
-#define	LST_thenTOKEN	265
-#define	LST_elseTOKEN	266
-#define	LST_LBRACKET	267
-#define	LST_RBRACKET	268
-#define	LST_SELECTSYM	269
-#define	LST_SEPSYM	270
-#define	LST_OPENSYM	271
-#define	LST_CLOSESYM	272
-#define	LST_COLON	273
-#define	LST_COMMA	274
-#define	LST_EOL	275
-#define	LST_COMMENTSYM	276
-#define	LST_WHITESPACE	277
-#define	LST_QUANTIFIERSYM	278
-#define	LST_EQUATIONSYM	279
-#define	LST_EQSEPSYM	280
-#define	LST_COMPOSESYM	281
-#define	LST_LPAR	282
-#define	LST_RPAR	283
-#define	LST_assertsTOKEN	284
-#define	LST_assumesTOKEN	285
-#define	LST_byTOKEN	286
-#define	LST_convertsTOKEN	287
-#define	LST_enumerationTOKEN	288
-#define	LST_equationsTOKEN	289
-#define	LST_exemptingTOKEN	290
-#define	LST_forTOKEN	291
-#define	LST_generatedTOKEN	292
-#define	LST_impliesTOKEN	293
-#define	LST_includesTOKEN	294
-#define	LST_introducesTOKEN	295
-#define	LST_ofTOKEN	296
-#define	LST_partitionedTOKEN	297
-#define	LST_traitTOKEN	298
-#define	LST_tupleTOKEN	299
-#define	LST_unionTOKEN	300
-#define	LST_BADTOKEN	301
-
-#line 36 "signature.y"
-
-
-# include "bison.reset"
-
-# include 
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "lslparse.h"
-# include "signature.h"
-
-void lslerror (char *);
-/*@dependent@*/ /*@null@*/ lslOp importedlslOp;
-
-/*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */
-static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */);
-/*@=noparams@*/
-
-# define YYPRINT(file, type, value) yyprint (file, type, value)
-
-# define YYDEBUG 1
-
-# include "bison.head"
-
-
-#line 73 "signature.y"
-typedef union {
-  ltoken ltok;  /* a leaf is also an ltoken */
-  unsigned int count;
-  /*@only@*/  ltokenList ltokenList;
-  /*@only@*/  opFormNode opform;
-  /*@owned@*/ sigNode signature;
-  /*@only@*/  nameNode name;
-  /*@owned@*/ lslOp operator;
-  /*@only@*/  lslOpList operators;
-} YYSTYPE;
-#ifndef YYDEBUG
-#define YYDEBUG 1
-#endif
-
-#include 
-
-#ifndef __cplusplus
-#ifndef __STDC__
-#define const
-#endif
-#endif
-
-
-
-#define	YYFINAL		62
-#define	YYFLAG		-32768
-#define	YYNTBASE	48
-
-#define YYTRANSLATE(x) ((unsigned)(x) <= 301 ? yytranslate[x] : 62)
-
-static const char yytranslate[] = {     0,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
-     7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
-    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
-    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
-    37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
-    47
-};
-
-#if YYDEBUG != 0
-static const short yyprhs[] = {     0,
-     0,     2,     4,     7,    11,    13,    15,    22,    24,    27,
-    30,    34,    38,    43,    48,    54,    58,    63,    68,    74,
-    77,    81,    85,    87,    89,    91,    92,    94,    96,   100,
-   102,   104,   108,   109,   111,   113,   117,   119
-};
-
-static const short yyrhs[] = {    49,
-     0,    50,     0,    49,    50,     0,    51,    19,    57,     0,
-    61,     0,    52,     0,    10,     9,    11,     9,    12,     9,
-     0,    53,     0,     9,    53,     0,    53,     9,     0,     9,
-    53,     9,     0,    17,    54,    18,     0,     9,    17,    54,
-    18,     0,    17,    54,    18,     9,     0,     9,    17,    54,
-    18,     9,     0,    13,    54,    14,     0,     9,    13,    54,
-    14,     0,    13,    54,    14,     9,     0,     9,    13,    54,
-    14,     9,     0,    15,     3,     0,     9,    15,     3,     0,
-     9,     8,     3,     0,     6,     0,     4,     0,     5,     0,
-     0,    55,     0,     9,     0,    55,    56,     9,     0,    20,
-     0,    16,     0,    58,     7,    60,     0,     0,    59,     0,
-    60,     0,    59,    20,    60,     0,     3,     0,     3,     0
-};
-
-#endif
-
-#if YYDEBUG != 0
-static const short yyrline[] = { 0,
-   139,   141,   146,   150,   156,   158,   162,   164,   166,   168,
-   170,   172,   174,   176,   178,   181,   184,   187,   190,   193,
-   196,   201,   206,   208,   210,   213,   215,   218,   220,   223,
-   225,   228,   231,   233,   236,   238,   241,   247
-};
-#endif
-
-
-#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
-
-static const char * const yytname[] = {   "$","error","$undefined.","LST_SIMPLEID",
-"LST_LOGICALOP","LST_EQOP","LST_SIMPLEOP","LST_MAPSYM","LST_FIELDMAPSYM","LST_MARKERSYM",
-"LST_ifTOKEN","LST_thenTOKEN","LST_elseTOKEN","LST_LBRACKET","LST_RBRACKET",
-"LST_SELECTSYM","LST_SEPSYM","LST_OPENSYM","LST_CLOSESYM","LST_COLON","LST_COMMA",
-"LST_EOL","LST_COMMENTSYM","LST_WHITESPACE","LST_QUANTIFIERSYM","LST_EQUATIONSYM",
-"LST_EQSEPSYM","LST_COMPOSESYM","LST_LPAR","LST_RPAR","LST_assertsTOKEN","LST_assumesTOKEN",
-"LST_byTOKEN","LST_convertsTOKEN","LST_enumerationTOKEN","LST_equationsTOKEN",
-"LST_exemptingTOKEN","LST_forTOKEN","LST_generatedTOKEN","LST_impliesTOKEN",
-"LST_includesTOKEN","LST_introducesTOKEN","LST_ofTOKEN","LST_partitionedTOKEN",
-"LST_traitTOKEN","LST_tupleTOKEN","LST_unionTOKEN","LST_BADTOKEN","top","operatorList",
-"operator","name","opForm","anyOp","middle","placeList","separator","signature",
-"domain","sortList","sortId","opId", NULL
-};
-#endif
-
-static const short yyr1[] = {     0,
-    48,    49,    49,    50,    51,    51,    52,    52,    52,    52,
-    52,    52,    52,    52,    52,    52,    52,    52,    52,    52,
-    52,    52,    53,    53,    53,    54,    54,    55,    55,    56,
-    56,    57,    58,    58,    59,    59,    60,    61
-};
-
-static const short yyr2[] = {     0,
-     1,     1,     2,     3,     1,     1,     6,     1,     2,     2,
-     3,     3,     4,     4,     5,     3,     4,     4,     5,     2,
-     3,     3,     1,     1,     1,     0,     1,     1,     3,     1,
-     1,     3,     0,     1,     1,     3,     1,     1
-};
-
-static const short yydefact[] = {     0,
-    38,    24,    25,    23,     0,     0,    26,     0,    26,     1,
-     2,     0,     6,     8,     5,     0,    26,     0,    26,     9,
-     0,    28,     0,    27,    20,     0,     3,    33,    10,    22,
-     0,    21,     0,    11,     0,    16,    31,    30,     0,    12,
-    37,     4,     0,    34,    35,    17,    13,     0,    18,    29,
-    14,     0,     0,    19,    15,     0,    32,    36,     7,     0,
-     0,     0
-};
-
-static const short yydefgoto[] = {    60,
-    10,    11,    12,    13,    14,    23,    24,    39,    42,    43,
-    44,    45,    15
-};
-
-static const short yypact[] = {    -3,
--32768,-32768,-32768,-32768,    11,    -4,     0,     8,     0,    -3,
--32768,    -1,-32768,    13,-32768,    17,     0,    22,     0,    18,
-    20,-32768,    19,   -12,-32768,    14,-32768,    31,-32768,-32768,
-    21,-32768,    23,-32768,    27,    28,-32768,-32768,    29,    30,
--32768,-32768,    33,    24,-32768,    34,    36,    35,-32768,-32768,
--32768,    31,    31,-32768,-32768,    37,-32768,-32768,-32768,    42,
-    48,-32768
-};
-
-static const short yypgoto[] = {-32768,
--32768,    39,-32768,-32768,    45,     4,-32768,-32768,-32768,-32768,
--32768,   -23,-32768
-};
-
-
-#define	YYLAST		50
-
-
-static const short yytable[] = {     1,
-     2,     3,     4,    37,    21,     5,     6,    38,    22,     7,
-    25,     8,    26,     9,     2,     3,     4,    28,    16,    30,
-    31,    29,    33,    17,    32,    18,    34,    19,    57,    58,
-    35,    40,    36,    41,    46,    48,    49,    50,    51,    52,
-    47,    61,    54,    53,    55,    59,    56,    62,    27,    20
-};
-
-static const short yycheck[] = {     3,
-     4,     5,     6,    16,     9,     9,    10,    20,     9,    13,
-     3,    15,     9,    17,     4,     5,     6,    19,     8,     3,
-    17,     9,    19,    13,     3,    15,     9,    17,    52,    53,
-    11,    18,    14,     3,    14,     9,     9,     9,     9,     7,
-    18,     0,     9,    20,     9,     9,    12,     0,    10,     5
-};
-#define YYPURE 1
-
-/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
-#line 3 "/af10/evans/bison-1.28/share/bison.simple"
-/* This file comes from bison-1.28.  */
-
-/* Skeleton output parser for bison,
-   Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
-
-/* This is the parser code that is written into each bison parser
-  when the %semantic_parser declaration is not specified in the grammar.
-  It was written by Richard Stallman by simplifying the hairy parser
-  used when %semantic_parser is specified.  */
-
-#ifndef YYSTACK_USE_ALLOCA
-#ifdef alloca
-#define YYSTACK_USE_ALLOCA
-#else /* alloca not defined */
-#ifdef __GNUC__
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#else /* not GNU C.  */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
-#define YYSTACK_USE_ALLOCA
-#include 
-#else /* not sparc */
-/* We think this test detects Watcom and Microsoft C.  */
-/* This used to test MSDOS, but that is a bad idea
-   since that symbol is in the user namespace.  */
-#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
-#if 0 /* No need for malloc.h, which pollutes the namespace;
-	 instead, just don't use alloca.  */
-#include 
-#endif
-#else /* not MSDOS, or __TURBOC__ */
-#if defined(_AIX)
-/* I don't know what this was needed for, but it pollutes the namespace.
-   So I turned it off.   rms, 2 May 1997.  */
-/* #include   */
- #pragma alloca
-#define YYSTACK_USE_ALLOCA
-#else /* not MSDOS, or __TURBOC__, or _AIX */
-#if 0
-#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
-		 and on HPUX 10.  Eventually we can turn this on.  */
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#endif /* __hpux */
-#endif
-#endif /* not _AIX */
-#endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc */
-#endif /* not GNU C */
-#endif /* alloca not defined */
-#endif /* YYSTACK_USE_ALLOCA not defined */
-
-#ifdef YYSTACK_USE_ALLOCA
-#define YYSTACK_ALLOC alloca
-#else
-#define YYSTACK_ALLOC malloc
-#endif
-
-/* Note: there must be only one dollar sign in this file.
-   It is replaced by the list of actions, each action
-   as one case of the switch.  */
-
-#define yyerrok		(yyerrstatus = 0)
-#define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		-2
-#define YYEOF		0
-#define YYACCEPT	goto yyacceptlab
-#define YYABORT 	goto yyabortlab
-#define YYERROR		goto yyerrlab1
-/* Like YYERROR except do call yyerror.
-   This remains here temporarily to ease the
-   transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
-#define YYFAIL		goto yyerrlab
-#define YYRECOVERING()  (!!yyerrstatus)
-#define YYBACKUP(token, value) \
-do								\
-  if (yychar == YYEMPTY && yylen == 1)				\
-    { yychar = (token), yylval = (value);			\
-      yychar1 = YYTRANSLATE (yychar);				\
-      YYPOPSTACK;						\
-      goto yybackup;						\
-    }								\
-  else								\
-    { yyerror ("syntax error: cannot back up"); YYERROR; }	\
-while (0)
-
-#define YYTERROR	1
-#define YYERRCODE	256
-
-#ifndef YYPURE
-#define YYLEX		yylex()
-#endif
-
-#ifdef YYPURE
-#ifdef YYLSP_NEEDED
-#ifdef YYLEX_PARAM
-#define YYLEX		yylex(&yylval, &yylloc, YYLEX_PARAM)
-#else
-#define YYLEX		yylex(&yylval, &yylloc)
-#endif
-#else /* not YYLSP_NEEDED */
-#ifdef YYLEX_PARAM
-#define YYLEX		yylex(&yylval, YYLEX_PARAM)
-#else
-#define YYLEX		yylex(&yylval)
-#endif
-#endif /* not YYLSP_NEEDED */
-#endif
-
-/* If nonreentrant, generate the variables here */
-
-#ifndef YYPURE
-
-int	yychar;			/*  the lookahead symbol		*/
-YYSTYPE	yylval;			/*  the semantic value of the		*/
-				/*  lookahead symbol			*/
-
-#ifdef YYLSP_NEEDED
-YYLTYPE yylloc;			/*  location data for the lookahead	*/
-				/*  symbol				*/
-#endif
-
-int yynerrs;			/*  number of parse errors so far       */
-#endif  /* not YYPURE */
-
-#if YYDEBUG != 0
-int yydebug;			/*  nonzero means print parse trace	*/
-/* Since this is uninitialized, it does not stop multiple parsers
-   from coexisting.  */
-#endif
-
-/*  YYINITDEPTH indicates the initial size of the parser's stacks	*/
-
-#ifndef	YYINITDEPTH
-#define YYINITDEPTH 200
-#endif
-
-/*  YYMAXDEPTH is the maximum size the stacks can grow to
-    (effective only if the built-in stack extension method is used).  */
-
-#if YYMAXDEPTH == 0
-#undef YYMAXDEPTH
-#endif
-
-#ifndef YYMAXDEPTH
-#define YYMAXDEPTH 10000
-#endif
-
-/* Define __yy_memcpy.  Note that the size argument
-   should be passed with type unsigned int, because that is what the non-GCC
-   definitions require.  With GCC, __builtin_memcpy takes an arg
-   of type size_t, but it can handle unsigned int.  */
-
-#if __GNUC__ > 1		/* GNU C and GNU C++ define this.  */
-#define __yy_memcpy(TO,FROM,COUNT)	__builtin_memcpy(TO,FROM,COUNT)
-#else				/* not GNU C or C++ */
-#ifndef __cplusplus
-
-/* This is the most reliable way to avoid incompatibilities
-   in available built-in functions on various systems.  */
-static void
-__yy_memcpy (to, from, count)
-     char *to;
-     char *from;
-     unsigned int count;
-{
-  register char *f = from;
-  register char *t = to;
-  register int i = count;
-
-  while (i-- > 0)
-    *t++ = *f++;
-}
-
-#else /* __cplusplus */
-
-/* This is the most reliable way to avoid incompatibilities
-   in available built-in functions on various systems.  */
-static void
-__yy_memcpy (char *to, char *from, unsigned int count)
-{
-  register char *t = to;
-  register char *f = from;
-  register int i = count;
-
-  while (i-- > 0)
-    *t++ = *f++;
-}
-
-#endif
-#endif
-
-#line 217 "/af10/evans/bison-1.28/share/bison.simple"
-
-/* The user can define YYPARSE_PARAM as the name of an argument to be passed
-   into yyparse.  The argument should have type void *.
-   It should actually point to an object.
-   Grammar actions can access the variable by casting it
-   to the proper pointer type.  */
-
-#ifdef YYPARSE_PARAM
-#ifdef __cplusplus
-#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL
-#else /* not __cplusplus */
-#define YYPARSE_PARAM_ARG YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
-#endif /* not __cplusplus */
-#else /* not YYPARSE_PARAM */
-#define YYPARSE_PARAM_ARG
-#define YYPARSE_PARAM_DECL
-#endif /* not YYPARSE_PARAM */
-
-/* Prevent warning if -Wstrict-prototypes.  */
-#ifdef __GNUC__
-#ifdef YYPARSE_PARAM
-int yyparse (void *);
-#else
-int yyparse (void);
-#endif
-#endif
-
-int
-yyparse(YYPARSE_PARAM_ARG)
-     YYPARSE_PARAM_DECL
-{
-  register int yystate;
-  register int yyn;
-  register short *yyssp;
-  register YYSTYPE *yyvsp;
-  int yyerrstatus;	/*  number of tokens to shift before error messages enabled */
-  int yychar1 = 0;		/*  lookahead token as an internal (translated) token number */
-
-  short	yyssa[YYINITDEPTH];	/*  the state stack			*/
-  YYSTYPE yyvsa[YYINITDEPTH];	/*  the semantic value stack		*/
-
-  short *yyss = yyssa;		/*  refer to the stacks thru separate pointers */
-  YYSTYPE *yyvs = yyvsa;	/*  to allow yyoverflow to reallocate them elsewhere */
-
-#ifdef YYLSP_NEEDED
-  YYLTYPE yylsa[YYINITDEPTH];	/*  the location stack			*/
-  YYLTYPE *yyls = yylsa;
-  YYLTYPE *yylsp;
-
-#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
-#else
-#define YYPOPSTACK   (yyvsp--, yyssp--)
-#endif
-
-  int yystacksize = YYINITDEPTH;
-  int yyfree_stacks = 0;
-
-#ifdef YYPURE
-  int yychar;
-  YYSTYPE yylval;
-  int yynerrs;
-#ifdef YYLSP_NEEDED
-  YYLTYPE yylloc;
-#endif
-#endif
-
-  YYSTYPE yyval;		/*  the variable used to return		*/
-				/*  semantic values from the action	*/
-				/*  routines				*/
-
-  int yylen;
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Starting parse\n");
-#endif
-
-  yystate = 0;
-  yyerrstatus = 0;
-  yynerrs = 0;
-  yychar = YYEMPTY;		/* Cause a token to be read.  */
-
-  /* Initialize stack pointers.
-     Waste one element of value and location stack
-     so that they stay on the same level as the state stack.
-     The wasted elements are never initialized.  */
-
-  yyssp = yyss - 1;
-  yyvsp = yyvs;
-#ifdef YYLSP_NEEDED
-  yylsp = yyls;
-#endif
-
-/* Push a new state, which is found in  yystate  .  */
-/* In all cases, when you get here, the value and location stacks
-   have just been pushed. so pushing a state here evens the stacks.  */
-yynewstate:
-
-  *++yyssp = yystate;
-
-  if (yyssp >= yyss + yystacksize - 1)
-    {
-      /* Give user a chance to reallocate the stack */
-      /* Use copies of these so that the &'s don't force the real ones into memory. */
-      YYSTYPE *yyvs1 = yyvs;
-      short *yyss1 = yyss;
-#ifdef YYLSP_NEEDED
-      YYLTYPE *yyls1 = yyls;
-#endif
-
-      /* Get the current used size of the three stacks, in elements.  */
-      int size = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-      /* Each stack pointer address is followed by the size of
-	 the data in use in that stack, in bytes.  */
-#ifdef YYLSP_NEEDED
-      /* This used to be a conditional around just the two extra args,
-	 but that might be undefined if yyoverflow is a macro.  */
-      yyoverflow("parser stack overflow",
-		 &yyss1, size * sizeof (*yyssp),
-		 &yyvs1, size * sizeof (*yyvsp),
-		 &yyls1, size * sizeof (*yylsp),
-		 &yystacksize);
-#else
-      yyoverflow("parser stack overflow",
-		 &yyss1, size * sizeof (*yyssp),
-		 &yyvs1, size * sizeof (*yyvsp),
-		 &yystacksize);
-#endif
-
-      yyss = yyss1; yyvs = yyvs1;
-#ifdef YYLSP_NEEDED
-      yyls = yyls1;
-#endif
-#else /* no yyoverflow */
-      /* Extend the stack our own way.  */
-      if (yystacksize >= YYMAXDEPTH)
-	{
-	  yyerror("parser stack overflow");
-	  if (yyfree_stacks)
-	    {
-	      free (yyss);
-	      free (yyvs);
-#ifdef YYLSP_NEEDED
-	      free (yyls);
-#endif
-	    }
-	  return 2;
-	}
-      yystacksize *= 2;
-      if (yystacksize > YYMAXDEPTH)
-	yystacksize = YYMAXDEPTH;
-#ifndef YYSTACK_USE_ALLOCA
-      yyfree_stacks = 1;
-#endif
-      yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
-      __yy_memcpy ((char *)yyss, (char *)yyss1,
-		   size * (unsigned int) sizeof (*yyssp));
-      yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
-      __yy_memcpy ((char *)yyvs, (char *)yyvs1,
-		   size * (unsigned int) sizeof (*yyvsp));
-#ifdef YYLSP_NEEDED
-      yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
-      __yy_memcpy ((char *)yyls, (char *)yyls1,
-		   size * (unsigned int) sizeof (*yylsp));
-#endif
-#endif /* no yyoverflow */
-
-      yyssp = yyss + size - 1;
-      yyvsp = yyvs + size - 1;
-#ifdef YYLSP_NEEDED
-      yylsp = yyls + size - 1;
-#endif
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Stack size increased to %d\n", yystacksize);
-#endif
-
-      if (yyssp >= yyss + yystacksize - 1)
-	YYABORT;
-    }
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Entering state %d\n", yystate);
-#endif
-
-  goto yybackup;
- yybackup:
-
-/* Do appropriate processing given the current state.  */
-/* Read a lookahead token if we need one and don't already have one.  */
-/* yyresume: */
-
-  /* First try to decide what to do without reference to lookahead token.  */
-
-  yyn = yypact[yystate];
-  if (yyn == YYFLAG)
-    goto yydefault;
-
-  /* Not known => get a lookahead token if don't already have one.  */
-
-  /* yychar is either YYEMPTY or YYEOF
-     or a valid token in external form.  */
-
-  if (yychar == YYEMPTY)
-    {
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Reading a token: ");
-#endif
-      yychar = YYLEX;
-    }
-
-  /* Convert token to internal form (in yychar1) for indexing tables with */
-
-  if (yychar <= 0)		/* This means end of input. */
-    {
-      yychar1 = 0;
-      yychar = YYEOF;		/* Don't call YYLEX any more */
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Now at end of input.\n");
-#endif
-    }
-  else
-    {
-      yychar1 = YYTRANSLATE(yychar);
-
-#if YYDEBUG != 0
-      if (yydebug)
-	{
-	  fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
-	  /* Give the individual parser a way to print the precise meaning
-	     of a token, for further debugging info.  */
-#ifdef YYPRINT
-	  YYPRINT (stderr, yychar, yylval);
-#endif
-	  fprintf (stderr, ")\n");
-	}
-#endif
-    }
-
-  yyn += yychar1;
-  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
-    goto yydefault;
-
-  yyn = yytable[yyn];
-
-  /* yyn is what to do for this token type in this state.
-     Negative => reduce, -yyn is rule number.
-     Positive => shift, yyn is new state.
-       New state is final state => don't bother to shift,
-       just return success.
-     0, or most negative number => error.  */
-
-  if (yyn < 0)
-    {
-      if (yyn == YYFLAG)
-	goto yyerrlab;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-  else if (yyn == 0)
-    goto yyerrlab;
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-  /* Shift the lookahead token.  */
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
-#endif
-
-  /* Discard the token being shifted unless it is eof.  */
-  if (yychar != YYEOF)
-    yychar = YYEMPTY;
-
-  *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
-  *++yylsp = yylloc;
-#endif
-
-  /* count tokens shifted since error; after three, turn off error status.  */
-  if (yyerrstatus) yyerrstatus--;
-
-  yystate = yyn;
-  goto yynewstate;
-
-/* Do the default action for the current state.  */
-yydefault:
-
-  yyn = yydefact[yystate];
-  if (yyn == 0)
-    goto yyerrlab;
-
-/* Do a reduction.  yyn is the number of a rule to reduce with.  */
-yyreduce:
-  yylen = yyr2[yyn];
-  if (yylen > 0)
-    yyval = yyvsp[1-yylen]; /* implement default value of the action */
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      int i;
-
-      fprintf (stderr, "Reducing via rule %d (line %d), ",
-	       yyn, yyrline[yyn]);
-
-      /* Print the symbols being reduced, and their result.  */
-      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
-	fprintf (stderr, "%s ", yytname[yyrhs[i]]);
-      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
-    }
-#endif
-
-
-  switch (yyn) {
-
-case 1:
-#line 139 "signature.y"
-{ lslOpList_free (yyvsp[0].operators); ;
-    break;}
-case 2:
-#line 142 "signature.y"
-{ lslOpList x = lslOpList_new ();
-		g_importedlslOp = yyvsp[0].operator;
-		lslOpList_add (x, yyvsp[0].operator);
- 		yyval.operators = x; ;
-    break;}
-case 3:
-#line 147 "signature.y"
-{ lslOpList_add (yyvsp[-1].operators, yyvsp[0].operator);
-		yyval.operators = yyvsp[-1].operators; ;
-    break;}
-case 4:
-#line 151 "signature.y"
-{ yyval.operator = makelslOpNode (yyvsp[-2].name, yyvsp[0].signature); ;
-    break;}
-case 5:
-#line 157 "signature.y"
-{ yyval.name = makeNameNodeId (yyvsp[0].ltok); ;
-    break;}
-case 6:
-#line 159 "signature.y"
-{ yyval.name = makeNameNodeForm (yyvsp[0].opform); ;
-    break;}
-case 7:
-#line 163 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-5].ltok, OPF_IF, opFormUnion_createMiddle (0), ltoken_undefined); ;
-    break;}
-case 8:
-#line 165 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[0].ltok, OPF_ANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 9:
-#line 167 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 10:
-#line 169 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_ANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
-    break;}
-case 11:
-#line 171 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
-    break;}
-case 12:
-#line 173 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 13:
-#line 175 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 14:
-#line 177 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 15:
-#line 179 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLEM, 
-			      opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 16:
-#line 182 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMIDDLE, 
-			      opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 17:
-#line 185 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMMIDDLE, 
-			      opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 18:
-#line 188 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMIDDLEM, 
-			    opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 19:
-#line 191 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMMIDDLEM, 
-			    opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 20:
-#line 194 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_SELECT, 
-			    opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 21:
-#line 197 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MSELECT, 
-			    opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 22:
-#line 202 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMAP, 
-			    opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 23:
-#line 207 "signature.y"
-{ yyval.ltok = yyvsp[0].ltok; ;
-    break;}
-case 24:
-#line 209 "signature.y"
-{ yyval.ltok = yyvsp[0].ltok; ;
-    break;}
-case 25:
-#line 211 "signature.y"
-{ yyval.ltok = yyvsp[0].ltok; ;
-    break;}
-case 26:
-#line 214 "signature.y"
-{ yyval.count = 0; ;
-    break;}
-case 27:
-#line 216 "signature.y"
-{ yyval.count = yyvsp[0].count; ;
-    break;}
-case 28:
-#line 219 "signature.y"
-{ yyval.count = 1; ;
-    break;}
-case 29:
-#line 221 "signature.y"
-{ yyval.count = yyvsp[-2].count + 1; ;
-    break;}
-case 30:
-#line 224 "signature.y"
-{ yyval.ltok = yyvsp[0].ltok; ;
-    break;}
-case 31:
-#line 226 "signature.y"
-{ yyval.ltok = yyvsp[0].ltok; ;
-    break;}
-case 32:
-#line 229 "signature.y"
-{ yyval.signature = makesigNode (yyvsp[-1].ltok, yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 33:
-#line 232 "signature.y"
-{ yyval.ltokenList = ltokenList_new (); ;
-    break;}
-case 34:
-#line 234 "signature.y"
-{ yyval.ltokenList = yyvsp[0].ltokenList; ;
-    break;}
-case 35:
-#line 237 "signature.y"
-{ yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
-    break;}
-case 36:
-#line 239 "signature.y"
-{ yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 37:
-#line 242 "signature.y"
-{ 
-	  yyval.ltok = yyvsp[0].ltok; 
-	  ltoken_setText (yyval.ltok, processTraitSortId (ltoken_getText (yyvsp[0].ltok))); 
-	;
-    break;}
-case 38:
-#line 248 "signature.y"
-{ yyval.ltok = yyvsp[0].ltok; ;
-    break;}
-}
-   /* the action file gets copied in in place of this dollarsign */
-#line 543 "/af10/evans/bison-1.28/share/bison.simple"
-
-  yyvsp -= yylen;
-  yyssp -= yylen;
-#ifdef YYLSP_NEEDED
-  yylsp -= yylen;
-#endif
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      short *ssp1 = yyss - 1;
-      fprintf (stderr, "state stack now");
-      while (ssp1 != yyssp)
-	fprintf (stderr, " %d", *++ssp1);
-      fprintf (stderr, "\n");
-    }
-#endif
-
-  *++yyvsp = yyval;
-
-#ifdef YYLSP_NEEDED
-  yylsp++;
-  if (yylen == 0)
-    {
-      yylsp->first_line = yylloc.first_line;
-      yylsp->first_column = yylloc.first_column;
-      yylsp->last_line = (yylsp-1)->last_line;
-      yylsp->last_column = (yylsp-1)->last_column;
-      yylsp->text = 0;
-    }
-  else
-    {
-      yylsp->last_line = (yylsp+yylen-1)->last_line;
-      yylsp->last_column = (yylsp+yylen-1)->last_column;
-    }
-#endif
-
-  /* Now "shift" the result of the reduction.
-     Determine what state that goes to,
-     based on the state we popped back to
-     and the rule number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
-  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTBASE];
-
-  goto yynewstate;
-
-yyerrlab:   /* here on detecting error */
-
-  if (! yyerrstatus)
-    /* If not already recovering from an error, report this error.  */
-    {
-      ++yynerrs;
-
-#ifdef YYERROR_VERBOSE
-      yyn = yypact[yystate];
-
-      if (yyn > YYFLAG && yyn < YYLAST)
-	{
-	  int size = 0;
-	  char *msg;
-	  int x, count;
-
-	  count = 0;
-	  /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
-	  for (x = (yyn < 0 ? -yyn : 0);
-	       x < (sizeof(yytname) / sizeof(char *)); x++)
-	    if (yycheck[x + yyn] == x)
-	      size += strlen(yytname[x]) + 15, count++;
-	  msg = (char *) malloc(size + 15);
-	  if (msg != 0)
-	    {
-	      strcpy(msg, "parse error");
-
-	      if (count < 5)
-		{
-		  count = 0;
-		  for (x = (yyn < 0 ? -yyn : 0);
-		       x < (sizeof(yytname) / sizeof(char *)); x++)
-		    if (yycheck[x + yyn] == x)
-		      {
-			strcat(msg, count == 0 ? ", expecting `" : " or `");
-			strcat(msg, yytname[x]);
-			strcat(msg, "'");
-			count++;
-		      }
-		}
-	      yyerror(msg);
-	      free(msg);
-	    }
-	  else
-	    yyerror ("parse error; also virtual memory exceeded");
-	}
-      else
-#endif /* YYERROR_VERBOSE */
-	yyerror("parse error");
-    }
-
-  goto yyerrlab1;
-yyerrlab1:   /* here on error raised explicitly by an action */
-
-  if (yyerrstatus == 3)
-    {
-      /* if just tried and failed to reuse lookahead token after an error, discard it.  */
-
-      /* return failure if at end of input */
-      if (yychar == YYEOF)
-	YYABORT;
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
-#endif
-
-      yychar = YYEMPTY;
-    }
-
-  /* Else will try to reuse lookahead token
-     after shifting the error token.  */
-
-  yyerrstatus = 3;		/* Each real token shifted decrements this */
-
-  goto yyerrhandle;
-
-yyerrdefault:  /* current state does not do anything special for the error token. */
-
-#if 0
-  /* This is wrong; only states that explicitly want error tokens
-     should shift them.  */
-  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
-  if (yyn) goto yydefault;
-#endif
-
-yyerrpop:   /* pop the current state because it cannot handle the error token */
-
-  if (yyssp == yyss) YYABORT;
-  yyvsp--;
-  yystate = *--yyssp;
-#ifdef YYLSP_NEEDED
-  yylsp--;
-#endif
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      short *ssp1 = yyss - 1;
-      fprintf (stderr, "Error: state stack now");
-      while (ssp1 != yyssp)
-	fprintf (stderr, " %d", *++ssp1);
-      fprintf (stderr, "\n");
-    }
-#endif
-
-yyerrhandle:
-
-  yyn = yypact[yystate];
-  if (yyn == YYFLAG)
-    goto yyerrdefault;
-
-  yyn += YYTERROR;
-  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
-    goto yyerrdefault;
-
-  yyn = yytable[yyn];
-  if (yyn < 0)
-    {
-      if (yyn == YYFLAG)
-	goto yyerrpop;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-  else if (yyn == 0)
-    goto yyerrpop;
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Shifting error token, ");
-#endif
-
-  *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
-  *++yylsp = yylloc;
-#endif
-
-  yystate = yyn;
-  goto yynewstate;
-
- yyacceptlab:
-  /* YYACCEPT comes here.  */
-  if (yyfree_stacks)
-    {
-      free (yyss);
-      free (yyvs);
-#ifdef YYLSP_NEEDED
-      free (yyls);
-#endif
-    }
-  return 0;
-
- yyabortlab:
-  /* YYABORT comes here.  */
-  if (yyfree_stacks)
-    {
-      free (yyss);
-      free (yyvs);
-#ifdef YYLSP_NEEDED
-      free (yyls);
-#endif
-    }
-  return 1;
-}
-#line 249 "signature.y"
-
-
-# include "bison.reset"
-
-extern char *yytext;
-
-void lslerror (char *s) 
-{
-  llfatalbug 
-    (cstring_makeLiteral 
-     ("There has been a problem parsing an LSL signature. This is believed to "
-      "result from a problem with gcc version 2.95 optimizations, "
-      "but it has not been confirmed.  Please try rebuidling LCLint "
-      "without the -O option."));
-
-}
-
-static void yyprint (FILE *file, int type, YYSTYPE value)
-{
-  fprintf (file, " (%u:%u type: %d; text: %s) ", 
-	   ltoken_getLine (value.ltok), 
-	   ltoken_getCol (value.ltok), 
-	   type, 
-	   ltoken_getRawTextChars (value.ltok));
-}
-
-extern void PrintToken (ltoken tok) {
-  char *codStr;
-  
-  switch (ltoken_getCode (tok)) 
-    {
-    case NOTTOKEN:          codStr = "*** NOTTOKEN ***"; break;
-    case LST_QUANTIFIERSYM: codStr = "QUANTIFIERSYM"; break;
-    case LST_LOGICALOP:     codStr = "LOGICALOP: "; break; 
-    case LST_SELECTSYM:     codStr = "LST_SELECTSYM"; break;
-    case LST_OPENSYM:	    codStr = "LST_OPENSYM"; break;
-    case LST_SEPSYM:	    codStr = "SEPSYM"; break;
-    case LST_CLOSESYM:	    codStr = "LST_CLOSESYM"; break;
-    case LST_SIMPLEID:	    codStr = "LST_SIMPLEID"; break;
-    case LST_MAPSYM:	    codStr = "MAPSYM"; break;
-    case LST_MARKERSYM:	    codStr = "LST_MARKERSYM"; break;
-    case LST_COMMENTSYM:    codStr = "COMMENTSYM"; break;
-    case LST_SIMPLEOP:	    codStr = "SIMPLEOP"; break;
-    case LST_COLON:         codStr = "LST_COLON"; break;
-    case LST_COMMA:	    codStr = "COMMA"; break;
-    case LST_LBRACKET:	    codStr = "LST_LBRACKET"; break;
-    case LST_LPAR:	    codStr = "LST_LPAR"; break;
-    case LST_RBRACKET:	    codStr = "LST_RBRACKET"; break;
-    case LST_RPAR:          codStr = "LST_RPAR"; break;
-    case LST_EQOP:          codStr = "LST_EQOP"; break;
-    case LST_WHITESPACE:    codStr = "WHITESPACE,"; break;
-    case LST_EOL:           codStr = "LST_EOL"; break;
-    case LST_elseTOKEN:     codStr = "elseTOKEN"; break;
-    case LST_ifTOKEN:       codStr = "ifTOKEN"; break;
-    case LST_thenTOKEN:     codStr = "thenTOKEN"; break;
-    case LST_BADTOKEN:      codStr = "*** BADTOKEN ***"; break;
-    case LEOFTOKEN: /* can't reach LEOFTOKEN easily */
-      codStr = "LEOFTOKEN"; break;
-    default:
-      codStr = "*** invalid token code ***";
-      break;
-    } /* end switch */
-  
-  /* only used for debugging */
-  printf ("%u:%u: Token Code (%u): %s",
-	  ltoken_getLine (tok), ltoken_getCol (tok), 
-	  ltoken_getCode (tok), codStr);
-  if (ltoken_getRawText (tok) != 0) 
-    {
-      printf (", Token String (%lu): %s\n", 
-	      ltoken_getRawText (tok), ltoken_getRawTextChars (tok));
-    }
-  else printf ("\n");
-}
-
-
-
-
diff --git a/src/signature.tab.c b/src/signature.tab.c
deleted file mode 100644
index 7b5f5b4..0000000
--- a/src/signature.tab.c
+++ /dev/null
@@ -1,1277 +0,0 @@
-
-/*  A Bison parser, made from signature.y
-    by GNU Bison version 1.28  */
-
-#define YYBISON 1  /* Identify Bison output.  */
-
-#define yyparse lslparse
-#define yylex lsllex
-#define yyerror lslerror
-#define yylval lsllval
-#define yychar lslchar
-#define yydebug lsldebug
-#define yynerrs lslnerrs
-#define	LST_SIMPLEID	257
-#define	LST_LOGICALOP	258
-#define	LST_EQOP	259
-#define	LST_SIMPLEOP	260
-#define	LST_MAPSYM	261
-#define	LST_FIELDMAPSYM	262
-#define	LST_MARKERSYM	263
-#define	LST_ifTOKEN	264
-#define	LST_thenTOKEN	265
-#define	LST_elseTOKEN	266
-#define	LST_LBRACKET	267
-#define	LST_RBRACKET	268
-#define	LST_SELECTSYM	269
-#define	LST_SEPSYM	270
-#define	LST_OPENSYM	271
-#define	LST_CLOSESYM	272
-#define	LST_COLON	273
-#define	LST_COMMA	274
-#define	LST_EOL	275
-#define	LST_COMMENTSYM	276
-#define	LST_WHITESPACE	277
-#define	LST_QUANTIFIERSYM	278
-#define	LST_EQUATIONSYM	279
-#define	LST_EQSEPSYM	280
-#define	LST_COMPOSESYM	281
-#define	LST_LPAR	282
-#define	LST_RPAR	283
-#define	LST_assertsTOKEN	284
-#define	LST_assumesTOKEN	285
-#define	LST_byTOKEN	286
-#define	LST_convertsTOKEN	287
-#define	LST_enumerationTOKEN	288
-#define	LST_equationsTOKEN	289
-#define	LST_exemptingTOKEN	290
-#define	LST_forTOKEN	291
-#define	LST_generatedTOKEN	292
-#define	LST_impliesTOKEN	293
-#define	LST_includesTOKEN	294
-#define	LST_introducesTOKEN	295
-#define	LST_ofTOKEN	296
-#define	LST_partitionedTOKEN	297
-#define	LST_traitTOKEN	298
-#define	LST_tupleTOKEN	299
-#define	LST_unionTOKEN	300
-#define	LST_BADTOKEN	301
-
-#line 36 "signature.y"
-
-
-# include "bison.reset"
-
-# include 
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "lslparse.h"
-# include "signature.h"
-
-void lslerror (char *);
-/*@dependent@*/ /*@null@*/ lslOp importedlslOp;
-
-/*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */
-static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */);
-/*@=noparams@*/
-
-# define YYPRINT(file, type, value) yyprint (file, type, value)
-
-# define YYDEBUG 1
-
-# include "bison.head"
-
-
-#line 73 "signature.y"
-typedef union {
-  ltoken ltok;  /* a leaf is also an ltoken */
-  unsigned int count;
-  /*@only@*/  ltokenList ltokenList;
-  /*@only@*/  opFormNode opform;
-  /*@owned@*/ sigNode signature;
-  /*@only@*/  nameNode name;
-  /*@owned@*/ lslOp operator;
-  /*@only@*/  lslOpList operators;
-} YYSTYPE;
-#ifndef YYDEBUG
-#define YYDEBUG 1
-#endif
-
-#include 
-
-#ifndef __cplusplus
-#ifndef __STDC__
-#define const
-#endif
-#endif
-
-
-
-#define	YYFINAL		62
-#define	YYFLAG		-32768
-#define	YYNTBASE	48
-
-#define YYTRANSLATE(x) ((unsigned)(x) <= 301 ? yytranslate[x] : 62)
-
-static const char yytranslate[] = {     0,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-     2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
-     7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
-    17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
-    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
-    37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
-    47
-};
-
-#if YYDEBUG != 0
-static const short yyprhs[] = {     0,
-     0,     2,     4,     7,    11,    13,    15,    22,    24,    27,
-    30,    34,    38,    43,    48,    54,    58,    63,    68,    74,
-    77,    81,    85,    87,    89,    91,    92,    94,    96,   100,
-   102,   104,   108,   109,   111,   113,   117,   119
-};
-
-static const short yyrhs[] = {    49,
-     0,    50,     0,    49,    50,     0,    51,    19,    57,     0,
-    61,     0,    52,     0,    10,     9,    11,     9,    12,     9,
-     0,    53,     0,     9,    53,     0,    53,     9,     0,     9,
-    53,     9,     0,    17,    54,    18,     0,     9,    17,    54,
-    18,     0,    17,    54,    18,     9,     0,     9,    17,    54,
-    18,     9,     0,    13,    54,    14,     0,     9,    13,    54,
-    14,     0,    13,    54,    14,     9,     0,     9,    13,    54,
-    14,     9,     0,    15,     3,     0,     9,    15,     3,     0,
-     9,     8,     3,     0,     6,     0,     4,     0,     5,     0,
-     0,    55,     0,     9,     0,    55,    56,     9,     0,    20,
-     0,    16,     0,    58,     7,    60,     0,     0,    59,     0,
-    60,     0,    59,    20,    60,     0,     3,     0,     3,     0
-};
-
-#endif
-
-#if YYDEBUG != 0
-static const short yyrline[] = { 0,
-   139,   141,   146,   150,   156,   158,   162,   164,   166,   168,
-   170,   172,   174,   176,   178,   181,   184,   187,   190,   193,
-   196,   201,   206,   208,   210,   213,   215,   218,   220,   223,
-   225,   228,   231,   233,   236,   238,   241,   247
-};
-#endif
-
-
-#if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
-
-static const char * const yytname[] = {   "$","error","$undefined.","LST_SIMPLEID",
-"LST_LOGICALOP","LST_EQOP","LST_SIMPLEOP","LST_MAPSYM","LST_FIELDMAPSYM","LST_MARKERSYM",
-"LST_ifTOKEN","LST_thenTOKEN","LST_elseTOKEN","LST_LBRACKET","LST_RBRACKET",
-"LST_SELECTSYM","LST_SEPSYM","LST_OPENSYM","LST_CLOSESYM","LST_COLON","LST_COMMA",
-"LST_EOL","LST_COMMENTSYM","LST_WHITESPACE","LST_QUANTIFIERSYM","LST_EQUATIONSYM",
-"LST_EQSEPSYM","LST_COMPOSESYM","LST_LPAR","LST_RPAR","LST_assertsTOKEN","LST_assumesTOKEN",
-"LST_byTOKEN","LST_convertsTOKEN","LST_enumerationTOKEN","LST_equationsTOKEN",
-"LST_exemptingTOKEN","LST_forTOKEN","LST_generatedTOKEN","LST_impliesTOKEN",
-"LST_includesTOKEN","LST_introducesTOKEN","LST_ofTOKEN","LST_partitionedTOKEN",
-"LST_traitTOKEN","LST_tupleTOKEN","LST_unionTOKEN","LST_BADTOKEN","top","operatorList",
-"operator","name","opForm","anyOp","middle","placeList","separator","signature",
-"domain","sortList","sortId","opId", NULL
-};
-#endif
-
-static const short yyr1[] = {     0,
-    48,    49,    49,    50,    51,    51,    52,    52,    52,    52,
-    52,    52,    52,    52,    52,    52,    52,    52,    52,    52,
-    52,    52,    53,    53,    53,    54,    54,    55,    55,    56,
-    56,    57,    58,    58,    59,    59,    60,    61
-};
-
-static const short yyr2[] = {     0,
-     1,     1,     2,     3,     1,     1,     6,     1,     2,     2,
-     3,     3,     4,     4,     5,     3,     4,     4,     5,     2,
-     3,     3,     1,     1,     1,     0,     1,     1,     3,     1,
-     1,     3,     0,     1,     1,     3,     1,     1
-};
-
-static const short yydefact[] = {     0,
-    38,    24,    25,    23,     0,     0,    26,     0,    26,     1,
-     2,     0,     6,     8,     5,     0,    26,     0,    26,     9,
-     0,    28,     0,    27,    20,     0,     3,    33,    10,    22,
-     0,    21,     0,    11,     0,    16,    31,    30,     0,    12,
-    37,     4,     0,    34,    35,    17,    13,     0,    18,    29,
-    14,     0,     0,    19,    15,     0,    32,    36,     7,     0,
-     0,     0
-};
-
-static const short yydefgoto[] = {    60,
-    10,    11,    12,    13,    14,    23,    24,    39,    42,    43,
-    44,    45,    15
-};
-
-static const short yypact[] = {    -3,
--32768,-32768,-32768,-32768,    11,    -4,     0,     8,     0,    -3,
--32768,    -1,-32768,    13,-32768,    17,     0,    22,     0,    18,
-    20,-32768,    19,   -12,-32768,    14,-32768,    31,-32768,-32768,
-    21,-32768,    23,-32768,    27,    28,-32768,-32768,    29,    30,
--32768,-32768,    33,    24,-32768,    34,    36,    35,-32768,-32768,
--32768,    31,    31,-32768,-32768,    37,-32768,-32768,-32768,    42,
-    48,-32768
-};
-
-static const short yypgoto[] = {-32768,
--32768,    39,-32768,-32768,    45,     4,-32768,-32768,-32768,-32768,
--32768,   -23,-32768
-};
-
-
-#define	YYLAST		50
-
-
-static const short yytable[] = {     1,
-     2,     3,     4,    37,    21,     5,     6,    38,    22,     7,
-    25,     8,    26,     9,     2,     3,     4,    28,    16,    30,
-    31,    29,    33,    17,    32,    18,    34,    19,    57,    58,
-    35,    40,    36,    41,    46,    48,    49,    50,    51,    52,
-    47,    61,    54,    53,    55,    59,    56,    62,    27,    20
-};
-
-static const short yycheck[] = {     3,
-     4,     5,     6,    16,     9,     9,    10,    20,     9,    13,
-     3,    15,     9,    17,     4,     5,     6,    19,     8,     3,
-    17,     9,    19,    13,     3,    15,     9,    17,    52,    53,
-    11,    18,    14,     3,    14,     9,     9,     9,     9,     7,
-    18,     0,     9,    20,     9,     9,    12,     0,    10,     5
-};
-#define YYPURE 1
-
-/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
-#line 3 "/af10/evans/bison-1.28/share/bison.simple"
-/* This file comes from bison-1.28.  */
-
-/* Skeleton output parser for bison,
-   Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
-
-/* This is the parser code that is written into each bison parser
-  when the %semantic_parser declaration is not specified in the grammar.
-  It was written by Richard Stallman by simplifying the hairy parser
-  used when %semantic_parser is specified.  */
-
-#ifndef YYSTACK_USE_ALLOCA
-#ifdef alloca
-#define YYSTACK_USE_ALLOCA
-#else /* alloca not defined */
-#ifdef __GNUC__
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#else /* not GNU C.  */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
-#define YYSTACK_USE_ALLOCA
-#include 
-#else /* not sparc */
-/* We think this test detects Watcom and Microsoft C.  */
-/* This used to test MSDOS, but that is a bad idea
-   since that symbol is in the user namespace.  */
-#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
-#if 0 /* No need for malloc.h, which pollutes the namespace;
-	 instead, just don't use alloca.  */
-#include 
-#endif
-#else /* not MSDOS, or __TURBOC__ */
-#if defined(_AIX)
-/* I don't know what this was needed for, but it pollutes the namespace.
-   So I turned it off.   rms, 2 May 1997.  */
-/* #include   */
- #pragma alloca
-#define YYSTACK_USE_ALLOCA
-#else /* not MSDOS, or __TURBOC__, or _AIX */
-#if 0
-#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
-		 and on HPUX 10.  Eventually we can turn this on.  */
-#define YYSTACK_USE_ALLOCA
-#define alloca __builtin_alloca
-#endif /* __hpux */
-#endif
-#endif /* not _AIX */
-#endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc */
-#endif /* not GNU C */
-#endif /* alloca not defined */
-#endif /* YYSTACK_USE_ALLOCA not defined */
-
-#ifdef YYSTACK_USE_ALLOCA
-#define YYSTACK_ALLOC alloca
-#else
-#define YYSTACK_ALLOC malloc
-#endif
-
-/* Note: there must be only one dollar sign in this file.
-   It is replaced by the list of actions, each action
-   as one case of the switch.  */
-
-#define yyerrok		(yyerrstatus = 0)
-#define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		-2
-#define YYEOF		0
-#define YYACCEPT	goto yyacceptlab
-#define YYABORT 	goto yyabortlab
-#define YYERROR		goto yyerrlab1
-/* Like YYERROR except do call yyerror.
-   This remains here temporarily to ease the
-   transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  */
-#define YYFAIL		goto yyerrlab
-#define YYRECOVERING()  (!!yyerrstatus)
-#define YYBACKUP(token, value) \
-do								\
-  if (yychar == YYEMPTY && yylen == 1)				\
-    { yychar = (token), yylval = (value);			\
-      yychar1 = YYTRANSLATE (yychar);				\
-      YYPOPSTACK;						\
-      goto yybackup;						\
-    }								\
-  else								\
-    { yyerror ("syntax error: cannot back up"); YYERROR; }	\
-while (0)
-
-#define YYTERROR	1
-#define YYERRCODE	256
-
-#ifndef YYPURE
-#define YYLEX		yylex()
-#endif
-
-#ifdef YYPURE
-#ifdef YYLSP_NEEDED
-#ifdef YYLEX_PARAM
-#define YYLEX		yylex(&yylval, &yylloc, YYLEX_PARAM)
-#else
-#define YYLEX		yylex(&yylval, &yylloc)
-#endif
-#else /* not YYLSP_NEEDED */
-#ifdef YYLEX_PARAM
-#define YYLEX		yylex(&yylval, YYLEX_PARAM)
-#else
-#define YYLEX		yylex(&yylval)
-#endif
-#endif /* not YYLSP_NEEDED */
-#endif
-
-/* If nonreentrant, generate the variables here */
-
-#ifndef YYPURE
-
-int	yychar;			/*  the lookahead symbol		*/
-YYSTYPE	yylval;			/*  the semantic value of the		*/
-				/*  lookahead symbol			*/
-
-#ifdef YYLSP_NEEDED
-YYLTYPE yylloc;			/*  location data for the lookahead	*/
-				/*  symbol				*/
-#endif
-
-int yynerrs;			/*  number of parse errors so far       */
-#endif  /* not YYPURE */
-
-#if YYDEBUG != 0
-int yydebug;			/*  nonzero means print parse trace	*/
-/* Since this is uninitialized, it does not stop multiple parsers
-   from coexisting.  */
-#endif
-
-/*  YYINITDEPTH indicates the initial size of the parser's stacks	*/
-
-#ifndef	YYINITDEPTH
-#define YYINITDEPTH 200
-#endif
-
-/*  YYMAXDEPTH is the maximum size the stacks can grow to
-    (effective only if the built-in stack extension method is used).  */
-
-#if YYMAXDEPTH == 0
-#undef YYMAXDEPTH
-#endif
-
-#ifndef YYMAXDEPTH
-#define YYMAXDEPTH 10000
-#endif
-
-/* Define __yy_memcpy.  Note that the size argument
-   should be passed with type unsigned int, because that is what the non-GCC
-   definitions require.  With GCC, __builtin_memcpy takes an arg
-   of type size_t, but it can handle unsigned int.  */
-
-#if __GNUC__ > 1		/* GNU C and GNU C++ define this.  */
-#define __yy_memcpy(TO,FROM,COUNT)	__builtin_memcpy(TO,FROM,COUNT)
-#else				/* not GNU C or C++ */
-#ifndef __cplusplus
-
-/* This is the most reliable way to avoid incompatibilities
-   in available built-in functions on various systems.  */
-static void
-__yy_memcpy (to, from, count)
-     char *to;
-     char *from;
-     unsigned int count;
-{
-  register char *f = from;
-  register char *t = to;
-  register int i = count;
-
-  while (i-- > 0)
-    *t++ = *f++;
-}
-
-#else /* __cplusplus */
-
-/* This is the most reliable way to avoid incompatibilities
-   in available built-in functions on various systems.  */
-static void
-__yy_memcpy (char *to, char *from, unsigned int count)
-{
-  register char *t = to;
-  register char *f = from;
-  register int i = count;
-
-  while (i-- > 0)
-    *t++ = *f++;
-}
-
-#endif
-#endif
-
-#line 217 "/af10/evans/bison-1.28/share/bison.simple"
-
-/* The user can define YYPARSE_PARAM as the name of an argument to be passed
-   into yyparse.  The argument should have type void *.
-   It should actually point to an object.
-   Grammar actions can access the variable by casting it
-   to the proper pointer type.  */
-
-#ifdef YYPARSE_PARAM
-#ifdef __cplusplus
-#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL
-#else /* not __cplusplus */
-#define YYPARSE_PARAM_ARG YYPARSE_PARAM
-#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
-#endif /* not __cplusplus */
-#else /* not YYPARSE_PARAM */
-#define YYPARSE_PARAM_ARG
-#define YYPARSE_PARAM_DECL
-#endif /* not YYPARSE_PARAM */
-
-/* Prevent warning if -Wstrict-prototypes.  */
-#ifdef __GNUC__
-#ifdef YYPARSE_PARAM
-int yyparse (void *);
-#else
-int yyparse (void);
-#endif
-#endif
-
-int
-yyparse(YYPARSE_PARAM_ARG)
-     YYPARSE_PARAM_DECL
-{
-  register int yystate;
-  register int yyn;
-  register short *yyssp;
-  register YYSTYPE *yyvsp;
-  int yyerrstatus;	/*  number of tokens to shift before error messages enabled */
-  int yychar1 = 0;		/*  lookahead token as an internal (translated) token number */
-
-  short	yyssa[YYINITDEPTH];	/*  the state stack			*/
-  YYSTYPE yyvsa[YYINITDEPTH];	/*  the semantic value stack		*/
-
-  short *yyss = yyssa;		/*  refer to the stacks thru separate pointers */
-  YYSTYPE *yyvs = yyvsa;	/*  to allow yyoverflow to reallocate them elsewhere */
-
-#ifdef YYLSP_NEEDED
-  YYLTYPE yylsa[YYINITDEPTH];	/*  the location stack			*/
-  YYLTYPE *yyls = yylsa;
-  YYLTYPE *yylsp;
-
-#define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
-#else
-#define YYPOPSTACK   (yyvsp--, yyssp--)
-#endif
-
-  int yystacksize = YYINITDEPTH;
-  int yyfree_stacks = 0;
-
-#ifdef YYPURE
-  int yychar;
-  YYSTYPE yylval;
-  int yynerrs;
-#ifdef YYLSP_NEEDED
-  YYLTYPE yylloc;
-#endif
-#endif
-
-  YYSTYPE yyval;		/*  the variable used to return		*/
-				/*  semantic values from the action	*/
-				/*  routines				*/
-
-  int yylen;
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Starting parse\n");
-#endif
-
-  yystate = 0;
-  yyerrstatus = 0;
-  yynerrs = 0;
-  yychar = YYEMPTY;		/* Cause a token to be read.  */
-
-  /* Initialize stack pointers.
-     Waste one element of value and location stack
-     so that they stay on the same level as the state stack.
-     The wasted elements are never initialized.  */
-
-  yyssp = yyss - 1;
-  yyvsp = yyvs;
-#ifdef YYLSP_NEEDED
-  yylsp = yyls;
-#endif
-
-/* Push a new state, which is found in  yystate  .  */
-/* In all cases, when you get here, the value and location stacks
-   have just been pushed. so pushing a state here evens the stacks.  */
-yynewstate:
-
-  *++yyssp = yystate;
-
-  if (yyssp >= yyss + yystacksize - 1)
-    {
-      /* Give user a chance to reallocate the stack */
-      /* Use copies of these so that the &'s don't force the real ones into memory. */
-      YYSTYPE *yyvs1 = yyvs;
-      short *yyss1 = yyss;
-#ifdef YYLSP_NEEDED
-      YYLTYPE *yyls1 = yyls;
-#endif
-
-      /* Get the current used size of the three stacks, in elements.  */
-      int size = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-      /* Each stack pointer address is followed by the size of
-	 the data in use in that stack, in bytes.  */
-#ifdef YYLSP_NEEDED
-      /* This used to be a conditional around just the two extra args,
-	 but that might be undefined if yyoverflow is a macro.  */
-      yyoverflow("parser stack overflow",
-		 &yyss1, size * sizeof (*yyssp),
-		 &yyvs1, size * sizeof (*yyvsp),
-		 &yyls1, size * sizeof (*yylsp),
-		 &yystacksize);
-#else
-      yyoverflow("parser stack overflow",
-		 &yyss1, size * sizeof (*yyssp),
-		 &yyvs1, size * sizeof (*yyvsp),
-		 &yystacksize);
-#endif
-
-      yyss = yyss1; yyvs = yyvs1;
-#ifdef YYLSP_NEEDED
-      yyls = yyls1;
-#endif
-#else /* no yyoverflow */
-      /* Extend the stack our own way.  */
-      if (yystacksize >= YYMAXDEPTH)
-	{
-	  yyerror("parser stack overflow");
-	  if (yyfree_stacks)
-	    {
-	      free (yyss);
-	      free (yyvs);
-#ifdef YYLSP_NEEDED
-	      free (yyls);
-#endif
-	    }
-	  return 2;
-	}
-      yystacksize *= 2;
-      if (yystacksize > YYMAXDEPTH)
-	yystacksize = YYMAXDEPTH;
-#ifndef YYSTACK_USE_ALLOCA
-      yyfree_stacks = 1;
-#endif
-      yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
-      __yy_memcpy ((char *)yyss, (char *)yyss1,
-		   size * (unsigned int) sizeof (*yyssp));
-      yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
-      __yy_memcpy ((char *)yyvs, (char *)yyvs1,
-		   size * (unsigned int) sizeof (*yyvsp));
-#ifdef YYLSP_NEEDED
-      yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
-      __yy_memcpy ((char *)yyls, (char *)yyls1,
-		   size * (unsigned int) sizeof (*yylsp));
-#endif
-#endif /* no yyoverflow */
-
-      yyssp = yyss + size - 1;
-      yyvsp = yyvs + size - 1;
-#ifdef YYLSP_NEEDED
-      yylsp = yyls + size - 1;
-#endif
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Stack size increased to %d\n", yystacksize);
-#endif
-
-      if (yyssp >= yyss + yystacksize - 1)
-	YYABORT;
-    }
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Entering state %d\n", yystate);
-#endif
-
-  goto yybackup;
- yybackup:
-
-/* Do appropriate processing given the current state.  */
-/* Read a lookahead token if we need one and don't already have one.  */
-/* yyresume: */
-
-  /* First try to decide what to do without reference to lookahead token.  */
-
-  yyn = yypact[yystate];
-  if (yyn == YYFLAG)
-    goto yydefault;
-
-  /* Not known => get a lookahead token if don't already have one.  */
-
-  /* yychar is either YYEMPTY or YYEOF
-     or a valid token in external form.  */
-
-  if (yychar == YYEMPTY)
-    {
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Reading a token: ");
-#endif
-      yychar = YYLEX;
-    }
-
-  /* Convert token to internal form (in yychar1) for indexing tables with */
-
-  if (yychar <= 0)		/* This means end of input. */
-    {
-      yychar1 = 0;
-      yychar = YYEOF;		/* Don't call YYLEX any more */
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Now at end of input.\n");
-#endif
-    }
-  else
-    {
-      yychar1 = YYTRANSLATE(yychar);
-
-#if YYDEBUG != 0
-      if (yydebug)
-	{
-	  fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
-	  /* Give the individual parser a way to print the precise meaning
-	     of a token, for further debugging info.  */
-#ifdef YYPRINT
-	  YYPRINT (stderr, yychar, yylval);
-#endif
-	  fprintf (stderr, ")\n");
-	}
-#endif
-    }
-
-  yyn += yychar1;
-  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
-    goto yydefault;
-
-  yyn = yytable[yyn];
-
-  /* yyn is what to do for this token type in this state.
-     Negative => reduce, -yyn is rule number.
-     Positive => shift, yyn is new state.
-       New state is final state => don't bother to shift,
-       just return success.
-     0, or most negative number => error.  */
-
-  if (yyn < 0)
-    {
-      if (yyn == YYFLAG)
-	goto yyerrlab;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-  else if (yyn == 0)
-    goto yyerrlab;
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-  /* Shift the lookahead token.  */
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
-#endif
-
-  /* Discard the token being shifted unless it is eof.  */
-  if (yychar != YYEOF)
-    yychar = YYEMPTY;
-
-  *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
-  *++yylsp = yylloc;
-#endif
-
-  /* count tokens shifted since error; after three, turn off error status.  */
-  if (yyerrstatus) yyerrstatus--;
-
-  yystate = yyn;
-  goto yynewstate;
-
-/* Do the default action for the current state.  */
-yydefault:
-
-  yyn = yydefact[yystate];
-  if (yyn == 0)
-    goto yyerrlab;
-
-/* Do a reduction.  yyn is the number of a rule to reduce with.  */
-yyreduce:
-  yylen = yyr2[yyn];
-  if (yylen > 0)
-    yyval = yyvsp[1-yylen]; /* implement default value of the action */
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      int i;
-
-      fprintf (stderr, "Reducing via rule %d (line %d), ",
-	       yyn, yyrline[yyn]);
-
-      /* Print the symbols being reduced, and their result.  */
-      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
-	fprintf (stderr, "%s ", yytname[yyrhs[i]]);
-      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
-    }
-#endif
-
-
-  switch (yyn) {
-
-case 1:
-#line 139 "signature.y"
-{ lslOpList_free (yyvsp[0].operators); ;
-    break;}
-case 2:
-#line 142 "signature.y"
-{ lslOpList x = lslOpList_new ();
-		g_importedlslOp = yyvsp[0].operator;
-		lslOpList_add (x, yyvsp[0].operator);
- 		yyval.operators = x; ;
-    break;}
-case 3:
-#line 147 "signature.y"
-{ lslOpList_add (yyvsp[-1].operators, yyvsp[0].operator);
-		yyval.operators = yyvsp[-1].operators; ;
-    break;}
-case 4:
-#line 151 "signature.y"
-{ yyval.operator = makelslOpNode (yyvsp[-2].name, yyvsp[0].signature); ;
-    break;}
-case 5:
-#line 157 "signature.y"
-{ yyval.name = makeNameNodeId (yyvsp[0].ltok); ;
-    break;}
-case 6:
-#line 159 "signature.y"
-{ yyval.name = makeNameNodeForm (yyvsp[0].opform); ;
-    break;}
-case 7:
-#line 163 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-5].ltok, OPF_IF, opFormUnion_createMiddle (0), ltoken_undefined); ;
-    break;}
-case 8:
-#line 165 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[0].ltok, OPF_ANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 9:
-#line 167 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_MANYOP, opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 10:
-#line 169 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_ANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
-    break;}
-case 11:
-#line 171 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MANYOPM, opFormUnion_createAnyOp (yyvsp[-1].ltok), ltoken_undefined); ;
-    break;}
-case 12:
-#line 173 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 13:
-#line 175 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMIDDLE, opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 14:
-#line 177 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MIDDLEM, opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 15:
-#line 179 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_MMIDDLEM, 
-			      opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 16:
-#line 182 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMIDDLE, 
-			      opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 17:
-#line 185 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_BMMIDDLE, 
-			      opFormUnion_createMiddle (yyvsp[-1].count), yyvsp[0].ltok); ;
-    break;}
-case 18:
-#line 188 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMIDDLEM, 
-			    opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 19:
-#line 191 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-3].ltok, OPF_BMMIDDLEM, 
-			    opFormUnion_createMiddle (yyvsp[-2].count), yyvsp[-1].ltok); ;
-    break;}
-case 20:
-#line 194 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-1].ltok, OPF_SELECT, 
-			    opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 21:
-#line 197 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MSELECT, 
-			    opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 22:
-#line 202 "signature.y"
-{ yyval.opform = makeOpFormNode (yyvsp[-2].ltok, OPF_MMAP, 
-			    opFormUnion_createAnyOp (yyvsp[0].ltok), ltoken_undefined); ;
-    break;}
-case 23:
-#line 207 "signature.y"
-{ yyval.ltok = yyvsp[0].ltok; ;
-    break;}
-case 24:
-#line 209 "signature.y"
-{ yyval.ltok = yyvsp[0].ltok; ;
-    break;}
-case 25:
-#line 211 "signature.y"
-{ yyval.ltok = yyvsp[0].ltok; ;
-    break;}
-case 26:
-#line 214 "signature.y"
-{ yyval.count = 0; ;
-    break;}
-case 27:
-#line 216 "signature.y"
-{ yyval.count = yyvsp[0].count; ;
-    break;}
-case 28:
-#line 219 "signature.y"
-{ yyval.count = 1; ;
-    break;}
-case 29:
-#line 221 "signature.y"
-{ yyval.count = yyvsp[-2].count + 1; ;
-    break;}
-case 30:
-#line 224 "signature.y"
-{ yyval.ltok = yyvsp[0].ltok; ;
-    break;}
-case 31:
-#line 226 "signature.y"
-{ yyval.ltok = yyvsp[0].ltok; ;
-    break;}
-case 32:
-#line 229 "signature.y"
-{ yyval.signature = makesigNode (yyvsp[-1].ltok, yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 33:
-#line 232 "signature.y"
-{ yyval.ltokenList = ltokenList_new (); ;
-    break;}
-case 34:
-#line 234 "signature.y"
-{ yyval.ltokenList = yyvsp[0].ltokenList; ;
-    break;}
-case 35:
-#line 237 "signature.y"
-{ yyval.ltokenList = ltokenList_singleton (yyvsp[0].ltok); ;
-    break;}
-case 36:
-#line 239 "signature.y"
-{ yyval.ltokenList = ltokenList_push (yyvsp[-2].ltokenList, yyvsp[0].ltok); ;
-    break;}
-case 37:
-#line 242 "signature.y"
-{ 
-	  yyval.ltok = yyvsp[0].ltok; 
-	  ltoken_setText (yyval.ltok, processTraitSortId (ltoken_getText (yyvsp[0].ltok))); 
-	;
-    break;}
-case 38:
-#line 248 "signature.y"
-{ yyval.ltok = yyvsp[0].ltok; ;
-    break;}
-}
-   /* the action file gets copied in in place of this dollarsign */
-#line 543 "/af10/evans/bison-1.28/share/bison.simple"
-
-  yyvsp -= yylen;
-  yyssp -= yylen;
-#ifdef YYLSP_NEEDED
-  yylsp -= yylen;
-#endif
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      short *ssp1 = yyss - 1;
-      fprintf (stderr, "state stack now");
-      while (ssp1 != yyssp)
-	fprintf (stderr, " %d", *++ssp1);
-      fprintf (stderr, "\n");
-    }
-#endif
-
-  *++yyvsp = yyval;
-
-#ifdef YYLSP_NEEDED
-  yylsp++;
-  if (yylen == 0)
-    {
-      yylsp->first_line = yylloc.first_line;
-      yylsp->first_column = yylloc.first_column;
-      yylsp->last_line = (yylsp-1)->last_line;
-      yylsp->last_column = (yylsp-1)->last_column;
-      yylsp->text = 0;
-    }
-  else
-    {
-      yylsp->last_line = (yylsp+yylen-1)->last_line;
-      yylsp->last_column = (yylsp+yylen-1)->last_column;
-    }
-#endif
-
-  /* Now "shift" the result of the reduction.
-     Determine what state that goes to,
-     based on the state we popped back to
-     and the rule number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
-  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTBASE];
-
-  goto yynewstate;
-
-yyerrlab:   /* here on detecting error */
-
-  if (! yyerrstatus)
-    /* If not already recovering from an error, report this error.  */
-    {
-      ++yynerrs;
-
-#ifdef YYERROR_VERBOSE
-      yyn = yypact[yystate];
-
-      if (yyn > YYFLAG && yyn < YYLAST)
-	{
-	  int size = 0;
-	  char *msg;
-	  int x, count;
-
-	  count = 0;
-	  /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
-	  for (x = (yyn < 0 ? -yyn : 0);
-	       x < (sizeof(yytname) / sizeof(char *)); x++)
-	    if (yycheck[x + yyn] == x)
-	      size += strlen(yytname[x]) + 15, count++;
-	  msg = (char *) malloc(size + 15);
-	  if (msg != 0)
-	    {
-	      strcpy(msg, "parse error");
-
-	      if (count < 5)
-		{
-		  count = 0;
-		  for (x = (yyn < 0 ? -yyn : 0);
-		       x < (sizeof(yytname) / sizeof(char *)); x++)
-		    if (yycheck[x + yyn] == x)
-		      {
-			strcat(msg, count == 0 ? ", expecting `" : " or `");
-			strcat(msg, yytname[x]);
-			strcat(msg, "'");
-			count++;
-		      }
-		}
-	      yyerror(msg);
-	      free(msg);
-	    }
-	  else
-	    yyerror ("parse error; also virtual memory exceeded");
-	}
-      else
-#endif /* YYERROR_VERBOSE */
-	yyerror("parse error");
-    }
-
-  goto yyerrlab1;
-yyerrlab1:   /* here on error raised explicitly by an action */
-
-  if (yyerrstatus == 3)
-    {
-      /* if just tried and failed to reuse lookahead token after an error, discard it.  */
-
-      /* return failure if at end of input */
-      if (yychar == YYEOF)
-	YYABORT;
-
-#if YYDEBUG != 0
-      if (yydebug)
-	fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
-#endif
-
-      yychar = YYEMPTY;
-    }
-
-  /* Else will try to reuse lookahead token
-     after shifting the error token.  */
-
-  yyerrstatus = 3;		/* Each real token shifted decrements this */
-
-  goto yyerrhandle;
-
-yyerrdefault:  /* current state does not do anything special for the error token. */
-
-#if 0
-  /* This is wrong; only states that explicitly want error tokens
-     should shift them.  */
-  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
-  if (yyn) goto yydefault;
-#endif
-
-yyerrpop:   /* pop the current state because it cannot handle the error token */
-
-  if (yyssp == yyss) YYABORT;
-  yyvsp--;
-  yystate = *--yyssp;
-#ifdef YYLSP_NEEDED
-  yylsp--;
-#endif
-
-#if YYDEBUG != 0
-  if (yydebug)
-    {
-      short *ssp1 = yyss - 1;
-      fprintf (stderr, "Error: state stack now");
-      while (ssp1 != yyssp)
-	fprintf (stderr, " %d", *++ssp1);
-      fprintf (stderr, "\n");
-    }
-#endif
-
-yyerrhandle:
-
-  yyn = yypact[yystate];
-  if (yyn == YYFLAG)
-    goto yyerrdefault;
-
-  yyn += YYTERROR;
-  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
-    goto yyerrdefault;
-
-  yyn = yytable[yyn];
-  if (yyn < 0)
-    {
-      if (yyn == YYFLAG)
-	goto yyerrpop;
-      yyn = -yyn;
-      goto yyreduce;
-    }
-  else if (yyn == 0)
-    goto yyerrpop;
-
-  if (yyn == YYFINAL)
-    YYACCEPT;
-
-#if YYDEBUG != 0
-  if (yydebug)
-    fprintf(stderr, "Shifting error token, ");
-#endif
-
-  *++yyvsp = yylval;
-#ifdef YYLSP_NEEDED
-  *++yylsp = yylloc;
-#endif
-
-  yystate = yyn;
-  goto yynewstate;
-
- yyacceptlab:
-  /* YYACCEPT comes here.  */
-  if (yyfree_stacks)
-    {
-      free (yyss);
-      free (yyvs);
-#ifdef YYLSP_NEEDED
-      free (yyls);
-#endif
-    }
-  return 0;
-
- yyabortlab:
-  /* YYABORT comes here.  */
-  if (yyfree_stacks)
-    {
-      free (yyss);
-      free (yyvs);
-#ifdef YYLSP_NEEDED
-      free (yyls);
-#endif
-    }
-  return 1;
-}
-#line 249 "signature.y"
-
-
-# include "bison.reset"
-
-extern char *yytext;
-
-void lslerror (char *s) 
-{
-  llfatalbug 
-    (cstring_makeLiteral 
-     ("There has been a problem parsing an LSL signature. This is believed to "
-      "result from a problem with gcc version 2.95 optimizations, "
-      "but it has not been confirmed.  Please try rebuidling LCLint "
-      "without the -O option."));
-
-}
-
-static void yyprint (FILE *file, int type, YYSTYPE value)
-{
-  fprintf (file, " (%u:%u type: %d; text: %s) ", 
-	   ltoken_getLine (value.ltok), 
-	   ltoken_getCol (value.ltok), 
-	   type, 
-	   ltoken_getRawTextChars (value.ltok));
-}
-
-extern void PrintToken (ltoken tok) {
-  char *codStr;
-  
-  switch (ltoken_getCode (tok)) 
-    {
-    case NOTTOKEN:          codStr = "*** NOTTOKEN ***"; break;
-    case LST_QUANTIFIERSYM: codStr = "QUANTIFIERSYM"; break;
-    case LST_LOGICALOP:     codStr = "LOGICALOP: "; break; 
-    case LST_SELECTSYM:     codStr = "LST_SELECTSYM"; break;
-    case LST_OPENSYM:	    codStr = "LST_OPENSYM"; break;
-    case LST_SEPSYM:	    codStr = "SEPSYM"; break;
-    case LST_CLOSESYM:	    codStr = "LST_CLOSESYM"; break;
-    case LST_SIMPLEID:	    codStr = "LST_SIMPLEID"; break;
-    case LST_MAPSYM:	    codStr = "MAPSYM"; break;
-    case LST_MARKERSYM:	    codStr = "LST_MARKERSYM"; break;
-    case LST_COMMENTSYM:    codStr = "COMMENTSYM"; break;
-    case LST_SIMPLEOP:	    codStr = "SIMPLEOP"; break;
-    case LST_COLON:         codStr = "LST_COLON"; break;
-    case LST_COMMA:	    codStr = "COMMA"; break;
-    case LST_LBRACKET:	    codStr = "LST_LBRACKET"; break;
-    case LST_LPAR:	    codStr = "LST_LPAR"; break;
-    case LST_RBRACKET:	    codStr = "LST_RBRACKET"; break;
-    case LST_RPAR:          codStr = "LST_RPAR"; break;
-    case LST_EQOP:          codStr = "LST_EQOP"; break;
-    case LST_WHITESPACE:    codStr = "WHITESPACE,"; break;
-    case LST_EOL:           codStr = "LST_EOL"; break;
-    case LST_elseTOKEN:     codStr = "elseTOKEN"; break;
-    case LST_ifTOKEN:       codStr = "ifTOKEN"; break;
-    case LST_thenTOKEN:     codStr = "thenTOKEN"; break;
-    case LST_BADTOKEN:      codStr = "*** BADTOKEN ***"; break;
-    case LEOFTOKEN: /* can't reach LEOFTOKEN easily */
-      codStr = "LEOFTOKEN"; break;
-    default:
-      codStr = "*** invalid token code ***";
-      break;
-    } /* end switch */
-  
-  /* only used for debugging */
-  printf ("%u:%u: Token Code (%u): %s",
-	  ltoken_getLine (tok), ltoken_getCol (tok), 
-	  ltoken_getCode (tok), codStr);
-  if (ltoken_getRawText (tok) != 0) 
-    {
-      printf (", Token String (%lu): %s\n", 
-	      ltoken_getRawText (tok), ltoken_getRawTextChars (tok));
-    }
-  else printf ("\n");
-}
-
-
-
-
diff --git a/src/sort.c b/src/sort.c
deleted file mode 100644
index 7de1916..0000000
--- a/src/sort.c
+++ /dev/null
@@ -1,3160 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** sort.c
-**
-** sort abstraction
-**
-**      NOTE: The structure of this module follows a similar one
-**            used in the previous LCL checker.  However, all other
-**            details are quite different.
-**
-**  AUTHOR:
-**	Yang Meng Tan,
-**         Massachusetts Institute of Technology
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "llgrammar.h"
-# include "lclscan.h"
-
-/*@+ignorequals@*/
-
-static lsymbol newStructTag (void) /*@*/ ;
-static lsymbol newEnumTag (void) /*@*/ ;
-static lsymbol newUnionTag (void) /*@*/ ;
-
-/*@constant static int MAXBUFFLEN; @*/
-# define MAXBUFFLEN 1024
-
-/*@constant static int DELTA; @*/
-# define DELTA 100
-
-/*@constant static int NOSORTHANDLE; @*/
-# define NOSORTHANDLE 0
-
-/*@constant static int HOFSORTHANDLE; @*/
-# define HOFSORTHANDLE 1
-
-/* local routines */
-
-static void sort_addTupleMembers (sort p_tupleSort, sort p_strSort)  
-   /*@modifies internalState@*/ ;
-
-static bool sort_isNewEntry (sortNode p_s) /*@*/ ;  
-
-static sort sort_enterNew (/*@special@*/ sortNode p_s) 
-   /*@uses p_s.kind, p_s.name, p_s.members@*/
-   /*@releases p_s.members@*/
-   /*@modifies internalState@*/ ;
-
-static sort sort_enterGlobal (sortNode p_s) /*@modifies internalState@*/ ;
-
-static sort sort_enterNewForce (/*@special@*/ sortNode p_s) 
-   /*@uses p_s.kind, p_s.name, p_s.members@*/
-   /*@releases p_s.members@*/
-   /*@modifies internalState@*/ ;
-
-static void genPtrOps (sort p_baseSort, sort p_ptrSort, sort p_arraySort);
-static void genArrOps (sort p_baseSort, sort p_arraySort, int p_dim,
-		       sort p_vecSort);
-static void genVecOps (sort p_baseSort, sort p_vecSort, int p_dim);
-static void genTupleOps (sort p_tupleSort);
-static void genUnionOps (sort p_tupleSort);
-static void genStrOps (sort p_strSort, sort p_tupleSort);
-static void genEnumOps (sort p_enumSort);
-
-static void overloadPtrFcns (sort p_ptrSort);
-static void overloadIsSub (sort p_s, int p_dim);
-static void overloadSizeof (sort p_domainSort);
-
-/*@observer@*/ static cstring sort_unparseKind (sortKind p_k) /*@*/ ;
-
-static /*@observer@*/ cstring
-  sort_unparseKindName (sortNode p_s) /*@*/ ;
-
-static lsymbol
-  sortTag_toSymbol (char *p_kind, ltoken p_tagid, /*@out@*/ bool *p_isNew);
-
-static void 
-  overloadUnaryTok (/*@only@*/ nameNode p_nn, 
-		    sort p_domainSort, /*@only@*/ ltoken p_range);
-static void 
-  overloadUnary (/*@only@*/ nameNode p_nn, 
-		 sort p_domainSort, sort p_rangeSort);
-static void 
-  overloadBinary (/*@only@*/ nameNode p_nn, 
-		  sort p_s, /*@only@*/ ltoken p_dTok, sort p_rs);
-static /*@only@*/ nameNode makeFieldOp (lsymbol p_field);
-static /*@only@*/ nameNode makeArrowFieldOp (lsymbol p_field);
-
-# undef sp
-static lsymbol sp (lsymbol p_s1, lsymbol p_s2);
-static void sortError (ltoken p_t, sort p_oldsort, sortNode p_newnode);
-
-/*@-namechecks@*/
-sort sort_bool;
-sort sort_capBool;
-sort sort_int;
-sort sort_char;
-sort sort_float;
-sort sort_double;
-sort sort_cstring;
-/*@=namechecks@*/
-
-static sort sort_void;
-static sort char_obj_ptrSort;
-static sort char_obj_ArrSort;
-
-/* This is used to uniqueize sort names, for anonymous C types */
-static int sortUID = 1;
-
-static /*@only@*/ /*@null@*/ sortNode *sortTable = (sortNode *) 0;
-static int sortTableSize = 0;
-static int sortTableAlloc = 0;
-
-/* Important to keep sorts in some order because importing routines
-for sorts rely on this order to ensure that when we encounter a sort
-S1 that is based on sort S2, S2 is before S1 in the imported file. */
-
-static bool exporting = TRUE;
-
-static lsymbol underscoreSymbol;
-static /*@only@*/ ltoken intToken;
-
-static /*@owned@*/ nameNode arrayRefNameNode;
-static /*@owned@*/ nameNode ptr2arrayNameNode;
-static /*@owned@*/ nameNode deRefNameNode;
-static /*@owned@*/ nameNode nilNameNode;
-static /*@owned@*/ nameNode plusNameNode;
-static /*@owned@*/ nameNode minusNameNode;
-static /*@owned@*/ nameNode condNameNode;
-static /*@owned@*/ nameNode eqNameNode;
-static /*@owned@*/ nameNode neqNameNode;
-
-static sortNode noSort;
-
-static sortNode HOFSort =
-{ 
-  SRT_HOF, 
-  HOFSORTHANDLE,
-  lsymbol_undefined,
-  lsymbol_undefined,
-  FALSE, /* was lsymbolNULL */
-  NOSORTHANDLE,
-  NOSORTHANDLE,
-  smemberInfo_undefined,
-  FALSE,
-  FALSE,
-  FALSE, 
-  FALSE
-};
-
-static ob_mstring sortKindName[] =
-{
-  "FIRSTSORT", "NOSORT", "HOFSORT",
-  "PRIMITIVE", "SYNONYM", "POINTER", "OBJ", "ARRAY", "VECTOR",
-  "STRUCT", "TUPLE", "UNION", "UNIONVAL", "ENUM", "LASTSORT"
-} ;
-
-static void smemberInfo_free (/*@null@*/ /*@only@*/ smemberInfo *mem)
-{
-  sfree (mem);
-}
-
-static void sortNode_free (/*@special@*/ sortNode sn)
-   /*@uses sn.members@*/
-   /*@releases sn.members@*/
-{
-  smemberInfo_free (sn.members);
-}
-
-void
-sort_destroyMod (void)
-   /*@globals killed sortTable, killed arrayRefNameNode,
-              killed ptr2arrayNameNode,killed deRefNameNode,
- 	      killed nilNameNode, killed plusNameNode,
-	      killed minusNameNode, killed condNameNode,
-	      killed eqNameNode, killed neqNameNode @*/
-{
-  if (sortTable != NULL)  
-    {
-      int i;
-
-      for (i = 0; i < sortTableSize; i++)
-	{
-	  sortNode_free (sortTable[i]);
-	}
-
-      nameNode_free (arrayRefNameNode);
-      nameNode_free (ptr2arrayNameNode);
-      nameNode_free (deRefNameNode);
-      nameNode_free (nilNameNode);
-      nameNode_free (plusNameNode);
-      nameNode_free (minusNameNode);
-      nameNode_free (condNameNode);
-      nameNode_free (eqNameNode);
-      nameNode_free (neqNameNode);
-
-      sfree (sortTable);
-      /*@-branchstate@*/
-    }
-} /*@=branchstate@*/
-
-sort
-sort_makeNoSort (void)
-{
-  return NOSORTHANDLE;
-}
-
-sort
-sort_makeHOFSort (sort base)
-{
-  sortNode outSort;
-  sort handle;
-
-  outSort.kind = SRT_HOF;
-  outSort.name = cstring_toSymbol (message ("_HOF_sort_%d", sortTableSize));
-  outSort.tag = lsymbol_undefined;
-  outSort.baseSort = base;
-  outSort.objSort = NOSORTHANDLE;
-  outSort.members = smemberInfo_undefined;
-  outSort.export = exporting;
-  outSort.imported = context_inImport ();
-  outSort.mutable = FALSE;
-  outSort.abstract = FALSE;
-
-  llassert (sortTable != NULL);
-
-  outSort.handle = handle = sortTableSize;
-  sortTable[handle] = outSort;
-
-  sortTableSize++;
-  return handle;
-}
-
-static sort
-sort_construct (lsymbol name, sortKind kind, sort baseSort,
-		lsymbol tagName,
-		bool mut, sort objSort, /*@null@*/ smemberInfo *members)
-{
-  sortNode outSort;
-  sort handle;
-
-  handle = sort_lookupName (name);
-
-  outSort.kind = kind;
-  outSort.name = name;
-  outSort.tag = tagName;
-  outSort.realtag = TRUE; 
-  outSort.baseSort = baseSort;
-  outSort.objSort = objSort;
-  outSort.members = members;
-  outSort.mutable = mut;
-  outSort.export = exporting;
-  outSort.imported = context_inImport ();
-  outSort.abstract = FALSE;
-  outSort.handle = handle;
-
-  if (handle == NOSORTHANDLE)
-    {
-      outSort.handle = handle = sort_enterNew (outSort);
-      return handle;
-    }
-  else
-    {
-      llassert (sortTable != NULL);
-
-      if (sortTable[handle].kind != kind)
-	{
-	  sortError (ltoken_undefined, handle, outSort);
-	  smemberInfo_free (outSort.members);
-
-	  return handle;
-	}
-      else
-	{
-	  /* evs --- added 11 Mar 1994
-	  ** the new entry should supercede the old one, since
-          ** it could be a forward reference to a struct, etc.
-          */
-
-	  sortTable[handle] = outSort;
-	  return handle;
-	}
-    }
-}
-
-static sort
-  sort_constructAbstract (lsymbol name, bool mut, sort baseSort)
-{
-  sortNode outSort;
-  sortKind kind;
-  sort handle;
-
-  if (mut)
-    kind = SRT_OBJ;
-  else
-    kind = SRT_PRIM;
-
-  handle = sort_lookupName (name);
-  outSort.kind = kind;
-  outSort.name = name;
-  outSort.tag = lsymbol_undefined;
-  outSort.baseSort = baseSort;
-  outSort.objSort = NOSORTHANDLE;
-  outSort.members = smemberInfo_undefined;
-  outSort.mutable = mut;
-  outSort.export = exporting;
-  outSort.imported = context_inImport ();
-  outSort.abstract = TRUE;
-  outSort.handle = handle;
-
-  if (handle == NOSORTHANDLE)
-    {
-      outSort.handle = handle = sort_enterNew (outSort);
-      /* do not make sort operators. */
-    }
-  else
-    {
-      llassert (sortTable != NULL);
-
-      if (sortTable[handle].kind != kind)
-	{
-	  sortError (ltoken_undefined, handle, outSort);
-	}
-
-      smemberInfo_free (outSort.members);
-    }
-
-  return handle;
-}
-
-sort
-sort_makeSort (/*@unused@*/ ltoken t, lsymbol n)
-{
-  /*
-  ** Expects n to be a new sort.
-  ** Generate a sort with the given name.  Useful for LSL sorts. 
-  */
-
-  sort handle = sort_lookupName (n);
-
-  if (handle == NOSORTHANDLE)
-    {
-      sortNode outSort;
-
-      outSort.handle = handle;      
-      outSort.kind = SRT_PRIM;
-      outSort.name = n;
-      outSort.tag = lsymbol_undefined;
-      outSort.baseSort = NOSORTHANDLE;
-      outSort.objSort = NOSORTHANDLE;
-      outSort.members = smemberInfo_undefined;
-      outSort.export = exporting;
-      outSort.mutable = FALSE;
-      outSort.imported = context_inImport ();
-      outSort.abstract = FALSE;
-
-      /* Put into sort table, sort_enter checks for duplicates. */
-      outSort.handle = handle = sort_enterNew (outSort);
-    }
-  else
-    {
-      /* don't override old info */
-     ;
-    }
-
-  return handle;
-}
-
-static sort
-sort_makeSortNoOps (/*@unused@*/ ltoken t, lsymbol n) /*@modifies internalState@*/ 
-{
-  sort handle;
-  
-  handle = sort_lookupName (n);
-
-  if (handle == NOSORTHANDLE)
-    {
-      sortNode outSort;
-
-      outSort.handle = handle;
-      outSort.kind = SRT_PRIM;
-      outSort.name = n;
-      outSort.tag = lsymbol_undefined;
-      outSort.baseSort = NOSORTHANDLE;
-      outSort.objSort = NOSORTHANDLE;
-      outSort.members = smemberInfo_undefined;
-      outSort.export = exporting;
-      outSort.mutable = FALSE;
-      outSort.imported = context_inImport ();
-      outSort.abstract = FALSE;
-      /* Put into sort table, sort_enter checks for duplicates. */
-      outSort.handle = handle = sort_enterNew (outSort);
-    }				/* don't override old info */
-
-  return handle;
-}
-
-static sort
-sort_makeLiteralSort (ltoken t, lsymbol n) 
-   /*@modifies internalState@*/
-{
-  /*
-  ** Like sort_makeSort, in addition, generate sizeof operator 
-  ** t not currently used, may be useful for generating error msgs later 
-  ** Also useful for abstract types, need sizeof operator.
-  */
-
-  sort handle = sort_makeSort (t, n);
-
-  overloadSizeof (handle);
-  return handle;
-}
-
-sort
-sort_makeSyn (ltoken t, sort s, lsymbol n)
-{
-  /* make a synonym sort with name n that is == to sort s */
-  /* expect n to be a new sort name */
-  sortNode outSort;
-  sort handle;
-  /* must not clash with any LSL sorts */
-  lsymbol newname = sp (underscoreSymbol, n);
-  
-  if (n == lsymbol_undefined)
-    {
-      llbuglit ("sort_makeSyn: synonym must have name");
-    }
-
-  handle = sort_lookupName (newname);
-
-  outSort.kind = SRT_SYN;
-  outSort.name = newname;
-  outSort.baseSort = s;
-  outSort.objSort = NOSORTHANDLE;
-  /* info is not duplicated */
-  outSort.tag = lsymbol_undefined;
-  outSort.members = smemberInfo_undefined;
-  outSort.export = exporting;
-  outSort.mutable = FALSE;
-  outSort.imported = context_inImport ();
-  outSort.abstract = FALSE;
-  outSort.handle = handle;
-
-  if (handle == NOSORTHANDLE)
-    {
-      outSort.handle = handle = sort_enterNew (outSort);
-      /* No operators to generate for synonyms */
-    }
-  else
-    {
-      llassert (sortTable != NULL);
-      
-      if (sortTable[handle].kind != SRT_SYN)
-	{
-	  sortError (t, handle, outSort);
-	}
-
-      smemberInfo_free (outSort.members);
-    }
-
-  return handle;
-}
-
-sort
-sort_makeFormal (sort insort)
-{
-  sortNode s;
-  sort sor, handle;
-
-  sor = sort_getUnderlying (insort);
-  handle = sor;
-  s = sort_lookup (sor);
-
-  switch (s.kind)
-    {
-    case SRT_STRUCT:
-      handle = sort_makeTuple (ltoken_undefined, sor);
-      break;
-    case SRT_UNION:
-      handle = sort_makeUnionVal (ltoken_undefined, sor);
-      break;
-    default:
-      break;
-    }
-
-  return handle;
-}
-
-sort
-sort_makeGlobal (sort insort)
-{
-  /* Make a Obj if not an array or a struct */
-  sortNode s;
-  sort sor, handle;
-  sor = sort_getUnderlying (insort);
-  handle = sor;
-  s = sort_lookup (sor);
-
-  switch (s.kind)
-    {
-    case SRT_ARRAY:
-    case SRT_STRUCT:
-    case SRT_UNION:
-    case SRT_HOF:
-    case SRT_NONE:
-      break;
-    case SRT_VECTOR:
-    case SRT_TUPLE:
-    case SRT_UNIONVAL:
-      llcontbuglit ("sort_makeGlobal: can't make vectors, tuples, or unionvals global");
-      break;
-    default:
-      handle = sort_makeObj (sor);
-      break;
-    }
-  return handle;
-}
-
-sort
-sort_makeObj (sort sor)
-{
-  sortNode baseSortNode, outSort;
-  sort baseSort, handle;
-  lsymbol name;
-
- /* skip the synonym sort */
-  baseSort = sort_getUnderlying (sor);
-  baseSortNode = sort_quietLookup (baseSort);
-  switch (baseSortNode.kind)
-    {
-    case SRT_HOF:
-    case SRT_NONE:
-      return baseSort;
-    case SRT_VECTOR:
-      if (baseSortNode.objSort != 0)
-	return baseSortNode.objSort;
-      else			/* must have well-defined objSort field */
-	{
-	  llcontbuglit ("sort_makeObj: Inconsistent vector reps:invalid objSort field");
-	  return baseSort;
-	}
-    case SRT_TUPLE:
-    case SRT_UNIONVAL:
-     /* need to map *_Struct_Tuple to *_Struct and *_Union_UnionVal to
-      *_Union, according to sort naming conventions */
-      if (baseSortNode.baseSort != NOSORTHANDLE)
-       /* for tuples and unionvals, baseSort field keeps the map from
-          value sort to obj sort. */
-	return baseSortNode.baseSort;
-      else			/* valid tuples and unionvals must have baseSort fields */
-	{
-	  llcontbuglit ("sort_makeObj: Inconsistent tuples or unionvals reps: invalid baseSort field");
-	  return baseSort;
-	}
-    default:
-      name = sp (sp (underscoreSymbol, sort_getLsymbol (baseSort)),
-		 lsymbol_fromChars ("_Obj"));
-      handle = sort_lookupName (name);
-
-      outSort.kind = SRT_OBJ;
-      /* must not clash with any LSL sorts */
-      outSort.name = name;
-      outSort.tag = lsymbol_undefined;
-      outSort.baseSort = baseSort;
-      outSort.objSort = NOSORTHANDLE;
-      outSort.members = smemberInfo_undefined;
-      outSort.mutable = TRUE;
-      outSort.export = exporting;
-      outSort.abstract = FALSE;
-      outSort.handle = handle;
-      outSort.imported = TRUE;
-
-      if (handle == NOSORTHANDLE)
-	{
-	  if (sort_isNewEntry (outSort))
-	    {
-	      outSort.handle = handle = sort_enterNew (outSort);
-	    }
-	  else
-	    {
-	      outSort.handle = handle = sort_enterNew (outSort);
-	    }
-	}
-      else
-	{
-	  llassert (sortTable != NULL);
-
-	  if (sortTable[handle].kind != SRT_OBJ)
-	    {
-	      sortError (ltoken_undefined, handle, outSort);
-	    }
-
-	  smemberInfo_free (outSort.members);
-	}
-
-      return handle;
-    }
-}
-
-sort
-sort_makePtr (ltoken t, sort baseSort)
-{
-  sortNode s, outSort;
-  sort handle, arrayHandle;
-  lsymbol name;
-
-  s = sort_lookup (baseSort);
-
-  if (s.kind == SRT_HOF)
-    {
-      return baseSort;
-    }
-  if (s.kind == SRT_NONE)
-    {
-      return baseSort;
-    }
-
-  if (s.kind != SRT_ARRAY && s.kind != SRT_STRUCT &&
-      s.kind != SRT_UNION)
-    /* && s.kind != SRT_OBJ) */
-    /* base is not an SRT_ARRAY, struct or union.  Need to insert a obj. */
-    baseSort = sort_makeObj (baseSort);
-  
-  name = sp (sp (underscoreSymbol, sort_getLsymbol (baseSort)),
-	     lsymbol_fromChars ("_Ptr"));
-  handle = sort_lookupName (name);
-  
-  outSort.kind = SRT_PTR;
-  outSort.name = name;
-  outSort.tag = lsymbol_undefined;
-  outSort.baseSort = baseSort;
-  outSort.objSort = NOSORTHANDLE;
-  outSort.members = smemberInfo_undefined;
-  outSort.mutable = FALSE;
-  outSort.export = exporting;
-  outSort.imported = context_inImport ();
-  outSort.abstract = FALSE;
-  outSort.handle = handle;
-  
-  if (handle == NOSORTHANDLE)
-    {
-      if (sort_isNewEntry (outSort))
-	{
-	  outSort.handle = handle = sort_enterNew (outSort);
-	  arrayHandle = sort_makeArr (t, baseSort);
-	  genPtrOps (baseSort, handle, arrayHandle);
-	}
-      else
-	{
-	  outSort.handle = handle = sort_enterNew (outSort);
-	}
-    }
-  else
-    {
-      llassert (sortTable != NULL);
-
-      if (sortTable[handle].kind != SRT_PTR)
-	{
-	  sortError (t, handle, outSort);
-	}
-      smemberInfo_free (outSort.members);
-    }
-  return handle;
-}
-
-sort
-sort_makePtrN (sort s, int pointers)
-{
-  llassert (pointers >= 0);
-
-  if (pointers == 0)
-    {
-      return s;
-    }
-  else
-    {
-      return sort_makePtrN (sort_makePtr (ltoken_undefined, s), 
-			    pointers - 1);
-    }
-}
-
-sort
-sort_makeArr (ltoken t, sort baseSort)
-{
-  sortNode s, outSort, old;
-  sort handle, vecHandle;
-  int dim;
-  lsymbol name;
-
-  s = sort_lookup (baseSort);
-
-  if (s.kind == SRT_HOF)
-    return baseSort;
-  if (s.kind == SRT_NONE)
-    return baseSort;
-
-  if (s.kind != SRT_ARRAY && s.kind != SRT_STRUCT &&
-      s.kind != SRT_UNION && s.kind != SRT_OBJ)
-   /* base is not an array, struct or obj.  Need to insert a Obj. */
-    baseSort = sort_makeObj (baseSort);
-
-  name = sp (sp (underscoreSymbol, sort_getLsymbol (baseSort)),
-	     lsymbol_fromChars ("_Arr"));
-  handle = sort_lookupName (name);
-
- /* must not clash with any LSL sorts */
-  outSort.name = name;
-  outSort.kind = SRT_ARRAY;
-  outSort.baseSort = baseSort;
-  outSort.objSort = NOSORTHANDLE;
-  outSort.members = smemberInfo_undefined;
-  outSort.mutable = TRUE;
-  outSort.export = exporting;
-  outSort.imported = context_inImport ();
-  outSort.abstract = FALSE;
-  outSort.handle = handle;
-  
-  if (handle == NOSORTHANDLE)
-    {
-      if (sort_isNewEntry (outSort))
-	{
-	  outSort.handle = handle = sort_enterNew (outSort);
-
-	  for (old = outSort, dim = 0;
-	       old.kind == SRT_ARRAY;
-	       dim++, old = sort_lookup (old.baseSort))
-	    {
-	      ;
-	    }
-
-	  vecHandle = sort_makeVec (t, handle);
-	  genArrOps (baseSort, handle, dim, vecHandle);
-	}
-      else
-	{
-	  outSort.handle = handle = sort_enterNew (outSort);
-	}
-    }
-  else
-    {
-      llassert (sortTable != NULL);
-
-      if (sortTable[handle].kind != SRT_ARRAY)
-	{
-	  sortError (t, handle, outSort);
-	}
-
-      smemberInfo_free (outSort.members);
-    }
-
-  return handle;
-}
-
-sort
-sort_makeVec (ltoken t, sort arraySort)
-{
-  sortNode s, outSort, old;
-  sort baseSort, handle, elementSort;
-  int dim;			/* array dimension count. */
-  lsymbol name;
-
-  s = sort_lookup (arraySort);
-
-  if (s.kind == SRT_HOF)
-    return arraySort;
-  if (s.kind == SRT_NONE)
-    return arraySort;
-
-  if (s.kind != SRT_ARRAY)
-    {
-      llbug (message ("sort_makeVec: only arrays can become vectors: given sort is %s",
-		      sort_unparseKind (s.kind)));
-    }
-
-  if (s.baseSort == NOSORTHANDLE)
-    llbuglit ("sort_makeVec: arrays must have base (element) sort");
-
- /* Vectors return "values", so make array elements values. */
-
-  baseSort = s.baseSort;
-  elementSort = sort_makeVal (baseSort);
-
-  name = sp (sp (underscoreSymbol, sort_getLsymbol (elementSort)),
-	     lsymbol_fromChars ("_Vec"));
-  handle = sort_lookupName (name);
-
-  outSort.baseSort = elementSort;
-  outSort.name = name;
-  outSort.objSort = arraySort;
-  outSort.kind = SRT_VECTOR;
-  outSort.members = smemberInfo_undefined;
-  outSort.mutable = FALSE;
-  outSort.export = exporting;
-  outSort.imported = context_inImport ();
-  outSort.abstract = FALSE;
-  outSort.handle = handle;
-
-  if (handle == NOSORTHANDLE)
-    {
-      if (sort_isNewEntry (outSort))
-	{
-	  outSort.handle = handle = sort_enterNew (outSort);
-
-	  for (old = outSort, dim = 0;
-	       old.kind == SRT_VECTOR;
-	       dim++, old = sort_lookup (old.baseSort))
-	    {
-	      ;
-	    }
-
-	  genVecOps (elementSort, handle, dim);
-	}
-      else
-	{
-	  outSort.handle = handle = sort_enterNew (outSort);
-	}
-    }
-  else
-    {
-      llassert (sortTable != NULL);
-
-      if (sortTable[handle].kind != SRT_VECTOR)
-	{
-	  sortError (t, handle, outSort);
-	}
-
-      smemberInfo_free (outSort.members);
-    }
-
-  return handle;
-}
-
-sort
-sort_makeVal (sort sor)
-{
-  sort retSort = sor;
-  sortNode rsn, s;
-
-  llassert (sortTable != NULL);
-  s = sort_quietLookup (sor);
-
-  switch (s.kind)
-    {
-    case SRT_PRIM:
-    case SRT_ENUM:
-    case SRT_PTR:
-    case SRT_TUPLE:
-    case SRT_UNIONVAL:
-    case SRT_VECTOR:
-    case SRT_HOF:
-    case SRT_NONE:
-     /* Do nothing for basic types and pointers. */
-      retSort = sor;
-      break;
-    case SRT_SYN:
-      return sort_makeVal (sortTable[sor].baseSort);
-    case SRT_OBJ:
-     /* Strip out the last Obj's */
-      if (s.baseSort == NOSORTHANDLE)
-	{
-	  llbuglit ("sort_makeVal: expecting a base sort for Obj");
-	}
-      retSort = s.baseSort;
-      break;
-    case SRT_ARRAY:
-      retSort = sort_makeVec (ltoken_undefined, sor);
-      break;
-    case SRT_STRUCT:
-      retSort = sort_makeTuple (ltoken_undefined, sor);
-      break;
-    case SRT_UNION:
-      retSort = sort_makeUnionVal (ltoken_undefined, sor);
-      break;
-    default:
-      llbuglit ("sort_makeVal: invalid sort kind");
-    }
-  rsn = sort_quietLookup (retSort);
-  if (rsn.kind == SRT_NONE)
-    {
-      llfatalbug (message ("sort_makeVal: invalid return sort kind: %d", (int)rsn.kind));
-    }
-  return retSort;
-}
-
-sort
-sort_makeImmutable (ltoken t, lsymbol name)
-{
-  sortNode outSort;
-  sort handle;
-
-  handle = sort_lookupName (name);
-
-  outSort.kind = SRT_PRIM;
-  outSort.name = name;
-  outSort.baseSort = NOSORTHANDLE;
-  outSort.objSort = NOSORTHANDLE;
-  outSort.members = smemberInfo_undefined;
-  outSort.export = exporting;
-  outSort.mutable = FALSE;
-  outSort.imported = context_inImport ();
-  outSort.abstract = TRUE;
-  outSort.handle = handle;
-
-  if (handle == NOSORTHANDLE)
-    {
-      outSort.handle = handle = sort_enterNew (outSort);
-      overloadSizeof (handle);
-    }
-  else
-    {				/* complain */
-      llassert (sortTable != NULL);
-
-      if ((sortTable[handle].kind != SRT_PRIM) &&
-	  (sortTable[handle].abstract) &&
-	  (!sortTable[handle].mutable))
-	{
-	  sortError (t, handle, outSort);
-	}
-
-      smemberInfo_free (outSort.members);
-    }
-
-  return handle;
-}
-
-sort
-sort_makeMutable (ltoken t, lsymbol name)
-{
-  sort immutable_old, handle, baseSort;
-  lsymbol objName;
-
-  immutable_old = sort_lookupName (name);
-
- /* First generate the value sort */
-  baseSort = sort_makeImmutable (t, name);
-
-  llassert (sortTable != NULL);
-
-  /* to prevent duplicate error messages */
-  if (immutable_old != NOSORTHANDLE &&
-      (sortTable[baseSort].kind != SRT_PRIM) &&
-      (sortTable[baseSort].abstract) &&
-      (!sortTable[baseSort].mutable))
-    {
-     /* already complained */
-      handle = NOSORTHANDLE;
-    }
-  else
-    {				/* sort_makeImmutable must have succeeded */
-      sortNode outSort;
-
-     /* must not clash with any LSL sorts */
-      objName = sp (sp (underscoreSymbol, name),
-		    lsymbol_fromChars ("_Obj"));
-      handle = sort_lookupName (objName);
-
-      outSort.kind = SRT_OBJ;
-      outSort.name = objName;
-      outSort.tag = lsymbol_undefined;
-      outSort.baseSort = baseSort;
-      outSort.objSort = NOSORTHANDLE;
-      outSort.members = smemberInfo_undefined;
-      outSort.mutable = TRUE;
-      outSort.export = exporting;
-      outSort.imported = context_inImport ();
-      outSort.abstract = TRUE;
-      outSort.handle = handle;
-
-      if (handle == NOSORTHANDLE)
-	{
-	  if (sort_isNewEntry (outSort))
-	    {
-	      outSort.handle = handle = sort_enterNew (outSort);
-	    }
-	  else
-	    {
-	      handle = sort_enterNew (outSort);
-	    }
-	}
-      else 
-	{
-	  llassert (sortTable != NULL);
-
-	  if ((sortTable[handle].kind != SRT_OBJ) 
-	      && sortTable[handle].abstract
-	      && sortTable[handle].mutable)
-	    {
-	      sortError (t, handle, outSort);
-	    }
-
-	  smemberInfo_free (outSort.members);
-	}
-    }
-  return handle;
-}
-
-sort
-sort_makeStr (ltoken opttagid)
-{
-  sortNode outSort;
-  sort handle;
-  bool isNewTag;
-  lsymbol name;
-
-  /* must not clash with any LSL sorts, tag2sortname adds "_" prefix */
-  /* isNewTag true means that the name generated is new */
-
-  if (ltoken_isUndefined (opttagid))
-    {
-      opttagid = ltoken_create (simpleId, newStructTag ());
-
-      outSort.realtag = FALSE;
-    }
-  else
-    {
-      outSort.realtag = TRUE;
-    }
-  
-  name = sortTag_toSymbol ("Struct", opttagid, &isNewTag);
-  
-  llassert (sortTable != NULL);
-  handle = sort_lookupName (name);
-  outSort.name = name;
-  outSort.kind = SRT_STRUCT;
-  outSort.tag = ltoken_getText (opttagid);
-  outSort.baseSort = NOSORTHANDLE;
-  outSort.objSort = NOSORTHANDLE;
-  outSort.members = smemberInfo_undefined;
-  outSort.export = exporting;
-  outSort.mutable = TRUE;
-  outSort.imported = context_inImport ();
-  outSort.abstract = FALSE;
-  outSort.handle = handle;
-
-  if (handle == NOSORTHANDLE)
-    {
-      if (sort_isNewEntry (outSort))
-	{
-	  outSort.handle = handle = sort_enterNew (outSort);
-	}
-      else
-	{
-	  outSort.handle = handle = sort_enterNewForce (outSort);
-	}
-    }
-  else 
-    {
-      if (sortTable[handle].kind != SRT_STRUCT)
-	{
-	  sortError (opttagid, handle, outSort);
-	}
-
-      smemberInfo_free (outSort.members);
-    }
-
-  return handle;
-}
-
-bool
-sort_updateStr (sort strSort, /*@only@*/ smemberInfo *info)
-{
-  /* expect strSort to be in sort table but not yet filled in */
-  /* return TRUE if it is "new" */
-  sort tupleSort;
-  sortNode sn;
-  
-  llassert (sortTable != NULL);
-  sn = sort_lookup (strSort);
-
-  if (sn.members == (smemberInfo *) 0)
-    {
-      sortTable[strSort].members = info;
-      tupleSort = sort_makeTuple (ltoken_undefined, strSort);
-      genStrOps (strSort, tupleSort);
-      return TRUE;
-    }
-  else
-    {
-      smemberInfo_free (info);
-      return FALSE;
-    }
-}
-
-sort
-sort_makeTuple (ltoken t, sort strSort)
-{
-  sort handle;
-  sortNode outSort, s = sort_lookup (strSort);
-  lsymbol name;
-
-  if (s.kind != SRT_STRUCT)
-    {
-      llfatalbug (message ("sort_makeTuple: Only structs can become tuples: given sort is %s",
-			   sort_unparseKind (s.kind)));
-    }
-
-  name = sp (s.name, lsymbol_fromChars ("_Tuple"));
-  llassert (sortTable != NULL);
-  handle = sort_lookupName (name);
-
-  outSort.kind = SRT_TUPLE;
-  outSort.name = name;
-  outSort.tag = s.tag;
-  outSort.realtag = s.realtag;
-  outSort.baseSort = strSort;
-  outSort.objSort = NOSORTHANDLE;
-  outSort.members = smemberInfo_undefined;
-  outSort.export = exporting;
-  outSort.abstract = FALSE;
-  outSort.imported = context_inImport ();
-  outSort.mutable = FALSE;
-  outSort.handle = handle;
-
-  if (handle == NOSORTHANDLE)
-    {
-      if (sort_isNewEntry (outSort))
-	{
-	  outSort.handle = handle = sort_enterNew (outSort);
-
-	  sort_addTupleMembers (handle, strSort);
-	  genTupleOps (handle);
-	}
-      else
-	{
-	  outSort.handle = handle = sort_enterNew (outSort);
-	}
-    }
-  else 
-    {
-      if (sortTable[handle].kind != SRT_TUPLE)
-	{
-	  sortError (t, handle, outSort);
-	}
-
-      smemberInfo_free (outSort.members);
-    }
-
-  return handle;
-}
-
-static void
-sort_addTupleMembers (sort tupleSort, sort strSort)
-{
-  smemberInfo *mem, *tail = smemberInfo_undefined;
-  smemberInfo *top = smemberInfo_undefined;
-  smemberInfo *newinfo;
-  
-  /* make sure it works for empty smemberInfo */
-  
-  llassert (sortTable != NULL);
- 
- for (mem = sortTable[strSort].members;
-       mem != smemberInfo_undefined; mem = mem->next)
-    {
-      newinfo = (smemberInfo *) dmalloc (sizeof (*newinfo));
-      newinfo->name = mem->name;
-      newinfo->sort = sort_makeVal (mem->sort);
-      newinfo->next = smemberInfo_undefined;
-
-      if (top == smemberInfo_undefined)
-	{			/* start of iteration */
-	  top = newinfo;
-	  tail = newinfo;
-	}
-      else
-	{
-	  llassert (tail != smemberInfo_undefined);
-
-	  tail->next = newinfo;
-	  tail = newinfo;
-	  /*@-branchstate@*/ /* tail is dependent */
-	} 
-      /*@=branchstate@*/
-    }
-
-  sortTable[tupleSort].members = top;
-}
-
-static 
-void genTupleOps (sort tupleSort)
-{
-  ltoken range, dom;
-  sort fieldsort;
-  smemberInfo *m;
-  unsigned int memCount;
-  ltokenList domain = ltokenList_new ();
-  sigNode signature;
-  opFormUnion u;
-  opFormNode opform;
-  nameNode nn;
-
-  memCount = 0;
-  range = ltoken_createType (simpleId, SID_SORT, sort_getLsymbol (tupleSort));
-
-  llassert (sortTable != NULL);
-  for (m = sortTable[tupleSort].members;
-       m != smemberInfo_undefined; m = m->next)
-    {
-      fieldsort = sort_makeVal (m->sort);
-      overloadUnary (makeFieldOp (m->name), tupleSort, fieldsort);
-
-      dom = ltoken_createType (simpleId, SID_SORT,
-			       sort_getLsymbol (fieldsort));
-      ltokenList_addh (domain, dom);
-      memCount++;
-    }
-
-  /* For tuples only: [__, ...]: memSorts, ... -> tupleSort */
-  signature = makesigNode (ltoken_undefined, domain, range);
-  u.middle = memCount;
-
-  opform = makeOpFormNode (ltoken_copy (ltoken_lbracked),
-			   OPF_BMIDDLE, u, ltoken_copy (ltoken_rbracket));
-
-  nn = makeNameNodeForm (opform);
-  symtable_enterOp (g_symtab, nn, signature);
-  
-  /*
-  ** should not be able to take sizeof (struct^) ...
-  */
-}
-
-static 
-void genUnionOps (sort tupleSort)
-{
- /* like genTupleOps but no constructor [ ...]: -> unionSort */
-  smemberInfo *m;
-  sort sort;
-
-  llassert (sortTable != NULL);
-  for (m = sortTable[tupleSort].members;
-       m != smemberInfo_undefined; m = m->next)
-    {
-     /* Generate __.memName: strSort ->memSortObj */
-      overloadUnary (makeFieldOp (m->name), tupleSort, m->sort);
-     /*    printf ("making __.%s: %s -> %s\n", lsymbol_toChars (m->name),
-                sort_getName (tupleSort), sort_getName (m->sort)); */
-     /* __->memName : Union_Ptr -> memSortObj */
-      sort = sort_makePtr (ltoken_undefined, tupleSort);
-      overloadUnary (makeArrowFieldOp (m->name), sort, m->sort);
-     /*    printf ("making __->%s: %s -> %s\n", lsymbol_toChars (m->name),
-                sort_getName (sort), sort_getName (m->sort)); */
-    }
-}
-
-static 
-void genStrOps (sort strSort, /*@unused@*/ sort tupleSort)
-{
-  smemberInfo *m;
-  sort sort;
-  
-  llassert (sortTable != NULL);
-  for (m = sortTable[strSort].members;
-       m != smemberInfo_undefined; m = m->next)
-    {
-     /* Generate __.memName: strSort ->memSortObj */
-      overloadUnary (makeFieldOp (m->name), strSort, m->sort);
-      /*    printf ("making __.%s: %s -> %s\n", lsymbol_toChars (m->name),
-	    sort_getName (strSort), sort_getName (m->sort)); */
-      /* __->memName : Struct_Ptr -> memSortObj */
-      sort = sort_makePtr (ltoken_undefined, strSort);
-      overloadUnary (makeArrowFieldOp (m->name), sort, m->sort);
-      /*    printf ("making __->%s: %s -> %s\n", lsymbol_toChars (m->name),
-	    sort_getName (sort), sort_getName (m->sort)); */
-    }
-  /* Generate fresh, trashed, modifies, unchanged: struct/union -> bool */
-  /* Generate __any, __pre, __post: nStruct -> nTuple */
-  /* Generate sizeof: strSort -> int */
-  /* overloadStateFcns (strSort, tupleSort); */
-}
-
-sort
-sort_makeUnion (ltoken opttagid)
-{
-  sortNode outSort;
-  sort handle;
-  bool isNewTag; 
-  lsymbol name;
-
-  /* must not clash with any LSL sorts, tag2sortname adds "_" prefix */
-  /* isNewTag true means that the name generated is new */
-
-  if (ltoken_isUndefined (opttagid))
-    {
-      opttagid = ltoken_create (simpleId, newUnionTag ());
-      outSort.realtag = FALSE;
-    }
-  else
-    outSort.realtag = TRUE;
-
-  llassert (sortTable != NULL);
-  name = sortTag_toSymbol ("Union", opttagid, &isNewTag);
-  handle = sort_lookupName (name);
-  outSort.name = name;
-  outSort.kind = SRT_UNION;
-  outSort.tag = ltoken_getText (opttagid);
-  outSort.baseSort = NOSORTHANDLE;
-  outSort.objSort = NOSORTHANDLE;
-  outSort.members = smemberInfo_undefined;
-  outSort.export = exporting;
-  outSort.mutable = TRUE;
-  outSort.imported = context_inImport ();
-  outSort.abstract = FALSE;
-  outSort.handle = handle;
-  
-  if (handle == NOSORTHANDLE)
-    {
-      if (sort_isNewEntry (outSort))
-	{
-	  outSort.handle = handle = sort_enterNew (outSort);
-	}
-      else
-	{
-	  outSort.handle = handle = sort_enterNewForce (outSort);
-	}
-    }
-  else 
-    {
-      if (sortTable[handle].kind != SRT_UNION)
-	{
-	  sortError (opttagid, handle, outSort);
-	}
-
-      smemberInfo_free (outSort.members);
-    }
-
-  return handle;
-}
-
-bool
-sort_updateUnion (sort unionSort, /*@only@*/ smemberInfo *info)
-{
- /* expect unionSort to be in sort table but not yet filled in */
- /* return TRUE if it is "new" */
-  sort uValSort;
-  sortNode sn;
-
-  llassert (sortTable != NULL);
-
-  sn = sort_lookup (unionSort);
-
-  if (sn.members == (smemberInfo *) 0)
-    {
-      sortTable[unionSort].members = info;
-      uValSort = sort_makeUnionVal (ltoken_undefined, unionSort);
-      /* same as struct operations */
-      genStrOps (unionSort, uValSort);
-      return TRUE;
-    }
-  else
-    {
-      smemberInfo_free (info);
-      return FALSE;
-    }
-}
-
-sort
-sort_makeUnionVal (ltoken t, sort unionSort)
-{
-  sort handle;
-  sortNode outSort, s = sort_lookup (unionSort);
-  lsymbol name;
-
-  if (s.kind != SRT_UNION)
-    {
-      llfatalbug (message ("sort_makeUnion: only unions can become unionVals: given sort is: %s",
-			   sort_unparseKind (s.kind)));
-    }
-
-  llassert (sortTable != NULL);
-
-  name = sp (s.name, lsymbol_fromChars ("_UnionVal"));
-  handle = sort_lookupName (name);
-
-  outSort.kind = SRT_UNIONVAL;
-  outSort.name = name;
-  outSort.tag = s.tag;
-  outSort.realtag = s.realtag;
-  outSort.baseSort = unionSort;
-  outSort.objSort = NOSORTHANDLE;
-  outSort.members = smemberInfo_undefined;
-  outSort.export = exporting;
-  outSort.abstract = FALSE;
-  outSort.imported = context_inImport ();
-  outSort.mutable = FALSE;
-  outSort.handle = handle;
-
-  if (handle == NOSORTHANDLE)
-    {
-      if (sort_isNewEntry (outSort))
-	{
-	  outSort.handle = handle = sort_enterNew (outSort);
-
-	  /* Add members to the unionVal's. */
-	  /* same as structs and tuples */
-
-	  sort_addTupleMembers (handle, unionSort);
-	  genUnionOps (handle);
-	}
-      else
-	{
-	  outSort.handle = handle = sort_enterNew (outSort);
-	}
-    }
-  else 
-    {
-      if (sortTable[handle].kind != SRT_UNIONVAL)
-	{
-	  sortError (t, handle, outSort);
-	}
-
-      smemberInfo_free (outSort.members);
-    }
-
-  return handle;
-}
-
-static lsymbol
-newEnumTag ()
-{
-  static int ecount = 0;
-
-  return (cstring_toSymbol (message ("e%s%de", context_moduleName (), ecount++)));
-}
-
-static lsymbol
-newStructTag ()
-{
-  static int ecount = 0;
-
-  return (cstring_toSymbol (message ("s%s%ds", context_moduleName (), ecount++)));
-}
-
-static lsymbol
-newUnionTag ()
-{
-  static int ecount = 0;
-
-  return (cstring_toSymbol (message ("u%s%du", context_moduleName (), ecount++)));
-}
-
-sort
-sort_makeEnum (ltoken opttagid)
-{
-  sortNode outSort;
-  sort handle;
-  bool isNew;
-  lsymbol name;
-
-  llassert (sortTable != NULL);
-
-  if (ltoken_isUndefined (opttagid))
-    {
-      opttagid = ltoken_create (simpleId, newEnumTag ());
-      outSort.realtag = FALSE;
-    }
-  else
-    outSort.realtag = TRUE;
-  
-  /* must not clash with any LSL sorts, tag2sortname adds "_" prefix */
-
-  name = sortTag_toSymbol ("Enum", opttagid, &isNew);
-  handle = sort_lookupName (name);
-  outSort.name = name;
-  outSort.kind = SRT_ENUM;
-  outSort.tag = ltoken_getText (opttagid);
-  outSort.baseSort = NOSORTHANDLE;
-  outSort.objSort = NOSORTHANDLE;
-  outSort.members = smemberInfo_undefined;
-  outSort.export = exporting;
-  outSort.mutable = FALSE;
-  outSort.imported = context_inImport ();
-  outSort.abstract = FALSE;
-  outSort.handle = handle;
-
-  if (handle == NOSORTHANDLE)
-    {
-      if (sort_isNewEntry (outSort))
-	{
-	  outSort.handle = handle = sort_enterNew (outSort);
-	}
-      else
-	{
-	  outSort.handle = handle = sort_enterNewForce (outSort);
-	}
-    }
-  else 
-    {
-      if (sortTable[handle].kind != SRT_ENUM)
-	{
-	  sortError (opttagid, handle, outSort);
-	}
-
-      smemberInfo_free (outSort.members);
-    }
-
-  return handle;
-}
-
-bool
-sort_updateEnum (sort enumSort, /*@only@*/ smemberInfo *info)
-{
-  /*
-  ** Expect enumSort to be in sort table but not yet filled in.
-  ** Return TRUE if it is "new" 
-  */
-
-  sortNode sn;
-
-  llassert (sortTable != NULL);
-
-  sn = sort_lookup (enumSort);
-  if (sn.members == (smemberInfo *) 0)
-    {
-      sortTable[enumSort].members = info;
-      genEnumOps (enumSort);
-      return TRUE;
-    }
-  else
-    {
-      smemberInfo_free (info);
-      return FALSE;
-    }
-}
-
-static 
-void genEnumOps (sort enumSort)
-{
-  smemberInfo *ei;
-  ltokenList domain = ltokenList_new ();
-  ltoken range, mem;
-  nameNode nn;
-  sigNode signature;
-
-  range = ltoken_createType (simpleId, SID_SORT, sort_getLsymbol (enumSort));
-  signature = makesigNode (ltoken_undefined, domain, range);
-
-  llassert (sortTable != NULL);
-
-  for (ei = sortTable[enumSort].members;
-       ei != (smemberInfo *) 0; ei = ei->next)
-    {
-      mem = ltoken_createType (simpleId, SID_OP, ei->name);
-      nn = makeNameNodeId (mem);
-      symtable_enterOp (g_symtab, nn, sigNode_copy (signature));
-    }
-
-  sigNode_free (signature);
-  overloadSizeof (enumSort);
-}
-
-static void
-genPtrOps (/*@unused@*/ sort baseSort, sort ptrSort, sort arraySort)
-{
-  /* Generate *__: xPtr -> x */
-
-  /* overloadUnary (deRefNameNode, ptrSort, baseSort); */
-
-  /* Generate maxIndex, minIndex: xPtr -> int */
-  /* overloadUnaryTok (maxIndexNameNode, ptrSort, intToken); */
-  /* overloadUnaryTok (minIndexNameNode, ptrSort, intToken); */
-
-  /* Generate __[]: pointer -> array  */
-  overloadUnary (nameNode_copySafe (ptr2arrayNameNode), ptrSort, arraySort);
-
-  /* Generate __+__, __-__: pointer, int -> pointer  */
-  overloadBinary (nameNode_copySafe (plusNameNode), ptrSort, 
-		  ltoken_copy (intToken), ptrSort);
-
-  overloadBinary (nameNode_copySafe (minusNameNode), ptrSort, 
-		  ltoken_copy (intToken), ptrSort);
-
-  /* Generate NIL: -> xPtr */
-  /* Generate __+__: int, pointer -> pointer  */
-  /* Generate __-__: pointer, pointer -> int  */
-  overloadPtrFcns (ptrSort);
-}
-
-static void
-genArrOps (sort baseSort, sort arraySort, int dim, /*@unused@*/ sort vecSort)
-{
-  /* Generate __[__]: nArr, int -> n */
-  overloadBinary (nameNode_copySafe (arrayRefNameNode), arraySort, 
-		  ltoken_copy (intToken), baseSort);
-  
-  /* Generate maxIndex, minIndex: sort -> int */
-  /* overloadUnaryTok (maxIndexNameNode, arraySort, intToken); */
-  /* overloadUnaryTok (minIndexNameNode, arraySort, intToken); */
-  
-  /* Generate isSub: arraySort, int, ... -> bool */
-  overloadIsSub (arraySort, dim); 
-  
-  /* Generate fresh, trashed, modifies, unchanged: array -> bool  */
-  /* Generate any, pre, post: array -> vector */
-  
-  /* overloadStateFcns (arraySort, vecSort); */
-  /* overloadObjFcns (arraySort); */
-}
-
-/*
-** overloadPtrFcns:
-**   generate NIL: -> ptrSort
-**            __+__: int, ptrSort -> ptrSort  
-**            __-__: ptrSort, ptrSort -> int  
-*/
-static void
-overloadPtrFcns (sort ptrSort)
-{
-  ltokenList domain = ltokenList_new ();
-  ltoken range;
-  sigNode signature;
-  
-  /* NIL: -> ptrSort */
-  
-  range = ltoken_createType (simpleId, SID_SORT, sort_getLsymbol (ptrSort));
-  signature = makesigNode (ltoken_undefined, ltokenList_new (), ltoken_copy (range));
-  symtable_enterOp (g_symtab, nameNode_copySafe (nilNameNode), signature);
-  
-  /* __+__: int, ptrSort -> ptrSort  */
-  
-  ltokenList_addh (domain, ltoken_copy (intToken));
-  ltokenList_addh (domain, ltoken_copy (range));
-
-  signature = makesigNode (ltoken_undefined, domain, ltoken_copy (range));
-  symtable_enterOp (g_symtab, nameNode_copySafe (plusNameNode), signature);
-  
-  /* __-__: ptrSort, ptrSort -> int  */
-
-  domain = ltokenList_new ();
-  ltokenList_addh (domain, ltoken_copy (range));
-  ltokenList_addh (domain, range);
-  range = ltoken_copy (intToken);
-  signature = makesigNode (ltoken_undefined, domain, range);
-  symtable_enterOp (g_symtab, nameNode_copySafe (minusNameNode), signature);
-}
-
-static void
-genVecOps (sort baseSort, sort vecSort, int dim)
-{
-  /* Generate __[__]: vecSort, int -> baseSort */
-
-  overloadBinary (nameNode_copySafe (arrayRefNameNode), vecSort, 
-		  ltoken_copy (intToken), baseSort);
-
-  /*          sizeof: vecSort -> int */
-  /* Generate isSub: vecSort, int, ... -> bool */
-
-  overloadIsSub (vecSort, dim);
-}
-
-static void
-overloadIsSub (sort s, int dim)
-{
-  /* Generate isSub: s, int, ... -> bool */
-  int j, i;
-  ltoken dom, nulltok = ltoken_undefined;
-  ltokenList domain;
-  sigNode signature;
-
-  for (j = 1; j <= dim; j++)
-    {
-      nameNode isSubNameNode = (nameNode) dmalloc (sizeof (*isSubNameNode));
-
-      isSubNameNode->isOpId = TRUE;
-      isSubNameNode->content.opid = ltoken_createType (simpleId, SID_OP, 
-							 lsymbol_fromChars ("isSub"));
-      dom = ltoken_createType (simpleId, SID_SORT, sort_getLsymbol (s));
-
-      domain = ltokenList_singleton (dom);
-
-      for (i = 1; i <= j; i++)
-	{
-	  ltokenList_addh (domain, ltoken_copy (intToken));
-	}
-
-      signature = makesigNode (nulltok, domain, ltoken_copy (ltoken_bool));
-      symtable_enterOp (g_symtab, isSubNameNode, signature);
-    }
-}
-
-static void
-overloadUnaryTok (/*@only@*/ nameNode nn, sort domainSort, /*@only@*/ ltoken range)
-{
-  /* Generate : domainSort -> rangeTok */
-  sigNode signature;
-  ltoken dom;
-  ltokenList domain;
-
-  dom = ltoken_createType (simpleId, SID_SORT, sort_getLsymbol (domainSort));
-  domain = ltokenList_singleton (dom);
-  signature = makesigNode (ltoken_undefined, domain, range);
-  symtable_enterOp (g_symtab, nn, signature);
-}
-
-static void
-overloadSizeof (sort domainSort)
-{
-  nameNode sizeofNameNode = (nameNode) dmalloc (sizeof (*sizeofNameNode));
-  
-  sizeofNameNode->isOpId = TRUE;
-  sizeofNameNode->content.opid = ltoken_createType (simpleId, SID_OP, 
-						      lsymbol_fromChars ("sizeof"));
-  
-  overloadUnaryTok (sizeofNameNode, domainSort, ltoken_copy (intToken));
-}
-
-static void
-overloadUnary (/*@only@*/ nameNode nn, sort domainSort, sort rangeSort)
-{
-  ltoken range = ltoken_createType (simpleId, SID_SORT, sort_getLsymbol (rangeSort));
-
-  overloadUnaryTok (nn, domainSort, range);
-}
-
-static void
-overloadBinary (/*@only@*/ nameNode nn, sort s, /*@only@*/ ltoken dTok, sort rs)
-{
-  /* Generate : s, dTok -> rs */
-  sigNode signature;
-  ltoken range, dom;
-  ltokenList domain = ltokenList_new ();
-
-  range = ltoken_createType (simpleId, SID_SORT, sort_getLsymbol (rs));
-  dom = ltoken_createType (simpleId, SID_SORT, sort_getLsymbol (s));
-  
-  ltokenList_addh (domain, dom);
-  ltokenList_addh (domain, dTok);
-  
-  signature = makesigNode (ltoken_undefined, domain, range);
-      symtable_enterOp (g_symtab, nn, signature);
-}
-
-static /*@only@*/ nameNode
-makeFieldOp (lsymbol field)
-{
- /* operator: __. */
-  nameNode nn;
-  opFormUnion u;
-  opFormNode opform;
-
-  u.id = ltoken_createType (simpleId, SID_OP, field);
-  opform = makeOpFormNode (ltoken_undefined, OPF_MSELECT, u, ltoken_undefined);
-  nn = makeNameNodeForm (opform);
-  return nn;
-}
-
-static /*@only@*/ nameNode
-makeArrowFieldOp (lsymbol field)
-{
- /* operator: __-> */
-  nameNode nn;
-  opFormUnion u;
-  opFormNode opform;
-
-  u.id = ltoken_createType (simpleId, SID_OP, field);
-  opform = makeOpFormNode (ltoken_undefined, OPF_MMAP, u, ltoken_undefined);
-  nn = makeNameNodeForm (opform);
-  return nn;
-}
-
-void
-sort_init (void) 
-   /*@globals undef noSort,
-              undef arrayRefNameNode,
-              undef ptr2arrayNameNode,
-              undef deRefNameNode,
-              undef nilNameNode,
-              undef plusNameNode,
-              undef minusNameNode,
-              undef condNameNode,
-              undef eqNameNode,
-              undef neqNameNode,
-              undef intToken; @*/
-{
-  /* on alpha, declaration does not allocate storage */
-  opFormNode opform;
-  opFormUnion u;
-  underscoreSymbol = lsymbol_fromChars ("_");
-
-  /*
-  ** commonly used data for generating operators 
-  */
-  
-  lsymbol_setbool (lsymbol_fromChars ("bool"));
-  intToken = ltoken_createType (simpleId, SID_SORT, lsymbol_fromChars ("int"));
-  
-  /*
-  ** __ \eq __: sort, sort -> bool 
-  */
-
-  u.anyop = ltoken_copy (ltoken_eq);
-  opform = makeOpFormNode (ltoken_undefined, OPF_MANYOPM, u, ltoken_undefined);
-  eqNameNode = makeNameNodeForm (opform);
-  
-  /*
-  ** __ \neq __: sort, sort -> bool 
-  */
-
-  u.anyop = ltoken_copy (ltoken_neq);
-  opform = makeOpFormNode (ltoken_undefined, OPF_MANYOPM, u, ltoken_undefined);
-  neqNameNode = makeNameNodeForm (opform);
-  
-  /*
-  **if __ then __ else __: bool, sort, sort -> sort 
-  */
-
-  opform = makeOpFormNode (ltoken_undefined, OPF_IF, 
-			   opFormUnion_createMiddle (0), ltoken_undefined);
-  condNameNode = makeNameNodeForm (opform);
-  
-  /* operator: __[__]: arraySort, int -> elementSort_Obj */
-  u.middle = 1;
-  opform = makeOpFormNode (ltoken_copy (ltoken_lbracked), OPF_BMMIDDLE, u,
-			   ltoken_copy (ltoken_rbracket));
-  arrayRefNameNode = makeNameNodeForm (opform);
-  
-  /* operator: __[]: ptrSort -> arraySort */
-  u.middle = 0;
-  opform = makeOpFormNode (ltoken_copy (ltoken_lbracked), 
-			   OPF_BMMIDDLE, u,
-			   ltoken_copy (ltoken_rbracket));
-  ptr2arrayNameNode = makeNameNodeForm (opform);
-  
-  /* operator: *__ */
-  u.anyop = ltoken_create (LLT_MULOP, lsymbol_fromChars ("*"));
-  opform = makeOpFormNode (ltoken_undefined, OPF_ANYOPM, u, ltoken_undefined);
-  deRefNameNode = makeNameNodeForm (opform);
-  
-  /* operator: __ + __ */
-  u.anyop = ltoken_create (simpleOp, lsymbol_fromChars ("+"));
-  opform = makeOpFormNode (ltoken_undefined, OPF_MANYOPM, u, ltoken_undefined);
-  plusNameNode = makeNameNodeForm (opform);
-  
-  /* operator: __ - __ */
-  u.anyop = ltoken_create (simpleOp, lsymbol_fromChars ("-"));
-  opform = makeOpFormNode (ltoken_undefined, OPF_MANYOPM, u, ltoken_undefined);
-  minusNameNode = makeNameNodeForm (opform);
-  
-  /* operator: NIL */
-  nilNameNode = (nameNode) dmalloc (sizeof (*nilNameNode));
-  nilNameNode->isOpId = TRUE;
-  nilNameNode->content.opid = ltoken_createType (simpleId, SID_OP, 
-						 lsymbol_fromChars ("NIL"));
-
-  noSort.kind = SRT_NONE;
-  noSort.name = lsymbol_fromChars ("_unknown");;
-  noSort.tag = lsymbol_undefined;
-  noSort.baseSort = NOSORTHANDLE;
-  noSort.objSort = NOSORTHANDLE;
-  noSort.members = smemberInfo_undefined;
-  noSort.export = FALSE;
-  noSort.mutable = FALSE;
-  noSort.abstract = FALSE;
-  noSort.imported = FALSE;
-  noSort.handle = NOSORTHANDLE;
-  
-  /*
-  ** Store the null sort into table, and in the process initialize the sort table. 
-  ** Must be the first sort_enter so NOSORTHANDLE is truly = 0. Similarly, 
-  ** for HOFSORTHANDLE = 1.
-  */
-  
-  noSort.handle = sort_enterGlobal (noSort);
-  (void) sort_enterGlobal (HOFSort); 
-  
-  /* Other builtin sorts */
-  
-  sort_bool = sort_makeImmutable (ltoken_undefined, lsymbol_fromChars ("bool"));
-  sort_capBool = sort_makeSortNoOps (ltoken_undefined, lsymbol_fromChars ("Bool"));
-  
-  llassert (sortTable != NULL);
-
-  /* make sort_Bool a synonym for sort_bool */
-  sortTable[sort_capBool].kind = SRT_SYN;
-  sortTable[sort_capBool].baseSort = sort_bool;
-  sortTable[sort_capBool].mutable = FALSE;
-  sortTable[sort_capBool].abstract = TRUE;
-  
-  sort_int = sort_makeLiteralSort (ltoken_undefined, 
-				   lsymbol_fromChars ("int"));
-  sort_char = sort_makeLiteralSort (ltoken_undefined,
-				    lsymbol_fromChars ("char"));
-  sort_void = sort_makeLiteralSort (ltoken_undefined,
-				    lsymbol_fromChars ("void"));
-  
-  /* sort_cstring is char__Vec, for C strings eg: "xyz" */
-  char_obj_ptrSort = sort_makePtr (ltoken_undefined, sort_char);
-  char_obj_ArrSort = sort_makeArr (ltoken_undefined, sort_char);
-  
-  sort_cstring = sort_makeVal (char_obj_ArrSort);
-  sort_float = sort_makeLiteralSort (ltoken_undefined, lsymbol_fromChars ("float"));
-  sort_double = sort_makeLiteralSort (ltoken_undefined, lsymbol_fromChars ("double"));
-}
-
-sort
-sort_lookupName (lsymbol name)
-{
-  long int i;
-
-  if (name == lsymbol_undefined)
-    {
-      return NOSORTHANDLE;
-    }
-
-  llassert (sortTable != NULL);
-
-  for (i = 0; i < sortTableSize; i++)
-    {
-      if (sortTable[i].name == name)
-	{
-	  return i;
-	}
-    }
-
-  return NOSORTHANDLE;
-}
-
-static bool
-sort_isNewEntry (sortNode s)
-{
-  int i;
-  
-  for (i = 0; i < sortTableSize; i++)
-    {
-      llassert (sortTable != NULL);
-
-      if (sortTable[i].kind == s.kind && sortTable[i].name == s.name)
-	{
-	  return FALSE;
-	}
-    }
-  return TRUE;
-}
-
-static sort
-sort_enterGlobal (sortNode s)
-{
-  /*@i@*/ return (sort_enterNew (s));
-}
-
-static sort
-sort_enterNew (sortNode s)
-{
-  /* This ensures that the argument sortNode is not entered into
-     the sort table more than once.  isNew flag will tell the
-     caller this info, and the caller will decide whether to generate
-     operators for this sort. */
-  long int i;
-  
-  for (i = 0; i < sortTableSize; i++)
-    {
-      llassert (sortTable != NULL);
-
-      if (sortTable[i].kind == s.kind && sortTable[i].name == s.name)
-	{
-	  sortNode_free (s);
-	  return i;
-	}
-    }
-
-  if (sortTableSize >= sortTableAlloc)
-    {
-      sortNode *oldSortTable = sortTable;
-
-      sortTableAlloc += DELTA;
-      sortTable = (sortNode *) dmalloc (sortTableAlloc * sizeof (*sortTable));
-
-      if (sortTableSize > 0)
-	{
-	  llassert (oldSortTable != NULL);      
-	  for (i = 0; i < sortTableSize; i++)
-	    {
-	      sortTable[i] = oldSortTable[i];
-	    }
-	}
-
-      sfree (oldSortTable);
-    }
-
-  llassert (sortTable != NULL);
-
-  s.handle = sortTableSize;
-  sortTable[sortTableSize++] = s;
-
-  /*@-compdef@*/ 
-  
-  return s.handle;
-} /*=compdef@*/
-
-static sort sort_enterNewForce (sortNode s)
-{
-  sort sor = sort_enterNew (s); 
-
-  s.handle = sor;
-  llassert (sortTable != NULL);
-  sortTable[sor] = s;
-  
-  /*@-globstate@*/ return (sor); /*@=globstate@*/
-}
-
-void
-sort_printStats (void)
-{
-  /* only for debugging */
-  printf ("sortTableSize = %d; sortTableAlloc = %d\n", sortTableSize,
-	  sortTableAlloc);
-}
-
-sortNode
-sort_lookup (sort sor)
-{
-  /* ymtan: can sor be 0 ? */
-  /* evs --- yup...0 should return noSort ? */
-  
-  if (sor > 0U && sor < (unsigned) sortTableSize)
-    {
-      llassert (sortTable != NULL);
-      return sortTable[sor];
-    }
-
-  llassert (sor == 0);
-  return noSort;
-}
-
-sortNode
-sort_quietLookup (sort sor)
-{
-  /* ymtan: can sor be 0 ? */
-  if (sor > 0U && sor < (unsigned) sortTableSize)
-    {
-      llassert (sortTable != NULL);
-      return (sortTable[sor]);
-    }
-  else
-    {
-      return noSort;
-    }
-}
-
-static cstring
-printEnumMembers (/*@null@*/ smemberInfo *list)
-{
-  cstring out = cstring_undefined;
-  smemberInfo *m;
-
-  for (m = list; m != (smemberInfo *) 0; m = m->next)
-    {
-      out = cstring_concat (out, lsymbol_toString (m->name));
-
-      if (m->next != (smemberInfo *) 0)
-	{
-	  out = cstring_concatChars (out, ", ");
-	}
-    }
-  return out;
-}
-
-static /*@only@*/ cstring
-printStructMembers (/*@null@*/ smemberInfo *list)
-{
-  cstring ret = cstring_undefined;
-  smemberInfo *m;
-
-  for (m = list; m != (smemberInfo *) 0; m = m->next)
-    {
-      ret = message ("%q%q %s; ",
-		     ret, sort_unparse (m->sort), 
-		     cstring_fromChars (lsymbol_toChars (m->name)));
-    }
-
-  return ret;
-}
-
-/*@only@*/ cstring
-sort_unparse (sort s)
-{
- /* printing routine for sorts */
-  sortNode sn;
-  lsymbol name;
-
-  sn = sort_quietLookup (s);
-  name = sn.name;
-
-  switch (sn.kind)
-    {
-    case SRT_NONE:
-      if (name == lsymbol_undefined)
-	{
-	  return cstring_makeLiteral ("_unknown");
-	}
-
-      return (cstring_fromCharsNew (lsymbol_toChars (name)));
-    case SRT_HOF:
-      return cstring_makeLiteral ("procedural");
-    case SRT_PRIM:
-      return (cstring_fromCharsNew (lsymbol_toChars (name)));
-    case SRT_SYN:
-      return (cstring_fromCharsNew (lsymbol_toChars (name)));
-
-    case SRT_PTR:
-      return (message ("%q *", sort_unparse (sort_makeVal (sn.baseSort))));
-    case SRT_OBJ:
-      return (message ("obj %q", sort_unparse (sn.baseSort)));
-    case SRT_ARRAY:
-      return (message ("array of %q", sort_unparse (sort_makeVal (sn.baseSort))));
-    case SRT_VECTOR:
-      return (message ("vector of %q", sort_unparse (sn.baseSort)));
-    case SRT_TUPLE:
-      if (sn.tag != lsymbol_undefined && sn.realtag)
-	{
-	  return (message ("struct %s", cstring_fromChars (lsymbol_toChars (sn.tag))));
-	}
-      else
-	{
-	  return (message ("struct {%q}", printStructMembers (sn.members)));
-	}
-    case SRT_UNIONVAL:
-      if (sn.tag != lsymbol_undefined && sn.realtag)
-	{
-	  return (message ("union %s", cstring_fromChars (lsymbol_toChars (sn.tag))));
-	}
-      else
-	{
-	  return (message ("union {%q}", printStructMembers (sn.members)));
-	}
-    case SRT_ENUM:
-      if (sn.tag != lsymbol_undefined && sn.realtag)
-	{
-	  return (message ("enum %s", cstring_fromChars (lsymbol_toChars (sn.tag))));
-	}
-      else
-	{
-	  return (message ("enum {%q}", printEnumMembers (sn.members)));
-	}
-    case SRT_STRUCT:
-      if (sn.tag != lsymbol_undefined && sn.realtag)
-	{
-	  return (message ("obj struct %s", cstring_fromChars (lsymbol_toChars (sn.tag))));
-	}
-      else
-	{
-	  return (message ("obj struct {%q}", printStructMembers (sn.members)));
-	}
-    case SRT_UNION:
-      if (sn.tag != lsymbol_undefined && sn.realtag)
-	{
-	  return (message ("obj union %s", cstring_fromChars (lsymbol_toChars (sn.tag))));
-	}
-      else
-	{
-	  return (message ("obj union {%q}", printStructMembers (sn.members)));
-	}
-    default:
-      return (cstring_makeLiteral ("illegal"));
-    }
-}
-
-static lsymbol
-sp (lsymbol s1, lsymbol s2)
-{
-  char buff[MAXBUFFLEN];
-  char *name1Ptr;
-  char *name2Ptr;
-  int temp_length;
-
-  name1Ptr = lsymbol_toCharsSafe (s1);
-  name2Ptr = lsymbol_toCharsSafe (s2);
-
-  if (strlen (name1Ptr) + strlen (name2Ptr) + 1 > MAXBUFFLEN)
-    {
-      temp_length = strlen (name1Ptr) + strlen (name2Ptr) + 1;
-      llfatalbug (message ("sp: name too long: %s%s", 
-			   cstring_fromChars (name1Ptr), 
-			   cstring_fromChars (name2Ptr)));
-    }
-
-  strcpy (&buff[0], name1Ptr);
-  strcat (&buff[0], name2Ptr);
-
-  return lsymbol_fromChars (&buff[0]);
-}
-
-static lsymbol
-sortTag_toSymbol (char *kind, ltoken tagid, /*@out@*/ bool *isNew)
-{
-  /* 
-  ** kind could be struct, union or enum.  Create a unique sort
-  ** name based on the given info. But first check that tagid
-  ** has not been defined already. (ok if it is a forward decl) 
-  **/
-
-  tagInfo to;
-
-  if (ltoken_isUndefined (tagid))
-    {
-      *isNew = TRUE;
-      return (cstring_toSymbol (message ("_anon_%s%d", cstring_fromChars (kind), sortUID++)));
-    }
-  else
-    {
-      to = symtable_tagInfo (g_symtab, ltoken_getText (tagid));
-
-      if (tagInfo_exists (to))
-	{
-	  *isNew = FALSE;
-	}
-      else
-	{
-	  *isNew = TRUE;
-	}
-
-      return (cstring_toSymbol (message ("_%s_%s", 
-					 ltoken_unparse (tagid), 
-					 cstring_fromChars (kind))));
-    }
-}
-
-/*@constant int MAX_SORT_DEPTH@*/
-# define MAX_SORT_DEPTH 10
-
-static sort
-sort_getUnderlyingAux (sort s, int depth)
-{
-  sortNode sn = sort_quietLookup (s);
-  
-  if (sn.kind == SRT_SYN)
-    {
-      if (depth > MAX_SORT_DEPTH)
-	{
-	  llcontbug (message ("sort_getUnderlying: depth charge: %d", depth));
-	  return s;
-	}
-      
-      return sort_getUnderlyingAux (sn.baseSort, depth + 1);
-    }
-  
-  return s;
-}
-
-sort
-sort_getUnderlying (sort s)
-{
-  return sort_getUnderlyingAux (s, 0);
-}
-
-static lsymbol
-underlyingSortName (sortNode sn)
-{
-  if (sn.kind == SRT_SYN)
-    return underlyingSortName (sort_quietLookup (sn.baseSort));
-  return sn.name;
-}
-
-static /*@observer@*/ sortNode
-underlyingSortNode (sortNode sn)
-{
-  if (sn.kind == SRT_SYN)
-    {
-      return underlyingSortNode (sort_quietLookup (sn.baseSort));
-    }
-
-  return sn;
-}
-
-bool
-sort_mutable (sort s)
-{
- /* if s is not a valid sort, then returns false */
-  sortNode sn = sort_quietLookup (s);
-  if (sn.mutable)
-    return TRUE;
-  return FALSE;
-}
-
-bool
-sort_setExporting (bool flag)
-{
-  bool old;
-  old = exporting;
-  exporting = flag;
-  return old;
-}
-
-/*@observer@*/ static cstring 
-sort_unparseKind (sortKind k)
-{
-  if (k > SRT_FIRST && k < SRT_LAST)
-    return (cstring_fromChars (sortKindName[(int)k]));
-  else
-    return (cstring_makeLiteralTemp (""));
-}
-
-bool
-sort_isValidSort (sort s)
-{
-  sortNode sn = sort_quietLookup (s);
-  sortKind k = sn.kind;
-  if (k != SRT_NONE && k > SRT_FIRST && k < SRT_LAST)
-    return TRUE;
-  else
-    return FALSE;
-}
-
-void
-sort_dump (FILE *f, bool lco)
-{
-  int i;
-  sortNode s;
-  smemberInfo *mem;
-
-  fprintf (f, "%s\n", BEGINSORTTABLE);
-  llassert (sortTable != NULL);
-
-  for (i = 2; i < sortTableSize; i++)
-    {
-      /* skips 0 and 1, noSort and HOFSort */
-      s = sortTable[i];
-      
-      /* if (lco && !s.export) continue; */
-      /* Difficult to keep track of where each op and sort belong to
-	 which LCL type.  Easiest to export them all (even private sorts and
-	 op's) but for checking imported modules, we only use LCL types and
-	 variables to check, i.e., we don't rely on sorts and op's for such
-	 checking. */
-      
-      if (s.kind == SRT_NONE)
-	continue;
-      
-      if (lco)
-	{
-	  fprintf (f, "%%LCL");
-	}
-
-      if (lsymbol_isDefined (s.name))
-	{
-	  fprintf (f, "sort %s ", lsymbol_toCharsSafe (s.name));
-	}
-      else
-	{
-	  llcontbug (message ("Invalid sort in sort_dump: sort %d; sortname: %s.  This may result from using .lcs files produced by an old version of LCLint.  Remove the .lcs files, and rerun LCLint.",
-			      i, lsymbol_toString (s.name)));
-	  fprintf (f, "sort _error_ ");
-	}
-      
-      if (!lco && !s.export)
-	fprintf (f, "private ");
-
-      /*@-loopswitchbreak@*/
-      switch (s.kind)
-	{
-	case SRT_HOF:
-	  fprintf (f, "hof nil nil\n");
-	  break;
-	case SRT_PRIM:
-	  if (s.abstract)
-	    fprintf (f, "immutable nil nil\n");
-	  else
-	    fprintf (f, "primitive nil nil\n");
-	  break;
-	case SRT_OBJ:
-	  if (s.abstract)
-	    fprintf (f, "mutable %s nil\n",
-		     lsymbol_toCharsSafe (sortTable[s.baseSort].name));
-	  else
-	    fprintf (f, "obj %s nil\n",
-		     lsymbol_toCharsSafe (sortTable[s.baseSort].name));
-	  break;
-	case SRT_SYN:
-	  fprintf (f, "synonym %s nil\n",
-		   lsymbol_toCharsSafe (sortTable[s.baseSort].name));
-	  break;
-	case SRT_PTR:
-	  fprintf (f, "ptr %s nil\n", lsymbol_toCharsSafe (sortTable[s.baseSort].name));
-	  break;
-	case SRT_ARRAY:
-	  fprintf (f, "arr %s nil\n",
-		   lsymbol_toCharsSafe (sortTable[s.baseSort].name));
-	  break;
-	case SRT_VECTOR:
-	  fprintf (f, "vec %s %s\n",
-		   lsymbol_toCharsSafe (sortTable[s.baseSort].name),
-		   lsymbol_toCharsSafe (sortTable[s.objSort].name));
-	  break;
-	case SRT_STRUCT:
-	  if (s.tag == lsymbol_undefined)
-	    {
-	      /* we need to make up a tag to prevent excessive
-		 growth of .lcs files when tags are overloaded
-		 */
-	      llbuglit ("Struct has no tag");
-	    }
-	  else
-	    fprintf (f, "str %s nil\n", lsymbol_toCharsSafe (s.tag));
-
-	  for (mem = s.members;
-	       mem != smemberInfo_undefined; mem = mem->next)
-	    {
-	      if (lco)
-		fprintf (f, "%%LCL");
-	      fprintf (f, "sort %s strMem %s nil\n", lsymbol_toCharsSafe (mem->name),
-		       lsymbol_toCharsSafe (sortTable[mem->sort].name));
-	    }
-	  if (lco)
-	    fprintf (f, "%%LCL");
-	  fprintf (f, "sort strEnd nil nil nil\n");
-	  break;
-	case SRT_UNION:
-	  if (s.tag == lsymbol_undefined)
-	    llbuglit ("Union has no tag");
-	  else
-	    fprintf (f, "union %s nil\n", lsymbol_toCharsSafe (s.tag));
-	  for (mem = s.members;
-	       mem != smemberInfo_undefined; mem = mem->next)
-	    {
-	      if (lco)
-		fprintf (f, "%%LCL");
-	      fprintf (f, "sort %s unionMem %s nil\n", lsymbol_toCharsSafe (mem->name),
-		       lsymbol_toCharsSafe (sortTable[mem->sort].name));
-	    }
-	  if (lco)
-	    fprintf (f, "%%LCL");
-	  fprintf (f, "sort unionEnd nil nil nil\n");
-	  break;
-	case SRT_ENUM:
-	  if (s.tag == lsymbol_undefined)
-	    {
-	      llbuglit ("Enum has no tag");
-	    }
-
-	  fprintf (f, "enum %s nil\n", lsymbol_toCharsSafe (s.tag));
-
-	  for (mem = s.members;
-	       mem != smemberInfo_undefined; mem = mem->next)
-	    {
-	      if (lco)
-		fprintf (f, "%%LCL");
-	      fprintf (f, "sort %s enumMem nil nil\n", lsymbol_toCharsSafe (mem->name));
-	    }
-	  if (lco)
-	    fprintf (f, "%%LCL");
-	  fprintf (f, "sort enumEnd nil nil nil\n");
-	  break;
-	case SRT_TUPLE:
-	  fprintf (f, "tup %s nil\n", lsymbol_toCharsSafe (sortTable[s.baseSort].name));
-	  break;
-	case SRT_UNIONVAL:
-	  fprintf (f, "unionval %s nil\n",
-		   lsymbol_toCharsSafe (sortTable[s.baseSort].name));
-	  break;
-	default:
-	  fprintf (f, "sort_dump: unexpected sort: %d", (int)s.kind);
-	}			/* switch */
-      /*@=loopswitchbreak@*/
-    }
-
-  fprintf (f, "%s\n", SORTTABLEEND);
-}
-
-static void
-sort_loadOther (char *kstr, lsymbol sname, sort bsort)
-{
-  if (strcmp (kstr, "synonym") == 0)
-    {
-      (void) sort_construct (sname, SRT_SYN, bsort, lsymbol_undefined,
-			     FALSE, NOSORTHANDLE, smemberInfo_undefined);
-    }
-  else if (strcmp (kstr, "mutable") == 0)
-    {
-      (void) sort_constructAbstract (sname, TRUE, bsort);
-    }
-  else if (strcmp (kstr, "obj") == 0)
-    {
-      (void) sort_construct (sname, SRT_OBJ, bsort, lsymbol_undefined,
-			     TRUE, NOSORTHANDLE, smemberInfo_undefined);
-    }
-  else if (strcmp (kstr, "ptr") == 0)
-    {
-      (void) sort_construct (sname, SRT_PTR, bsort, lsymbol_undefined,
-			     FALSE, NOSORTHANDLE, smemberInfo_undefined);
-    }
-  else if (strcmp (kstr, "arr") == 0)
-    {
-      (void) sort_construct (sname, SRT_ARRAY, bsort, lsymbol_undefined,
-			     TRUE, NOSORTHANDLE, smemberInfo_undefined);
-    }
-  else if (strcmp (kstr, "tup") == 0)
-    {
-      (void) sort_construct (sname, SRT_TUPLE, bsort, lsymbol_undefined,
-			     FALSE, NOSORTHANDLE, smemberInfo_undefined);
-    }
-  else if (strcmp (kstr, "unionval") == 0)
-    {
-      (void) sort_construct (sname, SRT_UNIONVAL, bsort, lsymbol_undefined,
-			     FALSE, NOSORTHANDLE, smemberInfo_undefined);
-    }
-  else
-    {
-      llbug (message ("Unhandled: %s", cstring_fromChars (kstr)));
-    }
-}
-
-static void
-parseSortLine (char *line, ltoken t, tsource * s,
-	       mapping *map, lsymbolList slist)
-{
-  /* caller expects that map and slist are updated */
-  /* t and importfle are only used for error messages */
-  static lsymbol strName = lsymbol_undefined;
-  static smemberInfo *strMemList = NULL;
-  static lsymbol unionName = lsymbol_undefined;
-  static smemberInfo *unionMemList = NULL;
-  static lsymbol enumName = lsymbol_undefined;
-  static smemberInfo *enumMemList = NULL;
-  static lsymbol tagName = lsymbol_undefined;
-  
-  char *importfile = tsource_fileName (s);
-  char sostr[MAXBUFFLEN], kstr[10], basedstr[MAXBUFFLEN], objstr[MAXBUFFLEN];
-  bool tmp;
-  tagInfo ti;
-  lsymbol sname, bname, new_name, objName;
-  sort objSort;
-  char *lineptr;
-  int col;			/* for keeping column number */
-  ltoken tagid;
-  
-  if (sscanf (line, "sort %s %s %s %s", &(sostr[0]), &(kstr[0]),
-	      &(basedstr[0]), &(objstr[0])) != 4)
-    {		
-      /* if this fails, can have weird errors */
-      /* strEnd, unionEnd, enumEnd won't return 4 args */
-      lclplainerror 
-	(message ("%q: Imported file contains illegal sort declaration.   "
-		  "Skipping this line: \n%s\n",
-		  fileloc_unparseRaw (cstring_fromChars (importfile), 
-				      tsource_thisLineNumber (s)), 
-		  cstring_fromChars (line)));
-      return;
-    }
-  
-  sname = lsymbol_fromChars (sostr);
-  if (sname == lsymbol_fromChars ("nil"))
-    {
-      /* No given sort name.  Use lsymbol_undefined and generate sort name
-	 in sort building routines. */
-      sname = lsymbol_undefined;
-      lclerror (t, message ("Illegal sort declaration in import file: %s:\n%s",
-			    cstring_fromChars (importfile), 
-			    cstring_fromChars (line)));
-    }
-  
-  /* Assume that when we encounter a sort S1 that is based on sort
-     S2, S2 is before S1 in the imported file.  sort table is a
-     linear list and we create base sorts before other sorts. */
-  
-  bname = lsymbol_fromChars (basedstr);
-  if (strcmp (kstr, "primitive") == 0)
-    {
-      new_name = lsymbol_translateSort (map, sname);
-      (void) sort_construct (new_name, SRT_PRIM, NOSORTHANDLE,
-			     lsymbol_undefined, FALSE,
-			     NOSORTHANDLE, smemberInfo_undefined);
-    }
-  else if (strcmp (kstr, "strMem") == 0)
-    {
-      smemberInfo *mem = (smemberInfo *) dmalloc (sizeof (*mem));
-      mem->next = strMemList;
-      mem->name = sname;
-      mem->sortname = bname;
-      mem->sort = NOSORTHANDLE;
-      strMemList = mem;
-    }
-  else if (strcmp (sostr, "strEnd") == 0)
-    {				/* now process it */
-      if (strName != lsymbol_undefined && strMemList != NULL)
-	{
-	  sort asort = sort_construct (strName, SRT_STRUCT, NOSORTHANDLE, tagName,
-				  TRUE, NOSORTHANDLE, strMemList);
-	  
-	  if (tagName != lsymbol_undefined)
-	    {
-	      tagid = ltoken_create (simpleId, tagName);
-
-	      ti = (tagInfo) dmalloc (sizeof (*ti));
-	      ti->sort = asort;
-	      ti->kind = TAG_STRUCT;
-	      ti->id = tagid;
-	      ti->imported = FALSE;
-	      
-	      (void) symtable_enterTagForce (g_symtab, ti);
-	    }
-	}
-      else
-	{
-	  if (strName == lsymbol_undefined)
-	    {
-	      lclbug (message ("%q: Imported file contains unexpected null struct sort",
-			       fileloc_unparseRaw (cstring_fromChars (importfile), tsource_thisLineNumber (s))));
-	    }
-	  else
-	    {
-	      /*
-	       ** no members -> its a forward struct
-	       */
-	      
-	      if (tagName != lsymbol_undefined)
-		{
-		  tagid = ltoken_create (simpleId, tagName);
-		  (void) checkAndEnterTag (TAG_FWDSTRUCT, tagid);
-		}
-	    }
-	}
-      strName = lsymbol_undefined;
-      strMemList = NULL;
-      tagName = lsymbol_undefined;
-    }
-  else if (strcmp (kstr, "str") == 0)
-    {
-      if (strName != lsymbol_undefined || strMemList != NULL)
-	{
-	  lclbug (message ("%q: unexpected non-null struct sort or "
-			   "non-empty member list",
-			   fileloc_unparseRaw (cstring_fromChars (importfile), 
-					       tsource_thisLineNumber (s))));
-	}
-      /* see if a tag is associated with this sort */
-      if (strcmp (basedstr, "nil") == 0)
-	{
-	  llfatalerror (message ("%s: Struct missing tag.  Obsolete .lcs file, remove and rerun lcl.",
-				 cstring_fromChars (importfile)));
-	  /*
-	    strName = sortTag_toSymbol ("Struct", nulltok, &tmp);
-	    tagName = lsymbol_undefined;
-	    mapping_bind (map, sname, strName);
-	    */
-	}
-      else /* a tag exists */
-	{  /* create tag in symbol table and add tagged sort in sort table */
-	  tagName = bname;
-	  tagid = ltoken_create (simpleId, bname);
-
-	  strName = sortTag_toSymbol ("Struct", tagid, &tmp);
-	  ti = symtable_tagInfo (g_symtab, tagName);
-
-	  /*
-	  ** No error for redefining a tag in an import.
-	  */
-	}
-      /* to be processed later in sort_import */
-      lsymbolList_addh (slist, strName);
-    }
-  else if (strcmp (kstr, "enumMem") == 0)
-    {
-      smemberInfo *mem = (smemberInfo *) dmalloc (sizeof (*mem));
-      mem->next = enumMemList;
-      mem->sortname = enumName;
-      mem->name = sname;
-      mem->sort = NOSORTHANDLE;
-      enumMemList = mem;
-    }
-  else if (strcmp (sostr, "enumEnd") == 0)
-    {
-      if (enumName != lsymbol_undefined && enumMemList != NULL)
-	{
-	  sort asort = sort_construct (enumName, SRT_ENUM, NOSORTHANDLE, tagName,
-				       FALSE, NOSORTHANDLE, enumMemList);
-	  
-	  if (tagName != lsymbol_undefined)
-	    {
-	      tagid = ltoken_create (simpleId, tagName);
-
-	      ti = (tagInfo) dmalloc (sizeof (*ti));
-	      ti->sort = asort;
-	      ti->kind = TAG_ENUM;
-	      ti->id = tagid;
-	      ti->imported = FALSE;
-
-	      (void) symtable_enterTagForce (g_symtab, ti);
-	    }
-	}
-      else
-	{
-	  lclbug (message ("%q: unexpected null enum sort or empty member list",
-			   fileloc_unparseRaw (cstring_fromChars (importfile), tsource_thisLineNumber (s))));
-	}
-      enumName = lsymbol_undefined;
-      enumMemList = NULL;
-      tagName = lsymbol_undefined;
-    }
-  else if (strcmp (kstr, "enum") == 0)
-    {
-      if (enumName != lsymbol_undefined || enumMemList != NULL)
-	{
-	  lclbug (message ("%q: Unexpected non-null enum sort or "
-			   "non-empty member list",
-			   fileloc_unparseRaw (cstring_fromChars (importfile), 
-					       tsource_thisLineNumber (s))));
-	}
-
-      /* see if a tag is associated with this sort */
-      if (strcmp (basedstr, "nil") == 0)
-	{
-	  llfatalerror (message ("%s: Enum missing tag.  Obsolete .lcs file, "
-				 "remove and rerun lcl.",
-				 cstring_fromChars (importfile)));
-	}
-      else
-	{			/* a tag exists */
-	  tagName = bname;
-	  tagid = ltoken_create (simpleId, bname);
-	  enumName = sortTag_toSymbol ("Enum", tagid, &tmp);
-	  ti = symtable_tagInfo (g_symtab, bname);
-	}
-    }
-  else if (strcmp (kstr, "unionMem") == 0)
-    {
-      smemberInfo *mem = (smemberInfo *) dmalloc (sizeof (*mem));
-      mem->next = unionMemList;
-      mem->sortname = bname;
-      mem->name = sname;
-      mem->sort = NOSORTHANDLE;
-      unionMemList = mem;
-    }
-  else if (strcmp (sostr, "unionEnd") == 0)
-    {
-      if (unionName != lsymbol_undefined && unionMemList != NULL)
-	{
-	  sort asort = sort_construct (unionName, SRT_UNION, NOSORTHANDLE, tagName,
-				       FALSE, NOSORTHANDLE, unionMemList);
-
-	  if (tagName != lsymbol_undefined)
-	    {
-	      tagid = ltoken_create (simpleId, tagName);
-
-	      ti = (tagInfo) dmalloc (sizeof (*ti));
-	      ti->sort = asort;
-	      ti->kind = TAG_UNION;
-	      ti->id = tagid;
-	      ti->imported = FALSE;
-
-	      (void) symtable_enterTagForce (g_symtab, ti);
-	    }
-	}
-      else
-	{
-	  if (unionName == lsymbol_undefined)
-	    {
-	      lclbug
-		(message ("%q: Imported file contains unexpected null union sort",
-			  fileloc_unparseRaw (cstring_fromChars (importfile), tsource_thisLineNumber (s))));
-	    }
-	  else
-	    {
-	      /*
-	       ** no members -> its a forward struct
-	       */
-	      
-	      if (tagName != lsymbol_undefined)
-		{
-		  tagid = ltoken_create (simpleId, tagName);
-
-		  (void) checkAndEnterTag (TAG_FWDUNION, tagid);
-		}
-	    }
-	}
-
-      unionName = lsymbol_undefined;
-      unionMemList = NULL;
-      tagName = lsymbol_undefined;
-    }
-  else if (strcmp (kstr, "union") == 0)
-    {
-      if (unionName != lsymbol_undefined || unionMemList != NULL)
-	{
-	  lclbug
-	    (message 
-	     ("%q: Unexpected non-null union sort or non-empty "
-	      "member list",
-	      fileloc_unparseRaw (cstring_fromChars (importfile), tsource_thisLineNumber (s))));
-	}
-      /* see if a tag is associated with this sort */
-      if (strcmp (basedstr, "nil") == 0)
-	{
-	  llfatalerror
-	    (message ("%s: Union missing tag.  Obsolete .lcs file, "
-		      "remove and rerun lcl.",
-	      cstring_fromChars (importfile)));
-	}
-      else
-	{			/* a tag exists */
-	  tagName = bname;
-	  tagid = ltoken_create (simpleId, bname);
-
-	  unionName = sortTag_toSymbol ("Union", tagid, &tmp);
-	  ti = symtable_tagInfo (g_symtab, bname);
-	}
-      lsymbolList_addh (slist, unionName);
-    }
-  else if (strcmp (kstr, "immutable") == 0)
-    {
-      (void) sort_constructAbstract (sname, FALSE, NOSORTHANDLE);
-    }
-  else if (strcmp (kstr, "hof") == 0)
-    {
-      (void) sort_construct (sname, SRT_HOF, NOSORTHANDLE, lsymbol_undefined,
-			     FALSE, NOSORTHANDLE, smemberInfo_undefined);
-    }
-  else
-    {
-      sort bsort = sort_lookupName (lsymbol_translateSort (map, bname));
-
-      if (sort_isNoSort (bsort))
-	{
-	  lineptr = strchr (line, ' ');	/* go past "sort" */
-	  llassert (lineptr != NULL);
-	  lineptr = strchr (lineptr + 1, ' ');	/* go past sostr */
-	  llassert (lineptr != NULL);
-	  lineptr = strchr (lineptr + 1, ' ');	/* go past kstr */
-	  llassert (lineptr != NULL);
-	  col = 5 + lineptr - line;	/* 5 for initial "%LCL "*/
-
-	  llbug 
-	    (message ("%q: Imported file contains unknown base sort: %s",
-		      fileloc_unparseRawCol (cstring_fromChars (importfile), 
-					     tsource_thisLineNumber (s), col),
-		      cstring_fromChars (lsymbol_toCharsSafe (bname))));
-	}
-      
-      if (strcmp (kstr, "vec") == 0)
-	{			
-	  objName = lsymbol_fromChars (objstr);
-	  objSort = sort_lookupName (lsymbol_translateSort (map, objName));
-	  (void) sort_construct (sname, SRT_VECTOR, bsort, lsymbol_undefined,
-				 FALSE, objSort, smemberInfo_undefined);
-	}
-      else
-	{
-	  sort_loadOther (kstr, sname, bsort);
-	}
-    } 
-}
-
-void
-sort_import (tsource *imported, ltoken tok, mapping * map)
-{
-  /* tok is only used for error message line number */
-  char *buf, *importfile;
-  tsource *lclsource;
-  sort bsort;
-  lsymbolList slist = lsymbolList_new ();
-
-  buf = tsource_nextLine (imported);
-
-  llassert (buf != NULL);
-
-  importfile = tsource_fileName (imported);
-
-  if (!firstWord (buf, "%LCLSortTable"))
-    {
-      lclsource = LCLScanSource ();
-
-      lclfatalerror (tok, message ("Expecting \"%%LCLSortTable\" line "
-				   "in import file %s:\n%s",
-				   cstring_fromChars (importfile), 
-				   cstring_fromChars (buf)));
-      
-    }
-
-  for (;;)
-    {
-      buf = tsource_nextLine (imported);
-
-      llassert (buf != NULL);
-
-      if (firstWord (buf, "%LCLSortTableEnd"))
-	{
-	  break;
-	}
-      else
-	{ /* a good line, remove %LCL from line first */
-	  if (firstWord (buf, "%LCL"))
-	    {
-	      parseSortLine (buf + 4, tok, imported, map, slist);
-	    }
-	  else
-	    {
-	      lclsource = LCLScanSource ();
-	      lclfatalerror
-		(tok, 
-		 message ("Expecting '%%LCL' prefix in import file %s:\n%s\n",
-			  cstring_fromChars (importfile), 
-			  cstring_fromChars (buf)));
-	    }
-	}
-    }
-
-  /* now process the smemberInfo in the sort List */
-  lsymbolList_elements (slist, s)
-    {
-      if (s != lsymbol_undefined)
-	{
-	  sort sor;
-	  sortNode sn;
-
-	  sor = sort_lookupName (s);
-	  sn = sort_quietLookup (sor);
-	  
-	  switch (sn.kind)
-	    {
-	    case SRT_ENUM:
-	      {			/* update the symbol table with members of enum */
-		varInfo vi;
-		smemberInfo *mlist = sn.members;
-		for (; mlist != NULL; mlist = mlist->next)
-		  {
-		    /* check that enumeration constants are unique */
-		    vi = symtable_varInfo (g_symtab, mlist->name);
-		    if (!varInfo_exists (vi))
-		      {	/* put info into symbol table */
-			vi = (varInfo) dmalloc (sizeof (*vi));
-			vi->id = ltoken_create (NOTTOKEN, mlist->name);
-			vi->kind = VRK_ENUM;
-			vi->sort = sor;
-			vi->export = TRUE;
-
-			(void) symtable_enterVar (g_symtab, vi);
-			varInfo_free (vi);
-		      }
-		    else
-		      {
-			lclplainerror 
-			  (message ("%s: enum member %s of %s has already been declared",
-				    cstring_fromChars (importfile), 
-				    lsymbol_toString (mlist->name),
-				    lsymbol_toString (sn.name)));
-		      }
-		  }
-		/*@switchbreak@*/ break;
-	      }
-	    case SRT_STRUCT:
-	    case SRT_UNION:
-	      {
-		smemberInfo *mlist = sn.members;
-
-		for (; mlist != NULL; mlist = mlist->next)
-		  {
-		    bsort = sort_lookupName (lsymbol_translateSort (map, mlist->sortname));
-		    if (sort_isNoSort (bsort))
-		      {
-			lclbug (message ("%s: member %s of %s has unknown sort\n",
-					 cstring_fromChars (importfile), 
-					 cstring_fromChars (lsymbol_toChars (mlist->name)),
-					 cstring_fromChars (lsymbol_toChars (sn.name))));
-		      }
-		    else
-		      {
-			mlist->sort = bsort;
-		      }
-		  }
-		/*@switchbreak@*/ break;
-	      }
-	    default:
-	      lclbug (message ("%s: %s has unexpected sort kind %s",
-			       cstring_fromChars (importfile), 
-			       cstring_fromChars (lsymbol_toChars (sn.name)),
-			       sort_unparseKind (sn.kind)));
-	    }
-	}
-    } end_lsymbolList_elements;
-  
-  /* list and sorts in it are not used anymore */
-  lsymbolList_free (slist);
-}
-
-bool
-sort_equal (sort *s1, sort *s2)
-{
-  sort syn1, syn2;
-  if ((s1 != 0) && (s2 != 0))
-    {
-      if ((*s1) == (*s2))
-	return TRUE;
-     /* handle synonym sorts */
-      syn1 = sort_getUnderlying (*s1);
-      syn2 = sort_getUnderlying (*s2);
-      if (syn1 == syn2)
-	return TRUE;
-     /* makes bool and Bool equal */
-    }
-  return FALSE;
-}
-
-bool
-sort_compatible (sort s1, sort s2)
-{
-  sort syn1, syn2;
- /* later: might consider "char" and enum types the same as "int" */
-  if (s1 == s2)
-    return TRUE;
- /* handle synonym sorts */
-  syn1 = sort_getUnderlying (s1);
-  syn2 = sort_getUnderlying (s2);
-  if (syn1 == syn2)
-    return TRUE;
-  /* makes bool and Bool equal */
-  return FALSE;
-}
-
-bool
-sort_compatible_modulo_cstring (sort s1, sort s2)
-{
- /* like sort_compatible but also handles special cstring inits,
-    allows the following 2 cases:
-     char c[] = "abc"; (LHS: char_Obj_Arr, RHS = char_Vec)
-                       (c as implicitly coerced into c^)
-     char *d = "abc";  (LHS: char_Obj_Ptr, RHS = char_Vec)
-                       (d as implicitly coerced into d[]^)
-		       */
-  sort syn1, syn2;
-  if (sort_compatible (s1, s2))
-    return TRUE;
-  syn1 = sort_getUnderlying (s1);
-  syn2 = sort_getUnderlying (s2);
-  if (sort_cstring == syn2 &&
-      (syn1 == char_obj_ptrSort || syn1 == char_obj_ArrSort))
-    return TRUE;
-  return FALSE;
-}
-
-lsymbol
-sort_getLsymbol (sort sor)
-{
- /*  sortNode sn = sort_lookup (sor); */
-  sortNode sn = sort_quietLookup (sor);
-  return sn.name;
-}
-
-/* a few handy routines for debugging */
-
-char *sort_getName (sort s)
-{
-  return (lsymbol_toCharsSafe (sort_getLsymbol (s)));
-}
-
-/*@exposed@*/ cstring
-sort_unparseName (sort s)
-{
-    return (cstring_fromChars (sort_getName (s)));
-}
-
-static void
-sortError (ltoken t, sort oldsort, sortNode newnode)
-{
-  sortNode old = sort_quietLookup (oldsort);
-
-  if ((old.kind <= SRT_FIRST || old.kind >= SRT_LAST) ||
-      (newnode.kind <= SRT_FIRST || newnode.kind >= SRT_LAST))
-    {
-      llbuglit ("sortError: illegal sort kind");
-    }
-
-  llassert (sortTable != NULL);
-
-  lclerror (t, message ("Sort %s defined as %s cannot be redefined as %s",
-			cstring_fromChars (lsymbol_toChars (newnode.name)),
-			sort_unparseKindName (sortTable[oldsort]),
-			sort_unparseKindName (newnode)));
-}
-
-static /*@observer@*/ cstring
-  sort_unparseKindName (sortNode s)
-{
-  switch (s.kind)
-    {
-    case SRT_NONE:
-      return cstring_fromChars (sortKindName[(int)s.kind]);
-    default:
-      if (s.abstract)
-	{
-	  if (s.mutable)
-	    {
-	      return cstring_makeLiteralTemp ("MUTABLE");
-	    }
-	  else
-	    {
-	      return cstring_makeLiteralTemp ("IMMUTABLE");
-	    }
-	}
-      else
-	return cstring_fromChars (sortKindName[(int)s.kind]);
-    }
-  
-  BADEXIT;
-}
-
-sort
-sort_fromLsymbol (lsymbol sortid)
-{
- /* like sort_lookupName but creates sort if not already present */
-  sort sort = sort_lookupName (sortid);
-  if (sort == NOSORTHANDLE)
-    sort = sort_makeSort (ltoken_undefined, sortid);
-  return sort;
-}
-
-bool
-sort_isHOFSortKind (sort s)
-{
-  sortNode sn = sort_quietLookup (s);
-  if (sn.kind == SRT_HOF)
-    return TRUE;
-  return FALSE;
-}
-
-/*
-** returns TRUE iff s has State operators (', ~, ^)
-*/
-
-static bool
-sort_hasStateFcns (sort s)
-{
-  sortNode sn = sort_quietLookup (s);
-  sortKind kind = sn.kind;
-
-  if (kind == SRT_SYN)
-    {
-      return (sort_hasStateFcns (sn.baseSort));
-    }
-
-  return ((kind == SRT_PTR) ||
-	  (kind == SRT_OBJ) ||
-	  (kind == SRT_ARRAY) ||
-	  (kind == SRT_STRUCT) ||
-	  (kind == SRT_UNION));
-}
-
-
diff --git a/src/sortList.c b/src/sortList.c
deleted file mode 100644
index 89a24b2..0000000
--- a/src/sortList.c
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** sortList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ sortList
-sortList_new ()
-{
-  sortList s = (sortList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = sortListBASESIZE;
-  s->elements = (sort *) dmalloc (sizeof (*s->elements) * sortListBASESIZE);
-  s->current = 0;
-
-  return (s);
-}
-
-static void
-sortList_grow (sortList s)
-{
-  int i;
-  sort *newelements;
-
-  s->nspace += sortListBASESIZE;
-
-  newelements = (sort *) dmalloc (sizeof (*newelements) * (s->nelements + s->nspace));
-
-  if (newelements == (sort *) 0)
-    {
-      llfatalerror (cstring_makeLiteral ("sortList_grow: out of memory!"));
-    }
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-void 
-sortList_addh (sortList s, sort el)
-{
-  if (s->nspace <= 0)
-    sortList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-}
-
-void 
-sortList_reset (sortList s)
-{
-  s->current = 0;
-}
-
-void 
-sortList_advance (sortList s)
-{
-  s->current++;
-  llassert (s->current < s->nelements);
-}
-
-sort 
-sortList_current (sortList s)
-{
-  if (s->current < 0 || s->current >= s->nelements)
-    {
-      llbug (message ("sortList_current: current out of range: %d (size: %d)",
-		      s->current, s->nelements));
-    }
-  return (s->elements[s->current]);
-}
-
-/*@only@*/ cstring
-sortList_unparse (sortList s)
-{
-  int i;
-  cstring st = cstring_undefined;
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      if (i == 0)
-	{
-	  st = cstring_copy (sort_unparseName (s->elements[i])); /* !!! NEED COPY HERE !!! */
-	}
-      else
-	{
-	  st = message ("%q, %s", st, sort_unparseName (s->elements[i]));
-	}
-    }
-
-  return st;
-}
-
-void
-sortList_free (sortList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-      /*      sort_free (s->elements[i]); */
-    }
-  
-  sfree (s->elements);		/* not quite!!! */
-  sfree (s);
-}
diff --git a/src/sortSet.c b/src/sortSet.c
deleted file mode 100644
index 02f4f84..0000000
--- a/src/sortSet.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** sortSet.c
-**
-** based on set_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-sortSet sortSet_new ()
-{
-  sortSet s = (sortSet) dmalloc (sizeof (*s));
-  
-  s->entries = 0;
-  s->nspace = sortSetBASESIZE;
-  s->elements = (sort *) dmalloc (sizeof (*s->elements) * sortSetBASESIZE);
-  
-  return (s);
-}
-
-static /*@notnull@*/ sortSet
-sortSet_predict (int size)
-{
-  sortSet s = (sortSet) dmalloc (sizeof (*s));
-  
-  s->entries = 0;
-
-  if (size > 0)
-    {
-      s->nspace = size;
-      s->elements = (sort *) dmalloc (sizeof (*s->elements) * size);
-    }
-  else
-    {
-      s->nspace = 0;
-      s->elements = NULL;
-    }
-  
-  return (s);
-}
-
-static void
-sortSet_grow (/*@notnull@*/ sortSet s)
-{
-  int i;
-  sort *newelements; 
-
-  s->nspace = sortSetBASESIZE;
-  newelements = (sort *) dmalloc (sizeof (*newelements) * (s->entries + s->nspace));
-
-  if (newelements == (sort *) 0)
-    {
-      llfatalerror (cstring_makeLiteral ("sortSet_grow: out of memory!"));
-    }
-
-  for (i = 0; i < s->entries; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements); 
-  s->elements = newelements;
-}
-
-/*
-** Ensures: if *e \in *s
-**          then unchanged (*s) & result = false
-**          else *s' = insert (*s, *e) & result = true
-** Modifies: *s
-*/
-
-bool
-sortSet_insert (sortSet s, sort el)
-{
-  llassert (sortSet_isDefined (s));
-
-  if (sortSet_member (s, el))
-    {
-      return FALSE;
-    }
-  else
-    {
-      if (s->nspace <= 0)
-	sortSet_grow (s);
-      s->nspace--;
-      s->elements[s->entries] = el;
-      s->entries++;
-      return TRUE;
-    }
-}
-
-sort
-sortSet_choose (sortSet s)
-{
-  llassert (sortSet_isDefined (s) && s->entries > 0);
-  return (s->elements[0]);
-}
-
-bool
-sortSet_member (sortSet s, sort el)
-{
-  if (sortSet_isDefined (s))
-    {
-      int i;
-
-      for (i = 0; i < s->entries; i++)
-	{
-	  if (sort_equal (&el, &(s->elements[i])))
-	    {
-	      return TRUE;
-	    }
-	}
-    }
-
-  return FALSE;
-}
-
-/*@only@*/ cstring
-sortSet_unparse (sortSet s)
-{
-  return (message ("{ %q }", sortSet_unparseClean (s)));
-}
-
-/*@only@*/ cstring
-sortSet_unparseClean (sortSet s)
-{
-  cstring st = cstring_undefined;
-
-  if (sortSet_isDefined (s))
-    {
-      int i;
-
-      for (i = 0; i < s->entries; i++)
-	{
-	  if (i == 0)
-	    {
-	      st = message ("%q%s", st, sort_unparseName (s->elements[i]));
-	    }
-	  else
-	    {
-	      st = message ("%q, %s", st, sort_unparseName (s->elements[i]));
-	    }
-	}
-    }
-
-  return st;
-}
-
-/*@only@*/ cstring
-sortSet_unparseOr (sortSet s)
-{
-  cstring st = cstring_undefined;
-
-  if (sortSet_isDefined (s))
-    {
-      int i;
-      int last = s->entries - 1;
-      
-      for (i = 0; i < s->entries; i++)
-	{
-	  if (i == 0)
-	    {
-	      st = cstring_concatFree (st, sort_unparse (s->elements[i]));
-	    }
-	  else
-	    {
-	      if (i == last)
-		{
-		  /* was sort_unparse ??? */
-		  st = message ("%q or %q", st, sort_unparse (s->elements[i]));
-		}
-	      else
-		{
-		  st = message ("%q, %q", st, sort_unparse (s->elements[i]));
-		}
-	    }
-	}
-    }
-  
-  return st;
-}
-
-void
-sortSet_free (sortSet s)
-{
-  if (sortSet_isDefined (s))
-    {
-      sfree (s->elements); 
-      sfree (s);
-    }
-}
-
-/*@only@*/ sortSet
-sortSet_copy (sortSet s)
-{
-  sortSet t = sortSet_predict (sortSet_size (s));
-  int i;
-
-  if (sortSet_isDefined (s))
-    {
-      for (i = 0; i < sortSet_size (s); i++)
-	{
-	  (void) sortSet_insert (t, s->elements[i]); 
-	}
-    }
-
-  return t;
-}
-
-
-
diff --git a/src/sortSetList.c b/src/sortSetList.c
deleted file mode 100644
index 4b7bc63..0000000
--- a/src/sortSetList.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** sortSetList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ sortSetList
-sortSetList_new ()
-{
-  sortSetList s = (sortSetList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->free = sortSetListBASESIZE;
-  s->elements = (sortSet *) dmalloc (sizeof (*s->elements) * sortSetListBASESIZE);
-  s->current = 0;
-  
-  return (s);
-}
-
-static void
-sortSetList_grow (sortSetList s)
-{
-  int i;
-  sortSet *newelements;
-
-  s->free += sortSetListBASESIZE;
-  newelements = (sortSet *) dmalloc (sizeof (*newelements)
-				     * (s->nelements + s->free));
-  
-  if (newelements == (sortSet *) 0)
-    {
-      llfatalerror (cstring_makeLiteral ("sortSetList_grow: out of memory!"));
-    }
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-void 
-sortSetList_addh (sortSetList s, sortSet el)
-{
-  llassert (sortSetListBASESIZE > 0);
-
-  if (s->free <= 0)
-    sortSetList_grow (s);
-
-  s->free--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-}
-
-void 
-sortSetList_reset (sortSetList s)
-{
-  s->current = 0;
-}
-
-void 
-sortSetList_advance (sortSetList s)
-{
-  s->current++;
-}
-
-/*@observer@*/ sortSet 
-sortSetList_head (sortSetList s)
-{
-  llassert (s->nelements > 0);
-  return (s->elements[0]);
-}
-
-/*@observer@*/ sortSet 
-sortSetList_current (sortSetList s)
-{
-  if (s->current < 0 || s->current >= s->nelements)
-    {
-      llbug (message ("sortSetList_current: current out of range: %d (size: %d)",
-		      s->current, s->nelements));
-    }
-  return (s->elements[s->current]);
-}
-
-/*@only@*/ cstring
-sortSetList_unparse (sortSetList s)
-{
-  int i;
-  cstring st = cstring_makeLiteral ("[ ");
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      if (i != 0)
-	st = message ("%q, %q", st, sortSet_unparse (s->elements[i]));
-      else
-	st = message ("%q%q", st, sortSet_unparse (s->elements[i]));
-    }
-  
-  st = message ("%q]", st);
-  return st;
-}
-
-void
-sortSetList_free (sortSetList s)
-{
-  /* note: elements are dependent */
-
-  sfree (s->elements);	     
-  sfree (s);
-}
diff --git a/src/source.c b/src/source.c
deleted file mode 100644
index b9852f2..0000000
--- a/src/source.c
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** source.c
-**
-** Interface to source file abstraction
-**
-**	NOTE:	    This module is almost identical to the one for LCL.  The
-**		    only difference is that a couple of source lines have been
-**		    commented out.
-**
-**		    This module has too many dependencies to be in the common
-**		    source area.  Any of the solutions that would allow this
-**		    module to be common had its own set of compromises.  It
-**		    seemed best and most straightforward to just keep separte
-**		    copies for LSL and LCL.  We should examine this again if we
-**		    ever reorganize the module structure.
-**
-**  AUTHORS:
-**
-**     Steve Garland,
-**         Massachusetts Institute of Technology
-**     Joe Wild, Technical Languages and Environments, DECspec project
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "osd.h"
-# include "portab.h"
-
-extern bool
-tsource_close (tsource *s)
-{
-  if (s->file != NULL)
-    {
-      check (fclose (s->file) == 0);
-      s->file = NULL;
-      return TRUE;
-    }
-
-  return FALSE;
-}
-
-extern void
-tsource_free (/*@null@*/ /*@only@*/ tsource *s)
-{
-  if (s != NULL)
-    {
-      sfree (s->name);
-      sfree (s->stringSource);
-      sfree (s);
-    }
-}
-
-extern /*@only@*/ tsource *
-  tsource_create (char *name, char *suffix, bool echo)
-{
-  char *ps;
-  tsource *s = (tsource *) dmalloc (sizeof (*s));
-  
-  s->name = (char *) dmalloc (strlen (name) + strlen (suffix) + 1);
-  s->file = 0;
-  strcpy (s->name, name);
-
-  ps = strrchr (s->name, CONNECTCHAR);
-
-  if (ps == (char *) 0)
-    {
-      ps = s->name;
-    }
-
-  if (strchr (ps, '.') == NULL)
-    {
-      strcat (s->name, suffix);
-    }
-
-  
-
-  s->lineNo = 0;
-  s->echo = echo;
-  s->fromString = FALSE;
-  s->stringSource = NULL;
-  s->stringSourceTail = NULL;
-  
-
-  return s;
-}
-
-extern /*@only@*/ tsource *
-tsource_fromString (char *name, char *str)
-{
-  tsource *s = (tsource *) dmalloc (sizeof (*s));
-
-  s->name = mstring_copy (name);
-  s->stringSource = mstring_copy (str);
-  s->stringSourceTail = s->stringSource;
-  s->file = 0;
-  s->echo = FALSE;
-  s->fromString = TRUE;
-  s->lineNo = 0;
-
-    return s;
-}
-
-extern /*@dependent@*/ /*@null@*/ 
-char *tsource_nextLine (tsource *s)
-{
-  char *currentLine;
-  int len;
-
-  if (s->fromString)
-    {
-      if (s->stringSourceTail == NULL || (strlen (s->stringSourceTail) == 0))
-	{
-	  currentLine = 0;
-	}
-      else
-	{
-	  char *c = strchr (s->stringSourceTail, '\n');
-	  
-	  
-	  /* in case line is terminated not by newline */ 
-	  if (c == 0)
-	    {
-	      c = strchr (s->stringSourceTail, '\0');
-	    }
-
-	  len = c - s->stringSourceTail + 1;
-
-	  if (len > STUBMAXRECORDSIZE - 2)
-	    {
-	      len = (STUBMAXRECORDSIZE - 2);
-	    }
-
-	  currentLine = &(s->buffer)[0];
-	  strncpy (currentLine, s->stringSourceTail, size_fromInt (len));
-	  currentLine[len] = '\0';
-	  s->stringSourceTail += len;
-	}
-      
-    }
-  else
-    {
-      llassert (s->file != NULL);
-      currentLine = fgets (&(s->buffer)[0], STUBMAXRECORDSIZE, s->file);
-    }
-  if (currentLine == 0)
-    {
-      strcpy (s->buffer, "*** End of File ***");
-    }
-  else
-    {
-      s->lineNo++;
-      len = strlen (currentLine) - 1;
-      if (s->buffer[len] == '\n')
-	{
-	  s->buffer[len] = '\0';
-	}
-      else 
-	{
-	  if (len >= STUBMAXRECORDSIZE - 2)
-	    {
-	      lldiagmsg (message ("Input line too long: %s",
-				  cstring_fromChars (currentLine)));
-	    }
-	}
-    }
-  /* if (s->echo) slo_echoLine (currentLine);		only needed in LCL */
-    return currentLine;
-}
-
-extern bool
-tsource_open (tsource *s)
-{
-  if (s->fromString)
-    {
-      /* not an error: tail is dependent */
-      s->stringSourceTail = s->stringSource; 
-      return TRUE;
-    }
-
-  DPRINTF (("Open: %s", s->name));
-  s->file = fopen (s->name, "r");
-  return (s->file != 0 || s->fromString);
-}
-
-/*
-** requires
-**  path != NULL \and
-**  s != NULL \and
-**  *s.name == filename (*s.name) || filetype (*s.name)
-**      *s.name consists of a file name and type only (".)
-**	No path name is included
-**
-** ensures
-**  if filefound (*path, *s) then
-**	result = true \and *s.name = filespec_where_file_found (*path, *s)
-**  else
-**	result = false
-*/
-
-extern bool tsource_getPath (char *path, tsource *s)
-{
-  char *returnPath;
-  filestatus status;		/* return status of osd_getEnvPath.*/
-  bool rVal;			/* return value of this procedure. */
-
- /* Check if requires met. */
-  if (path == NULL || s == NULL || s->name == NULL)
-    {
-      llbugexitlit ("tsource_getPath: invalid parameter");
-    }
-
-  status = osd_getPath (path, s->name, &returnPath);
-
-  if (status == OSD_FILEFOUND)
-    {				/* Should be majority of cases. */
-      rVal = TRUE;
-      
-      sfree (s->name);
-      s->name = returnPath;
-    }
-  else if (status == OSD_FILENOTFOUND)
-    {
-      rVal = FALSE;
-    }
-  else if (status == OSD_PATHTOOLONG)
-    {
-      rVal = FALSE;
-     /* Directory and filename are too long.  Report error. */
-     llbuglit ("soure_getPath: Filename plus directory from search path too long");
- }
-  else
-    {
-      rVal = FALSE;
-      llbuglit ("tsource_getPath: invalid return status");
-    }
-  return rVal;
-}
-
-# ifndef NOLCL
-char *specFullName (char *specfile, /*@out@*/ char **inpath)
-{
-  /* extract the path and the specname associated with the given file */
-  char *specname = (char *) dmalloc (sizeof (*specname) 
-				     * (strlen (specfile) + 9));
-  char *ospecname = specname;
-  char *path = (char *) dmalloc (sizeof (*path) * (strlen (specfile)));
-  size_t size;
-  long int i, j;
-  
-  /* initialized path to empty string or may have accidental garbage */
-  *path = '\0';
-
-  /*@-mayaliasunique@*/ 
-  strcpy (specname, specfile);
-  /*@=mayaliasunique@*/ 
-
-  /* trim off pathnames in specfile */
-  size = strlen (specname);
-
-  for (i = size_toInt (size) - 1; i >= 0; i--)
-    {
-      if (specname[i] == CONNECTCHAR)
-	{
-	  /* strcpy (specname, (char *)specname+i+1); */
-	  for (j = 0; j <= i; j++)	/* include '/'  */
-	    {
-	      path[j] = specname[j];
-	    }
-
-	  path[i + 1] = '\0';
-	  specname += i + 1;
-	  break;
-	}
-    }
-
-  /* 
-  ** also remove .lcl file extension, assume it's the last extension
-  ** of the file name 
-  */
-
-  size = strlen (specname);
-
-  for (i = size_toInt (size) - 1; i >= 0; i--)
-    {
-      if (specname[i] == '.')
-	{
-	  specname[i] = '\0';
-	  break;
-	}
-    }
-  
-  *inpath = path;
-
-  /*
-  ** If specname no longer points to the original char,
-  ** we need to allocate a new pointer and copy the string.
-  */
-
-  if (specname != ospecname) {
-    char *rspecname = (char *) dmalloc (sizeof (*rspecname) * (strlen (specname) + 1));
-    strcpy (rspecname, specname); /* evs 2000-05-16: Bug: was ospecname! */
-    sfree (ospecname);
-    return rspecname;
-  } 
-
-  return specname;
-}
-# endif
-
diff --git a/src/specialClauses.c b/src/specialClauses.c
deleted file mode 100644
index 4e34068..0000000
--- a/src/specialClauses.c
+++ /dev/null
@@ -1,944 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** specialClauses.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-static bool specialClause_isMemoryAllocation (specialClause p_cl) /*@*/ ;
-static void specialClause_free (/*@only@*/ specialClause p_s) ;
-static cstring specialClause_dump (specialClause p_s) /*@*/ ;
-static specialClause specialClause_undump (char **p_s) /*@modifies *p_s@*/ ;
-static specialClause specialClause_copy (specialClause p_s) /*@*/ ;
-static bool specialClause_sameKind (specialClause p_s1, specialClause p_s2) /*@*/ ;
-
-specialClause 
-  specialClause_create (stateConstraint st, specialClauseKind k, sRefSet s) 
-{
-  specialClause ret = (specialClause) dmalloc (sizeof (*ret));
-
-  ret->state = st;
-  ret->kind = k;
-  ret->refs = s;
-
-  return ret;
-}
-
-bool specialClause_isBefore (specialClause cl)
-{
-  return (cl->state == TK_BEFORE || cl->state == TK_BOTH);
-}
-
-bool specialClause_isAfter (specialClause cl)
-{
-  return (cl->state == TK_AFTER || cl->state == TK_BOTH);
-}
-
-bool specialClause_isMemoryAllocation (specialClause cl)
-{
-  switch (cl->kind)
-    {
-    case SP_ALLOCATES:
-    case SP_RELEASES:
-    case SP_ISONLY:
-    case SP_ISSHARED:
-    case SP_ISDEPENDENT:
-    case SP_ISOWNED:
-    case SP_ISOBSERVER:
-    case SP_ISEXPOSED:
-      return TRUE;
-    case SP_USES:
-    case SP_DEFINES:
-    case SP_SETS:
-    case SP_ISNULL:
-    case SP_ISNOTNULL:
-      return FALSE;
-  }
-
-  BADEXIT;
-}
-
-/*
-** An error is reported if the test is NOT true.
-*/
-
-sRefTest specialClause_getPreTestFunction (specialClause cl)
-{
-  switch (cl->kind)
-    {
-    case SP_USES:
-      return sRef_isStrictReadable;
-    case SP_ALLOCATES:
-      return sRef_hasNoStorage; 
-    case SP_DEFINES:
-      return sRef_hasNoStorage;
-    case SP_SETS:
-      return sRef_isNotUndefined;
-    case SP_RELEASES:
-      return sRef_isNotUndefined;
-    case SP_ISONLY:
-      return sRef_isOnly;
-    case SP_ISSHARED:
-      return sRef_isShared;
-    case SP_ISDEPENDENT:
-      return sRef_isDependent;
-    case SP_ISOWNED:
-      return sRef_isOwned;
-    case SP_ISOBSERVER:
-      return sRef_isObserver;
-    case SP_ISEXPOSED:
-      return sRef_isExposed;
-    case SP_ISNOTNULL:
-      return sRef_isNotNull;
-    case SP_ISNULL:
-      return sRef_isDefinitelyNull;
-  }
-
-  BADEXIT;
-}
-
-sRefTest specialClause_getPostTestFunction (specialClause cl)
-{
-  llassert (specialClause_isAfter (cl));
-
-  switch (cl->kind)
-    {
-    case SP_USES:
-      return NULL;
-    case SP_ALLOCATES:
-      return sRef_isAllocated;
-    case SP_DEFINES:
-      return sRef_isReallyDefined;
-    case SP_SETS:
-      return sRef_isReallyDefined;
-    case SP_RELEASES:
-      return sRef_isDeadStorage;
-    case SP_ISONLY:
-      return sRef_isOnly;
-    case SP_ISSHARED:
-      return sRef_isShared;
-    case SP_ISDEPENDENT:
-      return sRef_isDependent;
-    case SP_ISOWNED:
-      return sRef_isOwned;
-    case SP_ISOBSERVER:
-      return sRef_isObserver;
-    case SP_ISEXPOSED:
-      return sRef_isExposed;
-    case SP_ISNOTNULL:
-      return sRef_isNotNull;
-    case SP_ISNULL:
-      return sRef_isDefinitelyNull;
-  }
-
-  BADEXIT;
-}
-
-sRefShower specialClause_getPostTestShower (specialClause cl)
-{
-  switch (cl->kind)
-    {
-    case SP_USES:
-    case SP_ALLOCATES:
-      return NULL;
-    case SP_DEFINES:
-    case SP_SETS:
-      return sRef_showNotReallyDefined;
-    case SP_RELEASES:
-      return NULL;
-    case SP_ISONLY:
-    case SP_ISSHARED:
-    case SP_ISDEPENDENT:
-    case SP_ISOWNED:
-      return sRef_showAliasInfo;
-    case SP_ISOBSERVER:
-    case SP_ISEXPOSED:
-      return sRef_showExpInfo;
-    case SP_ISNOTNULL:
-    case SP_ISNULL:
-      return sRef_showNullInfo;
-  }
-
-  BADEXIT;
-}
-
-sRefMod specialClause_getEntryFunction (specialClause cl)
-{
-  if (cl->state == TK_BEFORE || cl->state == TK_BOTH)
-    {
-      switch (cl->kind)
-	{
-	case SP_USES:
-	  return sRef_setDefinedComplete;
-	case SP_ALLOCATES:
-	  return NULL;
-	case SP_DEFINES:
-	  return NULL;
-	case SP_SETS:
-	  return sRef_setAllocatedComplete;
-	case SP_RELEASES:
-	  return sRef_setDefinedComplete;
-	case SP_ISONLY:
-	  return sRef_setOnly;
-	case SP_ISSHARED:
-	  return sRef_setShared;
-	case SP_ISDEPENDENT:
-	  return sRef_setDependent;
-	case SP_ISOWNED:
-	  return sRef_setOwned;
-	case SP_ISOBSERVER:
-	  return sRef_setObserver;
-	case SP_ISEXPOSED:
-	  return sRef_setExposed;
-	case SP_ISNOTNULL:
-	  return sRef_setNotNull;
-	case SP_ISNULL:
-	  return sRef_setDefNull;
-	}
-
-      BADBRANCH;
-    }
-  else
-    {
-      return NULL;
-    }
-}
-
-sRefMod specialClause_getEffectFunction (specialClause cl)
-{
-  if (cl->state == TK_AFTER || cl->state == TK_BOTH)
-    {
-      switch (cl->kind)
-	{
-	case SP_USES:
-	  return NULL;
-	case SP_ALLOCATES:
-	  return sRef_setAllocatedComplete;
-	case SP_DEFINES:
-	  return sRef_setDefinedNCComplete;
-	case SP_SETS:
-	  return sRef_setDefinedNCComplete;
-	case SP_RELEASES:
-	  return sRef_killComplete;
-	case SP_ISONLY:
-	  return sRef_setOnly;
-	case SP_ISSHARED:
-	  return sRef_setShared;
-	case SP_ISDEPENDENT:
-	  return sRef_setDependent;
-	case SP_ISOWNED:
-	  return sRef_setOwned;
-	case SP_ISOBSERVER:
-	  return sRef_setObserver;
-	case SP_ISEXPOSED:
-	  return sRef_setExposed;
-	case SP_ISNOTNULL:
-	  return sRef_setNotNull;
-	case SP_ISNULL:
-	  return sRef_setDefNull;
-	}
-
-      BADBRANCH;
-    }
-  else
-    {
-      return NULL;
-    }
-}
-
-sRefMod specialClause_getReturnEffectFunction (specialClause cl)
-{
-  if (cl->state == TK_AFTER || cl->state == TK_BOTH)
-    {
-      switch (cl->kind)
-	{
-	case SP_USES:
-	case SP_ALLOCATES:
-	case SP_DEFINES:
-	case SP_SETS:
-	case SP_RELEASES:
-	  return NULL;
-	case SP_ISONLY:
-	  return sRef_killComplete;
-	case SP_ISSHARED:
-	case SP_ISDEPENDENT:
-	case SP_ISOWNED:
-	case SP_ISOBSERVER:
-	case SP_ISEXPOSED:
-	case SP_ISNULL:
-	case SP_ISNOTNULL:
-	  return NULL;
-	}
-
-      BADBRANCH;
-    }
-  else
-    {
-      return NULL;
-    }
-}
-
-flagcode specialClause_preErrorCode (specialClause cl)
-{
-  llassert (cl->state == TK_BOTH || cl->state == TK_BEFORE);
-
-  switch (cl->kind)
-    {
-    case SP_USES:
-      return FLG_USEDEF;
-    case SP_ALLOCATES: /*@fallthrough@*/ 
-    case SP_DEFINES:
-    case SP_SETS:
-      return FLG_MUSTFREE;
-    case SP_RELEASES:
-      return FLG_USEDEF;
-    case SP_ISONLY:
-      return FLG_ONLYTRANS;
-    case SP_ISSHARED:
-      return FLG_SHAREDTRANS;
-    case SP_ISDEPENDENT:
-      return FLG_DEPENDENTTRANS;
-    case SP_ISOWNED:
-      return FLG_OWNEDTRANS;
-    case SP_ISOBSERVER:
-      return FLG_OBSERVERTRANS;
-    case SP_ISEXPOSED:
-      return FLG_EXPOSETRANS;
-    case SP_ISNULL:
-    case SP_ISNOTNULL:
-      return FLG_NULLSTATE;
-  }
-
-  BADBRANCH;
-}
-
-cstring specialClause_preErrorString (specialClause cl, sRef sr)
-{
-  llassert (cl->state == TK_BOTH || cl->state == TK_BEFORE);
-
-  switch (cl->kind)
-    {
-    case SP_USES:
-      if (sRef_isDead (sr)) 
-	return cstring_makeLiteralTemp ("Dead");
-      else
-	return cstring_makeLiteralTemp ("Undefined");
-    case SP_ALLOCATES: /*@fallthrough@*/ 
-    case SP_DEFINES:
-    case SP_SETS:
-      return cstring_makeLiteralTemp ("Allocated");
-    case SP_RELEASES:
-      if (sRef_isDead (sr)) 
-	{
-	  return cstring_makeLiteralTemp ("Dead");
-	}
-      else if (sRef_isDependent (sr) 
-	       || sRef_isShared (sr))
-	{
-	  return alkind_unparse (sRef_getAliasKind (sr));
-	}
-      else if (sRef_isObserver (sr) || sRef_isExposed (sr))
-	{
-	  return exkind_unparse (sRef_getExKind (sr));
-	}
-      else
-	{
-	  return cstring_makeLiteralTemp ("Undefined");
-	}
-    case SP_ISONLY:
-    case SP_ISSHARED:
-    case SP_ISDEPENDENT:
-    case SP_ISOWNED:
-      return alkind_capName (sRef_getAliasKind (sr));
-    case SP_ISOBSERVER:
-      return cstring_makeLiteralTemp ("Non-observer");
-    case SP_ISEXPOSED:
-      if (sRef_isObserver (sr))
-	{
-	  return cstring_makeLiteralTemp ("Observer");
-	}
-      else
-	{
-	  return cstring_makeLiteralTemp ("Non-exposed");
-	}
-    case SP_ISNOTNULL:
-      if (sRef_isDefinitelyNull (sr))
-	{
-	  return cstring_makeLiteralTemp ("Null");
-	}
-      else
-	{
-	  return cstring_makeLiteralTemp ("Possibly null");
-	}
-    case SP_ISNULL:
-      return cstring_makeLiteralTemp ("Non-null");
-  }
-
-  BADEXIT;
-}
-
-flagcode specialClause_postErrorCode (specialClause cl)
-{
-  llassert (cl->state == TK_BOTH || cl->state == TK_AFTER);
-
-  switch (cl->kind)
-    {
-    case SP_USES:
-      BADBRANCHCONT;
-      return INVALID_FLAG;
-    case SP_ALLOCATES: 
-    case SP_DEFINES:  
-    case SP_SETS:     
-      return FLG_COMPDEF;
-    case SP_RELEASES:
-      return FLG_MUSTFREE;
-    case SP_ISONLY:
-      return FLG_ONLYTRANS;
-    case SP_ISSHARED:
-      return FLG_SHAREDTRANS;
-    case SP_ISDEPENDENT:
-      return FLG_DEPENDENTTRANS;
-    case SP_ISOWNED:
-      return FLG_OWNEDTRANS;
-    case SP_ISOBSERVER:
-      return FLG_OBSERVERTRANS;
-    case SP_ISEXPOSED:
-      return FLG_EXPOSETRANS;
-    case SP_ISNULL:
-    case SP_ISNOTNULL:
-      return FLG_NULLSTATE;
-  }
-
-  BADBRANCH;
-}
-
-cstring specialClause_postErrorString (specialClause cl, sRef sr)
-{
-  llassert (cl->state == TK_BOTH || cl->state == TK_AFTER);
-
-  switch (cl->kind)
-    {
-    case SP_USES:
-      BADBRANCHCONT;
-      return cstring_makeLiteralTemp ("");
-    case SP_ALLOCATES: 
-      return cstring_makeLiteralTemp ("Unallocated");
-    case SP_DEFINES:
-    case SP_SETS:
-      return cstring_makeLiteralTemp ("Undefined");
-    case SP_RELEASES:
-      return cstring_makeLiteralTemp ("Unreleased");
-    case SP_ISONLY:
-    case SP_ISSHARED:
-    case SP_ISOWNED:
-    case SP_ISDEPENDENT:
-      return alkind_capName (sRef_getAliasKind (sr));
-    case SP_ISOBSERVER:
-      return cstring_makeLiteralTemp ("Non-observer");
-    case SP_ISEXPOSED:
-      if (sRef_isObserver (sr))
-	{
-	  return cstring_makeLiteralTemp ("Observer");
-	}
-      else
-	{
-	  return cstring_makeLiteralTemp ("Non-exposed");
-	}
-    case SP_ISNULL:
-      return cstring_makeLiteralTemp ("Non-null");
-    case SP_ISNOTNULL:
-      if (sRef_isDefinitelyNull (sr))
-	{
-	  return cstring_makeLiteralTemp ("Null");
-	}
-      else
-	{
-	  return cstring_makeLiteralTemp ("Possibly null");
-	}
-  }
-
-  BADEXIT;
-}
-
-cstring specialClause_dump (specialClause s)
-{
-  return (message ("%d.%d.%q",
-		   (int) s->state,
-		   (int) s->kind,
-		   sRefSet_dump (s->refs)));
-}
-
-specialClause specialClause_undump (char **s)
-{
-  specialClause ret = (specialClause) dmalloc (sizeof (*ret));
-
-  ret->state = (stateConstraint) getInt (s);
-  checkChar (s, '.');
-  ret->kind = (specialClauseKind) getInt (s);
-  checkChar (s, '.');
-  ret->refs = sRefSet_undump (s);
-
-  return ret;
-}
-
-specialClause specialClause_copy (specialClause s) 
-{
-  specialClause ret = (specialClause) dmalloc (sizeof (*ret));
-  
-  ret->state = s->state;
-  ret->kind = s->kind;
-  ret->refs = sRefSet_newCopy (s->refs);
-  
-  return ret;
-}
-
-bool specialClause_sameKind (specialClause s1, specialClause s2)
-{
-  return (s1->state == s2->state && s1->kind == s2->kind);
-}
-
-void specialClause_free (specialClause s)
-{
-  sRefSet_free (s->refs);
-  sfree (s);
-}
-
-static /*@observer@*/ cstring 
-  specialClauseKind_unparse (specialClauseKind k) 
-{
-  switch (k)
-    {
-    case SP_USES: 
-      return cstring_makeLiteralTemp ("uses");
-    case SP_DEFINES:
-      return cstring_makeLiteralTemp ("defines");
-    case SP_ALLOCATES:
-      return cstring_makeLiteralTemp ("allocates");
-    case SP_RELEASES:
-      return cstring_makeLiteralTemp ("releases");
-    case SP_SETS:
-      return cstring_makeLiteralTemp ("sets");
-    case SP_ISNULL:
-      return cstring_makeLiteralTemp ("isnull");
-    case SP_ISNOTNULL:
-      return cstring_makeLiteralTemp ("notnull");
-    case SP_ISONLY:
-      return cstring_makeLiteralTemp ("only");
-    case SP_ISSHARED:
-      return cstring_makeLiteralTemp ("shared");
-    case SP_ISDEPENDENT:
-      return cstring_makeLiteralTemp ("dependent");
-    case SP_ISOWNED:
-      return cstring_makeLiteralTemp ("owned");
-    case SP_ISOBSERVER:
-      return cstring_makeLiteralTemp ("observer");
-    case SP_ISEXPOSED:
-      return cstring_makeLiteralTemp ("exposed");
-    }
-
-  BADEXIT;
-}
-
-cstring specialClause_unparseKind (specialClause s)
-{
-  return (message ("%s%s",
-		   cstring_makeLiteralTemp (s->state == TK_BEFORE 
-					    ? "pre:"
-					    : (s->state == TK_AFTER
-					       ? "post:" : "")),
-		   specialClauseKind_unparse (s->kind)));
-}
-
-cstring specialClause_unparse (specialClause s)
-{
-  return (message ("%q %q", 
-		   specialClause_unparseKind (s), sRefSet_unparse (s->refs)));
-}
-
-specialClause specialClause_createDefines (sRefSet s)
-{
-  return (specialClause_create (TK_BOTH, SP_DEFINES, s));
-}
-
-specialClause specialClause_createUses (sRefSet s)
-{
-  return (specialClause_create (TK_BOTH, SP_USES, s));
-}
-
-specialClause specialClause_createSets (sRefSet s)
-{
-  return (specialClause_create (TK_BOTH, SP_SETS, s));
-}
-
-specialClause specialClause_createReleases (sRefSet s)
-{
-  return (specialClause_create (TK_BOTH, SP_RELEASES, s));
-}
-
-specialClause specialClause_createAllocates (sRefSet s)
-{
-  return (specialClause_create (TK_BOTH, SP_ALLOCATES, s));
-}
-
-static /*@notnull@*/ specialClauses specialClauses_new (void)
-{
-  specialClauses s = (specialClauses) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = specialClausesBASESIZE;
-  s->elements = (specialClause *) 
-    dmalloc (sizeof (*s->elements) * specialClausesBASESIZE);
-
-  return (s);
-}
-
-static void
-specialClauses_grow (specialClauses s)
-{
-  int i;
-  specialClause *newelements;
-
-  llassert (specialClauses_isDefined (s));
-
-  s->nspace += specialClausesBASESIZE; 
-  
-  newelements = (specialClause *) 
-    dmalloc (sizeof (*newelements) * (s->nelements + s->nspace));
-  
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-  
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-specialClauses specialClauses_add (specialClauses s, specialClause el)
-{
-  if (specialClauses_isUndefined (s))
-    {
-      s = specialClauses_new ();
-    }
-  else
-    {
-      specialClauses_elements (s, cl)
-	{
-	  if (specialClause_sameKind (cl, el))
-	    {
-	      voptgenerror
-		(FLG_SYNTAX,
-		 message ("Multiple %q clauses for one function (using union)",
-			  specialClause_unparseKind (cl)),
-		 g_currentloc);
-
-	      cl->refs = sRefSet_union (cl->refs, el->refs);
-	      specialClause_free (el);
-	      return s;
-	    }
-	} end_specialClauses_elements ;
-    }
-
-  if (s->nspace <= 0)
-    {
-      specialClauses_grow (s);
-    }
-  
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-
-  return s;
-}
-
-cstring specialClauses_unparse (specialClauses s)
-{
-  cstring st = cstring_undefined;
-  int i;
-  
-  if (specialClauses_isDefined (s))
-    {
-      for (i = 0; i < specialClauses_size (s); i++)
-	{
-	  if (i == 0)
-	    {
-	      st = message ("%q;", specialClause_unparse (s->elements[i]));
-	    }
-	  else
-	    st = message ("%q %q;", st, specialClause_unparse (s->elements[i]));
-	}
-    }
-  
-  return (st);
-}
-
-specialClauses specialClauses_copy (specialClauses s)
-{
-  if (specialClauses_isDefined (s))
-    {
-      specialClauses t = (specialClauses) dmalloc (sizeof (*t));
-      int i;
-      
-      t->nelements = s->nelements;
-      t->nspace = 0;
-      
-      if (s->nelements > 0)
-	{
-	  t->elements = (specialClause *) dmalloc (sizeof (*t->elements) * t->nelements);
-	  for (i = 0; i < s->nelements; i++) 
-	    {
-	      t->elements[i] = specialClause_copy (s->elements[i]); 
-	    }
-	}
-      else
-	{
-	  t->elements = NULL;
-	}
-
-      return t;
-    }
-  else
-    {
-      return specialClauses_undefined;
-    }
-}
-
-void
-specialClauses_free (specialClauses s)
-{
-  if (!specialClauses_isUndefined (s)) 
-    {
-      int i;
-
-      for (i = 0; i < s->nelements; i++)
-	{
-	  specialClause_free (s->elements[i]);  
-	}
-
-      sfree (s->elements);
-      sfree (s);
-    }
-}
-
-cstring specialClauses_dump (specialClauses s)
-{
-  cstring st = cstring_undefined;
-
-  if (specialClauses_isUndefined (s)) return st;
-  
-  specialClauses_elements (s, current)
-    {
-      st = message ("%q%q$", st, specialClause_dump (current));
-    } end_specialClauses_elements;
-
-  return st;
-}
-
-specialClauses specialClauses_undump (char **s)
-{
-  char c;
-  specialClauses pn = specialClauses_new ();
-  int paramno = 0;
-
-  c = **s;
-
-  while (c != '#' && c != '@')
-    {
-      specialClause sc = specialClause_undump (s);
-      
-      pn = specialClauses_add (pn, sc);
-      checkChar (s, '$');
-      c = **s;
-      paramno++;
-    }
-
-  return pn;
-}
-
-static /*@exposed@*/ sRefSet
-  specialClauses_getClause (specialClauses s, stateConstraint st, 
-			    specialClauseKind k)
-{
-  specialClauses_elements (s, el)
-    {
-      if (el->state == st && el->kind == k)
-	{
-	  return el->refs;
-	}
-    } end_specialClauses_elements ;
-
-  return sRefSet_undefined;
-}
-
-void specialClauses_checkAll (uentry ue)
-{
-  specialClauses clauses = uentry_getSpecialClauses (ue);
-  sRef res = uentry_getSref (ue);		  
-  bool specialResult = FALSE;
-
-  specialClauses_elements (clauses, cl)
-    {
-      bool isPre = (cl->state == TK_BEFORE);
-      sRefSet refs = cl->refs;
-
-      sRefSet_allElements (refs, el)
-	{
-	  sRef rb = sRef_getRootBase (el);
-
-	  if (sRef_isResult (rb))
-	    {
-	      if (isPre)
-		{
-		  voptgenerror
-		    (FLG_INCONDEFS,
-		     message ("Function result is used in %q clause of %q "
-			      "(%q applies to the state before function is "
-			      "called, so should not use result): %q",
-			      specialClause_unparseKind (cl),
-			      uentry_getName (ue),
-			      specialClause_unparseKind (cl),
-			      sRef_unparse (el)),
-		     uentry_whereLast (ue));
-		}
-	      else
-		{
-		  if (!sRef_isStateSpecial (res))
-		    {
-		      if (!specialResult)
-			{
-			  voptgenerror
-			    (FLG_INCONDEFS,
-			     message ("Function result is used in %q clause of %q "
-				      "but not annotated with special: %q",
-				      specialClause_unparseKind (cl),
-				      uentry_getName (ue),
-				      sRef_unparse (el)),
-			     uentry_whereLast (ue));
-
-			  specialResult = TRUE;
-			}
-		    }
-
-		  (void) sRef_fixResultType (el, sRef_getType (res), ue);
-		}
-	    }
-	  else if (sRef_isParam (rb))
-	    {
-	      if (!sRef_isStateSpecial (rb))
-		{
-		  voptgenerror 
-		    (FLG_INCONDEFS,
-		     message ("Reference %q used in %q clause of %q, "
-			      "but not annotated with special: %q",
-			      sRef_unparse (rb),
-			      specialClause_unparseKind (cl),
-			      uentry_getName (ue),
-			      sRef_unparse (el)),
-		     uentry_whereLast (ue));
-		}
-	    }
-	  else if (sRef_isInvalid (rb))
-	    {
-	      /*@innercontinue@*/ continue;
-	    }
-	  else 
-	    {
-	      BADBRANCHCONT;
-	      /*@innercontinue@*/ continue;
-	    }
-
-	  if (specialClause_isMemoryAllocation (cl))
-	    {
-	      if (!ctype_isVisiblySharable (sRef_getType (el)))
-		{
-		  llerror 
-		    (FLG_SYNTAX, 
-		     message ("Special clause %q includes %q of "
-			      "non-dynamically allocatated type %s",
-			      specialClause_unparseKind (cl),
-			      sRef_unparse (el), 
-			      ctype_unparse (sRef_getType (el))));
-		}
-	    }
-
-	} end_sRefSet_allElements ;
-    } end_specialClauses_elements ;
-}
-  
-void specialClauses_checkEqual (uentry old, uentry unew)
-{
-  specialClauses oldClauses = uentry_getSpecialClauses (old);
-  specialClauses newClauses = uentry_getSpecialClauses (unew);
-
-  if (specialClauses_isDefined (newClauses))
-    {
-      specialClauses_elements (newClauses, cl)
-	{
-	  sRefSet sc = specialClauses_getClause (oldClauses, cl->state, cl->kind);
-
-	  if (!sRefSet_equal (sc, cl->refs))
-	    {
-	      if (optgenerror
-		  (FLG_INCONDEFS,
-		   message ("Function %q %rdeclared with inconsistent %q clause: %q",
-			    uentry_getName (old),
-			    uentry_isDeclared (old),
-			    specialClause_unparseKind (cl),
-			    sRefSet_unparsePlain (cl->refs)),
-		   g_currentloc))
-		{
-		  uentry_showWhereLastExtra (old, sRefSet_unparsePlain (sc));
-		}
-	    }
-	} end_specialClauses_elements ;
-
-      specialClauses_elements (oldClauses, cl)
-	{
-	  sRefSet sc = specialClauses_getClause (newClauses, cl->state, cl->kind);
-
-	  if (sRefSet_isUndefined (sc) && !sRefSet_isEmpty (cl->refs))
-	    {
-	      if (optgenerror
-		  (FLG_INCONDEFS,
-		   message ("Function %q %rdeclared without %q clause (either "
-			    "use no special clauses in redeclaration, or "
-			    "they must match exactly: %q",
-			    uentry_getName (old),
-			    uentry_isDeclared (old),
-			    specialClause_unparseKind (cl),
-			    sRefSet_unparsePlain (cl->refs)),
-		   g_currentloc))
-		{
-		  uentry_showWhereLastExtra (old, sRefSet_unparsePlain (sc));
-		}
-	    }
-	} end_specialClauses_elements ;
-
-    }
-}
-
-
-
diff --git a/src/stDeclNodeList.c b/src/stDeclNodeList.c
deleted file mode 100644
index 48e6c27..0000000
--- a/src/stDeclNodeList.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** structDeclNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ stDeclNodeList
-stDeclNodeList_new ()
-{
-  stDeclNodeList s = (stDeclNodeList) dmalloc (sizeof (*s));
-
-  s->nelements = 0;
-  s->nspace = stDeclNodeListBASESIZE;
-  s->elements = (stDeclNode *)
-    dmalloc (sizeof (*s->elements) * stDeclNodeListBASESIZE);
-
-  return (s);
-}
-
-static void
-stDeclNodeList_grow (stDeclNodeList s)
-{
-  int i;
-  stDeclNode *newelements; 
-
-  s->nspace += stDeclNodeListBASESIZE;
-
-  newelements = (stDeclNode *) dmalloc (sizeof (*newelements)
-					* (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i]; 
-    }
-
-  sfree (s->elements); 
-  s->elements = newelements;
-}
-
-stDeclNodeList  
-stDeclNodeList_add (stDeclNodeList s, /*@only@*/ stDeclNode el)
-{
-  if (s->nspace <= 0)
-    stDeclNodeList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-
-  return s;
-}
-
-/*@only@*/ stDeclNodeList 
-stDeclNodeList_copy (stDeclNodeList s)
-{
-  stDeclNodeList r = stDeclNodeList_new ();
-
-  stDeclNodeList_elements (s, x)
-    {
-      r = stDeclNodeList_add (r, stDeclNode_copy (x));
-    } end_stDeclNodeList_elements;
-  
-  return r;
-}
-
-/*@only@*/ cstring
-stDeclNodeList_unparse (stDeclNodeList s)
-{
-  bool first = TRUE;
-  cstring st = cstring_undefined;
-
-  stDeclNodeList_elements (s, current)
-  {
-    if (first)
-      {
-	st = message ("%q %q;", lclTypeSpecNode_unparse (current->lcltypespec),
-		      declaratorNodeList_unparse (current->declarators));
-	first = FALSE;
-      }
-    else
-      {
-	st = message ("%q %q %q;", st, lclTypeSpecNode_unparse (current->lcltypespec),
-		      declaratorNodeList_unparse (current->declarators));
-      }
-  } end_stDeclNodeList_elements;
-
-  return st;
-}
-
-void
-stDeclNodeList_free (stDeclNodeList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-      stDeclNode_free (s->elements[i]); 
-    }
-
-  sfree (s->elements); 
-  sfree (s);
-}
diff --git a/src/storeRefNodeList.c b/src/storeRefNodeList.c
deleted file mode 100644
index b4a4715..0000000
--- a/src/storeRefNodeList.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** storeRefNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ storeRefNodeList
-storeRefNodeList_new ()
-{
-  storeRefNodeList s = (storeRefNodeList) dmalloc (sizeof (*s));
-
-  s->nelements = 0;
-  s->nspace = storeRefNodeListBASESIZE;
-  s->elements = (storeRefNode *) 
-    dmalloc (sizeof (*s->elements) * storeRefNodeListBASESIZE);
-
-  return (s);
-}
-
-static void
-storeRefNodeList_grow (storeRefNodeList s)
-{
-  int i;
-  storeRefNode *newelements; 
-
-  s->nspace += storeRefNodeListBASESIZE;
-
-  newelements = (storeRefNode *) dmalloc (sizeof (*newelements)
-					  * (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i]; 
-    }
-
-  sfree (s->elements); 
-  s->elements = newelements;
-}
-
-storeRefNodeList
-storeRefNodeList_add (storeRefNodeList s, storeRefNode el)
-{
-  if (s->nspace <= 0)
-    storeRefNodeList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-
-  return s;
-}
-
-/*@only@*/ storeRefNodeList 
-storeRefNodeList_copy (storeRefNodeList s)
-{
-  storeRefNodeList r = storeRefNodeList_new ();
-
-  storeRefNodeList_elements (s, x)
-    {
-      r = storeRefNodeList_add (r, storeRefNode_copy (x));
-    } end_storeRefNodeList_elements;
-
-  return r;
-}
-
-/*@only@*/ cstring
-storeRefNodeList_unparse (storeRefNodeList s)
-{
-  bool first = TRUE;
-  cstring st = cstring_undefined;
-
-  storeRefNodeList_elements (s, current)
-  {
-    if (first)
-      {
-	first = FALSE;
-      }
-    else
-      {
-	st = message ("%q, ", st);
-      }
-
-    switch (current->kind)
-      {
-      case SRN_OBJ:
-	st = message ("%qobj", st);
-	/*@switchbreak@*/ break;
-      case SRN_TERM:
-	st = message ("%q%q", st, termNode_unparse (current->content.term));
-	/*@switchbreak@*/ break;
-      case SRN_TYPE:
-	st = message ("%q%q", st, lclTypeSpecNode_unparse (current->content.type));
-	/*@switchbreak@*/ break;
-      case SRN_SPECIAL:
-	st = message ("%q%q", st, sRef_unparse (current->content.ref));
-	/*@switchbreak@*/ break;
-      }
-  } end_storeRefNodeList_elements;
-
-  return st;
-}
-
-void
-storeRefNodeList_free (storeRefNodeList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-      storeRefNode_free (s->elements[i]);
-    }
-
-  sfree (s->elements);
-  sfree (s);
-}
diff --git a/src/structNames.c b/src/structNames.c
deleted file mode 100644
index cc55d27..0000000
--- a/src/structNames.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** structNames.c
-**
-** Hacks to fit tags into the same namespace.
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-# include "structNames.h"
-
-/*@constant char MARKCHAR_STRUCT; @*/
-# define MARKCHAR_STRUCT '@'
-
-/*@constant char MARKCHAR_UNION; @*/
-# define MARKCHAR_UNION  '$'
-
-/*@constant char MARKCHAR_ENUM; @*/
-# define MARKCHAR_ENUM   '&'
-
-/*@constant char MARKCHAR_PARAM; @*/
-# define MARKCHAR_PARAM  '%'
-
-/*@only@*/ cstring fixTagName (cstring s)
-{
-  if (isFakeTag (s))
-    {
-      switch (cstring_firstChar (s))
-	{
-	case MARKCHAR_STRUCT: return (cstring_makeLiteral ("struct"));
-	case MARKCHAR_UNION:  return (cstring_makeLiteral ("union"));
-	case MARKCHAR_ENUM:   return (cstring_makeLiteral ("enum"));
-	default:         return (message ("", s));
-	  /* BADDEFAULT; */
-	}
-    }
-  else
-    {
-      if (cstring_isDefined (s)) {
-	switch (cstring_firstChar (s))
-	  {
-	  case MARKCHAR_STRUCT:
-	    return (message ("struct %s", cstring_suffix (s, 1)));
-	  case MARKCHAR_UNION: 
-	    return (message ("union %s", cstring_suffix (s, 1)));
-	  case MARKCHAR_ENUM:   
-	    return (message ("enum %s", cstring_suffix (s, 1)));
-	    BADDEFAULT;
-	  }
-      } else {
-	return (cstring_makeLiteral (""));
-      }
-    }
-}
-
-cstring makeParam (cstring s)
-{
-  if (cstring_length(s) > 0 && cstring_firstChar (s) == MARKCHAR_PARAM)
-    {
-      llbug (message ("makeParam: %s\n", s));
-    }
-
-  if (cstring_isUndefined (s))
-    {
-      return cstring_undefined;
-    }
-
-  return (cstring_prependChar (MARKCHAR_PARAM, s));  
-}
-
-/*@observer@*/ cstring fixParamName (cstring s)
-{
-  if (cstring_length(s) < 1)
-    {
-      return cstring_undefined;
-    }
-
-  if (cstring_firstChar (s) != MARKCHAR_PARAM)
-    {
-      llbug (message ("fixParamName (no #): %s", s));
-    }
-
-  return (cstring_suffix (s, 1));
-}
-
-cstring makeStruct (cstring s)
-{
-  if (cstring_firstChar (s) == '@')
-    {
-      llbug (message ("makeStruct: %s\n", s));
-    }
-
-  return (cstring_prependChar (MARKCHAR_STRUCT, s));
-}
-
-cstring makeUnion (cstring s)
-{
-  return (cstring_prependChar (MARKCHAR_UNION, s));
-}
-
-cstring makeEnum (cstring s)
-{
-  return (cstring_prependChar (MARKCHAR_ENUM, s));
-}
-
-static unsigned int tagno = 1;
-
-void setTagNo (unsigned int n)
-{
-  if (n > tagno)
-    tagno = n;
-}
-
-bool isFakeTag (cstring s)
-{
-  int length = cstring_length (s);
-
-  return ((length >= 1 && cstring_firstChar (s) == '!')
-	  || (length >= 2 && cstring_getChar (s, 2) == '!'));
-}
-
-cstring fakeTag ()
-{
-  tagno++;
-
-  return (message ("!%u", tagno));
-}
-
-
-
-
-
diff --git a/src/symtable.c b/src/symtable.c
deleted file mode 100644
index 4908c66..0000000
--- a/src/symtable.c
+++ /dev/null
@@ -1,2121 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** symtable.c
-**
-** Symbol table abstraction
-**
-**  AUTHORS:
-**
-**	Gary Feldman, Technical Languages and Environments, DECspec project
-**	Steve Garland,
-**         Massachusetts Institute of Technology
-**	Joe Wild, Technical Languages and Environments, DECspec project
-**	Yang Meng Tan,
-**         Massachusetts Institute of Technology
-**
-**  CREATION DATE:
-**
-**	20 January 1991
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "gram.h"
-# include "lclscan.h"
-# include "lclsyntable.h"
-# include "lslparse.h"
-
-/*@+ignorequals@*/
-
-static bool isBlankLine (char *p_line);
-static bool inImport = FALSE;
-
-/*@constant static int MAXBUFFLEN;@*/
-# define MAXBUFFLEN 512
-/*@constant static int DELTA;@*/
-# define DELTA 100
-
-static void symHashTable_dump (symHashTable * p_t, FILE * p_f, bool p_lco);
-
-static void tagInfo_free (/*@only@*/ tagInfo p_tag);
-static /*@observer@*/ scopeInfo symtable_scopeInfo (symtable p_stable);
-
-static void symtable_dumpId (symtable p_stable, FILE *p_f, bool p_lco);
-static lsymbol nameNode2key (nameNode p_n);
-
-typedef enum
-{
-  SYMK_FCN, SYMK_SCOPE, SYMK_TYPE, SYMK_VAR
-} symKind;
-
-typedef struct
-{
-  symKind kind;
-  union
-  {
-    /*@only@*/ fctInfo fct;
-    /*@only@*/ scopeInfo scope;
-    /*@only@*/ typeInfo type;
-    /*@only@*/ varInfo var;
-  } info;
-} idTableEntry;
-
-typedef struct _idTable
-{
-  unsigned int size;
-  unsigned int allocated;
-  /*@relnull@*/ idTableEntry *entries;
-  bool exporting;
-} idTable;
-
-struct _symtableStruct
-{
-  idTable *idTable;		/* data is idTableEntry */
-  symHashTable *hTable;		/* data is htData */
-  mapping *type2sort;		/* maps LCL type symbol to LSL sort */
-} ;
-
-static /*@observer@*/ ltoken idTableEntry_getId (idTableEntry *p_x);
-static /*@out@*/ /*@exposed@*/ idTableEntry *nextFree (idTable * p_st);
-static /*@dependent@*/ /*@null@*/ idTableEntry *symtable_lookup (idTable * p_st, lsymbol p_id);
-static /*@dependent@*/ /*@null@*/ idTableEntry *symtable_lookupInScope (idTable * p_st, lsymbol p_id);
-
-static /*@only@*/ idTable *symtable_newIdTable (void);
-static void idTableEntry_free (idTableEntry p_x);
-
-/* Local implementatio of hash table */
-
-static bool allowed_redeclaration = FALSE;
-static symbolKey htData_key (htData *p_x);
-
-static void symHashTable_free (/*@only@*/ symHashTable *p_h);
-static /*@only@*/ symHashTable *symHashTable_create (unsigned int p_size);
-static /*@null@*/ /*@exposed@*/ htData *
-  symHashTable_get (symHashTable * p_t, symbolKey p_key, infoKind p_kind, 
-		 /*@null@*/ nameNode p_n);
-static bool symHashTable_put (symHashTable *p_t, /*@only@*/ htData *p_data);
-static /*@only@*/ /*@exposed@*/ /*@null@*/ htData *
-  symHashTable_forcePut (symHashTable * p_t, /*@only@*/ htData *p_data);
-/* static unsigned int symHashTable_count (symHashTable * t); */
-
-static void idTable_free (/*@only@*/ idTable *p_st);
-
-void varInfo_free (/*@only@*/ varInfo v)
-{
-  sfree (v);
-}
-
-static /*@only@*/ varInfo varInfo_copy (varInfo v)
-{
-  varInfo ret = (varInfo) dmalloc (sizeof (*ret));
-
-  ret->id = ltoken_copy (v->id);
-  ret->sort = v->sort;
-  ret->kind = v->kind;
-  ret->export = v->export;
-
-  return ret;
-}
-
-void symtable_free (symtable stable)
-{
-  /* symtable_printStats (stable); */
-
-  idTable_free (stable->idTable);
-  symHashTable_free (stable->hTable);
-  mapping_free (stable->type2sort);
-  sfree (stable);
-}
-
-static void idTable_free (idTable *st)
-{
-  unsigned int i;
-
-  for (i = 0; i < st->size; i++)
-    {
-      idTableEntry_free (st->entries[i]);
-    }
-
-  sfree (st->entries);
-  sfree (st);
-}
-
-static void fctInfo_free (/*@only@*/ fctInfo f)
-{
-  signNode_free (f->signature);
-  pairNodeList_free (f->globals);
-  ltoken_free (f->id);
-  sfree (f);
-}
-
-static void typeInfo_free (/*@only@*/ typeInfo t)
-{
-  sfree (t);
-}
-
-static void scopeInfo_free (/*@only@*/ scopeInfo s)
-{
-  sfree (s);
-}
-
-static void idTableEntry_free (idTableEntry x)
-{
-  switch (x.kind)
-    {
-    case SYMK_FCN:
-      fctInfo_free (x.info.fct);
-      break;
-    case SYMK_SCOPE:
-      scopeInfo_free (x.info.scope);
-      break;
-    case SYMK_TYPE:
-      typeInfo_free (x.info.type);
-      break;
-    case SYMK_VAR:
-      varInfo_free (x.info.var);
-      break;
-    }
-}
-
-static /*@observer@*/ ltoken idTableEntry_getId (idTableEntry *x)
-{
-  switch (x->kind)
-    {
-    case SYMK_FCN:
-      return (x->info.fct->id);
-    case SYMK_SCOPE:
-      return ltoken_undefined;
-    case SYMK_TYPE:
-      return (x->info.type->id);
-    case SYMK_VAR:
-      return (x->info.var->id);
-    }
-
-  BADBRANCH;
-}
-
-/*@only@*/ symtable
-symtable_new (void)
-{
-  symtable stable = (symtable) dmalloc (sizeof (*stable));
-  idTableEntry *e;
-  
-  stable->idTable = symtable_newIdTable ();
-  stable->hTable = symHashTable_create (HT_MAXINDEX);
-  stable->type2sort = mapping_create ();
-  
-  /* add builtin synonym:  Bool -> bool */
-  
-  mapping_bind (stable->type2sort, lsymbol_getBool (), lsymbol_getbool ());
-
-  /*
-  ** done by symtable_newIdTable
-  ** st->allocated = 0;
-  ** st->entries = (idTableEntry *) 0;
-  ** st->exporting = TRUE;
-  */
-
-  /* this is global scope */
-  e = nextFree (stable->idTable);
-  e->kind = SYMK_SCOPE;
-  (e->info).scope = (scopeInfo) dmalloc (sizeof (*((e->info).scope)));
-  (e->info).scope->kind = SPE_GLOBAL;
-  
-  return stable;
-}
-
-static /*@only@*/ idTable *symtable_newIdTable (void)
-{
-  idTable *st = (idTable *) dmalloc (sizeof (*st));
-
-  st->size = 0;
-  st->allocated = 0;
-  st->entries = (idTableEntry *) 0;
-  st->exporting = TRUE;
-  
-  /* this was being done twice!
-     e = nextFree (st);
-     e->kind = SYMK_SCOPE;
-     (e->info).scope.kind = globScope;
-     */
-
-  return st;
-}
-
-static lsymbol
-nameNode2key (nameNode n)
-{
-  unsigned int ret;
-
-  if (n->isOpId)
-    {
-      ret =  ltoken_getText (n->content.opid);
-    }
-  else
-    {
-      /* use opForm's key as its Identifier */
-      llassert (n->content.opform != NULL);
-      ret = (n->content.opform)->key;
-    }
-
-  return ret;
-}
-
-/*
-** requires: nameNode n is already in st.
-*/
-
-static bool
-htData_insertSignature (htData *d, /*@owned@*/ sigNode oi)
-{
-  sigNodeSet set = d->content.op->signatures;
-
-  
-  if (oi != (sigNode) 0)
-    {
-      return (sigNodeSet_insert (set, oi));
-    }
-  return FALSE;
-}
-
-void
-symtable_enterOp (symtable st, /*@only@*/ /*@notnull@*/ nameNode n, 
-		  /*@owned@*/ sigNode oi)
-{
-  /*
-  ** Operators are overloaded, we allow entering opInfo more than once,
-  ** even if it's the same signature. 
-  **
-  ** Assumes all sorts are already entered into the symbol table 
-  */
-
-  symHashTable *ht = st->hTable;
-  htData *d;
-  lsymbol id;
-
-  
-  
-  id = nameNode2key (n);
-
-  d = symHashTable_get (ht, id, IK_OP, n);
-  
-  if (d == (htData *) 0)
-    {				/* first signature of this operator */
-      opInfo op = (opInfo) dmalloc (sizeof (*op));
-      htData *nd = (htData *) dmalloc (sizeof (*nd));
-
-      op->name = n;
-
-      if (oi != (sigNode) 0)
-	{
-	  op->signatures = sigNodeSet_singleton (oi);
-	  ht->count++;
-	}
-      else
-	{
-	  op->signatures = sigNodeSet_new ();
-	  sigNode_markOwned (oi);
-	}
-
-      nd->kind = IK_OP;
-      nd->content.op = op;
-      (void) symHashTable_put (ht, nd);
-    }
-  else
-    {
-      
-      nameNode_free (n);  /*<<count++;
-	}
-    }
-}
-
-bool
-  symtable_enterTag (symtable st, tagInfo ti)
-{
-  /* put ti only if it is not already in symtable */
-  symHashTable *ht = st->hTable;
-  htData *d;
-  symbolKey key = ltoken_getText (ti->id);
-
-  d = symHashTable_get (ht, key, IK_TAG, (nameNode) 0);
-  if (d == (htData *) 0)
-    {
-      d = (htData *) dmalloc (sizeof (*d));
-      d->kind = IK_TAG;
-      d->content.tag = ti;
-      d->content.tag->imported = context_inImport ();
-      (void) symHashTable_put (ht, d);
-      return TRUE;
-    }
-  else
-    {
-      if (d->content.tag->imported)
-	{
-	  d->content.tag = ti;
-	  d->content.tag->imported = context_inImport ();
-	  return TRUE;
-	}
-      else
-	{
-	  tagInfo_free (ti);
-	  return FALSE;
-	}
-    }
-}
-
-bool
-symtable_enterTagForce (symtable st, tagInfo ti)
-{
- /* put ti, force-put if necessary */
-  symHashTable *ht = st->hTable;
-  htData *d;
-  symbolKey key = ltoken_getText (ti->id);
-
-  d = symHashTable_get (ht, key, IK_TAG, (nameNode) 0);
-
-  if (d == (htData *) 0)
-    {
-      d = (htData *) dmalloc (sizeof (*d));
-      
-      d->kind = IK_TAG;
-      d->content.tag = ti;
-      d->content.tag->imported = context_inImport ();
-      (void) symHashTable_put (ht, d);
-      return TRUE;
-    }
-  else
-    {
-            
-      d->kind = IK_TAG;
-      d->content.tag = ti;
-      d->content.tag->imported = context_inImport ();
-      /* interpret return data later, htData * */
-      /*@i@*/ (void) symHashTable_forcePut (ht, d);
-      return FALSE;
-    }
-}
-
-/*@null@*/ opInfo
-symtable_opInfo (symtable st, /*@notnull@*/ nameNode n)
-{
-  symHashTable *ht = st->hTable;
-  lsymbol i = nameNode2key (n);
-
-  htData *d;
-  d = symHashTable_get (ht, i, IK_OP, n);
-  if (d == (htData *) 0)
-    {
-      return (opInfo)NULL;
-    }
-
-  return (d->content.op);
-}
-
-/*@null@*/ tagInfo
-symtable_tagInfo (symtable st, lsymbol i)
-{
-  symHashTable *ht = st->hTable;
-  htData *d;
-  d = symHashTable_get (ht, i, IK_TAG, 0);
-
-  if (d == (htData *) 0)
-    {
-      return (tagInfo) NULL;
-    }
-
-  return (d->content.tag);
-}
-
-void
-  symtable_enterScope (symtable stable, scopeInfo si)
-{
-  idTable *st = stable->idTable;
-  idTableEntry *e = nextFree (st);
-  if (si->kind == SPE_GLOBAL)
-    llbuglit ("symtable_enterScope: SPE_GLOBAL");
-  e->kind = SYMK_SCOPE;
-  (e->info).scope = si;
-}
-
-void
-symtable_exitScope (symtable stable)
-{
-  idTable *st = stable->idTable;
-  int n;
-
-  if (st->entries != NULL)
-    {
-      for (n = st->size - 1; (st->entries[n]).kind != SYMK_SCOPE; n--)
-	{
-	  ;
-	}
-    }
-  else
-    {
-      llcontbuglit ("symtable_exitScope: no scope to exit");
-      n = 0;
-    }
-
-  st->size = n;
-}
-
-bool
-symtable_enterFct (symtable stable, fctInfo fi)
-{
-  idTable *st = stable->idTable;
-  idTableEntry *e;
-  bool redecl = FALSE;
-
-  if (!allowed_redeclaration &&
-      symtable_lookup (st, ltoken_getText (fi->id)) != (idTableEntry *) 0)
-    {
-      lclRedeclarationError (fi->id);
-      redecl = TRUE;
-    }
-  
-  e = nextFree (st);
-  e->kind = SYMK_FCN;
-  fi->export = st->exporting;	/* && !fi->private; */
-  (e->info).fct = fi;
-
-  return redecl;
-}
-
-void
-symtable_enterType (symtable stable, /*@only@*/ typeInfo ti)
-{
-  idTable *st = stable->idTable;
-  idTableEntry *e;
-  bool insertp = TRUE;
-  scopeKind k = (symtable_scopeInfo (stable))->kind;
-
-  /* symtable_disp (stable); */
-
-  if (k != SPE_GLOBAL && k != SPE_INVALID)	/* fixed for LCLint */
-    {
-      llbug (message ("%q: symtable_enterType: expect global scope. (type: %s)",
-		      ltoken_unparseLoc (ti->id),
-		      ltoken_getRawString (ti->id)));
-    }
-
-  if (!allowed_redeclaration &&
-      symtable_lookup (st, ltoken_getText (ti->id)) != (idTableEntry *) 0)
-    {
-     /* ignore if Bool is re-entered */
-      if (ltoken_getText (ti->id) == lsymbol_getBool () ||
-	  ltoken_getText (ti->id) == lsymbol_getbool ())
-	{
-	  insertp = FALSE;
-	}
-      else
-	{
-	  lclRedeclarationError (ti->id);
-	}
-    }
-  if (insertp)
-    {
-      /* make sure it is a type TYPEDEF_NAME; */
-      
-      if (ltoken_getCode (ti->id) != LLT_TYPEDEF_NAME)
-	{
-	  lclbug (message ("symtable_enterType: gets a simpleId, expect a type: %s",
-			   ltoken_getRawString (ti->id)));
-	}
-      
-      e = nextFree (st);
-      e->kind = SYMK_TYPE;
-      ti->export = st->exporting;/* && !ti->private; */
-      (e->info).type = ti;
-      mapping_bind (stable->type2sort, ltoken_getText (ti->id),
-		    sort_getLsymbol (sort_makeVal (sort_getUnderlying (ti->basedOn))));
-    }
-  else
-    {
-      typeInfo_free (ti);
-    }
-}
-
-lsymbol
-lsymbol_sortFromType (symtable s, lsymbol typename)
-{
-  lsymbol inter;
-  lsymbol out;
-  ltoken tok;
- /* check the synonym table first */
-  if (LCLIsSyn (typename))
-    {
-      tok = LCLGetTokenForSyn (typename);
-      inter = ltoken_getText (tok);
-     /*    printf ("In lsymbol_sortFromType: %s -> %s\n",
-                lsymbol_toChars (typename), lsymbol_toChars (inter)); */
-    }
-  else
-    {
-      inter = typename;
-    }
-
-  /* now map LCL type to sort */
-  out = mapping_find (s->type2sort, inter);
-  
-  if (out == lsymbol_undefined)
-    {
-      return inter;
-    }
-
-  return out;
-}
-
-/* really temp! */
-
-/*
-** returns true is vi is a redeclaration
-*/
-
-bool
-symtable_enterVar (symtable stable, /*@temp@*/ varInfo vi)
-{
-  idTable *st = stable->idTable;
-  bool insertp = TRUE;
-  bool redecl = FALSE;
-
-  
-  /* symtable_disp (symtab); */
-  
-  if (!allowed_redeclaration &&
-      (symtable_lookupInScope (st, ltoken_getText (vi->id)) != (idTableEntry *) 0))
-    {
-      if (ltoken_getText (vi->id) == lsymbol_getTRUE () ||
-	  ltoken_getText (vi->id) == lsymbol_getFALSE ())
-	{
-	  insertp = FALSE;
-	}
-      else
-	{
-	  if (usymtab_existsEither (ltoken_getRawString (vi->id)))
-	    {
-	      	      lclRedeclarationError (vi->id);
-	      redecl = TRUE;
-	    }
-	  else
-	    {
-	      llbuglit ("redeclared somethingerother?!");
-	    }
-	}
-    }
-
-  if (insertp)
-    {
-      idTableEntry *e = nextFree (st);
-
-      e->kind = SYMK_VAR;
-      vi->export = st->exporting &&	/* !vi.private && */
-	(vi->kind == VRK_VAR || vi->kind == VRK_CONST || vi->kind == VRK_ENUM);
-      (e->info).var = varInfo_copy (vi);
-    }
-  
-    return (redecl);
-}
-
-bool
-symtable_exists (symtable stable, lsymbol i)
-{
-  idTable *st = stable->idTable;
-  return symtable_lookup (st, i) != (idTableEntry *) 0;
-}
-
-/*@null@*/ typeInfo
-symtable_typeInfo (symtable stable, lsymbol i)
-{
-  idTable *st;
-  idTableEntry *e;
-
-  st = stable->idTable;
-  e = symtable_lookup (st, i);
-
-  if (e == (idTableEntry *) 0 || e->kind != SYMK_TYPE)
-    {
-      return (typeInfo) NULL;
-    }
-
-  return (e->info).type;
-}
-
-/*@null@*/ varInfo
-symtable_varInfo (symtable stable, lsymbol i)
-{
-  idTable *st = stable->idTable;
-  idTableEntry *e;
-
-  e = symtable_lookup (st, i);
-
-  if (e == (idTableEntry *) 0 || e->kind != SYMK_VAR)
-    {
-      return (varInfo) NULL;
-    }
-
-  return (e->info).var;
-}
-
-/*@null@*/ varInfo
-symtable_varInfoInScope (symtable stable, lsymbol id)
-{
-  /* if current scope is a SPE_QUANT, can go beyond current scope */
-  idTable *st = stable->idTable;
-  idTableEntry *e2 = (idTableEntry *) 0;
-  int n;
-  
-  for (n = st->size - 1; n >= 0; n--)
-    {
-      ltoken tok;
-
-      e2 = &(st->entries[n]);
-      
-      if (e2->kind == SYMK_SCOPE && e2->info.scope->kind != SPE_QUANT)
-	{
-	  return (varInfo) NULL;
-	}
-
-      tok = idTableEntry_getId (e2);
-
-      if (e2->kind == SYMK_VAR && ltoken_getText (tok) == id)
-	{
-	  return (e2->info).var;
-	}
-    }
-
-  return (varInfo) NULL;
-}
-
-scopeInfo
-symtable_scopeInfo (symtable stable)
-{
-  idTable *st = stable->idTable;
-  int n;
-  idTableEntry *e;
-
-  for (n = st->size - 1; n >= 0; n--)
-    {
-      e = &(st->entries[n]);
-      if (e->kind == SYMK_SCOPE)
-	return (e->info).scope;
-    }
-
-  lclfatalbug ("symtable_scopeInfo: not found");
-  BADEXIT;
-}
-
-void
-symtable_export (symtable stable, bool yesNo)
-{
-  idTable *st = stable->idTable;
-  st->exporting = yesNo;
-  (void) sort_setExporting (yesNo);
-}
-
-static void
-symHashTable_dump (symHashTable * t, FILE * f, bool lco)
-{
-  /* like symHashTable_dump2 but for output to .lcs file */
-  int i, size;
-  bucket *b;
-  htEntry *entry;
-  htData *d;
-  ltoken tok;
-  sigNodeSet sigs;
-  
-  for (i = 0; i <= HT_MAXINDEX; i++)
-    {
-            b = t->buckets[i];
-
-      for (entry = b; entry != NULL; entry = entry->next)
-	{
-	  d = entry->data;
-
-	  switch (d->kind)
-	    {
-	    case IK_SORT:
-	      /*@switchbreak@*/ break;
-	    case IK_OP:
-	      {
-		char *name = cstring_toCharsSafe (nameNode_unparse (d->content.op->name));
-		sigs = d->content.op->signatures;
-		size = sigNodeSet_size (sigs);
-
-		
-		sigNodeSet_elements (sigs, x)
-		  {
-		    cstring s = sigNode_unparse (x);
-
-		    if (lco)
-		      {
-			fprintf (f, "%%LCL");
-		      }
-
-		    fprintf (f, "op %s %s\n", name, cstring_toCharsSafe (s));
-		    cstring_free (s);
-		  } end_sigNodeSet_elements;
-
-		sfree (name);
-		/*@switchbreak@*/ break;
-	      }
-	    case IK_TAG:
-	      tok = d->content.tag->id;
-	      
-	      if (!ltoken_isUndefined (tok))
-		{
-		  cstring s = tagKind_unparse (d->content.tag->kind);
-
-		  if (lco)
-		    {
-		      fprintf (f, "%%LCL");
-		    }
-
-		  fprintf (f, "tag %s %s\n", ltoken_getTextChars (tok), 
-			   cstring_toCharsSafe (s));
-		  cstring_free (s);
-		}
-	      /*@switchbreak@*/ break;
-	    }
-	}
-    }
-}
-
-void
-symtable_dump (symtable stable, FILE * f, bool lco)
-{
-  symHashTable *ht = stable->hTable;
-
-
-  fprintf (f, "%s\n", BEGINSYMTABLE);
-   
-  symHashTable_dump (ht, f, lco);
-   
-  symtable_dumpId (stable, f, lco);
-  
-  fprintf (f, "%s\n", SYMTABLEEND);
-  }
-
-lsymbol
-lsymbol_translateSort (mapping * m, lsymbol s)
-{
-  lsymbol res = mapping_find (m, s);
-  if (res == lsymbol_undefined)
-    return s;
-  return res;
-}
-
-static /*@null@*/ lslOp
-  lslOp_renameSorts (mapping *map,/*@returned@*/ /*@null@*/ lslOp op)
-{
-  sigNode sign;
-
-  if (op != (lslOp) 0)
-    {
-      ltokenList domain;
-      ltoken range;
-
-      sign = op->signature;
-      range = sign->range;
-      domain = sign->domain;
-
-      ltokenList_elements (domain, dt)
-	{
-	  ltoken_setText (dt, 
-			  lsymbol_translateSort (map, ltoken_getText (dt)));
-	} end_ltokenList_elements;
-
-      /*@-onlytrans@*/ /* A memory leak... */
-      op->signature = makesigNode (sign->tok, domain, range);
-      /*@=onlytrans@*/
-    }
-
-  return op;
-}
-
-static /*@null@*/ signNode
-  signNode_fromsigNode (sigNode s)
-{
-  signNode sign;
-  sortList slist;
-  
-  if (s == (sigNode) 0)
-    {
-      return (signNode) 0;
-    }
-  
-  sign = (signNode) dmalloc (sizeof (*sign));
-  slist = sortList_new ();
-  sign->tok = ltoken_copy (s->tok);
-  sign->key = s->key;
-  sign->range = sort_makeSort (ltoken_undefined, ltoken_getText (s->range));
-
-  ltokenList_elements (s->domain, dt)
-    {
-      sortList_addh (slist, sort_makeSort (ltoken_undefined, ltoken_getText (dt)));
-    } end_ltokenList_elements;
-
-  sign->domain = slist;
-  return sign;
-}
-
-
-/**  2.4.3 ymtan  93.09.23  -- fixed bug in parseGlobals: removed ";" at the
- **                            end of pairNode (gstr).
- */
-
-static /*@only@*/ pairNodeList
-parseGlobals (char *line, tsource *srce)
-{
-  pairNodeList plist = pairNodeList_new ();
-  pairNode p;
-  int semi_index;
-  char *lineptr, sostr[MAXBUFFLEN], gstr[MAXBUFFLEN];
-
-  /* line is not all blank */
-  /* expected format: "sort1 g1; sort2 g2; sort3 g3;" */
-  lineptr = line;
-  
-  while (!isBlankLine (lineptr))
-    {
-      if (sscanf (lineptr, "%s %s", &(sostr[0]), gstr) != 2)
-	{
-	  lclplainerror 
-	    (message 
-	     ("%q: Imported file contains illegal function global declaration.\n"
-	      "Skipping rest of the line: %s (%s)",
-	      fileloc_unparseRaw (cstring_fromChars (tsource_fileName (srce)), 
-				  tsource_thisLineNumber (srce)), 
-	      cstring_fromChars (line), 
-	      cstring_fromChars (lineptr)));
-	  return plist;
-	}
-      
-      p = (pairNode) dmalloc (sizeof (*p));
-      
-      /* Note: remove the ";" separator at the end of gstr */
-      semi_index = size_toInt (strlen (gstr));
-      gstr[semi_index - 1] = '\0';
-
-      p->tok = ltoken_create (NOTTOKEN, lsymbol_fromChars (gstr));
-      p->sort = sort_makeSort (ltoken_undefined, lsymbol_fromChars (sostr));
-
-      pairNodeList_addh (plist, p);
-      lineptr = strchr (lineptr, ';');	/* go pass the next; */
-
-      llassert (lineptr != NULL);
-      lineptr = lineptr + 1;
-    }
-
-  return plist;
-}
-
-static bool
-isBlankLine (char *line)
-{
-  int i;
-
-  if (line == NULL) return TRUE;
-
-  for (i = 0; line[i] != '\0'; i++)
-    {
-      if (line[i] == ' ')
-	continue;
-      if (line[i] == '\t')
-	continue;
-      if (line[i] == '\n')
-	return TRUE;
-      return FALSE;
-    }
-  return TRUE;
-}
-
-typedef /*@only@*/ fctInfo o_fctInfo;
-
-static void
-parseLine (char *line, tsource *srce, mapping * map)
-{
-  static /*@owned@*/ o_fctInfo *savedFcn = NULL;
-  char *lineptr, *lineptr2, *cimportfile = tsource_fileName (srce);
-  cstring importfile = cstring_fromChars (cimportfile);
-  char namestr[MAXBUFFLEN], kstr[20], sostr[MAXBUFFLEN];
-  sort bsort, nullSort = sort_makeNoSort ();
-  int col = 0;
-  fileloc imploc = fileloc_undefined;
-
-  
-  if (inImport)
-    {
-      imploc = fileloc_createImport (importfile, tsource_thisLineNumber (srce));
-    }
-  
-  if (firstWord (line, "op"))
-    {
-      lslOp op;
-
-      lineptr = strchr (line, 'o');	/* remove any leading blanks */
-      llassert (lineptr != NULL);
-      lineptr = strchr (lineptr, ' ');	/* go past "op" */
-      llassert (lineptr != NULL);
-
-      /* add a newline to the end of the line since parseOpLine expects it */
-      lineptr2 = strchr (lineptr, '\0');
-
-      if (lineptr2 != 0)
-	{
-	  *lineptr2 = '\n';
-	  *(lineptr2 + 1) = '\0';
-	}
-
-      llassert (cimportfile != NULL);
-      op = parseOpLine (cimportfile, lineptr + 1);
-      
-      if (op == (lslOp) 0)
-	{
-	  lclplainerror
-	    (message
-	     ("%q: Imported file contains illegal operator declaration:\n "
-	      "skipping this line: %s",
-	      fileloc_unparseRaw (importfile, tsource_thisLineNumber (srce)), 
-	      cstring_fromChars (line)));
-	  fileloc_free (imploc);
-	  return;
-	}
-
-            op = lslOp_renameSorts (map, op);
-
-      llassert (op != NULL);
-      llassert (op->name != NULL);
-
-      symtable_enterOp (g_symtab, op->name, 
-			sigNode_copy (op->signature));
-          /*@-mustfree@*/ } /*@=mustfree@*/
-  else if (firstWord (line, "type"))
-    {
-      typeInfo ti;
-
-      if (sscanf (line, "type %s %s %s", namestr, sostr, kstr) != 3)
-	{
-	  lclplainerror 
-	    (message ("%q: illegal type declaration:\n skipping this line: %s",
-		      fileloc_unparseRaw (importfile, tsource_thisLineNumber (srce)), 
-		      cstring_fromChars (line)));
-	  fileloc_free (imploc);
-	  return;
-	}
-      
-      ti = (typeInfo) dmalloc (sizeof (*ti));
-      ti->id = ltoken_createFull (LLT_TYPEDEF_NAME, lsymbol_fromChars (namestr),
-				    importfile, tsource_thisLineNumber (srce), col);
-
-      bsort = sort_lookupName (lsymbol_translateSort (map, lsymbol_fromChars (sostr)));
-
-      if (sort_isNoSort (bsort))
-	{
-	  lineptr = strchr (line, ' ');	/* go past "type" */
-	  llassert (lineptr != NULL);
-	  lineptr = strchr (lineptr + 1, ' ');	/* go past namestr */
-	  llassert (lineptr != NULL);
-	  col = 5 + lineptr - line;	/* 5 for initial "%LCL "*/
-
-	  lclbug (message ("%q: Imported files contains unknown base sort",
-			   fileloc_unparseRawCol (importfile, tsource_thisLineNumber (srce), col)));
-
-	  bsort = nullSort;
-	}
-      ti->basedOn = bsort;
-
-      if (strcmp (kstr, "exposed") == 0)
-	{
-	  ti->abstract = FALSE;
-	  ti->modifiable = TRUE;
-	}
-      else
-	{
-	  ti->abstract = TRUE;
-	  if (strcmp (kstr, "mutable") == 0)
-	    ti->modifiable = TRUE;
-	  else
-	    ti->modifiable = FALSE;
-	}
-      ti->export = TRUE;
-      
-      /* 
-      ** sort of a hack to get imports to work...
-      */
-      
-      if (inImport)
-	{
-	  cstring cnamestr = cstring_fromChars (namestr);
-
-	  if (!usymtab_existsGlobEither (cnamestr))
-	    {
-	      (void) usymtab_addEntry 
-		(uentry_makeDatatype (cnamestr, ctype_unknown,
-				      ti->abstract ? ynm_fromBool (ti->modifiable) : MAYBE,
-				      ti->abstract ? YES : NO,
-				      fileloc_copy (imploc)));
-	    }
-	}
-
-      symtable_enterType (g_symtab, ti);
-    }
-  else if (firstWord (line, "var"))
-    {
-      varInfo vi;
-
-      if (sscanf (line, "var %s %s", namestr, sostr) != 2)
-	{
-	  lclplainerror
-	    (message ("%q: Imported file contains illegal variable declaration.  "
-		      "Skipping this line.", 
-		      fileloc_unparseRaw (importfile, tsource_thisLineNumber (srce))));
-	  fileloc_free (imploc);
-	  return;
-	}
-
-      vi = (varInfo) dmalloc (sizeof (*vi));
-      bsort = sort_lookupName (lsymbol_translateSort (map, lsymbol_fromChars (sostr)));
-      lineptr = strchr (line, ' ');	/* go past "var" */
-      llassert (lineptr != NULL);
-      lineptr = strchr (lineptr + 1, ' ');	/* go past namestr */
-      llassert (lineptr != NULL);
-      col = 5 + lineptr - line;	/* 5 for initial "%LCL "*/
-
-      if (sort_isNoSort (bsort))
-	{
-	  lclplainerror (message ("%q: Imported file contains unknown base sort",
-				  fileloc_unparseRawCol (importfile, tsource_thisLineNumber (srce), col)));
-	  bsort = nullSort;
-	}
-
-      vi->id = ltoken_createFull (simpleId, lsymbol_fromChars (namestr),
-				  importfile, tsource_thisLineNumber (srce), col);
-      vi->sort = bsort;
-      vi->kind = VRK_VAR;
-      vi->export = TRUE;
-      (void) symtable_enterVar (g_symtab, vi);
-      varInfo_free (vi);
-
-      if (inImport)
-	{
-	  cstring cnamestr = cstring_fromChars (namestr);
-
-	  if (!usymtab_existsGlobEither (cnamestr))
-	    {
-	      
-	      (void) usymtab_supEntrySref 
-		(uentry_makeVariable (cnamestr, ctype_unknown, 
-				      fileloc_copy (imploc), 
-				      FALSE));
-	    }
-	}
-    }
-  else if (firstWord (line, "const"))
-    {
-      varInfo vi;
-
-      if (sscanf (line, "const %s %s", namestr, sostr) != 2)
-	{
-	  lclbug (message ("%q: Imported file contains illegal constant declaration: %s",
-			   fileloc_unparseRaw (importfile, tsource_thisLineNumber (srce)), 
-			   cstring_fromChars (line)));
-	  fileloc_free (imploc);
-	  return;
-	}
-
-      vi = (varInfo) dmalloc (sizeof (*vi));
-      bsort = sort_lookupName (lsymbol_translateSort (map, lsymbol_fromChars (sostr)));
-      lineptr = strchr (line, ' ');	/* go past "var" */
-      llassert (lineptr != NULL);
-      lineptr = strchr (lineptr + 1, ' ');	/* go past namestr */
-      llassert (lineptr != NULL);
-      
-      col = 5 + lineptr - line;	/* 5 for initial "%LCL "*/
-
-      if (sort_isNoSort (bsort))
-	{
-	  lclplainerror (message ("%q: Imported file contains unknown base sort",
-				  fileloc_unparseRawCol (importfile, tsource_thisLineNumber (srce), col)));
-	  bsort = nullSort;
-	}
-
-      vi->id = ltoken_createFull (simpleId, lsymbol_fromChars (namestr),
-				    importfile, tsource_thisLineNumber (srce), col);
-      vi->sort = bsort;
-      vi->kind = VRK_CONST;
-      vi->export = TRUE;
-      (void) symtable_enterVar (g_symtab, vi);
-      varInfo_free (vi);
-      
-      if (inImport)
-	{
-	  cstring cnamestr = cstring_fromChars (namestr);
-	  
-	  if (!usymtab_existsGlobEither (cnamestr))
-	    {
-	      	      
-	      (void) usymtab_addEntry (uentry_makeConstant (cnamestr,
-							    ctype_unknown,
-							    fileloc_copy (imploc)));
-	    }
-	}
-      /* must check for "fcnGlobals" before "fcn" */
-    }
-  else if (firstWord (line, "fcnGlobals"))
-    {
-      pairNodeList globals;
-      lineptr = strchr (line, 'f');	/* remove any leading blanks */
-      llassert (lineptr != NULL);
-      lineptr = strchr (lineptr, ' ');	/* go past "fcnGlobals" */
-      llassert (lineptr != NULL);
-
-     /* a quick check for empty fcnGlobals */
-      if (!isBlankLine (lineptr))
-	{
-	  globals = parseGlobals (lineptr, srce);
-	  /* should ensure that each global in an imported function
-	     corresponds to some existing global.  Since only
-	     "correctly processed" .lcs files are imported, this is
-	     true as an invariant. */
-	}
-      else
-	{
-	  globals = pairNodeList_new ();
-	}
-      
-      /* check that they exist, store them on fctInfo */
-
-      if (savedFcn != NULL)
-	{
-	  pairNodeList_free ((*savedFcn)->globals);
-	  (*savedFcn)->globals = globals;  /* evs, moved inside if predicate */
-
-	  (void) symtable_enterFct (g_symtab, *savedFcn);
-	  savedFcn = NULL;
-	}
-      else
-	{
-	  lclplainerror 
-	    (message ("%q: Unexpected function globals.  "
-		      "Skipping this line: \n%s",
-		      fileloc_unparseRaw (importfile, tsource_thisLineNumber (srce)), 
-		      cstring_fromChars (line)));
-	  savedFcn = NULL;
-	  pairNodeList_free (globals);
-	}
-    }
-  else if (firstWord (line, "fcn"))
-    {
-      lslOp op;
-      lslOp op2; 
-
-      if (savedFcn != (fctInfo *) 0)
-	{
-	  lclplainerror 
-	    (message ("%q: illegal function declaration.  Skipping this line:\n%s",
-		      fileloc_unparseRaw (importfile, tsource_thisLineNumber (srce)), 
-		      cstring_fromChars (line)));
-	  fileloc_free (imploc);
-	  return;
-	}
-
-      savedFcn = (fctInfo *) dmalloc (sizeof (*savedFcn));
-
-      lineptr = strchr (line, 'f');	/* remove any leading blanks */
-      llassert (lineptr != NULL);
-      lineptr = strchr (lineptr, ' ');	/* go past "fcn" */
-      llassert (lineptr != NULL);
-
-      /* add a newline to the end of the line since parseOpLine expects it */
-
-      lineptr2 = strchr (lineptr, '\0');
-
-      if (lineptr2 != 0)
-	{
-	  *lineptr2 = '\n';
-	  *(lineptr2 + 1) = '\0';
-	}
-
-      op = parseOpLine (cimportfile, lineptr + 1);
-
-      if (op == (lslOp) 0)
-	{
-	  lclplainerror (message ("%q: illegal function declaration: %s",
-				  fileloc_unparseRaw (importfile, tsource_thisLineNumber (srce)), 
-				  cstring_fromChars (line)));
-	  fileloc_free (imploc);
-	  return;
-	}
-	
-      op2 = lslOp_renameSorts (map, op);
-
-      llassert (op2 != NULL);
-
-      if ((op->name != NULL) && op->name->isOpId)
-	{
-	  (*savedFcn) = (fctInfo) dmalloc (sizeof (**savedFcn));
-	  (*savedFcn)->id = op->name->content.opid;
-	  (*savedFcn)->signature = signNode_fromsigNode (op2->signature);
-	  (*savedFcn)->globals = pairNodeList_new ();
-	  (*savedFcn)->export = TRUE;
-	  
-	  if (inImport)
-	    {
-	      /* 27 Jan 1995 --- added this to be undefined namestr bug */
-	      cstring fname = ltoken_unparse ((*savedFcn)->id);
-	      
-	      if (!usymtab_existsGlobEither (fname))
-		{
-		  		  (void) usymtab_addEntry (uentry_makeFunction
-					   (fname, ctype_unknown, 
-					    typeId_invalid, globSet_new (),
-					    sRefSet_undefined, 
-					    fileloc_copy (imploc)));
-		}
-	    }
-	}
-      else
-	{
-	  lclplainerror (message ("%q: unexpected function name: %s",
-				  fileloc_unparseRaw (importfile, tsource_thisLineNumber (srce)), 
-				  cstring_fromChars (line)));
-	}
-    }
-  else if (firstWord (line, "enumConst"))
-    {
-      varInfo vi;
-
-      if (sscanf (line, "enumConst %s %s", namestr, sostr) != 2)
-	{
-	  lclplainerror 
-	    (message ("%q: Illegal enum constant declaration.  "
-		      "Skipping this line:\n%s",
-		      fileloc_unparseRaw (importfile, tsource_thisLineNumber (srce)), 
-		      cstring_fromChars (line)));
-	  fileloc_free (imploc);
-	  return;
-	}
-      
-      vi = (varInfo) dmalloc (sizeof (*vi));
-      bsort = sort_lookupName (lsymbol_translateSort (map, lsymbol_fromChars (sostr)));
-      lineptr = strchr (line, ' ');	/* go past "var" */
-      llassert (lineptr != NULL);
-      lineptr = strchr (lineptr + 1, ' ');	/* go past namestr */
-      llassert (lineptr != NULL);
-
-      col = 5 + lineptr - line;	/* 5 for initial "%LCL "*/
-      if (sort_isNoSort (bsort))
-	{
-	  lclplainerror (message ("%q: unknown base sort\n",
-				  fileloc_unparseRawCol (importfile, tsource_thisLineNumber (srce), col)));
-	  bsort = nullSort;
-	}
-
-      vi->id = ltoken_createFull (simpleId, lsymbol_fromChars (namestr),
-				    importfile, tsource_thisLineNumber (srce), col);
-			
-      vi->sort = bsort;
-      vi->kind = VRK_ENUM;
-      vi->export = TRUE;
-      (void) symtable_enterVar (g_symtab, vi);
-      varInfo_free (vi);
-
-      if (inImport)
-	{
-	  cstring cnamestr = cstring_fromChars (namestr);
-	  if (!usymtab_existsEither (cnamestr))
-	    {
-	      	      (void) usymtab_addEntry (uentry_makeConstant (cnamestr, ctype_unknown,
-							    fileloc_copy (imploc)));
-	    }
-	}
-    }
-  else if (firstWord (line, "tag"))
-    {
-     /* do nothing, sort processing already handles this */
-    }
-  else
-    {
-      lclplainerror 
-	(message ("%q: Unknown symbol declaration.  Skipping this line:\n%s",
-		  fileloc_unparseRaw (importfile, tsource_thisLineNumber (srce)), 
-		  cstring_fromChars (line)));
-    }
-
-    fileloc_free (imploc);
-}
-
-void
-symtable_import (tsource *imported, ltoken tok, mapping * map)
-{
-  char *buf, *importfile;
-  tsource *lclsource;
-  int old_lsldebug;
-  bool old_inImport = inImport;
-
-  buf = tsource_nextLine (imported);
-  importfile = tsource_fileName (imported);
-
-  llassert (buf != NULL);
-
-  if (!firstWord (buf, "%LCLSymbolTable"))
-    {
-      lclsource = LCLScanSource ();
-      lclfatalerror (tok, 
-		     message ("Expecting '%%LCLSymbolTable' line in import file %s:\n%s\n",
-			      cstring_fromChars (importfile), 
-			      cstring_fromChars (buf)));
-    }
-
-  old_lsldebug = lsldebug;
-  lsldebug = 0;
-  allowed_redeclaration = TRUE;
-  inImport = TRUE;
-
-  for (;;)
-    {
-      buf = tsource_nextLine (imported);
-      llassert (buf != NULL);
-
-      
-      if (firstWord (buf, "%LCLSymbolTableEnd"))
-	{
-	  break;
-	}
-      else
-	{			/* a good line, remove %LCL from line first */
-	  if (firstWord (buf, "%LCL"))
-	    {
-	      parseLine (buf + 4, imported, map);
-	    }
-	  else
-	    {
-	      lclsource = LCLScanSource ();
-	      lclfatalerror 
-		(tok,
-		 message ("Expecting '%%LCL' prefix in import file %s:\n%s\n",
-			  cstring_fromChars (importfile), 
-			  cstring_fromChars (buf)));
-	    }
-	}
-    }
-
-  /* restore old value */
-  inImport = old_inImport;
-  lsldebug = old_lsldebug;
-  allowed_redeclaration = FALSE;
-  }
-
-static void
-symtable_dumpId (symtable stable, FILE *f, bool lco)
-{
-  idTable *st = stable->idTable;
-  unsigned int i;
-  idTableEntry *se;
-  fctInfo fi;
-  typeInfo ti;
-  varInfo vi;
-
-  for (i = 1; i < st->size; i++)
-    {
-      /* 2/22/93 I think there is a off-by-1 error, 0 entry is never used */
-      se = st->entries + i;
-      llassert (se != NULL);
-      
-      
-      /*@-loopswitchbreak@*/
-      switch (se->kind)
-	{
-	case SYMK_FCN:
-	  {
-	    cstring tmp;
-	    
-	    fi = (se->info).fct;
-	    
-	    if (lco)
-	      {
-		fprintf (f, "%%LCL");
-	      }
-
-	    if (!lco && !fi->export)
-	      {
-		fprintf (f, "spec ");
-	      }
-	    
-	    tmp = signNode_unparse (fi->signature);
-	    fprintf (f, "fcn %s %s \n", ltoken_getTextChars (fi->id), 
-		     cstring_toCharsSafe (tmp));
-	    cstring_free (tmp);
-	    
-	    tmp = pairNodeList_unparse (fi->globals);
-	    fprintf (f, "%%LCLfcnGlobals %s\n", cstring_toCharsSafe (tmp));
-	    cstring_free (tmp);
-	    break;
-	  }
-	case SYMK_SCOPE:
-	  if (lco)
-	    {
-	      break;
-	    }
-
-	  /*@-switchswitchbreak@*/
-	  switch ((se->info).scope->kind)
-	    {
-	    case SPE_GLOBAL:
-	      fprintf (f, "Global scope\n");
-	      break;
-	    case SPE_ABSTRACT:
-	      fprintf (f, "Abstract type scope\n");
-	      break;
-	    case SPE_FCN:
-	      fprintf (f, "Function scope\n");
-	      break;
-	     /* a let scope can only occur in a function scope, should not push
-                a new scope, so symtable_lookupInScope works properly
-                   case letScope:
-	             fprintf (f, "Let scope\n");
-	             break; */
-	    case SPE_QUANT:
-	      fprintf (f, "Quantifier scope\n");
-	      break;
-	    case SPE_CLAIM:
-	      fprintf (f, "Claim scope\n");
-	      break;
-	    case SPE_INVALID:
-	      break;
-	    }
-	  break;
-	case SYMK_TYPE:
-	  ti = (se->info).type;
-	  if (lco)
-	    fprintf (f, "%%LCL");
-	  if (!lco && !ti->export)
-	    fprintf (f, "spec ");
-	  fprintf (f, "type %s %s",
-		   ltoken_getTextChars (ti->id), sort_getName (ti->basedOn));
-	  if (ti->abstract)
-	    {
-	      if (ti->modifiable)
-		fprintf (f, " mutable\n");
-	      else
-		fprintf (f, " immutable\n");
-	    }
-	  else
-	    fprintf (f, " exposed\n");
-	  break;
-	case SYMK_VAR:
-
-	  vi = (se->info).var;
-	  if (lco)
-	    {
-	      fprintf (f, "%%LCL");
-	    }
-
-	  if (!lco && !vi->export)
-	    {
-	      fprintf (f, "spec ");
-	    }
-	  switch (vi->kind)
-	    {
-	    case VRK_CONST:
-	      fprintf (f, "const %s %s\n",
-		       ltoken_getTextChars (vi->id), sort_getName (vi->sort));
-	      break;
-	    case VRK_VAR:
-	      fprintf (f, "var %s %s\n",
-		       ltoken_getTextChars (vi->id), sort_getName (vi->sort));
-	      break;
-	    case VRK_ENUM:
-	      fprintf (f, "enumConst %s %s\n",
-		       ltoken_getTextChars (vi->id), sort_getName (vi->sort));
-	      break;
-	    default:
-	      if (lco)
-		{
-		  switch (vi->kind)
-		    {
-		    case VRK_GLOBAL:
-		      fprintf (f, "global %s %s\n", ltoken_getTextChars (vi->id), sort_getName (vi->sort));
-		      break;
-		    case VRK_PRIVATE:	/* for private vars within function */
-		      fprintf (f, "local %s %s\n",
-			       ltoken_getTextChars (vi->id), sort_getName (vi->sort));
-		      break;
-		    case VRK_LET:
-		      fprintf (f, "let %s %s\n",
-			       ltoken_getTextChars (vi->id), sort_getName (vi->sort));
-		      break;
-		    case VRK_PARAM:
-		      fprintf (f, "param %s %s\n",
-			       ltoken_getTextChars (vi->id), sort_getName (vi->sort));
-		      break;
-		    case VRK_QUANT:
-		      fprintf (f, "quant %s %s\n",
-			       ltoken_getTextChars (vi->id), sort_getName (vi->sort));
-		      break;
-		    BADDEFAULT;
-		    }
-		  /*@=loopswitchbreak@*/
-		  /*@=switchswitchbreak@*/
-		}
-	    }
-	}
-    }
-}
-
-static /*@exposed@*/ /*@out@*/ idTableEntry *
-nextFree (idTable * st)
-{
-  idTableEntry *ret;
-  unsigned int n = st->size;
-
-  if (n >= st->allocated)
-    {
-      /*
-      ** this loses with the garbage collector
-      ** (and realloc is notoriously dangerous)
-      **
-      ** st->entries = (idTableEntry *) LSLMoreMem (st->entries, (n + DELTA) 
-      **                                * sizeof (idTableEntry));
-      **
-      ** instead, we copy the symtable...
-      */
-      
-      idTableEntry *oldentries = st->entries;
-      unsigned int i;
-      
-      st->entries = dmalloc ((n+DELTA) * sizeof (*st->entries));
-      
-      for (i = 0; i < n; i++)
-	{
-	  st->entries[i] = oldentries[i];
-	}
-      
-      sfree (oldentries);
-      
-      st->allocated = n + DELTA;
-    }
-  
-  ret = &(st->entries[st->size]);
-  st->size++;
-  return ret;
-}
-
-
-static /*@dependent@*/ /*@null@*/ idTableEntry *
-  symtable_lookup (idTable *st, lsymbol id)
-{
-  int n;
-  idTableEntry *e;
-
-  for (n = st->size - 1; n >= 0; n--)
-    {
-      e = &(st->entries[n]);
-
-      /*@-loopswitchbreak@*/
-      switch (e->kind)
-	{
-	case SYMK_SCOPE: 
-	  break;
-	case SYMK_FCN:
-	  if (ltoken_getText (e->info.fct->id) == id) return e;
-	  break;
-	case SYMK_TYPE:
-	  if (ltoken_getText (e->info.type->id) == id) return e;
-	  break;
-	case SYMK_VAR:
-	  if (ltoken_getText (e->info.var->id) == id) return e;
-	  break;
-	BADDEFAULT;
-	}
-      /*@=loopswitchbreak@*/
-    }
-
-  return (idTableEntry *) 0;
-}
-
-
-static /*@dependent@*/ /*@null@*/ idTableEntry *
-  symtable_lookupInScope (idTable *st, lsymbol id)
-{
-  int n;
-  idTableEntry *e;
-  for (n = st->size - 1; n >= 0; n--)
-    {
-      e = &(st->entries[n]);
-      if (e->kind == SYMK_SCOPE)
-	break;
-      if (ltoken_getText (e->info.fct->id) == id)
-	{
-	  return e;
-	}
-    }
-  return (idTableEntry *) 0;
-}
-
-/* hash table implementation */
-
-static symbolKey
-htData_key (htData * x)
-{
-  /* assume x points to a valid htData struct */
-  switch (x->kind)
-    {
-    case IK_SORT:
-      return x->content.sort;
-    case IK_OP:
-      {				/* get the textSym of the token */
-	nameNode n = (x->content.op)->name;
-
-	if (n->isOpId)
-	  {
-	    return ltoken_getText (n->content.opid);
-	  }
-	else
-	  {
-	    llassert (n->content.opform != NULL);
-	    return (n->content.opform)->key;
-	  }
-      }
-    case IK_TAG:
-      return ltoken_getText ((x->content).tag->id);
-    }
-  BADEXIT;
-}
-
-static void htData_free (/*@null@*/ /*@only@*/ htData *d)
-{
-  if (d != NULL)
-    {
-      switch (d->kind)
-	{
-	case IK_SORT:
-	  break;
-	case IK_OP:
-	  /* nameNode_free (d->content.op->name);*/
-	  sigNodeSet_free (d->content.op->signatures);
-	  break;
-	case IK_TAG:
-	  {
-	    switch (d->content.tag->kind)
-	      {
-	      case TAG_STRUCT:
-	      case TAG_UNION:
-	      case TAG_FWDSTRUCT:
-	      case TAG_FWDUNION:
-		/*
-		 ** no: stDeclNodeList_free (d->content.tag->content.decls);
-		 **     it is dependent!
-		 */
-		/*@switchbreak@*/ break;
-	      case TAG_ENUM:
-		
-		/* no: ltokenList_free (d->content.tag->content.enums);
-		 **     it is dependent!
-		 */
-		
-		/*@switchbreak@*/ break;
-	      }
-	  }
-	}
-      
-      sfree (d);
-    }
-}
-
-static void bucket_free (/*@null@*/ /*@only@*/ bucket *b)
-{
-  if (b != NULL)
-    {
-      bucket_free (b->next);
-      htData_free (b->data);
-      sfree (b);
-    }
-}
-
-static void symHashTable_free (/*@only@*/ symHashTable *h)
-{
-  unsigned int i;
-
-  for (i = 0; i < h->size; i++)
-    {
-      bucket_free (h->buckets[i]);
-    }
-
-  sfree (h->buckets);
-  sfree (h);
-}      
-      
-static /*@only@*/ symHashTable *
-symHashTable_create (unsigned int size)
-{
-  unsigned int i;
-  symHashTable *t = (symHashTable *) dmalloc (sizeof (*t));
-  
-  t->buckets = (bucket **) dmalloc ((size + 1) * sizeof (*t->buckets));
-  t->count = 0;
-  t->size = size;
-
-  for (i = 0; i <= size; i++)
-    {
-      t->buckets[i] = (bucket *) NULL;
-    }
-
-  return t;
-}
-
-static /*@null@*/ /*@exposed@*/ htData *
-symHashTable_get (symHashTable *t, symbolKey key, infoKind kind, /*@null@*/ nameNode n)
-{
-  bucket *b;
-  htEntry *entry;
-  htData *d;
-
-  b = t->buckets[MASH (key, kind)];
-  if (b == (bucket *) 0)
-    {
-      return ((htData *) 0);
-    }
-  
-  for (entry = (htEntry *) b; entry != NULL; entry = entry->next)
-    {
-      d = entry->data;
-
-      if (d->kind == kind && htData_key (d) == key)
-	if (kind != IK_OP || sameNameNode (n, d->content.op->name))
-	  {
-	    return d;
-	  }
-    }
-  return ((htData *) 0);
-}
-
-static bool
-symHashTable_put (symHashTable *t, /*@only@*/ htData *data)
-{
-  /* if key is already taken, don't insert, return FALSE
-     else insert it and return TRUE. */
-  symbolKey key;
-  htData *oldd;
-  infoKind kind;
-  nameNode name;
-
-  key = htData_key (data);
-  kind = data->kind;
-
-  if (kind == IK_OP && (!data->content.op->name->isOpId))
-    {
-      name = data->content.op->name;
-    }
-  else
-    {
-      name = (nameNode) 0;
-    }
-  
-  oldd = symHashTable_get (t, key, kind, name);
-
-  if (oldd == (htData *) 0)
-    {
-      /*@-deparrays@*/
-      bucket *new_entry = (bucket *) dmalloc (sizeof (*new_entry));
-      bucket *b = (t->buckets[MASH (key, kind)]);
-      htEntry *entry = (htEntry *) b;
-      /*@=deparrays@*/
-
-      new_entry->data = data;
-      new_entry->next = entry;
-      t->buckets[MASH (key, kind)] = new_entry;
-      t->count++;
-
-      return TRUE;
-    }
-  else
-    {
-      htData_free (data);
-    }
-
-  return FALSE;
-}
-
-static /*@only@*/ /*@exposed@*/ /*@null@*/ htData *
-  symHashTable_forcePut (symHashTable *t, /*@only@*/ htData *data)
-{
-  /* Put data in, return old value */
-  symbolKey key;
-  bucket *b;
-  htData *oldd;
-  htEntry *entry, *new_entry;
-  infoKind kind;
-  nameNode name;
-
-  key = htData_key (data);
-  kind = data->kind;
-
-  if (kind == IK_OP && (!data->content.op->name->isOpId))
-    {
-      name = data->content.op->name;
-    }
-  else
-    {
-      name = (nameNode) 0;
-    }
-
-  oldd = symHashTable_get (t, key, kind, name);
-
-  if (oldd == (htData *) 0)
-    {
-      new_entry = (htEntry *) dmalloc (sizeof (*new_entry));
-
-      /*@-deparrays@*/
-      b = t->buckets[MASH (key, kind)];
-      /*@=deparrays@*/
-
-      entry = b;
-      new_entry->data = data;
-      new_entry->next = entry;
-      t->buckets[MASH (key, kind)] = new_entry;
-      t->count++;
-
-      return NULL;
-    }
-  else
-    {				/* modify in place */
-      *oldd = *data;		/* copy new info over to old info */
-
-      /* dangerous: if the data is the same, don't free it */
-      if (data != oldd)   
-	{
-	  sfree (data); 
-        /*@-branchstate@*/ 
-	} 
-      /*@=branchstate@*/
-
-      return oldd;
-    }
-}
-
-#if 0
-static unsigned int
-symHashTable_count (symHashTable * t)
-{
-  return (t->count);
-}
-
-#endif
-
-static void
-symHashTable_printStats (symHashTable * t)
-{
-  int i, bucketCount, setsize, sortCount, opCount, tagCount;
-  int sortTotal, opTotal, tagTotal;
-  bucket *b;
-  htEntry *entry;
-  htData *d;
-
-  sortTotal = 0;
-  opTotal = 0;
-  tagTotal = 0;
-  sortCount = 0;
-  opCount = 0;
-  tagCount = 0;
-
-  /* for debugging only */
-  printf ("\n Printing symHashTable stats ... \n");
-  for (i = 0; i <= HT_MAXINDEX; i++)
-    {
-      b = t->buckets[i];
-      bucketCount = 0;
-      for (entry = b; entry != NULL; entry = entry->next)
-	{
-	  d = entry->data;
-	  bucketCount++;
-	  switch (d->kind)
-	    {
-	    case IK_SORT:
-	      sortCount++;
-	      /*@switchbreak@*/ break;
-	    case IK_OP:
-	      {
-		cstring name = nameNode_unparse (d->content.op->name);
-		cstring sigs = sigNodeSet_unparse (d->content.op->signatures);
-		opCount++;
-		/* had a tt? */
-		setsize = sigNodeSet_size (d->content.op->signatures);
-		printf ("       Op (%d): %s %s\n", setsize, 
-			cstring_toCharsSafe (name), 
-			cstring_toCharsSafe (sigs));
-		cstring_free (name);
-		cstring_free (sigs);
-		/*@switchbreak@*/ break;
-	      }
-	    case IK_TAG:
-	      tagCount++;
-	      /*@switchbreak@*/ break;
-	    }
-	}
-      if (bucketCount > 0)
-	{
-	  printf ("   Bucket %d has count = %d; opCount = %d; sortCount = %d; tagCount = %d\n", i, bucketCount, opCount, sortCount, tagCount);
-	  sortTotal += sortCount;
-	  tagTotal += tagCount;
-	  opTotal += opCount;
-	}
-    }
-  printf ("SymHashTable has total count = %d, opTotal = %d, sortTotal = %d, tagTotal = %d :\n", t->count, opTotal, sortTotal, tagTotal);
-
-}
-
-void
-symtable_printStats (symtable s)
-{
-  symHashTable_printStats (s->hTable);
- /* for debugging only */
-  printf ("idTable size = %d; allocated = %d\n",
-	  s->idTable->size, s->idTable->allocated);
-}
-
-/*@only@*/ cstring
-tagKind_unparse (tagKind k)
-{
-  switch (k)
-    {
-    case TAG_STRUCT:
-    case TAG_FWDSTRUCT:
-      return cstring_makeLiteral ("struct");
-    case TAG_UNION:
-    case TAG_FWDUNION:
-      return cstring_makeLiteral ("union");
-    case TAG_ENUM:
-      return cstring_makeLiteral ("enum");
-    }
-  BADEXIT;
-}
-
-static void tagInfo_free (/*@only@*/ tagInfo tag)
-{
-  sfree (tag);
-}
-
-/*@observer@*/ sigNodeSet 
-  symtable_possibleOps (symtable tab, nameNode n)
-{
-  opInfo oi = symtable_opInfo (tab, n);
-  
-  if (opInfo_exists (oi))
-    {
-      return (oi->signatures);
-    }
-
-  return sigNodeSet_undefined;
-}
-
-bool
-symtable_opExistsWithArity (symtable tab, nameNode n, int arity)
-{
-  opInfo oi = symtable_opInfo (tab, n);
-
-  if (opInfo_exists (oi))
-    {
-      sigNodeSet sigs = oi->signatures;
-      sigNodeSet_elements (sigs, sig)
-      {
-	if (ltokenList_size (sig->domain) == arity)
-	  return TRUE;
-      } end_sigNodeSet_elements;
-    }
-  return FALSE;
-}
-
-static bool
-domainMatches (ltokenList domain, sortSetList argSorts)
-{
-  /* expect their length to match */
-  /* each domain sort in op must be an element of
-     the corresponding set in argSorts. */
-  bool matched = TRUE;
-  sort s;
-
-  sortSetList_reset (argSorts);
-  ltokenList_elements (domain, dom)
-    {
-      s = sort_fromLsymbol (ltoken_getText (dom));
-      if (!(sortSet_member (sortSetList_current (argSorts), s)))
-	{
-	  /*      printf ("   mismatched element is: %s in %s\n", ltoken_getTextChars (*dom),
-		  sortSet_unparse (sortSetList_current (argSorts))); */
-	  matched = FALSE;
-	  break;
-	}
-      sortSetList_advance (argSorts);
-  } end_ltokenList_elements;
-
-  return matched;
-}
-
-/*@only@*/ lslOpSet
-  symtable_opsWithLegalDomain (symtable tab, /*@temp@*/ /*@null@*/ nameNode n,
-			       sortSetList argSorts, sort qual)
-{
- /* handles nil qual */
-  lslOpSet ops = lslOpSet_new ();
-  lslOp op;
-  sort rangeSort;
-  opInfo oi;
-
-  llassert (n != NULL);
-  oi = symtable_opInfo (tab, n);
-
-  if (opInfo_exists (oi))
-    {
-      sigNodeSet sigs = oi->signatures;
-
-      sigNodeSet_elements (sigs, sig)
-	{
-	  if (ltokenList_size (sig->domain) == sortSetList_size (argSorts))
-	    {
-	      rangeSort = sigNode_rangeSort (sig);
-	      
-	      if ((qual == 0) || (sort_equal (&rangeSort, &qual)))
-		{
-		  if (domainMatches (sig->domain, argSorts))
-		    {
-		      op = (lslOp) dmalloc (sizeof (*op));
-		      
-		      /* each domain sort in op must be an element of
-			 the corresponding set in argSorts. */
-		      op->signature = sig;
-		      op->name = nameNode_copy (n);
-		      (void) lslOpSet_insert (ops, op);
-		    }
-		}
-	    }
-	} end_sigNodeSet_elements;
-    }
-  return ops;
-}
diff --git a/src/syntable.c b/src/syntable.c
deleted file mode 100644
index 76d53eb..0000000
--- a/src/syntable.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** syntable.c
-**
-** Larch shared language synonym table
-**
-**	This table stores synonyms for the Larch Shared Language.  It is
-**	essentially a array of token-handles indexed by string-handles.
-**	Therefore, synonyms (strings) can be converted to the actual token.
-**
-**  AUTHORS:
-**	J.P. Wild
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-# include "tokentable.h"
-# include "syntable.h"
-
-/*@+ignorequals@*/
-
-typedef lsymbol *lsymbolTable;
-
-static /*@only@*/ /*@null@*/ lsymbolTable SynTable;	
-static unsigned long int SynTableEntries;
-
-static void SynTable_grow (int p_size);
-
-/*
-**++
-**  FUNCTION NAME:
-**
-**      LSLAddSyn ()
-**
-**  FORMAL PARAMETERS:
-**
-**      otok  - token-handle for token associated with oldToken
-**	ntok  - string-handle for the string to be a synonym with oldToken.
-**
-**  RETURN VALUE:
-**
-**  INVARIANTS:
-**
-**      A context must be established.
-**
-**  DESCRIPTION:
-**
-**    This routine inserts a synonym into the synonym table.  The synonym table
-**    is used to define synonyms in the form:
-**
-**	    synonym oldToken newToken
-**
-**    The table associates the string for newToken with the token for oldToken.
-**    This table is used to find the the actual token (oldToken) from a synonym
-**    string (newToken).
-**
-**    A new SynTable is allocated when:
-**	. The SynTable[] is empty (initial case)
-**      . The location where to insert the synonym is not in SynTable[]
-**
-**  IMPLICIT INPUTS/OUTPUT:
-**
-**    SynTable      - (input/output) SynTable array
-**
-**  EXCEPTIONS:
-**    A synonym already exists at the location where the it is to be added.
-**
-**--
-*/
-
-void
-LSLAddSyn (lsymbol ntok, lsymbol otok)
-{
-  if (ntok >= SynTableEntries) /* was otok */
-    {
-      SynTable_grow (otok);
-    }
-
-  llassert (SynTable != NULL);
-
-  if (SynTable[ntok] == (lsymbol) 0)
-    {				/* Entry is empty. Fill it in. */
-      SynTable[ntok] = otok;
-      LSLSetTokenHasSyn (otok, TRUE);	/* Mark oldToken as having a synonym. */
-    }
-  else
-    {
-      llbuglit ("LSLAddSyn: duplicate SynTable entry");
-    }
-}
-
-/*@exposed@*/ ltoken
-LSLGetTokenForSyn (lsymbol ntok)
-{
-  llassert (SynTable != NULL);
-  llassert (!(!((ntok < SynTableEntries) || (SynTable[ntok] != 0))));
-
-  return LSLGetToken (SynTable[ntok]);
-}
-
-bool
-LSLIsSyn (lsymbol str)
-{
-  if (str < SynTableEntries)
-    {
-      llassert (SynTable != NULL);
-      return (SynTable[str] != 0);
-    }
-  else
-    {
-      return FALSE;
-    }
-}
-
-static void
-SynTable_grow (int size)
-{
-  int oldSize;
-  int i;
-  lsymbolTable oldSynTable = SynTable;
-  
-  llassert (oldSynTable != NULL);
-  oldSize = SynTableEntries;
-  
-  if (size <= oldSize)
-    {
-      llcontbuglit ("SynTable_grow: goal size is smaller than oldSize");
-      return;
-    }
-  
-  if (size < (oldSize + SYNTABLE_BASESIZE))
-    {
-      size = oldSize + SYNTABLE_BASESIZE;
-    }
-
-  SynTable = (lsymbolTable) dmalloc (size * sizeof (*SynTable));
-  SynTableEntries = size;
-
-  for (i = 0; i < oldSize; i++)
-    {
-      SynTable[i] = oldSynTable[i];
-    }
-
-  /* Zero out new allocated space.  Need to detect when cells are empty   */
-  /* and do this by checking that SynTable[x] == 0.			  */
-
-  /*@+loopexec@*/
-  for (i = oldSize; i < size; i++)
-    {
-      SynTable[i] = (lsymbol) 0;
-    }
-  /*@=loopexec@*/
-
-  sfree (oldSynTable);
-/*@-compdef@*/ } /*=compdef@*/
-
-void
-lsynTableInit (void) /*@globals undef SynTable; @*/
-{
-  int i;
-
-  SynTable = (lsymbolTable) dmalloc (sizeof (*SynTable) * SYNTABLE_BASESIZE);
-
-  /*@+loopexec@*/
-  for (i = 0; i < SYNTABLE_BASESIZE; i++)
-    {
-      SynTable[i] = (lsymbol) 0;
-    }
-  /*@=loopexec@*/
-
-  SynTableEntries = SYNTABLE_BASESIZE;
-/*@-compdef@*/ } /*@=compdef@*/
-
-void
-lsynTableReset (void)
-{
-}
-
-void
-lsynTableCleanup (void)
-{
-  sfree (SynTable);
-  SynTable = NULL;
-}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/termNodeList.c b/src/termNodeList.c
deleted file mode 100644
index 7e522ea..0000000
--- a/src/termNodeList.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** termNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-termNodeList termNodeList_new ()
-{
-  termNodeList s = (termNodeList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspacelow = termNodeListGROWLOW;
-  s->nspacehigh = termNodeListGROWHI;
-  s->elementsroot = (termNode *) dmalloc (sizeof (*s->elements) * (s->nspacelow + s->nspacehigh));
-  s->elements = s->elementsroot + termNodeListGROWLOW;
-  s->current = 0;
-
-  return (s);
-}
-
-static void
-termNodeList_grow (termNodeList s)
-{
-  int i;
-  termNode *newelements = (termNode *) dmalloc (sizeof (*newelements)
-						* (s->nelements + termNodeListBASESIZE));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i + termNodeListGROWLOW] = s->elements[i];
-    }
-  
-  sfree (s->elementsroot);
-
-  s->nspacelow = termNodeListGROWLOW;
-  s->nspacehigh = termNodeListGROWHI; 
-
-  s->elementsroot = newelements;
-  s->elements = s->elementsroot + s->nspacelow;
-}
-
-void 
-termNodeList_addh (termNodeList s, termNode el)
-{
-  llassert (termNodeListGROWHI > 0);
-
-  if (s->nspacehigh <= 0)
-    termNodeList_grow (s);
-
-  s->nspacehigh--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-}
-
-termNodeList 
-termNodeList_push (termNodeList s, termNode el)
-{
-  termNodeList_addh (s, el);
-  return s;
-}
-
-void 
-termNodeList_addl (termNodeList s, termNode el)
-{
-  llassert (termNodeListGROWLOW > 0);
-
-  if (s->nspacelow <= 0)
-    termNodeList_grow (s);
-
-  s->nspacelow--;
-  s->elements--;
-  s->elements[0] = el;
-  s->current++;
-  s->nelements++;
-}
-
-void 
-termNodeList_reset (termNodeList s)
-{
-  s->current = 0;
-}
-
-void 
-termNodeList_finish (termNodeList s)
-{
-  s->current = s->nelements - 1;
-}
-
-void 
-termNodeList_advance (termNodeList s)
-{
-  s->current++;
-  llassert (s->current < s->nelements);
-}
-
-/*@exposed@*/ termNode 
-termNodeList_head (termNodeList s)
-{
-  llassert (s->nelements > 0);
-  return (s->elements[0]);
-}
-
-/*@only@*/ termNodeList 
-termNodeList_copy (termNodeList s)
-{
-  termNodeList r = termNodeList_new ();
-
-  termNodeList_elements (s, x)
-  {
-    termNodeList_addh (r, termNode_copySafe (x));
-  } end_termNodeList_elements;
-
-  return r;
-}
-
-/*@exposed@*/ termNode 
-termNodeList_current (termNodeList s)
-{
-  llassert (!(s->current >= s->nelements));
-  return (s->elements[s->current]);
-}
-
-termNode 
-termNodeList_getN (termNodeList s, int n)
-{
-  llassert (n >= 0 && n < s->nelements);
-
-  return (s->elements[n]);
-}
-
-/*@only@*/ cstring
-termNodeList_unparse (termNodeList s)
-{
-  bool first = TRUE;
-  cstring st = cstring_undefined;
-
-  termNodeList_elements (s, current)
-  {
-    if (first)
-      {
-	st = termNode_unparse (current);
-	first = FALSE;
-      }
-    else
-      st = message ("%q, %q", st, termNode_unparse (current));
-  } end_termNodeList_elements;
-
-  return st;
-}
-
-/*@only@*/ cstring
-termNodeList_unparseTail (termNodeList s)
-{
-  bool head = TRUE;
-  bool first = TRUE;
-  cstring st = cstring_undefined;
-
-  termNodeList_elements (s, current)
-  {
-    if (head)
-      {
-	head = FALSE;
-      }
-    else
-      {
-	if (first)
-	  {
-	    st = termNode_unparse (current);
-	    first = FALSE;
-	  }
-	else
-	  st = message ("%q, %q", st, termNode_unparse (current));
-      }
-  } end_termNodeList_elements;
-
-  return st;
-}
-
-/*@only@*/ cstring
-termNodeList_unparseToCurrent (termNodeList s)
-{
-  int i;
-  cstring st = cstring_undefined;
-
-  for (i = 0; i < s->current; i++)
-    {
-      termNode current = s->elements[i];
-
-      if (i == 0)
-	st = termNode_unparse (current);
-      else
-	st = message ("%q, %q", st, termNode_unparse (current));
-    }
-
-  return st;
-}
-
-/*@only@*/ cstring
-termNodeList_unparseSecondToCurrent (termNodeList s)
-{
-  int i;
-  cstring st = cstring_undefined;
-
-  for (i = 1; i < s->current; i++)
-    {
-      termNode current = s->elements[i];
-
-      if (i == 1)
-	{
-	  st = termNode_unparse (current);
-	}
-      else
-	{
-	  st = message ("%q, %q", st, termNode_unparse (current));
-	}
-    }
-
-  return st;
-}
-
-void
-termNodeList_free (termNodeList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-      termNode_free (s->elements[i]); 
-    }
-
-  sfree (s->elementsroot);
-  sfree (s);
-}
diff --git a/src/tokentable.c b/src/tokentable.c
deleted file mode 100644
index 66d9322..0000000
--- a/src/tokentable.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** tokentable.c
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "osd.h"
-# include "tokentable.h"
-
-static long unsigned MaxToken;	
-static /*@null@*/ /*@only@*/ o_ltoken *TokenTable;       
-
-static void AllocTokenTable (void) /*@modifies TokenTable, MaxToken@*/ ;
-
-ltoken
-  LSLInsertToken (ltokenCode cod, lsymbol sym, lsymbol rTxt, bool def)
-{
-  while (sym >= MaxToken)
-    {
-      AllocTokenTable ();
-    }
-
-  llassert (TokenTable != NULL);
-
-  if (ltoken_isUndefined (TokenTable[sym]))
-    {
-      TokenTable[sym] = ltoken_create (cod, sym);        
-      ltoken_setRawText (TokenTable[sym], rTxt);
-      ltoken_setDefined (TokenTable[sym], def);
-    }
-  
-  return TokenTable[sym];
-}
-
-void
-LSLUpdateToken (ltokenCode cod, lsymbol sym, bool def)
-{
-  llassert (TokenTable != NULL);
-
-  if (!ltoken_isUndefined (TokenTable[sym]))
-    {
-      ltoken_setCode (TokenTable[sym], cod);
-      ltoken_setDefined (TokenTable[sym], def);
-    }
-  else
-    {
-      llfatalbug (message ("LSLUpdateToken: token not in table: %d, text: %s", 
-			   (int) cod, cstring_fromChars (lsymbol_toChars (sym))));
-    }
-}
-
-void
-LSLSetTokenHasSyn (lsymbol sym, bool syn)
-{
-  llassert (TokenTable != NULL);
-    
-  if (!ltoken_isUndefined (TokenTable[sym]))
-    {
-      ltoken_setHasSyn (TokenTable[sym], syn);
-    }
-  else
-    {
-      llbuglit ("LSLSetTokenHasSyn: null token");
-    }
-}
-
-ltoken LSLGetToken (lsymbol sym)
-{
-  llassert (TokenTable != NULL);
-
-  if (!((sym < MaxToken) || (!ltoken_isUndefined (TokenTable[sym]))))
-    {
-      llcontbuglit ("LSLGetToken: bad argument");
-      return TokenTable[0];
-    }
-
-  return TokenTable[sym];
-}
-
-/*@exposed@*/ ltoken
-LSLReserveToken (ltokenCode cod, char *txt)
-{
-  lsymbol sym;
-  
-  sym = lsymbol_fromChars (txt);
-
-  /* 
-  ** Reserved tokens never have raw text like synonyms.
-  */
-
-  return LSLInsertToken (cod, sym, lsymbol_undefined, TRUE);
-}
-
-static void
-AllocTokenTable (void)
-{
-  long unsigned oldSize, newSize;
-  long unsigned int i;
-
-  oldSize = MaxToken;
-
-  if (oldSize == 0)
-    {
-      newSize = INITTOKENTABLE;
-      llassert (TokenTable == NULL);
-      TokenTable = (ltoken *) dmalloc (newSize * sizeof (*TokenTable)); 
-    }
-  else
-    {
-      o_ltoken *oldTokenTable = TokenTable;
-
-      newSize = (long unsigned) (DELTATOKENTABLE * oldSize);
-      TokenTable = (ltoken *) dmalloc (newSize * sizeof (*TokenTable));
-
-      llassert (oldSize > 0);
-      llassert (oldTokenTable != NULL);
-      
-      for (i = 0; i < oldSize; i++)
-	{
-	  TokenTable[i] = oldTokenTable[i];
-	}
-
-      sfree (oldTokenTable);
-    }
-
-  /*@+loopexec@*/
-  for (i = oldSize; i < newSize; i++)
-    {
-      TokenTable[i] = ltoken_undefined;
-    }
-  /*@=loopexec@*/
-
-  MaxToken = newSize;
-/*@-compdef@*/ } /*=compdef@*/
-
-void
-ltokenTableInit (void)
-{
-  MaxToken = 0;
-}
-
-void
-ltokenTableCleanup (void)
-{
-  if (TokenTable != NULL)
-    {
-      long unsigned i;
-      
-      for (i = 0; i < MaxToken; i++)
-	{
-	  ltoken_free (TokenTable[i]);
-	}
-
-      sfree (TokenTable); 
-      TokenTable = NULL;
-    }
-}
diff --git a/src/traitRefNodeList.c b/src/traitRefNodeList.c
deleted file mode 100644
index 19d9956..0000000
--- a/src/traitRefNodeList.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** traitRefNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-/*@only@*/ traitRefNodeList
-traitRefNodeList_new ()
-{
-  traitRefNodeList s = (traitRefNodeList) dmalloc (sizeof (*s));
-
-  s->nelements = 0;
-  s->nspace = traitRefNodeListBASESIZE;
-  s->elements = (traitRefNode *)
-    dmalloc (sizeof (*s->elements) * traitRefNodeListBASESIZE);
-
-  return (s);
-}
-
-static void
-traitRefNodeList_grow (traitRefNodeList s)
-{
-  int i;
-  traitRefNode *newelements; 
-
-  s->nspace += traitRefNodeListBASESIZE;
-  newelements = (traitRefNode *) dmalloc (sizeof (*newelements)
-					  * (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i]; 
-    }
-
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-traitRefNodeList
-traitRefNodeList_add (traitRefNodeList s, /*@only@*/ traitRefNode el)
-{
-  if (s->nspace <= 0)
-    traitRefNodeList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-
-  return s;
-}
-
-/*@only@*/ cstring
-traitRefNodeList_unparse (traitRefNodeList s)
-{
-  cstring st = cstring_undefined;
-
-  traitRefNodeList_elements (s, current)
-  {
-    st = message ("%quses (%q)", st, printLeaves2 (current->traitid));
-
-    if (current->rename != 0)
-      {
-	st = message ("%q (%q)", st, renamingNode_unparse (current->rename));
-      }
-
-    st = message ("%q\n", st);
-  } end_traitRefNodeList_elements;
-
-  return (st);
-}
-
-void
-traitRefNodeList_free (traitRefNodeList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-      traitRefNode_free (s->elements[i]); 
-    }
-
-  sfree (s->elements); 
-  sfree (s);
-}
diff --git a/src/typeIdSet.c b/src/typeIdSet.c
deleted file mode 100644
index 1489d83..0000000
--- a/src/typeIdSet.c
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** typeIdSet.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-/*@constant int TISTABLEBASESIZE;@*/
-# define TISTABLEBASESIZE LARGEBASESIZE
-
-static int tistableentries = 0;
-static int tistablefree = 0;
-typedef /*@only@*/ usymIdSet o_usymIdSet;
-static /*@only@*/ o_usymIdSet *tistable;
-static void tistable_addDirectEntry (/*@only@*/ usymIdSet p_s) 
-   /*@modifies tistable, tistableentries, tistablefree@*/;
-
-void typeIdSet_initMod (void)
-   /*@globals undef tistable;@*/
-   /*@modifies tistable, tistablefree;@*/
-{
-  llassert (tistableentries == 0 && tistablefree == 0);
-
-  tistablefree = TISTABLEBASESIZE;
-  tistable = (usymIdSet *) dmalloc (sizeof (tistable) * tistablefree);
-  tistable[0] = usymIdSet_undefined;
-  tistableentries = 1;
-  tistablefree--;
-}
-
-void typeIdSet_destroyMod (void)
-   /*@globals killed tistable, tistableentries@*/
-{
-  int i;
-
-  for (i = 0; i < tistableentries; i++)
-    {
-      usymIdSet_free (tistable[i]);
-    }
-
-  sfree (tistable);
-  tistableentries = 0;
-}
-
-void typeIdSet_dumpTable (FILE *fout)
-{
-  int i;
-
-  /*
-  ** Don't dump 0th entry
-  */
-
-  for (i = 1; i < tistableentries; i++)
-    {
-      cstring s = usymIdSet_dump (tistable[i]);
-
-      fprintf (fout, "%s\n", cstring_toCharsSafe (s));
-      cstring_free (s);
-    }
-}
-
-static /*@unused@*/ void tistable_printOut (void)
-{
-  int i;
-
-  /*
-  ** Don't dump 0th entry
-  */
-
-  for (i = 1; i < tistableentries; i++)
-    {
-      cstring s = usymIdSet_unparse (tistable[i]);
-
-      fprintf (g_msgstream, "%d: %s\n", i, cstring_toCharsSafe (s));
-      cstring_free (s);
-    }
-}
-
-void typeIdSet_loadTable (FILE *fin)
-{
-  char *s = mstring_create (MAX_DUMP_LINE_LENGTH);  
-  char *os = s;
-
-  llassert (tistableentries == 1);
-
-  s = fgets (s, MAX_DUMP_LINE_LENGTH, fin);
-
-  while (s != NULL && *s != ';')
-    {
-      usymIdSet u = usymIdSet_undump (&s);
-      
-      llassert (*s == '\0' || *s == '\n');
-      
-      tistable_addDirectEntry (u);
-      s = fgets (os, MAX_DUMP_LINE_LENGTH, fin);
-    }
-}
-  
-static void tistable_grow (void)
-{
-  o_usymIdSet *oldtable = tistable;
-  int newsize = tistableentries + TISTABLEBASESIZE;
-  int i;
-
-  llassert (tistablefree == 0);
-
-  tistable = (usymIdSet *) dmalloc (sizeof (tistable) * newsize);
-
-  for (i = 0; i < tistableentries; i++)
-    {
-      tistable[i] = oldtable[i];
-    }
-
-  tistablefree = TISTABLEBASESIZE;
-  sfree (oldtable);
-} 
-
-static void tistable_addDirectEntry (/*@only@*/ usymIdSet s)
-{
-  if (tistablefree == 0)
-    {
-      tistable_grow ();
-    }
-
-  tistable[tistableentries] = s;
-  tistableentries++;
-  tistablefree--;
-}
-
-static int tistable_addEntry (/*@only@*/ usymIdSet s)
-{
-  int i;
-
-  
-  for (i = 0; i < tistableentries; i++)
-    {
-      if (usymIdSet_compare (tistable[i], s) == 0)
-	{
-	  /*@access usymIdSet@*/
-	  llassert (i == 0 || s != tistable[i]);
-	  /*@noaccess usymIdSet@*/
-
-	  usymIdSet_free (s);
-	  	  return i;
-	}
-    }
-
-  tistable_addDirectEntry (s);
-  return (tistableentries - 1);
-}
-  
-static /*@observer@*/ usymIdSet tistable_fetch (typeIdSet t)
-   /*@globals tistableentries, tistable@*/
-   /*@modifies nothing;@*/
-{
-  llassert (t >= 0 && t < tistableentries);
-
-  return tistable[t];
-}
-
-typeIdSet typeIdSet_emptySet (void)
-{
-  if (tistableentries == 0)
-    {
-      int val = tistable_addEntry (usymIdSet_new ());
-
-      llassert (val == 0);
-    }
-
-  llassert (usymIdSet_isUndefined (tistable[0]));
-  return 0;
-}
-    
-bool typeIdSet_member (typeIdSet t, typeId el)
-{
-  usymIdSet u = tistable_fetch (t);
-
-  return usymIdSet_member (u, el);
-}
-
-bool typeIdSet_isEmpty (typeIdSet t)
-{
-  return (t == 0);
-}
-
-typeIdSet typeIdSet_single (typeId t)
-{
-  return (tistable_addEntry (usymIdSet_single (t)));
-}
-
-typeIdSet typeIdSet_singleOpt (typeId t)
-{
-  if (typeId_isValid (t))
-    {
-      return (tistable_addEntry (usymIdSet_single (t)));
-    }
-  else
-    {
-      return typeIdSet_empty;
-    }
-}
-
-typeIdSet typeIdSet_insert (typeIdSet t, typeId el)
-{
-  usymIdSet u = tistable_fetch (t);
-
-  if (usymIdSet_member (u, el))
-    {
-      return t;
-    }
-  else
-    {
-      return (tistable_addEntry (usymIdSet_add (u, el)));
-    }
-}
-
-typeIdSet typeIdSet_removeFresh (typeIdSet t, typeId el)
-{
-  return (tistable_addEntry (usymIdSet_removeFresh (tistable_fetch (t), el)));
-}
-
-cstring typeIdSet_unparse (typeIdSet t)
-{
-  return (usymIdSet_unparse (tistable_fetch (t)));
-}
-
-int typeIdSet_compare (typeIdSet t1, typeIdSet t2)
-{
-  return (int_compare (t1, t2));
-}
-
-typeIdSet typeIdSet_subtract (typeIdSet s, typeIdSet t)
-{
-  if (typeIdSet_isEmpty (t))
-    {
-      return s;
-    }
-  else
-    {
-      return (tistable_addEntry (usymIdSet_subtract (tistable_fetch (s),
-						     tistable_fetch (t))));
-    }
-}
-
-cstring typeIdSet_dump (typeIdSet t)
-{
-  return (message ("%d", t));
-}
-
-typeIdSet typeIdSet_undump (char **s)
-{
-  int i;
-
-  
-  i = getInt (s);
-
-  llassert (i >= 0 && i < tistableentries);
-  return (typeIdSet) i;
-}
-
-typeIdSet typeIdSet_union (typeIdSet t1, typeIdSet t2)
-{
-  if (t1 == typeIdSet_undefined)
-    {
-      return t2;
-    }
-  else if (t2 == typeIdSet_undefined)
-    {
-      return t1;
-    }
-  else
-    {
-      return (tistable_addEntry (usymIdSet_newUnion (tistable_fetch (t1),
-						     tistable_fetch (t2))));
-    }
-}
diff --git a/src/typeNameNodeList.c b/src/typeNameNodeList.c
deleted file mode 100644
index 267ad2a..0000000
--- a/src/typeNameNodeList.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** typeNameNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-typeNameNodeList typeNameNodeList_new ()
-{
-  typeNameNodeList s = (typeNameNodeList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = typeNameNodeListBASESIZE;
-  s->elements = (typeNameNode *) 
-    dmalloc (sizeof (*s->elements) * typeNameNodeListBASESIZE);
-
-  return (s);
-}
-
-static void
-typeNameNodeList_grow (typeNameNodeList s)
-{
-  int i;
-  typeNameNode *newelements; 
-
-  s->nspace += typeNameNodeListBASESIZE;
-
-  newelements = (typeNameNode *) dmalloc (sizeof (*newelements)
-					  * (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] =  s->elements[i]; 
-    }
-
-  sfree (s->elements); 
-  s->elements = newelements;
-}
-
-typeNameNodeList 
-typeNameNodeList_add (typeNameNodeList s, typeNameNode el)
-{
-  if (s->nspace <= 0)
-    typeNameNodeList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-
-  return s;
-}
-
-/*@only@*/ cstring
-typeNameNodeList_unparse (typeNameNodeList s)
-{
-  cstring st = cstring_undefined;
-  bool first = TRUE;
-
-  typeNameNodeList_elements (s, current)
-  {
-    if (first)
-      {
-	st = typeNameNode_unparse (current);
-	first = FALSE;
-      }
-    else
-      {
-	st = message ("%q, %q", st, typeNameNode_unparse (current));
-      }
-  } end_typeNameNodeList_elements;
-  return (st);
-}
-
-void
-typeNameNodeList_free (typeNameNodeList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-      typeNameNode_free (s->elements[i]); 
-    }
-
-  sfree (s->elements);
-  sfree (s);
-}
diff --git a/src/uentry.c b/src/uentry.c
deleted file mode 100644
index 5da16f3..0000000
--- a/src/uentry.c
+++ /dev/null
@@ -1,9882 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** uentry.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-# include "structNames.h"
-# include "nameChecks.h"
-
-/*@i223*/
-/*@-type*/
-static /*@dependent@*/ uentry posRedeclared = uentry_undefined;
-static /*@only@*/ fileloc posLoc = fileloc_undefined;
-static int nuentries = 0;
-static int totuentries = 0;
-
-static void checkGlobalsModifies (/*@notnull@*/ uentry p_ue, sRefSet p_sr) ;
-static void uentry_setDeclDef (uentry p_e, fileloc p_f) /*@modifies p_e@*/ ;
-static bool uentry_isRefCounted (uentry p_ue) /*@*/ ;
-static bool uentry_isRefsField (uentry p_ue) /*@*/ ;
-static bool uentry_isReallySpecified (uentry p_e) /*@*/ ;
-static void uentry_checkIterArgs (uentry p_ue);
-static cstring uentry_dumpAux (uentry p_v, bool p_isParam);
-
-/*@access ekind@*/
-static void checkAliasState (/*@notnull@*/ uentry p_old,
-			       /*@notnull@*/ uentry p_unew, 
-			       bool p_mustConform, bool p_completeConform) 
-   /*@modifies p_old, p_unew@*/ ;
-static void checkNullState (/*@notnull@*/ uentry p_old,
-			    /*@notnull@*/ uentry p_unew, 
-			    bool p_mustConform, bool p_completeConform) 
-   /*@modifies p_old, p_unew@*/ ;
-
-static void checkVarConformance (/*@notnull@*/ uentry p_old,
-				 /*@notnull@*/ uentry p_unew, 
-				 bool p_mustConform, bool p_completeConform) 
-   /*@modifies p_old, p_unew@*/;
-
-# ifndef NOLCL
-static void uentry_setHasMods (uentry p_ue) /*@modifies p_ue@*/;
-static void uentry_setHasGlobs (uentry p_ue) /*@modifies p_ue@*/;
-# endif
-
-static void uentry_reallyFree (/*@notnull@*/ /*@only@*/ uentry p_e);
-
-static void uentry_setSpecDef (/*@special@*/ uentry p_e, /*@keep@*/ fileloc p_f)
-   /*@defines p_e->whereSpecified, p_e->whereDeclared, p_e->whereDefined@*/
-   /*@modifies p_e@*/;
-
-static void returnValueError (/*@notnull@*/ uentry p_old, /*@notnull@*/ uentry p_unew);
-static void nargsError (/*@notnull@*/ uentry p_old, /*@notnull@*/ uentry p_unew);
-static /*@observer@*/ cstring paramStorageName (uentry p_ue) /*@*/ ;
-static /*@observer@*/ cstring fcnErrName (uentry p_ue) /*@*/ ;
-static /*@observer@*/ cstring checkedName (chkind p_checked) /*@*/ ;
-static void 
-  paramTypeError (/*@notnull@*/ uentry p_old, /*@notnull@*/ uentry p_oldCurrent,
-		  ctype p_oldType, /*@notnull@*/ uentry p_unew,
-		  /*@notnull@*/ uentry p_newCurrent, 
-		  ctype p_newType, int p_paramno) /*@modifies g_msgstream@*/ ;
-
-static /*@only@*/ /*@notnull@*/ uentry 
-  uentry_makeVariableAux (cstring p_n, ctype p_t, /*@keep@*/ fileloc p_f,
-			  /*@exposed@*/ sRef p_s, bool p_priv, vkind p_kind);
-
-static /*@out@*/ /*@notnull@*/ uentry uentry_alloc (void) /*@*/ 
-{
-  uentry ue = (uentry) dmalloc (sizeof (*ue));
-  nuentries++;
-  totuentries++;
-  
-  return ue;
-}
-
-static cstring uentry_getOptName (uentry p_e) /*@*/ ;
-static void uentry_copyInto (/*@out@*/ /*@unique@*/ uentry p_unew, uentry p_old);
-static void uentry_setNullState (/*@notnull@*/ uentry p_ue, nstate p_ns);
-static void uentry_setAliasKind (/*@notnull@*/ uentry p_ue, alkind p_ak);
-static /*@only@*/ /*@null@*/ uinfo uinfo_copy (uinfo p_u, ekind p_kind);
-static void uinfo_free (/*@only@*/ uinfo p_u, ekind p_kind);
-static void uvinfo_free (/*@only@*/ uvinfo p_u);
-
-# ifdef DOANNOTS
-
-static /*@only@*/ cstring ancontext_unparse (ancontext an)
-{
-  switch (an)
-    {
-    case AN_UNKNOWN: return cstring_makeLiteral ("unknown");
-    case AN_FCNRETURN: return cstring_makeLiteral ("return value");
-    case AN_FCNPARAM: return cstring_makeLiteral ("function param");
-    case AN_SUFIELD: return cstring_makeLiteral ("su field");
-    case AN_TDEFN: return cstring_makeLiteral ("type definition");
-    case AN_GSVAR: return cstring_makeLiteral ("global/static var");
-    case AN_CONST: return cstring_makeLiteral ("constant");
-    BADDEFAULT;
-    }
-  BADEXIT;
-}
-
-static int annots[AN_LAST][QU_LAST];
-static int decls[AN_LAST];
-static int shdecls[AN_LAST];
-static int idecls[AN_LAST];
-
-void initAnnots ()
-{
-  int i, j;
-
-  for (i = AN_UNKNOWN; i < AN_LAST; i++)
-    {
-      decls[i] = 0;
-      shdecls[i] = 0;
-      idecls[i] = 0;
-
-      for (j = QU_UNKNOWN; j < QU_LAST; j++)
-	{
-	  annots[i][j] = 0;
-	}
-    }
-}
-
-static void tallyAnnot (ancontext ac, qual q)
-{
-  (annots[ac][q])++;
-}
-
-void printAnnots ()
-{
-  int total[QU_LAST];
-  int alltotals = 0;
-  int totdecls = 0;
-  int totshdecls = 0;
-  int totidecls = 0;
-  int i, j;
-
-  for (j = QU_UNKNOWN; j < QU_LAST; j++)
-    {
-      total[j] = 0;
-    }
-
-  for (i = AN_UNKNOWN; i < AN_LAST; i++)
-    {
-      int tmptot;
-
-      if (decls[i] > 0)
-	{
-	  printf ("Context: %s (%d declarations, %d sharable, %d indirect)\n", 
-		  ancontext_unparse (i),
-		  decls[i], shdecls[i], idecls[i]);
-	  
-	  totdecls += decls[i];
-	  totshdecls += shdecls[i];
-	  totidecls += idecls[i];
-	  
-	  for (j = QU_UNKNOWN; j < QU_LAST; j++)
-	    {
-	      total[j] += annots[i][j];
-	      alltotals += annots[i][j];
-	    }
-	  
-	  printf ("   Allocation:\n");
-	  
-	  tmptot = 0;
-	  
-	  for (j = QU_UNKNOWN; j < QU_LAST; j++)
-	    {
-	      if (qual_isAliasQual (j) && !qual_isUnique (j))
-		{
-		  if (annots[i][j] > 0)
-		    {
-		      printf ("\t%10s: %5d (%3.2f%%)\n", qual_unparse (j), annots[i][j],
-			      100.0 * (double)annots[i][j] / (double)decls[i]);
-		      tmptot += annots[i][j];
-		    }
-		}
-	    }
-
-	  printf ("   Exposure:\n");
-	  
-	  tmptot = 0;
-	  
-	  for (j = QU_UNKNOWN; j < QU_LAST; j++)
-	    {
-	      if (qual_isExQual (j))
-		{
-		  if (annots[i][j] > 0)
-		    {
-		      printf ("\t%10s: %5d (%3.2f%%)\n", qual_unparse (j), annots[i][j],
-			      100.0 * (double)annots[i][j] / (double)decls[i]);
-		      tmptot += annots[i][j];
-		    }
-		}
-	    }
-	  
-	  printf ("   Definition:\n");
-	  
-	  for (j = QU_UNKNOWN; j < QU_LAST; j++)
-	    {
-	      if (qual_isAllocQual (j))
-		{
-		  if (annots[i][j] > 0)
-		    {
-		      printf ("\t%10s: %5d (%3.2f%%)\n", qual_unparse (j), annots[i][j],
-			      100.0 * (double)annots[i][j] / (double)decls[i]);
-		    }
-		}
-	    }
-	  
-	  printf ("   Null:\n");
-	  
-	  for (j = QU_UNKNOWN; j < QU_LAST; j++)
-	    {
-	      if (qual_isNull (j) || qual_isNotNull (j) || qual_isRelNull (j))
-		{
-		  if (annots[i][j] > 0)
-		    {
-		      printf ("\t%10s: %5d (%3.2f%%)\n", qual_unparse (j), annots[i][j],
-			      100.0 * (double)annots[i][j] / (double)decls[i]);
-		    }
-		}
-	    }
-
-	  printf ("\n");
-	}
-    }
-
-  for (j = QU_UNKNOWN; j < QU_LAST; j++)
-    {
-      bool hasone = FALSE;
-
-      for (i = AN_UNKNOWN; i < AN_LAST; i++)
-	{
-	  if (annots[i][j] > 0)
-	    {
-	      hasone = TRUE;
-	      break;
-	    }
-	}
-
-      if (hasone)
-	{
-	  printf ("Annotation: %s\n", qual_unparse (j));
-	  
-	  for (i = AN_UNKNOWN; i < AN_LAST; i++)
-	    {
-	      if (annots[i][j] > 0)
-		{
-		  printf ("%25s: %5d\n", ancontext_unparse (i), annots[i][j]);
-		}
-	    }
-	  printf ("\n");
-	}
-    }
-
-  printf ("All Contexts\n");
-  
-  for (j = QU_UNKNOWN; j < QU_LAST; j++)
-    {
-      if (total[j] > 0)
-	{
-	  printf ("%10s: %5d (%3.2f%%)\n", qual_unparse (j), total[j],
-		  100.0 * (double)total[j] / (double)(totdecls));
-	}
-    }
-  printf ("\n");
-
-  printf ("Total Annotations: %d (%d decls, %d sharable, %d indirect)\n", alltotals, totdecls, totshdecls, totidecls);
-}
-
-extern void uentry_tallyAnnots (uentry u, ancontext kind)
-{
-  alkind ak = sRef_getAliasKind (u->sref);
-  exkind ek = sRef_getExKind (u->sref);
-  nstate ns = sRef_getNullState (u->sref);
-  sstate ss = sRef_getDefState (u->sref);
-  bool recordUnknown = FALSE;
-
-  
-  if (kind == AN_UNKNOWN)
-    {
-      ekind e = u->ukind;
-
-      if (e == KENDITER)
-	{
-	  return;
-	}
-      else if (e == KCONST || e == KENUMCONST)
-	{
-	  kind = AN_CONST;
-	}
-      else if (e == KFCN || e == KITER)
-	{
-	  uentryList params = uentry_getParams (u);
-	  bool hasRet = FALSE;
-
-	  uentryList_elements (params, current)
-	    {
-	      if (uentry_isReturned (current))
-		{
-		  hasRet = TRUE;
-		}
-	      if (!uentry_isElipsisMarker (current))
-		{
-		  uentry_tallyAnnots (current, AN_FCNPARAM);
-		}
-	    } end_uentryList_elements;
-	  
-	  kind = AN_FCNRETURN;
-	  
-	  if (ctype_isFunction (u->utype)
-	      && !hasRet
-	      && ctype_isVisiblySharable (ctype_realType (ctype_returnValue (u->utype))))
-	    {
-	      recordUnknown = TRUE;
-	    }
-	}
-      else if (e == KDATATYPE || e == KSTRUCTTAG || e == KUNIONTAG || e == KENUMTAG)
-	{
-	  ctype t = ctype_realType (u->utype);
-
-	  if (ctype_isSU (t))
-	    {
-	      uentryList fields = ctype_getFields (t);
-
-	      uentryList_elements (fields, current)
-		{
-		  uentry_tallyAnnots (current, AN_SUFIELD);
-		}
-	    } end_uentryList_elements;
-	  
-	  kind = AN_TDEFN;
-
-	  if (ctype_isVisiblySharable (u->utype))
-	    {
-	      recordUnknown = TRUE;
-	    }
-	}
-      else 
-	{
-	  kind = AN_GSVAR;
-	  
-	  
-	  if (ctype_isVisiblySharable (ctype_realType (u->utype)))
-	    {
-	      recordUnknown = TRUE;
-	    }
-	}
-    }
-
-  decls[kind]++;
-
-  if (kind == AN_FCNRETURN)
-    {
-      if (recordUnknown) 
-	{
-	  shdecls[kind]++;
-	  idecls[kind]++;
-	}
-      else 
-	{
-	  ;
-	}
-    }
-  else
-    {
-      if (ctype_isVisiblySharable (ctype_realType (u->utype)))
-	{
-	  shdecls[kind]++;
-	  	}
-      
-      if (ctype_isRealPointer (ctype_realType (u->utype)))
-	{
-	  idecls[kind]++;
-	}
-    }
-  
-
-
-
-
-
-
-
-
-
-  switch (ss)
-    {
-    case SS_ALLOCATED: tallyAnnot (kind, QU_OUT); break;
-    case SS_PARTIAL:   tallyAnnot (kind, QU_PARTIAL); break;
-    case SS_RELDEF:    tallyAnnot (kind, QU_RELDEF); break;
-    case SS_SPECIAL:   tallyAnnot (kind, QU_SPECIAL); break;
-    default: break;
-    }
-
-  if (uentry_isReturned (u))
-    {
-      tallyAnnot (kind, QU_RETURNED); 
-    }
-
-  switch (ak)
-    {
-    case AK_UNKNOWN:    
-      if (ctype_isRefCounted (ctype_realType (u->utype))
-	  || (ctype_isFunction (u->utype) &&
-	      ctype_isRefCounted (ctype_realType (ctype_returnValue (u->utype)))))
-	{
-	  ;
-	}
-      else
-	{
-	  if (kind == AN_FCNPARAM) 
-	    { 
-	      tallyAnnot (kind, QU_TEMP); 
-	    } 
-	  else if (recordUnknown) 
-	    { 
-	      if (kind == AN_FCNRETURN)
-		{
-		  		}
-	      tallyAnnot (kind, QU_UNKNOWN); 
-	    }
-	}
-      break;
-    case AK_ONLY:       tallyAnnot (kind, QU_ONLY); break;
-    case AK_IMPONLY:    tallyAnnot (kind, QU_ONLY); break;
-    case AK_KEEP:       tallyAnnot (kind, QU_KEEP); break;
-    case AK_KEPT:       tallyAnnot (kind, QU_KEPT); break;
-    case AK_IMPTEMP:
-    case AK_TEMP:       tallyAnnot (kind, QU_TEMP); break;
-    case AK_SHARED:     tallyAnnot (kind, QU_SHARED); break;
-    case AK_UNIQUE:     tallyAnnot (kind, QU_UNIQUE); break;
-    case AK_RETURNED:   tallyAnnot (kind, QU_RETURNED); break;
-    case AK_REFCOUNTED: tallyAnnot (kind, QU_UNKNOWN); break;
-    case AK_REFS:       tallyAnnot (kind, QU_REFS); break;
-    case AK_KILLREF:    tallyAnnot (kind, QU_KILLREF); break;
-    case AK_NEWREF:     tallyAnnot (kind, QU_NEWREF); break;
-    case AK_OWNED:      tallyAnnot (kind, QU_OWNED); break;
-    case AK_IMPDEPENDENT:
-    case AK_DEPENDENT:  tallyAnnot (kind, QU_DEPENDENT); break;
-    case AK_ERROR:    
-    case AK_FRESH:
-    case AK_STACK:
-    case AK_LOCAL:
-      break;
-    }
-
-  switch (ek)
-    {
-    case XO_EXPOSED:    tallyAnnot (kind, QU_EXPOSED); break;
-    case XO_OBSERVER:   tallyAnnot (kind, QU_OBSERVER); break;
-    default:  break;
-    }
-
-  switch (ns)
-    {
-    case NS_ERROR:   break;
-    case NS_UNKNOWN:   break;
-    case NS_NOTNULL:   break;
-    case NS_MNOTNULL:  tallyAnnot (kind, QU_NOTNULL); break;
-    case NS_RELNULL:   tallyAnnot (kind, QU_RELNULL); break;
-    case NS_CONSTNULL: tallyAnnot (kind, QU_NULL); break;
-    case NS_POSNULL:   tallyAnnot (kind, QU_NULL); break;
-    case NS_DEFNULL: 
-    case NS_ABSNULL:   break;   
-    }
-}
-
-# endif
-
-static /*@observer@*/ cstring specCode_unparse (specCode s) /*@*/
-{
-  switch (s)
-    {
-    case SPC_NONE: return cstring_makeLiteralTemp ("normal");
-    case SPC_PRINTFLIKE: return cstring_makeLiteralTemp ("printflike");
-    case SPC_SCANFLIKE: return cstring_makeLiteralTemp ("scanflike");
-    case SPC_MESSAGELIKE: return cstring_makeLiteralTemp ("messagelike");
-    case SPC_LAST: return cstring_makeLiteralTemp ("");
-    }
-
-  BADEXIT;
-}
-
-static specCode specCode_fromInt (int i)
-{
-  /*@+enumint@*/
-  llassert (i >= SPC_NONE && i < SPC_LAST);
-
-  return ((specCode) i);
-  /*@=enumint@*/
-}
-
-/*@observer@*/ cstring uentry_specOrDefName (uentry u) 
-{
-  if (uentry_isDeclared (u))
-    {
-      return cstring_makeLiteralTemp ("previously declared");
-    }
-  else
-    {
-      return cstring_makeLiteralTemp ("specified");
-    }
-}
-
-/*@observer@*/ cstring uentry_specDeclName (uentry u) 
-{
-  if (uentry_isDeclared (u))
-    {
-      return cstring_makeLiteralTemp ("previous declaration");
-    }
-  else
-    {
-      return cstring_makeLiteralTemp ("specification");
-    }
-}
-
-static /*@observer@*/ cstring uentry_reDefDecl (uentry old, uentry unew)  /*@*/ 
-{
-  if (uentry_isCodeDefined (old) && uentry_isCodeDefined (unew))
-    {
-      return cstring_makeLiteralTemp ("redefined");
-    }
-  else if (uentry_isCodeDefined (unew))
-    {
-      return cstring_makeLiteralTemp ("defined");
-    }
-  else if (uentry_isDeclared (old) && uentry_isDeclared (unew))
-    {
-      return cstring_makeLiteralTemp ("redeclared");
-    }
-  else
-    {
-      return cstring_makeLiteralTemp ("declared");
-    }
-}
-
-
-/*drl7x*/
-constraintList uentry_getFcnPreconditions (uentry ue)
-{
-  if (uentry_isValid (ue))
-    {
-	{
-	  if (uentry_isVariable (ue) && ctype_isFunction (uentry_getType (ue)))
-	    {
-	      uentry_makeVarFunction (ue);
-	    }
-
-	  //llassert (uentry_isFunction (ue));
-	  //llassert ((ue->info->fcn->preconditions));
-  //llassert ((ue->info->fcn->preconditions));
-	  if (!uentry_isFunction (ue))
-	    {
-	      TPRINTF ( (message ("called uentry_getFcnPreconditions on nonfunction %s",
-				  uentry_unparse (ue) ) ) );
-	      	  if (!uentry_isSpecified (ue) )
-		    {
-		      TPRINTF((message ("called uentry_getFcnPreconditions on nonfunction %s",
-					uentry_unparse (ue) ) ));
-		      return constraintList_undefined;
-		    }
-	  
-
-		  return constraintList_undefined;
-	    }
-
-	  if (ue->info->fcn->preconditions)
-	    {
-	   return constraintList_copy (ue->info->fcn->preconditions);
-	    }
-	  else
-	    {
-	      return NULL;
-	    }
-	}
-	
-    }
-  
-  return constraintList_undefined;
-  
-}
-
-
-/*drl
-  12/28/2000
-*/
-constraintList uentry_getFcnPostconditions (uentry ue)
-{
-  if (uentry_isValid (ue))
-    {
-	{
-	  if (uentry_isVariable (ue) && ctype_isFunction (uentry_getType (ue)))
-	    {
-	      uentry_makeVarFunction (ue);
-	    }
-
-	  //llassert (uentry_isFunction (ue));
-	  //llassert ((ue->info->fcn->preconditions));
-	  /* if (!uentry_isSpecified (ue) )
-	    {
-	      TPRINTF((message ("called uentry_getFcnPostconditions on nonfunction %s",
-				  uentry_unparse (ue) ) ));
-	      //    return constraintList_undefined;
-	      }*/
-	  
-	  if (!uentry_isFunction (ue))
-	    {
-	      /*llcontbug*/ TPRINTF( (message ("called uentry_getFcnPostconditions on nonfunction %s",
-				  uentry_unparse (ue) ) ) );
-	      return constraintList_undefined;
-	    }
-
-	  if (ue->info->fcn->postconditions)
-	    {
-	   return constraintList_copy (ue->info->fcn->postconditions);
-	    }
-	  else
-	    {
-	      return NULL;
-	    }
-	}
-	
-    }
-  
-  return constraintList_undefined;
-  
-}
-
-
-static /*@only@*/ fileloc setLocation (void)
-{
-  fileloc fl = context_getSaveLocation ();
-
-  if (fileloc_isDefined (fl)) 
-    {
-      return fl;
-    }
-  else
-    {
-      return fileloc_copy (g_currentloc);
-    }
-}
-
-/*@notnull@*/ uentry uentry_makeEnumConstant (cstring n, ctype t)
-{
-  fileloc loc = setLocation ();
-  uentry ue = uentry_makeConstant (n, t, loc);
-
-  ue->ukind = KENUMCONST;
-  uentry_setDefined (ue, loc);
-  return ue;
-}
-
-/*@notnull@*/ uentry uentry_makeEnumInitializedConstant (cstring n, ctype t, exprNode expr)
-{
-  fileloc loc = setLocation ();
-  uentry ue = uentry_makeConstant (n, t, loc);
-  ctype etype = exprNode_getType (expr);
-
-  if (!ctype_isRealInt (etype)) {
-    voptgenerror 
-      (FLG_ENUMMEMBERS,
-       message
-       ("Value of enum member is not an integeral type (type %s): %s",
-	ctype_unparse (etype), exprNode_unparse (expr)),
-       exprNode_loc (expr));
-  }
-  
-  ue->ukind = KENUMCONST;
-  uentry_setDefined (ue, loc);
-  return ue;
-}
-
-# ifndef NOLCL
-/*@notnull@*/ uentry uentry_makeSpecEnumConstant (cstring n, ctype t, fileloc loc)
-{
-  uentry ue = uentry_makeConstant (n, t, loc);
-
-  ue->ukind = KENUMCONST;
-  return ue;
-}
-# endif
-
-/*@notnull@*/ uentry uentry_makeVariableLoc (cstring n, ctype t)
-{
-  return uentry_makeVariable (n, t, setLocation (), FALSE);
-}
-
-# ifndef NOLCL
-/*@notnull@*/ /*@only@*/ uentry uentry_makeUnnamedVariable (ctype t)
-{
-  return uentry_makeVariable (cstring_undefined, t, setLocation (), FALSE);
-}
-# endif
-
-/*@notnull@*/ uentry uentry_makeIdDatatype (idDecl id)
-{
-  ctype ct = idDecl_getCtype (id);
-  uentry ue = uentry_makeDatatype (idDecl_observeId (id), ct, 
-				   MAYBE, MAYBE, setLocation ());
-
-  uentry_reflectQualifiers (ue, idDecl_getQuals (id));
-  
-  if (!ynm_isOn (ue->info->datatype->abs))
-    {
-      if (ctype_isUnknown (ct))
-	{
-	  ue->info->datatype->mut = MAYBE;
-	}
-      else
-	{
-	  ue->info->datatype->mut = ynm_fromBool (ctype_isMutable (ct));
-	}
-    }
-  
-  return ue;
-}
-
-void uentry_checkParams (uentry ue)
-{
-  if (uentry_isValid (ue))
-    {
-      bool isExt = uentry_isExtern (ue);
-
-      if (uentry_isRealFunction (ue))
-	{
-	  uentryList params = uentry_getParams (ue);
-
-	  uentryList_elements (params, current)
-	    {
-	      if (uentry_isValid (current))
-		{
-		  ctype ct = current->utype;		      
-		  
-		  if (ctype_isFixedArray (ct))
-		    {
-		      if (ctype_isArray (ctype_baseArrayPtr (ct))
-			  && !ctype_isFixedArray (ctype_baseArrayPtr (ct)))
-			{
-			  ;
-			}
-		      else
-			{
-			  voptgenerror 
-			    (FLG_FIXEDFORMALARRAY,
-			     message ("Function parameter %q declared as "
-				      "manifest array (size constant is meaningless)",
-				      uentry_getName (current)),
-			     uentry_whereDeclared (current));
-			}
-		    }
-		  else 
-		    {
-		      if (ctype_isArray (ct))
-			{
-			  voptgenerror 
-			    (FLG_FORMALARRAY,
-			     message ("Function parameter %q declared as "
-				      "array (treated as pointer)", 
-				      uentry_getName (current)),
-			     uentry_whereDeclared (current));
-			}
-		    }
-
-		  if (sRef_getNullState (uentry_getSref (current)) == NS_MNOTNULL)
-		    {
-		      if (ctype_isAbstract (ct) && 
-			  (isExt || (ctype_isAbstract (ctype_realType (ct))
-				     && !context_hasFileAccess (ctype_typeId (ct)))))
-			{
-			  vgenhinterror 
-			    (FLG_INCONDEFS,
-			     message 
-			     ("Function %q declared with notnull parameter %q of abstract "
-			      "type %s",
-			      uentry_getName (ue),
-			      uentry_getName (current),
-			      ctype_unparse (ct)),
-			     message 
-			     ("Since %s is an abstract type, notnull can only be "
-			      "used for parameters if the function is static to a "
-			      "module where %s is accessible.",
-			      ctype_unparse (ct),
-			      ctype_unparse (ct)),
-			     uentry_whereDeclared (current));
-			}
-		    }
-		}
-	    } end_uentryList_elements;
-	  
-	  if (sRef_getNullState (uentry_getSref (ue)) == NS_MNOTNULL)
-	    {
-	      ctype ct = ue->utype;
-		  
-	      if (ctype_isAbstract (ct) 
-		  && (isExt || (ctype_isAbstract (ctype_realType (ct))
-				&& !context_hasFileAccess (ctype_typeId (ct)))))
-		{
-		  vgenhinterror 
-		    (FLG_INCONDEFS,
-		     message 
-		     ("%s %q declared %s notnull storage of abstract type %s",
-		      ekind_capName (uentry_getKind (ue)),
-		      uentry_getName (ue),
-		      fcnErrName (ue),
-		      ctype_unparse (ct)),
-		     message 
-		     ("Since %s is an abstract type, notnull can only be used "
-		      "if it is static to a module where %s is accessible.",
-		      ctype_unparse (ct),
-		      ctype_unparse (ct)),
-		     uentry_whereDeclared (ue));
-		}
-	    }
-	}
-    }
-}
-
-static void reflectImplicitFunctionQualifiers (/*@notnull@*/ uentry ue, bool spec)
-{
-  alkind ak = sRef_getAliasKind (ue->sref);
-
-  if (alkind_isRefCounted (ak))
-    {
-      sRef_setAliasKind (ue->sref, AK_NEWREF, fileloc_undefined);
-    }
-  else 
-    {
-      if (alkind_isUnknown (ak))
-	{
-	  exkind ek = sRef_getExKind (ue->sref);
-	  
-	  if (exkind_isKnown (ek))
-	    {
-	      sRef_setAliasKind (ue->sref, AK_IMPDEPENDENT, fileloc_undefined);
-	    }
-	  else 
-	    {
-	      if (context_getFlag (spec ? FLG_SPECRETIMPONLY : FLG_RETIMPONLY))
-		{
-		  if (ctype_isVisiblySharable 
-		      (ctype_realType (ctype_returnValue (ue->utype))))
-		    {
-		      if (uentryList_hasReturned (uentry_getParams (ue)))
-			{
-			  ;
-			}
-		      else
-			{
-			  sRef_setAliasKind (ue->sref, AK_IMPONLY, 
-					     fileloc_undefined);
-			  			}
-		    }
-		}
-	    }
-	}
-    }
-}
-
-static /*@notnull@*/ uentry 
-uentry_makeFunctionAux (cstring n, ctype t, 
-			typeIdSet access,
-			/*@only@*/ globSet globs, 
-			/*@only@*/ sRefSet mods, 
-			/*@keep@*/ fileloc f, bool priv,
-			/*@unused@*/ bool isForward)
-{
-  uentry e = uentry_alloc ();
-  ctype ret;
-
-  if (ctype_isFunction (t))
-    {
-      ret = ctype_returnValue (t);
-    }
-  else
-    {
-      if (ctype_isKnown (t))
-	{
-	  llbug (message ("not function: %s", ctype_unparse (t)));
-	}
-      ret = ctype_unknown;
-    }
-
-  e->ukind = KFCN;
-
-  if (fileloc_isSpec (f) || fileloc_isImport (f))
-    {
-      e->whereSpecified = f;
-      e->whereDeclared = fileloc_undefined;
-    }
-  else
-    {
-      e->whereSpecified = fileloc_undefined;
-      e->whereDeclared = f;
-    }
-
-  /* e->shallowCopy = FALSE; */
-  e->uname = cstring_copy (n);
-  e->utype = t;
-  e->storageclass = SCNONE;
-
-    e->sref = sRef_makeType (ret);
-
-  if (ctype_isUA (ret))
-    {
-      sRef_setStateFromType (e->sref, ret);
-    }
-  
-  e->used = FALSE;
-  e->lset = FALSE;
-  e->uses = filelocList_new ();
-  e->isPrivate = priv;
-  e->hasNameError = FALSE;
-
-  e->info = (uinfo) dmalloc (sizeof (*e->info));
-  e->info->fcn = (ufinfo) dmalloc (sizeof (*e->info->fcn));
-
-  e->info->fcn->hasMods = sRefSet_isDefined (mods);
-  e->info->fcn->hasGlobs = globSet_isDefined (globs);
-
-  e->info->fcn->exitCode = XK_UNKNOWN;
-  e->info->fcn->nullPred = QU_UNKNOWN;
-  e->info->fcn->specialCode = SPC_NONE;
-
-  e->info->fcn->access = access;
-  e->info->fcn->globs = globs;
-  e->info->fcn->defparams = uentryList_undefined;
-
-  sRef_setDefined (e->sref, f);
-  e->whereDefined = fileloc_undefined;
-  
-  e->info->fcn->mods = sRefSet_undefined;
-  e->info->fcn->specclauses = NULL;
-
-  /*drl 11 29 2000*/
-  e->info->fcn->preconditions = NULL;
-  /*end drl*/
-  
-  /*drl 12 28 2000*/
-  e->info->fcn->postconditions = NULL;
-  /*end drl*/
-  
-  checkGlobalsModifies (e, mods);
-  e->info->fcn->mods = mods;
-
-  return (e);
-}
-
-/*@notnull@*/ uentry uentry_makeIdFunction (idDecl id)
-{
-  uentry ue = 
-    uentry_makeFunction (idDecl_observeId (id), idDecl_getCtype (id), 
-			 typeId_invalid, globSet_undefined, 
-			 sRefSet_undefined, 
-			 setLocation ());
-  
-  uentry_reflectQualifiers (ue, idDecl_getQuals (id));
-  reflectImplicitFunctionQualifiers (ue, FALSE);
-
-  if (!uentry_isStatic (ue)
-      && cstring_equalLit (ue->uname, "main"))
-    {
-      ctype typ = ue->utype;
-      ctype retval;
-      uentryList args;
-
-      llassert (ctype_isFunction (typ));
-
-      retval = ctype_returnValue (typ);
-
-      if (!ctype_isInt (retval))
-	{
-	  voptgenerror 
-	    (FLG_MAINTYPE,
-	     message ("Function main declared to return %s, should return int",
-		      ctype_unparse (retval)),
-	     uentry_whereDeclared (ue));
-	}
-
-      args = ctype_argsFunction (typ);
-
-      if (uentryList_isMissingParams (args) 
-	  || uentryList_size (args) == 0)
-	{
-	  ;
-	}
-      else
-	{
-	  if (uentryList_size (args) != 2)
-	    {
-	      voptgenerror 
-		(FLG_MAINTYPE,
-		 message ("Function main declared with %d arg%p, "
-			  "should have 2 (int argc, char *argv[])",
-			  uentryList_size (args)),
-		 uentry_whereLast (ue));
-	    }
-	  else
-	    {
-	      uentry arg = uentryList_getN (args, 0);
-	      ctype ct = uentry_getType (arg);
-
-	      if (!ctype_isInt (ct))
-		{
-		  voptgenerror 
-		    (FLG_MAINTYPE,
-		     message ("Parameter 1, %q, of function main declared "
-			      "with type %t, should have type int",
-			      uentry_getName (arg), ct),
-		     uentry_whereDeclared (arg));
-		}
-
-	      arg = uentryList_getN (args, 1);
-	      ct = uentry_getType (arg);
-
-	      if (ctype_isArrayPtr (ct)
-		  && ctype_isArrayPtr (ctype_baseArrayPtr (ct))
-		  && ctype_isChar (ctype_baseArrayPtr (ctype_baseArrayPtr (ct))))
-		{
-		  ;
-		}
-	      else
-		{
-		  voptgenerror 
-		    (FLG_MAINTYPE,
-		     message ("Parameter 2, %q, of function main declared "
-			      "with type %t, should have type char **",
-			      uentry_getName (arg), ct),
-		     uentry_whereDeclared (arg));
-		}
-	    }
-	}
-    }
-
-  return ue;
-}
-
-static void uentry_implicitParamAnnots (/*@notnull@*/ uentry e)
-{
-  alkind ak = sRef_getAliasKind (e->sref);
-
-  if ((alkind_isUnknown (ak) || alkind_isImplicit (ak))
-      && context_getFlag (FLG_PARAMIMPTEMP))
-    {
-      exkind ek = sRef_getExKind (e->sref);
-      
-      if (exkind_isKnown (ek))
-	{
-	  sRef_setAliasKind (e->sref, AK_IMPDEPENDENT, fileloc_undefined);
-	  sRef_setOrigAliasKind (e->sref, AK_IMPDEPENDENT);
-	}
-      else
-	{
-	  sRef_setAliasKind (e->sref, AK_IMPTEMP, fileloc_undefined);
-	  sRef_setOrigAliasKind (e->sref, AK_IMPTEMP);
-	}
-    }
-}
-
-static /*@only@*/ /*@notnull@*/ uentry 
-uentry_makeVariableParamAux (cstring n, ctype t, sRef s, sstate defstate)
-{
-  cstring pname = makeParam (n);
-  uentry e = uentry_makeVariableAux (pname, t, setLocation (), s, FALSE, VKPARAM);
-
-  cstring_free (pname);
-  uentry_implicitParamAnnots (e);
-
-  if (!sRef_isAllocated (e->sref) && !sRef_isPartial (e->sref))
-    {
-      sRef_setDefState (e->sref, defstate, uentry_whereDeclared (e));
-      e->info->var->defstate = defstate;
-    }
-
-  return (e);
-}
-
-# ifndef NOLCL
-void
-uentry_setRefCounted (uentry e)
-{
-  if (uentry_isValid (e))
-    {
-      uentry_setAliasKind (e, AK_REFCOUNTED);
-      sRef_storeState (e->sref);
-    }
-}
-# endif
-
-void
-uentry_setStatic (uentry c)
-{
-  if (uentry_isValid (c)) 
-    {
-      alkind ak = sRef_getAliasKind (c->sref);
-      c->storageclass = SCSTATIC;
-
-      if (uentry_isVariable (c) && !ctype_isFunction (uentry_getType (c)))
-	{
-	  if (!alkind_isUnknown (ak)
-	      && !alkind_isStatic (ak))
-	    {
-	      if  (!(ctype_isRealPointer (uentry_getType (c)))
-		   && !(ctype_isAbstract (ctype_realType (uentry_getType (c))))
-		   && !alkind_isRefCounted (ak))
-		{
-		  if (alkind_isImplicit (ak)
-		      && alkind_isDependent (ak)
-		      && ctype_isArray (uentry_getType (c)))
-		    {
-		      ; /* no error for observer arrays */
-		    }
-		  else
-		    {
-		      voptgenerror 
-			(FLG_INCONDEFS,
-			 message ("Static storage %q declared as %s",
-				  uentry_getName (c),
-				  alkind_unparse (ak)),
-			 uentry_whereDeclared (c));
-		    }
-		}
-	    }
-	  else
-	    {
-	      if (alkind_isUnknown (ak)
-		  || (alkind_isImplicit (sRef_getAliasKind (c->sref))
-		      && !alkind_isDependent (sRef_getAliasKind (c->sref))))
-		{
-		  sRef_setAliasKind (c->sref, AK_STATIC, fileloc_undefined);
-		  sRef_setOrigAliasKind (c->sref, AK_STATIC);
-		}
-	    }
-	}
-    }
-}
-
-void
-uentry_setExtern (uentry c)
-{
-  if (uentry_isValid (c)) 
-    c->storageclass = SCEXTERN;
-}
-
-void
-uentry_setParamNo (uentry ue, int pno)
-{
-  llassert (uentry_isAnyParam (ue) && sRef_isParam (ue->sref));
-  sRef_setParamNo (ue->sref, pno);
-}
-
-static
-void checkGlobalsModifies (/*@notnull@*/ uentry ue, sRefSet sr)
-{
-  sRefSet_allElements (sr, el)
-    {
-      sRef base = sRef_getRootBase (el);
-      
-      if (sRef_isGlobal (base) || sRef_isInternalState (base)
-	  || (sRef_isKindSpecial (base) && !sRef_isNothing (base)))
-	{
-	  if (!globSet_member (ue->info->fcn->globs, base))
-	    {
-	      if (uentry_hasGlobs (ue)
-		  || context_getFlag (FLG_WARNMISSINGGLOBALSNOGLOBS))
-		{
-		  if (optgenerror 
-		      (FLG_WARNMISSINGGLOBALS,
-		       message
-		       ("Modifies list for %q uses global %q, "
-			"not included in globals list.",
-			uentry_getName (ue),
-			sRef_unparse (base)),
-		       uentry_whereLast (ue)))
-		    {
-		      uentry_showWhereSpecified (ue);
-		    } 
-		}
-	      
-	      ue->info->fcn->globs = globSet_insert (ue->info->fcn->globs, 
-						     base);
-	      if (sRef_isFileStatic (base))
-		{
-		  context_recordFileGlobals (ue->info->fcn->globs);
-		}
-	    }
-	}
-    } end_sRefSet_allElements;
-}
-
-uentry
-uentry_makeVariableSrefParam (cstring n, ctype t, sRef s)
-{
-  return (uentry_makeVariableParamAux (n, t, s, SS_UNKNOWN));
-}
-
-void
-uentry_fixupSref (uentry ue)
-{
-  sRef sr;
-  
-  if (uentry_isUndefined (ue) || uentry_isElipsisMarker (ue)) 
-    {
-      return;
-    }
-  
-  sr = uentry_getSref (ue);
-
-  sRef_resetState (sr);
-  sRef_clearDerived (sr);
-  
-  llassertprint (uentry_isVariable (ue), ("fixing: %s", uentry_unparseFull (ue)));
-  llassert (sRef_isValid (sr)); 
-  
-  if (uentry_isVariable (ue))
-    {
-      sRef_setDefState (sr, ue->info->var->defstate, fileloc_undefined);
-      sRef_setNullState (sr, ue->info->var->nullstate, fileloc_undefined);
-    }
-}
-
-void uentry_setSpecialClauses (uentry ue, specialClauses clauses)
-{
-  llassert (uentry_isFunction (ue));
-  llassert (!specialClauses_isDefined (ue->info->fcn->specclauses));
-
-  ue->info->fcn->specclauses = clauses;
-  specialClauses_checkAll (ue);
-}
-
-/*
-** Used for @modifies@ @endmodifies@ syntax.
-**
-** If ue is specified, sr must contain *only*:
-**
-**      o file static globals
-**      o sRef's derived from modifies spec (i.e., more specific than
-**        what was specified)
-**
-** Otherwise, if sr has modifies it must match sr.
-**
-** If it doesn't have modifies, set them to sr.
-*/
-
-void
-uentry_setModifies (uentry ue, /*@owned@*/ sRefSet sr)
-{
-  if (sRef_modInFunction ())
-    {
-      llparseerror
-	(message ("Modifies list not in function context.  "
-		  "A modifies list can only appear following the parameter list "
-		  "in a function declaration or header."));
-
-      /*@-mustfree@*/ return; /*@=mustfree@*/ 
-    }
-
-  if (sRefSet_hasStatic (sr))
-    {
-      context_recordFileModifies (sr);
-    }
-
-  if (uentry_isValid (ue))
-    {
-      if (uentry_isIter (ue))
-	{
-	  llassert (sRefSet_isUndefined (ue->info->iter->mods));
-	  ue->info->iter->mods = sr;
-	}
-      else
-	{
-	  if (uentry_isVariable (ue) && ctype_isFunction (uentry_getType (ue)))
-	    {
-	      uentry_makeVarFunction (ue);
-	    }
-	  
-	  llassertfatal (uentry_isFunction (ue));
-	  llassert (sRefSet_isUndefined (ue->info->fcn->mods));
-	  
-	  ue->info->fcn->mods = sr;
-	  ue->info->fcn->hasMods = TRUE;
-	  
-	  checkGlobalsModifies (ue, sr);
-	}
-      
-      if (context_getFlag (FLG_MODIFIESIMPNOGLOBALS))
-	{
-	  ue->info->fcn->hasGlobs = TRUE;
-	}
-    }
-  else
-    {
-      sRefSet_free (sr);
-    }
-}
-
-void
-uentry_setPreconditions (uentry ue, /*@owned@*/ constraintList preconditions)
-{
-  if (sRef_modInFunction ())
-    {
-      llparseerror
-	(message ("Precondition list not in function context.  "
-		  "A precondition list can only appear following the parameter list "
-		  "in a function declaration or header."));
-
-      /*@-mustfree@*/ return; /*@=mustfree@*/ 
-    }
-
-  if (uentry_isValid (ue))
-    {
-	{
-	  if (uentry_isVariable (ue) && ctype_isFunction (uentry_getType (ue)))
-	    {
-	      uentry_makeVarFunction (ue);
-	    }
-	  
-	  llassertfatal (uentry_isFunction (ue));
-	  //	  llassert (sRefSet_isUndefined (ue->info->fcn->mods));
-	  
-	  ue->info->fcn->preconditions = preconditions;
-	}
-	
-    }
-  else
-    {
-      //
-    }
-}
-
-/*
-  drl
-  added 12/28/2000
-*/
-void
-uentry_setPostconditions (uentry ue, /*@owned@*/ constraintList postconditions)
-{
-  if (sRef_modInFunction ())
-    {
-      llparseerror
-	(message ("Postcondition list not in function context.  "
-		  "A postcondition list can only appear following the parameter list "
-		  "in a function declaration or header."));
-
-      /*@-mustfree@*/ return; /*@=mustfree@*/ 
-    }
-
-  if (uentry_isValid (ue))
-    {
-	{
-	  if (uentry_isVariable (ue) && ctype_isFunction (uentry_getType (ue)))
-	    {
-	      uentry_makeVarFunction (ue);
-	    }
-	  
-	  llassertfatal (uentry_isFunction (ue));
-	  //	  llassert (sRefSet_isUndefined (ue->info->fcn->mods));
-	  
-	  ue->info->fcn->postconditions = postconditions;
-	}
-	
-    }
-  else
-    {
-      //
-    }
-}
-
-/*
-** requires: new and old are functions
-*/
- 
-static void
-checkGlobalsConformance (/*@notnull@*/ uentry old, 
-			 /*@notnull@*/ uentry unew, 
-			 bool mustConform, bool completeConform)
-{
-  bool hasInternalState = FALSE;
-
-  old->info->fcn->hasGlobs |= unew->info->fcn->hasGlobs;
-
-  if (globSet_isDefined (unew->info->fcn->globs))
-    {
-      globSet_allElements (unew->info->fcn->globs, el)
-	{
-	  if (sRef_isFileStatic (el))
-	    {
-	      sRef sr = globSet_lookup (old->info->fcn->globs, el);
-
-	      if (sRef_isInvalid (sr))
-		{
-		  bool hasError = FALSE;
-
-		  if (!hasInternalState 
-		      && sRef_isInvalid (globSet_lookup (old->info->fcn->globs,
-							 sRef_makeInternalState ()))
-		      && sRef_isInvalid (globSet_lookup (old->info->fcn->globs,
-							 sRef_makeSpecState ())))
-		    {
-		      if (mustConform 
-			  && !uentry_isStatic (old)
-			  && optgenerror 
-			  (FLG_INCONDEFS,
-			   message ("Globals list for %q includes internal state, %q, "
-				    "but %s without globals internalState.",
-				    uentry_getName (old),
-				    sRef_unparse (el),
-				    uentry_specOrDefName (old)),
-			   uentry_whereLast (unew)))
-			{
-			  uentry_showWhereSpecified (old);
-			  hasError = TRUE;
-			}
-		      
-		      old->info->fcn->globs = globSet_insert (old->info->fcn->globs,
-							      sRef_makeInternalState ());
-		      hasInternalState = TRUE;
-		    }
-
-		  if (!hasError
-		      && fileloc_sameFile (uentry_whereDeclared (unew),
-					   uentry_whereDeclared (old)))
-		    {
-		      if (mustConform
-			  && optgenerror 
-			  (FLG_INCONDEFS,
-			   message ("Function %q inconsistently %rdeclared (in "
-				    "same file) with file static global %q in "
-				    "globals list",
-				    uentry_getName (unew),
-				    uentry_isDeclared (old),
-				    sRef_unparse (el)),
-			   uentry_whereDeclared (unew)))
-			{
-			  uentry_showWhereSpecified (old);
-			}
-		    }
-		}
-
-	      old->info->fcn->globs = globSet_insert (old->info->fcn->globs, el);
-	      context_recordFileGlobals (old->info->fcn->globs);
-	    }
-	  else
-	    {
-	      sRef sr = globSet_lookup (old->info->fcn->globs, el);
-	      
-	      if (sRef_isInvalid (sr))
-		{
-		  if (mustConform
-		      && optgenerror 
-		      (FLG_INCONDEFS,
-		       message ("Function %q inconsistently %rdeclared with "
-				"%q in globals list",
-				uentry_getName (unew),
-				uentry_isDeclared (old),
-				sRef_unparse (el)),
-		       uentry_whereDeclared (unew)))
-		    {
-		      old->info->fcn->globs = globSet_insert (old->info->fcn->globs, el);
-		      uentry_showWhereSpecified (old);
-		    }
-		}
-	      else
-		{
-		  if (!bool_equal (sRef_isAllocated (el), sRef_isAllocated (sr)))
-		    {
-		      if (mustConform
-			  && optgenerror 
-			  (FLG_INCONDEFS,
-			   message 
-			   ("Function %q global %q inconsistently "
-			    "%rdeclared as %qout global",
-			    uentry_getName (unew),
-			    sRef_unparse (el),
-			    uentry_isDeclared (old),
-			    cstring_makeLiteral (sRef_isAllocated (el) ? "" : "non-")),
-			   uentry_whereDeclared (unew)))
-			{
-			  uentry_showWhereSpecified (old);
-			}
-		    }
-		}
-	    }
-	} end_globSet_allElements ;
-
-      if (completeConform)
-	{
-	  globSet_allElements (old->info->fcn->globs, el)
-	    {
-	      sRef sr = globSet_lookup (unew->info->fcn->globs, el);
-	      
-	      if (sRef_isInvalid (sr))
-		{
-		  if (mustConform
-		      && uentry_isReallySpecified (old)
-		      && optgenerror 
-		      (FLG_NEEDSPEC,
-		       message ("Function %q specified with %q in globals list, "
-				"but declared without %q",
-				uentry_getName (unew),
-				sRef_unparse (el),
-				sRef_unparse (el)),
-		       uentry_whereDeclared (unew)))
-		    {
-		      uentry_showWhereSpecified (old);
-		    }
-		}
-	    } end_globSet_allElements;
-	}
-    }
-  else
-    {
-      if (completeConform && !globSet_isEmpty (old->info->fcn->globs))
-	{
-	  if (uentry_isReallySpecified (old)
-	      && optgenerror 
-	      (FLG_NEEDSPEC,
-	       message ("%s %q specified with globals list, but "
-			"declared with no globals",
-			ekind_capName (unew->ukind),
-			uentry_getName (unew)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      llgenindentmsg 
-		(message ("Specification globals: %q", 
-			  globSet_unparse (old->info->fcn->globs)),
-		 uentry_whereSpecified (old));
-	    }
-	}
-      
-      unew->info->fcn->globs = globSet_copy (unew->info->fcn->globs, 
-					    old->info->fcn->globs);
-    }
-}
-
-/*
-** new modifies list must be included by old modifies list.
-**
-** file static state may be added to new, if old has internal.
-*/
-
-static void
-checkModifiesConformance (/*@notnull@*/ uentry old, /*@notnull@*/ uentry unew, 
-			  bool mustConform, bool completeConform)
-{
-  sRefSet newMods;
-  bool changedMods = FALSE;
-  bool modInternal = FALSE;
-
-  llassert (uentry_isFunction (old) && uentry_isFunction (unew));
-
-  old->info->fcn->hasMods |= unew->info->fcn->hasMods;
-  newMods = unew->info->fcn->mods;
-	    
-  if (sRefSet_isEmpty (newMods))
-    {
-      if (completeConform && !sRefSet_isEmpty (old->info->fcn->mods)
-	  && uentry_isReallySpecified (old))
-	{
-	  if (optgenerror 
-	      (FLG_NEEDSPEC,
-	       message ("%s %q specified with modifies clause, "
-			"but declared with no modifies clause",
-			ekind_capName (unew->ukind),
-			uentry_getName (unew)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      llgenindentmsg (message ("Specification has modifies %q", 
-				       sRefSet_unparse (old->info->fcn->mods)),
-			      uentry_whereSpecified (old));
-	    }
-	}
-
-      return;
-    }
-
-  sRefSet_allElements (newMods, current)
-    {
-      if (sRef_isValid (current))
-	{
-	  sRef rb = sRef_getRootBase (current);
-	  
-	  if (sRef_isFileStatic (rb))
-	    {
-	      if (!modInternal)
-		{
-		  if (!sRefSet_isSameMember (old->info->fcn->mods, 
-					     sRef_makeInternalState ())
-		      && !sRefSet_isSameMember (old->info->fcn->mods, 
-						sRef_makeSpecState ()))
-		    {
-		      if (mustConform 
-			  && !uentry_isStatic (old)
-			  && optgenerror 
-			  (FLG_INCONDEFS,
-			   message
-			   ("Modifies list for %q includes internal state, "
-			    "but %s without modifies internal.",
-			    uentry_getName (old),
-			    uentry_specOrDefName (old)),
-			   uentry_whereLast (unew)))
-			{
-			  uentry_showWhereSpecified (old);
-			}
-		      
-		      old->info->fcn->mods = 
-			sRefSet_insert (old->info->fcn->mods, 
-					sRef_makeInternalState ());
-		      modInternal = TRUE;
-		    }
-		}
-	      
-	      old->info->fcn->mods = sRefSet_insert (old->info->fcn->mods,
-						     current);
-	      changedMods = TRUE;
-	    }
-	  else
-	    {
-	      if (sRef_canModifyVal (current, old->info->fcn->mods))
-		{
-		  int size = sRefSet_size (old->info->fcn->mods);
-
-		  old->info->fcn->mods = sRefSet_insert (old->info->fcn->mods,
-							 current);
-
-		  if (sRefSet_size (old->info->fcn->mods) != size)
-		    {
-		      changedMods = TRUE;
-		    }
-		}
-	      else
-		{
-		  if (mustConform
-		      && optgenerror 
-		      (FLG_INCONDEFS,
-		       message 
-		       ("Modifies list for %q contains %q, not modifiable "
-			"according to %s",
-			uentry_getName (old),
-			sRef_unparse (current),
-			uentry_specDeclName (old)),
-		       uentry_whereLast (unew)))
-		    {
-		      uentry_showWhereSpecified (old);
-		    }
-		}
-	    }
-	}
-    } end_sRefSet_allElements;
-
-  if (completeConform && uentry_isReallySpecified (old))
-    {
-      sRefSet_allElements (old->info->fcn->mods, el)
-	{
-	  if (sRef_canModify (el, newMods))
-	    {
-	      ; /* okay */
-	    }
-	  else
-	    {
-	      if (optgenerror 
-		  (FLG_NEEDSPEC,
-		   message 
-		   ("Specification modifies clause for %q contains %q, "
-		    "not included in declaration modifies clause",
-		    uentry_getName (old),
-		    sRef_unparse (el)),
-		   uentry_whereLast (unew)))
-		{
-		  uentry_showWhereSpecified (old);
-		}
-	    }
-	} end_sRefSet_allElements ;
-    } 
-
-  /*
-  ** Make sure file static elements will be removed.
-  */
-
-  if (changedMods)
-    {
-      context_recordFileModifies (old->info->fcn->mods);
-    }
-}
-
-static void 
-  uentry_checkMutableType (uentry ue)
-{
-  ctype ct = uentry_getType (ue);
-
-  if (!ctype_isRealPointer (ct) && !ctype_isRealAbstract (ct))
-    {
-      voptgenerror (FLG_MUTREP,
-		    message ("Mutable abstract type %q declared without pointer "
-			     "indirection: %t (violates assignment semantics)",
-			     uentry_getName (ue), ct),
-		    uentry_whereDeclared (ue));
-    }
-}
-
-void
-uentry_setMutable (uentry e)
-{
-  llassert (uentry_isDatatype (e));
-  e->info->datatype->mut = YES;
-}
-
-static void
-uentry_checkIterArgs (uentry ue)
-{
-  bool hasYield = FALSE;
-  uentryList args;
-
-  llassert (uentry_isIter (ue));
-
-  args = uentry_getParams (ue);
-
-  uentryList_elements (args, el)
-    {
-      sstate ds = uentry_getDefState (el);
-
-      if (uentry_isYield (el))
-	{
-	  hasYield = TRUE;
-	}
-
-      if (sstate_isUnknown (ds))
-	{
-	  uentry_setDefState (el, SS_DEFINED);
-	}
-      else
-	{
-	  ;
-	}
-    } end_uentryList_elements;
-
-  if (!hasYield)
-    {
-      voptgenerror (FLG_HASYIELD,
-		    message ("Iterator %q declared with no yield parameters",
-			     uentry_getName (ue)),
-		    uentry_whereDeclared (ue));
-    }
-}
-
-static chkind
-chkind_fromQual (qual qel)
-{
-  if (qual_isChecked (qel))
-    {
-      return CH_CHECKED;
-    }
-  else if (qual_isCheckMod (qel))
-    {
-      return CH_CHECKMOD;
-    }
-  else if (qual_isCheckedStrict (qel))
-    {
-      return CH_CHECKEDSTRICT;
-    }
-  else if (qual_isUnchecked (qel))
-    {
-      return CH_UNCHECKED;
-    }
-  else
-    {
-      BADEXIT;
-      /*@notreached@*/ return CH_UNKNOWN;
-    }
-}
-
-static void
-uentry_reflectOtherQualifier (/*@notnull@*/ uentry ue, qual qel)
-{
-  if (qual_isKillRef (qel) || qual_isNewRef (qel) || qual_isTempRef (qel))
-    {
-      if (!uentry_isRefCounted (ue))
-	{
-	  llerror 
-	    (FLG_SYNTAX, 
-	     message ("Reference counting qualifier %s used on non-reference "
-		      "counted storage: %q",
-		      qual_unparse (qel), 
-		      uentry_unparse (ue)));
-	}
-      else
-	{
-	  alkind ak = alkind_fromQual (qel);
-	  
-	  uentry_setAliasKind (ue, ak);
-	}
-    }
-  else if (qual_isRefCounted (qel))
-    {
-      ctype ct = ctype_realType (uentry_getType (ue));
-      ctype rt;
-      
-      if (ctype_isPointer (ct) 
-	  && (ctype_isStruct (rt = ctype_realType (ctype_baseArrayPtr (ct)))))
-	{
-	  /* check there is a refs field */
-	  uentryList fields = ctype_getFields (rt);
-	  uentry refs = uentry_undefined;
-
-	  uentryList_elements (fields, field)
-	    {
-	      if (uentry_isRefsField (field))
-		{
-		  if (uentry_isValid (refs))
-		    {
-		      llerror 
-			(FLG_SYNTAX, 
-			 message ("Reference counted structure type %s has "
-				  "multiple refs fields: %q and %q",
-				  ctype_unparse (ct),
-				  uentry_getName (refs),
-				  uentry_getName (field)));
-		    }
-		  
-		  refs = field;
-		}
-	    } end_uentryList_elements;
-
-	  if (uentry_isInvalid (refs))
-	    {
-	      vgenhinterror 
-		(FLG_SYNTAX, 
-		 message ("Reference counted structure type %s has "
-			  "no refs field",
-			  ctype_unparse (ct)),
-		 cstring_makeLiteral
-		 ("To count reference, the structure must have a field named "
-		  "refs of type int."),
-		 g_currentloc);		  
-	    }
-	  else if (!ctype_isInt (uentry_getType (refs)))
-	    {
-	      llerror 
-		(FLG_SYNTAX, 
-		 message ("Reference counted structure type %s refs field has "
-			  "type %s (should be int)", ctype_unparse (ct),
-			  ctype_unparse (uentry_getType (refs))));
-	    }
-	  else
-	    {
-	      sRef_setAliasKind (ue->sref, alkind_fromQual (qel), 
-				 uentry_whereDeclared (ue));
-	    }
-	}
-      else
-	{
-	  if ((ctype_isPointer (ct) 
-	       && ctype_isUnknown (ctype_realType (ctype_baseArrayPtr (ct))))
-	      ||ctype_isAbstract (ct) || ctype_isUnknown (ct))
-	    {
-	      sRef_setAliasKind (ue->sref, alkind_fromQual (qel), 
-				 uentry_whereDeclared (ue));
-	    }
-	  else
-	    {
-	      llerror 
-		(FLG_SYNTAX, 
-		 message ("Non-pointer to structure type %s declared with "
-			  "refcounted qualifier",
-			  ctype_unparse (ct)));
-	    }
-	}
-    }
-  else if (qual_isRefs (qel))
-    {
-      if (uentry_isVariable (ue) && !uentry_isParam (ue))
-	{
-	  uentry_setAliasKind (ue, AK_REFS);
-	}
-      else
-	{
-	  llerror 
-	    (FLG_SYNTAX, 
-	     message ("Refs qualifier used on non-structure field: %q",
-		      uentry_unparse (ue)));
-	}
-    }
-  else if (qual_isAliasQual (qel))
-    {
-      alkind ak = alkind_fromQual (qel);
-      bool okay = TRUE;
-      alkind oldak = uentry_getAliasKind (ue);
-      ctype ut = uentry_getType (ue);
-      
-      if (alkind_isImplicit (ak) 
-	  && (alkind_isKnown (oldak) && !alkind_isImplicit (oldak)))
-	{
-	  /* ignore the implied qualifier */
-	  okay = FALSE;
-	}
-      
-      if (uentry_isEitherConstant (ue))
-	{
-	  llerror 
-	    (FLG_SYNTAX, 
-	     message ("Alias qualifier %s used on constant: %q",
-		      alkind_unparse (ak), uentry_unparse (ue)));
-	  okay = FALSE;
-	}
-      
-      if (ctype_isFunction (ut))
-	{
-	  ut = ctype_returnValue (ut);
-	}
-      
-      if (!(ctype_isVisiblySharable (ut) 
-	    || ctype_isRealArray (ut)
-	    || ctype_isRealSU (ut)))
-	{
-	  if (!qual_isImplied (qel))
-	    {
-	      llerror 
-		(FLG_SYNTAX, 
-		 message ("Alias qualifier %s used on unsharable storage type %t: %q",
-			  alkind_unparse (ak), ut, uentry_getName (ue)));
-	    }
-	  
-	  okay = FALSE;
-	}
-      else
-	{
-	  if (uentry_isRefCounted (ue))
-	    {
-	      if (!(qual_isRefQual (qel) || qual_isOnly (qel)
-		    || qual_isExposed (qel) 
-		    || qual_isObserver (qel)))
-		{
-		  if (!qual_isImplied (qel))
-		    {
-		      llerror 
-			(FLG_SYNTAX, 
-			 message 
-			 ("Alias qualifier %s used on reference counted storage: %q",
-			  alkind_unparse (ak), 
-			  uentry_unparse (ue)));
-		    }
-		  
-		  okay = FALSE;
-		}
-	    }
-	  else
-	    {
-	      if (qual_isRefQual (qel))
-		{
-		  llerror 
-		    (FLG_SYNTAX, 
-		     message ("Qualifier %s used on non-reference counted storage: %q",
-			      alkind_unparse (ak), uentry_unparse (ue)));
-		  
-		  okay = FALSE;
-		}
-	    }
-	}
-      
-      if (okay)
-	{
-	  uentry_setAliasKind (ue, ak);
-	}
-    }
-  else if (qual_isNull (qel))
-    {
-      if (uentry_isConstant (ue))
-	{
-	  sRef_setNullState 
-	    (ue->sref, 
-	     ctype_isAbstract (ue->utype) ? NS_CONSTNULL : NS_DEFNULL, 
-	     uentry_whereDeclared (ue));
-	}
-      else
-	{
-	  uentry_setNullState (ue, NS_POSNULL);
-	}
-    }
-  else if (qual_isRelNull (qel))
-    {
-      uentry_setNullState (ue, NS_RELNULL);
-    }
-  else if (qual_isNotNull (qel))
-    {
-      uentry_setNullState (ue, NS_MNOTNULL);
-    }
-  else if (qual_isAbstract (qel)
-	   || qual_isConcrete (qel))
-    {
-      if (!uentry_isDatatype (ue))
-	{
-	  llerror 
-	    (FLG_SYNTAX, 
-	     message ("Qualifier %s used with non-datatype", 
-		      qual_unparse (qel)));
-	}
-      else
-	{
-	  ue->info->datatype->abs = ynm_fromBool (qual_isAbstract (qel));
-	}
-    }
-  else if (qual_isMutable (qel))
-    {
-      if (!uentry_isDatatype (ue))
-	{
-	  llerror (FLG_SYNTAX,
-		   message ("Qualifier %s used with non-datatype", qual_unparse (qel)));
-	}
-      else
-	{
-	  if (!ynm_isOn (ue->info->datatype->mut))
-	    {
-	      uentry_checkMutableType (ue);
-	    }
-	  
-	  ue->info->datatype->mut = YES;
-	}
-    }
-  else if (qual_isImmutable (qel))
-    {
-      if (!uentry_isDatatype (ue))
-	{
-	  llerror (FLG_SYNTAX, message ("Qualifier %s used with non-datatype", 
-					qual_unparse (qel)));
-	}
-      else
-	{
-	  ue->info->datatype->mut = NO;
-	}
-    }
-  else if (qual_isNullPred (qel))
-    {
-      if (uentry_isVariable (ue) && ctype_isFunction (uentry_getType (ue)))
-	{
-	  uentry_makeVarFunction (ue);
-	}
-      
-      if (uentry_isFunction (ue))
-	{
-	  ctype typ = uentry_getType (ue);
-	  ctype rtype = ctype_returnValue (uentry_getType (ue));
-	  
-	  if (ctype_isRealBool (rtype))
-	    {
-	      uentryList pl = ctype_argsFunction (typ);
-	      
-	      if (uentryList_size (pl) == 1)
-		{
-		  ue->info->fcn->nullPred = qel;
-		}
-	      else
-		{
-		  llerror (FLG_SYNTAX, 
-			   message ("Qualifier %s used with function having %d "
-				    "arguments (should have 1)", 
-				    qual_unparse (qel),
-				    uentryList_size (pl)));
-		}
-	    }
-	  else
-	    {
-	      llerror (FLG_SYNTAX, 
-		       message ("Qualifier %s used with function returning %s "
-				"(should return bool)", 
-				qual_unparse (qel),
-				ctype_unparse (rtype)));
-	    }
-	}
-      else
-	{
-	  llerror (FLG_SYNTAX, 
-		   message ("Qualifier %s used with non-function", 
-			    qual_unparse (qel)));
-	}
-    }
-  else if (qual_isExitQual (qel))
-    {
-      exitkind exk = exitkind_fromQual (qel);
-      
-      if (uentry_isFunction (ue))
-	{
-	  if (exitkind_isKnown (ue->info->fcn->exitCode))
-	    {
-	      llerror (FLG_SYNTAX, 
-		       message ("Multiple exit qualifiers used on function %q:  %s, %s", 
-				uentry_getName (ue),
-				exitkind_unparse (ue->info->fcn->exitCode),
-				exitkind_unparse (exk)));
-	    }
-	  
-	  ue->info->fcn->exitCode = exk;
-	}
-      else
-	{
-	  if (uentry_isVariable (ue) && ctype_isFunction (uentry_getType (ue)))
-	    {
-	      uentry_makeVarFunction (ue);
-	      ue->info->fcn->exitCode = exk;
-	    }
-	  else
-	    {
-	      llerror (FLG_SYNTAX,
-		       message ("Exit qualifier %s used with non-function (type %s)", 
-				qual_unparse (qel),
-				ctype_unparse (uentry_getType (ue))));
-	    }
-	}
-    }
-  else
-    {
-      if (qual_isCQual (qel))
-	{
-	  ; /* okay */
-	}
-      else
-	{
-	  llbug (message ("unhandled qualifier: %s", qual_unparse (qel)));
-	}
-    }
-}
-
-void
-uentry_reflectQualifiers (uentry ue, qualList q)
-{
-  llassert (uentry_isValid (ue)); 
-
-  qualList_elements (q, qel)
-    {
-      if (qual_isStatic (qel))
-	{
-	  uentry_setStatic (ue);
-	}
-      else if (qual_isUnused (qel))
-	{
-	  uentry_setUsed (ue, fileloc_undefined);	  
-	}
-      else if (qual_isExternal (qel))
-	{
-	  fileloc_free (ue->whereDefined);
-	  ue->whereDefined = fileloc_createExternal ();
-	}
-      else if (qual_isSef (qel))
-	{
-	  if (uentry_isVariable (ue))
-	    {
-	      vkind vk = ue->info->var->kind;
-
-	      llassert (vk != VKREFPARAM);
-
-	      if (vk == VKYIELDPARAM)
-		{
-		  llerror
-		    (FLG_SYNTAX,
-		     message ("Qualifier sef cannot be used with %s: %q",
-			      cstring_makeLiteralTemp (vk == VKYIELDPARAM ? "yield" : "returned"),
-			      uentry_unparse (ue)));
-		}
-	      else if (vk == VKRETPARAM)
-		{
-		  ue->info->var->kind = VKSEFRETPARAM;
-		}
-	      else
-		{
-		  ue->info->var->kind = VKSEFPARAM;
-		}
-	    }
-	  else
-	    {
-	      llerror 
-		(FLG_SYNTAX,
-		 message ("Qualifier sef is meaningful only on parameters: %q", 
-			  uentry_unparse (ue)));
-	    }
-	}
-      else if (qual_isExtern (qel))
-	{
-	  ue->storageclass = SCEXTERN;
-	}
-      else if (qual_isGlobalQual (qel)) /* undef, killed */
-	{
-	  if (uentry_isVariable (ue))
-	    {
-	      sstate oldstate = ue->info->var->defstate;
-	      sstate defstate = sstate_fromQual (qel);
-
-
-	      if ((oldstate == SS_UNDEFGLOB && defstate == SS_KILLED)
-		  || (oldstate == SS_KILLED && defstate == SS_UNDEFGLOB))
-		{
-		  defstate = SS_UNDEFKILLED;
-		}
-	      else 
-		{
-		  ; /* any errors? */
-		}
-
-	      sRef_setDefState (ue->sref, defstate, fileloc_undefined);
-	      ue->info->var->defstate = defstate;
-	    }
-	  else
-	    {
-	      llerror 
-		(FLG_SYNTAX, 
-		 message ("Qualifier %s used on non-variable: %q",
-			  qual_unparse (qel), uentry_unparse (ue)));	      
-	    }
-	}
-      /* start modifications */
-
-      else if( qual_isBufQualifier(qel) ) {
-        ctype ct = ctype_realType(uentry_getType(ue));
-
-        if( ctype_isArray(ct) || ctype_isPointer(ct) ) {
-
-            if( uentry_hasBufStateInfo(ue) )  {
-
-                if( qual_isNullTerminated(qel) ) {  /* handle Nullterm */
-                    
-                   if (uentry_isAnyParam(ue) || uentry_isReturned (ue)) {
-                                               /* If formal func param */
-                       uentry_setNullTerminatedState(ue); 
-                       uentry_setLen (ue, 1);
-                       uentry_setSize (ue, 1);
-
-                       sRef_setNullTerminatedState(uentry_getSref(ue));
-                       sRef_setLen (uentry_getSref(ue), 1);
-                       sRef_setSize (uentry_getSref(ue), 1);
-                   } else {
-                       uentry_setPossiblyNullTerminatedState(ue); 
-
-                       sRef_setPossiblyNullTerminatedState(uentry_getSref(ue));
-                   }
-
-                } 
-                /* put other BufState Qualifiers here */
-            } else {
-	      cstring s =  uentry_getName(ue);
-	      llfatalbug(message("INTERNAL Error: we have a NULL BufState \
-			struct for identifier %s\n", s) );
-            }
-         } else if (ctype_isFunction (ct)) { /* We have to handle function */
-
-            sRef retSref = uentry_getSref (ue);
-            ctype retType = sRef_getType (retSref);
-
-            if (ctype_isPointer (retType) || ctype_isArray (retType)) {
-	       sRef_setNullTerminatedState (retSref);
-
-            } else {
-              
-	 	llerror 
-	          (FLG_SYNTAX,
-		       message ("Qualifier %s used on non-pointer on \
-                            function return: %q", qual_unparse (qel),
-                                                    uentry_unparse (ue)));
-             }
-         }
-              
-         else  {
-	 	llerror 
-	          (FLG_SYNTAX,
-		       message ("Qualifier %s used on non-pointer: %q",
-			  qual_unparse (qel), uentry_unparse (ue)));	      
-	 }
-      }/* end else if */    
-      else if (qual_isAllocQual (qel)) /* out, partial, reldef, special, etc. */
-	{
-	  ctype realType = ctype_realType (ue->utype);
-	  sstate defstate = sstate_fromQual (qel);
-
-	  if (ctype_isFunction (realType))
-	    {
-	      realType = ctype_realType (ctype_returnValue (realType));
-	    }
-
-	  if (qual_isRelDef (qel))
-	    {
-	      ; /* okay anywhere */
-	    }
-	  else
-	    {
-	      if (!ctype_isAP (realType) 
-		  && !ctype_isSU (realType)
-		  && !ctype_isUnknown (realType)
-		  && !ctype_isAbstract (ue->utype))
-		{
-		  llerror 
-		    (FLG_SYNTAX, 
-		     message ("Qualifier %s used on non-pointer or struct: %q",
-			      qual_unparse (qel), uentry_unparse (ue)));
-		}
-	    }
-
-	  uentry_setDefState (ue, defstate);
-
-	  if (sRef_isStateSpecial (ue->sref)
-	      && alkind_isImplicit (sRef_getAliasKind (ue->sref)))
-	    {
-	      sRef_setAliasKind (ue->sref, AK_ERROR, fileloc_undefined);
-	    }
-	}
-      else if (qual_isYield (qel))
-	{
-	  if (uentry_isVariable (ue))
-	    {
-	      ue->info->var->kind = VKYIELDPARAM;
-	    }
-	  else
-	    {
-	      llerror 
-		(FLG_SYNTAX, 
-		 message ("Qualifier %s used on non-iterator parameter: %q",
-			  qual_unparse (qel), uentry_unparse (ue)));	      
-	    }
-	}
-      else if (qual_isExQual (qel))
-	{
-	  exkind ek = exkind_fromQual (qel);
-	  ctype ut = uentry_getType (ue);
-
-	  if (ctype_isFunction (ut))
-	    {
-	      ut = ctype_returnValue (ut);
-	    }
-	  
-	  if (!(ctype_isVisiblySharable (ut))
-	      && !(ctype_isArray (ut)) /* can apply to arrays also! */
-	      && !(ctype_isStruct (ctype_realType (ut)))) /* applies to structure fields! */
-	    {
-	      if (!qual_isImplied (qel))
-		{
-		  llerror 
-		    (FLG_SYNTAX, 
-		     message ("Qualifier %s used on unsharable storage type %t: %q",
-			      exkind_unparse (ek), ut, uentry_getName (ue)));
-		}
-	    }
-	  else
-	    {
-	      alkind ak = sRef_getAliasKind (ue->sref);
-
-	      sRef_setExKind (ue->sref, ek, uentry_whereDeclared (ue));
-
-	      if (alkind_isUnknown (ak) || alkind_isImplicit (ak) || alkind_isStatic (ak))
-		{
-		  if (!alkind_isTemp (ak))
-		    {
-		      uentry_setAliasKind (ue, AK_IMPDEPENDENT);
-		    }
-		}
-	      else if (alkind_isDependent (ak) || alkind_isTemp (ak)
-		       || alkind_isOwned (ak))
-		{
-		  ; /* okay */
-		}
-	      else
-		{
-		  llerror 
-		    (FLG_SYNTAX, 
-		     message ("Exposure qualifier %s used on %s storage (should "
-			      "be dependent): %q",
-			      qual_unparse (qel), 
-			      alkind_unparse (ak),
-			      uentry_unparse (ue)));
-		}
-	    }
-	}
-      else if (qual_isGlobCheck (qel))
-	{
-	  if (uentry_isVariable (ue))
-	    {
-	      chkind ch = chkind_fromQual (qel); 		
-		       
-	      if (ue->info->var->checked != CH_UNKNOWN)
-		{
-		  if (ch == ue->info->var->checked)
-		    {
-		      llerror (FLG_SYNTAX, 
-			       message ("Redundant %s qualifier on %q",
-					qual_unparse (qel),
-					uentry_getName (ue)));
-		    }
-		  else
-		    {
-		      llerror (FLG_SYNTAX, 
-			       message
-			       ("Contradictory %s and %s qualifiers on %q",
-				qual_unparse (qel),
-				checkedName (ue->info->var->checked),
-				uentry_getName (ue)));
-		    }
-		}
-
-	      ue->info->var->checked = ch;
-	    }
-	  else
-	    {
-	      llerror
-		(FLG_SYNTAX, 
-		 message ("Qualifier %s used with non-variable", 
-			  qual_unparse (qel)));
-	    }
-	}
-      else if (qual_isReturned (qel))
-	{
-	  if (uentry_isVariable (ue))
-	    {
-	      ue->info->var->kind = VKRETPARAM;
-	    }
-	  else
-	    {
-	      llerror (FLG_SYNTAX, message ("Qualifier %s used with non-variable", 
-					    qual_unparse (qel)));
-	    }
-	}
-      else
-	{
-	  uentry_reflectOtherQualifier (ue, qel);
-	}
-
-      sRef_storeState (ue->sref);
-    } end_qualList_elements;
-
-  qualList_clear (q);
-}
-	
-bool
-uentry_isOnly (uentry ue)
-{
-  return (!uentry_isUndefined (ue) 
-	  && uentry_isVariable (ue) 
-	  && alkind_isOnly (sRef_getOrigAliasKind (ue->sref)));
-}
-
-static void
-uentry_setAliasKind (/*@notnull@*/ uentry ue, alkind ak)
-{
-  sRef_setAliasKind (ue->sref, ak, uentry_whereDeclared (ue));
-  sRef_setOrigAliasKind (ue->sref, ak);
-}
-
-static void
-uentry_setNullState (/*@notnull@*/ uentry ue, nstate ns)
-{
-  if (uentry_isVariable (ue))
-    {
-      ue->info->var->nullstate = ns;
-    }
-
-  sRef_setNullState (ue->sref, ns, uentry_whereDeclared (ue));
-}
-
-bool
-uentry_isUnique (uentry ue)
-{
-  return (!uentry_isUndefined (ue) 
-	  && uentry_isVariable (ue) 
-	  && alkind_isUnique (sRef_getOrigAliasKind (ue->sref)));
-}
-
-bool
-uentry_isFileStatic (uentry ue)
-{
-  return (uentry_isStatic (ue) 
-	  && (!uentry_isVariable (ue)
-	      || sRef_isFileStatic (uentry_getSref (ue))));
-}
-
-bool
-uentry_isExported (uentry ue)
-{
-  if (uentry_isValid (ue))
-    {
-      if (uentry_isVariable (ue))
-	{
-	  return (sRef_isRealGlobal (uentry_getSref (ue)));
-	}
-      else
-	{
-	  return !uentry_isStatic (ue);
-	}
-    }
-
-  return FALSE;
-}
-
-bool
-uentry_isNonLocal (uentry ue)
-{
-  return (uentry_isValid (ue) && uentry_isVariable (ue)
-	  && (sRef_isGlobal (ue->sref) || uentry_isStatic (ue)));
-}
-
-bool
-uentry_isGlobal (uentry ue)
-{
-  return (uentry_isValid (ue) && uentry_isVariable (ue) && 
-	  sRef_isGlobal (ue->sref));
-}
-
-bool
-uentry_isPrintfLike (uentry ue)
-{
-  return (uentry_isFunction (ue) 
-	  && (ue->info->fcn->specialCode == SPC_PRINTFLIKE));
-}
-
-bool
-uentry_isScanfLike (uentry ue)
-{
-  return (uentry_isFunction (ue) 
-	  && (ue->info->fcn->specialCode == SPC_SCANFLIKE));
-}
-
-bool
-uentry_isMessageLike (uentry ue)
-{
-  return (uentry_isFunction (ue) 
-	  && (ue->info->fcn->specialCode == SPC_MESSAGELIKE));
-}
-
-static void checkSpecialFunction (/*@notnull@*/ uentry ue)
-{
-  uentryList args = uentry_getParams (ue);
-
-  if (!uentryList_isMissingParams (args))
-    {
-      uentry last = uentry_undefined;
-
-      uentryList_elements (args, current)
-	{
-	  if (uentry_isElipsisMarker (current))
-	    {
-	      if (uentry_isUndefined (last))
-		{
-		  voptgenerror 
-		    (FLG_SYNTAX,
-		     message ("Function %q is marked %s, but has no format "
-			      "string argument before elipsis",
-			      uentry_getName (ue),
-			      specCode_unparse (ue->info->fcn->specialCode)),
-		     uentry_whereLast (ue));
-		  ue->info->fcn->specialCode = SPC_NONE;
-		}
-	      else
-		{
-		  ctype rt = ctype_realType (uentry_getType (last));
-
-		  if (!ctype_match (rt, ctype_string))
-		    {
-		      bool okay = FALSE;
-
-		      /* wchar_t * is okay too */
-		      if (ctype_isAP (rt))
-			{
-			  ctype base = ctype_baseArrayPtr (rt);
-			  
-			  if (ctype_isArbitraryIntegral (base)) 
-			    {
-			      okay = TRUE;
-			    }
-			}
-		      
-		      if (!okay) 
-			{
-			  voptgenerror
-			    (FLG_SYNTAX,
-			     message ("Function %q is marked %s, but the argument "
-				      "before the elipsis has type %s (should be char *)",
-				      uentry_getName (ue),
-				      specCode_unparse (ue->info->fcn->specialCode),
-				      ctype_unparse (uentry_getType (last))),
-			     uentry_whereLast (ue));
-			  
-			  ue->info->fcn->specialCode = SPC_NONE;
-			}
-		    }
-		}
-	      return;
-	    }
-	  last = current;
-	} end_uentryList_elements ;
-
-      voptgenerror 
-	(FLG_SYNTAX,
-	 message ("Function %q is marked %s, but has no elipsis parameter",
-		  uentry_getName (ue),
-		  specCode_unparse (ue->info->fcn->specialCode)),
-	 uentry_whereLast (ue));
-
-      ue->info->fcn->specialCode = SPC_NONE;
-    }
-}
-
-void
-uentry_setPrintfLike (uentry ue)
-{
-  if (uentry_isVariable (ue) && ctype_isFunction (uentry_getType (ue)))
-    {
-      uentry_makeVarFunction (ue);
-    }
-  
-  llassertfatal (uentry_isFunction (ue));
-  ue->info->fcn->specialCode = SPC_PRINTFLIKE;
-  checkSpecialFunction (ue);
-}
-
-void
-uentry_setScanfLike (uentry ue)
-{
-  if (uentry_isVariable (ue) && ctype_isFunction (uentry_getType (ue)))
-    {
-      uentry_makeVarFunction (ue);
-    }
-  
-  llassertfatal (uentry_isFunction (ue));
-  ue->info->fcn->specialCode = SPC_SCANFLIKE;
-  checkSpecialFunction (ue);
-}
-
-void
-uentry_setMessageLike (uentry ue)
-{
-  if (uentry_isVariable (ue) && ctype_isFunction (uentry_getType (ue)))
-    {
-      uentry_makeVarFunction (ue);
-    }
-  
-  llassertfatal (uentry_isFunction (ue));
-  ue->info->fcn->specialCode = SPC_MESSAGELIKE;
-  checkSpecialFunction (ue);
-}
-
-bool
-uentry_isSpecialFunction (uentry ue)
-{
-  return (uentry_isFunction (ue) 
-	  && (ue->info->fcn->specialCode != SPC_NONE));
-}
-
-/*@notnull@*/ uentry uentry_makeParam (idDecl t, int i)
-{
-  ctype ct = idDecl_getCtype (t);
-  ctype base = ct;
-  sRef pref = sRef_makeParam (i, ct);
-  uentry ue = uentry_makeVariableSrefParam (idDecl_observeId (t), ct, pref);
-
-  uentry_reflectQualifiers (ue, idDecl_getQuals (t));
-  uentry_implicitParamAnnots (ue);
-
-  /* Parameter type [][] or [x][] is invalid */
-
-  while (ctype_isFixedArray (base)) {
-    base = ctype_baseArrayPtr (base);
-  }
-  
-  if (ctype_isIncompleteArray (base)) {
-    base = ctype_baseArrayPtr (base);
-
-    if (ctype_isArray (base)) {
-      if (!uentry_hasName (ue)) {
-	(void) optgenerror (FLG_INCOMPLETETYPE, 
-			    message ("Unnamed function parameter %d is incomplete type (inner array must have bounds): %s",
-				     i + 1,
-				     ctype_unparse (ct)),
-			    uentry_whereLast (ue));
-      } else {
-	(void) optgenerror (FLG_INCOMPLETETYPE, 
-			    message ("Function parameter %q is incomplete type (inner array must have bounds): %s",
-				     uentry_getName (ue),
-				     ctype_unparse (ct)),
-			    uentry_whereLast (ue));
-      }
-    }
-  }
-
-  return ue;
-}
-
-/*@only@*/ /*@notnull@*/ uentry uentry_makeIdVariable (idDecl t)
-{
-  ctype ct = idDecl_getCtype (t);
-
-  if (ctype_isFunction (ct))
-    {
-            return (uentry_makeIdFunction (t));
-    }
-  else
-    {
-      fileloc loc = setLocation ();
-      uentry ue = uentry_makeVariable (idDecl_observeId (t), ct, loc, FALSE);
-      
-      uentry_reflectQualifiers (ue, idDecl_getQuals (t));
-
-      if (!uentry_isExtern (ue))
-	{
-	  uentry_setDefined (ue, loc);
-	}
-
-      return ue;
-    }
-}
-
-# ifndef NOLCL
-/*@notnull@*/ uentry uentry_makeVariableParam (cstring n, ctype t)
-{
-  return (uentry_makeVariableParamAux (n, t, sRef_makeType (t), SS_DEFINED));
-}
-# endif
-
-/*
-** constants
-*/
-
-/*@only@*/ /*@notnull@*/ 
-uentry uentry_makeConstantAux (cstring n, ctype t, 
-			       /*@keep@*/ fileloc f, bool priv,
-			       /*@only@*/ multiVal m)
-{
-  uentry e = uentry_alloc ();
-
-  e->ukind = KCONST;
-  e->uname = cstring_copy (n);
-  e->utype = t;
-  e->storageclass = SCNONE;
-
-  e->sref  = sRef_makeConst (t);
-
-  e->lset = FALSE;
-  e->used = FALSE;
-  
-  e->uses = filelocList_new ();
-  e->isPrivate = priv;
-  e->hasNameError = FALSE;
-
-  e->info = (uinfo) dmalloc (sizeof (*e->info));
-  e->info->uconst = (ucinfo) dmalloc (sizeof (*e->info->uconst));
-  e->info->uconst->val = m;
-  e->info->uconst->access = typeIdSet_undefined;
-
-  uentry_setSpecDef (e, f);
-
-  if (multiVal_isInt (m) && (multiVal_forceInt (m) == 0))
-    {
-      sRef_setDefNull (e->sref, uentry_whereDeclared (e)); 
-    }
-
-  return (e);
-}
-
-/*@notnull@*/ uentry uentry_makeConstant (cstring n, ctype t, fileloc f)
-{
-  return (uentry_makeConstantAux (n, t, f, FALSE, multiVal_unknown ()));
-}
-
-/*@notnull@*/ uentry uentry_makeIdConstant (idDecl t)
-{
-  uentry ue = uentry_makeConstant (idDecl_observeId (t), 
-				   idDecl_getCtype (t), 
-				   fileloc_undefined);
-
-  llassert (fileloc_isUndefined (ue->whereDeclared));
-  ue->whereDeclared = setLocation ();
-
-  uentry_reflectQualifiers (ue, idDecl_getQuals (t));
-
-  return ue;
-}
-
-/*
-** variables
-*/
-
-void uentry_setDefState (uentry ue, sstate defstate)
-{
-  if (uentry_isValid (ue))
-    {
-      sRef_setDefState (ue->sref, defstate, fileloc_undefined);
-
-      if (uentry_isVariable (ue))
-	{
-	  ue->info->var->defstate = defstate; /* evs 2000-05-17: fixed bug, was SS_DEFINED! */
-	}
-    }
-}
-
-bool uentry_isCheckedUnknown (uentry ue)
-{
-  return (uentry_isVar (ue) 
-	  && (ue->info->var->checked == CH_UNKNOWN));
-}
-
-bool uentry_isCheckMod (uentry ue)
-{
-  return (uentry_isVar (ue) 
-	  && (ue->info->var->checked == CH_CHECKMOD));
-}
-
-bool uentry_isUnchecked (uentry ue)
-{
-  return (uentry_isVar (ue) 
-	  && (ue->info->var->checked == CH_UNCHECKED));
-}
-
-bool uentry_isChecked (uentry ue)
-{
-  return (uentry_isVar (ue) 
-	  && (ue->info->var->checked == CH_CHECKED));
-}
-
-bool uentry_isCheckedModify (uentry ue)
-{
-  return (uentry_isVar (ue) 
-	  && (ue->info->var->checked == CH_CHECKED
-	      || ue->info->var->checked == CH_CHECKMOD
-	      || ue->info->var->checked == CH_CHECKEDSTRICT));
-}
-
-bool uentry_isCheckedStrict (uentry ue)
-{
-  return (uentry_isVar (ue) 
-	  && (ue->info->var->checked == CH_CHECKEDSTRICT));
-}
-
-void uentry_setUnchecked (uentry ue)
-{
-  llassert (uentry_isVar (ue));
-
-  ue->info->var->checked = CH_UNCHECKED;
-}
-
-void uentry_setChecked (uentry ue)
-{
-  llassert (uentry_isVar (ue));
-
-  ue->info->var->checked = CH_CHECKED;
-}
-
-void uentry_setCheckMod (uentry ue)
-{
-  llassert (uentry_isVar (ue));
-
-  ue->info->var->checked = CH_CHECKMOD;
-}
-
-void uentry_setCheckedStrict (uentry ue)
-{
-  llassert (uentry_isVar (ue));
-  
-  ue->info->var->checked = CH_CHECKEDSTRICT;
-}
-
-static /*@only@*/ /*@notnull@*/ 
-  uentry uentry_makeVariableAux (cstring n, ctype t, 
-				 fileloc f,
-				 /*@exposed@*/ sRef s,
-				 bool priv, vkind kind)
-{
-  uentry e = uentry_alloc ();
-  ctype rt = t;
-
-  DPRINTF (("Make variable: %s %s %s", n, ctype_unparse (t), sRef_unparse (s)));
-
-  e->ukind = KVAR;
-  e->uname = cstring_copy (n);
-  e->utype = t;
-
-  e->storageclass = SCNONE;
-
-  e->sref  = s;
-
-  e->used = FALSE;
-  e->lset = FALSE;
-
-  e->uses = filelocList_new ();
-  e->isPrivate = priv;
-  e->hasNameError = FALSE;
-
-  e->info = (uinfo) dmalloc (sizeof (*e->info));
-  e->info->var = (uvinfo) dmalloc (sizeof (*e->info->var));
-  e->info->var->kind = kind;
-
-  e->info->var->checked = CH_UNKNOWN;
-
-  uentry_setSpecDef (e, f);
-
-  if (ctype_isFunction (rt))
-    {
-      rt = ctype_returnValue (rt);
-    }
-
-  if (ctype_isUA (rt))
-    {
-      sRef_setStateFromType (e->sref, rt);
-    }
-
-  e->info->var->defstate = sRef_getDefState (e->sref);  
-  e->info->var->nullstate = sRef_getNullState (e->sref);
-
-/* start modifications */
-/* This function sets the uentry for a pointer or array variable declaration,
-   it allocates memory and sets the fields. We check if the type of the variable
-   is a pointer or array and allocate a `bbufinfo' struct accordingly */
-
-  if( ctype_isArray (t) || ctype_isPointer(t)) {
-    /*@i222@*/e->info->var->bufinfo = dmalloc( sizeof(*e->info->var->bufinfo) );
-     e->info->var->bufinfo->bufstate = BB_NOTNULLTERMINATED;
-     s->bufinfo.bufstate = BB_NOTNULLTERMINATED;
-  } else {
-     e->info->var->bufinfo = NULL;
-  }/* end else */
-/* end modification */
-
-  return (e);
-}
-
-bool
-uentry_isYield (uentry ue)
-{
-  return (uentry_isVariable (ue) 
-	  && (ue->info->var->kind == VKYIELDPARAM
-	      || ue->info->var->kind == VKREFYIELDPARAM));
-}
-
-static bool
-uentry_isRefsField (uentry ue)
-{
-  return (uentry_isVariable (ue) && sRef_isRefsField (ue->sref));
-}
-
-/*@only@*/ /*@notnull@*/ 
-uentry uentry_makeVariable (cstring n, ctype t, fileloc f, bool isPriv)
-{
-  return (uentry_makeVariableAux (n, t, f, sRef_makeType (t), isPriv, 
-				  fileloc_isSpec (f) ? VKSPEC : VKNORMAL));
-}
-
-/*
-** functions
-*/
-
-void uentry_makeVarFunction (uentry ue)
-{
-  alkind ak;
-  exkind ek;
-  uvinfo oldInfo;
-  fileloc loc;
-
-  llassert (uentry_isValid (ue));
-  llassert (!sRef_modInFunction ());
-
-  ak = sRef_getOrigAliasKind (ue->sref);
-  ek = sRef_getOrigExKind (ue->sref);
-
-  oldInfo = ue->info->var;
-
-  llassert (ctype_isUnknown (ue->utype) || ctype_isFunction (ue->utype));
-
-  /*
-  ** expanded macro is marked used (until I write a pre-processor)
-  */
-
-  ue->used |= (oldInfo->kind == VKEXPMACRO);
-
-  ue->ukind = KFCN;
-  ue->info->fcn = (ufinfo) dmalloc (sizeof (*ue->info->fcn));
-  ue->info->fcn->exitCode = XK_UNKNOWN;
-  ue->info->fcn->nullPred = QU_UNKNOWN;
-  ue->info->fcn->specialCode = SPC_NONE;
-  ue->info->fcn->access = typeIdSet_undefined;
-  ue->info->fcn->hasGlobs = FALSE;
-  ue->info->fcn->globs = globSet_undefined;
-  ue->info->fcn->hasMods = FALSE;
-  ue->info->fcn->mods = sRefSet_undefined;
-  ue->info->fcn->specclauses = NULL;
-  ue->info->fcn->defparams = uentryList_undefined;
-
-  /*drl*/
-  ue->info->fcn->preconditions = constraintList_undefined;
-  /*end */
-
-  /*drl 12/28/2000*/
-  ue->info->fcn->postconditions = constraintList_undefined;
-  /*end */
-
-  
-  if (ctype_isFunction (ue->utype))
-    {
-      ue->sref = sRef_makeType (ctype_returnValue (ue->utype)); 
-    }
-  else
-    {
-      ue->sref = sRef_makeType (ctype_unknown); 
-    }
-
-  if (sRef_isRefCounted (ue->sref))
-    {
-      ak = AK_NEWREF;
-    }
-  else
-    {
-      if (alkind_isUnknown (ak))
-	{
-	  if (exkind_isKnown (ek))
-	    {
-	      ak = AK_IMPDEPENDENT;
-	    }
-	  else 
-	    {
-	      if (context_getFlag (FLG_RETIMPONLY))
-		{
-		  if (ctype_isFunction (ue->utype)
-		      && ctype_isVisiblySharable 
-		      (ctype_realType (ctype_returnValue (ue->utype))))
-		    {
-		      if (uentryList_hasReturned (uentry_getParams (ue)))
-			{
-			  ;
-			}
-		      else
-			{
-			  ak = AK_IMPONLY;
-			  			}
-		    }
-		}
-	    }
-	}
-    }
-
-  loc = ue->whereDeclared;
-
-  sRef_setAliasKind (ue->sref, ak, loc);
-  sRef_setNullState (ue->sref, oldInfo->nullstate, loc);
-  sRef_setDefState (ue->sref, oldInfo->defstate, loc);
-  sRef_setExKind (ue->sref, ek, loc);
-
-  if (oldInfo->kind == VKEXPMACRO)
-    {
-      fileloc_free (loc);
-      ue->whereDeclared = fileloc_undefined;
-    }
-  else
-    {
-      fileloc_free (ue->whereDefined);
-      ue->whereDefined = fileloc_undefined;
-    }
-
-  uvinfo_free (oldInfo);
-}
-
-void
-uentry_setGlobals (uentry ue, /*@owned@*/ globSet globs)
-{
-  llassert (uentry_isValid (ue));
-
-  if (uentry_isIter (ue))
-    {
-      llassert (globSet_isUndefined (ue->info->iter->globs));
-      ue->info->iter->globs = globs;
-    }
-  else
-    {
-      if (uentry_isVariable (ue) && ctype_isFunction (uentry_getType (ue)))
-	{
-	  uentry_makeVarFunction (ue);
-	}
-      
-      llassert (uentry_isFunction (ue));
-      llassert (!ue->info->fcn->hasGlobs 
-		&& globSet_isUndefined (ue->info->fcn->globs));
-      
-      ue->info->fcn->hasGlobs = TRUE;
-      /*@-mustfree@*/ ue->info->fcn->globs = globs;
-      /*@=mustfree@*/
-    }
-
-  if (globSet_hasStatic (globs))
-    {
-      context_recordFileGlobals (globs);
-    }
-
-  if (context_getFlag (FLG_GLOBALSIMPMODIFIESNOTHING))
-    {
-      ue->info->fcn->hasMods = TRUE;
-    }
-}
-
-void uentry_addAccessType (uentry ue, typeId tid)
-{
-  if (uentry_isFunction (ue))
-    {
-      ue->info->fcn->access = typeIdSet_insert (ue->info->fcn->access, tid);
-    }
-  else if (uentry_isEitherConstant (ue))
-    {
-      ue->info->uconst->access = typeIdSet_insert (ue->info->uconst->access, tid);
-    }
-  else if (uentry_isIter (ue))
-    {
-      ue->info->iter->access = typeIdSet_insert (ue->info->iter->access, tid);
-    }
-  else if (uentry_isEndIter (ue))
-    {
-      ue->info->enditer->access = typeIdSet_insert (ue->info->enditer->access, tid);
-    }
-  else
-    {
-      llbug (message ("no access for: %q", uentry_unparse (ue)));
-    }
-}
-
-/*@only@*/ /*@notnull@*/ uentry 
-  uentry_makeFunction (cstring n, ctype t, 
-		       typeId access, 
-		       /*@only@*/ globSet globs, /*@only@*/ sRefSet mods, 
-		       fileloc f)
-{
-  return (uentry_makeFunctionAux (n, t, 
-				  ((typeId_isInvalid (access)) ? typeIdSet_emptySet () 
-				   : typeIdSet_single (access)),
-				  globs, mods, f,
-				  FALSE, FALSE));
-}
-
-# ifndef NOLCL
-/*@notnull@*/ uentry 
-  uentry_makePrivFunction2 (cstring n, ctype t, 
-			    typeIdSet access, 
-			    globSet globs, sRefSet mods, 
-			    fileloc f)
-{
-  return (uentry_makeFunctionAux (n, t, access, globs, mods, f, TRUE, FALSE));
-}
-
-
-/*@notnull@*/ uentry 
-  uentry_makeSpecFunction (cstring n, ctype t, 
-			   typeIdSet access,
-			   /*@only@*/ globSet globs, 
-			   /*@only@*/ sRefSet mods, 
-			   fileloc f)
-{
-  uentry ue = uentry_makeFunctionAux (n, t, access, 
-				      globs, mods, f,
-				      FALSE, FALSE);
-
-  uentry_setHasGlobs (ue);
-  uentry_setHasMods (ue);
-
-  reflectImplicitFunctionQualifiers (ue, TRUE);
-  return (ue);
-}
-# endif
-
-uentry uentry_makeExpandedMacro (cstring s, fileloc f)
-{
-  uentry ue = uentry_makeVariableAux (s, ctype_unknown, fileloc_undefined, 
-				      sRef_undefined, FALSE, VKEXPMACRO);
-
-  uentry_setDefined (ue, f);
-  return ue;
-}
-
-/*@notnull@*/ /*@notnull@*/ uentry 
-  uentry_makeForwardFunction (cstring n, typeId access, fileloc f)
-{
-  uentry ue = uentry_makeFunctionAux (n, ctype_unknown, 
-				      typeIdSet_singleOpt (access),
-				      globSet_undefined, sRefSet_undefined, 
-				      fileloc_undefined,
-				      FALSE, TRUE);
-
-  ue->whereDeclared = fileloc_update (ue->whereDeclared, f);
-  return ue;
-}
-
-bool uentry_isForward (uentry e)
-{
-  if (uentry_isValid (e))
-    {
-      ctype ct = uentry_getType (e);
-
-      return (ctype_isUnknown (ct)
-	      || (ctype_isFunction (ct)
-		  && ctype_isUnknown (ctype_returnValue (ct))));
-    }
-
-  return FALSE;
-}
-
-# ifndef NOLCL
-/*@notnull@*/ uentry 
-uentry_makeTypeListFunction (cstring n, typeIdSet access, fileloc f)
-{
-  return (uentry_makeFunctionAux (n, ctype_unknown, access,
-				  globSet_new (),
-				  sRefSet_new (), f,
-				  FALSE, TRUE));
-}
-
-/*@notnull@*/ uentry 
-uentry_makeUnspecFunction (cstring n, ctype t, 
-			   typeIdSet access, 
-			   fileloc f)
-{
-  uentry ue = uentry_makeFunctionAux (n, t, access, globSet_new (),
-				      sRefSet_new (), f, FALSE, TRUE);
-
-  reflectImplicitFunctionQualifiers (ue, TRUE);
-  return ue;
-}
-# endif
-
-/*
-** datatypes
-*/
-
-/* is exported for use by usymtab_interface */
-
-/*@notnull@*/ uentry 
-  uentry_makeDatatypeAux (cstring n, ctype t, ynm mut, ynm abs, 
-			  fileloc f, bool priv)
-{
-  uentry e = uentry_alloc ();
-
-  DPRINTF (("Make datatype: %s / %s",
-	    n, ctype_unparse (t)));
-
-  /* e->shallowCopy = FALSE; */
-  e->ukind = KDATATYPE;
-  e->uname = cstring_copy (n);
-  e->utype = t;
-  e->storageclass = SCNONE;
-  e->sref  = sRef_makeUnknown ();
-
-  if (ctype_isUA (t))
-    {
-      sRef_setStateFromType (e->sref, t);
-    }
-
-  uentry_setSpecDef (e, f);
-
-  e->uses = filelocList_new ();
-  e->isPrivate = priv;
-  e->hasNameError = FALSE;
-
-  e->used = FALSE;
-  e->lset = FALSE;
-
-  e->info = (uinfo) dmalloc (sizeof (*e->info));
-  e->info->datatype = (udinfo) dmalloc (sizeof (*e->info->datatype));
-  e->info->datatype->abs = abs;
-  e->info->datatype->mut = mut;
-  e->info->datatype->type = ctype_undefined;
-
-  if (uentry_isDeclared (e))
-    {
-      uentry_setDefined (e, f);
-    }
-
-  if (ynm_isOn (abs) && !(uentry_isCodeDefined (e)))
-    {
-      sRef_setNullState (e->sref, NS_ABSNULL, uentry_whereDeclared (e));
-    }
-
-  return (e);
-}
-
-/*@notnull@*/ uentry
-  uentry_makeDatatype (cstring n, ctype t, ynm mut, ynm abs, 
-		       fileloc f)
-{
-  return (uentry_makeDatatypeAux (n, t, mut, abs, f, FALSE));
-}
-
-/*@notnull@*/ uentry uentry_makeBoolDatatype (ynm abs)
-{
-  uentry ret = uentry_makeDatatypeAux (context_getBoolName (),
-				       ctype_bool, NO, abs, 
-				       fileloc_getBuiltin (),
-				       FALSE);
-  
-  ret->info->datatype->type = ctype_bool;
-  return ret;
-}
-
-/*
-** iters
-*/
-
-static /*@only@*/ /*@notnull@*/ uentry 
-  uentry_makeIterAux (cstring n, typeIdSet access, ctype ct, 
-		      /*@only@*/ fileloc f)
-{
-  uentry e = uentry_alloc ();
-
-  e->ukind = KITER;
-  e->uname = cstring_copy (n);
-  e->utype = ct;
-  e->sref  = sRef_makeUnknown ();
-  e->storageclass = SCNONE;
-  e->used = FALSE;
-  e->lset = FALSE;
-
-  uentry_setSpecDef (e, f);
-
-  e->uses = filelocList_new ();
-  e->isPrivate = FALSE;
-  e->hasNameError = FALSE;
-
-  e->info = (uinfo) dmalloc (sizeof (*e->info));
-  e->info->iter = (uiinfo) dmalloc (sizeof (*e->info->iter));
-  e->info->iter->access = access;
-  e->info->iter->mods = sRefSet_undefined;
-  e->info->iter->globs = globSet_undefined;
-
-  uentry_checkIterArgs (e);
-  return (e);
-}
-
-/*@notnull@*/ uentry uentry_makeIter (cstring n, ctype ct, fileloc f)
-{
-  return (uentry_makeIterAux (n, context_fileAccessTypes (), ct, f));
-}
-
-static /*@notnull@*/ uentry
-uentry_makeEndIterAux (cstring n, typeIdSet access, /*@only@*/ fileloc f)
-{
-  uentry e = uentry_alloc ();
-
-  /* e->shallowCopy = FALSE; */
-  e->ukind = KENDITER;
-  e->storageclass = SCNONE;
-  e->uname = message ("end_%s", n);
-  e->utype = ctype_unknown;
-  e->sref  = sRef_makeUnknown ();
-
-  uentry_setSpecDef (e, f);
-
-  e->used = FALSE;
-  e->lset = FALSE;
-
-  e->uses = filelocList_new ();
-  e->isPrivate = FALSE;
-  e->hasNameError = FALSE;
-
-  e->info = (uinfo) dmalloc (sizeof (*e->info));
-  e->info->enditer = (ueinfo) dmalloc (sizeof (*e->info->enditer));
-
-  e->info->enditer->access = access;
-
-  return (e);
-}
-
-/*@notnull@*/ /*@only@*/ uentry uentry_makeEndIter (cstring n, fileloc f)
-{
-  return (uentry_makeEndIterAux (n, context_fileAccessTypes (), f));
-}
-
-/*
-** tags
-*/
-
-static /*@only@*/ /*@notnull@*/ uentry 
-  uentry_makeTagAux (cstring n, ctype t, 
-		     /*@only@*/ fileloc fl, 
-		     bool priv, ekind kind)
-{
-  uentry e = uentry_alloc ();
-  
-  if (kind != KSTRUCTTAG && kind != KUNIONTAG && kind != KENUMTAG)
-    {
-      llbuglit ("uentry_makeTagAux: not a tag type");
-    }
-  
-  e->ukind = kind;
-  /* e->shallowCopy = FALSE; */
-  e->uname = cstring_copy (n);
-
-  e->utype = t;
-  e->sref  = sRef_makeUnknown ();
-  e->storageclass = SCNONE;
-
-  uentry_setSpecDef (e, fl);
-  
-  e->used = FALSE;
-  e->lset = FALSE;
-
-  e->uses = filelocList_new ();
-  e->isPrivate = priv;
-  e->hasNameError = FALSE;
-
-  e->info = (uinfo) dmalloc (sizeof (*e->info));
-  e->info->datatype = (udinfo) dmalloc (sizeof (*e->info->datatype));
-  e->info->datatype->abs = NO;
-  e->info->datatype->mut = (kind == KENUMTAG) ? NO : MAYBE;
-  e->info->datatype->type = t;
-
-  if (uentry_isDeclared (e))
-    {
-      uentry_setDefined (e, fl);
-    }
-
-  return (e);  
-}
-
-uentry uentry_makeStructTagLoc (cstring n, ctype t)
-{
-  cstring sname = makeStruct (n);
-  uentry ret = uentry_makeTagAux (sname, t, setLocation (), FALSE, KSTRUCTTAG);
-
-  cstring_free (sname);
-  return (ret);
-}
-
-/*@only@*/ uentry
-uentry_makeStructTag (cstring n, ctype t, fileloc loc)
-{
-  cstring sname = makeStruct (n);
-  uentry ret = uentry_makeTagAux (sname, t, loc, FALSE, KSTRUCTTAG);
-
-  cstring_free (sname);
-  return ret;
-}
-
-/*@only@*/ uentry
-uentry_makeUnionTag (cstring n, ctype t, fileloc loc)
-{
-  cstring uname = makeUnion (n);
-  uentry ret = uentry_makeTagAux (uname, t, loc, FALSE, KUNIONTAG);
-
-  cstring_free (uname);
-  return (ret);
-}
-
-# ifndef NOLCL
-uentry
-uentry_makeEnumTag (cstring n, ctype t, fileloc loc)
-{
-  cstring ename = makeEnum (n);
-  uentry ret = uentry_makeTagAux (ename, t, loc, FALSE, KENUMTAG);
-
-  cstring_free (ename);
-  return ret;
-}
-# endif
-
-uentry
-uentry_makeUnionTagLoc (cstring n, ctype t)
-{
-  cstring uname = makeUnion (n);
-  uentry ret = uentry_makeTagAux (uname, t, setLocation (), FALSE, KUNIONTAG);
-
-  cstring_free (uname);
-  return ret;
-}
-
-uentry
-uentry_makeEnumTagLoc (cstring n, ctype t)
-{
-  cstring ename = makeEnum (n);
-  uentry ret = uentry_makeTagAux (ename, t, setLocation (), FALSE, KENUMTAG);
-
-  cstring_free (ename);
-  return ret;
-}
-
-bool 
-uentry_isStructTag (uentry ue) 
-{
-  return (uentry_isValid (ue) && ue->ukind == KSTRUCTTAG);
-}
-
-bool 
-uentry_isUnionTag (uentry ue) 
-{
-  return (uentry_isValid (ue) && ue->ukind == KUNIONTAG);
-}
-
-bool 
-uentry_isEnumTag (uentry ue) 
-{
-  return (uentry_isValid (ue) && ue->ukind == KENUMTAG);
-}
-
-bool
-uentry_isAnyTag (uentry ue)
-{
-  return (uentry_isStructTag (ue) 
-	  || uentry_isUnionTag (ue)
-	  || uentry_isEnumTag (ue));
-}
-
-static /*@unchecked@*/ /*@only@*/ uentry emarker = NULL;
-
-extern void uentry_destroyMod (void)
-   /*@globals killed emarker@*/ /*@modifies emarker@*/
-{
-  static bool wasDestroyed = FALSE;
-
-  llassert (!wasDestroyed);
-
-  if (emarker != NULL)
-    {
-      uentry_reallyFree (emarker);
-    }
-
-  wasDestroyed = TRUE;
-}
-
-uentry
-uentry_makeElipsisMarker (void)
-{
-  if (emarker == NULL)
-    {
-      emarker = uentry_alloc ();
-
-      emarker->ukind = KELIPSMARKER;
-      emarker->uname = cstring_makeLiteral ("...");
-      emarker->utype = ctype_elipsMarker;
-      emarker->sref  = sRef_undefined;
-      emarker->storageclass = SCNONE;
-      emarker->used = FALSE;
-      emarker->lset = FALSE;
-      emarker->info = NULL;
-
-      uentry_setSpecDef (emarker, fileloc_undefined);
-      emarker->uses = filelocList_new ();
-      emarker->isPrivate = FALSE;
-      emarker->hasNameError = FALSE;
-    }
-
-  /*@ignore@*/ return (emarker); /*@end@*/
-} 
-
-/*
-** comparisons
-*/
-
-bool
-uentry_equiv (uentry p1, uentry p2)
-{
-  if (uentry_compare (p1, p2) != 0)
-    {
-      return FALSE;
-    }
-  else
-    {
-      return TRUE;
-    }
-}
-
-int
-uentry_xcomparealpha (uentry *p1, uentry *p2)
-{
-  int res;
-
-  if ((res = uentry_compare (*p1, *p2)) == 0) {
-    if ((*p1 != NULL) && (*p2 != NULL)) {
-      res = cstring_compare ((*p1)->uname,
-			     (*p2)->uname);
-    }
-  }
-
-  return res;
-}
-
-int
-uentry_xcompareuses (uentry *p1, uentry *p2)
-{
-  uentry u1 = *p1;
-  uentry u2 = *p2;
-
-  if (uentry_isValid (u1))
-    {
-      if (uentry_isValid (u2))
-	{
-	  return (-1 * int_compare (filelocList_size (u1->uses), 
-				    filelocList_size (u2->uses)));
-	}
-      else
-	{
-	  return 1;
-	}
-    }
-  else
-    {
-      if (uentry_isValid (u2))
-	{
-	  return -1;
-	}
-      else
-	{
-	  return 0;
-	}
-    }
-}
-
-int 
-uentry_compareStrict (uentry v1, uentry v2)
-{
-  COMPARERETURN (uentry_compare (v1, v2));
-
-  if (v1 != v2 && uentry_isValid (v1) && uentry_isValid (v2))
-    {
-      COMPARERETURN (fileloc_compare (v1->whereDeclared, v2->whereDeclared));
-      COMPARERETURN (fileloc_compare (v1->whereDefined, v2->whereDefined));
-      COMPARERETURN (fileloc_compare (v1->whereSpecified, v2->whereSpecified));
-    }
-
-  return 0;
-}
-
-int
-uentry_compare (uentry u1, uentry u2)
-{
-  if (u1 == u2) return 0;
-  
-  if (uentry_isInvalid (u1)) return -1;
-  if (uentry_isInvalid (u2)) return 1;
-
-  INTCOMPARERETURN (u1->ukind, u2->ukind);
-  COMPARERETURN (ctype_compare (u1->utype, u2->utype));
-  COMPARERETURN (bool_compare (uentry_isPriv (u1), uentry_isPriv (u2)));
-
-  COMPARERETURN (sRef_compare (u1->sref, u2->sref));
-
-  switch (u1->ukind)
-    {
-    case KINVALID:
-    case KELIPSMARKER:
-      /* bug detected by lclint:  
-      ** uentry.c:753,14: Return value type bool does not match declared type int: TRUE 
-      */
-      return 0;
-    case KENUMCONST:
-    case KCONST:
-      return (multiVal_compare (u1->info->uconst->val,
-				u2->info->uconst->val));
-    case KSTRUCTTAG: 
-    case KUNIONTAG: 
-    case KENUMTAG: 
-      return (ctype_compare (u1->info->datatype->type, u2->info->datatype->type));
-    case KITER:
-      COMPARERETURN (typeIdSet_compare (uentry_accessType (u1), 
-					 uentry_accessType (u2)));
-      return (uentryList_compareParams (uentry_getParams (u1), 
-					uentry_getParams (u2)));
-    case KENDITER:
-      return (typeIdSet_compare (uentry_accessType (u1), 
-				  uentry_accessType (u2)));
-    case KFCN:
-      COMPARERETURN (typeIdSet_compare (uentry_accessType (u1), 
-					 uentry_accessType (u2)));
-      COMPARERETURN (globSet_compare (uentry_getGlobs (u1), 
-				      uentry_getGlobs (u2)));
-      COMPARERETURN (uentryList_compareParams (uentry_getParams (u1), 
-					       uentry_getParams (u2)));
-      COMPARERETURN (generic_compare (u1->info->fcn->specialCode,
-				       u2->info->fcn->specialCode));
-      COMPARERETURN (generic_compare (u1->info->fcn->nullPred,
-				       u2->info->fcn->nullPred));
-
-      return (sRefSet_compare (uentry_getMods (u1), uentry_getMods (u2)));
-    case KVAR:
-      COMPARERETURN (generic_compare (u1->info->var->kind, u2->info->var->kind));
-      COMPARERETURN (generic_compare (sRef_getOrigAliasKind (u1->sref),
-				      sRef_getOrigAliasKind (u2->sref)));
-      COMPARERETURN (generic_compare (sRef_getOrigExKind (u1->sref),
-				      sRef_getOrigExKind (u2->sref)));
-      COMPARERETURN (generic_compare (u1->info->var->checked,
-				      u2->info->var->checked));
-      COMPARERETURN (generic_compare (u1->info->var->defstate, 
-				      u2->info->var->defstate));
-      return        (generic_compare (u1->info->var->nullstate, 
-				      u2->info->var->nullstate));
-    case KDATATYPE:
-      COMPARERETURN (ctype_compare (u1->info->datatype->type,
-				    u2->info->datatype->type));
-      COMPARERETURN (ynm_compare (u1->info->datatype->mut,
-				  u2->info->datatype->mut));
-      return (ynm_compare (u1->info->datatype->abs, u2->info->datatype->abs));
-    }
-  
-  BADEXIT;
-}
-
-/*
-** library format:
-**
-** all entries are: [@]*#
-**
-** info depends on kind:
-*/
-
-static void
-advanceField (char **s)
-{
-  checkChar (s, '@');
-}
-
-static void
-advanceName (char **s)
-{
-  checkChar (s, '#');
-}
-
-static vkind
-vkind_fromInt (int i)
-{
-  if /*@+enumint@*/ (i < VKFIRST || i > VKLAST) /*@=enumint@*/
-    {
-      llbuglit ("vkind_fromInt: out of range");
-    }
-
-  return (vkind)i;
-}
-
-static uentry  
-  uentry_makeConstantBase (/*@only@*/ cstring name, ctype ct, 
-			   typeIdSet access, nstate nullstate,
-			   /*@keep@*/ fileloc loc, /*@only@*/ multiVal m)
-{
-  uentry e = uentry_alloc ();
-  
-  e->ukind = KCONST;
-  e->uname = name;
-  e->utype = ct;
-  e->sref  = sRef_makeConst (ct);
-
-  sRef_setNullState (e->sref, nullstate, loc);
-  e->storageclass = SCNONE;
-
-  if (fileloc_isSpec (loc))
-    {
-      e->whereSpecified = loc;
-      e->whereDeclared = fileloc_undefined;
-    }
-  else
-    {
-      e->whereSpecified = fileloc_undefined;
-      e->whereDeclared = loc;
-    }
-
-  e->whereDefined = fileloc_undefined;
-  e->uses = filelocList_new ();
-  e->isPrivate = FALSE;
-  e->hasNameError = FALSE;
-
-  e->used = FALSE;
-  e->lset = FALSE;
-
-  e->info = (uinfo) dmalloc (sizeof (*e->info));
-  e->info->uconst = (ucinfo) dmalloc (sizeof (*e->info->uconst));
-  e->info->uconst->val = m;
-  e->info->uconst->access = access;
-
-  sRef_storeState (e->sref);
-
-  return (e);
-}
-
-static /*@only@*/ uentry  
-  uentry_makeVariableBase (/*@only@*/ cstring name, ctype ct, vkind kind, 
-			   sstate defstate, nstate isnull, alkind aliased,
-			   exkind exp, chkind checked, 
-			   /*@only@*/ fileloc loc)
-{
-  uentry e = uentry_alloc ();
-
-  e->ukind = KVAR;
-  e->uname = name;
-  e->utype = ct;
-  e->storageclass = SCNONE;
-
-  e->sref  = sRef_makeType (ct);
-  sRef_setNullState (e->sref, isnull, loc);
-
-  e->whereDefined = fileloc_undefined;
-
-  if (fileloc_isSpec (loc))
-    {
-      e->whereSpecified = loc;
-      e->whereDeclared = fileloc_undefined;
-    }
-  else
-    {
-      e->whereSpecified = fileloc_undefined;
-      e->whereDeclared = loc;
-    }
-
-  e->isPrivate = FALSE;
-  e->hasNameError = FALSE;
-
-  e->used = FALSE;
-  e->lset = FALSE;
-
-  e->uses = filelocList_new ();
-
-  e->info = (uinfo) dmalloc (sizeof (*e->info));
-  e->info->var = (uvinfo) dmalloc (sizeof (*e->info->var));
-  e->info->var->kind = kind;
-  e->info->var->checked = checked;
-  e->info->var->defstate = defstate;
-
-  sRef_setDefState (e->sref, defstate, loc);
-
-  e->info->var->nullstate = sRef_getNullState (e->sref);
-
-  sRef_setExKind (e->sref, exp, loc);
-  sRef_setAliasKind (e->sref, aliased, loc);
-
-  sRef_storeState (e->sref);
-
-  /*DRL ADDED 9-1-2000 */
-  e->info->var->bufinfo = NULL;
-  
-  return (e);
-}
-
-static /*@only@*/ uentry  
-uentry_makeDatatypeBase (/*@only@*/ cstring name, ctype ct, ynm abs, 
-			 ynm mut, ctype rtype, alkind ak, exkind exp, 
-			 sstate defstate, nstate isnull,
-			 /*@only@*/ fileloc loc)
-{
-  uentry e = uentry_alloc ();
-
-  e->ukind = KDATATYPE;
-  /* e->shallowCopy = FALSE; */
-  e->uname = name;
-  e->utype = ct;
-  e->storageclass = SCNONE;
-  e->sref  = sRef_makeUnknown ();
-
-  /*
-  ** This is only setting null state.  (I think?)
-  */
-
-  if (ctype_isUA (ct))
-    {
-      uentry te = usymtab_getTypeEntrySafe (ctype_typeId (ct));
-
-      if (uentry_isValid (te))
-	{
-	  sRef_setStateFromUentry (e->sref, te);
-	}
-      else
-	{
-	  /* problem for recursive type definitions */
-	}
-    }
-  
-  sRef_setAliasKind (e->sref, ak, loc);
-  sRef_setExKind (e->sref, exp, loc);
-
-  sRef_setDefState (e->sref, defstate, loc);
-
-  if (ynm_isOn (abs) && ctype_isUnknown (ct) && isnull == NS_UNKNOWN)
-    {
-      isnull = NS_ABSNULL;
-    }
-
-  sRef_mergeNullState (e->sref, isnull);
-
-  e->whereDefined = fileloc_copy (loc); /*< bogus!  (but necessary for lexer) >*/
-
-  if (fileloc_isSpec (loc))
-    {
-      e->whereSpecified = loc;
-      e->whereDeclared = fileloc_undefined;
-    }
-  else
-    {
-      e->whereSpecified = fileloc_undefined;
-      e->whereDeclared = loc;
-    }
-  
-  e->isPrivate = FALSE;
-  e->hasNameError = FALSE;
-
-  e->used = FALSE;
-  e->lset = FALSE;
-  e->uses = filelocList_new ();
-
-  e->info = (uinfo) dmalloc (sizeof (*e->info));
-  e->info->datatype = (udinfo) dmalloc (sizeof (*e->info->datatype));
-  e->info->datatype->abs = abs;
-  e->info->datatype->mut = mut;
-  e->info->datatype->type = rtype;
-  
-  sRef_storeState (e->sref);
-
-  return (e);
-}
-
-# ifndef NOLCL
-static void uentry_setHasGlobs (uentry ue)
-{
-  llassert (uentry_isFunction (ue));
-
-  ue->info->fcn->hasGlobs = TRUE;
-}
-
-static void uentry_setHasMods (uentry ue)
-{
-  llassert (uentry_isFunction (ue));
-
-  ue->info->fcn->hasMods = TRUE;
-}
-# endif
-
-bool uentry_hasGlobs (uentry ue)
-{
-  if (uentry_isFunction (ue))
-    {
-      return (ue->info->fcn->hasGlobs);
-    }
-
-  return FALSE;
-}
-
-bool uentry_hasSpecialClauses (uentry ue)
-{
-  return (uentry_isFunction (ue) && specialClauses_isDefined (ue->info->fcn->specclauses));
-}
-
-specialClauses uentry_getSpecialClauses (uentry ue)
-{
-  llassert (uentry_isFunction (ue));
-  return ue->info->fcn->specclauses;
-}
-
-bool uentry_hasMods (uentry ue)
-{
-  if (uentry_isFunction (ue))
-    {
-      return (ue->info->fcn->hasMods);
-    }
-
-  return FALSE;
-}
-
-static uentry  
-  uentry_makeFunctionBase (/*@only@*/ cstring name, ctype ct, 
-			   typeIdSet access, 
-			   bool hasGlobs, /*@only@*/ globSet globs, 
-			   bool hasMods, /*@only@*/ sRefSet mods, 
-			   alkind ak, exkind exp, 
-			   sstate defstate, nstate isnull,
-			   exitkind exitCode,
-			   specCode sCode,
-			   qual nullPred,
-			   /*@only@*/ specialClauses specclauses,
-			   /*@only@*/ fileloc loc)
-{
-  uentry e = uentry_alloc ();
-  ctype ret;
-
-  /* e->shallowCopy = FALSE; */
-  e->ukind = KFCN;
-  e->uname = name;
-  e->utype = ct;
-  e->storageclass = SCNONE;
-
-  if (ctype_isFunction (ct))
-    {
-      ret = ctype_returnValue (ct);
-    }
-  else
-    {
-      if (ctype_isKnown (ct))
-	{
-	  llbug (message ("not function: %s", ctype_unparse (ct)));
-	}
-
-      ret = ctype_unknown;
-    }
-
-  e->sref  = sRef_makeType (ret);
-
-  if (ctype_isUA (ret))
-    {
-      sRef_setStateFromType (e->sref, ret);
-    }
-
-  sRef_setDefined (e->sref, loc);
-  sRef_setNullState (e->sref, isnull, loc);
-
-  sRef_setAliasKind (e->sref, ak, loc);
-  sRef_setExKind (e->sref, exp, loc);
-  sRef_setDefState (e->sref, defstate, loc);
-
-  e->whereSpecified = loc;
-  e->whereDefined = fileloc_undefined;
-
-  e->isPrivate = FALSE;
-  e->hasNameError = FALSE;
-
-  e->used = FALSE;
-  e->lset = FALSE;
-  e->uses = filelocList_new ();  
-
-  e->info = (uinfo) dmalloc (sizeof (*e->info));
-  e->info->fcn = (ufinfo) dmalloc (sizeof (*e->info->fcn));
-  
-  e->info->fcn->exitCode = exitCode;
-  e->info->fcn->specialCode = sCode;
-  e->info->fcn->nullPred = nullPred;
-  e->info->fcn->access = access;
-
-  e->info->fcn->specclauses = specclauses;
-  e->info->fcn->hasGlobs = hasGlobs;
-  e->info->fcn->globs = globs;
-
-  e->info->fcn->hasMods = hasMods;
-  e->info->fcn->mods = mods;
-
-  e->info->fcn->defparams = uentryList_undefined; 
-  e->whereDeclared = fileloc_undefined;
-
-  sRef_storeState (e->sref);
-
-  /*drl 111  30 2000*/
-  e->info->fcn->preconditions = NULL;
-    /* end drl */
-
-  /*drl 12  28 2000*/
-  e->info->fcn->postconditions = NULL;
-    /* end drl */
-  
-  return (e);
-}
-
-static /*@only@*/ uentry  
-  uentry_makeTagBase (/*@only@*/ cstring name, ekind tagkind, 
-		      ctype ct, ctype rtype, /*@only@*/ fileloc loc)
-{
-  uentry e = uentry_alloc ();
-  
-  if (tagkind != KSTRUCTTAG && tagkind != KUNIONTAG && tagkind != KENUMTAG)
-    {
-      llbuglit ("uentry_makeTagBase: not a tag type");
-    }
-
-  /* e->shallowCopy = FALSE; */
-  e->ukind = tagkind;
-  e->uname = name;
-  e->utype = ct;
-  e->sref  = sRef_makeUnknown ();
-  e->storageclass = SCNONE;
-
-  if (fileloc_isSpec (loc))
-    {
-      e->whereSpecified = loc;
-      e->whereDeclared = fileloc_undefined;
-    }
-  else
-    {
-      e->whereDeclared = loc;
-      e->whereSpecified = fileloc_undefined;
-    }
-
-  e->whereDefined = fileloc_undefined;
-
-  e->isPrivate = FALSE;
-  e->hasNameError = FALSE;
-
-  e->used = FALSE;
-  e->lset = FALSE;
-  e->uses = filelocList_new ();
-
-  e->info = (uinfo) dmalloc (sizeof (*e->info));
-  e->info->datatype = (udinfo) dmalloc (sizeof (*e->info->datatype));
-  e->info->datatype->abs  = NO;
-  e->info->datatype->mut  = MAYBE;
-  e->info->datatype->type = rtype;
-
-  sRef_storeState (e->sref);
-
-  return (e);  
-}
-
-static uentry  
-  uentry_makeIterBase (/*@only@*/ cstring name, typeIdSet access, 
-		       ctype ct, /*@only@*/ fileloc loc)
-{
-  uentry e = uentry_alloc ();
-  
-  /* e->shallowCopy = FALSE; */
-  e->ukind = KITER;
-  e->uname = name;
-  e->utype = ct;
-  e->sref  = sRef_makeUnknown ();
-  e->storageclass = SCNONE;
-
-  if (fileloc_isSpec (loc))
-    {
-      e->whereSpecified = loc;
-      e->whereDeclared = fileloc_undefined;
-    }
-  else
-    {
-      e->whereDeclared = loc;
-      e->whereSpecified = fileloc_undefined;
-    }
-
-  e->whereDefined = fileloc_undefined;
-  
-  e->isPrivate = FALSE;
-  e->hasNameError = FALSE;
-
-  e->used = FALSE;
-  e->lset = FALSE;
-  e->uses = filelocList_new ();
-
-  e->info = (uinfo) dmalloc (sizeof (*e->info));
-  e->info->iter = (uiinfo) dmalloc (sizeof (*e->info->iter));
-  e->info->iter->access = access;
-  e->info->iter->mods = sRefSet_undefined;
-  e->info->iter->globs = globSet_undefined;
-  
-  sRef_storeState (e->sref);
-  return (e);
-}
-
-static uentry  
-  uentry_makeEndIterBase (/*@only@*/ cstring name, typeIdSet access, 
-			  /*@only@*/ fileloc loc)
-{
-  uentry e = uentry_alloc ();
-
-  /* e->shallowCopy = FALSE; */
-  e->ukind = KENDITER;
-  e->storageclass = SCNONE;
-  e->uname = name;
-  e->utype = ctype_unknown;
-  e->sref  = sRef_makeUnknown ();
-  
-  if (fileloc_isSpec (loc))
-    {
-      e->whereSpecified = loc;
-      e->whereDeclared = fileloc_undefined;
-    }
-  else
-    {
-      e->whereDeclared = loc;
-      e->whereSpecified = fileloc_undefined;
-    }
-
-  e->whereDefined = fileloc_undefined;
-
-  e->isPrivate = FALSE;
-  e->hasNameError = FALSE;
-
-  e->used = FALSE;
-  e->lset = FALSE;
-  e->uses = filelocList_new ();
-
-  e->info = (uinfo) dmalloc (sizeof (*e->info));
-  e->info->enditer = (ueinfo) dmalloc (sizeof (*e->info->enditer));
-  e->info->enditer->access = access;
-  sRef_storeState (e->sref);
-
-  return (e);
-}
-
-void uentry_markFree (/*@unused@*/ /*@owned@*/ uentry u)
-{
-  /* should save u */
-/*@-mustfree@*/
-}
-/*@=mustfree@*/
-
-/*@only@*/ uentry
-uentry_undump (ekind kind, fileloc loc, char **s)
-{
-  uentry ue;
-  
-  if (**s == '!')
-    {
-      checkChar (s, '!');
-      checkChar (s, '.');
-      ue = uentry_makeElipsisMarker ();
-    }
-  else
-    {
-      ctype ct = ctype_undump (s);
-      cstring name;
-
-      switch (kind)
-	{
-	case KVAR:
-	  {
-	    vkind  tkind;
-	    sstate defstate;
-	    nstate isnull;
-	    alkind aliased;
-	    exkind exp;
-	    chkind checked;
-	    
-	    checkChar (s, '|');
-
-	    if (optCheckChar (s, '@'))
-	      {
-		tkind = vkind_fromInt (getInt (s));
-		checkChar (s, '|');
-	      }
-	    else
-	      {
-		tkind = VKPARAM;
-	      }
-
-	    if (optCheckChar (s, '$'))
-	      {
-		defstate = SS_UNKNOWN;
-		isnull = NS_UNKNOWN;
-		aliased = AK_IMPTEMP;
-		exp = XO_UNKNOWN;
-		checked = CH_UNKNOWN;
-	      }		
-	    else if (optCheckChar (s, '&'))
-	      {
-		defstate = SS_DEFINED;
-		isnull = NS_UNKNOWN;
-		aliased = AK_IMPTEMP;
-		exp = XO_UNKNOWN;
-		checked = CH_UNKNOWN;
-	      }		
-	    else if (optCheckChar (s, '^'))
-	      {
-		defstate = SS_UNKNOWN;
-		isnull = NS_UNKNOWN;
-		aliased = AK_IMPTEMP;
-		exp = XO_UNKNOWN;
-		checked = CH_UNKNOWN;
-	      }		
-	    else
-	      {
-		defstate = sstate_fromInt (getInt (s));      
-		advanceField (s); isnull = nstate_fromInt (getInt (s));      
-		advanceField (s); aliased = alkind_fromInt (getInt (s));      
-
-		if (optCheckChar (s, '&'))
-		  {
-		    exp = XO_UNKNOWN;
-		    checked = CH_UNKNOWN;
-		  }
-		else
-		  {
-		    advanceField (s); exp = exkind_fromInt (getInt (s));      
-		    advanceField (s); checked = (chkind) (getInt (s));      
-		  }
-	      }
-
-	    advanceName (s);
-	    name = getStringWord (s);
-	    
-	    ue = uentry_makeVariableBase (name, ct, tkind, defstate, 
-					  isnull, aliased, exp, 
-					  checked, fileloc_copy (loc));
-	  }
-	  break;
-	case KDATATYPE: 
-	  {
-	    ynm abs;
-	    ynm mut;
-	    ctype rtype;
-	    sstate defstate;
-	    nstate isnull;
-	    alkind aliased;
-	    exkind exp;
-
-	    advanceField (s); abs = ynm_fromCodeChar (loadChar (s));
-	    advanceField (s); mut = ynm_fromCodeChar (loadChar (s));
-	    advanceField (s); defstate = sstate_fromInt (getInt (s));      
-	    advanceField (s); isnull = nstate_fromInt (getInt (s));      
-	    advanceField (s); aliased = alkind_fromInt (getInt (s));      
-	    advanceField (s); exp = exkind_fromInt (getInt (s));      
-	    advanceField (s); rtype = ctype_undump (s);
-	    advanceName (s); 
-	    name = getStringWord (s);
-
-	    ue = uentry_makeDatatypeBase (name, ct, abs, mut, rtype, 
-					  aliased, exp, defstate, isnull, 
-					  fileloc_copy (loc));
-	  }
-	  break;
-	case KFCN:
-	  {
-	    alkind     ak;
-	    exkind     exp;
-	    sstate     defstate;
-	    nstate     isnull;
-	    exitkind   exitCode;
-	    specCode   specc;
-	    qual       nullPred;
-	    typeIdSet access;
-	    bool       hasGlobs;
-	    globSet    globs;
-	    bool       hasMods;
-	    sRefSet    mods;
-	    specialClauses specclauses;
-
-	    if (optCheckChar (s, '$'))
-	      {
-		defstate = SS_DEFINED;
-		isnull = NS_UNKNOWN;
-		exitCode = XK_UNKNOWN;
-		specc = SPC_NONE;
-		nullPred = QU_UNKNOWN;
-	      }
-	    else
-	      {
-		advanceField (s); defstate = sstate_fromInt (getInt (s)); 
-		advanceField (s); isnull = nstate_fromInt (getInt (s)); 
-		advanceField (s); exitCode = exitkind_fromInt (getInt (s)); 
-		advanceField (s); specc = specCode_fromInt (getInt (s)); 
-		advanceField (s); nullPred = qual_fromInt (getInt (s)); 
-	      }
-
-	    if (optCheckChar (s, '$'))
-	      {
-		hasGlobs = FALSE;
-		globs = globSet_undefined;
-		hasMods = FALSE;
-		mods = sRefSet_undefined;
-	      }
-	    else if (optCheckChar (s, '^'))
-	      {
-		hasGlobs = TRUE;
-		globs = globSet_undefined;
-		hasMods = TRUE;
-		mods = sRefSet_undefined;
-	      }
-	    else
-	      {
-		advanceField (s); hasGlobs = bool_fromInt (getInt (s));
-		advanceField (s); globs  = globSet_undump (s);
-		advanceField (s); hasMods = bool_fromInt (getInt (s));
-		advanceField (s); mods   = sRefSet_undump (s);	    
-	      }
-
-	    if (optCheckChar (s, '$'))
-	      {
-		ak = AK_UNKNOWN;
-		exp = XO_UNKNOWN;
-	      }
-	    else
-	      {
-		advanceField (s); ak = alkind_fromInt (getInt (s));
-		advanceField (s); exp = exkind_fromInt (getInt (s));      
-	      }
-
-	    advanceField (s); access = typeIdSet_undump (s);
-
-	    if (optCheckChar (s, '@'))
-	      {
-		specclauses = specialClauses_undump (s);
-	      }
-	    else
-	      {
-		specclauses = specialClauses_undefined; 
-	      }
-
-	    advanceName (s);  name = getStringWord (s);
-
-	    ue = uentry_makeFunctionBase (name, ct, access, 
-					  hasGlobs, globs, 
-					  hasMods, mods, 
-					  ak, exp, defstate, isnull, 
-					  exitCode, specc, nullPred,
-					  specclauses,
-					  fileloc_copy (loc));
-	    DPRINTF (("Undump: %s", uentry_unparse (ue)));
-	  }
-	  break;
-	case KITER:
-	  {
-	    typeIdSet access;
-	    
-	    advanceField (s); access = typeIdSet_undump (s);
-	    advanceName (s);  name = getStringWord (s);
-	    
-	    ue = uentry_makeIterBase (name, access, ct,
-				      fileloc_copy (loc));
-	  }
-	  break;
-	case KENDITER:
-	  {
-	    typeIdSet access;
-
-	    advanceField (s); access = typeIdSet_undump (s);
-	    advanceName (s);  name = getStringWord (s);
-	    
-	    ue = uentry_makeEndIterBase (name, access, fileloc_copy (loc));
-	  }
-	  break;
-	case KENUMCONST:  
-	case KCONST:  
-	  {
-	    typeIdSet access;
-	    multiVal val;
-	    nstate nullstate;
-
-	    if (optCheckChar (s, '$'))
-	      {
-		val = multiVal_undefined;
-		access = typeIdSet_undefined;
-		nullstate = NS_UNKNOWN;
-	      }
-	    else
-	      {
-		advanceField (s); val = multiVal_undump (s);
-		advanceField (s); access = typeIdSet_undump (s);
-		advanceField (s); nullstate = nstate_fromInt (getInt (s));
-	      }
-
-	    advanceName (s);  name = getStringWord (s);
-	    
-	    ue = uentry_makeConstantBase (name, ct, access,
-					  nullstate, fileloc_copy (loc), val);
-	    break;
-	  }
-	case KSTRUCTTAG:
-	case KUNIONTAG:
-	case KENUMTAG:
-	  {
-	    ctype rtype;
-	    
-	    advanceField (s); rtype = ctype_undump (s);
-	    advanceName (s);  name = getStringWord (s);
-	    ue = uentry_makeTagBase (name, kind, ct, rtype, fileloc_copy (loc));
-	  }
-	  break;
-	case KINVALID:
-	  llcontbuglit ("uentry_undump: invalid");
-	  ue = uentry_undefined;
-	  break;
-	case KELIPSMARKER:
-	  llcontbuglit ("uentry_undump: elips marker");
-	  ue = uentry_undefined;
-	  break;
-	}
-    }
-  
-  return (ue);
-}
-
-cstring
-uentry_dump (uentry v)
-{
-  return (uentry_dumpAux (v, FALSE));
-}
-
-cstring
-uentry_dumpParam (uentry v)
-{
-  llassertprint (uentry_isVariable (v) || uentry_isElipsisMarker (v),
-		 ("dump: %s", uentry_unparseFull (v)));
-
-  return (uentry_dumpAux (v, TRUE));
-}
-
-static cstring
-uentry_dumpAux (uentry v, bool isParam)
-{
-  llassert (uentry_isValid (v));
-
-  DPRINTF (("Dumping entry: %s", uentry_unparseFull (v)));
-
-  switch (v->ukind)
-    {
-    case KINVALID: 
-      llcontbuglit ("uentry_dump: invalid entry"); 
-      return cstring_undefined;
-    case KELIPSMARKER: 
-      return (message ("!."));
-    case KVAR:     
-      {
-	cstring sdump;
-	vkind vk  = v->info->var->kind;
-	sstate dss = sRef_getDefState (v->sref);
-	nstate nst = sRef_getNullState (v->sref);
-	alkind alk = sRef_getAliasKind (v->sref);
-	exkind exk = sRef_getExKind (v->sref);
-	chkind chk = v->info->var->checked;
-
-	DPRINTF (("Dumping var"));
-
-	if (dss == SS_UNKNOWN
-	    && nst == NS_UNKNOWN
-	    && alk == AK_IMPTEMP
-	    && exk == XO_UNKNOWN
-	    && chk == CH_UNKNOWN)
-	  {
-	    sdump = cstring_makeLiteral ("$");
-	  }
-	else if (dss == SS_DEFINED
-		 && nst == NS_UNKNOWN
-		 && alk == AK_IMPTEMP
-		 && exk == XO_UNKNOWN
-		 && chk == CH_UNKNOWN)
-	  {
-	    sdump = cstring_makeLiteral ("&");
-	  }
-	else if (dss == SS_UNKNOWN
-		 && nst == NS_UNKNOWN
-		 && alk == AK_UNKNOWN
-		 && exk == XO_UNKNOWN
-		 && chk == CH_UNKNOWN)
-	  {
-	    sdump = cstring_makeLiteral ("^");
-	  }
-	else if (exk == XO_UNKNOWN
-		 && chk == CH_UNKNOWN)
-	  {
-	    sdump = message ("%d@%d@%d&",
-			     (int) dss,
-			     (int) nst,
-			     (int) alk);
-	  }
-	else
-	  {
-	    sdump = message ("%d@%d@%d@%d@%d",	
-		     (int) dss,
-			     (int) nst,
-			     (int) alk,
-			     (int) exk,
-			     (int) chk);
-	  }
-	
-
-	if (vk != VKPARAM)
-	  {
-	    return (message ("%q|@%d|%q#%s", 
-			     ctype_dump (v->utype), 
-			     (int) vk,
-			     sdump,
-			     isParam ? cstring_undefined : v->uname));
-	  }
-	else
-	  {
-	    return (message ("%q|%q#%s", 
-			     ctype_dump (v->utype), 
-			     sdump,
-			     isParam ? cstring_undefined : v->uname));
-	  }
-
-      }
-    case KDATATYPE: 
-      return (message ("%q@%s@%s@%d@%d@%d@%d@%q#%s", 
-		       ctype_dump (v->utype),
-		       ynm_unparseCode (v->info->datatype->abs),
-		       ynm_unparseCode (v->info->datatype->mut),
-		       (int) sRef_getDefState (v->sref),
-		       (int) sRef_getNullState (v->sref),
-		       (int) sRef_getAliasKind (v->sref),
-		       (int) sRef_getExKind (v->sref),
-		       ctype_dump (v->info->datatype->type),
-		       v->uname));
-    case KFCN:
-      {
-	cstring sdump, gdump, adump;
-	alkind alk = sRef_getAliasKind (v->sref);
-	exkind exk = sRef_getExKind (v->sref);
-
-	if (sRef_getDefState (v->sref) == SS_DEFINED
-	    && !nstate_isKnown (sRef_getNullState (v->sref))
-	    && !exitkind_isKnown (v->info->fcn->exitCode)
-	    && v->info->fcn->specialCode == SPC_NONE
-	    && v->info->fcn->nullPred == QU_UNKNOWN)
-	  {
-	    sdump = cstring_makeLiteral ("$");
-	  }
-	else
-	  {
-	    sdump = message ("@%d@%d@%d@%d@%d",
-			     (int) sRef_getDefState (v->sref),
-			     (int) sRef_getNullState (v->sref),
-			     (int) v->info->fcn->exitCode,
-			     (int) v->info->fcn->specialCode,
-			     (int) v->info->fcn->nullPred);
-	  }
-
-	if (!uentry_hasGlobs(v) && !uentry_hasMods (v))
-	  {
-	    gdump = cstring_makeLiteral ("$");
-	  }
-	else if (uentry_hasGlobs (v) && globSet_isEmpty (uentry_getGlobs (v))
-		 && uentry_hasMods (v) && sRefSet_isEmpty (uentry_getMods (v)))
-	  {
-	    gdump = cstring_makeLiteral ("^");
-	  }
-	else
-	  {
-	    gdump = message ("@%s@%q@%s@%q",
-			     bool_dump (uentry_hasGlobs (v)),
-			     globSet_dump (uentry_getGlobs (v)),
-			     bool_dump (uentry_hasMods (v)),
-			     sRefSet_dump (uentry_getMods (v)));
-	  }
-
-	if (alk == AK_UNKNOWN && exk == XO_UNKNOWN)
-	  {
-	    adump = cstring_makeLiteral ("$");
-	  }
-	else
-	  {
-	    adump = message ("@%d@%d", (int) alk, (int) exk);
-	  }
-
-	if (uentry_hasSpecialClauses (v))
-	  {
-	    return (message ("%q%q%q%q@%q@%q#%s",
-			     ctype_dump (v->utype),
-			     sdump,
-			     gdump,
-			     adump,
-			     typeIdSet_dump (uentry_accessType (v)),
-			     specialClauses_dump (v->info->fcn->specclauses),
-			     v->uname));
-	  }
-	else
-	  {
-	    return (message ("%q%q%q%q@%q#%s",
-			     ctype_dump (v->utype),
-			     sdump,
-			     gdump,
-			     adump,
-			     typeIdSet_dump (uentry_accessType (v)),
-			     v->uname));
-	  }
-      }
-    case KITER:
-      return (message ("%q@%q#%s",
-		       ctype_dump (v->utype),
-		       typeIdSet_dump (v->info->iter->access),
-		       v->uname));
-    case KENDITER:
-      return (message ("%q@%q#%s",
-		       ctype_dump (v->utype),
-		       typeIdSet_dump (uentry_accessType (v)),
-		       v->uname));
-    case KENUMCONST:  
-    case KCONST:  
-      {
-	cstring sdump;
-
-	if (multiVal_isUnknown (v->info->uconst->val)
-	    && typeIdSet_isEmpty (uentry_accessType (v))
-	    && (sRef_getNullState (v->sref) == NS_UNKNOWN))
-	  {
-	    sdump = cstring_makeLiteral ("$");
-	  }
-	else
-	  {
-	    sdump = message ("@%q@%q@%d",
-			     multiVal_dump (v->info->uconst->val),
-			     typeIdSet_dump (uentry_accessType (v)),
-			     (int) sRef_getNullState (v->sref));
-	  }
-
-	return (message ("%q%q#%s", 
-			 ctype_dump (v->utype), 
-			 sdump,
-			 v->uname));
-      }
-    case KSTRUCTTAG:
-    case KUNIONTAG:
-    case KENUMTAG:
-      return (message ("%q@%q#%s", 
-		       ctype_dump (v->utype), 
-		       ctype_dump (v->info->datatype->type), v->uname));
-    }
-
-  BADEXIT;
-}
-
-/*@only@*/ cstring
-uentry_unparseAbbrev (uentry v)
-{
-  if (!uentry_isVariable (v))
-    {
-      llcontbuglit ("uentry_unparseAbbrev: not variable");
-      return uentry_unparse (v);
-    }
-
-  return (message ("%s %q", ctype_unparseDeep (v->utype), uentry_getName (v)));
-}
-
-/*@only@*/ cstring
-uentry_unparse (uentry v)
-{
-  cstring st;
-
-    if (uentry_isUndefined (v)) return (cstring_makeLiteral (""));
-  if (uentry_isElipsisMarker (v)) return (cstring_makeLiteral ("..."));
-
-  st = uentry_getName (v);
-
-  if (cstring_isDefined (st))
-    {
-      return (ctype_unparseDeclaration (v->utype, st)); 
-    }
-  else
-    {
-      cstring_free (st);
-      return (cstring_copy (ctype_unparse (v->utype)));
-    }
-}
-
-/*@only@*/ cstring
-uentry_unparseFull (uentry v)
-{
-  if (uentry_isUndefined (v))
-    {
-      return (cstring_makeLiteral (""));
-    }
-  else if (uentry_isDatatype (v))
-    {
-      return (message ("[%d] [%s] %s %q : %t [%t] %s %s // %q [s: %q; d: %q]",
-		       (int) v,
-		       ekind_unparse (v->ukind),
-		       v->uname,
-		       uentry_getName (v),
-		       v->utype,
-		       ctype_isDefined (v->info->datatype->type) 
-		          ? v->info->datatype->type : ctype_unknown,
-		       ynm_unparse (v->info->datatype->mut),
-		       ynm_unparse (v->info->datatype->abs),
-		       sRef_unparseState (v->sref),
-		       fileloc_unparse (v->whereSpecified),
-		       fileloc_unparse (v->whereDefined)));
-    }
-  else if (uentry_isFunction (v))
-    {
-      return (message ("[%w] = [%s] %q : %t / sref: %q / mods: %q / "
-		       "globs: %q / [s: %q; decl: %q; def: %q]",
-		       (long unsigned) v,
-		       ekind_unparse (v->ukind),
-		       uentry_getName (v),
-		       v->utype,
-		       sRef_unparseFull (v->sref),
-		       sRefSet_unparse (v->info->fcn->mods),
-		       globSet_unparse  (v->info->fcn->globs),
-		       fileloc_unparse (v->whereSpecified),
-		       fileloc_unparse (v->whereDeclared),
-		       fileloc_unparse (v->whereDefined)));
-    }
-  else if (uentry_isIter (v))
-    {
-      return (message ("[%s] %q: %t / %q [s: %q; d: %q]",
-		       ekind_unparse (v->ukind),
-		       uentry_getName (v),
-		       v->utype,
-		       sRef_unparseFull (v->sref),
-		       fileloc_unparse (v->whereSpecified),
-		       fileloc_unparse (v->whereDefined)));
-    }
-  else if (uentry_isVariable (v))
-    {
-      return 
-	(message ("[check: %s] / [%w] = [%s] %s : %t %q [s: %q; def: %q; dec: %q] "
-		  "kind <%d> isout <%d> used <%d>",
-		  checkedName (v->info->var->checked),
-		  (long unsigned) v,
-		  ekind_unparse (v->ukind),
-		  v->uname,
-		  v->utype,
-		  sRef_unparseDeep (v->sref),
-		  fileloc_unparse (v->whereSpecified),
-		  fileloc_unparse (v->whereDefined),
-		  fileloc_unparse (v->whereDeclared),
-		  (int) v->info->var->kind,
-		  (int) v->info->var->defstate,
-		  (int) v->used));
-    }
-  else
-    {
-      return (message ("[%s] %s : %t %q at [s: %q; d: %q]",
-		       ekind_unparse (v->ukind),
-		       v->uname,
-		       v->utype,
-		       sRef_unparseFull (v->sref),
-		       fileloc_unparse (v->whereSpecified),
-		       fileloc_unparse (v->whereDefined)));
-      
-    }
-}
-
-bool uentry_hasAccessType (uentry e)
-{
-  if (uentry_isValid (e))
-    {
-      switch (e->ukind)
-	{
-	case KITER:
-	  return (!typeIdSet_isEmpty (e->info->iter->access));
-	case KENDITER:
-	  return (!typeIdSet_isEmpty (e->info->enditer->access));
-	case KFCN:
-	  return (!typeIdSet_isEmpty (e->info->fcn->access));
-	case KENUMCONST:
-	case KCONST:
-	  return (!typeIdSet_isEmpty (e->info->uconst->access));
-	default:
-	  return FALSE;
-	}
-    }
-
-  return FALSE;
-}
-  
-typeIdSet uentry_accessType (uentry e)
-{
-  if (uentry_isValid (e))
-    {
-      switch (e->ukind)
-	{
-	case KITER:
-	  return (e->info->iter->access);
-	case KENDITER:
-	  return (e->info->enditer->access);
-	case KFCN:
-	  return (e->info->fcn->access);
-	case KENUMCONST:
-	case KCONST:
-	  return (e->info->uconst->access);
-	default:
-	  break;
-	}
-    }
-
-  return typeIdSet_undefined;
-}
-
-bool
-uentry_isVariable (uentry e)
-{
-  return (uentry_isVar (e));
-}
-
-bool
-uentry_isSpecified (uentry e)
-{
-  return (uentry_isValid (e) && !fileloc_isUndefined (e->whereSpecified));
-}
-
-static bool
-uentry_isReallySpecified (uentry e)
-{
-  return (uentry_isValid (e) 
-	  && fileloc_isRealSpec (e->whereSpecified));
-}
-
-bool
-uentry_isVar (uentry e)
-{
-  return (!uentry_isUndefined (e) && e->ukind == KVAR);
-}
-
-bool 
-uentry_isFakeTag (uentry e)
-{
-  return (uentry_isValid (e) && strchr (cstring_toCharsSafe (e->uname), '!') != 0);
-}
-
-bool
-uentry_isDatatype (uentry e)
-{
-  return (!uentry_isUndefined (e) &&
-	  (e->ukind == KDATATYPE || e->ukind == KSTRUCTTAG ||
-	   e->ukind == KUNIONTAG || e->ukind == KENUMTAG));
-}
-
-void
-uentry_setAbstract (uentry e)
-{
-  typeId oldid;
-
-  llassert (uentry_isDatatype (e) 
-	    && (ynm_isMaybe (e->info->datatype->abs)));
-
-  oldid = ctype_typeId (e->info->datatype->type);
-  e->info->datatype->abs = YES;
-  e->info->datatype->type = ctype_createAbstract (oldid);
-}
-
-void
-uentry_setConcrete (uentry e)
-{
-  llassert (uentry_isDatatype (e) 
-	    && (ynm_isMaybe (e->info->datatype->abs)));
-
-  e->info->datatype->abs = NO;
-}
-
-bool
-uentry_isAbstractDatatype (uentry e)
-{
-  return (uentry_isDatatype (e) 
-	  && (ynm_isOn (e->info->datatype->abs)));
-}
-
-bool
-uentry_isMaybeAbstract (uentry e)
-{
-  return (uentry_isDatatype (e) 
-	  && (ynm_isMaybe (e->info->datatype->abs)));
-}
-
-bool
-uentry_isMutableDatatype (uentry e)
-{
-  bool res = uentry_isDatatype (e) 
-    && (ynm_toBoolRelaxed (e->info->datatype->mut));
-  
-  return res;
-}
-
-bool
-uentry_isRefCountedDatatype (uentry e)
-{
-  return (uentry_isDatatype (e) && (sRef_isRefCounted (uentry_getSref (e))));
-}
-
-bool
-uentry_isParam (uentry u)
-{
-  return (uentry_isVariable (u) && (u->info->var->kind == VKPARAM
-				    || u->info->var->kind == VKYIELDPARAM));
-}
-
-bool
-uentry_isExpandedMacro (uentry u)
-{
-  return (uentry_isVariable (u) && (u->info->var->kind == VKEXPMACRO));
-}
-
-bool
-uentry_isSefParam (uentry u)
-{
-  return (uentry_isVariable (u) 
-	  && (u->info->var->kind == VKSEFPARAM
-	      || u->info->var->kind == VKREFSEFPARAM
-	      || u->info->var->kind == VKSEFRETPARAM
-	      || u->info->var->kind == VKREFSEFRETPARAM));
-}
-
-bool
-uentry_isRefParam (uentry u)
-{
-  return (uentry_isVariable (u) 
-	  && (u->info->var->kind == VKREFPARAM
-	      || u->info->var->kind == VKREFYIELDPARAM
-	      || u->info->var->kind == VKREFSEFPARAM
-	      || u->info->var->kind == VKREFSEFRETPARAM));
-}
-
-bool
-uentry_isAnyParam (uentry u)
-{
-  return (uentry_isVariable (u) 
-	  && ((u->info->var->kind == VKPARAM)
-	      || (u->info->var->kind == VKSEFPARAM)
-	      || (u->info->var->kind == VKYIELDPARAM)
-	      || (u->info->var->kind == VKRETPARAM)
-	      || (u->info->var->kind == VKSEFRETPARAM)));
-}
-
-sstate 
-uentry_getDefState (uentry u)
-{
-  if (uentry_isValid (u))
-    {
-      return (sRef_getDefState (u->sref));
-    }
-  else
-    {
-      return (SS_UNKNOWN);
-    }
-}
-
-bool
-uentry_isOut (uentry u)
-{
-  return ((uentry_isVariable (u) && (u->info->var->defstate == SS_ALLOCATED))
-	  || (uentry_isDatatype (u) && (sRef_isAllocated (u->sref))));
-}
-
-bool
-uentry_isPartial (uentry u)
-{
-  return ((uentry_isVariable (u) && (u->info->var->defstate == SS_PARTIAL))
-	  || (uentry_isDatatype (u) && (sRef_isAllocated (u->sref))));
-}
-
-bool
-uentry_isStateSpecial (uentry u)
-{
-  return ((uentry_isVariable (u) 
-	   && (u->info->var->defstate == SS_SPECIAL))
-	  || (uentry_isValid (u) && sRef_isStateSpecial (u->sref)));
-}
-
-exitkind uentry_getExitCode (uentry ue) 
-{
-  if (uentry_isFunction (ue))
-    {
-      return ue->info->fcn->exitCode;
-    }
-  else
-    {
-      return XK_UNKNOWN;
-    }
-}
-
-qual
-uentry_nullPred (uentry u)
-{
-  llassert (uentry_isRealFunction (u));
-
-  if (uentry_isFunction (u))
-    {
-      return (u->info->fcn->nullPred);
-    }
-  else
-    {
-      return QU_UNKNOWN;
-    }
-}
-
-bool
-uentry_possiblyNull (uentry u)
-{
-  return ((uentry_isVariable (u) && (nstate_possiblyNull (u->info->var->nullstate)))
-	  || (uentry_isDatatype (u) && (sRef_possiblyNull (u->sref))));
-}
-
-alkind 
-uentry_getAliasKind (uentry u)
-{
-  if (uentry_isValid (u))
-    {
-      return (sRef_getAliasKind (uentry_getSref (u)));
-    }
-  else
-    {
-      return AK_UNKNOWN;
-    }
-}
-
-exkind 
-uentry_getExpKind (uentry u)
-{
-  if (uentry_isValid (u))
-    {
-      return (sRef_getExKind (uentry_getSref (u)));
-    }
-  else
-    {
-      return XO_UNKNOWN;
-    }
-}
-
-bool
-uentry_isIter (uentry e)
-{
-  return (!uentry_isUndefined (e) && e->ukind == KITER);
-}
-
-bool
-uentry_isEndIter (uentry e)
-{
-  return (!uentry_isUndefined (e) && e->ukind == KENDITER);
-}
-
-bool
-uentry_isRealFunction (uentry e)
-{
-  return (uentry_isFunction (e) ||
-	  (uentry_isVariable (e) && ctype_isFunction (uentry_getType (e))));
-}
-
-bool
-uentry_hasName (uentry e)
-{
-  if (uentry_isValid (e))
-    {
-      cstring s = e->uname;
-      
-      return (!(cstring_isEmpty (s) || cstring_equalLit (s, "...")));
-    }
-  else
-    {
-      return FALSE;
-    }
-}
-
-bool uentry_hasRealName (uentry e)
-{
-  return (uentry_isValid (e) && cstring_isNonEmpty (e->uname));
-}
-
-
-/*@observer@*/ globSet
-uentry_getGlobs (uentry l)
-{
-  if (uentry_isInvalid (l)) 
-    {
-      return globSet_undefined;
-    }
-
-  if (l->ukind != KFCN)
-    {
-      if (l->ukind != KITER && l->ukind != KENDITER)
-	{
-	  if (l->ukind == KVAR)
-	    {
-	      llbug (message ("Bad call to uentry_getGlobs (var): %q (%s)", 
-			      uentry_unparse (l), 
-			      ekind_unparse (l->ukind)));
-	    }
-	  else
-	    {
-	      llbug (message ("Bad call to uentry_getGlobs: %q (%s)", 
-			      uentry_unparse (l), 
-			      ekind_unparse (l->ukind)));
-	    }
-	}
-      return globSet_undefined;
-    }
-
-  return l->info->fcn->globs;
-}
-
-/*@observer@*/ sRefSet
-uentry_getMods (uentry l)
-{
-  llassert (uentry_isValid (l));
-
-  if (l->ukind != KFCN && l->ukind != KITER && l->ukind != KENDITER)
-    {
-      llcontbug (message ("Bad call to uentry_getMods: %q", uentry_unparse (l)));
-      return sRefSet_undefined; 
-    }
-
-  return l->info->fcn->mods;
-}
-
-ekind
-uentry_getKind (uentry e)
-{
-  llassert (uentry_isValid (e));
-
-  return (e->ukind);
-}
-
-/*@observer@*/ multiVal uentry_getConstantValue (uentry e)
-{
-  llassert (uentry_isEitherConstant (e));
-
-  return (e->info->uconst->val);
-}
-
-/*@observer@*/ uentryList
-uentry_getParams (uentry l)
-{
-  if (uentry_isInvalid (l)) return uentryList_undefined;
-
-  switch (l->ukind)
-    {
-    case KFCN:  
-    case KITER:
-      {
-	ctype ct = l->utype;
-
-	if (ctype_isFunction (ct))
-	  {
-	    return (ctype_argsFunction (ct));
-	  }
-	else
-	  {
-	    return uentryList_undefined;
-	  }
-      }
-    case KVAR:  
-      {
-	ctype ct = l->utype;
-
-	llassert (ctype_isFunction (ct));
-	return (ctype_argsFunction (ct));
-      }
-    BADDEFAULT;
-    }
-  BADEXIT;
-}
-
-/*@observer@*/ cstring
-uentry_rawName (uentry e)
-{
-  if (uentry_isValid (e))
-    {
-      return (e->uname);
-    }
-  else
-    {
-      return cstring_undefined;
-    }
-}
-
-static cstring
-uentry_getOptName (uentry e)
-{
-  cstring s = uentry_getName (e);
-
-  if (cstring_isDefined (s))
-    {
-      s = cstring_appendChar (s, ' ');
-    }
-  
-  return s;
-}
-
-/*@only@*/ cstring
-uentry_getName (uentry e)
-{
-  cstring ret = cstring_undefined;
-
-  if (uentry_isValid (e))
-    {
-      
-      if (uentry_isAnyTag (e))
-	{
-	  ret = fixTagName (e->uname); 
-	}
-      else if (uentry_isAnyParam (e))
-	{
-	  ret = cstring_copy (fixParamName (e->uname));
-	}
-      else
-	{
-	  ret = cstring_copy (e->uname);
-	}
-    }
-
-  return ret;
-}
-
-cstring uentry_getRealName (uentry e)
-{
-  if (uentry_isValid (e))
-    {
-      if (uentry_isAnyTag (e))
-	{
-	  return (cstring_undefined);
-	}
-      else
-	{
-	  return (e->uname);
-	}
-    }
-  return cstring_undefined;
-}
-
-ctype uentry_getType (uentry e)
-{
-  if (uentry_isValid (e))
-    {
-      return e->utype;
-    }
-  else
-    {
-      return ctype_unknown;
-    }
-}
-
-fileloc uentry_whereLast (uentry e)
-{
-  fileloc loc;
-
-  if (uentry_isInvalid (e)) 
-    {
-      return fileloc_undefined;
-    }
-  
-  loc = e->whereDefined;
-
-  if (fileloc_isValid (loc) && !fileloc_isExternal (loc))
-    {
-      return loc;
-    }
-
-  loc = uentry_whereDeclared (e);
-
-  if (fileloc_isValid (loc) && !fileloc_isExternal (loc))
-    {
-      return loc;
-    }
-
-  loc = uentry_whereSpecified (e);
-  return loc;
-}
-
-fileloc uentry_whereEither (uentry e)
-{
-  if (uentry_isInvalid (e)) return fileloc_undefined;
-
-  if (fileloc_isDefined (e->whereDefined) 
-      && !fileloc_isExternal (e->whereDefined))
-    {
-      return e->whereDefined;
-    }
-  else if (fileloc_isDefined (e->whereDeclared))
-    {
-      return e->whereDeclared;
-    }
-  else
-    {
-      return e->whereSpecified;
-    }
-}
-
-fileloc uentry_whereSpecified (uentry e)
-{
-  if (uentry_isInvalid (e)) return fileloc_undefined;
-
-  return (e->whereSpecified);
-}
-
-fileloc uentry_whereDefined (uentry e)
-{
-  if (uentry_isInvalid (e)) return fileloc_undefined;
-
-  return (e->whereDefined);
-}
-
-fileloc uentry_whereDeclared (uentry e)
-{
-  if (uentry_isInvalid (e)) return fileloc_undefined;
-
-  return (e->whereDeclared);
-}
-
-/*@observer@*/ fileloc
-uentry_whereEarliest (uentry e)
-{
-  if (uentry_isInvalid (e)) return fileloc_undefined;
-  
-  if (fileloc_isDefined (e->whereSpecified))
-    {
-      return (e->whereSpecified);
-    }
-  else if (fileloc_isDefined (e->whereDeclared))
-    {
-      return (e->whereDeclared);
-    }
-  else
-    {
-      return e->whereDefined;
-    }
-}
-
-void
-uentry_setFunctionDefined (uentry e, fileloc loc)
-{
-  if (uentry_isValid (e))
-    {
-      llassert (uentry_isFunction (e));
-
-      if (fileloc_isUndefined (e->whereDeclared))
-	{
-	  e->whereDeclared = fileloc_update (e->whereDeclared, loc);
-	}
-      
-      if (!fileloc_isDefined (e->whereDefined))
-	{
-	  e->whereDefined = fileloc_update (e->whereDefined, loc);
-	}
-    }
-}
-
-void
-uentry_setDeclDef (uentry e, fileloc f)
-{
-  uentry_setDeclared (e, f);
-  
-  if (!uentry_isFunction (e)
-      && !(uentry_isVariable (e) && uentry_isExtern (e)))
-    {
-      uentry_setDefined (e, f);
-    }
-}
-
-void
-uentry_setDeclaredForce (uentry e, fileloc f)
-{
-  llassert (uentry_isValid (e));
-  e->whereDeclared = fileloc_update (e->whereDeclared, f);
-}
-
-void
-uentry_setDeclaredForceOnly (uentry e, fileloc f)
-{
-  llassert (uentry_isValid (e));
-  fileloc_free (e->whereDeclared);
-  e->whereDeclared = f;
-}
-
-void
-uentry_setDeclaredOnly (uentry e, /*@only@*/ fileloc f)
-{
-  fileloc oldloc;
-
-  llassert (uentry_isValid (e));
-  oldloc = e->whereDeclared;  
-
-  if (fileloc_isDefined (oldloc))
-    {
-      if (fileloc_isLib (oldloc) || fileloc_isImport (oldloc))
-	{
-	  e->whereDeclared = f;
-	  fileloc_free (oldloc);
-	}
-      else
-	{
-	  fileloc_free (f);
-	}
-    }
-  else
-    {
-      e->whereDeclared = f;
-      fileloc_free (oldloc);
-    }
-}
-  
-void
-uentry_setDeclared (uentry e, fileloc f)
-{
-  fileloc oldloc;
-
-  llassert (uentry_isValid (e));
-  oldloc = e->whereDeclared;  
-
-  if (fileloc_isDefined (oldloc))
-    {
-      if (fileloc_isLib (oldloc) || fileloc_isImport (oldloc))
-	{
-	  e->whereDeclared = fileloc_update (e->whereDeclared, f);
-	}
-      else
-	{
-	  ;
-	}
-    }
-  else
-    {
-      e->whereDeclared = fileloc_update (e->whereDeclared, f);
-    }
-}
-
-void
-uentry_clearDefined (uentry e)
-{
-  if (uentry_isValid (e))
-    {
-      e->whereDefined = fileloc_update (e->whereDefined, fileloc_undefined);
-    }
-}
-
-void
-uentry_setDefined (uentry e, fileloc f)
-{
-  fileloc oldloc;
-
-  llassert (uentry_isValid (e));
-  oldloc = e->whereDefined;
-
-  if (fileloc_isDefined (oldloc))
-    {
-      if (fileloc_isLib (oldloc) 
-	  || fileloc_isImport (oldloc)
-	  || fileloc_isBuiltin (oldloc) 
-	  || fileloc_isPreproc (oldloc))
-	{
-	  e->whereDefined = fileloc_update (e->whereDefined, f);
-	}
-      else
-	{
-	  if (fileloc_equal (oldloc, f) || context_processingMacros ())
-	    {
-	      ; /* okay */
-	    }
-	  else
-	    {
-	      if (optgenerror (FLG_REDEF,
-			       message ("%s %q redefined", 
-					ekind_capName (e->ukind),
-					uentry_getName (e)),
-			       f))
-		{
-		  llgenindentmsg (message ("Previous definition of %q", 
-					   uentry_getName (e)),
-				  e->whereDefined);
-		}
-	    }
-	}
-    }
-  else
-    {
-      e->whereDefined = fileloc_update (e->whereDefined, f);
-    }
-}
-
-bool
-uentry_isCodeDefined (uentry e)
-{
-  return (uentry_isValid (e) && fileloc_isDefined (e->whereDefined));
-}
-
-bool
-uentry_isDeclared (uentry e)
-{
-  if (uentry_isValid (e))
-    {
-      return (fileloc_isDefined (e->whereDeclared));
-    }
-
-  return FALSE;
-}
-
-sRef uentry_getSref (uentry e)
-{
-  /* not true, used for functions too (but shouldn't be? */
-  /* llassertprint (e->ukind == KVAR, ("uentry_getSref: not variable!")); */
-
-  if (uentry_isInvalid (e)) return sRef_undefined;
-  
-  return (e->sref);
-}
-
-sRef uentry_getOrigSref (uentry e)
-{
-  if (uentry_isValid (e))
-    {
-      sRef sr = sRef_copy (uentry_getSref (e));
-      
-      sRef_resetState (sr);
-      sRef_clearDerived (sr);
-      
-      if (uentry_isVariable (e))
-	{
-	  sRef_setDefState (sr, e->info->var->defstate, fileloc_undefined);
-	  sRef_setNullState (sr, e->info->var->nullstate, fileloc_undefined);
-	}
-      
-      return (sr);
-    }
-  else
-    {
-      return sRef_undefined;
-    }
-}
-
-/*
-** requires: uentry e is not in a hashed symbol table
-*/
-
-void 
-uentry_setName (uentry e, /*@only@*/ cstring n)
-{
-  llassert (uentry_isValid (e));
-
-  cstring_free (e->uname);
-  e->uname = n;
-}
-
-void
-uentry_setType (uentry e, ctype t)
-{
-  if (uentry_isValid (e)) 
-    {
-      e->utype = t;
-      sRef_setType (e->sref, t);
-    }
-}
-
-void
-uentry_resetParams (uentry ue, /*@only@*/ uentryList pn)
-{
-  ctype rct;
-  ctype rettype = ctype_unknown;
-  
-  llassert (uentry_isValid (ue));
-
-  rct = ctype_realType (ue->utype);
-
-  if (uentry_isVariable (ue) && (ctype_isFunction (rct) || ctype_isUnknown (rct)))
-    {
-      uentry_makeVarFunction (ue);
-    }
-
-  llassert (uentry_isFunction (ue));
-
-  if (ctype_isFunction (rct))
-    {
-      rettype = ctype_returnValue (rct);
-    }
-
-  ue->utype = ctype_makeNFParamsFunction (rettype, pn);      
-}
-
-void
-uentry_setRefParam (uentry e)
-{
-  
-  if (!uentry_isVar (e))
-    {
-      llbug (message ("uentry_setParam: not variable: %q", uentry_unparse (e)));
-    }
-  else
-    {
-      if (e->info->var->kind == VKSEFPARAM)
-	{
-	  e->info->var->kind = VKREFSEFPARAM;
-	}
-      else if (e->info->var->kind == VKSEFRETPARAM)
-	{
-	  e->info->var->kind = VKREFSEFRETPARAM;
-	}
-      else if (e->info->var->kind == VKYIELDPARAM)
-	{
-	  e->info->var->kind = VKREFYIELDPARAM;
-	}
-      else
-	{
-	  e->info->var->kind = VKREFPARAM;
-	}
-    }
-}
-
-void
-uentry_setParam (uentry e)
-{
-  if (!uentry_isVar (e))
-    {
-      if (uentry_isElipsisMarker (e))
-	{
-
-	}
-      else
-	{
-	  llbug (message ("uentry_setParam: not variable: %q", uentry_unparse (e)));
-	}
-    }
-  else
-    {
-      cstring oldname;
-
-      if (e->info->var->kind == VKYIELDPARAM 
-	  || e->info->var->kind == VKSEFPARAM
-	  || e->info->var->kind == VKSEFRETPARAM)
-	{
-	  ;
-	}
-      else
-	{
-	  e->info->var->kind = VKPARAM;
-	}
-
-      oldname = e->uname;
-      e->uname = makeParam (e->uname);
-      cstring_free (oldname);
-    }
-}
-
-void
-uentry_setSref (uentry e, sRef s)
-{
-  if (uentry_isValid (e))
-    {
-      if (sRef_isValid (e->sref))
-	{
-	  sRef_mergeStateQuietReverse (e->sref, s);
-	}
-      else
-	{
-	  e->sref = sRef_saveCopy (s);
-	}
-    }
-}
-
-ctype
-uentry_getAbstractType (uentry e)
-{
-  llassert (uentry_isDatatype (e));
-
-  /*
-  ** This assertion removed.
-  ** Okay to have undefined type, for system types
-  
-  llassertprintret (!ctype_isUndefined (e->info->datatype->type),
-		    ("uentry_getAbstractType %q: undefined", uentry_unparseFull (e)),
-		    e->utype);
-		    
-  */
-
-  if (ctype_isUndefined (e->info->datatype->type))
-    {
-      return ctype_unknown;
-    }
-
-  /*
-  ** Sadly, a kludge...
-  */
-
-  if (ctype_isUserBool (e->info->datatype->type)) {
-    return ctype_bool;
-  }
-
-  return e->info->datatype->type;
-}
-
-ctype uentry_getRealType (uentry e)
-{
-  ctype ct;
-  typeId uid = USYMIDINVALID;
-
-  if (uentry_isInvalid (e))
-    {
-      return ctype_unknown;
-    }
-
-  llassertprint (uentry_isDatatype (e), ("not datatype: %s", uentry_unparse (e)));
-
-  if (uentry_isAnyTag (e))
-    {
-      return (e->utype);
-    }
-  
-  if (uentry_isAbstractType (e))
-    {
-      ct = uentry_getAbstractType (e);      
-
-      if (ctype_isManifestBool (ct)) {
-	return ct;
-      }
-
-      llassert (ctype_isUA (ct));
-      
-      uid = ctype_typeId (ct);
-      
-      if (!context_hasAccess (uid))
-	{
-	  return (ct);
-	}
-    }
-
-  ct = uentry_getType (e);
-
-  /* if (ctype_isUserBool (ct)) return ct; */
-
-  if (ctype_isManifestBool (ct)) {
-    return ctype_bool;
-  }
-  
-  if (ctype_isUA (ct))
-    {
-      usymId iid = ctype_typeId (ct);
-      
-      if /*@access usymId@*/ (iid == uid) /*@noaccess usymId@*/
-	{	  
-	  llcontbug (message ("uentry_getRealType: recursive type! %s",
-			      ctype_unparse (ct)));
-	  return ct;
-	}
-      else
-	{
-	  /* evs 2000-07-25: possible infinite recursion ? */
-	  uentry ue2 = usymtab_getTypeEntry (iid);
-	  llassertprint (ue2 != e, ("Bad recursion: %s", uentry_unparseFull (e)));
-
-	  return uentry_getRealType (ue2);
-	}
-    }
-  else
-    {
-      return ct;
-    }
-}
-
-ctype uentry_getForceRealType (uentry e)
-{
-  ctype   ct;
-  typeId uid = USYMIDINVALID;
-
-  if (uentry_isInvalid (e))
-    {
-      return ctype_unknown;
-    }
-
-  llassertprint (uentry_isDatatype (e), ("not datatype: %s", uentry_unparse (e)));
-  
-  if (uentry_isAnyTag (e))
-    {
-      return (e->utype);
-    }
-  
-  if (uentry_isAbstractType (e))
-    {
-      ct = uentry_getAbstractType (e);      
-      llassert (ctype_isUA (ct));
-      
-      uid = ctype_typeId (ct);
-      /* no check for access! */
-    }
-  
-  ct = uentry_getType (e);
-
-  /* evs 2000-07-25 */
-  /* if (ctype_isUserBool (ct)) return ct; */
-
-  if (ctype_isManifestBool (ct)) {
-    return ctype_bool;
-  }
-  
-  if (ctype_isUA (ct))
-    {
-      usymId iid = ctype_typeId (ct);
-      
-      if /*@access usymId@*/ (iid == uid) /*@noaccess usymId@*/
-	{	  
-	  llcontbug (message ("uentry_getRealType: recursive type! %s",
-			      ctype_unparse (ct)));
-	  return ct;
-	}
-      else
-	{
-	  return uentry_getForceRealType (usymtab_getTypeEntry (iid));
-	}
-    }
-  else
-    {
-      return ct;
-    }
-}
-
-uentry uentry_nameCopy (cstring name, uentry e)
-{
-  uentry enew = uentry_alloc ();
-
-  llassert (uentry_isValid (e));
-
-  /* enew->shallowCopy = FALSE; */
-  enew->ukind = e->ukind;
-  enew->uname = name;
-  enew->utype = e->utype;
-  enew->whereSpecified = fileloc_copy (e->whereSpecified);
-  enew->whereDefined = fileloc_copy (e->whereDefined);
-  enew->whereDeclared = fileloc_copy (e->whereDeclared);
-  enew->sref = sRef_copy (e->sref); 
-  enew->used = e->used;
-  enew->lset = FALSE;
-  enew->isPrivate = e->isPrivate;
-  enew->hasNameError = FALSE;
-
-  enew->uses = filelocList_new ();
-
-  enew->storageclass = e->storageclass;
-  enew->info = uinfo_copy (e->info, e->ukind);
-
-  return enew;
-}
-
-void
-uentry_setDatatype (uentry e, usymId uid)
-{
-  llassert (uentry_isDatatype (e));
-
-  if (uentry_isAbstractType (e))
-    {
-      e->info->datatype->type = ctype_createAbstract (uid);
-    }
-  else
-    {
-      e->info->datatype->type = ctype_createUser (uid);
-    }
-}
-
-static void 
-uentry_setSpecDef (/*@special@*/ uentry e, /*@keep@*/ fileloc f)
-   /*@defines e->whereSpecified, e->whereDeclared, e->whereDefined@*/
-   /*@modifies e@*/
-{
-  llassert (uentry_isValid (e));
-
-  if (fileloc_isSpec (f) || fileloc_isImport (f))
-    {
-      e->whereSpecified = f;
-      e->whereDeclared  = fileloc_undefined;
-      e->whereDefined  = fileloc_undefined;
-    }
-  else
-    {
-      e->whereSpecified = fileloc_undefined;
-      e->whereDeclared  = f;
-      e->whereDefined  = fileloc_undefined;
-    }
-}
-
-static void
-ucinfo_free (/*@only@*/ ucinfo u)
-{
-  multiVal_free (u->val);
-  sfree (u);
-}
-
-static void
-uvinfo_free (/*@only@*/ uvinfo u)
-{
-  sfree (u);
-}
-
-static void
-udinfo_free (/*@only@*/ udinfo u)
-{
-  sfree (u);
-}
-
-static void
-ufinfo_free (/*@only@*/ ufinfo u)
-{
-  globSet_free (u->globs);
-  sRefSet_free (u->mods);
-  specialClauses_free (u->specclauses);
-
-  sfree (u);
-}
-
-static void
-uiinfo_free (/*@only@*/ uiinfo u)
-{
-  sfree (u);
-}
-
-static void
-ueinfo_free (/*@only@*/ ueinfo u)
-{
-  sfree (u);
-}
-
-static /*@only@*/ ucinfo
-ucinfo_copy (ucinfo u)
-{
-  ucinfo ret = (ucinfo) dmalloc (sizeof (*ret));
-  
-  ret->val = multiVal_copy (u->val);
-  ret->access = u->access;
-
-  return ret;
-}
-
-static /*@only@*/ uvinfo
-uvinfo_copy (uvinfo u)
-{
-  uvinfo ret = (uvinfo) dmalloc (sizeof (*ret));
-  
-  ret->kind = u->kind;
-  ret->nullstate = u->nullstate;
-  ret->defstate = u->defstate;
-  ret->checked = u->checked;
-  //make sure line ok
-  //ret->bufinfo = u->bufinfo;
-  /*@i334@*/  return ret;
-}
-
-static /*@only@*/ udinfo
-udinfo_copy (udinfo u)
-{
-  udinfo ret = (udinfo) dmalloc (sizeof (*ret));
-
-  ret->abs = u->abs;
-  ret->mut = u->mut;
-  ret->type = u->type;
-
-  return ret;
-}
-
-static /*@only@*/ ufinfo
-ufinfo_copy (ufinfo u)
-{
-  ufinfo ret = (ufinfo) dmalloc (sizeof (*ret));
-
-  ret->hasGlobs = u->hasGlobs;
-  ret->hasMods = u->hasMods;
-  ret->exitCode = u->exitCode;
-  ret->specialCode = u->specialCode;
-  ret->nullPred = u->nullPred;
-  ret->access = u->access;
-  ret->globs = globSet_newCopy (u->globs);
-  ret->mods = sRefSet_newCopy (u->mods);
-  ret->defparams = u->defparams;
-  ret->specclauses = specialClauses_copy (u->specclauses);
-
-  /*drl 11 30 2000 */
-  ret->preconditions = u->preconditions? constraintList_copy(u->preconditions): NULL;
-  /* end drl */
-  
-
-  /*drl 11 30 2000 */
-  ret->postconditions = u->postconditions? constraintList_copy(u->postconditions): NULL;
-  /* end drl */
-  
-  return ret;
-}
-
-static /*@only@*/ uiinfo
-uiinfo_copy (uiinfo u)
-{
-  uiinfo ret = (uiinfo) dmalloc (sizeof (*ret));
-
-  ret->access = u->access;
-  ret->globs = globSet_newCopy (u->globs);
-  ret->mods = sRefSet_newCopy (u->mods);
-
-  return (ret);
-}
-
-static /*@only@*/ ueinfo
-ueinfo_copy (ueinfo u)
-{
-  ueinfo ret = (ueinfo) dmalloc (sizeof (*ret));
-
-  ret->access = u->access;
-  return ret;
-}
-
-static void
-uinfo_free (uinfo u, ekind kind)
-{
-  switch (kind)
-    {
-    case KENUMCONST:
-    case KCONST:       ucinfo_free (u->uconst); break;
-    case KVAR:         uvinfo_free (u->var); break;
-    case KSTRUCTTAG:
-    case KUNIONTAG:
-    case KENUMTAG:
-    case KDATATYPE:    udinfo_free (u->datatype); break;
-    case KFCN:         ufinfo_free (u->fcn); break;
-    case KITER:        uiinfo_free (u->iter); break;
-    case KENDITER:     ueinfo_free (u->enditer); break;
-    case KELIPSMARKER: break;
-    case KINVALID:     break;
-    }
-  
-    sfree (u);
-}
-
-static /*@only@*/ /*@null@*/ uinfo
-uinfo_copy (uinfo u, ekind kind)
-{
-  if (kind == KELIPSMARKER || kind == KINVALID)
-    {
-      return NULL;
-    }
-  else
-    {
-      uinfo ret = (uinfo) dmalloc (sizeof (*ret));
-      
-      switch (kind)
-	{
-	case KENUMCONST:
-	case KCONST:    ret->uconst = ucinfo_copy (u->uconst); break;
-	case KVAR:      ret->var = uvinfo_copy (u->var); break;
-	case KSTRUCTTAG:
-	case KUNIONTAG:
-	case KENUMTAG:
-	case KDATATYPE: ret->datatype = udinfo_copy (u->datatype); break;
-	case KFCN:      ret->fcn = ufinfo_copy (u->fcn); break;
-	case KITER:     ret->iter = uiinfo_copy (u->iter); break;
-	case KENDITER:  ret->enditer = ueinfo_copy (u->enditer); break;
-	BADDEFAULT;
-	}
-      return ret;
-    }
-}
-
-static void
-uentry_reallyFree (/*@notnull@*/ /*@only@*/ uentry e)
-{
-  filelocList_free (e->uses);
-  cstring_free (e->uname);
-  
-  uinfo_free (e->info, e->ukind);
-  
-  fileloc_free (e->whereSpecified); 
-  fileloc_free (e->whereDefined); 
-  fileloc_free (e->whereDeclared); 
-
-  nuentries--;
-  sfree (e);
-  }
-
-extern void uentry_markOwned (/*@owned@*/ uentry u)
-{
-  sfreeEventually (u);
-}
-
-void
-uentry_free (/*@only@*/ uentry e)
-{
-  if (uentry_isValid (e) && !uentry_isElipsisMarker (e))
-    {
-      uentry_reallyFree (e);
-    }
-}
-
-/*
-** For uentry's in the global or file scope
-*/
-
-void
-uentry_freeComplete (/*@only@*/ uentry e)
-{
-  if (uentry_isValid (e) && !uentry_isElipsisMarker (e))
-    {
-      /*@i@*/ sRef_free (e->sref);
-      e->sref = sRef_undefined;
-      uentry_reallyFree (e);
-    }
-}
-
-/*
-** requires old->kind != new->kind, old->uname = new->uname
-*/
-
-static void
-KindConformanceError (/*@unique@*/ uentry old, uentry unew, bool mustConform)
-{
-  llassert (uentry_isValid (old));
-  llassert (uentry_isValid (unew));
-
-  if (uentry_isEitherConstant (unew)
-      && (fileloc_isPreproc (uentry_whereDeclared (old))
-	  || ctype_isUnknown (old->utype))
-      && !uentry_isSpecified (old))
-    {
-      ; /* no error */
-    }
-  else 
-    {
-      if (mustConform)
-	{
-	  if (!uentry_isDeclared (old))
-	    {
-	      if (uentry_isSpecified (old))
-		{
-		  if (uentry_isSpecified (unew))
-		    {
-		      llbuglit ("Respecification!");
-		    }
-		  else if (uentry_isDeclared (unew))
-		    {
-		      if (optgenerror
-			  (FLG_INCONDEFS,
-			   message ("%s %q inconsistently declared as %s: %t",
-				    ekind_capName (old->ukind),
-				    uentry_getName (unew),
-				    ekind_unparseLong (unew->ukind),
-				    unew->utype),
-			   uentry_whereDeclared (unew)))
-			{
-			  uentry_showWhereLast (old);
-			}
-		    }
-		  else
-		    {
-		      BADEXIT;
-		    }
-		}
-	      else
-		{
-		  if (optgenerror
-		      (FLG_INCONDEFS,
-		       message ("%s %q inconsistently declared as %s: %t",
-				ekind_capName (old->ukind),
-				uentry_getName (unew),
-				ekind_unparseLong (unew->ukind),
-				unew->utype),
-		       uentry_whereDeclared (unew)))
-		    {
-		      uentry_showWhereLast (old);
-		    }
-		}
-	    }
-	  else
-	    {
-	      llassert (uentry_isDeclared (unew));
-
-	      if (optgenerror
-		  (FLG_INCONDEFS,
-		   message ("%s %q inconsistently redeclared as %s",
-			    ekind_capName (old->ukind),
-			    uentry_getName (unew),
-			    ekind_unparseLong (unew->ukind)),
-		   uentry_whereDeclared (unew)))
-		{
-		  uentry_showWhereLast (old);
-		}
-	    }
-	}
-    }
-
-  uentry_copyInto (old, unew);
-}
-
-/*
-** def is the definition of spec, modifies spec
-**
-** reports any inconsistencies
-** returns the summary of all available information
-** if spec and def are inconsistent, def is returned
-*/
-
-void
-uentry_showWhereLast (uentry spec)
-{
-  if (uentry_isValid (spec))
-    {
-      if (fileloc_isDefined (spec->whereDefined)
-	  && !fileloc_isLib (spec->whereDefined)
-	  && !fileloc_isPreproc (spec->whereDefined))
-	{
-	  llgenindentmsg (message ("Previous definition of %q: %t", 
-				   uentry_getName (spec),
-				   uentry_getType (spec)),
-			  uentry_whereDefined (spec));
-	}
-      else if (uentry_isDeclared (spec))
-	{
-	  llgenindentmsg (message ("Previous declaration of %q: %t", 
-				   uentry_getName (spec),
-				   uentry_getType (spec)),
-			  uentry_whereDeclared (spec));
-	}
-      else if (uentry_isSpecified (spec))
-	{
-	  if (uentry_hasName (spec))
-	    {
-	      llgenindentmsg (message ("Specification of %q: %t", 
-				       uentry_getName (spec),
-				       uentry_getType (spec)),
-			      uentry_whereSpecified (spec));
-	    }
-	  else
-	    {
-	      llgenindentmsg (message ("Specification: %t", uentry_getType (spec)),
-			      uentry_whereSpecified (spec));
-	    }
-	}
-      else
-	{
-	  /* nothing to show */
-	}
-    }
-}
-
-void
-uentry_showDefSpecInfo (uentry ce, fileloc fwhere)
-{
-  fileloc loc = uentry_whereDefined (ce);
-  
-  if (fileloc_isUser (loc) && !fileloc_equal (loc, fwhere))
-    {
-      llgenindentmsg (message ("Definition of %q", uentry_getName (ce)),
-		      loc);
-    }
-
-  loc = uentry_whereSpecified (ce);
-  
-  if (fileloc_isUser (loc) && !fileloc_equal (loc, fwhere))
-    {
-      llgenindentmsg (message ("Specification of %q", uentry_getName (ce)),
-		      loc);
-    }
-}
-
-void uentry_showWhereLastExtra (uentry spec, cstring extra)
-{
-  if (uentry_isDeclared (spec))
-    {
-      llgenindentmsg (message ("Previous declaration of %q: %q", 
-			       uentry_getName (spec), extra),
-		      uentry_whereDeclared (spec));
-    }
-  else if (uentry_isSpecified (spec))
-    {
-      llgenindentmsg (message ("Specification of %q: %q", 
-			       uentry_getName (spec), extra),
-		      uentry_whereSpecified (spec));
-    }
-  else
-    {
-      cstring_free (extra);
-    }
-}
-
-void
-uentry_showWhereDeclared (uentry spec)
-{
-  if (uentry_isDeclared (spec))
-    {
-      if (uentry_hasName (spec))
-	{
-	  llgenindentmsg (message ("Declaration of %q", uentry_getName (spec)),
-			  uentry_whereDeclared (spec));
-	}
-      else
-	{
-	  llgenindentmsg (cstring_makeLiteral ("Declaration"), uentry_whereDeclared (spec));
-	}
-    }
-  else if (uentry_isSpecified (spec))
-    {
-      if (uentry_hasName (spec))
-	{
-	  llgenindentmsg (message ("Specification of %q", uentry_getName (spec)),
-			  uentry_whereSpecified (spec));
-	}
-      else
-	{
-	  llgenindentmsg (cstring_makeLiteral ("Specification"), uentry_whereSpecified (spec));
-	}
-    }
-  else
-    {
-      /* nothing to show */
-    }
-    
-}
-
-void
-uentry_showWhereAny (uentry spec)
-{
-  if (uentry_isDeclared (spec))
-    {
-      if (uentry_hasName (spec))
-	{
-	  llgenindentmsg (message ("Declaration of %q", uentry_getName (spec)),
-			  uentry_whereDeclared (spec));
-	}
-      else
-	{
-	  llgenindentmsg (cstring_makeLiteral ("Declaration"), uentry_whereDeclared (spec));
-	}
-    }
-  else if (uentry_isSpecified (spec))
-    {
-      if (uentry_hasName (spec))
-	{
-	  llgenindentmsg (message ("Specification of %q",
-				   uentry_getName (spec)),
-			  uentry_whereSpecified (spec));
-	}
-      else
-	{
-	  llgenindentmsg (cstring_makeLiteral ("Specification"), 
-			  uentry_whereSpecified (spec));
-	}
-    }
-  else if (fileloc_isDefined (uentry_whereDefined (spec))) 
-    {
-      if (uentry_hasName (spec))
-	{
-	  llgenindentmsg (message ("Definition of %q", uentry_getName (spec)),
-			  uentry_whereDefined (spec));
-	}
-      else
-	{
-	  llgenindentmsg (cstring_makeLiteral ("Definition"), uentry_whereDefined (spec));
-	}
-    }
-  else
-    {
-      /* nothing to show */
-    }
-}
-
-void
-uentry_showWhereDefined (uentry spec)
-{
-  if (uentry_isCodeDefined (spec))
-    {
-      llgenindentmsg (message ("Previous definition of %q", uentry_getName (spec)),
-		      uentry_whereDefined (spec));
-    }
-}
-
-void
-uentry_showWhereLastPlain (uentry spec)
-{
-  if (uentry_isDeclared (spec))
-    {
-      llgenindentmsg (message ("Previous declaration of %q", uentry_getName (spec)),
-		      uentry_whereDeclared (spec));
-    }
-  else if (uentry_isSpecified (spec))
-    {
-      llgenindentmsg (message ("Specification of %q", uentry_getName (spec)),
-		      uentry_whereSpecified (spec));
-    }
-  else
-    {
-          }
-}
-
-static void
-uentry_showWhereLastVal (uentry spec, cstring val)
-{
-  if (uentry_isDeclared (spec))
-    {
-      llgenindentmsg (message ("Previous declaration of %q: %s", 
-			       uentry_getName (spec), val),
-		      uentry_whereDeclared (spec));
-    }
-  else if (uentry_isSpecified (spec))
-    {
-      llgenindentmsg (message ("Specification of %q: %s", 
-			       uentry_getName (spec), val),
-		      uentry_whereSpecified (spec));
-    }
-  else
-    {
-    }
-}
-
-void
-uentry_showWhereSpecified (uentry spec)
-{
-  if (uentry_isSpecified (spec))
-    {
-      if (uentry_hasName (spec))
-	{
-	  llgenindentmsg (message ("Specification of %q", uentry_getName (spec)),
-			  uentry_whereSpecified (spec));
-	}
-      else
-	{
-	  llgenindentmsg (cstring_makeLiteral ("Specification"), 
-			  uentry_whereSpecified (spec));
-	}
-    }
-  else if (uentry_isDeclared (spec))
-    {
-      llgenindentmsg (message ("Declaration of %q", uentry_getName (spec)),
-		      uentry_whereDeclared (spec));
-    }
-  else
-    {
-      /* nothing to show */
-    }
-}
-
-void
-uentry_showWhereSpecifiedExtra (uentry spec, cstring s)
-{
-  if (uentry_isSpecified (spec))
-    {
-      if (uentry_hasName (spec))
-	{
-	  llgenindentmsg (message ("Specification of %q: %q", 
-				   uentry_getName (spec), s),
-			  uentry_whereSpecified (spec));
-	}
-      else
-	{
-	  llgenindentmsg (message ("Specification: %q", s), 
-			  uentry_whereSpecified (spec));
-	}
-    }
-  else if (uentry_isDeclared (spec))
-    {
-      llgenindentmsg (message ("Declaration of %q: %q", 
-			       uentry_getName (spec), s),
-		      uentry_whereDeclared (spec));
-    }
-  else
-    {
-      llgenindentmsg (message ("Previous: %q", s),
-		      uentry_whereLast (spec));
-    }
-}
-
-/*
-**
-*/
-
-static void
-checkStructConformance (uentry old, uentry unew)
-{
-  ctype oldr, newr; 
-  uentryList fold, fnew;
-
-  /*
-  ** requires: types of old and new are structs or unions
-  */
-
-  llassert (uentry_isValid (old));
-  llassert (uentry_isValid (unew));
-
-  oldr = ctype_realType (old->utype);
-  fold =  ctype_getFields (oldr);
-
-  newr = ctype_realType (unew->utype);
-  fnew = ctype_getFields (newr);
-
-  if (!uentryList_matchFields (fold, fnew))
-    {
-      if (fileloc_equal (uentry_whereLast (old),
-			 uentry_whereLast (unew)))
-	{
-	  ; /* cheat! */
-	}
-      else 
-	{
-	  if (optgenerror 
-	      (FLG_MATCHFIELDS,
-	       message ("%q %q %rdeclared with fields { %q }, %s "
-			"with fields { %q }",
-			cstring_makeLiteral (ctype_isStruct (newr) ? "Structure": "Union"),
-			uentry_getName (old), 
-			uentry_isDeclared (old),
-			uentryList_unparseAbbrev (fnew),
-			uentry_specOrDefName (old),
-			uentryList_unparseAbbrev (fold)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereLastPlain (old);
-	      uentryList_showFieldDifference (fold, fnew);
-	    }
-	}
-
-      old->utype = unew->utype;
-    }
-}
-
-static void
-checkEnumConformance (/*@notnull@*/ uentry old, /*@notnull@*/ uentry unew)
-{
-  /*
-  ** requires old and new are enums
-  */
-  
-  ctype        rold = ctype_realType (old->utype);
-  ctype        rnew = ctype_realType (unew->utype);
-  enumNameList eold = ctype_elist (rold);
-  enumNameList enew = ctype_elist (rnew);
-  
-  if (!enumNameList_match (eold, enew))
-    {
-      if (optgenerror 
-	  (FLG_MATCHFIELDS,
-	   message ("Enum %q declared with members { %q } but "
-		    "specified with members { %q }",
-		    uentry_getName (old), 
-		    enumNameList_unparse (enew),
-		    enumNameList_unparse (eold)),
-	   uentry_whereDeclared (unew)))
-	{
-	  uentry_showWhereSpecified (old);
-	  old->utype = unew->utype;
-	}
-    }
-}
-
-/*
-** either oldCurrent or newCurrent may be undefined!
-*/
-
-static void
-paramTypeError (uentry old, uentry oldCurrent, ctype oldType,
-		uentry unew, uentry newCurrent, ctype newType,
-		int paramno)
-{
-  bool hasError = FALSE;
-
-  if (uentry_isValid (newCurrent) && uentry_isDeclared (newCurrent))
-    {
-      if (uentry_hasName (newCurrent))
-	{
-	  hasError = optgenerror 
-	    (FLG_TYPE,
-	     message ("Parameter %d, %q, of function %q has inconsistent type: "
-		      "declared %t, %s %t",
-		      paramno + 1, uentry_getName (newCurrent), 
-		      uentry_getName (unew),
-		      newType, uentry_specOrDefName (old), oldType),
-	     uentry_whereDeclared (newCurrent));
-	}
-      else
-	{
-	  hasError = optgenerror
-	    (FLG_TYPE,
-	     message ("Parameter %d of function %q has inconsistent type: "
-		      "declared %t, %s %t",
-		      paramno + 1, uentry_getName (unew),
-		      newType, uentry_specOrDefName (old), oldType),
-	     uentry_whereDeclared (newCurrent));
-
-	  DPRINTF (("type: %s / %s",
-		    ctype_unparse (newType),
-		    ctype_unparse (ctype_realType (newType))));
-	}
-    }
-  else 
-    {
-      if (uentry_isDeclared (unew))
-	{
-	  hasError = optgenerror 
-	    (FLG_TYPE,
-	     message ("Parameter %d of function %s has inconsistent type: "
-		      "declared %t, %s %t",
-		      paramno + 1, unew->uname, 
-		      newType, uentry_specOrDefName (old), oldType),
-	     uentry_whereDeclared (unew));
-	}
-      else
-	{
-	  hasError = optgenerror
-	    (FLG_TYPE,
-	     message ("Parameter %d of function %s has inconsistent type: "
-		      "declared %t, %s %t",
-		      paramno + 1, unew->uname, 
-		      newType, uentry_specOrDefName (old), oldType),
-	     uentry_whereDeclared (unew));
-	}
-    }
-  
-  if (hasError)
-    {
-      if (!uentry_isUndefined (oldCurrent))
-	{
-	  if (!uentry_isUndefined (newCurrent) 
-	      && cstring_equal (uentry_rawName (newCurrent), uentry_rawName (oldCurrent)))
-	    {
-	      uentry_showWhereLast (oldCurrent);
-	    }
-	  else
-	    {
-	      uentry_showWhereLastPlain (old);
-	    }
-	  
-	  uentry_setType (oldCurrent, newType);
-	}
-      else
-	{
-	  uentry_showWhereLastPlain (old);
-	}
-    }
-}
-
-static void
-nargsError (/*@notnull@*/ uentry old, /*@notnull@*/ uentry unew)
-{
-  if (optgenerror 
-      (FLG_TYPE,
-       message ("Function %s %rdeclared with %d arg%p, %s with %d",
-		unew->uname, 
-		uentry_isDeclared (old),
-		uentryList_size (uentry_getParams (unew)),
-		uentry_specOrDefName (old),
-		uentryList_size (uentry_getParams (old))),
-       uentry_whereDeclared (unew)))
-    {
-      uentry_showWhereLastPlain (old);
-    }
-}
-
-static void
-returnValueError (/*@notnull@*/ uentry old, /*@notnull@*/ uentry unew)
-{
-  if (optgenerror
-      (FLG_INCONDEFS,
-       message ("Function %s inconsistently %rdeclared to return %t",
-		unew->uname,
-		uentry_isDeclared (old),
-		ctype_returnValue (unew->utype)),
-       uentry_whereDeclared (unew)))
-    {
-      uentry_showWhereLastVal (old, ctype_unparse (ctype_returnValue (old->utype)));
-    }
-}
-
-static cstring paramStorageName (uentry ue)
-{
-  return (cstring_makeLiteralTemp (uentry_isParam (ue) ? "param" : "storage"));
-}
-
-static cstring fcnErrName (uentry ue)
-{
-  return (cstring_makeLiteralTemp (uentry_isFunction (ue) ? "to return" : "as"));
-}
-
-extern /*@observer@*/ cstring uentry_checkedName (uentry ue)
-{
-  if (uentry_isVar (ue))
-    {
-      return (checkedName (ue->info->var->checked));
-    }
-  else
-    {
-      return (cstring_makeLiteralTemp (""));
-    }
-}
-
-static cstring checkedName (chkind checked)
-{
-  switch (checked)
-    {
-    case CH_UNKNOWN:       return (cstring_makeLiteralTemp ("unknown"));
-    case CH_UNCHECKED:     return (cstring_makeLiteralTemp ("unchecked"));
-    case CH_CHECKED:       return (cstring_makeLiteralTemp ("checked"));
-    case CH_CHECKMOD:      return (cstring_makeLiteralTemp ("checkmod"));
-    case CH_CHECKEDSTRICT: return (cstring_makeLiteralTemp ("checkedstrict"));
-    }
-  BADEXIT;
-}
-
-static
-void checkNullState (/*@notnull@*/ uentry old, /*@notnull@*/ uentry unew, bool mustConform, bool completeConform)
-{
-  nstate oldState;
-  nstate newState;
-  
-  if (uentry_isVar (unew))
-    {
-      llassert (uentry_isVar (old));
-      
-      oldState = old->info->var->nullstate;
-      newState = unew->info->var->nullstate;
-    }
-  else
-    {
-      oldState = sRef_getNullState (old->sref);
-      newState = sRef_getNullState (unew->sref);
-    }
-
-  if (oldState == NS_ABSNULL)
-    {
-      if (uentry_isVar (old))
-	{
-	  old->info->var->nullstate = newState;
-	}
-      
-      sRef_mergeNullState (old->sref, newState);
-    }
-  else if (newState == NS_UNKNOWN)
-    {
-      if (completeConform && newState != oldState
-	  && uentry_isReallySpecified (old))
-	{
-	  if (optgenerror 
-	      (FLG_NEEDSPEC,
-	       message ("%s %q specified as %s, but declared without %s qualifier",
-			ekind_capName (unew->ukind),
-			uentry_getName (unew),
-			nstate_unparse (oldState),
-			nstate_unparse (oldState)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereSpecified (old);
-	    }
-	}
-      
-      if (uentry_isVar (unew))
-	{
-	  unew->info->var->nullstate = oldState;
-	}
-
-      sRef_mergeNullState (unew->sref, oldState);
-    }
-  else if (newState == NS_POSNULL)
-    {
-      if (oldState == NS_MNOTNULL 
-	  && (ctype_isUA (unew->utype) 
-	      || (uentry_isFunction (unew)
-		  && ctype_isUA (ctype_returnValue (unew->utype)))))
-	{
-	  if (uentry_isVar (unew))
-	    {
-	      unew->info->var->nullstate = oldState;
-	    }
-
-	  sRef_mergeNullState (unew->sref, oldState);
-	}
-      else 
-	{
-	  if (oldState == NS_NOTNULL || oldState == NS_MNOTNULL 
-	      || oldState == NS_UNKNOWN)
-	    {
-	      if (mustConform)
-		{
-		  if (optgenerror 
-		      (FLG_INCONDEFS,
-		       message 
-		       ("%s %q inconsistently %rdeclared %s possibly null storage, "
-			"%s %q qualifier",
-			uentry_ekindName (unew),
-			uentry_getName (unew),
-			uentry_isDeclared (old),
-			fcnErrName (unew),
-			uentry_specOrDefName (old),
-			cstring_makeLiteral (oldState == NS_MNOTNULL ? "with notnull" : "without null")),
-		       uentry_whereDeclared (unew)))
-		    {
-		      uentry_showWhereSpecified (old);
-		    }
-		}
-	    }
-	  
-	  if (uentry_isVar (old))
-	    {
-	      old->info->var->nullstate = newState;
-	    }
-
-	  sRef_mergeNullState (old->sref, newState);
-	}
-    }
-  else if (newState == NS_MNOTNULL)
-    {
-      if (oldState != NS_MNOTNULL)
-	{
-	  if (mustConform)
-	    {
-	      if (optgenerror 
-		  (FLG_INCONDEFS,
-		   message ("%s %q inconsistently %rdeclared %s notnull storage, "
-			    "%s without notnull qualifier",
-			    uentry_ekindName (unew),
-			    uentry_getName (unew),
-			    uentry_isDeclared (old),
-			    fcnErrName (unew),
-			    uentry_specOrDefName (old)),
-		   uentry_whereDeclared (unew)))
-		{
-		  uentry_showWhereSpecified (old);
-		}
-	    }
-	  
-	  if (uentry_isVar (old))
-	    {
-	      old->info->var->nullstate = newState;
-	    }
-
-	  sRef_mergeNullState (old->sref, newState);
-	}
-    }
-  else
-    {
-      if (uentry_isVar (unew)) 
-	{
-	  unew->info->var->nullstate = oldState;
-	}
-
-      sRef_mergeNullState (unew->sref, oldState);
-    }
-}
-
-static
-void checkDefState (/*@notnull@*/ uentry old, /*@notnull@*/ uentry unew, 
-		    bool mustConform, bool completeConform)
-{
-  sstate oldState;
-  sstate newState;
-  bool vars = FALSE;
-
-  if (uentry_isVar (old) && uentry_isVar (unew))
-    {
-      oldState = old->info->var->defstate;
-      newState = unew->info->var->defstate;
-      vars = TRUE;
-    }
-  else
-    {
-      oldState = sRef_getDefState (old->sref);
-      newState = sRef_getDefState (unew->sref);
-    }
-
-  if (newState != oldState && newState != SS_UNKNOWN && newState != SS_DEFINED)
-    {
-      if (mustConform)
-	{
-	  if (optgenerror 
-	      (FLG_INCONDEFS,
-	       message ("%s %q inconsistently %rdeclared %s %s %s, "
-			"%s %s %s %s",
-			uentry_ekindName (unew),
-			uentry_getName (unew),
-			uentry_isDeclared (old),
-			fcnErrName (unew),
-			sstate_unparse (newState),
-			paramStorageName (unew),
-			uentry_specOrDefName (old),
-			fcnErrName (unew),
-			sstate_unparse (oldState),
-			paramStorageName (unew)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereSpecified (old);
-	    }
-	}
-      
-      if (vars) old->info->var->defstate = newState;
-      sRef_setDefState (old->sref, newState, uentry_whereDeclared (unew));
-    }
-  else
-    {
-      if (completeConform
-	  && (newState != oldState) && (oldState != SS_DEFINED)
-	  && uentry_isReallySpecified (old))
-	{
-	  if (optgenerror 
-	      (FLG_NEEDSPEC,
-	       message ("%s %q specified as %s, but declared without %s qualifier",
-			ekind_capName (unew->ukind),
-			uentry_getName (unew),
-			sstate_unparse (oldState),
-			sstate_unparse (oldState)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereSpecified (old);
-	    }
-	}
-
-      if (vars) unew->info->var->defstate = oldState;
-      sRef_setDefState (unew->sref, oldState, uentry_whereDeclared (unew));
-    }
-}
-
-static void 
-  checkAliasState (/*@notnull@*/ uentry old, /*@notnull@*/ uentry unew, 
-		   bool mustConform, bool completeConform)
-{
-  alkind newKind;
-  alkind oldKind;
-
-  oldKind = sRef_getAliasKind (old->sref);
-  newKind = sRef_getAliasKind (unew->sref);
-
-  if (alkind_isImplicit (newKind) 
-      || (alkind_isRefCounted (newKind) && !uentry_isDatatype (unew)))
-    {
-      if (completeConform && !alkind_equal (newKind, oldKind)
-	  && uentry_isReallySpecified (old))
-	{
-	  if (optgenerror 
-	      (FLG_NEEDSPEC,
-	       message ("%s %q specified as %s, but declared without "
-			"explicit alias qualifier",
-			ekind_capName (unew->ukind),
-			uentry_getName (unew),
-			alkind_unparse (oldKind)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereSpecified (old);
-	    }
-	}
-
-      /*  
-      ** This really shouldn't be necessary, but it is!
-      ** Function params (?) use new here.
-      */
-
-      sRef_setAliasKind (unew->sref, oldKind, uentry_whereDeclared (unew));
-      return;
-    }
-
-  if (alkind_isKnown (newKind))
-    {
-      if (!alkind_equal (oldKind, newKind))
-	{
-	  if (alkind_isKnown (oldKind))
-	    {
-	      if (mustConform && 
-		  optgenerror 
-		  (FLG_INCONDEFS,
-		   message ("%s %q inconsistently %rdeclared %s %s storage, "
-			    "%s as %s storage",
-			    uentry_ekindName (unew),
-			    uentry_getName (unew),
-			    uentry_isDeclared (old),
-			    fcnErrName (unew),
-			    alkind_unparse (newKind),
-			    uentry_specOrDefName (old),
-			    alkind_unparse (oldKind)),
-		   uentry_whereDeclared (unew)))
-		{
-		  uentry_showWhereSpecified (old);
-
-		  sRef_setAliasKind (old->sref, AK_ERROR, 
-				     uentry_whereDeclared (unew));
-		}
-	      else
-		{
-		  sRef_setAliasKind (old->sref, newKind, 
-				     uentry_whereDeclared (unew));
-		}
-	    }
-	  else
-	    {
-	      if (!(alkind_isImplicit (newKind)))
-		{
-		  if (mustConform &&
-		      !uentry_isFunction (unew) &&
-		      optgenerror 
-		      (FLG_INCONDEFS,
-		       message ("%s %q inconsistently %rdeclared %s %s storage, "
-				"implicitly %s as temp storage",
-				uentry_ekindName (unew),
-				uentry_getName (unew),
-				uentry_isDeclared (old),
-				fcnErrName (unew),
-				alkind_unparse (newKind),
-				uentry_specOrDefName (old)),
-		       uentry_whereDeclared (unew)))
-		    {
-		      uentry_showWhereSpecified (old);
-		      oldKind = AK_ERROR;
-		    }
-		  
-		  sRef_setAliasKind (old->sref, newKind, 
-				     uentry_whereDeclared (unew));
-		}
-	      else /* newKind is temp or refcounted */
-		{
-		  ;
-		}
-	    }
-	}
-    }
-  else /* newKind unknown */
-    {
-      ;
-    }
-}
-
-static void 
-  checkExpState(/*@notnull@*/ uentry old, /*@notnull@*/ uentry unew, 
-		bool mustConform, bool completeConform)
-{
-  exkind newKind;
-  exkind oldKind;
-  
-  oldKind = sRef_getExKind (old->sref);
-  newKind = sRef_getExKind (unew->sref);
-
-  if (exkind_isKnown (newKind))
-    {
-      if (oldKind != newKind)
-	{
-	  if (exkind_isKnown (oldKind))
-	    {
-	      if (mustConform && 
-		  optgenerror 
-		  (FLG_INCONDEFS,
-		   message ("%s %q inconsistently %rdeclared %s %s, %s as %s",
-			    uentry_ekindName (unew),
-			    uentry_getName (unew),
-			    uentry_isDeclared (old),
-			    fcnErrName (unew),
-			    exkind_unparse (newKind),
-			    uentry_specOrDefName (old),
-			    exkind_unparse (oldKind)),
-		   uentry_whereDeclared (unew)))
-		{
-		  uentry_showWhereSpecified (old);
-		}
-
-	      sRef_setExKind (old->sref, newKind, uentry_whereDefined (unew));
-	    }
-	  else
-	    {
-	      if (mustConform &&
-		  optgenerror 
-		  (FLG_INCONDEFS,
-		   message ("%s %q inconsistently %rdeclared %s %s, "
-			    "implicitly %s without exposure qualifier",
-			    uentry_ekindName (unew),
-			    uentry_getName (unew),
-			    uentry_isDeclared (old),
-			    fcnErrName (unew),
-			    exkind_unparse (newKind),
-			    uentry_specOrDefName (old)),
-		   uentry_whereDeclared (unew)))
-		{
-		  uentry_showWhereSpecified (old);
-		}
-
-	      sRef_setExKind (old->sref, newKind, uentry_whereDefined (unew));
-	    }
-	}
-    }
-  else
-    {
-      if (completeConform && exkind_isKnown (oldKind)
-	  && uentry_isReallySpecified (old))
-	{
-	  if (optgenerror 
-	      (FLG_NEEDSPEC,
-	       message ("%s %q specified as %s, but declared without "
-			"exposure qualifier",
-			ekind_capName (unew->ukind),
-			uentry_getName (unew),
-			exkind_unparse (oldKind)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereSpecified (old);
-	    }
-	}
-
-      /* yes, this is necessary! (if its a param) */
-      sRef_setExKind (unew->sref, oldKind, fileloc_undefined);
-    }
-}
-
-static void
-uentry_checkStateConformance (/*@notnull@*/ uentry old,
-			      /*@notnull@*/ uentry unew,
-			      bool mustConform, bool completeConform)
-{
-  checkDefState (old, unew, mustConform, completeConform);
-  checkNullState (old, unew, mustConform, completeConform);
-  checkAliasState (old, unew, mustConform, completeConform);
-  checkExpState (old, unew, mustConform, completeConform);
-
-  sRef_storeState (old->sref);
-  sRef_storeState (unew->sref);
-}
-
-static void
-checkVarConformance (uentry old, uentry unew, bool mustConform, bool completeConform)
-{
-  if (uentry_isElipsisMarker (old) || uentry_isElipsisMarker (unew))
-    {
-      return;
-    }
-
-  llassert (uentry_isVar (old));
-  llassert (uentry_isVar (unew));
-
-  if (cstring_isEmpty (old->uname)) 
-    {
-      cstring_free (old->uname);
-      old->uname = cstring_copy (unew->uname);
-    }
-
-  if (unew->info->var->kind == VKRETPARAM
-      || unew->info->var->kind == VKSEFRETPARAM)
-    {
-      if (old->info->var->kind != VKRETPARAM
-	  && old->info->var->kind != VKSEFRETPARAM)
-	{
-	  if (optgenerror 
-	      (FLG_INCONDEFS,
-	       message ("Parameter %q inconsistently %rdeclared as "
-			"returned parameter",
-			uentry_getName (unew),
-			uentry_isDeclared (old)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereSpecified (old);
-	      old->info->var->kind = unew->info->var->kind;
-	    }
-	}
-    }
-
-
-  if (unew->info->var->kind == VKSEFPARAM || unew->info->var->kind == VKSEFRETPARAM)
-    {
-      if (old->info->var->kind != VKSEFPARAM 
-	  && old->info->var->kind != VKSEFRETPARAM)
-	{
-	  if (optgenerror 
-	      (FLG_INCONDEFS,
-	       message ("Parameter %qinconsistently %rdeclared as "
-			"sef parameter",
-			uentry_getOptName (unew),
-			uentry_isDeclared (old)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereSpecified (old);
-	      old->info->var->kind = unew->info->var->kind;
-	    }
-	}
-    }
-
-  if (old->info->var->kind == VKSPEC)
-    {
-      old->info->var->kind = unew->info->var->kind;
-    }
-  else
-    {
-      unew->info->var->kind = old->info->var->kind;
-    }
-
-  if (unew->info->var->checked != CH_UNKNOWN
-      && unew->info->var->checked != old->info->var->checked)
-    {
-      if (old->info->var->checked == CH_UNKNOWN
-	  && !fileloc_isUser (uentry_whereLast (old)))
-	{
-	  ; /* no error */
-	}
-      else
-	{
-	  if (optgenerror 
-	      (FLG_INCONDEFS,
-	       message ("Variable %q inconsistently %rdeclared as "
-			"%s parameter (was %s)",
-			uentry_getName (unew),
-			uentry_isDeclared (old),
-			checkedName (unew->info->var->checked),
-			checkedName (old->info->var->checked)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereSpecified (old);
-	    }
-	}
-      
-      old->info->var->checked = unew->info->var->checked;
-    }
-  else
-    {
-      if (completeConform 
-	  && (old->info->var->checked != CH_UNKNOWN)
-	  && uentry_isReallySpecified (old))
-	{
-	  if (optgenerror 
-	      (FLG_NEEDSPEC,
-	       message ("%s %q specified as %s, but declared without %s qualifier",
-			ekind_capName (unew->ukind),
-			uentry_getName (unew),
-			checkedName (old->info->var->checked),
-			checkedName (old->info->var->checked)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereSpecified (old);
-	    }
-	}
-      
-      unew->info->var->checked = old->info->var->checked;
-    }
-
-  uentry_checkStateConformance (old, unew, mustConform, completeConform);
-}
-
-void uentry_checkMatchParam (uentry u1, uentry u2, int paramno, exprNode e)
-{
-  if (uentry_isElipsisMarker (u1) || uentry_isElipsisMarker (u2))
-    {
-      return;
-    }
-
-  llassert (uentry_isVar (u1));
-  llassert (uentry_isVar (u2));
-
-  if (u1->info->var->kind != u2->info->var->kind) {
-    if (u1->info->var->kind == VKSEFRETPARAM) {
-      if (u2->info->var->kind == VKRETPARAM) {
-	voptgenerror 
-	  (FLG_TYPE,
-	   message ("Function types are inconsistent. Parameter %d is "
-		    "sef parameter, but non-sef parameter in "
-		    "assigned function: %s",
-		    paramno, exprNode_unparse (e)),
-	   exprNode_loc (e));
-      } else if (u2->info->var->kind == VKSEFPARAM) {
-	voptgenerror 
-	  (FLG_TYPE,
-	   message ("Function types are inconsistent. Parameter %d is "
-		    "returns parameter, but non-returns parameter in "
-		    "assigned function: %s",
-		    paramno, exprNode_unparse (e)),
-	   exprNode_loc (e));
-      } else {
-	voptgenerror 
-	  (FLG_TYPE,
-	   message ("Function types are inconsistent. Parameter %d is "
-		    "sef returns parameter, but non-sef returns parameter in "
-		    "assigned function: %s",
-		    paramno, exprNode_unparse (e)),
-	   exprNode_loc (e));
-      }
-    } else if (u1->info->var->kind == VKRETPARAM) {
-      voptgenerror 
-	(FLG_TYPE,
-	 message ("Function types are inconsistent. Parameter %d is "
-		  "returns parameter, but non-returns parameter in "
-		  "assigned function: %s",
-		  paramno, exprNode_unparse (e)),
-	 exprNode_loc (e));
-    } else if (u1->info->var->kind == VKSEFPARAM) {
-      voptgenerror 
-	(FLG_TYPE,
-	 message ("Function types are inconsistent. Parameter %d is "
-		  "sef parameter, but non-sef parameter in "
-		  "assigned function: %s",
-		  paramno, exprNode_unparse (e)),
-	 exprNode_loc (e));
-    } else {
-      if (u2->info->var->kind == VKSEFRETPARAM) {
-	voptgenerror 
-	  (FLG_TYPE,
-	   message ("Function types are inconsistent. Parameter %d is "
-		    "normal parameter, but sef returns parameter in "
-		    "assigned function: %s",
-		    paramno, exprNode_unparse (e)),
-	   exprNode_loc (e));
-      } else if (u2->info->var->kind == VKSEFPARAM) {
-	voptgenerror 
-	  (FLG_TYPE,
-	   message ("Function types are inconsistent. Parameter %d is "
-		    "normal parameter, but sef parameter in "
-		    "assigned function: %s",
-		    paramno, exprNode_unparse (e)),
-	   exprNode_loc (e));
-      } else if (u2->info->var->kind == VKRETPARAM) {
-	voptgenerror 
-	  (FLG_TYPE,
-	   message ("Function types are inconsistent. Parameter %d is "
-		    "normal parameter, but returns parameter in "
-		    "assigned function: %s",
-		    paramno, exprNode_unparse (e)),
-	   exprNode_loc (e));
-      } else {
-	BADBRANCH;
-      }
-    }
-  }
-
-  if (u1->info->var->defstate != u2->info->var->defstate) 
-    {
-      voptgenerror 
-	(FLG_TYPE,
-	 message ("Function types are inconsistent. Parameter %d is "
-		  "%s, but %s in assigned function: %s",
-		  paramno, 
-		  sstate_unparse (u1->info->var->defstate),
-		  sstate_unparse (u2->info->var->defstate),
-		  exprNode_unparse (e)),
-	 exprNode_loc (e));
-    }
-
-  if (u1->info->var->nullstate != u2->info->var->nullstate) 
-    {
-      voptgenerror 
-	(FLG_TYPE,
-	 message ("Function types are inconsistent. Parameter %d is "
-		  "%s, but %s in assigned function: %s",
-		  paramno, 
-		  nstate_unparse (u1->info->var->nullstate),
-		  nstate_unparse (u2->info->var->nullstate),
-		  exprNode_unparse (e)),
-	 exprNode_loc (e));
-    }
-      
-  if (sRef_getAliasKind (u1->sref) != sRef_getAliasKind (u2->sref))
-    {
-      voptgenerror 
-	(FLG_TYPE,
-	 message ("Function types are inconsistent. Parameter %d is "
-		  "%s, but %s in assigned function: %s",
-		  paramno, 
-		  alkind_unparse (sRef_getAliasKind (u1->sref)),
-		  alkind_unparse (sRef_getAliasKind (u2->sref)),
-		  exprNode_unparse (e)),
-	 exprNode_loc (e));
-    }
-
-  if (sRef_getExKind (u1->sref) != sRef_getExKind (u2->sref))
-    {
-      voptgenerror 
-	(FLG_TYPE,
-	 message ("Function types are inconsistent. Parameter %d is "
-		  "%s, but %s in assigned function: %s",
-		  paramno, 
-		  exkind_unparse (sRef_getExKind (u1->sref)),
-		  exkind_unparse (sRef_getExKind (u2->sref)),
-		  exprNode_unparse (e)),
-	 exprNode_loc (e));
-    }
-}
-
-static void
-checkFunctionConformance (/*@unique@*/ /*@notnull@*/ uentry old,
-			  /*@notnull@*/ uentry unew, 
-			  bool mustConform, /*@unused@*/ bool completeConform)
-{
-  uentryList oldParams  = uentry_getParams (old);
-  uentryList newParams  = uentry_getParams (unew);
-  ctype      newType    = unew->utype;
-  ctype      oldType    = old->utype;
-  ctype      oldRetType = ctype_unknown;
-  ctype      newRetType = ctype_unknown;
-
-  if (uentry_isForward (old))
-    {
-      mustConform = FALSE;
-      uentry_copyInto (old, unew);
-      return;
-    }
-
-  /*
-  ** check return values
-  */
-  
-  if (ctype_isKnown (oldType))
-    {
-      llassert (ctype_isFunction (oldType));
-
-      oldRetType = ctype_returnValue (oldType);
-    }
-
-  if (ctype_isKnown (newType))
-    {
-      llassert (ctype_isFunction (newType));
-
-      newRetType = ctype_returnValue (newType);
-    }
-
-  if (ctype_isKnown (oldRetType) && ctype_isKnown (newRetType)
-      && !ctype_matchDef (newRetType, oldRetType))
-    {
-      if (mustConform) returnValueError (old, unew);
-    }
-  else 
-    {
-      if (ctype_isConj (newRetType))
-	{
-	  if (ctype_isConj (oldRetType))
-	    {
-	      if (!ctype_sameAltTypes (newRetType, oldRetType))
-		{
-		  if (optgenerror 
-		      (FLG_INCONDEFS,
-		       message ("Function %q inconsistently %rdeclared to "
-				"return alternate types %s "
-				"(types match, but alternates are not identical, "
-				"so checking may not be correct)",
-				uentry_getName (unew),
-				uentry_isDeclared (old),
-				ctype_unparse (newRetType)),
-		       uentry_whereDeclared (unew)))
-		    {
-		      uentry_showWhereLastVal (old, ctype_unparse (oldRetType));
-		    }
-		}
-	    }
-	  else
-	    {
-	      old->utype = ctype_makeFunction (oldRetType, uentryList_copy (newParams));
-	    }
-	}
-    }
-
-  uentry_checkStateConformance (old, unew, mustConform, completeConform);
-
-  if (!exitkind_equal (unew->info->fcn->exitCode, old->info->fcn->exitCode))
-    {
-      if (exitkind_isKnown (unew->info->fcn->exitCode))
-	{
-	  if (optgenerror 
-	      (FLG_INCONDEFS,
-	       message ("Function %q inconsistently %rdeclared using %s",
-			uentry_getName (unew),
-			uentry_isDeclared (old),
-			exitkind_unparse (unew->info->fcn->exitCode)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereSpecified (old);
-	    }
-	}
-      else
-	{
-	  unew->info->fcn->exitCode = old->info->fcn->exitCode;
-	}
-    }
-
-  if (!qual_isUnknown (unew->info->fcn->nullPred))
-    {
-      if (!qual_equal (old->info->fcn->nullPred, unew->info->fcn->nullPred))
-	{
-	  if (optgenerror
-	      (FLG_INCONDEFS,
-	       message ("Function %q inconsistently %rdeclared using %s",
-			uentry_getName (unew),
-			uentry_isDeclared (old),
-			qual_unparse (unew->info->fcn->nullPred)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereSpecified (old);
-	    }
-	}
-    }
-  else
-    {
-      unew->info->fcn->nullPred = old->info->fcn->nullPred;
-    }
-
-  if (unew->info->fcn->specialCode != SPC_NONE)
-    {
-      if (old->info->fcn->specialCode != unew->info->fcn->specialCode)
-	{
-	  if (optgenerror
-	      (FLG_INCONDEFS,
-	       message ("Function %q inconsistently %rdeclared using %s",
-			uentry_getName (unew),
-			uentry_isDeclared (old),
-			specCode_unparse (unew->info->fcn->specialCode)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereSpecified (old);
-	    }
-	}
-    }
-  else
-    {
-      unew->info->fcn->specialCode = old->info->fcn->specialCode;
-    }
-	  
-  /*
-  ** check parameters
-  */
-  
-  if (!uentryList_sameObject (oldParams, newParams)
-      && (!uentryList_isMissingParams (oldParams)))
-    {
-      if (!uentryList_isMissingParams (newParams))
-	{
-	  int paramno = 0;
-	  int nparams = uentryList_size (oldParams);
-	  bool checknames = context_maybeSet (FLG_DECLPARAMMATCH);
-
-	  if (nparams != uentryList_size (newParams))
-	    {
-	      nargsError (old, unew);
-	    }
-	  
-	  if (uentryList_size (newParams) < nparams) 
-	    {
-	      nparams = uentryList_size (newParams);
-	    }
-
-	  while (paramno < nparams)
-	    {
-	      uentry oldCurrent = uentryList_getN (oldParams, paramno);
-	      uentry newCurrent  = uentryList_getN (newParams, paramno);
-	      ctype  oldCurrentType = uentry_getType (oldCurrent);
-	      ctype  newCurrentType = uentry_getType (newCurrent);
-
-	      llassert (uentry_isValid (oldCurrent)
-			&& uentry_isValid (newCurrent));
-	      
-	      if (!uentry_isElipsisMarker (oldCurrent)
-		  && !uentry_isElipsisMarker (newCurrent))
-		{
-		  checkVarConformance (oldCurrent, newCurrent, 
-				       mustConform, completeConform);
-		}
-
-	      if (checknames)
-		{
-		  if (uentry_hasName (oldCurrent) 
-		      && uentry_hasName (newCurrent))
-		    {
-		      cstring oldname = uentry_getName (oldCurrent);
-		      cstring pfx = context_getString (FLG_DECLPARAMPREFIX);
-		      cstring oname;
-		      cstring nname = uentry_getName (newCurrent);
-		      cstring nnamefix;
-
-		      if (cstring_isDefined (pfx)
-			  && cstring_equalPrefix (oldname, cstring_toCharsSafe (pfx)))
-			{
-			  oname = cstring_suffix (oldname, cstring_length (pfx));
-			}
-		      else
-			{
-			  oname = oldname;
-			/*@-branchstate@*/ } /*@=branchstate@*/
-
-		      if (cstring_isDefined (pfx)
-			  && cstring_equalPrefix (nname, cstring_toCharsSafe (pfx)))
-			{
-			  nnamefix = cstring_suffix (nname, cstring_length (pfx));
-			}
-		      else
-			{
-			  nnamefix = nname;
-			/*@-branchstate@*/ } /*@=branchstate@*/
-
-		      if (!cstring_equal (oname, nnamefix))
-			{
-			  if (optgenerror
-			      (FLG_DECLPARAMMATCH, 
-			       message ("Definition parameter name %s does not match "
-					"name of corresponding parameter in "
-					"declaration: %s",
-					nnamefix, oname),
-			       uentry_whereLast (newCurrent)))
-			    {
-			      uentry_showWhereLastPlain (oldCurrent);
-			    }
-			}
-		      
-		      cstring_free (oldname);
-		      cstring_free (nname);
-		    }
-		}
-
-	      if (!ctype_match (oldCurrentType, newCurrentType))
-		{
-		  paramTypeError (old, oldCurrent, oldCurrentType,
-				  unew, newCurrent, newCurrentType, paramno);
-		}
-	      else
-		{
-		  if (ctype_isMissingParamsMarker (newCurrentType)
-		      || ctype_isElips (newCurrentType)
-		      || ctype_isMissingParamsMarker (oldCurrentType)
-		      || ctype_isElips (oldCurrentType))
-		    {
-		      ;
-		    }
-		  else
-		    {
-		      if (ctype_isConj (newCurrentType))
-			{
-			  if (ctype_isConj (oldCurrentType))
-			    {
-			      if (!ctype_sameAltTypes (newCurrentType, oldCurrentType))
-				{
-				  if (optgenerror 
-				      (FLG_INCONDEFS,
-				       message ("Parameter %q inconsistently %rdeclared with "
-						"alternate types %s "
-						"(types match, but alternates are not identical, "
-						"so checking may not be correct)",
-						uentry_getName (newCurrent),
-						uentry_isDeclared (oldCurrent),
-						ctype_unparse (newCurrentType)),
-				       uentry_whereDeclared (unew)))
-				    {
-				      uentry_showWhereLastVal (oldCurrent,
-							       ctype_unparse (oldCurrentType));
-				    }
-				}
-			    }
-			  else
-			    {
-			      if (optgenerror 
-				  (FLG_INCONDEFS,
-				   message ("Parameter %q inconsistently %rdeclared with "
-					    "alternate types %s",
-					    uentry_getName (newCurrent),
-					    uentry_isDeclared (oldCurrent),
-					    ctype_unparse (newCurrentType)),
-				   uentry_whereDeclared (unew)))
-				{
-				  uentry_showWhereLastVal (oldCurrent,
-							   ctype_unparse (oldCurrentType));
-				  
-				}
-			    }
-			}
-		      else 
-			{
-			  if (ctype_isConj (oldCurrentType))
-			    {
-			      uentry_setType (newCurrent, oldCurrentType);
-			    }
-			}
-		    }
-		}
-
-	      paramno++;  
-	      /*
-	       ** Forgot this!  detected by lclint:
-	       ** uentry.c:1257,15: Suspected infinite loop
-	       */
-	    }
-	}
-    }
-
-  if (!uentryList_isMissingParams (newParams))
-    {
-      if (ctype_isConj (oldRetType))
-	{
-	  old->utype = ctype_makeFunction (oldRetType, 
-					   uentryList_copy (newParams));
-	}
-      else
-	{
-	  old->utype = unew->utype;
-	}
-    }
-
-  checkGlobalsConformance (old, unew, mustConform, completeConform);
-  checkModifiesConformance (old, unew, mustConform, completeConform);
-
-  if (specialClauses_isDefined (unew->info->fcn->specclauses))
-    {
-      if (!specialClauses_isDefined (old->info->fcn->specclauses))
-	{
-	  if (optgenerror
-	      (FLG_INCONDEFS,
-	       message ("Function %q redeclared using special clauses (can only "
-			"be used in first declaration)",
-			uentry_getName (unew)),
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereLast (old);
-	    }
-	}
-      else
-	{
-	  specialClauses_checkEqual (old, unew);
-	}
-    }
-
-  if (fileloc_isUndefined (old->whereDeclared))
-    {
-      old->whereDeclared = fileloc_copy (unew->whereDeclared);
-    }
-  else if (fileloc_isUndefined (unew->whereDeclared))
-    {
-      unew->whereDeclared = fileloc_copy (old->whereDeclared);
-    }
-  else
-    {
-      /* no change */
-    }
-}
-
-void
-uentry_mergeConstantValue (uentry ue, /*@only@*/ multiVal m)
-{
-  multiVal uval;
-
-  llassert (uentry_isValid (ue));
-  llassert (uentry_isEitherConstant (ue));
-
-  uval = ue->info->uconst->val;
-
-  if (multiVal_isDefined (uval))
-    {
-      if (multiVal_isDefined (m))
-	{
-	  if (!multiVal_equiv (uval, m))
-	    {
-	      if (optgenerror 
-		  (FLG_INCONDEFS,
-		   message ("%s %q defined with inconsistent value: %q",
-			    ekind_capName (ue->ukind),
-			    uentry_getName (ue), 
-			    multiVal_unparse (m)),
-		   g_currentloc))
-		{
-		  uentry_showWhereLastExtra (ue, multiVal_unparse (uval));
-		}
-	    }
-	}
-      multiVal_free (m);
-    }
-  else
-    {
-      ue->info->uconst->val = m;
-      multiVal_free (uval);
-    }
-}
-
-static
-bool checkTypeConformance (/*@notnull@*/ uentry old, /*@notnull@*/ uentry unew, 
-			   bool mustConform)
-{
-  bool typeError = FALSE;
-
-  if (uentry_isStructTag (old) || uentry_isUnionTag (old))
-    {
-      if (ctype_isSU (old->utype) && ctype_isSU (unew->utype))
-	{
-	  if (mustConform)
-	    {
-	      checkStructConformance (old, unew); 
-	    }
-	}
-      else
-	{
-	  if (!(ctype_isBogus (old->utype) || ctype_isBogus (unew->utype)))
-	    {
-	      llbug (message ("struct tags: bad types: %t / %t", 
-			      old->utype, unew->utype));
-	    }
-	}
-    }
-  else if (uentry_isEnumTag (old))
-    {
-      if (ctype_isEnum (old->utype) && ctype_isEnum (unew->utype))
-	{
-	  if (mustConform) checkEnumConformance (old, unew);
-	}
-      else 
-	{
-	  if (!(ctype_isBogus (old->utype) || ctype_isBogus (unew->utype)))
-	    {
-	      llbug (message ("enum! bad type: %s / %s", ctype_unparse (old->utype),
-			      ctype_unparse (unew->utype)));
-	    }
-	}
-    }
-  else if (!ctype_match (old->utype, unew->utype))
-    {
-      if (cstring_equal (uentry_rawName (old), context_getBoolName ()))
-	{
-	  ctype realt = ctype_realType (unew->utype);
-	  
-	  if (ctype_isRealInt (realt) || ctype_isChar (realt))
-	    {
-	      unew->utype = ctype_bool;
-	    }
-	  else
-	    {
-	      if (mustConform)
-		{
-		  typeError = optgenerror
-		    (FLG_INCONDEFS,
-		     message ("%q defined as %s", uentry_getName (old), 
-			      ctype_unparse (realt)),
-		     uentry_whereDeclared (unew));
-		}
-	    }
-	} 
-      else 
-	{
-	  if (mustConform)
-	    {
-	      ctype oldr = ctype_realType (old->utype);
-	      ctype newr = ctype_realType (unew->utype);
-	      
-	      if (ctype_isStruct (oldr) && ctype_isStruct (newr))
-		{
-		  checkStructConformance (old, unew);
-		}
-	      else if (ctype_isUnion (oldr) && ctype_isUnion (newr))
-		{
-		  checkStructConformance (old, unew);
-		}
-	      else if (ctype_isEnum (oldr) && ctype_isEnum (newr))
-		{
-		  checkEnumConformance (old, unew);
-		}
-	      else if (uentry_isConstant (old) 
-		       && (ctype_isAbstract (oldr) && ctype_isEnum (newr)))
-		{
-		  /* okay...for now! (should check the type is reset later... */
-		}
-	      else
-		{
-		  DPRINTF (("YABA!"));
-		  if (optgenerror 
-		      (FLG_INCONDEFS,
-		       message ("%s %q %rdeclared with inconsistent type: %t",
-				ekind_capName (unew->ukind),
-				uentry_getName (unew), 
-				uentry_isDeclared (old),
-				unew->utype),
-		       uentry_whereDeclared (unew)))
-		    {
-		      uentry_showWhereLast (old);
-		      typeError = TRUE;
-		    }
-		}
-	    }
-	}
-    }
-  else
-    {
-      /* no error */
-    }
-
-  return typeError;
-}
-
-static void
-uentry_checkDatatypeConformance (/*@notnull@*/ uentry old,
-				 /*@notnull@*/ uentry unew,
-				 bool mustConform, bool completeConform)
-{
-  if (ctype_isDefined (unew->info->datatype->type))
-    {
-      /*
-      ** bool is hard coded here, since it is built into LCL.
-      ** For now, we're stuck with LCL's types.
-      */
-
-      if (ctype_isDirectBool (old->utype) &&
-	  cstring_equalLit (unew->uname, "bool"))
-	{
-	  /* if (!context_getFlag (FLG_ABSTRACTBOOL))
-	     evs 2000-07-25: removed
-	  */
-	      unew->utype = ctype_bool;
-	}
-      
-      if (ctype_isUnknown (old->info->datatype->type))
-	{
-	  old->info->datatype->type = unew->info->datatype->type;
-	}
-      else
-	{
-	  DPRINTF (("Old: %s / New: %s",
-		    uentry_unparseFull (old),
-		    uentry_unparseFull (unew)));
-	  DPRINTF (("Types: %s / %s",
-		    ctype_unparse (old->info->datatype->type),
-		    ctype_unparse (unew->info->datatype->type)));
-
-	  if (ctype_matchDef (old->info->datatype->type,
-			      unew->info->datatype->type))
-	    {
-	      ;
-	    }
-	  else
-	    {
-	      if (optgenerror 
-		  (FLG_INCONDEFS,
-		   message
-		   ("Type %q %s with inconsistent type: %t",
-		    uentry_getName (unew), 
-		    uentry_reDefDecl (old, unew),
-		    unew->info->datatype->type),
-		   uentry_whereDeclared (unew)))
-		{
-		  uentry_showWhereLastExtra 
-		    (old, cstring_copy (ctype_unparse (old->info->datatype->type)));
-		}
-
-	      old->info->datatype->type = unew->info->datatype->type;
-	    }
-	}
-    }
-  
-  if (unew->info->datatype->abs != MAYBE)
-    {
-      if (ynm_isOff (old->info->datatype->abs)
-	  && ynm_isOn (unew->info->datatype->abs))
-	{
-	  if (!ctype_isDirectBool (old->utype))
-	    {
-	      if (optgenerror 
-		  (FLG_INCONDEFS,
-		   message 
-		   ("Datatype %q inconsistently %rdeclared as abstract type",
-		    uentry_getName (unew), 
-		    uentry_isDeclared (old)),
-		   uentry_whereDeclared (unew)))
-		{
-		  uentry_showWhereLastPlain (old);
-		}
-	    }
-	}
-      else if (ynm_isOn (old->info->datatype->abs)
-	       && ynm_isOff (unew->info->datatype->abs))
-	{
-	  if (!ctype_isDirectBool (old->utype))
-	    {
-	      if (optgenerror 
-		  (FLG_INCONDEFS,
-		   message 
-		   ("Datatype %q inconsistently %rdeclared as concrete type",
-		    uentry_getName (unew), 
-		    uentry_isDeclared (old)),
-		   uentry_whereDeclared (unew)))
-		{
-		  uentry_showWhereLastPlain (old);
-		}
-	    }
-	}
-      else
-	{
-	  ;
-	}
-    }
-  else 
-    {
-      if (ynm_isOn (old->info->datatype->abs))
-	{
-	  old->sref = unew->sref;
-	  unew->info->datatype->mut = old->info->datatype->mut;
-	  
-	  if (completeConform
-	      && uentry_isReallySpecified (old))
-	    {
-	      if (optgenerror 
-		  (FLG_NEEDSPEC,
-		   message 
-		   ("Datatype %q specified as abstract, "
-		    "but abstract annotation not used in declaration",
-		    uentry_getName (unew)), 
-		   uentry_whereDeclared (unew)))
-		{
-		  uentry_showWhereLastPlain (old);
-		}
-	    }
-	}
-    }
-  
-  unew->info->datatype->abs = old->info->datatype->abs;	  
-  
-  if (ynm_isMaybe (unew->info->datatype->mut))
-    {
-      if (completeConform && ynm_isOff (old->info->datatype->mut)
-	  && uentry_isReallySpecified (old))
-	{
-	  if (optgenerror 
-	      (FLG_NEEDSPEC,
-	       message 
-	       ("Datatype %q specified as immutable, "
-		"but immutable annotation not used in declaration",
-		uentry_getName (unew)), 
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereLastPlain (old);
-	    }
-	}
-      
-      unew->info->datatype->mut = old->info->datatype->mut;
-    }
-  else if (ynm_isMaybe (old->info->datatype->mut))
-    {
-      old->info->datatype->mut = unew->info->datatype->mut;
-    }
-  else
-    {
-      if (ynm_isOn (old->info->datatype->abs))
-	{
-	  if (ynm_isOn (old->info->datatype->mut) && ynm_isOff (unew->info->datatype->mut))
-	    {
-	      if (optgenerror
-		  (FLG_INCONDEFS,
-		   message ("Datatype %q inconsistently %rdeclared as immutable",
-			    uentry_getName (unew), 
-			    uentry_isDeclared (old)),
-		   uentry_whereDeclared (unew)))
-		{
-		  uentry_showWhereLastPlain (old);
-		}
-	    }
-	  else 
-	    {
-	      if (ynm_isOff (old->info->datatype->mut)
-		  && ynm_isOn (unew->info->datatype->mut))
-		{
-		  if (optgenerror
-		      (FLG_INCONDEFS,
-		       message ("Datatype %q inconsistently %rdeclared as mutable",
-				uentry_getName (unew), 
-				uentry_isDeclared (old)),
-		       uentry_whereDeclared (unew)))
-		    {
-		      uentry_showWhereLastPlain (old);
-		    }
-		}
-	    }
-	}
-      old->info->datatype->mut = unew->info->datatype->mut;	  
-    }
-
-  uentry_checkStateConformance (old, unew, mustConform, completeConform);
-}
-
-static void
-uentry_checkConstantConformance (/*@notnull@*/ uentry old,
-				 /*@notnull@*/ uentry unew,
-				 bool mustConform, 
-				 /*@unused@*/ bool completeConform)
-{
-  multiVal oldVal = old->info->uconst->val;
-  multiVal newVal = unew->info->uconst->val;
-  
-  if (multiVal_isDefined (oldVal))
-    {
-      if (multiVal_isDefined (newVal))
-	{
-	  if (!multiVal_equiv (oldVal, newVal))
-	    {
-	      if (mustConform
-		  && optgenerror 
-		  (FLG_INCONDEFS,
-		   message ("%s %q %rdeclared with inconsistent value: %q",
-			    ekind_capName (unew->ukind),
-			    uentry_getName (unew), 
-			    uentry_isDeclared (old),
-			    multiVal_unparse (newVal)),
-		   uentry_whereDeclared (unew)))
-		{
-		  uentry_showWhereLastExtra (old, multiVal_unparse (oldVal));
-		}
-	    }
-	  
-	  unew->info->uconst->val = multiVal_copy (oldVal);
-	  multiVal_free (newVal);
-	}
-      else
-	{
-	  ;
-	}
-    }
-  else
-    {
-      old->info->uconst->val = multiVal_copy (newVal);
-    }
-}
-
-static void 
-uentry_checkConformance (/*@unique@*/ /*@notnull@*/ uentry old, 
-			 /*@notnull@*/ uentry unew, bool mustConform,
-			 bool completeConform)
-{
-  bool typeError = FALSE;
-  bool fcnConformance = FALSE;
-
-  if (!ekind_equal (unew->ukind, old->ukind))
-    {
-      /*
-      ** okay, only if one is a function and the other is
-      ** a variable of type function.
-      */
-
-      if (unew->ukind == KENUMCONST
-	  && old->ukind == KCONST)
-	{
-	  old->ukind = KENUMCONST;
-	  goto nokinderror;
-	}
-
-      if (unew->ukind == KFCN 
-	  && old->ukind == KCONST
-	  && ctype_isUnknown (old->utype))
-	{
-	  /*
-	  ** When a function is defined with an unparam macro
-	  */
-
-	  uentry_copyInto (old, unew);
-	  return;
-	}
-
-      if (uentry_isExpandedMacro (old) 
-	  && uentry_isEitherConstant (unew))
-	{
-	  uentry_copyInto (old, unew);
-	  return;
-	}
-
-      if (uentry_isEndIter (unew))
-	{
-	  if (ctype_isUnknown (old->utype))
-	    {
-	      if (!uentry_isSpecified (old)
-		  && uentry_isCodeDefined (unew))
-		{
-		  if (!fileloc_withinLines (uentry_whereDefined (old),
-					    uentry_whereDeclared (unew), 2))
-		    { /* bogus!  will give errors if there is too much whitespace */
-		      voptgenerror
-			(FLG_SYNTAX,
-			 message
-			 ("Iterator finalized name %q does not match name in "
-			  "previous iter declaration (should be end_%q).  This iter "
-			  "is declared at %q", 
-			  uentry_getName (unew),
-			  uentry_getName (old),
-			  fileloc_unparse (uentry_whereDefined (old))),
-			 uentry_whereDeclared (old));
-		    }
-		}
-
-	      uentry_copyInto (old, unew);
-	      return;
-	    }
-	  else
-	    {
-	      KindConformanceError (old, unew, mustConform);
-	    }
-	}
-
-      if (uentry_isFunction (unew))
-	{
-	  if (uentry_isVariable (old))
-	    {
-	      if (!ctype_isUnknown (old->utype))
-		{
-		  if (ctype_isFunction (old->utype))
-		    {
-		      uentry_makeVarFunction (old);
-		      checkFunctionConformance (old, unew, mustConform,
-						completeConform);
-		      fcnConformance = TRUE;
-		    }
-		  else
-		    {
-		      KindConformanceError (old, unew, mustConform);
-		    }
-		}
-	      else
-		{
-		  if (uentry_isExpandedMacro (old))
-		    {
-		      if (fileloc_isUndefined (unew->whereDefined))
-			{
-			  unew->whereDefined = fileloc_update (unew->whereDefined, 
-							      old->whereDefined);
-			}
-
-		      uentry_copyInto (old, unew);
-		      old->used = unew->used = TRUE;
-		      return;
-		    }
-		  else
-		    {
-		      /* undeclared identifier */
-		      old->utype = unew->utype;
-		      uentry_makeVarFunction (old);
-		      checkFunctionConformance (old, unew, FALSE, FALSE);
-		      fcnConformance = TRUE;
-		    }
-		}
-	    }
-	  else
-	    {
-	      KindConformanceError (old, unew, mustConform);
-	    }
-	}
-      else if (uentry_isFunction (old) && uentry_isVariable (unew))
-	{
-	  if (!ctype_isUnknown (unew->utype))
-	    {
-	      if (ctype_isFunction (unew->utype))
-		{
-		  uentry_makeVarFunction (unew);
-		  checkFunctionConformance (old, unew, mustConform, completeConform);
-		  fcnConformance = TRUE;
-		}
-	      else
-		{
-		  KindConformanceError (old, unew, mustConform);
-		}
-	    }
-	  else
-	    {
-	      KindConformanceError (old, unew, mustConform);
-	    }
-	}
-      else
-	{
-	  KindConformanceError (old, unew, mustConform);
-	}
-    }
-  else
-    {
-      /*
-      ** check parameter lists for functions 
-      ** (before type errors, to get better messages
-      */
-
-      if (uentry_isFunction (old))
-	{
-	  checkFunctionConformance (old, unew, mustConform, completeConform);
-	  fcnConformance = TRUE;
-	}
-      else 
-	{
-	  if (!ctype_isUndefined (old->utype))
-	    {
-	      typeError = checkTypeConformance (old, unew, mustConform);
-	    }
-	}
-    }
-
- nokinderror:
-
-  if (uentry_isEitherConstant (old) && uentry_isEitherConstant (unew))
-    {
-      uentry_checkConstantConformance (old, unew, mustConform, completeConform);
-    }
-
-  if (uentry_isDatatype (old) && uentry_isDatatype (unew))
-    {
-      DPRINTF (("Check datatype: %s / %s",
-		uentry_unparseFull (old),
-		uentry_unparseFull (unew)));
-
-      uentry_checkDatatypeConformance (old, unew, mustConform, completeConform);
-    }
-
-  if (uentry_isVariable (old) && uentry_isVariable (unew))
-    {
-      if (!typeError && 
-	  !ctype_matchDef (old->utype, unew->utype))
-	{
-	  if (optgenerror 
-	      (FLG_INCONDEFS,
-	       message
-	       ("Variable %q %s with inconsistent type (arrays and pointers are "
-		"not identical in variable declarations): %t",
-		uentry_getName (unew), 
-		uentry_reDefDecl (old, unew),
-		unew->utype),
-	       uentry_whereDeclared (unew)))
-	    {
-	      uentry_showWhereLast (old);
-	      
-	      /*
-	      ** Avoid repeated errors.
-	      */
-
-	      if (uentry_isCodeDefined (old) && uentry_isCodeDefined (unew))
-		{
-		  old->whereDefined = fileloc_update (old->whereDefined,
-						      fileloc_undefined);
-		}
-
-	      typeError = TRUE;
-	    }
-	}
-
-      checkVarConformance (old, unew, mustConform, completeConform);
-    }
-
-  if (fcnConformance)
-    {
-      /* old->utype = unew->utype; */
-    }
-  else
-    {
-      if (ctype_isConj (old->utype))
-	{
-	  if (ctype_isConj (unew->utype))
-	    {
-	      if (!ctype_sameAltTypes (old->utype, unew->utype))
-		{
-		  if (optgenerror 
-		      (FLG_INCONDEFS,
-		       message ("%s %q inconsistently %rdeclared with "
-				"alternate types %s "
-				"(types match, but alternates are not identical, "
-				"so checking may not be correct)",
-				ekind_capName (uentry_getKind (old)),
-				uentry_getName (unew),
-				uentry_isDeclared (old),
-				ctype_unparse (unew->utype)),
-		       uentry_whereDeclared (unew)))
-		    {
-		      uentry_showWhereLastVal (old, ctype_unparse (old->utype));
-		    }
-		  else
-		    {
-		      old->utype = unew->utype;
-		    }
-		}
-	    }
-	}
-      else
-	{
-	  if (ctype_isUnknown (old->utype))
-	    {
-	      old->utype = unew->utype;
-	    }
-	}
-    }  
-
-  if (unew->ukind == old->ukind) 
-    {
-      sfree (unew->info);
-      unew->info = uinfo_copy (old->info, old->ukind);
-    }
-
-  sRef_storeState (old->sref);
-  sRef_storeState (unew->sref);
-}
-
-/*
-** modifies spec to reflect def, reports any inconsistencies
-*/
-
-void
-uentry_mergeEntries (uentry spec, /*@only@*/ uentry def)
-{
-  llassert (uentry_isValid (spec));
-  llassert (uentry_isValid (def));
-  llassert (cstring_equal (spec->uname, def->uname));
-
-  uentry_checkConformance (spec, def, TRUE, 
-			   context_getFlag (FLG_NEEDSPEC));
-
-  /* was: !(fileloc_isImport (uentry_whereSpecified (spec)))); */
-
-  /*
-  ** okay, declarations conform.  Propagate extra information.
-  */
-
-  uentry_setDefined (spec, uentry_whereDefined (def));
-  uentry_setDeclared (spec, uentry_whereDeclared (def));
-
-  if (uentry_isStatic (def))
-    {
-      if (optgenerror 
-	  (FLG_INCONDEFS,
-	   message ("%s %q specified, but declared as static",
-		    ekind_capName (def->ukind),
-		    uentry_getName (def)),
-	   uentry_whereDeclared (def)))
-	{
-	  uentry_showWhereSpecified (spec);
-	}
-    }
-  else 
-    {
-      spec->storageclass = def->storageclass;
-    }
-
-  sRef_storeState (spec->sref);
-
-  spec->used = def->used || spec->used;
-  spec->hasNameError |= def->hasNameError;
-
-  uentry_free (def);
-
-  if (!spec->hasNameError)
-    {
-      uentry_checkName (spec);
-    }
-  else
-    {
-      ;
-    }
-}
-
-/*
-** Can't generate function redeclaration errors when the 
-** entries are merged, since we don't yet know if its the
-** definition of the function.
-*/
-
-void
-uentry_clearDecl (void)
-{
-  posRedeclared = uentry_undefined;
-  fileloc_free (posLoc);
-  posLoc = fileloc_undefined;
-}
-
-void
-uentry_checkDecl (void)
-{
-  if (uentry_isValid (posRedeclared))
-    {
-      llassert (fileloc_isDefined (posLoc));
-
-      if (uentry_isCodeDefined (posRedeclared))
-	{
-	  if (optgenerror (FLG_REDECL,
-			   message ("%s %q declared after definition", 
-				    ekind_capName (posRedeclared->ukind),
-				    uentry_getName (posRedeclared)),
-			   posLoc))
-	    {
-	      llgenindentmsg (message ("Definition of %q", 
-				       uentry_getName (posRedeclared)),
-			      posRedeclared->whereDeclared);
-	    }
-	}
-      else
-	{
-	  if (optgenerror (FLG_REDECL,
-			   message ("%s %q declared more than once", 
-				    ekind_capName (posRedeclared->ukind),
-				    uentry_getName (posRedeclared)),
-			   posLoc))
-	    {
-	      llgenindentmsg (message ("Previous declaration of %q", 
-				       uentry_getName (posRedeclared)),
-			      posRedeclared->whereDeclared);
-	    }
-	}
-    }
-
-  fileloc_free (posLoc);
-  posLoc = fileloc_undefined;
-  posRedeclared = uentry_undefined;
-}
-
-/*
-** Redefinition of old as unew.
-** modifies old to reflect unew, reports any inconsistencies
-*/
-
-void
-uentry_mergeDefinition (uentry old, /*@only@*/ uentry unew)
-{
-  fileloc olddef = uentry_whereDeclared (old);
-  fileloc unewdef = uentry_whereDeclared (unew);
-  bool mustConform;
-  bool wasForward;
- 
-  if (uentry_isExtern (unew))
-    {
-      uentry_setUsed (old, unewdef);
-    }
-
-  wasForward = 
-    fileloc_isUndefined (olddef) 
-      && fileloc_isDefined (uentry_whereDefined (old)) 
-	&& !uentry_isExpandedMacro (old);
-  
-  if (!context_getFlag (FLG_INCONDEFSLIB)
-      && (fileloc_isLib (olddef) || fileloc_isImport (olddef)))
-    {
-      mustConform = FALSE;
-    }
-  else
-    {
-      mustConform = TRUE;
-    }
-  
-  llassert (uentry_isValid (old));
-  llassert (uentry_isValid (unew));
-  llassert (cstring_equal (old->uname, unew->uname));
-
-  /*
-  ** should check old one was extern!
-  */
-
-  if (uentry_isStatic (old))
-    {
-      if (!(uentry_isStatic (unew)))
-	{
-	  if (optgenerror 
-	      (FLG_SHADOW,
-	       message ("%s %q shadows static declaration",
-			ekind_capName (unew->ukind),
-			uentry_getName (unew)),
-	       unewdef))
-	    {
-	      uentry_showWhereLast (old);
-	    }
-	}
-      else
-	{
-	  uentry_setDeclDef (old, unewdef);
-	}
-    }
-  else if (uentry_isStatic (unew))
-    {
-      uentry_setDeclDef (old, unewdef);
-    }
-  else if (uentry_isExtern (old))
-    {
-      uentry_setDeclared (old, unewdef);
-    }
-  else
-    {
-      if (!uentry_isExtern (unew) && !uentry_isForward (old)
-	  && !fileloc_equal (olddef, unewdef)
-	  && !fileloc_isUndefined (olddef)
-	  && !fileloc_isUndefined (unewdef)
-	  && !fileloc_isBuiltin (olddef)
-	  && !fileloc_isBuiltin (unewdef)
-	  && !uentry_isYield (old)
-	  && !(fileloc_isLib (olddef) || fileloc_isImport (olddef)))
-	{
-	  if (uentry_isVariable (old) || uentry_isVariable (unew))
-	    {
-	      ; /* will report redeclaration error later */
-	    }
-	  else
-	    {
-	      if (fileloc_isDefined (uentry_whereDefined (old)))
-		{
-		  if (optgenerror
-		      (FLG_REDEF,
-		       message ("%s %q defined more than once", 
-				ekind_capName (unew->ukind),
-				uentry_getName (unew)),
-		       uentry_whereLast (unew)))
-		    {
-		      llgenindentmsg
-			(message ("Previous definition of %q", 
-				  uentry_getName (old)),
-			 uentry_whereLast (old));
-		    }
-		  /*
-		  if (uentry_isDatatype (old) || uentry_isAnyTag (old))
-		    {
-		      uentry_copyInto (old, unew);
-		      old->sref = sRef_saveCopy (old->sref);
-		    }
-		    */
-		}
-	    }
-	}
-      else
-	{
-	  if (fileloc_isLib (olddef)
-	      || fileloc_isUndefined (olddef)
-	      || fileloc_isImport (olddef))
-	    {
-	      if (uentry_isExtern (unew)) 
-		{
-		  if (uentry_isExtern (old)
-		      || (fileloc_isDefined (uentry_whereDeclared (old))
-			  && (!fileloc_equal (uentry_whereDeclared (old),
-					      uentry_whereDefined (old)))))
-		    {
-		      if (optgenerror
-			  (FLG_REDECL,
-			   message ("%s %q declared more than once", 
-				    ekind_capName (unew->ukind),
-				    uentry_getName (unew)),
-			   unew->whereDeclared))
-			{
-			  llgenindentmsg
-			    (message ("Previous declaration of %q", 
-				      uentry_getName (old)),
-			     old->whereDeclared);
-			}
-		    }
-		  
-		  uentry_setExtern (old);
-		}
-	      else
-		{
-		  uentry_setDefined (old, unewdef);
-		}
-	    }
-	}
-    }
-
-  uentry_checkConformance (old, unew, mustConform, FALSE);
-
-  old->used = old->used || unew->used;
-  old->uses = filelocList_append (old->uses, unew->uses);
-  unew->uses = filelocList_undefined; 
-
-  sRef_storeState (old->sref); 
-  sRef_storeState (unew->sref);
-
-  if (wasForward)
-    {
-      old->whereDefined = fileloc_update (old->whereDefined,
-					  fileloc_undefined);
-    }
-
-  /*
-  ** No redeclaration errors for functions here, since we
-  ** don't know if this is the definition of the function.
-  */
-
-  if (fileloc_isUser (old->whereDeclared)
-      && fileloc_isUser (unew->whereDeclared)
-      && !fileloc_equal (old->whereDeclared, unew->whereDeclared)
-      && !fileloc_isDefined (unew->whereDefined))
-    {
-      if (uentry_isFunction (old))
-	{
-	  /*@-temptrans@*/ posRedeclared = old; /*@=temptrans@*/
-	  posLoc = fileloc_update (posLoc, unew->whereDeclared);
-	}
-      else
-	{
-	  if (optgenerror (FLG_REDECL,
-			   message ("%s %q declared more than once", 
-				    ekind_capName (unew->ukind),
-				    uentry_getName (unew)),
-			   unew->whereDeclared))
-	    {
-	      llgenindentmsg (message ("Previous declaration of %q", 
-				       uentry_getName (old)),
-			      old->whereDeclared);
-	    }
-	}
-    }
-
-  if (fileloc_isUndefined (old->whereDefined))
-    {
-      old->whereDefined = fileloc_update (old->whereDefined, unew->whereDefined);
-    }
-  else
-    {
-      if (!context_processingMacros ()
-	  && fileloc_isUser (old->whereDefined) 
-	  && fileloc_isUser (unew->whereDefined)
-	  && !fileloc_equal (old->whereDefined, unew->whereDefined))
-	{
-	  if (uentry_isVariable (unew) || uentry_isFunction (unew))
-	    {
-	      if (uentry_isVariable (unew) 
-		  && uentry_isExtern (unew))
-		{
-		  if (optgenerror (FLG_REDECL,
-				   message ("%s %q declared after definition", 
-					    ekind_capName (unew->ukind),
-					    uentry_getName (unew)),
-				   unew->whereDeclared))
-		    {
-		      llgenindentmsg (message ("Definition of %q", 
-					       uentry_getName (old)),
-				      old->whereDefined);
-		    }
-		}
-	      else
-		{
-		  if (optgenerror (FLG_REDEF,
-				   message ("%s %q redefined", 
-					    ekind_capName (unew->ukind),
-					    uentry_getName (unew)),
-				   unew->whereDefined))
-		    {
-		      llgenindentmsg (message ("Previous definition of %q", 
-					       uentry_getName (old)),
-				      old->whereDefined);
-		    }
-		}
-	    }
-	}
-    }
-
-  if (uentry_isExternal (unew))
-    {
-      old->whereDefined = fileloc_createExternal ();
-    }
-
-  if (unew->hasNameError)
-    {
-      old->hasNameError = TRUE;
-    }
-
-  uentry_free (unew);
-
-  if (!old->hasNameError)
-    {
-      uentry_checkName (old);
-    }
-
-  llassert (!ctype_isUndefined (old->utype));
-}
-
-void
-uentry_copyState (uentry res, uentry other)
-{
-  llassert (uentry_isValid (res));
-  llassert (uentry_isValid (other));
-
-  res->used = other->used;
-
-  res->info->var->kind = other->info->var->kind;
-  res->info->var->defstate = other->info->var->defstate;
-  res->info->var->nullstate = other->info->var->nullstate;
-  res->info->var->checked = other->info->var->checked;
-
-  sRef_copyState (res->sref, other->sref);
-}
-
-bool
-uentry_sameKind (uentry u1, uentry u2)
-{
-  if (uentry_isValid (u1) && uentry_isValid (u2))
-    {
-      if (uentry_isVar (u1) && uentry_isVar (u2))
-	{
-	  ctype c1 = u1->utype;
-	  ctype c2 = u2->utype;
-
-	  if (ctype_isUnknown (c1) || ctype_isUnknown (c2)) return FALSE;
-
-	  /*
-	  ** both functions, or both not functions
-	  */
-
-	  return (bool_equal (ctype_isFunction (c1), ctype_isFunction (c2)));
-	}
-      else
-	{
-	  return ((u1->ukind == u2->ukind));
-	}
-    }
-  
-  return FALSE;
-}
-   
-static void uentry_copyInto (/*@unique@*/ uentry unew, uentry old)
-{
-  llassert (uentry_isValid (unew));
-  llassert (uentry_isValid (old));
-
-  unew->ukind = old->ukind;
-  unew->uname = cstring_copy (old->uname);
-  unew->utype = old->utype;
-
-  unew->whereSpecified = fileloc_copy (old->whereSpecified);
-  unew->whereDefined = fileloc_copy (old->whereDefined);
-  unew->whereDeclared = fileloc_copy (old->whereDeclared);
-
-  unew->sref = sRef_saveCopy (old->sref); /* Memory leak! */
-  unew->used = old->used;
-  unew->lset = FALSE;
-  unew->isPrivate = old->isPrivate;
-  unew->hasNameError = old->hasNameError;
-  unew->uses = filelocList_undefined;
-
-  unew->storageclass = old->storageclass;
-  unew->info = uinfo_copy (old->info, old->ukind);
-}
-
-
-uentry
-uentry_copy (uentry e)
-{
-  if (uentry_isValid (e))
-    {
-      uentry enew = uentry_alloc ();
-      DPRINTF (("copy: %s", uentry_unparseFull (e)));
-      uentry_copyInto (enew, e);
-      DPRINTF (("Here we are..."));
-      DPRINTF (("original: %s", uentry_unparseFull (e)));
-      DPRINTF (("copy: %s", uentry_unparse (enew)));
-      DPRINTF (("copy: %s", uentry_unparseFull (enew)));
-      return enew;
-    }
-  else
-    {
-      return uentry_undefined;
-    }
-}
-
-void
-uentry_setState (uentry res, uentry other)
-{
-  llassert (uentry_isValid (res));
-  llassert (uentry_isValid (other));
-
-  llassert (res->ukind == other->ukind);
-  llassert (res->ukind == KVAR);
-
-  res->sref = sRef_saveCopy (other->sref);
-  res->used = other->used;
-  filelocList_free (res->uses); 
-  res->uses = other->uses; 
-  other->uses = filelocList_undefined; 
-  res->lset = other->lset;
-}
-
-void
-uentry_mergeUses (uentry res, uentry other)
-{
-  llassert (uentry_isValid (res));
-  llassert (uentry_isValid (other));
-
-  res->used = other->used || res->used;
-  res->lset = other->lset || res->lset;
-  res->uses = filelocList_append (res->uses, other->uses);
-  other->uses = filelocList_undefined;
-}
-
-
-/*
-** This is a really ugly routine.
-**
-** gack...fix this one day.
-*/
-
-/*
-** flip == TRUE
-**   >> res is the false branch, other is the true branch (or continuation)
-** flip == FALSE
-**   >> res is the true branch, other is the false branch (or continutation)
-**
-** opt == TRUE if,
-**
-** 
-** if  ;
-**
-** References not effected by res are propagated from other.
-*/
-
-static void
-  branchStateError (/*@notnull@*/ uentry res, /*@notnull@*/ uentry other, 
-		    bool flip, clause cl, fileloc loc)
-{
-  if (optgenerror 
-      (FLG_BRANCHSTATE,
-       message ("%s %q is %s %s, but %s %s.",
-		ekind_capName (res->ukind), uentry_getName (res),
-		sRef_stateVerb (res->sref), clause_nameFlip (cl, flip),
-		sRef_stateAltVerb (res->sref), clause_nameFlip (cl, !flip)),
-       loc))
-    {
-      if (sRef_isDead (res->sref))
-	{
-	  sRef_showStateInfo (res->sref);
-	}
-      else if (sRef_isKept (res->sref))
-	{
-	  sRef_showAliasInfo (res->sref);
-	}
-      else /* dependent */
-	{
-	  sRef_showAliasInfo (res->sref);
-	  sRef_showAliasInfo (other->sref);
-	}
-      
-      sRef_setAliasKind (res->sref, AK_ERROR, fileloc_undefined);
-    }
-}
-
-static bool incompatibleStates (sRef rs, sRef os)
-{
-  alkind rk = sRef_getAliasKind (rs);
-  alkind ok = sRef_getAliasKind (os);
-
-  if (alkind_isError (rk) || alkind_isError (ok))
-    {
-      return FALSE;
-    }
-  else
-    {
-      return ((sRef_isDead (rs)
-	       || (alkind_isKept (rk) && !alkind_isKept (ok))
-	       || (alkind_isDependent (rk) 
-		   && !alkind_isDependent (ok) && !alkind_isTemp (ok)))
-	      && (sRef_isAllocated (os) || sRef_isStateDefined (os)));
-    }
-}
-
-static void
-  branchStateAltError (/*@notnull@*/ uentry res,
-		       /*@notnull@*/ uentry other, bool flip,
-		       clause cl, fileloc loc)
-{
-  if (optgenerror 
-      (FLG_BRANCHSTATE,
-       message ("%s %q is %s %s, but %s %s.",
-		ekind_capName (res->ukind), uentry_getName (res),
-		sRef_stateVerb (other->sref), clause_nameFlip (cl, flip),
-		sRef_stateAltVerb (other->sref), clause_nameFlip (cl, !flip)),
-       loc))
-    {
-      if (sRef_isDead (other->sref))
-	{
-	  sRef_showStateInfo (other->sref);
-	}
-      else /* kept */
-	{
-	  sRef_showAliasInfo (other->sref);
-	}
-      
-      sRef_setAliasKind (res->sref, AK_ERROR, fileloc_undefined);
-      sRef_setDefinedComplete (res->sref, fileloc_undefined);
-      
-      sRef_setAliasKind (other->sref, AK_ERROR, fileloc_undefined);
-      sRef_setDefinedComplete (other->sref, fileloc_undefined);
-    }
-}
-
-static bool notNull (sRef sr, bool flip)
-{
-  return (!sRef_definitelyNull (sr)
-	  && !(sRef_isKept (sr))
-	  && !(sRef_isDependent (sr))
-	  && !(flip ? usymtab_isProbableDeepNull (sr)
-	       : usymtab_isAltProbablyDeepNull (sr)));
-}
-    
-void
-uentry_mergeState (uentry res, uentry other, fileloc loc,
-		   bool mustReturn, bool flip, bool opt,
-		   clause cl)
-{
-  llassert (uentry_isValid (res));
-  llassert (uentry_isValid (other));
-
-  llassert (res->ukind == other->ukind);
-  llassert (res->ukind == KVAR);
-
-  DPRINTF (("Merge state: %s / %s", 
-	    uentry_unparse (res),
-	    uentry_unparse (other)));
-
-  if (sRef_isValid (res->sref))
-    {
-      if (!mustReturn)
-	{
-	  if (incompatibleStates (res->sref, other->sref))
-	    {
-	      if (sRef_isThroughArrayFetch (res->sref)
-		  && !context_getFlag (FLG_STRICTBRANCHSTATE))
-		{
-		  if (sRef_isKept (res->sref) || sRef_isKept (other->sref))
-		    {
-		      sRef_maybeKill (res->sref, loc);
-		    }
-		  else if (sRef_isPossiblyDead (other->sref))
-		    {
-		      sRef_maybeKill (res->sref, loc);
-		    }
-		  else
-		    {
-		      ;
-		    }
-		}
-	      else
-		{
-		  if (notNull (other->sref, flip))
-		    {
-		      if (sRef_isLocalParamVar (res->sref) 
-			  && (sRef_isLocalState (other->sref) 
-			      || sRef_isDependent (other->sref)))
-			{
-			  if (sRef_isDependent (res->sref))
-			    {
-			      sRef_setDependent (other->sref, loc);
-			    }
-			  else
-			    {
-			      sRef_setDefState (res->sref, SS_UNUSEABLE, loc);
-			    }
-			}
-		      else 
-			{
-			  branchStateError (res, other, flip, cl, loc);
-			}
-		    }
-		}
-	      
-	      if (sRef_isKept (res->sref))
-		{
-		  sRef_setKept (other->sref, loc);
-		}
-	    }
-	  else
-	    {
-	      if (incompatibleStates (other->sref, res->sref))
-		{
-		  if (notNull (res->sref, !flip))
-		    {
-		      if (sRef_isLocalParamVar (res->sref) 
-			  && (sRef_isDependent (res->sref)
-			      || sRef_isLocalState (res->sref)))
-			{
-			  if (sRef_isDependent (other->sref))
-			    {
-			      sRef_setDependent (res->sref, loc);
-			    }
-			  else
-			    {
-			      sRef_setDefState (res->sref, SS_UNUSEABLE, loc);
-			    }
-			}
-		      else
-			{
-			  if (sRef_isParam (other->sref))
-			    {
-			      /* 
-		              ** If the local variable associated
-			      ** with the param has the correct state,
-			      ** its okay.
-			      ** (e.g., free (s); s = new(); ...
-			      */
-
-			      uentry uvar = usymtab_lookupSafe (other->uname);
-
-			      if (uentry_isValid (uvar)
-				  && ((sRef_isDead (other->sref) 
-				       && sRef_isOnly (uvar->sref))
-				      || (sRef_isDependent (other->sref)
-					  && sRef_isOwned (uvar->sref))))
-				{
-				  /* no error */
-				}
-			      else
-				{
-				  branchStateAltError (res, other,
-						       flip, cl, loc);
-				}
-			    }
-			  else
-			    {
-			      branchStateAltError (res, other, 
-						   flip, cl, loc);
-			    }
-			}
-		    }
-		}
-
-	      if (sRef_isKept (other->sref))
-		{
-		  sRef_setKept (res->sref, loc);
-		}
-	    }
-	  
-	  if (opt)
-	    {
-	      DPRINTF (("Merge opt..."));
-	      sRef_mergeOptState (res->sref, other->sref, cl, loc);
-	      DPRINTF (("Done!"));
-	    }
-	  else
-	    {
-	      sRef_mergeState (res->sref, other->sref, cl, loc);
-	    }
-	}
-      else
-	{
-	  if (sRef_isModified (other->sref))
-	    {
-	      sRef_setModified (res->sref);
-	    }
-	}
-
-      if (cl == DOWHILECLAUSE)
-	{
-	  res->used = other->used || res->used;
-	  res->lset = other->lset || res->lset;
-	  res->uses = filelocList_append (res->uses, other->uses);
-	  other->uses = filelocList_undefined;
-	}
-      else
-	{
-	  if (sRef_isMacroParamRef (res->sref)
-	      && !uentry_isSefParam (other)
-	      && !uentry_isSefParam (res))
-	    {
-	      bool hasError = FALSE;
-	      
-	      if (bool_equal (res->used, other->used))
-		{
-		  res->used = other->used;
-		}
-	      else
-		{
-		  if (other->used && !flip)
-		    {
-		      hasError = 
-			optgenerror 
-			  (FLG_MACROPARAMS,
-			   message ("Macro parameter %q used in true clause, "
-				    "but not in false clause",
-				    uentry_getName (res)),
-			   uentry_whereDeclared (res));
-		    }
-		  else
-		    {	
-		      hasError = 
-			optgenerror 
-			  (FLG_MACROPARAMS,
-			   message ("Macro parameter %q used in false clause, "
-				    "but not in true clause",
-				    uentry_getName (res)),
-			   uentry_whereDeclared (res));
-		    }
-		  res->used = TRUE;
-		  
-		  if (hasError)
-		    {
-		      /* make it sef now, prevent more errors */
-		      res->info->var->kind = VKREFSEFPARAM;
-		    }
-		}
-	    }
-	  else
-	    {
-	      res->used = other->used || res->used;
-	      res->lset = other->lset || res->lset;
-	      res->uses = filelocList_append (res->uses, other->uses);
-	      other->uses = filelocList_undefined;
-	    }
-	}
-    }
-}
-
-void uentry_setUsed (uentry e, fileloc loc)
-{
-  static bool firstTime = TRUE;
-  static bool showUses = FALSE;
-  static bool exportLocal = FALSE;
-
-  if (firstTime)
-    {
-      /* need to track uses is FLG_SHOWUSES or FLG_EXPORTLOCAL is true */
-
-      showUses = context_getFlag (FLG_SHOWUSES); 
-      exportLocal = context_maybeSet (FLG_EXPORTLOCAL);
-
-      firstTime = FALSE;
-    }
-
-  if (uentry_isValid (e))
-    {
-      int dp;
-      
-      if (sRef_isMacroParamRef (e->sref))
-	{
-	  if (uentry_isYield (e) || uentry_isSefParam (e))
-	    {
-	      ;
-	    }
-	  else 
-	    {
-	      if (context_inConditional ())
-		{
-		  if (optgenerror
-		      (FLG_MACROPARAMS,
-		       message ("Macro parameter %q used in conditionally "
-				"executed code (may or may not be "
-				"evaluated exactly once)", 
-				uentry_getName (e)),
-		       loc))
-		    {
-		      e->info->var->kind = VKREFSEFPARAM;
-		    }
-		}
-	      else
-		{
-		  if ((e)->used)
-		    {
-		      if (optgenerror
-			  (FLG_MACROPARAMS,
-			   message ("Macro parameter %q used more than once", 
-				    uentry_getName (e)),
-			   uentry_whereDeclared (e)))
-			{
-			  e->info->var->kind = VKREFSEFPARAM;
-			}
-		    }
-		}
-	    }
-	}
-      
-      if ((dp = uentry_directParamNo (e)) >= 0)
-	{
-	  uentry_setUsed (usymtab_getParam (dp), loc);
-	}
-      
-      e->used = TRUE;
-      
-      if (!sRef_isLocalVar (e->sref))
-	{
-	  if (showUses)
-	    {
-	      e->uses = filelocList_add (e->uses, fileloc_copy (loc));
-	    }
-	  else 
-	    {
-	      if (exportLocal)
-		{
-		  if (context_inMacro ())
-		    {
-		      e->uses = filelocList_addUndefined (e->uses);
-		    }
-		  else 
-		    {
-		      e->uses = filelocList_addDifferentFile
-			(e->uses, 
-			 uentry_whereDeclared (e),
-			 loc);
-		    }
-		}
-	    }
-	}
-    }
-}
-
-bool uentry_isReturned (uentry u)
-{
-  return (uentry_isValid (u) && uentry_isVar (u) 
-	  && (u->info->var->kind == VKRETPARAM
-	      || u->info->var->kind == VKSEFRETPARAM));
-}
-
-/*@exposed@*/ sRef uentry_returnedRef (uentry u, exprNodeList args)
-{
-  llassert (uentry_isRealFunction (u));
-
-  if (ctype_isFunction (u->utype)
-      && sRef_isStateSpecial (uentry_getSref (u)))
-    {
-      specialClauses clauses = uentry_getSpecialClauses (u);
-      sRef res = sRef_makeNew (ctype_returnValue (u->utype), u->sref, u->uname);
-
-      sRef_setAllocated (res, g_currentloc);
-
-      specialClauses_postElements (clauses, cl)
-	{
-	  sRefSet refs = specialClause_getRefs (cl);
-	  sRefMod modf = specialClause_getEffectFunction (cl);
-
-	  sRefSet_elements (refs, el)
-	    {
-	      sRef base = sRef_getRootBase (el);
-
-	      if (sRef_isResult (base))
-		{
-		  if (modf != NULL)
-		    {
-		      sRef sr = sRef_fixBase (el, res);
-		      modf (sr, g_currentloc);
-		    }
-		}
-	      else
-		{
-		  ;
-		}
-	    } end_sRefSet_elements ;
-
-	} end_specialClauses_postElements ;
-
-      return res;
-    }
-  else
-    {
-      uentryList params;
-      alkind ak;
-      sRefSet prefs = sRefSet_new ();
-      sRef res = sRef_undefined;
-      int paramno = 0;
-      
-      params = uentry_getParams (u);
-      
-      uentryList_elements (params, current)
-	{
-	  if (uentry_isReturned (current))
-	    {
-	      if (exprNodeList_size (args) >= paramno)
-		{
-		  exprNode ecur = exprNodeList_nth (args, paramno);
-		  sRef tref = exprNode_getSref (ecur);
-		  
-		  if (sRef_isValid (tref))
-		    {
-		      sRef tcref = sRef_copy (tref);
-		      
-		      if (sRef_isDead (tcref))
-			{
-			  sRef_setDefined (tcref, g_currentloc);
-			  sRef_setOnly (tcref, g_currentloc);
-			}
-		      
-		      if (sRef_isRefCounted (tcref))
-			{
-			  /* could be a new ref now (but only if its returned) */
-			  sRef_setAliasKindComplete (tcref, AK_ERROR, g_currentloc);
-			}
-		      
-		      sRef_makeSafe (tcref);
-		      
-		      prefs = sRefSet_insert (prefs, tcref);
-		    }
-		}
-	    }
-	  
-	  paramno++;
-	} end_uentryList_elements ;
-      
-      if (sRefSet_size (prefs) > 0)
-	{
-	  nstate n = sRef_getNullState (u->sref);
-	  
-	  if (sRefSet_size (prefs) == 1)
-	    {
-	      res = sRefSet_choose (prefs);
-	    }
-	  else
-	    {
-	      res = sRefSet_mergeIntoOne (prefs);
-	    }
-	  
-	  if (nstate_isKnown (n))
-	    {
-	      sRef_setNullState (res, n, g_currentloc);
-	    }
-	}
-      else
-	{
-	  if (ctype_isFunction (u->utype))
-	    {
-	      res = sRef_makeNew (ctype_returnValue (u->utype), u->sref, u->uname);
-	    }
-	  else
-	    {
-	      res = sRef_makeNew (ctype_unknown, u->sref, u->uname);
-	    }
-	  
-	  if (sRef_isRefCounted (res))
-	    {
-	      sRef_setAliasKind (res, AK_NEWREF, g_currentloc);
-	    }
-	}
-      
-      if (sRef_getNullState (res) == NS_ABSNULL)
-	{
-	  ctype ct = ctype_realType (u->utype);
-	  
-	  if (ctype_isAbstract (ct))
-	    {
-	      sRef_setNotNull (res, g_currentloc);
-	    }
-	  else
-	    {
-	      if (ctype_isUser (ct))
-		{
-		  sRef_setStateFromUentry (res, usymtab_getTypeEntry (ctype_typeId (ct)));
-		}
-	      else
-		{
-		  sRef_setNotNull (res, g_currentloc);
-		}
-	    }
-	}
-      
-      if (sRef_isRefCounted (res))
-	{
-	  sRef_setAliasKind (res, AK_NEWREF, g_currentloc);
-	}
-      else if (sRef_isKillRef (res))
-	{
-	  sRef_setAliasKind (res, AK_REFCOUNTED, g_currentloc);
-	}
-      else
-	{
-	  ;
-	}
-      
-      ak = sRef_getAliasKind (res);
-      
-      if (alkind_isImplicit (ak))
-	{
-	  sRef_setAliasKind (res, 
-			     alkind_fixImplicit (ak),
-			     g_currentloc);
-	}
-      
-      sRefSet_free (prefs);
-      
-      return res;
-    }
-}
-
-static bool uentry_isRefCounted (uentry ue)
-{
-  ctype ct = uentry_getType (ue);
-
-  if (ctype_isFunction (ct))
-    {
-      return (ctype_isRefCounted (ctype_returnValue (ct)));
-    }
-  else
-    {
-      return (ctype_isRefCounted (ct));
-    }
-}
-
-/*
-** old was declared yield in the specification.  
-** new is declared in the iter implementation.
-*/
-
-void uentry_checkYieldParam (uentry old, uentry unew)
-{
-  cstring name;
-
-  llassert (uentry_isVariable (old));
-  llassert (uentry_isVariable (unew));
-
-  unew->info->var->kind = VKYIELDPARAM;
-  (void) checkTypeConformance (old, unew, TRUE);
-  checkVarConformance (old, unew, TRUE, FALSE);
-
-  /* get rid of param marker */
-
-  name = uentry_getName (unew);
-  cstring_free (unew->uname);
-  unew->uname = name;
-  unew->info->var->kind = VKREFYIELDPARAM;
-
-  uentry_setUsed (old, fileloc_undefined);
-  uentry_setUsed (unew, fileloc_undefined);
-}
-
-/*@observer@*/ cstring
-uentry_ekindName (uentry ue)
-{
-  if (uentry_isValid (ue))
-    {
-      switch (ue->ukind)
-	{
-	case KINVALID:
-	  return cstring_makeLiteralTemp ("");
-	case KDATATYPE: 
-	  return cstring_makeLiteralTemp ("Datatype");
-	case KENUMCONST:
-	  return cstring_makeLiteralTemp ("Enum member");
-	case KCONST:  
-	  return cstring_makeLiteralTemp ("Constant");
-	case KVAR:      
-	  if (uentry_isParam (ue))
-	    {
-	      return cstring_makeLiteralTemp ("Parameter");
-	    }
-	  else if (uentry_isExpandedMacro (ue))
-	    {
-	      return cstring_makeLiteralTemp ("Expanded macro");
-	    }
-	  else
-	    {
-	      return cstring_makeLiteralTemp ("Variable");
-	    }
-	case KFCN:   
-	  return cstring_makeLiteralTemp ("Function");
-	case KITER: 
-	  return cstring_makeLiteralTemp ("Iterator");
-	case KENDITER:
-	  return cstring_makeLiteralTemp ("Iterator finalizer");
-	case KSTRUCTTAG:
-	  return cstring_makeLiteralTemp ("Struct tag");
-	case KUNIONTAG:
-	  return cstring_makeLiteralTemp ("Union tag");
-	case KENUMTAG: 
-	  return cstring_makeLiteralTemp ("Enum tag");
-	case KELIPSMARKER: 
-	  return cstring_makeLiteralTemp ("Optional parameters");
-	}
-    }
-  else
-    {
-      return cstring_makeLiteralTemp ("");
-    }
-
-  BADEXIT;
-}
-
-void uentry_setHasNameError (uentry ue)
-{
-  llassert (uentry_isValid (ue));
-
-  ue->hasNameError = TRUE;
-}
-
-void uentry_checkName (uentry ue)
-{
-  if (uentry_isValid (ue) 
-      && !uentry_isElipsisMarker (ue)
-      && context_getFlag (FLG_NAMECHECKS)
-      && !ue->hasNameError 
-      && !uentry_isEndIter (ue)
-      && !fileloc_isBuiltin (uentry_whereLast (ue))
-      && (uentry_isExpandedMacro (ue) || !uentry_isForward (ue)))
-    {
-      
-      if (uentry_isPriv (ue))
-	{
-	  ; /* any checks here? */
-	}
-      else if (fileloc_isExternal (uentry_whereDefined (ue)))
-	{
-	  ; /* no errors for externals */
-	}
-      else
-	{
-	  int scope;
-	  
-	  if (uentry_isExpandedMacro (ue))
-	    {
-	      scope = globScope;
-	    }
-	  else
-	    {
-	      if (uentry_isExpandedMacro (ue))
-		{
-		  scope = fileScope;
-		}
-	      else if (uentry_isVariable (ue))
-		{
-		  sRef sr = uentry_getSref (ue);
-
-		  if (sRef_isValid (sr))
-		    {
-		      scope = sRef_getScope (sr);
-		    }
-		  else
-		    {
-		      scope = fileScope; 
-		    }
-		}
-	      else if (uentry_isFunction (ue)
-		       || uentry_isIter (ue)
-		       || uentry_isEndIter (ue)
-		       || uentry_isConstant (ue))
-		{
-		  scope = uentry_isStatic (ue) ? fileScope : globScope;
-		}
-	      else /* datatypes, etc. must be global */
-		{
-		  scope = globScope;
-		}
-	      
-	      usymtab_checkDistinctName (ue, scope);
-	    }
-
-	  if (context_getFlag (FLG_CPPNAMES)) 
-	    {
-	      if (checkCppName (uentry_rawName (ue), uentry_whereLast (ue)))
-		{
-		  uentry_setHasNameError (ue);
-		}
-	    }
-
-	  if (scope == globScope)
-	    {
-	      checkGlobalName (ue);
-
-	      if (context_getFlag (FLG_ANSIRESERVED))
-		{
-		  if (uentry_hasName (ue)
-		      && !uentry_isAnyTag (ue))
-		    {
-		      if (checkAnsiName (uentry_rawName (ue),
-					 uentry_whereLast (ue)))
-			{
-			  uentry_setHasNameError (ue);
-			}
-		    }
-		}
-	    }
-	  else
-	    {
-	      checkLocalName (ue);
-	      
-	      if (context_getFlag (FLG_ANSIRESERVEDLOCAL))
-		{
-		  if (uentry_hasName (ue)
-		      && !uentry_isAnyTag (ue))
-		    {
-		      if (checkAnsiName (uentry_rawName (ue),
-					 uentry_whereLast (ue)))
-			{
-			  uentry_setHasNameError (ue);
-			}
-		    }
-		}
-	    }
-
-	  DPRINTF (("Check prefix: %s", uentry_unparse (ue)));
-	  checkPrefix (ue);
-	}
-    }
-}
-
-/*@exposed@*/ uentry uentry_makeUnrecognized (cstring c, /*@keep@*/ fileloc loc)
-{
-  uentry ue;
-  fileloc tloc;
-
-  /*
-  ** Can't but unrecognized ids in macros in global scope, because srefs will break! */
-  if (!context_inMacro ())
-    {
-      sRef_setGlobalScopeSafe ();
-    }
-
-  ue = uentry_makeVariable (c, ctype_unknown, loc, FALSE);
-  uentry_setUsed (ue, loc);		  
-  
-  tloc = fileloc_createExternal ();
-  uentry_setDefined (ue, tloc);
-  fileloc_free (tloc);
-  uentry_setHasNameError (ue);
-  
-  if (context_getFlag (FLG_REPEATUNRECOG))
-    {
-      uentry_markOwned (ue);
-    }
-  else
-    {
-      ue = usymtab_supReturnFileEntry (ue);
-    }
-  
-  if (!context_inMacro ())
-    {
-      sRef_clearGlobalScopeSafe ();
-    }
-
-  return ue;
-}
-
-/* new start modifications */
-
-void uentry_testInRange (uentry p_e, uentry cconstant)  {
-  if( uentry_isValid(p_e) ) {
-    if( sRef_isValid (p_e->sref) ) {
-      char * t = cstring_toCharsSafe (uentry_unparse(cconstant) );
-      int index = atoi( t );
-      free (t);
-      usymtab_testInRange (p_e->sref, index);
-    }//end if
-  }//endif
-}
-
-void uentry_setStringLength (uentry p_e, uentry cconstant)  {
-if( uentry_isValid(p_e) ) {
-  if( p_e->info != NULL) {
-    if( p_e->info->var != NULL) {
-      char *t =  cstring_toCharsSafe (uentry_unparse(cconstant));
-      int length = atoi( t );
-      free (t);
-      p_e->info->var->bufinfo->len = length; 
-      p_e->sref->bufinfo.len = length;
-      printf("Set string length of buff to %d \n",  p_e->sref->bufinfo.size);
-    }//end if
-  }//endif
-}//end if
-}
-
-
-void uentry_setBufferSize (uentry p_e, exprNode cconstant) {
-if( uentry_isValid(p_e) ) {
-  if( p_e->info != NULL) {
-    if( p_e->info->var != NULL) {
-      int size = atoi(cstring_toCharsSafe(exprNode_unparse(cconstant) ) ); 
-      p_e->info->var->bufinfo->size = size; 
-      p_e->sref->bufinfo.size = size;
-      printf("Set buffer size to %d \n",  p_e->sref->bufinfo.size);
-      //  fprintf(stderr, "For %s and %s\n", uentry_unparse(p_e) );
-      // fprintf(stderr, "and %d\n", size );
-      
-    }//end if
-  }//endif
-}//end if
-}
-
-  
-/* start modifications */
-/*
-requires: p_e is defined, is a ptr/array variable 
-modifies: p_e
-effects: sets the state of the variable
-*/
-
-void uentry_setPossiblyNullTerminatedState (uentry p_e)  {
-  if( uentry_isValid(p_e) ) {
-    if( p_e->info != NULL) {
-      if( p_e->info->var != NULL) {
-         p_e->info->var->bufinfo->bufstate = BB_POSSIBLYNULLTERMINATED;
-         p_e->sref->bufinfo.bufstate = BB_POSSIBLYNULLTERMINATED;
-         return;
-      }/* End if */
-    }/* End if */
-  }/* End if */
-
-  fprintf(stderr, "uentry:Error in setPossiblyNullTerminatedState\n");
-}
-
-/*
-requires: p_e is defined, is a ptr/array variable 
-modifies: p_e
-effects: sets the size of the buffer
-*/
-
-void uentry_setNullTerminatedState (uentry p_e)  {
-  if( uentry_isValid(p_e) ) {
-    if( p_e->info != NULL) {
-      if( p_e->info->var != NULL) {
-        p_e->info->var->bufinfo->bufstate = BB_NULLTERMINATED;
-        p_e->sref->bufinfo.bufstate = BB_NULLTERMINATED;
-        return;
-      }//End if
-    }//End if
-  }//End if
-
-  fprintf(stderr, "uentry:Error in setNullTerminatedState\n");
-}
-
-
-/*
-requires: p_e is defined, is a ptr/array variable 
-modifies: p_e
-effects: sets the state of the variable
-*/
-
-void uentry_setNotNullTerminatedState (uentry p_e)  {
-  if( uentry_isValid(p_e) ) {
-    if( p_e->info != NULL) {
-      if( p_e->info->var != NULL) {
-        p_e->info->var->bufinfo->bufstate = BB_NOTNULLTERMINATED;
-        p_e->sref->bufinfo.bufstate = BB_NOTNULLTERMINATED;
-        return;
-      }//End if
-    }//End if
-  }//End if
-
-  fprintf(stderr, "uentry:Error in setNotNullTerminatedState\n");
-}
-
-
-/*
-requires: p_e is defined, is a ptr/array variable 
-modifies: p_e
-effects: sets the size of the buffer
-*/
-
-void uentry_setSize (uentry p_e, int size)  {
-  if( uentry_isValid(p_e) ) {
-    if( p_e->info != NULL) {
-      if( p_e->info->var != NULL) {
-        p_e->info->var->bufinfo->size = size;
-        p_e->sref->bufinfo.size = size;
-        return;
-      }//End if
-    }//End if
-  }//End if
-
-  fprintf(stderr, "uentry:Error in setSize\n");
-}
-
-
-/*
-requires: p_e is defined, is a ptr/array variable 
-modifies: p_e
-effects: sets the length of the buffer
-*/
-
-void uentry_setLen (uentry p_e, int len)  {
-  if( uentry_isValid(p_e) ) {
-    if( p_e->info != NULL) {
-      if( p_e->info->var != NULL) {
-        p_e->info->var->bufinfo->len = len;
-        p_e->sref->bufinfo.len = len;
-        return;
-      }//End if
-    }//End if
-  }//End if
-
-  fprintf(stderr, "uentry:Error in setLen\n");
-}
-
-/*@=type*/
diff --git a/src/uentryList.c b/src/uentryList.c
deleted file mode 100644
index 773af21..0000000
--- a/src/uentryList.c
+++ /dev/null
@@ -1,849 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** uentryList.c (from slist_template.c)
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-/*@only@*/ /*@notnull@*/ uentryList
-uentryList_new ()
-{
-  uentryList s = (uentryList) dmalloc (sizeof (*s));
-  
-  s->nelements = 0;
-  s->nspace = uentryListBASESIZE;
-  s->elements = (uentry *) 
-    dmalloc (sizeof (*s->elements) * uentryListBASESIZE);
-  s->current = 0;
-
-  return (s);
-}
-
-/*@only@*/ uentryList
-uentryList_single (/*@keep@*/ uentry el)
-{
-  uentryList s = (uentryList) dmalloc (sizeof (*s));
-  
-  s->nelements = 1;
-  s->nspace = uentryListBASESIZE - 1;
-  s->elements = (uentry *) dmalloc (sizeof (*s->elements) * uentryListBASESIZE);
-  
-  s->elements[0] = el;
-  s->current = 0;
-
-  return (s);
-}
-
-static void
-uentryList_grow (uentryList s)
-{
-  int i;
-  uentry *newelements;
-
-  llassert (!uentryList_isUndefined (s));
-
-  s->nspace += uentryListBASESIZE; 
-  
-  newelements = (uentry *) dmalloc (sizeof (*newelements) 
-				    * (s->nelements + s->nspace));
-    
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-  
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-void uentryList_clear (uentryList s)
-{
-  if (uentryList_isUndefined (s))
-    {
-      ;
-    }
-  else
-    {
-      s->nspace += s->nelements;
-      s->nelements = 0;
-    }
-}
-
-uentryList uentryList_add (uentryList s, /*@keep@*/ uentry el)
-{
-  if (uentryList_isUndefined (s))
-    {
-      s = uentryList_new ();
-    }
-
-  if (s->nspace <= 0)
-    uentryList_grow (s);
-  
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-
-  return s;
-}
-
-/*@only@*/ cstring
-  uentryList_unparse (uentryList s)
-{
-  cstring st = cstring_undefined;
-  int i;
-  
-  if (uentryList_isDefined (s))
-    {
-      for (i = 0; i < uentryList_size (s); i++)
-	{
-	  if (i == 0)
-	    {
-	      st = message ("%q;", uentry_unparse (s->elements[i]));
-	    }
-	  else
-	    st = message ("%q %q;", st, uentry_unparse (s->elements[i]));
-	}
-    }
-  
-  return (st);
-}
-
-/*@unused@*/ /*@only@*/ cstring
-  uentryList_unparseFull (uentryList s)
-{
-  cstring st = cstring_undefined;
-  int i;
-  
-  if (uentryList_isDefined (s))
-    {
-      for (i = 0; i < uentryList_size (s); i++)
-	{
-	  if (i == 0)
-	    {
-	      st = message ("%q;", uentry_unparseFull (s->elements[i]));
-	    }
-	  else
-	    {
-	      st = message ("%q %q;", st, uentry_unparseFull (s->elements[i]));
-	    }
-	}
-    }
-  
-  return (st);
-}
-
-cstring uentryList_unparseParams (uentryList s)
-{
-  int i;
-  cstring st = cstring_undefined;
-
-  
-  if (uentryList_isUndefined (s))
-    {
-      return st;
-    }
-  else if (uentryList_isVoid (s))
-    {
-      return (cstring_makeLiteral ("void"));
-    }
-  else
-    {
-      for (i = 0; i < uentryList_size (s); i++)
-	{
-	  if (i == 0)
-	    {
-	      st = message ("%s", ctype_unparse (uentry_getType (s->elements[i])));
-	    }
-	  else
-	    {
-	      st = message ("%q, %s", st, ctype_unparse (uentry_getType (s->elements[i])));
-	    }
-	}
-      
-      return st;
-    }
-}
-
-bool uentryList_matchParams (uentryList p1, uentryList p2, bool force, bool arg)
-{
-  int sz1 = uentryList_size (p1);
-  int sz2 = uentryList_size (p2);
-  int i;
-  
-  if (p1 == p2) return TRUE;
-
-  if (uentryList_isMissingParams (p1) || uentryList_isMissingParams (p2))
-    {
-      return TRUE;
-    }
-
-  if (sz1 != sz2)
-    return FALSE;
-
-  for (i = 0; i < sz1; i++)
-    {
-      if (!ctype_genMatch (uentry_getType (p1->elements[i]), 
-			   uentry_getType (p2->elements[i]), 
-			   force, arg, FALSE, FALSE))
-	{
-	  return FALSE;
-	}
-    }
-
-  return TRUE;
-}
-
-/*@only@*/ cstring
-uentryList_unparseAbbrev (uentryList p)
-{
-  bool first = TRUE;
-  cstring s = cstring_undefined;
-  int i = 0;
-  
-  if (uentryList_isUndefined (p))
-    return s;
-
-  if (uentryList_size (p) == 0)
-    return cstring_makeLiteral ("void");
-
-  for (i = 0; i < p->nelements && i < PRINTBREADTH; i++)
-    {
-      if (first)
-	{
-	  s = message ("%q;", uentry_unparseAbbrev (p->elements[i]));
-	  first = FALSE;
-	}
-      else
-	{
-	  s = message ("%q %q;", s, uentry_unparseAbbrev (p->elements[i]));
-	}
-    }
-  
-  if (i != uentryList_size (p))
-    s = message ("%q, ...", s);
-  
-  return (s);
-}
-
-static int
-uentryList_lookupDirectName (uentryList s, cstring name)
-{
-  if (uentryList_isDefined (s))
-    {
-      int i;
-      
-      for (i = 0; i < uentryList_size (s); i++)
-	{
-	  if (cstring_equal (name, uentry_rawName (s->elements[i])))
-	    {
-	      return i;
-	    }
-	}
-    }
-
-   return -1;
-}
-
-int
-uentryList_lookupRealName (uentryList s, cstring name)
-{
-  if (uentryList_isDefined (s))
-    {
-      int i;
-      
-      for (i = 0; i < uentryList_size (s); i++)
-	{
-	  cstring uname = uentry_getName (s->elements[i]);
-
-	  if (cstring_equal (name, uname))
-	    {
-	      cstring_free (uname);
-	      return i;
-	    }      
-
-	  cstring_free (uname);
-	}
-    }
-
-   return -1;
-}
-
-uentryList uentryList_copy (uentryList s)
-{
-  
-  if (uentryList_isDefined (s))
-    {
-      uentryList t = (uentryList) dmalloc (sizeof (*t));
-      int i;
-      
-      t->nelements = s->nelements;
-      t->nspace = 0;
-      t->current = s->current;
-      
-      if (s->nelements > 0)
-	{
-	  t->elements = (uentry *) dmalloc (sizeof (*t->elements) * t->nelements);
-	  
-	  for (i = 0; i < s->nelements; i++) 
-	    {
-	      	      t->elements[i] = uentry_copy (s->elements[i]); 
-	      	    }
-	}
-      else
-	{
-	  t->elements = NULL;
-	}
-
-      return t;
-    }
-  else
-    {
-      return uentryList_undefined;
-    }
-}
-
-void
-uentryList_free (uentryList s)
-{
-  
-  if (!uentryList_isUndefined (s)) 
-    {
-      int i;
-
-      for (i = 0; i < s->nelements; i++)
-	{
-	  uentry_free (s->elements[i]);  
-	}
-
-      sfree (s->elements);
-      sfree (s);
-    }
-}
-
-bool
-uentryList_isVoid (uentryList cl)
-{
-  if (cl != NULL && cl->nelements == 1)
-    {
-      return (ctype_isVoid (uentry_getType (cl->elements[0])));
-    }
-  return FALSE;
-}
-
-/*@exposed@*/ uentry
-uentryList_getN (uentryList p, int n)
-{
-  llassert (uentryList_isDefined (p));
-
-  if (n < 0 || (n >= uentryList_size (p)))
-    {
-      llcontbug (message ("uentryList_getN: out of range: %d (size %d)",
-			  n, uentryList_size (p)));
-      return uentry_undefined;
-    }
-
-  return (p->elements[n]);
-}
-
-void uentryList_fixMissingNames (uentryList cl)
-{
-  uentryList_elements (cl, ce)
-    {
-      if (!uentry_hasRealName (ce))
-	{
-	  ctype ct = uentry_getType (ce);
-
-	  if (ctype_isUA (ct))
-	    {
-	      uentry_setName (ce, usymtab_getTypeEntryName (ctype_typeId (ct)));
-	    }
-	  else
-	    {
-	      llbug (message ("uentryList_fixMissingNames: not UA: %s", 
-			      ctype_unparse (ct)));
-	    }
-
-	  uentry_setType (ce, ctype_int);
-	}
-    } end_uentryList_elements;
-}
-
-void uentryList_fixImpParams (uentryList cl)
-{
-  
-  if (context_getFlag (FLG_PARAMIMPTEMP))
-    {
-      uentryList_elements (cl, ce)
-	{
-	  sRef s = uentry_getSref (ce);
-	  alkind ak = sRef_getAliasKind (s);
-
-	  if (alkind_isUnknown (ak) || alkind_isImplicit (ak))
-	    {
-	      exkind ek = sRef_getExKind (s);
-
-	      if (exkind_isKnown (ek))
-		{
-		  sRef_setAliasKind (s, AK_IMPDEPENDENT, fileloc_undefined);
-		}
-	      else
-		{
-		  sRef_setAliasKind (s, AK_IMPTEMP, fileloc_undefined);
-		}
-	      	    }
-	  else
-	    {
-	      	    }
-	} end_uentryList_elements;
-    }
-}
-
-int
-uentryList_compareParams (uentryList s, uentryList t)
-{
-  int i, sz;
-
-  if (s == t) return 0;
-
-  if (uentryList_isUndefined (s)) return 1;
-  if (uentryList_isUndefined (t)) return -1;
-  
-  sz = uentryList_size (s);
-  
-  INTCOMPARERETURN (uentryList_size (t), sz);
-  
-  for (i = 0; i < sz; i++)
-    {
-      COMPARERETURN (uentry_compare (s->elements[i], t->elements[i]));
-    }
-  
-  return 0;
-}
-
-int
-uentryList_compareStrict (uentryList s, uentryList t)
-{
-  int i, sz;
-
-  if (s == t) 
-    {
-      return 0;
-    }
-  
-  if (uentryList_isMissingParams (s))
-    {
-      if (uentryList_isMissingParams (t))
-	{
-	  return 0;
-	}
-      else
-	{
-	  return 1;
-	}
-    }
-  else 
-    {
-      if (uentryList_isMissingParams (t))
-	{
-	  return -1;
-	}
-      else
-	{
-	  sz = uentryList_size (s);
-	  
-	  INTCOMPARERETURN (uentryList_size (t), sz);
-	  
-	  for (i = 0; i < sz; i++)
-	    {
-	      COMPARERETURN (uentry_compareStrict (s->elements[i], t->elements[i]));
-	    }
-	  
-	  return 0;
-	}
-    }
-}
-
-int
-uentryList_compareFields (uentryList s, uentryList t)
-{
-  int i, sz;
-
-  if (s == t) return 0;
-
-  if (uentryList_isUndefined (s))
-    return 1;
-  if (uentryList_isUndefined (t))
-    return -1;
-  
-  sz = uentryList_size (s);
-  
-  if (uentryList_size (t) != sz)
-    {
-      return (int_compare (sz, uentryList_size (t)));
-    }
-  
-  for (i = 0; i < sz; i++)
-    {
-      uentry se = s->elements[i];
-      uentry te = t->elements[i];
-      int namecmp = cstring_compare (uentry_rawName (se), uentry_rawName (te));
-
-      if (namecmp == 0)
-	{
-	  int uc = uentry_compare (s->elements[i], t->elements[i]);
-	  
-	  if (uc != 0) 
-	    { 
-	      return uc; 
-	    }
-	}
-      else
-	{
-	  return (namecmp);
-	}
-    }
-
-  return 0;
-}
-
-/*@exposed@*/ uentry 
-uentryList_current (uentryList s)
-{
-  llassert (uentryList_isDefined (s));
-  llassert (!(s->current < 0 || (s->current >= s->nelements)));
-  return (s->elements[s->current]);
-}
-
-cstring
-uentryList_dumpParams (uentryList s)
-{
-  cstring st = cstring_undefined;
-
-  if (uentryList_isUndefined (s)) return st;
-  
-  uentryList_elements (s, current)
-    {
-      st = message ("%q%q,", st, uentry_dumpParam (current));
-  } end_uentryList_elements;
-
-  return st;
-}
-
-/*@only@*/ cstring
-uentryList_dumpFields (uentryList s)
-{
-  cstring st = cstring_undefined;
-
-  if (uentryList_isUndefined (s)) return st;
-
-  uentryList_elements (s, current)
-  {
-    if (!uentry_isVariable (current))
-      {
-	llassert (uentry_isFunction (current));
-	st = message ("%q!%q,", st, uentry_dump (current));
-      }
-    else
-      {
-	st = message ("%q%q,", st, uentry_dump (current));
-      }
-  } end_uentryList_elements;
-  
-  return st;
-}
-
-/*@only@*/ uentryList 
-uentryList_undumpFields (char **s, fileloc loc)
-{
-  uentryList ul = uentryList_new ();
-
-  while (**s != '\0' && **s != '}') 
-    {
-      if (**s == '!')
-	{
-	  checkChar (s, '!');
-	  ul = uentryList_add (ul, uentry_undump (ekind_function, loc, s));
-	}
-      else
-	{
-	  ul = uentryList_add (ul, uentry_undump (ekind_variable, loc, s));
-	}
-      checkChar (s, ',');
-    }
-
-  checkChar (s, '}');
-  return ul;
-}
-
-/*@only@*/ uentryList
-uentryList_undump (char **s)
-{
-  char c;
-  uentryList pn = uentryList_new ();
-  int paramno = 0;
-
-  c = **s;
-
-  while (c != '#' && c != '@' && c != ')')
-    {
-      uentry ue = uentry_undump (ekind_variable, g_currentloc, s);
-      
-      
-      if (!uentry_isUndefined (ue))
-	{
-	  pn = uentryList_add (pn, ue);
-	}
-      else
-	{
-	  uentry_free (ue);
-	}
-
-      checkChar (s, ',');
-      c = **s;
-      paramno++;
-    }
-
-  checkChar (s, ')');
-  return pn;
-}
-
-void 
-uentryList_reset (uentryList s)
-{
-  if (uentryList_isUndefined (s)) return;
-  s->current = 0;
-}
-
-bool
-uentryList_isFinished (uentryList s)
-{
-  if (uentryList_isUndefined (s)) return TRUE;
-  return (s->current > s->nelements - 1);
-}
-
-void 
-uentryList_advanceSafe (uentryList s)
-{
-  if (uentryList_isUndefined (s)) return;
-
-  s->current++;
-
-  if (s->current > s->nelements)
-    {
-      s->current = s->nelements;
-    }
-}
-
-int
-uentryList_size (uentryList s)
-{
-  if (uentryList_isUndefined (s)) return 0;
-
-  if (s->nelements == 1 && ctype_isVoid (uentry_getType (s->elements[0])))
-    return 0;
-  
-  return s->nelements;
-}
-
-bool
-uentryList_isMissingParams (uentryList s)
-{
-  return (uentryList_isUndefined (s) || s->nelements == 0);
-}
-
-bool uentryList_hasReturned (uentryList ul)
-{
-  uentryList_elements (ul, current)
-    {
-      if (uentry_isReturned (current)) return TRUE;
-    } end_uentryList_elements;
-
-  return FALSE;
-}
-
-/*@exposed@*/ uentry 
-uentryList_lookupField (uentryList f, cstring name)
-{
-  int i = uentryList_lookupDirectName (f, name);
-
-  if (i >= 0)
-    {
-      return (uentryList_getN (f, i));
-    }
-  else
-    {
-      return uentry_undefined;
-    }
-}
-
-/*@only@*/ uentryList
-  uentryList_mergeFields (/*@only@*/ uentryList f1, /*@only@*/ uentryList f2)
-{
-  if (uentryList_isUndefined (f1))
-    {
-      return  (f2);
-    }
-
-  if (uentryList_isDefined (f2))
-    {
-      uentryList_elements (f2, current)
-	{
-	  uentry old = uentryList_lookupField (f1, uentry_rawName (current));
-	  
-	  if (uentry_isValid (old))
-	    {
-	      voptgenerror
-		(FLG_SYNTAX,
-		 message ("Field name reused: %s", uentry_rawName (current)),
-		 uentry_whereDefined (current));
-	      llgenmsg (message ("Previous use of %s", uentry_rawName (current)),
-			uentry_whereDefined (old));
-	    }
-	  
-	  /* okay to use exposed current since f2 is killed */
-	  /*@-exposetrans@*/ /*@-dependenttrans@*/
-	  f1 = uentryList_add (f1, current); 
-	  /*@=exposetrans@*/ /*@=dependenttrans@*/
-
-	} end_uentryList_elements;
-      
-      sfree (f2->elements);
-      sfree (f2);
-    }
-
-  return (f1);
-}
-
-void
-uentryList_showFieldDifference (uentryList p1, uentryList p2)
-{
-  uentry cp1, cp2;
-  int index;
-
-  llassert (NOALIAS (p1, p2));
-  llassert (uentryList_isDefined (p1));
-  llassert (uentryList_isDefined (p2));
-  
-  for (index = 0; index < p1->nelements; index++)
-    {
-      cp1 = p1->elements[index];
-
-      if (index == p2->nelements)
-	{
-	  llgenindentmsg
-	    (message ("Field present in %s, missing in %rdeclaration: %q", 
-		      uentry_specDeclName (cp1),
-		      uentry_isDeclared (cp1),
-		      uentry_unparse (cp1)),
-	     uentry_whereEither (cp1));
-	  return;
-	}
-	  
-      cp2 = p2->elements[index];
-
-      if (!(cstring_equal (uentry_rawName (cp1), uentry_rawName (cp2))))
-	{
-	  llgenindentmsg 
-	    (message ("Field %s in %s corresponds to %s in %rdeclaration", 
-		      uentry_rawName (cp1),
-		      uentry_specOrDefName (cp1),
-		      uentry_rawName (cp2),
-		      uentry_isCodeDefined (cp1)),
-	     uentry_whereDefined (cp2));
-	  uentry_showWhereLastPlain (cp1);
-	  return;
-	}
-      else 
-	{
-	  /* evs 2000-07-25 was ctype_match, should match uentryList_matchFields */
-	  if (!ctype_almostEqual (uentry_getType (cp1), uentry_getType (cp2)))
-	    {
-	      llgenindentmsg 
-		(message ("Field %s %rdeclared as %s, %s as %s",
-			  uentry_rawName (cp2),
-			  uentry_isCodeDefined (cp1),
-			  ctype_unparse (uentry_getType (cp1)),
-			  uentry_specOrDefName (cp2),
-			  ctype_unparse (uentry_getType (cp2))),
-		 uentry_whereDefined (cp2));
-	      uentry_showWhereLastPlain (cp1);
-	      return;
-	    }
-	}
-    }
-
-  if (index != p2->nelements)
-    {
-      cp2 = p2->elements[index];
-
-      llgenindentmsg 
-	(message ("Extra field in new declaration: %q",
-		  uentry_unparse (cp2)),
-	 uentry_whereEither (cp2));
-
-      return;
-    }
-
-  llbug (message ("uentryList_showFieldDifference: match: %q / %q",
-		  uentryList_unparse (p1), uentryList_unparse (p2)));
-}
-
-bool
-uentryList_matchFields (uentryList p1, uentryList p2)
-{
-  int index;
-  uentry cp1, cp2;
-
-  if (p1 == p2) 
-    {
-      return (TRUE);
-    }
-
-  if (uentryList_isEmpty (p1) || uentryList_isEmpty (p2))
-    {
-      return (TRUE);
-    }
-
-  if (uentryList_size (p1) != uentryList_size (p2))
-    {
-      return FALSE;
-    }
-
-  for (index = 0; index < p1->nelements; index++)
-    {
-      cp1 = p1->elements[index];
-      cp2 = p2->elements[index];
-
-      if (!(cstring_equal (uentry_rawName (cp1), uentry_rawName (cp2))
-	    && (ctype_almostEqual (uentry_getType (cp1), uentry_getType (cp2)))))
-	{     /* was ctype_match! */
-	  return FALSE;
-	}
-    }
-
-  return TRUE;
-}
-
diff --git a/src/usymIdSet.c b/src/usymIdSet.c
deleted file mode 100644
index 661390f..0000000
--- a/src/usymIdSet.c
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** usymIdSet.c
-**
-** based on set_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-usymIdSet
-usymIdSet_new ()
-{
-  return usymIdSet_undefined;
-}
-
-static /*@notnull@*/ /*@only@*/ usymIdSet
-usymIdSet_newEmpty (void)
-{
-  usymIdSet s = (usymIdSet) dmalloc (sizeof (*s));
-  
-  s->entries = 0;
-  s->nspace = usymIdSetBASESIZE;
-  s->elements = (usymId *) dmalloc (sizeof (*s->elements) * usymIdSetBASESIZE);
-
-  return (s);
-}
-
-static void
-usymIdSet_grow (/*@notnull@*/ usymIdSet s)
-{
-  int i;
-  usymId *newelements;
-
-  s->nspace = usymIdSetBASESIZE;
-  newelements = (usymId *) dmalloc (sizeof (*newelements) * (s->entries + s->nspace));
-
-  for (i = 0; i < s->entries; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-/*@only@*/ usymIdSet
-usymIdSet_single (usymId t)
-{
-  usymIdSet s = (usymIdSet) dmalloc (sizeof (*s));
-   
-  s->entries = 1;
-  s->nspace = usymIdSetBASESIZE - 1;
-  s->elements = (usymId *) dmalloc (sizeof (*s->elements) * usymIdSetBASESIZE);
-  s->elements[0] = t;
-
-  return (s);
-}
-
-static usymIdSet 
-  usymIdSet_insert (/*@returned@*/ usymIdSet s, usymId el)
-{
-  if (usymIdSet_isUndefined (s))
-    {
-      s = usymIdSet_newEmpty ();
-    }
-
-  if (usymIdSet_member (s, el))
-    {
-      return s;
-    }
-  else
-    {
-      if (s->nspace <= 0)
-	usymIdSet_grow (s);
-      s->nspace--;
-      s->elements[s->entries] = el;
-      s->entries++;
-      return s;
-    }
-}
-
-static usymIdSet
-usymIdSet_copy (/*@notnull@*/ usymIdSet s)
-{
-  int size = s->entries + 1;
-  usymIdSet t = (usymIdSet) dmalloc (sizeof (*t));
-  int i;
-  
-  t->entries = s->entries;
-  t->nspace = 1;
-  t->elements = (usymId *) dmalloc (sizeof (*t->elements) * size);
-  
-  for (i = 0; i < s->entries; i++)
-    {
-      t->elements[i] = s->elements[i];
-    }
-  
-  return t;
-}
-
-usymIdSet
-usymIdSet_add (usymIdSet s, usymId el)
-{
-  if (usymIdSet_isDefined (s))
-    {
-      llassert (!usymIdSet_member (s, el));
-      
-      return (usymIdSet_insert (usymIdSet_copy (s), el));
-    }
-  else
-    {
-      return (usymIdSet_single (el));
-    }
-}
-
-usymIdSet
-usymIdSet_removeFresh (/*@temp@*/ usymIdSet s, usymId el)
-{
-  if (usymIdSet_isDefined (s))
-    {
-      usymIdSet t = usymIdSet_newEmpty ();
-      int i;
-      
-      for (i = 0; i < s->entries; i++)
-	{
-	  if (!usymId_equal (el, s->elements[i]))
-	    {
-	      t = usymIdSet_insert (t, s->elements[i]);
-	    }
-	}
-      
-      return t;
-    }
-  else
-    {
-      return usymIdSet_undefined;
-    }
-}
-
-usymIdSet
-usymIdSet_newUnion (usymIdSet s1, usymIdSet s2)
-{
-  usymIdSet t = usymIdSet_new ();
-
-  usymIdSet_elements (s1, current)
-    {
-      t = usymIdSet_insert (t, current);
-    } end_usymIdSet_elements;
-
-  usymIdSet_elements (s2, current)
-    {
-      t = usymIdSet_insert (t, current);
-    } end_usymIdSet_elements;
-
-  return t;
-}
-
-/*
-** returns a new usymIdSet comprised of all elements
-** in s which are not in t.
-*/
-
-usymIdSet
-usymIdSet_subtract (usymIdSet s, usymIdSet t)
-{
-  usymIdSet r = usymIdSet_new ();
-
-  usymIdSet_elements (s, current)
-    {
-      if (!usymIdSet_member (t, current))
-	{
-	  r = usymIdSet_insert (r, current);
-	}
-    } end_usymIdSet_elements;
-
-  return r;
-}
-
-bool
-usymIdSet_member (usymIdSet s, usymId el)
-{
-  if (usymIdSet_isUndefined (s))
-    {
-      return FALSE;
-    }
-  else
-    {
-      int i;
-      
-      for (i = 0; i < s->entries; i++)
-	{
-	  if (usymId_equal (el, s->elements[i]))
-	    return TRUE;
-	}
-      return FALSE;
-    }
-}
-
-void
-usymIdSet_free (/*@only@*/ usymIdSet s)
-{
-  if (!usymIdSet_isUndefined (s))
-    {
-      int i;
-      for (i = 0; i < s->entries; i++)
-	{
-	  /*      usymId_free (s->elements[i]); */
-	}
-      
-      sfree (s->elements); 
-      sfree (s);
-    }
-}
-
-cstring usymIdSet_dump (usymIdSet lset)
-{
-  cstring st = cstring_undefined;
-  
-  if (!usymIdSet_isUndefined (lset))
-    {
-      bool first = TRUE;
-      int i;
-      
-      for (i = 0; i < lset->entries; i++)
-	{
-	  usymId current = lset->elements[i];
-	  
-	  if (!usymId_isInvalid (current))
-	    {
-	      current = usymtab_convertId (current);
-
-	      if (first)
-		{
-		  st = message ("%d", current);
-		  first = FALSE;
-		}
-	      else
-		{
-		  st = message ("%q,%d", st, current);
-		}
-	    }
-	}
-    }
-  return (st);
-}
-
-/*
-** end of list is '@' or '\0'
-*/
-
-usymIdSet
-usymIdSet_undump (char **s)
-{
-  usymIdSet t = usymIdSet_new ();
-  char *olds = *s;
-  char c;
-
-  
-  while ((c = **s) != '\0' && c != '@' && c != '#' && c != '\n')
-    {
-      int tid = 0;
-
-      while (c != '@' && c != '#' && c != ',' && c != '\0' && c != '\n')
-	{
-	  while (c >= '0' && c <= '9')
-	    {
-	      tid *= 10;
-	      tid += (int) (c - '0');
-	      (*s)++;
-	      c = **s;
-	    }
-
-	  if (*s == olds)
-	    {
-	      llcontbug (message ("usymIdSet_undump: loop: %s", 
-				  cstring_fromChars (*s)));
-
-	      while (**s != '\0') 
-		{
-		  (*s)++;
-		}
-
-	      /*@innerbreak@*/ break;
-	    }
-
-	  olds = *s;
-	  
-	  t = usymIdSet_insert (t, usymId_fromInt (tid));
-	}
-
-      if (c == ',')
-	{
-	  (*s)++;
-	}
-    }
-
-  return t;
-}
-
-/*@only@*/ cstring
-usymIdSet_unparse (usymIdSet ll)
-{
-  cstring s = cstring_undefined;
-
-  if (!usymIdSet_isUndefined (ll))
-    {
-      int i;
-      
-      for (i = 0; i < ll->entries; i++)
-	{
-	  usymId current = ll->elements[i];
-
-	  if (i == 0)
-	    s = uentry_getName (usymtab_getGlobalEntry (current));
-	  else
-	    s = message ("%q, %q", s, uentry_getName (usymtab_getGlobalEntry (current)));
-	}
-    }
-  
-  return s;
-}
-
-int 
-usymIdSet_compare (usymIdSet l1, usymIdSet l2)
-{
-  if (usymIdSet_isUndefined (l1))
-    {
-      return (usymIdSet_size (l2) == 0 ? 0 : 1);
-    }
-  
-  if (usymIdSet_isUndefined (l2))
-    {
-      return (usymIdSet_size (l1) == 0 ? 0 : 1);
-    }
-  
-  {
-    int li1 = l1->entries;
-    int li2 = l2->entries;
-    int leastelements = (li1 < li2) ? li1 : li2;
-    int i = 0;
-    
-    while (i < leastelements)
-      {
-	if (usymId_equal (l1->elements[i], l2->elements[i]))
-	  {
-	    i++;
-	  }
-	else
-	  {
-	    if (l1->elements[i] > l2->elements[i]) 
-	      {
-		return 1;
-	      }
-	    else
-	      {
-		return -1;
-	      }
-	  }
-      }
-
-    return (int_compare (li1, li2));
-  }
-}
diff --git a/src/usymtab.c b/src/usymtab.c
deleted file mode 100644
index 1c15b5c..0000000
--- a/src/usymtab.c
+++ /dev/null
@@ -1,5612 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** usymtab
-**
-** Lexically scoped symbol table.
-**
-** Unlike a normal symbol table, this table splits to reflect branches.
-**
-** This is necessary since symbol table entries also reflect
-** some state information, like initialization, that may be
-** different on different branches.
-**
-** For each control structure we split:
-**
-** { }                - a normal scope (no control) US_NORMAL
-**
-** if  { }      - US_TBRANCH true branch
-** while  { }     US_FBRANCH else branch
-**
-** switch  { }  - US_SWITCH
-**
-** case x:            - case scope US_CBRANCH
-**                      Should be kept in a separate table, because of
-**                      weird C syntax.
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-# include "structNames.h"
-# include "exprChecks.h"
-# include "aliasChecks.h"
-
-/*
-** Keep track of type definitions inside a function.
-*/
-
-static uentryList functypes = uentryList_undefined;
-
-static bool dbgfree = FALSE;
-static bool dbgload = TRUE;
-
-/*@access ekind usymId@*/
-
-/*
-** Hack to prevent shadow errors from appearing when function parameters
-** are entered into a new scope.
-*/
-
-static bool noshadowerror = FALSE;
-
-/*
-** Constraint: static variables can live in 1 or > 2. 
-**
-** except for tags.  All tags must be at the global level.
-** Static tags are handled in a kludgey way.
-*/
-
-/*
-** utab    is the universal symbol table
-** globtab is the global environment of utab
-** oldtab  is needed for conversions in dumping (after sorting the table)
-**
-** there can be only one usymtab!
-*/
-
-static /*@checkedstrict@*/ /*@owned@*/ /*@notnull@*/ usymtab utab;
-
-/* Reachable environments from from utab */
-static /*@checkedstrict@*/ /*@notnull@*/ /*@dependent@*/ usymtab globtab;
-static /*@checkedstrict@*/ /*@dependent@*/ usymtab filetab;
-
-/* Used for sorting for dumpage. */
-static /*@checkedstrict@*/ /*@owned@*/ usymtab oldtab;
-
-static int usymtab_lexicalLevel (void) /*@globals utab@*/ ;
-static bool usymtab_isProbableNullAltBranch (sRef p_s) /*@globals utab@*/ ;
-static void refTable_free (/*@only@*/ /*@null@*/ refTable p_x, int p_nentries);
-static ctype usymtab_suFieldsType (uentryList p_f, bool p_isStruct) /*@globals globtab@*/ ;
-
-static void
-usymtab_freeLevel (/*@notnull@*/ /*@only@*/ usymtab p_u)
-  /*@globals globtab, utab, filetab@*/ /*@modifies p_u@*/ ;
-
-static bool usymtab_isProbableNullAux (sRef p_s) /*@globals utab@*/ ;
-static /*@only@*/ cstring usymtab_unparseStackTab (usymtab p_t);
-static /*@exposed@*/ /*@dependent@*/ uentry 
-  usymtab_getRefTab (/*@notnull@*/ usymtab p_u, int p_level, usymId p_index);
-static /*@unused@*/ /*@only@*/ cstring 
-  usymtab_unparseLocalAux (/*@notnull@*/ usymtab p_s);
-static /*@unused@*/ /*@only@*/ cstring 
-  usymtab_unparseLocalList (/*@notnull@*/ usymtab p_s);
-static /*@only@*/ cstring usymtab_typeName (/*@notnull@*/ usymtab p_t);
-static void usymtab_handleParams (void)
-   /*@globals utab, globtab, filetab@*/ 
-   /*@modifies utab@*/ ;
-
-static /*@exposed@*/ /*@dependent@*/ uentry 
-  usymtab_addRefEntry (/*@notnull@*/ usymtab p_s, cstring p_k);
-static /*@exposed@*/ /*@dependent@*/ usymtab
-  usymtab_dropEnv (/*@notnull@*/ usymtab p_s);
-static /*@exposed@*/ /*@dependent@*/ uentry 
-  usymtab_getRefNoisy (/*@notnull@*/ usymtab p_s, int p_level, usymId p_index);
-
-static /*@exposed@*/ /*@dependent@*/ uentry 
-  usymtab_lookupQuiet (usymtab p_s, cstring p_k);
-static void usymtab_printAllAux (usymtab p_s) /*@modifies g_msgstream@*/ ;
-static int usymtab_getIndex (/*@notnull@*/ usymtab p_s, cstring p_k);
-static /*@exposed@*/ uentry usymtab_fetchIndex (/*@notnull@*/ usymtab p_s, int p_i);
-static /*@exposed@*/ uentry 
-  usymtab_lookupAux (usymtab p_s, cstring p_k);
-static /*@exposed@*/ /*@dependent@*/ /*@notnull@*/ usymtab 
-  usymtab_getFileTab (void) /*@globals filetab@*/ ;
-static int refTable_lookup (/*@notnull@*/ usymtab p_ut, int p_level, int p_index);
-static bool usymtab_mustBreak (usymtab p_s);
-static bool usymtab_mustEscape (usymtab p_s);
-
-static void recordFunctionType (uentry ue)
-{
-    llassert (uentry_isDatatype (ue) || uentry_isAnyTag (ue)
-	    || uentry_isEnumConstant (ue));
-
-  /*@-temptrans@*/
-  functypes = uentryList_add (functypes, ue);
-  /*@=temptrans@*/
-}
-
-static void clearFunctionTypes (void)
-  /*@modifies globtab@*/
-{
-  uentryList_elements (functypes, el)
-    {
-      if (cstring_isDefined (uentry_rawName (el)))
-	{
-	  if (globtab->htable != NULL)
-	    {
-	      hashTable_remove (globtab->htable, uentry_rawName (el));
-	    }
-
-	  uentry_setName (el, cstring_undefined);
-	}
-
-      /*@access uentry@*/ 
-      llassert (uentry_isValid (el));
-      el->sref = sRef_undefined;
-      /*@noaccess uentry@*/
-    } end_uentryList_elements ;
-
-  uentryList_clear (functypes);
-}
-
-static /*@falsenull@*/ bool usymtab_isBranch (usymtab u)
-{
-  return (usymtab_isDefined (u) && 
-	  (u->kind == US_TBRANCH || u->kind == US_FBRANCH
-	   || u->kind == US_CBRANCH || u->kind == US_SWITCH));
-}
-
-static bool usymtab_mustBreak (usymtab s)
-{
-  llassert (s != GLOBAL_ENV);
-  return (s->mustBreak);
-}
-
-static bool usymtab_mustEscape (usymtab s)
-{
-  llassert (s != GLOBAL_ENV);
-  return (exitkind_mustEscape (s->exitCode));
-}
-
-void usymtab_setMustBreak () 
-  /*@modifies utab@*/
-{
-  llassert (utab != GLOBAL_ENV);
-  utab->mustBreak = TRUE;
-}
-
-void usymtab_setExitCode (exitkind ex) 
-   /*@modifies utab@*/
-{
-  llassert (utab != GLOBAL_ENV);
-
-  utab->exitCode = ex;
-  
-  if (exitkind_mustEscape (ex))
-    {
-      utab->mustBreak = TRUE;
-    }
-}
-
-bool usymtab_isAltProbablyDeepNull (sRef s)
-{
-  return (sRef_deepPred (usymtab_isProbableNullAltBranch, s));
-}
-
-static bool usymtab_isProbableNullAltBranch (sRef s) 
-   /*@globals utab@*/
-{
-  guardSet t;
-  bool res;
-
-  t = utab->guards;
-
-  llassert (utab->env != NULL);
-
-  /*@-mods@*/ /* These modifications are cancelled. */
-  utab->guards = utab->env->guards;
-  utab->env->guards = t;
-  /*@=mods@*/
-
-  llassert (usymtab_isDefined (utab));
-  res = usymtab_isProbableNull (s);
-
-  /*
-  ** This reports a spurious error.  It is okay, because of
-  ** the nesting relationship of usymtab environments.
-  */
-
-  /*@-mods@*/ /* Cancelling modifications. */
-  /*@i1@*/ utab->env->guards = utab->guards;
-  /*@i1@*/ utab->guards = t;
-  /*@=mods@*/ 
-
-  return res;
-}
-
-static /*@notnull@*/ /*@special@*/ usymtab
-  usymtab_create (uskind kind, /*@keep@*/ usymtab env, bool nextlevel)
-  /*@defines result@*/
-  /*@post:isnull result->htable, result->guards, result->aliases@*/
-{
-  usymtab t = (usymtab) dmalloc (sizeof (*t));
-  
-  t->nentries = 0;
-  t->nspace = CBASESIZE;
-  t->entries = (uentry *) dmalloc (sizeof (*t->entries) * CBASESIZE);
-  t->reftable = (nextlevel 
-		 ? NULL
-		 : (refentry *) dmalloc (sizeof (*t->reftable) * CBASESIZE));
-  
-  t->kind = kind;
-  t->lexlevel = (env == GLOBAL_ENV ? 0 : env->lexlevel) + (nextlevel ? 1 : 0); 
-
-  t->env = env;
-  t->htable = NULL;
-
-  t->guards = guardSet_undefined;
-  t->aliases = aliasTable_undefined;
-
-    t->mustBreak = FALSE;
-  t->exitCode = XK_NEVERESCAPE;
-
-  return t;
-}
-
-/*
-** constructors
-*/
-
-static /*@only@*/ /*@notnull@*/ usymtab
-  usymtab_createRoot (void) /*@modifies nothing@*/
-{
-  usymtab u = (usymtab) dmalloc (sizeof (*u));
-  
-  u->nentries = 0;
-  u->nspace = CGLOBBASESIZE;
-  u->entries = (uentry *) dmalloc (sizeof (*u->entries) * CGLOBBASESIZE);
-  u->env = GLOBAL_ENV;
-  u->lexlevel = 0;
-  u->htable = hashTable_create (CGLOBHASHSIZE);
-  u->reftable = NULL;
-
-  u->guards = guardSet_new ();
-  u->aliases = aliasTable_new ();
-
-  u->mustBreak = FALSE;
-  u->exitCode = XK_NEVERESCAPE;
-  u->kind = US_NORMAL;
-
-  /*@i23@*/ return (u);
-}
-
-void
-usymtab_initMod (void)
-   /*@globals undef utab, undef oldtab, undef globtab, undef filetab @*/
-   /*@modifies utab, globtab, filetab, oldtab @*/
-{
-  utab = usymtab_createRoot ();
-  globtab = utab;
-  filetab = usymtab_undefined;
-  oldtab = usymtab_undefined;
-}
-
-/*
-** utab should be empty?  (requires?)
-**
-** Adds bool types to symbol table (these are built in for now)
-** Only do this is there is no library!
-*/
-
-void
-usymtab_initBool ()
-{
-  if (context_getFlag (FLG_NOLIB))
-    {
-      ctype boolt = ctype_bool;
-      /* evs 2000-07-24: bool is now treated as abstract (always) */
-
-      uentry boolentry = uentry_makeBoolDatatype (YES);
-      usymtab_supGlobalEntry (boolentry);
-      context_addBoolAccess ();
-
-      /*
-      ** We supply values 0 and 1 for the constants, so things like
-      ** while (TRUE) can be interpreted correctly.
-      */
-
-      usymtab_supGlobalEntry 
-	(uentry_makeConstantAux (context_getFalseName (), boolt, 
-				 fileloc_getBuiltin (), FALSE,
-				 multiVal_makeInt (0)));
-      usymtab_supGlobalEntry 
-	(uentry_makeConstantAux (context_getTrueName (), boolt, 
-				 fileloc_getBuiltin (), FALSE,
-				 multiVal_makeInt (1)));
-    }
-}
-
-/*
-** mutators 
-*/
-
-static void
-usymtab_grow (/*@notnull@*/ usymtab s)
-{
-  int i;
-  o_uentry *oldsyms = s->entries;
-
-  s->nspace = CBASESIZE;
-  s->entries = (uentry *) dmalloc (sizeof (*s->entries) 
-				   * (s->nentries + s->nspace));
-
-  for (i = 0; i < s->nentries; i++)
-    {
-      s->entries[i] = oldsyms[i];
-    }
-
-  sfree (oldsyms);
-
-  if (s->reftable != NULL)
-    {
-      refTable oldRefs = s->reftable;
-
-      s->reftable = (refentry *) dmalloc (sizeof (*s->reftable)
-					  * (s->nentries + CBASESIZE + 1));
-      
-      for (i = 0; i < s->nentries; i++)
-	{
-	  s->reftable[i] = oldRefs[i];
-	}
-
-      /*@-compdestroy@*/ 
-      sfree (oldRefs);
-      /*@=compdestroy@*/ 
-    }
-      
-}
-
-static void
-usymtab_addEntryQuiet (/*@notnull@*/ usymtab s, /*@keep@*/ uentry e)
-{
-  if (!(s->lexlevel > fileScope || !sRef_modInFunction ()))
-    {
-      if (uentry_isDatatype (e) 
-	  || uentry_isFunction (e)
-	  || uentry_isAnyTag (e)
-	  || uentry_isEnumConstant (e)
-	  || context_inMacro ())
-	{
-	  /* 
-	  ** Not a bug.  Code like,
-	  **    int f (void) { typedef int tint; ... }
-	  ** is legal.
-	  */
-	  
-	  /* was nothing here! */
-	  /*@i@*/ e->sref = sRef_saveCopy (e->sref);
-	}
-      else
-	{
-	  llparseerror 
-	    (cstring_makeLiteral ("Declaration outside function scope"));
-
-	  llcontbug (message ("usymtab_addEntryQuiet: inconsistent state "
-			      "(lexlevel = %d, modFunction = %s) adding: %q", 
-			      s->lexlevel, bool_unparse (sRef_modInFunction ()), 
-			      uentry_unparse (e)));
-	  sRef_setGlobalScope ();
-	  /* make sure the sRef is not bashed! */
-	  /*@i@*/ e->sref = sRef_saveCopy (e->sref);
-	}
-    }
-
-  if (s->nspace <= 0)
-    {
-      usymtab_grow (s);
-    }
-  
-  s->nspace--;
-  s->entries[s->nentries] = e;
-
-# ifdef DOANNOTS
-  if (s == globtab || s == filetab)
-    {
-      if (!fileloc_isLib (g_currentloc))
-	{
-	  uentry_tallyAnnots (e, AN_UNKNOWN);
-	}
-    }
-# endif
-
-  if (s->htable != NULL)
-    {
-      hashTable_insert (s->htable, uentry_rawName (e), s->nentries);
-    }
-
-  s->nentries++;
-}
-
-static /*@observer@*/ uentry /*@alt void@*/
-usymtab_addEntryBase (/*@notnull@*/ usymtab s, /*@only@*/ uentry e)
-{
-  /* 
-  ** In theory, we shouldn't need this test because it this is
-  ** only called when a library is being read, and it shouldn't
-  ** ever have a duplicate entry.  In practice, its safer to
-  ** leave it in, though.
-  */
-
-  uentry old;
-
-  if (uentry_isValid (old = usymtab_lookupQuiet (s, uentry_rawName (e))))
-    {
-      DPRINTF (("Duplicate entry: %s", uentry_unparse (e)));
-      uentry_free (e); /* duplicate */
-      return old;
-    }
-  else
-    {
-      int thisentry = s->nentries;  
-      
-      if (uentry_isVar (e))
-	{
-	  uentry_setSref (e, sRef_makeCvar (globScope, thisentry, 
-					    uentry_getType (e)));
-	}
-      
-      usymtab_addEntryQuiet (s, e);
-      return e;
-    }
-}
-
-static usymId
-usymtab_addEntryAux (/*@notnull@*/ usymtab st, /*@keep@*/ uentry e, bool isSref)
-     /*@globals globtab@*/
-     /*@modifies st, e@*/
-{
-  usymId thisentry = st->nentries;
-
-  llassert (!uentry_isElipsisMarker (e));
-
-  /*
-  ** not true for tags
-  **  llassert (usymtab_lookupSafe (uentry_rawName (e)) == uentry_undefined);
-  **/
-
-  llassertprint (uentry_isAnyTag (e) ? st == globtab : TRUE, 
-		 ("non-global tag: %s / %d", uentry_unparseFull (e), st->lexlevel));
-
-  if (st->lexlevel == fileScope 
-      && (!(uentry_isStatic (e)) || uentry_isAnyTag (e))) 
-    {
-      st = globtab;
-    }
-
-  if (isSref)
-    {
-      ctype ct = uentry_getType (e);
-
-      if (uentry_isFunction (e) && ctype_isFunction (ct))
-	{
-	  ct = ctype_returnValue (ct);
-	}
-
-      if (uentry_isStatic (e))
-	{
-	  sRef sr = sRef_makeCvar (st->lexlevel, thisentry, ct);
-
-	  if (sRef_isStack (sr) || sRef_isLocalState (sr))
-	    {
-	      sRef_setAliasKind (sr, AK_STATIC, uentry_whereLast (e));
-	      sRef_setDefined (sr, uentry_whereLast (e));
-	    }
-	  
-	  uentry_setSref (e, sr);
-	}
-      else
-	{
-	  uentry_setSref (e, sRef_makeCvar (st->lexlevel, thisentry, ct));
-	}
-
-          }
-
-  if (uentry_isDatatype (e))
-    {
-      
-      uentry_setDatatype (e, thisentry);
-    }
-
-  if (uentry_isFunction (e))
-    {
-      ctype ct = uentry_getType (e);
-
-      if (ctype_isFunction (ct)
-	  && uentryList_isMissingParams (ctype_argsFunction (ct)))
-	{
-	  if (uentry_isDeclared (e))
-	    {
-	      voptgenerror 
-		(FLG_NOPARAMS,
-		 message ("Function %q declared without parameter list",
-			  uentry_getName (e)),
-		 uentry_whereDeclared (e));
-	    }
-	  else
-	    {
-	      voptgenerror
-		(FLG_NOPARAMS,
-		 message ("Function %q specified without parameter list",
-			  uentry_getName (e)),
-		 uentry_whereSpecified (e));
-	    }
-	}
-    }
-
-  if (st == globtab && !uentry_isSpecified (e))
-    {
-      exprChecks_checkExport (e);
-    }
-  
-  
-  uentry_checkName (e);
-  
-  usymtab_addEntryQuiet (st, e);
-  return (thisentry);
-}
-
-usymId
-usymtab_addEntry (uentry e) 
-   /*@globals utab, globtab@*/
-   /*@modifies utab, e@*/
-{
-  
-  llassertprint (!usymtab_exists (uentry_rawName (e)),
-		 ("Entry already exists: %s", uentry_unparse (e)));
-
-  return usymtab_addEntryAux (utab, e, FALSE);
-}
-
-void
-usymtab_addGlobalEntry (uentry e)
-   /*@modifies globtab, e@*/ 
-{
-  DPRINTF (("Add global: %s / %s", uentry_unparse (e), bool_unparse (uentry_isForward (e))));
-
-  (void) usymtab_addEntryAux (globtab, e, FALSE);
-}
-
-/*
-** supercede and replace entry use elements of entries array, and
-** assign an element to a new value, and then free the old value.
-** Need -deparrays to avoid errors for this. 
-*/
-
-/*@-deparrays@*/ 
-
-static usymId
-usymtab_supEntryAux (/*@notnull@*/ usymtab st, 
-		     /*@only@*/ uentry e, bool isSref)
-   /*@globals globtab, filetab@*/
-   /*@modifies st, globtab, e@*/
-{
-  cstring ename = uentry_rawName (e);
-  bool staticEntry = FALSE;
-  int eindex;
-
-  /* static tags in global scope */
-  if (st->lexlevel == fileScope 
-      && (!(uentry_isStatic (e)) || uentry_isAnyTag (e))) 
-    {
-      eindex = usymtab_getIndex (st, ename);
-
-      if (eindex != NOT_FOUND)
-	{
-	  uentry ce = st->entries[eindex];      
-	  
-	  if (optgenerror
-	      (FLG_SHADOW,
-	       message ("%s %q shadows static declaration",
-			ekind_capName (uentry_getKind (e)),
-			uentry_getName (e)),
-	       uentry_whereDeclared (e)))
-	    {
-	      uentry_showWhereLast (ce);
-	    }
-
-	  if (eindex == st->nentries - 1)
-	    {
-	     ;
-	    }
-	  else
-	    {
-	      st->entries[eindex] = st->entries[st->nentries - 1];
-	    }
-
-	  if (st->htable != NULL)
-	    {
-	      hashTable_replaceKey (st->htable, uentry_rawName (ce), 
-				    uentry_rawName (e));
-	    }
-
-	  uentry_free (ce);
-	  st->nentries--;
-	}
-      
-      st = globtab;
-    }
-
-  if (uentry_isStatic (e)) {
-    if (uentry_isFunction (e)) {
-      /* Static function declarations are at the file level, even if they are in a deeped scope. */
-      st = usymtab_getFileTab ();
-      staticEntry = TRUE;
-    } else {
-      if (!uentry_isAnyTag (e) && st == globtab) 
-	{
-	  st = usymtab_getFileTab ();
-	  staticEntry = TRUE;
-	  DPRINTF (("Static entry!"));
-	}
-    }
-  }
-
-  DPRINTF (("Using symtab: %s", usymtab_unparseLocalAux (st)));
-
-  eindex = usymtab_getIndex (st, ename);
-      
-  if (eindex != NOT_FOUND)
-    {
-      uentry ce = st->entries[eindex];
-
-      DPRINTF (("Found entry: %s", uentry_unparse (ce)));
-
-      if (uentry_isPriv (ce)
-	  /* || (fileloc_isImport (uentry_whereSpecified (ce))) */
-	  || (uentry_isStatic (ce) 
-	      && uentry_isAnyTag (ce)
-	      && (uentry_isDeclared (ce) 
-		  && !fileloc_sameFile (uentry_whereDefined (ce),
-					uentry_whereDefined (e)))))
-	{
-	  /*
-          ** overload entry 
-	  **    if overloading import should do some checks!
-	  */
-
-	  llassert ((st->lexlevel > fileScope || !sRef_modInFunction ()));
-	  
-	  st->entries[eindex] = e;
-
-	  if (uentry_isDatatype (e))
-	    {
-	      uentry_setDatatype (e, eindex);
-	    }
-	  
-	  if (st == globtab && !uentry_isSpecified (e))
-	    {
-	      exprChecks_checkExport (e);
-	    }
-
-	  if (st->htable != NULL)
-	    {
-	      hashTable_replaceKey (st->htable, uentry_rawName (ce), 
-				    uentry_rawName (e));
-	    }
-
-	  uentry_free (ce);
-	  ce = e; 
-	}
-      else if (uentry_isSpecified (ce))
-	{
-	  if (uentry_isSpecified (e))
-	    {
-	      if (fileloc_isImport (uentry_whereSpecified (ce)))
-		{
-		  
-		  if (st->htable != NULL)
-		    {
-		      hashTable_replaceKey (st->htable, 
-					    uentry_rawName (ce), 
-					    uentry_rawName (e));
-		    }
-		  
-		  uentry_free (ce); 
-		  st->entries[eindex] = e;
-		  ce = e;
-
-		  if (uentry_isDatatype (e)) uentry_setDatatype (e, eindex);
-		}
-	      else 
-		{
-		  if (fileloc_isImport (uentry_whereSpecified (e)))
-		    {
-		      uentry_free (e);
-		    }
-		  else
-		    {
-		      /* respecification errors already reported */
-  
-		      if (uentry_isDatatype (e)) 
-			{
-			  uentry_setDatatype (e, eindex);
-			}
-		      
-		      if (st->htable != NULL)
-			{
-			  hashTable_replaceKey (st->htable, 
-						uentry_rawName (ce), 
-						uentry_rawName (e));
-			}
-		      
-		      llassert ((st->lexlevel > fileScope || !sRef_modInFunction ()));
-		      uentry_free (ce);
-		      st->entries[eindex] = e;
-		      ce = e;
-		    } 
-		}
-	    }
-	  else /* e not specified */
-	    {
-	      if (uentry_isDeclared (ce))
-		{
-		  llassert ((st->lexlevel > fileScope || !sRef_modInFunction ()));
-		  uentry_mergeDefinition (ce, e);
-		}
-	      else 
-		{
-		  llassert ((st->lexlevel > fileScope || !sRef_modInFunction ()));
-		  uentry_mergeEntries (ce, e);
-		}
-	    }
-	}
-      else /* ce not specified */
-	{
-	  if (!(st->lexlevel > fileScope || !sRef_modInFunction ()))
-	    {
-	      if (uentry_isDatatype (e) || uentry_isAnyTag (e)
-		  || uentry_isEnumConstant (e))
-		{
-		  ; /* 
-		     ** Not a bug.  Code like,
-		     **    int f (void) { typedef int tint; ... }
-		     ** is legal.
-		     */
-		}
-	      else
-		{
-		  llcontbug (message ("usymtab_supEntryAux: inconsistent state "
-				      "(lexlevel = %d, modFunction = %s) adding: %q", 
-				      st->lexlevel, bool_unparse (sRef_modInFunction ()), 
-				      uentry_unparse (e)));
-
-		  if (sRef_modInFunction ())
-		    {
-		      /* make sure the sRef is not bashed! */
-		      /*@i@*/ e->sref = sRef_saveCopy (e->sref);
-		    }
-		}
-	    }
-	  
-	  uentry_mergeDefinition (ce, e);
-	}
-      
-      if (isSref)
-	{
-	  ctype ct = uentry_getType (ce);
-	  
-	  if (uentry_isFunction (ce) && ctype_isFunction (ct))
-	    {
-	      ct = ctype_returnValue (ct);
-	    }
-	  
-	  uentry_setSref (ce, sRef_makeCvar (st->lexlevel, eindex, ct));
-	  	}
-    }
-  else /* no previous entry */
-    {
-      uentry outer;
-
-      if (st->lexlevel == globScope 
-	  && !uentry_isStatic (e)
-	  && !uentry_isExtern (e)
-	  && usymtab_isDefined (filetab))
-	{
-	  /*
-	  ** check if there is a static entry:  (i.e.,
-	  **   
-	  **    static int f ();
-	  **    ...
-	  **    int f (); 
-	  */
-	  
-	  eindex = usymtab_getIndex (filetab, ename);
-	  
-	  if (eindex != NOT_FOUND)
-	    {
-	      uentry ce = filetab->entries[eindex];
-
-	      uentry_setStatic (e);
-	      uentry_mergeDefinition (ce, e);
-	      staticEntry = TRUE;
-	      goto exitPoint;
-	    }
-	}
-      
-      outer = usymtab_lookupQuiet (st->env, ename);
-
-      /*
-      ** no previous definition, add the new one
-      */
-      
-      if (!noshadowerror 
-	  && uentry_isValid (outer)
-	  && !(uentry_isYield (e) || uentry_isYield (outer))
-	  && fileloc_isDefined (uentry_whereLast (e))
-	  && fileloc_isDefined (uentry_whereLast (outer)))
-	{
-	  if (!uentry_sameKind (outer, e))
-	    {
-	      ; /* no error */
-	    }
-	  else
-	    {
-	      if (ctype_isUnknown (uentry_getType (outer))
-		  || uentry_isForward (outer))
-		{
-		  ;
-		}
-	      else
-		{
-		  if (optgenerror 
-		      (FLG_SHADOW,
-		       message ("%s %q shadows outer declaration",
-				ekind_capName (uentry_getKind (e)),
-				uentry_getName (e)),
-		       uentry_whereLast (e)))
-		    {
-		      uentry_showWhereLast (outer);
-		    }
-		}
-	    }
-	}
-      
-      if (st == globtab && context_getFlag (FLG_NEWDECL))
-	{
-	  voptgenerror 
-	    (FLG_NEWDECL,
-	     message ("New declaration: %q", uentry_getName (e)),
-	     uentry_whereLast (e));
-	}
-
-      eindex = usymtab_addEntryAux (st, e, isSref);
-    }
-
- exitPoint:
-    return (staticEntry ? USYMIDINVALID : eindex);
-}
-
-# ifndef NOLCL
-static void
-usymtab_replaceEntryAux (/*@notnull@*/ usymtab st, /*@only@*/ uentry e)
-   /*@globals globtab@*/ /*@modifies st, e@*/
-{
-  cstring ename = uentry_rawName (e);
-  int eindex;
-
-  /* static tags in global scope */
-  eindex = usymtab_getIndex (st, ename);
-  
-  if (eindex != NOT_FOUND)
-    {
-      uentry ce = st->entries[eindex];      
-      
-      if (st->htable != NULL)
-	{
-	  hashTable_replaceKey (st->htable, uentry_rawName (ce), uentry_rawName (e));
-	}
-
-      uentry_free (ce);
-      st->entries[eindex] = e;
-    }
-  else
-    {
-      eindex = usymtab_addEntryAux (st, e, FALSE);
-    }
-}
-# endif
-
-/*@=deparrays@*/ 
-
-void usymtab_supEntry (uentry e)
-   /*@globals utab, filetab, globtab@*/
-   /*@modifies utab, globtab, e@*/
-{
-    (void) usymtab_supEntryAux (utab, e, FALSE);
-}
-
-/*
-** this should be lots more efficient!
-*/
-
-static /*@exposed@*/ uentry 
-  usymtab_supEntryReturnAux (/*@notnull@*/ usymtab tab, 
-			     /*@only@*/ uentry e, bool isref)
-  /*@globals globtab, filetab@*/
-  /*@modifies tab, globtab, e@*/
-{
-  cstring rawName = cstring_copy (uentry_rawName (e));
-  bool stat = (tab == globtab) && uentry_isStatic (e);
-  uentry ret;
-
-    
-  (void) usymtab_supEntryAux (tab, e, isref);
-
-  if (stat)
-    {
-      ret = usymtab_lookupAux (filetab, rawName);
-    }
-  else
-    {
-      ret = usymtab_lookupAux (tab, rawName);
-
-      if (uentry_isInvalid (ret) && usymtab_isDefined (filetab))
-	{
-	  ret = usymtab_lookupAux (filetab, rawName);
-	}
-    }
-  
-  cstring_free (rawName);
-  return ret;
-}
-
-/*@dependent@*/ /*@exposed@*/ uentry 
-  usymtab_supEntryReturn (/*@only@*/ uentry e)
-  /*@globals utab, filetab, globtab@*/
-  /*@modifies utab, globtab, e@*/
-{
-  return (usymtab_supEntryReturnAux (utab, e, FALSE));
-}
-
-/*@dependent@*/ /*@exposed@*/ uentry 
-  usymtab_supEntrySrefReturn (/*@only@*/ uentry e)
-  /*@globals utab, globtab, filetab@*/
-  /*@modifies utab, globtab, e@*/
-{
-  return (usymtab_supEntryReturnAux (utab, e, TRUE));
-}
-
-/*@dependent@*/ /*@exposed@*/ uentry 
-  usymtab_supGlobalEntryReturn (uentry e)
-  /*@globals globtab, filetab@*/
-  /*@modifies globtab, e@*/
-{
-  uentry ret;
-
-  ret = usymtab_supEntryReturnAux (globtab, e, FALSE);
-
-  if (sRef_modInFunction ())
-    {
-      recordFunctionType (ret);
-    }
-
-  return (ret);
-}
-
-ctype
-usymtab_supTypeEntry (/*@only@*/ uentry e)
-  /*@globals globtab, filetab@*/
-  /*@modifies globtab, e@*/
-{
-  usymId uid;
-  ctype ret;
-
-  if (uentry_isAbstractDatatype (e))
-    {
-      uid = usymtab_supAbstractTypeEntry (e, FALSE);
-      ret = ctype_createAbstract (uid);
-    }
-  else
-    {
-      uid = usymtab_supEntryAux (globtab, e, FALSE);
-      ret = ctype_createUser (uid);
-    }
-
-  if (sRef_modInFunction ())
-    {
-      recordFunctionType (globtab->entries[uid]);
-    }
-
-  return ret;
-}
-
-uentry
-usymtab_supReturnTypeEntry (/*@only@*/ uentry e)
-  /*@globals globtab, filetab@*/
-  /*@modifies globtab@*/
-{
-  usymId uid;
-  
-  if (uentry_isAbstractDatatype (e))
-    {
-      uid = usymtab_supAbstractTypeEntry (e, FALSE);
-    }
-  else
-    {
-      uid = usymtab_supEntryAux (globtab, e, FALSE);
-    }
-  
-  if (sRef_modInFunction ())
-    {
-      recordFunctionType (globtab->entries[uid]);
-    }
-
-    return (globtab->entries[uid]);
-}
-
-usymId
-usymtab_supAbstractTypeEntry (/*@only@*/ uentry e, bool dodef)
-  /*@globals globtab, filetab@*/
-  /*@modifies globtab, e@*/
-{
-  usymId uid;
-  uid = usymtab_supEntryAux (globtab, e, FALSE);
-
-  if (dodef)
-    {
-      uentry ue = usymtab_getTypeEntry (uid);
-      uentry_setDatatype (ue, uid);
-    }
-
-  if (context_getFlag (FLG_ACCESSMODULE))
-    {
-      context_addFileAccessType (uid);
-    }
-
-  if (sRef_modInFunction ())
-    {
-      recordFunctionType (globtab->entries[uid]);
-    }
-
-  return (uid);
-}
-
-# ifndef NOLCL
-usymId
-usymtab_supExposedTypeEntry (/*@only@*/ uentry e, bool dodef)
-  /*@globals globtab, filetab@*/
-  /*@modifies globtab, e@*/
-{
-  usymId uid;
-
-  uid = usymtab_supEntryAux (globtab, e, FALSE);
-
-  if (dodef)
-    {
-      uentry ue = usymtab_getTypeEntry (uid);
-
-      uentry_setDatatype (ue, uid);
-    }
-
-  if (sRef_modInFunction ())
-    {
-      recordFunctionType (globtab->entries[uid]);
-    }
-
-  return (uid);
-}
-# endif
-
-ctype
-usymtab_supForwardTypeEntry (/*@only@*/ uentry e)
-  /*@globals globtab, filetab@*/
-  /*@modifies globtab, e@*/
-{
-  usymId uid = usymtab_supEntryAux (globtab, e, FALSE);
-  uentry ue = usymtab_getTypeEntry (uid);
-
-    uentry_setDatatype (ue, uid);
-
-  if (sRef_modInFunction ())
-    {
-      recordFunctionType (globtab->entries[uid]);
-    }
-
-  return (uentry_getAbstractType (ue));
-}
-
-void
-  usymtab_supEntrySref (uentry e)
-  /*@globals utab, globtab, filetab@*/
-  /*@modifies utab, globtab, e@*/
-{
-  sRef old = uentry_getSref (e);
-
-  
-  if (sRef_isType (old))
-    {
-      uentry ue = usymtab_supEntryReturnAux (utab, e, TRUE);
-
-      /*@access uentry@*/
-      if (uentry_isValid (ue)) 
-	{
-	  sRef uref = uentry_getSref (ue);
-
-	  sRef_mergeStateQuiet (uref, old); 
-	  sRef_clearDerived (uref);
-	}
-      /*@noaccess uentry@*/
-    }
-  else if (sRef_isKnown (old))
-    {
-      usymtab_supEntry (e);
-    }
-  else
-    {
-      (void) usymtab_supEntryAux (utab, e, TRUE);
-    }
-}
-
-void usymtab_supGlobalEntry (/*@only@*/ uentry e)
-  /*@globals globtab, filetab@*/
-  /*@modifies globtab, filetab, e@*/
-{
-  usymId uid;
-
-  DPRINTF (("Sup global entry: %s", uentry_unparse (e)));
-
-  uid = usymtab_supEntryAux (globtab, e, FALSE);
-
-  if (sRef_modInFunction ())
-    {
-      recordFunctionType (globtab->entries[uid]);
-    }
-}
-
-uentry
-  usymtab_supReturnFileEntry (/*@only@*/ uentry e)
-  /*@globals filetab, globtab@*/
-  /*@modifies filetab, globtab, e@*/
-{
-  llassert (filetab != usymtab_undefined);
-  DPRINTF (("File entry: %s", uentry_unparse (e)));
-  return (usymtab_supEntryReturnAux (filetab, e, FALSE));
-}
-
-/*
-** observers
-*/
-
-bool
-usymtab_inDeepScope () /*@globals utab@*/
-{
-  return (utab->lexlevel > paramsScope);
-}
-
-static int
-usymtab_getIndex (/*@notnull@*/ usymtab s, cstring k)
-{
-  int i;
-
-  if (s->htable != NULL)
-    {
-      i = hashTable_lookup (s->htable, k);
-
-      return i;
-    }
-  else
-    {
-      for (i = 0; i < s->nentries; i++)
-	{
-	  uentry current = s->entries[i];
-
-	  if (!uentry_isUndefined (current) 
-	      && cstring_equal (uentry_rawName (current), k))
-	    {
-	      return i;
-	    }
-	}
-
-      return NOT_FOUND;
-    }
-}
-
-static uentry
-usymtab_fetchIndex (/*@notnull@*/ usymtab s, int i)
-{
-  llassert (i >= 0 && i < s->nentries);
-  return (s->entries[i]);
-}
-
-usymId
-usymtab_getTypeId (cstring k) /*@globals globtab@*/
-{
-  usymId uid = usymtab_getIndex (globtab, k);
-
-  if (uid == NOT_FOUND) return USYMIDINVALID;
-
-  if (!(uentry_isDatatype (usymtab_getTypeEntry (uid)))) {
-    return USYMIDINVALID;
-  }
-
-  return uid;
-}
-
-/*@dependent@*/ uentry
-usymtab_lookupStructTag (cstring k)
-{
-  cstring sname = makeStruct (k);
-  uentry ue = usymtab_lookupGlob (sname);
-    cstring_free (sname);
-  return (ue);
-}
-
-/*@dependent@*/ uentry
-usymtab_lookupUnionTag (cstring k)
-{
-  cstring uname = makeUnion (k);
-  uentry res = usymtab_lookupGlob (uname);
-
-  cstring_free (uname);
-  return res;
-}
-
-/*@dependent@*/ uentry
-usymtab_lookupEnumTag (cstring k)
-{
-  cstring ename = makeEnum (k);
-  uentry res = usymtab_lookupGlob (ename);
-
-  cstring_free (ename);
-  return res;
-}
-
-usymId
-usymtab_getId (cstring k) /*@globals globtab@*/
-{
-  usymId uid = usymtab_getIndex (globtab, k);
-  uentry ue;
-
-  if (uid == NOT_FOUND)
-    {
-      return USYMIDINVALID;
-    }
-
-  ue = usymtab_getGlobalEntry (uid);
-
-  if (uentry_isPriv (ue))
-    {
-      return USYMIDINVALID;
-    }
-
-  return uid;
-}
-
-static /*@exposed@*/ uentry 
-usymtab_getEntryAux (/*@notnull@*/ usymtab s, usymId uid)
-{
-  llassert (uid != USYMIDINVALID);
- 
-  if (uid < 0 || uid >= s->nentries)
-    {
-      llcontbug (message ("usymtab_getEntry: out of range: level = %d [%d]",
-			  s->lexlevel, uid));
-      return uentry_undefined;
-    }
-
-  llassertprint (uentry_isValid (s->entries[uid]),
-		 ("entry undefined: %d", uid));
-
-  return s->entries[uid];
-}
-
-/*@dependent@*/ /*@observer@*/ uentry 
-  usymtab_getGlobalEntry (usymId uid)
-  /*@globals utab, globtab@*/
-{
-  if (dbgfree) return (uentry_undefined);
-  
-  if (utab->lexlevel > paramsScope)
-    {
-      /* need to do this the awkward way, since it could be in conditional scope */
-     return (usymtab_lookupSafe (uentry_rawName (globtab->entries[uid])));
-    }
-  else
-    {
-      return (globtab->entries[uid]);
-    }
-}
-
-/*@dependent@*/ /*@exposed@*/ uentry 
-  usymtab_getTypeEntry (usymId uid)
-  /*@globals globtab@*/
-{
-  if (dbgload)
-    {
-      if (uid >= 0 && uid < globtab->nentries)
-	{
-	  return (globtab->entries[uid]);
-	}
-      else
-	{
-	  return (uentry_undefined);
-	}
-    }
-  else
-    {
-      llassert (uid >= 0 && uid < globtab->nentries);
-      
-      return (globtab->entries[uid]);
-    }
-}
-
-/*
-** in load files
-*/
-
-/*@dependent@*/ /*@exposed@*/ uentry 
-  usymtab_getTypeEntrySafe (usymId uid)
-  /*@globals globtab@*/
-{
-  if (uid < 0 || uid >= globtab->nentries)
-    {
-      return uentry_undefined;
-    }
-
-      return (globtab->entries[uid]);
-}
-
-bool
-  usymtab_isBoolType (usymId uid)
-  /*@globals globtab@*/
-{
-  llassert (uid >= 0 && uid < globtab->nentries);
-
-  return (cstring_equal (uentry_rawName (globtab->entries[uid]),
-			 context_getBoolName ()));
-}
- 
-cstring
-usymtab_getTypeEntryName (usymId uid)
-   /*@globals globtab@*/
-{
-  uentry ue;
-
-  if (dbgfree)
-    {
-      return (cstring_makeLiteral (""));
-    }
-
-  ue = usymtab_getTypeEntry (uid);
-
-  if (dbgload && !uentry_isValid (ue))
-    {
-      return (message ("", uid));
-    }
-
-  llassertprint (uentry_isValid (ue), ("type undefined: %d", uid));
-
-  return (uentry_getName (ue));
-}
-
-static void
-usymtab_rehash (/*@notnull@*/ usymtab s)
-{
-  int i;
-  
-  if (s->htable != NULL)
-    {
-      hashTable_free (s->htable);
-    }
-  
-  s->htable = hashTable_create (LLHASHSIZE);
-
-  for (i = 0; i < s->nentries; i++)
-    {
-      hashTable_insert (s->htable, uentry_rawName (s->entries[i]), i);
-    }
-}
-
-/*
-** superficial copy of usymtab
-**
-** DO copy spec entries 
-*/
-
-static /*@only@*/ /*@notnull@*/ usymtab
-usymtab_shallowCopy (/*@notnull@*/ usymtab s) /*@*/
-{
-  usymtab copytab = usymtab_createRoot ();
-  int i;
-
-  for (i = 0; i < s->nentries; i++)
-    {
-      usymtab_addEntryBase (copytab, s->entries[i]);
-    }
-
-  return copytab;
-}
-
-static void
-usymtab_shallowFree (/*@only@*/ /*@notnull@*/ usymtab s)
-{
-  aliasTable_free (s->aliases);
-  refTable_free (s->reftable, s->nentries);
-  sfree (s->entries);
-  /*@-compdestroy@*/ sfree (s); /*@=compdestroy@*/
-}
-
-/*
-** converts usymId from old table to sorted one
-*/
-
-usymId 
-  usymtab_convertId (usymId uid)
-  /*@globals oldtab, utab@*/
-{
-  uentry ue;
-  usymId ret;
-  cstring name;
-
-  llassert (usymtab_isDefined (oldtab));
-
-  ue = usymtab_getEntryAux (oldtab, uid);
-
-  llassertprint (uentry_isValid (ue), ("convertId: undefined: %d", uid));
-
-  name = uentry_rawName (ue);
-
-  ret = usymtab_getIndex (utab, name);
-
-  llassertprint (ret != USYMIDINVALID, ("convertId: return is invalid"));
-
-  return (ret);
-}
-
-void
-usymtab_prepareDump (void)
-   /*@globals oldtab, utab@*/
-   /*@modifies oldtab, utab@*/
-{
-  llassert (usymtab_inGlobalScope ());
-
-  llassert (oldtab == usymtab_undefined);
-
-  oldtab = usymtab_shallowCopy (utab);
-
-  /* 
-     alpha compare - make sure order is same on different platforms
-     error messages appear in same order 
-  */
-
-  qsort (utab->entries, (size_t)utab->nentries, 
-	 sizeof (*utab->entries), (int (*)(const void *, const void *)) uentry_xcomparealpha);
-
-  usymtab_rehash (utab);
-}
-
-void
-  usymtab_dump (FILE *fout)
-  /*@globals utab, oldtab@*/
-{
-  int i;
-  bool neednl = FALSE;
-  uentry lastentry = uentry_undefined;
-  ekind lastekind = KINVALID;
-  int linelen = 0;
-
-  /*
-  ** must call prepareDump first
-  */
-
-  llassert (oldtab != usymtab_undefined);
-
-  for (i = 0; i < utab->nentries; i++)
-    {
-      uentry thisentry = utab->entries[i];
-      ekind  thisekind = uentry_getKind (thisentry);
-
-      
-      if (uentry_hasRealName (thisentry)) {
-	if (thisekind != lastekind)
-	  {
-	    if (neednl)
-	      {
-		check (fputc ('\n', fout) == (int) '\n');
-	      }
-	    
-	    neednl = FALSE;
-	    lastentry = uentry_undefined;
-	    fprintf (fout, "*%d (%s)\n", ekind_toInt (thisekind),  
-		     cstring_toCharsSafe (ekind_capName (thisekind)));
-	    lastekind = thisekind;
-	    linelen = 0;
-	  }
-	
-	if (uentry_isInvalid (lastentry) || !uentry_equiv (lastentry, thisentry)
-	    || (linelen > (MAX_DUMP_LINE_LENGTH - (2 * MAX_NAME_LENGTH))))
-	  {
-	    cstring cdump = uentry_dump (thisentry);
-	    
-	    lastentry = thisentry;
-	    if (neednl)
-	      {
-		check (fputc ('\n', fout) == (int) '\n');
-		linelen = 0;
-	      }
-	    
-	    linelen += cstring_length (cdump);
-	    
-	    /* no new line here! */
-	    if (cstring_length (cdump) > 0) 
-	      {
-		check (fputs (cstring_toCharsSafe (cdump), fout) != EOF);
-	      }
-	    
-	    cstring_free (cdump);
-	    neednl = TRUE;
-	  }
-	else
-	  {
-	    cstring cdump = uentry_rawName (thisentry);
-	    	    linelen += cstring_length (cdump);
-	    fprintf (fout, "#%s", cstring_toCharsSafe (cdump));
-	  }
-      }
-    }
-
-  if (neednl)
-    {
-      check (fputc ('\n', fout) == (int) '\n');
-    }
-}
-
-void usymtab_load (FILE *f)
-  /*@globals utab, globtab@*/
-  /*@modifies utab, *f@*/
-{
-  char *s = mstring_create (MAX_DUMP_LINE_LENGTH);
-  char *os = s;
-  ekind kind = KINVALID;
-  fileloc loc = g_currentloc;
-  char c;
-  uentry ue;
-
-  dbgload = TRUE;
-
-  llassert (utab == globtab);
-  llassert (utab->nentries == 0);
-
-  while (fgets (s, MAX_DUMP_LINE_LENGTH, f) != NULL 
-	 && *s == ';')
-    {
-      ; /* ignore ;-comments */
-    }
-
-  while (s != NULL && *s != ';')
-    {
-      
-      if (*s == '*')
-	{
-	  s++;
-	  kind = ekind_fromInt (getInt (&s));
-
-	  	  goto nextiter;
-	}
-
-      if (*s == '$')
-	{
-	  llfatalerror
-	    (cstring_makeLiteral 
-	     ("Library is in obsolete format.  Use lclint +whichlib "
-	      "to see which library is being loaded."));
-	}
-
-      ue = uentry_undump (kind, loc, &s);
-      DPRINTF (("Load: %s", uentry_unparseFull (ue)));
-
-      if (uentry_isValid (ue))
-	{	
-	  ue = usymtab_addEntryBase (utab, ue);
-	  /*@-branchstate@*/ 
-	} 
-      /*@=branchstate@*/
-
-      /*
-      ** now, any other names are the same uentry
-      */
-
-      while (*(s++) == '#')
-	{
-	  cstring name = cstring_fromCharsO (getWord (&s));
-	  uentry nue = uentry_nameCopy (name, ue);
-
-	  DPRINTF (("Name copy: %s", uentry_unparseFull (nue)));
-	  usymtab_addEntryBase (utab, nue);
-	}
-
-      while ((c = *s) != '\0' && (c !='\n'))
-	{
-	  if (c != ' ' || c != '\t') 
-	    {
-	      llbuglit ("Junk in load file");
-	    }
-
-	  s++;
-	}
-
-    nextiter:
-      s = fgets (os, MAX_DUMP_LINE_LENGTH, f);
-    }
-
-  dbgload = FALSE;
-  sfree (os);
-}
-
-/*
-** file scope for static variables
-*/
-
-void
-usymtab_enterFile ()
-  /*@globals utab, globtab, filetab@*/
-  /*@modifies filetab@*/
-{
-  llassert (utab == globtab);
-
-  # if 0
-  /* check globals */
-  
-  usymtab_entries (globtab, ue)
-    {
-      if (sRef_hasDerived (uentry_getSref (ue)))
-	{
-	  fprintf (g_msgstream, "Derived Global: %s\n", uentry_unparse (ue));
-	  fprintf (g_msgstream, "sRef: %s\n", sRef_unparseFull (ue->sref));
-	}
-    } end_usymtab_entries ;
-
-  # endif
-
-  usymtab_enterScope ();
-  filetab = utab;
-}
-
-void
-usymtab_exitFile ()
-   /*@globals utab, filetab@*/
-   /*@modifies filetab, utab@*/
-{
-  
-  llassert (utab->lexlevel == 1);
-
-  usymtab_exitScope (exprNode_undefined);
-  filetab = NULL;
-}
-
-void
-usymtab_enterScope ()
-  /*@globals utab, globtab, filetab@*/
-  /*@modifies utab@*/
-{
-  usymtab t = usymtab_create (US_NORMAL, utab, TRUE);
-    	  
-  /* unconditional scope: optimize to avoid copy */
-  t->aliases = aliasTable_copy (utab->aliases); 
-  utab = t;
-  
-  llassert (usymtab_isDefined (t->env));
-  
-  if (t->env->lexlevel == paramsScope && context_inFunctionLike ())
-    {
-      noshadowerror = TRUE;
-      usymtab_handleParams ();
-      noshadowerror = FALSE;
-    }
-}
-
-/*
-** setup external references:
-**    o only, unique params alias external args
-**    o other params may alias anything of their type
-*/
- 
-static void
-usymtab_handleParams (void)
-  /*@globals utab, globtab, filetab@*/
-  /*@modifies utab, globtab@*/
-{
-  usymtab ptab = utab->env;
-  uentry fcn = context_getHeader ();
-
-  
-  usymtab_entries (ptab, param)
-    {
-      uentry ue;
-
-      if (!uentry_isYield (param))
-	{
-	  sRef uref;
-	  sRef pref = uentry_getSref (param);
-	  
-	  llassertprint (uentry_isAnyParam (param), 
-			 ("not param: %s", 
-			  uentry_unparseFull (param)));
-	  
-	  
-	  ue = uentry_makeVariable (fixParamName (uentry_rawName (param)),
-				    uentry_getType (param),
-				    fileloc_copy (uentry_whereDeclared (param)),
-				    FALSE);
-
-	  uentry_copyState (ue, param);
-	  uentry_setRefParam (ue);
-	  
-	  ue = usymtab_supEntrySrefReturn (ue);
-	  	  
-	  /* must be after supercede! */
-	  
-	  if (!sRef_stateKnown (pref))
-	    {
-	      uentry_setDefState (ue, SS_DEFINED);
-	      uentry_setDefState (param, SS_DEFINED);
-	    }
-	  else
-	    {
-	      if (sRef_isStateSpecial (pref))
-		{
-		  uentry_setDefState (ue, SS_ALLOCATED);
-		}
-	      else
-		{
-		  uentry_setDefState (ue, sRef_getDefState (pref));
-		}
-	    }
-
-	  uref = uentry_getSref (ue);
-	  
-	  if (sRef_isStack (uref))
-	    {
-	      alkind pkind = sRef_getAliasKind (pref);
-
-	      if (alkind_isKnown (pkind) && !alkind_isLocal (pkind)
-		  && !alkind_isStack (pkind))
-		{
-		  sRef_setAliasKind (uref, pkind, fileloc_undefined);
-		  sRef_setOrigAliasKind (uref, pkind);
-		}
-	      else
-		{
-		  sRef_setAliasKind (uref, AK_IMPTEMP, fileloc_undefined);
-		  sRef_setOrigAliasKind (uref, AK_IMPTEMP);
-
-		  if (uentry_isOut (param))
-		    {
-		      ;
-		    }
-		  else
-		    {
-		      sRef_setDefined (uref, fileloc_undefined);
-		    }
-		}
-
-	      	    }
-
-	  	  usymtab_addMustAlias (uref, pref);   
-
-	  if (!(uentry_isOnly (param) || uentry_isUnique (param)))
-	    {
-	      sRef s = sRef_makeExternal (uref);
-
-	      	      usymtab_addMustAlias (uref, s);   
-	    }
-	  
-	  if (sRef_isKillRef (pref))
-	    {
-	      sRef_setAliasKind (uref, AK_NEWREF, fileloc_undefined);
-	      sRef_setOrigAliasKind (uref, AK_KILLREF);
-	    }
-	  else if (sRef_isRefCounted (uref))
-	    {
-	      sRef_setOrigAliasKind (uref, AK_REFCOUNTED);
-	    }
-	  else
-	    {
-	      /* was AK_UNIQUE */
-	      sRef_setOrigAliasKind (uref, AK_LOCAL);
-	    }
-	}
-      else
-	{
-	  	}
-    } end_usymtab_entries;
-
-
-  if (uentry_hasSpecialClauses (fcn))
-    {
-      specialClauses clauses = uentry_getSpecialClauses (fcn);
-
-      specialClauses_preElements (clauses, cl)
-	{
-	  sRefSet refs = specialClause_getRefs (cl);
-	  sRefMod modf = specialClause_getEntryFunction (cl);
-
-	  
-	  sRefSet_elements (refs, el)
-	    {
-	      sRef base = sRef_getRootBase (el);
-	      
-	      if (sRef_isResult (base))
-		{
-		  ; /* nothing to do before */
-		}
-	      else if (sRef_isParam (base))
-		{
-		  if (modf != NULL)
-		    {
-		      sRef sb = sRef_updateSref (el);
-		      sRefSet aliases = usymtab_allAliases (sb);
-		      
-		      		      modf (sb, fileloc_undefined);
-		      		      
-		      sRefSet_elements (aliases, sr)
-			{
-			  			  modf (sr, fileloc_undefined);
-			  			} end_sRefSet_elements ;
-
-		      sRefSet_free (aliases);
-		    }
-		}
-	      else
-		{
-		  if (sRef_isValid (base))
-		    {
-		      BADBRANCH;
-		    }
-		}
-	    } end_sRefSet_elements ; 	  
-	} end_specialClauses_preElements ;
-    }
-  }
-  
-void
-usymtab_enterFunctionScope (uentry fcn)
-  /*@globals utab, filetab, globtab@*/
-  /*@modifies utab@*/
-{
-  usymtab t = usymtab_create (US_NORMAL, utab, TRUE);
-
-  if (utab->lexlevel != fileScope)
-    {
-      if (utab->lexlevel > fileScope)
-	{
-	  llparseerror (cstring_makeLiteral ("New function scope inside function."));
-	  
-	  while (utab->lexlevel > fileScope)
-	    {
-	      /*@i@*/ utab = usymtab_dropEnv (utab);
-              /*@-branchstate@*/
-            }
-	  /*@=branchstate@*/
-	}
-      else
-	{
-	  llfatalbug (cstring_makeLiteral ("New function not inside file."));
-	}
-    /*@-branchstate@*/ } /*@=branchstate@*/
-
-  globSet_allElements (uentry_getGlobs (fcn), el)
-    {
-      
-      if (sRef_isUndefGlob (el))
-	{
-	  int index = sRef_getScopeIndex (el);
-	  sRef sr = sRef_updateSref (el);
-	  fileloc loc = uentry_whereEarliest (fcn);
-	  
-	  if (sRef_isFileStatic (el))
-	    {
-	      ctype ct = sRef_getType (el);
-	      uentry ue;
-	      
-	      llassert (usymtab_isDefined (filetab));
-
-	      ue = usymtab_fetchIndex (filetab, index);
-	      
-	      if (ctype_isRealArray (ct) || ctype_isRealSU (ct))
-		{
-		  sRef_setAllocated (sr, loc);
-		}
-	      else
-		{
-		  sRef_setUndefined (sr, loc);
-		}
-	    }
-	  else
-	    {
-	      uentry ue = globtab->entries[index];
-	      ctype ct = uentry_getType (ue);
-	      
-	      if (ctype_isArray (ct) || ctype_isSU (ct))
-		{
-		  sRef_setAllocated (sr, loc);
-		}
-	      else
-		{
-		  sRef_setUndefined (sr, loc);
-		}
-	    }
-	}
-      else if (sRef_isAllocated (el))
-	{
-	  sRef sr = sRef_updateSref (el);
-	  fileloc loc = uentry_whereEarliest (fcn);
-	  
-	  sRef_setAllocated (sr, loc);
-	}
-      else if (sRef_isPartial (el))
-	{
-	  sRef sr = sRef_updateSref (el);
-	  fileloc loc = uentry_whereEarliest (fcn);
-
-	  sRef_setPartial (sr, loc);
-	}
-      else
-	{
-	  /* defined */ ;
-	}
-    } end_globSet_allElements;
-
-  utab = t;
-}
-
-static void
-usymtab_caseBranch (void)
-  /*@modifies utab@*/
-{
-  usymtab t = usymtab_create (US_CBRANCH, utab, FALSE);
-  utab = t;
-}
-
-void
-usymtab_switchBranch (/*@unused@*/ exprNode s)
-  /*@modifies utab@*/
-{
-  usymtab t = usymtab_create (US_SWITCH, utab, FALSE);
-
-  t->aliases = aliasTable_copy (utab->aliases);
-    utab = t;
-}
-
-void
-usymtab_trueBranch (/*@only@*/ guardSet guards)
-  /*@modifies utab@*/
-{
-  usymtab t = usymtab_create (US_TBRANCH, utab, FALSE);
-
-  /*
-  ** not true! (could be in a macro)
-  **
-  ** llassertprint (utab->lexlevel > paramsScope,
-  ** ("not in scope: %s", usymtab_unparseLocal ()));
-  **
-  */
-
-  guardSet_free (t->guards);
-  t->guards = guards;
-
-    aliasTable_free (t->aliases);
-  t->aliases = aliasTable_copy (utab->aliases);
-  
-    utab = t;
-}
-
-/*
-** consider,
-** 
-**   { int a; if (...) a = 3; < a may be undefined here!
-**
-*/
-
-void
-usymtab_popTrueBranch (exprNode pred, exprNode expr, clause cl)
-{
-  /*
-  ** add a false branch
-  ** (could be done more efficiently as a special case, but
-  ** it is better to only maintain one version of the code)
-  */
-
-  usymtab_altBranch (guardSet_invert (exprNode_getGuards (pred)));
-  usymtab_popBranches (pred, expr, exprNode_undefined, TRUE, cl);
-}
-
-void
-usymtab_popCaseBranch () /*@modifies utab@*/
-{
-  llassert (utab->kind == US_CBRANCH);
-  usymtab_quietPlainExitScope ();
-}
-
-void
-usymtab_popTrueExecBranch (exprNode pred, exprNode expr, clause cl)
-{
-  /*
-  ** add a false branch that must return --- that is,
-  ** the true branch is always executed!
-  */
-  
-  usymtab_altBranch (guardSet_invert (exprNode_getGuards (pred)));
-  usymtab_popBranches (pred, expr, exprNode_makeMustExit (), FALSE, cl);
-}
-
-void
-usymtab_popOrBranch (exprNode pred, exprNode expr)
-  /*@modifies utab@*/
-{
-  bool mustReturn;
-  usymtab env = utab->env;
-  usymtab otab = utab;
-  int i = 0;
-
-  llassert (env != NULL);
-
-  if (exprNode_isError (expr))
-    {
-      mustReturn = FALSE;
-    }
-  else
-    {
-      mustReturn = exprNode_mustEscape (expr);
-    }
-
-  
-  llassert (utab->kind == US_TBRANCH);
-
-  /*
-  ** merge each entry in table with its original
-  ** unless execution cannot continue after this branch
-  */
-
-  for (i = 0; i < utab->nentries; i++)
-    {
-      uentry current = utab->entries[i];
-      uentry old = usymtab_lookupAux (env, uentry_rawName (current));
-
-      uentry_mergeState (old, current, exprNode_loc (expr), 
-			 mustReturn, FALSE, TRUE, ORCLAUSE);
-    }
-  
-  
-  if (mustReturn)
-    {
-      env->guards = guardSet_levelUnionFree (env->guards, 
-					     guardSet_invert (exprNode_getGuards (pred)), 
-					     env->lexlevel);
-    }
-  else
-    {
-      env->aliases = aliasTable_levelUnion (env->aliases, otab->aliases, env->lexlevel);
-    }
- 
-  /* env is now utab */
-  usymtab_quietPlainExitScope ();
-}
-
-/*
-** case syntax in C is very unrestricted.  This is unfortunate.
-**
-** A switch case is ended either by a new case or default, or
-** a close } that may close the switch or some other control
-** structure.  
-*/
-
-bool
-usymtab_newCase (/*@unused@*/ exprNode pred, exprNode last)
-  /*@modifies utab@*/
-{
-  bool mustBreak = usymtab_mustBreak (utab);
-  bool mustReturn = usymtab_mustEscape (utab);
-  usymtab stab = utab;
-
-  /*
-  ** Find last case (or outer switch)
-  */
-
-  while (stab->kind != US_CBRANCH && stab->kind != US_SWITCH)
-    {
-      stab = stab->env;
-      llassert (stab != GLOBAL_ENV);
-    }
-
-  /* ??? */
-
-  while (stab->kind == US_CBRANCH)
-    {
-      stab = stab->env;
-      llassert (stab != GLOBAL_ENV);
-    }
-  
-  /*
-  ** if its a fall through case, merge in outside entries and last case.
-  **
-  ** e.g.,
-  **        ...
-  **        switch
-  **          case 1: x = 3; 
-  **          case 2: << x may not be defined
-  **
-  */
-
-  if (!mustBreak && !mustReturn && utab->kind == US_CBRANCH)
-    {
-      llassert (stab->kind == US_SWITCH || stab->kind == US_NORMAL);
-
-      usymtab_entries (utab, ue)  /* but, keep track of used variables */
-	{
-	  uentry old = usymtab_lookupAux (stab, uentry_rawName (ue));
-
-	  llassert (uentry_isValid (old));
-
-	  /* modifies ue, not old */
-	  
-	  uentry_mergeState (ue, old, exprNode_loc (last),
-			     FALSE, FALSE, TRUE, CASECLAUSE); 
-	} end_usymtab_entries;
-
-      utab->aliases = aliasTable_levelUnion (utab->aliases, 
-					     stab->aliases, utab->lexlevel);
-      
-      /* 
-      ** No need for a new branch.
-      */
-      
-      return FALSE;
-    }
-  else
-    {
-      usymtab_caseBranch ();
-      /*@-mustfree@*/ /*< utab->aliases >*/
-      utab->aliases = aliasTable_copy (stab->aliases);
-      /*@=mustfree@*/
-      
-      return TRUE;
-    }
-}
-
-/*
-** for && (both pred and expr are executed)
-*/
-
-void
-usymtab_popAndBranch (exprNode pred, /*@unused@*/ exprNode expr)
-  /*@modifies utab@*/
-{
-  usymtab env = utab->env;
-  usymtab otab= utab;
-  int i = 0;
-
-    llassert (utab->kind == US_TBRANCH);
-
-  /*
-  ** merge each entry in table with its original
-  ** unless execution cannot continue after this branch
-  */
-
-  for (i = 0; i < utab->nentries; i++)
-    {
-      uentry current = utab->entries[i];
-      sRef   tref = uentry_getSref (current);
-      uentry old = usymtab_lookupAux (env, uentry_rawName (current));
-      sRef   oref = uentry_getSref (old);
-
-      /* note that is current is in a nested branch,
-	 it may create a "new" old entry. */
-
-      llassert (uentry_isValid (old));
-      uentry_mergeState (old, current, exprNode_loc (expr), 
-			 FALSE, FALSE, TRUE, ANDCLAUSE);
-
-      /*
-      ** if is it defined by the second clause, then it should be defined.
-      */
-
-      if (sRef_isAnyDefined (tref)
-	  && (sRef_isAllocated (oref) || sRef_isStateUndefined (oref)))
-	{
-	  sRef_setDefined (oref, g_currentloc);
-	}
-    }
-
-  utab->guards = guardSet_levelUnionFree (utab->guards, 
-					  guardSet_invert (exprNode_getGuards (pred)), 
-					  utab->lexlevel);
-  utab->aliases = aliasTable_levelUnion (utab->aliases, otab->aliases, utab->lexlevel);
-
-  usymtab_quietPlainExitScope ();
-
-  }
-
-/*
-** Stack should be [ US_CBRANCH+ US_SWITCH ]
-** Only branches which do not return (except possibly the last branch) are included.
-**
-** Conditionally merge state from all CBRANCHes.
-**
-** If allpaths is TRUE, then all possible executions go through some switch 
-** case, and the original scope is not merged.
-*/
-
-void
-usymtab_exitSwitch (/*@unused@*/ exprNode sw, bool allpaths)
-  /*@modifies utab@*/
-{
-  usymtab ttab = utab;
-  usymtab stab = ttab;
-  usymtab ltab = ttab;
-  bool lastMustReturn = usymtab_mustEscape (utab);
-  int i;
-  
-    
-  while (stab->kind == US_CBRANCH)
-    {
-      stab = stab->env;
-      llassert (stab != GLOBAL_ENV);
-    }
-
-  while (stab->kind == US_NORMAL)
-    {
-      stab = stab->env;
-      llassert (stab != GLOBAL_ENV);
-    }
-
-  llassert (stab->kind == US_SWITCH);
-
-  /* go to the scope outside the switch (US_SWITCH is just a marker! */
-  stab = stab->env; 
-  llassert (stab != GLOBAL_ENV);
-
-  
-  ttab = ttab->env;
-  llassert (usymtab_isDefined (ttab));
-  
-  if (ttab->kind == US_CBRANCH)
-    {
-      /* was quietPlainExitScope --- but, can't free it yet! */
-      utab = utab->env;
-      llassert (utab != GLOBAL_ENV);
-
-      while (ttab->kind == US_CBRANCH)
-	{
-	  /*
-	  ** (from popTrueBranch)
-	  */	  
-	  
-	  bool mustReturn = usymtab_mustEscape (ttab);
-	  bool mustBreak = usymtab_mustBreak (ttab);
-	  
-	  usymtab_entries (ttab, current)
-	    {
-	      uentry old = /*@-compmempass@*/ usymtab_lookupAux (ltab, uentry_rawName (current));
-       	                   /*@=compmempass@*/ 
-	      
-	      /*
-	      ** note that is this is in a nested branch,
-	      ** it may create a "new" old entry. 
-	      */
-	   
-	      if (uentry_isValid (old))
-		{
-		  if (lastMustReturn)
-		    {
-		      uentry_mergeUses (current, old);
-		      uentry_setState (old, current);
-		    }
-		  else
-		    {
-		      uentry_mergeState (old, current, exprNode_loc (sw),
-					 mustReturn, FALSE, TRUE, SWITCHCLAUSE);
-		    }
-		}
-	      else
-		{
-		  ;
-		}
-	    } end_usymtab_entries;
-	  
-	  /*
-	  ** if entry is not in symbol table for this case, merge with pre-switch
-	  ** table
-	  */
-	  
-	  if (!mustReturn && !mustBreak)
-	    {
-	      usymtab_entries (stab, current)
-		{
-		  if (usymtab_getIndex (ttab, uentry_rawName (current)) == NOT_FOUND)
-		    {
-		      uentry old = /*@-compmempass@*/
-			usymtab_lookupAux (ltab, uentry_rawName (current));
-		      /*@=compmempass@*/
-
-		      llassert (uentry_isValid (old));
-		      uentry_mergeState (old, current, exprNode_loc (sw),
-					 FALSE, FALSE, TRUE, SWITCHCLAUSE);
-		    }
-		} end_usymtab_entries;
-	    }
-	  
-	  ltab->env = ttab->env; 
-	  ttab = ltab->env;
-
-	  /*
-	  ** Suprious error, becuase of environments.
-	  */
-
-	  /*@i1@*/ utab = ltab;
-
-	  lastMustReturn = FALSE;
-	  /*@-branchstate@*/ 
-	}
-    }
-  /*@=branchstate@*/
-
-  /*
-  ** now, there is one US_CBRANCH.  Merge this with the stab.
-  */
-  
-    
-  for (i = 0; i < ltab->nentries; i++)
-    {
-      uentry current = ltab->entries[i];
-      uentry old = usymtab_lookupAux (stab, uentry_rawName (current));
-      
-      /* note that is this is in a nested branch,
-	 it may create a "new" old entry. */
-      
-         
-      if (uentry_isValid (old))
-	{
-	  if (allpaths)
-	    {
-	      uentry_mergeUses (current, old);
-	      uentry_setState (old, current);
-	    }
-	  else
-	    {
-	      uentry_mergeState (old, current, exprNode_loc (sw), 
-				 FALSE, FALSE, TRUE, SWITCHCLAUSE);
-	    }
-	}
-      else
-	{
-	  	}
-    }
-  
-  /*
-  ** exit the switch
-  */
-  
-  
-  /*
-  ** switch may or may not be followed by a new scope
-  */
-
-  if (utab->kind == US_SWITCH)
-    {
-      usymtab_quietPlainExitScope ();  
-    }
-  else
-    {
-      usymtab_quietPlainExitScope ();
-      llassert (utab->kind == US_SWITCH);
-      usymtab_quietPlainExitScope ();   
-    }
-
-  }
-
-static void 
-updateNullState (sRef el, /*@notnull@*/ usymtab ttab, 
-		 /*@notnull@*/ usymtab ftab, bool trueGuard)
-{
-  sRef base = sRef_getRootBase (el);
-  int level = sRef_lexLevel (base);
-  
-        
-    
-  if (sRef_isCvar (base))
-    {
-      usymId index = sRef_getScopeIndex (base);
-      uentry ue = usymtab_getRefTab (ttab, level, index);
-
-      if (!uentry_isLset (ue)) 
-	{
-	  sRef sr = uentry_getSref (ue);
-
-	  if (trueGuard)
-	    {
-	      sRef_setDerivNullState (sr, el, NS_NOTNULL);
-	    }
-	  else 
-	    {
-	      if (!guardSet_isGuarded (ttab->guards, el) 
-		  && !sRef_isNotNull (sr))
-		{
-		  sRef_setDerivNullState (sr, el, NS_DEFNULL);
-		  		}
-	    }
-	}
-      else
-	{
-	  	}
-      
-      ue = usymtab_getRefTab (ftab, level, index);
-      
-      if (!uentry_isLset (ue)) 
-	{
-	  sRef sr = uentry_getSref (ue);
-	  
-	  
-	  if (!trueGuard) /* yikes!  forgot the ! */
-	    {
-	      sRef_setDerivNullState (sr, el, NS_NOTNULL);
-	    }
-	  else 
-	    {
-	      
-	      if (!guardSet_isGuarded (ftab->guards, el)
-		  && !sRef_isNotNull (sr))
-		{
-		  sRef_setDerivNullState (sr, el, NS_DEFNULL);
-		  		}
-	    }
-	}
-      else
-	{
-	  	}
-      
-          }
-
-      }
-
-void
-usymtab_popBranches (exprNode pred, exprNode tbranch, exprNode fbranch, 
-		     bool isOpt, clause cl)
-     /*@modifies utab@*/
-{
-  int i = 0;
-  usymtab ftab = utab;
-  usymtab ttab = utab->env;
-
-  fileloc loc;
-  usymtab env;
-  guardSet guards = exprNode_getGuards (pred);
-  sRefSet tguards = guardSet_getTrueGuards (guards);
-  sRefSet fguards = guardSet_getFalseGuards (guards);
-  bool mustReturnT = exprNode_mustEscape (tbranch);
-  bool mustReturnF = exprNode_mustEscape (fbranch);
-  
-  if (exprNode_isDefined (fbranch))
-    {
-      loc = exprNode_loc (fbranch);
-    }
-  else
-    {
-      loc = exprNode_loc (tbranch);
-    }
-
-  llassert (usymtab_isDefined (ttab));
-  
-  env = ttab->env;
-  
-  llassert (usymtab_isDefined (env));
-  llassert (ftab->kind == US_FBRANCH);
-  llassert (ttab->kind == US_TBRANCH);
-
-  /*
-  ** For each element that is true guarded (i.e., if (x != NULL)) 
-  **          make x = null in false branch,
-  **          and x = notnull in true branch.
-  **          unless x was set locally in that branch.
-  ** For each element that is false guarded (x == NULL) 
-  **          make x = null in true, notnull in false.
-  **                      
-  ** For each element that is either guarded (pred(x)) 
-  **     
-  */
-  
-  sRefSet_allElements (tguards, el)
-    {
-      updateNullState (el, ttab, ftab, TRUE);
-    } end_sRefSet_allElements;
-    
-  sRefSet_allElements (fguards, el)
-    {
-      updateNullState (el, ttab, ftab, FALSE);
-    } end_sRefSet_allElements;
-
-  /*
-  ** 
-  ** if an entry is in both true and false, merge the entries,
-  ** then replace original with new state.
-  **
-  ** if an entry is in one table, merge it with the original.
-  */
-    
-  for (i = 0; i < ftab->nentries; i++)
-    {
-      uentry fthis = ftab->entries[i];
-      uentry old = usymtab_lookupAux (env, uentry_rawName (fthis));
-      int    tindex = usymtab_getIndex (ttab, uentry_rawName (fthis));
-      
-      if (uentry_isUndefined (old))
-	{
-	  /* possible entry was added as an undefined id */
-	  continue;
-	}
-      
-      if (tindex != NOT_FOUND)
-	{
-	  uentry tthis = ttab->entries[tindex];
-	  
-	  /* note that is this is in a nested branch,
-	     it may create a "new" old entry. */
-	  
-	  if (!mustReturnF)
-	    {
-	      if (!mustReturnT)
-		{
-		  
-		  uentry_mergeState (fthis, tthis, loc,
-				     mustReturnT, FALSE, FALSE, cl);
-		}
-	      else
-		{
-		  uentry_mergeUses (fthis, tthis);
-		}
-	      
-	      uentry_setState (old, fthis);
-	      
-	      /*@-mustfree@*/ 
-	    } 
-	  /*@=mustfree@*/
-	  else
-	    {
-	      uentry_setState (old, tthis);
-	      uentry_mergeState (old, fthis, loc, mustReturnF, 
-				 TRUE, FALSE, cl);
-	    }
-	  
-	  ttab->entries[tindex] = uentry_undefined;
-	  uentry_free (tthis);
-	}
-      else
-	{
-	  uentry_mergeState (old, fthis, loc, mustReturnF, TRUE, FALSE, cl);
-	}
-    }
-
-  for (i = 0; i < ttab->nentries; i++)
-    {
-      uentry current = ttab->entries[i];
-      
-      if (!uentry_isUndefined (current)) 
-	{
-	  uentry old = usymtab_lookupAux (env, uentry_rawName (current));
-
-	  llassertprint (!uentry_isUndefined (old), ("name: <%s>", 
-						     uentry_rawName (current)));
-	  if (mustReturnF)
-	    {
-	      uentry_mergeUses (current, old); 
-	      uentry_setState (old, current);
-	    }
-	  else
-	    {
-	      /*
-              ** assumes false branch is a fall-through if
-              ** fbranch is not defined.  This is true, unless
-              ** where was some greivous error in processing
-              ** the else branch of an if-then, in which case
-              ** this is probably the right thing to do anyway.
-              */
-
-	      uentry_mergeState (old, current, loc, mustReturnT, 
-				 FALSE, isOpt, cl);
-	    }
-	}
-    }
-
-  
-  /*
-  ** Plain levelUnion doesn't work, since we need to use the sRef's in env->aliases
-  ** if they are present.
-  */
-
-  llassert (NOALIAS (env->aliases, ttab->aliases));
-  llassert (NOALIAS (env->aliases, ftab->aliases));
-
-  aliasTable_free (env->aliases);  
-
-  env->aliases = aliasTable_levelUnionNew (ttab->aliases, 
-					   ftab->aliases, env->lexlevel);
-
-  aliasTable_fixSrefs (env->aliases);
-  
-  /* exit true and false scopes */
-  usymtab_quietPlainExitScope ();
-  usymtab_quietPlainExitScope ();
-  
-  if (mustReturnT)
-    {
-      utab->guards = guardSet_levelUnionFree 
-	(utab->guards, 
-	 guardSet_invert (exprNode_getGuards (pred)), 
-	 utab->lexlevel);
-    }
-
-  if (mustReturnF)
-    {
-      utab->guards = guardSet_levelUnion (utab->guards, 
-					  exprNode_getGuards (pred), 
-					  utab->lexlevel);
-    }
-
-  DPRINTF (("Here."));
-}
-
-static void usymtab_fixCases (void) /*@modifies utab@*/ {
-  while (utab->kind == US_CBRANCH)
-    {
-      usymtab_quietPlainExitScope ();
-    }
-
-  llassert (utab->kind != US_CBRANCH);
-}
-
-void
-usymtab_altBranch (/*@only@*/ guardSet guards)
-  /*@modifies utab@*/
-{
-  usymtab t = usymtab_create (US_FBRANCH, utab, FALSE);
-  usymtab parent = utab->env;
-
-  /*
-  ** If we are in a case, need to close it.  The C syntax
-  ** is very liberal, so this kludge is necessary.
-  */
-
-  usymtab_fixCases ();
-
-  DPRINTF (("Current kind: %s", usymtab_unparseStack ()));
-  llassert (utab->kind == US_TBRANCH);
-  llassert (parent != GLOBAL_ENV);
-
-  guardSet_free (t->guards);
-  t->guards = guards;
-
-  aliasTable_free (t->aliases);
-  t->aliases = aliasTable_copy (parent->aliases);
-    
-  utab = t;
-}
-
-void
-usymtab_allDefined (void)
-   /*@globals utab, globtab@*/
-{
-  int i;
-
-  llassert (utab == globtab);
-
-  for (i = 0; i < utab->nentries; i++)
-    {
-      uentry e = utab->entries[i];
-
-      if (uentry_isPriv (e))
-	{
-	 ; /* no need to define it */
-	}
-      else
-	{
-	  if (context_getFlag (FLG_SPECUNDECL))
-	    {
-	      fileloc sloc = uentry_whereSpecified (e);
-	      fileloc dloc = uentry_whereDeclared (e);
-
-	      if (fileloc_isDefined (sloc) 
-		  && !uentry_isFakeTag (e)
-		  && !fileloc_isDefined (dloc))
-		{
-		  voptgenerror 
-		    (FLG_SPECUNDECL,
-		     message ("%s %q specified but not declared",
-			      ekind_capName (uentry_getKind (e)),
-			      uentry_getName (e)),
-		     sloc);
-		}
-	    }
-	  
-	  if (!uentry_isCodeDefined (e))
-	    {
-	      fileloc dloc = uentry_whereDeclared (e);
-	      
-	      if (fileloc_isLib (dloc))
-		{
-		 ;
-		}
-	      else if (fileloc_isDefined (dloc))
-		{
-		  if (!uentry_isAnyTag (e))
-		    {
-		      if (fileloc_isUser (dloc))
-			{
-			  voptgenerror 
-			    (FLG_DECLUNDEF,
-			     message ("%s %q declared but not defined",
-				      ekind_capName (uentry_getKind (e)),
-				      uentry_getName (e)),
-			     dloc);
-			}
-		    }
-		}
-	      else
-		{
-		  fileloc sloc = uentry_whereSpecified (e);
-
-		  if (fileloc_isDefined (sloc) 
-		      && !fileloc_isImport (sloc)
-		      && !fileloc_isLib (sloc)
-		      && !fileloc_isPreproc (sloc)
-		      && !uentry_isFakeTag (e))
-		    {
-		      if (uentry_isVariable (e) || uentry_isFunction (e))
-			{
-			  voptgenerror 
-			    (FLG_SPECUNDEF,
-			     message ("%s %q specified but not declared or defined",
-				      ekind_capName (uentry_getKind (e)),
-				      uentry_getName (e)),
-			     sloc);
-			}
-		      else
-			{
-			  voptgenerror 
-			    (FLG_SPECUNDEF,
-			     message ("%s %q specified but not defined",
-				      ekind_capName (uentry_getKind (e)),
-				      uentry_getName (e)),
-			     sloc);
-			}
-		    }
-		}
-	    }
-	}
-    }
-}
-
-void usymtab_exportHeader (void)
-     /*@globals utab@*/
-{
-  int i;
-
-  for (i = 0; i < utab->nentries; i++)
-    {
-      uentry ce = utab->entries[i];
-
-      if (!uentry_isDatatype (ce) 
-	  && !uentry_isAnyTag (ce) 
-	  && !uentry_isEitherConstant (ce) && !uentry_isStatic (ce)
-	  && !uentry_isExternal (ce)
-	  && !uentry_isForward (ce))
-	{
-	  fileloc fwhere = uentry_whereDeclared (ce);
-
-	  if (fileloc_isUndefined (fwhere)
-	      && uentry_isFunction (ce))
-	    {
-	      fwhere = uentry_whereDefined (ce);
-	    }
-
-	  if (fileloc_isDefined (fwhere) 
-	      && !fileloc_isHeader (fwhere)
-	      && !(fileloc_isSpecialFile (fwhere)
-		   && !context_getFlag (FLG_UNUSEDSPECIAL)))
-	    {
-	      if (uentry_isVariable (ce))
-		{
-		  if (optgenerror
-		      (FLG_EXPORTHEADERVAR,
-		       message ("%s %q exported but not declared in header file", 
-				ekind_capName (uentry_getKind (ce)),
-				uentry_getName (ce)),
-		       fwhere))
-		    {
-		      uentry_showDefSpecInfo (ce, fwhere);
-		    }
-		}
-	      else
-		{
-		  if (!uentry_isIter (ce)
-		      && !uentry_isEndIter (ce)
-		      && !uentry_isExpandedMacro (ce))
-		    {
-		      if (uentry_isFunction (ce) 
-			  && cstring_equalLit (uentry_rawName (ce), "main"))
-			{
-			  ; /* no error for main */
-			}
-		      else
-			{
-			  if (optgenerror
-			      (FLG_EXPORTHEADER,
-			       message ("%s %q exported but not declared "
-					"in header file", 
-					ekind_capName (uentry_getKind (ce)),
-					uentry_getName (ce)),
-			       fwhere))
-			    {
-			      uentry_showDefSpecInfo (ce, fwhere);
-			    }
-			}
-		    }
-		}
-	    }
-	}
-    }
-}
-
-void usymtab_exportLocal (void)
-   /*@globals utab@*/
-{
-  int i;
-
-  
-  for (i = 0; i < utab->nentries; i++)
-    {
-      uentry ce = utab->entries[i];
-
-      
-      if (!uentry_isDatatype (ce) && !uentry_isAnyTag (ce) 
-	  && !uentry_isEitherConstant (ce) 
-	  && !uentry_isIter (ce)
-	  && !uentry_isEndIter (ce)
-	  && !uentry_isExpandedMacro (ce)
-	  && uentry_isUsed (ce))
-	{
-	  /* check static uses */
-	  filelocList fuses = uentry_getUses (ce);
-	  fileloc mod = uentry_whereDefined (ce);
-	  bool ok = filelocList_isEmpty (fuses);
-	  fileloc fwhere = uentry_whereDeclared (ce);
-
-	  if (fileloc_isSpecialFile (fwhere)
-	      && !context_getFlag (FLG_UNUSEDSPECIAL))
-	    {
-	      ok = TRUE; /* no errors for special files */
-	    }
-	  else
-	    {
-	      filelocList_elements (fuses, uloc)
-		{
-		  if (fileloc_isUndefined (uloc) || !fileloc_sameModule (uloc, mod))
-		    {
-		      ok = TRUE;
-		      /*@innerbreak@*/ break;
-		    }
-		} end_filelocList_elements;
-	    }
-
-	  if (!ok)
-	    {
-	      if (optgenerror
-		  (FLG_EXPORTLOCAL,
-		   message ("%s exported but not used outside %s: %q", 
-			    ekind_capName (uentry_getKind (ce)),
-			    fileloc_getBase (mod),
-			    uentry_getName (ce)),
-		   fwhere))
-		{
-		  uentry_showDefSpecInfo (ce, fwhere);
-		}
-	    }
-	}
-    }
-}
-
-void
-usymtab_allUsed (void)
-  /*@globals utab@*/
-{
-  int i;
-  bool isFileStatic = usymtab_inFileScope ();
-  cstring last_file = cstring_undefined;
-
-  for (i = 0; i < utab->nentries; i++)
-    {
-      bool hasError = FALSE;
-      uentry ce = utab->entries[i];
-      fileloc fwhere = uentry_whereDeclared (ce);
-
-      if (fileloc_isUndefined (fwhere))
-	{
-	  fwhere = uentry_whereDefined (ce);
-	}
-
-      if (fileloc_isInvalid (fwhere) 
-	  || fileloc_isLib (fwhere) 
-	  || fileloc_isBuiltin (fwhere)
-	  || ((fileloc_isSpecialFile (fwhere)
-	       || fileloc_isSpecialFile (uentry_whereDefined (ce)))
-	      && !context_getFlag (FLG_UNUSEDSPECIAL)))
-	{
-	  ;
-	}
-      else if (!uentry_wasUsed (ce) && !uentry_isAnyTag (ce))
-	{
-	  cstring fname = fileloc_filename (fwhere);
-
-	  if (cstring_isUndefined (last_file))
-	    {
-	      last_file = fname;
-	    }
-	  else if (cstring_equal (fname, last_file))
-	    {
-	    }
-	  else
-	    {
-	      cleanupMessages ();
-	      last_file = fname;
-	    } 
-	  
-	  if (uentry_isParam (ce))
-	    {
-	      if (context_inMacro ())
-		{
-		  sRef cref = uentry_getSref (ce);
-
-		  if (uentry_isYield (ce))
-		    {
-		      ; /* no checks (for now) */
-		    }
-		  else if (sRef_isSafe (cref))
-		    {
-		      ; /* no error */
-		    }
-		  else
-		    {
-		      if (uentry_hasRealName (ce))
-			{
-			  hasError = 
-			    optgenerror (FLG_MACROPARAMS,
-					 message ("Macro parameter %q not used", 
-						  uentry_getName (ce)),
-					 fwhere);
-			}
-		    }
-		}
-	      else 
-		{
-		  if (cstring_equalFree (uentry_getName (ce), 
-					 cstring_makeLiteral ("...")))
-		    {
-		      ;
-		    }
-		  else
-		    {
-		      hasError = optgenerror (FLG_PARAMUNUSED,
-					      message ("Parameter %q not used",
-						       uentry_getName (ce)),
-					      fwhere);
-		    }
-		}
-	    } /* isParam */
-	  else if (uentry_isFunction (ce) || uentry_isIter (ce))
-	    {
-	      if (fileloc_isUser (fwhere))
-		{
-		  hasError = optgenerror
-		    (FLG_FUNCUNUSED, 
-		     message ("%q %q declared but not used", 
-			      cstring_makeLiteral 
-			      (uentry_isIter (ce) ? "Iterator" 
-			       : (isFileStatic ? "File static function" : "Function")),
-			      uentry_getName (ce)),
-		     fwhere);
-		}
-	    }
-	  else if (uentry_isEndIter (ce))
-	    {
-	      ; /* no error (already reported for iter */
-	    }
-	  else if (uentry_isEnumConstant (ce))
-	    {
-	      if (fileloc_isUser (fwhere))
-		{
-		  hasError = optgenerror
-		    (FLG_ENUMMEMUNUSED,
-		     message ("Enum member %q not used", 
-			      uentry_getName (ce)),
-		     fwhere);
-		}
-	    }
-	  else if (uentry_isConstant (ce))
-	    {
-	      if (fileloc_isUser (fwhere))
-		{
-		  hasError = optgenerror
-		    (FLG_CONSTUNUSED,
-		     message ("Constant %q declared but not used", 
-			      uentry_getName (ce)),
-		     fwhere);
-		}
-	    }
-	  else if (uentry_isDatatype (ce))
-	    {
-	      if (fileloc_isUser (fwhere))
-		{
-		  hasError = optgenerror
-		    (FLG_TYPEUNUSED,
-		     message ("Type %q declared but not used", 
-			      uentry_getName (ce)),
-		     fwhere);
-		}
-	    }
-	  else if (!uentry_isRefParam (ce) && !uentry_isExpandedMacro (ce))
-	    { /* errors for ref params will be reported in the next scope */
-	      llassertprint (uentry_isVar (ce), 
-			     ("ce: %s", uentry_unparseFull (ce)));
-
-	      if (ctype_isFunction (uentry_getType (ce)))
-		{
-		  if (fileloc_isUser (fwhere))
-		    {
-		      hasError = optgenerror
-			(FLG_FUNCUNUSED,
-			 message ("%q %q declared but not used", 
-				  cstring_makeLiteral 
-				  (isFileStatic ? "File static function" 
-				   : "Function"),
-				  uentry_getName (ce)),
-			 fwhere);
-		    }
-		}
-	      else 
-		{
-		  if (fileloc_isUser (fwhere))
-		    {
-		      
-		      
-		      hasError = optgenerror 
-			(FLG_VARUNUSED,
-			 message ("%q %q declared but not used", 
-				  cstring_makeLiteral 
-				  (isFileStatic ? "File static variable" 
-				   : "Variable"), 
-				  uentry_getName (ce)),
-			 fwhere);
-		    }
-		}
-	    }
-	  else
-	    {
-	      ; /* no errors */
-	    }
-	} /* unused */
-      else if (uentry_isDatatype (ce) || uentry_isAnyTag (ce))
-	{ /* check all fields */
-	  ctype ct = uentry_getRealType (ce); 
-
-	  
-	  while (ctype_isAP (ct))
-	    {
-	      ct = ctype_getBaseType (ct);
-	    }
-
-	  
-	  if (ctype_isSU (ct))
-	    {
-	      uentryList fields = ctype_getFields (ct);
-
-	      uentryList_elements (fields, field)
-		{
-		  if (!uentry_isUsed (field))
-		    {
-		      if (uentry_hasName (ce))
-			{
-			  hasError |= optgenerror 
-			    (FLG_FIELDUNUSED,
-			     message ("Field %q of %s %q declared but not used", 
-				      uentry_getName (field),
-				      cstring_makeLiteralTemp
-				      (ctype_isStruct (ct) ? "structure" : "union"),
-				      uentry_getName (ce)),
-			     uentry_whereEarliest (field));
-			}
-		      else
-			{
-			  hasError |= optgenerror 
-			    (FLG_FIELDUNUSED,
-			     message ("Field %q of unnamed %s declared but not used", 
-				      uentry_getName (field),
-				      cstring_makeLiteralTemp
-				      (ctype_isStruct (ct) ? "structure" : "union")),
-			     uentry_whereEarliest (field));
-			}
-		      
-		      uentry_setUsed (field, fileloc_undefined);
-		    }
-		} end_uentryList_elements;
-	    }
-	}
-      else
-	{
-	  ; /* no errors */
-	}
-
-      if (hasError)
-	{
-	  if (uentry_isParam (ce) && context_inMacro ())
-	    {
-	      if (fileloc_isDefined (uentry_whereSpecified (ce)))
-		{
-		  uentry_showWhereSpecified (ce);
-		}
-	    }
-	  else
-	    {
-	      uentry_showDefSpecInfo (ce, fwhere);
-	    }
-
-	  uentry_setUsed (ce, fileloc_undefined);
-	}
-    }
-}
-
-static void
-checkGlobalReturn (uentry glob, sRef orig)
-{
-  sRef sr = uentry_getSref (glob);
-  
-  
-  if (context_getFlag (FLG_GLOBSTATE))
-    {
-      if (sRef_isKilledGlob (orig))
-	{
-	  if (sRef_isStateUndefined (sr)
-	      || sRef_isUnuseable (sr)
-	      || sRef_isStateUnknown (sr)
-	      || sRef_isDead (sr))
-	    {
-	      ;
-	    }
-	  else
-	    {
-	      ctype ct = ctype_realType (uentry_getType (glob));
-
-	      if (ctype_isVisiblySharable (ct))
-		{
-		  if (optgenerror 
-		      (FLG_GLOBSTATE,
-		       message 
-		       ("Killed global %q not released before return",
-			uentry_getName (glob)),
-		       g_currentloc))
-		    {
-		      sRef_showStateInfo (sr);
-		      		    }
-		}
-	      else
-		{
-		  		  sRef_protectDerivs ();
-		  (void) checkGlobalDestroyed (sr, g_currentloc);
-		  sRef_clearProtectDerivs ();
-		}
-	    }
-	}
-      else
-	{
-	  if (sRef_isStateUndefined (sr))
-	    {
-	      if (optgenerror (FLG_GLOBSTATE,
-			       message 
-			       ("Function returns with global %q undefined",
-				uentry_getName (glob)),
-			       g_currentloc))
-		{
-		  sRef_showStateInfo (sr);
-		}
-	    }
-	  else 
-	    {
-	      if (sRef_isDead (sr))
-		{
-		  if (optgenerror 
-		      (FLG_GLOBSTATE,
-		       message ("Function returns with global %q "
-				"referencing released storage",
-				uentry_getName (glob)),
-		       g_currentloc))
-		    {
-		      sRef_showStateInfo (sr);
-		      sRef_setDefState (sr, SS_UNKNOWN, fileloc_undefined);
-		    }
-		}
-	      
-	      if (ctype_isRealPointer (uentry_getType (glob)) &&
-		  sRef_possiblyNull (sr) && !uentry_possiblyNull (glob))
-		{
-		  if (optgenerror 
-		      (FLG_GLOBSTATE,
-		       message ("Function returns with non-null global %q "
-				"referencing null storage",
-				uentry_getName (glob)),
-		       g_currentloc))
-		    {
-		      sRef_showNullInfo (sr);
-		    }
-		}
-	      else
-		{
-		  checkGlobReturn (glob);
-		}
-	    }
-	}
-    }
-}
-
-/*
-** remember: check alias globals
-*/
-
-void usymtab_checkFinalScope (bool isReturn)
-  /*@globals utab@*/
-{
-  bool mustFree = context_getFlag (FLG_MUSTFREE);
-  bool mustDefine = context_getFlag (FLG_MUSTDEFINE);
-  /* bool mustNotAlias = context_getFlag (FLG_MUSTNOTALIAS); */
-  sRefSet checked = sRefSet_new ();
-  usymtab stab = utab;
-  int i;
-    
-  /*
-  ** need to check all scopes out to function parameters.
-  */
-
-  do 
-    {
-      for (i = 0; i < stab->nentries; i++)
-	{
-	  uentry ce = stab->entries[i];
-	  sRef sr = uentry_getSref (ce);
-	  sRef rb = sRef_getRootBase (sr);
-
-	  if (ctype_isFunction (uentry_getType (ce)))
-	    {
-	      /*@innercontinue@*/ continue;
-	    }
-
-	  if (mustFree)
-	    {
-	      DPRINTF (("Check entry: %s", uentry_unparseFull (ce)));
-
-	      if (!sRefSet_member (checked, sr) && !sRef_isGlobal (rb))
-		{
-		  if (ctype_isRealSU (uentry_getType (ce))
-		      && !uentry_isAnyParam (ce)
-		      && !uentry_isRefParam (ce)
-		      && !uentry_isStatic (ce)
-		      && !sRef_isDependent (sr)
-		      && !sRef_isOwned (sr))
-		    {
-		      sRefSet als = usymtab_allAliases (sr);
-
-		      
-		      if (sRefSet_isEmpty (als))
-			{
-			  checkLocalDestroyed (sr, g_currentloc);
-			}
-		      else
-			{
-			  /* aliased, no problem */ ;
-			}
-
-		      sRefSet_free (als);
-		    }
-		  else if
-		    (!uentry_isStatic (ce)
-		     && ((sRef_isNewRef (sr))
-			 || (((sRef_isOnly (sr) || sRef_isFresh (sr) 
-			       || sRef_isKeep (sr) || sRef_isOwned (sr))
-			      && !sRef_isDead (sr))
-			     && (!sRef_definitelyNull (sr))
-			     && (!usymtab_isProbableNull (sr)))))
-		      {
-			bool hasError = TRUE;
-			
-			/*
-    	     	        ** If its a scope exit, check if there is an alias.
-			** If so, make it only.  If not, there is an error.
-			*/
-			
-			if (!isReturn)
-			  {
-			    if (canLoseReference (sr, g_currentloc))
-			      {
-				hasError = FALSE;
-			      }
-			  }
-			
-			if (hasError)
-			  {
-			    if (sRef_hasLastReference (sr))
-			      {
-				sRef ar = sRef_getAliasInfoRef (sr);
-				
-				if (optgenerror 
-				    (FLG_MUSTFREE,
-				     message
-				     ("Last reference %q to %s storage %qnot %q before %q",
-				      sRef_unparse (sr),
-				      alkind_unparse (sRef_getAliasKind (sr)),
-				      sRef_unparseOpt (ar),
-				      cstring_makeLiteral (sRef_isKeep (sr) 
-							   ? "transferred" : "released"),
-				      cstring_makeLiteral (isReturn 
-							   ? "return" : "scope exit")),
-				     g_currentloc))
-				  {
-				    sRef_showRefLost (sr);
-				  }
-			      }
-			    else if (sRef_isNewRef (sr))
-			      {
-				if (optgenerror
-				    (FLG_MUSTFREE,
-				     message 
-				     ("%q %q not released before %q",
-				      cstring_makeLiteral 
-				      (alkind_isKillRef (sRef_getOrigAliasKind (sr))
-				       ? "Kill reference parameter" : "New reference"),
-				      uentry_getName (ce),
-				      cstring_makeLiteral (isReturn
-							   ? "return" : "scope exit")),
-				     g_currentloc))
-				  {
-				    sRef_showAliasInfo (sr);
-				  }
-			      }
-			    else 
-			      {
-				if (ctype_isRealSU (sRef_getType (sr)))
-				  {
-				    				    checkStructDestroyed (sr, g_currentloc);
-				  }
-				else
-				  {
-				    if (optgenerror
-					(FLG_MUSTFREE,
-					 message 
-					 ("%s storage %q not %q before %q",
-					  alkind_capName (sRef_getAliasKind (sr)),
-					  uentry_getName (ce),
-					  cstring_makeLiteral (sRef_isKeep (sr) 
-							       ? "transferred" : "released"),
-					  cstring_makeLiteral (isReturn 
-							       ? "return" : "scope exit")),
-					 g_currentloc))
-				      {
-					sRef_showAliasInfo (sr);
-				      }
-				  }
-			      }
-			  }
-		      }
-		  else
-		    {
-		      ;
-		    }
-		}
-	      else if (mustDefine && uentry_isOut (ce))
-		{
-		  if (!ynm_toBoolStrict (sRef_isReadable (sr)))
-		    {
-		      voptgenerror 
-			(FLG_MUSTDEFINE,
-			 message ("Out storage %q not defined before %q",
-				  uentry_getName (ce),
-				  cstring_makeLiteral 
-				  (isReturn ? "return" : "scope exit")),
-			 g_currentloc);
-		      
-		      /* uentry_showWhereDeclared (ce); */
-		    }
-		}
-	      else
-		{
-		  ; 
-		}
-	      
-	      /*
-	      ** also check state is okay
-	      */
-
-	      if (usymtab_lexicalLevel () > functionScope
-		  && uentry_isVariable (ce)
-		  && (sRef_isLocalVar (sr)
-		      && (sRef_isDependent (sr) || sRef_isLocalState (sr))))
-		{
-		  sRefSet ab = usymtab_aliasedBy (sr);
-
-		  /* should do something more efficient here */
-
-		  if (sRefSet_isEmpty (ab))
-		    {
-		      /* and no local ref */
-		      checkLoseRef (ce);
-		    }
-		  else
-		    {
-		      ;
-		    }
-		  
-		  sRefSet_free (ab);
-		}
-	      else 
-		{
-		  ;
-		}
-	      
-	      checked = sRefSet_insert (checked, sr);
-	    }
-	}
-      llassert (usymtab_isDefined (stab->env));
-
-      if (usymtab_isBranch (stab))
-	{
-	  stab = usymtab_dropEnv (stab);
-	}
-      else
-	{
-	  stab = stab->env;
-	}
-
-      llassert (stab != usymtab_undefined);
-    } while (isReturn && (stab->lexlevel >= paramsScope));
-
-    sRefSet_free (checked);
-
-  /*
-  ** for returns:
-  **      all globals are appropriately defined
-  **      all parameters are appropriately defined
-  **      special clauses are followed
-  */
-
-  if (isReturn || (utab->lexlevel == paramsScope))
-    {
-      uentry fcn = context_getHeader ();
-      uentryList params = context_getParams ();
-      globSet uglobs = context_getUsedGlobs ();
-      globSet sglobs = context_getGlobs ();
-
-            
-      if (isReturn && context_maybeSet (FLG_GLOBALIAS))
-	{ 
-	  aliasTable_checkGlobs (utab->aliases); 
-	}
-
-      /*
-      ** special clauses (defines, sets, allocates, releases) 
-      */
-
-      if (uentry_hasSpecialClauses (fcn))
-	{
-	  specialClauses clauses = uentry_getSpecialClauses (fcn);
-
-	  specialClauses_elements (clauses, cl)
-	    {
-	      if (specialClause_isAfter (cl)) 
-		{ /* evs - 2000 07 10 - added this */
-		  sRefTest tst = specialClause_getPostTestFunction (cl);
-		  sRefSet rfs = specialClause_getRefs (cl);
-		  
-		  sRefSet_elements (rfs, el)
-		    {
-		      sRef base = sRef_getRootBase (el);
-		      
-		      if (sRef_isResult (base))
-			{
-			  ; 
-			}
-		      else if (sRef_isParam (base))
-			{
-			  sRef sr = sRef_updateSref (base);
-			  sr = sRef_fixBase (el, sr);
-			  
-			  if (tst != NULL && !tst (sr))
-			    {
-			      if (optgenerror 
-				  (specialClause_postErrorCode (cl),
-				   message ("%s storage %qcorresponds to "
-					    "storage listed in %q clause",
-					    specialClause_postErrorString (cl, sr),
-					    sRef_unparseOpt (sr),
-					    specialClause_unparseKind (cl)),
-				   g_currentloc))
-				{
-				  sRefShower ss = specialClause_getPostTestShower (cl);
-				  
-				  if (ss != NULL)
-				    {
-				      ss (sr);
-				    }
-				}  
-			    }
-			}
-		      else
-			{
-			  if (sRef_isMeaningful (el))
-			    {
-			      BADBRANCH;
-			    }
-			}
-		    } end_sRefSet_elements ;
-		}
-	    } end_specialClauses_elements ;
-	}
-      
-      /*
-      ** check parameters on return
-      */
-
-      uentryList_elements (params, arg)
-	{
-	  if (!uentry_isElipsisMarker (arg))
-	    {
-	      ctype rt = ctype_realType (uentry_getType (arg));
-
-	      if (ctype_isMutable (rt) || ctype_isSU (rt))
-		{
-		  uentry param = usymtab_lookupQuiet (utab, uentry_rawName (arg));
-		  checkParamReturn (param);
-		}
-	    }
-	} end_uentryList_elements;
-      
-      globSet_allElements (sglobs, el)
-	{
-	  uentry current = sRef_getUentry (el);
-
-	  if (uentry_isVariable (current) && !uentry_isRealFunction (current))
-	    {
-	      checkGlobalReturn (current, el);
-	    }
-	} end_globSet_allElements;
-
-      globSet_allElements (uglobs, el)
-	{
-	  if (!globSet_member (sglobs, el))
-	    {
-	      uentry current = sRef_getUentry (el);
-	      
-	      	      
-	      if (uentry_isVariable (current)
-		  && !uentry_isRealFunction (current))
-		{
-		  checkGlobalReturn (current, sRef_undefined);
-		}
-	    }
-	} end_globSet_allElements;
-    }
-  
-  }
-
-void
-usymtab_quietExitScope (fileloc loc) 
-   /*@globals utab, globtab, filetab; @*/ 
-   /*@modifies utab@*/
-{
-  usymtab t = utab->env;
-
-  if (utab->reftable != NULL)
-    {
-      int i;
-
-      for (i = 0; i < utab->nentries; i++)
-	{
-	  uentry current = utab->entries[i];	  
-	  uentry old = usymtab_lookupAux (t, uentry_rawName (current));
-
-	  uentry_mergeState (old, current, loc, FALSE, FALSE, FALSE, NOCLAUSE);
-	}
-    }
-
-  llassert (t != NULL);
-
-  if (t->lexlevel > paramsScope)
-    {
-      t->guards = guardSet_levelUnion (t->guards, utab->guards, t->lexlevel);
-      t->aliases = aliasTable_levelUnionSeq (t->aliases, utab->aliases, 
-					     t->lexlevel);
-      utab->aliases = aliasTable_undefined;
-    }
-
-  t->mustBreak = utab->mustBreak;
-  t->exitCode = utab->exitCode;
-
-  usymtab_freeLevel (utab);
-
-  utab = t;
-}
-
-/*
-** Exit a scope with no checking, lose alias states.
-** (When should this be used?)
-*/
-
-void usymtab_quietPlainExitScope (void)
-     /*@globals utab, globtab, filetab@*/
-     /*@modifies utab@*/
-{
-  usymtab t = utab->env;
-
-  llassert (t != NULL);
-  llassert (NOALIAS (utab->aliases, t->aliases));
-  usymtab_freeLevel (utab);
-  utab = t;
-}
-
-void usymtab_exitScope (exprNode expr)
-  /*@globals utab, filetab, globtab@*/
-  /*@modifies utab, globtab@*/
-{
-  usymtab ctab = usymtab_undefined;
-  usymtab lctab = usymtab_undefined;
-  bool mustReturn = exprNode_mustEscape (expr);
-  
-  if (utab->kind == US_CBRANCH)
-    {
-      /*
-      ** save the case branches, remove the first non-cbranch
-      */
-
-      ctab = utab;
-
-      while (utab->kind == US_CBRANCH) 
-	{
-	  lctab = utab;
-	  utab = utab->env;
-	  llassert (utab != GLOBAL_ENV);
-	}
-    }
-  
-  if (utab->kind == US_TBRANCH || utab->kind == US_FBRANCH
-      || utab->kind == US_CBRANCH || utab->kind == US_SWITCH) {
-   
-    if (context_inMacro ()) {
-      /* evs 2000-07-25 */
-      /* Unparseable macro may end inside nested scope.  Deal with it. */
-      
-      llerror (FLG_SYNTAX, message ("Problem parsing macro body of %s (unbalanced scopes).  Attempting to recover, recommend /*@notfunction@*/ before macro definition.", 
-				    context_inFunctionName ()));
-      
-      while (utab->kind == US_TBRANCH
-	     || utab->kind == US_FBRANCH
-	     || utab->kind == US_CBRANCH
-	     || utab->kind == US_SWITCH) 
-	{
-	  utab = utab->env;
-	  llassert (utab != GLOBAL_ENV);
-	}
-    } else {
-      llcontbug (("exitScope: in branch: %s", usymtab_unparseStack ()));
-      /*@-branchstate@*/ 
-    } /*@=branchstate@*/
-  }
-
-  /*
-  ** check all variables in scope were used
-  */
-
-  /*
-  ** bogus errors if this is the normal inside a switch,
-  ** since cases have not been merged yet.  Should probably
-  ** still check this, but I'm too lazy at the moment...
-  */
-
-  llassertfatal (utab->env != GLOBAL_ENV);
-
-  if (utab->env->kind != US_SWITCH)
-    {
-      usymtab_allUsed ();
-    }
-
-  /*
-  ** check aliasing: all only params are released (dead)
-  **     definition: all out params are defined, all modified params 
-  **                     are completely defined
-  **
-  ** NOTE: note for exiting paramsScope, since checkReturn should be
-  ** called first.
-  */
-
-  if (!mustReturn && (usymtab_lexicalLevel () > functionScope))
-    {
-      /*
-      ** should only call this is end of scope is reachable...
-      */
-
-      usymtab_checkFinalScope (FALSE);
-    }
-
-  if (usymtab_lexicalLevel () == paramsScope && context_inFunctionLike ())
-    {
-      /*
-      ** leaving a function, need to fix up globals
-      */
-
-      uentryList params = context_getParams ();
-      globSet    globs = context_getUsedGlobs ();
-
-                  
-      uentryList_elements (params, ue)
-	{
-	  uentry_fixupSref (ue);
-	} end_uentryList_elements;
-
-      clearFunctionTypes ();
-
-      
-      globSet_allElements (globs, el)
-	{
-	  if (sRef_isCvar (el))
-	    {
-	      uentry current;
-	      int index = sRef_getScopeIndex (el);
-	      
-	      if (sRef_isFileStatic (el))
-		{
-		  llassert (usymtab_isDefined (filetab));
-		  current = usymtab_fetchIndex (filetab, index);
-		}
-	      else
-		{
-		  current = usymtab_fetchIndex (globtab, index);
-		}
-	      
-	      if (uentry_isVariable (current))
-		{
-		  uentry_fixupSref (current);
-		}
-	      else
-		{
-		  sRef_clearDerived (uentry_getSref (current));
-		}
-	    }
-	} end_globSet_allElements;
-    }
-  
-  usymtab_quietExitScope (exprNode_loc (expr));
-  
-  if (lctab != usymtab_undefined)
-    {
-      /*@i@*/ lctab->env = utab;  
-      /*@i@*/ utab = ctab;
-    /*@-branchstate@*/ } /*@=branchstate@*/
-/*@-globstate@*/
-}
-/*@=globstate@*/
-
-/*
-** yikes!  don't let the '170 kids see this one...
-*/
-
-int
-uentry_directParamNo (uentry ue)
-{
-  if (uentry_isVar (ue))
-    {
-      sRef sr = uentry_getSref (ue);
-
-      if (sRef_lexLevel (sr) == functionScope)
-	{
-	  /*@access sRef@*/ /*@-null@*/
-	  int index = sr->info->cvar->index;
-	  /*@noaccess sRef@*/ /*@=null@*/
-
-	  if (index < uentryList_size (context_getParams ()))
-	    {
-	      return index;
-	    }
-	}
-    }
-  return -1;
-}
-
-/*@dependent@*/ /*@exposed@*/ uentry
-  usymtab_getParam (int paramno)
-  /*@globals utab@*/
-{
-  /*
-  ** requires in a function context (checked)
-  **
-  ** depends on no nested functions --- the function
-  ** parameters are ALWAYS one scope inside the global scope
-  ** and entered in order!
-  */
-  usymtab s = utab;
-
-  if (!context_inFunctionLike ())
-    llfatalbug (message ("usymtab_getParam: not in function context: %q", 
-			 context_unparse ()));
-
-  while (s->lexlevel > paramsScope) 
-    {
-      s = s->env;
-    }
-
-  llassert (usymtab_isDefined (s));
-
-  if (paramno >= s->nentries)
-    {
-      /*  
-      ** Parse errors lead to this. 
-      */
-
-      uentry err = uentry_makeVariableLoc (cstring_makeLiteralTemp (""),
-					   ctype_unknown);
-      
-      uentry_markOwned (err);
-      return (err);
-    }
-
-  return (s->entries[paramno]);
-}
-
-static /*@dependent@*/ /*@exposed@*/ uentry 
-usymtab_getRefTab (/*@notnull@*/ usymtab u, int level, usymId index)
-{
-  uentry ue;
-
-  
-  ue = usymtab_getRefNoisy (u, level, index);
-
-  
-  if (uentry_isUndefined (ue))
-    {
-      llbug (message ("usymtab_getRef: out of range: %d. level = %d",
-		    index, level));
-    }
-
-  
-  return ue;
-}
-
-static /*@dependent@*/ /*@exposed@*/ usymtab 
-  usymtab_dropEnv (/*@notnull@*/ usymtab s)
-{
-  if (s->kind == US_CBRANCH)
-    {
-      usymtab t = s;
-
-      do 
-	{
-	  t = s;
-	  s = s->env;
-	  llassert (s != GLOBAL_ENV);
-	} while (s->kind == US_CBRANCH); 
-      /* drop all cases (except in nested scopes */ 
-
-      s = t;
-      llassert (s != GLOBAL_ENV);
-    }
-
-  if (s->kind == US_FBRANCH)
-    {
-      s = s->env; /* skip the true branch */
-      llassert (usymtab_isDefined (s));
-      llassert (s->kind == US_TBRANCH);
-    }
-
-  llassert (s != GLOBAL_ENV);
-  s = s->env;
-
-  return s;
-}
-
-/*@dependent@*/ /*@exposed@*/ uentry
-  usymtab_getRefQuiet (int level, usymId index)
-  /*@globals utab@*/
-{
-  usymtab s = utab;
-  
-  
-  llassert (s != NULL);
-  llassert (index >= 0);
-
-  if (level > s->lexlevel)
-    {
-            
-      return uentry_undefined;
-    }
-
-  llassertprint (level <= s->lexlevel, ("level: %d / lexlevel: %d", 
-					level, s->lexlevel)); 
-
-  while (s->lexlevel > level)
-    {
-      if (usymtab_isBranch (s))
-	{
-	  int eindex = refTable_lookup (s, level, index);
-
-	  if (eindex != NOT_FOUND)
-	    {
-	      return (s->entries[eindex]);
-	    }
-	}
-
-      s = usymtab_dropEnv (s);
-    }
-
-  while (usymtab_isBranch (s) && s->lexlevel == level)
-    {
-      int eindex = refTable_lookup (s, level, index);
-      
-      if (eindex != NOT_FOUND)
-	{
-	  return (s->entries[eindex]);
-	}
-
-      s = usymtab_dropEnv (s);
-    }
- 
-  if (index >= s->nentries)
-    {
-      return uentry_undefined;
-    }
-
-  llassert (!uentry_isUndefined (s->entries[index]));
-
-  return s->entries[index];
-}
-
-static /*@dependent@*/ /*@exposed@*/ uentry
-usymtab_getRefNoisy (/*@notnull@*/ usymtab s, int level, usymId index)
-{
-  usymtab otab = s;
-  uentry ue = uentry_undefined;
-
-  
-  llassert (index >= 0);
-
-  
-  while (s->lexlevel > level)
-    {
-      
-      if (usymtab_isBranch (s))
-	{
-	  int eindex = refTable_lookup (s, level, index);
-
-	  if (eindex != NOT_FOUND)
-	    {
-	      ue = s->entries[eindex];
-
-	      if (s != otab)
-		{
-		  while (!usymtab_isBranch (otab))
-		    {
-		      otab = usymtab_dropEnv (otab);
-		      llassert (otab != GLOBAL_ENV);
-		    }
-		
-		  if (refTable_lookup (otab, level, index) == NOT_FOUND)
-		    {
-		      ue = usymtab_addRefEntry (otab, uentry_rawName (ue));
-		    }
-		  else
-		    {
-		      ;
-		    }
-		}
-	      
-	      return ue;
-	    }
-	}
-
-      s = usymtab_dropEnv (s);
-    }
-
-  llassert (usymtab_isDefined (s));
-
-  while (usymtab_isBranch (s) && s->lexlevel == level)
-    {
-      int eindex = refTable_lookup (s, level, index);
-
-      
-      if (eindex != NOT_FOUND)
-	{
-	  ue = s->entries[eindex];
-	  
-	  if (s != otab)
-	    {
-	      while (!usymtab_isBranch (otab))
-		{
-		  otab = usymtab_dropEnv (otab);
-		  llassert (otab != GLOBAL_ENV);
-		}
-
-	      ue = usymtab_addRefEntry (otab, uentry_rawName (ue));
-	    }
-	  else
-	    {
-	      ;
-	    } 
-
-	  return ue;
-	}
-
-      s = usymtab_dropEnv (s);
-          }
-
-  if (s->lexlevel == level && (index < s->nentries))
-    {
-      ue = s->entries[index];
-      
-      if (uentry_isValid (ue))
-	{
-	  if (s != otab)
-	    {
-	      while (!usymtab_isBranch (otab))
-		{
-		  otab = usymtab_dropEnv (otab);
-		  
-		  if (otab == GLOBAL_ENV)
-		    {
-		      return ue;
-		    }
-		}
-	      
-	      ue = usymtab_addRefEntry (otab, uentry_rawName (ue));
-	    }
-	  else
-	    {
-	      	    }
-	}
-
-      return ue;
-    }
-
-  
-  if (index >= s->nentries)
-    {
-      return uentry_undefined;
-    }
-
-  llassert (!uentry_isUndefined (s->entries[index]));
-
-  return s->entries[index];
-}
-
-/*
-** looking up entries
-**
-** If entry is inside a branch, then copy it, and put it into 
-** the branch table.
-*/
-
-static
-int refTable_lookup (/*@notnull@*/ usymtab ut, int level, int index)
-{
-  refTable rt = ut->reftable;
-  int i;
-
-  llassert (rt != NULL);
-
-  
-  for (i = 0; i < ut->nentries; i++)
-    {
-      if (rt[i]->level == level && rt[i]->index == index)
-	{
-	  	  return i;
-	}
-    }
-
-    return NOT_FOUND;
-}
-  
-static
-/*@only@*/ refentry refentry_create (int level, int index)
-{
-  refentry r = (refentry) dmalloc (sizeof (*r));
-
-  r->level = level;
-  r->index = index;
-
-  return r;
-}
-
-static /*@dependent@*/ /*@exposed@*/ uentry
-usymtab_addRefEntry (/*@notnull@*/ usymtab s, cstring k)
-{
-  int eindex;
-  usymtab ut = s;
-
-  llassert (ut->reftable != NULL);
-
-  while (s != GLOBAL_ENV)
-    {
-      eindex = usymtab_getIndex (s, k);
-      
-      if (eindex != NOT_FOUND)
-	{
-	  uentry current = s->entries[eindex];
-
-	  if (uentry_isVar (current) && !ctype_isFunction (uentry_getType (current)))
-	    {
-	      uentry ue;
-
-	      DPRINTF (("Here: copying %s", uentry_unparseFull (current)));
-
-	      ue = uentry_copy (current);
-
-	      DPRINTF (("Here: copying %s", uentry_unparseFull (ue)));
-
-	      usymtab_addEntryQuiet (ut, ue);
-
-	      if (s->reftable != NULL)
-		{
-		  refentry ref = s->reftable[eindex];
-
-		  
-		  ut->reftable[ut->nentries - 1] 
-		    = refentry_create (ref->level, ref->index);
-		}
-	      else
-		{
-		  ut->reftable[ut->nentries - 1] 
-		    = refentry_create (s->lexlevel, eindex);
-		}
-	      
-	      return (ue);
-	    }
-	  else
-	    {
-	      return (current);
-	    }
-	}
-
-      s = usymtab_dropEnv (s);
-    }
-
-  return uentry_undefined;
-}
-
-static uentry usymtab_lookupAux (usymtab s, cstring k)
-{
-  DPRINTF (("Lookup: %s", k));
-
-  while (s != GLOBAL_ENV)
-    {
-      int eindex = usymtab_getIndex (s, k);
-
-      if (eindex != NOT_FOUND)
-	{
-	  uentry ret = s->entries[eindex];
-	  
-	  DPRINTF (("Found: %s", uentry_unparseFull (ret)));
-	  return (ret);
-	}
-
-      if (s->kind == US_TBRANCH || s->kind == US_FBRANCH 
-	  || s->kind == US_CBRANCH)
-	{
-	  uentry ret = usymtab_addRefEntry (s, k);
-	  DPRINTF (("Ref entry: %s", uentry_unparseFull (ret)));
-	  return ret;
-	}
-      
-      s = s->env;
-    }
-  
-  return uentry_undefined;
-}
-
-static /*@dependent@*/ /*@exposed@*/ uentry
-usymtab_lookupQuiet (usymtab s, cstring k)
-{
-  int eindex;
-
-  while (s != GLOBAL_ENV)
-    {
-      eindex = usymtab_getIndex (s, k);
-      
-      if (eindex != NOT_FOUND)
-	{
-	  uentry ret = s->entries[eindex];
-	  return (ret);
-	}
-      
-      s = s->env;
-    }
-
-  return uentry_undefined;
-}
-
-/*@dependent@*/ /*@observer@*/ uentry
-  usymtab_lookupSafe (cstring k)
-  /*@globals utab@*/
-{
-  DPRINTF (("Lookup safe: %s", k));
-  return (usymtab_lookupAux (utab, k));
-}
-
-uentry
-  usymtab_lookupExpose (cstring k)
-  /*@globals utab@*/
-{
-  uentry ce = usymtab_lookupAux (utab, k);
-
-  if (uentry_isUndefined (ce))
-    {
-      llfatalbug (message ("usymtab_lookup: not found: *%s*", k));
-    }
-
-  if (uentry_isPriv (ce))
-    {
-      llfatalbug (message ("usymtab_lookup: private: *%s*", k));
-    }
-
-  return ce;
-}
-
-uentry usymtab_lookupExposeGlob (cstring k)
-{
-  return (usymtab_lookupGlobSafe (k));
-}
-
-uentry usymtab_lookupGlob (cstring k)
-  /*@globals globtab@*/
-{
-  uentry ce = usymtab_lookupAux (globtab, k);
-
-  if (uentry_isUndefined (ce))
-    llfatalbug (message ("usymtab_lookup: not found: %s", k));
-
-  if (uentry_isPriv (ce))
-    llfatalbug (message ("usymtab_lookup: private: %s", k));
-
-  return ce;
-}
-
-/*@observer@*/ uentry
-  usymtab_lookupGlobSafe (cstring k)
-  /*@globals globtab@*/
-{
-  uentry ce = usymtab_lookupAux (globtab, k);
-
-  return ce;
-}
-
-uentry usymtab_lookupEither (cstring k)
-   /*@globals utab@*/
-{
-  uentry ce = usymtab_lookupSafe (k);
-
-  if (uentry_isUndefined (ce))
-    llfatalerror (message ("usymtab_lookup: not found: %s", k));
-
-  return ce;
-}
-
-# ifndef NOLCL
-ctype
-usymtab_lookupType (cstring k)
-   /*@globals globtab@*/
-{
-  usymId uid = usymtab_getTypeId (k);
-
-  if (uid == USYMIDINVALID)
-    {
-      llcontbug (message ("usymtab_lookupType: not found: %s", k));
-      return ctype_unknown;
-    }
-  
-  return (uentry_getRealType (usymtab_getTypeEntry (uid)));
-}
-# endif
-
-ctype
-usymtab_lookupAbstractType (cstring k) /*@globals globtab@*/
-{
-  usymId uid = usymtab_getTypeId (k);
-
-  if (uid == USYMIDINVALID)
-    {
-      llcontbug (message ("usymtab_lookupType: not found: %s", k));
-      return ctype_unknown; 
-    }
-  
-  return (uentry_getAbstractType (usymtab_getTypeEntry (uid)));
-}
-  
-/*
-** if there is an unnamed lcl-specified struct tag matching
-** the uentryList, return its datatype.  Otherwise, returns
-** ctype_undefined.
-*/
-
-ctype
-usymtab_structFieldsType (uentryList f)
-   /*@globals globtab@*/
-{
-  return (usymtab_suFieldsType (f, TRUE));
-}
-
-ctype
-usymtab_unionFieldsType (uentryList f)
-   /*@globals globtab@*/
-{
-  return (usymtab_suFieldsType (f, FALSE));
-}
-
-static ctype
-usymtab_suFieldsType (uentryList f, bool isStruct)
-  /*@globals globtab@*/
-{
-  int i;
-
-  if (fileloc_isSpec (g_currentloc)) return (ctype_undefined);
-
-  for (i = 0; i < globtab->nentries; i++)
-    {
-      uentry current = globtab->entries[i];
-
-      if ((isStruct 
-	   ? uentry_isStructTag (current) : uentry_isUnionTag (current)))
-	{
-	  if (isFakeTag (uentry_rawName (current)))
-	    {
-	      ctype ct = uentry_getType (current);
-
-	      if ((isStruct ? ctype_isStruct (ct) : ctype_isUnion (ct))
-		  && (uentryList_matchFields (f, ctype_getFields (ct))))
-		{
-		  		  return uentry_getAbstractType (current);
-		}
-	    }
-	}
-    }
-  
-    return ctype_undefined;
-}
-
-ctype
-  usymtab_enumEnumNameListType (enumNameList f)
-  /*@globals globtab@*/
-{
-  int i;
-
-  for (i = 0; i < globtab->nentries; i++)
-    {
-      uentry current = globtab->entries[i];
-
-      if (uentry_isEnumTag (current))
-	{
-	  if (isFakeTag (uentry_rawName (current)))
-	    {
-	      ctype ct = uentry_getType (current);
-
-	      if (ctype_isEnum (ct) && (enumNameList_match (f, ctype_elist (ct))))
-		{
-		  return uentry_getType (current);
-		}
-	    }
-	}
-    }
-  
-  return ctype_undefined;
-}
-
-bool
-usymtab_exists (cstring k)
-   /*@globals utab@*/
-{
-  uentry ce = usymtab_lookupSafe (k);
-
-  return (!(uentry_isUndefined (ce)) && !(uentry_isPriv (ce)));
-}
-
-bool
-usymtab_existsReal (cstring k)
-   /*@globals utab@*/
-{
-  uentry ce = usymtab_lookupSafe (k);
-
-  return (!(uentry_isUndefined (ce)) 
-	  && !(uentry_isPriv (ce))
-	  && !(uentry_isExpandedMacro (ce)));
-}
-
-bool
-  usymtab_existsGlob (cstring k)
-  /*@globals globtab@*/
-{
-  uentry ce = usymtab_lookupAux (globtab, k);
-
-  return (!(uentry_isUndefined (ce)) && !(uentry_isPriv (ce)));
-}
-
-# ifndef NOLCL
-bool
-usymtab_existsEither (cstring k)
-  /*@globals utab@*/
-{
-  uentry ce = usymtab_lookupAux (utab, k);
-  
-  return (uentry_isValid (ce));
-}
-
-bool
-  usymtab_existsGlobEither (cstring k)
-  /*@globals globtab@*/
-{
-  uentry ce = usymtab_lookupAux (globtab, k);
-  
-  return (uentry_isValid (ce));
-}
-# endif
-
-bool
-usymtab_existsType (cstring k)
-  /*@globals globtab@*/
-{
-  uentry ce = usymtab_lookupAux (globtab, k);
-
-  return (!(uentry_isUndefined (ce)) && !(uentry_isPriv (ce)) && uentry_isDatatype (ce));
-}
-
-bool
-usymtab_existsTypeEither (cstring k)
-  /*@globals globtab@*/
-{
-  uentry ce = usymtab_lookupAux (globtab, k);
-
-    return (uentry_isValid (ce) && uentry_isDatatype (ce));
-}
-
-bool
-usymtab_existsStructTag (cstring k) /*@globals globtab@*/
-{
-  cstring sname = makeStruct (k);
-  uentry ce = usymtab_lookupAux (globtab, sname);
-
-  cstring_free (sname);
-
-  
-  return (!(uentry_isUndefined (ce)) && !(uentry_isPriv (ce)));
-}
-
-bool
-usymtab_existsUnionTag (cstring k) /*@globals globtab@*/
-{
-  cstring uname = makeUnion (k);
-  uentry ce = usymtab_lookupAux (globtab, uname);
-
-  cstring_free (uname);
-
-  return (!(uentry_isUndefined (ce)) && !(uentry_isPriv (ce)));
-}
-
-bool
-usymtab_existsEnumTag (cstring k) /*@globals globtab@*/
-{
-  cstring ename = makeEnum (k);
-  uentry ce = usymtab_lookupAux (globtab, ename);
-
-  cstring_free (ename);
-  return (!(uentry_isUndefined (ce)) && !(uentry_isPriv (ce)));
-}
-
-# ifndef NOLCL
-bool usymtab_existsVar (cstring k)
-   /*@globals utab@*/
-{
-  uentry ce = usymtab_lookupSafe (k);
-
-  return (!(uentry_isUndefined (ce)) && !(uentry_isPriv (ce)) && (uentry_isVar (ce)));
-}
-# endif
-
-/*
-** destructors
-*/
-
-static void
-refTable_free (/*@only@*/ /*@null@*/ refTable x, int nentries)
-{
-  if (x != NULL)
-    {
-      int i;
-
-      for (i = 0; i < nentries; i++)
-	{
-	  sfree (x[i]);
-	}
-      
-      sfree (x);
-    }
-}
-  
-static void
-usymtab_freeLevel (/*@notnull@*/ /*@only@*/ usymtab u)
-  /*@globals globtab, utab, filetab@*/
-{
-  int i;
-
-  aliasTable_free (u->aliases);
-  environmentTable_free (u->environment);
-  refTable_free (u->reftable, u->nentries);
-
-  if (u == filetab || u == globtab)
-    {
-      for (i = 0; i < u->nentries; i++)
-	{
-	  uentry_freeComplete (u->entries[i]);
-	}
-    }
-  else
-    {
-      for (i = 0; i < u->nentries; i++)
-	{
-	  uentry_free (u->entries[i]);
-	}
-    }
-
-  guardSet_free (u->guards);
-  sfree (u->entries);
-
-  if (u != globtab 
-      && u != utab
-      && u != filetab)
-    {
-      llassert (u->htable == NULL);
-      sfree (u);
-    }
-
-/*@-mustfree@*/
-} /*@=mustfree@*/
-
-static void
-usymtab_freeAux (/*@only@*/ usymtab u)
-   /*@globals globtab, utab, filetab@*/
-   /*@modifies u@*/
-{
-  while (u != GLOBAL_ENV)
-    {
-      usymtab t = u->env;
-      usymtab_freeLevel (u);
-      u = t;
-      /*@-branchstate@*/ 
-    } 
-  /*@=branchstate@*/
-}
-
-void usymtab_free () 
-  /*@globals killed utab, globtab, filetab@*/ 
-  /*@modifies utab@*/
-{
-  dbgfree = TRUE;
-  usymtab_freeAux (utab);
-}
-
-static int usymtab_lexicalLevel (void) /*@globals utab@*/
-{
-  return (utab->lexlevel);
-}
-
-bool usymtab_inGlobalScope () /*@globals utab, globtab@*/
-{
-  return (utab == globtab);
-}
-
-bool usymtab_inFileScope () /*@globals utab@*/
-{
-  return (utab->lexlevel == fileScope);
-}
-
-bool usymtab_inFunctionScope () /*@globals utab@*/
-{
-  return (utab->lexlevel == functionScope);
-}
-
-# ifndef NOLCL
-void
-usymtab_replaceEntry (uentry s)
-  /*@globals utab, globtab@*/
-  /*@modifies utab, s@*/
-{
-  usymtab_replaceEntryAux (utab, s);
-}
-# endif
-
-bool
-usymtab_matchForwardStruct (usymId u1, usymId u2)
-   /*@globals globtab@*/
-{
-  uentry ue1 = usymtab_getTypeEntry (u1);
-  uentry ue2 = usymtab_getTypeEntry (u2);
-
-  if (uentry_isAnyTag (ue2))
-    {
-      ctype reptype = uentry_getType (ue1);
-      
-      if (ctype_isPointer (reptype))
-	{
-	  ctype repbase = ctype_getBaseType (reptype);
-  
-	  if (ctype_isUA (repbase))
-	    {
-	      typeId rtuid = ctype_typeId (repbase);
-
-	      if (u2 == rtuid) return TRUE;
-	      
-	      if (usymId_isValid (rtuid))
-		{
-		  reptype = uentry_getType (usymtab_getTypeEntry (rtuid));
-		  
-		  return (ctype_isUA (reptype) && (u2 == (ctype_typeId (reptype))));
-		}
-	    }
-	}
-    }
-  
-  return FALSE;
-}
-
-void usymtab_addGuards (guardSet guards)
-  /*@modifies utab@*/
-{
-  utab->guards = guardSet_union (utab->guards, guards);
-  }
-
-static bool usymtab_isGuardedAux (sRef s)
-  /*@globals utab@*/
-{
-  usymtab tab = utab;
-  sRef base = sRef_getRootBase (s);
-  int lowlevel = paramsScope;
-  int baselevel = sRef_lexLevel (base);
-
-  if (sRef_isCvar (base))
-    {
-      lowlevel = baselevel;
-      if (lowlevel < paramsScope) lowlevel = paramsScope;
-    }
-  
-  while (tab->lexlevel >= lowlevel)
-    {
-      if (guardSet_isGuarded (tab->guards, s))
-	{
-	  /*
-	  if (!sRef_definitelyNull (s))
-	    {
-	      sRef_setNotNull (s, fileloc_undefined);
-	    }
-	    */
-	  return TRUE;
-	}
-
-      tab = usymtab_dropEnv (tab);
-    }
-  
-  return FALSE;
-}
-
-void usymtab_unguard (sRef s) /*@modifies utab@*/
-{
-  usymtab tab = utab;
-  sRef base = sRef_getRootBase (s);
-  int lowlevel = paramsScope;
-  int baselevel = sRef_lexLevel (base);
-  
-  if (sRef_isCvar (base))
-    {
-      lowlevel = baselevel;
-      if (lowlevel < paramsScope) lowlevel = paramsScope;
-    }
-
-  while (tab->lexlevel >= lowlevel)
-    {
-      if (guardSet_isGuarded (tab->guards, s))
-	{
-	  guardSet_delete (tab->guards, s);
-	}
-      
-      tab = usymtab_dropEnv (tab);
-    }
-}
-
-bool usymtab_isGuarded (sRef s)
-{
-  
-  return (sRef_aliasCompleteSimplePred (usymtab_isGuardedAux, s));
-}
-
-bool usymtab_isProbableNull (sRef s)
-{
-  return (sRef_aliasCheckSimplePred (usymtab_isProbableNullAux, s));
-}
-
-bool usymtab_isProbableDeepNull (sRef s)
-{
-  return (sRef_deepPred (usymtab_isProbableNull, s));
-}
-
-static bool usymtab_isProbableNullAux (sRef s)
-  /*@globals utab@*/
-{
-  usymtab tab = utab;
-  sRef base = sRef_getRootBase (s);
-  int  lowlevel = paramsScope;
-  
-  if (sRef_isCvar (base))
-    {
-      lowlevel = sRef_lexLevel (base);
-      if (lowlevel < paramsScope) lowlevel = paramsScope;
-    }
-  
-  while (tab->lexlevel >= lowlevel)
-    {
-      if (guardSet_isProbableNull (tab->guards, s))
-	{
-	  return TRUE;
-	}
-      
-      while (tab->kind == US_CBRANCH) 
-	{
-	  tab = tab->env;
-	}
-
-      llassert (usymtab_isDefined (tab));
-
-      if (tab->kind == US_FBRANCH)
-	{
-	  tab = tab->env;
-	  llassert (tab->kind == US_TBRANCH);
-	}
-      
-      tab = tab->env;
-    }
-
-  return FALSE;
-}
-
-void
-usymtab_printGuards ()
-  /*@globals utab, globtab@*/
-{
-  usymtab ttab = utab;
-
-  while (ttab != globtab)
-    {
-      llmsg (message ("Guards [%d]: %q", ttab->lexlevel,
-		      guardSet_unparse (ttab->guards)));
-      ttab = ttab->env;
-    }
-}
-
-void
-usymtab_displayAllUses ()
-  /*@globals utab, globtab@*/
-{
-  usymtab copy;
-
-  /* only in top scope */
-  llassert (utab == globtab);
-
-  /* need a copy, so order is not messed up by sort! */  
-  copy = usymtab_shallowCopy (globtab); 
-  
-  qsort (copy->entries, (size_t)copy->nentries, 
-	 sizeof (*copy->entries), (int (*)(const void *, const void *)) uentry_xcompareuses);
-
-  usymtab_entries (copy, ue)
-    {
-      if (uentry_isValid (ue))
-	{
-	  filelocList uses = uentry_getUses (ue);
-	  int size = filelocList_realSize (uses);
-
-	  if (fileloc_isDefined (uentry_whereDefined (ue)) 
-	      && !fileloc_isLib (uentry_whereDefined (ue))
-	      && (size > 0))
-	    {
-	      llmsg (message ("%q (%q), %d use%p:\n   %q", 
-			      uentry_getName (ue),
-			      fileloc_unparse (uentry_whereDefined (ue)),
-			      size, filelocList_unparseUses (uses)));
-	    }
-	}
-    } end_usymtab_entries;
-  
-  usymtab_shallowFree (copy);
-}
-
-static /*@dependent@*/ /*@exposed@*/ usymtab
-usymtab_getFileTab ()
-  /*@globals filetab@*/
-{
-  llassert (filetab != NULL);
-
-  return filetab;
-}
-
-/*@only@*/ cstring
-usymtab_unparseStack ()
-  /*@globals utab@*/
-{
-  return (usymtab_unparseStackTab (utab));
-}
- 
-static /*@only@*/ cstring
-usymtab_unparseStackTab (usymtab t)
-{
-  bool firstOne = TRUE;
-  cstring ret = cstring_makeLiteral ("[");
-
-  while (t != GLOBAL_ENV)
-    {
-      if (firstOne)
-	{
-	  ret = message ("%q %q", ret, usymtab_typeName (t));
-	  firstOne = FALSE;
-	}
-      else
-	{
-	  ret = message ("%q, %q", ret, usymtab_typeName (t));
-	}
-      t = t->env;
-    }
-
-  ret = message ("%q ]", ret);
-  return ret;
-}
-
-static /*@only@*/ cstring
-usymtab_typeName (/*@notnull@*/ usymtab t)
-{
-  switch (t->kind)
-    {
-    case US_GLOBAL:  return cstring_makeLiteral ("global");
-    case US_NORMAL:  return cstring_makeLiteral ("normal");
-    case US_TBRANCH: return cstring_makeLiteral ("true");
-    case US_FBRANCH: return cstring_makeLiteral ("false");
-    case US_CBRANCH: return cstring_makeLiteral ("case");
-    case US_SWITCH:  return cstring_makeLiteral ("switch");
-    }
-  
-  BADEXIT;
-}
-
-void usymtab_testInRange (sRef s, int index) /*@globals utab;@*/
-{
-  /*@i22*/
-  /*@-globs*/
-  environmentTable_testInRange (utab->environment, s, index);
-  /*@=globs*/
-}
-void usymtab_postopVar (sRef sr) /*@globals utab;@*/
-{
-  environmentTable_postOpvar (utab->environment, sr);
-  
-}
-/* doesn't do much check here assumes checking is done before call*/
-void usymtab_addExactValue(sRef s1, int val)
-{
-  /*@i22@*/ utab->environment = environmentTable_addExactValue (utab->environment, s1, val);
-}
-  
-void usymtab_addMustAlias (sRef s, sRef al)
-  /*@modifies utab@*/
-{
-  if (sRef_isMeaningful (s) && sRef_isMeaningful (al)
-      && !(sRef_isConst (s) || sRef_isConst (al))
-      && !(sRef_isAddress (al) && sRef_isDirectParam (sRef_getBase (al)))
-      && !(sRef_similar (s, al)))
-    {
-      utab->aliases = aliasTable_addMustAlias (utab->aliases, s, al); 
-      DPRINTF (("Must alias: %s", aliasTable_unparse (utab->aliases)));
-
-      /*
-      ** for local variable, aliasing is symmetric 
-      */
-      
-      if (sRef_isLocalVar (s) && sRef_isLocalVar (al))
-	{
-	  utab->aliases = aliasTable_addMustAlias (utab->aliases, al, s); 
-	}
-    }
-  else
-    {
-      ;
-    }
-}
-
-/*
-** Same as usymtab_addMustAlias, except does not check sRef_isSimilar.
-*/
-
-void usymtab_addForceMustAlias (sRef s, sRef al)
-  /*@modifies utab@*/
-{
-  if (sRef_isMeaningful (s) 
-      && sRef_isMeaningful (al)
-      && !(sRef_isConst (s) || sRef_isConst (al))
-      && !(sRef_isAddress (al) && sRef_isDirectParam (sRef_getBase (al))))
-    {
-      utab->aliases = aliasTable_addMustAlias (utab->aliases, s, al); 
-      DPRINTF (("Must alias: %s", aliasTable_unparse (utab->aliases)));
-
-      /*
-      ** for local variable, aliasing is symmetric 
-      */
-      
-      if (sRef_isLocalVar (s) && sRef_isLocalVar (al))
-	{
-	  utab->aliases = aliasTable_addMustAlias (utab->aliases, al, s); 
-	}
-    }
-  else
-    {
-      ;
-    }
-}
-
-void usymtab_clearAlias (sRef s)
-  /*@modifies utab, s@*/
-{
-  
-  aliasTable_clearAliases (utab->aliases, s); 
-}
-
-sRefSet usymtab_allAliases (sRef s)
-   /*@globals utab@*/  
-{
-  if (sRef_isMeaningful (s))
-    {
-      sRefSet ret;
-
-            
-      ret = sRefSet_unionFree (aliasTable_aliasedBy (utab->aliases, s),
-			       aliasTable_canAlias (utab->aliases, s));
-            return (ret);
-    }
-  else
-    {
-      return sRefSet_undefined;
-    }
-}
-
-/*@only@*/ sRefSet usymtab_canAlias (sRef s)
-  /*@globals utab@*/
-{
-  if (sRef_isMeaningful (s))
-    {
-      sRefSet res = aliasTable_canAlias (utab->aliases, s);
-
-      return res;
-    }
-
-  return sRefSet_undefined;
-}
-
-/*@only@*/ sRefSet usymtab_aliasedBy (sRef s)
-  /*@globals utab@*/
-{
-  return (aliasTable_aliasedBy (utab->aliases, s));
-}
-
-/*@only@*/ cstring usymtab_unparseAliases ()
-  /*@globals utab@*/
-{
-  return (aliasTable_unparse (utab->aliases));
-}
-
-/*
-** Debugging routines:
-**    okay to leak storage here, only for debugging 
-*/
-
-/*@-mustfree@*/ 
-
-void
-usymtab_printOut (void)
-  /*@globals utab@*/
-{
-  int i;
-  usymtab s = utab;
-  int depth = 0;
-  char *ind = mstring_copy ("               ");
-
-  fprintf (g_msgstream, "<<< [symbol table] >>>\n");
-  
-  while (s != GLOBAL_ENV && s->env != GLOBAL_ENV)
-    {
-      cstring tname = usymtab_typeName (s);
-
-      if (depth < 5)
-	{
-	  ind[depth * 3 + 1] = '\0';
-	}
-     
-      fprintf (g_msgstream, "level: %d (%s)\n", s->lexlevel,
-	       cstring_toCharsSafe (tname));
-
-      cstring_free (tname);
-
-      for (i = 0; i < s->nentries; i++)
-	{
-	  cstring us = uentry_unparseFull (s->entries[i]);
-	  fprintf (g_msgstream, "%s\n", cstring_toCharsSafe (us));
-	  cstring_free (us);
-	}
-      
-      if (s->reftable != NULL && s->nentries > 0)
-	{
-	  fprintf (g_msgstream, "\t<< Ref table >>\n");
-
-	  for (i = 0; i < s->nentries; i++)
-	    {
-	      fprintf (g_msgstream, "\t%s %3d: %d, %d\n", ind, i, 
-		       s->reftable[i]->level,
-		       s->reftable[i]->index);
-	    }
-	}
-
-      ind[depth * 3 + 1] = ' ';
-      depth++;
-      s = s->env;
-    }
-  fprintf (g_msgstream, "<<< end usymtab >>>\n");
-  mstring_free (ind);
-  return;
-}
-
-void
-usymtab_printTypes ()
-  /*@globals globtab@*/
-{
-  usymtab_printAllAux (globtab);
-}
-
-void 
-usymtab_printAll (void)
-  /*@globals utab@*/
-{
-  usymtab_printAllAux (utab);
-}
-
-static void
-usymtab_printAllAux (usymtab s)
-   /*@modifies g_msgstream@*/
-{
-  int i;
-  int depth = 0;
-  char *ind = mstring_copy ("               ");
-
-  printf ("[[[ usymtab ]]]");
-
-  while (s != GLOBAL_ENV)
-    {
-      if (depth < 5)
-	ind[depth * 3 + 1] = '\0';
-      
-      if (s->env == GLOBAL_ENV)
-	{
-	  int looplow;
-
-	  printf ("level: %d / break: %s / exit: %s\n", s->lexlevel,
-		  cstring_toCharsSafe (bool_unparse (s->mustBreak)), 
-		  cstring_toCharsSafe (exitkind_unparse (s->exitCode)));
-
-	  looplow = 0;
-
-	  for (i = looplow; i < s->nentries; i++)
-	    {
-	      printf ("%s%3d. %s\n", ind, i, 
-		      cstring_toCharsSafe (uentry_unparseFull (s->entries[i])));
-	    }
-	}
-      else
-	{
-	  printf ("level: %d / break: %s / exit: %s\n", s->lexlevel,
-		  cstring_toCharsSafe (bool_unparse (s->mustBreak)),
-		  cstring_toCharsSafe (exitkind_unparse (s->exitCode)));
-
-	  for (i = 0; i < s->nentries; i++)
-	    {
-	      printf ("%s%3d %s\n", ind, i, 
-		     cstring_toCharsSafe (uentry_unparseFull (s->entries[i])));
-	    }
-	}
-      
-      ind[depth * 3 + 1] = ' ';
-      depth++;
-      s = s->env;
-    }
-  printf ("----------\n");
-}
-
-void
-usymtab_printComplete ()
-  /*@globals utab@*/
-{
-  int i;
-  int depth = 0;
-  char *ind = mstring_copy ("               ");
-  usymtab s = utab;
-
-  while (s != GLOBAL_ENV)
-    {
-      if (depth < 5)
-	{
-	  ind[depth * 3 + 1] = '\0';
-	}
-      
-      if (s->env == GLOBAL_ENV)
-	{
-	  int looplow;
-
-	  printf ("level: %d\n", s->lexlevel);
-
-	  looplow = 0;
-
-	  for (i = looplow; i < s->nentries; i++)
-	    {
-	      printf ("%s%3d %s\n", ind, i, 
-		      cstring_toCharsSafe (uentry_unparse (s->entries[i])));
-	    }
-	}
-      else
-	{
-	  printf ("level: %d\n", s->lexlevel);
-	  for (i = 0; i < s->nentries; i++)
-	    {
-	      printf ("%s%3d %s\n", ind, i, 
-		     cstring_toCharsSafe (uentry_unparse (s->entries[i])));
-	    }
-	}
-      
-      ind[depth * 3 + 1] = ' ';
-      depth++;
-      s = s->env;
-    }
-
-  printf ("----------\n");
-  mstring_free (ind);
-}
-
-static /*@only@*/ cstring /*@unused@*/ 
-usymtab_unparseLocalAux (/*@notnull@*/ usymtab s)
-{
-  cstring c = message ("lexlevel: %d\n", s->lexlevel);
-  int i;
-
-  for (i = 0; i < s->nentries; i++)
-    {
-      c = message ("%q\n%q", c, uentry_unparseFull (s->entries[i]));
-    }
-
-  c = message ("%q\n=========", c);
-  return (c);
-}
-
-static cstring /*@unused@*/ /*@only@*/ 
-usymtab_unparseLocalList (/*@notnull@*/ usymtab s)
-{
-  cstring c = message ("[%d/%s/%s] ", s->lexlevel, 
-		       bool_unparse (s->mustBreak), 
-		       exitkind_unparse (s->exitCode));
-  int i;
-
-  for (i = 0; i < s->nentries; i++)
-    {
-      sRef sr = uentry_getSref (s->entries[i]);
-
-      if (i == 0)
-	{
-	  c = message ("%q: %q [%b]", c, uentry_getName (s->entries[i]), 
-		       sRef_isStateDefined (sr));
-	}
-      else
-	{
-	  c = message ("%q, %q [%b]", c, uentry_getName (s->entries[i]), 
-		       sRef_isStateDefined (sr));
-	}
-
-    }
-
-  return (c);
-}
-
-void
-usymtab_printLocal (void)
-  /*@globals utab@*/
-{
-  int i;
-  usymtab s = utab;
-
-  printf ("lexlevel: %d\n", s->lexlevel);
-
-  for (i = 0; i < s->nentries; i++)
-    {
-      printf ("%s\n", cstring_toCharsSafe (uentry_unparseFull (s->entries[i])));
-    }
-  
-  while (s->lexlevel > 1)
-    {
-      s = s->env;
-    }
-
-  llassert (usymtab_isDefined (s));
-
-  printf ("Params:\n");
-
-  for (i = 0; i < s->nentries; i++)
-    {
-      printf ("%d: %s\n", i, 
-	      cstring_toCharsSafe (uentry_unparseFull (s->entries[i])));
-    }
-}
-/*@=mustfree@*/
-
-static bool checkDistinctExternalName (uentry e)
-  /*@globals globtab@*/
-  /*@modifies *g_msgstream@*/
-{
-  int checklen = context_getValue (FLG_EXTERNALNAMELEN);
-  bool ignorecase = context_getFlag (FLG_EXTERNALNAMECASEINSENSITIVE);
-  bool gotone = FALSE;
-  bool extras = FALSE;
-  bool hasError = FALSE;
-  cstring name = uentry_rawName (e);
-  usymtab st = globtab;
-
-  if (checklen == 0)
-    {
-      ;
-    }
-  else
-    {
-      if (uentry_isAnyTag (e)) 
-	{
-	  checklen++;  /* the tag marker doesn't count */
-	}
-    }
-
-  usymtab_entries (st, oe)
-    {
-      if (uentry_sameObject (oe, e))
-	{
-	  continue;
-	}
-
-      if (checklen == 0)
-	{
-	  if (cstring_equalCaseInsensitive (uentry_rawName (oe), name))
-	    {
-	      if (gotone)
-		{
-		  extras = TRUE;
-		  break;
-		}
-	      
-	      if (optgenerror 
-		  (FLG_DISTINCTEXTERNALNAMES,
-		   message 
-		   ("External identifier %q is not distinguishable from %q "
-		    "because alphabetical case is ignored",
-		    uentry_getName (e),
-		    uentry_getName (oe)),
-		   uentry_whereLast (e)))
-		{
-		  uentry_showWhereAny (oe);
-		  uentry_setHasNameError (oe);
-		  gotone = TRUE;
-		}
-	    }
-	}
-      else
-	{
-	  if (ignorecase)
-	    {
-	      if (cstring_equalLenCaseInsensitive (uentry_rawName (oe),
-						   name, checklen))
-		{
-		  if (gotone)
-		    {
-		      extras = TRUE;
-		      break;
-		    }
-		  
-		  if (cstring_equalLen (uentry_rawName (oe), name, checklen))
-		    {
-		      if (optgenerror 
-			  (FLG_DISTINCTEXTERNALNAMES,
-			   /*@-sefparams@*/
-			   message 
-			   ("External identifier %q is not distinguishable from %q "
-			    "in the first %d characters (%q)",
-			    uentry_getName (e),
-			    uentry_getName (oe),
-			    checklen,
-			    cstring_clip (uentry_getName (e), checklen)),
-			   /*@=sefparams@*/
-			   uentry_whereLast (e)))
-			{
-			  uentry_showWhereAny (oe);
-			  uentry_setHasNameError (oe);
-			  gotone = TRUE;
-			}
-		    }
-		  else
-		    {
-		      if (gotone)
-			{
-			  extras = TRUE;
-			  break;
-			}
-		      
-		      if (optgenerror 
-			  (FLG_DISTINCTEXTERNALNAMES,
-			   message 
-			   ("External identifier %q is not distinguishable from %q "
-			    "in the first %d characters because alphabetical case "
-			    "is ignored",
-			    uentry_getName (e),
-			    uentry_getName (oe),
-			    checklen),
-			   uentry_whereLast (e)))
-			{
-			  uentry_showWhereAny (oe);
-			  uentry_setHasNameError (oe);
-			  gotone = TRUE;
-			}
-		    }
-		}
-	    }
-	  else if (cstring_equalLen (uentry_rawName (oe), name, checklen))
-	    {
-	      if (gotone)
-		{
-		  extras = TRUE;
-		  break;
-		}
-	      
-	      if (optgenerror 
-		  (FLG_DISTINCTEXTERNALNAMES,
-		   /*@-sefparams@*/
-		   message 
-		   ("External identifier %q is not distinguishable from %q "
-		    "in the first %d characters (%q)",
-		    uentry_getName (e),
-		    uentry_getName (oe),
-		    checklen,
-		    cstring_clip (uentry_getName (e), checklen)),
-		   /*@=sefparams@*/
-		   uentry_whereLast (e)))
-		{
-		  uentry_showWhereAny (oe);
-		  uentry_setHasNameError (oe);
-		  gotone = TRUE;
-		}
-	    }
-	  else
-	    {
-	      ; /* okay */
-	    }
-	}
-    } end_usymtab_entries ;
-
-  hasError = gotone;
-  
-  if (extras)
-    {
-      llgenindentmsgnoloc
-	(cstring_makeLiteral ("One or more additional "
-			      "indistinguishable external "
-			      "names not reported"));
-    }
-
-  return hasError;
-}
-
-static bool checkDistinctInternalName (uentry e)
-  /*@globals utab@*/
-  /*@modifies *g_msgstream@*/
-{
-  usymtab ttab = utab;
-  cstring name = uentry_rawName (e);
-  int numchars = context_getValue (FLG_INTERNALNAMELEN);
-  bool caseinsensitive = context_getFlag (FLG_INTERNALNAMECASEINSENSITIVE);
-  bool lookalike = context_getFlag (FLG_INTERNALNAMELOOKALIKE);
-
-  if (uentry_isAnyTag (e) && (numchars != 0))
-    {
-      numchars++;  /* the tag marker doesn't count */
-    }
-  
-  while (usymtab_isDefined (ttab))
-    {
-      usymtab_entries (ttab, oe)
-	{
-	  if (uentry_sameObject (oe, e))
-	    {
-	      /*@innercontinue@*/ continue;
-	    }
-
-	  switch (cstring_genericEqual
-		  (name, uentry_rawName (oe),
-		   numchars, caseinsensitive, lookalike))
-	    {
-	    case CGE_DISTINCT: /* okay */
-	      /*@switchbreak@*/ 
-	      break;
-	    case CGE_SAME:
-	      if (cstring_equal (name, uentry_rawName (oe)))
-		{
-		  ; /* got a shadow error */
-		}
-	      else
-		{
-		  if (optgenerror 
-		      (FLG_DISTINCTINTERNALNAMES,
-		       /*@-sefparams@*/
-		       message 
-		       ("Internal identifier %q is not distinguishable from %q "
-			"in the first %d characters (%q)",
-			uentry_getName (e),
-			uentry_getName (oe),
-			numchars,
-			cstring_clip (uentry_getName (e), numchars)),
-		       /*@=sefparams@*/
-		       uentry_whereLast (e)))
-		    {
-		      uentry_showWhereAny (oe);
-		      uentry_setHasNameError (oe);
-		      return TRUE;
-		    }
-		}
-	      /*@switchbreak@*/
-	      break;
-	    case CGE_CASE:
-	      if (numchars == 0 
-		  || (cstring_length (name) <= numchars))
-		{
-		  if (optgenerror 
-		      (FLG_DISTINCTINTERNALNAMES,
-		       message 
-		       ("Internal identifier %q is not distinguishable from %q "
-			"without case sensitivity",
-			uentry_getName (e),
-			uentry_getName (oe)),
-		       uentry_whereLast (e)))
-		    {
-		      uentry_showWhereAny (oe);
-		      uentry_setHasNameError (oe);
-		      return TRUE;
-		    }
-		}
-	      else 
-		{
-		  if (optgenerror 
-		      (FLG_DISTINCTINTERNALNAMES,
-		       message 
-		       ("Internal identifier %q is not distinguishable from %q "
-			"in the first %d characters without case sensitivity",
-			uentry_getName (e),
-			uentry_getName (oe),
-			numchars),
-		       uentry_whereLast (e)))
-		    {
-		      uentry_showWhereAny (oe);
-		      uentry_setHasNameError (oe);
-		      return TRUE;
-		    }
-		}
-	      /*@switchbreak@*/ 
-	      break;
-	    case CGE_LOOKALIKE:
-	      if (numchars == 0 
-		  || (cstring_length (name) <= numchars))
-		{
-		  if (optgenerror 
-		      (FLG_DISTINCTINTERNALNAMES,
-		       message 
-		       ("Internal identifier %q is not distinguishable from %q "
-			"except by lookalike characters",
-			uentry_getName (e),
-			uentry_getName (oe)),
-		       uentry_whereLast (e)))
-		    {
-		      uentry_showWhereAny (oe);
-		      uentry_setHasNameError (oe);
-		      return TRUE;
-		    }
-		}
-	      else 
-		{
-		  if (optgenerror 
-		      (FLG_DISTINCTINTERNALNAMES,
-		       message 
-		       ("Internal identifier %q is not distinguishable from %q "
-			"in the first %d characters except by lookalike characters",
-			uentry_getName (e),
-			uentry_getName (oe),
-			numchars),
-		       uentry_whereLast (e)))
-		    {
-		      uentry_showWhereAny (oe);
-		      uentry_setHasNameError (oe);
-		      return TRUE;
-		    }
-		}
-	    }
-	} end_usymtab_entries ;
-      
-      ttab = ttab->env;
-    }
-
-  return FALSE;
-}
-
-void usymtab_checkDistinctName (uentry e, int scope)
-   /*@globals utab, globtab@*/
-{
-  bool hasError = FALSE;
-  fileloc where = uentry_whereLast (e);
-
-  if (!fileloc_isPreproc (where)  && !fileloc_isBuiltin (where))
-    {
-      if (scope == globScope)
-	{
-	  if (context_getFlag (FLG_DISTINCTEXTERNALNAMES))
-	    {
-	      hasError = checkDistinctExternalName (e);
-	    }
-	}
-      
-      if (!hasError && context_getFlag (FLG_DISTINCTINTERNALNAMES))
-	{
-	  hasError = checkDistinctInternalName (e);
-	}
-    }
-
-  if (hasError)
-    {
-            uentry_setHasNameError (e);
-    }
-}
-
diff --git a/src/usymtab_interface.c b/src/usymtab_interface.c
deleted file mode 100644
index 9d486d2..0000000
--- a/src/usymtab_interface.c
+++ /dev/null
@@ -1,1733 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** usymtab_interface.c
-**
-** Grammar interface to symtab.
-**
-** The LCLint parser will build symbol tables for abstract types and
-** function declarations.
-**
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-# include "gram.h"
-# include "lclscan.h"
-# include "lclsyntable.h"
-# include "lslparse.h"
-# include "usymtab_interface.h"
-# include "structNames.h"
-
-static void 
-  declareFcnAux (fcnNode p_f, /*@only@*/ qtype p_qt, ctype p_ct, typeId p_tn, 
-		 bool p_priv, bool p_spec);
-
-static uentryList paramNodeList_toUentryList (paramNodeList p_p);
-static /*@observer@*/ cstring getVarName (/*@null@*/ typeExpr p_x);
-static qtype convertLclTypeSpecNode (/*@null@*/ lclTypeSpecNode p_n);
-static ctype convertTypeExpr (ctype p_c, /*@null@*/ typeExpr p_x);
-static ctype convertCTypeExpr (ctype p_c, /*@null@*/ typeExpr p_x);
-static /*@exposed@*/ sRef fixTermNode (termNode p_n, fcnNode p_f, uentryList p_cl);
-static sRefSet fixModifies (fcnNode p_f, uentryList p_cl);
-
-static uentryList
-  convertuentryList (stDeclNodeList x)
-{
-  uentryList fl = uentryList_new ();
-
-  
-  stDeclNodeList_elements (x, i)
-  {
-    declaratorNodeList d = i->declarators;
-    qtype q = convertLclTypeSpecNode (i->lcltypespec);
-
-    declaratorNodeList_elements (d, j)
-    {
-      idDecl id;
-
-      qtype_setType (q, convertTypeExpr (qtype_getType (q), j->type));
-      id = idDecl_create (cstring_copy (getVarName (j->type)), qtype_copy (q));
-      fl = uentryList_add (fl, uentry_makeIdVariable (id));
-      idDecl_free (id);
-    } end_declaratorNodeList_elements;
-
-    qtype_free (q);
-  } end_stDeclNodeList_elements;
-
-  
-  return (fl);
-}
-
-static uentryList
-  convert_uentryList (paramNodeList x)
-{
-  uentryList p = uentryList_undefined;
-  bool first_one = TRUE;
-
-  
-  paramNodeList_elements (x, i)
-  {
-    if (i != (paramNode) 0)
-      {
-	if (paramNode_isElipsis (i))
-	  {
-	    first_one = FALSE;
-	    p = uentryList_add (p, uentry_makeElipsisMarker ());
-	  }
-	else
-	  {
-	    qtype q = convertLclTypeSpecNode (i->type);
-	    typeExpr t = i->paramdecl;
-	    
-	    qtype_setType (q, convertTypeExpr (qtype_getType (q), t));
-	    
-	    /* note: has to be like this to hack around void  ???? still */ 
-
-	    if (first_one)
-	      {
-		if (ctype_isVoid (qtype_getType (q)))
-		  {
-		    llassert (uentryList_isUndefined (p));
-		    qtype_free (q);
-		    return (p);
-		  }
-		
-		first_one = FALSE;
-	      }
-	    
-	    /*
-	    ** don't do qualifiers here, will get errors later
-	    */
-
-	    p = uentryList_add (p, uentry_makeUnnamedVariable (qtype_getType (q)));
-	    qtype_free (q);
-	  }
-      }
-    else
-      {
-	llbug (cstring_makeLiteral ("convertuentryList: null paramNode"));
-      }
-  } end_paramNodeList_elements;
-  
-  if (first_one)
-    {
-      llassert (uentryList_isUndefined (p));
-      
-      p = uentryList_makeMissingParams ();
-    }
-
-  return p;
-}
-
-/*
-** convertTypeExpr
-**
-** modify c with pointer, array, function
-**
-** (based on printTypeExpr2 from abstract.c)
-**
-*/
-
-static ctype
-convertTypeExpr (ctype c, typeExpr x)
-{
-  if (x == (typeExpr) 0)
-    {
-      return c;
-    }
-  
-  switch (x->kind)
-    {
-    case TEXPR_BASE:
-      return (c);
-    case TEXPR_PTR:
-      return (convertTypeExpr (ctype_makePointer (c), x->content.pointer));
-    case TEXPR_ARRAY:
-      return (convertTypeExpr (ctype_makeArray (c), x->content.array.elementtype));
-    case TEXPR_FCN:
-      {
-	ctype rv = convertTypeExpr (c, x->content.function.returntype);
-	uentryList p = paramNodeList_toUentryList (x->content.function.args);
-	
-	if (x->content.function.returntype != NULL
-	    && x->content.function.returntype->wrapped == 1 
-	    && ctype_isPointer (rv))
-	  {
-	    rv = ctype_baseArrayPtr (rv);
-	  }
-
-	return (ctype_makeParamsFunction (rv, p));
-      }
-    default:
-      {
-	llfatalbug (message ("convertTypeExpr: unknown typeExprKind: %d",
-			     (int) x->kind));
-      }
-    }
-
-  BADEXIT;
-}
-
-static 
-ctype convertCTypeExpr (ctype c, typeExpr x)
-{
-  if (x == (typeExpr) 0)
-    {
-      return c;
-    }
-
-  switch (x->kind)
-    {
-    case TEXPR_BASE:     return (c);
-    case TEXPR_PTR:  return (convertCTypeExpr (ctype_makePointer (c), 
-						 x->content.pointer));
-    case TEXPR_ARRAY:    return (convertCTypeExpr (ctype_makeArray (c), 
-						 x->content.array.elementtype));
-    case TEXPR_FCN:
-      {
-	ctype rv = convertCTypeExpr (c, x->content.function.returntype);
-	uentryList p = convert_uentryList (x->content.function.args);
-
-	return (ctype_makeParamsFunction (rv, p));
-      }
-    default:
-      {
-	llfatalbug (message ("convertCTypeExpr: unknown typeExprKind: %d", (int) x->kind));
-      }
-    }
-  BADEXIT;
-}
-
-/*
-** convertLclTypeSpecNode
-**
-** LclTypeSpecNode --> ctype
-** this is the base type only!
-*/
-
-/*
-** convertLeaves
-**
-** for now, assume only last leaf is relevant.
-** this should be a safe assumption in general???
-*/
-
-static ctype
-  convertLeaves (ltokenList f)
-{
-  ctype c = ctype_unknown;
-  
-  ltokenList_reset (f);
-  
-  ltokenList_elements (f, current)
-    {
-      switch (ltoken_getCode (current))
-	{
-	case LLT_TYPEDEF_NAME:
-	  {
-	    cstring tn = ltoken_getRawString (current);
-
-	    if (usymtab_existsTypeEither (tn))
-	      {
-		c = ctype_combine (uentry_getAbstractType 
-				   (usymtab_lookupEither (tn)), c);
-	      }
-	    else if (cstring_equalLit (tn, "bool"))
-	      {
-		/*
-		** Bogus...keep consistent with old lcl builtin.
-		*/
-		c = ctype_bool;
-	      }
-	    else
-	      {
-		fileloc loc = fileloc_fromTok (current);
-
-		voptgenerror (FLG_UNRECOG, 
-			      message ("Unrecognized type: %s", tn), loc);
-		fileloc_free (loc);
-		
-		usymtab_supEntry 
-		  (uentry_makeDatatype 
-		   (tn, ctype_unknown, MAYBE, NO, fileloc_getBuiltin ()));
-		
-	      }
-	    /*@switchbreak@*/ break;
-	  }
-	case LLT_CHAR:
-	  c = ctype_combine (ctype_char, c);
-	  /*@switchbreak@*/ break;
-	  
-	case LLT_DOUBLE:
-	  c = ctype_combine (ctype_double, c);
-	  /*@switchbreak@*/ break;
-	case LLT_FLOAT:     
-	  c = ctype_combine (ctype_float, c);
-	  /*@switchbreak@*/ break;
-	case LLT_CONST:    
-	case LLT_VOLATILE: 
-	  /*@switchbreak@*/ break;
-	case LLT_INT:      
-	  c = ctype_combine (ctype_int, c);
-	  /*@switchbreak@*/ break;
-	case LLT_LONG:  
-	  c = ctype_combine (c, ctype_lint); 
-	  /*@switchbreak@*/ break;
-	case LLT_SHORT:    
-	  c = ctype_combine (c, ctype_sint);
-	  /*@switchbreak@*/ break;
-	case LLT_SIGNED:    
-	  c = ctype_combine (c, ctype_int); 
-	  /*@switchbreak@*/ break;
-	case LLT_UNSIGNED:  
-	  c = ctype_combine (c, ctype_uint);
-	  /*@switchbreak@*/ break;
-	case LLT_UNKNOWN:   
-	  c = ctype_combine (ctype_unknown, c);
-	  /*@switchbreak@*/ break;
-	case LLT_VOID:      
-	  c = ctype_combine (ctype_void, c); 
-	  /*@switchbreak@*/ break;
-	case LLT_ENUM:
-	  llcontbug (cstring_makeLiteral ("convertLeaves: enum"));
-	  c = ctype_int; 
-	  /*@switchbreak@*/ break;
-	default:
-	  llfatalbug (message ("convertLeaves: bad token: %q", 
-			       ltoken_unparseCodeName (current)));
-	}
-    } end_ltokenList_elements;
-
-  return c;
-}
-
-static enumNameList
-  convertEnumList (ltokenList enums)
-{
-  enumNameList el = enumNameList_new ();
-
-  if (ltokenList_isDefined (enums))
-    {
-      ltokenList_elements (enums, i)
-	{
-	  enumNameList_addh 
-	    (el, enumName_create (cstring_copy (ltoken_unparse (i))));
-	} end_ltokenList_elements;
-    }
-
-  return el;
-}
-
-static /*@only@*/ qtype 
-  convertLclTypeSpecNode (/*@null@*/ lclTypeSpecNode n)
-{
-  
-  if (n != (lclTypeSpecNode) 0)
-    {
-      qtype result;
-      
-      switch (n->kind)
-	{
-	case LTS_CONJ:
-	  {
-	    qtype c1 = convertLclTypeSpecNode (n->content.conj->a);
-	    qtype c2 = convertLclTypeSpecNode (n->content.conj->b);
-
-	    /*
-	    ** Is it explicit?
-	    */
-
-	    if (fileloc_isLib (g_currentloc)
-		|| fileloc_isStandardLibrary (g_currentloc))
-	      {
-		result = qtype_mergeImplicitAlt (c1, c2);
-	      }
-	    else
-	      {
-		result = qtype_mergeAlt (c1, c2);
-	      }
-	    
-	    break;
-	  }
-	case LTS_TYPE:
-	  llassert (n->content.type != NULL);
-	  result = qtype_create (convertLeaves (n->content.type->ctypes));
-	  break;
-	case LTS_STRUCTUNION:
-	  {
-	    strOrUnionNode sn;
-	    cstring cn = cstring_undefined;
-
-	    sn = n->content.structorunion;
-
-	    llassert (sn != (strOrUnionNode) 0);
-
-	    if (!ltoken_isUndefined (sn->opttagid))
-	      {
-		cn = cstring_copy (ltoken_getRawString (sn->opttagid));
-	      }
-	    else
-	      {
-		cn = fakeTag ();
-	      }
-
-	    switch (sn->kind)
-	      {
-	      case SU_STRUCT:
-		if (usymtab_existsStructTag (cn))
-		  {
-		    
-		    result = qtype_create (uentry_getAbstractType
-					   (usymtab_lookupStructTag (cn)));
-		    cstring_free (cn);
-		  }
-		else
-		  {
-		    uentryList fl = convertuentryList (sn->structdecls);
-		    ctype ct;
-
-		    		    ct = ctype_createStruct (cstring_copy (cn), fl);
-
-		    /*
-		    ** If it was a forward declaration, this could add it to
-		    ** the table.  Need to check if it exists again...
-		    */
-
-		    if (usymtab_existsStructTag (cn))
-		      {
-			result = qtype_create (uentry_getAbstractType
-					       (usymtab_lookupStructTag (cn)));
-		      }
-		    else
-		      {
-			fileloc loc = fileloc_fromTok (n->content.structorunion->tok);
-			uentry ue = uentry_makeStructTag (cn, ct, loc);
-
-			result = qtype_create (usymtab_supTypeEntry (ue));
-		      }
-			
-		    cstring_free (cn);
-		  }
-		/*@switchbreak@*/ break;
-	      case SU_UNION:
-		if (usymtab_existsUnionTag (cn))
-		  {
-		    
-		    result = qtype_create (uentry_getAbstractType
-					   (usymtab_lookupUnionTag (cn)));
-		    cstring_free (cn);
-		  }
-		else
-		  {
-		    uentryList fl;
-		    ctype ct;
-		    
-		    fl = convertuentryList (sn->structdecls);
-		    ct = ctype_createUnion (cstring_copy (cn), fl);
-
-		    /*
-		    ** If it was a forward declaration, this could add it to
-		    ** the table.  Need to check if it exists again...
-		    */
-
-		    
-		    
-		    if (usymtab_existsUnionTag (cn))
-		      {
-			
-			result = qtype_create (uentry_getAbstractType
-					       (usymtab_lookupUnionTag (cn)));
-		      }
-		    else
-		      {
-			fileloc loc = fileloc_fromTok (n->content.structorunion->tok);
-			uentry ue = uentry_makeUnionTag (cn, ct, loc);
-
-			result = qtype_create (usymtab_supTypeEntry (ue));
-		      }
-			
-		    cstring_free (cn);
-		  }
-		/*@switchbreak@*/ break;
-	      BADDEFAULT
-	      }
-	    break;
-	  }
-	case LTS_ENUM:
-	  {
-	    enumSpecNode e = n->content.enumspec;
-	    enumNameList el;
-	    cstring ename;
-	    bool first = TRUE;
-	    ctype ta;
-	    ctype cet;
-
-	    llassert (e != NULL);
-	    el = convertEnumList (e->enums);
-
-	    if (!ltoken_isUndefined (e->opttagid))	/* named enumerator */
-	      {
-		ename = cstring_copy (ltoken_getRawString (e->opttagid));
-	      }
-	    else
-	      {
-		ename = fakeTag ();
-	      }
-
-	    cet = ctype_createEnum (ename, el);
-	    
-	    if (usymtab_existsEnumTag (ename))
-	      {
-		ta = uentry_getAbstractType (usymtab_lookupEnumTag (ename));
-	      }
-	    else
-	      {	
-		fileloc loc = fileloc_fromTok (e->tok);
-		uentry ue = uentry_makeEnumTag (ename, cet, loc);
-
-		ta = usymtab_supTypeEntry (ue);
-	      }
-
-	    enumNameList_elements (el, en)
-	      {
-		uentry ue;
-		fileloc loc;
-
-		if (first)
-		  {
-		    ltokenList_reset (e->enums);
-		    first = FALSE;
-		  }
-		else
-		  {
-		    ltokenList_advance (e->enums);
-		  }
-
-		loc = fileloc_fromTok (ltokenList_current (e->enums));
-		ue = uentry_makeSpecEnumConstant (en, cet, loc);
-
-		/*
-		** Can't check name here, might not have
-		** type yet.  Will check in .lh file?
-		*/
-		
-		ue = usymtab_supGlobalEntryReturn (ue);
-		
-		if (context_inLCLLib ())
-		  {
-		    uentry_setDefined (ue, loc);
-		  }
-	      } end_enumNameList_elements;
-	    
-	    result = qtype_create (ta);
-	  }
-	  break;
-	default:
-	  {
-	    llfatalbug (message ("convertLclTypeSpecNode: unknown lclTypeSpec kind: %d",
-				 (int) n->kind));
-	  }
-	}
-      
-      result = qtype_addQualList (result, n->quals);
-
-      if (n->pointers > 0)
-	{
-	  qtype_adjustPointers (n->pointers, result);
-	}
-
-      return result;
-    }
-  else
-    {
-      llcontbug (cstring_makeLiteral ("convertLclTypeSpecNode: null"));
-      return qtype_unknown (); 
-    }
-  BADEXIT;
-} 
-
-static /*@only@*/ multiVal
-  literalValue (ctype ct, ltoken lit)
-{
-  cstring text = cstring_fromChars (lsymbol_toChars (ltoken_getText (lit)));
-  char first;
-
-  if (cstring_length (text) > 0)
-    {
-      first = cstring_firstChar (text);
-    }
-  else
-    {
-      return multiVal_unknown ();
-    }
-
-  
-  if /*@-usedef@*/ (first == '\"') /*@=usedef@*/
-    {
-      int len = cstring_length (text) - 2;
-      char *val = mstring_create (len);
-      
-      llassert (cstring_lastChar (text) == '\"');
-      strncpy (val, cstring_toCharsSafe (text) + 1, size_fromInt (len));
-      return (multiVal_makeString (cstring_fromCharsO (val)));
-    }
-
-  if (ctype_isDirectInt (ct) || ctype_isPointer (ct))
-    {
-      long val = 0;
-     
-      if (sscanf (cstring_toCharsSafe (text), "%ld", &val) == 1)
-	{
-	  return multiVal_makeInt (val);
-	}
-    }
-
-  return multiVal_unknown ();
-}
-
-
-/*
-** declareConstant
-**
-** unfortunately, because the abstract types are different, this
-** cannot be easily subsumed into declareVar.
-*/
-
-void
-doDeclareConstant (constDeclarationNode c, bool priv)
-{
-  lclTypeSpecNode t;
-  ctype ctx;
-  qtype qt;
-  
-  if (c == (constDeclarationNode) 0)
-    {
-      return;
-    }
-
-  t = c->type;
-  qt = convertLclTypeSpecNode (t);
-
-  ctx = qtype_getType (qt);
-
-  initDeclNodeList_elements (c->decls, i)
-    {
-      ctype ct = convertTypeExpr (ctx, i->declarator->type);
-      cstring s = getVarName (i->declarator->type);
-
-      if (ctype_isFunction (ct))
-	{
-	  fcnNode fcn = fcnNode_fromDeclarator (lclTypeSpecNode_copy (t), 
-						declaratorNode_copy (i->declarator));
-
-	  /* FALSE == unspecified function, only a declaration */
-
-	  doDeclareFcn (fcn, typeId_invalid, priv, FALSE);
-	  fcnNode_free (fcn);
-	}
-      else
-	{
-	  uentry ue;
-	  fileloc loc = fileloc_fromTok (i->declarator->id);
-
-	  if (i->value != (termNode)0 &&
-	      i->value->kind == TRM_LITERAL)
-	    {
-	      ue = uentry_makeConstantAux (s, ct, loc, priv, 
-					   literalValue (ct, i->value->literal));
-	    }
-	  else
-	    {
-	      ue = uentry_makeConstantAux (s, ct, loc, priv, multiVal_unknown ());
-	    }
-
-	  	  uentry_reflectQualifiers (ue, qtype_getQuals (qt));
-
-	  
-	  if (context_inLCLLib () && !priv)
-	    {
-	      uentry_setDefined (ue, loc);
-	    }
-
-	  usymtab_supGlobalEntry (ue);
-	}
-    } end_initDeclNodeList_elements;
-
-  qtype_free (qt);
-}
-
-static cstring
-getVarName (/*@null@*/ typeExpr x)
-{
-  cstring s = cstring_undefined;
-
-  if (x != (typeExpr) 0)
-    {
-      switch (x->kind)
-	{
-	case TEXPR_BASE:
-	  s = ltoken_getRawString (x->content.base);
-	  break;
-	case TEXPR_PTR:
-	  s = getVarName (x->content.pointer);
-	  break;
-	case TEXPR_ARRAY:
-	  s = getVarName (x->content.array.elementtype);
-	  break;
-	case TEXPR_FCN:
-	  s = getVarName (x->content.function.returntype);
-	  break;
-	default:
-	  llfatalbug (message ("getVarName: unknown typeExprKind: %d", (int) x->kind));
-	}
-    }
-
-  return s;
-}
-
-void
-doDeclareVar (varDeclarationNode v, bool priv)
-{
-  lclTypeSpecNode t;
-  qtype c;
-
-  if (v == (varDeclarationNode) 0)
-    {
-      return;
-    }
-
-  t = v->type;
-  c = convertLclTypeSpecNode (t);
-
-  initDeclNodeList_elements (v->decls, i)
-    {
-      ctype ct = convertTypeExpr (qtype_getType (c), i->declarator->type);
-      cstring s = getVarName (i->declarator->type);
-
-      qtype_setType (c, ct);
-
-      if (ctype_isFunction (ct))
-	{
-	  fcnNode fcn;
-
-	  	  
-	  fcn = fcnNode_fromDeclarator (lclTypeSpecNode_copy (t), 
-					declaratorNode_copy (i->declarator));
-
-	  /* FALSE == unspecified function, only a declaration */
-	  declareFcnAux (fcn, qtype_unknown (), ct,
-			 typeId_invalid, priv, FALSE);
-	  fcnNode_free (fcn);
-	}
-      else
-	{
-	  fileloc loc = fileloc_fromTok (i->declarator->id);
-	  uentry le = uentry_makeVariable (s, ct, loc, priv);
-	  
-	  uentry_reflectQualifiers (le, qtype_getQuals (c));
-	  
-	  if (uentry_isCheckedUnknown (le))
-	    {
-	      if (context_getFlag (FLG_IMPCHECKEDSTRICTSPECGLOBALS))
-		{
-		  uentry_setCheckedStrict (le);
-		}
-	      else if (context_getFlag (FLG_IMPCHECKEDSPECGLOBALS))
-		{
-		  uentry_setChecked (le);
-		}
-	      else if (context_getFlag (FLG_IMPCHECKMODSPECGLOBALS))
-		{
-		  uentry_setCheckMod (le);
-		}
-	      else
-		{
-		  ; /* okay */
-		}
-	    }
-
-	  if (context_inLCLLib () && !priv)
-	    {
-	      uentry_setDefined (le, loc);
-	    }
-
-	  if (initDeclNode_isRedeclaration (i))
-	    {
-	      usymtab_replaceEntry (le);
-	    }
-	  else
-	    {
-	      le = usymtab_supEntrySrefReturn (le);
-	    }
-	}
-    } end_initDeclNodeList_elements;
-
-  qtype_free (c);
-}
-
-static globSet
-processGlob (/*@returned@*/ globSet globs, varDeclarationNode v)
-{
-  if (v == (varDeclarationNode) 0)
-    {
-      return globs;
-    }
-
-  if (v->isSpecial)
-    {
-      globs = globSet_insert (globs, v->sref);
-    }
-  else
-    {
-      lclTypeSpecNode t = v->type;
-      qtype qt = convertLclTypeSpecNode (t);
-      ctype c = qtype_getType (qt);
-      cstring s;      
-
-      initDeclNodeList_elements (v->decls, i)
-	{
-	  ctype ct;
-	  uentry ue;
-	  qualList quals = qtype_getQuals (qt);
-	  
-	  s = getVarName (i->declarator->type);
-	  ue = usymtab_lookupGlobSafe (s);
-	  
-	  if (uentry_isInvalid (ue))
-	    {
-	      ; /* error already reported */ 
-	    }
-	  else
-	    {
-	      if (uentry_isPriv (ue))
-		{
-		  globs = globSet_insert (globs, sRef_makeSpecState ());
-		}
-	      else
-		{
-		  uentry ce = uentry_copy (ue);
-		  ctype lt = uentry_getType (ce);
-		  fileloc loc = fileloc_fromTok (i->declarator->id);
-		  
-		  ct = convertTypeExpr (c, i->declarator->type);
-		  
-		  if (!ctype_match (lt, ct))
-		    {
-		      (void) gentypeerror
-			(lt, exprNode_undefined,
-			 ct, exprNode_undefined,
-			 message ("Global type mismatch %s (%t, %t)",
-				  s, lt, ct), 
-			 loc);
-		    }
-		  
-		  uentry_reflectQualifiers (ce, quals);
-		  globs = globSet_insert (globs,
-					  sRef_copy (uentry_getSref (ce)));
-		  fileloc_free (loc);
-		  uentry_free (ce);
-		}
-	    }
-	} end_initDeclNodeList_elements;
-
-      qtype_free (qt);
-    }
-
-  return globs;
-}
-
-static void
-declareAbstractType (abstractNode n, bool priv)
-{
-  cstring tn;
-  fileloc loc;
-  uentry ue;
-  usymId uid;
-  abstBodyNode ab;
-
-  if (n == (abstractNode) 0)
-    {
-      return;
-    }
-
-  
-  tn = ltoken_getRawString (n->name);
-
-  loc = fileloc_fromTok (n->tok);
-  
-  ue = uentry_makeDatatypeAux (tn, ctype_unknown, 
-			       ynm_fromBool (n->isMutable), YES, loc, priv);
-
-  if (n->isRefCounted)
-    {
-      uentry_setRefCounted (ue);
-    }
-
-  if (context_inLCLLib () && !priv)
-    {
-      uentry_setDefined (ue, loc);
-    }
-
-  uid = usymtab_supAbstractTypeEntry (ue, context_inLCLLib() && !priv);
-  
-
-  if (!priv && (ab = n->body) != (abstBodyNode) 0)
-    {
-      fcnNodeList ops = ab->fcns;
-
-      if (!fcnNodeList_isEmpty (ops))
-	{
-	  fcnNodeList_elements (ops, i)
-	  {
-	    if (i->typespec == (lclTypeSpecNode) 0)
-	      {
-		cstring fname = ltoken_getRawString (i->name);
-
-		if (usymtab_exists (fname))
-		  {
-		    uentry e = usymtab_lookup (fname);
-		    fileloc floc = fileloc_fromTok (i->declarator->id);
-
-		    if (uentry_isForward (e))
-		      {
-			usymtab_supEntry  
-			  (uentry_makeTypeListFunction 
-			   (fname, typeIdSet_insert (uentry_accessType (e), uid), 
-			    floc));
-		      }
-		    else
-		      {
-			usymtab_supEntry 
-			  (uentry_makeSpecFunction 
-			   (fname, uentry_getType (e),
-			    typeIdSet_insert (uentry_accessType (e), uid),
-			    globSet_undefined,
-			    sRefSet_undefined,
-			    floc));
-			
-			if (context_inLCLLib ())
-			  {
-			    llbuglit ("Jolly jeepers Wilma, it ain't dead after all!");
-			  }
-		      }
-		  }
-		else
-		  {
-		    usymtab_supEntry 
-		      (uentry_makeForwardFunction (fname, uid, loc));
-		  }
-	      }
-	    else
-	      {
-		declareFcn (i, uid);
-	      }
-	  } end_fcnNodeList_elements;
-	}
-    }
-}
-
-static void
-  declareExposedType (exposedNode n, bool priv)
-{
-  usymId uid;
-  qtype c;
-  cstring s;
-
-  
-  if (n == (exposedNode) 0)
-    {
-      return;
-    }
-
-  c = convertLclTypeSpecNode (n->type);
-
-  declaratorInvNodeList_elements (n->decls, i)
-  {
-    ctype realType = convertTypeExpr (qtype_getType (c), i->declarator->type);
-    fileloc loc = fileloc_fromTok (i->declarator->id);
-    uentry ue;
-
-    s = getVarName (i->declarator->type);
-
-    ue = uentry_makeDatatypeAux (s, realType, MAYBE, NO, loc, priv);
-
-    uentry_reflectQualifiers (ue, qtype_getQuals (c));
-    
-    if (context_inLCLLib () && !priv)
-      {
-	uentry_setDefined (ue, loc);
-      }
-
-    uid = usymtab_supExposedTypeEntry (ue, context_inLCLLib () && !priv);
-  } end_declaratorInvNodeList_elements;
-
-  qtype_free (c);
-}
-
-/*
-** ah...remember ye old days...
-**
-** wow...same thing in THREE symbol tables!  talk about space efficiency
-** (or as Joe Theory once said, its only a constant factor)
-*/
-
-void
-doDeclareType (typeNode t, bool priv)
-{
-  
-  if (t != (typeNode) 0)
-    {
-      switch (t->kind)
-	{
-	case TK_ABSTRACT:
-	  declareAbstractType (t->content.abstract, priv);
-	  break;
-	  
-	case TK_EXPOSED:
-	  declareExposedType (t->content.exposed, priv);
-	  break;
-	  
-	case TK_UNION:
-	default:
-	  {
-	    llfatalbug (message ("declareType ERROR: unknown kind: %q",
-				 cstring_fromCharsO (FormatInt ((int)t->kind))));
-	  }
-	}
-    }
-  
-}
-
-extern void
-declareIter (iterNode iter)
-{
-  fileloc loc = fileloc_fromTok (iter->name);
-  uentry ue = 
-    uentry_makeIter (ltoken_unparse (iter->name), 
-		     ctype_makeFunction 
-		     (ctype_void,
-		      paramNodeList_toUentryList (iter->params)), 
-		     fileloc_copy (loc));
-  
-  usymtab_supEntry (ue);
-  usymtab_supEntry 
-    (uentry_makeEndIter (ltoken_unparse (iter->name), loc));
-}
-
-/*
-** declareFcn
-*/
-
-static void
-declareFcnAux (fcnNode f, /*@only@*/ qtype qt, ctype ct,
-	       typeId tn, bool priv, bool spec)
-{
-  globalList globals;
-  typeIdSet acct;
-  sRefSet sl = sRefSet_undefined;
-  globSet globlist = globSet_undefined;
-  cstring s = getVarName (f->declarator->type);
-  fileloc loc = fileloc_fromTok (f->declarator->id);
-  uentryList args;
-
-  /*
-  ** type conversion generates args 
-  */
-
-  if (ctype_isFunction (ct))
-    {
-      args = ctype_argsFunction (ct);
-    }
-  else
-    {
-      llcontbug (message ("Not function: %s", ctype_unparse (ct)));
-      args = uentryList_undefined;
-    }
-
-  
-  fileloc_setColumnUndefined (loc);
-
-  if (spec)
-    {
-      globals = f->globals;
-      
-            sl = fixModifies (f, args);
-
-      /*
-      ** Bind let declarations in modifies list 
-      */
-
-      varDeclarationNodeList_elements (globals, glob)
-	{
-	  globlist = processGlob (globlist, glob);
-	} end_varDeclarationNodeList_elements;
-      
-      
-      if (f->checks != (lclPredicateNode) 0)
-	/* push stderr on globalList */
-	/* modifies *stderr^ */
-	{
-	  uentry ue;
-
-	  if (!(usymtab_existsVar (cstring_makeLiteralTemp ("stderr"))))
-	    {
-	      ctype tfile;
-	      
-	      llmsglit ("Global stderr implied by checks clause, "
-			"not declared in initializations.");
-
-	      tfile = usymtab_lookupType (cstring_makeLiteralTemp ("FILE"));
-	      
-	      if (ctype_isUndefined (tfile))
-		{
-		  llmsglit ("FILE datatype implied by checks clause not defined.");
-		  tfile = ctype_unknown;
-		}
-	      
-	      usymtab_supGlobalEntry 
-		(uentry_makeVariable (cstring_makeLiteralTemp ("stderr"), 
-				     tfile, fileloc_getBuiltin (), FALSE));
-	    }
-	  
-	  ue = usymtab_lookupGlob (cstring_makeLiteralTemp ("stderr"));
-	  
-	  	  globlist = globSet_insert (globlist, sRef_copy (uentry_getSref (ue)));
-	  sl = sRefSet_insert (sl, sRef_buildPointer (uentry_getSref (ue)));
-
-	}
-    }
-
-  if (usymId_isInvalid (tn))
-    {
-      acct = context_fileAccessTypes ();
-    }
-  else
-    {
-      acct = typeIdSet_single (tn);
-    }
-  
-  if (usymtab_exists (s))
-    {
-      uentry l = usymtab_lookup (s);
-      uentry ue;
-
-      if (uentry_isForward (l) || (fileloc_isLib (uentry_whereSpecified (l))))
-	{
-	  typeIdSet accessType;
-
-	  if (uentry_isFunction (l))
-	    {
-	      accessType = typeIdSet_union (uentry_accessType (l), 
-					    context_fileAccessTypes ());
-	    }
-	  else
-	    {
-	      accessType = context_fileAccessTypes ();
-	    }
-
-	  if (spec)
-	    {
-	      ue = uentry_makeSpecFunction (s, ct, accessType, globlist, sl, loc);
-	    }
-	  else
-	    {
-	      sRefSet_free (sl);
-	      globSet_free (globlist);
-
-	      ue = uentry_makeUnspecFunction (s, ct, accessType, loc);
-	    }
-
-	  uentry_reflectQualifiers (ue, qtype_getQuals (qt));
-
-	  usymtab_supEntry (ue);
-	}
-      else
-	{
-	  /*
-	  ** error reported by symtable already
-          **
-	  ** llgenerror (message ("Function redeclared: %s (previous declaration: %s)", s,
-	  **		      fileloc_unparse (uentry_whereSpecified (l))),
-	  **	      loc);
-          */
-
-	  
-	  fileloc_free (loc);
-	  sRefSet_free (sl);
-	  globSet_free (globlist);
-	}
-    }
-  else
-    {
-      uentry le;
-      
-      if (spec)
-	{
-	  if (priv)
-	    {
-	      le = uentry_makePrivFunction2 (s, ct, acct, globlist, sl, loc);
-	    }
-	  else
-	    {
-	      le = uentry_makeSpecFunction (s, ct, acct, globlist, sl, loc);
-	    }
-	}
-      else
-	{
-	  le = uentry_makeUnspecFunction (s, ct, acct, loc);
-
-	  sRefSet_free (sl);
-	  globSet_free (globlist);
-	}
-
-      if (context_inLCLLib () && !priv)
-	{
-	  uentry_setDefined (le, loc);
-	}      
-
-      uentry_reflectQualifiers (le, qtype_getQuals (qt));
-
-      switch (f->special)
-	{
-	case QU_UNKNOWN:     break;
-	case QU_PRINTFLIKE:  uentry_setPrintfLike (le); break;
-	case QU_SCANFLIKE:   uentry_setScanfLike (le); break;
-	case QU_MESSAGELIKE: uentry_setMessageLike (le); break;
-	BADDEFAULT;
-	}
-
-      usymtab_supEntry (le);
-    }
-
-  qtype_free (qt);
-}
-
-extern void
-doDeclareFcn (fcnNode f, typeId tn, bool priv, bool spec)
-{
-  qtype qt = convertLclTypeSpecNode (f->typespec);
-  ctype ct = convertTypeExpr (qtype_getType (qt), f->declarator->type);
-
-    declareFcnAux (f, qt, ct, tn, priv, spec);
-}
-
-/*
-** is s is an argument to f, return its arg no.
-** otherwise, return 0
-*/
-
-static int
-getParamNo (cstring s, fcnNode f)
-{
-  /* gasp, maybe should do run-time checks here */
-  paramNodeList params;
-  typeExpr fd = f->declarator->type;
-  
-  /* is this a bug in the LCL grammar? */
-
-  while (fd != NULL && (fd->kind == TEXPR_PTR || fd->kind == TEXPR_ARRAY))
-    {
-      if (fd->kind == TEXPR_PTR)
-	{
-	  fd = fd->content.pointer;
-	}
-      else
-	{
-	  /*@-null@*/ fd = fd->content.array.elementtype; /*@=null@*/
-         
-          /*
-          ** This is a bug in checking, that I should eventually fix.
-	  ** Need some way of deleting the guard from the true branch,
-	  ** but adding it back in the false branch...
-	  */
-	}
-    }
-
-  llassert (fd != NULL);
-
-  if (fd->kind != TEXPR_FCN)
-    {
-      llfatalbug (message ("getParamNo: not a function: %q (%d)",
-			   typeExpr_unparse (fd), (int) fd->kind));
-    }
-
-  params = fd->content.function.args;
-
-  if (paramNodeList_empty (params))
-    {
-      return -1;
-    }
-  else
-    {
-      int pno = 0;
-
-      paramNodeList_elements (params, i)
-	{
-	  if (i->paramdecl != (typeExpr) 0)	/* handle (void) */
-	    {
-	      if (cstring_equal (s, getVarName (i->paramdecl)))
-		{
-		  return pno;
-		}
-	    }
-	  pno++;
-	} end_paramNodeList_elements;
-      return -1;
-    }
-}
-
-static /*@null@*/ /*@observer@*/ termNode
-getLetDecl (cstring s, fcnNode f)
-{
-  letDeclNodeList x = f->lets;
-
-  letDeclNodeList_elements (x, i)
-  {
-    if (cstring_equal (s, ltoken_getRawString (i->varid)))
-      {
-	if (i->sortspec != NULL)
-	  {
-	    llbuglit ("getLetDecl: cannot return sort!");
-	  }
-	else
-	  {			/* is a termNode */
-	    return i->term;
-	  }
-      }
-  } end_letDeclNodeList_elements;
-
-  return (termNode) 0;
-}
-
-/*
-** processTermNode --- based on printTermNode2
-*/
-
-static /*@exposed@*/ sRef 
-  processTermNode (/*@null@*/ opFormNode op, termNodeList args, 
-		   fcnNode f, uentryList cl)
-{
-  if (op != (opFormNode) 0)
-    {
-      switch (op->kind)
-	{
-	case OPF_IF:
-	  llcontbuglit ("processTermNode: OPF_IF: not handled");
-	  break;
-	case OPF_ANYOP:
-	  llcontbuglit ("processTermNode: OPF_ANYOP: not handled");
-	  break;
-	case OPF_MANYOP:
-	  {
-	    int size = termNodeList_size (args);
-
-	    if (size == 1 
-		&& (cstring_equalLit (ltoken_getRawString (op->content.anyop), "'") ||
-		    cstring_equalLit (ltoken_getRawString (op->content.anyop), "^")))
-	      {
-		return (fixTermNode (termNodeList_head (args), f, cl));
-	      }
-	    else 
-	      {
-		;
-	      }
-	    break;
-	  }
-	case OPF_ANYOPM:
-	  {
-	    int size = termNodeList_size (args);
-
-	    if (size == 1 
-		&& (cstring_equalLit (ltoken_getRawString (op->content.anyop), "*")))
-	      {
-		sRef ft;
-		sRef res;
-
-		ft = fixTermNode (termNodeList_head (args), f, cl);
-		res = sRef_buildPointer (ft);
-		return (res);
-	      }
-	    else
-	      {
-		;
-	      }
-	    break;
-	  }
-	case OPF_MANYOPM:
-	  llcontbuglit ("OPF_MANYOPM: not handled\n");
-	  break;
-	case OPF_MIDDLE:
-	  llcontbuglit ("OPF_MIDDLE: not handled\n");
-	  break;
-	case OPF_MMIDDLE:
-	  llcontbuglit ("OPF_MMIDDLE: not handled\n");
-	  break;
-	case OPF_MIDDLEM:
-	  llcontbuglit ("OPF_MIDDLEM: not handled\n");
-	  break;
-	case OPF_MMIDDLEM:
-	  llcontbuglit ("OPF_MMIDDLEM: not handled\n");
-	  break;
-	case OPF_BMIDDLE:
-	  if (op->content.middle == 1)
-	    llbug (message ("array fetch: [%q]",
-			    termNodeList_unparse (args)));
-	  else
-	    llcontbuglit ("OPF_BMIDDLE: bad\n");
-	  break;
-
-	case OPF_BMMIDDLE:
-	  if (op->content.middle <= 1)
-	    {
-	      sRef arr = fixTermNode (termNodeList_head (args), f, cl);
-	      sRef ret;
-
-	      if (op->content.middle == 1)
-		{
-		  termNode t = (termNodeList_reset (args),
-				termNodeList_advance (args),
-				termNodeList_current (args));
-		  
-		  if (t->kind == TRM_LITERAL)
-		    {
-		      int i;
-
-		      if (sscanf 
-			  (cstring_toCharsSafe 
-			   (ltoken_getRawString (t->literal)),
-			   "%d", &i) == 1)
-			{
-			  ret = sRef_buildArrayFetchKnown (arr, i);
-			}
-		      else
-			{
-			  ret = sRef_buildArrayFetch (arr);
-			}
-
-		      return (ret);
-		    }
-		}
-	      	      
-	      /* unknown index */
-
-	      ret = sRef_buildArrayFetch (arr);
-
-	      return (ret);
-	    }
-	  else 
-	    {
-	      llcontbug (message ("op->content.middle = %d", 
-				  op->content.middle));
-	      break;
-	    }
-
-	case OPF_BMIDDLEM:
-	  llcontbuglit ("OPF_BMIDDLEM not handled");
-	  break; 
-
-	case OPF_BMMIDDLEM:
-	  llcontbuglit ("OPF_BMMIDDLEM not handled");
-	  break;
-
-	case OPF_SELECT:
-	  llcontbug (message ("select: .%s", 
-			      ltoken_getRawString (op->content.id)));
-	  break; 
-
-	case OPF_MAP:
-	  llcontbug (message ("map: .%s", 
-			      ltoken_getRawString (op->content.id)));
-	  break;
-
-	case OPF_MSELECT:
-	  {
-	    sRef rec = fixTermNode (termNodeList_head (args), f, cl);
-	    sRef ret; 
-	    ctype ct = ctype_realType (sRef_deriveType (rec, cl));
-	    cstring fieldname = ltoken_getRawString (op->content.id);
-
-	    ct = ctype_realType (ct);
-
-	    /*
-            ** does it correspond to a typedef struct field
-            **
-            ** (kind of kludgey, but there is no direct way to
-            **  tell if it is an lsl operator instead)
-	    */
-	    
-	    if (ctype_isStructorUnion (ct) &&
-		uentry_isValid 
-		(uentryList_lookupField (ctype_getFields (ct), fieldname)))
-	      {
-		cstring fname = cstring_copy (fieldname);
-
-		ret = sRef_buildField (rec, fname);
-		cstring_markOwned (fname);
-	      }
-	    else
-	      {
-		ret = sRef_undefined;
-	      }
-
-	    return ret;
-	  }
-	case OPF_MMAP: 
-	  {
-	    sRef rec = fixTermNode (termNodeList_head (args), f, cl);
-	    sRef ret = sRef_undefined;
-	    ctype ct = ctype_realType (sRef_deriveType (rec, cl));
-	    cstring fieldname = ltoken_getRawString (op->content.id);
-
-	    /*
-	    ** does it correspond to a typedef struct field
-	    */
-	    
-	    if (ctype_isPointer (ct))
-	      {
-		ctype ctb = ctype_realType (ctype_baseArrayPtr (ct));
-
-		if (ctype_isStructorUnion (ctb) &&
-		    uentry_isValid (uentryList_lookupField
-				    (ctype_getFields (ctb), fieldname)))
-		  {
-		    cstring fname = cstring_copy (fieldname);
-
- 		    ret = sRef_buildArrow (rec, fname);
-		    cstring_markOwned (fname);
-		  }
-	      }
-
-	    return ret;
-	  }
-	}
-    }
-
-  return sRef_undefined;
-}
-
-/*
-** fixModifies
-**
-** o replace anything in modifies that is bound with let with value
-** o replace spec variables with internal state 
-** o replace paramaters with paramno identifiers
-** o replace globals with their usymid's
-** o make everything sRefs
-*/
-
-static /*@exposed@*/ sRef fixTermNode (termNode n, fcnNode f, uentryList cl)
-{
-  if (n != (termNode) 0)
-    {
-      switch (n->kind)
-	{
-	case TRM_LITERAL:
-	  break;
-	case TRM_CONST:
-	case TRM_VAR:
-	case TRM_ZEROARY:
-	  {
-	    cstring s = ltoken_getRawString (n->literal);
-	    termNode tl = getLetDecl (s, f);
-
-	    if (tl != (termNode) 0)
-	      {
-		return (fixTermNode (tl, f, cl));
-	      }
-	    else
-	      {
-		int i = getParamNo (s, f);
-
-		if (i < 0)
-		  {
-		    usymId usym = usymtab_getId (s);
-		    
-		    if (usymId_isInvalid (usym))
-		      {
-			if (usymtab_existsEither (s))
-			  {
-			    return sRef_makeSpecState ();
-			  }
-			else
-			  {
-			    llcontbuglit ("Invalid symbol in modifies list");
-			    return sRef_undefined;
-			  }
-		      }
-		    else
-		      return (sRef_makeGlobal (usym, ctype_unknown));
-		  }
-		
-		else
-		  {
-		    sRef p = sRef_makeParam (i, ctype_unknown);
-
-		    		    return (p);
-		  }
-	      }
-	  }
-	case TRM_APPLICATION:
-	  {
-	    nameNode nn = n->name;
-
-	    if (nn != (nameNode) 0)
-	      {
-		if (nn->isOpId)
-		  {
-		    /* must we handle n->given ? skip for now */
-
-		    llfatalbug 
-		      (message ("fixTermNode: expect non-empty nameNode: "
-				"TRM_APPLICATION: %q",
-				nameNode_unparse (nn)));
-		  }
-		else
-		  {
-		    sRef sr;
-
-		    sr = processTermNode (nn->content.opform, n->args, f, cl);
-		    		    return (sr);
-		  }
-	      }
-	    
-	    return sRef_undefined;
-	  }
-	case TRM_UNCHANGEDALL:      
-	case TRM_UNCHANGEDOTHERS:
-	case TRM_SIZEOF:
-	case TRM_QUANTIFIER:
-	  return sRef_undefined;
-	}
-    }
-
-  return sRef_undefined;
-}
-
-static 
-/*@only@*/ sRefSet fixModifies (fcnNode f, uentryList cl)
-{
-  static bool shownWarning = FALSE;
-  modifyNode m = f->modify;
-  sRefSet sl = sRefSet_new ();
-
-  if (m != (modifyNode) 0)
-    {
-      if (m->hasStoreRefList)
-	{
-	  storeRefNodeList srefs = m->list;
-
-	  storeRefNodeList_elements (srefs, i)
-	    {
-	      if (storeRefNode_isObj (i) || storeRefNode_isType (i))
-		{
-		  if (!shownWarning)
-		    {
-		      fileloc loc = fileloc_fromTok (f->name);
-		  
-		      llmsg (message
-			     ("%q: Warning: object and type modifications "
-			      "not understood by LCLint",
-			      fileloc_unparse (loc)));
-		      fileloc_free (loc);
-		      shownWarning = TRUE;
-		    }
-		}
-	      else if (storeRefNode_isSpecial (i))
-		{
-		  sl = sRefSet_insert (sl, i->content.ref);
-		}
-	      else if (storeRefNode_isTerm (i))
-		{
-		  sRef s = fixTermNode (i->content.term, f, cl);
-
-		  if (sRef_isKnown (s)) 
-		    {
-		      sl = sRefSet_insert (sl, s);
-		    }
-		}
-	      else
-		{
-		  BADEXIT;
-		}
-	    } end_storeRefNodeList_elements;
-	  
-	}
-    }
-
-  return sl;
-}
-
-static /*@only@*/ cstring
-paramNode_name (paramNode x)
-{
-  return (typeExpr_name (x->paramdecl));
-}
-
-static /*@only@*/ uentry
-paramNode_toUentry (paramNode p)
-{
-  if (p != (paramNode) 0)
-    {
-      if (p->kind == PELIPSIS)
-	{
-	  return uentry_makeElipsisMarker ();
-	}
-      else
-	{
-	  qtype ct = convertLclTypeSpecNode (p->type);
-	  ctype cr = convertTypeExpr (qtype_getType (ct), p->paramdecl);
-	  cstring pname = (p->paramdecl == (typeExpr)0) ? cstring_undefined 
-	                                                : paramNode_name (p);
-	  uentry ue = uentry_makeVariableParam (pname, cr);
-
-	  uentry_reflectQualifiers (ue, qtype_getQuals (ct));
-	  qtype_free (ct);
-	  return (ue);
-	}
-    }
-  else
-    {
-      llcontbuglit ("paramNode_toUentry: NULL");
-      return uentry_undefined;
-    }
-  BADEXIT;
-}
-
-static uentryList
-  paramNodeList_toUentryList (paramNodeList p)
-{
-  uentryList cl = uentryList_new ();
-
-  if (paramNodeList_isNull (p)) return (cl);
-
-  paramNodeList_elements (p, current)
-    {
-      cl = uentryList_add (cl, paramNode_toUentry (current));
-    } end_paramNodeList_elements;
-
-  return cl;
-}
-
-
diff --git a/src/varDeclarationNodeList.c b/src/varDeclarationNodeList.c
deleted file mode 100644
index fbacc41..0000000
--- a/src/varDeclarationNodeList.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** varDeclarationNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-varDeclarationNodeList varDeclarationNodeList_new ()
-{
-  varDeclarationNodeList s = (varDeclarationNodeList) dmalloc (sizeof (*s));
-   
-  s->nelements = 0;
-  s->nspace = varDeclarationNodeListBASESIZE;
-  s->elements = (varDeclarationNode *) 
-    dmalloc (sizeof (*s->elements) * varDeclarationNodeListBASESIZE);
-
-  return (s);
-}
-
-static void
-varDeclarationNodeList_grow (varDeclarationNodeList s)
-{
-  int i;
-  varDeclarationNode *newelements; 
-
-  s->nspace += varDeclarationNodeListBASESIZE;
-
-  newelements = (varDeclarationNode *) dmalloc (sizeof (*newelements) 
-						* (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i];
-    }
-
-  sfree (s->elements);
-  s->elements = newelements;
-}
-
-void 
-varDeclarationNodeList_addh (varDeclarationNodeList s, /*@keep@*/ varDeclarationNode el)
-{
-  if (s->nspace <= 0)
-    varDeclarationNodeList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-}
-
-/*@only@*/ cstring
-varDeclarationNodeList_unparse (varDeclarationNodeList s)
-{
-  cstring st = cstring_undefined;
-
-  varDeclarationNodeList_elements (s, current)
-  {
-    if (current->isPrivate)
-      st = message ("%q private ", st);
-
-    st = message ("%q%q %q;\n", st, lclTypeSpecNode_unparse (current->type),
-		  initDeclNodeList_unparse (current->decls));
-  } end_varDeclarationNodeList_elements;
-
-  return st;
-}
-
-
-void
-varDeclarationNodeList_free (varDeclarationNodeList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-      varDeclarationNode_free (s->elements[i]); 
-    }
-
-  sfree (s->elements);
-  sfree (s);
-}
diff --git a/src/varKinds.c b/src/varKinds.c
deleted file mode 100644
index 1864dc3..0000000
--- a/src/varKinds.c
+++ /dev/null
@@ -1,623 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** varKinds.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-alkind alkind_fromInt (int n)
-{
-  /*@+enumint@*/
-  llassert (n >= AK_UNKNOWN && n <= AK_LOCAL);
-  /*@=enumint@*/
-
-  return ((alkind)n);
-}
-
-nstate nstate_fromInt (int n)
-{
-  /*@+enumint@*/
-  llassert (n >= NS_ERROR && n <= NS_ABSNULL);
-  /*@=enumint@*/
-
-  return ((nstate)n);
-}
-
-sstate sstate_fromInt (int n)
-{
-  /*@+enumint@*/
-  llassert (n >= SS_UNKNOWN && n < SS_LAST);
-  /*@=enumint@*/
-
-  return ((sstate)n);
-}
-
-exkind exkind_fromInt (int n)
-{
-  /*@+enumint@*/
-  llassert (n >= XO_UNKNOWN && n <= XO_OBSERVER);
-  /*@=enumint@*/
-
-  return ((exkind) n);
-}
-
-cstring sstate_unparse (sstate s)
-{
-  switch (s)
-    {
-    case SS_UNKNOWN:   return cstring_makeLiteralTemp ("unknown");
-    case SS_UNUSEABLE: return cstring_makeLiteralTemp ("unuseable");
-    case SS_UNDEFINED: return cstring_makeLiteralTemp ("undefined");
-    case SS_MUNDEFINED:return cstring_makeLiteralTemp ("possibly undefined");
-    case SS_ALLOCATED: return cstring_makeLiteralTemp ("allocated");
-    case SS_PDEFINED:  return cstring_makeLiteralTemp ("partially defined");
-    case SS_DEFINED:   return cstring_makeLiteralTemp ("defined");
-    case SS_PARTIAL:   return cstring_makeLiteralTemp ("partial");
-    case SS_SPECIAL:   return cstring_makeLiteralTemp ("special");
-    case SS_DEAD:      return cstring_makeLiteralTemp ("dead");
-    case SS_HOFFA:     return cstring_makeLiteralTemp ("probably dead");
-    case SS_FIXED:     return cstring_makeLiteralTemp ("unmodifiable");
-    case SS_RELDEF:    return cstring_makeLiteralTemp ("reldef");
-    case SS_LAST:      llcontbuglit ("sstate_unparse: last");
-                       return cstring_makeLiteralTemp ("");
-    case SS_UNDEFGLOB:     return cstring_makeLiteralTemp ("undefglob");
-    case SS_KILLED:    return cstring_makeLiteralTemp ("killed");
-    case SS_UNDEFKILLED:
-      return cstring_makeLiteralTemp ("undefkilled");
-    }
-
-  BADEXIT;
-}
-
-bool nstate_possiblyNull (nstate n)
-{
-  /*
-  ** note: not NS_UNKNOWN or NS_ERROR 
-  */
-
-  return ((n >= NS_CONSTNULL) && (n <= NS_ABSNULL));
-}
-
-bool nstate_perhapsNull (nstate n)
-{
-  /*
-  ** note: not NS_UNKNOWN or NS_ERROR 
-  */
-
-  return ((n >= NS_RELNULL) && (n <= NS_ABSNULL));
-}
-
-cstring nstate_unparse (nstate n)
-{
-  switch (n)
-    {
-    case NS_ERROR:     return cstring_makeLiteralTemp ("");
-    case NS_UNKNOWN:   return cstring_makeLiteralTemp ("implicitly non-null");
-    case NS_POSNULL:   return cstring_makeLiteralTemp ("null");
-    case NS_DEFNULL:   return cstring_makeLiteralTemp ("null");
-    case NS_NOTNULL:   return cstring_makeLiteralTemp ("notnull");
-    case NS_MNOTNULL:  return cstring_makeLiteralTemp ("notnull");
-    case NS_ABSNULL:   return cstring_makeLiteralTemp ("null");
-    case NS_RELNULL:   return cstring_makeLiteralTemp ("relnull");
-    case NS_CONSTNULL: return cstring_makeLiteralTemp ("null");
-    }
-
-  BADEXIT;
-}
-
-/*
-** ??? (used to do something different for guarded)
-*/
-
-int nstate_compare (nstate n1, nstate n2)
-{
-  return (generic_compare (n1, n2));
-}
-
-/*
-** This occurs when we select a field with alkind inner, 
-** from a structure with alkind outer.  It is probably
-** unnecessary.
-*/
-
-alkind alkind_derive (alkind outer, alkind inner)
-{
-  switch (outer)
-    {
-    case AK_ERROR:
-    case AK_UNKNOWN: return inner;
-    case AK_KEPT:
-    case AK_KEEP:
-    case AK_ONLY: 
-    case AK_IMPONLY:
-    case AK_OWNED:
-    case AK_IMPDEPENDENT:
-    case AK_DEPENDENT:
-      if (inner == AK_SHARED) return AK_SHARED;
-      else return outer;
-      /* not so sure about these? */
-    case AK_REFCOUNTED:
-    case AK_NEWREF:
-    case AK_KILLREF:
-    case AK_REFS:
-    case AK_STACK:
-    case AK_STATIC:
-      return outer;
-    case AK_TEMP: 
-    case AK_IMPTEMP:
-    case AK_SHARED:
-    case AK_UNIQUE:
-    case AK_LOCAL: 
-    case AK_FRESH:
-    case AK_RETURNED:
-      if (alkind_isKnown (inner)) return inner; 
-      else return outer;
-    }
-  BADEXIT;
-}
-
-cstring alkind_unparse (alkind a)
-{
-  switch (a)
-    {
-    case AK_ERROR:           return cstring_makeLiteralTemp ("");
-    case AK_UNKNOWN:         return cstring_makeLiteralTemp ("unqualified");
-    case AK_ONLY:            return cstring_makeLiteralTemp ("only");
-    case AK_IMPONLY:         return cstring_makeLiteralTemp ("implicitly only");
-    case AK_OWNED:           return cstring_makeLiteralTemp ("owned");
-    case AK_IMPDEPENDENT:    return cstring_makeLiteralTemp ("implicitly dependent");
-    case AK_DEPENDENT:       return cstring_makeLiteralTemp ("dependent");
-    case AK_KEEP:            return cstring_makeLiteralTemp ("keep");
-    case AK_KEPT:            return cstring_makeLiteralTemp ("kept");
-    case AK_IMPTEMP:         return cstring_makeLiteralTemp ("implicitly temp");
-    case AK_TEMP:            return cstring_makeLiteralTemp ("temp");
-    case AK_SHARED:          return cstring_makeLiteralTemp ("shared");
-    case AK_UNIQUE:          return cstring_makeLiteralTemp ("unique");
-    case AK_RETURNED:        return cstring_makeLiteralTemp ("returned");
-    case AK_FRESH:           return cstring_makeLiteralTemp ("fresh");
-    case AK_STACK:           return cstring_makeLiteralTemp ("stack");
-    case AK_REFCOUNTED:      return cstring_makeLiteralTemp ("refcounted");
-    case AK_REFS:            return cstring_makeLiteralTemp ("refs");
-    case AK_KILLREF:         return cstring_makeLiteralTemp ("killref");
-    case AK_NEWREF:          return cstring_makeLiteralTemp ("newref");
-    case AK_LOCAL:           return cstring_makeLiteralTemp ("local");
-    case AK_STATIC:          return cstring_makeLiteralTemp ("unqualified static");
-    }
-    BADEXIT;
-}
-
-cstring exkind_unparse (exkind a)
-{
-  switch (a)
-    {
-    case XO_UNKNOWN:         return cstring_makeLiteralTemp ("unknown");
-    case XO_NORMAL:          return cstring_makeLiteralTemp ("unexposed");
-    case XO_EXPOSED:         return cstring_makeLiteralTemp ("exposed");
-    case XO_OBSERVER:        return cstring_makeLiteralTemp ("observer");
-    }
-  BADEXIT;
-}
-
-cstring exkind_capName (exkind a)
-{
-  switch (a)
-    {
-    case XO_UNKNOWN:         return cstring_makeLiteralTemp ("Unknown");
-    case XO_NORMAL:          return cstring_makeLiteralTemp ("Unexposed");
-    case XO_EXPOSED:         return cstring_makeLiteralTemp ("Exposed");
-    case XO_OBSERVER:        return cstring_makeLiteralTemp ("Observer");
-    }
-  BADEXIT;
-}
-
-cstring exkind_unparseError (exkind a)
-{
-  switch (a)
-    {
-    case XO_UNKNOWN:         return cstring_makeLiteralTemp ("unqualified");
-    case XO_NORMAL:          return cstring_makeLiteralTemp ("unqualifier");
-    case XO_EXPOSED:         return cstring_makeLiteralTemp ("exposed");
-    case XO_OBSERVER:        return cstring_makeLiteralTemp ("observer");
-    }
-  BADEXIT;
-}
-
-cstring alkind_capName (alkind a)
-{
-  switch (a)
-    {
-    case AK_ERROR:    
-      return cstring_makeLiteralTemp ("");
-    case AK_UNKNOWN:     
-      return cstring_makeLiteralTemp ("Unqualified");
-    case AK_ONLY:  
-      return cstring_makeLiteralTemp ("Only");
-    case AK_IMPONLY:
-      return cstring_makeLiteralTemp ("Implicitly only");
-    case AK_OWNED:
-      return cstring_makeLiteralTemp ("Owned");
-    case AK_IMPDEPENDENT:  
-      return cstring_makeLiteralTemp ("Implicitly dependent");
-    case AK_DEPENDENT:  
-      return cstring_makeLiteralTemp ("Dependent");
-    case AK_KEEP:     
-      return cstring_makeLiteralTemp ("Keep");
-    case AK_KEPT:    
-      return cstring_makeLiteralTemp ("Kept");
-    case AK_IMPTEMP:   
-      return cstring_makeLiteralTemp ("Implicitly temp");
-    case AK_TEMP:    
-      return cstring_makeLiteralTemp ("Temp");
-    case AK_SHARED:
-      return cstring_makeLiteralTemp ("Shared");
-    case AK_UNIQUE:    
-      return cstring_makeLiteralTemp ("Unique");
-    case AK_RETURNED:
-      return cstring_makeLiteralTemp ("Returned");
-    case AK_FRESH:   
-      return cstring_makeLiteralTemp ("Fresh");
-    case AK_STACK:      
-      return cstring_makeLiteralTemp ("Stack");
-    case AK_REFCOUNTED: 
-      return cstring_makeLiteralTemp ("Refcounted");
-    case AK_REFS:
-      return cstring_makeLiteralTemp ("Refs");
-    case AK_KILLREF: 
-      return cstring_makeLiteralTemp ("Killref");
-    case AK_NEWREF:    
-      return cstring_makeLiteralTemp ("Newref");
-    case AK_LOCAL:    
-      return cstring_makeLiteralTemp ("Local");
-    case AK_STATIC: 
-      return cstring_makeLiteralTemp ("Unqualified static");
-    }
-  BADEXIT;
-}
-
-exkind
-exkind_fromQual (qual q)
-{
-  if (qual_isExposed (q))     return XO_EXPOSED;
-  if (qual_isObserver (q))    return XO_OBSERVER;
-  else
-    {
-      llcontbug (message ("exkind_fromQual: not exp qualifier: %d" , (int)q));
-      return XO_UNKNOWN;
-    }
-}
-
-sstate
-sstate_fromQual (qual q)
-{
-  if (qual_isOut (q))          return SS_ALLOCATED;
-  if (qual_isIn (q))           return SS_DEFINED;
-  else if (qual_isPartial (q)) return SS_PARTIAL;
-  else if (qual_isRelDef (q))  return SS_RELDEF;
-  else if (qual_isUndef (q))   return SS_UNDEFGLOB;
-  else if (qual_isKilled (q))  return SS_KILLED;
-  else if (qual_isSpecial (q)) return SS_SPECIAL;
-  else
-    {
-      llcontbug (message ("sstate_fromQual: not alias qualifier: %s (%d)" , 
-			  qual_unparse (q),
-			  (int)q));
-      return SS_UNKNOWN;
-    }
-}
-
-exitkind
-exitkind_fromQual (qual q)
-{
-  if (qual_isExits (q))     return XK_MUSTEXIT;
-  if (qual_isMayExit (q))   return XK_MAYEXIT;
-  if (qual_isTrueExit (q))  return XK_TRUEEXIT;
-  if (qual_isFalseExit (q)) return XK_FALSEEXIT;
-  if (qual_isNeverExit (q)) return XK_NEVERESCAPE;
-  else
-    {
-      llcontbug (message ("exitkind_fromQual: not exit qualifier: %s",
-			  qual_unparse (q)));
-      return XK_UNKNOWN;
-    }
-}
-
-alkind
-alkind_fromQual (qual q)
-{
-  if (qual_isOnly (q))       return AK_ONLY;
-  if (qual_isImpOnly (q))    return AK_IMPONLY;
-  if (qual_isKeep (q))       return AK_KEEP;
-  if (qual_isKept (q))       return AK_KEPT;
-  if (qual_isTemp (q))       return AK_TEMP;
-  if (qual_isShared (q))     return AK_SHARED;
-  if (qual_isUnique (q))     return AK_UNIQUE;
-  if (qual_isRefCounted (q)) return AK_REFCOUNTED;
-  if (qual_isRefs (q))       return AK_REFS;
-  if (qual_isNewRef (q))     return AK_NEWREF;
-  if (qual_isKillRef (q))    return AK_KILLREF;
-  if (qual_isTempRef (q))    return AK_KILLREF; /* kludge? use kill ref for this */
-  if (qual_isOwned (q))      return AK_OWNED;
-  if (qual_isDependent (q))  return AK_DEPENDENT;
-
-  llcontbug (message ("alkind_fromQual: not alias qualifier: %d" , (int)q));
-  return AK_ERROR;
-}    
-
-static bool alkind_isMeaningless (alkind a1)
-{
-  return (a1 == AK_ERROR || a1 == AK_UNKNOWN || a1 == AK_RETURNED
-	  || a1 == AK_STACK || a1 == AK_REFCOUNTED
-	  || a1 == AK_REFS || a1 == AK_KILLREF || a1 == AK_NEWREF
-	  || a1 == AK_LOCAL);
-}
-
-bool alkind_compatible (alkind a1, alkind a2)
-{
-  if (a1 == a2) return TRUE;
-  if (a2 == AK_ERROR) return TRUE;
-  if (a2 == AK_UNKNOWN)
-    {
-      return (alkind_isMeaningless (a1) || (a1 == AK_IMPTEMP));
-    }
-
-  switch (a1)
-    {
-    case AK_ERROR:               return TRUE;
-    case AK_UNKNOWN:             return (alkind_isMeaningless (a2)
-					 || (a2 == AK_IMPTEMP));
-    case AK_IMPONLY:             return (a2 == AK_KEEP || a2 == AK_FRESH 
-					 || a2 == AK_ONLY);
-    case AK_ONLY:                return (a2 == AK_KEEP || a2 == AK_FRESH
-					 || a2 == AK_IMPONLY);
-    case AK_OWNED:               return FALSE;
-    case AK_IMPDEPENDENT:        return (a2 == AK_DEPENDENT);
-    case AK_DEPENDENT:           return (a2 == AK_IMPDEPENDENT);
-    case AK_KEEP:                return (a2 == AK_ONLY || a2 == AK_FRESH
-					 || a2 == AK_IMPONLY);
-    case AK_KEPT:                return FALSE;
-    case AK_IMPTEMP:             return (a2 == AK_TEMP);
-    case AK_TEMP:                return (a2 == AK_IMPTEMP);
-    case AK_SHARED:              return FALSE;
-    case AK_UNIQUE:              return (a2 == AK_TEMP);
-    case AK_RETURNED:            return (alkind_isMeaningless (a2));
-    case AK_FRESH:               return (alkind_isOnly (a2));
-    case AK_STACK:               return (alkind_isMeaningless (a2));
-    case AK_REFCOUNTED:          return (alkind_isMeaningless (a2));
-    case AK_REFS:                return (alkind_isMeaningless (a2));
-    case AK_KILLREF:             return (alkind_isMeaningless (a2));
-    case AK_NEWREF:              return (alkind_isMeaningless (a2));
-    case AK_LOCAL:               return (alkind_isMeaningless (a2));
-    case AK_STATIC:              return (alkind_isMeaningless (a2));
-    }
-  BADEXIT;
-}
-
-bool alkind_equal (alkind a1, alkind a2)
-{
-  if (a1 == a2) return TRUE;
-  if (a2 == AK_ERROR) return TRUE;
-
-  switch (a1)
-    {
-    case AK_ERROR:               return TRUE;
-    case AK_IMPONLY:             return (a2 == AK_ONLY);
-    case AK_ONLY:                return (a2 == AK_IMPONLY);
-    case AK_IMPDEPENDENT:        return (a2 == AK_DEPENDENT);
-    case AK_DEPENDENT:           return (a2 == AK_IMPDEPENDENT);
-    case AK_IMPTEMP:             return (a2 == AK_TEMP);
-    case AK_TEMP:                return (a2 == AK_IMPTEMP);
-    default:                     return FALSE;
-    }
-
-  BADEXIT;
-}
-
-alkind
-alkind_fixImplicit (alkind a)
-{
-  if (a == AK_IMPTEMP) return AK_TEMP;
-  if (a == AK_IMPONLY) return AK_IMPONLY;
-  if (a == AK_IMPDEPENDENT) return AK_DEPENDENT;
-
-  return a;
-}
-
-cstring exitkind_unparse (exitkind k)
-{
-  switch (k)
-    {
-    case XK_ERROR:       return (cstring_makeLiteralTemp (""));
-    case XK_UNKNOWN:     return (cstring_makeLiteralTemp ("?"));
-    case XK_NEVERESCAPE: return (cstring_makeLiteralTemp ("never escape"));
-    case XK_MAYEXIT:     return (cstring_makeLiteralTemp ("mayexit"));
-    case XK_MUSTEXIT:    return (cstring_makeLiteralTemp ("exits"));
-    case XK_TRUEEXIT:    return (cstring_makeLiteralTemp ("trueexit"));
-    case XK_FALSEEXIT:   return (cstring_makeLiteralTemp ("falseexit"));
-    case XK_MUSTRETURN:  return (cstring_makeLiteralTemp ("mustreturn"));
-    case XK_MAYRETURN:   return (cstring_makeLiteralTemp ("mayreturn"));
-    case XK_MUSTRETURNEXIT: return (cstring_makeLiteralTemp ("mustreturnexit"));
-    case XK_MAYRETURNEXIT: return (cstring_makeLiteralTemp ("mayreturnexit"));
-    case XK_GOTO:        return (cstring_makeLiteralTemp ("goto"));
-    case XK_MAYGOTO:     return (cstring_makeLiteralTemp ("maygoto"));
-    }
-  
- BADEXIT;
-}
-
-exitkind exitkind_makeConditional (exitkind k)
-{
-  switch (k)
-    {
-    case XK_TRUEEXIT:
-    case XK_FALSEEXIT: 
-    case XK_MUSTEXIT:       return XK_MAYEXIT;
-    case XK_MUSTRETURN:     return XK_MAYRETURN;
-    case XK_MUSTRETURNEXIT: return XK_MAYRETURNEXIT;
-    case XK_GOTO:           return XK_MAYGOTO;
-    default:                return k;
-    }
-}
-
-exitkind exitkind_combine (exitkind k1, exitkind k2)
-{
-  if (k1 == k2)
-    {
-      return k1;
-    }
-
-  if (k2 == XK_ERROR)
-    {
-      return XK_ERROR;
-    }
-
-  switch (k1)
-    {
-    case XK_ERROR: return XK_ERROR;
-    case XK_UNKNOWN:     
-    case XK_NEVERESCAPE: return (exitkind_makeConditional (k2));
-    case XK_MUSTEXIT:    
-      switch (k2)
-	{
-	case XK_MUSTRETURNEXIT:
-	case XK_MUSTRETURN: return XK_MUSTRETURNEXIT;
-	case XK_MAYRETURNEXIT:
-	case XK_MAYRETURN:  return XK_MAYRETURNEXIT;
-	default:             return XK_MAYEXIT;
-	}
-      BADEXIT;
-
-    case XK_MAYEXIT:     
-    case XK_TRUEEXIT:    
-    case XK_FALSEEXIT:   
-      switch (k2)
-	{
-	case XK_MUSTRETURNEXIT:
-	case XK_MAYRETURNEXIT:
-	case XK_MAYRETURN:
-	case XK_MUSTRETURN: return XK_MAYRETURNEXIT;
-	default:             return XK_MAYEXIT;
-	}
-      BADEXIT;
-
-    case XK_MUSTRETURN:
-      switch (k2)
-	{
-	case XK_MUSTRETURNEXIT:
-	case XK_MUSTEXIT:    return XK_MUSTRETURNEXIT;
-	case XK_MAYRETURNEXIT:
-	case XK_TRUEEXIT:
-	case XK_FALSEEXIT:
-	case XK_MAYEXIT:     return XK_MAYRETURNEXIT;
-	default:              return XK_MAYRETURN;
-	}
-      BADEXIT;
-
-    case XK_MAYRETURN:
-      if (exitkind_couldExit (k2))
-	{
-	  return XK_MAYRETURNEXIT;
-	}
-      else
-	{
-	  return XK_MAYRETURN;
-	}
-
-    case XK_MUSTRETURNEXIT: 
-      switch (k2)
-	{
-	case XK_MUSTRETURN:
-	case XK_MUSTEXIT:    return XK_MUSTRETURNEXIT;
-	default:              return XK_MAYRETURNEXIT;
-	}
-      BADEXIT;
-
-    case XK_MAYRETURNEXIT:   return XK_MAYRETURNEXIT;
-    case XK_GOTO:
-    case XK_MAYGOTO:         
-      if (exitkind_couldExit (k2))
-	{
-	  return XK_MAYRETURNEXIT;
-	}
-      return XK_MAYGOTO;
-    }
-  
- BADEXIT;
-}
-
-bool exitkind_couldExit (exitkind e)
-{
-  switch (e)
-    {
-    case XK_MAYEXIT:
-    case XK_MUSTEXIT:
-    case XK_TRUEEXIT:
-    case XK_FALSEEXIT:
-    case XK_MAYRETURNEXIT:
-    case XK_MUSTRETURNEXIT: 
-    case XK_GOTO:
-    case XK_MAYGOTO: return TRUE;
-    default: return FALSE;
-    }
-}
-
-static bool exitkind_couldReturn (exitkind e) /*@*/ 
-{
-  switch (e)
-    {
-    case XK_MUSTRETURN:
-    case XK_MAYRETURN:
-    case XK_MAYRETURNEXIT:
-    case XK_MUSTRETURNEXIT:  return TRUE;
-    default: return FALSE;
-    }
-}
-
-static bool exitkind_couldGoto (exitkind e) /*@*/
-{
-  return (e == XK_GOTO || e == XK_MAYGOTO);
-}
-
-bool exitkind_couldEscape (exitkind e)
-{
-  return exitkind_couldReturn (e) || exitkind_couldExit (e)
-    || exitkind_couldGoto (e);
-}
-
-exitkind exitkind_fromInt (int x)
-{
-  /*@+enumint@*/
-  llassert (x >= XK_ERROR && x <= XK_LAST);
-  /*@=enumint@*/
-
-  return (exitkind) x;
-}
-
-
-
-
-
-
-
diff --git a/src/varNodeList.c b/src/varNodeList.c
deleted file mode 100644
index a471484..0000000
--- a/src/varNodeList.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** varNodeList.c
-**
-** based on list_template.c
-**
-** where T has T_equal (or change this) and T_unparse
-*/
-
-# include "lclintMacros.nf"
-# include "llbasic.h"
-
-varNodeList varNodeList_new ()
-{
-  varNodeList s = (varNodeList) dmalloc (sizeof (*s));
-
-  s->nelements = 0;
-  s->nspace = varNodeListBASESIZE;
-  s->elements = (varNode *)
-    dmalloc (sizeof (*s->elements) * varNodeListBASESIZE);
-
-  return (s);
-}
-
-static void
-varNodeList_grow (varNodeList s)
-{
-  int i;
-  varNode *newelements; 
-
-  s->nspace += varNodeListBASESIZE;
-  newelements = (varNode *) dmalloc (sizeof (*newelements)
-				     * (s->nelements + s->nspace));
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      newelements[i] = s->elements[i]; 
-    }
-
-  sfree (s->elements); 
-  s->elements = newelements;
-}
-
-varNodeList 
-varNodeList_add (varNodeList s, varNode el)
-{
-  if (s->nspace <= 0)
-    varNodeList_grow (s);
-
-  s->nspace--;
-  s->elements[s->nelements] = el;
-  s->nelements++;
-  return s;
-}
-
-cstring
-varNodeList_unparse (varNodeList s)
-{
-  int i;
-  cstring st = cstring_undefined;
-  bool first = TRUE;
-
-  for (i = 0; i < s->nelements; i++)
-    {
-      cstring type = cstring_undefined;
-      varNode current = s->elements[i];
-
-      if (current->isObj)
-	{
-	  type = cstring_makeLiteral ("obj ");
-	}
-
-      if (current->type != NULL)
-	{
-	  type = message (": %q%q", type, lclTypeSpecNode_unparse (current->type));
-	}
-
-      if (first)
-	{
-	  st = type;
-	  first = FALSE;
-	}
-      else
-	{
-	  st = message ("%q, %q", st, type);
-	}
-    }
-
-  return st;
-}
-
-void
-varNodeList_free (varNodeList s)
-{
-  int i;
-  for (i = 0; i < s->nelements; i++)
-    {
-      varNode_free (s->elements[i]); 
-    }
-
-  sfree (s->elements);
-  sfree (s);
-}
-
-varNodeList
-varNodeList_copy (varNodeList s)
-{
-  varNodeList ret = varNodeList_new ();
-
-  varNodeList_elements (s, el)
-    {
-      ret = varNodeList_add (ret, varNode_copy (el));
-    } end_varNodeList_elements;
-
-  return ret;
-}
diff --git a/src/ynm.c b/src/ynm.c
deleted file mode 100644
index fe5c0e2..0000000
--- a/src/ynm.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
-**         Massachusetts Institute of Technology
-**
-** This program is free software; you can redistribute it and/or modify it
-** under the terms of the GNU General Public License as published by the
-** Free Software Foundation; either version 2 of the License, or (at your
-** option) any later version.
-** 
-** This program is distributed in the hope that it will be useful, but
-** WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-** General Public License for more details.
-** 
-** The GNU General Public License is available from http://www.gnu.org/ or
-** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-** MA 02111-1307, USA.
-**
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
-*/
-/*
-** ynm.c
-*/
-
-# include "lclintMacros.nf"
-# include "basic.h"
-
-ynm ynm_fromCodeChar (char c)
-{
-  switch (c)
-    {
-    case '+': return YES;
-    case '-': return NO;
-    case '=': return MAYBE;
-    BADDEFAULT;
-    }
-}
-
-int ynm_compare (ynm x, ynm y)
-{
-  switch (x)
-    {
-    case YES: if (y == YES) return 0; else return 1;
-    case NO:  if (y == NO)  return 0; else return -1;
-    case MAYBE: if (y == MAYBE) return 0; else return 1;
-    }
-
-  BADEXIT;
-}
-      
-      
-- 
2.45.2