InputState.java 774 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package jplag;
  2. import java.io.InputStream;
  3. import java.io.Reader;
  4. import antlr.InputBuffer;
  5. import antlr.LexerSharedInputState;
  6. /** This object contains the data associated with an
  7. * input stream of characters. Multiple lexers
  8. * share a single LexerSharedInputState to lex
  9. * the same input stream.
  10. */
  11. public class InputState extends LexerSharedInputState {
  12. public int column = 0;
  13. public int tokColumn = 0;
  14. // public int guessing = 0;
  15. public InputState(InputBuffer inbuf) {
  16. super(inbuf);
  17. column = 1;
  18. line = 1;
  19. }
  20. public InputState(InputStream in) {
  21. super(in);
  22. column = 1;
  23. line = 1;
  24. }
  25. public InputState(Reader in) {
  26. super(in);
  27. column = 1;
  28. line = 1;
  29. }
  30. @Override
  31. public int getLine() { return line; }
  32. }