- From: Norm Tovey-Walsh <norm@saxonica.com>
- Date: Sun, 18 Jun 2023 18:49:19 +0100
- To: "C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com>
- Cc: public-ixml@w3.org
- Message-ID: <m28rcg4q30.fsf@saxonica.com>
"C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com> writes:
> and a pretty-printer for WEB could parse the embedded @<...@> sequences
> as cross-references, in my XML-based LP system this code scrap would
> look something like this:
>
> <scrap file="primes.pas"
> n="Program to print the first thousand prime numbers">
> program print_primes(output);
> const m=1000;
> <ptr target="constants"/>;
> var <ptr target="vars"/>;
> begin
> <ptr target="print-m-primes"/>
> end.
> </scrap>
>
> In a grammar for Pascal or a similar language, it's not hard to
> recognize the 'begin ... end' as a block. But I have not found a good
> way to recognize the 'begin ... end' here as a block, given that what an
> ixml parser called on the text nodes of this 'scrap' element will see at
> that point is one text node reading ";
begin
 " and another
> reading "
end.".
Could you get any milage out of parsing this text?
program print_primes(output);
const m=1000;
<ptr target="constants"/>;
var <ptr target="vars"/>;
begin
<ptr target="print-m-primes"/>
end.
If so, might you parse the serialization of the content of scrap?
Be seeing you,
norm
--
Norm Tovey-Walsh
Saxonica
Received on Sunday, 18 June 2023 17:50:54 UTC