Artifact c1cf23659bd8a23cd29986e725ba4a8f1aa3e29f329212e537328fc1542f7458:
- Executable file
r37/lisp/csl/jlisp/ListReader.java
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1018) [annotate] [blame] [check-ins using] [more...]
// // This file is part of the Jlisp implementation of Standard Lisp // Copyright \u00a9 (C) Codemist Ltd, 1998-2000. // import java.io.*; import java.math.*; import java.util.*; import java.text.*; import java.security.*; class ListReader extends LispStream { ListReader(LispObject data) { super("<read from list>"); inputData = data; needsPrompt = false; escaped = false; this.allowOctal = allowOctal; nextChar = -2; } int read() throws Exception { if (inputData.atom) return -1; LispObject w = inputData.car; inputData = inputData.cdr; if (w instanceof LispString) return (int)((LispString)w).string.charAt(0); else if (w instanceof Symbol) return (int)((Symbol)w).pname.charAt(0); else if (w instanceof LispInteger) return w.intValue(); else return -1; } void close() { inputData = Jlisp.nil; } } // end of ListReader.java