Objective-C 在xp下环境搭建以及使用utraedit高亮显示编辑代码

GNUstep Windows Installer提供了Windows平台下的Objective-C的模拟开发环境,一共有四个软件包,

其中GNUstep SystemGNUstep Core是必装的,GNUstep DevelCairo Backend是选装的。

甭管必装选装,一次性全安上,免得以后麻烦。

编写Hello, World!



1.安装后在环境变量PATH中增加:

  C:\GNUstep\GNUstep\System\Tools;C:\GNUstep\bin;C:\GNUstep\mingw\bin

  安装后运行GNUstep shell也就是安装目录下的msys.bat。测试一下gcc与make命令。

2: 测试程序

test.m
1 #import <Foundation/Foundation.h>
2 int main (int argc, const char *argv[]) {
3 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
4 NSLog(@"Hello World!");
5 [pool drain];
6 return 0;
7 }

3.在Shell中输入命令:

gcc -fconstant-string-class=NSConstantString -c testm -I /GNUstep/System/Library/Headers


这是目录里就会生成test.o和test.exe文件。


4.UltraEdit下配置Objective-c高亮显示


#追加到 UltraEdit配置文件末尾

/L14"Objective-C" OBJECTIVE-C_LANG Line Comment = // Block Comment On = /* Block Comment Off = */ Escape Char = \ String Chars = "' String Literal Prefix = @ File Extensions = H M MM PCH
/Delimiters = ~!@%^&*()-+=|\/{}[]:;"'<> , .?
/Function String = "%^([a-zA-Z_0-9^[^]*]+^)[ ^t]+([^p*&:, ^t^[^]a-zA-Z_0-9.!]++)[~;]"
/Function String 1 = "%[a-zA-Z_0-9*]*::^([a-zA-Z_0-9^~]+^)[ ^t^p]++([^p*&:, ^t^[^]/*^-'=:&a-zA-Z_0-9./(!]++)[~;]"
/Function String 2 = "%[a-zA-Z_0-9^][a-zA-Z_0-9^[^]]+[ ^t*]+^([a-zA-Z_0-9]+^)[ ^t]++([^p*&:, ^t^[^]a-zA-Z_0-9./(!]++)[~;]"
/Function String 3 = "%[a-zA-Z_0-9*&$^[^]*]+[ ^t]+[a-zA-Z_0-9*&$^[^]]+[ ^t*]+^([a-zA-Z_0-9]+^)[ ^t]++([^p*&:, ^t^[^]a-zA-Z_0-9./(!]++)[~;]"
/Function String 4 = "%[a-z_0-9^[^]*]++ [a-z_0-9*^[^]]+[ ^t]++[a-z_0-9*^[^]]+[ ^t]++^([*a-z_0-9]+^)[ ^t]++([^p*&:, ^t^[^]a-z_0-9./(!]++)[~;]"
/Function String 5 = "%^([a-zA-Z_0-9^[^]*]+^)[ ^t]++([^p*&:, ^t^[^]a-zA-Z_0-9./()!]++)[~;]"
/Member String = "^([A-Za-z0-9_:.]+^)[ ^t^*&]+$S[ ^t^[^]A-Za-z0-9_]++[(-);,]"
/Variable String = "%[ ^t]++^([!-~ ^t<>]+*[~a-z^p]^)$S[ ^t;,()^-]"
/Indent Strings = "{"
/Unindent Strings = "}"
/Open Brace Strings =  "{" "(" "["
/Close Brace Strings = "}" ")" "]"
/Open Fold Strings = "{"
/Close Fold Strings = "}"
/C1"Keywords" STYLE_KEYWORD
_Bool _Complex _Imaginary _cmd __func__
__asm __based __cdecl __declspec __except __far __fastcall __finally __fortran __huge __inline __int16
__int32 __int64 __int8 __interrupt __leave __loadds __near __pascal __saveregs __segment __segname __self
__stdcall __try __uuidof __multiple_inheritance __single_inheritance __virtual_inheritance
auto do double assign
bool break bycopy byref
BOOL
char class case const continue const_cast catch copy
Class
defined default do double delete dynamic_cast dllexport dllimport
enum extern else explicit export
for float false friend
goto getter
int if in inline inout id init
IMP
long
mutable
nil namespace new naked nonatomic
Nil NO NSObject
oneway out operator
Object
private protected public
Protocol
return register restrict reinterpret_cast retain readwrite readonly
self short signed sizeof static struct super switch static_cast setter
SEL
typedef template this throw true try typeid typename thread
union unsigned using uuid
void volatile virtual
while wchar_t
YES
** @ #
/C2"Operators" STYLE_OPERATOR
@
#
:
!
%
&
+
-
*
// /
<
=
>
^
|
~
?
,
/C3"Framework" STYLE_EXTENSION
alloc
dealloc
Foundation
release
** NS IB CF CA CG UI GL EAGL
/C4"OpenGL" STYLE_KEYWORD
** gl


你可能感兴趣的:(Objective-C 在xp下环境搭建以及使用utraedit高亮显示编辑代码)