Analysis of file based on grammar