parser documentation and minor refactorings

I made documented the parser.