jeremyong/eprotoc — pull request #16 by kolorahl (2013-08-26 23:57:14+00:00)
Title: Custom "Plugin" Code Generation

Separate code generation logic to a separate module and allow custom code generation modules to be used in `eprotoc_generator:parse_file/4`. Defaults to the original code generation logic for eprotoc, now available in module `eprotoc_codegen`. This will allow others to create their own code generators using `eprotoc` as the parser and construction platform.

Right now I'm passing another argument to the necessary functions, called `Codegen`, which is an atom representing the name of the module to use for code generation. If there's a better way I should do this, let me know. The only thing I haven't quite figured out is how to get the eprotoc escript executable to take in an optional code generator module; as of now someone would need to create a custom escript file to invoke the new `parse_file/4` function that allows for a custom code generator module.