Im trying to build small parser for XML files in C. I know, i could find some finished solutions but, i need just some basic stuff for embedded project. I`m trying to create grammar for describing XML without attributes, just tags, but it seems it is not working and i was not able to figure out why. Here is the grammar: \[code\] XML : FIRST_TAG NIZ NIZ : VAL NIZ | eps VAL : START VAL END | STR | eps\[/code\]Here is part of C code that implement this grammar :\[code\]void check() {getSymbol();if( sym == FIRST_LINE ){ niz();}else { printf("FIRST_LINE EXPECTED"); exit(1); }} void niz() {getSymbol();if( sym == ERROR ) return;if( sym == START ) { back = 1; val(); niz();}printf(" EPS OR START EXPECTED\n");}void val() {getSymbol();if( sym == ERROR ) return;if( sym == START ) { back = 0; val(); getSymbol(); if( sym != END ) { printf("END EXPECTED"); exit(1); } return;}if( sym == EMPTY_TAG || sym == STR) return;printf("START, STR, EMPTY_TAG OR EPS EXPECTED\n");exit(1);\[/code\]}\[code\] void getSymbol() {int pom;if(back == 1) { back = 0; return;}sym = getNextToken(cmd + offset, &pom);offset += pom + 1; }\[/code\]EDIT: Here is the example of XML file that does not satisfy this grammar:\[code\]<?xml version="1.0"?> <VATCHANGES> <DATE>15/08/2012</DATE><TIME>1452</TIME><EFDSERIAL>01KE000001</EFDSERIAL> <CHANGENUM>1</CHANGENUM> <VATRATE>A</VATRATE> <FROMVALUE>16.00</FROMVALUE> <TOVALUE>18.00</TOVALUE> <VATRATE>B</VATRATE> <FROMVALUE>2.00</FROMVALUE> <TOVALUE>0.00</TOVALUE> <VATRATE>C</VATRATE> <FROMVALUE>5.00</FROMVALUE> <TOVALUE>0.00</TOVALUE> <DATE>25/05/2010</DATE> <CHANGENUM>2</CHANGENUM> <VATRATE>C</VATRATE> <FROMVALUE>0.00</FROMVALUE> <TOVALUE>4.00</TOVALUE> </VATCHANGES> \[/code\]It gives END EXPECTED at the output.