Browse Source

ig-c99: add ig_c99_typeclass() - typeclass resolution of type as defined in lms-c99 spec.

main
heck 2 years ago
parent
commit
b437e8bf3d
  1. 26
      lm-c99/ig-c99.ysl2

26
lm-c99/ig-c99.ysl2

@ -17,19 +17,29 @@ tstylesheet {
// * object
def "func:ig_c99_typeclass" {
param "idltype";
const "resolved_type", "func:idl_type_get_resolved_type($idltype)";
const "resolved_typekind", "func:idl_type_get_typekind_of_type($resolved_type)";
choose {
when "func:idl_type_is_defined($idltype)"
choose {
when "func:idl_type_is_of_typekind_basetype($idltype)"
when "$resolved_typekind = 'basetype'"
choose {
when "$resolved_type = 'string'"
result > object
when "$resolved_type = 'binary'"
result > object
otherwise
result > primitive
}
when "$resolved_typekind = 'enum'"
result > primitive
when "func:idl_type_is_of_typekind_deftype($idltype)"
result > primitive
when "func:idl_type_is_of_typekind_enum($idltype)"
result > primitive
when "func:idl_type_is_of_typekind_struct($idltype)"
result > primitive
when "$resolved_typekind = 'struct'"
result > object
when "$resolved_typekind = 'generic'"
result > object
otherwise
error > ig_c99_typeclass - cant determine typeclass of: «$idltype»
}
otherwise
error > ig_c99_typeclass - is not a type: «$idltype»

Loading…
Cancel
Save