More improvements.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@20390 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-11-27 22:38:53 +00:00
parent b282d75ec3
commit 2363466584
3 changed files with 43 additions and 12 deletions

View file

@ -32,6 +32,7 @@
#include <InterfaceBuilder/IBPalette.h>
#include <GNUstepBase/GSCategories.h>
#include <Foundation/NSValue.h>
#include <Foundation/NSException.h>
#include <GormObjCHeaderParser/OCHeaderParser.h>
#include <GormObjCHeaderParser/OCClass.h>
@ -1594,6 +1595,10 @@
NSMutableArray *actions = [NSMutableArray array];
NSMutableArray *outlets = [NSMutableArray array];
// skip it, if it's category... for now. TODO: make categories work...
if([cls isCategory])
continue;
while((method = (OCMethod *)[men nextObject]) != nil)
{
if([method isAction])
@ -1610,10 +1615,20 @@
}
}
[self addClassNamed: className
withSuperClassNamed: superClass
withActions: actions
withOutlets: outlets];
if([self isKnownClass: superClass])
{
[self addClassNamed: className
withSuperClassNamed: superClass
withActions: actions
withOutlets: outlets];
}
else
{
result = NO;
[NSException raise: @"UnknownParentClass"
format: @"The superclass %@ of class %@ is not known, please parse it.",
superClass, className];
}
}
}
}

View file

@ -32,6 +32,7 @@
#include "GormFilePrefsManager.h"
#include "GormViewWindow.h"
#include <Foundation/NSUserDefaults.h>
#include <Foundation/NSException.h>
#include <AppKit/NSImage.h>
#include <AppKit/NSSound.h>
#include <AppKit/NSNibConnector.h>
@ -1259,18 +1260,30 @@ static NSImage *fileImage = nil;
if (result == NSOKButton)
{
NSString *fileName = [oPanel filename];
if(![classManager parseHeader: fileName])
NS_DURING
{
NSString *message = [NSString stringWithFormat:
_(@"An error occurred while parsing %@"),fileName];
if(![classManager parseHeader: fileName])
{
NSString *message = [NSString stringWithFormat:
_(@"An error occurred while parsing %@"),fileName];
NSRunAlertPanel(_(@"Problem parsing class"),
message,
nil, nil, nil);
}
else
{
return self;
}
}
NS_HANDLER
{
NSString *message = [localException reason];
NSRunAlertPanel(_(@"Problem parsing class"),
message,
nil, nil, nil);
}
else
{
return self;
}
NS_ENDHANDLER
}
return nil;

View file

@ -68,16 +68,18 @@
NSString *finalString = [NSString stringWithString: @""];
// strip all of the one line comments out...
[scanner setCharactersToBeSkipped: nil];
while(![scanner isAtEnd])
{
NSString *tempString = nil;
[scanner scanUpToString: @"//" intoString: &tempString];
[scanner scanUpToAndIncludingString: @"\n" intoString: NULL];
[scanner scanUpToString: @"\n" intoString: NULL];
resultString = [resultString stringByAppendingString: tempString];
}
// strip all of the multiline comments out...
scanner = [NSScanner scannerWithString: resultString];
[scanner setCharactersToBeSkipped: nil];
while(![scanner isAtEnd])
{
NSString *tempString = nil;
@ -96,6 +98,7 @@
NSString *resultString = [NSString stringWithString: @""];
// strip all of the one line comments out...
[scanner setCharactersToBeSkipped: nil];
while(![scanner isAtEnd])
{
NSString *tempString = nil;