[XML-SIG] PyXPath 1.1

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Wed, 3 Jan 2001 12:21:48 +0100


> I'm confused.  This thread originally started as an interface from
> multiple lexers into 4XPath (if I remeber correctly).  

It was never clear an interface to *what* is the subject. As the
subject still indicates, it started with my announcement that I have
multiple pure-Python lexers and parsers. It may be reasonable to get
an interface to multiple lexers also, but only if there are actually
multiple lexers that are sufficiently different (e.g. C based ones,
sre based ones, fast ones, correct ones - assuming you can't be fast
and correct simultaneously).

Note that an interface to XPath could be even higher-level than the
parsing level, since there are multiple independent software blocks
involved in your typical XPath application:
- the XPath lexer (reading streams, generating tokens)
- the XPath parser (reading tokens, generating trees)
- the tree implementation (providing expression trees, offering evaluation)
- the application (evaluating trees)

That gives a total of three potential interfaces. There may be other
things that an application wishes to do with an XPath expression
(e.g. navigating it), which would require more features from the tree
implementation.

> However, the Parsed* classes in 4XPath are created by the parser
> (Bison).  This is why I originally recommended the interface of a
> token stream to feed into the parser (currently Bison, but could be
> replaced with a python only version).

As a matter of fact, PyXML 1.2 creates the Parsed* classes without a
bison parser.

Regards,
Martin