XQilla Developer Documentation
This page is very much a work in progress. It contains some notes as I learn about the XQilla implementation. This page is largely unorganized and will be mostly incomplete.
Doxygen Documentation
- Doxygen documentation can be built with:
- The above command only builds API documentation. Additional developer documentation can be built with the following command:
- The generated documentation is placed into the docs directory and into subdirectories corresponding to the documentation type.
Architecture/Flow Control/etc
This would be a good place for a flow chart. For now, a list will get me started. This list is in regards to handeling an XQuery through the command line
- The lexer reads in the query file and recognizes tokens. When a token is recognized, it is passed to the parser.
- The parser takes the token and depending on other tokens, constructs that represent the xquery
- The the query placed into an Abstract Syntax Tree∞. This is the end of the compilation stage.
- Once the abstract syntax tree (AST) is created, static resolution is done. The staticResolution function is called once for each node in the AST. This will perform namespace prefix resolution, and adding atomization and type checking objects.
- Static Typing is done next. The staticTyping functions are called for each node any number of times. XQilla does not implement formal static typing, so type is
more loosely defined. The properties include what parts of the dynamic context are used by the expression, what order we expect results in etc.
- This stage is also where constant folding and other AST rewrites happen.
- Finally, createResult is called to execute the expression, and returns an iterator object which should be a subclass of ResultImpl. The FLWOR one is already written and comes in two flavours: SortingFLWORResult and FLWORResult. The former handles any FLWOR with an "order by" clause, where as the latter allows lazy evaluation but can't handle "order by".
Testing
Make sure that the tests continue to work! You'll need to download the XQTS (XQuery test suite) test data from here:
http://www.w3.org/XML/Query/test-suite/∞
Then run the tests using a command like this:
./xqtsRunner -e ../tests/xqts/xqts_testsuite/errors.xml -E
xqts-latest-errors.xml /home/jpcs/drop/XQTS_current/XQTSCatalog.xml 2>xqts-latest-errors
The "errors.xml" file contains a list of tests that are known to fail,
since at the moment we don't pass 100% of the XQTS tests. Specifying
this file to the xqtsRunner allows it to report to you a list of
"unexpected failures" (which are bad) and "unexpected passes" (which are
good).
What's missing?
CategoryDocumentation
There are no comments on this page. [Add comment]