home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / programm / 5739 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.6 KB  |  39 lines

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