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
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
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
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
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
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