public class Lexer { String derString; public Lexer() { derString = ""; } private boolean istZiffer(char c) { return (('0' <= c) && (c <= '9')); } private boolean istVorzeichen(char c) { return ((c == '+') || (c == '-')); } public boolean istInt(String s) { int q; char c; q = 1; while (s.length() > 0) { c = s.charAt(0); if (q == 1) { if (istVorzeichen(c)) q = 2; else if (istZiffer(c)) q = 3; else q = 99; } else if ((q == 2) || (q == 3)) { if (istZiffer(c)) q = 3; else q = 99; } s = s.substring(1); } return (q==3); } }