You are on page 1of 2

Bule Hora University

College of Informatics
Department of Computer Science
Compiler Design Project(20%)

Instruction
1. Each group should have 3 to 5 members not greater than five.
2. Deadline for Documentation and Demo Submission -29/06/2019
3. Presentation – 29/06/19
4. Each group member present their project

1. Develop or Build SQL Parse Generator For Relational Database Using lex and
YACC
2. Write a Lex and Yacc program that redisplays any expression composed of integers
and the following operators (+, -, *, /) It should also display an error message
whenever the input does not follow the above syntax. Don’t use attributes.
Example
Input: 123 + 234 \ 345 * 456
Output: 123 + 234 \ 345 * 456 Correct input
Input: 123 + + 234 \ 345 * 456
Output: 123 + + 234 \ 345 * 456 Syntax error
3. Calculator for integer expressions
Write a Lex and Yacc program that calculates the values of any expression composed
of integers and the following operators (+, -, *, /) The usual priority rules should be
respected. It should also display an error message whenever the input does not follow
the above syntax
i. Version I: All the integers are single digit
ii. Version II: The integers are of any number of digits
Examples
Input:
5+
4 \2 *
3
Output: The value of the expression is 11
Input: 1 + + 2 \ 3 * 4
Output: Syntax error
4. Write a Lex program that counts the number of words, characters and lines in a text
which is in multi-file composed of alphabetical character and punctuation.

You might also like