// Expected BitSet / not BitSet public MismatchedCharException(char c, BitSet set_, boolean matchNot, CharScanner scanner_) { super("Mismatched char", scanner_.getFilename(), scanner_.getLine(), scanner_.getColumn()); mismatchType = matchNot ? NOT_SET : SET; foundChar = c; set = set_; scanner = scanner_; }
// Expected token / not token public MismatchedCharException(char c, char expecting_, boolean matchNot, CharScanner scanner_) { super("Mismatched char", scanner_.getFilename(), scanner_.getLine(), scanner_.getColumn()); mismatchType = matchNot ? NOT_CHAR : CHAR; foundChar = c; expecting = expecting_; scanner = scanner_; }
// Expected range / not range public MismatchedCharException( char c, char lower, char upper_, boolean matchNot, CharScanner scanner_) { super("Mismatched char", scanner_.getFilename(), scanner_.getLine(), scanner_.getColumn()); mismatchType = matchNot ? NOT_RANGE : RANGE; foundChar = c; expecting = lower; upper = upper_; scanner = scanner_; }
public Number toIntegerWrapper() { if (CharScanner.isInteger(buffer, 0, location)) { return intValue(); } else { return longValue(); } }
public long longValue() { return CharScanner.parseLongFromTo(buffer, 0, location); }
public int intValue() { return CharScanner.parseIntFromTo(buffer, 0, location); }
public float floatValue() { return CharScanner.parseFloat(this.buffer, 0, location); }
public double doubleValue() { return CharScanner.parseDouble(this.buffer, 0, location); }