Professional Documents
Culture Documents
PPL-QB
PPL-QB
PPL-QB
COURSE OBJECTIVES
To understand and describe syntax and semantics of programming languages
To understand data, data types, and basic statements
To understand call-return architecture and ways of implementing them
To understand object-orientation, concurrency, and event handling programming
languages
To develop programs in non-procedural programming paradigms
Names – variables – binding – type checking – scope – scope rules – lifetime and garbage
collection – primitive data types – strings – array types – associative arrays – record
types – union types – pointers and references – Arithmetic expressions – overloaded
operators – type conversions – relational and boolean expressions – assignment statements
– mixed mode assignments – control structures – selection – iterations – branching –
guarded statements
TOTAL : 45 PERIODS
COURSE OUTCOMES
At the end of the course, the student will be able to
Describe syntax and semantics of programming languages
Explain data, data types, and basic statements of programming languages
Design and implement subprogram constructs
Apply object-oriented, concurrency, and event handling programming
constructs and develop programs in Scheme, ML, and Prolog
Understand and adopt new programming languages
Applying the programming Languages in creating various applications
TEXT BOOKS
2. When and whom developed Context Free Grammars and Backus Naur
Form and define its rules.
Context-Free Grammars (1950)
Developed by Noam Chomsky
Language generators, meant to describe the syntax of natu- ral languages
Backus-Naur Form (1959)
Invented by John Backus to describe the syntax of Algol - 58
BNF is equivalent to context-free grammars
An abstraction (or nonterminal symbol) can have more than one RHS
<stmt> → <single_stmt>
| begin <stmt_list> end The same as…
<stmt> → <single_stmt>
<stmt> → begin <stmt_list> end
3. Define Attribute Grammars and list primary value of AGs. (NOV /DEC 2022)
Attribute grammars (AGs) have additions to CFGs to carry some semantic info on
parse tree nodes
Primary value of AGs:
Static semantics specification
Compiler design (static semantics checking)
4. What are the different factors that influence the evolution of programming languages?
Readability
Writability
Expressivity
Reliability
Cost
5. What are the different components of the context free grammar used for programming
language construction?
A set of terminal symbols, which are the characters of the alphabet that appear in the strings
generated by the grammar.
A set of nonterminal symbols, which are placeholders for patterns of terminal symbols that
can be generated by the nonterminal symbols.
A set of productions, which are rules for replacing (or rewriting) nonterminal symbols (on
the left side of the production) in a string with other nonterminal or terminal symbols (on the
right side of the production).
A start symbol, which is a special nonterminal symbol that appears in the initial string
generated by the grammar.
8. Define Binding.
A binding is an association between an attribute and an en- tity, such as between a
variable and its type or value, or be- tween an operation and a symbol.
PART-B
PART-A
1. List the data types used in various languages and describe primitive data types,
string type and array type with its design issues.
a. Primitive Data Types
Data types that are not defined in terms of other types are called primitive data types.
nearly all programming languages provide a set of primitive data types. Some of the
primitive types are merely reflections of the hardware. For example, most integer types.
i. Numeric Type:
Integer
Floating point
Complex
Decimal
ii. Boolean
iii.Character Type
b. Character String Type
A character string type is one in which the values consist of sequences of characters.
Character string constants are used to label output, and the input and output of all kinds
of data are often done in terms of strings.
c. Array Types
An array is a homogeneous aggregate of data elements in which an individual
element is identified by its position in the aggregate, relative to the first element. The
individual data elements of an array are of the same type. References to individual array
elements are specified using subscript expressions. If any of the subscript expressions in
a reference include variables, then the reference will require an additional run-time
calculation to determine the address of the memory location being referenced.
PART- B
1. Explain the different types of bindings in detail. (NOV/DEC 2021)
2. Explain about data types in detail.
3. Write a note on an Array.(NOV/DEC 2022)
4. Explain about Arithmetic expressions in detail.
5. Describe control structures in detail.
6. Write a note on guarded statements in detail.
UNIT – III - SUBPROGRAMS AND
IMPLEMENTATIONS PART-A
1. Define Subprogram.
A subprogram definition describes the interface to and the actions of the subprogram abstraction .
2. Define formal parameter. (NOV/DEC 2021)
A formal parameter is a dummy variable listed in the subprogram header and used in the
subprogram
3. Define actual parameter.
An actual parameter represents a value or address used in the subprogram call statement.
4. List the categories of subprograms.
• Procedures
• Functions
5. List the parameter passing methods
Pass-by-value
Pass-by-result
Pass-by-value-result
Pass-by-reference
Pass-by-name
6. Define the term overloaded.
An overloaded subprogram is one that has the same name as another subprogram in the same
referencing environment.
PART- B
1. Explain about subprograms in detail.
2. Write in detail about semantic of call and return .
3. Write short note on overloaded methods and generic methods.
4. Explain dynamic scoping with an example. (NOV/DEC 2021)
5. How parameters are passed to the functions. Explain.
PART-A
1. Define Object orientation.(NOV/DEC 2012)
Object orientation is a programming approach that focuses on objects that represent real-world things.
2. List the design issues for OOP languages. (APR/MAY 2011)
The exclusivity of objects
Are subclasses subtypes?
Type checking and polymorphism
Single and multiple inheritance
Object allocation and deallocation
Dynamic and static binding
Nested classes
Initialization of objects
3. List the disadvantages of Multiple Inheritance.(NOV/DEC 2022)
Language and implementation complexity (in part due to name collisions)
Potential inefficiency - dynamic binding costs more with multiple inheritance (but not much)
7. Define Semaphore.
A semaphore is a data structure consisting of a counter and a queue for storing task descriptors.
Semaphores can be used to implement guards on the code that accesses shared data structures.
8. Define Monitor.
A monitor in an operating system (OS) is a synchronization construct that manages access to shared
resources and enables threads or processes to coordinate actions. Monitors are also known as
synchronization tools.
PART-B