01: // Copyright (c) 2001 Per M.A. Bothner
02: // This is free software; for terms and warranty disclaimer see ./COPYING.
03:
04: package gnu.kawa.lispexpr;
05:
06: import gnu.text.Lexer;
07: import gnu.text.SyntaxException;
08: import gnu.lists.Sequence;
09: import gnu.mapping.Values;
10:
11: public class ReaderIgnoreRestOfLine extends ReadTableEntry {
12: static ReaderIgnoreRestOfLine instance = new ReaderIgnoreRestOfLine();
13:
14: public static ReaderIgnoreRestOfLine getInstance() {
15: return instance;
16: }
17:
18: public Object read(Lexer in, int ch, int count)
19: throws java.io.IOException, SyntaxException {
20: do {
21: ch = in.read();
22: if (ch < 0)
23: return Sequence.eofValue;
24: } while (ch != '\n' && ch != '\r');
25: return Values.empty;
26: }
27: }
|