This repository furnishes some helpful features focused on Google Protocol Buffers.
The primary motivation for this workspace is simply to extrapolate descriptor level details concerning a Protocol Buffer specification.
Support for wire level interpretation of Protocol Buffer messages is beyond ths scope of this workspace.
Additionally, third party extensions to the grammar specification are also beyond the scope of this workspace and are expressly unsupported.
Note, at this time my grammar only supports a subset of the Protocol Buffer version 2 syntax for purposes of what I am accomplishing. Support is provided up to but not including the Service Definition.
Pull Requests are welcome in the event you want to add additional support, i.e. extending through Service level support, support for version 3, or so on.
The key to any string rendering approach is to be able to specify mission critical options, such as how to render numeric values, such as System.Int64
or long
values, or System.Double
or double
, or what level of multi-line or single-line comments or whitespace to support.
For the moment, I have implemented an interface, ICanRenderString
, for purposes of rendering descriptor elements. In the future, I may consider pursuing a more formalized string serialization approach, using a System.IO.TextWriter based approach, but for now, the implemented interface does just fine for me.
I use the string rendering extensively in order to verify that descriptor Abstract Syntax Tree (AST) synthesis occurs properly during ANTLR4 parsing.