*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Software development process, language and software
development environments, language and software design
methods, languages and computer architecture, programming
language qualities, languages and reliability, languages and
maintainability, languages and efficiency, a brief historical
perspective and early high level languages, a bird's eye view of
programming language concepts.
Syntax and semantics-language definition, syntax, abstract
syntax, concrete syntax, and pragmatics, semantics, an
introduction to formal semantics, languages, language
processing, interpretation, translation, the concept of binding,
variables, name and scope, Type, l-value, r-value, reference
and unnamed variables, routines, generic routines, aliasing and
overloading, an abstract semantic processor, run time structure.
Case study- run time structure
of C.
UNIT-I Programming Language Syntax and
semantics
3.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
•Requirement analysis and specification.
•Software design and specification
•Implementation (coding).
•Verification and validation.
•Maintenance.
Software Development Process
4.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
SDLC Activities Description
Specifications Agreement between the developer and
client: what the software must do and
what are the constraints.
Design Design determines internal structure of
the software. Two approaches :
Architectural design
Detailed design
Implementation Translation of detailed design into code
Testing and evaluation How well software has met the
fulfilment of the specified requirement.
Maintenance Modification of software product to
correct faults, to improve performance ,
or to adapt the software to changed
environment.
SDLC (software development life cycle): Water Fall
Model
5.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
SDLC Activities Description
Specifications Agreement between the developer and
client: what the software must do and
what are the constraints.
Design Design determines internal structure of
the software. Two approaches :
Architectural design
Detailed design
Implementation Translation of detailed design into code
Testing and evaluation How well software has met the
fulfilment of the specified requirement.
Maintenance Modification of software product to
correct faults, to improve performance ,
or to adapt the software to changed
environment.
SDLC (software development life cycle): Water Fall
Model
6.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Name Description Activity
Rapid At each step interaction with • Rapid prototype
Porototyping client to either test or verify • Specification
the progression of product • Design
• Implementation
•Interaction
•Maintenance
•Retirement
Spiral Similar to incremental model • Planning
with an emphasis on risk analysis • Risk Analysis
and verification in each phase. • Evaluation
Each pass through these phases • Engineering
occurs iteratively .
Structured A top-down approach • Requirement
SDLC (software development life cycle): Water Fall
Model
7.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Name Description Activity
• Testing
•Deployment
Waterfall Most common and classic model • Requirement
Each phase must be completed • Design
in its entirely before moving to • Implementation
the next phase Also called linear • integration
sequential model . •Maintenance
Retirement
SDLC (software development life cycle): Water Fall
Model
8.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
software development environment means an integrated set of
tools and techniques that aids in the development of software.
The environment is used in all phases of software
development: requirements, design, implementation,
verification and validation, and maintenance..
Languages and software development environments
9.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
FORTRAN : Procedural Language
PASCAL : Procedural Language
Smalltalk : Object Oriented
C++ : procedural and Object Oriented
C : procedural
JAVA : Object Oriented
LISP : Functiona
Language and Software Design Methods
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Software must be reliable.
(less fault tolerant, )
Software must be maintainable
(economically, new requirement satisfactions)
Software must execute efficiently.
Programming Language Qualities
13.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Languages and reliability Writ-ability Readability Simplicity
Safety Robustness .
Programming Language Qualities Languages and
maintainability Factoring, Locality.
Languages and efficiency Time Speed Reusable Portable
Programming Language Qualities
14.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Early high-level languages: FORTRAN, ALGOL 60, and
COBOL
-in 1950’s
-solving numerical scientific problems
-COBOL was defined as a tool for solving business
data- processing problems
Early schisms: LISP, APL, and SNOBOL4
next leap forward: ALGOL 68, SIMULA 67, Pascal, and
BASIC
-1960
-ALGOL 68 -orthogonality
SIMULA 67 - class, a modularization mechanism
C and the experiments in the 70’s
The 80’s: ML, Ada, C++ and object orientation
A brief historical perspective
15.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Programming language strength
What makes one language strong than other?
inherent capabilities and shortcomings of different
programming languages?
Example
A bird's eye view of programming language concepts.
16.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
#include <iostream.h>
#include “phone.h”
extern phone_list pb;
void insert();
number lookup ();
main()
{
int request;
cout << “Enter 1 to insert, 2 to lookup: n”;
cin >> request;
if (request == 1) insert();
else if (request == 2) cout << lookup();
else {cout << “invalid request.n”;
exit (1);
} }
FIGURE 4. A phone-list program
Program Structure
17.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
The syntax rules of the language state how to form expressions,
statements, and programs that look right.
The semantic rules of the language tell us how to build
meaningful expressions, statements, and programs.
A bird's eye view of programming language concepts.
Syntax and Semantics
18.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
A bird's eye view of programming language concepts.
Semantic elements
Variables :
Scope
Type
Lifetime
Value and References
Expression a=b=c+d;
Program Organization
Program data and algorithms : data & computation
19.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Syntax and semantics.
a language definition should enable a person or a computer
program to determine
(1)whether a purported program is in fact valid, and
(2) if the program is valid, what its meaning or effect is.
So we require Syntax and Semantics
Syntax defines as a collection of rules to form statement,
expression of a language.
20.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Syntax
Lexical Rules :
Lexical rules specify the set of characters that constitute
the alphabet of the language and the way such characters can be
combined to form valid words.
Syntactic Rules :
Defines particular arrangement of words defined by the
lexical rules.
Context Free Grammar is used here.
BNF(Backus Naur Form) or EBNF ( Extended BNF)
are used
21.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Syntax
(a) Syntax rules
<program>::= {<statement> * }
< statement>::= <assignment > | <conditional > | <loop >
< assignment > ::= < identifier > = < expr > ;
< conditional > if < expr > { < statement >+ } |
if < expr > { < statement >+ } else {< statement >+ } loop
loop ::=while < expr > { < statement >+ }
<exp>::= <identifier>|<numbers> | (expr ) |<expr>
<operator> <expr>
(b) Lexical rules
<operator>::= + | - | * | / | = | ¦ | < | > | ≤ | ≥
< identifier > ::= <letter><ld>*
<ld> ::=<letter> |<digit>
<number> ::= <digit>+
< letter>::= a | b | c | . . . | z
22.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Abstract syntax, concrete syntax and pragmatics
the C fragment Concrete Syntax Tree for C
while (x != y) statement <statement> :=while (condition)
{statement};
{
. . .
};
Pascal fragment Concrete Syntax Tree for Pascal
while x <> y do < statement > :=while (condition) do
begin {statement} end
begin
. . .
end
23.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Semantics
Syntax defines well-formed programs of a language.
Semantics defines the meaning or effect of syntactically
correct programs in that language.
int vector [10];
causes ten integer elements to be reserved for a variable
named vector. The first element of the vector may be
referenced by vector [0];
all other elements may be referenced by an index i, 0 ≤ i ≤ 9.
24.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Declarations
Using a global variable offset PRODUCTION Semantic Rule
P M D { } M {offset:=0 } D id : T
{ addtype(id.entry, T.type, offset) offset:=offset + T.width } T
char {T.type = char; T.width = 4; } T integer {T.type =
integer ; T.width = 4; } T array [ num ] of T1
{T.type=array(1..num.val,T1.type) T.width = num.val *
T1.width} T ^T1 {T.type = pointer(T1.type); T1.width = 4}
25.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Semantics Ways
Axiomatic semantics
program as a state machine
if B then L1 else L2
<precondition> command <postcondition>
In axiomatic semantic, the meaning of specific kind of
statement is defined by computing the precondition. The
weakest precondition is least restrictive precondition which
gives validity for associated post condition. Semantics Ways
x = expr;
and a postcondition P . The weakest precondition is obtained
by replacing
each
occurrence of x in P with expression expr . We express this
weakest precondition with the notation P x → expr . Thus 1
asem (x = expr;, P) = P x → expr
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Denotational semantics
Denotational semantics associates each language statement
with a function dsem from the state of the program before the
execution to the state after exe-cution.
If x = expr is an assignment statement and mem is the
function describing the memory before executing the
assignment
If dsem (x := expr, mem) = error mem (x) is undefined for
some variable x occurring in expr. Otherwise
dsem (x: = expr, mem) = mem' where mem' (y) = mem (y) for
all y ¦ x , mem' (x) = mem (expr) . Denotational semantics
S1; S2;
If
dsem (S1, mem) = mem1
and
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Language processing
an interpreter is a program that repeatedly executes the
following sequence.
Get the next statement;
Determine the actions to be executed;
Perform the actions;
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
The concept of binding
A binding that cannot be modified is called static.
A modifiable binding is called dynamic.
Language definition time binding.
Language implementation time binding.
Compile time (or translation time) binding
Execution time (or run time) binding.
33.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Variable
Formally, a variable is a 5-tuple <name, scope, type, l_value,
r_value> ,
Where
name is a string of characters used by program statements
to denote the Variable;
Scope is the range of program instructions over which the
name is known;
type is the variable’s type;
l_value is the memory location associated with the variable;
r_value is the encoded value stored in the variable’s
location.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Routine and Generic Routine
Overloading
A name is said to be overloaded if more than one entity is
bound to the name
int i, j, k;
float a, b, c;
... i = j + k;
a = b + c;
Operator + is overloaded
a = b + c + b ( );
36.
*
*
R
E
S
E
A
R
C
H
C
E
N
T
R
E
V
I
I
T
*
*
Seminar Presentation –Department of Technology
Routine and Generic Routine
Alaising
Two alias variables share the same data object in the same
referencing environment
int i;
int fun (int& a);
{ . . .
a = a + 1;
printf ("%d", i);
. . .
} main ( )
{ . . .
x = fun (i);
. . .
}