Fast and simple implementation of Protocol Buffers for Delphi. Now we support code generation for the classes. Next, we plan to add reflection and records using memory regions.
In my computer. I have the source code as follow: procedure TGen.GenComment(const ? string); var s: string; begin for s in ?Split([#13#10], TStringSplitOptions.None) do Wrln('// ' + s) end;
After successful parsing in our table TopScope refers to the universe, which contains built-in types.
The generation code is discouraged.
We need either to add a module to the table or not to close the module's scope.
There is one more option, we can rewrite the generation code to work with the module and the import list.
Add the ability to control code generation in different files. It is best to use the concept of a namespace to control generation.
In this case, you should not use already existing packages for this. Since the existing packages are used to describe the data model and are designed to resolve collisions when names match.
For standard scalar data types
We use a method binding based on TypeInfo.
For user defined types
a) array or collection (type of collection, type of value)
b) record or object (TObjMeta)
Use a pair of generated read/write methods.