class Token{
static ChoiceFormat fmt = new ChoiceFormat("4#演算子|5#単項演算子|7#定数|8#右括弧|9#左括弧|"
+ "10#変数|11#演算子|12#(終)|13#(不正トークン)");
String sign;
int type;
public Token(int type, String sign){
this.type = type;
this.sign = sign;
}
public int getType(){
return type;
}
public double getValue() {
return Double.parseDouble(sign);
}
public String toString(){
return fmt.format(type) + " : " + sign;
}
}