mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 11:41:05 +00:00
Add _ to all ivars
This commit is contained in:
parent
185119df80
commit
e778644329
4 changed files with 55 additions and 60 deletions
|
@ -5,17 +5,15 @@
|
|||
PACKAGE_NAME = gorm
|
||||
include $(GNUSTEP_MAKEFILES)/common.make
|
||||
|
||||
|
||||
#
|
||||
# Subprojects
|
||||
#
|
||||
|
||||
|
||||
SUBPROJECTS = \
|
||||
Tests
|
||||
|
||||
#
|
||||
# Library
|
||||
#
|
||||
|
||||
LIBRARY_VAR=GMOBJCHEADERPARSER
|
||||
LIBRARY_NAME=GormObjCHeaderParser
|
||||
GormObjCHeaderParser_HEADER_FILES_DIR=.
|
||||
|
@ -24,13 +22,11 @@ ADDITIONAL_INCLUDE_DIRS = -I..
|
|||
#
|
||||
# Additional libraries
|
||||
#
|
||||
|
||||
GormObjCHeaderParser_LIBRARIES_DEPEND_UPON += -lgnustep-gui -l$(FOUNDATION_LIBRARY_NAME)
|
||||
|
||||
#
|
||||
# Header files
|
||||
#
|
||||
|
||||
GormObjCHeaderParser_HEADER_FILES= \
|
||||
GormObjCHeaderParser.h \
|
||||
NSScanner+OCHeaderParser.h \
|
||||
|
@ -41,11 +37,9 @@ OCIVarDecl.h \
|
|||
OCMethod.h \
|
||||
ParserFunctions.h
|
||||
|
||||
|
||||
#
|
||||
# Class files
|
||||
#
|
||||
|
||||
GormObjCHeaderParser_OBJC_FILES= \
|
||||
NSScanner+OCHeaderParser.m \
|
||||
OCClass.m \
|
||||
|
@ -58,7 +52,6 @@ ParserFunctions.m
|
|||
#
|
||||
# C files
|
||||
#
|
||||
|
||||
GormObjCHeaderParser_C_FILES=
|
||||
|
||||
HEADERS_INSTALL = $(GormObjCHeaderParser_HEADER_FILES)
|
||||
|
|
|
@ -36,30 +36,30 @@
|
|||
{
|
||||
if ((self = [super init]) != nil)
|
||||
{
|
||||
methods = [[NSMutableArray alloc] init];
|
||||
ivars = [[NSMutableArray alloc] init];
|
||||
properties = [[NSMutableArray alloc] init];
|
||||
protocols = [[NSMutableArray alloc] init];
|
||||
ASSIGN(classString, string);
|
||||
_methods = [[NSMutableArray alloc] init];
|
||||
_ivars = [[NSMutableArray alloc] init];
|
||||
_properties = [[NSMutableArray alloc] init];
|
||||
_protocols = [[NSMutableArray alloc] init];
|
||||
ASSIGN(_classString, string);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(methods);
|
||||
RELEASE(ivars);
|
||||
RELEASE(properties);
|
||||
RELEASE(protocols);
|
||||
RELEASE(classString);
|
||||
RELEASE(className);
|
||||
RELEASE(superClassName);
|
||||
RELEASE(_methods);
|
||||
RELEASE(_ivars);
|
||||
RELEASE(_properties);
|
||||
RELEASE(_protocols);
|
||||
RELEASE(_classString);
|
||||
RELEASE(_className);
|
||||
RELEASE(_superClassName);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSArray *) methods
|
||||
{
|
||||
return methods;
|
||||
return _methods;
|
||||
}
|
||||
|
||||
- (void) addMethod: (NSString *)name isAction: (BOOL) flag
|
||||
|
@ -67,12 +67,12 @@
|
|||
OCMethod *method = AUTORELEASE([[OCMethod alloc] init]);
|
||||
[method setName: name];
|
||||
[method setIsAction: flag];
|
||||
[methods addObject: method];
|
||||
[_methods addObject: method];
|
||||
}
|
||||
|
||||
- (NSArray *) ivars
|
||||
{
|
||||
return ivars;
|
||||
return _ivars;
|
||||
}
|
||||
|
||||
- (void) addIVar: (NSString *)name isOutlet: (BOOL) flag
|
||||
|
@ -80,27 +80,27 @@
|
|||
OCIVar *ivar = AUTORELEASE([[OCIVar alloc] init]);
|
||||
[ivar setName: name];
|
||||
[ivar setIsOutlet: flag];
|
||||
[ivars addObject: ivar];
|
||||
[_ivars addObject: ivar];
|
||||
}
|
||||
|
||||
- (NSString *) className
|
||||
{
|
||||
return className;
|
||||
return _className;
|
||||
}
|
||||
|
||||
- (void) setClassName: (NSString *)name
|
||||
{
|
||||
ASSIGN(className, name);
|
||||
ASSIGN(_className, name);
|
||||
}
|
||||
|
||||
- (NSString *) superClassName
|
||||
{
|
||||
return superClassName;
|
||||
return _superClassName;
|
||||
}
|
||||
|
||||
- (void) setSuperClassName: (NSString *)name
|
||||
{
|
||||
ASSIGN(superClassName,name);
|
||||
ASSIGN(_superClassName,name);
|
||||
}
|
||||
|
||||
- (BOOL) isCategory
|
||||
|
@ -115,16 +115,22 @@
|
|||
|
||||
- (NSArray *) properties
|
||||
{
|
||||
return properties;
|
||||
return _properties;
|
||||
}
|
||||
|
||||
- (void) addProperty: (NSString *)name isOutlet: (BOOL)flag
|
||||
{
|
||||
}
|
||||
|
||||
// Properties can be declared anywhere within the file, so it's necessary
|
||||
// to parse them out separately.
|
||||
- (void) _propertiesScan
|
||||
{
|
||||
}
|
||||
|
||||
- (void) _strip
|
||||
{
|
||||
NSScanner *stripScanner = [NSScanner scannerWithString: classString];
|
||||
NSScanner *stripScanner = [NSScanner scannerWithString: _classString];
|
||||
NSString *resultString = @"";
|
||||
NSCharacterSet *wsnl = [NSCharacterSet whitespaceAndNewlineCharacterSet];
|
||||
|
||||
|
@ -139,7 +145,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
ASSIGN(classString, resultString);
|
||||
ASSIGN(_classString, resultString);
|
||||
}
|
||||
|
||||
- (void) parse
|
||||
|
@ -155,8 +161,8 @@
|
|||
|
||||
// get the interface line... look ahead...
|
||||
[self _strip];
|
||||
scanner = [NSScanner scannerWithString: classString];
|
||||
if (lookAhead(classString, @"{"))
|
||||
scanner = [NSScanner scannerWithString: _classString];
|
||||
if (lookAhead(_classString, @"{"))
|
||||
{
|
||||
[scanner scanUpToString: @"@interface" intoString: NULL];
|
||||
[scanner scanUpToString: @"{" intoString: &interfaceLine];
|
||||
|
@ -176,12 +182,12 @@
|
|||
|
||||
[iscan scanUpToAndIncludingString: @"@interface" intoString: NULL];
|
||||
[iscan scanUpToString: @":" intoString: &cn];
|
||||
className = [cn stringByTrimmingCharactersInSet: wsnl];
|
||||
RETAIN(className);
|
||||
_className = [cn stringByTrimmingCharactersInSet: wsnl];
|
||||
RETAIN(_className);
|
||||
[iscan scanString: @":" intoString: NULL];
|
||||
[iscan scanUpToCharactersFromSet: wsnl intoString: &scn];
|
||||
superClassName = [scn stringByTrimmingCharactersInSet: wsnl];
|
||||
RETAIN(superClassName);
|
||||
_superClassName = [scn stringByTrimmingCharactersInSet: wsnl];
|
||||
RETAIN(_superClassName);
|
||||
}
|
||||
else // category...
|
||||
{
|
||||
|
@ -189,8 +195,8 @@
|
|||
|
||||
[iscan scanUpToAndIncludingString: @"@interface" intoString: NULL];
|
||||
[iscan scanUpToCharactersFromSet: wsnl intoString: &cn];
|
||||
className = [cn stringByTrimmingCharactersInSet: wsnl];
|
||||
RETAIN(className);
|
||||
_className = [cn stringByTrimmingCharactersInSet: wsnl];
|
||||
RETAIN(_className);
|
||||
|
||||
// check to see if it's a category on an existing interface...
|
||||
if (lookAhead(interfaceLine,@"("))
|
||||
|
@ -222,19 +228,12 @@
|
|||
[ivarScan scanString: @";" intoString: NULL];
|
||||
ivarDecl = AUTORELEASE([[OCIVarDecl alloc] initWithString: ivarLine]);
|
||||
[ivarDecl parse];
|
||||
[ivars addObjectsFromArray: [ivarDecl ivars]];
|
||||
[_ivars addObjectsFromArray: [ivarDecl ivars]];
|
||||
}
|
||||
}
|
||||
|
||||
// Scan properties...
|
||||
/*
|
||||
[scanner
|
||||
if (lookAhead(@"@property"))
|
||||
{
|
||||
|
||||
propertyScan = [NSScanner scannerWithString:
|
||||
}
|
||||
*/
|
||||
}
|
||||
else // yes, it's a category, but properties can be in categories...
|
||||
{
|
||||
}
|
||||
|
||||
// put the methods into a string...
|
||||
|
@ -244,7 +243,7 @@
|
|||
}
|
||||
else //
|
||||
{
|
||||
scanner = [NSScanner scannerWithString: classString];
|
||||
scanner = [NSScanner scannerWithString: _classString];
|
||||
[scanner scanUpToAndIncludingString: interfaceLine intoString: NULL];
|
||||
[scanner scanUpToString: @"@end" intoString: &methodsString];
|
||||
}
|
||||
|
@ -262,7 +261,7 @@
|
|||
[methodScan scanString: @";" intoString: NULL];
|
||||
method = AUTORELEASE([[OCMethod alloc] initWithString: methodLine]);
|
||||
[method parse];
|
||||
[methods addObject: method];
|
||||
[_methods addObject: method];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Tests Makefile for Gorm ObjC Parser Library.
|
||||
# Tests Makefile for GNUstep GUI Library.
|
||||
#
|
||||
# Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
#
|
||||
|
@ -45,21 +45,24 @@ include $(GNUSTEP_MAKEFILES)/common.make
|
|||
TOP_DIR := $(shell dirname $(CURDIR))
|
||||
|
||||
all::
|
||||
@(echo If you want to run the gnustep-gui testsuite, please type \'make check\')
|
||||
@(echo If you want to run the gorm-objcheaderparser testsuite, please type \'make check\')
|
||||
|
||||
check::
|
||||
(\
|
||||
ADDITIONAL_INCLUDE_DIRS="-I$(TOP_DIR)/."
|
||||
ADDITIONAL_LIB_DIRS="-L$(TOP_DIR)/$(GNUSTEP_OBJ_DIR)";\
|
||||
LD_LIBRARY_PATH="$(TOP_DIR)/$(GNUSTEP_OBJ_DIR):${LD_LIBRARY_PATH}";\
|
||||
ADDITIONAL_INCLUDE_DIRS="-I$(TOP_DIR)/Headers -I$(TOP_DIR)/Source/$(GNUSTEP_TARGET_DIR) -I$(TOP_DIR)/Headers/Additions";\
|
||||
ADDITIONAL_LIB_DIRS="-L$(TOP_DIR)/Source/$(GNUSTEP_OBJ_DIR)";\
|
||||
LD_LIBRARY_PATH="$(TOP_DIR)/Source/$(GNUSTEP_OBJ_DIR):${LD_LIBRARY_PATH}";\
|
||||
PATH="$(TOP_DIR)/Tools/$(GNUSTEP_OBJ_DIR):${PATH}";\
|
||||
export GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES;\
|
||||
export ADDITIONAL_INCLUDE_DIRS;\
|
||||
export ADDITIONAL_LIB_DIRS;\
|
||||
export LD_LIBRARY_PATH;\
|
||||
export PATH;\
|
||||
env;\
|
||||
if [ "$(DEBUG)" = "" ]; then \
|
||||
gnustep-tests GormObjCHeaderParser;\
|
||||
gnustep-tests parser;\
|
||||
else \
|
||||
gnustep-tests --debug GormObjCHeaderParser;\
|
||||
gnustep-tests --debug parser;\
|
||||
fi; \
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue