implement token precedences