[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qexo-general] XQParser

From: Per Bothner
Subject: Re: [Qexo-general] XQParser
Date: Sun, 04 Aug 2002 22:52:03 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1b) Gecko/20020722

Chen Ya Bing wrote:
> I would like to use XQParser of the qexo to parser an xquery and get
> the abstract syntax tree parsed. could you tell me how I achive this?

You can create an instance of XQuery, and then call
the parseFile method.  That returns a Compilation state.
Calling getModule on the latter gives you an abstract
syntax tree of the parser.  However, it's not fully
abstract - it is tailored to the Kawa compilation

You can use the flag --debug-print-expr to print the
parsed tree from the Kawa commmand line:

  kawa --xquery --debug-print-expr -C source-file.xql

That is an easy way to look at the structure of the tree.
        --Per Bothner
address@hidden   http://www.bothner.com/per/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]