Changeset 3887
- Timestamp:
- 09/19/03 12:32:14 (20 years ago)
- Location:
- trunk/j/src/org/armedbear/lisp
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/BinaryInputStream.java
r3883 r3887 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: BinaryInputStream.java,v 1. 2 2003-09-19 01:46:39piso Exp $5 * $Id: BinaryInputStream.java,v 1.3 2003-09-19 12:32:13 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 44 44 } 45 45 catch (IOException e) { 46 throw new StreamError(e);46 throw new ConditionThrowable(new StreamError(e)); 47 47 } 48 48 if (n < 0) { 49 49 if (eofError) 50 throw new EndOfFileException();50 throw new ConditionThrowable(new EndOfFileException()); 51 51 else 52 52 return eofValue; … … 56 56 57 57 // Returns true if stream was open, otherwise implementation-dependent. 58 public LispObject close(LispObject abort) throws StreamError58 public LispObject close(LispObject abort) throws ConditionThrowable 59 59 { 60 60 try { … … 63 63 } 64 64 catch (IOException e) { 65 throw new StreamError(e);65 throw new ConditionThrowable(new StreamError(e)); 66 66 } 67 67 } -
trunk/j/src/org/armedbear/lisp/BinaryOutputStream.java
r1598 r3887 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: BinaryOutputStream.java,v 1. 2 2003-04-09 18:09:00piso Exp $5 * $Id: BinaryOutputStream.java,v 1.3 2003-09-19 12:32:13 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 35 35 } 36 36 37 public void writeByte(int n) throws StreamError37 public void writeByte(int n) throws ConditionThrowable 38 38 { 39 39 try { … … 41 41 } 42 42 catch (IOException e) { 43 throw new StreamError(e);43 throw new ConditionThrowable(new StreamError(e)); 44 44 } 45 45 } 46 46 47 public void finishOutput() throws StreamError47 public void finishOutput() throws ConditionThrowable 48 48 { 49 49 try { … … 51 51 } 52 52 catch (IOException e) { 53 throw new StreamError(e);53 throw new ConditionThrowable(new StreamError(e)); 54 54 } 55 55 } 56 56 57 57 // Returns true if stream was open, otherwise implementation-dependent. 58 public LispObject close(LispObject abort) throws StreamError58 public LispObject close(LispObject abort) throws ConditionThrowable 59 59 { 60 60 try { … … 63 63 } 64 64 catch (IOException e) { 65 throw new StreamError(e);65 throw new ConditionThrowable(new StreamError(e)); 66 66 } 67 67 } -
trunk/j/src/org/armedbear/lisp/CharacterInputStream.java
r3886 r3887 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: CharacterInputStream.java,v 1.4 8 2003-09-19 12:20:34piso Exp $5 * $Id: CharacterInputStream.java,v 1.49 2003-09-19 12:32:13 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 79 79 } 80 80 catch (IOException e) { 81 throw new StreamError(e);81 throw new ConditionThrowable(new StreamError(e)); 82 82 } 83 83 } … … 92 92 } 93 93 catch (IOException e) { 94 throw new StreamError(e);94 throw new ConditionThrowable(new StreamError(e)); 95 95 } 96 96 if (n < 0) { 97 97 if (eofError) 98 throw new EndOfFileException();98 throw new ConditionThrowable(new EndOfFileException()); 99 99 else 100 100 return eofValue; … … 144 144 int n = read(); 145 145 if (n < 0) 146 throw new EndOfFileException();146 throw new ConditionThrowable(new EndOfFileException()); 147 147 char c = (char) n; 148 148 if (c == '\\') { … … 150 150 n = read(); 151 151 if (n < 0) 152 throw new EndOfFileException();152 throw new ConditionThrowable(new EndOfFileException()); 153 153 sb.append((char)n); 154 154 continue; … … 162 162 } 163 163 catch (IOException e) { 164 throw new StreamError(e);164 throw new ConditionThrowable(new StreamError(e)); 165 165 } 166 166 } … … 184 184 int n = read(); 185 185 if (n < 0) 186 throw new EndOfFileException();186 throw new ConditionThrowable(new EndOfFileException()); 187 187 char nextChar = (char) n; 188 188 if (isTokenDelimiter(nextChar)) { … … 213 213 } 214 214 catch (IOException e) { 215 throw new StreamError(e);215 throw new ConditionThrowable(new StreamError(e)); 216 216 } 217 217 } … … 250 250 } 251 251 catch (IOException e) { 252 throw new StreamError(e);252 throw new ConditionThrowable(new StreamError(e)); 253 253 } 254 254 } … … 259 259 int n = read(); 260 260 if (n < 0) 261 throw new EndOfFileException();261 throw new ConditionThrowable(new EndOfFileException()); 262 262 char c = (char) n; 263 263 switch (c) { … … 275 275 } 276 276 catch (IOException e) { 277 throw new StreamError(e);277 throw new ConditionThrowable(new StreamError(e)); 278 278 } 279 279 } … … 292 292 int n = read(); 293 293 if (n < 0) 294 throw new EndOfFileException();294 throw new ConditionThrowable(new EndOfFileException()); 295 295 c = (char) n; 296 296 if (c < '0' || c > '9') … … 354 354 } 355 355 catch (IOException e) { 356 throw new StreamError(e);356 throw new ConditionThrowable(new StreamError(e)); 357 357 } 358 358 } … … 363 363 int n = read(); 364 364 if (n < 0) 365 throw new EndOfFileException();365 throw new ConditionThrowable(new EndOfFileException()); 366 366 char c = (char) n; 367 367 StringBuffer sb = new StringBuffer(); … … 389 389 } 390 390 catch (IOException e) { 391 throw new StreamError(e);391 throw new ConditionThrowable(new StreamError(e)); 392 392 } 393 393 } … … 419 419 int n = read(); 420 420 if (n < 0) 421 throw new EndOfFileException();421 throw new ConditionThrowable(new EndOfFileException()); 422 422 char c = (char) n; 423 423 StringBuffer sb = new StringBuffer(); … … 426 426 n = read(); 427 427 if (n < 0) 428 throw new EndOfFileException();428 throw new ConditionThrowable(new EndOfFileException()); 429 429 c = (char) n; 430 430 if (c == '|') … … 451 451 } 452 452 catch (IOException e) { 453 throw new StreamError(e);454 } 455 } 456 457 private void skipBalancedComment() throws StreamError453 throw new ConditionThrowable(new StreamError(e)); 454 } 455 } 456 457 private void skipBalancedComment() throws ConditionThrowable 458 458 { 459 459 try { … … 478 478 } 479 479 catch (IOException e) { 480 throw new StreamError(e);480 throw new ConditionThrowable(new StreamError(e)); 481 481 } 482 482 } … … 501 501 } 502 502 catch (IOException e) { 503 throw new StreamError(e);503 throw new ConditionThrowable(new StreamError(e)); 504 504 } 505 505 } … … 537 537 } 538 538 catch (IOException e) { 539 throw new StreamError(e);539 throw new ConditionThrowable(new StreamError(e)); 540 540 } 541 541 } … … 565 565 } 566 566 catch (IOException e) { 567 throw new StreamError(e);567 throw new ConditionThrowable(new StreamError(e)); 568 568 } 569 569 } … … 592 592 } 593 593 catch (IOException e) { 594 throw new StreamError(e);594 throw new ConditionThrowable(new StreamError(e)); 595 595 } 596 596 } … … 762 762 } 763 763 catch (IOException e) { 764 throw new StreamError(e);764 throw new ConditionThrowable(new StreamError(e)); 765 765 } 766 766 } … … 800 800 } 801 801 catch (IOException e) { 802 throw new StreamError(e);802 throw new ConditionThrowable(new StreamError(e)); 803 803 } 804 804 } … … 810 810 int n = read(); 811 811 if (n < 0) 812 throw new EndOfFileException();812 throw new ConditionThrowable(new EndOfFileException()); 813 813 char c = (char) n; 814 814 if (!Character.isWhitespace(c)) … … 817 817 } 818 818 catch (IOException e) { 819 throw new StreamError(e);819 throw new ConditionThrowable(new StreamError(e)); 820 820 } 821 821 } … … 834 834 if (sb.length() == 0) { 835 835 if (eofError) 836 throw new EndOfFileException();836 throw new ConditionThrowable(new EndOfFileException()); 837 837 return eofValue; 838 838 } … … 856 856 } 857 857 catch (IOException e) { 858 throw new StreamError(e);858 throw new ConditionThrowable(new StreamError(e)); 859 859 } 860 860 } … … 871 871 } 872 872 catch (IOException e) { 873 throw new StreamError(e);873 throw new ConditionThrowable(new StreamError(e)); 874 874 } 875 875 if (n < 0) { 876 876 if (eofError) 877 throw new EndOfFileException();877 throw new ConditionThrowable(new EndOfFileException()); 878 878 else 879 879 return eofValue; … … 889 889 } 890 890 catch (IOException e) { 891 throw new StreamError(e);891 throw new ConditionThrowable(new StreamError(e)); 892 892 } 893 893 return NIL; … … 902 902 } 903 903 catch (IOException e) { 904 throw new StreamError(e);904 throw new ConditionThrowable(new StreamError(e)); 905 905 } 906 906 return NIL; … … 909 909 // close stream &key abort => result 910 910 // Must return true if stream was open, otherwise implementation-dependent. 911 public LispObject close(LispObject abort) throws StreamError911 public LispObject close(LispObject abort) throws ConditionThrowable 912 912 { 913 913 try { … … 916 916 } 917 917 catch (IOException e) { 918 throw new StreamError(e);918 throw new ConditionThrowable(new StreamError(e)); 919 919 } 920 920 } -
trunk/j/src/org/armedbear/lisp/CharacterOutputStream.java
r3433 r3887 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: CharacterOutputStream.java,v 1. 4 2003-08-16 16:53:39piso Exp $5 * $Id: CharacterOutputStream.java,v 1.5 2003-09-19 12:32:13 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 63 63 } 64 64 65 public LispObject terpri() throws StreamError66 { 67 try { 68 writer.write(lineSeparator); 69 writer.flush(); 70 charPos = 0; 71 } 72 catch (IOException e) { 73 throw new StreamError(e);65 public LispObject terpri() throws ConditionThrowable 66 { 67 try { 68 writer.write(lineSeparator); 69 writer.flush(); 70 charPos = 0; 71 } 72 catch (IOException e) { 73 throw new ConditionThrowable(new StreamError(e)); 74 74 } 75 75 return NIL; 76 76 } 77 77 78 public LispObject freshLine() throws StreamError78 public LispObject freshLine() throws ConditionThrowable 79 79 { 80 80 if (charPos == 0) … … 86 86 } 87 87 catch (IOException e) { 88 throw new StreamError(e);88 throw new ConditionThrowable(new StreamError(e)); 89 89 } 90 90 return T; 91 91 } 92 92 93 public void print(LispObject obj) throws StreamError93 public void print(LispObject obj) throws ConditionThrowable 94 94 { 95 95 try { … … 97 97 } 98 98 catch (IOException e) { 99 throw new StreamError(e);100 } 101 } 102 103 public void print(char c) throws StreamError99 throw new ConditionThrowable(new StreamError(e)); 100 } 101 } 102 103 public void print(char c) throws ConditionThrowable 104 104 { 105 105 try { … … 112 112 } 113 113 catch (IOException e) { 114 throw new StreamError(e);114 throw new ConditionThrowable(new StreamError(e)); 115 115 } 116 116 } … … 121 121 // good to people, while output from PRIN1 is intended to be acceptable to 122 122 // READ. 123 public void princ(LispObject obj) throws StreamError123 public void princ(LispObject obj) throws ConditionThrowable 124 124 { 125 125 LispThread thread = LispThread.currentThread(); … … 137 137 } 138 138 catch (IOException e) { 139 throw new StreamError(e);139 throw new ConditionThrowable(new StreamError(e)); 140 140 } 141 141 } … … 143 143 // PRIN1 produces output suitable for input to READ. 144 144 // Binds *PRINT-ESCAPE* to true. 145 public void prin1(LispObject obj) throws StreamError145 public void prin1(LispObject obj) throws ConditionThrowable 146 146 { 147 147 String s = String.valueOf(obj); … … 155 155 } 156 156 catch (IOException e) { 157 throw new StreamError(e);158 } 159 } 160 161 public void writeChar(char c) throws StreamError157 throw new ConditionThrowable(new StreamError(e)); 158 } 159 } 160 161 public void writeChar(char c) throws ConditionThrowable 162 162 { 163 163 try { … … 170 170 } 171 171 catch (IOException e) { 172 throw new StreamError(e);173 } 174 } 175 176 public void writeString(LispString string) throws StreamError172 throw new ConditionThrowable(new StreamError(e)); 173 } 174 } 175 176 public void writeString(LispString string) throws ConditionThrowable 177 177 { 178 178 writeString(string.getValue()); 179 179 } 180 180 181 public void writeString(String s) throws StreamError181 public void writeString(String s) throws ConditionThrowable 182 182 { 183 183 try { … … 190 190 } 191 191 catch (IOException e) { 192 throw new StreamError(e);193 } 194 } 195 196 public void writeLine(String s) throws StreamError197 { 198 try { 199 writer.write(s); 200 writer.write(lineSeparator); 201 writer.flush(); 202 charPos = 0; 203 } 204 catch (IOException e) { 205 throw new StreamError(e);206 } 207 } 208 209 public void printStackTrace(Throwable t) throws StreamError192 throw new ConditionThrowable(new StreamError(e)); 193 } 194 } 195 196 public void writeLine(String s) throws ConditionThrowable 197 { 198 try { 199 writer.write(s); 200 writer.write(lineSeparator); 201 writer.flush(); 202 charPos = 0; 203 } 204 catch (IOException e) { 205 throw new ConditionThrowable(new StreamError(e)); 206 } 207 } 208 209 public void printStackTrace(Throwable t) throws ConditionThrowable 210 210 { 211 211 StringWriter sw = new StringWriter(); … … 219 219 } 220 220 catch (IOException e) { 221 throw new StreamError(e);222 } 223 } 224 225 public void finishOutput() throws StreamError226 { 227 try { 228 writer.flush(); 229 } 230 catch (IOException e) { 231 throw new StreamError(e);221 throw new ConditionThrowable(new StreamError(e)); 222 } 223 } 224 225 public void finishOutput() throws ConditionThrowable 226 { 227 try { 228 writer.flush(); 229 } 230 catch (IOException e) { 231 throw new ConditionThrowable(new StreamError(e)); 232 232 } 233 233 } 234 234 235 235 // Returns true if stream was open, otherwise implementation-dependent. 236 public LispObject close(LispObject abort) throws StreamError236 public LispObject close(LispObject abort) throws ConditionThrowable 237 237 { 238 238 try { … … 241 241 } 242 242 catch (IOException e) { 243 throw new StreamError(e);243 throw new ConditionThrowable(new StreamError(e)); 244 244 } 245 245 } -
trunk/j/src/org/armedbear/lisp/Interpreter.java
r3883 r3887 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Interpreter.java,v 1.3 2 2003-09-19 01:46:40piso Exp $5 * $Id: Interpreter.java,v 1.33 2003-09-19 12:32:13 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 374 374 LispObject obj = stream.read(false, EOF, false); 375 375 if (obj == EOF) 376 throw new EndOfFileException();376 throw new ConditionThrowable(new EndOfFileException()); 377 377 eval(obj, new Environment(), LispThread.currentThread()); 378 378 getStandardOutput().freshLine(); … … 388 388 LispObject obj = stream.read(false, EOF, false); 389 389 if (obj == EOF) 390 throw new EndOfFileException();390 throw new ConditionThrowable(new EndOfFileException()); 391 391 eval(obj, new Environment(), LispThread.currentThread()); 392 392 return true; … … 531 531 LispObject obj = stream.read(false, EOF, false); 532 532 if (obj == EOF) 533 throw new EndOfFileException();533 throw new ConditionThrowable(new EndOfFileException()); 534 534 return eval(obj, new Environment(), LispThread.currentThread()); 535 535 } -
trunk/j/src/org/armedbear/lisp/LispStream.java
r3883 r3887 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: LispStream.java,v 1. 4 2003-09-19 01:46:41piso Exp $5 * $Id: LispStream.java,v 1.5 2003-09-19 12:32:13 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 31 31 } 32 32 33 public abstract LispObject close(LispObject abort) throws StreamError;33 public abstract LispObject close(LispObject abort) throws ConditionThrowable; 34 34 } -
trunk/j/src/org/armedbear/lisp/LispThread.java
r3884 r3887 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: LispThread.java,v 1.1 2 2003-09-19 11:50:18piso Exp $5 * $Id: LispThread.java,v 1.13 2003-09-19 12:32:13 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 257 257 258 258 private static void pprint(LispObject obj, int indentBy, 259 CharacterOutputStream stream) throws StreamError259 CharacterOutputStream stream) throws ConditionThrowable 260 260 { 261 261 if (stream.getCharPos() == 0) { -
trunk/j/src/org/armedbear/lisp/Primitives.java
r3886 r3887 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: Primitives.java,v 1.40 8 2003-09-19 12:20:34piso Exp $5 * $Id: Primitives.java,v 1.409 2003-09-19 12:32:13 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 1790 1790 { 1791 1791 if (type == Symbol.END_OF_FILE) 1792 return c instanceof EndOfFileException;1792 return c.getCondition() instanceof EndOfFileException; 1793 1793 if (type == Symbol.STREAM_ERROR) 1794 return c instanceof StreamError;1794 return c.getCondition() instanceof StreamError; 1795 1795 if (type == Symbol.UNDEFINED_FUNCTION) 1796 1796 return c.getCondition() instanceof UndefinedFunctionError; -
trunk/j/src/org/armedbear/lisp/StreamError.java
r1605 r3887 3 3 * 4 4 * Copyright (C) 2002-2003 Peter Graves 5 * $Id: StreamError.java,v 1. 3 2003-04-09 23:54:47piso Exp $5 * $Id: StreamError.java,v 1.4 2003-09-19 12:32:14 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 22 22 package org.armedbear.lisp; 23 23 24 public class StreamError extends LispError24 public class StreamError extends Condition 25 25 { 26 private String message; 26 27 private Throwable cause; 27 28 28 29 public StreamError() 29 30 { 30 super();31 31 } 32 32 33 33 public StreamError(String message) 34 34 { 35 super(message);35 this.message = message; 36 36 } 37 37 … … 40 40 super(); 41 41 this.cause = cause; 42 } 43 44 public LispObject typep(LispObject type) throws ConditionThrowable 45 { 46 if (type == Symbol.ERROR) 47 return T; 48 if (type == Symbol.STREAM_ERROR) 49 return T; 50 return super.typep(type); 42 51 } 43 52 -
trunk/j/src/org/armedbear/lisp/TwoWayStream.java
r3884 r3887 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: TwoWayStream.java,v 1. 4 2003-09-19 11:50:19piso Exp $5 * $Id: TwoWayStream.java,v 1.5 2003-09-19 12:32:14 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 55 55 } 56 56 57 public LispObject close(LispObject abort) throws StreamError57 public LispObject close(LispObject abort) throws ConditionThrowable 58 58 { 59 59 in.close(abort);
Note: See TracChangeset
for help on using the changeset viewer.