RE: Fwd: "Active XML"

Larry Masinter (masinter@parc.xerox.com)
Tue, 2 Nov 1999 13:00:22 PST


> > Very nice. I was thinking just the other night of parsing C and
> > outputting the parse tree as an XML document. You could
> > think of it as an alternate syntax for C.

Why, you could do this for other languages, too! For example,
you could parse Lisp and output the parse tree as XML,

<p xml:xmlns="urn:lang:lisp">defun fact<p>n</p>
<p>if <p>= n 0</p>
1
<p>* n <p>fact <p>- n 1</p></p></p></p></p>

I wasn't sure about the content model, though; shouldn't
we use <s> for "symbol" and <n> for "number"?

<p xml:xmlns="urn:lang:lisp"><s>defun</s><s>fact</s><p><s>n</s></p>
<p><s>if<s><p><s>=</s><s>n</s><n>0</n></p>
<n>1</n>
<p><s>*</s><s>n</s>
<p><s>fact</s><p><s>-</s><s>n</s><n>1</n></p></p>
</p>
</p>
</p>

I might call this language Lis<p>, for Lots of Irritating
Silly <p>arentheses.