diff options
author | Matthias Benkard <mulk@minimulk.mst-plus> | 2008-08-11 12:16:44 +0200 |
---|---|---|
committer | Matthias Benkard <mulk@minimulk.mst-plus> | 2008-08-11 12:16:44 +0200 |
commit | f784dcad0bda2c518cc21df24180019263915da5 (patch) | |
tree | fe19873ae10c7da6f4eb5ce393cb45c2cef2341a | |
parent | ab43577a31b56bb451d1abc3eb9da2e8afc12509 (diff) |
MLKForm: Add method -subforms.
-rw-r--r-- | MLKForm.h | 2 | ||||
-rw-r--r-- | MLKForm.m | 99 |
2 files changed, 99 insertions, 2 deletions
@@ -41,6 +41,8 @@ +(id) formWithObject:(id)object inContext:(MLKLexicalContext *)context forCompiler:(id)compiler; + +-(NSArray *) subforms; @end @@ -78,6 +78,11 @@ inContext:context forCompiler:compiler]); } + +-(NSArray *) subforms +{ + return [NSArray array]; +} @end @@ -93,8 +98,6 @@ @implementation MLKSelfEvaluatingForm -// FIXME - +(Class) dispatchClassForObject:(id)object { return self; @@ -246,6 +249,11 @@ { [self processBody:object inContext:_context]; } + +-(NSArray *) subforms +{ + return _bodyForms; +} @end @@ -260,6 +268,11 @@ [self splitDeclarationsAndBody:object]; return _declarations; } + +-(NSArray *) subforms +{ + return [[super subforms] arrayByAddingObjectsFromArray:_declarationForms]; +} @end @@ -278,6 +291,11 @@ LASSIGN (_argumentForms, [_tail array]); return self; } + +-(NSArray *) subforms +{ + return [[super subforms] arrayByAddingObjectsFromArray:_argumentForms]; +} @end @@ -289,6 +307,12 @@ LASSIGN (_bodyForms, [[_tail cdr] array]); return self; } + +-(NSArray *) subforms +{ + return [[[super subforms] arrayByAddingObject:_tagForm] + arrayByAddingObjectsFromArray:_bodyForms]; +} @end @@ -400,6 +424,11 @@ LASSIGN (_lambdaForm, MAKE_FORM ([_tail car])); return self; } + +-(NSArray *) subforms +{ + return [[super subforms] arrayByAddingObject:_lambdaForm]; +} @end @@ -422,6 +451,13 @@ LASSIGN (_alternativeForm, MAKE_FORM ([[[_tail cdr] cdr] car])); return self; } + +-(NSArray *) subforms +{ + return [[[[super subforms] arrayByAddingObject:_conditionForm] + arrayByAddingObject:_consequentForm] + arrayByAddingObject:_alternativeForm]; +} @end @@ -539,6 +575,11 @@ inContext:newContext]; return self; } + +-(NSArray *) subforms +{ + return [[super subforms] arrayByAddingObjectsFromArray:_functionBindingForms]; +} @end @@ -579,6 +620,11 @@ inContext:newContext]; return self; } + +-(NSArray *) subforms +{ + return [[super subforms] arrayByAddingObjectsFromArray:_variableBindingForms]; +} @end @@ -621,6 +667,11 @@ [self processBody:[_tail cdr]]; return self; } + +-(NSArray *) subforms +{ + return [[super subforms] arrayByAddingObject:_functionForm]; +} @end @@ -643,6 +694,12 @@ [self processBody:[[_tail cdr] cdr]]; return self; } + +-(NSArray *) subforms +{ + return [[[super subforms] arrayByAddingObject:_variableListForm] + arrayByAddingObject:_valueListForm]; +} @end @@ -677,6 +734,11 @@ LASSIGN (_valueForms, valueForms); return self; } + +-(NSArray *) subforms +{ + return [[super subforms] arrayByAddingObjectsFromArray:_valueForms]; +} @end @@ -701,6 +763,11 @@ LASSIGN (_valueForms, valueForms); return self; } + +-(NSArray *) subforms +{ + return [[super subforms] arrayByAddingObjectsFromArray:_valueForms]; +} @end @@ -712,6 +779,12 @@ LASSIGN (_valueForm, MAKE_FORM ([[_tail cdr] car])); return self; } + +-(NSArray *) subforms +{ + return [[[super subforms] arrayByAddingObject:_variableForm] + arrayByAddingObject:_valueForm]; +} @end @@ -723,6 +796,12 @@ LASSIGN (_valueForm, MAKE_FORM ([[_tail cdr] car])); return self; } + +-(NSArray *) subforms +{ + return [[[super subforms] arrayByAddingObject:_functionNameForm] + arrayByAddingObject:_valueForm]; +} @end @@ -734,6 +813,12 @@ LASSIGN (_valueForm, MAKE_FORM ([[_tail cdr] car])); return self; } + +-(NSArray *) subforms +{ + return [[[super subforms] arrayByAddingObject:_tagForm] + arrayByAddingObject:_valueForm]; +} @end @@ -745,6 +830,11 @@ [self processBody:[_tail cdr]]; return self; } + +-(NSArray *) subforms +{ + return [[super subforms] arrayByAddingObject:_protectedForm]; +} @end @@ -804,6 +894,11 @@ return self; } + +-(NSArray *) subforms +{ + return [[super subforms] arrayByAddingObject:_valueForm]; +} @end |