Q1) How do you write a code for number 3 which is bottom of the code in a Tokenzier class.
if(Buf[cur]>=('0') && Buf[cur]<=('9')){
while(cur=('0') && Buf[cur]<=('9')){ do something.
}
class Tokenizer {
private char [] Buf;
private int cur;
Tokenizer(String infixExpression) {
Buf = infixExpression.toCharArray();
cur = 0;
}
Token nextToken() {
1. Skip blanks.
2. if (cur>=Buf.length) return null;
3. If the next character is a digit, keep reading until a non-digit is read.
Convert the string of digits into an integer.
String Digits = new String(Buf, start, len);
int num = Integer.valueOf(Digits).intValue();
Create and return an operand.
4. Otherwise, use the next character to create and return an operator.
}
}