ݺߣ

ݺߣShare a Scribd company logo
Parser
DEFINITION AND SOME KEY POINTS
Definition
 A computer program use just to evaluate scripts according
  to the respective grammar.

 In computer Science, its a text analyzing process to
  determine if it belongs to a certain language or not.


 Mostly used as a part of High-Level-Language
  translators(Interpreter or Compiler).


 But some Standalone Parsers are available for specific
  purposes.(for e.g. http://nlp.stanford.edu/software/lex-parser.shtml)
What and How it works?

 It first receives input in the form of
    sequential source program or
    Stream of characters (String).
 Break them into small chunks or parts (tokens).
   For Example in English Language:


             He is running to school
             Subject    Verb           Object


 And produces a data-structure that is usually a tree.
What is not Parsing?

 Parser does not evaluate one thing into another. If
 just change its representation from one form to
 another.

 Parser is not responsible for summarizing or extract
 the original body of text.

Word Processing Programs also uses a parser to check
spelling and grammatical mistakes.
But What is Compiler ???

    Compiler is a Language Translator or a
  computer program that translates a Human
   understandable instruction set into Computer
               understandable form

  Or simply, the output of compiler is .exe file,

Object code or RTL(Register Transfer Language)
Compiler VS Parser

 From the previous discussion it can be concluded
 that:
    The output of Parser is a Data-Structure that is useless for the
     for both Liveware and hardware.
        But this will be a very useful input for some component of the
         compiler.


    Whereas, the output of the compiler is understandable and can
     be executed by Computer hardware
Phases of Compiler
Phases of Compiler

              These 3 phases can
              be called as they
              are actually
              parsing the source
              Program
Lexical Analysis

 As the name shows, Its done by Lexical Analyzer.


 Reads the characters from the input stream or source
  program.
 Group them in tokens.
 Each token describe some important element.


 CONFUSED….!!!
 Lets see an exmaple.
Token Example

 int a = 10 ;
 That’s the code for declaring and initializing a variable “a”.
 When this LOC passed through t Lexical Box following
  thing happens
                             Identifier Constant

                        int a = 10 ;
                     Data Type Assignment Symbol
                                Operator

 Each of this term is called as Token.
 For e.g. “a” is a token of “Identifier type”.
 The Character Sequence “int” is called as the its Lexeme.
           http://en.wikipedia.org/wiki/Token_(parser)#Token
Can we proceed further OR
Syntax Analyzer

 According to many sources, this phase is actually
 responsible for Parsing.
 So, the input of this phase is the Tokens formed in
 the previous phase i.e. Lexical Analysis.
 In this phase, the recently formed token acquire a
 Hierarchical Data Structure, that’s called Tree in
 Computer Science.
Before Moving Further

 First Explore this New Buzz Word Tree.

 Definition: Its an hierarchical Data Structure that is

 also known as the Collection of some related nodes.
Terminologies

 Node is structure that contains some value or
 condition.

 In the tree on right side
 “2” is a parent node that has two
  child nodes “7” and “5”.
Ad

Recommended

PPT
Lexical Analyzers and Parsers
Heshan Suriyaarachchi
PDF
Token, Pattern and Lexeme
A. S. M. Shafi
PPTX
role of lexical anaysis
Sudhaa Ravi
PPTX
Lexical analyzer
Farzana Aktar
PPT
Syntax analysis
Chetan Mahawar
TXT
tokens patterns and lexemes
Saqib Javed
PPTX
Cd ch2 - lexical analysis
mengistu23
PPTX
Compiler construction
Muhammed Afsal Villan
PDF
Java chapter 3
Mukesh Tekwani
PPT
Syntax analysis
Binsent Ribera
PPT
Declarative programming language
Vinisha Pathak
PPTX
1 compiler outline
ASHOK KUMAR REDDY
PDF
Using Static Analysis in Program Development
PVS-Studio
PPTX
Relationship Among Token, Lexeme & Pattern
Bharat Rathore
PPTX
Compilers in computer programming
Chetan Pandey
PPTX
Flex (fast lexical analyzer generator )
Sandip Basnet
PDF
Assignment4
Sunita Milind Dol
PPT
Compiler_Project_Srikanth_Vanama
Srikanth Vanama
PPTX
Hema wt (1)
SangeethaSasi1
PPT
Principles of compiler design
Janani Parthiban
PPTX
Binary Studio Academy PRO: ANTLR course by Alexander Vasiltsov (lesson 1)
Binary Studio
PPTX
Syntax analyzer
ahmed51236
PPTX
Fundamentals of Language Processing
Hemant Sharma
PDF
Language processors
Ganesh Wedpathak
PDF
compiler.pdfljdvgepitju4io3elkhldhyreyio4uw
abhinandpk2405
PDF
An Introduction to the Compiler Designss
ElakkiaU

More Related Content

What's hot (20)

PPTX
Cd ch2 - lexical analysis
mengistu23
PPTX
Compiler construction
Muhammed Afsal Villan
PDF
Java chapter 3
Mukesh Tekwani
PPT
Syntax analysis
Binsent Ribera
PPT
Declarative programming language
Vinisha Pathak
PPTX
1 compiler outline
ASHOK KUMAR REDDY
PDF
Using Static Analysis in Program Development
PVS-Studio
PPTX
Relationship Among Token, Lexeme & Pattern
Bharat Rathore
PPTX
Compilers in computer programming
Chetan Pandey
PPTX
Flex (fast lexical analyzer generator )
Sandip Basnet
PDF
Assignment4
Sunita Milind Dol
PPT
Compiler_Project_Srikanth_Vanama
Srikanth Vanama
PPTX
Hema wt (1)
SangeethaSasi1
PPT
Principles of compiler design
Janani Parthiban
PPTX
Binary Studio Academy PRO: ANTLR course by Alexander Vasiltsov (lesson 1)
Binary Studio
PPTX
Syntax analyzer
ahmed51236
PPTX
Fundamentals of Language Processing
Hemant Sharma
PDF
Language processors
Ganesh Wedpathak
Cd ch2 - lexical analysis
mengistu23
Compiler construction
Muhammed Afsal Villan
Java chapter 3
Mukesh Tekwani
Syntax analysis
Binsent Ribera
Declarative programming language
Vinisha Pathak
1 compiler outline
ASHOK KUMAR REDDY
Using Static Analysis in Program Development
PVS-Studio
Relationship Among Token, Lexeme & Pattern
Bharat Rathore
Compilers in computer programming
Chetan Pandey
Flex (fast lexical analyzer generator )
Sandip Basnet
Compiler_Project_Srikanth_Vanama
Srikanth Vanama
Hema wt (1)
SangeethaSasi1
Principles of compiler design
Janani Parthiban
Binary Studio Academy PRO: ANTLR course by Alexander Vasiltsov (lesson 1)
Binary Studio
Syntax analyzer
ahmed51236
Fundamentals of Language Processing
Hemant Sharma
Language processors
Ganesh Wedpathak

Similar to Parser (20)

PDF
compiler.pdfljdvgepitju4io3elkhldhyreyio4uw
abhinandpk2405
PDF
An Introduction to the Compiler Designss
ElakkiaU
PPTX
COMPILER CONSTRUCTION KU 1.pptx
Rossy719186
PDF
3a. Context Free Grammar.pdf
TANZINTANZINA
PPTX
1._Introduction_.pptx
Anbarasan Radhakrishnan R
PPTX
Chapter 2.pptx compiler design lecture note
adugnanegero
PPTX
compiler introduction vtu syllabus 1st chapter.pptx
ranjan317165
PPTX
CD U1-5.pptx
Himajanaidu2
PPT
Unit1.ppt
BerlinShaheema2
PDF
11700220036.pdf
SouvikRoy149
PPT
SS & CD Module 3
ShwetaNirmanik
PPT
Module 2
ShwetaNirmanik
DOCX
Compiler Design
Anujashejwal
PPTX
Plc part 2
Taymoor Nazmy
PPT
Data design and analysis of computing tools
KamranAli649587
PPTX
Compiler Design.pptx
SouvikRoy149
PPTX
Ss ui lecture 2
Avinash Kapse
PPTX
Structure of the compiler
Sudhaa Ravi
PDF
Structure of a Compiler, Compiler and Interpreter, Lexical Analysis: Role of ...
GunjalSanjay
PPT
Compiler Design in Computer Applications
Mohit422982
compiler.pdfljdvgepitju4io3elkhldhyreyio4uw
abhinandpk2405
An Introduction to the Compiler Designss
ElakkiaU
COMPILER CONSTRUCTION KU 1.pptx
Rossy719186
3a. Context Free Grammar.pdf
TANZINTANZINA
1._Introduction_.pptx
Anbarasan Radhakrishnan R
Chapter 2.pptx compiler design lecture note
adugnanegero
compiler introduction vtu syllabus 1st chapter.pptx
ranjan317165
CD U1-5.pptx
Himajanaidu2
11700220036.pdf
SouvikRoy149
SS & CD Module 3
ShwetaNirmanik
Compiler Design
Anujashejwal
Plc part 2
Taymoor Nazmy
Data design and analysis of computing tools
KamranAli649587
Compiler Design.pptx
SouvikRoy149
Ss ui lecture 2
Avinash Kapse
Structure of the compiler
Sudhaa Ravi
Structure of a Compiler, Compiler and Interpreter, Lexical Analysis: Role of ...
GunjalSanjay
Compiler Design in Computer Applications
Mohit422982
Ad

Recently uploaded (20)

PDF
COM and NET Component Services 1st Edition Juval Löwy
kboqcyuw976
PDF
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
DOCX
MUSIC AND ARTS 5 DLL MATATAG LESSON EXEMPLAR QUARTER 1_Q1_W1.docx
DianaValiente5
PDF
Learning Styles Inventory for Senior High School Students
Thelma Villaflores
PPTX
How to use grouped() method in Odoo 18 - Odoo ݺߣs
Celine George
PPTX
Tanja Vujicic - PISA for Schools contact Info
EduSkills OECD
PPTX
Elo the Hero is an story about a young boy who became hero.
TeacherEmily1
PPTX
Project 4 PART 1 AI Assistant Vocational Education
barmanjit380
PDF
Our Guide to the July 2025 USPS® Rate Change
Postal Advocate Inc.
PPTX
How to Manage Wins & Losses in Odoo 18 CRM
Celine George
PDF
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
PPTX
Urban Hierarchy and Service Provisions.pptx
Islamic University of Bangladesh
PPTX
How to Create & Manage Stages in Odoo 18 Helpdesk
Celine George
PPTX
How to use _name_search() method in Odoo 18
Celine George
PDF
Andreas Schleicher_Teaching Compass_Education 2040.pdf
EduSkills OECD
PDF
Wikinomics How Mass Collaboration Changes Everything Don Tapscott
wcsqyzf5909
PPT
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
DOCX
ANNOTATION on objective 10 on pmes 2022-2025
joviejanesegundo1
PPTX
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
PDF
Supply Chain Security A Comprehensive Approach 1st Edition Arthur G. Arway
rxgnika452
COM and NET Component Services 1st Edition Juval Löwy
kboqcyuw976
Gladiolous Cultivation practices by AKL.pdf
kushallamichhame
MUSIC AND ARTS 5 DLL MATATAG LESSON EXEMPLAR QUARTER 1_Q1_W1.docx
DianaValiente5
Learning Styles Inventory for Senior High School Students
Thelma Villaflores
How to use grouped() method in Odoo 18 - Odoo ݺߣs
Celine George
Tanja Vujicic - PISA for Schools contact Info
EduSkills OECD
Elo the Hero is an story about a young boy who became hero.
TeacherEmily1
Project 4 PART 1 AI Assistant Vocational Education
barmanjit380
Our Guide to the July 2025 USPS® Rate Change
Postal Advocate Inc.
How to Manage Wins & Losses in Odoo 18 CRM
Celine George
CAD25 Gbadago and Fafa Presentation Revised-Aston Business School, UK.pdf
Kweku Zurek
Urban Hierarchy and Service Provisions.pptx
Islamic University of Bangladesh
How to Create & Manage Stages in Odoo 18 Helpdesk
Celine George
How to use _name_search() method in Odoo 18
Celine George
Andreas Schleicher_Teaching Compass_Education 2040.pdf
EduSkills OECD
Wikinomics How Mass Collaboration Changes Everything Don Tapscott
wcsqyzf5909
M&A5 Q1 1 differentiate evolving early Philippine conventional and contempora...
ErlizaRosete
ANNOTATION on objective 10 on pmes 2022-2025
joviejanesegundo1
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
Supply Chain Security A Comprehensive Approach 1st Edition Arthur G. Arway
rxgnika452
Ad

Parser

  • 2. Definition  A computer program use just to evaluate scripts according to the respective grammar.  In computer Science, its a text analyzing process to determine if it belongs to a certain language or not.  Mostly used as a part of High-Level-Language translators(Interpreter or Compiler).  But some Standalone Parsers are available for specific purposes.(for e.g. http://nlp.stanford.edu/software/lex-parser.shtml)
  • 3. What and How it works?  It first receives input in the form of  sequential source program or  Stream of characters (String).  Break them into small chunks or parts (tokens).  For Example in English Language: He is running to school Subject Verb Object  And produces a data-structure that is usually a tree.
  • 4. What is not Parsing?  Parser does not evaluate one thing into another. If just change its representation from one form to another.  Parser is not responsible for summarizing or extract the original body of text. Word Processing Programs also uses a parser to check spelling and grammatical mistakes.
  • 5. But What is Compiler ??? Compiler is a Language Translator or a computer program that translates a Human understandable instruction set into Computer understandable form Or simply, the output of compiler is .exe file, Object code or RTL(Register Transfer Language)
  • 6. Compiler VS Parser  From the previous discussion it can be concluded that:  The output of Parser is a Data-Structure that is useless for the for both Liveware and hardware.  But this will be a very useful input for some component of the compiler.  Whereas, the output of the compiler is understandable and can be executed by Computer hardware
  • 8. Phases of Compiler These 3 phases can be called as they are actually parsing the source Program
  • 9. Lexical Analysis  As the name shows, Its done by Lexical Analyzer.  Reads the characters from the input stream or source program.  Group them in tokens.  Each token describe some important element.  CONFUSED….!!!  Lets see an exmaple.
  • 10. Token Example  int a = 10 ;  That’s the code for declaring and initializing a variable “a”.  When this LOC passed through t Lexical Box following thing happens Identifier Constant int a = 10 ; Data Type Assignment Symbol Operator  Each of this term is called as Token.  For e.g. “a” is a token of “Identifier type”.  The Character Sequence “int” is called as the its Lexeme. http://en.wikipedia.org/wiki/Token_(parser)#Token
  • 11. Can we proceed further OR
  • 12. Syntax Analyzer  According to many sources, this phase is actually responsible for Parsing.  So, the input of this phase is the Tokens formed in the previous phase i.e. Lexical Analysis.  In this phase, the recently formed token acquire a Hierarchical Data Structure, that’s called Tree in Computer Science.
  • 13. Before Moving Further  First Explore this New Buzz Word Tree.  Definition: Its an hierarchical Data Structure that is also known as the Collection of some related nodes.
  • 14. Terminologies  Node is structure that contains some value or condition.  In the tree on right side  “2” is a parent node that has two child nodes “7” and “5”.