I have got one question about writing recursive descent parsing for checking pascal grammar. I have got this code for example:
a := c ;
I see that a,c is variables. := and ; - is terminals. This expression I can check. But if I have got smth like this:
a := c + 1 - d ;
I have got problems how to write recursive descent parsing for this expression.
For first example I wrote on C# like this:
if ((!parsing(current_token, "var")) || (!current_token, ":=")) || ( !parsing(current_token, "var") && !parsing(current_token, "const") ) || (!current_token, "term"))) show_error();
How can I write for second example? Thanks.