home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / text / sgml / 1242 < prev    next >
Encoding:
Internet Message Format  |  1992-12-28  |  1.8 KB

  1. Path: sparky!uunet!ralvm13.VNET.IBM.COM
  2. From: drmacro@ralvm13.VNET.IBM.COM
  3. Message-ID: <19921228.050635.862@almaden.ibm.com>
  4. Date: Mon, 28 Dec 92 07:54:28 EST
  5. Newsgroups: comp.text.sgml
  6. Subject: Re: Precedence of SGML Operators?
  7. Disclaimer: This posting represents the poster's views, not those of IBM
  8. News-Software: UReply 3.1
  9. References: <1802@igd.fhg.de>
  10. Lines: 38
  11.  
  12. In <1802@igd.fhg.de> Hans Holger Rath writes:
  13. >Is the first element definition equivalent to
  14. >
  15. >   <!ELEMENT x - - (z, ((a* | b)*)) > ???
  16.  
  17. I'm assuming you meant:
  18.     <!ELEMENT x - - (z, ((a* | b*))) > ???
  19.  
  20. >                        _      _
  21. >
  22. >I don't think so and Mr. Martin Bryan in "SGML an Author's Guide", page 111 don't
  23. >think so, too.
  24. >
  25. >I always thought, that the occurence indicators ("?", "+", "*") have a higher
  26. >precedence than the group connectors ("|", ",", "&").
  27. >
  28. >What do the experts think about these problems?
  29. >
  30. >Thanks in advance,
  31. >
  32.  --Holger
  33.  
  34. I tried the test case with two different parsers (IBM SGML Translator
  35. release 2 and release 3) and both flagged the B element as out of
  36. context, which they should have.  Even if the grouping operator did
  37. take precedence in (A* | B*), B is still invalid because the OR group
  38. itself is not repeating and thus only A or B can be specified
  39. (regardless of the repitition operators).  Thus, if A is specified, B
  40. cannot be specified.  This suggests that (A* | B*) is equivalent to
  41. ((A*) | (B*)), which they are.  Both say "A repeated OR B repeated".
  42. The grouping around the individual tokens does not change the meaning.
  43.  
  44. Eliot Kimber                      Internet:  drmacro@ralvm13.vnet.ibm.com
  45. Dept E14/B500                     IBMMAIL:   USIB2DK9@IBMMAIL
  46. Network Programs Information Development     Phone: 1-919-543-7091
  47. IBM Corporation
  48. Research Triangle Park, NC 27709
  49.  
  50.