1 ! Copyright (C) 2006 Slava Pestov
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: compiler io kernel cocoa.runtime cocoa.subclassing
4 cocoa.messages cocoa.types sequences words vocabs parser
5 core-foundation.bundles namespaces assocs hashtables
6 compiler.units lexer init ;
9 : (remember-send) ( selector variable -- )
10 global [ dupd ?set-at ] change-at ;
14 : remember-send ( selector -- )
15 sent-messages (remember-send) ;
18 scan dup remember-send parsed \ send parsed ;
21 SYMBOL: super-sent-messages
23 : remember-super-send ( selector -- )
24 super-sent-messages (remember-send) ;
27 scan dup remember-super-send parsed \ super-send parsed ;
32 frameworks global [ V{ } clone or ] change-at
34 [ frameworks get [ load-framework ] each ] "cocoa.messages" add-init-hook
36 : FRAMEWORK: scan [ load-framework ] [ frameworks get push ] bi ; parsing
38 : IMPORT: scan [ ] import-objc-class ; parsing
40 "Compiling Objective C bridge..." print
42 "cocoa.classes" create-vocab drop
45 "cocoa" "cocoa.runtime" "cocoa.messages" "cocoa.subclassing"
46 } [ words ] map concat compile
48 "Importing Cocoa classes..." print
66 "NSNotificationCenter"
74 "NSPropertyListSerialization"
85 ] with-compilation-unit