In computer science, tail recursive parsers are a derivation from the more common recursive descent parsers. Tail recursive parsers are commonly used to parse left recursive grammars. They use a smaller amount of stack space than regular recursive descent parsers. They are also easy to write. Typical recursive descent parsers make parsing left recursive grammars impossible (because of an infinite loop problem). Tail recursive parsers use a node reparenting technique that makes this allowable.
Given an EBNF Grammar such as the following:
A basic example of this kind of parser in C is shown here. Implementation details have been omitted for simplicity.
exptree *parse_e(void)
exptree *parse_t(void)
exptree *parse_f(void)
exptree *parse_i(void)