COMPILER CONSTRUCTION Principles and practice Kenneth C. louden
COMPILER CONSTRUCTION Principles and Practice Kenneth C. Louden
2. Scanning (Lexical Analysis) PART ONE
2. Scanning (Lexical Analysis) PART ONE
Contents PART ONE 2. 1 The Scanning Process [Open] 2.2 Regular Expression [Open 2.3 Finite Automata [Open PART TWO 2. 4 From Regular expressions to dFAs 2.5 Implementation of a TINY Scanner 2.6 Use of Lex to Generate a Scanner automatically
Contents PART ONE 2.1 The Scanning Process [Open] 2.2 Regular Expression [Open] 2.3 Finite Automata [Open] PART TWO 2.4 From Regular Expressions to DFAs 2.5 Implementation of a TINY Scanner 2.6 Use of Lex to Generate a Scanner Automatically
2. 1 The Scanning Process
2.1 The Scanning Process
The Function of a scanner Reading characters from the source code and form them into logical units called tokens Tokens are logical entities defined as an enumerated type Typedef enum fIF, THEN, ELSE, PLUS, MINUS, NUM, ID,...) OKen lype
The Function of a Scanner • Reading characters from the source code and form them into logical units called tokens • Tokens are logical entities defined as an enumerated type – Typedef enum {IF, THEN, ELSE, PLUS, MINUS, NUM, ID,…} TokenType;