Starting from:

$35

Lab #6 Solution

Objective: Development of a recursive descent parser.

In this lab you need to design and implement a recursive descent parser for the arithmetic, relational, and logical expressions in C programming language. For this you need to design a non left recursive and left factored grammar and then the parser to be implemented. Note that you have already implemeted lexical analyzer using LEX in previous lab sessions. You need to combine the same with this parser so that any given input string is first tokenized and then parsed. You may make appropriate assumptions.

Please name the executable as rdparser. Your parser should accept the following valid expressions writ-ten in C language. You must submit also the grammar that your parser has implemented in the Readme file.

c == a+b && !flag
valid
a != 7
&& flag || c >= 6
valid
!b <=
12 && a%2 ==0
valid
!b < a < A ∗ 2
invalid














































9

More products