COMPUTER SCIENCE
& ENGINEERING
B. E. SEMESTER: VII
Subject
Name: Compiler Design
Subject
Code: 170701
Faculty Name : Prof M M Chaudhari
Practical No
|
Title
|
1
|
Implement
a program to implement simple lexical analyzer using C language.
|
2
|
Implement
a program for a predictive parser (grammar from the book).
|
3
|
Implement
RDP for a grammar.
E->TE’
E’->+TE’ | ^
T->FT’
T’->*FT’ | ^
F->(E) | id
|
4
|
Write
a program to eliminate left recursion from a grammar.
|
5
|
Write
a program to left factor a grammar.
|
6
|
Write
a program that will find the FIRST SET of the grammar.
|
7
|
Write
a program that will find the FOLLOW SET of the grammar.
|
8
|
Write a Lexical Analyzer using
Lex or Flex utility of UNIX for following:
1. A lexer to print out
all numbers from a given file. (Hint: By default lex reads from standard
input).
2. A lexer to print out
all HTML tags in a file.
3. A lexer which adds
line numbers to the given file and display the same onto the standardoutput.
4. A lexer which
attempt to extract only comments from a C program and display the same on
standard output.
5. A lexer which replaces
all the occurrence of “comp” with “COMP” and “dept” with “DEPT”.
6. A lexer to do the
word count functions of the wc command in UNIX. It prints the number of
lines, words and characters in a file.
7. A lexer which
classifies tokens as words, numbers or "other".
8. A lexer that changes
all numbers to hexadecimal in input file while ignoring all others.
9. This lexer prints
only words followed by punctuation. If the following sentence was the input
from standard input:
"I was here", they said. But were they? I cannot tell. It will print the words here, said, they, and tell. It will not print the punctuation; only the words.
10. Implement lexical
analyzer for C language program.
|
9
|
Write
a Parser using yacc or utility of UNIX
for following:
Write a Program for a simple desk
calculator using YACC Specification and Also implements the code that checks
semantic error from string.
|
No comments:
Post a Comment