Google protobuf is a good IDL for RPC. But I want to know how to write my own code generator for protobuf.
The protoc compiler can output a description of the .proto file in protobuf format. Thus, most of the analysis has been done for you already, and you only need to create the desired result.
protoc
The .proto diagram for describing the .proto file is here: https://github.com/google/protobuf/blob/master/src/google/protobuf/descriptor.proto
As an additional step, you can start your generator via "-mygenerator-out =." option on the duct itself: https://developers.google.com/protocol-buffers/docs/reference/other
Here is one (albeit a bit confusing) example of how a code generator can be written in Python: https://github.com/nanopb/nanopb/blob/master/generator/nanopb_generator.py
Source: https://habr.com/ru/post/1215031/More articles:The most annoying parsing with a qualified identifier - or not? - c ++J Web programming in J - jHow to call a function in vba that is already assigned to a button - excel-vbajQuery slidedown and slide show wiggles div - jqueryHow to check if a string starts with a word or tab or space in python? - pythoncounter lines php codeigniter - phpWhat happened to the Null-Conditional Operator below? - c #composer update authentication on packaging - phpMacOSX splash screen not loading due to library not loaded: @ rpath / libswiftAppKit.dylib - xcodeMutually exclusive option groups - c ++All Articles