summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-08-03 13:27:01 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-08-03 13:27:01 +0200
commit02ebdffc544f9ff20798cce31b26c4227c858123 (patch)
tree7cf40f76f928e6cc078e672db5a6ed59be09ab1e
parent7c9daef5037fef49b3bd522cd4a78cdeda0c2055 (diff)
Add declaration manipulation support to MLKLexicalContext.
-rw-r--r--MLKLexicalContext.h3
-rw-r--r--MLKLexicalContext.m12
2 files changed, 15 insertions, 0 deletions
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];