home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / programm / 3357 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.7 KB  |  40 lines

  1. Newsgroups: comp.programming
  2. Path: sparky!uunet!spool.mu.edu!darwin.sura.net!uvaarpa!murdoch!usenet
  3. From: jpw@sansfoy.lib.Virginia.EDU (John Price-Wilkin)
  4. Subject: lex help
  5. Message-ID: <1992Dec23.012520.12393@murdoch.acc.Virginia.EDU>
  6. Keywords: lex
  7. Sender: usenet@murdoch.acc.Virginia.EDU
  8. Organization: University of Virginia
  9. Date: Wed, 23 Dec 1992 01:25:20 GMT
  10. Lines: 28
  11.  
  12. My apologies if this is misdirected, but I could use some basic help with  
  13. lex.  I'm writing a filter for a tagged file and have done all of the  
  14. basic routines (i.e., the routines my *basic* skills will cover).  Some of  
  15. the tagging I'm trying to cover looks like the following:
  16.     <doc name="Opera" author="Anselmus">
  17. but sometimes they're like:
  18.     <doc author="Anselmus">
  19. and sometimes like:
  20.     <doc name="Opera">
  21. They are always one of the three, and the contents of the quotes are of  
  22. variable length, often containing spaces.  I'd like to render them as:
  23.     Name:  Opera
  24.     Author:  Anselmus
  25. (or the corresponding versions with only one of the elements).  There's  
  26. another variation on this theme, where the hierarchical tag scheme "<divN"  
  27. is used, so that I encounter
  28.     <div1 name="Opera" author="Anselmus">
  29. as well as
  30.     <div2 name="Opera" author="Anselmus">
  31. and so on, through div4.  My first and most immediate concern is to get a  
  32. lex routine that will take care of each instance (e.g,. a <doc tag that  
  33. has any one of the three configurations -- both author and name, or either  
  34. author or name), but an ideal solution would be to have something that did  
  35. a <doc or any <divN as well.  I'd be much obliged if someone would show me  
  36. the light on this.  Replying to me personally would be swell.
  37.  
  38. John Price-Wilkin
  39. jpw@virginia.edu
  40.