[squeak-dev] Smacc and CPD

Matthias Berth matthias.berth at googlemail.com
Tue Mar 4 19:16:26 UTC 2008


Davide, Lukas,

I'm just guessing here - Davide wants to compare the parse trees of,
say, two methods, as opposed to the source code. That's what the CPD
(copy/paste detector) is proud of, they can identify copied Java code
even if it was reformatted.

In Smalltalk, you can access or create the parse tree of a method (I
don't know how, sorry). So there is no need to write your own parser.

Another route would be to normalize the code before comparison, check
out the implementors / senders of prettyPrint:. Then you would compare
lines of normalized code.

HTH

Matthias





On Mon, Mar 3, 2008 at 11:05 PM, Lukas Renggli <renggli at gmail.com> wrote:
> > No hints?
>  > Davide
>
>  The NewCompiler on squeaksource.com uses SmaCC for example. SmaCC
>  itself comes with many examples. It also includes a small tutorial.
>
>  What I find a bit strange how you ask your question: "I have problem
>  X. How do I use SmaCC to solve it?" In my opinion you should first try
>  to formulate the steps to get to a solution and only afterwards look
>  for tools that could help you reaching this goal? I don't understand
>  what you want to do ...
>
>  Lukas
>
>  --
>  Lukas Renggli
>  http://www.lukas-renggli.ch
>
>



More information about the Squeak-dev mailing list