From 02ebdffc544f9ff20798cce31b26c4227c858123 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 3 Aug 2008 13:27:01 +0200 Subject: Add declaration manipulation support to MLKLexicalContext. --- MLKLexicalContext.h | 3 +++ MLKLexicalContext.m | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/MLKLexicalContext.h b/MLKLexicalContext.h index 949bcff..c4aafc2 100644 --- a/MLKLexicalContext.h +++ b/MLKLexicalContext.h @@ -81,6 +81,9 @@ -(id) goTagForSymbol:(MLKSymbol *)symbol; +-(id) declarations; +-(void) addDeclaration:(id)declaration; + // FIXME? //-(MLKLexicalEnvironment *) instantiateWithVariables:(NSDictionary *)variables // functions:(NSDictionary *)functions; diff --git a/MLKLexicalContext.m b/MLKLexicalContext.m index a4c0ba2..cec9fd7 100644 --- a/MLKLexicalContext.m +++ b/MLKLexicalContext.m @@ -180,6 +180,18 @@ static MLKSymbol *LEXICAL; return [_goTags valueForSymbol:symbol]; } +-(id) declarations +{ + return _declarations; +} + +-(void) addDeclaration:(id)declaration +{ + ASSIGN (_declarations, + [MLKCons cons:declaration + with:_declarations]); +} + -(BOOL) symbolNamesFunction:(MLKSymbol *)symbol { symbol = symbol ? (id)symbol : (id)[NSNull null]; -- cgit v1.2.3