From 7a417274fbc5913ccc288f06842345ff494363df Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Tue, 12 Feb 2008 12:25:45 +0100 Subject: Add function PRINT-TYPESPEC. darcs-hash:8b64d370e2168812dfd3dea46c02fdffb8461252 --- Lisp/constant-data.lisp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'Lisp/constant-data.lisp') diff --git a/Lisp/constant-data.lisp b/Lisp/constant-data.lisp index 85b5584..7c7176d 100644 --- a/Lisp/constant-data.lisp +++ b/Lisp/constant-data.lisp @@ -72,6 +72,37 @@ (complex . #\j))) +(defparameter *objcl-typespec-map* + '((id . id) + (objective-c-class . class) + (exception . exc) + (selector . sel) + (:char . chr) + (:unsigned-char . uchr) + (:short . sht) + (:unsigned-short . usht) + (:int . int) + (:unsigned-int . uint) + (:long . lng) + (:unsigned-long . ulng) + (:long-long . lng-lng) + (:unsigned-long-long . ulng-lng) + (:float . flt) + (:double . dbl) + (bit-field . bfld) + (:boolean . bool) + (:void . void) + (:unknown . undef) + (pointer . ptr) + (:string . charptr) + (:atom . atom) + (array . (ary-b ary-e)) + (union . (union-b union-e)) + (struct . (struct-b struct-e)) + (vector . vector) + (complex . complex))) + + (defparameter *objcl-type-map* '((id . id) (class . objective-c-class) @@ -128,3 +159,9 @@ (declaim (ftype (function (symbol) symbol) type-name->c-type)) (defun type-name->c-type (type-name) (cdr (assoc type-name *objcl-c-type-map*))) + +(defun typespec-name->type-name (typespec-name) + (cdr (assoc typespec-name *objcl-typespec-map*))) + +(defun typespec-name->type-id (typespec-name) + (type-name->type-id (typespec-name->type-name typespec-name))) -- cgit v1.2.3