diff options
| author | Bdale Garbee <bdale@gag.com> | 2010-08-27 03:08:53 -0600 |
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2010-08-27 03:08:53 -0600 |
| commit | c443f43f8dee6e0fcbcecf9d09e948fd928b7af4 (patch) | |
| tree | 653fe6ba91e165aaf8a6b4eef17602c5f1bd62a9 /ao-tools/altosui/AltosParse.java | |
| parent | 295043112ccde35092945c286596f9045ee6fa05 (diff) | |
| parent | 2923cf5057f9cef110dd547d8677ea5b60e00796 (diff) | |
Merge branch 'new-packet-format' of ssh://git.gag.com/scm/git/fw/altos into new-package-format
Diffstat (limited to 'ao-tools/altosui/AltosParse.java')
| -rw-r--r-- | ao-tools/altosui/AltosParse.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ao-tools/altosui/AltosParse.java b/ao-tools/altosui/AltosParse.java index a60dc694..4d82de78 100644 --- a/ao-tools/altosui/AltosParse.java +++ b/ao-tools/altosui/AltosParse.java @@ -20,10 +20,16 @@ package altosui; import java.text.*; import java.lang.*; +import altosui.Altos; + 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); } @@ -31,7 +37,7 @@ public class AltosParse { 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); } |
