I've got a bit of my parser going
and am now wondering what I should
parse the elements into. My initial thought was to extend FAMIX and
then create appropriate elements of it. I'm not sure that's
appropriate, and would appreciate some advice.
First, it looks as if the sample smalltalk parser uses the AST from
and not the FAMIX models directly.
The Smalltalk importer traverses the AST provided by RB to produce a
Second, there are clear differences between the FAMIX models and the
immediate parse results. For example, suppose I have a variable (or
dataset for SAS) named X. The parser may treat each as distinct,
my model needs to describe the single entity to which each
the name refers. That single entity will have much richer information
(relations to other variables, the block of source code in which the
variable is defined or referenced ....) than the parser would
Exactly. You want the analysis model to be richer than the AST.
On the other hand, I could use the FAMIX models in initially a
lightweight way; otherwise it seems I could end up with fairly
duplicative parser classes and model classes.
So, would it be best to parse directly into my model classes, or to
parse into some other AST that is later used to make the model?
If you want a strong model, than doing it in two passes is what you
- first build the AST
- then resolve the relationships and build a richer model
Moose-dev mailing list
"Beauty is where we see it."