1 package persistence.antlr; 2 3 8 9 import java.io.Reader ; 10 import java.io.InputStream ; 11 12 17 public class LexerSharedInputState { 18 protected int column = 1; 19 protected int line = 1; 20 protected int tokenStartColumn = 1; 21 protected int tokenStartLine = 1; 22 protected InputBuffer input; 23 24 25 protected String filename; 26 27 public int guessing = 0; 28 29 public LexerSharedInputState(InputBuffer inbuf) { 30 input = inbuf; 31 } 32 33 public LexerSharedInputState(InputStream in) { 34 this(new ByteBuffer(in)); 35 } 36 37 public LexerSharedInputState(Reader in) { 38 this(new CharBuffer(in)); 39 } 40 41 public void reset() { 42 column = 1; 43 line = 1; 44 tokenStartColumn = 1; 45 tokenStartLine = 1; 46 guessing = 0; 47 filename = null; 48 input.reset(); 49 } 50 } 51 | Popular Tags |