
# fileIn("s8/library/scripting/Steps.st")
smalltalk.addClass("StepsObject",smalltalk.EventManager,["id"],"Steps")
setattr(smalltalk.StepsObject,"$classVariableNames","LastID")

setattr(smalltalk.StepsObject,"$comment","""
		Instances are part of Steps framework, can trigger events and maintain a reference ID.
	""")

smalltalk.bind(smalltalk.StepsObject.__class__,"constructEventsTriggered",0
,smalltalk.__f__("""(self):
	#StepsObject class>>#constructEventsTriggered
	return smalltalk.object_comma_(smalltalk.newArray(["needsID"]),smalltalk.superReceiver(smalltalk.StepsObject.__class__,self).constructEventsTriggered()) 
""","StepsObject_class_constructEventsTriggered")
,"events","""constructEventsTriggered
	" Private - Return the events managed by instances of the receiver. "

	^#(	needsID
	) ,super constructEventsTriggered""",nil)

smalltalk.bind(smalltalk.StepsObject.__class__,"newID",0
,smalltalk.__f__("""(self):
	#StepsObject class>>#newID
	if smalltalk.b(smalltalk.isNil_(smalltalk.StepsObject.classVariableAt_("LastID"))):
		smalltalk.StepsObject.classVariableAt_put_("LastID",smalltalk.Number(0)) 
	 
	smalltalk.StepsObject.classVariableAt_put_("LastID",smalltalk.StepsObject.classVariableAt_("LastID")._plus(smalltalk.Number(1))) 
	return smalltalk.StepsObject.classVariableAt_("LastID") 
""","StepsObject_class_newID")
,"id","""newID
	" Private - Returns a new/unique ID to reference an instance of the receiver. "

	LastID isNil ifTrue: [ LastID := 0 ].
	LastID := LastID + 1.
	^LastID """,nil)

smalltalk.bind(smalltalk.StepsObject,"initializeId",0
,smalltalk.__f__("""(self):
	#StepsObject>>#initializeId
	def __blk1__():
		return (self).__class__.newID() 
	smalltalk.basic_at_put(self,"@id",self.triggerEvent_ifNotHandled_(smalltalk.String("needsID"),smalltalk.blk(__blk1__,0))) 
	return self 
""","StepsObject_initializeId")
,"initialize","""initializeId
	" Private - Initialize the id of the receiver. "

	id := self
		triggerEvent: #needsID
		ifNotHandled: [ self class newID ] """,nil)

smalltalk.bind(smalltalk.StepsObject,"id",0
,smalltalk.__f__("""(self):
	#StepsObject>>#id
	if smalltalk.b(smalltalk.isNil_(getattr(self,"@id",nil))):
		self.initializeId() 
	 
	return getattr(self,"@id",nil) 
""","StepsObject_id")
,"accessing","""id
	" Returns the id of the receiver. "

	id isNil ifTrue: [ self initializeId ].
	^id """,nil)

smalltalk.bind(smalltalk.StepsObject,"descriptionForBinding:",0
,smalltalk.__f__("""(self,aBinding):
	#StepsObject>>#descriptionForBinding:
	__0__=smalltalk.newContext()
	__0__.text=nil
	__0__.max=nil
	__0__.max=smalltalk.Number(30) 
	__0__.text=self.descriptionForValue_(aBinding.value()) 
	if smalltalk.b(__0__.text.size()._gt(__0__.max)):
		__0__.text=smalltalk.object_comma_(__0__.text.copyFrom_to_(smalltalk.Number(1),__0__.max._minus(smalltalk.Number(3))),smalltalk.String("...")) 
	 
	return smalltalk.object_comma_(smalltalk.object_comma_(aBinding.key(),smalltalk.String(" := ")),__0__.text) 
""","StepsObject_descriptionForBinding_")
,"ui","""descriptionForBinding: aBinding
	" Private - Returns a (short) description of aBinding. "

	| text max |
	max := 30.
	text := self descriptionForValue: aBinding value.
	text size > max ifTrue: [ text := (text copyFrom: 1 to: max - 3) ,'...'].
	^aBinding key ,' := ' ,text """,nil)

smalltalk.bind(smalltalk.StepsObject,"descriptionForValue:",0
,smalltalk.__f__("""(self,anObject):
	_s8Ret_=smalltalk.newContext()
	try:
		#StepsObject>>#descriptionForValue:
		__0__=smalltalk.newContext()
		def __blk1__():
			__0__.text=self.toString_(anObject)
			return __0__.text 
		def __blk2__(ex):
			return smalltalk.raise_result_(_s8Ret_,smalltalk.object_comma_(smalltalk.String("Note: "),ex.messageText())) 
		__0__.text=nil
		if smalltalk.b(smalltalk.isNil_(anObject)):
			smalltalk.raise_result_(_s8Ret_,smalltalk.String("nil")) 
		 
		smalltalk.blk(__blk1__,0).on_do_(smalltalk.Exception,smalltalk.blk(__blk2__,1)) 
		if smalltalk.b(self.isObject_(anObject)):
			smalltalk.raise_result_(_s8Ret_,anObject.asLiteral()) 
		 
		smalltalk.raise_result_(_s8Ret_,__0__.text) 
	except Exception as __ex:
		if smalltalk.exception_at(__ex,_s8Ret_):
			return smalltalk.exceptionResult_(__ex)
		raise __ex
	
""","StepsObject_descriptionForValue_")
,"ui","""descriptionForValue: anObject
	" Private - Returns a (short) description of anObject. "

	| text |
	anObject isNil ifTrue: [ ^#nil ].

	[ text := self toString: anObject
	] on: Exception do: [:ex|
		^'Note: ' ,ex messageText
	].

	(self isObject: anObject) ifTrue: [ ^anObject asLiteral ].
	^text """,nil)

smalltalk.bind(smalltalk.StepsObject,"info",0
,smalltalk.__f__("""(self):
	#StepsObject>>#info
	return smalltalk.NativeHandle.support()._at_gt(self) 
""","StepsObject_info")
,"debug","""info
	" Returns the description of the receiver. "

	^NativeHandle support @> self """,nil)

smalltalk.addClass("SimulationBlock",smalltalk.S8Block,["simulator","method"],"Steps")

smalltalk.bind(smalltalk.SimulationBlock,"simulator:",0
,smalltalk.__f__("""(self,aSimulator):
	#SimulationBlock>>#simulator:
	__0__=smalltalk.newContext()
	__0__.tos=nil
	smalltalk.basic_at_put(self,"@simulator",aSimulator) 
	__0__.tos=aSimulator.topFrame() 
	if smalltalk.b(smalltalk.notNil_(__0__.tos)):
		smalltalk.basic_at_put(self,"@method",__0__.tos.method()) 
	 
	return self 
""","SimulationBlock_simulator_")
,"accessing","""simulator: aSimulator
	" Private - Set the receiver. "

	| tos |
	simulator := aSimulator.
	tos := aSimulator topFrame.
	tos notNil ifTrue: [ method := tos method ] """,nil)

smalltalk.bind(smalltalk.SimulationBlock,"node",0
,smalltalk.__f__("""(self):
	#SimulationBlock>>#node
	return getattr(self,"@node",nil) 
""","SimulationBlock_node")
,"accessing","""node
	" Private - Returns the node of the receiver. "

	^node """,nil)

smalltalk.bind(smalltalk.SimulationBlock,"context",0
,smalltalk.__f__("""(self):
	#SimulationBlock>>#context
	return getattr(self,"@context",nil) 
""","SimulationBlock_context")
,"accessing","""context
	" Private - Returns the activation context of the receiver. "

	^context """,nil)

smalltalk.bind(smalltalk.SimulationBlock,"source",0
,smalltalk.__f__("""(self):
	#SimulationBlock>>#source
	__0__=smalltalk.newContext()
	def __blk1__():
		return smalltalk.isObject_equalTo_(getattr(self,"@method",nil).source().size(),smalltalk.Number(0)) 
	def __blk2__():
		return getattr(self,"@method",nil).source().copyFrom_to_(__0__.interval.start().max_(smalltalk.Number(1)),__0__.interval.end()) 
	__0__.interval=nil
	if smalltalk.b(smalltalk.boolean_or_(smalltalk.isNil_(getattr(self,"@method",nil)),smalltalk.blk(__blk1__,0))):
		return nil 
	 
	__0__.interval=getattr(self,"@node",nil).sourceRange() 
	return smalltalk.if_true_false_(smalltalk.notNil_(__0__.interval),smalltalk.blk(__blk2__,0),nil) 
""","SimulationBlock_source")
,"accessing","""source
	" Return the source of the receiver (or nil). "

	| interval |
	(method isNil or: [ method source size = 0 ]) ifTrue: [ ^nil ].
	interval := node sourceRange.
	^interval notNil ifTrue: [
		method source
			copyFrom: (interval start max: 1)
			to: interval end
	] """,nil)

smalltalk.bind(smalltalk.SimulationBlock,"asLiteral",0
,smalltalk.__f__("""(self):
	#SimulationBlock>>#asLiteral
	__0__=smalltalk.newContext()
	def __blk1__():
		return __0__.result 
	def __blk2__():
		return smalltalk.superReceiver(smalltalk.SimulationBlock,self).asLiteral() 
	__0__.result=nil
	__0__.result=self.source() 
	return smalltalk.if_true_false_(smalltalk.notNil_(__0__.result),smalltalk.blk(__blk1__,0),smalltalk.blk(__blk2__,0)) 
""","SimulationBlock_asLiteral")
,"converting","""asLiteral
	" Return the receiver in literal notation. "

	| result |
	result := self source.
	^result notNil ifTrue: [ result ] ifFalse: [ super asLiteral ] """,nil)

smalltalk.bind(smalltalk.SimulationBlock,"asBlock",0
,smalltalk.__f__("""(self):
	#SimulationBlock>>#asBlock
	return smalltalk.S8Block.for_in_(getattr(self,"@node",nil),getattr(self,"@context",nil)) 
""","SimulationBlock_asBlock")
,"converting","""asBlock
	" Returns the receiver an an evaluable block. "

	^S8Block for: node in: context """,nil)

smalltalk.bind(smalltalk.SimulationBlock,"valueWithArguments:",0
,smalltalk.__f__("""(self,anArray):
	#SimulationBlock>>#valueWithArguments:
	def __blk1__(ctx):
		self.bindTo_in_(anArray,ctx) 
		return getattr(self,"@node",nil).inject_in_(getattr(self,"@simulator",nil),ctx) 
	smalltalk.S8Context.in_clear_do_(getattr(self,"@context",nil),smalltalk.object_comma_(self.arguments(),self.temporaries()),smalltalk.blk(__blk1__,1)) 
	return self 
""","SimulationBlock_valueWithArguments_")
,"evaluating","""valueWithArguments: anArray
	" Evaluate the receiver with parameters anArray.
	Result of evaluation is loaded on simulator value when finished.
	"

	S8Context
		in: context clear: self arguments ,self temporaries
		do: [:ctx|
			self bindTo: anArray in: ctx.
			node inject: simulator in: ctx
	]. """,nil)

smalltalk.bind(smalltalk.SimulationBlock,"ensure:",0
,smalltalk.__f__("""(self,aBlock):
	#SimulationBlock>>#ensure:
	self.bindTo_in_(smalltalk.newArray([]),getattr(self,"@context",nil)) 
	getattr(self,"@node",nil).inject_in_catch_curtail_finally_(getattr(self,"@simulator",nil),getattr(self,"@context",nil),nil,nil,aBlock) 
	return self 
""","SimulationBlock_ensure_")
,"evaluating","""ensure: aBlock
	" Return the result of evaluating the receiver.
	Execute aBlock after the receiver is executed.
	"

	self bindTo: #() in: context.
	node	inject: simulator in: context
		catch: nil curtail: nil
		finally: aBlock """,nil)

smalltalk.bind(smalltalk.SimulationBlock,"ifCurtailed:",0
,smalltalk.__f__("""(self,exceptionBlock):
	#SimulationBlock>>#ifCurtailed:
	self.bindTo_in_(smalltalk.newArray([]),getattr(self,"@context",nil)) 
	getattr(self,"@node",nil).inject_in_catch_curtail_finally_(getattr(self,"@simulator",nil),getattr(self,"@context",nil),nil,exceptionBlock,nil) 
	return self 
""","SimulationBlock_ifCurtailed_")
,"evaluating","""ifCurtailed: exceptionBlock
	" Return the result of evaluating the receiver.
	If evaluation is limited by exiting before completion, the exception block is evaluated.
	"

	self bindTo: #() in: context.
	node	inject: simulator in: context
		catch: nil curtail: exceptionBlock
		finally: nil """,nil)

smalltalk.bind(smalltalk.SimulationBlock,"on:do:",0
,smalltalk.__f__("""(self,anExceptionType,aBlock):
	#SimulationBlock>>#on:do:
	self.bindTo_in_(smalltalk.newArray([]),getattr(self,"@context",nil)) 
	getattr(self,"@node",nil).inject_in_catch_curtail_finally_(getattr(self,"@simulator",nil),getattr(self,"@context",nil),smalltalk.Association.key_value_(anExceptionType,aBlock),nil,nil) 
	return self 
""","SimulationBlock_on_do_")
,"evaluating","""on: anExceptionType do: aBlock
	" Return the result of evaluating the receiver catching exceptions. "

	self bindTo: #() in: context.
	node	inject: simulator in: context
		catch: (Association key: anExceptionType value: aBlock)
		curtail: nil finally: nil """,nil)

smalltalk.bind(smalltalk.SimulationBlock,"repeat",0
,smalltalk.__f__("""(self):
	#SimulationBlock>>#repeat
	def __blk1__():
		return smalltalk.true 
	def __blk2__():
		nil 
	getattr(self,"@simulator",nil).repeat_while_doing_then_(self,smalltalk.blk(__blk1__,0),nil,smalltalk.blk(__blk2__,0)) 
	return self 
""","SimulationBlock_repeat")
,"evaluating","""repeat
	" OBSOLETE - Evaluate the receiver repeatedly, ending only if the block forces some stopping condition. "

	simulator
		repeat: self while: [ true ]
		doing: nil then: [] """,nil)

smalltalk.bind(smalltalk.SimulationBlock,"whileFalse:",0
,smalltalk.__f__("""(self,aBlock):
	#SimulationBlock>>#whileFalse:
	def __blk1__():
		return smalltalk.isObject_equalTo_(smalltalk.false,getattr(self,"@simulator",nil).value()) 
	def __blk2__():
		return getattr(self,"@simulator",nil).value_(nil) 
	getattr(self,"@simulator",nil).repeat_while_doing_then_(self,smalltalk.blk(__blk1__,0),aBlock,smalltalk.blk(__blk2__,0)) 
	return self 
""","SimulationBlock_whileFalse_")
,"evaluating","""whileFalse: aBlock
	" Evaluate aBlock while the result of evaluating the receiver is false. "

	simulator
		repeat: self while: [ false = simulator value ]
		doing: aBlock then: [ simulator value: nil ] """,nil)

smalltalk.bind(smalltalk.SimulationBlock,"whileTrue:",0
,smalltalk.__f__("""(self,aBlock):
	#SimulationBlock>>#whileTrue:
	def __blk1__():
		return smalltalk.isObject_equalTo_(smalltalk.true,getattr(self,"@simulator",nil).value()) 
	def __blk2__():
		return getattr(self,"@simulator",nil).value_(nil) 
	getattr(self,"@simulator",nil).repeat_while_doing_then_(self,smalltalk.blk(__blk1__,0),aBlock,smalltalk.blk(__blk2__,0)) 
	return self 
""","SimulationBlock_whileTrue_")
,"evaluating","""whileTrue: aBlock
	" Evaluate aBlock while the result of evaluating the receiver is true. "

	simulator
		repeat: self while: [ true = simulator value ]
		doing: aBlock then: [ simulator value: nil ] """,nil)

smalltalk.bind(smalltalk.SimulationBlock,"isValuable",0
,smalltalk.__f__("""(self):
	#SimulationBlock>>#isValuable
	return smalltalk.true 
""","SimulationBlock_isValuable")
,"testing","""isValuable
	" Return true if the receiver can be evaluated. "

	^true""",nil)

smalltalk.bind(smalltalk.SimulationBlock,"asJSONObject",0
,smalltalk.__f__("""(self):
	#SimulationBlock>>#asJSONObject
	return self 
""","SimulationBlock_asJSONObject")
,"json","""asJSONObject
	" Return the receiver as a hash object. "

	^self""",nil)

smalltalk.addClass("SimulationStep",smalltalk.StepsObject,["source","action","context"],"Steps")

smalltalk.bind(smalltalk.SimulationStep,"source",0
,smalltalk.__f__("""(self):
	#SimulationStep>>#source
	return getattr(self,"@source",nil) 
""","SimulationStep_source")
,"accessing","""source
		" Return the source of the receiver. "
	
		^source""",nil)

smalltalk.bind(smalltalk.SimulationStep,"source:",0
,smalltalk.__f__("""(self,anObject):
	#SimulationStep>>#source:
	smalltalk.basic_at_put(self,"@source",anObject) 
	return self 
""","SimulationStep_source_")
,"accessing","""source: anObject
		" Set the source of the receiver. "
	
		source := anObject""",nil)

smalltalk.bind(smalltalk.SimulationStep,"action",0
,smalltalk.__f__("""(self):
	#SimulationStep>>#action
	return getattr(self,"@action",nil) 
""","SimulationStep_action")
,"accessing","""action
		" Return the action of the receiver. "
	
		^action""",nil)

smalltalk.bind(smalltalk.SimulationStep,"action:",0
,smalltalk.__f__("""(self,anObject):
	#SimulationStep>>#action:
	smalltalk.basic_at_put(self,"@action",anObject) 
	return self 
""","SimulationStep_action_")
,"accessing","""action: anObject
		" Set the action of the receiver. "
	
		action := anObject""",nil)

smalltalk.bind(smalltalk.SimulationStep,"context",0
,smalltalk.__f__("""(self):
	#SimulationStep>>#context
	return getattr(self,"@context",nil) 
""","SimulationStep_context")
,"accessing","""context
		" Return the context of the receiver. "
	
		^context""",nil)

smalltalk.bind(smalltalk.SimulationStep,"context:",0
,smalltalk.__f__("""(self,anObject):
	#SimulationStep>>#context:
	smalltalk.basic_at_put(self,"@context",anObject) 
	return self 
""","SimulationStep_context_")
,"accessing","""context: anObject
		" Set the context of the receiver. "
	
		context := anObject""",nil)

smalltalk.bind(smalltalk.SimulationStep.__class__,"for:doing:in:",0
,smalltalk.__f__("""(self,aNodeOrMethod,action,aContext):
	#SimulationStep class>>#for:doing:in:
	return self.new().initialize_doing_in_(aNodeOrMethod,action,aContext) 
""","SimulationStep_class_for_doing_in_")
,"instantiation","""for: aNodeOrMethod doing: action in: aContext
	" Return an instance of the receiver. "

	^self new initialize: aNodeOrMethod doing: action in: aContext """,nil)

smalltalk.bind(smalltalk.SimulationStep,"initialize:doing:in:",0
,smalltalk.__f__("""(self,aNodeOrMethod,aBlock,aContext):
	#SimulationStep>>#initialize:doing:in:
	smalltalk.basic_at_put(self,"@source",aNodeOrMethod) 
	smalltalk.basic_at_put(self,"@action",aBlock) 
	smalltalk.basic_at_put(self,"@context",aContext) 
	return self 
""","SimulationStep_initialize_doing_in_")
,"initialize","""initialize: aNodeOrMethod doing: aBlock in: aContext
	" Private - Initialize the receiver. "

	source := aNodeOrMethod.
	action := aBlock.
	context := aContext """,nil)

smalltalk.bind(smalltalk.SimulationStep,"evaluateWithArguments:",0
,smalltalk.__f__("""(self,anArray):
	#SimulationStep>>#evaluateWithArguments:
	return self.action().evaluateWithArguments_(anArray) 
""","SimulationStep_evaluateWithArguments_")
,"evaluating","""evaluateWithArguments: anArray
	" Return the result of evaluating the receiver. "

"self note: source class name ,$	,(JS@> source)."
	^self action evaluateWithArguments: anArray """,nil)

smalltalk.bind(smalltalk.SimulationStep,"sourceRange",0
,smalltalk.__f__("""(self):
	#SimulationStep>>#sourceRange
	def __blk1__():
		return smalltalk.responds_to_(getattr(self,"@source",nil),(smalltalk.String("sourceRange"))) 
	def __blk2__():
		return getattr(self,"@source",nil).sourceRange() 
	return smalltalk.if_true_false_(smalltalk.boolean_and_(smalltalk.notNil_(getattr(self,"@source",nil)),smalltalk.blk(__blk1__,0)),smalltalk.blk(__blk2__,0),nil) 
""","SimulationStep_sourceRange")
,"accessing","""sourceRange
	" Returns the source range of source (or nil). "

	^(source notNil and: [ source respondsTo: #sourceRange ])
		ifTrue: [ source sourceRange ] """,nil)

smalltalk.bind(smalltalk.SimulationStep,"sourceLimits",0
,smalltalk.__f__("""(self):
	#SimulationStep>>#sourceLimits
	__0__=smalltalk.newContext()
	def __blk1__():
		return smalltalk.Array.with_with_(__0__.range.start(),__0__.range.end()) 
	__0__.range=nil
	__0__.range=self.sourceRange() 
	return smalltalk.if_true_false_(smalltalk.notNil_(__0__.range),smalltalk.blk(__blk1__,0),nil) 
""","SimulationStep_sourceLimits")
,"accessing","""sourceLimits
	" Returns the source range limits of source (or nil). "

	| range |
	range := self sourceRange.
	^range notNil ifTrue: [ Array with: range start with: range end ] """,nil)

smalltalk.bind(smalltalk.SimulationStep,"bindings",0
,smalltalk.__f__("""(self):
	#SimulationStep>>#bindings
	__0__=smalltalk.newContext()
	def __blk1__(assoc):
		return __0__.array.add_(assoc) 
	__0__.array=nil
	if smalltalk.b(smalltalk.isNil_(getattr(self,"@context",nil))):
		return nil 
	 
	__0__.array=smalltalk.newArray([]) 
	getattr(self,"@context",nil).associationsDo_(smalltalk.blk(__blk1__,1)) 
	return __0__.array 
""","SimulationStep_bindings")
,"accessing","""bindings
	" Returns the bindings of the receiver (or nil). "

	| array |
	context isNil ifTrue: [ ^nil ].
	array := #().
	context associationsDo: [:assoc| array add: assoc ].
	^array """,nil)

smalltalk.bind(smalltalk.SimulationStep,"@","_at"
,smalltalk.__f__("""(self,key):
	_s8Ret_=smalltalk.newContext()
	try:
		#SimulationStep>>#@
		def __blk1__(assoc):
			def __blk2__():
				return smalltalk.raise_result_(_s8Ret_,assoc) 
			return smalltalk.if_true_false_(smalltalk.isObject_equalTo_(assoc.key(),key),smalltalk.blk(__blk2__,0),nil) 
		if smalltalk.b(smalltalk.isNil_(getattr(self,"@context",nil))):
			smalltalk.raise_result_(_s8Ret_,nil) 
		 
		getattr(self,"@context",nil).associationsDo_(smalltalk.blk(__blk1__,1)) 
		smalltalk.raise_result_(_s8Ret_,nil) 
	except Exception as __ex:
		if smalltalk.exception_at(__ex,_s8Ret_):
			return smalltalk.exceptionResult_(__ex)
		raise __ex
	
""","SimulationStep__at")
,"virtuals","""@ key
	" Returns the result of accessing the receiver at key (or nil). "

	context isNil ifTrue: [ ^nil ].
	context associationsDo: [:assoc|
		assoc key = key ifTrue: [ ^assoc ]
	].
	^nil """,nil)

smalltalk.bind(smalltalk.SimulationStep,"bindingAt:put:",0
,smalltalk.__f__("""(self,key,aValue):
	#SimulationStep>>#bindingAt:put:
	if smalltalk.b(smalltalk.isNil_(getattr(self,"@context",nil))):
		return nil 
	 
	return getattr(self,"@context",nil).at_put_(key,aValue) 
""","SimulationStep_bindingAt_put_")
,"accessing","""bindingAt: key put: aValue
	" Set the binding of the receiver. "

	context isNil ifTrue: [ ^nil ].
	^context at: key put: aValue """,nil)

smalltalk.bind(smalltalk.SimulationStep,"printString",0
,smalltalk.__f__("""(self):
	#SimulationStep>>#printString
	if not smalltalk.b(smalltalk.responds_to_(getattr(self,"@source",nil),(smalltalk.String("sourceRange")))):
		return smalltalk.superReceiver(smalltalk.SimulationStep,self).printString() 
	 
	return smalltalk.object_comma_(smalltalk.object_comma_(smalltalk.object_comma_(smalltalk.object_comma_(smalltalk.String("["),getattr(self,"@source",nil).asLiteral()),smalltalk.String("@")),getattr(self,"@source",nil).sourceRange()),smalltalk.String("]")) 
""","SimulationStep_printString")
,"printing","""printString
	" Return a printable representation of the receiver. "

	(source respondsTo: #sourceRange) ifFalse: [
		^super printString
	].
	^$[ ,source asLiteral ,$@ ,source sourceRange ,$] """,nil)

smalltalk.addClass("SimulationFrame",smalltalk.StepsObject,["method","steps","receiver","values","catcher","curtail","final"],"Steps")

smalltalk.bind(smalltalk.SimulationFrame,"method",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#method
	return getattr(self,"@method",nil) 
""","SimulationFrame_method")
,"accessing","""method
		" Return the method of the receiver. "
	
		^method""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"method:",0
,smalltalk.__f__("""(self,anObject):
	#SimulationFrame>>#method:
	smalltalk.basic_at_put(self,"@method",anObject) 
	return self 
""","SimulationFrame_method_")
,"accessing","""method: anObject
		" Set the method of the receiver. "
	
		method := anObject""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"steps",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#steps
	return getattr(self,"@steps",nil) 
""","SimulationFrame_steps")
,"accessing","""steps
		" Return the steps of the receiver. "
	
		^steps""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"steps:",0
,smalltalk.__f__("""(self,anObject):
	#SimulationFrame>>#steps:
	smalltalk.basic_at_put(self,"@steps",anObject) 
	return self 
""","SimulationFrame_steps_")
,"accessing","""steps: anObject
		" Set the steps of the receiver. "
	
		steps := anObject""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"receiver",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#receiver
	return getattr(self,"@receiver",nil) 
""","SimulationFrame_receiver")
,"accessing","""receiver
		" Return the receiver of the receiver. "
	
		^receiver""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"receiver:",0
,smalltalk.__f__("""(self,anObject):
	#SimulationFrame>>#receiver:
	smalltalk.basic_at_put(self,"@receiver",anObject) 
	return self 
""","SimulationFrame_receiver_")
,"accessing","""receiver: anObject
		" Set the receiver of the receiver. "
	
		receiver := anObject""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"values",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#values
	return getattr(self,"@values",nil) 
""","SimulationFrame_values")
,"accessing","""values
		" Return the values of the receiver. "
	
		^values""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"values:",0
,smalltalk.__f__("""(self,anObject):
	#SimulationFrame>>#values:
	smalltalk.basic_at_put(self,"@values",anObject) 
	return self 
""","SimulationFrame_values_")
,"accessing","""values: anObject
		" Set the values of the receiver. "
	
		values := anObject""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"catcher",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#catcher
	return getattr(self,"@catcher",nil) 
""","SimulationFrame_catcher")
,"accessing","""catcher
		" Return the catcher of the receiver. "
	
		^catcher""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"catcher:",0
,smalltalk.__f__("""(self,anObject):
	#SimulationFrame>>#catcher:
	smalltalk.basic_at_put(self,"@catcher",anObject) 
	return self 
""","SimulationFrame_catcher_")
,"accessing","""catcher: anObject
		" Set the catcher of the receiver. "
	
		catcher := anObject""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"curtail",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#curtail
	return getattr(self,"@curtail",nil) 
""","SimulationFrame_curtail")
,"accessing","""curtail
		" Return the curtail of the receiver. "
	
		^curtail""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"curtail:",0
,smalltalk.__f__("""(self,anObject):
	#SimulationFrame>>#curtail:
	smalltalk.basic_at_put(self,"@curtail",anObject) 
	return self 
""","SimulationFrame_curtail_")
,"accessing","""curtail: anObject
		" Set the curtail of the receiver. "
	
		curtail := anObject""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"final",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#final
	return getattr(self,"@final",nil) 
""","SimulationFrame_final")
,"accessing","""final
		" Return the final of the receiver. "
	
		^final""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"final:",0
,smalltalk.__f__("""(self,anObject):
	#SimulationFrame>>#final:
	smalltalk.basic_at_put(self,"@final",anObject) 
	return self 
""","SimulationFrame_final_")
,"accessing","""final: anObject
		" Set the final of the receiver. "
	
		final := anObject""",nil)

smalltalk.bind(smalltalk.SimulationFrame.__class__,"for:doing:",0
,smalltalk.__f__("""(self,aMethod,steps):
	#SimulationFrame class>>#for:doing:
	return self.new().initialize_doing_(aMethod,steps) 
""","SimulationFrame_class_for_doing_")
,"instantiation","""for: aMethod doing: steps
	" Return an instance of the receiver. "

	^self new initialize: aMethod doing: steps """,nil)

smalltalk.bind(smalltalk.SimulationFrame.__class__,"for:catch:curtail:finally:",0
,smalltalk.__f__("""(self,aMethod,catcher,curtail,final):
	#SimulationFrame class>>#for:catch:curtail:finally:
	def __blk1__(_s8_rec):
		_s8_rec.catcher_(catcher) 
		_s8_rec.curtail_(curtail) 
		_s8_rec.final_(final) 
		return _s8_rec.yourself() 
	return __blk1__(self.for_doing_(aMethod,smalltalk.newArray([]))) 
""","SimulationFrame_class_for_catch_curtail_finally_")
,"instantiation","""for: aMethod catch: catcher curtail: curtail finally: final
	" Return an instance of the receiver. "

	^(self for: aMethod doing: #())
		catcher: catcher;
		curtail: curtail;
		final: final;
		yourself """,nil)

smalltalk.bind(smalltalk.SimulationFrame,"initialize:doing:",0
,smalltalk.__f__("""(self,aMethod,array):
	#SimulationFrame>>#initialize:doing:
	smalltalk.basic_at_put(self,"@method",aMethod) 
	smalltalk.basic_at_put(self,"@steps",array.copy()) 
	return self 
""","SimulationFrame_initialize_doing_")
,"initialize","""initialize: aMethod doing: array
	" Private - Initialize the receiver. "

	method := aMethod.
	steps := array copy """,nil)

smalltalk.bind(smalltalk.SimulationFrame,"receiver:values:",0
,smalltalk.__f__("""(self,anObject,array):
	#SimulationFrame>>#receiver:values:
	smalltalk.basic_at_put(self,"@receiver",anObject) 
	smalltalk.basic_at_put(self,"@values",array) 
	return self 
""","SimulationFrame_receiver_values_")
,"accessing","""receiver: anObject values: array
	" Private - Set activation data. "

	receiver := anObject.
	values := array """,nil)

smalltalk.bind(smalltalk.SimulationFrame,"selector",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#selector
	return self.method().selector() 
""","SimulationFrame_selector")
,"accessing","""selector
	" Returns the selector of message sent. "

	^self method selector """,nil)

smalltalk.bind(smalltalk.SimulationFrame,"contents",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#contents
	def __blk1__():
		return smalltalk.newArray([]) 
	def __blk2__():
		return getattr(self,"@steps",nil) 
	return smalltalk.if_true_false_(smalltalk.isNil_(getattr(self,"@steps",nil)),smalltalk.blk(__blk1__,0),smalltalk.blk(__blk2__,0)) 
""","SimulationFrame_contents")
,"accessing","""contents
	" Returns the receiver's contents. "

	^steps isNil
		ifTrue: [ #() ]
		ifFalse: [ steps ] """,nil)

smalltalk.bind(smalltalk.SimulationFrame,"bindings",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#bindings
	def __blk1__():
		return getattr(self,"@steps",nil).first().bindings() 
	return smalltalk.if_true_false_(getattr(self,"@steps",nil).size()._gt(smalltalk.Number(0)),smalltalk.blk(__blk1__,0),nil) 
""","SimulationFrame_bindings")
,"accessing","""bindings
	" Returns the associations bound to the receiver (or nil). "

	^steps size > 0 ifTrue: [ steps first bindings ] """,nil)

smalltalk.bind(smalltalk.SimulationFrame,"bindingsInfo",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#bindingsInfo
	__0__=smalltalk.newContext()
	def __blk1__():
		def __blk2__(each):
			return smalltalk.Array.with_with_(each.key(),self.descriptionForBinding_(each)) 
		return smalltalk.Array.with_with_(getattr(self,"@steps",nil).first().id(),__0__.array.collect_(smalltalk.blk(__blk2__,1))) 
	__0__.array=nil
	__0__.array=self.bindings() 
	return smalltalk.if_true_false_(smalltalk.notNil_(__0__.array),smalltalk.blk(__blk1__,0),nil) 
""","SimulationFrame_bindingsInfo")
,"virtuals","""bindingsInfo
	" Returns the information for bindings of the receiver. "

	| array |
	array := self bindings.
	^array notNil ifTrue: [
		Array	with: steps first id
			with: (array collect: [:each|
				Array	with: each key
					with: (self descriptionForBinding: each)
			])
	] """,nil)

smalltalk.bind(smalltalk.SimulationFrame,"isEmpty",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#isEmpty
	return smalltalk.isObject_equalTo_(getattr(self,"@steps",nil).size(),smalltalk.Number(0)) 
""","SimulationFrame_isEmpty")
,"query","""isEmpty
	" Returns true if the receiver is empty. "

	^steps size = 0 """,nil)

smalltalk.bind(smalltalk.SimulationFrame,"peek",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#peek
	def __blk1__():
		return getattr(self,"@steps",nil).first() 
	return smalltalk.if_true_false_(getattr(self,"@steps",nil).size()._gt(smalltalk.Number(0)),smalltalk.blk(__blk1__,0),nil) 
""","SimulationFrame_peek")
,"stream","""peek
	" Returns the next action to evaluate (or nil). "

	^steps size > 0 ifTrue: [ steps first ]""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"next",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#next
	def __blk1__():
		return getattr(self,"@steps",nil).removeFirst() 
	return smalltalk.if_true_false_(getattr(self,"@steps",nil).size()._gt(smalltalk.Number(0)),smalltalk.blk(__blk1__,0),nil) 
""","SimulationFrame_next")
,"stream","""next
	" Returns and remove the next action to evaluate (or nil). "

	^steps size > 0 ifTrue: [ steps removeFirst ]""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"add:",0
,smalltalk.__f__("""(self,aStep):
	#SimulationFrame>>#add:
	return getattr(self,"@steps",nil).addFirst_(aStep) 
""","SimulationFrame_add_")
,"add","""add: aStep
	" Add an inmediate step to evaluate. "

	^steps addFirst: aStep """,nil)

smalltalk.bind(smalltalk.SimulationFrame,"restart:",0
,smalltalk.__f__("""(self,simulator):
	#SimulationFrame>>#restart:
	if not smalltalk.b(smalltalk.isObject_equalTo_(simulator.callStack().removeFirst(),self)):
		return self.error_(smalltalk.String("Broken stack")) 
	 
	simulator.send_to_withArguments_(self.selector(),self.receiver(),self.values()) 
	return self 
""","SimulationFrame_restart_")
,"stack","""restart: simulator
	" Private - Set simulator to restart the execution of the receiver.
	NOTE: the receiver will be (silently) removed from stack and a new frame activation will occur for the original message.
	"

	simulator callStack removeFirst = self ifFalse: [ ^self error: 'Broken stack' ].
	simulator
		send: self selector to: self receiver
		withArguments: self values """,nil)

smalltalk.bind(smalltalk.SimulationFrame,"execute:for:",0
,smalltalk.__f__("""(self,step,simulator):
	#SimulationFrame>>#execute:for:
	def __blk1__():
		return step.evaluateWith_(simulator) 
	def __blk2__(ex):
		return simulator.handleException_(ex) 
	smalltalk.blk(__blk1__,0).on_do_(smalltalk.Exception,smalltalk.blk(__blk2__,1)) 
	return self 
""","SimulationFrame_execute_for_")
,"execute","""execute: step for: simulator
	" Private - Capture execution of step in simulator. "

	[ step evaluateWith: simulator
	] on: Exception do: [:ex|
		simulator	handleException: ex
	]""",nil)

smalltalk.bind(smalltalk.SimulationFrame,"printString",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#printString
	if smalltalk.b(smalltalk.isNil_(getattr(self,"@method",nil))):
		return smalltalk.superReceiver(smalltalk.SimulationFrame,self).printString() 
	 
	return smalltalk.object_comma_(smalltalk.object_comma_(getattr(self,"@method",nil).classField().asLiteral(),smalltalk.String("~>")),getattr(self,"@method",nil).selector().asLiteral()) 
""","SimulationFrame_printString")
,"printing","""printString
	" Return a printable representation of the receiver. "

	method isNil ifTrue: [ ^super printString ].
	^method classField asLiteral ,#~> ,method selector asLiteral """,nil)

smalltalk.bind(smalltalk.SimulationFrame,"methodInfo",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#methodInfo
	def __blk1__():
		return smalltalk.Array.with_with_with_(getattr(self,"@method",nil).classField().name(),getattr(self,"@method",nil).selector(),getattr(self,"@method",nil).source()) 
	return smalltalk.if_true_false_(smalltalk.notNil_(getattr(self,"@method",nil)),smalltalk.blk(__blk1__,0),nil) 
""","SimulationFrame_methodInfo")
,"virtuals","""methodInfo
	" Private - Returns the information to catch for the method (or nil). "

	^method notNil ifTrue: [
		Array	with: method classField name 
			with: method selector
			with: method source
	] """,nil)

smalltalk.bind(smalltalk.SimulationFrame,"stepIDs",0
,smalltalk.__f__("""(self):
	#SimulationFrame>>#stepIDs
	def __blk1__(each):
		return each.id() 
	return self.steps().collect_(smalltalk.blk(__blk1__,1)) 
""","SimulationFrame_stepIDs")
,"virtuals","""stepIDs
	" Private - Returns an array with steps IDs. "

	^self steps collect: [:each| each id ] """,nil)

smalltalk.bind(smalltalk.SimulationFrame,"@","_at"
,smalltalk.__f__("""(self,key):
	#SimulationFrame>>#@
	__0__=smalltalk.newContext()
	def __blk1__(one):
		return smalltalk.isObject_equalTo_(one.id(),__0__.anID) 
	def __blk2__():
		nil 
	__0__.anID=nil
	__0__.anID=key.asNumber() 
	return self.steps().detect_ifNone_(smalltalk.blk(__blk1__,1),smalltalk.blk(__blk2__,0)) 
""","SimulationFrame__at")
,"virtuals","""@ key
	" Returns the result of accessing the receiver at key (or nil). "

	| anID |
	anID := key asNumber.
	^self steps detect: [:one| one id = anID ] ifNone: [] """,nil)

smalltalk.addClass("S8Simulator",smalltalk.StepsObject,["callStack","value","state","shortcuts","scriptCompiler","breakpoints"],"Steps")
setattr(smalltalk.S8Simulator,"$classVariableNames","InUse")

smalltalk.bind(smalltalk.S8Simulator,"initializeCallStack",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#initializeCallStack
	smalltalk.basic_at_put(self,"@callStack",smalltalk.Array.new()) 
	return self 
""","S8Simulator_initializeCallStack")
,"initialize","""initializeCallStack
		" Private - Initialize the callStack of the receiver. "
	
		callStack := Array new""",nil)

smalltalk.bind(smalltalk.S8Simulator,"callStack",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#callStack
	if smalltalk.b(smalltalk.isNil_(getattr(self,"@callStack",nil))):
		self.initializeCallStack() 
	 
	return getattr(self,"@callStack",nil) 
""","S8Simulator_callStack")
,"accessing","""callStack
		" Return the callStack of the receiver. "
	
		callStack isNil ifTrue: [ self initializeCallStack ].
		^callStack""",nil)

smalltalk.bind(smalltalk.S8Simulator,"initializeBreakpoints",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#initializeBreakpoints
	smalltalk.basic_at_put(self,"@breakpoints",smalltalk.Array.new()) 
	return self 
""","S8Simulator_initializeBreakpoints")
,"initialize","""initializeBreakpoints
		" Private - Initialize the breakpoints of the receiver. "
	
		breakpoints := Array new""",nil)

smalltalk.bind(smalltalk.S8Simulator,"breakpoints",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#breakpoints
	if smalltalk.b(smalltalk.isNil_(getattr(self,"@breakpoints",nil))):
		self.initializeBreakpoints() 
	 
	return getattr(self,"@breakpoints",nil) 
""","S8Simulator_breakpoints")
,"accessing","""breakpoints
		" Return the breakpoints of the receiver. "
	
		breakpoints isNil ifTrue: [ self initializeBreakpoints ].
		^breakpoints""",nil)

smalltalk.bind(smalltalk.S8Simulator,"initializeScriptCompiler",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#initializeScriptCompiler
	smalltalk.basic_at_put(self,"@scriptCompiler",self.defaultScriptCompiler()) 
	return self 
""","S8Simulator_initializeScriptCompiler")
,"initialize","""initializeScriptCompiler
		" Private - Initialize the scriptCompiler of the receiver. "
	
		scriptCompiler := self defaultScriptCompiler""",nil)

smalltalk.bind(smalltalk.S8Simulator,"scriptCompiler",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#scriptCompiler
	if smalltalk.b(smalltalk.isNil_(getattr(self,"@scriptCompiler",nil))):
		self.initializeScriptCompiler() 
	 
	return getattr(self,"@scriptCompiler",nil) 
""","S8Simulator_scriptCompiler")
,"accessing","""scriptCompiler
		" Return the scriptCompiler of the receiver. "
	
		scriptCompiler isNil ifTrue: [ self initializeScriptCompiler ].
		^scriptCompiler""",nil)

smalltalk.bind(smalltalk.S8Simulator,"scriptCompiler:",0
,smalltalk.__f__("""(self,anObject):
	#S8Simulator>>#scriptCompiler:
	smalltalk.basic_at_put(self,"@scriptCompiler",anObject) 
	return self 
""","S8Simulator_scriptCompiler_")
,"accessing","""scriptCompiler: anObject
		" Set the scriptCompiler of the receiver. "
	
		scriptCompiler := anObject""",nil)

smalltalk.bind(smalltalk.S8Simulator,"initializeShortcuts",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#initializeShortcuts
	def __blk1__():
		return smalltalk.PoolDictionary.new() 
	smalltalk.basic_at_put(self,"@shortcuts",self.triggerEvent_ifNotHandled_(smalltalk.String("needsShortcuts"),smalltalk.blk(__blk1__,0))) 
	return self 
""","S8Simulator_initializeShortcuts")
,"initialize","""initializeShortcuts
		" Private - Initialize the shortcuts of the receiver. "
	
		shortcuts := self
			triggerEvent: #needsShortcuts
			ifNotHandled: [ PoolDictionary new ]""",nil)

smalltalk.bind(smalltalk.S8Simulator,"shortcuts",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#shortcuts
	if smalltalk.b(smalltalk.isNil_(getattr(self,"@shortcuts",nil))):
		self.initializeShortcuts() 
	 
	return getattr(self,"@shortcuts",nil) 
""","S8Simulator_shortcuts")
,"accessing","""shortcuts
		" Return the shortcuts of the receiver. "
	
		shortcuts isNil ifTrue: [ self initializeShortcuts ].
		^shortcuts""",nil)

smalltalk.bind(smalltalk.S8Simulator,"shortcuts:",0
,smalltalk.__f__("""(self,anObject):
	#S8Simulator>>#shortcuts:
	smalltalk.basic_at_put(self,"@shortcuts",anObject) 
	return self 
""","S8Simulator_shortcuts_")
,"accessing","""shortcuts: anObject
		" Set the shortcuts of the receiver. "
	
		shortcuts := anObject""",nil)

smalltalk.setVarNames(smalltalk.S8Simulator.__class__,smalltalk.newArray(["current","useScripting"]))

smalltalk.bind(smalltalk.S8Simulator.__class__,"current",0
,smalltalk.__f__("""(self):
	#S8Simulator class>>#current
	return getattr(self,"@current",nil) 
""","S8Simulator_class_current")
,"accessing","""current
		" Return the current of the receiver. "
	
		^current""",nil)

smalltalk.bind(smalltalk.S8Simulator.__class__,"current:",0
,smalltalk.__f__("""(self,anObject):
	#S8Simulator class>>#current:
	smalltalk.basic_at_put(self,"@current",anObject) 
	return self 
""","S8Simulator_class_current_")
,"accessing","""current: anObject
		" Set the current of the receiver. "
	
		current := anObject""",nil)

smalltalk.bind(smalltalk.S8Simulator.__class__,"initializeUseScripting",0
,smalltalk.__f__("""(self):
	#S8Simulator class>>#initializeUseScripting
	smalltalk.basic_at_put(self,"@useScripting",smalltalk.false) 
	return self 
""","S8Simulator_class_initializeUseScripting")
,"initialize","""initializeUseScripting
		" Private - Initialize the useScripting of the receiver. "
	
		useScripting := false""",nil)

smalltalk.bind(smalltalk.S8Simulator.__class__,"useScripting",0
,smalltalk.__f__("""(self):
	#S8Simulator class>>#useScripting
	if smalltalk.b(smalltalk.isNil_(getattr(self,"@useScripting",nil))):
		self.initializeUseScripting() 
	 
	return getattr(self,"@useScripting",nil) 
""","S8Simulator_class_useScripting")
,"accessing","""useScripting
		" Return the useScripting of the receiver. "
	
		useScripting isNil ifTrue: [ self initializeUseScripting ].
		^useScripting""",nil)

smalltalk.bind(smalltalk.S8Simulator.__class__,"useScripting:",0
,smalltalk.__f__("""(self,anObject):
	#S8Simulator class>>#useScripting:
	smalltalk.basic_at_put(self,"@useScripting",anObject) 
	return self 
""","S8Simulator_class_useScripting_")
,"accessing","""useScripting: anObject
		" Set the useScripting of the receiver. "
	
		useScripting := anObject""",nil)

smalltalk.bind(smalltalk.S8Simulator.__class__,"example",0
,smalltalk.__f__("""(self):
	#S8Simulator class>>#example
	self.open_(smalltalk.String("self halt. 3 + 4 ")).run() 
	return self 
""","S8Simulator_class_example")
,"example","""example
	" DEBUG - Open an instance with a simple expression. "

	(self open: 'self halt. 3 + 4 ') run """,nil)

smalltalk.bind(smalltalk.S8Simulator.__class__,"open:",0
,smalltalk.__f__("""(self,initializer):
	#S8Simulator class>>#open:
	return self.new().open_(initializer) 
""","S8Simulator_class_open_")
,"ui","""open: initializer
	" Returns an instance opened with initializer. "

	^self new open: initializer """,nil)

smalltalk.bind(smalltalk.S8Simulator.__class__,"run:",0
,smalltalk.__f__("""(self,initializer):
	#S8Simulator class>>#run:
	return self.open_(initializer).run() 
""","S8Simulator_class_run_")
,"ui","""run: initializer
	" Returns an instance opened with initializer. "

	^(self open: initializer) run """,nil)

smalltalk.bind(smalltalk.S8Simulator.__class__,"constructEventsTriggered",0
,smalltalk.__f__("""(self):
	#S8Simulator class>>#constructEventsTriggered
	return smalltalk.object_comma_(smalltalk.newArray(["aboutToOpen:","opened","ready","paused","breakpoint:","aboutToRun","atEnd","aboutToClose","closed","valueChanged:","enter:","enter:with:","exit:","exit:with:","aboutToExit:","activateMethod:","activateNative:","activateBlock:","deactivateBlock:","terminate:","discard:","aboutToExecute:","executed:","needsShortcuts","getShortcuts:"]),smalltalk.superReceiver(smalltalk.S8Simulator.__class__,self).constructEventsTriggered()) 
""","S8Simulator_class_constructEventsTriggered")
,"events","""constructEventsTriggered
	" Private - Return the events managed by instances of the receiver. "

	^#(	aboutToOpen: opened
		ready paused breakpoint:
		aboutToRun atEnd
		aboutToClose closed
		valueChanged:
		enter: enter:with:
		exit: exit:with: aboutToExit:
		activateMethod: activateNative:
		activateBlock: deactivateBlock:
		terminate: discard:
		aboutToExecute: executed:
		needsShortcuts getShortcuts:
	) ,super constructEventsTriggered""",nil)

smalltalk.bind(smalltalk.S8Simulator.__class__,"inUse",0
,smalltalk.__f__("""(self):
	#S8Simulator class>>#inUse
	if smalltalk.b(smalltalk.isNil_(smalltalk.S8Simulator.classVariableAt_("InUse"))):
		smalltalk.S8Simulator.classVariableAt_put_("InUse",smalltalk.PoolDictionary.new()) 
	 
	return smalltalk.S8Simulator.classVariableAt_("InUse") 
""","S8Simulator_class_inUse")
,"accessing","""inUse
	" Returns the pool of open instances of the receiver. "

	InUse isNil ifTrue: [ InUse := PoolDictionary new ].
	^InUse""",nil)

smalltalk.bind(smalltalk.S8Simulator.__class__,"@","_at"
,smalltalk.__f__("""(self,key):
	#S8Simulator class>>#@
	return self.inUse()._at(key.asNumber()) 
""","S8Simulator_class__at")
,"accessing","""@ key
	" Returns the information given at key (or nil). "

	^self inUse @ key asNumber """,nil)

smalltalk.bind(smalltalk.S8Simulator.__class__,"empty",0
,smalltalk.__f__("""(self):
	#S8Simulator class>>#empty
	return self.open_(nil) 
""","S8Simulator_class_empty")
,"instantiation","""empty
	" Returns a fresh instance of the receiver. "

	^self open: nil """,nil)

smalltalk.bind(smalltalk.S8Simulator.__class__,"reset",0
,smalltalk.__f__("""(self):
	#S8Simulator class>>#reset
	smalltalk.S8Simulator.classVariableAt_put_("LastID",smalltalk.S8Simulator.classVariableAt_put_("InUse",nil)) 
	return self 
""","S8Simulator_class_reset")
,"private","""reset
	" Reset the receiver. "

	LastID := InUse := nil """,nil)

smalltalk.bind(smalltalk.S8Simulator,"defaultScriptCompiler",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#defaultScriptCompiler
	if smalltalk.b((self).__class__.useScripting()):
		return smalltalk.Smalltalk.at_(smalltalk.String("ScriptCompiler")) 
	 
	return smalltalk.Compiler 
""","S8Simulator_defaultScriptCompiler")
,"defaults","""defaultScriptCompiler
	" Returns the default script compiler for the receiver. "

	self class useScripting ifTrue: [
		^Smalltalk at: #ScriptCompiler
	].
	^Compiler """,nil)

smalltalk.bind(smalltalk.S8Simulator,"value",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#value
	return getattr(self,"@value",nil) 
""","S8Simulator_value")
,"accessing","""value
	" Returns the value of the receiver. "

	^value """,nil)

smalltalk.bind(smalltalk.S8Simulator,"value:",0
,smalltalk.__f__("""(self,aValue):
	#S8Simulator>>#value:
	smalltalk.basic_at_put(self,"@value",aValue) 
	self.triggerEvent_with_(smalltalk.String("valueChanged:"),aValue) 
	return self 
""","S8Simulator_value_")
,"accessing","""value: aValue
	" Set the value of the receiver. "

	value := aValue.
	self triggerEvent: #valueChanged: with: aValue """,nil)

smalltalk.bind(smalltalk.S8Simulator,"breakpointFromString:",0
,smalltalk.__f__("""(self,aString):
	_s8Ret_=smalltalk.newContext()
	try:
		#S8Simulator>>#breakpointFromString:
		if smalltalk.b(aString.includes_(smalltalk.String(">>"))):
			def __blk1__():
				return smalltalk.raise_result_(_s8Ret_,aString.fileIn()) 
			smalltalk.if_true_false_(aString.upTo_(smalltalk.String(">>")).trimBlanks().notEmpty(),smalltalk.blk(__blk1__,0),nil) 
		 
		smalltalk.raise_result_(_s8Ret_,aString) 
	except Exception as __ex:
		if smalltalk.exception_at(__ex,_s8Ret_):
			return smalltalk.exceptionResult_(__ex)
		raise __ex
	
""","S8Simulator_breakpointFromString_")
,"breakpoints","""breakpointFromString: aString
	" Private - Returns a breakpoint specified by aString. "

	(aString includes: #>>) ifTrue: [
		(aString upTo: #>>) trimBlanks notEmpty ifTrue: [
			^aString fileIn
		].
	].
	^aString """,nil)

smalltalk.bind(smalltalk.S8Simulator,"breakpoints:",0
,smalltalk.__f__("""(self,array):
	#S8Simulator>>#breakpoints:
	def __blk1__():
		def __blk2__(each):
			def __blk3__():
				return self.breakpointFromString_(each) 
			def __blk4__():
				return each 
			return smalltalk.if_true_false_(each.isString(),smalltalk.blk(__blk3__,0),smalltalk.blk(__blk4__,0)) 
		return array.collect_(smalltalk.blk(__blk2__,1)) 
	smalltalk.basic_at_put(self,"@breakpoints",smalltalk.if_true_false_(smalltalk.notNil_(array),smalltalk.blk(__blk1__,0),nil)) 
	return self 
""","S8Simulator_breakpoints_")
,"accessing","""breakpoints: array
	" Set the breakpoints of the receiver. "

	breakpoints := array notNil ifTrue: [
		array collect: [:each|
			each isString
			ifTrue: [ self breakpointFromString: each ]
			ifFalse: [ each ]
		]
	]""",nil)

smalltalk.bind(smalltalk.S8Simulator,"isEmpty",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#isEmpty
	return smalltalk.isObject_equalTo_(getattr(self,"@callStack",nil).size(),smalltalk.Number(0)) 
""","S8Simulator_isEmpty")
,"query","""isEmpty
	" Returns true if the receiver is empty. "

	^callStack size = 0 """,nil)

smalltalk.bind(smalltalk.S8Simulator,"size",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#size
	return getattr(self,"@callStack",nil).size() 
""","S8Simulator_size")
,"accessing","""size
	" Return the size of the receiver. "

	^callStack size """,nil)

smalltalk.bind(smalltalk.S8Simulator,"topFrame",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#topFrame
	def __blk1__():
		return getattr(self,"@callStack",nil).first() 
	return smalltalk.if_true_false_(smalltalk.booleanNot_(self.isEmpty()),smalltalk.blk(__blk1__,0),nil) 
""","S8Simulator_topFrame")
,"accessing","""topFrame
	" Returns the frame at top (or nil). "

	^self isEmpty not ifTrue: [ callStack first ] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"bindings",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#bindings
	def __blk1__():
		return smalltalk.Array.with_(smalltalk.String("result")._minus_gt(self.value())) 
	return smalltalk.if_true_false_(self.atEnd(),smalltalk.blk(__blk1__,0),nil) 
""","S8Simulator_bindings")
,"accessing","""bindings
	" Returns the bindings of the receiver (or nil).
	Note: it is nil or an Array with result (when finished).
	"

	^self atEnd ifTrue: [ Array with: #result -> self value ] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"bindingKeys",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#bindingKeys
	__0__=smalltalk.newContext()
	def __blk1__():
		def __blk2__(each):
			return each.key() 
		return __0__.array.collect_(smalltalk.blk(__blk2__,1)) 
	__0__.array=nil
	__0__.array=self.bindings() 
	return smalltalk.if_true_false_(smalltalk.notNil_(__0__.array),smalltalk.blk(__blk1__,0),nil) 
""","S8Simulator_bindingKeys")
,"virtuals","""bindingKeys
	" Returns the keys for bindings of the receiver. "

	| array |
	array := self bindings.
	^array notNil ifTrue: [ array collect: [:each| each key ] ] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"topFrameID",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#topFrameID
	__0__=smalltalk.newContext()
	def __blk1__():
		return __0__.part.id() 
	__0__.part=nil
	__0__.part=self.topFrame() 
	return smalltalk.if_true_false_(smalltalk.notNil_(__0__.part),smalltalk.blk(__blk1__,0),nil) 
""","S8Simulator_topFrameID")
,"virtuals","""topFrameID
	" Returns the ID of the frame at top (or nil). "

	| part |
	part := self topFrame.
	^part notNil ifTrue: [ part id ]""",nil)

smalltalk.bind(smalltalk.S8Simulator,"callStackIDs",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#callStackIDs
	def __blk1__(each):
		return each.id() 
	return self.callStack().collect_(smalltalk.blk(__blk1__,1)) 
""","S8Simulator_callStackIDs")
,"virtuals","""callStackIDs
	" Returns the IDs of the callStack elements. "

	^self callStack collect: [:each| each id ] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"needsWorkTo:",0
,smalltalk.__f__("""(self,aFrame):
	#S8Simulator>>#needsWorkTo:
	def __blk1__():
		return smalltalk.isObject_equalTo_(getattr(self,"@callStack",nil).first(),aFrame)._8not() 
	return smalltalk.boolean_and_(self.includes_(aFrame),smalltalk.blk(__blk1__,0)) 
""","S8Simulator_needsWorkTo_")
,"accessing","""needsWorkTo: aFrame
	" Returns true when more work must be done to reach aFrame on top of stack. "

	^(self includes: aFrame) and: [ callStack first ~= aFrame ] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"needsWorkToID:",0
,smalltalk.__f__("""(self,aFrameID):
	#S8Simulator>>#needsWorkToID:
	return self.needsWorkTo_(self._at(aFrameID)) 
""","S8Simulator_needsWorkToID_")
,"virtuals","""needsWorkToID: aFrameID
	" Returns true when more work must be done to reach aFrame on top of stack. "

	^self needsWorkTo: self @ aFrameID """,nil)

smalltalk.bind(smalltalk.S8Simulator,"frames",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#frames
	def __blk1__(each):
		return each.asLiteral() 
	return self.callStack().collect_(smalltalk.blk(__blk1__,1)) 
""","S8Simulator_frames")
,"accessing","""frames
	" Returns a snapshot of the frames of the receiver. "

	^self callStack collect: [:each| each asLiteral ] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"@","_at"
,smalltalk.__f__("""(self,key):
	#S8Simulator>>#@
	__0__=smalltalk.newContext()
	def __blk1__(one):
		return smalltalk.isObject_equalTo_(one.id(),__0__.anID) 
	def __blk2__():
		nil 
	__0__.anID=nil
	if smalltalk.b(smalltalk.isObject_equalTo_(key,smalltalk.String("result"))):
		return smalltalk.String("result")._minus_gt(self.value()) 
	 
	__0__.anID=key.asNumber() 
	return self.callStack().detect_ifNone_(smalltalk.blk(__blk1__,1),smalltalk.blk(__blk2__,0)) 
""","S8Simulator__at")
,"virtuals","""@ key
	" Returns the result of accessing the receiver at key (or nil). "

	| anID |
	key = #result ifTrue: [ ^#result -> self value ].

	anID := key asNumber.
	^self callStack detect: [:one| one id = anID ] ifNone: [] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"removeTop",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#removeTop
	__0__=smalltalk.newContext()
	def __blk1__(_s8_rec):
		_s8_rec.triggerEvent_with_(smalltalk.String("exit:"),__0__.aMethod) 
		return _s8_rec.triggerEvent_with_with_(smalltalk.String("exit:with:"),__0__.aMethod,getattr(self,"@value",nil)) 
	__0__.frame=nil
	__0__.aMethod=nil
	if smalltalk.b(self.isEmpty()):
		return nil 
	 
	__0__.frame=getattr(self,"@callStack",nil).removeFirst() 
	__0__.aMethod=__0__.frame.method() 
	__blk1__(self) 
	self.curtail_finally_(__0__.frame.curtail(),__0__.frame.final()) 
	return self 
""","S8Simulator_removeTop")
,"stack","""removeTop
	" Remove the method at top of call stack. "

	| frame aMethod |
	self isEmpty ifTrue: [ ^nil ].
	frame := callStack removeFirst.
	aMethod := frame method.
	self	triggerEvent: #exit: with: aMethod;
		triggerEvent: #exit:with: with: aMethod with: value.
	self curtail: frame curtail finally: frame final """,nil)

smalltalk.bind(smalltalk.S8Simulator,"handleException:",0
,smalltalk.__f__("""(self,exception):
	_s8Ret_=smalltalk.newContext()
	try:
		#S8Simulator>>#handleException:
		__0__=smalltalk.newContext()
		def __blk1__(each):
			return self.catcher_canHandle_(each.catcher(),exception) 
		def __blk2__():
			return smalltalk.raise_result_(_s8Ret_,self.error_(smalltalk.object_comma_(smalltalk.String("Uncaptured exception "),exception.description()))) 
		def __blk3__(_s8_rec):
			_s8_rec.discard_(__0__.handler) 
			return _s8_rec.removeTop() 
		__0__.handler=nil
		__0__.handler=getattr(self,"@callStack",nil).detect_ifNone_(smalltalk.blk(__blk1__,1),smalltalk.blk(__blk2__,0)) 
		__blk3__(self) 
		__0__.handler.catcher().value().evaluateWith_(exception) 
		smalltalk.raise_result_(_s8Ret_,self) 
	except Exception as __ex:
		if smalltalk.exception_at(__ex,_s8Ret_):
			return smalltalk.exceptionResult_(__ex)
		raise __ex
	
""","S8Simulator_handleException_")
,"exceptions","""handleException: exception
	" Private - Leave activated frames handling captured exception "

	| handler |
	handler := callStack detect: [:each|
		self catcher: each catcher canHandle: exception
	] ifNone: [ ^self error: 'Uncaptured exception ' ,exception description ].
	self discard: handler; removeTop.
	handler catcher value evaluateWith: exception. """,nil)

smalltalk.bind(smalltalk.S8Simulator,"catcher:canHandle:",0
,smalltalk.__f__("""(self,assoc,exception):
	#S8Simulator>>#catcher:canHandle:
	def __blk1__():
		def __blk2__():
			nil 
		return smalltalk.blk(__blk2__,0).exception_matches_(exception,assoc.key()) 
	return smalltalk.boolean_and_(smalltalk.notNil_(assoc),smalltalk.blk(__blk1__,0)) 
""","S8Simulator_catcher_canHandle_")
,"exceptions","""catcher: assoc canHandle: exception
	" Private - Returns true if catcher assoc can handle exception "

	^assoc notNil and: [
		[] exception: exception matches: assoc key
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"peek",0
,smalltalk.__f__("""(self):
	_s8Ret_=smalltalk.newContext()
	try:
		#S8Simulator>>#peek
		__0__=smalltalk.newContext()
		def __blk1__():
			if smalltalk.b(self.isEmpty()):
				smalltalk.raise_result_(_s8Ret_,nil) 
			 
			__0__.result=self.topFrame().peek() 
			return smalltalk.isNil_(__0__.result) 
		__0__.result=nil
		while smalltalk.b(smalltalk.blk(__blk1__,0)()):
			self.removeTop() 
		 
		smalltalk.raise_result_(_s8Ret_,__0__.result) 
	except Exception as __ex:
		if smalltalk.exception_at(__ex,_s8Ret_):
			return smalltalk.exceptionResult_(__ex)
		raise __ex
	
""","S8Simulator_peek")
,"stream","""peek
	" Returns the next action to evaluate (or nil). "

	| result |
	[	self isEmpty ifTrue: [ ^nil ].
		result := self topFrame peek.
		result isNil
	] whileTrue: [ self removeTop ].
	^result""",nil)

smalltalk.bind(smalltalk.S8Simulator,"peekID",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#peekID
	__0__=smalltalk.newContext()
	def __blk1__():
		return smalltalk.Array.with_with_(__0__.top.id(),__0__.part.id()) 
	__0__.top=nil
	__0__.part=nil
	__0__.top=self.topFrame() 
	if smalltalk.b(smalltalk.isNil_(__0__.top)):
		return nil 
	 
	__0__.part=__0__.top.peek() 
	return smalltalk.if_true_false_(smalltalk.notNil_(__0__.part),smalltalk.blk(__blk1__,0),nil) 
""","S8Simulator_peekID")
,"virtuals","""peekID
	" Returns the ID of next action to evaluate (or nil). "

	| top part |
	top := self topFrame.
	top isNil ifTrue: [ ^nil ].
	part := top peek.
	^part notNil ifTrue: [ Array with: top id with: part id ]""",nil)

smalltalk.bind(smalltalk.S8Simulator,"peekSource",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#peekSource
	__0__=smalltalk.newContext()
	def __blk1__():
		return __0__.step.source() 
	__0__.step=nil
	__0__.step=self.peek() 
	return smalltalk.if_true_false_(smalltalk.notNil_(__0__.step),smalltalk.blk(__blk1__,0),nil) 
""","S8Simulator_peekSource")
,"accessing","""peekSource
	" Returns the source of next step (or nil). "

	| step |
	step := self peek.
	^step notNil ifTrue: [ step source ]""",nil)

smalltalk.bind(smalltalk.S8Simulator,"hasMessage",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#hasMessage
	__0__=smalltalk.newContext()
	def __blk1__():
		return __0__.node.isMessageNode() 
	__0__.node=nil
	__0__.node=self.peekSource() 
	return smalltalk.boolean_and_(smalltalk.responds_to_(__0__.node,(smalltalk.String("isMessageNode"))),smalltalk.blk(__blk1__,0)) 
""","S8Simulator_hasMessage")
,"query","""hasMessage
	" Returns true when the next action to evaluate is a message send. "

	| node |
	node := self peekSource.
	^(node respondsTo: #isMessageNode) and: [ node isMessageNode ] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"peekSourceID",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#peekSourceID
	__0__=smalltalk.newContext()
	def __blk1__():
		return __0__.source.sourceRange() 
	def __blk2__():
		return smalltalk.String("none") 
	__0__.source=nil
	__0__.hash=nil
	__0__.source=self.peekSource() 
	if smalltalk.b(smalltalk.isNil_(__0__.source)):
		return nil 
	 
	__0__.hash=smalltalk.if_true_false_(smalltalk.responds_to_(__0__.source,(smalltalk.String("sourceRange"))),smalltalk.blk(__blk1__,0),smalltalk.blk(__blk2__,0)) 
	return smalltalk.Array.with_with_((__0__.source).__class__.name(),smalltalk.to_String(__0__.hash)) 
""","S8Simulator_peekSourceID")
,"accessing","""peekSourceID
	" Returns the ID of current source (or nil). "

	| source hash |
	source := self peekSource.
	source isNil ifTrue: [ ^nil ].
	hash := (source respondsTo: #sourceRange)
		ifTrue: [ source sourceRange ]
		ifFalse: [ #none ].
	^Array	with: source class name
		with: hash toString """,nil)

smalltalk.bind(smalltalk.S8Simulator,"stepsOn:hasSource:",0
,smalltalk.__f__("""(self,aFrame,node):
	_s8Ret_=smalltalk.newContext()
	try:
		#S8Simulator>>#stepsOn:hasSource:
		def __blk1__(each):
			def __blk2__():
				return smalltalk.raise_result_(_s8Ret_,smalltalk.true) 
			return smalltalk.if_true_false_(smalltalk.isObject_equalTo_(each.source(),node),smalltalk.blk(__blk2__,0),nil) 
		aFrame.steps().do_(smalltalk.blk(__blk1__,1)) 
		smalltalk.raise_result_(_s8Ret_,smalltalk.false) 
	except Exception as __ex:
		if smalltalk.exception_at(__ex,_s8Ret_):
			return smalltalk.exceptionResult_(__ex)
		raise __ex
	
""","S8Simulator_stepsOn_hasSource_")
,"query","""stepsOn: aFrame hasSource: node
	" Private - Returns true if the source is on sources to execute for frame. "

	aFrame steps do: [:each| each source = node ifTrue: [ ^true ] ].
	^false """,nil)

smalltalk.bind(smalltalk.S8Simulator,"includes:",0
,smalltalk.__f__("""(self,aFrame):
	#S8Simulator>>#includes:
	return self.callStack().includes_(aFrame) 
""","S8Simulator_includes_")
,"query","""includes: aFrame
	" Returns true if the callStack includes frame. "

	^self callStack includes: aFrame """,nil)

smalltalk.bind(smalltalk.S8Simulator,"includesID:",0
,smalltalk.__f__("""(self,aFrameID):
	#S8Simulator>>#includesID:
	return self.includes_(self._at(aFrameID)) 
""","S8Simulator_includesID_")
,"query","""includesID: aFrameID
	" Returns true if the callStack includes frame with id aFrameID. "

	^self includes: self @ aFrameID """,nil)

smalltalk.bind(smalltalk.S8Simulator,"execute:in:",0
,smalltalk.__f__("""(self,step,frame):
	#S8Simulator>>#execute:in:
	frame.execute_for_(step,self) 
	return self 
""","S8Simulator_execute_in_")
,"execute","""execute: step in: frame
	" Private - Evaluate the step in the frame (actually on top of callstack). "

	frame execute: step for: self""",nil)

smalltalk.bind(smalltalk.S8Simulator,"atEnd",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#atEnd
	return smalltalk.isNil_(self.peek()) 
""","S8Simulator_atEnd")
,"stream","""atEnd
	" Returns true if the receiver is at end. "

	^self peek isNil """,nil)

smalltalk.bind(smalltalk.S8Simulator,"next",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#next
	__0__=smalltalk.newContext()
	__0__.tos=nil
	__0__.step=nil
	if smalltalk.b(self.atEnd()):
		return smalltalk.false 
	 
	smalltalk.basic_at_put(self,"@state",smalltalk.String("running")) 
	__0__.tos=self.topFrame() 
	__0__.step=__0__.tos.next() 
	self.triggerEvent_with_(smalltalk.String("aboutToExecute:"),__0__.step) 
	self.execute_in_(__0__.step,__0__.tos) 
	self.triggerEvent_with_(smalltalk.String("executed:"),__0__.step) 
	return smalltalk.b_(not(getattr(self,"@state",nil) is smalltalk.String("paused"))) 
""","S8Simulator_next")
,"stream","""next
	" Evaluate the next action in the receiver; returns true when it is expected to continue execution. "

	| tos step |
	self atEnd ifTrue: [ ^false ].
	state := #running.
	tos := self topFrame.
	step := tos next.
	self triggerEvent: #aboutToExecute: with: step.
	self execute: step in: tos.
	self triggerEvent: #executed: with: step.
	^state ~~ #paused """,nil)

smalltalk.bind(smalltalk.S8Simulator,"open:",0
,smalltalk.__f__("""(self,initializer):
	#S8Simulator>>#open:
	return self.open_on_(initializer,nil) 
""","S8Simulator_open_")
,"gui","""open: initializer
	" Open the receiver to execute initializer. "

	^self open: initializer on: nil """,nil)

smalltalk.bind(smalltalk.S8Simulator,"open:on:",0
,smalltalk.__f__("""(self,initializer,aReceiver):
	#S8Simulator>>#open:on:
	__0__=smalltalk.newContext()
	def __blk1__():
		return aReceiver 
	def __blk2__(_s8_rec):
		_s8_rec.triggerEvent_(smalltalk.String("opened")) 
		return _s8_rec.triggerEvent_(smalltalk.String("ready")) 
	__0__.rcv=nil
	__0__.rcv=smalltalk.if_true_false_(smalltalk.notNil_(aReceiver),smalltalk.blk(__blk1__,0),nil) 
	self.triggerEvent_with_(smalltalk.String("aboutToOpen:"),initializer) 
	(self).__class__.inUse().at_put_(self.id(),self) 
	(self).__class__.current_(self) 
	self.prepare_on_(initializer,__0__.rcv) 
	__blk2__(self) 
	return self 
""","S8Simulator_open_on_")
,"gui","""open: initializer on: aReceiver
	" Open the receiver to execute initializer. "

	| rcv |
	rcv := aReceiver notNil ifTrue: [ aReceiver ].
	self triggerEvent: #aboutToOpen: with: initializer.
	self class inUse at: self id put: self.
	self class current: self.
	self prepare: initializer on: rcv.
	self	triggerEvent: #opened;
		triggerEvent: #ready """,nil)

smalltalk.bind(smalltalk.S8Simulator,"close",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#close
	def __blk1__():
		nil 
	self.triggerEvent_(smalltalk.String("aboutToClose")) 
	(self).__class__.inUse().removeKey_ifAbsent_(self.id(),smalltalk.blk(__blk1__,0)) 
	smalltalk.basic_at_put(self,"@callStack",smalltalk.basic_at_put(self,"@value",nil)) 
	self.triggerEvent_(smalltalk.String("closed")) 
	return smalltalk.true 
""","S8Simulator_close")
,"gui","""close
	" Close the receiver. "

	self triggerEvent: #aboutToClose.
	self class inUse removeKey: self id ifAbsent: [].
	callStack := value := nil.
	self triggerEvent: #closed.
	^true """,nil)

smalltalk.bind(smalltalk.S8Simulator,"runWhile:",0
,smalltalk.__f__("""(self,condition):
	_s8Ret_=smalltalk.newContext()
	try:
		#S8Simulator>>#runWhile:
		def __blk1__():
			def __blk2__():
				return self.next() 
			if smalltalk.b(self.atEnd()):
				smalltalk.raise_result_(_s8Ret_,self.triggerEvent_(smalltalk.String("atEnd"))) 
			 
			return smalltalk.boolean_and_(condition.value(),smalltalk.blk(__blk2__,0)) 
		self.triggerEvent_(smalltalk.String("aboutToRun")) 
		while smalltalk.b(smalltalk.blk(__blk1__,0)()):
			continue
		 
		smalltalk.raise_result_(_s8Ret_,self) 
	except Exception as __ex:
		if smalltalk.exception_at(__ex,_s8Ret_):
			return smalltalk.exceptionResult_(__ex)
		raise __ex
	
""","S8Simulator_runWhile_")
,"running","""runWhile: condition
	" Execute the receiver (until paused, empty or condition value is true). "

	self triggerEvent: #aboutToRun.
	[	self atEnd ifTrue: [ ^self triggerEvent: #atEnd ].
		condition value and: [ self next ]
	] whileTrue """,nil)

smalltalk.bind(smalltalk.S8Simulator,"run",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#run
	def __blk1__():
		return smalltalk.true 
	self.runWhile_(smalltalk.blk(__blk1__,0)) 
	return self 
""","S8Simulator_run")
,"running","""run
	" Start execution of the receiver (until paused or empty). "

	self runWhile: [ true ] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"stepIn",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#stepIn
	__0__=smalltalk.newContext()
	def __blk1__():
		return smalltalk.isObject_equalTo_(self.peekSource(),__0__.node) 
	__0__.top=nil
	__0__.node=nil
	__0__.node=self.peekSource() 
	if smalltalk.b(smalltalk.isNil_(__0__.node)):
		return nil 
	 
	__0__.top=self.topFrame() 
	self.runWhile_(smalltalk.blk(__blk1__,0)) 
	return self 
""","S8Simulator_stepIn")
,"actions","""stepIn
	" Step in current message sent. "

	| top node |
	node := self peekSource.
	node isNil ifTrue: [ ^nil ].
	top := self topFrame.
	self runWhile: [ self peekSource = node ] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"stepOver",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#stepOver
	__0__=smalltalk.newContext()
	def __blk1__():
		def __blk2__():
			return self.stepsOn_hasSource_(__0__.top,__0__.node) 
		return smalltalk.boolean_and_(self.includes_(__0__.top),smalltalk.blk(__blk2__,0)) 
	__0__.top=nil
	__0__.node=nil
	__0__.node=self.peekSource() 
	if smalltalk.b(smalltalk.isNil_(__0__.node)):
		return nil 
	 
	__0__.top=self.topFrame() 
	self.runWhile_(smalltalk.blk(__blk1__,0)) 
	return self 
""","S8Simulator_stepOver")
,"actions","""stepOver
	" Run until the current message is consumed. "

	| top node |
	node := self peekSource.
	node isNil ifTrue: [ ^nil ].
	top := self topFrame.
	self runWhile: [
		(self includes: top) and: [
			self stepsOn: top hasSource: node
		]
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"stepOut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#stepOut
	__0__=smalltalk.newContext()
	def __blk1__():
		return self.includes_(__0__.top) 
	__0__.top=nil
	__0__.top=self.topFrame() 
	if smalltalk.b(smalltalk.isNil_(__0__.top)):
		return nil 
	 
	self.runWhile_(smalltalk.blk(__blk1__,0)) 
	return self 
""","S8Simulator_stepOut")
,"actions","""stepOut
	" Run the receiver while current frame is still on the callStack. "

	| top |
	top := self topFrame.
	top isNil ifTrue: [ ^nil ].
	self runWhile: [ self includes: top ] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"pause",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#pause
	def __blk1__():
		self.triggerEvent_(smalltalk.String("paused")) 
		smalltalk.basic_at_put(self,"@state",smalltalk.String("paused"))
		return getattr(self,"@state",nil) 
	self.add_step_in_(smalltalk.String("pause"),smalltalk.blk(__blk1__,0),nil) 
	return self 
""","S8Simulator_pause")
,"running","""pause
	" Pause execution of the receiver. "

	self add: #pause step: [
		self triggerEvent: #paused.
		state := #paused
	] in: nil """,nil)

smalltalk.bind(smalltalk.S8Simulator,"prepare:on:",0
,smalltalk.__f__("""(self,initializer,rcv):
	#S8Simulator>>#prepare:on:
	def __blk1__():
		return smalltalk.isNil_(initializer) 
	if smalltalk.b(initializer.isMemberOf_(smalltalk.Message)):
		return self.send_to_withArguments_(initializer.selector(),initializer.receiver(),initializer.arguments()) 
	 
	if smalltalk.b(smalltalk.boolean_or_(smalltalk.booleanNot_(self.isObject_(initializer)),smalltalk.blk(__blk1__,0))):
		return self 
	 
	if smalltalk.b(initializer.isString()):
		__1__=smalltalk.newContext()
		__1__.cls=nil
		__1__.mth=nil
		__1__.cls=(rcv).__class__ 
		__1__.mth=__1__.cls.compiler().compiledMethodToEvaluate_in_(initializer,__1__.cls) 
		return self.callMethod_for_withArguments_(__1__.mth,rcv,smalltalk.newArray([])) 
	 
	return self.send_to_withArguments_(smalltalk.String("evaluate"),initializer,smalltalk.newArray([])) 
""","S8Simulator_prepare_on_")
,"initialize","""prepare: initializer on: rcv
	" Private - Initialize the receiver to execute initializer. "

	(initializer isMemberOf: Message) ifTrue: [
		^self	send: initializer selector
			to: initializer receiver
			withArguments: initializer arguments
	].
	((self isObject: initializer) not or: [initializer isNil]) ifTrue: [ ^self ].
	initializer isString ifTrue: [ | cls mth |
		cls := rcv class.
		mth := cls compiler
			compiledMethodToEvaluate: initializer
			in: cls.
		^self callMethod: mth for: rcv withArguments: #()
	].
	^self send: #evaluate to: initializer withArguments: #()""",nil)

smalltalk.bind(smalltalk.S8Simulator,"exit:",0
,smalltalk.__f__("""(self,aValue):
	#S8Simulator>>#exit:
	self.triggerEvent_with_(smalltalk.String("aboutToExit:"),aValue) 
	smalltalk.basic_at_put(self,"@value",aValue) 
	return self.removeTop() 
""","S8Simulator_exit_")
,"execute","""exit: aValue
	" Exit the execution of current method returning aValue. "

	self triggerEvent: #aboutToExit: with: aValue.
	value := aValue.
	^self removeTop """,nil)

smalltalk.bind(smalltalk.S8Simulator,"stack:remove:doing:",0
,smalltalk.__f__("""(self,eventName,aFrame,aBlock):
	#S8Simulator>>#stack:remove:doing:
	def __blk1__():
		def __blk2__():
			return smalltalk.isObject_equalTo_(aFrame,self.topFrame()) 
		return smalltalk.boolean_or_(self.isEmpty(),smalltalk.blk(__blk2__,0)) 
	while not smalltalk.b(smalltalk.blk(__blk1__,0)()):
		__1__=smalltalk.newContext()
		__1__.frame=nil
		__1__.frame=self.callStack().removeFirst() 
		self.triggerEvent_with_(eventName,__1__.frame) 
		aBlock.evaluateWith_(__1__.frame) 
	 
	return self 
""","S8Simulator_stack_remove_doing_")
,"stack","""stack: eventName remove: aFrame doing: aBlock
	" Private - Remove frames at top of the callStack until aFrame is found. "

	[  self isEmpty or: [aFrame = self topFrame] ] whileFalse: [ | frame |
		frame := self callStack removeFirst.
		self triggerEvent: eventName with: frame.
		aBlock evaluateWith: frame.
	]""",nil)

smalltalk.bind(smalltalk.S8Simulator,"removeTop:then:",0
,smalltalk.__f__("""(self,frames,aBlock):
	#S8Simulator>>#removeTop:then:
	def __blk1__():
		return self.terminate_then_(frames,aBlock) 
	self.removeTop() 
	self.add_step_in_(smalltalk.String("terminate"),smalltalk.blk(__blk1__,0),nil) 
	return self 
""","S8Simulator_removeTop_then_")
,"stack","""removeTop: frames then: aBlock
	" Private - Remove top of the callStack and continue terminating frames. "

	self removeTop.
	self add: #terminate step: [ self terminate: frames then: aBlock ] in: nil. """,nil)

smalltalk.bind(smalltalk.S8Simulator,"terminate:then:",0
,smalltalk.__f__("""(self,frames,aBlock):
	#S8Simulator>>#terminate:then:
	__0__=smalltalk.newContext()
	def __blk1__():
		return self.removeTop_then_(frames,aBlock) 
	__0__.frame=nil
	if smalltalk.b(frames.isEmpty()):
		return aBlock.evaluate() 
	 
	__0__.frame=frames.removeFirst() 
	if not smalltalk.b(smalltalk.isObject_equalTo_(self.topFrame(),__0__.frame)):
		self.error_(smalltalk.String("Broken call stack")) 
	 
	self.triggerEvent_with_ifNotHandled_(smalltalk.String("terminate:"),__0__.frame,smalltalk.blk(__blk1__,0)) 
	return self 
""","S8Simulator_terminate_then_")
,"stack","""terminate: frames then: aBlock
	" Private - Terminate the execution of frames at top of the callStack. "

	| frame |
	frames isEmpty ifTrue: [ ^aBlock evaluate ].
	frame := frames removeFirst.
	self topFrame = frame ifFalse: [ self error: 'Broken call stack' ].
	self triggerEvent: #terminate: with: frame ifNotHandled: [
		self removeTop: frames then: aBlock
	]. """,nil)

smalltalk.bind(smalltalk.S8Simulator,"discard:",0
,smalltalk.__f__("""(self,aFrame):
	#S8Simulator>>#discard:
	def __blk1__():
		return self.stack_remove_doing_(smalltalk.String("discard:"),aFrame,nil) 
	self.triggerEvent_with_ifNotHandled_(smalltalk.String("discard:"),aFrame,smalltalk.blk(__blk1__,0)) 
	return self 
""","S8Simulator_discard_")
,"stack","""discard: aFrame
	" Private - Discard the execution of frames at top of the callStack until aFrame is found. "

	self triggerEvent: #discard: with: aFrame ifNotHandled: [
		self stack: #discard: remove: aFrame doing: nil
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"curtail:finally:",0
,smalltalk.__f__("""(self,curtail,final):
	#S8Simulator>>#curtail:finally:
	if smalltalk.b(smalltalk.notNil_(curtail)):
		return curtail.ensure_(final) 
	 
	if smalltalk.b(smalltalk.notNil_(final)):
		final.ensure_(nil) 
	 
	return self 
""","S8Simulator_curtail_finally_")
,"private","""curtail: curtail finally: final
	" Private - Evaluate curtail & final blocks in current frame. "

	curtail notNil ifTrue: [ ^curtail ensure: final ].
	final notNil ifTrue: [ final ensure: nil ] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"restart:",0
,smalltalk.__f__("""(self,aFrame):
	#S8Simulator>>#restart:
	self.discard_(aFrame) 
	if smalltalk.b(self.isEmpty()):
		return nil 
	 
	aFrame.restart_(self) 
	return self 
""","S8Simulator_restart_")
,"stack","""restart: aFrame
	" Restart execution at start of aFrame. "

	self discard: aFrame.
	self isEmpty ifTrue: [ ^nil ].
	aFrame restart: self """,nil)

smalltalk.bind(smalltalk.S8Simulator,"restartID:",0
,smalltalk.__f__("""(self,aFrameID):
	#S8Simulator>>#restartID:
	return self.restart_(self._at(aFrameID)) 
""","S8Simulator_restartID_")
,"virtuals","""restartID: aFrameID
	" Restart execution at start of aFrame with id aFrameID. "

	^self restart: self @ aFrameID """,nil)

smalltalk.bind(smalltalk.S8Simulator,"return:in:then:",0
,smalltalk.__f__("""(self,aNode,aContext,aBlock):
	_s8Ret_=smalltalk.newContext()
	try:
		#S8Simulator>>#return:in:then:
		__0__=smalltalk.newContext()
		def __blk1__(frame):
			if smalltalk.b(smalltalk.isObject_equalTo_(__0__.tos,frame)):
				smalltalk.raise_result_(_s8Ret_,self.terminate_then_(__0__.all,aBlock)) 
			 
			return __0__.all.add_(frame) 
		__0__.tos=nil
		__0__.all=nil
		__0__.tos=aContext.home() 
		if smalltalk.b(smalltalk.isNil_(__0__.tos)):
			smalltalk.raise_result_(_s8Ret_,self.error_(smalltalk.String("Method context missing"))) 
		 
		__0__.all=smalltalk.newArray([]) 
		self.callStack().do_(smalltalk.blk(__blk1__,1)) 
		smalltalk.raise_result_(_s8Ret_,self.error_(smalltalk.object_comma_(smalltalk.object_comma_(smalltalk.String("Activation("),__0__.tos),smalltalk.String(") missing in call stack")))) 
	except Exception as __ex:
		if smalltalk.exception_at(__ex,_s8Ret_):
			return smalltalk.exceptionResult_(__ex)
		raise __ex
	
""","S8Simulator_return_in_then_")
,"execute","""return: aNode in: aContext then: aBlock
	" Prepare the receiver to return from method. "

	| tos all |
	tos := aContext home.
	tos isNil ifTrue: [ ^self error: 'Method context missing' ].
	all := #().
	self callStack do: [:frame|
		tos = frame ifTrue: [ ^self terminate: all then: aBlock ].
		all add: frame.
	].
	^self error: 'Activation(' ,tos ,') missing in call stack'""",nil)

smalltalk.bind(smalltalk.S8Simulator,"addAll:in:",0
,smalltalk.__f__("""(self,statements,aContext):
	#S8Simulator>>#addAll:in:
	def __blk1__(each):
		return self.add_in_(each,aContext) 
	statements.reverseDo_(smalltalk.blk(__blk1__,1)) 
	return self 
""","S8Simulator_addAll_in_")
,"execute","""addAll: statements in: aContext
	" Add steps to simulate statements in current method with aContext. "

	statements reverseDo: [:each| self add: each in: aContext ] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"activateBlock:catch:curtail:finally:",0
,smalltalk.__f__("""(self,aFrame,catcher,curtail,final):
	#S8Simulator>>#activateBlock:catch:curtail:finally:
	__0__=smalltalk.newContext()
	def __blk1__():
		def __blk2__():
			def __blk3__():
				return smalltalk.isObject_equalTo_(final,aFrame.final()) 
			return smalltalk.boolean_and_(smalltalk.isObject_equalTo_(curtail,aFrame.curtail()),smalltalk.blk(__blk3__,0)) 
		return smalltalk.boolean_and_(smalltalk.isObject_equalTo_(catcher,aFrame.catcher()),smalltalk.blk(__blk2__,0)) 
	__0__.tos=nil
	if smalltalk.b(smalltalk.boolean_and_(smalltalk.isObject_equalTo_(aFrame,self.topFrame()),smalltalk.blk(__blk1__,0))):
		return aFrame 
	 
	__0__.tos=smalltalk.SimulationFrame.for_catch_curtail_finally_(aFrame.method(),catcher,curtail,final) 
	self.callStack().addFirst_(__0__.tos) 
	self.triggerEvent_with_(smalltalk.String("activateBlock:"),__0__.tos) 
	return __0__.tos 
""","S8Simulator_activateBlock_catch_curtail_finally_")
,"execute","""activateBlock: aFrame catch: catcher curtail: curtail finally: final
	" Private - (re)Activate a method context to evaluate a block. "

	| tos |
	(aFrame = self topFrame
		and: [ catcher = aFrame catcher 
		and: [ curtail = aFrame curtail
		and: [ final = aFrame final ]]])
		ifTrue: [ ^aFrame ].
	tos := SimulationFrame
		for: aFrame method
		catch: catcher curtail: curtail finally: final.
	self callStack addFirst: tos.
	self triggerEvent: #activateBlock: with: tos.
	^tos """,nil)

smalltalk.bind(smalltalk.S8Simulator,"deactivateBlock:finally:",0
,smalltalk.__f__("""(self,aFrame,final):
	#S8Simulator>>#deactivateBlock:finally:
	self.triggerEvent_with_(smalltalk.String("deactivateBlock:"),aFrame) 
	self.curtail_finally_(nil,final) 
	return self 
""","S8Simulator_deactivateBlock_finally_")
,"execute","""deactivateBlock: aFrame finally: final
	" Private - Deactivate a block context that run up to end. "

	self triggerEvent: #deactivateBlock: with: aFrame.
	self curtail: nil finally: final """,nil)

smalltalk.bind(smalltalk.S8Simulator,"addBlock:contents:in:catch:curtail:finally:",0
,smalltalk.__f__("""(self,aNode,nodes,aContext,catcher,curtail,final):
	#S8Simulator>>#addBlock:contents:in:catch:curtail:finally:
	__0__=smalltalk.newContext()
	def __blk1__():
		return self.deactivateBlock_finally_(__0__.home,final) 
	__0__.home=nil
	__0__.tos=nil
	__0__.home=aContext.home() 
	__0__.tos=self.activateBlock_catch_curtail_finally_(__0__.home,catcher,curtail,final) 
	self.add_step_in_(aNode,smalltalk.blk(__blk1__,0),aContext) 
	self.addAll_in_(nodes,aContext) 
	return self 
""","S8Simulator_addBlock_contents_in_catch_curtail_finally_")
,"execute","""addBlock: aNode contents: nodes in: aContext
	catch: catcher curtail: curtail finally: final
	" Add steps to activate a block of statements with aContext. "

	| home tos |
	home := aContext home.
	tos := self
		activateBlock: home
		catch: catcher curtail: curtail
		finally: final.
	self	add: aNode
		step: [ self deactivateBlock: home finally: final ]
		in: aContext.
	self addAll: nodes in: aContext. """,nil)

smalltalk.bind(smalltalk.S8Simulator,"collect:all:in:",0
,smalltalk.__f__("""(self,aStatement,nodes,aContext):
	#S8Simulator>>#collect:all:in:
	__0__=smalltalk.newContext()
	def __blk1__():
		smalltalk.basic_at_put(self,"@value",__0__.array)
		return getattr(self,"@value",nil) 
	def __blk2__(each):
		def __blk3__():
			return __0__.array.add_(getattr(self,"@value",nil)) 
		self.add_step_in_(aStatement,smalltalk.blk(__blk3__,0),aContext) 
		return self.add_in_(each,aContext) 
	__0__.array=nil
	smalltalk.basic_at_put(self,"@value",smalltalk.newArray([])) 
	if smalltalk.b(nodes.isEmpty()):
		return self 
	 
	self.add_step_in_(aStatement,smalltalk.blk(__blk1__,0),aContext) 
	nodes.reverseDo_(smalltalk.blk(__blk2__,1)) 
	__0__.array=getattr(self,"@value",nil) 
	return self 
""","S8Simulator_collect_all_in_")
,"execute","""collect: aStatement all: nodes in: aContext
	" Add steps to simulate nodes in current method with aContext and collect results. "

	| array |
	value := #().
	nodes isEmpty ifTrue: [ ^self ].
	self add: aStatement step: [ value := array ] in: aContext.
	nodes reverseDo: [:each|
		self add: aStatement step: [ array add: value ] in: aContext.
		self add: each in: aContext
	].
	array := value.""",nil)

smalltalk.bind(smalltalk.S8Simulator,"add:step:in:",0
,smalltalk.__f__("""(self,aStatement,action,aContext):
	#S8Simulator>>#add:step:in:
	self.topFrame().add_(smalltalk.SimulationStep.for_doing_in_(aStatement,action,aContext)) 
	return self 
""","S8Simulator_add_step_in_")
,"execute","""add: aStatement step: action in: aContext
	" Add step to simulate aStatement in current method with aContext. "

	self topFrame add: (SimulationStep for: aStatement doing: action in: aContext) """,nil)

smalltalk.bind(smalltalk.S8Simulator,"add:steps:in:",0
,smalltalk.__f__("""(self,aStatement,array,aContext):
	#S8Simulator>>#add:steps:in:
	def __blk1__(action):
		return self.add_step_in_(aStatement,action,aContext) 
	array.reverseDo_(smalltalk.blk(__blk1__,1)) 
	return self 
""","S8Simulator_add_steps_in_")
,"execute","""add: aStatement steps: array in: aContext
	" Add steps to simulate aStatement in current method with aContext. "

	array reverseDo: [:action| self add: aStatement step: action in: aContext ] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"add:in:",0
,smalltalk.__f__("""(self,aStatement,aContext):
	#S8Simulator>>#add:in:
	return self.add_steps_in_(aStatement,aStatement.actionsIn_(aContext),aContext) 
""","S8Simulator_add_in_")
,"execute","""add: aStatement in: aContext
	" Add steps to simulate aStatement in current method with aContext. "

	^self	add: aStatement
		steps: (aStatement actionsIn: aContext)
		in: aContext""",nil)

smalltalk.bind(smalltalk.S8Simulator,"activateMethod:in:",0
,smalltalk.__f__("""(self,aFrame,aContext):
	#S8Simulator>>#activateMethod:in:
	if smalltalk.b(smalltalk.notNil_(aContext)):
		self.triggerEvent_with_(smalltalk.String("activateMethod:"),aFrame) 
		aContext.home_(aFrame) 
	 
	return self 
""","S8Simulator_activateMethod_in_")
,"activation","""activateMethod: aFrame in: aContext
	" Private - Activate the method context. "

	aContext notNil ifTrue: [
		self triggerEvent: #activateMethod: with: aFrame.
		aContext home: aFrame
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"enter:method:withAll:",0
,smalltalk.__f__("""(self,anObject,aMethod,steps):
	#S8Simulator>>#enter:method:withAll:
	__0__=smalltalk.newContext()
	def __blk1__(_s8_rec):
		_s8_rec.triggerEvent_with_(smalltalk.String("enter:"),aMethod) 
		return _s8_rec.triggerEvent_with_with_(smalltalk.String("enter:with:"),aMethod,anObject) 
	__0__.tos=nil
	__0__.tos=smalltalk.SimulationFrame.for_doing_(aMethod,steps) 
	self.callStack().addFirst_(__0__.tos) 
	__blk1__(self) 
	if smalltalk.b(steps.notEmpty()):
		self.activateMethod_in_(__0__.tos,steps.first().context()) 
	 
	return __0__.tos 
""","S8Simulator_enter_method_withAll_")
,"execute","""enter: anObject method: aMethod withAll: steps
	" Private - Activate execution of Method and returns the frame pushed on stack. "

	| tos |
	tos := SimulationFrame for: aMethod doing: steps.
	self callStack addFirst: tos.
	self	triggerEvent: #enter: with: aMethod;
		triggerEvent: #enter:with: with: aMethod with: anObject.
	steps notEmpty ifTrue: [
		self activateMethod: tos in: steps first context
	].
	^tos """,nil)

smalltalk.bind(smalltalk.S8Simulator,"evaluationScript",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#evaluationScript
	return self.scriptCompiler().evaluationScript() 
""","S8Simulator_evaluationScript")
,"private","""evaluationScript
	" Private - Return the support for skipping method execution. "

	^self scriptCompiler evaluationScript """,nil)

smalltalk.bind(smalltalk.S8Simulator,"scriptCompilerFor:",0
,smalltalk.__f__("""(self,aClass):
	#S8Simulator>>#scriptCompilerFor:
	__0__=smalltalk.newContext()
	__0__.support=nil
	__0__.support=self.scriptCompiler() 
	if smalltalk.b(smalltalk.isObject_equalTo_(__0__.support,smalltalk.Compiler)):
		return aClass.compiler() 
	 
	return __0__.support.for_(aClass) 
""","S8Simulator_scriptCompilerFor_")
,"private","""scriptCompilerFor: aClass
	" Private - Return the script compiler to use for aClass. "

	| support |
	support := self scriptCompiler.
	support = Compiler ifTrue: [ ^aClass compiler ].
	^support for: aClass """,nil)

smalltalk.bind(smalltalk.S8Simulator,"compiledScriptFor:",0
,smalltalk.__f__("""(self,aMethod):
	#S8Simulator>>#compiledScriptFor:
	__0__=smalltalk.newContext()
	def __blk1__():
		def __blk2__():
			return smalltalk.String("none") 
		return self.scriptCompilerFor_(aMethod.classField()).scriptForMethod_onError_(aMethod.source(),smalltalk.blk(__blk2__,0)) 
	def __blk3__():
		return __0__.script 
	__0__.script=nil
	if smalltalk.b(smalltalk.responds_to_(aMethod,(smalltalk.String("compiledScript")))):
		return aMethod.compiledScript() 
	 
	__0__.script=aMethod.basicAt_ifAbsentPut_(smalltalk.String("s8_compiledScript"),smalltalk.blk(__blk1__,0)) 
	return smalltalk.if_true_false_(smalltalk.isObject_equalTo_(__0__.script,smalltalk.String("none")),nil,smalltalk.blk(__blk3__,0)) 
""","S8Simulator_compiledScriptFor_")
,"private","""compiledScriptFor: aMethod
	" Private - Returns the compiled script of aMethod (or nil). "

	| script |
	(aMethod respondsTo: #compiledScript)
		ifTrue: [ ^aMethod compiledScript ].

	script := aMethod basicAt: #s8_compiledScript ifAbsentPut: [
		(self scriptCompilerFor: aMethod classField)
			scriptForMethod: aMethod source
			onError: [ #none ]
	].
	^script = #none ifFalse: [ script ] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"callMethod:for:withArguments:",0
,smalltalk.__f__("""(self,aMethod,anObject,array):
	#S8Simulator>>#callMethod:for:withArguments:
	__0__=smalltalk.newContext()
	__0__.steps=nil
	__0__.mth=nil
	if smalltalk.b(smalltalk.isNil_(aMethod)):
		return self.error_(smalltalk.String("Missing method")) 
	 
	__0__.mth=self.compiledScriptFor_(aMethod) 
	if smalltalk.b(smalltalk.notNil_(__0__.mth)):
		__1__=smalltalk.newContext()
		def __blk1__():
			__0__.steps=__1__.script.stepsFor_entering_withArguments_(anObject,__0__.mth,array)
			return __0__.steps 
		__1__.script=nil
		__1__.script=__0__.mth.script() 
		smalltalk.if_true_false_(smalltalk.notNil_(__1__.script),smalltalk.blk(__blk1__,0),nil) 
	 
	if smalltalk.b(smalltalk.isNil_(__0__.steps)):
		__0__.steps=self.stepsOver_for_withArguments_(aMethod,anObject,array) 
	 
	self.enter_method_withAll_(anObject,aMethod,__0__.steps).receiver_values_(anObject,array) 
	return self 
""","S8Simulator_callMethod_for_withArguments_")
,"execute","""callMethod: aMethod for: anObject withArguments: array
	" Call aMethod for anObject with given arguments. "

	| steps mth |
	aMethod isNil ifTrue: [ ^self error: 'Missing method' ].
	mth := self compiledScriptFor: aMethod.
	mth notNil ifTrue: [ | script |
		script := mth script.
		script notNil ifTrue: [
			steps := script
				stepsFor: anObject entering: mth
				withArguments: array.
		].
	].
	steps isNil ifTrue: [
		steps := self
			stepsOver: aMethod for: anObject
			withArguments: array.
	].
	(self enter: anObject method: aMethod withAll: steps)
		receiver: anObject values: array """,nil)

smalltalk.bind(smalltalk.S8Simulator,"stepsOver:for:withArguments:",0
,smalltalk.__f__('''(self,aMethod,aReceiver,array):
	#S8Simulator>>#stepsOver:for:withArguments:
	__0__=smalltalk.newContext()
	def __blk1__(each):
		def __blk2__():
			def __blk3__():
				return aMethod.messages().includes_(smalltalk.String("callableOf:")) 
			return smalltalk.boolean_and_(each.isMemberOf_(smalltalk.SimulationBlock),smalltalk.blk(__blk3__,0)) 
		def __blk4__():
			return self.note_(smalltalk.object_comma_(smalltalk.object_comma_(smalltalk.object_comma_(smalltalk.object_comma_(smalltalk.String("Step in method calling block "),each.asLiteral()),smalltalk.String("""
		Method """)),aMethod),smalltalk.String(""" needs edition to run.
		Edit inline expressions to avoid block activations"""))) 
		return smalltalk.if_true_false_(smalltalk.boolean_and_(self.isObject_(each),smalltalk.blk(__blk2__,0)),smalltalk.blk(__blk4__,0),nil) 
	def __blk5__(simulator):
		return aReceiver.basicPerform_withArguments_(aMethod.selector().asSelector(),array) 
	__0__.script=nil
	array.do_(smalltalk.blk(__blk1__,1)) 
	__0__.script=self.evaluationScript().doing_(smalltalk.blk(__blk5__,1)) 
	return __0__.script.stepsFor_entering_withArguments_(aReceiver,aMethod,array) 
''',"S8Simulator_stepsOver_for_withArguments_")
,"execute","""stepsOver: aMethod for: aReceiver withArguments: array
	" Private - The method do not have a script to evaluate.
	Return the steps to execute the method without entering script.
	"

	| script |
	array do: [:each| ((self isObject: each) and: [
		(each isMemberOf: SimulationBlock) and: [
		aMethod messages includes: #callableOf: ]]) ifTrue: [
			self note: 'Step in method calling block ' ,each asLiteral ,'
	Method ' ,aMethod ,' needs edition to run.
	Edit inline expressions to avoid block activations'
	] ].

	script := self evaluationScript doing: [:simulator|
		aReceiver
			basicPerform: aMethod selector asSelector
			withArguments: array
	].
	^script stepsFor: aReceiver entering: aMethod withArguments: array """,nil)

smalltalk.bind(smalltalk.S8Simulator,"shortcut:message:for:withArguments:",0
,smalltalk.__f__("""(self,aClass,selector,anObject,values):
	#S8Simulator>>#shortcut:message:for:withArguments:
	__0__=smalltalk.newContext()
	def __blk1__():
		return smalltalk.newArray([]) 
	def __blk2__(assoc):
		return assoc.key().evaluateWithArguments_(__0__.pair) 
	def __blk3__():
		return smalltalk.String("halt")._minus_gt(nil) 
	__0__.pool=nil
	__0__.pair=nil
	if not smalltalk.b(self.isObject_(anObject)):
		return nil 
	 
	__0__.pool=self.shortcuts() 
	if smalltalk.b(__0__.pool.isEmpty()):
		def __blk4__():
			return self.registerDefaultShortcuts() 
		self.triggerEvent_with_(smalltalk.String("getShortcuts:"),__0__.pool) 
		smalltalk.if_true_false_(__0__.pool.isEmpty(),smalltalk.blk(__blk4__,0),nil) 
	 
	__0__.pair=smalltalk.Array.with_with_(anObject,values) 
	return __0__.pool.at_ifAbsent_(selector,smalltalk.blk(__blk1__,0)).detect_ifNone_(smalltalk.blk(__blk2__,1),smalltalk.blk(__blk3__,0)).value() 
""","S8Simulator_shortcut_message_for_withArguments_")
,"shortcuts","""shortcut: aClass message: selector for: anObject withArguments: values
	" Private - Returns an action to handle an optimized message send (or nil). "

	| pool pair |
	(self isObject: anObject) ifFalse: [ ^nil ].
	pool := self shortcuts.
	pool isEmpty ifTrue: [
		self triggerEvent: #getShortcuts: with: pool.
		pool isEmpty ifTrue: [ self registerDefaultShortcuts ].
	].
	pair := Array with: anObject with: values.
	^((pool at: selector ifAbsent: [#()])
	 	detect: [:assoc| assoc key evaluateWithArguments: pair ]
		ifNone: [ #halt -> nil ]) value """,nil)

smalltalk.bind(smalltalk.S8Simulator,"break:",0
,smalltalk.__f__("""(self,why):
	#S8Simulator>>#break:
	self.triggerEvent_with_(smalltalk.String("breakpoint:"),why) 
	smalltalk.basic_at_put(self,"@state",smalltalk.String("paused")) 
	return self 
""","S8Simulator_break_")
,"breakpoints","""break: why
	" Breakpoint hit. "

	self triggerEvent: #breakpoint: with: why.
	state := #paused""",nil)

smalltalk.bind(smalltalk.S8Simulator,"testPoint:",0
,smalltalk.__f__("""(self,test):
	_s8Ret_=smalltalk.newContext()
	try:
		#S8Simulator>>#testPoint:
		def __blk1__():
			return smalltalk.isObject_equalTo_(getattr(self,"@breakpoints",nil).size(),smalltalk.Number(0)) 
		if smalltalk.b(smalltalk.boolean_or_(smalltalk.isNil_(test),smalltalk.blk(__blk1__,0))):
			return self 
		 
		if smalltalk.b(getattr(self,"@breakpoints",nil).includes_(test)):
			return self.break_(test) 
		 
		if smalltalk.b(smalltalk.is_kindOf_(test,(smalltalk.Behavior))):
			def __blk2__(each):
				def __blk3__():
					return each.includes_(test) 
				def __blk4__():
					def __blk5__():
						return test.inheritsFrom_(each) 
					return smalltalk.boolean_and_(smalltalk.is_kindOf_(each,(smalltalk.Behavior)),smalltalk.blk(__blk5__,0)) 
				def __blk6__():
					return smalltalk.raise_result_(_s8Ret_,self.break_(test)) 
				return smalltalk.if_true_false_(smalltalk.boolean_or_(smalltalk.boolean_and_(each.isArray(),smalltalk.blk(__blk3__,0)),smalltalk.blk(__blk4__,0)),smalltalk.blk(__blk6__,0),nil) 
			getattr(self,"@breakpoints",nil).do_(smalltalk.blk(__blk2__,1)) 
			smalltalk.raise_result_(_s8Ret_,self) 
		 
		if smalltalk.b(test.isString()):
			def __blk7__(each):
				def __blk8__():
					return each.endsWith_(smalltalk.String("*")) 
				def __blk9__():
					return test.startsWith_(each.upTo_(smalltalk.String("*"))) 
				def __blk10__():
					return smalltalk.raise_result_(_s8Ret_,self.break_(test)) 
				return smalltalk.if_true_false_(smalltalk.boolean_and_(smalltalk.boolean_and_(each.isString(),smalltalk.blk(__blk8__,0)),smalltalk.blk(__blk9__,0)),smalltalk.blk(__blk10__,0),nil) 
			getattr(self,"@breakpoints",nil).do_(smalltalk.blk(__blk7__,1)) 
		 
		smalltalk.raise_result_(_s8Ret_,self) 
	except Exception as __ex:
		if smalltalk.exception_at(__ex,_s8Ret_):
			return smalltalk.exceptionResult_(__ex)
		raise __ex
	
""","S8Simulator_testPoint_")
,"breakpoints","""testPoint: test
	" Private - Test matching of a breakpoint. "

	(test isNil or: [breakpoints size = 0]) ifTrue: [ ^self ].
	(breakpoints includes: test) ifTrue: [ ^self break: test ]. "method selector or cls"
	(test isKindOf: Behavior) ifTrue: [
		breakpoints do: [:each|
			((each isArray and: [each includes: test]) "#(cls1 cls2 cls3)"
			or: [ (each isKindOf: Behavior) and: [ test inheritsFrom: each ]]) "cls w/subclasses"
			ifTrue: [ ^self break: test ].
		].	^self
	].
	test isString ifTrue: [
		breakpoints do: [:each| "sel*"
			((each isString and: [each endsWith: $*])
			and: [test startsWith: (each upTo: $*)]) ifTrue: [
				^self break: test
			]
		]
	]""",nil)

smalltalk.bind(smalltalk.S8Simulator,"activateBasic:message:withArguments:",0
,smalltalk.__f__("""(self,anObject,selector,values):
	#S8Simulator>>#activateBasic:message:withArguments:
	if smalltalk.b(smalltalk.is_kindOf_(anObject,(smalltalk.SimulationBlock))):
		self.value_(anObject.perform_withArguments_(selector,values)) 
		return smalltalk.true 
	 
	if smalltalk.b(smalltalk.isObject_equalTo_(selector,smalltalk.String("halt"))):
		def __blk1__(_s8_rec):
			_s8_rec.value_(anObject) 
			return _s8_rec.pause() 
		__blk1__(self) 
		return smalltalk.true 
	 
	if smalltalk.b(smalltalk.isObject_equalTo_(selector,smalltalk.String("||"))):
		self.value_(smalltalk.b_(anObject or values.first())) 
		return smalltalk.true 
	 
	return smalltalk.false 
""","S8Simulator_activateBasic_message_withArguments_")
,"execute","""activateBasic: anObject message: selector withArguments: values
	" Private - Returns true if selector sent to anObject has been activated as basic message sent. "

	(anObject isKindOf: SimulationBlock) ifTrue: [
		self value: (anObject
			perform: selector
			withArguments: values).
		^true
	].
	selector = #halt ifTrue: [
		self value: anObject; pause.
		^true
	].
	selector = #|| ifTrue: [
		self value: anObject || values first.
		^true
	].
	^false""",nil)

smalltalk.bind(smalltalk.S8Simulator,"callNative:message:withArguments:",0
,smalltalk.__f__("""(self,anObject,selector,values):
	#S8Simulator>>#callNative:message:withArguments:
	__0__=smalltalk.newContext()
	def __blk1__():
		return smalltalk.responds_to_(__0__.mth,(smalltalk.String("valueWithArguments:"))) 
	__0__.mth=nil
	
	if smalltalk.b(smalltalk.isNil_(__0__.mth)):
		__0__.mth=smalltalk.basic_at_(anObject,selector.asSelector()) 
	 
	if smalltalk.b(smalltalk.boolean_and_(smalltalk.notNil_(__0__.mth),smalltalk.blk(__blk1__,0))):
		self.value_(self.callNative_on_withArguments_(__0__.mth,anObject,values)) 
		return smalltalk.true 
	 
	if not smalltalk.b(self.isObject_(anObject)):
		return self.error_(smalltalk.object_comma_(smalltalk.String("Native object DNU "),selector.asLiteral())) 
	 
	return smalltalk.false 
""","S8Simulator_callNative_message_withArguments_")
,"execute","""callNative: anObject message: selector withArguments: values
	" Private - Returns true if selector sent to anObject has been activated as native call. "

	| mth |
	{'self' jl' mth=eval(Symbol(asSelector(selector))) '}.
	mth isNil ifTrue: [
		"self note: 'proto-lookup for ',selector asSeletor."
		mth := anObject basicAt: selector asSelector.
	].
	(mth notNil and: [ mth respondsTo: #valueWithArguments: ]) ifTrue: [
		self value: (self callNative: mth on: anObject withArguments: values).
		^true
	].
	(self isObject: anObject) ifFalse: [
		^self error: 'Native object DNU ' ,selector asLiteral
	].
	^false""",nil)

smalltalk.bind(smalltalk.S8Simulator,"activateNative:message:withArguments:",0
,smalltalk.__f__("""(self,anObject,selector,values):
	#S8Simulator>>#activateNative:message:withArguments:
	def __blk1__():
		return self.callNative_message_withArguments_(anObject,selector,values) 
	return self.triggerEvent_with_ifNotHandled_(smalltalk.String("activateNative:"),smalltalk.Message.receiver_selector_arguments_(anObject,selector,values),smalltalk.blk(__blk1__,0)) 
""","S8Simulator_activateNative_message_withArguments_")
,"execute","""activateNative: anObject message: selector withArguments: values
	" Private - Returns true if selector sent to anObject has been activated as native call. "

	^self
		triggerEvent: #activateNative:
		with: (Message receiver: anObject selector: selector arguments: values)
		ifNotHandled: [
			self callNative: anObject message: selector withArguments: values
		] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"callDNU:message:withArguments:",0
,smalltalk.__f__("""(self,anObject,selector,values):
	#S8Simulator>>#callDNU:message:withArguments:
	__0__=smalltalk.newContext()
	__0__.mth=nil
	__0__.array=nil
	__0__.mth=(anObject).__class__._gt_gt_gt(smalltalk.String("dnu:withArguments:")) 
	if smalltalk.b(smalltalk.isNil_(__0__.mth)):
		__0__.mth=(anObject).__class__._gt_gt_gt(smalltalk.String("doesNotUnderstand:")) 
		__0__.array=smalltalk.Array.with_(selector) 
	else:
		__0__.array=smalltalk.Array.with_with_(selector,values) 
	 
	self.callMethod_for_withArguments_(__0__.mth,anObject,__0__.array) 
	return self 
""","S8Simulator_callDNU_message_withArguments_")
,"execute","""callDNU: anObject message: selector withArguments: values
	" Private - Call DNU error condition. "

	| mth array |
	mth := anObject class >>> #dnu:withArguments:.
	mth isNil ifTrue: [
		mth := anObject class >>> #doesNotUnderstand:.
		array := Array with: selector.
	] ifFalse: [
		array := Array with: selector with: values
	].
	self callMethod: mth for: anObject withArguments: array """,nil)

smalltalk.bind(smalltalk.S8Simulator,"activate:message:for:withArguments:",0
,smalltalk.__f__("""(self,aClass,selector,anObject,values):
	_s8Ret_=smalltalk.newContext()
	try:
		#S8Simulator>>#activate:message:for:withArguments:
		__0__=smalltalk.newContext()
		def __blk1__():
			return self.isObject_(anObject) 
		def __blk2__():
			return (anObject).__class__ 
		def __blk3__():
			return aClass 
		def __blk4__():
			return smalltalk.isNil_(__0__.mth) 
		__0__.mth=nil
		self.testPoint_(smalltalk.if_true_false_(smalltalk.boolean_and_(smalltalk.isNil_(aClass),smalltalk.blk(__blk1__,0)),smalltalk.blk(__blk2__,0),smalltalk.blk(__blk3__,0))) 
		self.testPoint_(selector) 
		if smalltalk.b(self.activateBasic_message_withArguments_(anObject,selector,values)):
			return self 
		 
		if smalltalk.b(smalltalk.notNil_(aClass)):
			__0__.mth=self.shortcut_message_for_withArguments_(aClass,selector,anObject,values) 
			if smalltalk.b(smalltalk.notNil_(__0__.mth)):
				return __0__.mth.evaluateWithArguments_(smalltalk.Array.with_with_with_with_(anObject,selector,values,aClass)) 
			 
			__0__.mth=aClass._gt_gt_gt(selector) 
		 
		if smalltalk.b(smalltalk.boolean_and_(smalltalk.notNil_(aClass),smalltalk.blk(__blk4__,0))):
			def __blk5__():
				return smalltalk.raise_result_(_s8Ret_,self) 
			smalltalk.if_true_false_(self.activateNative_message_withArguments_(anObject,selector,values),smalltalk.blk(__blk5__,0),nil) 
		 
		if smalltalk.b(smalltalk.isNil_(__0__.mth)):
			smalltalk.raise_result_(_s8Ret_,self.callDNU_message_withArguments_(anObject,selector,values)) 
		 
		self.testPoint_(__0__.mth) 
		smalltalk.raise_result_(_s8Ret_,self.callMethod_for_withArguments_(__0__.mth,anObject,values)) 
	except Exception as __ex:
		if smalltalk.exception_at(__ex,_s8Ret_):
			return smalltalk.exceptionResult_(__ex)
		raise __ex
	
""","S8Simulator_activate_message_for_withArguments_")
,"execute","""activate: aClass message: selector for: anObject withArguments: values
	" Activate a method context simulation for sending message to anObject with given arguments. "

	| mth |
	self testPoint: ((aClass isNil and: [self isObject: anObject])
		ifTrue: [ anObject class ] ifFalse: [aClass]).
	self testPoint: selector.
	(self	activateBasic: anObject
		message: selector withArguments: values)
		ifTrue: [ ^self ].
	aClass notNil ifTrue: [
		mth := self shortcut: aClass message: selector for: anObject withArguments: values.
		mth notNil ifTrue: [
			^mth evaluateWithArguments: (Array
				with: anObject with: selector
				with: values with: aClass)
		].
		mth := aClass >>> selector.
	].
	(aClass notNil and: [mth isNil]) ifTrue: [
		(self	activateNative: anObject
			message: selector withArguments: values)
			ifTrue: [ ^self ]
	].
	mth isNil ifTrue: [
		^self	callDNU: anObject
			message: selector
			withArguments: values
	].
	self testPoint: mth.
	^self callMethod: mth for: anObject withArguments: values """,nil)

smalltalk.bind(smalltalk.S8Simulator,"callNativeLua:on:withArguments:",0
,smalltalk.__f__("""(self,evaluable,anObject,values):
	#S8Simulator>>#callNativeLua:on:withArguments:
	return evaluable.valueWithArguments_(smalltalk.object_comma_(smalltalk.Array.with_(anObject),values)) 
""","S8Simulator_callNativeLua_on_withArguments_")
,"execute","""callNativeLua: evaluable on: anObject withArguments: values
	" Private - Returns the result of evaluating an evaluable function on anObject. "

	^evaluable valueWithArguments: (Array with: anObject) ,values""",nil)

smalltalk.bind(smalltalk.S8Simulator,"callNativeJulia:on:withArguments:",0
,smalltalk.__f__("""(self,evaluable,anObject,values):
	#S8Simulator>>#callNativeJulia:on:withArguments:
	def __blk1__():
		return evaluable.isMemberOf_(smalltalk.BlockClosure) 
	if smalltalk.b(smalltalk.boolean_and_(smalltalk.isNil_(anObject),smalltalk.blk(__blk1__,0))):
		return self.invalidMessage_(smalltalk.String("callNativeJulia:on:withArguments:")) 
	 
	self.note_(smalltalk.object_comma_(smalltalk.String("[S8Simulator] native-oo call with "),values.asLiteral())) 
	return evaluable.valueWithArguments_(smalltalk.object_comma_(smalltalk.Array.with_(anObject),values)) 
""","S8Simulator_callNativeJulia_on_withArguments_")
,"execute","""callNativeJulia: evaluable on: anObject withArguments: values
	" Private - Returns the result of evaluating an evaluable function on anObject. "

	(anObject isNil and: [evaluable isMemberOf: BlockClosure]) ifTrue: [
		^{'' jl'evaluable(handle(values)...)'}
	].

"DEBUG-"	self note: '[S8Simulator] native-oo call with ',values asLiteral.
	^evaluable valueWithArguments: (Array with: anObject) ,values""",nil)

smalltalk.bind(smalltalk.S8Simulator,"callNative:on:withArguments:",0
,smalltalk.__f__("""(self,evaluable,anObject,values):
	#S8Simulator>>#callNative:on:withArguments:
	if smalltalk.b(smalltalk.isObject_equalTo_(self.nativeLanguage(),smalltalk.String("lua"))):
		return self.callNativeLua_on_withArguments_(evaluable,anObject,values) 
	 
	if smalltalk.b(smalltalk.isObject_equalTo_(self.nativeLanguage(),smalltalk.String("jl"))):
		return self.callNativeJulia_on_withArguments_(evaluable,anObject,values) 
	 
	return evaluable.valueWithArguments_(values) 
""","S8Simulator_callNative_on_withArguments_")
,"execute","""callNative: evaluable on: anObject withArguments: values
	" Private - Returns the result of evaluating an evaluable function on anObject.
	e.g.	Smalltalk current classes
	see also	Behavior>>#allSubclassesDo:
	"

	self nativeLanguage = #lua ifTrue: [ "transform to a lua oo call"
		^self callNativeLua: evaluable on: anObject withArguments: values
	].
	self nativeLanguage = #jl ifTrue: [
		^self callNativeJulia: evaluable on: anObject withArguments: values
	].
	^evaluable valueWithArguments: values""",nil)

smalltalk.bind(smalltalk.S8Simulator,"send:to:withArguments:",0
,smalltalk.__f__("""(self,selector,anObject,values):
	#S8Simulator>>#send:to:withArguments:
	return self.activate_message_for_withArguments_((anObject).__class__,selector,anObject,values) 
""","S8Simulator_send_to_withArguments_")
,"execute","""send: selector to: anObject withArguments: values
	" Add message send to anObject with given arguments. "

	^self	activate: anObject class message: selector
		for: anObject withArguments: values """,nil)

smalltalk.bind(smalltalk.S8Simulator,"repeat:while:doing:then:",0
,smalltalk.__f__("""(self,aSimulationBlock,condition,action,epilogue):
	#S8Simulator>>#repeat:while:doing:then:
	def __blk1__():
		def __blk2__():
			def __blk3__():
				self.triggerEvent_with_(smalltalk.String("aboutToLoop:"),aSimulationBlock) 
				return self.repeat_while_doing_then_(aSimulationBlock,condition,action,epilogue) 
			def __blk4__():
				def __blk5__():
					return action.value() 
				return smalltalk.if_true_false_(smalltalk.notNil_(action),smalltalk.blk(__blk5__,0),nil) 
			self.add_step_in_(aSimulationBlock.node(),smalltalk.blk(__blk3__,0),aSimulationBlock.context()) 
			return self.add_step_in_(aSimulationBlock.node(),smalltalk.blk(__blk4__,0),aSimulationBlock.context()) 
		def __blk6__():
			return epilogue.value() 
		return smalltalk.if_true_false_(condition.value(),smalltalk.blk(__blk2__,0),smalltalk.blk(__blk6__,0)) 
	self.add_step_in_(aSimulationBlock.node(),smalltalk.blk(__blk1__,0),aSimulationBlock.context()) 
	aSimulationBlock.value() 
	return self 
""","S8Simulator_repeat_while_doing_then_")
,"execute","""repeat: aSimulationBlock while: condition doing: action then: epilogue
	" Private - Execute evaluations in a loop. "

	self add: aSimulationBlock node step: [
		condition value ifTrue: [
			self add: aSimulationBlock node step: [
				self triggerEvent: #aboutToLoop: with: aSimulationBlock.
				self repeat: aSimulationBlock while: condition doing: action then: epilogue
			] in: aSimulationBlock context.
			self add: aSimulationBlock node step: [
				action notNil ifTrue: [ action value ].
			] in: aSimulationBlock context.
		] ifFalse: [ epilogue value ]
	] in: aSimulationBlock context.
	aSimulationBlock value """,nil)

smalltalk.bind(smalltalk.S8Simulator,"ignoreShortcuts",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#ignoreShortcuts
	__0__=smalltalk.newContext()
	__0__.pool=nil
	__0__.pool=smalltalk.PoolDictionary.new() 
	__0__.pool.at_put_(smalltalk.String("halt"),smalltalk.newArray([])) 
	self.shortcuts_(__0__.pool) 
	return self 
""","S8Simulator_ignoreShortcuts")
,"shortcuts","""ignoreShortcuts
	" Private - Set the receiver to do NOT use shortcuts. "

	| pool |
	pool := PoolDictionary new.
	pool at: #halt put: #().
	self shortcuts: pool """,nil)

smalltalk.bind(smalltalk.S8Simulator,"useShortcuts",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#useShortcuts
	self.shortcuts_(nil) 
	return self 
""","S8Simulator_useShortcuts")
,"shortcuts","""useShortcuts
	" Private - Set the receiver to use shortcuts. "

	self shortcuts: nil """,nil)

smalltalk.bind(smalltalk.S8Simulator,"register:shortcut:",0
,smalltalk.__f__("""(self,selector,assoc):
	#S8Simulator>>#register:shortcut:
	def __blk1__():
		return smalltalk.newArray([]) 
	self.shortcuts().at_ifAbsentPut_(selector,smalltalk.blk(__blk1__,0)).add_(assoc) 
	return self 
""","S8Simulator_register_shortcut_")
,"shortcuts","""register: selector shortcut: assoc
	" Private - Register the shortcut for selector with assoc. "

	(self shortcuts
		at: selector ifAbsentPut: [#()])
		add: assoc """,nil)

smalltalk.bind(smalltalk.S8Simulator,"registerInlined:",0
,smalltalk.__f__("""(self,messages):
	#S8Simulator>>#registerInlined:
	def __blk1__(selector):
		def __blk2__(receiver,args):
			return smalltalk.responds_to_(receiver,(selector)) 
		def __blk3__(receiver,selector,args,cls):
			return self.value_(receiver.perform_withArguments_(selector,args)) 
		return self.register_shortcut_(selector,smalltalk.blk(__blk2__,2)._minus_gt(smalltalk.blk(__blk3__,4))) 
	messages.do_(smalltalk.blk(__blk1__,1)) 
	return self 
""","S8Simulator_registerInlined_")
,"shortcuts","""registerInlined: messages
	" Private - Register messages to be inlined. "

	messages do: [:selector|
		self register: selector shortcut:
			[:receiver :args| receiver respondsTo: selector ]
			-> [:receiver :selector :args :cls|
				self value: (receiver perform: selector withArguments: args)
			]
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"registerInlined:for:",0
,smalltalk.__f__("""(self,messages,classOrArray):
	#S8Simulator>>#registerInlined:for:
	__0__=smalltalk.newContext()
	def __blk1__(selector):
		def __blk2__(receiver,selector,args,cls):
			return self.value_(receiver.perform_withArguments_(selector,args)) 
		return self.register_shortcut_(selector,__0__.test._minus_gt(smalltalk.blk(__blk2__,4))) 
	__0__.test=nil
	if smalltalk.b(classOrArray.isClass()):
		def __blk3__(receiver,args):
			return smalltalk.is_kindOf_(receiver,(classOrArray)) 
		__0__.test=smalltalk.blk(__blk3__,2) 
	else:
		def __blk4__(receiver,args):
			def __blk5__(cls):
				return smalltalk.is_kindOf_(receiver,(cls)) 
			def __blk6__():
				nil 
			return smalltalk.notNil_(classOrArray.detect_ifNone_(smalltalk.blk(__blk5__,1),smalltalk.blk(__blk6__,0))) 
		__0__.test=smalltalk.blk(__blk4__,2) 
	 
	messages.do_(smalltalk.blk(__blk1__,1)) 
	return self 
""","S8Simulator_registerInlined_for_")
,"shortcuts","""registerInlined: messages for: classOrArray
	" Private - Register messages to be inlined. "

	| test |
	classOrArray isClass ifTrue: [
		test := [:receiver :args| receiver isKindOf: classOrArray ]
	] ifFalse: [
		test := [:receiver :args|
			(classOrArray detect: [:cls|
				receiver isKindOf: cls
			] ifNone: []) notNil
		]
		
	].
	messages do: [:selector|
		self register: selector shortcut:
			test -> [:receiver :selector :args :cls|
				self value: (receiver perform: selector withArguments: args)
			]
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"registerDefaultShortcuts",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#registerDefaultShortcuts
	def __blk1__(_s8_rec):
		def __blk2__(receiver):
			return self.value_(receiver) 
		_s8_rec.registerInlined_(smalltalk.newArray(["json","handle","size","asLiteral","@","->","asNativeSelector","toString"])) 
		_s8_rec.register_shortcut_(smalltalk.String("yourself"),smalltalk.true._minus_gt(smalltalk.blk(__blk2__,1))) 
		_s8_rec.register_shortcut_(smalltalk.String("timesRepeat:"),self.timesRepeatShortcut()) 
		_s8_rec.register_shortcut_(smalltalk.String("do:"),self.doShortcut()) 
		_s8_rec.register_shortcut_(smalltalk.String("reverseDo:"),self.reverseDoShortcut()) 
		_s8_rec.register_shortcut_(smalltalk.String("withIndexDo:"),self.withIndexDoShortcut()) 
		_s8_rec.register_shortcut_(smalltalk.String("to:do:"),self.toDoShortcut()) 
		_s8_rec.register_shortcut_(smalltalk.String("to:by:do:"),self.toByDoShortcut()) 
		_s8_rec.register_shortcut_(smalltalk.String("keysAndValuesDo:"),self.keysAndValuesDoShortcut()) 
		_s8_rec.register_shortcut_(smalltalk.String("ifTrue:"),self.ifTrueShortcut()) 
		_s8_rec.register_shortcut_(smalltalk.String("ifFalse:"),self.ifFalseShortcut()) 
		_s8_rec.register_shortcut_(smalltalk.String("at:ifAbsent:"),self.atIfAbsentShortcut()) 
		_s8_rec.register_shortcut_(smalltalk.String("ifTrue:ifFalse:"),self.ifTrueIfFalseShortcut()) 
		_s8_rec.register_shortcut_(smalltalk.String("ifFalse:ifTrue:"),self.ifFalseIfTrueShortcut()) 
		_s8_rec.register_shortcut_(smalltalk.String("indexOf:ifAbsent:"),self.indexOfIfAbsentShortcut()) 
		_s8_rec.register_shortcut_(smalltalk.String("sorted:"),self.sortedShortcut()) 
		_s8_rec.register_shortcut_(smalltalk.String("sort:"),self.sortShortcut()) 
		return _s8_rec.yourself() 
	__blk1__(self) 
	return self 
""","S8Simulator_registerDefaultShortcuts")
,"shortcuts","""registerDefaultShortcuts
	" Private - Register the default shortcuts. "

	self	registerInlined: #(
			json handle size asLiteral
			@ -> asNativeSelector
			toString );
		register: #yourself shortcut: true -> [:receiver | self value: receiver ];
		register: #timesRepeat: shortcut: self timesRepeatShortcut;
		register: #do: shortcut: self doShortcut;
		register: #reverseDo: shortcut: self reverseDoShortcut;
		register: #withIndexDo: shortcut: self withIndexDoShortcut;
		register: #to:do: shortcut: self toDoShortcut;
		register: #to:by:do: shortcut: self toByDoShortcut;
		register: #keysAndValuesDo: shortcut: self keysAndValuesDoShortcut;
		register: #ifTrue: shortcut: self ifTrueShortcut;
		register: #ifFalse: shortcut: self ifFalseShortcut;
		register: #at:ifAbsent: shortcut: self atIfAbsentShortcut;
		register: #ifTrue:ifFalse: shortcut: self ifTrueIfFalseShortcut;
		register: #ifFalse:ifTrue: shortcut: self ifFalseIfTrueShortcut;
		register: #indexOf:ifAbsent: shortcut: self indexOfIfAbsentShortcut;
		register: #sorted: shortcut: self sortedShortcut;
		register: #sort: shortcut: self sortShortcut;
		yourself """,nil)

smalltalk.bind(smalltalk.S8Simulator,"timesRepeatShortcut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#timesRepeatShortcut
	def __blk1__(receiver,args):
		def __blk2__():
			return smalltalk.is_kindOf_(args.last(),(smalltalk.SimulationBlock)) 
		return smalltalk.boolean_and_(receiver.isNumber(),smalltalk.blk(__blk2__,0)) 
	def __blk3__(receiver,selector,args,cls):
		__1__=smalltalk.newContext()
		def __blk4__():
			return self.value_(receiver) 
		def __blk5__():
			if smalltalk.b(__1__.i._lt(receiver)):
				self.add_step_in_(smalltalk.String("timesRepeat-loop"),__1__.loop,nil) 
			 
			__1__.blk.value_(__1__.i) 
			__1__.i=__1__.i._plus(smalltalk.Number(1))
			return __1__.i 
		def __blk6__():
			return self.add_step_in_(smalltalk.String("timesRepeat-loop"),__1__.loop,nil) 
		__1__.i=nil
		__1__.blk=nil
		__1__.loop=nil
		__1__.blk=args.last() 
		__1__.i=smalltalk.Number(1) 
		self.add_step_in_(smalltalk.String("timesRepeat-exit"),smalltalk.blk(__blk4__,0),nil) 
		__1__.loop=smalltalk.blk(__blk5__,0) 
		return smalltalk.if_true_false_(__1__.i._lt_eq(receiver),smalltalk.blk(__blk6__,0),nil) 
	return smalltalk.blk(__blk1__,2)._minus_gt(smalltalk.blk(__blk3__,4)) 
""","S8Simulator_timesRepeatShortcut")
,"shortcuts","""timesRepeatShortcut
	" Private - Returns the shortcut for the selector. "

	^[:receiver :args|
		receiver isNumber and: [
		args last isKindOf: SimulationBlock ] ]
	-> [:receiver :selector :args :cls| | i blk loop |
		blk := args last. i := 1.
		self add: #timesRepeat-exit step: [ self value: receiver ] in: nil.
		loop := [ i < receiver ifTrue: [ self add: #timesRepeat-loop step: loop in: nil ].
			blk value: i. i := i + 1.
		].
		i <= receiver ifTrue: [ self add: #timesRepeat-loop step: loop in: nil ].
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"doShortcut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#doShortcut
	def __blk1__(receiver,args):
		def __blk2__():
			return smalltalk.is_kindOf_(args.last(),(smalltalk.SimulationBlock)) 
		return smalltalk.boolean_and_(smalltalk.is_kindOf_(receiver,(smalltalk.SequenceableCollection)),smalltalk.blk(__blk2__,0)) 
	def __blk3__(receiver,selector,args,cls):
		__1__=smalltalk.newContext()
		def __blk4__():
			return self.value_(receiver) 
		def __blk5__():
			if smalltalk.b(__1__.i._lt(__1__.to)):
				self.add_step_in_(smalltalk.String("do-loop"),__1__.loop,nil) 
			 
			__1__.blk.value_(receiver.at_(__1__.i)) 
			__1__.i=__1__.i._plus(smalltalk.Number(1))
			return __1__.i 
		def __blk6__():
			return self.add_step_in_(smalltalk.String("do-loop"),__1__.loop,nil) 
		__1__.i=nil
		__1__.to=nil
		__1__.blk=nil
		__1__.loop=nil
		__1__.to=receiver.size() 
		__1__.blk=args.last() 
		__1__.i=smalltalk.Number(1) 
		self.add_step_in_(smalltalk.String("do-exit"),smalltalk.blk(__blk4__,0),nil) 
		__1__.loop=smalltalk.blk(__blk5__,0) 
		return smalltalk.if_true_false_(__1__.i._lt_eq(__1__.to),smalltalk.blk(__blk6__,0),nil) 
	return smalltalk.blk(__blk1__,2)._minus_gt(smalltalk.blk(__blk3__,4)) 
""","S8Simulator_doShortcut")
,"shortcuts","""doShortcut
	" Private - Returns the shortcut for the selector. "

	^[:receiver :args|
		(receiver isKindOf: SequenceableCollection) and: [
		args last isKindOf: SimulationBlock ] ]
	-> [:receiver :selector :args :cls| | i to blk loop |
		to := receiver size. blk := args last. i := 1.
		self add: #do-exit step: [ self value: receiver ] in: nil.
		loop := [ i < to ifTrue: [ self add: #do-loop step: loop in: nil ].
			blk value: (receiver at: i). i := i + 1.
		].
		i <= to ifTrue: [ self add: #do-loop step: loop in: nil ].
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"reverseDoShortcut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#reverseDoShortcut
	def __blk1__(receiver,args):
		def __blk2__():
			return smalltalk.is_kindOf_(args.last(),(smalltalk.SimulationBlock)) 
		return smalltalk.boolean_and_(smalltalk.is_kindOf_(receiver,(smalltalk.SequenceableCollection)),smalltalk.blk(__blk2__,0)) 
	def __blk3__(receiver,selector,args,cls):
		__1__=smalltalk.newContext()
		def __blk4__():
			return self.value_(receiver) 
		def __blk5__():
			if smalltalk.b(__1__.i._gt(smalltalk.Number(1))):
				self.add_step_in_(smalltalk.String("reverseDo-loop"),__1__.loop,nil) 
			 
			__1__.blk.value_(receiver.at_(__1__.i)) 
			__1__.i=__1__.i._minus(smalltalk.Number(1))
			return __1__.i 
		def __blk6__():
			return self.add_step_in_(smalltalk.String("reverseDo-loop"),__1__.loop,nil) 
		__1__.i=nil
		__1__.blk=nil
		__1__.loop=nil
		__1__.i=receiver.size() 
		__1__.blk=args.last() 
		self.add_step_in_(smalltalk.String("reverseDo-exit"),smalltalk.blk(__blk4__,0),nil) 
		__1__.loop=smalltalk.blk(__blk5__,0) 
		return smalltalk.if_true_false_(__1__.i._gt(smalltalk.Number(0)),smalltalk.blk(__blk6__,0),nil) 
	return smalltalk.blk(__blk1__,2)._minus_gt(smalltalk.blk(__blk3__,4)) 
""","S8Simulator_reverseDoShortcut")
,"shortcuts","""reverseDoShortcut
	" Private - Returns the shortcut for the selector. "

	^[:receiver :args|
		(receiver isKindOf: SequenceableCollection) and: [
		args last isKindOf: SimulationBlock ] ]
	-> [:receiver :selector :args :cls| | i blk loop |
		i := receiver size. blk := args last.
		self add: #reverseDo-exit step: [ self value: receiver ] in: nil.
		loop := [ i > 1 ifTrue: [ self add: #reverseDo-loop step: loop in: nil ].
			blk value: (receiver at: i). i := i - 1.
		].
		i > 0 ifTrue: [ self add: #reverseDo-loop step: loop in: nil ].
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"withIndexDoShortcut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#withIndexDoShortcut
	def __blk1__(receiver,args):
		def __blk2__():
			return smalltalk.is_kindOf_(args.last(),(smalltalk.SimulationBlock)) 
		return smalltalk.boolean_and_(smalltalk.is_kindOf_(receiver,(smalltalk.SequenceableCollection)),smalltalk.blk(__blk2__,0)) 
	def __blk3__(receiver,selector,args,cls):
		__1__=smalltalk.newContext()
		def __blk4__():
			return self.value_(receiver) 
		def __blk5__():
			if smalltalk.b(__1__.i._lt(__1__.to)):
				self.add_step_in_(smalltalk.String("withIndexDo-loop"),__1__.loop,nil) 
			 
			__1__.blk.value_value_(receiver.at_(__1__.i),__1__.i) 
			__1__.i=__1__.i._plus(smalltalk.Number(1))
			return __1__.i 
		def __blk6__():
			return self.add_step_in_(smalltalk.String("withIndexDo-loop"),__1__.loop,nil) 
		__1__.i=nil
		__1__.to=nil
		__1__.blk=nil
		__1__.loop=nil
		__1__.i=smalltalk.Number(1) 
		__1__.to=receiver.size() 
		__1__.blk=args.last() 
		self.add_step_in_(smalltalk.String("withIndexDo-exit"),smalltalk.blk(__blk4__,0),nil) 
		__1__.loop=smalltalk.blk(__blk5__,0) 
		return smalltalk.if_true_false_(__1__.i._lt_eq(__1__.to),smalltalk.blk(__blk6__,0),nil) 
	return smalltalk.blk(__blk1__,2)._minus_gt(smalltalk.blk(__blk3__,4)) 
""","S8Simulator_withIndexDoShortcut")
,"shortcuts","""withIndexDoShortcut
	" Private - Returns the shortcut for the selector. "

	^[:receiver :args|
		(receiver isKindOf: SequenceableCollection) and: [
		args last isKindOf: SimulationBlock ] ]
	-> [:receiver :selector :args :cls| | i to blk loop |
		i := 1. to := receiver size. blk := args last.
		self add: #withIndexDo-exit step: [ self value: receiver ] in: nil.
		loop := [ i < to ifTrue: [ self add: #withIndexDo-loop step: loop in: nil ].
			blk value: (receiver at: i) value: i. i := i + 1. 
		].
		i <= to ifTrue: [ self add: #withIndexDo-loop step: loop in: nil ].
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"keysAndValuesDoShortcut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#keysAndValuesDoShortcut
	def __blk1__(receiver,args):
		def __blk2__():
			return smalltalk.is_kindOf_(args.last(),(smalltalk.SimulationBlock)) 
		return smalltalk.boolean_and_(smalltalk.is_kindOf_(receiver,(smalltalk.KeyedCollection)),smalltalk.blk(__blk2__,0)) 
	def __blk3__(receiver,selector,args,cls):
		__1__=smalltalk.newContext()
		def __blk4__():
			return self.value_(receiver) 
		def __blk5__():
			if smalltalk.b(__1__.keys.size()._gt(smalltalk.Number(1))):
				self.add_step_in_(smalltalk.String("keysAndValuesDo-loop"),__1__.loop,nil) 
			 
			return __1__.blk.value_value_(__1__.keys.first(),receiver.at_(__1__.keys.removeFirst())) 
		def __blk6__():
			return self.add_step_in_(smalltalk.String("keysAndValuesDo-loop"),__1__.loop,nil) 
		__1__.keys=nil
		__1__.blk=nil
		__1__.loop=nil
		__1__.keys=receiver.keys().asArray().copy() 
		__1__.blk=args.last() 
		self.add_step_in_(smalltalk.String("keysAndValuesDo-exit"),smalltalk.blk(__blk4__,0),nil) 
		__1__.loop=smalltalk.blk(__blk5__,0) 
		return smalltalk.if_true_false_(__1__.keys.notEmpty(),smalltalk.blk(__blk6__,0),nil) 
	return smalltalk.blk(__blk1__,2)._minus_gt(smalltalk.blk(__blk3__,4)) 
""","S8Simulator_keysAndValuesDoShortcut")
,"shortcuts","""keysAndValuesDoShortcut
	" Private - Returns the shortcut for the selector. "

	^[:receiver :args|
		(receiver isKindOf: KeyedCollection) and: [
		args last isKindOf: SimulationBlock ] ]
	-> [:receiver :selector :args :cls| | keys blk loop |
		keys := receiver keys asArray copy. blk := args last.
		self add: #keysAndValuesDo-exit step: [ self value: receiver ] in: nil.
		loop := [ keys size > 1 ifTrue: [ self add: #keysAndValuesDo-loop step: loop in: nil ].
			blk value: keys first value: (receiver at: keys removeFirst).
		].
		keys notEmpty ifTrue: [ self add: #keysAndValuesDo-loop step: loop in: nil ].
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"toDoShortcut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#toDoShortcut
	def __blk1__(receiver,args):
		def __blk2__():
			def __blk3__():
				return smalltalk.is_kindOf_(args.last(),(smalltalk.SimulationBlock)) 
			return smalltalk.boolean_and_(args.first().isNumber(),smalltalk.blk(__blk3__,0)) 
		return smalltalk.boolean_and_(receiver.isNumber(),smalltalk.blk(__blk2__,0)) 
	def __blk4__(receiver,selector,args,cls):
		__1__=smalltalk.newContext()
		def __blk5__():
			return self.value_(receiver) 
		def __blk6__():
			if smalltalk.b(__1__.i._lt(__1__.to)):
				self.add_step_in_(smalltalk.String("toDo-loop"),__1__.loop,nil) 
			 
			__1__.blk.value_(__1__.i) 
			__1__.i=__1__.i._plus(smalltalk.Number(1))
			return __1__.i 
		def __blk7__():
			return self.add_step_in_(smalltalk.String("toDo-loop"),__1__.loop,nil) 
		__1__.i=nil
		__1__.to=nil
		__1__.blk=nil
		__1__.loop=nil
		__1__.to=args.first() 
		__1__.blk=args.last() 
		__1__.i=receiver 
		self.add_step_in_(smalltalk.String("toDo-exit"),smalltalk.blk(__blk5__,0),nil) 
		__1__.loop=smalltalk.blk(__blk6__,0) 
		return smalltalk.if_true_false_(__1__.i._lt_eq(__1__.to),smalltalk.blk(__blk7__,0),nil) 
	return smalltalk.blk(__blk1__,2)._minus_gt(smalltalk.blk(__blk4__,4)) 
""","S8Simulator_toDoShortcut")
,"shortcuts","""toDoShortcut
	" Private - Returns the shortcut for the selector. "

	^[:receiver :args|
		receiver isNumber and: [
		args first isNumber and: [
		args last isKindOf: SimulationBlock ]] ]
	-> [:receiver :selector :args :cls| | i to blk loop |
		to := args first. blk := args last. i := receiver.
		self add: #toDo-exit step: [ self value: receiver ] in: nil.
		loop := [ i < to ifTrue: [ self add: #toDo-loop step: loop in: nil ].
			blk value: i. i := i + 1.
		].
		i <= to ifTrue: [ self add: #toDo-loop step: loop in: nil ].
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"toByDoShortcut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#toByDoShortcut
	def __blk1__(receiver,args):
		def __blk2__():
			def __blk3__():
				def __blk4__():
					return smalltalk.is_kindOf_(args.last(),(smalltalk.SimulationBlock)) 
				return smalltalk.boolean_and_(args.second().isNumber(),smalltalk.blk(__blk4__,0)) 
			return smalltalk.boolean_and_(args.first().isNumber(),smalltalk.blk(__blk3__,0)) 
		return smalltalk.boolean_and_(receiver.isNumber(),smalltalk.blk(__blk2__,0)) 
	def __blk5__(receiver,selector,args,cls):
		__1__=smalltalk.newContext()
		def __blk6__():
			return self.value_(receiver) 
		def __blk7__():
			if smalltalk.b(__1__.i._plus(__1__.increment).between_and_(__1__.min,__1__.max)):
				self.add_step_in_(smalltalk.String("toByDo-loop"),__1__.loop,nil) 
			 
			__1__.blk.value_(__1__.i) 
			__1__.i=__1__.i._plus(__1__.increment)
			return __1__.i 
		def __blk8__():
			return __1__.i._lt(__1__.to) 
		def __blk9__():
			return __1__.i._gt(__1__.to) 
		def __blk10__():
			return self.add_step_in_(smalltalk.String("toByDo-loop"),__1__.loop,nil) 
		__1__.i=nil
		__1__.to=nil
		__1__.increment=nil
		__1__.blk=nil
		__1__.loop=nil
		__1__.min=nil
		__1__.max=nil
		__1__.to=args.first() 
		__1__.increment=args.second() 
		__1__.blk=args.last() 
		__1__.i=receiver 
		__1__.min=receiver.min_(__1__.to) 
		__1__.max=receiver.max_(__1__.to) 
		self.add_step_in_(smalltalk.String("toByDo-exit"),smalltalk.blk(__blk6__,0),nil) 
		__1__.loop=smalltalk.blk(__blk7__,0) 
		return smalltalk.if_true_false_(smalltalk.if_true_false_(__1__.increment._gt(smalltalk.Number(0)),smalltalk.blk(__blk8__,0),smalltalk.blk(__blk9__,0)),smalltalk.blk(__blk10__,0),nil) 
	return smalltalk.blk(__blk1__,2)._minus_gt(smalltalk.blk(__blk5__,4)) 
""","S8Simulator_toByDoShortcut")
,"shortcuts","""toByDoShortcut
	" Private - Returns the shortcut for the selector. "

	^[:receiver :args|
		receiver isNumber and: [
		args first isNumber and: [ args second isNumber and: [
		args last isKindOf: SimulationBlock ]]] ]
	-> [:receiver :selector :args :cls| | i to increment blk loop min max |
		to := args first. increment := args second. blk := args last. i := receiver.
		min := receiver min: to. max := receiver max: to.
		self add: #toByDo-exit step: [ self value: receiver ] in: nil.
		loop := [	(i + increment between: min and: max) ifTrue: [
				self add: #toByDo-loop step: loop in: nil
			].
			blk value: i. i := i + increment. 
		].
		(increment > 0
			ifTrue: [ i < to ]
			ifFalse: [ i > to ])
		ifTrue: [ self add: #toByDo-loop step: loop in: nil ].
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"ifTrueShortcut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#ifTrueShortcut
	def __blk1__(receiver,args):
		def __blk2__():
			return smalltalk.is_kindOf_(args.last(),(smalltalk.SimulationBlock)) 
		return smalltalk.boolean_and_(smalltalk.isBoolean_(receiver),smalltalk.blk(__blk2__,0)) 
	def __blk3__(receiver,selector,args,cls):
		def __blk4__():
			return args.last().value() 
		def __blk5__():
			return self.value_(nil) 
		return smalltalk.if_true_false_(smalltalk.b_(receiver is smalltalk.true),smalltalk.blk(__blk4__,0),smalltalk.blk(__blk5__,0)) 
	return smalltalk.blk(__blk1__,2)._minus_gt(smalltalk.blk(__blk3__,4)) 
""","S8Simulator_ifTrueShortcut")
,"shortcuts","""ifTrueShortcut
	" Private - Returns the shortcut for the selector. "

	^[:receiver :args|
		receiver isBoolean and: [
		args last isKindOf: SimulationBlock ] ]
	-> [:receiver :selector :args :cls|
		receiver == true
		ifTrue: [ args last value ]
		ifFalse: [ self value: nil ]
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"ifFalseShortcut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#ifFalseShortcut
	def __blk1__(receiver,args):
		def __blk2__():
			return smalltalk.is_kindOf_(args.last(),(smalltalk.SimulationBlock)) 
		return smalltalk.boolean_and_(smalltalk.isBoolean_(receiver),smalltalk.blk(__blk2__,0)) 
	def __blk3__(receiver,selector,args,cls):
		def __blk4__():
			return args.last().value() 
		def __blk5__():
			return self.value_(nil) 
		return smalltalk.if_true_false_(smalltalk.b_(receiver is smalltalk.false),smalltalk.blk(__blk4__,0),smalltalk.blk(__blk5__,0)) 
	return smalltalk.blk(__blk1__,2)._minus_gt(smalltalk.blk(__blk3__,4)) 
""","S8Simulator_ifFalseShortcut")
,"shortcuts","""ifFalseShortcut
	" Private - Returns the shortcut for the selector. "

	^[:receiver :args|
		receiver isBoolean and: [
		args last isKindOf: SimulationBlock ] ]
	-> [:receiver :selector :args :cls|
		receiver == false
		ifTrue: [ args last value ]
		ifFalse: [ self value: nil ]
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"atIfAbsentShortcut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#atIfAbsentShortcut
	def __blk1__(receiver,args):
		return smalltalk.is_kindOf_(args.last(),(smalltalk.SimulationBlock)) 
	def __blk2__(receiver,selector,args,cls):
		__1__=smalltalk.newContext()
		def __blk3__():
			return __1__.failed 
		def __blk4__():
			def __blk5__():
				return args.last().value() 
			return self.add_step_in_(smalltalk.String("atIfAbsent-failed"),smalltalk.blk(__blk5__,0),nil) 
		def __blk6__():
			return self.value_(__1__.result) 
		__1__.failed=nil
		__1__.result=nil
		__1__.failed=smalltalk.Object.new() 
		__1__.result=receiver.at_ifAbsent_(args.first(),smalltalk.blk(__blk3__,0)) 
		return smalltalk.if_true_false_(smalltalk.b_(__1__.failed is __1__.result),smalltalk.blk(__blk4__,0),smalltalk.blk(__blk6__,0)) 
	return smalltalk.blk(__blk1__,2)._minus_gt(smalltalk.blk(__blk2__,4)) 
""","S8Simulator_atIfAbsentShortcut")
,"shortcuts","""atIfAbsentShortcut
	" Private - Returns the shortcut for the selector. "

	^[:receiver :args| args last isKindOf: SimulationBlock ]
	-> [:receiver :selector :args :cls| | failed result |
		failed := Object new.
		result := receiver at: args first ifAbsent: [ failed ].
		failed == result ifTrue: [
			self add: #atIfAbsent-failed step: [ args last value ] in: nil
		] ifFalse: [ self value: result ]
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"ifTrueIfFalseShortcut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#ifTrueIfFalseShortcut
	def __blk1__(receiver,args):
		def __blk2__():
			def __blk3__():
				return smalltalk.is_kindOf_(args.first(),(smalltalk.SimulationBlock)) 
			return smalltalk.boolean_and_(smalltalk.is_kindOf_(args.last(),(smalltalk.SimulationBlock)),smalltalk.blk(__blk3__,0)) 
		return smalltalk.boolean_and_(smalltalk.isBoolean_(receiver),smalltalk.blk(__blk2__,0)) 
	def __blk4__(receiver,selector,args,cls):
		def __blk5__():
			return args.first().value() 
		def __blk6__():
			return args.last().value() 
		return smalltalk.if_true_false_(smalltalk.b_(receiver is smalltalk.true),smalltalk.blk(__blk5__,0),smalltalk.blk(__blk6__,0)) 
	return smalltalk.blk(__blk1__,2)._minus_gt(smalltalk.blk(__blk4__,4)) 
""","S8Simulator_ifTrueIfFalseShortcut")
,"shortcuts","""ifTrueIfFalseShortcut
	" Private - Returns the shortcut for the selector. "

	^[:receiver :args|
		receiver isBoolean and: [
		(args last isKindOf: SimulationBlock) and: [
		args first isKindOf: SimulationBlock ]] ]
	-> [:receiver :selector :args :cls|
		receiver == true
		ifTrue: [ args first value ]
		ifFalse: [ args last value ]
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"ifFalseIfTrueShortcut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#ifFalseIfTrueShortcut
	def __blk1__(receiver,args):
		def __blk2__():
			def __blk3__():
				return smalltalk.is_kindOf_(args.first(),(smalltalk.SimulationBlock)) 
			return smalltalk.boolean_and_(smalltalk.is_kindOf_(args.last(),(smalltalk.SimulationBlock)),smalltalk.blk(__blk3__,0)) 
		return smalltalk.boolean_and_(smalltalk.isBoolean_(receiver),smalltalk.blk(__blk2__,0)) 
	def __blk4__(receiver,selector,args,cls):
		def __blk5__():
			return args.first().value() 
		def __blk6__():
			return args.last().value() 
		return smalltalk.if_true_false_(smalltalk.b_(receiver is smalltalk.false),smalltalk.blk(__blk5__,0),smalltalk.blk(__blk6__,0)) 
	return smalltalk.blk(__blk1__,2)._minus_gt(smalltalk.blk(__blk4__,4)) 
""","S8Simulator_ifFalseIfTrueShortcut")
,"shortcuts","""ifFalseIfTrueShortcut
	" Private - Returns the shortcut for the selector. "

	^[:receiver :args|
		receiver isBoolean and: [
		(args last isKindOf: SimulationBlock) and: [
		args first isKindOf: SimulationBlock ]] ]
	-> [:receiver :selector :args :cls|
		receiver == false
		ifTrue: [ args first value ]
		ifFalse: [ args last value ]
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"indexOfIfAbsentShortcut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#indexOfIfAbsentShortcut
	def __blk1__(receiver,args):
		return smalltalk.is_kindOf_(receiver,(smalltalk.SequenceableCollection)) 
	def __blk2__(receiver,selector,args,cls):
		__1__=smalltalk.newContext()
		def __blk3__():
			return __1__.failed 
		def __blk4__():
			def __blk5__():
				return args.last().value() 
			return self.add_step_in_(smalltalk.String("indexOfIfAbsent-failed"),smalltalk.blk(__blk5__,0),nil) 
		def __blk6__():
			return self.value_(__1__.result) 
		__1__.failed=nil
		__1__.result=nil
		__1__.failed=smalltalk.Object.new() 
		__1__.result=receiver.indexOf_ifAbsent_(args.first(),smalltalk.blk(__blk3__,0)) 
		return smalltalk.if_true_false_(smalltalk.b_(__1__.failed is __1__.result),smalltalk.blk(__blk4__,0),smalltalk.blk(__blk6__,0)) 
	return smalltalk.blk(__blk1__,2)._minus_gt(smalltalk.blk(__blk2__,4)) 
""","S8Simulator_indexOfIfAbsentShortcut")
,"shortcuts","""indexOfIfAbsentShortcut
	" Private - Returns the shortcut for the selector. "

	^[:receiver :args| receiver isKindOf: SequenceableCollection  ]
	-> [:receiver :selector :args :cls| | failed result |
		failed := Object new.
		result := receiver indexOf: args first ifAbsent: [ failed ].
		failed == result ifTrue: [
			self add: #indexOfIfAbsent-failed step: [ args last value ] in: nil
		] ifFalse: [ self value: result ]
	] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"sortedShortcut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#sortedShortcut
	def __blk1__(receiver,args):
		def __blk2__():
			return smalltalk.is_kindOf_(args.first(),(smalltalk.SimulationBlock)) 
		return smalltalk.boolean_and_(smalltalk.is_kindOf_(receiver,(smalltalk.SequenceableCollection)),smalltalk.blk(__blk2__,0)) 
	def __blk3__(receiver,selector,args,cls):
		return self.value_(receiver.sorted_(args.first().asBlock())) 
	return smalltalk.blk(__blk1__,2)._minus_gt(smalltalk.blk(__blk3__,4)) 
""","S8Simulator_sortedShortcut")
,"shortcuts","""sortedShortcut
	" Private - Returns the shortcut for the selector. "

	^[:receiver :args|
		(receiver isKindOf: SequenceableCollection) and: [
		args first isKindOf: SimulationBlock ] ]
	-> [:receiver :selector :args :cls| self value: (receiver sorted: args first asBlock) ] """,nil)

smalltalk.bind(smalltalk.S8Simulator,"sortShortcut",0
,smalltalk.__f__("""(self):
	#S8Simulator>>#sortShortcut
	def __blk1__(receiver,args):
		def __blk2__():
			return smalltalk.is_kindOf_(args.first(),(smalltalk.SimulationBlock)) 
		return smalltalk.boolean_and_(smalltalk.is_kindOf_(receiver,(smalltalk.SequenceableCollection)),smalltalk.blk(__blk2__,0)) 
	def __blk3__(receiver,selector,args,cls):
		return self.value_(receiver.sort_(args.first().asBlock())) 
	return smalltalk.blk(__blk1__,2)._minus_gt(smalltalk.blk(__blk3__,4)) 
""","S8Simulator_sortShortcut")
,"shortcuts","""sortShortcut
	" Private - Returns the shortcut for the selector. "

	^[:receiver :args|
		(receiver isKindOf: SequenceableCollection) and: [
		args first isKindOf: SimulationBlock ] ]
	-> [:receiver :selector :args :cls| self value: (receiver sort: args first asBlock) ] """,nil)
