SP-2150708 - Assignments 2019
SP-2150708 - Assignments 2019
1. Define Following
a. System Program h. Detranslator
b. System Software i. Interpreter
c. Specification gap j. Language Migrator
d. Execution gap k. Token
e. Language processor l. Pass
f. Language translator m. Semantic gap
g. Language preprocessor
2. Fill in the Blanks
a. _________ Phase performs type checking task.
(1) Lexical Analysis (2) Syntax Analysis (3) Semantic Analysis
b. A _____________________bridges an execution gap to the machine language of a
computer system(1) Detranslator, (2) Preprocessor, (3) Language translator
c. A _____________________bridges the specification gap between two programming
languages. (1) Interpreter (2) Language Migrator (3) Compiler
d. Syntax analysis processes the string of tokens built by _______________ to determine
the statement class. (1) Semantic Analysis (2) Lexical Analysis (3) Itself
3. State whether the following statements are true or false. Justify your answer.
1) An interpreter is a language translator.
2) Knowledge of software engineering helps us to bridge the semantic gap.
4. Brief note about address space.
5. Explain the various stages of the life cycle of a source program with a neat diagram
6. Explain different kinds of system software. Compare user-centric view and system-centric view of
system software.
7. List phases of a language processor. Explain roles of first two phases of it. Explain Symbol table.
8. Compare Problem oriented and Procedure oriented languages.
9. Explain language processing activities.
10. Perform lexical, syntax and semantic analysis on below C statement a=b+c*d*100+e/f
Where data type of b, c & e are integers and remaining all variables are float.
1. Define Following:
a. Assembler e. Macro
b. Literals f. Constant
c. Back patching g. Macro Assembler
d. Forward Reference
h. State True/False : Symbol table is used to store mnemonics and opcodes
i. State True/False: “Single pass assemblers cannot handle forward references.”
2. Compare single pass assembler and two pass assembler. Explain both type of assemblers in
detail with suitable example.
3. Explain in brief: Assembly Language Statements .What is assembler directive? List out and
explain all assembler directives.
4. Compare Variant I and Variant II of intermediate code generation for assembler?
5. Explain use of various data structures (tables) needed in PASS I of the assembler. Also
give details of their fields.
6. Explain advanced macro facilities with suitable example.
7. What is macro processor? Explain Design of Macro Preprocessor.
8. Explain positional parameters, keyword parameters and default value parameters for macros.
9. Explain various data structures of Macro definition processing with example.
10. Write and explain an algorithm for macro definition & Macro expansion.
11. Explain Nested Macro using example.
12. Consider the following assembly program
ZE‘O DC
ONE DC
MAX DC
END
(i) Identify task performed by above program.
(ii) Generate symbol table
12. Let us consider a two pass assembler and assume that each instruction is one word. Given an
assembly program and code for Mnemonics.
Assignment 3 - Unit -6
Submission Date:
1. Define Following:
a. Scanning
b. Regular Grammar OR Regular h. Simple phrase grammar
Expressions i. Left recursion
c. FSA(Finite State Automaton) j. Top down parsing
d. Abstract Syntax trees k. operator grammar
e. Parsing l. Handle
f. Parse tree m. State True
g. Pattern.
/False : Top Down parsers can never work with left recursive grammar
2. Write regular expression for the following.
a. Real number with optional b. Identifier
fraction
c. For the language consisting of all strings ending with 1 and does not contain substring 00.
d. For a language containing a binary string which does not contain two consecutive 0s or
two consecutive 1s anywhere.
e. The language consists of all strings of a’s and b’s which ends with a and does not contain
bb.
f. A language consists of all strings of a’s and b’s which ends with b and does not contain
aa. Write regular expression for the language.
3. Build NFA & DFA for following regular expression
a. (a | b)* aba# e. (1*)* 0 (0|1)*#
b. (a | b)*abb# f. (0 | 1)*001#
c. a* (b* | c*) (a | c)* # g. (1+110)* 0#
d. (a* | b* )a*ab #
h. String ends with 1 but does not contain 00 as a substring
i. String with next to last symbol 0.
j. String that contain 101 as substring
4. What is grammar? List and explain various types of grammar. OR Discuss Classification of Grammar.
5. Construct LL(1) parsing table for following grammar.
1. S = iCtSeS | iCtS | a
C=b
2. E -> TA B -> *VB | ε
A -> +TA | ε V -> id | (E)
T -> VB
Parse following string using the parsing table.id * ( id + id) using 2nd grammar.