1 //<Script type="text/javascript">
3 imports['Object.js'].load(Object);
4 JSDOC = imports['JSDOC.js'].JSDOC;
5 console = imports['console.js'].console;
9 * @prop data {String} raw value of token
10 * @prop type {String} type of token
11 * TOKN (unknown) - name is UNKNOWN_TOKEN
12 * KEYW (keyword) - name is upper case version of keyword
13 * NAME (name/identifier) - name is NAME
14 * COMM (comment) - name is MULTI_LINE_COMM, JSDOC, SINGLE_LINE_COMM
15 * PUNC (puctuation) - name is String description of punctionan (eg LEFTPARAM)
16 * WHIT (white space) - name is SPACE,NEWLINE
17 * STRN (string) - name is DOBULE_QUOTE, SINGLE_QUOTE
18 * NUMB (number) - name is OCTAL,DECIMAL,HEC_DEC
19 * REGX (reg.expression) - name is REGX
20 * @prop name {String} see type details above
21 * @prop indentifier {Identifier} identifier class if relivant
25 Token = Object.define(
26 function(data, type, name) {
31 this.outData = false; // used by packer/scopeparser
32 this.identifier = false; // used by scope
38 return 'type:' + this.type+ ', name:' + this.name + ', data:' + this.data;
49 Roo.each(this.items, function(ai) {
52 Roo.each(ai, function(it) {
53 str += it.toRaw(lvl + 1);
62 for (var i in this.props) {
63 ret += this.props[i].key.toRaw(lvl+1) + ' : ';
64 Roo.each(this.props[i].val, function(e) {
73 return this.prefix + ret;
81 eval( "_tmp = " + this.data);
84 return "ERROR unparsable" + this.data;
91 return this.name === what || this.type === what;