SlideShare a Scribd company logo
SYNTAX ANALYSIS
CONTENTS 
o Syntax 
o Syntax Terminology 
o Syntatic element of the Language 
o Syntax Analysis 
o Formal Methods of Describing Syntax 
Grammar 
Parts of Grammars 
Parse Tree 
Syntax Diagram 
1
Syntax 
“The arrangement of words as elements in a sentence 
to show their relationship” describes the sequence of 
symbols that make up valid programs. 
Form of expressions, statements and program units. 
2
Syntax Terminology 
 A sentence is a string of characters over some alphabet 
 A language is a set of sentences 
 A lexeme is the lowest level syntactic unit of a language 
(e.g., *, sum, begin) 
 A token is a category of lexemes (e.g., identifier) 
3
Syntactic elements of the Language 
 Keywords and reserved words – is an identifier used as 
a fixed part of the syntax of a statement. It is a reserved 
word if it may not be used as a programmer-chosen 
identifier. 
 Noise words – optional words that are inserted in a 
statements to improved readability. 
4
Syntactic elements of the Language 
 Comments – important part of the documentation. 
REM, /* */, or // 
 Blank (spaces) 
 Delimiters – a syntactic element used simply to mark 
the beginning or end of some syntactic unit such as a 
statement or expression. “begin”…”end”, or { }. 
5
Syntactic Analysis 
 Determines if the program being compiled is a valid 
sentence in the syntactic model programming 
language. 
6
Formal Methods of Describing Syntax 
 Grammars 
 Parse Trees 
 Syntax Diagrams 
7
Grammars 
 Formal definition of the syntax of a programming 
language. 
 Collection of rules that define, mathematically, which 
strings of symbols are valid sentences. 
8
Parts of Grammar 
 Set of tokens/terminal symbols 
 symbols that are atomic / non-divisible 
 can be combined to form valid constructs in the 
language 
 Set of non-terminal symbols 
 symbols used to represent intermediate definitions 
within the language 
 defined by productions 
 syntactic classes or categories 
9
Parse Tree 
 Parse trees are trees level by symbols of a particular 
context free grammar(CFG). 
 Leaves : level by a terminal. 
 Interior nodes: level by a variable. 
 Root: must be level by the start symbol. 
10
Thank you… 
…
Any Queries??? 
…
Ad

More Related Content

What's hot (20)

Grammar & its Kinds.pptx
Grammar & its Kinds.pptxGrammar & its Kinds.pptx
Grammar & its Kinds.pptx
University of Sahiwal
 
Language and mind
Language and mindLanguage and mind
Language and mind
Yermek Toktarov
 
Introduction to Systemic Functional Linguistics
Introduction to Systemic Functional LinguisticsIntroduction to Systemic Functional Linguistics
Introduction to Systemic Functional Linguistics
AleeenaFarooq
 
Lecture 1 - Lexical Analysis.ppt
Lecture 1 - Lexical Analysis.pptLecture 1 - Lexical Analysis.ppt
Lecture 1 - Lexical Analysis.ppt
NderituGichuki1
 
Prescriptive linguistics presentation
Prescriptive linguistics presentationPrescriptive linguistics presentation
Prescriptive linguistics presentation
jhaiusa20
 
Syntax directed translation
Syntax directed translationSyntax directed translation
Syntax directed translation
Akshaya Arunan
 
Ch3 4 regular expression and grammar
Ch3 4 regular expression and grammarCh3 4 regular expression and grammar
Ch3 4 regular expression and grammar
meresie tesfay
 
Natural Language Processing: Parsing
Natural Language Processing: ParsingNatural Language Processing: Parsing
Natural Language Processing: Parsing
Rushdi Shams
 
Saussure
Saussure Saussure
Saussure
Junaid Amjed
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming language
Vasavi College of Engg
 
Structure chart
Structure chartStructure chart
Structure chart
Arjun R
 
L3 cfg
L3 cfgL3 cfg
L3 cfg
Self-employed
 
Intermediate code- generation
Intermediate code- generationIntermediate code- generation
Intermediate code- generation
rawan_z
 
Linguistics and Its Branches.pptx
Linguistics and Its Branches.pptxLinguistics and Its Branches.pptx
Linguistics and Its Branches.pptx
Khaleel Al Bataineh
 
Parse Tree
Parse TreeParse Tree
Parse Tree
A. S. M. Shafi
 
Concept of language testing
Concept  of  language  testingConcept  of  language  testing
Concept of language testing
nirmeennimmu
 
Language planning
Language planningLanguage planning
Language planning
Umm-e-Rooman Yaqoob
 
morphemes
morphemesmorphemes
morphemes
Indah AlwaysHappy
 
Introduction to morphosyntax
Introduction to morphosyntaxIntroduction to morphosyntax
Introduction to morphosyntax
soraya hermawan
 
Introductiontopragmaticsanddiscourse 160828144616
Introductiontopragmaticsanddiscourse 160828144616Introductiontopragmaticsanddiscourse 160828144616
Introductiontopragmaticsanddiscourse 160828144616
Buhsra
 
Introduction to Systemic Functional Linguistics
Introduction to Systemic Functional LinguisticsIntroduction to Systemic Functional Linguistics
Introduction to Systemic Functional Linguistics
AleeenaFarooq
 
Lecture 1 - Lexical Analysis.ppt
Lecture 1 - Lexical Analysis.pptLecture 1 - Lexical Analysis.ppt
Lecture 1 - Lexical Analysis.ppt
NderituGichuki1
 
Prescriptive linguistics presentation
Prescriptive linguistics presentationPrescriptive linguistics presentation
Prescriptive linguistics presentation
jhaiusa20
 
Syntax directed translation
Syntax directed translationSyntax directed translation
Syntax directed translation
Akshaya Arunan
 
Ch3 4 regular expression and grammar
Ch3 4 regular expression and grammarCh3 4 regular expression and grammar
Ch3 4 regular expression and grammar
meresie tesfay
 
Natural Language Processing: Parsing
Natural Language Processing: ParsingNatural Language Processing: Parsing
Natural Language Processing: Parsing
Rushdi Shams
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming language
Vasavi College of Engg
 
Structure chart
Structure chartStructure chart
Structure chart
Arjun R
 
Intermediate code- generation
Intermediate code- generationIntermediate code- generation
Intermediate code- generation
rawan_z
 
Linguistics and Its Branches.pptx
Linguistics and Its Branches.pptxLinguistics and Its Branches.pptx
Linguistics and Its Branches.pptx
Khaleel Al Bataineh
 
Concept of language testing
Concept  of  language  testingConcept  of  language  testing
Concept of language testing
nirmeennimmu
 
Introduction to morphosyntax
Introduction to morphosyntaxIntroduction to morphosyntax
Introduction to morphosyntax
soraya hermawan
 
Introductiontopragmaticsanddiscourse 160828144616
Introductiontopragmaticsanddiscourse 160828144616Introductiontopragmaticsanddiscourse 160828144616
Introductiontopragmaticsanddiscourse 160828144616
Buhsra
 

Viewers also liked (11)

Syntactic change through translation: A corpus-based approach to language change
Syntactic change through translation: A corpus-based approach to language changeSyntactic change through translation: A corpus-based approach to language change
Syntactic change through translation: A corpus-based approach to language change
Mario Bisiada
 
Syntax
SyntaxSyntax
Syntax
Lyudmila Osinovskaya
 
The Universe: A Module in Science and Technology for Grade 5 Pupils
The Universe: A Module in Science and Technology for Grade 5 PupilsThe Universe: A Module in Science and Technology for Grade 5 Pupils
The Universe: A Module in Science and Technology for Grade 5 Pupils
cryster
 
Syntax Definition
Syntax DefinitionSyntax Definition
Syntax Definition
Guido Wachsmuth
 
Model of Teaching
Model of TeachingModel of Teaching
Model of Teaching
Deepty Gupta
 
Teaching models
Teaching modelsTeaching models
Teaching models
Xyrille Yves Zaide
 
Syntactic space syntax4generativedesign
Syntactic space syntax4generativedesignSyntactic space syntax4generativedesign
Syntactic space syntax4generativedesign
Pirouz Nourian
 
Syntax
SyntaxSyntax
Syntax
rmsutton
 
ENGLISH SYNTAX
ENGLISH SYNTAXENGLISH SYNTAX
ENGLISH SYNTAX
Videoconferencias UTPL
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
Vasavi College of Engg
 
Models of teaching
Models of teachingModels of teaching
Models of teaching
Aileen Asim
 
Syntactic change through translation: A corpus-based approach to language change
Syntactic change through translation: A corpus-based approach to language changeSyntactic change through translation: A corpus-based approach to language change
Syntactic change through translation: A corpus-based approach to language change
Mario Bisiada
 
The Universe: A Module in Science and Technology for Grade 5 Pupils
The Universe: A Module in Science and Technology for Grade 5 PupilsThe Universe: A Module in Science and Technology for Grade 5 Pupils
The Universe: A Module in Science and Technology for Grade 5 Pupils
cryster
 
Syntactic space syntax4generativedesign
Syntactic space syntax4generativedesignSyntactic space syntax4generativedesign
Syntactic space syntax4generativedesign
Pirouz Nourian
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
Vasavi College of Engg
 
Models of teaching
Models of teachingModels of teaching
Models of teaching
Aileen Asim
 
Ad

Similar to Syntax analysis (20)

Copy-of-Introduction-to-Parse-Trees-and-Syntax-Trees.pptx
Copy-of-Introduction-to-Parse-Trees-and-Syntax-Trees.pptxCopy-of-Introduction-to-Parse-Trees-and-Syntax-Trees.pptx
Copy-of-Introduction-to-Parse-Trees-and-Syntax-Trees.pptx
PrathiyathiM
 
COMPILER DESIGN LECTURES -UNIT-2 ST.pptx
COMPILER DESIGN LECTURES -UNIT-2 ST.pptxCOMPILER DESIGN LECTURES -UNIT-2 ST.pptx
COMPILER DESIGN LECTURES -UNIT-2 ST.pptx
Ranjeet Reddy
 
SS UII Lecture 1
SS UII Lecture 1SS UII Lecture 1
SS UII Lecture 1
Avinash Kapse
 
Syntax analyzer
Syntax analyzerSyntax analyzer
Syntax analyzer
ahmed51236
 
Chahioiuou9oioooooooooooooofffghfpterTwo.pptx
Chahioiuou9oioooooooooooooofffghfpterTwo.pptxChahioiuou9oioooooooooooooofffghfpterTwo.pptx
Chahioiuou9oioooooooooooooofffghfpterTwo.pptx
dejenehundaol91
 
Chapter 2.pptx compiler design lecture note
Chapter 2.pptx compiler design lecture noteChapter 2.pptx compiler design lecture note
Chapter 2.pptx compiler design lecture note
adugnanegero
 
PSEUDOCODE TO SOURCE PROGRAMMING LANGUAGE TRANSLATOR
PSEUDOCODE TO SOURCE PROGRAMMING LANGUAGE TRANSLATORPSEUDOCODE TO SOURCE PROGRAMMING LANGUAGE TRANSLATOR
PSEUDOCODE TO SOURCE PROGRAMMING LANGUAGE TRANSLATOR
ijistjournal
 
role of lexical anaysis
role of lexical anaysisrole of lexical anaysis
role of lexical anaysis
Sudhaa Ravi
 
Describing Syntax and Semantics in ppl.pptx
Describing Syntax and Semantics in ppl.pptxDescribing Syntax and Semantics in ppl.pptx
Describing Syntax and Semantics in ppl.pptx
yogaranganathsct
 
Explained: Interpreter Design Pattern and its Components
Explained: Interpreter Design Pattern and its ComponentsExplained: Interpreter Design Pattern and its Components
Explained: Interpreter Design Pattern and its Components
StudySection
 
Pcd question bank
Pcd question bank Pcd question bank
Pcd question bank
Sumathi Gnanasekaran
 
Structure of the compiler
Structure of the compilerStructure of the compiler
Structure of the compiler
Sudhaa Ravi
 
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmmUnit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
DhruvKushwaha12
 
Improving Document Clustering by Eliminating Unnatural Language
Improving Document Clustering by Eliminating Unnatural LanguageImproving Document Clustering by Eliminating Unnatural Language
Improving Document Clustering by Eliminating Unnatural Language
Jinho Choi
 
An Intuitive Natural Language Understanding System
An Intuitive Natural Language Understanding SystemAn Intuitive Natural Language Understanding System
An Intuitive Natural Language Understanding System
inscit2006
 
chapter4 end.pptx
chapter4 end.pptxchapter4 end.pptx
chapter4 end.pptx
Maryam522887
 
Parser
ParserParser
Parser
Mallikarjun Rao
 
Describing syntax and semantics66666.ppt
Describing syntax and semantics66666.pptDescribing syntax and semantics66666.ppt
Describing syntax and semantics66666.ppt
sameehamoogab
 
3a. Context Free Grammar.pdf
3a. Context Free Grammar.pdf3a. Context Free Grammar.pdf
3a. Context Free Grammar.pdf
TANZINTANZINA
 
Shallow parser for hindi language with an input from a transliterator
Shallow parser for hindi language with an input from a transliteratorShallow parser for hindi language with an input from a transliterator
Shallow parser for hindi language with an input from a transliterator
Shashank Shisodia
 
Copy-of-Introduction-to-Parse-Trees-and-Syntax-Trees.pptx
Copy-of-Introduction-to-Parse-Trees-and-Syntax-Trees.pptxCopy-of-Introduction-to-Parse-Trees-and-Syntax-Trees.pptx
Copy-of-Introduction-to-Parse-Trees-and-Syntax-Trees.pptx
PrathiyathiM
 
COMPILER DESIGN LECTURES -UNIT-2 ST.pptx
COMPILER DESIGN LECTURES -UNIT-2 ST.pptxCOMPILER DESIGN LECTURES -UNIT-2 ST.pptx
COMPILER DESIGN LECTURES -UNIT-2 ST.pptx
Ranjeet Reddy
 
Syntax analyzer
Syntax analyzerSyntax analyzer
Syntax analyzer
ahmed51236
 
Chahioiuou9oioooooooooooooofffghfpterTwo.pptx
Chahioiuou9oioooooooooooooofffghfpterTwo.pptxChahioiuou9oioooooooooooooofffghfpterTwo.pptx
Chahioiuou9oioooooooooooooofffghfpterTwo.pptx
dejenehundaol91
 
Chapter 2.pptx compiler design lecture note
Chapter 2.pptx compiler design lecture noteChapter 2.pptx compiler design lecture note
Chapter 2.pptx compiler design lecture note
adugnanegero
 
PSEUDOCODE TO SOURCE PROGRAMMING LANGUAGE TRANSLATOR
PSEUDOCODE TO SOURCE PROGRAMMING LANGUAGE TRANSLATORPSEUDOCODE TO SOURCE PROGRAMMING LANGUAGE TRANSLATOR
PSEUDOCODE TO SOURCE PROGRAMMING LANGUAGE TRANSLATOR
ijistjournal
 
role of lexical anaysis
role of lexical anaysisrole of lexical anaysis
role of lexical anaysis
Sudhaa Ravi
 
Describing Syntax and Semantics in ppl.pptx
Describing Syntax and Semantics in ppl.pptxDescribing Syntax and Semantics in ppl.pptx
Describing Syntax and Semantics in ppl.pptx
yogaranganathsct
 
Explained: Interpreter Design Pattern and its Components
Explained: Interpreter Design Pattern and its ComponentsExplained: Interpreter Design Pattern and its Components
Explained: Interpreter Design Pattern and its Components
StudySection
 
Structure of the compiler
Structure of the compilerStructure of the compiler
Structure of the compiler
Sudhaa Ravi
 
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmmUnit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
Unit-1 PPL PPTvvhvmmmmmmmmmmmmmmmmmmmmmm
DhruvKushwaha12
 
Improving Document Clustering by Eliminating Unnatural Language
Improving Document Clustering by Eliminating Unnatural LanguageImproving Document Clustering by Eliminating Unnatural Language
Improving Document Clustering by Eliminating Unnatural Language
Jinho Choi
 
An Intuitive Natural Language Understanding System
An Intuitive Natural Language Understanding SystemAn Intuitive Natural Language Understanding System
An Intuitive Natural Language Understanding System
inscit2006
 
Describing syntax and semantics66666.ppt
Describing syntax and semantics66666.pptDescribing syntax and semantics66666.ppt
Describing syntax and semantics66666.ppt
sameehamoogab
 
3a. Context Free Grammar.pdf
3a. Context Free Grammar.pdf3a. Context Free Grammar.pdf
3a. Context Free Grammar.pdf
TANZINTANZINA
 
Shallow parser for hindi language with an input from a transliterator
Shallow parser for hindi language with an input from a transliteratorShallow parser for hindi language with an input from a transliterator
Shallow parser for hindi language with an input from a transliterator
Shashank Shisodia
 
Ad

More from Chetan Mahawar (16)

A christmas carol
A christmas carolA christmas carol
A christmas carol
Chetan Mahawar
 
The god of small things
The god of small thingsThe god of small things
The god of small things
Chetan Mahawar
 
Oliver twist
Oliver twistOliver twist
Oliver twist
Chetan Mahawar
 
Process in operating system
Process in operating systemProcess in operating system
Process in operating system
Chetan Mahawar
 
Biography of jawaharlal nehru
Biography of jawaharlal nehruBiography of jawaharlal nehru
Biography of jawaharlal nehru
Chetan Mahawar
 
A biography of dhirubhai ambani
A biography of dhirubhai ambaniA biography of dhirubhai ambani
A biography of dhirubhai ambani
Chetan Mahawar
 
Dwayne the rock johnson
Dwayne the rock johnsonDwayne the rock johnson
Dwayne the rock johnson
Chetan Mahawar
 
Translation lookaside buffer
Translation lookaside bufferTranslation lookaside buffer
Translation lookaside buffer
Chetan Mahawar
 
The god of small things
The god of small thingsThe god of small things
The god of small things
Chetan Mahawar
 
Dell corporation ltd
Dell corporation ltdDell corporation ltd
Dell corporation ltd
Chetan Mahawar
 
Transaction states and properties
Transaction states and propertiesTransaction states and properties
Transaction states and properties
Chetan Mahawar
 
100 crore tag in indian cinema
100 crore tag in indian cinema100 crore tag in indian cinema
100 crore tag in indian cinema
Chetan Mahawar
 
Traning needs analysis1
Traning needs analysis1Traning needs analysis1
Traning needs analysis1
Chetan Mahawar
 
Hrm ppt
Hrm pptHrm ppt
Hrm ppt
Chetan Mahawar
 
Cellular india
Cellular indiaCellular india
Cellular india
Chetan Mahawar
 
Subsidy in india
Subsidy in indiaSubsidy in india
Subsidy in india
Chetan Mahawar
 
The god of small things
The god of small thingsThe god of small things
The god of small things
Chetan Mahawar
 
Process in operating system
Process in operating systemProcess in operating system
Process in operating system
Chetan Mahawar
 
Biography of jawaharlal nehru
Biography of jawaharlal nehruBiography of jawaharlal nehru
Biography of jawaharlal nehru
Chetan Mahawar
 
A biography of dhirubhai ambani
A biography of dhirubhai ambaniA biography of dhirubhai ambani
A biography of dhirubhai ambani
Chetan Mahawar
 
Dwayne the rock johnson
Dwayne the rock johnsonDwayne the rock johnson
Dwayne the rock johnson
Chetan Mahawar
 
Translation lookaside buffer
Translation lookaside bufferTranslation lookaside buffer
Translation lookaside buffer
Chetan Mahawar
 
The god of small things
The god of small thingsThe god of small things
The god of small things
Chetan Mahawar
 
Transaction states and properties
Transaction states and propertiesTransaction states and properties
Transaction states and properties
Chetan Mahawar
 
100 crore tag in indian cinema
100 crore tag in indian cinema100 crore tag in indian cinema
100 crore tag in indian cinema
Chetan Mahawar
 
Traning needs analysis1
Traning needs analysis1Traning needs analysis1
Traning needs analysis1
Chetan Mahawar
 

Recently uploaded (20)

Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
The Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLabThe Gaussian Process Modeling Module in UQLab
The Gaussian Process Modeling Module in UQLab
Journal of Soft Computing in Civil Engineering
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)
samueljackson3773
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Journal of Soft Computing in Civil Engineering
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...15th International Conference on Computer Science, Engineering and Applicatio...
15th International Conference on Computer Science, Engineering and Applicatio...
IJCSES Journal
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)AI-assisted Software Testing (3-hours tutorial)
AI-assisted Software Testing (3-hours tutorial)
Vəhid Gəruslu
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptxLidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
Lidar for Autonomous Driving, LiDAR Mapping for Driverless Cars.pptx
RishavKumar530754
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
Compiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptxCompiler Design_Lexical Analysis phase.pptx
Compiler Design_Lexical Analysis phase.pptx
RushaliDeshmukh2
 
International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)International Journal of Distributed and Parallel systems (IJDPS)
International Journal of Distributed and Parallel systems (IJDPS)
samueljackson3773
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 

Syntax analysis

  • 2. CONTENTS o Syntax o Syntax Terminology o Syntatic element of the Language o Syntax Analysis o Formal Methods of Describing Syntax Grammar Parts of Grammars Parse Tree Syntax Diagram 1
  • 3. Syntax “The arrangement of words as elements in a sentence to show their relationship” describes the sequence of symbols that make up valid programs. Form of expressions, statements and program units. 2
  • 4. Syntax Terminology  A sentence is a string of characters over some alphabet  A language is a set of sentences  A lexeme is the lowest level syntactic unit of a language (e.g., *, sum, begin)  A token is a category of lexemes (e.g., identifier) 3
  • 5. Syntactic elements of the Language  Keywords and reserved words – is an identifier used as a fixed part of the syntax of a statement. It is a reserved word if it may not be used as a programmer-chosen identifier.  Noise words – optional words that are inserted in a statements to improved readability. 4
  • 6. Syntactic elements of the Language  Comments – important part of the documentation. REM, /* */, or //  Blank (spaces)  Delimiters – a syntactic element used simply to mark the beginning or end of some syntactic unit such as a statement or expression. “begin”…”end”, or { }. 5
  • 7. Syntactic Analysis  Determines if the program being compiled is a valid sentence in the syntactic model programming language. 6
  • 8. Formal Methods of Describing Syntax  Grammars  Parse Trees  Syntax Diagrams 7
  • 9. Grammars  Formal definition of the syntax of a programming language.  Collection of rules that define, mathematically, which strings of symbols are valid sentences. 8
  • 10. Parts of Grammar  Set of tokens/terminal symbols  symbols that are atomic / non-divisible  can be combined to form valid constructs in the language  Set of non-terminal symbols  symbols used to represent intermediate definitions within the language  defined by productions  syntactic classes or categories 9
  • 11. Parse Tree  Parse trees are trees level by symbols of a particular context free grammar(CFG).  Leaves : level by a terminal.  Interior nodes: level by a variable.  Root: must be level by the start symbol. 10