From d355e8a5ef359b76ddaec26f33a8c9345d3a2e79 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Tue, 10 Jun 2008 17:09:40 +0200 Subject: Add class MLKSymbol. --- GNUmakefile | 3 ++- MLKSymbol.h | 20 ++++++++++++++++++++ MLKSymbol.m | 30 ++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 MLKSymbol.h create mode 100644 MLKSymbol.m diff --git a/GNUmakefile b/GNUmakefile index 36c159d..68e893b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -19,7 +19,8 @@ include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = etoilisp etoilisp_OBJC_FILES = MLKCons.m MLKEnvironment.m MLKLinkedList.m \ - MLKLispValue.m MLKUndefinedVariableException.m + MLKLispValue.m MLKSymbol.m \ + MLKUndefinedVariableException.m -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/tool.make diff --git a/MLKSymbol.h b/MLKSymbol.h new file mode 100644 index 0000000..e239c67 --- /dev/null +++ b/MLKSymbol.h @@ -0,0 +1,20 @@ +/* -*- mode: objc; coding: utf-8 -*- */ +/* Copyright 2008, Matthias Benkard. */ + +#import "MLKLispValue.h" + +@class MLKPackage; + + +@interface MLKSymbol : MLKLispValue +{ + NSString *name; + MLKPackage *homePackage; +} + +-(MLKSymbol *) initWithName:(id)aName package:(id)aPackage; + +-(NSString *) name; +-(MLKPackage *) homePackage; +-(void) setHomePackage:(MLKPackage *)aPackage; +@end diff --git a/MLKSymbol.m b/MLKSymbol.m new file mode 100644 index 0000000..6d19323 --- /dev/null +++ b/MLKSymbol.m @@ -0,0 +1,30 @@ +/* -*- mode: objc; coding: utf-8 -*- */ +/* Copyright 2008, Matthias Benkard. */ + +#import "MLKSymbol.h" + + +@implementation MLKSymbol +-(MLKSymbol *) initWithName:(id)aName package:(id)aPackage +{ + ASSIGN (name, aName); + ASSIGN (homePackage, aPackage); + return self; +} + +-(NSString *) name +{ + return name; +} + +-(MLKPackage *) homePackage +{ + return homePackage; +} + +-(void) setHomePackage:(MLKPackage *)aPackage +{ + ASSIGN (homePackage, aPackage); +} +@end + -- cgit v1.2.3