From patrick%cs.kuleuven.ac.be@princeton.edu Thu Aug 29 01:20:59 1991 Return-Path: Received: from alpha.xerox.com by palain.PARC (4.1/SMI-4.1) id AA13556; Thu, 29 Aug 91 01:20:57 PDT Received: from Minos.PARC.Xerox.xns by alpha.xerox.com via XNS id <11523>; Thu, 29 Aug 1991 01:20:32 PDT Received: from Princeton.EDU ([128.112.128.1]) by alpha.xerox.com with SMTP id <11523>; Thu, 29 Aug 1991 01:20:05 PDT Received: from fs.Princeton.EDU by Princeton.EDU (5.65b/2.80/princeton) id AA15585; Thu, 29 Aug 91 04:19:59 -0400 Received: from Princeton.EDU (Princeton.EDU.) by fs.Princeton.EDU (4.0/1.105) id AA08885; Thu, 29 Aug 91 04:19:57 EDT Received: from n-kulcs.cs.kuleuven.ac.be by Princeton.EDU (5.65b/2.80/princeton) id AA15582; Thu, 29 Aug 91 04:19:49 -0400 Received: from medusa.cs.kuleuven.ac.be by n-kulcs.cs.kuleuven.ac.be (5.64+/n_kulcs1.1) id AA02072; Thu, 29 Aug 91 10:20:48 +0200 Received: by medusa.cs.kuleuven.ac.be (5.65b/cs_kuleuven.02) id AA08766; Thu, 29 Aug 91 10:21:14 +0200 X-Ns-Transport-Id: 08002008D0FD000FC327 Date: Thu, 29 Aug 1991 01:21:14 PDT From: patrick%cs.kuleuven.ac.be@princeton.edu (Patrick Weemeeuw) Subject: Spidery Web To: nr@princeton.edu Message-Id: <9108290821.AA08766@medusa.cs.kuleuven.ac.be> Status: RO Hello, I'm trying to develop a web system for Prolog. One of the difficulties I had is recognizing tokens containing backslashes. I changed master/spider.web such that it now correctly handles tokens like: token \\== category .... generating the C string "\\==" but checking for a string with lenght *3* instead of 4. The context diff is included below. Patrick. -- Patrick Weemeeuw mail: Katholieke Universiteit Leuven Tel: +32 16 200656 x 3544 Dept. of Computer Science e-mail: patrick@cs.kuleuven.ac.be Celestijnenlaan 200 A Fax: +32 16 205308 B-3001 Leuven (Belgium) ====================================================================== *** spider.web Wed Aug 28 19:32:01 1991 --- spider.web.orig Wed Aug 28 17:47:57 1991 *************** *** 794,800 tokenname[$2]="SP_gen_token_" tokennumber tokennumbers[$2]=tokennumber tokennumber-- - # ## figure out how to recognize the token temp = sprintf( "strncmp(\"%s\",loc-1,%d)==0", $2, tokenlength[$2]) tokentest[$2]=temp --- 794,799 ----- tokenname[$2]="SP_gen_token_" tokennumber tokennumbers[$2]=tokennumber tokennumber-- ## figure out how to recognize the token temp = sprintf( "strncmp(\"%s\",loc-1,%d)==0", $2, length($2)) tokentest[$2]=temp *************** *** 796,802 tokennumber-- # ## figure out how to recognize the token ! temp = sprintf( "strncmp(\"%s\",loc-1,%d)==0", $2, tokenlength[$2]) tokentest[$2]=temp # To find the length of a string considered as a C~string, we scan it looking --- 795,801 ----- tokennumbers[$2]=tokennumber tokennumber-- ## figure out how to recognize the token ! temp = sprintf( "strncmp(\"%s\",loc-1,%d)==0", $2, length($2)) tokentest[$2]=temp tokenlength[$2]=length($2) *************** *** 798,803 ## figure out how to recognize the token temp = sprintf( "strncmp(\"%s\",loc-1,%d)==0", $2, tokenlength[$2]) tokentest[$2]=temp # To find the length of a string considered as a C~string, we scan it looking for occurrences of the \.{\\} character. We initialize |templ| with --- 797,803 ----- ## figure out how to recognize the token temp = sprintf( "strncmp(\"%s\",loc-1,%d)==0", $2, length($2)) tokentest[$2]=temp + tokenlength[$2]=length($2) # The setting of attributes is as for all tokens: *************** *** 799,827 temp = sprintf( "strncmp(\"%s\",loc-1,%d)==0", $2, tokenlength[$2]) tokentest[$2]=temp - # To find the length of a string considered as a C~string, we scan it looking - for occurrences of the \.{\\} character. We initialize |templ| with - |length($2)|, and each time we find a legitimate escape sequence, we decrement - |templ|. Remark that, given the current lexical analysis, \.{\\f}, \.{\\n} etc. - cannot occur in a token. - #= - templ=length($2) - i=1 #/ - while(i<=length($2)) { #/ - if(substr($2,i,1)=="\\") { #/ - if(i= --- 799,804 ----- tokentest[$2]=temp tokenlength[$2]=length($2) # The setting of attributes is as for all tokens: #=