Implementing the XQuery grammar: From BNF to parse tree to backend data structures

Howard Katz
howardk@fatdog.com

Abstract

Building a parse tree representation of an XQuery or XPath query is an important first step in responding to that query. This presentation shows how to use the JavaCC parser generator tool, starting from the XQuery BNF, to build a parse tree for a particular XQuery instance, and how to tailor that tree to make it easily walkable at query-resolution time to connect in to your own backend data structures. JavaCC is used by both the W3C’s Query Working Group to test new versions of the XQuery grammar, and by the author to generate the query-parsing code in Fatdog’s opensource query engine product.

Keywords: XPath; XQuery; Querying

Implementing the XQuery grammar

From BNF to parse tree to backend data structures

Howard Katz [Proprietor; Fatdog Software]

Extreme Markup Languages 2002® (Montréal, Québec)

This paper is not represented in the conference proceedings.

But see the author package.