KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > kawa > lispexpr > ReaderIgnoreRestOfLine


1 // Copyright (c) 2001 Per M.A. Bothner
2
// This is free software; for terms and warranty disclaimer see ./COPYING.
3

4 package gnu.kawa.lispexpr;
5 import gnu.text.Lexer;
6 import gnu.text.SyntaxException;
7 import gnu.lists.Sequence;
8 import gnu.mapping.Values;
9
10 public class ReaderIgnoreRestOfLine extends ReadTableEntry
11 {
12   static ReaderIgnoreRestOfLine instance = new ReaderIgnoreRestOfLine();
13
14   public static ReaderIgnoreRestOfLine getInstance() { return instance; }
15
16   public Object JavaDoc read (Lexer in, int ch, int count)
17     throws java.io.IOException JavaDoc, SyntaxException
18   {
19     do
20       {
21     ch = in.read();
22     if (ch < 0)
23       return Sequence.eofValue;
24       } while (ch != '\n' && ch!= '\r');
25     return Values.empty;
26   }
27 }
28
Popular Tags