protected void checkFor ( VDMToken tok , int number , String message ) throws LexException , ParserException { if ( lastToken ( ) . is ( tok ) ) { nextToken ( ) ; } else { throwMessage ( number , message ) ; } }
If the last token is as expected advance else raise an error .