private function addToken($type, $text) { $this->output[] = $token = new Token(); $token->type = $type; $token->text = $text; $token->line = $this->getLine() - substr_count(ltrim($text), "\n"); return $token; }