Building a recursive descent parser requires an algorithm and two distinct piece
ID: 3770399 • Letter: B
Question
Building a recursive descent parser requires an algorithm and two distinct pieces of input information. What are those two pieces ... AND WHY?
(YOU MUST ANSWER WHY you choose the answer you choose. Show source if available!!! Do not just list the answer.)
(a) A recursive and a descent
(b) A finite state automata and a regular expression
(c) A context-free grammar and a set of grammar-independent starting functions.
(d) A set of regular expressions, RE, and a set of RE-independent starting functions.
(e) A context-free grammar and a set of regular expressions.
Please show your source! DO NOT just list the answer!
Explanation / Answer
Building a recursive descent parser algorithm requires two pieces of input as-
e) A context free grammar and a set of regular expression..
A context free grammar is needed as if the grammar contains left recursion then the recursive descent paser doesn't
The recursive descent primitives can assume access to input:
Source: http://matt.might.net/articles/parsing-regex-with-recursive-descent/
http://www.cs.engr.uky.edu/~lewis/essays/compilers/rec-des.html
work.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.