Le 31/03/2018 à 20:36, Steven Costiou a écrit :
> i was browsing the classes of the AST and i am curious about the
> RBPattern* classes.
> What are they used for?
They represent metavariables in pattern trees when you use refactorings.
Each pattern node specify a type of AST subtree that may be in that
place when you match some smalltalk source code against a refactoring
pattern. Once matched, an unification is done so that you can refer to
that metavariable content by name (for example, retrieve the top node of
that variable subtree).
> The RBPatternParser's comment says that it is used "to search and
> transform source code".
> After looking a bit in the senders and class refs, it seems it is used
> for refactorings and other stuff.
Refactorings and searches.
> But is that used at some point in code compilation?
No. But they could be used... if you do source to source transformations
when compiling, for example, you could use such patterns to rewrite the
code before compiling it; SmaCC for one uses that (create generic
methods, then scan all methods with a set of refactorings to rewrite an
optimised version of the code, such as merging contiguous character