Re: [Pharo-project] Classes referenced in code string

2011-12-30 Thread Lukas Renggli
This is the rest of the code: ast := RBParser parseExpression: 'Object new. String new'. ast annotateInClass: UndefinedObject. (ast allChildren select: [ :each | each isVariable and: [ each variableBinding isLiteralBinding ] ]) collect: [ :each | each variableBinding binding value

Re: [Pharo-project] Classes referenced in code string

2011-12-30 Thread Sean P. DeNigris
Lukas Renggli wrote This is the rest of the code: Thanks Lukas! #annotateInClass: nil doesn't work... what's the class of nil? Seems so obvious now! -- View this message in context: http://forum.world.st/Classes-referenced-in-code-string-tp4244214p4246073.html Sent from the Pharo

[Pharo-project] Classes referenced in code string

2011-12-29 Thread Sean P. DeNigris
How would I programmatically find out what classes are referenced in a string. For example: 'Object new. String new' would return { Object. String } -- View this message in context: http://forum.world.st/Classes-referenced-in-code-string-tp4244214p4244214.html Sent from the Pharo Smalltalk

Re: [Pharo-project] Classes referenced in code string

2011-12-29 Thread Lukas Renggli
Can be easily done with RB: You parse it (RBParser parseExpression: aString) and do a semantic analysis (see the tests in AST-Tests-Semantics for examples). Lukas On Thursday, December 29, 2011, Sean P. DeNigris s...@clipperadams.com wrote: How would I programmatically find out what classes are

Re: [Pharo-project] Classes referenced in code string

2011-12-29 Thread Sean P. DeNigris
Lukas Renggli wrote Can be easily done with RB: You parse it (RBParser parseExpression: aString) and do a semantic analysis (see the tests in AST-Tests-Semantics for examples). Thanks, Lukas! How did I know that you would answer ;-) I got that far, but couldn't figure out what to pass to

Re: [Pharo-project] Classes referenced in code string

2011-12-29 Thread Lukas Renggli
On 30 December 2011 01:23, Sean P. DeNigris s...@clipperadams.com wrote: Lukas Renggli wrote Can be easily done with RB: You parse it (RBParser parseExpression: aString) and do a semantic analysis (see the tests in AST-Tests-Semantics for examples). Thanks, Lukas! How did I know that you