Browse Source

Allow token types to be accessed via a getter.

Timur Sağlam 4 years ago
parent
commit
75ad3d916d
1 changed files with 7 additions and 0 deletions
  1. 7 0
      jplag.frontend-utils/src/main/java/de/jplag/Token.java

+ 7 - 0
jplag.frontend-utils/src/main/java/de/jplag/Token.java

@@ -79,6 +79,13 @@ public abstract class Token {
         return line;
     }
 
+    /**
+     * @return the type identifier of the token.
+     */
+    public int getType() {
+        return type;
+    }
+
     /**
      * Sets the character index which denotes where the code sections represented by this token starts in the line.
      * @param column is the index in characters to set.