function Token(text, type) { this.text = text; this.type = type; } Token.prototype.getText = function () { return this.text; }; Token.prototype.getType = function () { return this.type; }; Token.prototype.toString = function () { return this.type + " " + this.text; };