added ability to set anchors/ref in parser or  to get it

This PR was submitted on the symfony/Yaml read-only repository and moved automatically to the main Symfony repository (closes symfony/Yaml#10).

It is very needed when someone has custom yaml file loader with imports.
Now there is no way that parser has known mappings or scalars from imported files.