Coder Social home page Coder Social logo

marat1961 / protobuf-delphi Goto Github PK

View Code? Open in Web Editor NEW
51.0 51.0 19.0 429 KB

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.

License: GNU General Public License v3.0

Pascal 99.95% Batchfile 0.05%
cocor delphi efficiency pascal protobuf protocol-buffer serialization

protobuf-delphi's People

Contributors

marat1961 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

protobuf-delphi's Issues

Namespace support

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.

Code Generation

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.

Clean up grammar

Replace service declaration and rpc with embedded procedure type.

Unrecognized character

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;

Memory regions usage

To facilitate the release of memory occupied by recursive structures, start using memory regions.

Two/three different methods are needed

Two/three different methods are needed

  1. For standard scalar data types
    We use a method binding based on TypeInfo.
  2. 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.

Make Generation Settings Support

Management of the generated code.
Place in settings

  1. Frame for the generated data model.
  2. Frame for the generated serialization code.
  3. Templates for generating fields:
  • tag declaration;
  • private field declaration in class;
  • field declaration in the record;
  • property generation;
  • getter/setter;
  • custom type;
  • repeating field;
  • standard dictionary.

Delphi keywords

When declaring class fields, check the names for equality with Delphi keywords.
If there is a match, it is possible:

  1. Issue a diagnosis
  2. Add prefix &
  3. Add the ability to determine:
  • Generated field name;
  • Generated type name.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.