In Squeak I can't say, but in Pharo, the Compiler can be "stupid" and compile more or less everything :) Ben On Jan 25, 2013, at 12:20 PM, Mircea SamoilÄ wrote:
I was just in the debugger stepping through code right now. Interestingly enough stepping through code like this gives you snapshots of execution, if i were to overlay them in Photoshop all at once i would get something close to what i want.
But what happens if the code does not exist, class names are not valid, method names are just examples.
If i were to analyze something like an example someone has posted somewhere.
Question 1: Would "invalid" code compile anyway and i would get the execution order inspecting the AST, as errors would pop up at "run time"?
Question 2: Or⦠invalid code does not compile and i don't get to the stage where AST gives me anything useful (when using copy pasted code from anywhere) so i have to code some kind of smalltalk "text" parser and search for the patterns myself?
Pe 25.01.2013, la 13:09, Göran Krampe <goran@krampe.se> a scris:
Hi!
Another way to answer:
1. If you want to show the order of the messages sent *without* actually executing the code you need to compile the code and inspect the AST. This is not that hard to do.
2. If you want to visualize the order while executing it - you could look at how Debugger works and simply "debug" the code programmatically. It basically means spawning a Process and sending "step" to it over and over and looking at where it is etc. Funky enough the Debugger is "just Smalltalk code". :)
regards, Göran