Browse Source

Add the WIP/tentative idl-grammar pEpACIDLang.yml2

main
heck 2 years ago
parent
commit
1d63cdb706
  1. 82
      idl/pEpACIDLang.yml2

82
idl/pEpACIDLang.yml2

@ -0,0 +1,82 @@
// p≡p API Y language
// Copyleft (c) 2019-2020, p≡p foundation
// this file is under GNU General Public License 3.0
// see LICENSE.txt
// written by Volker Birk and Nana Karlstetter
decl package @name;
decl api @name;
decl type @name;
decl is @type;
decl extends @type;
// enum
decl enum @name;
decl item @name;
decl hex is item (output=hex);
// struct
decl struct @name;
decl field @type @name; // optional: function=free for a free function
// method
decl method @name;
// unimplemented
// decl internal < field >; // internal field, p≡p engine only
// decl flag @name;
// decl protocol @name;
// decl construct, new is construct;
// readonly in parm, ownership remains with caller
decl use @type @name (mode=use) alias parm;
// inout parm, ownership remains with caller
decl supply @type @name (mode=supply) alias parm;
// in parm, ownership goes to callee
decl provide @type @name (mode=provide) alias parm;
// out parm, ownership goes to caller
decl return @type @name (mode=return) alias parm;
// factory delivers this, ownership goes to caller
decl create @type @name (mode=create) alias parm;
decl throws @except;
decl caveat(mode=caveat) alias doc;
// base types
// string text
// p≡p engine uses UTF-8 strings which are NFC normalized.
// Cf. https //dev.pep.foundation/Engine/Basic%20Concepts%20of%20the%20pEp%20Engine
// binary binary data
// int signed integer number
// uint unsigned integer number
// size size in memory
// bool true or false
// timestamp point of time
// opaque opaque type (was: 'any')
//package idl {
// type string;
// type binary;
// type int;
// type uint;
// type size;
// type bool;
// type timestamp;
// type opaque;
//}
// collections
// list one or more elements, which have a sequence
// set one or more elements, which do not have a sequence
// pair two elements in sequence
Loading…
Cancel
Save