Your SlideShare is downloading. ×
0
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Ppl ppt
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Ppl ppt

1,044

Published on

Programming Languages and Functional Programming

Programming Languages and Functional Programming

Published in: Education, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,044
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
35
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. PRINCIPLES OF PROGRAMMING LANGUAGE AND FUNCTIONAL PROGRAMING By:Tauseef Jamal(100101243) Siddharth Khurana(100101220) Pooja Singh(100101167) Varun Kumar(100101254)
  • 2. CONTENTS • INTRODUCTION • COMPILERS • STAGES OF COMPILER • BNF • FUNCTIONAL PROGRAMMING • USES OF FUNCTIONAL PROGRAMMING
  • 3. INTRODUCTION • Language Designers have a basic vocabulary about language structure, meaning and pragmatic concerns that help them understand how language works. Their vocabulary falls into three major categories that we call programming language design. o Syntax o Names & Types o Semantics
  • 4. • Syntax:- Describes what constitutes a structurally correct programs. • Names & Types:-Enables the programmer to understand and properly implement operations on the values of various types. • Semantics:-Defines the meaning of a program. i.e. when a program is executed, the effect of each statement on the values of the variable in the program is given by the semantic of the language.
  • 5. PROGRAMMING PARADIGMS • A Programming Paradigm is a pattern of problem-solving thoughts that underlies a particular genre of programs and languages. • Types:- Imperative Programming Object-Oriented Programming Functional Programming Logic Programming
  • 6. COMPILERS  A compiler is a program that reads a program written in one language – the source language – and translate it into an equivalent program in another language – the target language. As an imp part of this translation process, the compiler reports to its user the presence errors in the source program. Source program program Target Error messages
  • 7. STAGES OF COMPILER Source Program Lexical Analyzer Syntax analyzer Semantic analyzer Symbol Table Manager Intermediate code generator Code optimizer Code generator Target Program Error Handler
  • 8. LEXICAL ANALYZER • Also called “Scanner”. • Scanner separates characters of the source language into groups that logically belong together, these groups are called tokens. Usual tokens are keywords such as Do or IF, identifiers such as NUM, operators such as <,= ,+, and punctuation symbols such as parentheses or commas.
  • 9. SYNTACTICAL ANALYZER • Also called “Parser”. • It is the process of analyzing a string of symbols, either in natural language or in computer languages, according to the rules of a formal grammar.
  • 10. SEMANTIC ANALYZER • In this phase the compiler adds semantic information to the parse tree and builds the symbol table. • Performs semantic checks such as type checking, object binding, definite assignment, rejecting incorrect programs or issuing warnings.
  • 11. INTERMEDIATE CODE GENERATOR • It is machine independent. • During the translation of a source program into the object code for a target machine, a compiler may generate a middle-level language code, which is known as intermediate code. • The complexity of this code lies between the source language code and the object code.
  • 12. CODE OPTIMIZER • The intermediate language representation is transformed into functionally equivalent but faster (or smaller) forms. It tries to minimize or maximize some attributes of an executable computer program
  • 13. CODE GENERATOR • Converts some intermediate representation of source code into a form that can be readily executed by a machine. • This involves resource and storage decisions, such as deciding which variables to fit into registers and memory and the selection and scheduling of appropriate machine instructions along with their associated addressing modes.
  • 14. BNF GRAMMAR • Backus-Naur Form. • Adopted from Chomsky Theory. • Used for defining programming language syntax, the non- terminals N identify the language's grammatical categories like identifiers,integers,expression,statement & program. • Non-Terminals are written in angle brackets which also appear in the left hand side of at least one production. Example:-<A>::=<A><B> <B>
  • 15. FUNCTIONAL PROGRAMMING • Functional programming is style of programming in which the basic method of computation is the application of functions to arguments; • A functional language is one that supports and encourages the functional style.
  • 16. Example Summing the integers 1 to 10 in Java: total = 0; for (i = 1; i 10; ++i) total = total+i; The computation method is variable assignment. 16
  • 17. Example Summing the integers 1 to 10 in Haskell: sum [1..10] The computation method is function application. 17
  • 18. Basic Concepts Used In Functional Programming • • • • • Types and classes Defining functions List comprehensions Recursive functions Higher-order functions
  • 19. WHY IS IT USEFUL?  The abstract nature of functional programming leads to considerably simpler programs;  It also supports a number of powerful new ways to structure and reason about programs
  • 20. THANK YOU

×