Only in .: AllNames.html Binary files ./Arith.class and /home/keller/pub/polya/Arith.class differ Binary files ./EOF.class and /home/keller/pub/polya/EOF.class differ Binary files ./Function1.class and /home/keller/pub/polya/Function1.class differ Binary files ./Growable.class and /home/keller/pub/polya/Growable.class differ Binary files ./Incremental.class and /home/keller/pub/polya/Incremental.class differ Binary files ./Polylist.class and /home/keller/pub/polya/Polylist.class differ diff ./Polylist.java /home/keller/pub/polya/Polylist.java 98,111d97 < * setFirst() sets the first of a list to an object < * @exception NullPointerException Can't take first of an empty Polylist. < * < **/ < < public void setFirst(Object ob) < { < ptr.setFirst(ob); < } < < < < < /** 818c804 < public static Polylist PolylistFromArray(Object[] array) --- > public static Polylist PolylistFromArray(Object array[]) Binary files ./PolylistEnum.class and /home/keller/pub/polya/PolylistEnum.class differ Binary files ./Seed.class and /home/keller/pub/polya/Seed.class differ Binary files ./Tokenizer.class and /home/keller/pub/polya/Tokenizer.class differ diff ./Tokenizer.java /home/keller/pub/polya/Tokenizer.java 36,41c36 < this(new InputStreamReader(I)); < } < < public Tokenizer(Reader R) < { < super(new BufferedReader(R)); // initialize --- > super(I); // initialize 44,46c39,45 < slashSlashComments(true); < slashStarComments(true); < eolIsSignificant(false); --- > wordChars(33, 255); > whitespaceChars(0, ' '); > ordinaryChar( '(' ); // mark as special > ordinaryChar( ')' ); > ordinaryChar( '[' ); > ordinaryChar( ',' ); > ordinaryChar( ']' ); 75c74,78 < boolean isWhiteSpace(int c) --- > /** > * get token, indicating TT_LONG, TT_NUMBER, TT_WORD, TT_EOL, or TT_EOF > **/ > > public int nextToken() 77c80,81 < switch( c ) --- > int token; > try 79,83c83 < case ' ': case '\t': case '\n': case '\r': case '\f': < return true; < < default: < return false; --- > token = super.nextToken(); 84a85,150 > catch( IOException e ) > { > exceptionHandler(e); > return TT_EOF; > } > > switch( token ) // get token using parent method > { > case TT_EOF: > return ttype; > > case TT_WORD: // analyze string token > if( sval.equals("-") ) > { > // special case: treat as word; otherwise would be treated as long 0 > break; > } > try // try token as a long (TT_LONG) > { > Long as_long = new Long(sval); > lval = as_long.longValue(); > nval = as_long.doubleValue(); > ttype = TT_LONG; > } > catch( NumberFormatException e ) > { // exception converting to long > try // try token as double (TT_NUMBER) > { > Double as_double = new Double(sval); > nval = as_double.doubleValue(); > ttype = TT_NUMBER; > } > catch( NumberFormatException f ) // exception converting to double > { // default to word (TT_WORD) > // ttype = TT_WORD; // already set > } > } > break; > > default: // something else, pass it on > break; > } > return ttype; > } > > /** > * nextFullToken is like nextToken but ignores ends of line > **/ > > public int nextFullToken() > { > boolean needToken = true; > while( needToken ) > switch( nextToken() ) > { > case TT_EOF: > return TT_EOF; > > case TT_EOL: > continue; > > default: // something else, pass it on > needToken = false; > break; > } > return ttype; 87,88d152 < // hand-implemented get/putBack system, since the one in StreamTokenizer < // doesn't work 90,91c154,156 < int buff; < boolean valid = false; --- > /** > * get next token and try to interpret as double > **/ 93c158 < void get() --- > public double nextDouble() 95,100d159 < if( valid ) < { < valid = false; < ttype = buff; < return; < } 103c162,173 < super.nextToken(); --- > switch( nextFullToken() ) > { > case TT_EOF: > throw new eofException(); > > case TT_NUMBER: > case TT_LONG: > return nval; > > default: > throw new NumberFormatException("Double requested"); > } 105c175 < catch( IOException e ) --- > catch( Exception e ) 108d177 < ttype = TT_EOF; 109a179 > return 0; 113c183,187 < void putBack(int c) --- > /** > * get next token and try to interpret as long > **/ > > public long nextLong() 115,116c189,207 < valid = true; < buff = c; --- > try > { > switch( nextFullToken() ) > { > case TT_EOF: > throw new eofException(); > > case TT_LONG: > return lval; > > default: > throw new NumberFormatException("Long requested"); > } > } > catch( Exception e ) > { > exceptionHandler(e); > } > return 0; 119c210,214 < public void getSkippingWhiteSpace() --- > /** > * get next token and interpret as string > **/ > > public String nextString() 121,122c216 < get(); < while( isWhiteSpace(ttype) ) --- > try 124c218,225 < get(); --- > switch( nextFullToken() ) > { > case TT_EOF: > throw new eofException(); > > default: > return sval; > } 125a227,231 > catch( Exception e ) > { > exceptionHandler(e); > } > return ""; 128d233 < 130c235 < * get token, indicating TT_LONG, TT_NUMBER, TT_WORD, or TT_EOF --- > * get next token and try to interpret as an atom 133c238 < public int nextToken() --- > public Object nextAtom() 135,136c240 < getSkippingWhiteSpace(); < switch( ttype ) // parens by themselves are tokens --- > try 138,139c242,255 < case '(': case ')': case TT_EOF: < return ttype; --- > switch( nextFullToken() ) > { > case TT_EOF: > return eof; > > case TT_LONG: > return new Long(lval); > > case TT_NUMBER: > return new Double(nval); > > default: > return new String(sval); > } 140a257,262 > catch( Exception e ) > { > exceptionHandler(e); > } > return eof; > } 142d263 < StringBuffer buff = new StringBuffer(); 144c265,267 < buff.append((char)ttype); --- > /** > * get next R expression from input stream > **/ 146,148c269,271 < get(); < out: < while( ttype != TT_EOF && !isWhiteSpace(ttype) ) --- > public Object nextRexp() > { > try 150c273,275 < switch( ttype ) --- > int c = nextFullToken(); > > switch( c ) 152,153c277,278 < case '(': case ')': < break out; --- > case TT_EOF: > return eof; 154a280,306 > case '[': > { > return getRestRexp(); > } > > case ']': > { > return Polylist.nil; > } > > case ',': > { > return Polylist.nil; > } > > case '(': > return new Character('('); > > case ')': > return new Character(')'); > > case TT_LONG: > return new Long(lval); > > case TT_NUMBER: > return new Double(nval); > 156c308 < buff.append((char)ttype); --- > return new String(sval); 158d309 < get(); 160c311,316 < putBack(ttype); --- > catch( Exception e ) > { > exceptionHandler(e); > } > return eof; > } 162,164c318 < sval = buff.toString(); < < try // try token as a long (TT_LONG) --- > Polylist getRestRexp() 166,173c320 < Long as_long = new Long(sval); < lval = as_long.longValue(); < ttype = TT_LONG; < return ttype; < } < catch( NumberFormatException e ) < { // exception converting to long < try // try token as double (TT_NUMBER) --- > try 175,178c322,354 < Double as_double = new Double(sval); < nval = as_double.doubleValue(); < ttype = TT_NUMBER; < return ttype; --- > int c = nextFullToken(); > > switch( c ) > { > case TT_EOF: > throw new eofException(); > > case ']': > return Polylist.nil; > > case '[': > { > return Polylist.cons(getRestRexp(), getRestRexp()); > } > > case ',': > return getRestRexp(); // ignore ',' > > case '(': > return Polylist.cons(new Character('('), getRestRexp()); > > case ')': > return Polylist.cons(new Character(')'), getRestRexp()); > > case TT_LONG: > return Polylist.cons(new Long(lval), getRestRexp()); > > case TT_NUMBER: > return Polylist.cons(new Double(nval), getRestRexp()); > > default: > return Polylist.cons(new String(sval), getRestRexp()); > } 180,183c356,358 < catch( NumberFormatException f ) // exception converting to double < { // default to word (TT_WORD) < ttype = TT_WORD; < return ttype; --- > catch( Exception e ) > { > return Polylist.nil; 186d360 < } 198c372 < int c = nextToken(); --- > int c = nextFullToken(); 204c378 < case ')': --- > case '(': 206c380 < return Polylist.nil; --- > return getRestSexp(); 209c383 < case '(': --- > case ')': 211c385 < return getRestSexp(); --- > return Polylist.nil; 213a388,396 > case '[': > return new Character('['); > > case ']': > return new Character(']'); > > case ',': > return new Character(','); > 235c418 < int c = nextToken(); --- > int c = nextFullToken(); 240c423 < return Polylist.nil; --- > throw new eofException(); 249a433,441 > case '[': > return Polylist.cons(new Character('['), getRestSexp()); > > case ']': > return Polylist.cons(new Character(']'), getRestSexp()); > > case ',': > return Polylist.cons(new Character(','), getRestSexp()); > 275c467 < static public void main(String[] args) --- > static public void main(String args[]) Only in .: diffs Only in /home/keller/pub/polya: doc Binary files ./eofException.class and /home/keller/pub/polya/eofException.class differ Only in /home/keller/pub/polya: index.html Only in /home/keller/pub/polya: index.html~ Only in /home/keller/pub/polya: package-list Only in .: packages.html Only in .: polya.Arith.html Only in .: polya.EOF.html Only in .: polya.Function1.html Only in .: polya.Growable.html Only in .: polya.Incremental.html Only in .: polya.Polylist.html Only in .: polya.PolylistEnum.html Only in .: polya.Seed.html Only in .: polya.Tokenizer.html Only in .: polya.eofException.html Only in .: polya.polycell.html Only in /home/keller/pub/polya: polya.tar.gz Binary files ./polycell.class and /home/keller/pub/polya/polycell.class differ Only in /home/keller/pub/polya: stylesheet.css Only in .: tree.html