(version 1000) (serializator "test1" (define "alpha_max" 100u '("alpha")) ;; Scheme structure (procedure "alpha" (arg "alpha_lvl" symbol uint ) ) (procedure "beta" (arg "beta_lvl" int) ) (procedure "Test") (procedure "Ray" (arg "length" uint) (arg "width" uint) ) (procedure "Line" (arg "xpoint" int) (arg "ypoint" int) (arg "zpoint" int) ) ; (procedure "alpha" ; (proc "label" '("Line") (proc-allow '(optional collection))) ; ) ; (wrap vector/hashmap "key") ; the content if structured like in the struct (procedure "levels" (arg "title" string) (proc "label1" '("alpha") (proc-allow '(optional))) (proc "label2" '("beta")) (proc "label3" '("Ray" "Line" "Test") (proc-allow '(collection))) ) (rootprocedure (proc "main1" '("levels")) ) ;; Serialization ;(enum "enum title" " of procs") (enum "GeomType" '("Ray" "Line" "Test") (enumopt "Test" "Test" (empty) ) (enumopt "Ray" "Ray" (struct none "Ray" (field "l" (f/uint '("length"))) (field "w" (f/uint '("width"))) ) ) (enumopt "Line" "Line" ;(vec '("xpoint" "zpoint" "ypoint")) (vec (field "xpoint" (f/int '("xpoint"))) (field "zpoint" (f/int '("zpoint"))) (field "ypoint" (f/int '("ypoint"))) ) ) ) ; (struct "struct title" "procedure title") (struct "Levels" "levels" (field "name" (f/string '("title"))) (field "ch_a" (f/optional) (f/uint '("label1" "alpha_lvl") (val/width 4u))) (field "ch_b" (f/int '("label2" "beta_lvl") (val/width word))) (field "g_type" (f/vector (f/enum '("label3")) (vector/type array) ; or array (for a structure constructor) ) ) ) ; for enum (field/noname f/enum '("label3")) ;root "title of the Struct" (fields...) (rootstruct "CommonLevels" (field "lvl" (f/struct '("main1"))) ) )