home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!fhg!igd!rath
- From: rath@igd.fhg.de (Hans Holger Rath)
- Newsgroups: comp.text.sgml
- Subject: Precedence of SGML Operators?
- Keywords: SGML, Operator Precedence, MARKIT-Parser
- Message-ID: <1802@igd.fhg.de>
- Date: 28 Dec 92 11:14:01 GMT
- Sender: news@igd.fhg.de
- Organization: Haus der Graphischen Datenverarbeitung, 6100 Darmstadt, Germany
- Lines: 67
-
-
- Hey folks,
-
- I've I problem with the operator precedence in SGML.
-
- I parsed an incorrect (?) SGML file with the markit 2.0 parser, but no
- error message or warning occurs.
-
- The problem in detail:
-
- When the DTD has following element definition
-
- <!ELEMENT x - - (z, (a* | b*)) >
-
- (with the intention to allow a z followed by repeatative a's OR repeatative b's)
-
- and the sgml instance looks like this
-
- <x>
- <z>...</z>
- <a>...</a>
- <b>...</b> <------- !!! Error !!! ------->
- <a>...</a>
- </x>
-
- the markit says, that it is okay.
-
- When I change the element definition to
-
- <!ELEMENT x - - (z, ((a*) | (b*))) >
- - - - -
-
- the markit prints an error message for the "b" tag, what I expected already with
- the first definition.
-
- Is this a bug of the markit or is my interpretation of the operator precedence
- in SGML wrong?
-
- Is the first element definition equivalent to
-
- <!ELEMENT x - - (z, ((a* | b)*)) > ???
- _ _
-
- I don't think so and Mr. Martin Bryan in "SGML an Author's Guide", page 111 don't
- think so, too.
-
- I always thought, that the occurence indicators ("?", "+", "*") have a higher
- precedence than the group connectors ("|", ",", "&").
-
- What do the experts think about these problems?
-
-
- Thanks in advance,
-
- --Holger
-
-
- P.S.: I wish everybody an HAPPY NEW YEAR.
-
- ---------------------------------------------------------------------
- | Hans Holger Rath - Computer Graphics Center - Darmstadt - Germany |
- ---------------------------------------------------------------------
- | Zentrum fuer | EMail: rath@igd.fhg.de |
- | Graphische Datenverarbeitung e. V. | |
- | Wilhelminenstrasse 7 | Tel. : +49 6151/155-245 |
- | D-6100 Darmstadt | Fax : +49 6151/155-299 |
- ---------------------------------------------------------------------
-