] >
|
state = q0
IF( char undefined ){ char = nextChar(); } WHILE( char != EOF ){ IF( state == q0 ){ str = ""; IF( char == ’ ’ || char == ’\n’ ){ char = nextChar(); CONTINUE; } } nextState = table[state, charMap[char] ]; IF( nextState defined ){ str += char; state = nextState; char = nextChar(); } ELSE break; } IF( ! final(state) ){ error(); }
|
|
|
IF( state == q1 ){
i = lookid(str) IF( i < 4 ) return(i,) ELSE return(8,i) }
| symbol table
|
IF( state == q2 ){
value = parseInt(str) i = lookint( value ) return(9,i) }
| constant table
|
Note: lookid and lookint introduce the given arguments into the tables, if the values are not yet included in the tables
|
transition table
|
charMap
|