Chapter 3:Lexical Analysis

Implementation of transition diagrams

Token nexttoken() {

       while(1) {

               switch (state) {

..

case 10 : c=nextchar();

if(isletter(c)) state=10;

elseif (isdigit(c)) state=10; else state=11;

break;

..

}

}

}