
# fileIn("s8/library/scripting/S8Steps.st")
smalltalk.addClass("StepOverNode",smalltalk.MethodNode,["action"],"S8Steps")

smalltalk.bind(smalltalk.Compiler.__class__,"evaluationScript",0
,smalltalk.__f__("""(self):
	#Compiler class>>#evaluationScript
	return smalltalk.StepOverNode 
""","Compiler_class_evaluationScript")
,"S8Steps-private","""evaluationScript
	" Return the support for skipping method execution. "

	^StepOverNode """,nil)

smalltalk.bind(smalltalk.Compiler,"isSourcecode:",0
,smalltalk.__f__("""(self,string):
	_s8Ret_=smalltalk.newContext()
	try:
		#Compiler>>#isSourcecode:
		__0__=smalltalk.newContext()
		def __blk1__():
			return __0__.input.atEnd() 
		__0__.input=nil
		__0__.input=string.stream() 
		while not smalltalk.b(smalltalk.blk(__blk1__,0)()):
			def __blk2__():
				return smalltalk.raise_result_(_s8Ret_,smalltalk.false) 
			smalltalk.if_true_false_(__0__.input.upTo_(smalltalk.String.crlf()).includes_(smalltalk.String.lf()),smalltalk.blk(__blk2__,0),nil) 
		 
		smalltalk.raise_result_(_s8Ret_,smalltalk.true) 
	except Exception as __ex:
		if smalltalk.exception_at(__ex,_s8Ret_):
			return smalltalk.exceptionResult_(__ex)
		raise __ex
	
""","Compiler_isSourcecode_")
,"S8Steps-private","""isSourcecode: string
	" Private - Returns true if a string is formated as sourcecode. "

	| input |
	input := string stream.
	[input atEnd] whileFalse: [
		((input upTo: String crlf) includes: String lf) ifTrue: [ ^false ]
	].
	^true""",nil)

smalltalk.bind(smalltalk.Compiler,"sourcecode:",0
,smalltalk.__f__("""(self,string):
	#Compiler>>#sourcecode:
	__0__=smalltalk.newContext()
	def __blk1__():
		return __0__.input.atEnd() 
	__0__.input=nil
	__0__.output=nil
	if smalltalk.b(self.isSourcecode_(string)):
		return string 
	 
	__0__.input=string.stream() 
	__0__.output=smalltalk.String("").writeStream() 
	while not smalltalk.b(smalltalk.blk(__blk1__,0)()):
		def __blk2__():
			return __0__.output.cr() 
		__0__.output.nextPutAll_(__0__.input.nextLine()) 
		smalltalk.if_true_false_(__0__.input.atEnd(),nil,smalltalk.blk(__blk2__,0)) 
	 
	return __0__.output.contents() 
""","Compiler_sourcecode_")
,"S8Steps-private","""sourcecode: string
	" Private - Returns a string formated as sourcecode. "

	| input output |
	(self isSourcecode: string) ifTrue: [ ^string ].
	input := string stream.
	output := '' writeStream.
	[input atEnd] whileFalse: [
		output nextPutAll: input nextLine.
		input atEnd ifFalse: [ output cr ]
	].
	^output contents""",nil)

smalltalk.bind(smalltalk.Compiler,"scriptForMethod:onError:",0
,smalltalk.__f__("""(self,source,aBlock):
	#Compiler>>#scriptForMethod:onError:
	__0__=smalltalk.newContext()
	def __blk1__():
		__0__.node=self.parseMethod_(self.sourcecode_(source)) 
		if smalltalk.b(__0__.node.isParseFailure()):
			self.error_(smalltalk.to_String(__0__.node)) 
		 
		return __0__.node 
	def __blk2__(ex):
		return aBlock.value_(ex) 
	__0__.node=nil
	return smalltalk.blk(__blk1__,0).on_do_(smalltalk.Error,smalltalk.blk(__blk2__,1)) 
""","Compiler_scriptForMethod_onError_")
,"S8Steps-scripting","""scriptForMethod: source onError: aBlock
	" Return the compiled script for method with source code or the result of evaluating aBlock with error. "

	| node |
	^[	node := self parseMethod: (self sourcecode: source).
		node isParseFailure ifTrue: [ self error: node toString ].
		node
	] on: Error do: [:ex| aBlock value: ex ] """,nil)

smalltalk.bind(smalltalk.Compiler,"scriptForMethod:",0
,smalltalk.__f__("""(self,source):
	#Compiler>>#scriptForMethod:
	def __blk1__():
		return nil 
	return self.scriptForMethod_onError_(source,smalltalk.blk(__blk1__,0)) 
""","Compiler_scriptForMethod_")
,"S8Steps-scripting","""scriptForMethod: source
	" Return the compiled script for method with source code (or nil). "

	^self scriptForMethod: source onError: [ nil ] """,nil)

smalltalk.bind(smalltalk.CompilerNode,"isMessageNode",0
,smalltalk.__f__("""(self):
	#CompilerNode>>#isMessageNode
	return smalltalk.false 
""","CompilerNode_isMessageNode")
,"S8Steps-testing","""isMessageNode
	" Returns true if the receiver is a message send. "

	^false """,nil)

smalltalk.bind(smalltalk.CompilerNode,"isValid",0
,smalltalk.__f__("""(self):
	_s8Ret_=smalltalk.newContext()
	try:
		#CompilerNode>>#isValid
		if not smalltalk.b(self.isEmpty()):
			def __blk1__(each):
				def __blk2__():
					return smalltalk.raise_result_(_s8Ret_,smalltalk.false) 
				return smalltalk.if_true_false_(each.isValid(),nil,smalltalk.blk(__blk2__,0)) 
			getattr(self,"@nodes",nil).do_(smalltalk.blk(__blk1__,1)) 
		 
		smalltalk.raise_result_(_s8Ret_,smalltalk.true) 
	except Exception as __ex:
		if smalltalk.exception_at(__ex,_s8Ret_):
			return smalltalk.exceptionResult_(__ex)
		raise __ex
	
""","CompilerNode_isValid")
,"S8Steps-testing","""isValid
	" Returns true if the receiver is valid (for simulation). "

	self isEmpty ifFalse: [
		nodes do: [:each| each isValid ifFalse: [ ^false ] ]
	].
	^true """,nil)

smalltalk.bind(smalltalk.CompilerNode,"emptyActions:",0
,smalltalk.__f__("""(self,actions):
	#CompilerNode>>#emptyActions:
	return self.note_(smalltalk.object_comma_(smalltalk.String("WARNING: Empty actions for "),self)) 
""","CompilerNode_emptyActions_")
,"S8Steps-simulating","""emptyActions: actions
	" The actions taken to evaluate the receiver are empty. "

	^self note: 'WARNING: Empty actions for ' ,self """,nil)

smalltalk.bind(smalltalk.CompilerNode,"actionsIn:",0
,smalltalk.__f__("""(self,aContext):
	#CompilerNode>>#actionsIn:
	__0__=smalltalk.newContext()
	def __blk1__(total,each):
		def __blk2__(_s8_rec):
			_s8_rec.addAll_(each.actionsIn_(aContext)) 
			return _s8_rec.yourself() 
		return __blk2__(total) 
	__0__.result=nil
	__0__.result=self.nodes().inject_into_(smalltalk.newArray([]),smalltalk.blk(__blk1__,2)) 
	if smalltalk.b(__0__.result.isEmpty()):
		self.emptyActions_(__0__.result) 
	 
	return __0__.result 
""","CompilerNode_actionsIn_")
,"S8Steps-simulating","""actionsIn: aContext
	" Returns the steps to evaluate while simulating execution of the receiver in aContext.
	The default implementation returns the actions to evaluate the contents of receiver.
	This method can be refined by the subclasses.
	"

	| result |
	result := self nodes inject: #() into: [:total :each|
		total addAll: (each actionsIn: aContext); yourself
	].
	result isEmpty ifTrue: [ self emptyActions: result ].
	^result""",nil)

smalltalk.bind(smalltalk.AssignmentNode,"actionsIn:",0
,smalltalk.__f__("""(self,aContext):
	#AssignmentNode>>#actionsIn:
	def __blk1__(simulator):
		return simulator.add_in_(self.right(),aContext) 
	def __blk2__(simulator):
		return self.left().bind_in_(simulator.value(),aContext) 
	return smalltalk.Array.with_with_(smalltalk.blk(__blk1__,1),smalltalk.blk(__blk2__,1)) 
""","AssignmentNode_actionsIn_")
,"S8Steps-simulating","""actionsIn: aContext
	" Returns the steps to evaluate while simulating execution of the receiver in aContext. "

	^Array
		with: [:simulator| simulator add: self right in: aContext ]
		with: [:simulator| self left bind: simulator value in: aContext ] """,nil)

smalltalk.bind(smalltalk.AssignmentNode,"isValid",0
,smalltalk.__f__("""(self):
	#AssignmentNode>>#isValid
	def __blk1__():
		return self.left().isValid() 
	return smalltalk.boolean_and_(self.right().isValid(),smalltalk.blk(__blk1__,0)) 
""","AssignmentNode_isValid")
,"S8Steps-test","""isValid
	" Returns true if the receiver is valid (for simulation). "

	^self right isValid and: [ self left isValid ] """,nil)

smalltalk.bind(smalltalk.DirectiveNode,"isValid",0
,smalltalk.__f__("""(self):
	#DirectiveNode>>#isValid
	return smalltalk.false 
""","DirectiveNode_isValid")
,"S8Steps-test","""isValid
	" Returns true if the receiver is valid (for simulation). "

	^false """,nil)

smalltalk.bind(smalltalk.InlineNode,"isValid",0
,smalltalk.__f__("""(self):
	#InlineNode>>#isValid
	return smalltalk.notNil_(getattr(self,"@nodes",nil)) 
""","InlineNode_isValid")
,"S8Steps-test","""isValid
	" Returns true if the receiver is valid (for simulation).
	Actually we do NOT simulate methods with inlined code if not encoded for #s8.
	"

	^nodes notNil """,nil)

smalltalk.bind(smalltalk.MethodNode,"script",0
,smalltalk.__f__("""(self):
	#MethodNode>>#script
	def __blk1__():
		return self 
	return smalltalk.if_true_false_(self.isValid(),smalltalk.blk(__blk1__,0),nil) 
""","MethodNode_script")
,"S8Steps-converting","""script
	" Returns the receiver capable to be evaluated as a script. "

	^self isValid ifTrue: [ self ]""",nil)

smalltalk.bind(smalltalk.MethodNode,"actionsIn:",0
,smalltalk.__f__("""(self,aContext):
	#MethodNode>>#actionsIn:
	__0__=smalltalk.newContext()
	def __blk1__(simulator):
		def __blk2__(value):
			return simulator.exit_(value) 
		return self.exitBlock_(smalltalk.blk(__blk2__,1)) 
	__0__.result=nil
	__0__.result=smalltalk.superReceiver(smalltalk.MethodNode,self).actionsIn_(aContext) 
	__0__.result.addFirst_(smalltalk.blk(__blk1__,1)) 
	return __0__.result 
""","MethodNode_actionsIn_")
,"S8Steps-simulating","""actionsIn: aContext
	" Returns the steps to evaluate while simulating execution of the receiver in aContext. "

	| result |
	result := super actionsIn: aContext.
	result addFirst: [:simulator|
		self exitBlock: [:value| simulator exit: value ].
	].
	^result """,nil)

smalltalk.bind(smalltalk.MethodNode,"argsIn:",0
,smalltalk.__f__("""(self,mth):
	#MethodNode>>#argsIn:
	return mth.arguments() 
""","MethodNode_argsIn_")
,"S8Steps-native","""argsIn: mth
	" Private - Return the arguments bound to mth. "

	^mth arguments """,nil)

smalltalk.bind(smalltalk.MethodNode,"contextFor:binding:to:",0
,smalltalk.__f__("""(self,aReceiver,args,array):
	#MethodNode>>#contextFor:binding:to:
	__0__=smalltalk.newContext()
	def __blk1__(i):
		__1__=smalltalk.newContext()
		__1__.key=nil
		__1__.key=args.at_(i).value() 
		return __0__.result.at_put_(__1__.key,array.at_(i)) 
	__0__.result=nil
	__0__.count=nil
	__0__.result=smalltalk.S8Context.for_(aReceiver) 
	__0__.count=args.size().min_(array.size()) 
	smalltalk.Number(1).to_do_(__0__.count,smalltalk.blk(__blk1__,1)) 
	return __0__.result 
""","MethodNode_contextFor_binding_to_")
,"S8Steps-evaluating","""contextFor: aReceiver binding: args to: array
	" Private - Returns the context to evaluate the receiver on aReceiver with parameters. "

	| result count |
	result := S8Context for: aReceiver.
	count := args size min: array size.
	1 to: count do: [:i| | key |
		key := (args at: i) value.
		result at: key put: (array at: i)
	].
	^result """,nil)

smalltalk.bind(smalltalk.MethodNode,"stepsFor:entering:withArguments:",0
,smalltalk.__f__("""(self,aReceiver,aMethod,array):
	#MethodNode>>#stepsFor:entering:withArguments:
	__0__=smalltalk.newContext()
	def __blk1__(each):
		return smalltalk.SimulationStep.for_doing_in_(self,each,__0__.ctx) 
	__0__.ctx=nil
	__0__.ctx=self.contextFor_binding_to_(aReceiver,self.argsIn_(aMethod),array) 
	return self.actionsIn_(__0__.ctx).collect_(smalltalk.blk(__blk1__,1)) 
""","MethodNode_stepsFor_entering_withArguments_")
,"S8Steps-simulating","""stepsFor: aReceiver entering: aMethod withArguments: array
	" Returns the steps to evaluate execution of the receiver activating aMethod. "

	| ctx |
	ctx := self contextFor: aReceiver binding: (self argsIn: aMethod) to: array.
	^(self actionsIn: ctx) collect: [:each|
		SimulationStep for: self doing: each in: ctx
	]""",nil)

smalltalk.bind(smalltalk.StepOverNode.__class__,"doing:",0
,smalltalk.__f__("""(self,aBlock):
	#StepOverNode class>>#doing:
	return self.new().initialize_(aBlock) 
""","StepOverNode_class_doing_")
,"instantiation","""doing: aBlock
	" Returns an instance of the receiver. "

	^self new initialize: aBlock """,nil)

smalltalk.bind(smalltalk.StepOverNode,"initialize:",0
,smalltalk.__f__("""(self,anAction):
	#StepOverNode>>#initialize:
	smalltalk.basic_at_put(self,"@action",anAction) 
	return self 
""","StepOverNode_initialize_")
,"initialize","""initialize: anAction
	" Private - Initialize the receiver. "

	action := anAction """,nil)

smalltalk.bind(smalltalk.StepOverNode,"stepsFor:entering:withArguments:",0
,smalltalk.__f__("""(self,aReceiver,aMethod,array):
	#StepOverNode>>#stepsFor:entering:withArguments:
	self.sourceRange_(smalltalk.Number(0).to_(aMethod.source().size()._minus(smalltalk.Number(1)))) 
	return smalltalk.superReceiver(smalltalk.StepOverNode,self).stepsFor_entering_withArguments_(aReceiver,aMethod,array) 
""","StepOverNode_stepsFor_entering_withArguments_")
,"simulating","""stepsFor: aReceiver entering: aMethod withArguments: array
	" Returns the steps to evaluate execution of the receiver activating aMethod. "

	self sourceRange: (0 to: aMethod source size - 1).
	^super stepsFor: aReceiver entering: aMethod withArguments: array """,nil)

smalltalk.bind(smalltalk.StepOverNode,"contextFor:binding:to:",0
,smalltalk.__f__("""(self,aReceiver,args,array):
	#StepOverNode>>#contextFor:binding:to:
	__0__=smalltalk.newContext()
	def __blk1__(i):
		return __0__.result.at_put_(args.at_(i),array.at_(i)) 
	__0__.result=nil
	__0__.count=nil
	__0__.result=smalltalk.S8Context.for_(aReceiver) 
	__0__.count=args.size().min_(array.size()) 
	smalltalk.Number(1).to_do_(__0__.count,smalltalk.blk(__blk1__,1)) 
	return __0__.result 
""","StepOverNode_contextFor_binding_to_")
,"evaluating","""contextFor: aReceiver binding: args to: array
	" Returns the context to evaluate the receiver on aReceiver with parameters. "

	| result count |
	result := S8Context for: aReceiver.
	count := args size min: array size.
	1 to: count do: [:i| result at: (args at: i) put: (array at: i) ].
	^result """,nil)

smalltalk.bind(smalltalk.StepOverNode,"argsIn:",0
,smalltalk.__f__("""(self,aMethod):
	#StepOverNode>>#argsIn:
	__0__=smalltalk.newContext()
	def __blk1__(each):
		__0__.i=__0__.i._plus(smalltalk.Number(1)) 
		return smalltalk.object_comma_(smalltalk.object_comma_(smalltalk.object_comma_(smalltalk.String("("),__0__.i),smalltalk.String(")")),each) 
	__0__.i=nil
	__0__.i=smalltalk.Number(0) 
	return aMethod.selector().asArrayOfSubstringsSeparatedBy_(smalltalk.String(":")).collect_(smalltalk.blk(__blk1__,1)) 
""","StepOverNode_argsIn_")
,"native","""argsIn: aMethod
	" Private - Return the arguments bound to aMethod. "

	| i | i := 0.
	^(aMethod selector asArrayOfSubstringsSeparatedBy: $:) collect: [:each|
		i := i + 1. $( ,i ,$) ,each
	] """,nil)

smalltalk.bind(smalltalk.StepOverNode,"evaluateContentsIn:",0
,smalltalk.__f__("""(self,localContext):
	#StepOverNode>>#evaluateContentsIn:
	if smalltalk.b(self.isEmpty()):
		return getattr(self,"@action",nil).evaluateWith_(nil) 
	 
	return self.invalidMessage_(smalltalk.String("evaluateContentsIn:")) 
""","StepOverNode_evaluateContentsIn_")
,"evaluating","""evaluateContentsIn: localContext
	" Private - Returns the result of evaluating the contents of the receiver in local context. "

	self isEmpty ifTrue: [ ^action evaluateWith: nil ].
	^self invalidMessage: #evaluateContentsIn: """,nil)

smalltalk.bind(smalltalk.StepOverNode,"inject:in:",0
,smalltalk.__f__("""(self,simulator,aContext):
	#StepOverNode>>#inject:in:
	if smalltalk.b(self.isEmpty()):
		def __blk1__(simulator):
			return simulator.value_(getattr(self,"@action",nil).evaluateWith_(simulator)) 
		return simulator.add_step_in_(self,smalltalk.blk(__blk1__,1),aContext) 
	 
	return self.invalidMessage_(smalltalk.String("inject:in:")) 
""","StepOverNode_inject_in_")
,"internal","""inject: simulator in: aContext
	" Private - Add the steps for evaluation of contents of the receiver in aContext. "

	self isEmpty ifTrue: [
		^simulator add: self
			step: [:simulator| simulator value: (action evaluateWith: simulator) ]
			in: aContext
	].
	^self invalidMessage: #inject:in: """,nil)

smalltalk.bind(smalltalk.StepOverNode,"actionsIn:",0
,smalltalk.__f__("""(self,aContext):
	#StepOverNode>>#actionsIn:
	def __blk1__(simulator):
		return simulator.value_(getattr(self,"@action",nil).value_(simulator)) 
	return smalltalk.Array.with_(smalltalk.blk(__blk1__,1)) 
""","StepOverNode_actionsIn_")
,"S8Steps-simulating","""actionsIn: aContext
	" Returns the steps to evaluate while simulating execution of the receiver in aContext. "

	^Array with: [:simulator| simulator value: (action value: simulator) ] """,nil)

smalltalk.bind(smalltalk.ReturnNode,"actionsIn:",0
,smalltalk.__f__("""(self,aContext):
	#ReturnNode>>#actionsIn:
	def __blk1__(_s8_rec):
		def __blk2__(simulator):
			def __blk3__():
				return getattr(self,"@exitBlock",nil).value_(simulator.value()) 
			return simulator.return_in_then_(self,aContext,smalltalk.blk(__blk3__,0)) 
		_s8_rec.add_(smalltalk.blk(__blk2__,1)) 
		return _s8_rec.yourself() 
	return __blk1__(smalltalk.superReceiver(smalltalk.ReturnNode,self).actionsIn_(aContext)) 
""","ReturnNode_actionsIn_")
,"S8Steps-simulating","""actionsIn: aContext
	" Returns the steps to evaluate while simulating execution of the receiver in aContext. "

	^(super actionsIn: aContext)
		add: [:simulator|
			simulator return: self in: aContext then: [
				exitBlock value: simulator value
			]
		];
		yourself """,nil)

smalltalk.bind(smalltalk.ScopedNode,"inject:in:",0
,smalltalk.__f__("""(self,simulator,aContext):
	#ScopedNode>>#inject:in:
	return self.inject_in_catch_curtail_finally_(simulator,aContext,nil,nil,nil) 
""","ScopedNode_inject_in_")
,"S8Steps-internal","""inject: simulator in: aContext
	" Private - Add the steps for evaluation of contents of the receiver in aContext. "

	^self	inject: simulator in: aContext
		catch: nil curtail: nil finally: nil """,nil)

smalltalk.bind(smalltalk.ScopedNode,"inject:in:catch:curtail:finally:",0
,smalltalk.__f__("""(self,simulator,aContext,catcher,curtail,final):
	#ScopedNode>>#inject:in:catch:curtail:finally:
	simulator.addBlock_contents_in_catch_curtail_finally_(self,self.nodes(),aContext,catcher,curtail,final) 
	if smalltalk.b(self.isEmpty()):
		def __blk1__():
			return simulator.value_(nil) 
		return simulator.add_step_in_(self,smalltalk.blk(__blk1__,0),aContext) 
	 
	return self 
""","ScopedNode_inject_in_catch_curtail_finally_")
,"S8Steps-internal","""inject: simulator in: aContext catch: catcher curtail: curtail finally: final
	" Private - Add the steps for evaluation of contents of the receiver in aContext. "

	simulator
		addBlock: self contents: self nodes in: aContext
		catch: catcher curtail: curtail finally: final.
	self isEmpty ifTrue: [
		^simulator add: self step: [ simulator value: nil ] in: aContext
	].""",nil)

smalltalk.bind(smalltalk.ScopedNode,"contextVariables",0
,smalltalk.__f__("""(self):
	#ScopedNode>>#contextVariables
	return self.implementedBySubclass_(smalltalk.String("contextVariables")) 
""","ScopedNode_contextVariables")
,"S8Steps-activation","""contextVariables
	" Private - Returns the variables involved in activation of the receiver. "

	^self implementedBySubclass: #contextVariables """,nil)

smalltalk.bind(smalltalk.ScopedNode,"content:actionsIn:",0
,smalltalk.__f__("""(self,simulator,aContext):
	#ScopedNode>>#content:actionsIn:
	return self.implementedBySubclass_(smalltalk.String("content:actionsIn:")) 
""","ScopedNode_content_actionsIn_")
,"S8Steps-internal","""content: simulator actionsIn: aContext
	" Private - Add the steps for evaluation of contents of the receiver in aContext. "

	^self implementedBySubclass: #content:actionsIn: """,nil)

smalltalk.bind(smalltalk.ScopedNode,"actionsIn:",0
,smalltalk.__f__("""(self,aContext):
	#ScopedNode>>#actionsIn:
	def __blk1__(simulator):
		def __blk2__(ctx):
			return self.content_actionsIn_(simulator,ctx) 
		return smalltalk.S8Context.in_clear_do_(aContext,self.contextVariables(),smalltalk.blk(__blk2__,1)) 
	if smalltalk.b(self.isEmpty()):
		def __blk3__(simulator):
			return self.content_actionsIn_(simulator,aContext) 
		return smalltalk.Array.with_(smalltalk.blk(__blk3__,1)) 
	 
	return smalltalk.Array.with_(smalltalk.blk(__blk1__,1)) 
""","ScopedNode_actionsIn_")
,"S8Steps-simulating","""actionsIn: aContext
	" Returns the steps to evaluate while simulating execution of the receiver in aContext. "

	self isEmpty ifTrue: [
		^Array with: [:simulator| self content: simulator actionsIn: aContext ]
	].
	^Array with: [:simulator|
		S8Context
			in: aContext clear: self contextVariables
			do: [:ctx| self content: simulator actionsIn: ctx ]
	] """,nil)

smalltalk.bind(smalltalk.BlockNode,"contextVariables",0
,smalltalk.__f__("""(self):
	#BlockNode>>#contextVariables
	return self.parameters() 
""","BlockNode_contextVariables")
,"bindings","""contextVariables
	" Private - Returns the variables involved in activation of the receiver. "

	^self parameters """,nil)

smalltalk.bind(smalltalk.BlockNode,"content:actionsIn:",0
,smalltalk.__f__("""(self,simulator,aContext):
	#BlockNode>>#content:actionsIn:
	__0__=smalltalk.newContext()
	def __blk1__():
		__0__.block.simulator_(simulator) 
		return simulator.value_(__0__.block) 
	__0__.block=nil
	__0__.block=smalltalk.SimulationBlock.for_in_(self,aContext) 
	return simulator.add_step_in_(self,smalltalk.blk(__blk1__,0),aContext) 
""","BlockNode_content_actionsIn_")
,"S8Steps-internal","""content: simulator actionsIn: aContext
	" Private - Add the steps for evaluation of contents of the receiver in aContext. "

	| block |
	block := SimulationBlock for: self in: aContext.
	^simulator add: self step: [
		block simulator: simulator.		
		simulator value: block
	] in: aContext """,nil)

smalltalk.bind(smalltalk.CascadeNode,"isMessageNode",0
,smalltalk.__f__("""(self):
	#CascadeNode>>#isMessageNode
	return smalltalk.true 
""","CascadeNode_isMessageNode")
,"S8Steps-query","""isMessageNode
	" Returns true if the receiver is a message send. "

	^true """,nil)

smalltalk.bind(smalltalk.CascadeNode,"isValid",0
,smalltalk.__f__("""(self):
	#CascadeNode>>#isValid
	def __blk1__():
		return self.receiver().isValid() 
	return smalltalk.boolean_and_(smalltalk.superReceiver(smalltalk.CascadeNode,self).isValid(),smalltalk.blk(__blk1__,0)) 
""","CascadeNode_isValid")
,"S8Steps-test","""isValid
	" Returns true if the receiver is valid (for simulation). "

	^super isValid and: [ self receiver isValid ] """,nil)

smalltalk.bind(smalltalk.CascadeNode,"contextVariables",0
,smalltalk.__f__("""(self):
	#CascadeNode>>#contextVariables
	return smalltalk.newArray([]) 
""","CascadeNode_contextVariables")
,"bindings","""contextVariables
	" Private - Returns the variables involved in activation of the receiver. "

	^#() """,nil)

smalltalk.bind(smalltalk.CascadeNode,"content:actionsIn:",0
,smalltalk.__f__("""(self,simulator,aContext):
	#CascadeNode>>#content:actionsIn:
	__0__=smalltalk.newContext()
	def __blk1__(each):
		return each.shallowCopy() 
	def __blk2__():
		return simulator.add_in_(__0__.head,aContext) 
	def __blk3__():
		__1__=smalltalk.newContext()
		def __blk4__(each):
			return each.receiver_(__1__.literal) 
		__1__.value=nil
		__1__.literal=nil
		__1__.value=simulator.value() 
		__1__.literal=smalltalk.ValueNode.literal_value_(smalltalk.String("$rec"),__1__.value) 
		__1__.literal.sourceRange_(__0__.head.sourceRange()) 
		__0__.tail.do_(smalltalk.blk(__blk4__,1)) 
		return simulator.addAll_in_(__0__.tail,aContext) 
	__0__.head=nil
	__0__.tail=nil
	__0__.tail=self.nodes().collect_(smalltalk.blk(__blk1__,1)) 
	if smalltalk.b(__0__.tail.isEmpty()):
		return self.error_(smalltalk.String("Empty cascade - Should not happen")) 
	 
	__0__.head=self.receiver() 
	return simulator.add_steps_in_(self,smalltalk.Array.with_with_(smalltalk.blk(__blk2__,0),smalltalk.blk(__blk3__,0)),aContext) 
""","CascadeNode_content_actionsIn_")
,"S8Steps-internal","""content: simulator actionsIn: aContext
	" Private - Add the steps for evaluation of contents of the receiver in aContext. "

	| head tail |
	tail := self nodes collect: [:each| each shallowCopy ].
	tail isEmpty ifTrue: [
		^self error: 'Empty cascade - Should not happen'
	].
	head := self receiver.
	^simulator add: self steps: (Array
		with: [ simulator add: head in: aContext ]
		with: [ | value literal |
			value := simulator value.
			literal := ValueNode literal: '$rec' value: value.
			literal sourceRange: head sourceRange.
			tail do: [:each| each receiver: literal ].
			" aContext at: '$rec' put: value. "
			simulator addAll: tail in: aContext
		]) in: aContext """,nil)

smalltalk.bind(smalltalk.SequenceNode,"contextVariables",0
,smalltalk.__f__("""(self):
	#SequenceNode>>#contextVariables
	return self.temps() 
""","SequenceNode_contextVariables")
,"bindings","""contextVariables
	" Private - Returns the variables involved in activation of the receiver. "

	^self temps """,nil)

smalltalk.bind(smalltalk.SequenceNode,"content:actionsIn:",0
,smalltalk.__f__("""(self,simulator,aContext):
	#SequenceNode>>#content:actionsIn:
	return self.inject_in_(simulator,aContext) 
""","SequenceNode_content_actionsIn_")
,"S8Steps-internal","""content: simulator actionsIn: aContext
	" Private - Add the steps for evaluation of contents of the receiver in aContext. "

	^self inject: simulator in: aContext """,nil)

smalltalk.bind(smalltalk.ExtendedSequenceNode,"actionsIn:",0
,smalltalk.__f__("""(self,aContext):
	#ExtendedSequenceNode>>#actionsIn:
	__0__=smalltalk.newContext()
	def __blk1__(total,each):
		def __blk2__(_s8_rec):
			_s8_rec.addAll_(each.actionsIn_(aContext)) 
			return _s8_rec.yourself() 
		return __blk2__(total) 
	__0__.result=nil
	__0__.result=self.directives().inject_into_(smalltalk.newArray([]),smalltalk.blk(__blk1__,2)) 
	__0__.result.addAll_(smalltalk.superReceiver(smalltalk.ExtendedSequenceNode,self).actionsIn_(aContext)) 
	return __0__.result 
""","ExtendedSequenceNode_actionsIn_")
,"S8Steps-simulating","""actionsIn: aContext
	" Returns the steps to evaluate while simulating execution of the receiver in aContext. "

	| result |
	result := self directives inject: #() into: [:total :each|
		total addAll: (each actionsIn: aContext); yourself
	].
	result addAll: (super actionsIn: aContext).
	^result""",nil)

smalltalk.bind(smalltalk.SendNode,"actionsIn:",0
,smalltalk.__f__("""(self,aContext):
	#SendNode>>#actionsIn:
	def __blk1__(simulator):
		return simulator.add_in_(self.receiver(),aContext) 
	def __blk2__(simulator):
		return simulator.add_steps_in_(self,self.steps_in_(simulator.value(),aContext),aContext) 
	return smalltalk.Array.with_with_(smalltalk.blk(__blk1__,1),smalltalk.blk(__blk2__,1)) 
""","SendNode_actionsIn_")
,"S8Steps-simulating","""actionsIn: aContext
	" Returns the steps to evaluate while simulating execution of the receiver in aContext. "

	^Array
		with: [:simulator| simulator add: self receiver in: aContext ]
		with: [:simulator| simulator add: self steps: (self steps: simulator value in: aContext) in: aContext ] """,nil)

smalltalk.bind(smalltalk.SendNode,"steps:in:",0
,smalltalk.__f__("""(self,anObject,aContext):
	#SendNode>>#steps:in:
	__0__=smalltalk.newContext()
	def __blk1__(simulator):
		return simulator.collect_all_in_(self,self.arguments(),aContext) 
	def __blk2__(simulator):
		__1__=smalltalk.newContext()
		__1__.send=nil
		__1__.send=self.steps_toSend_to_withArguments_in_(__0__.type,self.selector(),anObject,simulator.value(),aContext) 
		return simulator.add_steps_in_(self,__1__.send,aContext) 
	__0__.type=nil
	if smalltalk.b(self.receiver().isOO()):
		__0__.type=smalltalk.String("message") 
	 
	if smalltalk.b(self.receiver().isSuper()):
		__0__.type=smalltalk.String("super") 
	 
	return smalltalk.Array.with_with_(smalltalk.blk(__blk1__,1),smalltalk.blk(__blk2__,1)) 
""","SendNode_steps_in_")
,"S8Steps-simulating","""steps: anObject in: aContext
	" Private - Returns the steps to simulate message sent to anObject in aContext. "

	| type |
	self receiver isOO ifTrue: [ type := #message ].
	self receiver isSuper ifTrue: [ type := #super ].
	^Array	with: [:simulator| simulator collect: self all: self arguments in: aContext ]
		with: [:simulator| | send |
			send := self
				steps: type toSend: self selector
				to: anObject withArguments: simulator value
				in: aContext.
			simulator add: self steps: send in: aContext 
		] """,nil)

smalltalk.bind(smalltalk.SendNode,"valuesToSend:to:withArguments:in:",0
,smalltalk.__f__("""(self,msg,anObject,values,aContext):
	#SendNode>>#valuesToSend:to:withArguments:in:
	def __blk1__(each):
		def __blk2__():
			return self.callableOf_(each) 
		def __blk3__():
			return each 
		return smalltalk.if_true_false_(smalltalk.is_kindOf_(each,(smalltalk.SimulationBlock)),smalltalk.blk(__blk2__,0),smalltalk.blk(__blk3__,0)) 
	if not smalltalk.b(msg.startsWith_(smalltalk.String("#"))):
		return values 
	 
	return values.collect_(smalltalk.blk(__blk1__,1)) 
""","SendNode_valuesToSend_to_withArguments_in_")
,"S8Steps-sending","""valuesToSend: msg to: anObject withArguments: values in: aContext
	" Private - Returns the arguments to send msg to anObject. "

	(msg startsWith: $#) ifFalse: [ ^values ].
	^values collect: [:each|
		(each isKindOf: SimulationBlock)
		ifTrue: [ self callableOf: each ]
		ifFalse: [ each ]
	] """,nil)

smalltalk.bind(smalltalk.SendNode,"steps:toSend:to:withArguments:in:",0
,smalltalk.__f__("""(self,type,msg,anObject,objects,aContext):
	#SendNode>>#steps:toSend:to:withArguments:in:
	def __blk1__():
		nil 
	def __blk2__(simulator):
		__1__=smalltalk.newContext()
		def __blk3__():
			return simulator.topFrame().method().classField().superclass() 
		def __blk4__():
			return (anObject).__class__ 
		__1__.cls=nil
		__1__.cls=smalltalk.if_true_false_(smalltalk.isObject_equalTo_(type,smalltalk.String("super")),smalltalk.blk(__blk3__,0),smalltalk.blk(__blk4__,0)) 
		return simulator.activate_message_for_withArguments_(__1__.cls,(self).__class__.selectorToSend_(msg),anObject,self.valuesToSend_to_withArguments_in_(msg,anObject,objects,aContext)) 
	if smalltalk.b(smalltalk.notNil_((self).__class__.actionToSend_ifAbsent_(msg,smalltalk.blk(__blk1__,0)))):
		def __blk5__(simulator):
			return simulator.value_(self.send_to_withArguments_in_(msg,anObject,objects,aContext)) 
		return smalltalk.Array.with_(smalltalk.blk(__blk5__,1)) 
	 
	return smalltalk.Array.with_(smalltalk.blk(__blk2__,1)) 
""","SendNode_steps_toSend_to_withArguments_in_")
,"S8Steps-simulating","""steps: type toSend: msg to: anObject withArguments: objects in: aContext
	" Private - Returns the steps to simulate message sent to anObject in aContext. "

	(self class actionToSend: msg ifAbsent: []) notNil ifTrue: [ "optimized/native message sent"
		^Array with: [:simulator|
			simulator value: (self send: msg to: anObject withArguments: objects in: aContext)
		]
	].
	^Array with: [:simulator| | cls |
		cls := type = #super
			ifTrue: [ simulator topFrame method classField superclass ]
			ifFalse: [ anObject class ].
		simulator
			activate: cls message: (self class selectorToSend: msg)
			for: anObject withArguments: (self
				valuesToSend: msg to: anObject
				withArguments: objects in: aContext)
	] """,nil)

smalltalk.bind(smalltalk.SendNode,"isMessageNode",0
,smalltalk.__f__("""(self):
	#SendNode>>#isMessageNode
	return smalltalk.true 
""","SendNode_isMessageNode")
,"S8Steps-query","""isMessageNode
	" Returns true if the receiver is a message send. "

	^true """,nil)

smalltalk.bind(smalltalk.SendNode,"isValid",0
,smalltalk.__f__("""(self):
	_s8Ret_=smalltalk.newContext()
	try:
		#SendNode>>#isValid
		def __blk1__(each):
			def __blk2__():
				return smalltalk.raise_result_(_s8Ret_,smalltalk.false) 
			return smalltalk.if_true_false_(each.isValid(),nil,smalltalk.blk(__blk2__,0)) 
		if smalltalk.b(smalltalk.notNil_(self.receiver())):
			def __blk3__():
				return smalltalk.raise_result_(_s8Ret_,smalltalk.false) 
			smalltalk.if_true_false_(getattr(self,"@receiver",nil).isValid(),nil,smalltalk.blk(__blk3__,0)) 
		 
		self.arguments().do_(smalltalk.blk(__blk1__,1)) 
		smalltalk.raise_result_(_s8Ret_,smalltalk.superReceiver(smalltalk.SendNode,self).isValid()) 
	except Exception as __ex:
		if smalltalk.exception_at(__ex,_s8Ret_):
			return smalltalk.exceptionResult_(__ex)
		raise __ex
	
""","SendNode_isValid")
,"S8Steps-test","""isValid
	" Returns true if the receiver is valid (for simulation). "

	self receiver notNil ifTrue: [ receiver isValid ifFalse: [ ^false ] ].
	self arguments do: [:each| each isValid ifFalse: [ ^false ] ].
	^super isValid """,nil)

smalltalk.bind(smalltalk.ValueNode,"actionsIn:",0
,smalltalk.__f__("""(self,aContext):
	#ValueNode>>#actionsIn:
	def __blk1__(simulator):
		return simulator.value_(self.evaluateIn_(aContext)) 
	return smalltalk.Array.with_(smalltalk.blk(__blk1__,1)) 
""","ValueNode_actionsIn_")
,"S8Steps-simulating","""actionsIn: aContext
	" Returns the steps to evaluate while simulating execution of the receiver in aContext. "

	^Array with: [:simulator|
		simulator value: (self evaluateIn: aContext)
	] """,nil)
