0% found this document useful (0 votes)
37 views

SL-V Assignment Questions

The document lists 12 programming problems related to compiler design techniques: (1) implement Pass-I of a two-pass assembler, (2) implement Pass-II to output the results of Pass-I, (3) implement a lexical analyzer for a C subset, (4) implement a recursive descent parser, (5) implement a calculator using LEX and YACC, (6) generate intermediate code using LEX and YACC for control flow statements, (7) find max and min array elements using divide-and-conquer, (8) solve an optimal storage problem using greedy approach, (9) implement Bellman-Ford algorithm using dynamic programming, (10) solve the travelling salesman problem using

Uploaded by

jagdish750
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

SL-V Assignment Questions

The document lists 12 programming problems related to compiler design techniques: (1) implement Pass-I of a two-pass assembler, (2) implement Pass-II to output the results of Pass-I, (3) implement a lexical analyzer for a C subset, (4) implement a recursive descent parser, (5) implement a calculator using LEX and YACC, (6) generate intermediate code using LEX and YACC for control flow statements, (7) find max and min array elements using divide-and-conquer, (8) solve an optimal storage problem using greedy approach, (9) implement Bellman-Ford algorithm using dynamic programming, (10) solve the travelling salesman problem using

Uploaded by

jagdish750
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Write a program to implement Pass-I of Two-pass assembler for Symbols and

Literal processing considering following cases

1. Forward references
2. DS and DC statement
3. START, EQU, LTORG, END.
4. Error handling: symbol used but not defined, invalid instruction/register etc.
START 200
MOVER AREG, =’5’
MOVEM AREG, A
LOOP MOVER CREG, B
ADD CREG, =’1’
LTORG
ORIGIN LOOP+2
MULT CREG, B
STOP
A DS 2
B DS 2
END

2. Write a program to implement Pass-II of Two-pass assembler for output of Q.1

3. Write a program to implement Lexical Analyzer for subset of C.

4. Write a program to implement a Recursive Descent Parser.

E→E+E |E-E|E*E|E/E|(E)|digit

5. Write a program to implement calculator using LEX and YACC.

6. Write a program for Intermediate code generation using LEX &YACC for
Control Flow statement ( Either While loop or Switch case)
7. Write a program to find Maximum and Minimum element in an array using

Divide and Conquer strategy and verify the time complexity.

8. Write a program to solve optimal storage on tapes problem using Greedy

approach.
9. Write a program to implement Bellman-Ford Algorithm using Dynamic

Programming and verify the time complexity.

10. Write a program to solve the travelling salesman problem and to print the path

and the cost using Dynamic Programming.

11. Write a recursive program to find the solution of placing n queens on chessboard

so that no two queens attack each other using Backtracking.

12. Write a program to solve the travelling salesman problem and to print the path

and the cost using Branch and Bound.

You might also like