Template for my parser

Watch it and tell me if i have some wrong logic or it can be written
some better.