Lines Matching refs:decl
182 /* Demangle the calling convention from MANGLED and append it to DECL.
185 dlang_call_convention (string *decl, const char *mangled)
197 string_append (decl, "extern(C) ");
201 string_append (decl, "extern(Windows) ");
205 string_append (decl, "extern(Pascal) ");
209 string_append (decl, "extern(C++) ");
218 /* Demangle the D function attributes from MANGLED and append it to DECL.
221 dlang_attributes (string *decl, const char *mangled)
233 string_append (decl, "pure ");
237 string_append (decl, "nothrow ");
241 string_append (decl, "ref ");
245 string_append (decl, "@property ");
249 string_append (decl, "@trusted ");
253 string_append (decl, "@safe ");
265 string_append (decl, "@nogc ");
274 /* Demangle the function type from MANGLED and append it to DECL.
277 dlang_function_type (string *decl, const char *mangled)
296 mangled = dlang_call_convention (decl, mangled);
310 /* Append to decl in order. */
311 string_appendn (decl, type.b, sztype);
312 string_append (decl, "(");
313 string_appendn (decl, args.b, szargs);
314 string_append (decl, ") ");
315 string_appendn (decl, attr.b, szattr);
323 /* Demangle the argument list from MANGLED and append it to DECL.
326 dlang_function_args (string *decl, const char *mangled)
336 string_append (decl, "...");
340 string_append (decl, ", ...");
348 string_append (decl, ", ");
353 string_append (decl, "scope ");
360 string_append (decl, "out ");
364 string_append (decl, "ref ");
368 string_append (decl, "lazy ");
371 mangled = dlang_type (decl, mangled);
377 /* Demangle the type from MANGLED and append it to DECL.
380 dlang_type (string *decl, const char *mangled)
389 string_append (decl, "shared(");
390 mangled = dlang_type (decl, mangled);
391 string_append (decl, ")");
395 string_append (decl, "const(");
396 mangled = dlang_type (decl, mangled);
397 string_append (decl, ")");
401 string_append (decl, "immutable(");
402 mangled = dlang_type (decl, mangled);
403 string_append (decl, ")");
410 string_append (decl, "inout(");
411 mangled = dlang_type (decl, mangled);
412 string_append (decl, ")");
418 string_append (decl, "__vector(");
419 mangled = dlang_type (decl, mangled);
420 string_append (decl, ")");
427 mangled = dlang_type (decl, mangled);
428 string_append (decl, "[]");
442 mangled = dlang_type (decl, mangled);
443 string_append (decl, "[");
444 string_appendn (decl, numptr, num);
445 string_append (decl, "]");
458 mangled = dlang_type (decl, mangled);
459 string_append (decl, "[");
460 string_appendn (decl, type.b, sztype);
461 string_append (decl, "]");
468 mangled = dlang_type (decl, mangled);
469 string_append (decl, "*");
477 return dlang_parse_symbol (decl, mangled);
480 mangled = dlang_function_type (decl, mangled);
481 string_append (decl, "delegate");
485 return dlang_parse_tuple (decl, mangled);
490 mangled = dlang_function_type (decl, mangled);
491 string_append (decl, "function");
497 string_append (decl, "none");
501 string_append (decl, "void");
505 string_append (decl, "byte");
509 string_append (decl, "ubyte");
513 string_append (decl, "short");
517 string_append (decl, "ushort");
521 string_append (decl, "int");
525 string_append (decl, "uint");
529 string_append (decl, "long");
533 string_append (decl, "ulong");
537 string_append (decl, "float");
541 string_append (decl, "double");
545 string_append (decl, "real");
551 string_append (decl, "ifloat");
555 string_append (decl, "idouble");
559 string_append (decl, "ireal");
563 string_append (decl, "cfloat");
567 string_append (decl, "cdouble");
571 string_append (decl, "creal");
577 string_append (decl, "bool");
581 string_append (decl, "char");
585 string_append (decl, "wchar");
589 string_append (decl, "dchar");
597 /* Extract the identifier from MANGLED and append it to DECL.
600 dlang_identifier (string *decl, const char *mangled)
620 return dlang_parse_template (decl, mangled, i);
628 string_append (decl, "this");
635 string_append (decl, "~this");
642 string_append (decl, "this(this)");
649 string_append (decl, "init$");
656 string_prepend (decl, "ClassInfo for ");
657 string_setlength (decl, string_length (decl) - 1);
664 string_prepend (decl, "vtable for ");
665 string_setlength (decl, string_length (decl) - 1);
672 string_prepend (decl, "Interface for ");
673 string_setlength (decl, string_length (decl) - 1);
680 string_prepend (decl, "ModuleInfo for ");
681 string_setlength (decl, string_length (decl) - 1);
686 string_appendn (decl, mangled, i);
695 DECL,
699 dlang_parse_integer (string *decl, const char *mangled, char type)
713 string_append (decl, "'");
719 string_appendn (decl, &c, 1);
727 string_append (decl, "\\x");
731 string_append (decl, "\\u");
735 string_append (decl, "\\U");
756 string_appendn (decl, &(value[pos]), 10 - pos);
758 string_append (decl, "'");
770 string_append (decl, val ? "true" : "false");
784 string_appendn (decl, numptr, num);
792 string_append (decl, "u");
795 string_append (decl, "L");
798 string_append (decl, "uL");
806 /* Extract the floating-point value from MANGLED and append it to DECL.
809 dlang_parse_real (string *decl, const char *mangled)
819 string_append (decl, "NaN");
825 string_append (decl, "Inf");
831 string_append (decl, "-Inf");
886 string_appendn (decl, buffer, len);
906 /* Extract the string value from MANGLED and append it to DECL.
909 dlang_parse_string (string *decl, const char *mangled)
926 string_append (decl, "\"");
934 string_appendn (decl, &val, 1);
941 string_append (decl, "\"");
944 string_appendn (decl, &type, 1);
949 /* Extract the static array value from MANGLED and append it to DECL.
952 dlang_parse_arrayliteral (string *decl, const char *mangled)
961 string_append (decl, "[");
964 mangled = dlang_value (decl, mangled, NULL, '\0');
966 string_append (decl, ", ");
969 string_append (decl, "]");
973 /* Extract the associative array value from MANGLED and append it to DECL.
976 dlang_parse_assocarray (string *decl, const char *mangled)
985 string_append (decl, "[");
988 mangled = dlang_value (decl, mangled, NULL, '\0');
989 string_append (decl, ":");
990 mangled = dlang_value (decl, mangled, NULL, '\0');
993 string_append (decl, ", ");
996 string_append (decl, "]");
1000 /* Extract the struct literal value for NAME from MANGLED and append it to DECL.
1003 dlang_parse_structlit (string *decl, const char *mangled, const char *name)
1013 string_append (decl, name);
1015 string_append (decl, "(");
1018 mangled = dlang_value (decl, mangled, NULL, '\0');
1020 string_append (decl, ", ");
1023 string_append (decl, ")");
1027 /* Extract the value from MANGLED and append it to DECL.
1030 dlang_value (string *decl, const char *mangled, const char *name, char type)
1040 string_append (decl, "null");
1046 string_append (decl, "-");
1047 mangled = dlang_parse_integer (decl, mangled, type);
1057 mangled = dlang_parse_integer (decl, mangled, type);
1063 mangled = dlang_parse_real (decl, mangled);
1069 mangled = dlang_parse_real (decl, mangled);
1070 string_append (decl, "+");
1074 mangled = dlang_parse_real (decl, mangled);
1075 string_append (decl, "i");
1082 mangled = dlang_parse_string (decl, mangled);
1089 mangled = dlang_parse_assocarray (decl, mangled);
1091 mangled = dlang_parse_arrayliteral (decl, mangled);
1097 mangled = dlang_parse_structlit (decl, mangled, name);
1135 /* Extract and demangle the symbol in MANGLED and append it to DECL.
1138 dlang_parse_symbol (string *decl, const char *mangled)
1144 string_append (decl, ".");
1146 mangled = dlang_identifier (decl, mangled);
1157 saved = string_length (decl);
1158 mangled = dlang_call_convention (decl, mangled);
1159 mangled = dlang_attributes (decl, mangled);
1160 string_setlength (decl, saved);
1162 string_append (decl, "(");
1163 mangled = dlang_function_args (decl, mangled);
1164 string_append (decl, ")");
1169 saved = string_length (decl);
1170 mangled = dlang_type (decl, mangled);
1171 string_setlength (decl, saved);
1180 /* Demangle the tuple from MANGLED and append it to DECL.
1183 dlang_parse_tuple (string *decl, const char *mangled)
1192 string_append (decl, "Tuple!(");
1196 mangled = dlang_type (decl, mangled);
1198 string_append (decl, ", ");
1201 string_append (decl, ")");
1205 /* Demangle the argument list from MANGLED and append it to DECL.
1208 dlang_template_args (string *decl, const char *mangled)
1222 string_append (decl, ", ");
1228 mangled = dlang_parse_symbol (decl, mangled);
1232 mangled = dlang_type (decl, mangled);
1250 mangled = dlang_value (decl, mangled, name.b, type);
1264 be made up of LEN characters, and append it to DECL.
1267 dlang_parse_template (string *decl, const char *mangled, long len)
1286 mangled = dlang_identifier (decl, mangled);
1289 string_append (decl, "!(");
1290 mangled = dlang_template_args (decl, mangled);
1291 string_append (decl, ")");
1306 string decl;
1315 string_init (&decl);
1319 string_append (&decl, "D main");
1325 if (dlang_parse_symbol (&decl, mangled) == NULL)
1326 string_delete (&decl);
1329 if (string_length (&decl) > 0)
1331 string_need (&decl, 1);
1332 *(decl.p) = '\0';
1333 demangled = decl.b;