private int match() throws ParsingException, IOException {
  int value=-1;
  int lineno=st.lineno();
  String sValue=null;
switch (lookahead) {
case StreamTokenizer.TT_NUMBER:
    value=(int)st.nval;
  if (value < 0) {
    sValue=String.valueOf(st.nval);
  }
lookahead=st.nextToken();
break;
default :
sValue=st.sval;
break;
}
if (value <= 0) {
throw new ParsingException(lineno,"a non-negative number",sValue);
}
return value;
}

private int match ( ) throws ParsingException , IOException { int value = - 1 ; int lineno = st . lineno ( ) ; String sValue = null ; switch ( lookahead ) { case StreamTokenizer . TT_NUMBER : value = ( int ) st . nval ; if ( value < 0 ) { sValue = String . valueOf ( st . nval ) ; } lookahead = st . nextToken ( ) ; break ; default : sValue = st . sval ; break ; } if ( value <= 0 ) { throw new ParsingException ( lineno , "a non-negative number" , sValue ) ; } return value ; }
excepts to match a non - negative number .
