JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech III Year PRINCIPLES OF PROGRAMMING LANGUAGES Previous Question Paper (August - 2022 - R18)
Answer any five questions. All questions carry equal marks.
Main
Describe the criteria of success for a good programming language.
Answer
A successful programming language is evaluated based on several key criteria that determine its usability, reliability, and efficiency:
- Readability: The ease with which programs can be read and understood. This is influenced by simplicity, orthogonality, control structures, and data types.
- Writability: The ease with which a language can be used to create programs. It depends on the expressivity of the language, support for abstraction, and the presence of powerful built-in features.
- Reliability: A language is reliable if it performs to its specifications under all conditions. Key factors include type checking, exception handling, and aliasing restrictions.
- Cost: This includes the cost of training programmers, writing code, compiling, executing, and maintaining the software.
- Generality: The applicability of the language to a wide range of problem domains.
- Extensibility: The ability of the language to allow users to add new features or data types.
What is the difference between a phase and a pass of a compiler? Under what circumstances do a compiler have multiple phases?
Answer
A phase is a logically distinct step in the compilation process where the compiler performs a specific task, such as lexical analysis, syntax analysis, or code generation. A pass refers to the traversal of the entire source program or its intermediate representation by the compiler. A single pass may involve multiple phases, or a single phase may be split across multiple passes.
Compilers use multiple phases for the following reasons:
- Complexity Management: Breaking the compilation process into smaller, manageable phases simplifies the design and implementation of the compiler.
- Portability: By separating machine-independent phases (like parsing) from machine-dependent phases (like code generation), the compiler can be easily adapted to different hardware architectures.
- Optimization: Multiple phases allow for iterative analysis of the code, enabling more sophisticated optimizations that would be impossible in a single pass.
- Memory Constraints: In environments with limited memory, the compiler may need to process the code in multiple passes to avoid loading the entire program representation into memory at once.
Exception handling is very important, but often neglected by programming languages. Comment on it.
Answer
Sign in to view the complete answer paper.
Give the attribute grammar for a simple assignment statement.
Answer
Sign in to view the complete answer paper.
Write a denotation semantics mapping function for “for” statement in Ada.
Answer
Sign in to view the complete answer paper.
Explain about static binding and dynamic binding with its relative merits and demerits.
Answer
Sign in to view the complete answer paper.
What are the design issues of logically controlled loop statements? Explain briefly.
Answer
Sign in to view the complete answer paper.
What is meant by type compatibility? Explain with an example.
Answer
Sign in to view the complete answer paper.
Discuss the design and implementation issues of pointer data types.
Answer
Sign in to view the complete answer paper.
Describe pass-by-value and pass-by-result parameter passing methods with examples.
Answer
Sign in to view the complete answer paper.
What are the distinct semantic models for formal parameters? Explain.
Answer
Sign in to view the complete answer paper.
List and explain various functional characteristics of OOP in Small Talk and C++.
Answer
Sign in to view the complete answer paper.
Explain exception propagation and exception handling in C++ with illustrative examples.
Answer
Sign in to view the complete answer paper.
Write down the applications of logic programming.
Answer
Sign in to view the complete answer paper.
Explain the pragmatics of scripting languages.
Answer
Sign in to view the complete answer paper.