interfacing between transports written in different programming languages
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
646 B

9 months ago
  1. include yslt.yml2
  2. tstylesheet {
  3. include standardlib.ysl2
  4. template "/enum"
  5. ||
  6. package foundation.pEp
  7. enum class «yml:CamelCase(@name)»(val «yml:abbr(@name)»: Int) {
  8. `` apply "item|doc"
  9. }
  10. ||
  11. template "item" {
  12. param "hexdigits", 8;
  13. indent 0;
  14. choose {
  15. when "@output='hex'"
  16. > «yml:ucase(@name)»(0x«yml:ucase(yml:dec2hex(.,$hexdigits))»)
  17. otherwise
  18. > «yml:ucase(@name)»(.)
  19. }
  20. if "position()!=last()" > ,
  21. if "@doc" > // «@doc»
  22. > \n
  23. }
  24. template "doc"
  25. ||
  26. // «.»
  27. ||
  28. }