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