public void interpret( Scenario s, DomainContext c ) throws LemRuntimeException { context = c; ActionBlock block = s.getActionBlock(); executeBlock( block, c );   Iterator i = createdThreads.iterator(); while ( i.hasNext() ) { InstanceInterpreter thread = ( InstanceInterpreter ) i.next(); instanceInterpreters.add(thread); thread.setScenario(s) ; while ( true ) { try { thread.join(); } catch ( InterruptedException e ) { continue; } break; } }  context = null; createdThreads = null; }
public void interpret( Procedure p, DomainContext c ) throws LemRuntimeException { context = c;  LocalContext stateContext = new LocalContext( c ); Variable selfVar = VariableFactory.newVariable( ObjectReferenceType.getInstance(), currentObject ); stateContext.addVariable( "self" , selfVar ) ;  ActionBlock block = p.getActionBlock(); executeBlock( block, stateContext ); stateContext.finish();  context = null; }
	public void interpret( Scenario s, DomainContext c ) throws LemRuntimeException {		context = c;		ActionBlock block = s.getActionBlock();		executeBlock( block, c );				// wait for all created threads.		Iterator i = createdThreads.iterator();		while ( i.hasNext() ) {			InstanceInterpreter thread = ( InstanceInterpreter ) i.next();			instanceInterpreters.add(thread);			thread.setScenario(s) ;			while ( true ) {				try {					thread.join();				} catch ( InterruptedException e ) {					continue;				}				break;			}		}				context = null; // ensure no other entry point tries to use this		createdThreads = null;	}