PROGRAMMING IN ‘C’ LAB

The programming lab is well equipped with all equipments that satisfy the curriculum laboratory. The aims of this course are to provide a solid introduction to programming in C and to provide an overview of the principles and constraints that affect the way in which the C programming language have been designed and are used.

Equipments/Configurations

  • Dual core processor
  • 2GB RAM
  • 500 GB HDD
  • 17” monitor

Software Used

  • GNU C
  • Dev C++ IDE
  • Code Block IDE
  • Ubuntu OS
  • Windows XP OS

List of Experiments

  1. Find Area, Perimeter of Square & Rectangle.
  2. Find max. Among 3 nos.
  3. Check leap year
  4. Factorial of Number
  5. Calculate a b
  6. Prime Number.
  7. Perfect Number.
  8. Armstrong Number.
  9. Floyd’s Triangle
  10. Fibonacci Series
  11. Inter conversion of Decimal, Binary & Hexadecimal no.
  12. LCM & GCD of numbers
  13. Insert & Delete an element at given location in array.
  14. Transpose of matrices
  15. Multiplication of matrices
  16. Display upper & lower diagonal of matrices
  17. Array of Structure e.g. student result, Employee pay slip , Phone bill
  18. Function with no parameter & no return values
  19. Function with parameter & return values
  20. Function with parameter & no return values
  21. Function with call by reference
  22. Recursion function e.g. sum of digit, reverse of digit
  23. String manipulation function e.g. string copy, concatenation, compare, stringlength, reverse
  1. Pointer Arithmetic
  2. File handling e.g. Read / Write file, copy file, merging file
  3. Random access of file
  4. File handling with command line arguments
  5. Drawing line, rectangle, circle, ellipse by using graph
  6. Changing foreground/ background color
  7. Changing color & font of text
  8. Swapping of numbers by using bit wise operator.
  9. Macro expansion
  10. File Inclusion
  11. IO interfacing & Device Driver using C.
  12. Graphics using C

COMPUTER ORGANIZATIONS AND ARCHITECTURE

List of Experiments

I–CYCLE: DigitalLogicDesignExperiments:

  1. Multiplexers & Decoders
  2. Counters
  3. Shift Registers

4 Binary Adders&Subtractors

5 A L U

II–CYCLE: 8085AssemblyLanguageProgramming:

  1. 8085AssemblyLanguageProgrammingaccordingtotheorycourse microprocessorsusingthefollowingtrainers:

KeyboardMonitorof8085μPTrainer.SerialMonitorof8085μPTraine

rwithTerminal

8085LineAssemblerof8085μPTrainerwithPCasTerminal8085CrossAssemblerusingIn-

CircuitEmulator(ICE)with8085μPTrainerandPCasTerminalGradedProblemsaretobeusedacc

ordingtothesyllabusof

  1. COMPUTER ORGANIZATION

PentiumclassPCarchitecturefamiliarizationhardware&softwarepartsdemonstration,

Troubleshooting of PC,Laptops, Server and Loading of Operating System, Antivirus and

other software packages

BUSINESS COMMUNICATION LABORATORY

List of Experiments

Describe the communication process and the major types of written, verbal, and nonverbal

communications used in business and professional communication.

Demonstrate the ability to compose a letter or memo using clear, concise language as

required for a defined audience.

Demonstrate the ability to communicate a variety of types of business messages that may

include good news, unfavorable news, persuasive messages, sales messages, or general

information.

Compose business reports or proposals that demonstrate the ability to gather, organize,

and present information.

Demonstrate the ability to prepare and deliver an oral business presentation in a clear,

confident, and effective manner, with visual aids (if needed).

Discuss the interpersonal communication skills needed to build interpersonal cooperation

in the business environment including meetings and work teams.

Discuss the communication principles and processes that improve the effectiveness of an

organization’s communication climate.

Describe strategies for communicating across cultures.

 

COURSE/LAB OUTLINE

  1. Understanding business communication
  2. Work-team communication
  3. Communication technology
  4. Developing business writing skills
  5. Writing basic correspondence (routine, persuasive, and bad-news messages)
  6. Report writing
  7. Oral and employment communication

DATA STRUCTURE LABORATORY

This course concentrates on the practical implementation of Data Structure using C Environment. This course allows students to understand practically the Logical and physical representation of data, algorithms, complexity and efficiency, data Structure operations, matrix representations, linked lists and their Different variations, string storage representation and manipulation, queues and stacks and their applications, tree structures and their different variations, graphs, sorting techniques and searching techniques.

Equipments/Configurations

  • Dual core processor
  • 2GB RAM
  • 500 GB HDD
  • 17” monitor

Software Used

  • GNU C
  • Dev C++ IDE
  • Code Block IDE
  • Ubuntu OS
  • Windows XP OS

List of Experiments

1 ADT Stack implementation and use it for evaluation of post-fix expression.

2 Conversion of prefix expression into post-fix form using recursion.

3 Implementation of circular queue (using array) with menu options like insert, delete,

display and exit.

4 Implementation of a priority queue (using pointers) and use it to organize student

records prioritized by marks.

5 Implementation of ADT doubly linked circular list to hold strings and use it for

organizing a sequence of cities constituting at our program.

6 Implementation of a binary search tree with menu options: Construct a tree, insert

anode, delete anode, traverse and display preorder, in order and post order sequence

of its nodes.

7 Implementation of di-graphs using adjacency matrix and find the transitive closure

usingWarshall’s algorithm.

8 Implementation of a weighted graph and find minimal cost spanning tree using

PRIM’s Algorithm.

9 Generate 70 random integers in a given range and sort them using quick sort. Apply

both binary search and Interpolation search to locate a given integer and compare the

search algorithms based on the number of comparisons / probes required or a

successful as well as unsuccessful search..

10 Heap Sort

11 Merge Sort.

12 Implementation of a small Real World Application illustrating DS usage

FIRST SEMESTER MCA SYLLABUS FOR ADMISSION BATCH 2016-17

OBJECT ORIENTED PROGRAMMING LABORATORY

The programming lab is well equipped with all equipments that satisfy the curriculum laboratory. The aims of this course are to provide a solid introduction to programming in C++ and to provide an overview of the principles and constraints that affect the way in which the C++ programming language have been designed and are used.

Equipments/Configurations

  • Dual core processor
  • 2GB RAM
  • 500 GB HDD
  • 17” monitor

Software Used

  • GNU C++
  • Dev C++ IDE
  • Code Block IDE
  • Ubuntu OS
  • Windows XP OS

List of Experiments

  1. Illustrate passing by Reference
  2. Illustrateuseofstaticinsideaclass
  3. Demonstrate–usageofFriendFunction
  4. Demonstrate Friend Class
  5. ComplexNo.s adding and multiplying
  6. Copyconstructordemo
  7. Userdefinedcopyconstructordemo
  8. Operator+,*overloading
  9. AddingRationalNumbers
  10. OverloadingAutoincrementoperator.
  11. InteractiveConstructor
  12. RealTimeDigitalClock
  13. VirtualbaseclassDemo
  14. ‘Is–a’,‘has-a’relationships
  15. PolymorphismusingPointertoObject
  16. VirtualbaseclassDemo
  17. BinaryFileDemo
  18. Creating large file
  19. Filesplit,Filejoin
  20. Templatesorting
  21. DemoofClassTemplate
  22. Matrix Multiplication
  23. Linkedlistimplementation
  24. Stacksimulation
  25. DemoofusingKeywordCONST
  26. Drawinglines
  27. StoringimageonDisk
  28. Animation
  29. UsingMouse
  30. VisualBasicformcreation

Reference:

Object Oriented Programming with C++, M.P.BhaveandS.A.Patekar, Pearson

Education

OPERATING SYSTEMS LAB

An operating system (OS) lab helps students to learn to manage computer hardware and software resources. This lab complements the operating systems course. Students will gain practical experience with designing and implementing concepts of operating systems such as system calls, CPU scheduling, process management, memory management, file systems and deadlock handling use C language in Linux environment.

Equipments

  • Dual core processor
  • 2GB RAM
  • 500 GB HDD
  • 17” monitor

Software

  • GNU C/C++
  • Ubuntu OS
  • Windows XP OS
  • NS2
  • Packet tracer

List of Experiments

  1. Basics of UNIX commands.
  2. Shell Programming.
  3. Implement the following CPU scheduling algorithms
  4. a) Round Robin b) SJF c) FCFS d) Priority
  5. Implement all file allocation strategies

Sequential

Indexed

Linked

  1. Implement Semaphores
  2. Implement all File Organization Techniques

Single level directory

Two level

Hierarchical

DAG

  1. Implement Bankers Algorithm for Dead Lock Avoidance
  2. Implement an Algorithm for Dead Lock Detection
  3. Implement e all page replacement algorithms

FIFO

LRU

LFU

  1. Implement Shared memory and IPC
  2. Implement Paging Technique of memory management.
  3. Implement Threading & Synchronization Applications

Design and Analysis of Algorithm Lab

The programming lab is well equipped with all equipments that satisfy the curriculum laboratory. The aims of this course are to provide a solid introduction to programming in C and to provide an overview of the principles and constraints that affect the way in which the C programming language have been designed and are used.

Equipments/Configurations

  • Dual core processor
  • 2GB RAM
  • 500 GB HDD
  • 17” monitor

Software Used

  • GNU C
  • Dev C++ IDE
  • Code Block IDE
  • Ubuntu OS
  • Windows XP OS

List of Experiments

  1. Write C++ programs to implement the following:
  2. a) Prim’s algorithm.
  3. b) Kruskal’s algorithm.
  4. Write a C++ program to find optimal ordering of matrix multiplication.

(Note: Use Dynamic programming method).

  1. Consider the problem of eight queens on an (8×8) chessboard.

Two queens are said to attack each other if they are on the same row, column, or

diagonal.

Write a C++ program that implements backtracking algorithm to solve the problem

i.e.place eight non-attacking queens on the board.

  1. Write a C++ program to find the strongly connected components in a digraph.
  2. Write a C++ program to implement file compression (and un-compression)

usingHuffman’s algorithm.

  1. Write a C++ program to implement dynamic programming algorithm to solve all

pairsshortest path problem.

  1. Write a C++ program to solve 0/1 knapsack problem using the following:
  2. a) Greedy algorithm.
  3. b) Dynamic programming algorithm.

FIRST SEMESTER MCA SYLLABUS FOR ADMISSION BATCH 2016-17

  1. c) Backtracking algorithm.
  2. d) Branch and bound algorithm.
  3. Write a C++ program that uses dynamic programming algorithm to solve the optimal

binary

search tree problem.

  1. Write a C++ program for solving traveling sales persons problem using the following:
  2. a) Dynamic programming algorithm.
  3. b) The back tracking algorithm.
  4. c) Branch and Bound.

Computer Networks Lab

The programming lab is well equipped with all equipments that satisfy the curriculum laboratory. The aims of this course are to provide a solid introduction to programming in C and to provide an overview of the principles and constraints that affect the way in which the C programming language have been designed and are used.

Equipments/Configurations

  • Dual core processor
  • 2GB RAM
  • 500 GB HDD
  • 17” monitor

Software Used

  • GNU C
  • Dev C++ IDE
  • Code Block IDE
  • Ubuntu OS
  • Windows XP OS

List of Experiments

  1. Implementation of Stop and Wait Protocol and Sliding Window Protocol.
  2. Study of Socket Programming and Client – Server model
  3. Write a code simulating ARP /RARP protocols.
  4. Write a code simulating PING and TRACEROUTE commands
  5. Create a socket for HTTP for web page upload and download.
  6. Write a program to implement RPC (Remote Procedure Call)
  7. Implementation of Subnetting.
  8. Applications using TCP Sockets like
  9. Echo client and echo server
  10. Chat
  11. File Transfer
  12. Applications using TCP and UDP Sockets like
  13. DNS
  14. SNMP
  15. File Transfer
  16. Study of Network simulator (NS).and Simulation of Congestion Control Algorithms

using NS/NetSim

  1. Perform a case study about the different routing algorithms to select the network

path with itsoptimum and economical during data transfer.

  1. Link State routing
  2. Flooding
  3.  Distance vector

Database Management System Labs

The Database Lab is designed to graduate students to the foundations of database systems, focusing on basics such as the relational algebra, data model and transactions using SQL programming. The lab is well organized and equipped with sufficient numbers of systems that satisfy the curriculum requirements. The lab is sufficient to accommodate one system per student for each experiment. Sufficient number of systems is available keeping in mind the comfort ability to conduct each experiment.

Equipments/Configurations

  • Dual core processor
  • 2GB RAM
  • 500 GB HDD
  • 17” monitor

Software Used

  • Oracle 10g Express Edition
  • Ubuntu OS
  • Windows XP OS

List of Experiments

  1. Creation of a database and writing SQL queries to retrieve information from the

database.

  1. Performing Insertion, Deletion, Modifying, Altering, Updating and Viewing records

based on conditions.

  1. Creation of Views, Synonyms, Sequence, Indexes, Save point.
  2. Creating an Employee database to set various constraints.
  3. Creating relationship between the databases.
  4. Study of PL/SQL block.
  5. Write a PL/SQL block to satisfy some conditions by accepting input from the

user.

  1. Write a PL/SQL block that handles all types of exceptions.

FIRST SEMESTER MCA SYLLABUS FOR ADMISSION BATCH 2016-17

  1. Creation of Procedures.
  2. Creation of database triggers and functions
  3. Mini project (Application Development using Oracle/ Mysql )

a) Inventory Control System.

b) Material Requirement Processing.

c) Hospital Management System.

d) Railway Reservation System.

e) Personal Information System.

f) Web Based User Identification System.

g) Timetable Management System.

h) Hotel Management System

12. Using Oracle or DB2 under Windows platform and MySQL under Linux/Unix Platform.

JAVA PROGRAMMING LABORATORY

Java Programming Laboratory (JPL) is an educational application designed to assist students learn Java programming language. It provides an environment that allows students to develop their programming skills by starting with simple Java code fragments and slowly transitioning to complete Java programs. By applying programming concepts different complicated programs are applied. Once the concepts are clear, a set of exercises given on the concerned topics would help the students to evaluate themselves and their progress of learning.

Equipments/Configurations

  • Dual core processor
  • 2GB RAM
  • 500 GB HDD
  • 17” monitor

Software Used

  • Java 8 SDK
  • Oracle 10g
  • Windows XP OS
  • Ubuntu OS

List of Experiments

  1. Programs to illustrate constructors.
  2. Programs to illustrate Overloading & Overriding methods in Java.
  3. Programs Illustrate the Implementation of Various forms of Inheritance. (Ex. Single,

Hierarchical, Multilevel inheritance….)

  1. Program which illustrates the implementation of multiple Inheritance using interfaces

in Java.

  1. Program to illustrate the implementation of abstract class.
  2. Programs to illustrate Exception handling
  3. Programs to create packages in Java.
  4. Program to Create Multiple Threads in Java.
  5. Program to Implement Producer/Consumer problem using synchronization.
  6. Program to Write Applets to draw the various polygons.

11.Create and Manipulate Labels, Lists, Text Fields, Text Areas & Panels

FIRST SEMESTER MCA SYLLABUS FOR ADMISSION BATCH 2016-17

  1. Handling Mouse Events & Keyboard Events.
  2. Using Layout Managers.

14.Create& Manipulate the Following Text Areas, Canvas, Scroll bars, Frames, Menus,

DialogBoxes.

  1. Programs, which illustrate the manipulation of strings.
  2. Ex. 1. Sorting an array of Strings.
  3. Frequency count of words & Characters in a text.
  4. Programs, which illustrate the use of Streams.
  5. Java Program that reads on file name from the user and displays the contents of

file.

  1. Write an applet that displays a simple message.
  2. Write an applet that computes the payment of a loan based on the amount of the

loan, theinterest rate and the number of months. It takes one parameter from the

browser: Monthlyrate; if true, the interest rate is per month; Other wise the interest rate

is annual.

  1. Write a Java program that works as a simple calculator. Use a grid layout to arrange

buttonsfor the digits and for the + – X % operations. Add a text field to display the result.

  1. Write a Java program for handling mouse events.
  2. Write a Java program for creating multiple threads
  3. Write a Java program that correctly implements producer consumer problem using

theconceptof inter thread communication.

  1. Write a Java program that lets users create Pie charts. Design your own user

interface (with

AWT)

  1. Write a Java program that allows the user to draw lines, rectangles and ovals.
  2. Write a Java program that illustrates how run time polymorphism is achieved.

 

COMPUTER GRAPHICS AND MULTIMEDIA LAB

This course concentrates on the practical implementation of Computer Graphics. This course allows students to understand practically the Logical and physical representation of graphic, and make them familiar with graphics and animation.

Equipments/Configurations

  • Dual core processor
  • 2GB RAM
  • 500 GB HDD
  • 17” monitor

Software Used

  • GNU  C
  • Dev C++ IDE
  • Code Block IDE
  • Ubuntu OS
  • Windows XP OS

List of Experiments

  1. Program using OpenGL library functions, to implement the basic primitives such as POINT, LINES, QUAD, TRIANGLES and POLYGON etc.
  1. Program using OpenGL library functions, to implement the line chart as per user input. Input monthly data for period of one year.
  1. Program to draw hard wired house by using basic primitives of OpenGL library functions.
  1. Program by using OpenGL library functions, to implement the Digital Differential Analyser line drawing algorithm.
  1. Program by using OpenGL library functions, to implement the Bresenham‟s Line drawing, Circle drawing, Mid-point Circle drawing and Mid-point Ellipsedrawing algorithms.
  1. Program by using OpenGL library functions, to implement the Cohen-Sutherland Line clipping algorithm.
  1. Program by using OpenGL library functions, to implement the Liang-Barsky Line clipping algorithm..
  1. Program to demonstrate 2D and 3D transformations.
  2. Window to Viewport Transformation
  3. Splines Using OpenGL, 2D Animation

Software Engineering Labs

Equipments/Configurations

  • Dual core processor
  • 2GB RAM
  • 500 GB HDD
  • 17” monitor

Software Used

  • TOMCAT
  • Java 8 SDK
  • Oracle 10g
  • Windows XP OS
  • Ubuntu OS

List of Experiments

EXPERIMENT-1

Aim: Phases in software development project, overview, need, coverage of topics

Tools/ Apparatus: None.

Procedure:

1) Open an appropriate software engineering guide and study the software development

life cycle and related topics.

2) Study the need of the software engineering.

3) Study the coverage of topics such as life cycle models and their comparisons.

EXPERIMENT-2

Aim: To assign the requirement engineering tasks.

Tools/ Apparatus: None.

Procedure:

1) Identify the different requirement engineering tasks.

2) Assign these tasks to various students to set the ball rolling.

3) Ask the students to start working on the given tasks.

EXPERIMENT-3

Aim: To perform the system analysis : Requirement analysis, SRS

Tools/ Apparatus: None.

Procedure:

1) Assign the group of the students different tasks of system analysis.

2) Ask students to meet different users and start analysis the requirements.

3) Ask students to give presentations group-wise of their system requirements analysis.

EXPERIMENT-4

Aim: To perform the function oriented diagram : DFD and Structured chart

Tools/Apparatus: Rational Rose Software.

Procedure:

1) Identify various processes, data store, input, output etc. of the system and

askstudents to analyse.

2) Use processes at various levels to draw the DFDs.

3) Identify various modules, input, output etc. of the system and ask students to

analyse.

4) Use various modules to draw Structured charts.

EXPERIMENT-5

Aim: To perform the user‟s view analysis : Use case diagram

Tools/Apparatus: Rational Rose Software.

FIRST SEMESTER MCA SYLLABUS FOR ADMISSION BATCH 2016-17

Procedure:

1) Iidentify various processes, use-cases, actors etc. of the system and ask students

toanalyse.

2) Use processes at various levels to draw the use-case diagram.

EXPERIMENT-6

Aim: To draw the structural view diagram : Class diagram, object diagram

Tools/Apparatus: Rational Rose Software.

Procedure:

1) Identify various elements such as classes, member variables, member functions etc.

of the class diagram

2) Draw the class diagram as per the norms.

3) Identify various elements such as various objects of the object diagram

4) Draw the object diagram as per the norms.

EXPERIMENT-7

Aim: To draw the behavioral view diagram : Sequence diagram, Collaboration diagram

Tools/Apparatus: Rational Rose Software.

Procedure:

1) Identify various elements such as controller class, objects, boundaries, messages

etc.

of the sequence diagram

2) Draw the sequence diagram as per the norms.

3) Identify various elements such as for the sequence diagram of the collaboration

diagram

4) Draw the collaboration diagram as per the norms.

EXPERIMENT-8

Aim: To draw the behavioral view diagram : State-chart diagram, Activity diagram

Tools/Apparatus: Rational Rose Software.

Procedure:

1) Identify various elements states and their different transition of the state-chart

diagram

2) Draw the state-chart diagram as per the norms.

3) Identify various elements such as different activity their boundaries etc. of the activity

diagram

4) Draw the activity diagram as per the norms.

EXPERIMENT-9

Aim: To draw the implementation view diagram: Component diagram.

FIRST SEMESTER MCA SYLLABUS FOR ADMISSION BATCH 2016-17

Tools/Apparatus: Rational Rose Software.

Procedure:

1) Identify various elements of the component diagram such as the various components

like client, server, network elements etc.

2) Draw the component diagram as per the norms.

EXPERIMENT-10

Aim: To draw the implementation view diagram: deployment diagram

Tools/Apparatus: Rational Rose Software.

Procedure:

1) Identify various elements such as the hardware components of the deployment

diagram

2) Draw the deployment diagram as per the norms.

EXPERIMENT-11

Aim: To perform various techniques for testing using the testing tool : unit testing,

Integrationtesting

Tools/Apparatus: Winrunner.

Procedure:

1) Identify various modules of the system so that they can be tested stand alone.

2) Identify the groups of the module that can be tested together in integration.

3) Perform the testing of the modules as a unit and in integration by using the testing

tool.

EXPERIMENT-12

Aim: To draw UML diagrams using Rational rose software.

Tools/Apparatus: Rational rose software.

Procedure:

1) Identify various elements of the system to be drawn using the IDE.

2) Use the UML options of the rational rose to draw the diagrams from experiment 4 to

10.

EXPERIMENT-13

Aim: To draw UML diagrams using MS Visio software.

Tools/Apparatus: MS Visio software.

Procedure:

1) Identify various elements of the system to be drawn using the IDE.

2) Use the UML options of the MS Visio software to draw the diagram from experiment

4 to 10.

Compiler Design and Language Processor Lab

Equipments/Configurations

  • Dual core processor
  • 2GB RAM
  • 500 GB HDD
  • 17” monitor

Software Used

  • GNU C
  • Dev C++ IDE
  • Code Block IDE
  • Ubuntu OS
  • Windows XP OS

List of Experiments

  1. Design a lexical analyzer for given language and the lexical analyzer should

ignoreredundant spaces, tabs and new lines. It should also ignore comments.

Although thesyntax specification states that identifiers can be arbitrarily long, you

may restrict thelength to some reasonable value. Simulate the same in C/LEX

language.

  1. Write a program to identify whether a given line is a comment or not.
  2. Write a program to recognize strings under ‘a’, ‘a*b+’, ‘abb’.
  3. Write a program to test whether a given identifier is valid or not.
  4. Write a program to simulate lexical analyzer for validating operators.
  5. Implement the lexical analyzer using JLex, flex or other lexical analyzer

generating Tools.

  1. Write a program for implementing the functionalities of predictive parser for the

miniLanguageas specified in Note 1.

  1. Write a program for constructing of LL (1) parsing
  2. Write a program for constructing recursive descent parsing.
  3. Write a program to implement LALR parsing.
  4. Write a program to implement operator precedence parsing
  5. Write a program to implement Program semantic rules to calculate theexpression

that takes an expression with digits, + and * and computes the value.

  1. Convert the BNF rules into Yacc form and write code to generate abstract syntax

treefor the mini language

  1. Write a program to generate machine code from abstract syntax tree generated

bytheparser. The instruction set specified in Note 2 may be considered as the

target code.

Note 1:

A simple language written in this language is

{int a[3],t1,t2;

FIRST SEMESTER MCA SYLLABUS FOR ADMISSION BATCH 2016-17

T1=2;

A[0]=1;a[1]=2;a[t]=3;

T2=-( a[2]+t1*6)/(a[2]-t1);

If t2>5then

Print(t2)

Else{

Int t3;

T3=99;

T2=25;

Print(-t1+t2*t3);/*this is a comment on 2 lines*/

}endif

}

Comments(zero or more characters enclosed between the standard C/JAVA Style

comment brackets/*…*/)can beinserted .The language has rudimentary support for1-

dimenstional array, the declaration int a[3] declares an array ofthree

elements,referenced as a[0],a[1] and a[2].

Note:You should worry about the scoping of names.

Experiment with:

  1. Write a program to compute FIRST for the following grammar?

E→ TE’

E’ →+TE’/î

T →FT‟

T’→*FT’/î

F→ (E)/i

  1. Write a program to compute FIRST for the following grammar?

S→iCtSS‟

S‟→eS/ î

  1. Write a program to construct predictive parsing table for the following grammar?

S→iCtSS‟

S‟→eS/ î

Note 2:

 

Consider the following mini language, a simple procedural high –level language, only

operating on integer data, with asyntax looking vaguely like a simple C crossed with

Pascal. The syntax of the language is defined by the followinggrammar.

<program>::=<block>

<block>::={<variable definition><slist>}

|{<slist>}

<variabledefinition>::=int<vardeflist>

<vardec>::=<identifier>|<identifier>[<constant>]

<slist>::=<statement>|<statement>;<slist>

<statement>::=<assignment>|<ifstament>|<whilestatement>

|<block>|<printstament>|<empty>

<assignment>::=<identifier>=<expression>

|<identifier>[<expression>]=<expression>

<if statement>::=if<bexpression>then<slist>else<slist>endif

|if<bexpression>then<slisi>endif

<whilestatement>::=while<bexpreession>do<slisi>enddo

<printstatement>:;=print(<expression>)

<expression>::=<expression>::=<expression><addingop><term>|<term>|<addingop>

<term>

<bexprssion>::=<expression><relop><expression>

<relop>::=<|<=|==|>=|>|!=

<addingop>::=+|-

<term>::=<term><multop><factor>|<factor>

<Multop>::=*|/

<factor>::=<constant>|<identifier>|<identifier>[<expression>]

|(<expression>)

<constant>::=<digit>|<digit><constant>

<identifier>::=<identifier><letter or digit>|<letter>

<letter or digit>::=<letter>|<digit>

<letter>:;=a|b|c|d|e|f|g|h|I|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z

<digit>::=0|1|2|3|4|5|^|7|8|9

<empty>::=has the obvious meaning

Experiment with:

  1. Write a program to generate the code for the following three address code

statements?

A=B+C

W=X-Y

2 Write a program to generate the code for the following three address code

statements?

W=(A+B)*C