import java.lang.*;
public class AltosParse {
+ static boolean isdigit(char c) {
+ return '0' <= c && c <= '9';
+ }
+
static int parse_int(String v) throws ParseException {
try {
- return Integer.parseInt(v);
+ return Altos.fromdec(v);
} catch (NumberFormatException e) {
throw new ParseException("error parsing int " + v, 0);
}
static int parse_hex(String v) throws ParseException {
try {
- return Integer.parseInt(v, 16);
+ return Altos.fromhex(v);
} catch (NumberFormatException e) {
throw new ParseException("error parsing hex " + v, 0);
}