Hi Roger,
Due to the complexity they are typically parsed using one of the
traditional compiler parsing algorithms, either through a manually
coded parser such as the ones in Saxon and the experimental parser for
FusionDB, or through a parser compiler compiler toolkit such as Antlr,
Yacc, etc.
I gave a talk on some aspects of our new Hand-rolled Recursive Descent
approach here (you might recognise "the book" in the background at the
beginning of the video) at Declarative Amsterdam 2020 -
https://www.youtube.com/watch?v=nxLqE_7ZO2A and the slides:
https://declarative.amsterdam/resources/da/slides/da.2020.retter.slides.pdf
There are also various pre-baked Open Source XPath and XQuery parsers
in Java and Scala using Antlr and various other toolkits kicking
around my various GitHubs - let me know if you want links to them.
Kind regards. Adam.
On Sun, 8 May 2022 at 23:19, Roger L Costello costello(_at_)mitre(_dot_)org
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
Hi Folks,
I dug out my old compiler "Dragon book" and started rereading it.
Chapter 1 lists some of the tools that employ compiler techniques. This one
caught my attention:
Query interpreters: A query interpreter translates a predicate containing
relational and boolean operators into commands to search a database of
records satisfying that predicate.
An XPath expression is a query. Not against a database, but against an XML
document. Are XPath expressions parsed using compiler parsing algorithms? Is
a syntax tree constructed for an XPath expression? Is the syntax tree
traversed?
/Roger
--
Adam Retter
skype: adam.retter
tweet: adamretter
http://www.adamretter.org.uk
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--