Back to Regular Expressions, Continued. On to From Specification to NFA.
Held Friday, February 2, 2001
Summary
Today we consider finite automata, which server as another representation of data for lexical analysis.
Notes
Overview
lex
, Jlex
, and
flex
.
if
is given by if.
if
is matched by the regular expression for
the if keyword. However, it is also matched by the definition of
an identifier.
if then = if then if = else else if = then
if3
one
token or two? How many tokens are there in if 3 then
?
/** * Determine whether a string is in the language given by the * current automaton. */ public boolean inLanguage(String candidate) begin State current_state = q0; for each symbol sym in candidate current_state = delta(current_state ,sym) if current_state is undefined return false end for return (current_state is a final state); end inLanguage
a
's and
b
's with equal numbers of a
's and
b
's''.
Monday, 22 January 2001
Thursday, 1 February 2001
Back to Regular Expressions, Continued. On to From Specification to NFA.
[Current]
[Discussions]
[Glance]
[Honesty]
[Instructions]
[Links]
[Search]
[Syllabus]
Primary
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Project]
[Quizzes]
[Readings]
[Reference]
Sets
[Blackboard]
[98F]
Links
Disclaimer: I usually create these pages on the fly. This means that they are rarely proofread and may contain bad grammar and incorrect details. It also means that I may update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.
This page was generated by Siteweaver on Mon Apr 30 10:51:47 2001.
This page may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS362/2001S/outline.06.html
.
You may validate
this page's HTML.
The source was last modified Thu Feb 1 20:33:44 2001.