100 likes | 331 Views
The Role of Lexical Analyzer. Lexical Analysis vs. ParsingTokens, Patterns and LexemesAttributes for TokensLexical Errors. Input Buffering. Buffer PairsSentinels. Specification of Tokens. Strings and LanguagesOperations on LanguagesRegular ExpressionsRegular DefinitionsExtensions of Regular
E N D
1. Overview Compiler Design Lexical Analysis
2. The Role of Lexical Analyzer Lexical Analysis vs. Parsing
Tokens, Patterns and Lexemes
Attributes for Tokens
Lexical Errors
3. Input Buffering Buffer Pairs
Sentinels
4. Specification of Tokens Strings and Languages
Operations on Languages
Regular Expressions
Regular Definitions
Extensions of Regular Expressions
5. Recognition of Tokens Transitions Diagrams
Recognition of Reserved Words and Identifiers
Completion of the Running Example
Architecture of a Transition-Diagram-Based Lexical Analyzer
6. The Lexical-Analyzer Generator Lex Use of Lex
Structure of Lex Programs
Conflict Resolution in Lex
The Lookahead Operator
7. Finite Automata Nondeterministic Finite Automata
Transition Tables
Acceptance of Input Strings by Automata
Deterministic Finite Automata
8. From Regular Expressions to Automata Conversion of an NFA to DFA
Simulation of a NFA
Efficiency of NFA Simulation
Construction of an NFA from a Regular Expression
9. Optimization of DFA-Based Pattern Matchers Important States of an NFA
Functions Computed from the Syntax Tree
Computing nullable, firstpos and lastpos
Computing followpos
Converting a Regular Expression Directly to a DFA
Minimizing the Number of States of a DFA
State Minimization of a Lexical Analyzers
Trading Time for Space in DFA Simulation
10. Bibliography Alfred V. Aho, Monica S. Lam, Ravi Sethi, Jeffrey D. Ullman – Compilers, Principles, Techniques and Tools, Second Edition, 2007