[Newcompiler] ASTTranslator>>#emitToDoNode:

Marcus Denker denker at iam.unibe.ch
Tue May 8 09:42:42 UTC 2007


On 08.05.2007, at 11:31, Mathieu Suen wrote:

> Hi,
>
> When I read this method I wonder why we are using stuff from the  
> RewriteTools:
>
>
> 	(limit isLiteral or:
> 		[limit isVariable and:
> 			[ParseTreeSearcher new
> 				matches: limit name , ' := `@object' do: [:n :a | false];
> 				executeTree: block initialAnswer: true]]
> 	) ifFalse: [
> 		limit := {iterator. #limit}.  "must be unique throughout method"
> 		methodBuilder addTemp: limit.
> 		methodBuilder storeTemp: limit.
> 		limitEmit := [methodBuilder pushTemp: limit].
> 	].
>
> I propose to add a Visitor to test if there is an affectation to  
> the first argument of the toDo.
>

Yes, using the ParseTreeSearcher is not got... for one, I'm sure it's  
fairly slow (the pattern
to be matched needs to be parsed), and the other problem is that it's  
using the RBParser,
which in turn makes the whole NewCompiler depend on the RBParser (and  
the RBTokens).

So we should try to break this dependency.

Another thing to be done later is to implement the ParseTreeSearcher  
on top of the SqueakParser
istead of RBParser.

	Marcus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3947 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/newcompiler/attachments/20070508/c41a4766/smime.bin


More information about the Newcompiler mailing list