home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / vmsnet / tpu / 556 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  1.5 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!cleveland.Freenet.Edu!at913
  2. From: at913@cleveland.Freenet.Edu (Mirko Vukovic)
  3. Newsgroups: vmsnet.tpu
  4. Subject: Pattern
  5. Date: 30 Dec 1992 18:40:24 GMT
  6. Organization: Case Western Reserve University, Cleveland, OH (USA)
  7. Lines: 40
  8. Message-ID: <1hsqeoINNmqe@usenet.INS.CWRU.Edu>
  9. Reply-To: at913@cleveland.Freenet.Edu (Mirko Vukovic)
  10. NNTP-Posting-Host: hela.ins.cwru.edu
  11.  
  12.  
  13. Hello!
  14.  
  15. I am converting a fortran code from single to double precision on a VAX.  I 
  16. a TPU routine that searches for constants in the program by using the following
  17. patterns
  18.  
  19.     aaaa.bbbbbX
  20.         .bbbbbX
  21.     aaaa.X
  22.  
  23.     aaaa any number of digits
  24.     bbbb any number of digits
  25.     X any character except d,D
  26.  
  27. and puts the cursor on the end of a line where the pattern was found.
  28.  
  29. I came up with the following patterns:
  30.  
  31. predig:=span('0123456789');            <--- for aaaa
  32. posdig:=anchor&span('0123456789');        <--- for bbbb
  33. per:='.';                    <--- for .
  34. exp:=anchor&(notany('dD')|line_end);        <--- for X
  35.  
  36. find :=((predig&per&exp)|(per&posdig&exp)|(predig&per&posdig&exp));
  37.  
  38. However the above does detect numbers like 123.12D00, ie if I have more than one
  39. digit after the period followed by D.
  40.  
  41. Is that because in posdig anchor forces the span to match only one character?
  42. How do I go around that?  The program has 10000 (10^4) lines.
  43.  
  44.  
  45. Also, how do I put a cursor on the end of a range?
  46.  
  47. Thanks.
  48. -- 
  49. Mirko Vukovic 
  50. University of Wisconsin -- Madison
  51. VUKOVIC@UWMFE.NEEP.WISC.EDU 
  52.