SlideShare ist ein Scribd-Unternehmen logo
1 von 16
CSE340 - Principles of
Programming Languages
Lecture 06:
Closing with Lexical Analysis
Javier Gonzalez-Sanchez
javiergs@asu.edu
BYENG M1-38
Office Hours: By appointment
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 4
Programming Assignment #1
?
70%
?
100%
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 5
Programming Assignment #1
?
100%
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 6
Programming Assignment #1
?
70%
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 7
Programming Assignment #1
!  Firstname_Lastname_P1.zip
!  Compile and Run
!  Recognize BINARY
!  Recognize DELIMITER and OPERATOR
approx. 20%
!  Recognize INTEGER
!  Recognize OCTAL
!  Recognize HEXADECIMAL
!  Recognize IDENTIFIER
approx. 40%
!  Recognize STRING
!  Recognize CHAR
!  Recognize KEYWORD
!  Recognize FLOAT
approx. 40%
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 8
Review | Lexical Analysis
Are the following STRINGS correct or not? Why?
!  000000005
!  000000009
!  000000009.1
!  000000005
!  000000005.1
!  0x0000002
!  0123456789
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 9
Review | Lexical Analysis
Are the following STRINGS correct or not? Why?
!  1.2e---3++
!  $50
!  float ________________ = 5;
!  double x = 000000.1;
!  '''a'
!  '''b'
!  ''b'
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 10
Review | Lexical Analysis
Are the following STRINGS correct or not? Why?
!  " a"
!  "Hello""world"
!  abc"Hello"
!  ''’
!  'x’
!  ’a'
!  ’w’
!  ""
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 11
State Transition Table
for our Lexer
(step by step)
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 12
BINARY
INTEGER
OCTAL
HEXADECIMAL
IDENTIFIER
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 13
Lexer – Step by Step
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 14
Lexer – Step by Step
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 15
Lexer – Step by Step
1 = INTEGER
2 = INTEGER
3 = IDENTIFIER
5 = OCTAL
7 = INTEGER
8 = IDENTIFIER
9 = BINARY
10 = HEXADECIMAL
columns
[a-z] = [A] B [C-F] [G-W] X [Y-Z]
[a-f] = [A] B [C-F]
0
$
_
[1]
[2-7]
[8-9]
[A]
B
[C-F]
[G-W]
X
[Y-Z]
states
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 16
Lexer – Step by Step
0 $ _ [1] [2-7] [8-9] A B [C-F] [G-W] X [Y-Z] ... Delimiter, operator,
whitespace, quotation
mark
S0! S1$ S3$ S3$ S2$ S2$ S2$ S3$ S3$ S3$ S3$ S3$ S3$ SE! Stop!
S1! S5$ SE! SE! S5$ S5$ SE! SE! S4$ SE! SE! S6$ SE! SE! Stop!
S2! S7$ SE! SE! S7$ S7$ S7$ SE! SE! SE! SE! SE! SE! SE! Stop!
S3! S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ SE! Stop!
S4! S9$ SE! SE! S9$ SE! SE! SE! SE! SE! SE! SE! SE! SE! Stop!
S5! S5$ SE! SE! S5$ S5$ SE! SE! SE! SE! SE! SE! SE! SE! Stop!
S6! S10$ SE! SE! S10$ S10$ S10$ S10$ S10$ S10$ SE! SE! SE! SE! Stop!
S7! S7$ SE! SE! S7$ S7$ S7$ SE! SE! SE! SE! SE! SE! SE! Stop!
S8! S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ SE! Stop!
S9! S9$ SE! SE! S9$ SE! SE! SE! SE! SE! SE! SE! SE! SE! Stop!
S10! S10$ SE! SE! S10$ S10$ S10$ S10$ S10$ S10$ SE! SE! SE! SE! Stop!
SE! SE! SE! SE! SE! SE! SE! SE! SE! SE! SE! SE! SE! SE! Stop!
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 17
Homework
Review Recursion
Solve the Problem Set #1 in preparation for your exam
CSE340 - Principles of Programming Languages
Javier Gonzalez-Sanchez
javiergs@asu.edu
Summer 2015
Disclaimer. These slides can only be used as study material for the class CSE340 at ASU. They cannot be distributed or used for another purpose.

Weitere ähnliche Inhalte

Andere mochten auch

Andere mochten auch (20)

Heirloom Travel: Wine Country - Wineries
Heirloom Travel: Wine Country - WineriesHeirloom Travel: Wine Country - Wineries
Heirloom Travel: Wine Country - Wineries
 
Week7
Week7Week7
Week7
 
Eprotect
EprotectEprotect
Eprotect
 
Monaco 020909
Monaco 020909Monaco 020909
Monaco 020909
 
CQRS introduction
CQRS introductionCQRS introduction
CQRS introduction
 
201506 CSE340 Lecture 13
201506 CSE340 Lecture 13201506 CSE340 Lecture 13
201506 CSE340 Lecture 13
 
201506 CSE340 Lecture 14
201506 CSE340 Lecture 14201506 CSE340 Lecture 14
201506 CSE340 Lecture 14
 
RCMSL Phenomenal July 16, 2009
RCMSL Phenomenal July 16, 2009RCMSL Phenomenal July 16, 2009
RCMSL Phenomenal July 16, 2009
 
200801 Generating OpenMP and Pthreads code
200801 Generating OpenMP and Pthreads code200801 Generating OpenMP and Pthreads code
200801 Generating OpenMP and Pthreads code
 
201505 CSE340 Lecture 03
201505 CSE340 Lecture 03201505 CSE340 Lecture 03
201505 CSE340 Lecture 03
 
RCMSL Phenomenal July 9, 2009
RCMSL Phenomenal July 9, 2009RCMSL Phenomenal July 9, 2009
RCMSL Phenomenal July 9, 2009
 
Mobile Social Media, Sept. 2010, Do You Want To Be Visible?, Marketing Club K...
Mobile Social Media, Sept. 2010, Do You Want To Be Visible?, Marketing Club K...Mobile Social Media, Sept. 2010, Do You Want To Be Visible?, Marketing Club K...
Mobile Social Media, Sept. 2010, Do You Want To Be Visible?, Marketing Club K...
 
RCMSL Phenomenal Sep 24, 2009
RCMSL Phenomenal Sep 24, 2009RCMSL Phenomenal Sep 24, 2009
RCMSL Phenomenal Sep 24, 2009
 
201101 affective learning
201101 affective learning201101 affective learning
201101 affective learning
 
Medi Contention
Medi ContentionMedi Contention
Medi Contention
 
RCMSL Phenomenal Aug 13 And 20, 2009
RCMSL Phenomenal Aug 13 And 20, 2009RCMSL Phenomenal Aug 13 And 20, 2009
RCMSL Phenomenal Aug 13 And 20, 2009
 
簡介創用CC授權
簡介創用CC授權簡介創用CC授權
簡介創用CC授權
 
201003 Alice (part 1/15)
201003 Alice (part 1/15)201003 Alice (part 1/15)
201003 Alice (part 1/15)
 
Week9
Week9Week9
Week9
 
201006 its tutorial
201006 its tutorial201006 its tutorial
201006 its tutorial
 

Mehr von Javier Gonzalez-Sanchez (20)

201804 SER332 Lecture 01
201804 SER332 Lecture 01201804 SER332 Lecture 01
201804 SER332 Lecture 01
 
201801 SER332 Lecture 03
201801 SER332 Lecture 03201801 SER332 Lecture 03
201801 SER332 Lecture 03
 
201801 SER332 Lecture 04
201801 SER332 Lecture 04201801 SER332 Lecture 04
201801 SER332 Lecture 04
 
201801 SER332 Lecture 02
201801 SER332 Lecture 02201801 SER332 Lecture 02
201801 SER332 Lecture 02
 
201801 CSE240 Lecture 26
201801 CSE240 Lecture 26201801 CSE240 Lecture 26
201801 CSE240 Lecture 26
 
201801 CSE240 Lecture 25
201801 CSE240 Lecture 25201801 CSE240 Lecture 25
201801 CSE240 Lecture 25
 
201801 CSE240 Lecture 24
201801 CSE240 Lecture 24201801 CSE240 Lecture 24
201801 CSE240 Lecture 24
 
201801 CSE240 Lecture 23
201801 CSE240 Lecture 23201801 CSE240 Lecture 23
201801 CSE240 Lecture 23
 
201801 CSE240 Lecture 22
201801 CSE240 Lecture 22201801 CSE240 Lecture 22
201801 CSE240 Lecture 22
 
201801 CSE240 Lecture 21
201801 CSE240 Lecture 21201801 CSE240 Lecture 21
201801 CSE240 Lecture 21
 
201801 CSE240 Lecture 20
201801 CSE240 Lecture 20201801 CSE240 Lecture 20
201801 CSE240 Lecture 20
 
201801 CSE240 Lecture 19
201801 CSE240 Lecture 19201801 CSE240 Lecture 19
201801 CSE240 Lecture 19
 
201801 CSE240 Lecture 18
201801 CSE240 Lecture 18201801 CSE240 Lecture 18
201801 CSE240 Lecture 18
 
201801 CSE240 Lecture 17
201801 CSE240 Lecture 17201801 CSE240 Lecture 17
201801 CSE240 Lecture 17
 
201801 CSE240 Lecture 16
201801 CSE240 Lecture 16201801 CSE240 Lecture 16
201801 CSE240 Lecture 16
 
201801 CSE240 Lecture 15
201801 CSE240 Lecture 15201801 CSE240 Lecture 15
201801 CSE240 Lecture 15
 
201801 CSE240 Lecture 14
201801 CSE240 Lecture 14201801 CSE240 Lecture 14
201801 CSE240 Lecture 14
 
201801 CSE240 Lecture 13
201801 CSE240 Lecture 13201801 CSE240 Lecture 13
201801 CSE240 Lecture 13
 
201801 CSE240 Lecture 12
201801 CSE240 Lecture 12201801 CSE240 Lecture 12
201801 CSE240 Lecture 12
 
201801 CSE240 Lecture 11
201801 CSE240 Lecture 11201801 CSE240 Lecture 11
201801 CSE240 Lecture 11
 

Kürzlich hochgeladen

%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...masabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...Nitya salvi
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 

Kürzlich hochgeladen (20)

%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

201505 CSE340 Lecture 06

  • 1. CSE340 - Principles of Programming Languages Lecture 06: Closing with Lexical Analysis Javier Gonzalez-Sanchez javiergs@asu.edu BYENG M1-38 Office Hours: By appointment
  • 2. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 4 Programming Assignment #1 ? 70% ? 100%
  • 3. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 5 Programming Assignment #1 ? 100%
  • 4. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 6 Programming Assignment #1 ? 70%
  • 5. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 7 Programming Assignment #1 !  Firstname_Lastname_P1.zip !  Compile and Run !  Recognize BINARY !  Recognize DELIMITER and OPERATOR approx. 20% !  Recognize INTEGER !  Recognize OCTAL !  Recognize HEXADECIMAL !  Recognize IDENTIFIER approx. 40% !  Recognize STRING !  Recognize CHAR !  Recognize KEYWORD !  Recognize FLOAT approx. 40%
  • 6. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 8 Review | Lexical Analysis Are the following STRINGS correct or not? Why? !  000000005 !  000000009 !  000000009.1 !  000000005 !  000000005.1 !  0x0000002 !  0123456789
  • 7. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 9 Review | Lexical Analysis Are the following STRINGS correct or not? Why? !  1.2e---3++ !  $50 !  float ________________ = 5; !  double x = 000000.1; !  '''a' !  '''b' !  ''b'
  • 8. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 10 Review | Lexical Analysis Are the following STRINGS correct or not? Why? !  " a" !  "Hello""world" !  abc"Hello" !  ''’ !  'x’ !  ’a' !  ’w’ !  ""
  • 9. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 11 State Transition Table for our Lexer (step by step)
  • 10. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 12 BINARY INTEGER OCTAL HEXADECIMAL IDENTIFIER
  • 11. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 13 Lexer – Step by Step
  • 12. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 14 Lexer – Step by Step
  • 13. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 15 Lexer – Step by Step 1 = INTEGER 2 = INTEGER 3 = IDENTIFIER 5 = OCTAL 7 = INTEGER 8 = IDENTIFIER 9 = BINARY 10 = HEXADECIMAL columns [a-z] = [A] B [C-F] [G-W] X [Y-Z] [a-f] = [A] B [C-F] 0 $ _ [1] [2-7] [8-9] [A] B [C-F] [G-W] X [Y-Z] states
  • 14. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 16 Lexer – Step by Step 0 $ _ [1] [2-7] [8-9] A B [C-F] [G-W] X [Y-Z] ... Delimiter, operator, whitespace, quotation mark S0! S1$ S3$ S3$ S2$ S2$ S2$ S3$ S3$ S3$ S3$ S3$ S3$ SE! Stop! S1! S5$ SE! SE! S5$ S5$ SE! SE! S4$ SE! SE! S6$ SE! SE! Stop! S2! S7$ SE! SE! S7$ S7$ S7$ SE! SE! SE! SE! SE! SE! SE! Stop! S3! S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ SE! Stop! S4! S9$ SE! SE! S9$ SE! SE! SE! SE! SE! SE! SE! SE! SE! Stop! S5! S5$ SE! SE! S5$ S5$ SE! SE! SE! SE! SE! SE! SE! SE! Stop! S6! S10$ SE! SE! S10$ S10$ S10$ S10$ S10$ S10$ SE! SE! SE! SE! Stop! S7! S7$ SE! SE! S7$ S7$ S7$ SE! SE! SE! SE! SE! SE! SE! Stop! S8! S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ S8$ SE! Stop! S9! S9$ SE! SE! S9$ SE! SE! SE! SE! SE! SE! SE! SE! SE! Stop! S10! S10$ SE! SE! S10$ S10$ S10$ S10$ S10$ S10$ SE! SE! SE! SE! Stop! SE! SE! SE! SE! SE! SE! SE! SE! SE! SE! SE! SE! SE! SE! Stop!
  • 15. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 17 Homework Review Recursion Solve the Problem Set #1 in preparation for your exam
  • 16. CSE340 - Principles of Programming Languages Javier Gonzalez-Sanchez javiergs@asu.edu Summer 2015 Disclaimer. These slides can only be used as study material for the class CSE340 at ASU. They cannot be distributed or used for another purpose.