//
//  EXPAssignmentElement.h
//  dde
//
//  Created by Ashley on 21/07/2007.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "EXPBinOp.h"

@class EXPAssignmentOp;
@class EXPError;

//void compileIndexLoopHeader(EXPVirtualMachine *machine, int nIndices, NSArray *indices, unsigned int *branchAddresses, unsigned int *loopAddresses);
//void compileIndexLoopFooter(EXPVirtualMachine *machine, int nIndices, NSArray *indices, unsigned int *branchAddresses, unsigned int *loopAddresses);
int EXPAssignmentSortFunction(EXPAssignmentOp *assignment1, EXPAssignmentOp *assignment2, void *context);
int EXPAssignmentSortFunction2(void *context, EXPAssignmentOp **assignment1, EXPAssignmentOp **assignment2);

@interface EXPAssignmentOp : EXPBinOp {
	BOOL _isInitialiser;
//	NSMutableArray *_rightHandSideList;
//	Change this to mutable set? Rename it...
	NSMutableArray *_dependencies;
}

- (id) initWithLeft:(id)left right:(id)right/* primes:(int)nPrimes*/;
- (void) setIsInitialiser:(BOOL)isInitialiser;
- (BOOL) isInitialiser;

- (void) addRight:(id)right;

- (void) setDependencies:(id)dependencies;
- (id) dependencies;
- (void) addDependency:(EXPExpression *)dependency;
// - (BOOL) dependsUpon:(EXPAuxiliaryElement *)var;
- (void) storeDependencies;
- (BOOL) dependsUpon:(EXPAssignmentOp *)assignment withLookup:(NSDictionary *)lookup;

- (void) coerce:(EXPError *)error;

- (id) indices;
- (void) setIndices:(id)indices;

@end