JNTU
JNTU B.Tech II PRINCIPLES OF PROGRAMMING LANGUAGES Previous Question Paper (February - 2024 - R15)
Note: i) Question paper consists of Part A, Part B. ii) Part A is compulsory, which carries 25 marks. In Part A, answer all questions. iii) In Part B, Answer any one question from each unit. Each question carries 10 marks and may have a, b as sub questions.
PART - A
Answer
An attribute grammar for simple assignment statements, such as x = y + 1, can be defined as follows:
Let assign be the non-terminal for an assignment statement.
Let id be a non-terminal representing an identifier.
Let expr be a non-terminal representing an expression.
The grammar rules are:
Attributes:
id.lval: boolean, true if the identifier is on the left-hand side of an assignment.expr.val: the value of the expression.
Semantic rules:
- For the rule
assign ::= id = expr: id.lvalmust be true.expr.valis computed.- The value of
expr.valis assigned to the location represented byid.
Answer
The factors influencing the writability of a programming language, which refers to how easily a language can be used to construct programs, include:
- Simplicity: A language with a smaller set of fundamental concepts and constructs is generally easier to learn and use.
- Expressiveness: The ability to express a wide range of computations and algorithms concisely and clearly.
- Readability: A language that is easy to read and understand often leads to better writability, as code written by one programmer can be easily understood by others.
- Orthogonality: A set of primitive constructs that can be combined in a small number of ways to achieve all other constructs. This reduces the number of exceptions and special cases.
- Support for Abstraction: The ability to define and use abstract data types and control structures helps in managing complexity.
- Standardization and Tool Support: Well-defined standards and good tool support (compilers, debuggers, IDEs) improve the development experience.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
PART - B
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.
Answer
Sign in to view the complete answer paper.