InputState.java 908 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. @SuppressWarnings({"java:S1104", "java:S2387"})
  11. public class InputState extends LexerSharedInputState {
  12. public int column = 0;
  13. public int tokenColumn = 0;
  14. public InputState(InputBuffer inputBuffer) {
  15. super(inputBuffer);
  16. column = 1;
  17. line = 1;
  18. }
  19. public InputState(InputStream inputStream) {
  20. super(inputStream);
  21. column = 1;
  22. line = 1;
  23. }
  24. public InputState(Reader inputReader) {
  25. super(inputReader);
  26. column = 1;
  27. line = 1;
  28. }
  29. @Override
  30. public int getLine() {
  31. return line;
  32. }
  33. }