Browse Source

idl-api - add static analysis of the interface description

main
heck 2 years ago
parent
commit
2dde4d56a9
  1. 23
      idl/idl_api.ysl2

23
idl/idl_api.ysl2

@ -19,6 +19,29 @@ def "func:exists" {
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// idl-api (ysl2) // idl-api (ysl2)
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
template "/" {
choose {
when "func:idl_static_analysis_is_ok()"
apply "/pEpACIDLang", 0
}
}
def "func:idl_static_analysis_is_ok" {
const "pepacidlang_count", "count(/pEpACIDLang)";
const "idl_count", "count(/pEpACIDLang/idl)";
choose {
when "$pepacidlang_count < 1"
error > idl_static_analysis_is_ok - root node pEpACIDLang not found
when "$idl_count < 1"
error > idl_static_analysis_is_ok - pEpACIDLang idl data not found, include pEpACIDLang.yml2 exactly once.
when "$idl_count < 1"
error > idl_static_analysis_is_ok - ambiguous idl data, include pEpACIDLang.yml2 exactly once.
otherwise
result "true()";
}
}
def "func:idl_get_package_name" { def "func:idl_get_package_name" {
result "/pEpACIDLang/package/@name" result "/pEpACIDLang/package/@name"
} }

Loading…
Cancel
Save