JNTU
JNTU B.Tech II PRINCIPLES OF PROGRAMMING LANGUAGES Previous Question Paper (September/October - 2023 - R13)
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
(25 Marks)
Answer
An attribute grammar for simple assignment statements can be defined as follows:
Non-terminals:
assign (assignment statement)
expr (expression)
Terminals:
id (identifier), := (assignment operator), +, -, *, / (arithmetic operators), (, ) (parentheses)
Attribute:
synthesized attribute: val (the value of the expression)
Production Rules:
assign -> id := expr
expr -> expr + expr
expr -> expr - expr
expr -> expr * expr
expr -> expr / expr
expr -> ( expr )
expr -> id
The attribute grammar would associate semantic rules with these productions to compute the value of the expression.
Answer
A Virtual Machine (VM) is a software-based emulation of a computer system. It mimics the hardware of a physical computer, allowing multiple operating systems and applications to run on a single physical machine as if they were on separate, independent computers.
Key aspects of a Virtual Machine:
- Abstraction: VMs provide an abstraction layer over the physical hardware, isolating the guest operating system and applications from the underlying hardware.
- Isolation: Each VM operates in its own isolated environment, preventing issues in one VM from affecting others or the host system.
- Portability: VM images can be easily moved and run on different physical hardware, provided the virtualization software is compatible.
- Resource Management: Virtualization software (hypervisor) manages and allocates physical resources (CPU, memory, storage, network) to the VMs.
- Execution Environment: VMs execute instructions in a controlled environment, often translating them for the host CPU or running them on a simulated CPU.
In programming languages, VMs are crucial for platform independence (e.g., Java Virtual Machine - JVM) and for executing intermediate code like bytecode.
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.
Unit I
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.
Unit II
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.
Unit III
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.
Unit IV
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.
Unit V
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.