









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










CMSC 433, Fall 2002 50
CMSC 433, Fall 2002 51
CMSC 433, Fall 2002 52
CMSC 433, Fall 2002 53
CMSC 433, Fall 2002 56
class State1 implements State { static State1 instance = new State1(); private State1() {} public State move (char c) { switch (c) { case 'a': return State2.instance; case 'b': return State1.instance; default: throw new IllegalArgumentException(); } } public boolean accept() {return false;} }
class State2 implements State { static State2 instance = new State2(); private State2() {} public State move (char c) { switch (c) { case 'a': return State1.instance; case 'b': return State1.instance; default: throw new IllegalArgumentException(); } } public boolean accept() {return true;} }
CMSC 433, Fall 2002 57
CMSC 433, Fall 2002 58
CMSC 433, Fall 2002 59
FileReader frdr = new FileReader(filename); LineNumberReader lrdr = new LineNumberReader(frdr); String line; while ((line = lrdr.readLine()) != null) { System.out.print(lrdr.getLineNumber() + ":\t" + line); }
CMSC 433, Fall 2002 62
CMSC 433, Fall 2002 63
CMSC 433, Fall 2002 64
CMSC 433, Fall 2002 65
CMSC 433, Fall 2002 68
CMSC 433, Fall 2002 69
CMSC 433, Fall 2002 70
CMSC 433, Fall 2002 71
CMSC 433, Fall 2002 74
CMSC 433, Fall 2002 75
CMSC 433, Fall 2002 76