
4 changed files with 486 additions and 155 deletions
@ -1,84 +1,127 @@ |
|||||
include pEpACIDLang.yml2 |
pEpACIDLang { |
||||
|
include pEpACIDLang.yml2 |
||||
package pkg { |
|
||||
version 1.0; |
|
||||
license "License text"; |
|
||||
copyleft "Copyleft text"; |
|
||||
|
|
||||
api api1 { |
|
||||
// These are the idl basetypes |
|
||||
// They should be in the package 'pEpIdl' |
|
||||
// And they need to be 'imported' into every module. |
|
||||
// But currently there is no import/depends concept implemented |
|
||||
type string; |
|
||||
type binary; |
|
||||
type int; |
|
||||
type uint; |
|
||||
type size; |
|
||||
type bool; |
|
||||
type opaque; |
|
||||
|
|
||||
// This is part of the API def |
|
||||
type stringalias is string; |
|
||||
|
|
||||
enum enum1 { |
|
||||
item item1 doc="oneline doc"; |
|
||||
item item2 doc=""; |
|
||||
item item3 |
|
||||
doc= |
|
||||
""" |
|
||||
item 3 |
|
||||
------ |
|
||||
multiline |
|
||||
doc |
|
||||
"""; |
|
||||
}; |
|
||||
|
|
||||
enum enum2 { |
package example { |
||||
item item1 0; |
version 1.0; |
||||
item item2 1; |
license "License text"; |
||||
item item3 2 |
copyleft "Copyleft text"; |
||||
doc= |
|
||||
""" |
|
||||
|
|
||||
|
api api1 { |
||||
|
// creates a type-alias with optional |
||||
|
// properties to specialize the type. |
||||
|
// the aliased type must be a basetype |
||||
|
deftype deftype1 as size; |
||||
|
deftype deftype2 as string; |
||||
|
deftype stringlist as list<string>; |
||||
|
|
||||
|
enum enum1 { |
||||
|
item item1 doc="item with automatic value"; |
||||
|
item item2 23 doc="item with explicit value"; |
||||
|
hex item3 0xff |
||||
|
doc= |
||||
|
""" |
||||
|
hex enum item |
||||
|
------------- |
||||
|
use 'hex' instead of 'item' |
||||
|
and specify value as 3rd param |
||||
|
"""; |
||||
|
}; |
||||
|
|
||||
item 3 |
struct struct1 { |
||||
------ |
field int int1; |
||||
|
field size size1 doc="short doc"; |
||||
|
field string string1 |
||||
|
doc=""" |
||||
|
Multiline |
||||
|
Doc |
||||
|
"""; |
||||
|
}; |
||||
|
|
||||
multiline |
|
||||
|
|
||||
doc with bad formattting """; |
|
||||
}; |
|
||||
|
|
||||
enum enum3 { |
// Param Passing Modes |
||||
hex item1 0x00; |
// * borrow |
||||
hex item2 0x10 doc="oneline doc"; |
// * mborrow |
||||
hex item3 0xff |
// * claim |
||||
doc= |
// * provide |
||||
""" |
|
||||
item 3 |
|
||||
------ |
|
||||
multi line |
|
||||
doc |
|
||||
"""; |
|
||||
}; |
|
||||
|
|
||||
struct struct1 { |
// TEST |
||||
field int int1; |
// ---- |
||||
field size size1 doc="short doc"; |
// Test comma after param |
||||
field string string1 |
|
||||
doc=""" |
method test_one_param { |
||||
Multiline |
param borrow size p |
||||
Doc |
doc=""" |
||||
""", |
Multiline |
||||
bla="fds"; |
Doc |
||||
}; |
"""; |
||||
}; |
}; |
||||
|
|
||||
|
method test_two_param { |
||||
|
param borrow size p1 |
||||
|
doc=""" |
||||
|
Multiline |
||||
|
Doc |
||||
|
"""; |
||||
|
param borrow size p2 |
||||
|
doc=""" |
||||
|
Multiline |
||||
|
Doc |
||||
|
"""; |
||||
|
}; |
||||
|
|
||||
|
|
||||
|
|
||||
|
// TEST |
||||
|
// ---- |
||||
|
|
||||
api api2 { |
method method_test_all { |
||||
|
// primitive basetype |
||||
|
param borrow size borrow_primitive_basetype; |
||||
|
param mborrow size mborrow_primitive_basetype; |
||||
|
//param claim size claim_primitive_basetype; ERROR CASE |
||||
|
//param provide size provide_primitive_basetype; ERROR CASE |
||||
|
|
||||
|
// object basetype |
||||
} |
param borrow string borrow_obj_basetype; |
||||
} |
param mborrow string mborrow_obj_basetype; |
||||
|
param claim string claim_obj_basetype; |
||||
|
param provide string provide_obj_basetype; |
||||
|
|
||||
|
// enum |
||||
|
param borrow enum1 borrow_enum; |
||||
|
param mborrow enum1 mborrow_enum; |
||||
|
//param claim enum1 claim_enum; ERROR CASE |
||||
|
//param provide enum1 provide_enum; ERROR CASE |
||||
|
|
||||
|
// struct |
||||
|
param borrow struct1 borrow_struct; |
||||
|
param mborrow struct1 mborrow_struct; |
||||
|
param claim struct1 claim_struct; |
||||
|
param provide struct1 provide_struct; |
||||
|
|
||||
|
// deftype of primitive basetype |
||||
|
param borrow deftype1 borrow_spec_primitive_basetype; |
||||
|
param mborrow deftype1 mborrow_spec_primitive_basetype; |
||||
|
//param claim deftype1 claim_spec_primitive_basetype; ERROR CASE |
||||
|
//param provide deftype1 provide_spec_primitive_basetype; ERROR CASE |
||||
|
|
||||
|
// deftype of object basetype object |
||||
|
param borrow deftype2 borrow_spec_obj_basetype; |
||||
|
param mborrow deftype2 mborrow_spec_obj_basetype; |
||||
|
param claim deftype2 claim_spec_obj_basetype; |
||||
|
param provide deftype2 provide_spec_obj_basetype; |
||||
|
|
||||
|
// deftype of list |
||||
|
param borrow stringlist borrow_spec_primitive_basetype; |
||||
|
param mborrow stringlist mborrow_spec_primitive_basetype; |
||||
|
param claim stringlist claim_spec_primitive_basetype; |
||||
|
param provide stringlist provide_spec_primitive_basetype; |
||||
|
}; |
||||
|
|
||||
|
}; |
||||
|
|
||||
|
|
||||
|
test_types; |
||||
|
}; |
||||
|
}; |
Loading…
Reference in new issue