added -P option to print, and extra details to declaration nodes