home *** CD-ROM | disk | FTP | other *** search
- package com.ms.xml.parser;
-
- import java.io.IOException;
- import java.io.InputStream;
-
- class EntityReader {
- int line;
- int column;
- EntityReader prev;
- Object owner;
- int[] next = new int[3];
- int pos;
- InputStream input;
-
- EntityReader(InputStream var1, int var2, int var3, EntityReader var4, Object var5) {
- this.line = var2;
- this.column = var3;
- this.prev = var4;
- this.owner = var5;
- this.pos = -1;
- this.input = var1;
- }
-
- public int read() throws ParseException {
- int var1 = this.readChar();
- if (var1 != 13 && var1 != 10) {
- ++this.column;
- } else {
- if (var1 == 13) {
- int var2 = this.readChar();
- if (var2 != 10) {
- this.push((char)var2);
- }
-
- var1 = 10;
- }
-
- ++this.line;
- this.column = 1;
- }
-
- return var1;
- }
-
- void push(char var1) throws ParseException {
- if (this.pos == 1) {
- throw new ParseException("Error unreading '" + var1 + "' at (" + this.line + "," + this.column + ") : ", this.line, this.column, this.owner);
- } else {
- this.next[++this.pos] = var1;
- }
- }
-
- int readChar() throws ParseException {
- int var1;
- if (this.pos >= 0) {
- int[] var10000 = this.next;
- int var10003 = this.pos;
- this.pos = var10003 + -1;
- var1 = var10000[var10003];
- } else {
- try {
- var1 = this.input.read();
- } catch (IOException var4) {
- String var3 = this.owner.toString();
- var1 = -1;
- throw new ParseException("Error reading " + var3 + " at (" + this.line + "," + this.column + ") : " + var4, this.line, this.column, this.owner);
- }
- }
-
- return var1;
- }
- }
-