[Instructions] [Search] [Current] [News] [Syllabus] [Handouts] [Outlines] [Assignments]
Held Wednesday, September 9, 1998
Notes
lex, Jlex, and
flex. As I mentioned the first day of class, I expect
you to be able to teach yourself about programs.
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) {
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);
} // inLanguage
a's and
b's with equal numbers of a's and
b's.''
Back to Introduction to lexical analysis and regular expressions. On to From regular expression to finite automaton.
[Instructions] [Search] [Current] [News] [Syllabus] [Handouts] [Outlines] [Assignments]
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
Source text last modified Fri Sep 11 12:28:17 1998.
This page generated on Wed Sep 16 11:21:17 1998 by SiteWeaver.
Contact our webmaster at rebelsky@math.grin.edu