On Jun 7, 2004, at 4:35 PM, Marcel Weiher wrote:
However, I think it would be even better if we decoupled the execution-object-tree (whatever you want to call it) from the syntax tree generated by the compiler. After all, one particular syntax is just another view onto the code (MVC), right? ;-)
Hmm, I'm not sure I buy that. If there's some representation of a Smalltalk method that is a more general high-level abstraction than an AST, I'd like to know what it is. (Note that I'm talking about an abstract, not concrete, syntax tree).
The AST for a Smalltalk method is pretty clean. There isn't a whole lot in the syntax that isn't related to the semantics of the method's execution. So it wouldn't be difficult to create parsers and pretty printers to support alternate syntax. But really, why bother? Does anyone actually use the alternate syntax we already have? I am interested in alternate views of the code, just not alternate *syntax.*
Also, keeping the AST reasonably equivalent to it's textual representation has a lot of advantages - you can write tools like the refactoring browser or the debugger that present the code the programmer textually, but operate on the AST internally.
"ExpressionObjects" can be structured CompiledMethods and much, much more...
Like what?
Colin