Must initTree always be invoked manually?

9 views
Skip to first unread message

Malte Schwerhoff

unread,
Dec 16, 2011, 12:01:26 PM12/16/11
to kiama
Hi all,

In the PicoJava example, at least as far as I can see, Main.scala
doesn't invoke initTree after parsing the program, whereas all test
cases do so, e.g. test/BasicNameResolutionTests.scala. Is initTree
somehow invoked implicitly when running Main?

I adopted the example, but when I don't invoke initTree myself the
children iterator in collectErrors is always empty.

Thanks,
Malte

Tony Sloane

unread,
Dec 19, 2011, 1:23:22 AM12/19/11
to ki...@googlegroups.com

Thanks for noticing this one; initTree should be called. It's a bug in the trunk version. I've pushed a fix.

BTW, the collectErrors style in the picojava example is designed to mimic the way the JastAdd Java version of the example works.

If you're starting from scratch would recommend more the style used in (say) the semantic analysis phase of the Obr example, since it uses the Kiama message module to record the errors.

cheers,
Tony

Reply all
Reply to author
Forward
0 new messages