1 / 8

Compiler Designs and Constructions (Page 83 – 92)

Compiler Designs and Constructions (Page 83 – 92). Chapter 4: Scanner (Lexical Analyzer) Objectives: Introduction to Scanner Token Definition Types of Scanners Dr. Mohsen Chitsaz. Scanner (Lexical Analyzer). Task. GetNextToken. Scanner. Parser. Token. Symbol Table. Scanner.

eesposito
Download Presentation

Compiler Designs and Constructions (Page 83 – 92)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Compiler Designs and Constructions (Page 83 – 92) Chapter 4: Scanner (Lexical Analyzer) Objectives: Introduction to Scanner Token Definition Types of Scanners Dr. Mohsen Chitsaz Chapter 4: Scanner (Lexical Analyzer)

  2. Scanner (Lexical Analyzer) • Task GetNextToken Scanner Parser Token Symbol Table Chapter 4: Scanner (Lexical Analyzer)

  3. Scanner • Token: • Input File: • Keywords • User id • Symbols • Numbers • Preparation: • Remove Comments • Case Conversion • White Spaces • Compiler Directives (Token Continued) Chapter 4: Scanner (Lexical Analyzer)

  4. Scanner • Preparation of the output listing: • Create a listing file • Keep line numbers • Insert errors, warnings • Table Summary Chapter 4: Scanner (Lexical Analyzer)

  5. Scanner • Definition: Total, Sum, LongNum, Max If • Input Disk -> OS Buffer -> File Buffer -> Program Buffer • Reading large blocks • Min Disk access • Unite allocations • Lookahead/ Pushback Chapter 4: Scanner (Lexical Analyzer)

  6. Scanner • Buffering • Buffer Size • Max lexeme length Chapter 4: Scanner (Lexical Analyzer)

  7. Scanner Lexeme: A, NumOfBooks, Sum Token: ID Chapter 4: Scanner (Lexical Analyzer)

  8. Scanner • Buffer Markers • Start • End • Logical End of Buffer • Next Input • Previous Lexeme • Beginning of Current Lexeme • End of Current Lexeme • Danger Zone • Lookahead Characters Chapter 4: Scanner (Lexical Analyzer)

More Related