CharToken.java 674 B

1234567891011121314151617181920212223242526272829303132
  1. package jplag.chars;
  2. public class CharToken extends jplag.Token {
  3. private static final long serialVersionUID = 1L;
  4. private int index;
  5. public CharToken(int type, String file, int index, Parser parser) {
  6. super(type, file, -1);
  7. this.index = index;
  8. }
  9. public CharToken(int type, String file, Parser parser) {
  10. this(type, file, -1, parser);
  11. }
  12. @Override
  13. public int getLine() {
  14. return index; // so that the result-index is sorted correctly
  15. }
  16. @Override
  17. public int getColumn() { return 0; }
  18. @Override
  19. public int getLength() { return 0; }
  20. @Override
  21. public int getIndex() { return index; }
  22. public static int numberOfTokens() { return 36; }
  23. }