A recursion-descent parsers is a reflection of the nature of programming languages. EBNF is ideally suited for such parsers. The syntax of these structures is naturally described with grammar rules.A recursion-descent parsing subprogram has a subprogram for each nonterminal in its associated grammar. When given an input string, it traces out the parse tree that can be rootedat that nonterminal and whose leaves match the input string. A subprogram for a rule with a single RHS is relatively simple. For each terminal symbol in the RHS, that terminal symbol is com- pared with nextToken. If they do not match, it is a syntax error. If they match, the lexical analyzer is called to get the next input token. For each nonterminal, the parsing subprogram for that nonterminal is called.