SlideShare a Scribd company logo
1 of 2
Download to read offline
DEC
Lexical Analysis
(Recognizing & Scanning)
WL
MIPS
Context-Free / Syntactic
Analysis
(Parsing)
Context-Sensitive / Semantic
Analysis
Code Generation
- Given a chunk of WL code:
> perform semantic analysis on it
- Discuss how you performed semantic analysis of WL Programs
> build a table:
* verify (1) it is not already in the table (definition)
* verify (2) variables being used are in the table (usage)
- Generate Code:
> Given a WL parse tree/code, generate equivalent MIPS code.
- Strategies:
> how did you implement your chosen strategy?
> provide sketch of algorithm to convert WL to MIPS
- Reading/Understanding MIPS, MERL, Conversion Reference
- Interpreting Bits (work with all interpretations, base conversion)
- Write Assembly Language Programs
> control structures (loops, conditionals), array addressing
> memory-mapped i/o, functions (recursive and non-recursive)
> allocating memory (directives, stack)
- Linking and Loading (MERL, .import, .export)
- Write WL programs to solve given problems.
- Explain what given WL programs do.
- Parse WL programs (would given code compile?)
- DFAs, NFAs, NFAs with Epsilon Transitions
> draw DFAs for accepting a given language (set of strings)
> decide if a given string is accepted by a given *FA
- Regular Expressions
> given a language, provide a regular expression to match it
> given a regular expression, decide if a string is accepted
- Write pseudocode for any algorithms dealing with RLs
> accepting w/ DFAs, NFAs, NFAs w/ epsilons, Maximal-Munch
- CFGs: (understand assignment CFG file format reference)
> given a CFG, give derivations for given strings.
> given a CFG, find an ambiguous derivation.
- Parsing:
> LL(1): given predict table, parse a string.
> LR(1): given shift/reduce rules or LR(1) DFA, parse a string.
- Parse Tree Play:
> understand how to draw a tree for a derivation
- Stored Program Computer (CPU, RAM, Machine-Cycle)
- Abstractions (Machine -> Assembly -> High-Level Language)
- Bit-Interpretations ("Meaning is in the eye of the beholder.")
> bit, nibble (4 bits), byte (8 bits), word (32 bits)
> two's complement, unsigned, instruction interpretations
- Memory Usage @ Run-Time (code+data, stack, addresses)
- Assembler Function and Construction
- Understand How/Why: Traversal of Parse Trees.
- Understand Strategies for Generating Code:
> why do we want a strategy? Ad-Hoc vs. Strategic methods.
> how did the strategies presented in class work?
* (Lhotak/Pretti) vars in C+D section, (Cormack) unique offsets
- Why have prologue/epilogue sections in generated code?
- Briefly, what does it mean to optimize your generated code?
> not how, know that you can streamline the generated code
- Define: Semantic/Context-Sensitive Analysis
- Understand the Semantic Requirements of the WL Language
> variables must be defined only once
> variables must be defined to be used
- Understand that Semantic Analysis verifies a string's 'meaning'.
- Define: Parsing, Context-Free Grammar/Language
- Context-Free Grammars:
> productions, derivations, membership in lang. def. by a CFG
> derivation/parse trees, ambiguity
- Parsing Algorithms
> top-down: LL(k) - first & follow sets, predict table
> bottom-up: LR(k) - shift/reduce rules. LR(1) machines (DFA)
- Left and Right Canonical Derivations
- Define: Scanner, Recognizer, Membership in Language, Tokens
- Regular Languages and Associated Tools (automata, regexp)
> DFAs, NFAs, NFAs w/ epsilon transitions, Regular Expressions
> DFAs with actions, transducers
- Properties of Regular Languages
- Compare and Contrast RLs with Context-Free Languages
- Algorithms Associated with DFAs, NFAs (w/eps and w/out eps)
- Scanning and Processing Strings with Maximal-Munch
- Understand WL Grammar:
> what is allowed? what is not?
* could you explain using the grammar (show derivation)?
- Understand Basic WL Parse Tree:
> convert WL code to and from parse trees
- WL Relation to Java/C++ (subset).
- WLPP vs. WL
Theory Practical
1
2
3
4
5
SEPT
C/C++
6
UW CS241 - F06
If you used it for the assignments you might need to know about it:
* COMPILE JAVA: javac filename.java (produces .class files)
* RUN JAVA: java ClassName <inputfile (runs main() method, System.in sees inputfile's contents)
* CAN REDIRECT INPUT AND OUTPUT USING: cmdname <inputfile and cmdname >outputfile
* BASIC UNIX CMDS:
ls (list files), cd dirname (change directory), mkdir dirname (make a directory)
man programname (get help on a program called programname), xxd filename (hexdump filename)
dos2unix (converts Windows rn endline sequences to Unix n newline sequences)
* EDITING IN CSCF ENVIRONMENT:
pico, vi/vim, emacs (text editors allow you to edit files)
* COMPILING C++ IN CSCF ENVIRONMENT: g++ -o exename filename0.cc filename1.cc ...
* EXECUTING COMPILED C++ CODE: ./exename (or, if no -o option given to g++) ./a.out
If you needed to do it on A10, you might need to do it on the exam:
- Compare C++ to Java. Compare C++ and WLPP.
- What are pointers? How do you de-reference a pointer (*p)? How can you get the address of a variable (&v)?
- How do you write a basic C++ program? int main() { ... }
- What are includes? What must you include to use printf(...)? How do you use printf(...)? How can you use the 'NULL' symbol?
- How do you create a struct? How does struct compare to class?
- What is operator overloading? How can you overload the '+' operator (for example)?
- pointer addition vs. [] syntactic sugar.
- 'new' keyword. 'delete' keyword. What do they do, why must we use them both in C++ but not in Java (delete doesn't exist in Java)?
- What are '.h' files and what are '.cc' files? What are function prototypes?
C/C++
UNIX
Other Materials You Might Need

More Related Content

What's hot

C101 – Intro to Programming with C
C101 – Intro to Programming with CC101 – Intro to Programming with C
C101 – Intro to Programming with Cgpsoft_sk
 
Lex tool manual
Lex tool manualLex tool manual
Lex tool manualSami Said
 
Intermediate code- generation
Intermediate code- generationIntermediate code- generation
Intermediate code- generationrawan_z
 
Symbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationSymbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationAkhil Kaushik
 
system software 16 marks
system software 16 markssystem software 16 marks
system software 16 marksvvcetit
 
System Programming Unit IV
System Programming Unit IVSystem Programming Unit IV
System Programming Unit IVManoj Patil
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler DesignShine Raj
 
Lecture 16 17 code-generation
Lecture 16 17 code-generationLecture 16 17 code-generation
Lecture 16 17 code-generationIffat Anjum
 
Chapter Three(1)
Chapter Three(1)Chapter Three(1)
Chapter Three(1)bolovv
 

What's hot (20)

C101 – Intro to Programming with C
C101 – Intro to Programming with CC101 – Intro to Programming with C
C101 – Intro to Programming with C
 
Lexyacc
LexyaccLexyacc
Lexyacc
 
Lexical
LexicalLexical
Lexical
 
Lex tool manual
Lex tool manualLex tool manual
Lex tool manual
 
C++
C++C++
C++
 
Lecture4 lexical analysis2
Lecture4 lexical analysis2Lecture4 lexical analysis2
Lecture4 lexical analysis2
 
Intermediate code- generation
Intermediate code- generationIntermediate code- generation
Intermediate code- generation
 
Symbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationSymbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code Generation
 
Lexyacc
LexyaccLexyacc
Lexyacc
 
system software 16 marks
system software 16 markssystem software 16 marks
system software 16 marks
 
C++ Basics
C++ BasicsC++ Basics
C++ Basics
 
Assembly language part I
Assembly language part IAssembly language part I
Assembly language part I
 
Yacc
YaccYacc
Yacc
 
System Programming Unit IV
System Programming Unit IVSystem Programming Unit IV
System Programming Unit IV
 
Interm codegen
Interm codegenInterm codegen
Interm codegen
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler Design
 
First pass of assembler
First pass of assemblerFirst pass of assembler
First pass of assembler
 
Lecture 16 17 code-generation
Lecture 16 17 code-generationLecture 16 17 code-generation
Lecture 16 17 code-generation
 
Chapter Three(1)
Chapter Three(1)Chapter Three(1)
Chapter Three(1)
 
Lex
LexLex
Lex
 

Viewers also liked

Social Graphs and Semantic Analytics
Social Graphs and Semantic AnalyticsSocial Graphs and Semantic Analytics
Social Graphs and Semantic AnalyticsColin Bell
 
WatITis2013: Why API? (cpbell)
WatITis2013: Why API? (cpbell)WatITis2013: Why API? (cpbell)
WatITis2013: Why API? (cpbell)Colin Bell
 
Do More with Less: Semantic Technologies
Do More with Less: Semantic TechnologiesDo More with Less: Semantic Technologies
Do More with Less: Semantic TechnologiesColin Bell
 
FINAL-PDAG-May2016--IST-EA-Update
FINAL-PDAG-May2016--IST-EA-UpdateFINAL-PDAG-May2016--IST-EA-Update
FINAL-PDAG-May2016--IST-EA-UpdateColin Bell
 
ITANA 2016: API Architecture and Implementation
ITANA 2016: API Architecture and ImplementationITANA 2016: API Architecture and Implementation
ITANA 2016: API Architecture and ImplementationColin Bell
 
WatITis2012: The Service Oriented Enterprise (SOE) [cpbell]
WatITis2012: The Service Oriented Enterprise (SOE) [cpbell]WatITis2012: The Service Oriented Enterprise (SOE) [cpbell]
WatITis2012: The Service Oriented Enterprise (SOE) [cpbell]Colin Bell
 
Progress IST-EA: Role, Responsibilities, and Activities
Progress IST-EA: Role, Responsibilities, and ActivitiesProgress IST-EA: Role, Responsibilities, and Activities
Progress IST-EA: Role, Responsibilities, and ActivitiesColin Bell
 
OUCC2015 Service Oriented Enterprise (SOE)
OUCC2015 Service Oriented Enterprise (SOE)OUCC2015 Service Oriented Enterprise (SOE)
OUCC2015 Service Oriented Enterprise (SOE)Colin Bell
 

Viewers also liked (8)

Social Graphs and Semantic Analytics
Social Graphs and Semantic AnalyticsSocial Graphs and Semantic Analytics
Social Graphs and Semantic Analytics
 
WatITis2013: Why API? (cpbell)
WatITis2013: Why API? (cpbell)WatITis2013: Why API? (cpbell)
WatITis2013: Why API? (cpbell)
 
Do More with Less: Semantic Technologies
Do More with Less: Semantic TechnologiesDo More with Less: Semantic Technologies
Do More with Less: Semantic Technologies
 
FINAL-PDAG-May2016--IST-EA-Update
FINAL-PDAG-May2016--IST-EA-UpdateFINAL-PDAG-May2016--IST-EA-Update
FINAL-PDAG-May2016--IST-EA-Update
 
ITANA 2016: API Architecture and Implementation
ITANA 2016: API Architecture and ImplementationITANA 2016: API Architecture and Implementation
ITANA 2016: API Architecture and Implementation
 
WatITis2012: The Service Oriented Enterprise (SOE) [cpbell]
WatITis2012: The Service Oriented Enterprise (SOE) [cpbell]WatITis2012: The Service Oriented Enterprise (SOE) [cpbell]
WatITis2012: The Service Oriented Enterprise (SOE) [cpbell]
 
Progress IST-EA: Role, Responsibilities, and Activities
Progress IST-EA: Role, Responsibilities, and ActivitiesProgress IST-EA: Role, Responsibilities, and Activities
Progress IST-EA: Role, Responsibilities, and Activities
 
OUCC2015 Service Oriented Enterprise (SOE)
OUCC2015 Service Oriented Enterprise (SOE)OUCC2015 Service Oriented Enterprise (SOE)
OUCC2015 Service Oriented Enterprise (SOE)
 

Similar to cs241-f06-final-overview

Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming languageVasavi College of Engg
 
Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingPositive Hack Days
 
Reversing & Malware Analysis Training Part 4 - Assembly Programming Basics
Reversing & Malware Analysis Training Part 4 - Assembly Programming BasicsReversing & Malware Analysis Training Part 4 - Assembly Programming Basics
Reversing & Malware Analysis Training Part 4 - Assembly Programming Basicssecurityxploded
 
Compiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow AnalysisCompiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow AnalysisEelco Visser
 
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)Michael Rys
 
Introduction to Assembly Language
Introduction to Assembly Language Introduction to Assembly Language
Introduction to Assembly Language ApekshaShinde6
 
ElixirでFPGAを設計する
ElixirでFPGAを設計するElixirでFPGAを設計する
ElixirでFPGAを設計するHideki Takase
 
0.5mln packets per second with Erlang
0.5mln packets per second with Erlang0.5mln packets per second with Erlang
0.5mln packets per second with ErlangMaxim Kharchenko
 
Compiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code GenerationCompiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code GenerationEelco Visser
 
Workshop Assembler
Workshop AssemblerWorkshop Assembler
Workshop AssemblerTuhin_Das
 
Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03Avelin Huo
 
H2O World - What's New in H2O with Cliff Click
H2O World - What's New in H2O with Cliff ClickH2O World - What's New in H2O with Cliff Click
H2O World - What's New in H2O with Cliff ClickSri Ambati
 
Sstic 2015 detailed_version_triton_concolic_execution_frame_work_f_saudel_jsa...
Sstic 2015 detailed_version_triton_concolic_execution_frame_work_f_saudel_jsa...Sstic 2015 detailed_version_triton_concolic_execution_frame_work_f_saudel_jsa...
Sstic 2015 detailed_version_triton_concolic_execution_frame_work_f_saudel_jsa...Jonathan Salwan
 

Similar to cs241-f06-final-overview (20)

Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
 
IN4308 1
IN4308 1IN4308 1
IN4308 1
 
7986-lect 7.pdf
7986-lect 7.pdf7986-lect 7.pdf
7986-lect 7.pdf
 
Specialized Compiler for Hash Cracking
Specialized Compiler for Hash CrackingSpecialized Compiler for Hash Cracking
Specialized Compiler for Hash Cracking
 
ISA.pptx
ISA.pptxISA.pptx
ISA.pptx
 
CD U1-5.pptx
CD U1-5.pptxCD U1-5.pptx
CD U1-5.pptx
 
Reversing & Malware Analysis Training Part 4 - Assembly Programming Basics
Reversing & Malware Analysis Training Part 4 - Assembly Programming BasicsReversing & Malware Analysis Training Part 4 - Assembly Programming Basics
Reversing & Malware Analysis Training Part 4 - Assembly Programming Basics
 
Compiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow AnalysisCompiler Construction | Lecture 10 | Data-Flow Analysis
Compiler Construction | Lecture 10 | Data-Flow Analysis
 
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
 
Lecture 01 2017
Lecture 01 2017Lecture 01 2017
Lecture 01 2017
 
Matlab-3.pptx
Matlab-3.pptxMatlab-3.pptx
Matlab-3.pptx
 
Introduction to Assembly Language
Introduction to Assembly Language Introduction to Assembly Language
Introduction to Assembly Language
 
ElixirでFPGAを設計する
ElixirでFPGAを設計するElixirでFPGAを設計する
ElixirでFPGAを設計する
 
0.5mln packets per second with Erlang
0.5mln packets per second with Erlang0.5mln packets per second with Erlang
0.5mln packets per second with Erlang
 
Compiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code GenerationCompiler Construction | Lecture 13 | Code Generation
Compiler Construction | Lecture 13 | Code Generation
 
Workshop Assembler
Workshop AssemblerWorkshop Assembler
Workshop Assembler
 
Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03Designing A Syntax Based Retrieval System03
Designing A Syntax Based Retrieval System03
 
_intro.ppt
_intro.ppt_intro.ppt
_intro.ppt
 
H2O World - What's New in H2O with Cliff Click
H2O World - What's New in H2O with Cliff ClickH2O World - What's New in H2O with Cliff Click
H2O World - What's New in H2O with Cliff Click
 
Sstic 2015 detailed_version_triton_concolic_execution_frame_work_f_saudel_jsa...
Sstic 2015 detailed_version_triton_concolic_execution_frame_work_f_saudel_jsa...Sstic 2015 detailed_version_triton_concolic_execution_frame_work_f_saudel_jsa...
Sstic 2015 detailed_version_triton_concolic_execution_frame_work_f_saudel_jsa...
 

cs241-f06-final-overview

  • 1. DEC Lexical Analysis (Recognizing & Scanning) WL MIPS Context-Free / Syntactic Analysis (Parsing) Context-Sensitive / Semantic Analysis Code Generation - Given a chunk of WL code: > perform semantic analysis on it - Discuss how you performed semantic analysis of WL Programs > build a table: * verify (1) it is not already in the table (definition) * verify (2) variables being used are in the table (usage) - Generate Code: > Given a WL parse tree/code, generate equivalent MIPS code. - Strategies: > how did you implement your chosen strategy? > provide sketch of algorithm to convert WL to MIPS - Reading/Understanding MIPS, MERL, Conversion Reference - Interpreting Bits (work with all interpretations, base conversion) - Write Assembly Language Programs > control structures (loops, conditionals), array addressing > memory-mapped i/o, functions (recursive and non-recursive) > allocating memory (directives, stack) - Linking and Loading (MERL, .import, .export) - Write WL programs to solve given problems. - Explain what given WL programs do. - Parse WL programs (would given code compile?) - DFAs, NFAs, NFAs with Epsilon Transitions > draw DFAs for accepting a given language (set of strings) > decide if a given string is accepted by a given *FA - Regular Expressions > given a language, provide a regular expression to match it > given a regular expression, decide if a string is accepted - Write pseudocode for any algorithms dealing with RLs > accepting w/ DFAs, NFAs, NFAs w/ epsilons, Maximal-Munch - CFGs: (understand assignment CFG file format reference) > given a CFG, give derivations for given strings. > given a CFG, find an ambiguous derivation. - Parsing: > LL(1): given predict table, parse a string. > LR(1): given shift/reduce rules or LR(1) DFA, parse a string. - Parse Tree Play: > understand how to draw a tree for a derivation - Stored Program Computer (CPU, RAM, Machine-Cycle) - Abstractions (Machine -> Assembly -> High-Level Language) - Bit-Interpretations ("Meaning is in the eye of the beholder.") > bit, nibble (4 bits), byte (8 bits), word (32 bits) > two's complement, unsigned, instruction interpretations - Memory Usage @ Run-Time (code+data, stack, addresses) - Assembler Function and Construction - Understand How/Why: Traversal of Parse Trees. - Understand Strategies for Generating Code: > why do we want a strategy? Ad-Hoc vs. Strategic methods. > how did the strategies presented in class work? * (Lhotak/Pretti) vars in C+D section, (Cormack) unique offsets - Why have prologue/epilogue sections in generated code? - Briefly, what does it mean to optimize your generated code? > not how, know that you can streamline the generated code - Define: Semantic/Context-Sensitive Analysis - Understand the Semantic Requirements of the WL Language > variables must be defined only once > variables must be defined to be used - Understand that Semantic Analysis verifies a string's 'meaning'. - Define: Parsing, Context-Free Grammar/Language - Context-Free Grammars: > productions, derivations, membership in lang. def. by a CFG > derivation/parse trees, ambiguity - Parsing Algorithms > top-down: LL(k) - first & follow sets, predict table > bottom-up: LR(k) - shift/reduce rules. LR(1) machines (DFA) - Left and Right Canonical Derivations - Define: Scanner, Recognizer, Membership in Language, Tokens - Regular Languages and Associated Tools (automata, regexp) > DFAs, NFAs, NFAs w/ epsilon transitions, Regular Expressions > DFAs with actions, transducers - Properties of Regular Languages - Compare and Contrast RLs with Context-Free Languages - Algorithms Associated with DFAs, NFAs (w/eps and w/out eps) - Scanning and Processing Strings with Maximal-Munch - Understand WL Grammar: > what is allowed? what is not? * could you explain using the grammar (show derivation)? - Understand Basic WL Parse Tree: > convert WL code to and from parse trees - WL Relation to Java/C++ (subset). - WLPP vs. WL Theory Practical 1 2 3 4 5 SEPT C/C++ 6 UW CS241 - F06
  • 2. If you used it for the assignments you might need to know about it: * COMPILE JAVA: javac filename.java (produces .class files) * RUN JAVA: java ClassName <inputfile (runs main() method, System.in sees inputfile's contents) * CAN REDIRECT INPUT AND OUTPUT USING: cmdname <inputfile and cmdname >outputfile * BASIC UNIX CMDS: ls (list files), cd dirname (change directory), mkdir dirname (make a directory) man programname (get help on a program called programname), xxd filename (hexdump filename) dos2unix (converts Windows rn endline sequences to Unix n newline sequences) * EDITING IN CSCF ENVIRONMENT: pico, vi/vim, emacs (text editors allow you to edit files) * COMPILING C++ IN CSCF ENVIRONMENT: g++ -o exename filename0.cc filename1.cc ... * EXECUTING COMPILED C++ CODE: ./exename (or, if no -o option given to g++) ./a.out If you needed to do it on A10, you might need to do it on the exam: - Compare C++ to Java. Compare C++ and WLPP. - What are pointers? How do you de-reference a pointer (*p)? How can you get the address of a variable (&v)? - How do you write a basic C++ program? int main() { ... } - What are includes? What must you include to use printf(...)? How do you use printf(...)? How can you use the 'NULL' symbol? - How do you create a struct? How does struct compare to class? - What is operator overloading? How can you overload the '+' operator (for example)? - pointer addition vs. [] syntactic sugar. - 'new' keyword. 'delete' keyword. What do they do, why must we use them both in C++ but not in Java (delete doesn't exist in Java)? - What are '.h' files and what are '.cc' files? What are function prototypes? C/C++ UNIX Other Materials You Might Need