Version 0.23.0 of the Trash toolkit has been released. This version moves some of the functionality for CRUD of parse trees into an XQuery application. It also adds a way to address the off-channel tokens in the parse tree in XPath. WIth these two additions, we can now write queries for off-channel tokens in the parse tree.

As I mention in the Release notes, the main engine used in Trash is the Eclipse XPath. The version used in Trash is a C# port of the Java code. While it works well for most situations, there are several problems with this engine.

  • It only implements XPath2.
  • It does not contain XQuery.
  • The original Java code is no longer being maintained.
  • It is not very efficient.

The XPath engine needs to be replaced; this release moves in this direction.

Notwithstanding the fact that Trash still uses the current XPath engine, trquery was added for three basic XQuery CRUD statements, and implemented using the engine.

  • Insert
    insert //grammarDecl ' '
    
  • Delete
    delete //labeledLexerElement/(identifier | ASSIGN | PLUS_ASSIGN);
    
  • Move
    move //labeledAlt/(POUND | identifer)/@WS ./ancestor::labeledAlt;
    

Some of the “higher-level” applications, which deal with Antlr4 grammars, are implemented as XQuery scripts in g4-scripts.