From 80724b1cdab2ac614635b658960bbe71957cca51 Mon Sep 17 00:00:00 2001 From: ps Date: Fri, 9 Dec 2022 12:24:17 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'README.md'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index e69de29..d204f42 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,39 @@ +Metagen package is used to describe structures, interfaces, functions, RPC calls using DSL. +This can be useful for codegen, bindings, etc. + +Here is an example of some imaginary DSL: + + #include enum.meta + + func GetPlayer( + id : uint32 + ) : DataPlayer + + func Apply( + fn : func(float, DataPlayer) : uint32 + ) + + struct DataPlayer + @POD @table:player @pkey:id + id : uint32 + version : string @strmax:16 + gold : uint8 @default:0 #bonus + registered : bool @default:true + + func Equals( + o : DataPlayer + v : uint32 + ) : bool,bool + end + + struct ProtoBase + id : uint32 + title : string @strmax:16 @default:"Hello" + end + + struct ProtoBuilding extends ProtoBase + floors : int32 + arr : uint32[] @default:[1,2,3] + end + +[Look at tests for an actual API usage.](../master/tests/run.php) \ No newline at end of file