Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members  

lslinit.c

Go to the documentation of this file.
00001 /*
00002 ** LCLint - annotation-assisted static program checker
00003 ** Copyright (C) 1994-2000 University of Virginia,
00004 **         Massachusetts Institute of Technology
00005 **
00006 ** This program is free software; you can redistribute it and/or modify it
00007 ** under the terms of the GNU General Public License as published by the
00008 ** Free Software Foundation; either version 2 of the License, or (at your
00009 ** option) any later version.
00010 ** 
00011 ** This program is distributed in the hope that it will be useful, but
00012 ** WITHOUT ANY WARRANTY; without even the implied warranty of
00013 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 ** General Public License for more details.
00015 ** 
00016 ** The GNU General Public License is available from http://www.gnu.org/ or
00017 ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00018 ** MA 02111-1307, USA.
00019 **
00020 ** For information on lclint: lclint-request@cs.virginia.edu
00021 ** To report a bug: lclint-bug@cs.virginia.edu
00022 ** For more information: http://lclint.cs.virginia.edu
00023 */
00024 /*
00025 ** lslinit.c
00026 **
00027 ** Processor for Larch Shared Language Init Files
00028 */
00029 
00030 # include "lclintMacros.nf"
00031 # include "llbasic.h"
00032 # include "signature.h"
00033 # include "signature2.h"
00034 # include "scan.h"
00035 # include "scanline.h"
00036 # include "tokentable.h"
00037 # include "syntable.h"
00038 # include "lslinit.h"
00039 
00040 /* needed to parse init files */
00041 # include "shift.h"
00042 #if TRACING == 1
00043 /*@notfunction@*/
00044 # define LTRACE(rule) printf ("Reducing: %s\n", rule)
00045 #else
00046 /*@notfunction@*/
00047 # define LTRACE(rule)
00048 #endif
00049 
00050 static void LocalUserError (ltoken p_t, /*@temp@*/ char *p_msg)
00051   /*@modifies *g_msgstream@*/;
00052 
00053 static /*@only@*/ ltoken nextToken;
00054 
00055 static void InitFile (void) /*@modifies nextToken@*/ ;
00056 static void InitLines (void) /*@modifies nextToken@*/ ;
00057 static void InitLine (void) /*@modifies nextToken@*/ ;
00058 static void Classification (void) /*@modifies nextToken@*/ ;
00059 static void CharClass (void) /*@modifies nextToken@*/ ;
00060 
00061 static void EndCommentChars (void) /*@modifies nextToken@*/ ;
00062 static void IdChars (void) /*@modifies nextToken@*/ ;
00063 static void OpChars (void) /*@modifies nextToken@*/ ;
00064 static void ExtensionChar (void) /*@modifies nextToken@*/ ;
00065 static void SingChars (void) /*@modifies nextToken@*/ ;
00066 static void WhiteChars (void) /*@modifies nextToken@*/ ;
00067 static void EndCommentChar (void) /*@modifies nextToken@*/ ;
00068 static void IdChar (void) /*@modifies nextToken@*/ ;
00069 static void OpChar (void) /*@modifies nextToken@*/ ;
00070 static void SingChar (void) /*@modifies nextToken@*/ ;
00071 static void WhiteChar (void) /*@modifies nextToken@*/ ;
00072 
00073 static void TokenClass (void) /*@modifies nextToken@*/ ;
00074 static void QuantifierSymToks (void) /*@modifies nextToken@*/ ;
00075 static void LogicalOpToks (void) /*@modifies nextToken@*/ ;
00076 static void EqOpToks (void) /*@modifies nextToken@*/ ;
00077 static void EquationSymToks (void) /*@modifies nextToken@*/ ;
00078 static void EqSepSymToks (void) /*@modifies nextToken@*/ ;
00079 static void SelectSymToks (void) /*@modifies nextToken@*/ ;
00080 static void OpenSymToks (void) /*@modifies nextToken@*/ ;
00081 static void SepSymToks (void) /*@modifies nextToken@*/ ;
00082 static void CloseSymToks (void) /*@modifies nextToken@*/ ;
00083 static void SimpleIdToks (void) /*@modifies nextToken@*/ ;
00084 static void MapSymToks (void) /*@modifies nextToken@*/ ;
00085 static void MarkerSymToks (void) /*@modifies nextToken@*/ ;
00086 static void CommentSymToks (void) /*@modifies nextToken@*/ ;
00087 static void QuantifierSymTok (void) /*@modifies nextToken@*/ ;
00088 static void LogicalOpTok (void) /*@modifies nextToken@*/ ;
00089 static void EqOpTok (void) /*@modifies nextToken@*/ ;
00090 static void EquationSymTok (void) /*@modifies nextToken@*/ ;
00091 static void EqSepSymTok (void) /*@modifies nextToken@*/ ;
00092 static void SelectSymTok (void) /*@modifies nextToken@*/ ;
00093 static void OpenSymTok (void) /*@modifies nextToken@*/ ;
00094 static void SepSymTok (void) /*@modifies nextToken@*/ ;
00095 static void CloseSymTok (void) /*@modifies nextToken@*/ ;
00096 static void SimpleIdTok (void) /*@modifies nextToken@*/ ;
00097 static void MapSymTok (void) /*@modifies nextToken@*/ ;
00098 static void MarkerSymTok (void) /*@modifies nextToken@*/ ;
00099 static void CommentSymTok (void) /*@modifies nextToken@*/ ;
00100 static void SynClass (void) /*@modifies nextToken@*/ ;
00101 static void OldToken (void) /*@modifies nextToken@*/ ;
00102 static void NewToken (void) /*@modifies nextToken@*/ ;
00103 static void Token (void) /*@modifies nextToken@*/ ;
00104 
00105 static void InitReduce (LSLInitRuleCode p_rule) /*@modifies nextToken@*/ ;
00106 static void UpdateXCharKeywords (charCode) /*@modifies nextToken@*/ ;
00107 static void ProcessExtensionChar (void) /*@modifies nextToken@*/ ;
00108 static void ProcessEndCommentChar (void) /*@modifies nextToken@*/ ;
00109 static void ProcessSingleChar (charCode p_code) /*@modifies nextToken@*/ ;
00110 static void ProcessToken (ltokenCode p_code) /*@modifies nextToken@*/ ;
00111 static void ProcessSynonym (void) /*@modifies nextToken@*/ ;
00112 
00113 /* If TRUE character has been redefined as a singleChar. */
00114 static bool defineSingleChar[LASTCHAR + 1];
00115 
00116 static charCode currentExtensionChar;
00117 
00118 /* LSL init file keyword tokens.  */
00119 
00120 static /*@dependent@*/ ltoken endCommentCharToken;
00121 static /*@dependent@*/ ltoken idCharToken;
00122 static /*@dependent@*/ ltoken opCharToken;
00123 static /*@dependent@*/ ltoken extensionCharToken;
00124 static /*@dependent@*/ ltoken singleCharToken;
00125 static /*@dependent@*/ ltoken whiteCharToken;
00126 static /*@dependent@*/ ltoken quantifierSymToken;
00127 static /*@dependent@*/ ltoken logicalOpToken;
00128 static /*@dependent@*/ ltoken eqOpToken;
00129 static /*@dependent@*/ ltoken equationSymToken;
00130 static /*@dependent@*/ ltoken eqSepSymToken;
00131 static /*@dependent@*/ ltoken selectSymToken;
00132 static /*@dependent@*/ ltoken openSymToken;
00133 static /*@dependent@*/ ltoken sepSymToken;
00134 static /*@dependent@*/ ltoken closeSymToken;
00135 static /*@dependent@*/ ltoken simpleIdToken;
00136 static /*@dependent@*/ ltoken mapSymToken;
00137 static /*@dependent@*/ ltoken markerSymToken;
00138 static /*@dependent@*/ ltoken commentSymToken;
00139 static /*@dependent@*/ ltoken synonymToken;
00140 
00141 static bool
00142 hasFirstChar (ltoken tok)
00143 {
00144   return (ltoken_isChar (tok)
00145           && lscanCharClass (cstring_firstChar (ltoken_unparse (tok))) == SINGLECHAR);
00146 }
00147 
00148 void
00149 LSLProcessInitFile (void)
00150 {
00151   InitFile ();
00152 }
00153 
00154 /*
00155 **
00156 **  Parsing functions for init file processing, in the same order as the
00157 **  grammar file lslinit.cfg.  This is top-down order, as much as possible.
00158 **
00159 */
00160 
00161 static void
00162 InitFile (void)
00163 {
00164   InitLines ();
00165   InitReduce (INITFILE1);
00166 
00167   if (ltoken_getCode (nextToken) != LEOFTOKEN)
00168     {
00169       LocalUserError (nextToken, "unexpected tokens after end-of-file");
00170     }
00171 }
00172 
00173 static void
00174 InitLines (void)
00175 {
00176   InitReduce (INITLINES1);
00177 
00178   if (ltoken_getCode (nextToken) != LEOFTOKEN)
00179     {
00180       InitLine ();
00181       InitReduce (INITLINES2);
00182     }
00183 
00184   while (ltoken_getCode (nextToken) != LEOFTOKEN)
00185     {
00186       InitLine ();
00187       InitReduce (INITLINES3);
00188     }
00189 
00190 }
00191 
00192 static void
00193 InitLine (void)
00194 {
00195   if (ltoken_getCode (nextToken) == LST_EOL)
00196     {
00197      /* Nothing on line. */
00198       InitReduce (INITLINE1);
00199     }
00200   else
00201     {
00202       Classification ();
00203       InitReduce (INITLINE2);
00204     }
00205 
00206   if (ltoken_getCode (nextToken) != LST_EOL)
00207     {
00208       LocalUserError (nextToken, "Unexpected tokens on line");
00209     }
00210 
00211   ltoken_free (nextToken);
00212   nextToken = LSLScanNextToken ();             
00213 }
00214 
00215 static void
00216 Classification (void)
00217 {
00218   if (ltoken_getRawText (nextToken) == ltoken_getText (endCommentCharToken)
00219       || ltoken_getRawText (nextToken) == ltoken_getText (idCharToken)
00220       || ltoken_getRawText (nextToken) == ltoken_getText (opCharToken)
00221       || ltoken_getRawText (nextToken) == ltoken_getText (extensionCharToken)
00222       || ltoken_getRawText (nextToken) == ltoken_getText (singleCharToken)
00223       || ltoken_getRawText (nextToken) == ltoken_getText (whiteCharToken))
00224     {
00225       CharClass ();
00226       InitReduce (CLASSIFICATION1);
00227     }
00228   else if (ltoken_getRawText (nextToken) == ltoken_getText (quantifierSymToken)
00229            || ltoken_getRawText (nextToken) == ltoken_getText (logicalOpToken)
00230            || ltoken_getRawText (nextToken) == ltoken_getText (eqOpToken)
00231            || ltoken_getRawText (nextToken) == ltoken_getText (equationSymToken)
00232            || ltoken_getRawText (nextToken) == ltoken_getText (eqSepSymToken)
00233            || ltoken_getRawText (nextToken) == ltoken_getText (selectSymToken)
00234            || ltoken_getRawText (nextToken) == ltoken_getText (openSymToken)
00235            || ltoken_getRawText (nextToken) == ltoken_getText (sepSymToken)
00236            || ltoken_getRawText (nextToken) == ltoken_getText (closeSymToken)
00237            || ltoken_getRawText (nextToken) == ltoken_getText (simpleIdToken)
00238            || ltoken_getRawText (nextToken) == ltoken_getText (mapSymToken)
00239            || ltoken_getRawText (nextToken) == ltoken_getText (markerSymToken)
00240            || ltoken_getRawText (nextToken) == ltoken_getText (commentSymToken))
00241     {
00242       TokenClass ();
00243       InitReduce (CLASSIFICATION2);
00244     }
00245   else if (ltoken_getRawText (nextToken) == ltoken_getText (synonymToken))
00246     {
00247       SynClass ();
00248       InitReduce (CLASSIFICATION3);
00249     }
00250   else
00251     {
00252       LocalUserError (nextToken,
00253                       "expected character, token, or synonym classification");
00254     }
00255 }
00256 
00257 static void
00258 CharClass (void)
00259 {
00260   ltoken charClassToken;
00261 
00262   charClassToken = nextToken;
00263 
00264   nextToken = LSLScanNextToken ();              /* Discard char class keyword. */
00265 
00266   if (ltoken_getRawText (charClassToken) == ltoken_getText (endCommentCharToken))
00267     {
00268       EndCommentChars ();
00269       InitReduce (CHARCLASS1);
00270     }
00271   else if (ltoken_getRawText (charClassToken) == ltoken_getText (idCharToken))
00272     {
00273       IdChars ();
00274       InitReduce (CHARCLASS2);
00275     }
00276   else if (ltoken_getRawText (charClassToken) == ltoken_getText (opCharToken))
00277     {
00278       OpChars ();
00279       InitReduce (CHARCLASS3);
00280     }
00281   else if (ltoken_getRawText (charClassToken)
00282            == ltoken_getText (extensionCharToken))
00283     {
00284       ExtensionChar ();
00285       InitReduce (CHARCLASS4);
00286     }
00287   else if (ltoken_getRawText (charClassToken) == ltoken_getText (singleCharToken))
00288     {
00289       SingChars ();
00290       InitReduce (CHARCLASS5);
00291     }
00292   else if (ltoken_getRawText (charClassToken) == ltoken_getText (whiteCharToken))
00293     {
00294       WhiteChars ();
00295       InitReduce (CHARCLASS6);
00296     }
00297   else
00298     {
00299       LocalUserError (nextToken, "expected character classification");
00300     }
00301 
00302   ltoken_free (charClassToken);
00303 }
00304 
00305 static void
00306 EndCommentChars (void)
00307 {
00308   EndCommentChar ();
00309   InitReduce (LRC_ENDCOMMENT1);
00310 
00311   while (ltoken_getCode (nextToken) != LST_EOL)
00312     {
00313       EndCommentChar ();
00314       InitReduce (LRC_ENDCOMMENT2);
00315     }
00316 
00317 }
00318 
00319 static void
00320 IdChars (void)
00321 {
00322   IdChar ();
00323   InitReduce (IDCHARS1);
00324 
00325   while (ltoken_getCode (nextToken) != LST_EOL)
00326     {
00327       IdChar ();
00328       InitReduce (IDCHARS2);
00329     }
00330 }
00331 
00332 static void
00333 OpChars (void)
00334 {
00335   OpChar ();
00336   InitReduce (OPCHARS1);
00337 
00338   while (ltoken_getCode (nextToken) != LST_EOL)
00339     {
00340       OpChar ();
00341       InitReduce (OPCHARS2);
00342     }
00343 }
00344 
00345 static void
00346 ExtensionChar (void)
00347 {
00348   if (ltoken_isChar (nextToken)
00349       && lscanCharClass (cstring_firstChar (ltoken_unparse (nextToken))) == SINGLECHAR)
00350     {
00351       LSLGenShiftOnly (nextToken);
00352       nextToken = LSLScanNextToken ();
00353       InitReduce (LRC_EXTENSIONCHAR1);
00354     }
00355   else
00356     {
00357       LocalUserError (nextToken, "expected only one character");
00358     }
00359 }
00360 
00361 static void
00362 SingChars (void)
00363 {
00364   SingChar ();
00365   InitReduce (SINGCHARS1);
00366 
00367   while (ltoken_getCode (nextToken) != LST_EOL)
00368     {
00369       SingChar ();
00370       InitReduce (SINGCHARS2);
00371     }
00372 }
00373 
00374 static void
00375 WhiteChars (void)
00376 {
00377   WhiteChar ();
00378   InitReduce (WHITECHARS1);
00379 
00380   while (ltoken_getCode (nextToken) != LST_EOL)
00381     {
00382       WhiteChar ();
00383       InitReduce (WHITECHARS2);
00384     }
00385 }
00386 
00387 static void
00388 EndCommentChar (void)
00389 {
00390   if (ltoken_isChar (nextToken))
00391     {
00392       LSLGenShiftOnly (nextToken);
00393       nextToken = LSLScanNextToken ();
00394       InitReduce (LRC_ENDCOMMENTCHAR1);
00395     }
00396   else
00397     {
00398       LocalUserError (nextToken, "expected only one character");
00399     }
00400 }
00401 
00402 static void
00403 IdChar (void)
00404 {
00405   if (hasFirstChar (nextToken))
00406     {
00407       LSLGenShiftOnly (nextToken);
00408       nextToken = LSLScanNextToken ();
00409       InitReduce (IDCHAR1);
00410     }
00411   else
00412     {
00413       LocalUserError (nextToken, "character is already defined, cannot redefine");
00414     }
00415 }
00416 
00417 static void
00418 OpChar (void)
00419 {
00420   if (hasFirstChar (nextToken))
00421     {
00422       LSLGenShiftOnly (nextToken);
00423       nextToken = LSLScanNextToken ();
00424       InitReduce (OPCHAR1);
00425     }
00426   else
00427     {
00428       LocalUserError (nextToken, "character is already defined, cannot redefine");
00429     }
00430 }
00431 
00432 static void
00433 SingChar (void)
00434 {
00435   if (hasFirstChar (nextToken))
00436     {
00437       LSLGenShiftOnly (nextToken);
00438       nextToken = LSLScanNextToken ();
00439       InitReduce (SINGCHAR1);
00440     }
00441   else
00442     {
00443       LocalUserError (nextToken, "character is already defined, cannot redefine");
00444     }
00445 }
00446 
00447 static void
00448 WhiteChar (void)
00449 {
00450   if (hasFirstChar (nextToken))
00451     {
00452       LSLGenShiftOnly (nextToken);
00453       nextToken = LSLScanNextToken ();
00454       InitReduce (WHITECHAR1);
00455     }
00456   else
00457     {
00458       LocalUserError (nextToken, "character is already defined, cannot redefine");
00459     }
00460 }
00461 
00462 static void
00463 TokenClass (void)
00464 {
00465   ltoken tokenClassToken;
00466 
00467   tokenClassToken = nextToken;
00468 
00469   nextToken = LSLScanNextToken ();
00470 
00471   if (ltoken_getRawText (tokenClassToken) == ltoken_getText (quantifierSymToken))
00472     {
00473       QuantifierSymToks ();
00474       InitReduce (TOKENCLASS1);
00475     }
00476   else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (logicalOpToken))
00477     {
00478       LogicalOpToks ();
00479       InitReduce (TOKENCLASS2);
00480     }
00481   else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (eqOpToken))
00482     {
00483       EqOpToks ();
00484       InitReduce (TOKENCLASS3);
00485     }
00486   else if (ltoken_getRawText (tokenClassToken)
00487            == ltoken_getText (equationSymToken))
00488     {
00489       EquationSymToks ();
00490       InitReduce (TOKENCLASS4);
00491     }
00492   else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (eqSepSymToken))
00493     {
00494       EqSepSymToks ();
00495       InitReduce (TOKENCLASS5);
00496     }
00497   else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (selectSymToken))
00498     {
00499       SelectSymToks ();
00500       InitReduce (TOKENCLASS6);
00501     }
00502   else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (openSymToken))
00503     {
00504       OpenSymToks ();
00505       InitReduce (TOKENCLASS7);
00506     }
00507   else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (sepSymToken))
00508     {
00509       SepSymToks ();
00510       InitReduce (TOKENCLASS8);
00511     }
00512   else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (closeSymToken))
00513     {
00514       CloseSymToks ();
00515       InitReduce (TOKENCLASS9);
00516     }
00517   else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (simpleIdToken))
00518     {
00519       SimpleIdToks ();
00520       InitReduce (TOKENCLASS10);
00521     }
00522   else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (mapSymToken))
00523     {
00524       MapSymToks ();
00525       InitReduce (TOKENCLASS11);
00526     }
00527   else if (ltoken_getRawText (tokenClassToken) == ltoken_getText (markerSymToken))
00528     {
00529       MarkerSymToks ();
00530       InitReduce (TOKENCLASS12);
00531     }
00532   else if (ltoken_getRawText (tokenClassToken)
00533            == ltoken_getText (commentSymToken))
00534     {
00535       CommentSymToks ();
00536       InitReduce (TOKENCLASS13);
00537     }
00538   else
00539     {
00540       LocalUserError (nextToken, "expected token classification");
00541     }
00542 
00543   ltoken_free (tokenClassToken);
00544 }
00545 
00546 static void
00547 QuantifierSymToks (void)
00548 {
00549   QuantifierSymTok ();
00550   InitReduce (QUANTIFIERSYMTOKS1);
00551 
00552   while (ltoken_getCode (nextToken) != LST_EOL)
00553     {
00554       QuantifierSymTok ();
00555       InitReduce (QUANTIFIERSYMTOKS2);
00556     }
00557 }
00558 
00559 static void
00560 LogicalOpToks (void)
00561 {
00562   LogicalOpTok ();
00563   InitReduce (LOGICALOPTOKS1);
00564 
00565   while (ltoken_getCode (nextToken) != LST_EOL)
00566     {
00567       LogicalOpTok ();
00568       InitReduce (LOGICALOPTOKS2);
00569     }
00570 }
00571 
00572 static void
00573 EqOpToks (void)
00574 {
00575   EqOpTok ();
00576   InitReduce (LRC_EQOPTOKS1);
00577 
00578   while (ltoken_getCode (nextToken) != LST_EOL)
00579     {
00580       EqOpTok ();
00581       InitReduce (LRC_EQOPTOKS2);
00582     }
00583 }
00584 
00585 static void
00586 EquationSymToks (void)
00587 {
00588   EquationSymTok ();
00589   InitReduce (LRC_EQUATIONSYMTOKS1);
00590 
00591   while (ltoken_getCode (nextToken) != LST_EOL)
00592     {
00593       EquationSymTok ();
00594       InitReduce (LRC_EQUATIONSYMTOKS2);
00595     }
00596 }
00597 
00598 static void
00599 EqSepSymToks (void)
00600 {
00601   EqSepSymTok ();
00602   InitReduce (LRC_EQSEPSYMTOKS1);
00603 
00604   while (ltoken_getCode (nextToken) != LST_EOL)
00605     {
00606       EqSepSymTok ();
00607       InitReduce (LRC_EQSEPSYMTOKS2);
00608     }
00609 }
00610 
00611 static void
00612 SelectSymToks (void)
00613 {
00614   SelectSymTok ();
00615   InitReduce (SELECTSYMTOKS1);
00616 
00617   while (ltoken_getCode (nextToken) != LST_EOL)
00618     {
00619       SelectSymTok ();
00620       InitReduce (SELECTSYMTOKS2);
00621     }
00622 }
00623 
00624 static void
00625 OpenSymToks (void)
00626 {
00627   OpenSymTok ();
00628   InitReduce (OPENSYMTOKS1);
00629 
00630   while (ltoken_getCode (nextToken) != LST_EOL)
00631     {
00632       OpenSymTok ();
00633       InitReduce (OPENSYMTOKS2);
00634     }
00635 }
00636 
00637 static void
00638 SepSymToks (void)
00639 {
00640   SepSymTok ();
00641   InitReduce (SEPSYMTOKS1);
00642 
00643   while (ltoken_getCode (nextToken) != LST_EOL)
00644     {
00645       SepSymTok ();
00646       InitReduce (SEPSYMTOKS2);
00647     }
00648 }
00649 
00650 static void
00651 CloseSymToks (void)
00652 {
00653   CloseSymTok ();
00654   InitReduce (CLOSESYMTOKS1);
00655 
00656   while (ltoken_getCode (nextToken) != LST_EOL)
00657     {
00658       CloseSymTok ();
00659       InitReduce (CLOSESYMTOKS2);
00660     }
00661 }
00662 
00663 static void
00664 SimpleIdToks (void)
00665 {
00666   SimpleIdTok ();
00667   InitReduce (SIMPLEIDTOKS1);
00668 
00669   while (ltoken_getCode (nextToken) != LST_EOL)
00670     {
00671       SimpleIdTok ();
00672       InitReduce (SIMPLEIDTOKS2);
00673     }
00674 }
00675 
00676 static void
00677 MapSymToks (void)
00678 {
00679   MapSymTok ();
00680   InitReduce (MAPSYMTOKS1);
00681 
00682   while (ltoken_getCode (nextToken) != LST_EOL)
00683     {
00684       MapSymTok ();
00685       InitReduce (MAPSYMTOKS2);
00686     }
00687 }
00688 
00689 static void
00690 MarkerSymToks (void)
00691 {
00692   MarkerSymTok ();
00693   InitReduce (MARKERSYMTOKS1);
00694 
00695   while (ltoken_getCode (nextToken) != LST_EOL)
00696     {
00697       MarkerSymTok ();
00698       InitReduce (MARKERSYMTOKS2);
00699     }
00700 }
00701 
00702 static void
00703 CommentSymToks (void)
00704 {
00705   CommentSymTok ();
00706   InitReduce (COMMENTSYMTOKS1);
00707 
00708   while (ltoken_getCode (nextToken) != LST_EOL)
00709     {
00710       CommentSymTok ();
00711       InitReduce (COMMENTSYMTOKS2);
00712     }
00713 }
00714 
00715 static void
00716 QuantifierSymTok (void)
00717 {
00718   Token ();
00719   InitReduce (QUANTIFIERSYMTOK1);
00720 }
00721 
00722 static void
00723 LogicalOpTok (void)
00724 {
00725   Token ();
00726   InitReduce (LOGICALOPTOK1);
00727 }
00728 
00729 static void
00730 EqOpTok (void)
00731 {
00732   Token ();
00733   InitReduce (LRC_EQOPTOK1);
00734 }
00735 
00736 static void
00737 EquationSymTok (void)
00738 {
00739  /* ### EquationSymTok (); ### */
00740   Token ();
00741   InitReduce (LRC_EQUATIONSYMTOK1);
00742 }
00743 
00744 static void
00745 EqSepSymTok (void)
00746 {
00747   Token ();
00748   InitReduce (LRC_EQSEPSYMTOK1);
00749 
00750 }
00751 
00752 static void
00753 SelectSymTok (void)
00754 {
00755   Token ();
00756   InitReduce (SELECTSYMTOK1);
00757 }
00758 
00759 static void
00760 OpenSymTok (void)
00761 {
00762   Token ();
00763   InitReduce (OPENSYMTOK1);
00764 }
00765 
00766 static void
00767 SepSymTok (void)
00768 {
00769   Token ();
00770   InitReduce (SEPSYMTOK1);
00771 }
00772 
00773 static void
00774 CloseSymTok (void)
00775 {
00776   Token ();
00777   InitReduce (CLOSESYMTOK1);
00778 }
00779 
00780 static void
00781 SimpleIdTok (void)
00782 {
00783   Token ();
00784   InitReduce (SIMPLEIDTOK1);
00785 }
00786 
00787 static void
00788 MapSymTok (void)
00789 {
00790   Token ();
00791   InitReduce (MAPSYMTOK1);
00792 }
00793 
00794 static void
00795 MarkerSymTok (void)
00796 {
00797   Token ();
00798   InitReduce (MARKERSYMTOK1);
00799 
00800 }
00801 
00802 static void
00803 CommentSymTok (void)
00804 {
00805   Token ();
00806   InitReduce (COMMENTSYMTOK1);
00807 }
00808 
00809 
00810 static void
00811 SynClass (void)
00812 {
00813   if (ltoken_getRawText (nextToken) == ltoken_getText (synonymToken))
00814     {
00815       ltoken_free (nextToken);
00816       nextToken = LSLScanNextToken ();
00817 
00818       OldToken ();
00819       NewToken ();
00820 
00821       InitReduce (SYNCLASS1);
00822     }
00823   else
00824     {
00825       LocalUserError (nextToken, "expected synonym classification");
00826     }
00827 
00828 }
00829 
00830 static void
00831 OldToken (void)
00832 {
00833   Token ();
00834   InitReduce (OLDTOKEN1);
00835 
00836 }
00837 
00838 static void
00839 NewToken (void)
00840 {
00841   Token ();
00842   InitReduce (NEWTOKEN1);
00843 
00844 }
00845 
00846 static void
00847 Token (void)
00848 {
00849   if (ltoken_getCode (nextToken) == LST_EOL
00850       || ltoken_getCode (nextToken) == LEOFTOKEN)
00851     {
00852       LocalUserError (nextToken, "unexpected end-of-line or end-of-file");
00853     }
00854   else
00855     {
00856       LSLGenShiftOnly (nextToken);
00857       nextToken = LSLScanNextToken ();
00858     }
00859 }
00860 
00861 /*
00862 ** Init File Processing Routines, these routines use the shift-reduce sequence
00863 ** produced by the init file parser and update the necessary tables for the
00864 ** scanner.
00865 **
00866 ** The same shift stack is used that LSL parser uses.  A different reduce
00867 ** procedure is used because the init file grammar is different from the LSL
00868 ** grammar.
00869 **
00870 */
00871 
00872 static void
00873 InitReduce (LSLInitRuleCode rule)
00874 {
00875   switch (rule)
00876     {
00877       case INITFILE1:
00878       LTRACE ("INITFILE1");
00879       break;
00880 
00881     case INITLINES1:
00882       LTRACE ("INITLINES1");
00883       break;
00884 
00885     case INITLINES2:
00886       LTRACE ("INITLINES2");
00887       break;
00888 
00889     case INITLINES3:
00890       LTRACE ("INITLINES3");
00891       break;
00892 
00893     case INITLINE1:
00894       LTRACE ("INITLINE1");
00895       break;
00896 
00897     case INITLINE2:
00898       LTRACE ("INITLINE2");
00899       break;
00900 
00901     case CLASSIFICATION1:
00902       LTRACE ("CLASSIFICATION1");
00903       break;
00904 
00905     case CLASSIFICATION2:
00906       LTRACE ("CLASSIFICATION2");
00907       break;
00908 
00909     case CLASSIFICATION3:
00910       LTRACE ("CLASSIFICATION3");
00911       break;
00912 
00913     case CHARCLASS1:
00914       LTRACE ("CHARCLASS1");
00915       break;
00916 
00917     case CHARCLASS2:
00918       LTRACE ("CHARCLASS2");
00919       break;
00920 
00921     case CHARCLASS3:
00922       LTRACE ("CHARCLASS3");
00923       break;
00924 
00925     case CHARCLASS4:
00926       LTRACE ("CHARCLASS4");
00927       break;
00928 
00929     case CHARCLASS5:
00930       LTRACE ("CHARCLASS5");
00931       break;
00932 
00933     case CHARCLASS6:
00934       LTRACE ("CHARCLASS6");
00935       break;
00936 
00937     case LRC_ENDCOMMENT1:
00938       LTRACE ("LRC_ENDCOMMENT1");
00939       break;
00940 
00941     case LRC_ENDCOMMENT2:
00942       LTRACE ("LRC_ENDCOMMENT2");
00943       break;
00944 
00945     case IDCHARS1:
00946       LTRACE ("IDCHARS1");
00947       break;
00948 
00949     case IDCHARS2:
00950       LTRACE ("IDCHARS2");
00951       break;
00952 
00953     case OPCHARS1:
00954       LTRACE ("OPCHARS1");
00955       break;
00956 
00957     case OPCHARS2:
00958       LTRACE ("OPCHARS2");
00959       break;
00960 
00961     case LRC_EXTENSIONCHAR1:
00962       LTRACE ("LRC_EXTENSIONCHAR1");
00963       ProcessExtensionChar ();
00964       break;
00965 
00966     case SINGCHARS1:
00967       LTRACE ("SINGCHARS1");
00968       break;
00969 
00970     case SINGCHARS2:
00971       LTRACE ("SINGCHARS2");
00972       break;
00973 
00974     case WHITECHARS1:
00975       LTRACE ("WHITECHARS1");
00976       break;
00977 
00978     case WHITECHARS2:
00979       LTRACE ("WHITECHARS2");
00980       break;
00981 
00982     case LRC_ENDCOMMENTCHAR1:
00983       LTRACE ("LRC_ENDCOMMENTCHAR1");
00984       ProcessEndCommentChar ();
00985       break;
00986 
00987     case IDCHAR1:
00988       LTRACE ("IDCHAR1");
00989       ProcessSingleChar (IDCHAR);
00990       break;
00991 
00992     case OPCHAR1:
00993       LTRACE ("OPCHAR1");
00994       ProcessSingleChar (OPCHAR);
00995       break;
00996 
00997     case SINGCHAR1:
00998       LTRACE ("SINGCHAR1");
00999       ProcessSingleChar (SINGLECHAR);
01000       break;
01001 
01002     case WHITECHAR1:
01003       LTRACE ("CHAR1");
01004       ProcessSingleChar (WHITECHAR);
01005       break;
01006 
01007     case TOKENCLASS1:
01008       LTRACE ("TOKENCLASS1");
01009       break;
01010 
01011     case TOKENCLASS2:
01012       LTRACE ("TOKENCLASS2");
01013       break;
01014 
01015     case TOKENCLASS3:
01016       LTRACE ("TOKENCLASS3");
01017       break;
01018 
01019     case TOKENCLASS4:
01020       LTRACE ("TOKENCLASS4");
01021       break;
01022 
01023     case TOKENCLASS5:
01024       LTRACE ("TOKENCLASS5");
01025       break;
01026 
01027     case TOKENCLASS6:
01028       LTRACE ("TOKENCLASS6");
01029       break;
01030 
01031     case TOKENCLASS7:
01032       LTRACE ("TOKENCLASS7");
01033       break;
01034 
01035     case TOKENCLASS8:
01036       LTRACE ("TOKENCLASS8");
01037       break;
01038 
01039     case TOKENCLASS9:
01040       LTRACE ("TOKENCLASS9");
01041       break;
01042 
01043     case TOKENCLASS10:
01044       LTRACE ("TOKENCLASS10");
01045       break;
01046 
01047     case TOKENCLASS11:
01048       LTRACE ("TOKENCLASS11");
01049       break;
01050 
01051     case TOKENCLASS12:
01052       LTRACE ("TOKENCLASS12");
01053       break;
01054 
01055     case TOKENCLASS13:
01056       LTRACE ("TOKENCLASS13");
01057       break;
01058 
01059     case QUANTIFIERSYMTOKS1:
01060       LTRACE ("QUALIFERSYMTOKS1");
01061       break;
01062 
01063     case QUANTIFIERSYMTOKS2:
01064       LTRACE ("QUANTIFIERSYMTOKS2");
01065       break;
01066 
01067     case LOGICALOPTOKS1:
01068       LTRACE ("LOGICALOPTOKS1");
01069       break;
01070 
01071     case LOGICALOPTOKS2:
01072       LTRACE ("LOGICALOPTOKS2");
01073       break;
01074 
01075     case LRC_EQOPTOKS1:
01076       LTRACE ("LRC_EQOPTOKS1");
01077       break;
01078 
01079     case LRC_EQOPTOKS2:
01080       LTRACE ("LRC_EQOPTOKS2");
01081       break;
01082 
01083     case LRC_EQUATIONSYMTOKS1:
01084       LTRACE ("LRC_EQUATIONSYMTOKS1");
01085       break;
01086 
01087     case LRC_EQUATIONSYMTOKS2:
01088       LTRACE ("LRC_EQUATIONSYMTOKS2");
01089       break;
01090 
01091     case LRC_EQSEPSYMTOKS1:
01092       LTRACE ("LRC_EQSEPSYMTOKS1");
01093       break;
01094 
01095     case LRC_EQSEPSYMTOKS2:
01096       LTRACE ("LRC_EQSEPSYMTOKS2");
01097       break;
01098 
01099     case SELECTSYMTOKS1:
01100       LTRACE ("SELECTSYMTOKS1");
01101       break;
01102 
01103     case SELECTSYMTOKS2:
01104       LTRACE ("SELECTSYMTOKS2");
01105       break;
01106 
01107     case OPENSYMTOKS1:
01108       LTRACE ("OPENSYMTOKS1");
01109       break;
01110 
01111     case OPENSYMTOKS2:
01112       LTRACE ("OPENSYMTOKS2");
01113       break;
01114 
01115     case SEPSYMTOKS1:
01116       LTRACE ("SEPSYMTOKS1");
01117       break;
01118 
01119     case SEPSYMTOKS2:
01120       LTRACE ("SEPSYMTOKS2");
01121       break;
01122 
01123     case CLOSESYMTOKS1:
01124       LTRACE ("CLOSESYMTOKS1");
01125       break;
01126 
01127     case CLOSESYMTOKS2:
01128       LTRACE ("CLOSESYMTOKS2");
01129       break;
01130 
01131     case SIMPLEIDTOKS1:
01132       LTRACE ("SIMPLEIDTOKS1");
01133       break;
01134 
01135     case SIMPLEIDTOKS2:
01136       LTRACE ("SIMPLEIDTOKS2");
01137       break;
01138 
01139     case MAPSYMTOKS1:
01140       LTRACE ("MAPSYMTOKS1");
01141       break;
01142 
01143     case MAPSYMTOKS2:
01144       LTRACE ("MAPSYMTOKS2");
01145       break;
01146 
01147     case MARKERSYMTOKS1:
01148       LTRACE ("MARKERSYMTOKS1");
01149       break;
01150 
01151     case MARKERSYMTOKS2:
01152       LTRACE ("MARKERSYMTOKS2");
01153       break;
01154 
01155     case COMMENTSYMTOKS1:
01156       LTRACE ("COMMENTSYMTOKS1");
01157       break;
01158 
01159     case COMMENTSYMTOKS2:
01160       LTRACE ("COMMENTSYMTOKS2");
01161       break;
01162 
01163     case QUANTIFIERSYMTOK1:
01164       LTRACE ("QUANTIFERSYMTOK1");
01165       ProcessToken (LST_QUANTIFIERSYM);
01166       break;
01167 
01168     case LOGICALOPTOK1:
01169       LTRACE ("LOGICALOPTOK1");
01170       ProcessToken (LST_LOGICALOP);
01171       break;
01172 
01173     case LRC_EQOPTOK1:
01174       LTRACE ("LRC_EQOPTOK1");
01175       ProcessToken (LST_EQOP);
01176       break;
01177 
01178     case LRC_EQUATIONSYMTOK1:
01179       LTRACE ("LRC_EQUATIONSYMTOK1");
01180       ProcessToken (LST_EQUATIONSYM);
01181       break;
01182 
01183     case LRC_EQSEPSYMTOK1:
01184       LTRACE ("LRC_EQSEPSYMTOK1");
01185       ProcessToken (LST_EQSEPSYM);
01186       break;
01187 
01188     case SELECTSYMTOK1:
01189       LTRACE ("SELECTSYMTOK1");
01190       ProcessToken (LST_SELECTSYM);
01191       break;
01192 
01193     case OPENSYMTOK1:
01194       LTRACE ("OPENSYMTOK1");
01195       ProcessToken (LST_OPENSYM);
01196       break;
01197 
01198     case SEPSYMTOK1:
01199       LTRACE ("SEPSYMTOK1");
01200       ProcessToken (LST_SEPSYM);
01201       break;
01202 
01203     case CLOSESYMTOK1:
01204       LTRACE ("CLOSESYMTOK1");
01205       ProcessToken (LST_CLOSESYM);
01206       break;
01207 
01208     case SIMPLEIDTOK1:
01209       LTRACE ("SIMPLEIDTOK1");
01210       ProcessToken (LST_SIMPLEID);
01211       break;
01212 
01213     case MAPSYMTOK1:
01214       LTRACE ("MAPSYMTOK1");
01215       ProcessToken (LST_MAPSYM);
01216       break;
01217 
01218     case MARKERSYMTOK1:
01219       LTRACE ("MARKERSYMTOK1");
01220       ProcessToken (LST_MARKERSYM);
01221       break;
01222 
01223     case COMMENTSYMTOK1:
01224       LTRACE ("COMMENTSYMTOK1");
01225       ProcessToken (LST_COMMENTSYM);
01226       break;
01227 
01228     case SYNCLASS1:
01229       LTRACE ("SYNCLASS1");
01230       ProcessSynonym ();
01231       break;
01232 
01233     case OLDTOKEN1:
01234       LTRACE ("OLDTOKEN1");
01235       break;
01236 
01237     case NEWTOKEN1:
01238       LTRACE ("NEWTOKEN1");
01239       break;
01240 
01241     default:
01242       llcontbuglit ("InitReduce: bad switch");
01243       break;
01244 
01245     }                           /* end switch       */
01246 }                               /* end InitReduce () */
01247 
01248 
01249 
01250 /* Reset the first character of the predefined extensionChar keywords when  */
01251 /* the extensionChar changes.  e.g. "extensionChar @" changes "forall" to   */
01252 /* "@forall".                                                               */
01253 
01254 static void
01255 UpdateXCharKeywords (charCode xCharCode)
01256 {
01257   char xChar = (char) xCharCode;
01258   char *str;
01259 
01260   str = ltoken_getTextChars (ltoken_forall);
01261   *str = xChar;
01262 
01263   str = ltoken_getTextChars (ltoken_and);
01264   *str = xChar;
01265 
01266   str = ltoken_getTextChars (ltoken_or);
01267   *str = xChar;
01268 
01269   str = ltoken_getTextChars (ltoken_implies);
01270   *str = xChar;
01271 
01272   str = ltoken_getTextChars (ltoken_eq);
01273   *str = xChar;
01274 
01275   str = ltoken_getTextChars (ltoken_neq);
01276   *str = xChar;
01277 
01278   str = ltoken_getTextChars (ltoken_equals);
01279   *str = xChar;
01280 
01281   str = ltoken_getTextChars (ltoken_eqsep);
01282   *str = xChar;
01283 
01284   str = ltoken_getTextChars (ltoken_select);
01285   *str = xChar;
01286 
01287   str = ltoken_getTextChars (ltoken_open);
01288   *str = xChar;
01289 
01290   str = ltoken_getTextChars (ltoken_sep);
01291   *str = xChar;
01292 
01293   str = ltoken_getTextChars (ltoken_close);
01294   *str = xChar;
01295 
01296   str = ltoken_getTextChars (ltoken_id);
01297   *str = xChar;
01298 
01299   str = ltoken_getTextChars (ltoken_arrow);
01300   *str = xChar;
01301 
01302   str = ltoken_getTextChars (ltoken_marker);
01303   *str = xChar;
01304 
01305   str = ltoken_getTextChars (ltoken_comment);
01306   *str = xChar;
01307 
01308 }
01309 
01310 /* Different from ProcessCharClass because only allow one extension         */
01311 /* character. Therefore, the present extension character must be set to a   */
01312 /* singleChar.                                                              */
01313 
01314 static void
01315 ProcessExtensionChar (void)
01316 {
01317   ltoken stackToken = LSLGenTopPopShiftStack ();
01318   char firstChar = cstring_firstChar (ltoken_unparse (stackToken));
01319 
01320   if (!defineSingleChar[(int)firstChar]
01321       && lscanCharClass (firstChar) == SINGLECHAR)
01322     {
01323      /* Is a single character that has not been defined before.     */
01324      /* Can only have one extension char.  Release old one. */
01325       lsetCharClass (firstChar, CHC_EXTENSION);
01326       
01327       /* this is a (bogus) type bug! caught by lclint */
01328       /* lsetCharClass (currentExtensionChar, SINGLECHAR); */
01329 
01330       lsetCharClass ((char) currentExtensionChar, SINGLECHAR);
01331 
01332       currentExtensionChar = (charCode) firstChar;
01333       UpdateXCharKeywords (currentExtensionChar);
01334     }
01335   else
01336     {
01337      /* Already redefined.  Don't allow to be redefined. */
01338       LocalUserError (stackToken, "character is already defined, cannot redefine");
01339     }
01340   ltoken_free (stackToken);
01341 }
01342 
01343 /* Different from ProcessSingleChar because allow any characters to be      */
01344 /* endCommentChar and also set a different part of the scanner structure.   */
01345 
01346 static void
01347 ProcessEndCommentChar (void)
01348 {
01349   ltoken stackToken = LSLGenTopPopShiftStack ();
01350   char firstChar = cstring_firstChar (ltoken_unparse (stackToken));
01351 
01352   if (LSLIsEndComment (firstChar))
01353     {
01354       LocalUserError (stackToken,
01355                     "already defined as a endCommentChar, cannot redefine");
01356     }
01357   else
01358     {
01359       lsetEndCommentChar (firstChar, TRUE);
01360     }
01361   ltoken_free (stackToken);
01362 }
01363 
01364 static void
01365 ProcessSingleChar (charCode code)
01366 {
01367   ltoken stackToken = LSLGenTopPopShiftStack ();
01368   char firstChar = cstring_firstChar (ltoken_unparse (stackToken));
01369 
01370   if (!defineSingleChar[(int)firstChar]
01371       && lscanCharClass (firstChar) == SINGLECHAR)
01372     {
01373       /* Is a single character that has not been defined before.            */
01374       /* It's OK to redefine once. */
01375       lsetCharClass (firstChar, code);
01376       /* OK to mark as a defined singleChar even if not.  Only check        */
01377       /* defineSingleChar[] if defining a singleChar.                       */
01378       defineSingleChar[(int)firstChar] = TRUE;
01379     }
01380   else
01381     {
01382       LocalUserError (stackToken, "character is already defined, cannot redefine");
01383     }
01384   ltoken_free (stackToken);
01385 }
01386 
01387 static void
01388 ProcessToken (ltokenCode code)
01389 {
01390   ltoken stackToken, temp;
01391   lsymbol sym;
01392 
01393   stackToken = LSLGenTopPopShiftStack ();
01394   sym = ltoken_getText (stackToken);
01395 
01396   if (LSLIsSyn (sym))
01397     {
01398       LocalUserError (stackToken,
01399                       "already defined as a synonym, cannot redefine");
01400     }
01401 
01402   /* Get the token from the token table, so can check if the token    */
01403   /* was updated by a previous token.                               */
01404   temp = LSLGetToken (sym);
01405   
01406   if (ltoken_isStateDefined (temp))
01407     {
01408       if ((code == LST_OPENSYM && sym == lsymbol_fromChars ("[")) ||
01409           (code == LST_CLOSESYM && sym == lsymbol_fromChars ("]")))
01410         {
01411           /* ignore "openSym [" and "closeSym ]" TokenClass */
01412           ltoken_free (stackToken);
01413           return;
01414         }
01415       else
01416         {
01417           LocalUserError (stackToken, "already defined, cannot redefine");
01418           PrintToken (temp);
01419         }
01420     }
01421   
01422   LSLUpdateToken (code, ltoken_getText (stackToken), TRUE);
01423   ltoken_free (stackToken);
01424 }
01425 
01426 
01427 static void
01428 ProcessSynonym (void)
01429 {
01430   ltoken newtok;
01431   ltoken oldtok;
01432 
01433   newtok = LSLGenTopPopShiftStack ();
01434   oldtok = LSLGenTopPopShiftStack ();
01435 
01436   if (ltoken_wasSyn (newtok))
01437     {
01438      /* The token has a synonym.  This means that the synonym was in the */
01439      /* init file, so complain about redefining as a synonym again          */
01440       LocalUserError (newtok, "newtok already is a synonym, cannot redefine");
01441     }
01442 
01443   if (ltoken_hasSyn (newtok))
01444     {
01445       /*
01446       ** newtok already has a synonym defined for it.  Do not allow         
01447       ** synonyms to be chained.                                            
01448       */
01449 
01450       LocalUserError (newtok,
01451                       "newtok already has a synonym, cannot chain synonyms");
01452     }
01453 
01454   if (ltoken_isStateDefined (newtok))
01455     {
01456       LocalUserError (newtok, "newtok already defined, cannot redefine");
01457     }
01458 
01459   LSLAddSyn (ltoken_getText (newtok), ltoken_getText (oldtok));
01460   ltoken_free (oldtok);
01461   ltoken_free (newtok);
01462 }
01463 
01464 
01465 /*
01466  * Utilities, in alphabetical order
01467  */
01468 
01469 static void
01470 LocalUserError (ltoken t, /*@temp@*/ char *msg)
01471 {
01472   lldiagmsg (message ("%s %s in the LSL init file:", 
01473                       ltoken_unparse (t), cstring_fromChars (msg)));
01474 
01475   ltoken_free (nextToken);
01476   nextToken = LSLScanNextToken ();             
01477 
01478   while (ltoken_getCode (nextToken) != LST_EOL)
01479     {
01480       ltoken_free (nextToken);
01481       nextToken = LSLScanNextToken ();
01482     }
01483 }
01484 
01485 /*
01486 **  Required initialization and cleanup routines
01487 */
01488 
01489 static /*@exposed@*/ ltoken insertSimpleToken (char *text) 
01490   /*@modifies internalState@*/
01491 {
01492   return (LSLInsertToken (LST_SIMPLEID, lsymbol_fromChars (text), 0, FALSE));
01493 }
01494 
01495 void
01496 LSLProcessInitFileInit (void)
01497 {
01498   int i;
01499 
01500   LSLGenInit (TRUE);            /* parsing LSLinit not LCLinit */
01501 
01502   /*
01503   ** Insert the init file keywords into the token table as undefined        
01504   ** SIMPLEIDs.  They are defined as simpleIds since they must be treated 
01505   ** that way if they do not appear as the first token on a line, and       
01506   ** they must be treated that way for the actual LSL parsing. Save the   
01507   ** tokens so can recognize as init file keywords when necessary.       
01508   */
01509 
01510   endCommentCharToken = insertSimpleToken ("endCommentChar");
01511   idCharToken = insertSimpleToken ("idChar");                        
01512   opCharToken = insertSimpleToken ("opChar");                        
01513   extensionCharToken = insertSimpleToken ("extensionChar");    
01514   singleCharToken = insertSimpleToken ("singleChar");   
01515   whiteCharToken = insertSimpleToken ("whiteChar");
01516 
01517   quantifierSymToken = insertSimpleToken ("quantifierSym");
01518   logicalOpToken = insertSimpleToken ("logicalOp");
01519   eqOpToken = insertSimpleToken ("eqOp");                          
01520   equationSymToken = insertSimpleToken ("equationSym");
01521   eqSepSymToken = insertSimpleToken ("eqSepSym");                              
01522   selectSymToken = insertSimpleToken ("selectSym");
01523   openSymToken = insertSimpleToken ("openSym");                       
01524   sepSymToken = insertSimpleToken ("sepSym");                        
01525   closeSymToken = insertSimpleToken ("closeSym");                              
01526   simpleIdToken = insertSimpleToken ("simpleId");                              
01527   mapSymToken = insertSimpleToken ("mapSym");                        
01528   markerSymToken = insertSimpleToken ("markerSym");
01529   commentSymToken = insertSimpleToken ("commentSym"); 
01530   synonymToken = insertSimpleToken ("synonym");                       
01531 
01532   for (i = 0; i <= LASTCHAR; i++)
01533     {
01534       defineSingleChar[i] = FALSE;
01535     }
01536   
01537   /*
01538   ** Record the current extension character so can redefine back to         
01539   ** singleChar if a new extension character is redefined.                  
01540   */
01541 
01542   currentExtensionChar = (charCode) CHAREXTENDER;
01543 
01544   LSLReportEolTokens (TRUE);
01545   ltoken_free (nextToken);
01546   nextToken = LSLScanNextToken ();             
01547 }
01548 
01549 
01550 
01551 
01552 
01553 
01554 
01555 

Generated at Fri Nov 3 18:57:43 2000 for LCLint by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000