Advertisement
Guest User

Token.java

a guest
Jan 31st, 2018
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. public final class Token {
  2.  
  3.     public final String value;
  4.     public final TokenType type;
  5.    
  6.     public final int line, column;
  7.    
  8.     public Token(TokenType type, String value, int line, int column) {
  9.         this.value = value;
  10.         this.type = type;
  11.         this.line = line;
  12.         this.column = column;
  13.     }
  14.    
  15.     @Override
  16.     public String toString() {
  17.         return "(" + type.name().toLowerCase() + " - " + value + ")";
  18.     }
  19.    
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement