LanguageWithDelimitedMethods.java 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package jplag.java15;
  2. import java.io.File;
  3. import jplag.ProgramI;
  4. /**
  5. * Java 1.5 parser with method separators; if you know why these separators
  6. * exist, PLEASE tell us or document at
  7. * https://svn.ipd.kit.edu/trac/jplag/wiki/Server/Frontends/Java-1.5)
  8. */
  9. public class LanguageWithDelimitedMethods implements jplag.Language {
  10. private Parser parser;
  11. public LanguageWithDelimitedMethods(ProgramI program) {
  12. this.parser = new Parser(true);
  13. this.parser.setProgram(program);
  14. }
  15. public int errorsCount() {
  16. return this.parser.errorsCount();
  17. }
  18. public String[] suffixes() {
  19. String[] res = { ".java", ".jav", ".JAVA", ".JAV" };
  20. return res;
  21. }
  22. public String name() {
  23. return "Java1.5 Parser with delimited methods";
  24. }
  25. public String getShortName() {
  26. return "java15dm";
  27. }
  28. public int min_token_match() {
  29. return 8;
  30. }
  31. public jplag.Structure parse(File dir, String[] files) {
  32. return this.parser.parse(dir, files);
  33. }
  34. public boolean errors() {
  35. return this.parser.getErrors();
  36. }
  37. public boolean supportsColumns() {
  38. return true;
  39. }
  40. public boolean isPreformated() {
  41. return true;
  42. }
  43. public boolean usesIndex() {
  44. return false;
  45. }
  46. public int noOfTokens() {
  47. return jplag.java15.JavaToken.numberOfTokens();
  48. }
  49. public String type2string(int type) {
  50. return jplag.java15.JavaToken.type2string(type);
  51. }
  52. }