SlideShare a Scribd company logo
CSE340 - Principles of
Programming Languages
Lecture 02:
Introduction
Javier Gonzalez-Sanchez
javiergs@asu.edu
BYENG M1-38
Office Hours: By appointment
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 2
Keywords
Level
Paradigm
Language
Analysis
Lexical
Input:
Symbols
Output:
Words
Syntax
Input:
Words
Output:
Sentences
Semantic
Input:
Sentences
Translate or
Execute
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 3
Analysis
int x = 5;
float y = "hello;
String @z = "9.5";
int x = cse340;
if ( x > 14) while (5 == 5) if (int a) a = 1;
x = x; for ( ; ; );
y = 13.45.0;
int me = 99999000001111222000000111111222223443483045830948;
while { x != 9} ();
int {x} = 10;
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 4
High-Level Languages
X,E,G,O,O
#e1,I,I,0,7
@
OPR 19, AX
STO x, AX
LIT 5, AX
OPR 21, AX
LOD #e1,AX
CAL 1, AX
OPR 0, AX
5
Virtual Machine
(interpreter)
// sorce code
int x;
int foo () {
read (x);
print (5);
}
main () {
foo ();
}
Lexer
Parser
Semantic Analyzer
Code Generation
01001010101000010
01010100101010010
10100100000011011
11010010110101111
00010010101010010
10101001010101011
Assembler
compilation execution
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 5
Keywords
Lexical
Alphabet Symbol
String Word
Token
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 6
Lexical Analysis
int x = 5;
float y = "hello;
String @z = "9.5";
int x = cse340;
if ( x > 14) while (5 == 5) if (int a) a = 1;
x = x; for ( ; ; );
y = 13.45.0;
int me = 99999000001111222000000111111222223443483045830948;
while { x != 9} ();
int {x} = 10;
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 7
Lexical Analysis | Steps
a)  Read a text FILE line by line
b)  For each LINE:
•  Read character by character.
•  Create sets of consecutive characters (STRING). Try to
group the bigger amount of characters as possible.
•  Start a new set each time that you need. Take care of:
Whitespace, Delimiter, Operator, End of Line and others
special characters.
c) For each STRING: verify if it is a valid WORD.
d) Create a VECTOR and store the STRINGs and WORDs.
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 8
Lexical Analysis
int x = 5; float y = "hello;
String@z="9.5”;intx=cse340;if(x>
14) while
(5 == 5) if (int a) a = 1; x = x;
for ( ; ; );y = 13.45.0;int me
=99999000001111222000000111111222
223443483045830948;while { x !=
9} ();int {x} = 10;
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 9
Lexical Analysis
int x = 5; float y = "hello;
String@z="9.5”;intx=cse340;if(x>
14) while
(5 == 5) if (int a) a = 1; x = x;
for ( ; ; );y = 13.45.0;int me
=99999000001111222000000111111222
223443483045830948;while { x !=
9} ();int {x} = 10;
”hello "world" bye"
# of STRINGS
9
12
3
18
12
2
6
12
3
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 10
Keywords
Lexical
Alphabet Symbol
String Word
Token Rules
Regular
Expression
Deterministic
Finite
Automata
Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 11
Homework
Review the following topics:
Regular Expressions (Text Book: Chapter 6)
and Deterministic Finite Automata
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.
Ad

More Related Content

What's hot (20)

Tcs nqt 2019 p 1
Tcs nqt 2019 p 1Tcs nqt 2019 p 1
Tcs nqt 2019 p 1
Phaneendra Bolla
 
Tcs nqt 2019 p 2
Tcs nqt 2019 p 2Tcs nqt 2019 p 2
Tcs nqt 2019 p 2
Phaneendra Bolla
 
Pa1 loops
Pa1 loopsPa1 loops
Pa1 loops
aiclub_slides
 
Unsupervised program synthesis
Unsupervised program synthesisUnsupervised program synthesis
Unsupervised program synthesis
Amrith Krishna
 
C programming Lab 1
C programming Lab 1C programming Lab 1
C programming Lab 1
Zaibi Gondal
 
Lab 1
Lab 1Lab 1
Lab 1
emailharmeet
 
[Question Paper] Introduction To C++ Programming (Revised Course) [January / ...
[Question Paper] Introduction To C++ Programming (Revised Course) [January / ...[Question Paper] Introduction To C++ Programming (Revised Course) [January / ...
[Question Paper] Introduction To C++ Programming (Revised Course) [January / ...
Mumbai B.Sc.IT Study
 
More on Data Types (Exponential and Scientific Notations)
More on Data Types (Exponential and Scientific Notations)More on Data Types (Exponential and Scientific Notations)
More on Data Types (Exponential and Scientific Notations)
Nicole Ynne Estabillo
 
test(3)arithmetic in c
test(3)arithmetic in ctest(3)arithmetic in c
test(3)arithmetic in c
Jaya Malathy
 
parallelizing Trapezoidal rule
parallelizing Trapezoidal rule parallelizing Trapezoidal rule
parallelizing Trapezoidal rule
zainab mohammed
 
C programming session 03
C programming session 03C programming session 03
C programming session 03
Dushmanta Nath
 
Arithmetic and Logic instructions in Embedded C
Arithmetic and Logic instructions in Embedded CArithmetic and Logic instructions in Embedded C
Arithmetic and Logic instructions in Embedded C
Vikas Dongre
 
Programming fundamentals
Programming fundamentalsProgramming fundamentals
Programming fundamentals
Zaibi Gondal
 
Code quailty metrics demystified
Code quailty metrics demystifiedCode quailty metrics demystified
Code quailty metrics demystified
Jeroen Resoort
 
LLVM Overview
LLVM OverviewLLVM Overview
LLVM Overview
Constantin Lungu
 
Data structures Lecture no. 4
Data structures Lecture no. 4Data structures Lecture no. 4
Data structures Lecture no. 4
AzharIqbal710687
 
Quantifying Information Leaks via Model Counting Modulo Theories
Quantifying Information Leaks via Model Counting Modulo TheoriesQuantifying Information Leaks via Model Counting Modulo Theories
Quantifying Information Leaks via Model Counting Modulo Theories
Quoc-Sang Phan
 
A* algorithm
A* algorithmA* algorithm
A* algorithm
Komal Samdariya
 
Space complexity
Space complexitySpace complexity
Space complexity
Bhanusree Koduru
 
[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...
[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...
[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...
Mumbai B.Sc.IT Study
 
Unsupervised program synthesis
Unsupervised program synthesisUnsupervised program synthesis
Unsupervised program synthesis
Amrith Krishna
 
C programming Lab 1
C programming Lab 1C programming Lab 1
C programming Lab 1
Zaibi Gondal
 
[Question Paper] Introduction To C++ Programming (Revised Course) [January / ...
[Question Paper] Introduction To C++ Programming (Revised Course) [January / ...[Question Paper] Introduction To C++ Programming (Revised Course) [January / ...
[Question Paper] Introduction To C++ Programming (Revised Course) [January / ...
Mumbai B.Sc.IT Study
 
More on Data Types (Exponential and Scientific Notations)
More on Data Types (Exponential and Scientific Notations)More on Data Types (Exponential and Scientific Notations)
More on Data Types (Exponential and Scientific Notations)
Nicole Ynne Estabillo
 
test(3)arithmetic in c
test(3)arithmetic in ctest(3)arithmetic in c
test(3)arithmetic in c
Jaya Malathy
 
parallelizing Trapezoidal rule
parallelizing Trapezoidal rule parallelizing Trapezoidal rule
parallelizing Trapezoidal rule
zainab mohammed
 
C programming session 03
C programming session 03C programming session 03
C programming session 03
Dushmanta Nath
 
Arithmetic and Logic instructions in Embedded C
Arithmetic and Logic instructions in Embedded CArithmetic and Logic instructions in Embedded C
Arithmetic and Logic instructions in Embedded C
Vikas Dongre
 
Programming fundamentals
Programming fundamentalsProgramming fundamentals
Programming fundamentals
Zaibi Gondal
 
Code quailty metrics demystified
Code quailty metrics demystifiedCode quailty metrics demystified
Code quailty metrics demystified
Jeroen Resoort
 
Data structures Lecture no. 4
Data structures Lecture no. 4Data structures Lecture no. 4
Data structures Lecture no. 4
AzharIqbal710687
 
Quantifying Information Leaks via Model Counting Modulo Theories
Quantifying Information Leaks via Model Counting Modulo TheoriesQuantifying Information Leaks via Model Counting Modulo Theories
Quantifying Information Leaks via Model Counting Modulo Theories
Quoc-Sang Phan
 
[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...
[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...
[Question Paper] Fundamentals of Digital Computing (Revised Course) [January ...
Mumbai B.Sc.IT Study
 

Viewers also liked (20)

Thehub euromed
Thehub   euromedThehub   euromed
Thehub euromed
The Hub Milan
 
201106 WICSA
201106 WICSA201106 WICSA
201106 WICSA
Javier Gonzalez-Sanchez
 
Developing distributed analysis pipelines with shared community resources usi...
Developing distributed analysis pipelines with shared community resources usi...Developing distributed analysis pipelines with shared community resources usi...
Developing distributed analysis pipelines with shared community resources usi...
Brad Chapman
 
RCMSL Phenomenal July 16, 2009
RCMSL Phenomenal July 16, 2009RCMSL Phenomenal July 16, 2009
RCMSL Phenomenal July 16, 2009
etalcomendras
 
KANSAS CITY INVESTMENT PROPERTIES
KANSAS CITY INVESTMENT PROPERTIESKANSAS CITY INVESTMENT PROPERTIES
KANSAS CITY INVESTMENT PROPERTIES
MISSOURI REAL ESTATE EXCHANGE
 
Login Seminars Blackboard Directions 2009
Login Seminars Blackboard Directions 2009Login Seminars Blackboard Directions 2009
Login Seminars Blackboard Directions 2009
Ohio LETC
 
Tax planning introduction fall 2012
Tax planning introduction fall 2012Tax planning introduction fall 2012
Tax planning introduction fall 2012
dphil002
 
Paul Pangaro
Paul PangaroPaul Pangaro
Paul Pangaro
Luis Fernando Guggenberger
 
Syndrome metabolique et maladies vasculaires s novo
Syndrome metabolique et maladies vasculaires s novoSyndrome metabolique et maladies vasculaires s novo
Syndrome metabolique et maladies vasculaires s novo
sfa_angeiologie
 
201506 CSE340 Lecture 09
201506 CSE340 Lecture 09201506 CSE340 Lecture 09
201506 CSE340 Lecture 09
Javier Gonzalez-Sanchez
 
Practical Object-Oriented Back-in-Time Debugging
Practical Object-Oriented Back-in-Time DebuggingPractical Object-Oriented Back-in-Time Debugging
Practical Object-Oriented Back-in-Time Debugging
lienhard
 
Laserendoveineux b anastasie 1 er partie
Laserendoveineux  b anastasie   1 er partieLaserendoveineux  b anastasie   1 er partie
Laserendoveineux b anastasie 1 er partie
sfa_angeiologie
 
201101 mLearning
201101 mLearning201101 mLearning
201101 mLearning
Javier Gonzalez-Sanchez
 
Angeiologie 4 2013 - 1-2014 livre des resumes
Angeiologie 4 2013 - 1-2014 livre des resumesAngeiologie 4 2013 - 1-2014 livre des resumes
Angeiologie 4 2013 - 1-2014 livre des resumes
sfa_angeiologie
 
Thehub bocconi law
Thehub   bocconi lawThehub   bocconi law
Thehub bocconi law
The Hub Milan
 
Diapositivas
DiapositivasDiapositivas
Diapositivas
Isabelica13
 
Itf ipp ch10_2012_final
Itf ipp ch10_2012_finalItf ipp ch10_2012_final
Itf ipp ch10_2012_final
dphil002
 
Cluster 15
Cluster 15Cluster 15
Cluster 15
etalcomendras
 
Developing distributed analysis pipelines with shared community resources usi...
Developing distributed analysis pipelines with shared community resources usi...Developing distributed analysis pipelines with shared community resources usi...
Developing distributed analysis pipelines with shared community resources usi...
Brad Chapman
 
RCMSL Phenomenal July 16, 2009
RCMSL Phenomenal July 16, 2009RCMSL Phenomenal July 16, 2009
RCMSL Phenomenal July 16, 2009
etalcomendras
 
Login Seminars Blackboard Directions 2009
Login Seminars Blackboard Directions 2009Login Seminars Blackboard Directions 2009
Login Seminars Blackboard Directions 2009
Ohio LETC
 
Tax planning introduction fall 2012
Tax planning introduction fall 2012Tax planning introduction fall 2012
Tax planning introduction fall 2012
dphil002
 
Syndrome metabolique et maladies vasculaires s novo
Syndrome metabolique et maladies vasculaires s novoSyndrome metabolique et maladies vasculaires s novo
Syndrome metabolique et maladies vasculaires s novo
sfa_angeiologie
 
Practical Object-Oriented Back-in-Time Debugging
Practical Object-Oriented Back-in-Time DebuggingPractical Object-Oriented Back-in-Time Debugging
Practical Object-Oriented Back-in-Time Debugging
lienhard
 
Laserendoveineux b anastasie 1 er partie
Laserendoveineux  b anastasie   1 er partieLaserendoveineux  b anastasie   1 er partie
Laserendoveineux b anastasie 1 er partie
sfa_angeiologie
 
Angeiologie 4 2013 - 1-2014 livre des resumes
Angeiologie 4 2013 - 1-2014 livre des resumesAngeiologie 4 2013 - 1-2014 livre des resumes
Angeiologie 4 2013 - 1-2014 livre des resumes
sfa_angeiologie
 
Itf ipp ch10_2012_final
Itf ipp ch10_2012_finalItf ipp ch10_2012_final
Itf ipp ch10_2012_final
dphil002
 
Ad

Similar to 201505 CSE340 Lecture 02 (20)

201506 CSE340 Lecture 20
201506 CSE340 Lecture 20 201506 CSE340 Lecture 20
201506 CSE340 Lecture 20
Javier Gonzalez-Sanchez
 
201801 CSE240 Lecture 03
201801 CSE240 Lecture 03201801 CSE240 Lecture 03
201801 CSE240 Lecture 03
Javier Gonzalez-Sanchez
 
201801 CSE240 Lecture 01
201801 CSE240 Lecture 01201801 CSE240 Lecture 01
201801 CSE240 Lecture 01
Javier Gonzalez-Sanchez
 
201505 CSE340 Lecture 06
201505 CSE340 Lecture 06201505 CSE340 Lecture 06
201505 CSE340 Lecture 06
Javier Gonzalez-Sanchez
 
Лексический анализ расмореные 3 различных способа
Лексический анализ расмореные 3 различных способаЛексический анализ расмореные 3 различных способа
Лексический анализ расмореные 3 различных способа
lajoh66475
 
Compiler Design in Engineering for Designing
Compiler Design in Engineering for DesigningCompiler Design in Engineering for Designing
Compiler Design in Engineering for Designing
Adityaverma750841
 
201801 CSE240 Lecture 26
201801 CSE240 Lecture 26201801 CSE240 Lecture 26
201801 CSE240 Lecture 26
Javier Gonzalez-Sanchez
 
Compiler worksheet
Compiler worksheetCompiler worksheet
Compiler worksheet
ArthyR3
 
C compiler(final)
C compiler(final)C compiler(final)
C compiler(final)
Farzan Dehbashi
 
Lesson 01.ppt theory of automata including basics of it
Lesson 01.ppt theory  of automata including basics of itLesson 01.ppt theory  of automata including basics of it
Lesson 01.ppt theory of automata including basics of it
zainalvi552
 
Theory of Automata - Power Point Slides Lecture 01).ppt
Theory of Automata - Power Point Slides Lecture 01).pptTheory of Automata - Power Point Slides Lecture 01).ppt
Theory of Automata - Power Point Slides Lecture 01).ppt
saimakhosa3
 
Compiler design.ppt
Compiler design.pptCompiler design.ppt
Compiler design.ppt
AnkushPal34
 
Compilers Design
Compilers DesignCompilers Design
Compilers Design
Akshaya Arunan
 
201506 CSE340 Lecture 17
201506 CSE340 Lecture 17201506 CSE340 Lecture 17
201506 CSE340 Lecture 17
Javier Gonzalez-Sanchez
 
Theory of Automata Lesson 01
 Theory of Automata Lesson 01  Theory of Automata Lesson 01
Theory of Automata Lesson 01
hamzamughal39
 
Lexical analysis, syntax analysis, semantic analysis. Ppt
Lexical analysis, syntax analysis, semantic analysis. PptLexical analysis, syntax analysis, semantic analysis. Ppt
Lexical analysis, syntax analysis, semantic analysis. Ppt
ovidlivi91
 
201506 CSE340 Lecture 12
201506 CSE340 Lecture 12201506 CSE340 Lecture 12
201506 CSE340 Lecture 12
Javier Gonzalez-Sanchez
 
Lesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.pptLesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.ppt
ashja1
 
Ch 2.pptx
Ch 2.pptxCh 2.pptx
Ch 2.pptx
woldu2
 
Example PseudocodeProblem Given a sorted array a with n elements .docx
Example PseudocodeProblem Given a sorted array a with n elements .docxExample PseudocodeProblem Given a sorted array a with n elements .docx
Example PseudocodeProblem Given a sorted array a with n elements .docx
cravennichole326
 
Лексический анализ расмореные 3 различных способа
Лексический анализ расмореные 3 различных способаЛексический анализ расмореные 3 различных способа
Лексический анализ расмореные 3 различных способа
lajoh66475
 
Compiler Design in Engineering for Designing
Compiler Design in Engineering for DesigningCompiler Design in Engineering for Designing
Compiler Design in Engineering for Designing
Adityaverma750841
 
Compiler worksheet
Compiler worksheetCompiler worksheet
Compiler worksheet
ArthyR3
 
Lesson 01.ppt theory of automata including basics of it
Lesson 01.ppt theory  of automata including basics of itLesson 01.ppt theory  of automata including basics of it
Lesson 01.ppt theory of automata including basics of it
zainalvi552
 
Theory of Automata - Power Point Slides Lecture 01).ppt
Theory of Automata - Power Point Slides Lecture 01).pptTheory of Automata - Power Point Slides Lecture 01).ppt
Theory of Automata - Power Point Slides Lecture 01).ppt
saimakhosa3
 
Compiler design.ppt
Compiler design.pptCompiler design.ppt
Compiler design.ppt
AnkushPal34
 
Theory of Automata Lesson 01
 Theory of Automata Lesson 01  Theory of Automata Lesson 01
Theory of Automata Lesson 01
hamzamughal39
 
Lexical analysis, syntax analysis, semantic analysis. Ppt
Lexical analysis, syntax analysis, semantic analysis. PptLexical analysis, syntax analysis, semantic analysis. Ppt
Lexical analysis, syntax analysis, semantic analysis. Ppt
ovidlivi91
 
Lesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.pptLesson-01-29092022-081117pm.ppt
Lesson-01-29092022-081117pm.ppt
ashja1
 
Ch 2.pptx
Ch 2.pptxCh 2.pptx
Ch 2.pptx
woldu2
 
Example PseudocodeProblem Given a sorted array a with n elements .docx
Example PseudocodeProblem Given a sorted array a with n elements .docxExample PseudocodeProblem Given a sorted array a with n elements .docx
Example PseudocodeProblem Given a sorted array a with n elements .docx
cravennichole326
 
Ad

More from Javier Gonzalez-Sanchez (20)

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

Recently uploaded (20)

A Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business StageA Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
SynapseIndia
 
Logs, Metrics, traces and Mayhem - An Interactive Observability Adventure Wor...
Logs, Metrics, traces and Mayhem - An Interactive Observability Adventure Wor...Logs, Metrics, traces and Mayhem - An Interactive Observability Adventure Wor...
Logs, Metrics, traces and Mayhem - An Interactive Observability Adventure Wor...
Imma Valls Bernaus
 
AI Agents with Gemini 2.0 - Beyond the Chatbot
AI Agents with Gemini 2.0 - Beyond the ChatbotAI Agents with Gemini 2.0 - Beyond the Chatbot
AI Agents with Gemini 2.0 - Beyond the Chatbot
Márton Kodok
 
IObit Uninstaller Pro Crack {2025} Download Free
IObit Uninstaller Pro Crack {2025} Download FreeIObit Uninstaller Pro Crack {2025} Download Free
IObit Uninstaller Pro Crack {2025} Download Free
Iobit Uninstaller Pro Crack
 
Shift Right Security for EKS Webinar Slides
Shift Right Security for EKS Webinar SlidesShift Right Security for EKS Webinar Slides
Shift Right Security for EKS Webinar Slides
Anchore
 
File Viewer Plus 7.5.5.49 Crack Full Version
File Viewer Plus 7.5.5.49 Crack Full VersionFile Viewer Plus 7.5.5.49 Crack Full Version
File Viewer Plus 7.5.5.49 Crack Full Version
raheemk1122g
 
Hyper Casual Game Developers Company
Hyper  Casual  Game  Developers  CompanyHyper  Casual  Game  Developers  Company
Hyper Casual Game Developers Company
Nova Carter
 
Unit Two - Java Architecture and OOPS
Unit Two  -   Java Architecture and OOPSUnit Two  -   Java Architecture and OOPS
Unit Two - Java Architecture and OOPS
Nabin Dhakal
 
Drawing Heighway’s Dragon - Part 4 - Interactive and Animated Dragon Creation
Drawing Heighway’s Dragon - Part 4 - Interactive and Animated Dragon CreationDrawing Heighway’s Dragon - Part 4 - Interactive and Animated Dragon Creation
Drawing Heighway’s Dragon - Part 4 - Interactive and Animated Dragon Creation
Philip Schwarz
 
How to Create a Crypto Wallet Like Trust.pptx
How to Create a Crypto Wallet Like Trust.pptxHow to Create a Crypto Wallet Like Trust.pptx
How to Create a Crypto Wallet Like Trust.pptx
riyageorge2024
 
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studiesTroubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Tier1 app
 
Buy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training techBuy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training tech
Rustici Software
 
Welcome to QA Summit 2025.
Welcome to QA Summit 2025.Welcome to QA Summit 2025.
Welcome to QA Summit 2025.
QA Summit
 
How to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryErrorHow to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
 
Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025
Web Designer
 
Serato DJ Pro Crack Latest Version 2025??
Serato DJ Pro Crack Latest Version 2025??Serato DJ Pro Crack Latest Version 2025??
Serato DJ Pro Crack Latest Version 2025??
Web Designer
 
Lumion Pro Crack + 2025 Activation Key Free Code
Lumion Pro Crack + 2025 Activation Key Free CodeLumion Pro Crack + 2025 Activation Key Free Code
Lumion Pro Crack + 2025 Activation Key Free Code
raheemk1122g
 
NYC ACE 08-May-2025-Combined Presentation.pdf
NYC ACE 08-May-2025-Combined Presentation.pdfNYC ACE 08-May-2025-Combined Presentation.pdf
NYC ACE 08-May-2025-Combined Presentation.pdf
AUGNYC
 
wAIred_LearnWithOutAI_JCON_14052025.pptx
wAIred_LearnWithOutAI_JCON_14052025.pptxwAIred_LearnWithOutAI_JCON_14052025.pptx
wAIred_LearnWithOutAI_JCON_14052025.pptx
SimonedeGijt
 
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptxThe-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
james brownuae
 
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business StageA Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
SynapseIndia
 
Logs, Metrics, traces and Mayhem - An Interactive Observability Adventure Wor...
Logs, Metrics, traces and Mayhem - An Interactive Observability Adventure Wor...Logs, Metrics, traces and Mayhem - An Interactive Observability Adventure Wor...
Logs, Metrics, traces and Mayhem - An Interactive Observability Adventure Wor...
Imma Valls Bernaus
 
AI Agents with Gemini 2.0 - Beyond the Chatbot
AI Agents with Gemini 2.0 - Beyond the ChatbotAI Agents with Gemini 2.0 - Beyond the Chatbot
AI Agents with Gemini 2.0 - Beyond the Chatbot
Márton Kodok
 
IObit Uninstaller Pro Crack {2025} Download Free
IObit Uninstaller Pro Crack {2025} Download FreeIObit Uninstaller Pro Crack {2025} Download Free
IObit Uninstaller Pro Crack {2025} Download Free
Iobit Uninstaller Pro Crack
 
Shift Right Security for EKS Webinar Slides
Shift Right Security for EKS Webinar SlidesShift Right Security for EKS Webinar Slides
Shift Right Security for EKS Webinar Slides
Anchore
 
File Viewer Plus 7.5.5.49 Crack Full Version
File Viewer Plus 7.5.5.49 Crack Full VersionFile Viewer Plus 7.5.5.49 Crack Full Version
File Viewer Plus 7.5.5.49 Crack Full Version
raheemk1122g
 
Hyper Casual Game Developers Company
Hyper  Casual  Game  Developers  CompanyHyper  Casual  Game  Developers  Company
Hyper Casual Game Developers Company
Nova Carter
 
Unit Two - Java Architecture and OOPS
Unit Two  -   Java Architecture and OOPSUnit Two  -   Java Architecture and OOPS
Unit Two - Java Architecture and OOPS
Nabin Dhakal
 
Drawing Heighway’s Dragon - Part 4 - Interactive and Animated Dragon Creation
Drawing Heighway’s Dragon - Part 4 - Interactive and Animated Dragon CreationDrawing Heighway’s Dragon - Part 4 - Interactive and Animated Dragon Creation
Drawing Heighway’s Dragon - Part 4 - Interactive and Animated Dragon Creation
Philip Schwarz
 
How to Create a Crypto Wallet Like Trust.pptx
How to Create a Crypto Wallet Like Trust.pptxHow to Create a Crypto Wallet Like Trust.pptx
How to Create a Crypto Wallet Like Trust.pptx
riyageorge2024
 
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studiesTroubleshooting JVM Outages – 3 Fortune 500 case studies
Troubleshooting JVM Outages – 3 Fortune 500 case studies
Tier1 app
 
Buy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training techBuy vs. Build: Unlocking the right path for your training tech
Buy vs. Build: Unlocking the right path for your training tech
Rustici Software
 
Welcome to QA Summit 2025.
Welcome to QA Summit 2025.Welcome to QA Summit 2025.
Welcome to QA Summit 2025.
QA Summit
 
How to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryErrorHow to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
 
Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025
Web Designer
 
Serato DJ Pro Crack Latest Version 2025??
Serato DJ Pro Crack Latest Version 2025??Serato DJ Pro Crack Latest Version 2025??
Serato DJ Pro Crack Latest Version 2025??
Web Designer
 
Lumion Pro Crack + 2025 Activation Key Free Code
Lumion Pro Crack + 2025 Activation Key Free CodeLumion Pro Crack + 2025 Activation Key Free Code
Lumion Pro Crack + 2025 Activation Key Free Code
raheemk1122g
 
NYC ACE 08-May-2025-Combined Presentation.pdf
NYC ACE 08-May-2025-Combined Presentation.pdfNYC ACE 08-May-2025-Combined Presentation.pdf
NYC ACE 08-May-2025-Combined Presentation.pdf
AUGNYC
 
wAIred_LearnWithOutAI_JCON_14052025.pptx
wAIred_LearnWithOutAI_JCON_14052025.pptxwAIred_LearnWithOutAI_JCON_14052025.pptx
wAIred_LearnWithOutAI_JCON_14052025.pptx
SimonedeGijt
 
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptxThe-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
james brownuae
 

201505 CSE340 Lecture 02

  • 1. CSE340 - Principles of Programming Languages Lecture 02: Introduction Javier Gonzalez-Sanchez javiergs@asu.edu BYENG M1-38 Office Hours: By appointment
  • 2. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 2 Keywords Level Paradigm Language Analysis Lexical Input: Symbols Output: Words Syntax Input: Words Output: Sentences Semantic Input: Sentences Translate or Execute
  • 3. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 3 Analysis int x = 5; float y = "hello; String @z = "9.5"; int x = cse340; if ( x > 14) while (5 == 5) if (int a) a = 1; x = x; for ( ; ; ); y = 13.45.0; int me = 99999000001111222000000111111222223443483045830948; while { x != 9} (); int {x} = 10;
  • 4. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 4 High-Level Languages X,E,G,O,O #e1,I,I,0,7 @ OPR 19, AX STO x, AX LIT 5, AX OPR 21, AX LOD #e1,AX CAL 1, AX OPR 0, AX 5 Virtual Machine (interpreter) // sorce code int x; int foo () { read (x); print (5); } main () { foo (); } Lexer Parser Semantic Analyzer Code Generation 01001010101000010 01010100101010010 10100100000011011 11010010110101111 00010010101010010 10101001010101011 Assembler compilation execution
  • 5. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 5 Keywords Lexical Alphabet Symbol String Word Token
  • 6. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 6 Lexical Analysis int x = 5; float y = "hello; String @z = "9.5"; int x = cse340; if ( x > 14) while (5 == 5) if (int a) a = 1; x = x; for ( ; ; ); y = 13.45.0; int me = 99999000001111222000000111111222223443483045830948; while { x != 9} (); int {x} = 10;
  • 7. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 7 Lexical Analysis | Steps a)  Read a text FILE line by line b)  For each LINE: •  Read character by character. •  Create sets of consecutive characters (STRING). Try to group the bigger amount of characters as possible. •  Start a new set each time that you need. Take care of: Whitespace, Delimiter, Operator, End of Line and others special characters. c) For each STRING: verify if it is a valid WORD. d) Create a VECTOR and store the STRINGs and WORDs.
  • 8. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 8 Lexical Analysis int x = 5; float y = "hello; String@z="9.5”;intx=cse340;if(x> 14) while (5 == 5) if (int a) a = 1; x = x; for ( ; ; );y = 13.45.0;int me =99999000001111222000000111111222 223443483045830948;while { x != 9} ();int {x} = 10;
  • 9. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 9 Lexical Analysis int x = 5; float y = "hello; String@z="9.5”;intx=cse340;if(x> 14) while (5 == 5) if (int a) a = 1; x = x; for ( ; ; );y = 13.45.0;int me =99999000001111222000000111111222 223443483045830948;while { x != 9} ();int {x} = 10; ”hello "world" bye" # of STRINGS 9 12 3 18 12 2 6 12 3
  • 10. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 10 Keywords Lexical Alphabet Symbol String Word Token Rules Regular Expression Deterministic Finite Automata
  • 11. Javier Gonzalez-Sanchez | CSE340 | Summer 2015 | 11 Homework Review the following topics: Regular Expressions (Text Book: Chapter 6) and Deterministic Finite Automata
  • 12. 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.
  翻译: