Re: KISS (was: Parameter entity references in WF docs)

> It's been my experience that PEs are a lot more useful on the "right
> hand side" of a declaration than on the "left hand side" [...]
> Does this make any difference to ease of implementation?

The simplest way to implement them that I can see is to push the input
stack on %name; and to pop it on the end of the corresponding string.
This isn't exactly the SGML way.

Most macro processors I've seen do this either in a getchar() or a
gettoken() routine, depending on whether a macro is a token (as per
XML and C, for example) or not (as per troff, for example).

I therefore think that implementation would be eased if S were removed
from all productions and replaced by a set of tokenisation rules.
The input could then be considered as a token stream rather than as
a byte stream with delimiters -- that is to say, both views would be
equally conformant and correct.

I have previously offered to see if I could make this change to the
grammar, but have been waiting for it to settle down a bit more first.

People who have implemented parsers -- might that have been eaiser?
Do you agree?

Lee

Received on Thursday, 5 June 1997 11:49:46 UTC