The following programming languages question seems really unclear and what it wants me to do is not obvious to me, could somebody help me to understand it?
The question:
Implement part of a recursive descent parser for a simple set of language rules. Use any programming language for the implementation; if it isn’t a common language, please make a note of which language it is in a comment. You should implement functions for each of the nonterminal symbols and, using the following rules that describe part of a C-like language.
<ifblock> --> if(<logic_expr>){<stmts>} [else {<stmts>}]
<logic_expr> --> <value> == <value> | <value> != <value>
You may assume the following functions:
lex(), a lexical analyser which places a code for the next token in the global variable next token
stmts()
value()
Terminal symbols should be encoded with the following defined constants:
CODE LP for ‘(’
CODE RP for ‘)’
CODE LB for ‘{’
CODE RB for ‘{’
CODE EQ for ‘==’
CODE NEQ for ‘!=’
CODE IF for ‘if’
CODE ELSE for ‘else’