700 likes | 1.05k Vues
Lexical Analysis. Arial Font Family. Figure 3.1: Interactions between the lexical analyzer and the parser. Figure 3.2: Examples of tokens. Figure 3.3: Using a pair of input buffers. Figure 3.4: Sentinels at the end of each buffer. Figure 3.5: Lookahead code with sentinels.
E N D
Lexical Analysis Arial Font Family
Figure 3.1: Interactions between the lexical analyzer and the parser
Figure 3.9: Filename expressions used by the shell command sh
Figure 3.15: Hypothetical transition diagram for the keyword then
Figure 3.18: Sketch of implementation of relop transition diagram
Figure 3.19: Algorithm to compute the failure function for keyword blb2 . . . bn
Figure 3.20: The KMP algorithmtests whether string ala2 . . a, contains asingle keyword bl b2 . . . bnas a substring in O(m + n) time
Figure 3.36: Result of applying the subset construction to Fig. 3.34
Figure 3.38: Adding a new state s, which is known not to be on newstates
Figure 3.41: NFA for the concatenation of two regular expressions
Figure 3.47: An NFA that has many fewer states than the smallest equivalent DFA
Figure 3.48: Initial cost and per-string-cost of various methods of recognizingthe language of a regular expression
Figure 3.49: A Lex program is turned into a transition table and actions, whichare used by a finite-automaton simulator