rss

ParserNg

Category : C#, DBus Explorer, Mono

First of all, happy new year everyone.

ParserNg is the name of the new parser that I committed today in git. It’s a somehow more flexible redesign of the precedent parser which allow to parse D-Bus type expressions to other things than just string and will, thus, facilitate the coding of, both, the code autogenerator and the langage-agnostic prototype viewer, the two main features I want to add for next release.

ParserNg uses a forward-only approach with IEnumerator instead of the old List.GetRange way resulting in no temporary List creation. Moreover the parser now display correctly complicated expressions like the ones in Telepathy (e.g : a{u(ua{sa{sv}})}Dictionary<UInt32, struct { UInt32; Dictionary<String, Dictionary>; }> ), expressions that were borked with the precedent code.

The actual processing is also deferred to an external class via a sort-of Visitor pattern allowing easier customization of the produced result (though for the moment I just rewrote a CSharpVisitor class to behave like the ancient parser).

Code available in latest git pull.

Post a comment