InputState.java 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package de.jplag.text;
  2. import java.io.InputStream;
  3. import java.io.Reader;
  4. import antlr.InputBuffer;
  5. import antlr.LexerSharedInputState;
  6. /**
  7. * This object contains the data associated with an input stream of characters. Multiple lexers share a single
  8. * LexerSharedInputState to lex the same input stream.
  9. */
  10. public class InputState extends LexerSharedInputState {
  11. private int columnIndex = 1;
  12. private int tokenColumnIndex = 1;
  13. public InputState(InputBuffer inputBuffer) {
  14. super(inputBuffer);
  15. }
  16. public InputState(InputStream inputStream) {
  17. super(inputStream);
  18. }
  19. public InputState(Reader inputReader) {
  20. super(inputReader);
  21. }
  22. @Override
  23. public int getLine() {
  24. return line;
  25. }
  26. public int getColumnIndex() {
  27. return columnIndex;
  28. }
  29. public void setColumnIndex(int columnIndex) {
  30. this.columnIndex = columnIndex;
  31. }
  32. public int getTokenColumnIndex() {
  33. return tokenColumnIndex;
  34. }
  35. public void setTokenColumnIndex(int tokenColumnIndex) {
  36. this.tokenColumnIndex = tokenColumnIndex;
  37. }
  38. }