(TokenType type, String text)
| 97 | } |
| 98 | |
| 99 | protected Token newToken(TokenType type, String text) { |
| 100 | if (!type.isSkippable()) { |
| 101 | this.lastTokenType = type; |
| 102 | } |
| 103 | Token token = null; |
| 104 | |
| 105 | if (text == null) { |
| 106 | token = new Token(type, text, this.fileName, this.lineNumber, this.columnNumber); |
| 107 | } else { |
| 108 | token = new Token(type, text, this.fileName, this.lineNumber, this.columnNumber - text.length()); |
| 109 | } |
| 110 | |
| 111 | if ( type == LEFT_PAREN ) { |
| 112 | ++this.parens; |
| 113 | } else if ( type == RIGHT_PAREN ) { |
| 114 | --this.parens; |
| 115 | } |
| 116 | |
| 117 | return token; |
| 118 | } |
| 119 | |
| 120 | protected void incrementLine() { |
| 121 | ++this.lineNumber; |
no test coverage detected