Given an EBNF Grammar such as the following:
A simple tail recursive parser can be written much like a recursive descent parser. The typical algorithm for parsing a grammar like this using an abstract syntax tree is:
A basic example of this kind of parser in C is shown here. Implementation details have been omitted for simplicity.