3 # Copyright © 2021 Nick Bowler
5 # Generate a test for whether a particuar combination of type specifiers
6 # represents a valid type, for internal use by the declaration parser.
8 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
9 # This is free software: you are free to do what the fuck you want to.
10 # There is NO WARRANTY, to the extent permitted by law.
15 print " * Automatically generated by gen-typemap.awk from " FILENAME
17 print " * Automatically generated by gen-typemap.awk"
19 print " * Do not edit."
28 $0 ~ /^[abcdefghijklmnopqrstuvwxyz_]/ {
30 for (i = 1; i <= NF; i++) {
38 $i = "1ul<<(CDECL_TYPE_" toupper($i) "-CDECL_SPEC_TYPE)"
44 print "static inline int typemap_is_valid(unsigned long map)\n{"
45 print "\tswitch (map) {"
47 for (i = 0; i < count; i++) {
48 print "\tcase " types[i] ":"