1 /** 2 * @fileoverview Class represents a generic token for tags of 3 * any kind. 4 */ 5 6 goog.provide('xrx.token.Tag'); 7 8 9 10 goog.require('xrx.token'); 11 12 /** 13 * Constructs a new tag token. The tag token is a generic 14 * container token for all kinds of native tag tokens as 15 * well as all generic tag tokens. 16 * 17 * @constructor 18 * @extends xrx.token 19 */ 20 xrx.token.Tag = function(label) { 21 goog.base(this, xrx.token.TAG, label); 22 }; 23 goog.inherits(xrx.token.Tag, xrx.token); 24 25 26 27 /** 28 * Compares the generic type of two tokens. 29 * 30 * @param {!number} type The type to check against. 31 * @return {!boolean} 32 */ 33 xrx.token.Tag.prototype.typeOf = function(type) { 34 return this.type_ === type || xrx.token.START_TAG === type 35 || xrx.token.END_TAG === type || xrx.token.EMPTY_TAG === type || 36 xrx.token.START_EMPTY_TAG === type; 37 };