Treefic is a tool for parsing text files as XML trees.
DISCLAIMER: this documentation just a draft for the moment. Some parts are not finalized, some other parts are not even written yet...
Treefic is born of an observation: XML-based syntaxes are sometimes used in contexts where a specialized text-based syntax (i.e. with minimal markup, if any) would be more appropriate.
XML is a great standard, which has provided a large variety of reusable tools to manipulate (store, exchange, transform, query, digitally sign...) documents and data structured as trees. However, the central feature of XML, namely the underlying hierarchical structure of XML files, is often mistaken with the generic exchange syntax which has been its starting point.
It is a shame because that syntax is not a panacea. It is generic so as to allow expressing arbitrary XML trees, and even mix different vocabularies (courtesy of namespaces). The price to pay for this genericity is a high level of verbosity in the markup which structures the actual data into a tree. That makes some XML-based syntaxes hard to read and edit with general-purpose text-based tools. We claim that in some contexts, this trade-off is not satisfactory, and readability is more important than genericity. But by getting rid of the XML syntax, wouldn’t one also lose the ability to use all the related technologies?
The aim of Treefic is to bridge the gap between XML-based and text-based syntaxes, in order to get the best of both world. Given a text and a context-free grammar, it converts that text to an XML tree, which can in turn be handled using standard XML technologies. The goal of Treefic is therefore twofold:
Treefic development is still ongoing. See the Developers section below to get the source code.
The source code is available as a subversion repository. Get it with:
svn co https://svn.liris.cnrs.fr/pchampin/treefic/trunk/