rokicki@rocky.STANFORD.EDU (Tomas Rokicki) (12/30/87)
---cut here--- } break ; default : if ( ( lexclass [ exbuf [ exbufptr ] ] == 1 ) ) { incr ( exbufptr ) ; precedingwhite = true ; } else { incr ( exbufptr ) ; precedingwhite = false ; } break ; } checkbracelevel ( poplitvar ) ; } boolean vontokenfound () { /* 10 */ boolean temp ; nmbracelevel = 0 ; temp = false ; while ( ( namebfptr < namebfxptr ) ) if ( ( ( svbuffer [ namebfptr ] >= 65 ) && ( svbuffer [ namebfptr ] <= 90 ) ) ) return ( false ) ; else if ( ( ( svbuffer [ namebfptr ] >= 97 ) && ( svbuffer [ namebfptr ] <= 122 ) ) ) return ( true ) ; else if ( ( svbuffer [ namebfptr ] == 123 ) ) { incr ( nmbracelevel ) ; incr ( namebfptr ) ; while ( ( ( nmbracelevel > 0 ) && ( namebfptr < namebfxptr ) ) ) { if ( ( svbuffer [ namebfptr ] == 125 ) ) decr ( nmbracelevel ) ; else if ( ( svbuffer [ namebfptr ] == 123 ) ) incr ( nmbracelevel ) ; incr ( namebfptr ) ; } } else incr ( namebfptr ) ; return ( false ) ; } vonnameendsandlastna () { /* 10 */ if ( ( vonstart >= lastend - 1 ) ) vonend = vonstart ; else { vonend = lastend - 1 ; while ( ( vonend > vonstart ) ) { namebfptr = nametok [ vonend - 1 ] ; namebfxptr = nametok [ vonend ] ; if ( ( vontokenfound () ) ) goto lab10 ; decr ( vonend ) ; } } lab10 : ; } skipstuffatspbracele () { while ( ( ( spbracelevel > 1 ) && ( spptr < spend ) ) ) { if ( ( strpool [ spptr ] == 125 ) ) decr ( spbracelevel ) ; else if ( ( strpool [ spptr ] == 123 ) ) incr ( spbracelevel ) ; incr ( spptr ) ; } } bracelvlonelettersco () { tputs ( cnull , "the format string \"" ) ; printpoolstr ( poplit1 ) ; tputs ( cnull , "\" has an illegal brace-level-1 letter\n" ) ; { tputs ( cnull , " " ) ; bstexwarnprint () ; } } bracesunbalancedcomp () { tputs ( cnull , "the format string \"" ) ; printpoolstr ( poplit1 ) ; tputs ( cnull , "\" is not brace balanced\n" ) ; { tputs ( cnull , " " ) ; bstexwarnprint () ; } } zpushlitstk ( pushlt , pushtype ) integer pushlt ; stktype pushtype ; { #ifdef TRACE litstkloc dumptr ; #endif litstack [ litstkptr ] = pushlt ; litstktype [ litstkptr ] = pushtype ; #ifdef TRACE for ( dumptr = 0 ; dumptr <= litstkptr ; dumptr ++ ) tputs ( logfile , " " ) ; tputs ( logfile , "pushing " ) ; switch ( litstktype [ litstkptr ] ) { case 0 : { tputi ( logfile , litstack [ litstkptr ] ) ; tputc ( logfile , 10 ) ; } break ; case 1 : { tputs ( logfile , "\"" ) ; traceprpoolstr ( litstack [ litstkptr ] ) ; tputs ( logfile , "\"\n" ) ; } break ; case 2 : { tputs ( logfile , "`" ) ; traceprpoolstr ( hashtext [ litstack [ litstkptr ] ] ) ; tputs ( logfile , "'\n" ) ; } break ; case 3 : { tputs ( logfile , "missing field `" ) ; traceprpoolstr ( litstack [ litstkptr ] ) ; tputs ( logfile , "'\n" ) ; } break ; case 4 : tputs ( logfile , "a bad literal--popped from an empty stack\n" ) ; break ; default : tputs ( cnull , "this can't happen---unknown literal type\n" ) ; break ; } #endif if ( ( litstkptr == litstksize ) ) { tputs ( cnull , "Sorry, you've exceeded BibTeX's literal-stack size " ) ; tputi ( cnull , litstksize ) ; tputc ( cnull , 10 ) ; jumpout ( 1 ) ; } incr ( litstkptr ) ; } integer zpoplitstk ( poptype ) stktype * poptype ; { integer poplit ; if ( ( litstkptr == 0 ) ) { { tputs ( cnull , "you can't pop an empty literal stack" ) ; bstexwarnprint () ; } * poptype = 4 ; } else { decr ( litstkptr ) ; poplit = litstack [ litstkptr ] ; * poptype = litstktype [ litstkptr ] ; if ( ( * poptype == 1 ) ) if ( ( poplit >= cmdstrptr ) ) { if ( ( poplit != strptr - 1 ) ) tputs ( cnull , "this can't happen---nontop top of string stack\n" ) ; { decr ( strptr ) ; poolptr = strstart [ strptr ] ; } } } return ( poplit ) ; } zprintwrongstklit ( stklt , stktp1 , stktp2 ) integer stklt ; stktype stktp1 , stktp2 ; { printstklit ( stklt , stktp1 ) ; switch ( stktp2 ) { case 0 : tputs ( cnull , ", not an integer\n" ) ; break ; case 1 : tputs ( cnull , ", not a string\n" ) ; break ; case 2 : tputs ( cnull , ", not a function\n" ) ; break ; case 3 : case 4 : tputs ( cnull , "---this can't happen---an illegal literal type\n" ) ; break ; default : tputs ( cnull , "---this can't happen---unknown literal type\n" ) ; break ; } { tputs ( cnull , " " ) ; bstexwarnprint () ; } } poptopandprint () { integer stklt ; stktype stktp ; stklt = poplitstk ( stktp ) ; printlit ( stklt , stktp ) ; } popwholestack () { while ( ( litstkptr > 0 ) ) poptopandprint () ; } initcommandexecution () { litstkptr = 0 ; cmdstrptr = strptr ; } checkcommandexecutio () { if ( ( litstkptr != 0 ) ) { tputi ( cnull , litstkptr ) ; tputs ( cnull , "=ptr---the literal stack isn't empty---\n" ) ; popwholestack () ; { tputs ( cnull , " " ) ; bstexwarnprint () ; } } if ( ( cmdstrptr != strptr ) ) { tputs ( cnull , "this can't happen---nonempty empty string stack---\n" ) ; { tputs ( cnull , "pointer is " ) ; tputi ( cnull , strptr ) ; tputs ( cnull , " but should be " ) ; tputi ( cnull , cmdstrptr ) ; tputc ( cnull , 10 ) ; } { tputs ( cnull , " " ) ; bstexwarnprint () ; } } } addpoolbufandpush () { { if ( ( poolptr + exbuflength > poolsize ) ) { tputs ( cnull , "Sorry, you've exceeded BibTeX's pool size " ) ; tputi ( cnull , poolsize ) ; tputc ( cnull , 10 ) ; jumpout ( 1 ) ; } } exbufptr = 0 ; while ( ( exbufptr < exbuflength ) ) { { strpool [ poolptr ] = exbuf [ exbufptr ] ; incr ( poolptr ) ; } incr ( exbufptr ) ; } makestring () ; pushlitstk ( strptr - 1 , 1 ) ; } zaddbufpool ( pstr ) strnumber pstr ; { pptr1 = strstart [ pstr ] ; pptr2 = strstart [ pstr + 1 ] ; if ( ( exbuflength + ( pptr2 - pptr1 ) > bufsize ) ) { tputs ( cnull , "Sorry, you've exceeded BibTeX's execution buffer size " ) ; tputi ( cnull , bufsize ) ; tputc ( cnull , 10 ) ; jumpout ( 1 ) ; } exbufptr = exbuflength ; while ( ( pptr1 < pptr2 ) ) { { exbuf [ exbufptr ] = strpool [ pptr1 ] ; incr ( exbufptr ) ; } incr ( pptr1 ) ; } exbuflength = exbufptr ; } zaddoutpool ( pstr ) strnumber pstr ; { bufpointer breakptr ; bufpointer endptr ; pptr1 = strstart [ pstr ] ; pptr2 = strstart [ pstr + 1 ] ; if ( ( outbuflength + ( pptr2 - pptr1 ) > bufsize ) ) { tputs ( cnull , "Sorry, you've exceeded BibTeX's output buffer size " ) ; tputi ( cnull , bufsize ) ; tputc ( cnull , 10 ) ; jumpout ( 1 ) ; } outbufptr = outbuflength ; while ( ( pptr1 < pptr2 ) ) { outbuf [ outbufptr ] = strpool [ pptr1 ] ; incr ( pptr1 ) ; incr ( outbufptr ) ; } outbuflength = outbufptr ; while ( ( outbuflength > maxprintline ) ) { endptr = outbuflength ; outbufptr = maxprintline ; while ( ( ( lexclass [ outbuf [ outbufptr ] ] != 1 ) && ( outbufptr >= minprintline ) ) ) decr ( outbufptr ) ; if ( ( outbufptr == minprintline - 1 ) ) { tputs ( cnull , "unbreakable output line---line " ) ; tputi ( cnull , bbllinenum ) ; tputs ( cnull , " of file " ) ; printpoolstr ( toplevstr ) ; printpoolstr ( sbblextension ) ; tputc ( cnull , 10 ) ; { tputs ( cnull , " this error is" ) ; bstexwarnprint () ; } outbuflength = maxprintline ; breakptr = outbuflength ; } else { outbuflength = outbufptr ; breakptr = outbuflength + 1 ; } outputbblline () ; outbuf [ 0 ] = 32 ; outbuf [ 1 ] = 32 ; outbufptr = 2 ; while ( ( outbufptr <= endptr - breakptr + 1 ) ) { outbuf [ outbufptr ] = outbuf [ outbufptr + breakptr - 2 ] ; incr ( outbufptr ) ; } outbuflength = endptr - breakptr + 2 ; } } xequals () { poplit1 = poplitstk ( poptyp1 ) ; poplit2 = poplitstk ( poptyp2 ) ; if ( ( poptyp1 != poptyp2 ) ) { printstklit ( poplit1 , poptyp1 ) ; printstklit ( poplit2 , poptyp2 ) ; tputc ( cnull , 10 ) ; { tputs ( cnull , "--they aren't the same literal types" ) ; bstexwarnprint () ; } pushlitstk ( 0 , 0 ) ; } else if ( ( ( poptyp1 != 0 ) && ( poptyp1 != 1 ) ) ) { printstklit ( poplit1 , poptyp1 ) ; tputs ( cnull , ", not an integer or a string\n" ) ; { tputs ( cnull , " " ) ; bstexwarnprint () ; } pushlitstk ( 0 , 0 ) ; } else if ( ( poptyp1 == 0 ) ) if ( ( poplit2 == poplit1 ) ) pushlitstk ( 1 , 0 ) ; else pushlitstk ( 0 , 0 ) ; else if ( ( streqstr ( poplit2 , poplit1 ) ) ) pushlitstk ( 1 , 0 ) ; else pushlitstk ( 0 , 0 ) ; } xgreaterthan () { poplit1 = poplitstk ( poptyp1 ) ; poplit2 = poplitstk ( poptyp2 ) ; if ( ( poptyp1 != 0 ) ) { printwrongstklit ( poplit1 , poptyp1 , 0 ) ; pushlitstk ( 0 , 0 ) ; } else if ( ( poptyp2 != 0 ) ) { printwrongstklit ( poplit2 , poptyp2 , 0 ) ; pushlitstk ( 0 , 0 ) ; } else if ( ( poplit2 > poplit1 ) ) pushlitstk ( 1 , 0 ) ; else pushlitstk ( 0 , 0 ) ; } xlessthan () { poplit1 = poplitstk ( poptyp1 ) ; poplit2 = poplitstk ( poptyp2 ) ; if ( ( poptyp1 != 0 ) ) { printwrongstklit ( poplit1 , poptyp1 , 0 ) ; pushlitstk ( 0 , 0 ) ; } else if ( ( poptyp2 != 0 ) ) { printwrongstklit ( poplit2 , poptyp2 , 0 ) ; pushlitstk ( 0 , 0 ) ; } else if ( ( poplit2 < poplit1 ) ) pushlitstk ( 1 , 0 ) ; else pushlitstk ( 0 , 0 ) ; } xplus () { poplit1 = poplitstk ( poptyp1 ) ; poplit2 = poplitstk ( poptyp2 ) ; if ( ( poptyp1 != 0 ) ) { printwrongstklit ( poplit1 , poptyp1 , 0 ) ; pushlitstk ( 0 , 0 ) ; } else if ( ( poptyp2 != 0 ) ) { printwrongstklit ( poplit2 , poptyp2 , 0 ) ; pushlitstk ( 0 , 0 ) ; } else pushlitstk ( poplit2 + poplit1 , 0 ) ; } xminus () { poplit1 = poplitstk ( poptyp1 ) ; poplit2 = poplitstk ( poptyp2 ) ; if ( ( poptyp1 != 0 ) ) { printwrongstklit ( poplit1 , poptyp1 , 0 ) ; pushlitstk ( 0 , 0 ) ; } else if ( ( poptyp2 != 0 ) ) { printwrongstklit ( poplit2 , poptyp2 , 0 ) ; pushlitstk ( 0 , 0 ) ; } else pushlitstk ( poplit2 - poplit1 , 0 ) ; } xconcatenate () { poplit1 = poplitstk ( poptyp1 ) ; poplit2 = poplitstk ( poptyp2 ) ; if ( ( poptyp1 != 1 ) ) { printwrongstklit ( poplit1 , poptyp1 , 1 ) ; pushlitstk ( snull , 1 ) ; } else if ( ( poptyp2 != 1 ) ) { printwrongstklit ( poplit2 , poptyp2 , 1 ) ; pushlitstk ( snull , 1 ) ; } else { exbuflength = 0 ; addbufpool ( poplit2 ) ; addbufpool ( poplit1 ) ; addpoolbufandpush () ; } } xgets () { poplit1 = poplitstk ( poptyp1 ) ; poplit2 = poplitstk ( poptyp2 ) ; if ( ( poptyp2 != 2 ) ) printwrongstklit ( poplit2 , poptyp2 , 2 ) ; else if ( ( ( ! messwithentries ) && ( ( fntype [ poplit2 ] == 7 ) || ( fntype [ poplit2 ] == 6 ) ) ) ) { tputs ( cnull , "you can't mess with entries here" ) ; bstexwarnprint () ; } else switch ( fntype [ poplit2 ] ) { case 6 : if ( ( poptyp1 != 0 ) ) printwrongstklit ( poplit1 , poptyp1 , 0 ) ; else entryints [ citeptr * numentints + ilkinfo [ poplit2 ] ] = poplit1 ; break ; case 7 : if ( ( poptyp1 != 1 ) ) printwrongstklit ( poplit1 , poptyp1 , 1 ) ; else { strentptr = citeptr * numentstrs + ilkinfo [ poplit2 ] ; entchrptr = 0 ; spptr = strstart [ poplit1 ] ; spxptr1 = strstart [ poplit1 + 1 ] ; mymalloc ( entrystrs [ strentptr ] , spxptr1 - spptr + 1 ) ; while ( ( spptr < spxptr1 ) ) { entrystrs [ strentptr ] [ entchrptr ] = strpool [ spptr ] ; incr ( entchrptr ) ; incr ( spptr ) ; } entrystrs [ strentptr ] [ entchrptr ] = 127 ; } break ; case 8 : if ( ( poptyp1 != 0 ) ) printwrongstklit ( poplit1 , poptyp1 , 0 ) ; else ilkinfo [ poplit2 ] = poplit1 ; break ; case 9 : if ( ( poptyp1 != 1 ) ) printwrongstklit ( poplit1 , poptyp1 , 1 ) ; else { strglbptr = ilkinfo [ poplit2 ] ; globchrptr = 0 ; spptr = strstart [ poplit1 ] ; spxptr1 = strstart [ poplit1 + 1 ] ; mymalloc ( globalstrs [ strglbptr ] , spxptr1 - spptr + 1 ) ; while ( ( spptr < spxptr1 ) ) { globalstrs [ strglbptr ] [ globchrptr ] = strpool [ spptr ] ; incr ( globchrptr ) ; incr ( spptr ) ; } globalstrs [ strglbptr ] [ globchrptr ] = 127 ; } break ; default : { tputs ( cnull , "you can't assign to type " ) ; printfnclass ( poplit2 ) ; tputs ( cnull , ", a nonvariable function class\n" ) ; { tputs ( cnull , " " ) ; bstexwarnprint () ; } } break ; } } xaddperiod () { /* 15 */ poplit1 = poplitstk ( poptyp1 ) ; if ( ( poptyp1 != 1 ) ) { printwrongstklit ( poplit1 , poptyp1 , 1 ) ; pushlitstk ( snull , 1 ) ; } else { exbuflength = 0 ; addbufpool ( poplit1 ) ; exbufptr = exbuflength ; while ( ( exbufptr > 0 ) ) { decr ( exbufptr ) ; if ( ( exbuf [ exbufptr ] != 125 ) ) goto lab15 ; } lab15 : if ( ( exbufptr == 0 ) ) addbufpool ( speriod ) ; else switch ( exbuf [ exbufptr ] ) { case 46 : case 63 : case 33 : ; break ; default : addbufpool ( speriod ) ; break ; } addpoolbufandpush () ; } } xchangecase () { poplit1 = poplitstk ( poptyp1 ) ; poplit2 = poplitstk ( poptyp2 ) ; if ( ( poptyp1 != 1 ) ) { printwrongstklit ( poplit1 , poptyp1 , 1 ) ; pushlitstk ( snull , 1 ) ; } else if ( ( poptyp2 != 1 ) ) { printwrongstklit ( poplit2 , poptyp2 , 1 ) ; pushlitstk ( snull , 1 ) ; } else { exbuflength = 0 ; addbufpool ( poplit1 ) ; lowercase ( exbuf , 0 , ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ] ) ) ; if ( ( streqbuf ( sul , exbuf , 0 , ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ] ) ) ) ) conversiontype = 0 ; else if ( ( streqbuf ( sll , exbuf , 0 , ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ] ) ) ) ) conversiontype = 1 ; else if ( ( streqbuf ( suu , exbuf , 0 , ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ] ) ) ) ) conversiontype = 2 ; else if ( ( streqbuf ( slu , exbuf , 0 , ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ] ) ) ) ) conversiontype = 3 ; else { conversiontype = 4 ; printpoolstr ( poplit1 ) ; { tputs ( cnull , " is an illegal case-conversion string" ) ; bstexwarnprint () ; } } exbuflength = 0 ; addbufpool ( poplit2 ) ; bracelevel = 0 ; exbufptr = 0 ; if ( ( exbufptr < exbuflength ) ) if ( ( exbuf [ exbufptr ] == 123 ) ) incr ( bracelevel ) ; else if ( ( exbuf [ exbufptr ] == 125 ) ) decrbracelevel ( poplit2 ) ; else { switch ( conversiontype ) { case 0 : case 2 : uppercase ( exbuf , exbufptr , 1 ) ; break ; case 1 : case 3 : lowercase ( exbuf , exbufptr , 1 ) ; break ; case 4 : ; break ; default : tputs ( cnull , "this can't happen---unknown type of case conversion\n" ) ; break ; } } incr ( exbufptr ) ; while ( ( exbufptr < exbuflength ) ) { if ( ( exbuf [ exbufptr ] == 125 ) ) decrbracelevel ( poplit2 ) ; else if ( ( exbuf [ exbufptr ] == 123 ) ) incr ( bracelevel ) ; else if ( ( bracelevel == 0 ) ) { switch ( conversiontype ) { case 0 : case 1 : lowercase ( exbuf , exbufptr , 1 ) ; break ; case 2 : case 3 : uppercase ( exbuf , exbufptr , 1 ) ; break ; case 4 : ; break ; default : tputs ( cnull , "this can't happen---unknown type of case conversion\n" ) ; break ; } } incr ( exbufptr ) ; } checkbracelevel ( poplit2 ) ; addpoolbufandpush () ; } } xchrtoint () { poplit1 = poplitstk ( poptyp1 ) ; if ( ( poptyp1 != 1 ) ) { printwrongstklit ( poplit1 , poptyp1 , 1 ) ; pushlitstk ( 0 , 0 ) ; } else if ( ( ( strstart [ poplit1 + 1 ] - strstart [ poplit1 ] ) != 1 ) ) { tputs ( cnull , "\"" ) ; printpoolstr ( poplit1 ) ; { tputs ( cnull , "\" isn't a single character" ) ; bstexwarnprint () ; } pushlitstk ( 0 , 0 ) ; } else pushlitstk ( strpool [ strstart [ poplit1 ] ] , 0 ) ; } xcite () { if ( ( ! messwithentries ) ) { tputs ( cnull , "you can't mess with entries here" ) ; bstexwarnprint () ; } else pushlitstk ( citelist [ citeptr ] , 1 ) ; } xduplicate () { poplit1 = poplitstk ( poptyp1 ) ; if ( ( poptyp1 != 1 ) ) { pushlitstk ( poplit1 , poptyp1 ) ; pushlitstk ( poplit1 , poptyp1 ) ; } else { exbuflength = 0 ; addbufpool ( poplit1 ) ; addpoolbufandpush () ; addpoolbufandpush () ; } } xformatname () { /* 16 17 */ poplit1 = poplitstk ( poptyp1 ) ; poplit2 = poplitstk ( poptyp2 ) ; poplit3 = poplitstk ( poptyp3 ) ; if ( ( poptyp1 != 1 ) ) { printwrongstklit ( poplit1 , poptyp1 , 1 ) ; pushlitstk ( snull , 1 ) ; } else if ( ( poptyp2 != 0 ) ) { printwrongstklit ( poplit2 , poptyp2 , 0 ) ; pushlitstk ( snull , 1 ) ; } else if ( ( poptyp3 != 1 ) ) { printwrongstklit ( poplit3 , poptyp3 , 1 ) ; pushlitstk ( snull , 1 ) ; } else { exbuflength = 0 ; addbufpool ( poplit3 ) ; exbufptr = 0 ; numnames = 0 ; while ( ( ( numnames < poplit2 ) && ( exbufptr < exbuflength ) ) ) { incr ( numnames ) ; exbufxptr = exbufptr ; namescanforand ( poplit3 ) ; } if ( ( exbufptr < exbuflength ) ) exbufptr = exbufptr - 4 ; if ( ( numnames < poplit2 ) ) { tputs ( cnull , "there aren't " ) ; tputi ( cnull , poplit2 ) ; tputs ( cnull , " names in \"" ) ; printpoolstr ( poplit3 ) ; tputs ( cnull , "\"\n" ) ; { tputs ( cnull , " " ) ; bstexwarnprint () ; } } while ( ( exbufptr > exbufxptr ) ) if ( ( lexclass [ exbuf [ exbufptr - 1 ] ] == 1 ) ) decr ( exbufptr ) ; else if ( ( exbuf [ exbufptr - 1 ] == 44 ) ) { tputs ( cnull , "name " ) ; tputi ( cnull , poplit2 ) ; tputs ( cnull , " in \"" ) ; printpoolstr ( poplit3 ) ; tputs ( cnull , "\" has a comma at the end\n" ) ; { tputs ( cnull , " " ) ; bstexwarnprint () ; } decr ( exbufptr ) ; } else goto lab16 ; lab16 : ; namebfptr = 0 ; numcommas = 0 ; numtokens = 0 ; tokenstarting = true ; while ( ( exbufxptr < exbufptr ) ) switch ( exbuf [ exbufxptr ] ) { case 44 : { if ( ( numcommas == 2 ) ) { tputs ( cnull , "too many commas in name " ) ; tputi ( cnull , poplit2 ) ; tputs ( cnull , " of \"" ) ; printpoolstr ( poplit3 ) ; tputs ( cnull , "\"\n" ) ; { tputs ( cnull , " " ) ; bstexwarnprint () ; } } else { incr ( numcommas ) ; if ( ( numcommas == 1 ) ) comma1 = numtokens ; else comma2 = numtokens ; } incr ( exbufxptr ) ; tokenstarting = true ; } break ; case 123 : { incr ( bracelevel ) ; if ( ( tokenstarting ) ) { nametok [ numtokens ] = namebfptr ; incr ( numtokens ) ; } svbuffer [ namebfptr ] = exbuf [ exbufxptr ] ; incr ( namebfptr ) ; incr ( exbufxptr ) ; while ( ( ( bracelevel > 0 ) && ( exbufxptr < exbufptr ) ) ) { if ( ( exbuf [ exbufxptr ] == 125 ) ) decr ( bracelevel ) ; else if ( ( exbuf [ exbufxptr ] == 123 ) ) incr ( bracelevel ) ; svbuffer [ namebfptr ] = exbuf [ exbufxptr ] ; incr ( namebfptr ) ; incr ( exbufxptr ) ; } tokenstarting = false ; } break ; case 125 : { if ( ( tokenstarting ) ) { nametok [ numtokens ] = namebfptr ; incr ( numtokens ) ; } { tputs ( cnull , "name " ) ; tputi ( cnull , poplit2 ) ; tputs ( cnull , " of \"" ) ; } printpoolstr ( poplit3 ) ; tputs ( cnull , "\" is not brace balanced\n" ) ; { tputs ( cnull , " " ) ; bstexwarnprint () ; } incr ( exbufxptr ) ; tokenstarting = false ; } break ; default : if ( ( lexclass [ exbuf [ exbufxptr ] ] == 1 ) ) { incr ( exbufxptr ) ; tokenstarting = true ; } else { if ( ( tokenstarting ) ) { nametok [ numtokens ] = namebfptr ; incr ( numtokens ) ; } svbuffer [ namebfptr ] = exbuf [ exbufxptr ] ; incr ( namebfptr ) ; incr ( exbufxptr ) ; tokenstarting = false ; } break ; } nametok [ numtokens ] = namebfptr ; if ( ( numcommas == 0 ) ) { firststart = 0 ; lastend = numtokens ; jrend = lastend ; vonstart = 0 ; while ( ( vonstart < lastend - 1 ) ) { namebfptr = nametok [ vonstart ] ; namebfxptr = nametok [ vonstart + 1 ] ; if ( ( vontokenfound () ) ) goto lab17 ; incr ( vonstart ) ; } lab17 : firstend = vonstart ; vonnameendsandlastna () ; } else if ( ( numcommas == 1 ) ) { vonstart = 0 ; lastend = comma1 ; jrend = lastend ; firststart = jrend ; firstend = numtokens ; vonnameendsandlastna () ; } else if ( ( numcommas == 2 ) ) { vonstart = 0 ; lastend = comma1 ; jrend = comma2 ; firststart = jrend ; firstend = numtokens ; vonnameendsandlastna () ; } else tputs ( cnull , "this can't happen---illegal number of comma,s\n" ) ; exbuflength = 0 ; addbufpool ( poplit1 ) ; exbufptr = 0 ; spbracelevel = 0 ; spptr = strstart [ poplit1 ] ; spend = strstart [ poplit1 + 1 ] ; while ( ( spptr < spend ) ) if ( ( strpool [ spptr ] == 123 ) ) { incr ( spbracelevel ) ; incr ( spptr ) ; spxptr1 = spptr ; alphafound = false ; doubleletter = false ; endofgroup = false ; tobewritten = true ; while ( ( ( ! endofgroup ) && ( spptr < spend ) ) ) if ( ( lexclass [ strpool [ spptr ] ] == 2 ) ) { incr ( spptr ) ; { if ( ( alphafound ) ) { bracelvlonelettersco () ; tobewritten = false ; } else switch ( strpool [ spptr - 1 ] ) { case 102 : case 70 : { curtoken = firststart ; lasttoken = firstend ; if ( ( curtoken == lasttoken ) ) tobewritten = false ; if ( ( ( strpool [ spptr ] == 102 ) || ( strpool [ spptr ] == 70 ) ) ) doubleletter = true ; } break ; case 118 : case 86 : { curtoken = vonstart ; lasttoken = vonend ; if ( ( curtoken == lasttoken ) ) tobewritten = false ; if ( ( ( strpool [ spptr ] == 118 ) || ( strpool [ spptr ] == 86 ) ) ) doubleletter = true ; } break ; case 108 : case 76 : { curtoken = vonend ; lasttoken = lastend ; if ( ( curtoken == lasttoken ) ) tobewritten = false ; if ( ( ( strpool [ spptr ] == 108 ) || ( strpool [ spptr ] == 76 ) ) ) doubleletter = true ; } break ; case 106 : case 74 : { curtoken = lastend ; lasttoken = jrend ; if ( ( curtoken == lasttoken ) ) tobewritten = false ; if ( ( ( strpool [ spptr ] == 106 ) || ( strpool [ spptr ] == 74 ) ) ) doubleletter = true ; } break ; default : { bracelvlonelettersco () ; tobewritten = false ; } break ; } if ( ( doubleletter ) ) incr ( spptr ) ; alphafound = true ; } } else if ( ( strpool [ spptr ] == 125 ) ) { decr ( spbracelevel ) ; incr ( spptr ) ; endofgroup = true ; } else if ( ( strpool [ spptr ] == 123 ) ) { incr ( spbracelevel ) ; incr ( spptr ) ; skipstuffatspbracele () ; } else incr ( spptr ) ; if ( ( ( endofgroup ) && ( tobewritten ) ) ) { spptr = spxptr1 ; spbracelevel = 1 ; while ( ( spbracelevel > 0 ) ) if ( ( ( lexclass [ strpool [ spptr ] ] == 2 ) && ( spbracelevel == 1 ) ) ) { incr ( spptr ) ; if ( ( doubleletter ) ) incr ( spptr ) ; usedefault = true ; spxptr2 = spptr ; if ( ( strpool [ spptr ] == 123 ) ) { usedefault = false ; incr ( spbracelevel ) ; incr ( spptr ) ; spxptr1 = spptr ; skipstuffatspbracele () ; spxptr2 = spptr - 1 ; } while ( ( curtoken < lasttoken ) ) { if ( ( doubleletter ) ) { namebfptr = nametok [ curtoken ] ; namebfxptr = nametok [ curtoken + 1 ] ; if ( ( exbuflength + ( namebfxptr - namebfptr ) > bufsize ) ) { tputs ( cnull , "Sorry, you've exceeded BibTeX's execution buffer size " ) ; tputi ( cnull , bufsize ) ; tputc ( cnull , 10 ) ; jumpout ( 1 ) ; } while ( ( namebfptr < namebfxptr ) ) { { exbuf [ exbufptr ] = svbuffer [ namebfptr ] ; incr ( exbufptr ) ; } incr ( namebfptr ) ; } } else { namebfptr = nametok [ curtoken ] ; while ( ( ( lexclass [ svbuffer [ namebfptr ] ] != 2 ) && ( namebfptr < nametok [ curtoken + 1 ] ) ) ) incr ( namebfptr ) ; if ( ( namebfptr < nametok [ curtoken + 1 ] ) ) { if ( ( exbufptr == bufsize ) ) { tputs ( cnull , "Sorry, you've exceeded BibTeX's execution buffer size " ) ; tputi ( cnull , bufsize ) ; tputc ( cnull , 10 ) ; jumpout ( 1 ) ; } exbuf [ exbufptr ] = svbuffer [ namebfptr ] ; incr ( exbufptr ) ; } } incr ( curtoken ) ; if ( ( curtoken < lasttoken ) ) { if ( ( usedefault ) ) if ( ( doubleletter ) ) { if ( ( exbufptr == bufsize ) ) { tputs ( cnull , "Sorry, you've exceeded BibTeX's execution buffer size " ) ; tputi ( cnull , bufsize ) ; tputc ( cnull , 10 ) ; jumpout ( 1 ) ; } exbuf [ exbufptr ] = 126 ; incr ( exbufptr ) ; } else { if ( ( exbuflength + 2 > bufsize ) ) { tputs ( cnull , "Sorry, you've exceeded BibTeX's execution buffer size " ) ; tputi ( cnull , bufsize ) ; tputc ( cnull , 10 ) ; jumpout ( 1 ) ; } { exbuf [ exbufptr ] = 46 ; incr ( exbufptr ) ; } { exbuf [ exbufptr ] = 126 ; incr ( exbufptr ) ; } } else { if ( ( exbuflength + ( spxptr2 - spxptr1 ) > bufsize ) ) { tputs ( cnull , "Sorry, you've exceeded BibTeX's execution buffer size " ) ; tputi ( cnull , bufsize ) ; tputc ( cnull , 10 ) ; jumpout ( 1 ) ; } spptr = spxptr1 ; while ( ( spptr < spxptr2 ) ) { { exbuf [ exbufptr ] = strpool [ spptr ] ; incr ( exbufptr ) ; } incr ( spptr ) ; } } } } if ( ( ! usedefault ) ) spptr = spxptr2 + 1 ; } else if ( ( strpool [ spptr ] == 125 ) ) { decr ( spbracelevel ) ; incr ( spptr ) ; if ( ( spbracelevel > 0 ) ) { if ( ( exbufptr == bufsize ) ) { tputs ( cnull , "Sorry, you've exceeded BibTeX's execution buffer size " ) ; tputi ( cnull , bufsize ) ; tputc ( cnull , 10 ) ; jumpout ( 1 ) ; } exbuf [ exbufptr ] = 125 ; incr ( exbufptr ) ; } } else if ( ( strpool [ spptr ] == 123 ) ) { incr ( spbracelevel ) ; incr ( spptr ) ; { if ( ( exbufptr == bufsize ) ) { tputs ( cnull , "Sorry, you've exceeded BibTeX's execution buffer size " ) ; tputi ( cnull , bufsize ) ; tputc ( cnull , 10 ) ; jumpout ( 1 ) ; } exbuf [ exbufptr ] = 123 ; incr ( exbufptr ) ; } } else { { if ( ( exbufptr == bufsize ) ) { tputs ( cnull , "Sorry, you've exceeded BibTeX's execution buffer size " ) ; tputi ( cnull , bufsize ) ; tputc ( cnull , 10 ) ; jumpout ( 1 ) ; } exbuf [ exbufptr ] = strpool [ spptr ] ; incr ( exbufptr ) ; } incr ( spptr ) ; } } } ---cut here---