added idea of actions and resources to parser; fixed some pretty printer bugs