//    LEX3


GET "SYNHDR"

LET RCH() BE
    $( CH := RDCH()

       IF PRSOURCE DO IF GETP=0 LOGAND CH NE ENDSTREAMCH DO
          $( UNLESS LINECOUNT=PRLINE DO $( WRITEF("%I4  ", LINECOUNT)
                                           PRLINE := LINECOUNT  $)
             WRCH(CH)  $)

       CHCOUNT := CHCOUNT + 1
       CHBUF!(CHCOUNT&63) := CH  $)

AND WRCHBUF() BE
    $( WRITES("*N...")
       FOR P = CHCOUNT-63 TO CHCOUNT DO
                $( LET K = CHBUF!(P&63)
                   UNLESS K=0 DO WRCH(K)  $)
       NEWLINE()  $)


AND RDTAG(X) BE
    $( CHARP, CHARV!1 := 1, UPPER(X)    //                       $$$$$

        $(  RCH()
            UNLESS 'A'<=CH<='Z' LOGOR 'a'<=CH<='z' LOGOR   // $$$$$
                   '0'<=CH<='9' LOGOR
                    CH='.' BREAK
            IF CH='\' DO BREAK
            CHARP := CHARP+1
            CHARV!CHARP := UPPER(CH)  $) REPEAT // $$$$$

       CHARV!0 := CHARP
       WORDSIZE := PACKSTRING(CHARV, WORDV)  $)


AND PERFORMGET() BE
    $( NEXTSYMB()
       UNLESS SYMB=S.STRING THEN CAEREPORT(97)

       IF OPTION!5 RETURN

       GETV!GETP := SOURCESTREAM
       GETV!(GETP+1) := LINECOUNT
       GETV!(GETP+2) := CH
       GETP := GETP + 3
       LINECOUNT := 1
       FOR I = 1 TO GETBYTE(WORDV,0) DO
         PUTBYTE(WORDV,I,UPPER(UNASKII(GETBYTE(WORDV,I))))  // TO UPPER CASE
       SOURCESTREAM := FINDINPUT(WORDV)
       IF SOURCESTREAM=0 THEN CAEREPORT(96,WORDV)
       SELECTINPUT(SOURCESTREAM)
       RCH()   $)


.