BACHELOR IN COMPUTER APPLICATIONS
Term-End Examination
June, 2007
CS - 63: INTRODUCTION TO SYSTEM SOFTWARE
Time: 2 hours Maximum Marks: 60
Note: Question number 1 is compulsory. Answer any three questions from the rest.
1. (a) Explain the syntax analysis phase of a compiler design. Write the CFG for an arithmetic expression and generate a parse tree for the expression a + b * c / d - e * f (8)
(b) Consider the following set of processes arrived at the sametime: (8)
Process CPU Time
P1 5
P2 10
P3 8
P4 4
Draw the Gantt chart and calculate the average turnaround time and average waiting time for
(i) SJF
(ii) FCFS scheduling.
(c) Write an algorithm and draw the corresponding flowchart for generating the fibonacci series.(8)
(d) Write a shell program to encrypt any text file using the following table. (7)
Character to be replaced with
a P
e q
i r
o s
u t
s o
other characters Remains unchanged
0 to 9
Replace with 9 to 0
2. (a) Give necessary conditions for deadlock occurrence. Explain with an example and draw the resource allocation graph to represent a deadlock. (5)
(b) Explain the concept of dynamic partition memory management.What are the advantages of dynamic partition over fixed-size partition of memory? (5)
3. (a) Write UNIX commands for:7x5=5
(i) to find the no. of users logged on the system.
(ii) to copy file to another file2 in the same directory.
(iii) to stop the background process.
(iv) to create a file named "cities".
(v) to terminate a login session.
(b) What is a 4GL? Give two examples of 4GL. Discuss the relative advantages and disadvantages of 4GLs in software development. (5)
4. (a) Give suitable example to illustrate both first fit and best fit strategies of disk allocation (5)
(b) Explain the address mapping procedure in a paging system,with the help of a diagram. (5)
5. (a) Create a shell program which will display the following menu and then perform the desired function based on the user's choice: (5)
Functions' Menu:
1. PRINT sorted list of users.
2. Change environment variables.
3. To change the permission mode for any file.
(b) Draw a diagram for the structure of an editor and explain. (5)
ANSWERS
ANS.
1. (a)The syntax analysis is a module that reads the token stream delivered by the lexer module and builds a memory data structure containing the syntactically analyzed and built program.
The syntax analysis is a module that reads the token stream delivered by the lexer module and builds a memory data structure containing the syntactically analyzed and built program.For the syntax analysis the program is a series of commands. A command is a series of symbols. There is nothing like command blocks, or one command embedding another command. Therefore the syntax definition is quite simple and yet still powerful enough to define a BASIC like language.
Syntax analysis phase of a compiler design involves parsing the token sequence to identify the syntactic structure of the program. This phase typically builds a parse tree, which replaces the linear sequence of tokens with a tree structure built according to the rules of a formal grammar which define the language's syntax. The parse tree is often analyzed, augmented, and transformed by later phases in the compile
It consist of
1) Context-Free Grammar (CFG):In formal language theory, a context-free grammar (CFG) is a grammar in which every production rule is of the form
- V ? w
Context-free grammars play a central role in the description and design of programming languages and compilers. They are also used for analyzing the syntax of natural languages.
2) Ambiguity
3) Shift-Reduce Parsing
4) Parse Trees: In computer science and linguistics, parsing, or, more formally, syntactic analysis, is the process of analyzing a sequence of tokens to determine their grammatical structure with respect to a given (more or less) formal grammar.
ANSWER PENDING...Ask moderator by posting comment