0% found this document useful (0 votes)
45 views1 page

BCT 2311 Compiler Construction Assignment II

The document outlines 3 assignments involving compiler construction: 1) writing a recursive descent calculator for integer addition and multiplication, 2) creating a LEX/YACC interpreter to count 'a's in a string based on a grammar, and 3) writing LEX/YACC specification files for a calculator that can add and subtract numbers.

Uploaded by

jeff.kaharu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views1 page

BCT 2311 Compiler Construction Assignment II

The document outlines 3 assignments involving compiler construction: 1) writing a recursive descent calculator for integer addition and multiplication, 2) creating a LEX/YACC interpreter to count 'a's in a string based on a grammar, and 3) writing LEX/YACC specification files for a calculator that can add and subtract numbers.

Uploaded by

jeff.kaharu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

BCT 2311 Compiler Construction - Assignment II

1. Using the Recursive Descent strategy, write a C program for a simple calculator that
can be used to perform integer arithmetic involving ‘+’ and ‘*’. Let your program
consist of a set of mutually recursive routines.

2. Using the following grammar

SaS|b

Create an interpreter using LEX and YACC which will count the number of a’s in the
input string.

3. Write a LEX and YACC specification files for a small calculator that can add and
subtract numbers.

You might also like