Static Plug-ins with Variadic Templates in C++: Parsing Java Class Files in a Modular Way

The template meta programming in C++ is a powerful mechanism, so powerful that it is turing-complete.

Although with some limitations. They have become even more expressive in C++11. They have added variadic template arguments.

How we have used variadic template arguments to implement a statically plugin system, to parse Java Class Files.

This is the main type of the parser:

ClassParser<
        ConstPoolParser,
        AttrsParser<
                SourceFileAttrParser,
                SignatureAttrParser>,
        AttrsParser<
                CodeAttrParser<
                        LineNumberTableAttrParser,
                        LocalVariableTableAttrParser,
                        LocalVariableTypeTableAttrParser,
                        StackMapTableAttrParser>,
                ExceptionsAttrParser,
                SignatureAttrParser>,
        AttrsParser<
                SignatureAttrParser>
> parser;