4.4 Others
Plugins can define their own importers and make them appear in the menu of the Moose Panel. For example, after loading the CAnalyzer module, a new menu item appears that allows us to import an XML exported by srcML, an external tool that can parse C programs.
Pre-made parsers are great because they ease the loading of systems written in well-known languages, such as Java or C++. However, not all languages are supported out-of-the-box. For these situations there are other possibilities:
- PetitParser (see Chapter 14) is a generic framework for building parsers. Using it, an analyst can quickly approach a new language in an iterative manner.
- Another often encountered case is the importing of XML data. Moose ships with a library for parsing XML either through a typical SAX interface, or through the more advanced possibility of producing qualified DOM trees.