sbin/res/jsdoc/app/lib/JSDOC/Walker.js
author hamidouk
Fri, 23 Dec 2011 11:38:47 +0100
branchjsdoc
changeset 520 fe008e95a716
permissions -rw-r--r--
added jsdoc support, and a script to generate the docs. Also added sample documentation for the IriSP.widget base class.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
520
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
     1
if (typeof JSDOC == "undefined") JSDOC = {};
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
     2
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
     3
/** @constructor */
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
     4
JSDOC.Walker = function(/**JSDOC.TokenStream*/ts) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
     5
	this.init();
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
     6
	if (typeof ts != "undefined") {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
     7
		this.walk(ts);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
     8
	}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
     9
}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    10
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    11
JSDOC.Walker.prototype.init = function() {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    12
	this.ts = null;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    13
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    14
	var globalSymbol = new JSDOC.Symbol("_global_", [], "GLOBAL", new JSDOC.DocComment(""));
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    15
	globalSymbol.isNamespace = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    16
	globalSymbol.srcFile = "";
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    17
	globalSymbol.isPrivate = false;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    18
	JSDOC.Parser.addSymbol(globalSymbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    19
	this.lastDoc = null;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    20
	this.token = null;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    21
	
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    22
	/**
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    23
		The chain of symbols under which we are currently nested.
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    24
		@type Array
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    25
	*/
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    26
	this.namescope = [globalSymbol];
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    27
	this.namescope.last = function(n){ if (!n) n = 0; return this[this.length-(1+n)] || "" };
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    28
}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    29
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    30
JSDOC.Walker.prototype.walk = function(/**JSDOC.TokenStream*/ts) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    31
	this.ts = ts;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    32
	while (this.token = this.ts.look()) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    33
		if (this.token.popNamescope) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    34
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    35
			var symbol = this.namescope.pop();
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    36
			if (symbol.is("FUNCTION")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    37
				if (this.ts.look(1).is("LEFT_PAREN") && symbol.comment.getTag("function").length == 0) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    38
					symbol.isa = "OBJECT";
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    39
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    40
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    41
		}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    42
		this.step();
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    43
		if (!this.ts.next()) break;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    44
	}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    45
}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    46
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    47
JSDOC.Walker.prototype.step = function() {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    48
	if (this.token.is("JSDOC")) { // it's a doc comment
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    49
	
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    50
		var doc = new JSDOC.DocComment(this.token.data);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    51
		
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    52
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    53
		if (doc.getTag("exports").length > 0) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    54
			var exports = doc.getTag("exports")[0];
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    55
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    56
			exports.desc.match(/(\S+) as (\S+)/i);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    57
			var n1 = RegExp.$1;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    58
			var n2 = RegExp.$2;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    59
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    60
			if (!n1 && n2) throw "@exports tag requires a value like: 'name as ns.name'";
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    61
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    62
			JSDOC.Parser.rename = (JSDOC.Parser.rename || {});	
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    63
			JSDOC.Parser.rename[n1] = n2
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    64
		}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    65
		
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    66
		if (doc.getTag("lends").length > 0) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    67
			var lends = doc.getTag("lends")[0];
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    68
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    69
			var name = lends.desc
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    70
			if (!name) throw "@lends tag requires a value.";
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    71
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    72
			var symbol = new JSDOC.Symbol(name, [], "OBJECT", doc);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    73
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    74
			this.namescope.push(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    75
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    76
			var matching = this.ts.getMatchingToken("LEFT_CURLY");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    77
			if (matching) matching.popNamescope = name;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    78
			else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    79
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    80
			this.lastDoc = null;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    81
			return true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    82
		}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    83
		else if (doc.getTag("name").length > 0 && doc.getTag("overview").length == 0) { // it's a virtual symbol
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    84
			var virtualName = doc.getTag("name")[0].desc;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    85
			if (!virtualName) throw "@name tag requires a value.";
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    86
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    87
			if (doc.getTag("memberOf").length > 0) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    88
				virtualName = (doc.getTag("memberOf")[0] + "." + virtualName)
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    89
					.replace(/([#.])\./, "$1");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    90
				doc.deleteTag("memberOf");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    91
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    92
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    93
			var symbol = new JSDOC.Symbol(virtualName, [], "VIRTUAL", doc);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    94
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    95
			JSDOC.Parser.addSymbol(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    96
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    97
			this.lastDoc = null;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    98
			return true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
    99
		}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   100
		else if (doc.meta) { // it's a meta doclet
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   101
			if (doc.meta == "@+") JSDOC.DocComment.shared = doc.src;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   102
			else if (doc.meta == "@-") JSDOC.DocComment.shared = "";
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   103
			else if (doc.meta == "nocode+") JSDOC.Parser.conf.ignoreCode = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   104
			else if (doc.meta == "nocode-") JSDOC.Parser.conf.ignoreCode = JSDOC.opt.n;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   105
			else throw "Unrecognized meta comment: "+doc.meta;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   106
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   107
			this.lastDoc = null;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   108
			return true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   109
		}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   110
		else if (doc.getTag("overview").length > 0) { // it's a file overview
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   111
			symbol = new JSDOC.Symbol("", [], "FILE", doc);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   112
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   113
			JSDOC.Parser.addSymbol(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   114
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   115
			this.lastDoc = null;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   116
			return true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   117
		}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   118
		else {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   119
			this.lastDoc = doc;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   120
			return false;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   121
		}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   122
	}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   123
	else if (!JSDOC.Parser.conf.ignoreCode) { // it's code
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   124
		if (this.token.is("NAME")) { // it's the name of something
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   125
			var symbol;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   126
			var name = this.token.data;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   127
			var doc = null; if (this.lastDoc) doc = this.lastDoc;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   128
			var params = [];
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   129
		
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   130
			// it's inside an anonymous object
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   131
			if (this.ts.look(1).is("COLON") && this.ts.look(-1).is("LEFT_CURLY") && !(this.ts.look(-2).is("JSDOC") || this.namescope.last().comment.getTag("lends").length || this.ts.look(-2).is("ASSIGN") || this.ts.look(-2).is("COLON"))) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   132
				name = "$anonymous";
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   133
				name = this.namescope.last().alias+"-"+name
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   134
					
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   135
				params = [];
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   136
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   137
				symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   138
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   139
				JSDOC.Parser.addSymbol(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   140
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   141
				this.namescope.push(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   142
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   143
				var matching = this.ts.getMatchingToken(null, "RIGHT_CURLY");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   144
				if (matching) matching.popNamescope = name;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   145
				else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   146
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   147
			// function foo() {}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   148
			else if (this.ts.look(-1).is("FUNCTION") && this.ts.look(1).is("LEFT_PAREN")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   149
				var isInner;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   150
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   151
				if (this.lastDoc) doc = this.lastDoc;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   152
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   153
				if (doc && doc.getTag("memberOf").length > 0) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   154
					name = (doc.getTag("memberOf")[0]+"."+name).replace("#.", "#");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   155
					doc.deleteTag("memberOf");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   156
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   157
				else {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   158
					name = this.namescope.last().alias+"-"+name;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   159
					if (!this.namescope.last().is("GLOBAL")) isInner = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   160
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   161
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   162
				if (!this.namescope.last().is("GLOBAL")) isInner = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   163
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   164
				params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   165
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   166
				symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   167
				if (isInner) symbol.isInner = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   168
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   169
				if (this.ts.look(1).is("JSDOC")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   170
					var inlineReturn = ""+this.ts.look(1).data;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   171
					inlineReturn = inlineReturn.replace(/(^\/\*\* *| *\*\/$)/g, "");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   172
					symbol.type = inlineReturn;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   173
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   174
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   175
				JSDOC.Parser.addSymbol(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   176
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   177
				this.namescope.push(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   178
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   179
				var matching = this.ts.getMatchingToken("LEFT_CURLY");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   180
				if (matching) matching.popNamescope = name;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   181
				else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   182
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   183
			// foo = function() {}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   184
			else if (this.ts.look(1).is("ASSIGN") && this.ts.look(2).is("FUNCTION")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   185
				var constructs;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   186
				var isConstructor = false;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   187
				if (doc && (constructs = doc.getTag("constructs")) && constructs.length) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   188
					if (constructs[0].desc) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   189
						name = constructs[0].desc;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   190
						isConstructor = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   191
					}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   192
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   193
					
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   194
				var isInner;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   195
				if (this.ts.look(-1).is("VAR") || this.isInner) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   196
					if (doc && doc.getTag("memberOf").length > 0) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   197
						name = (doc.getTag("memberOf")[0]+"."+name).replace("#.", "#");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   198
						doc.deleteTag("memberOf");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   199
					}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   200
					else {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   201
						name = this.namescope.last().alias+"-"+name;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   202
						if (!this.namescope.last().is("GLOBAL")) isInner = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   203
					}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   204
					if (!this.namescope.last().is("GLOBAL")) isInner = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   205
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   206
				else if (name.indexOf("this.") == 0) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   207
					name = this.resolveThis(name);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   208
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   209
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   210
				if (this.lastDoc) doc = this.lastDoc;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   211
				params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   212
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   213
				symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   214
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   215
				if (isInner) symbol.isInner = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   216
				if (isConstructor) symbol.isa = "CONSTRUCTOR";
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   217
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   218
				if (this.ts.look(1).is("JSDOC")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   219
					var inlineReturn = ""+this.ts.look(1).data;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   220
					inlineReturn = inlineReturn.replace(/(^\/\*\* *| *\*\/$)/g, "");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   221
					symbol.type = inlineReturn;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   222
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   223
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   224
				JSDOC.Parser.addSymbol(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   225
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   226
				this.namescope.push(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   227
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   228
				var matching = this.ts.getMatchingToken("LEFT_CURLY");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   229
				if (matching) matching.popNamescope = name;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   230
				else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   231
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   232
			// foo = new function() {} or foo = (function() {}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   233
			else if (this.ts.look(1).is("ASSIGN") && (this.ts.look(2).is("NEW") || this.ts.look(2).is("LEFT_PAREN")) && this.ts.look(3).is("FUNCTION")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   234
				var isInner;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   235
				if (this.ts.look(-1).is("VAR") || this.isInner) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   236
					name = this.namescope.last().alias+"-"+name
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   237
					if (!this.namescope.last().is("GLOBAL")) isInner = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   238
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   239
				else if (name.indexOf("this.") == 0) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   240
					name = this.resolveThis(name);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   241
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   242
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   243
				this.ts.next(3); // advance past the "new" or "("
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   244
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   245
				if (this.lastDoc) doc = this.lastDoc;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   246
				params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   247
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   248
				symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   249
				if (isInner) symbol.isInner = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   250
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   251
				if (this.ts.look(1).is("JSDOC")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   252
					var inlineReturn = ""+this.ts.look(1).data;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   253
					inlineReturn = inlineReturn.replace(/(^\/\*\* *| *\*\/$)/g, "");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   254
					symbol.type = inlineReturn;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   255
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   256
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   257
				JSDOC.Parser.addSymbol(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   258
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   259
				symbol.scopeType = "INSTANCE";
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   260
				this.namescope.push(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   261
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   262
				var matching = this.ts.getMatchingToken("LEFT_CURLY");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   263
				if (matching) matching.popNamescope = name;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   264
				else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   265
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   266
			// foo: function() {}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   267
			else if (this.ts.look(1).is("COLON") && this.ts.look(2).is("FUNCTION")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   268
				name = (this.namescope.last().alias+"."+name).replace("#.", "#");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   269
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   270
				if (this.lastDoc) doc = this.lastDoc;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   271
				params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   272
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   273
				if (doc && doc.getTag("constructs").length) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   274
					name = name.replace(/\.prototype(\.|$)/, "#");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   275
					
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   276
					if (name.indexOf("#") > -1) name = name.match(/(^[^#]+)/)[0];
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   277
					else name = this.namescope.last().alias;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   278
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   279
					symbol = new JSDOC.Symbol(name, params, "CONSTRUCTOR", doc);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   280
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   281
				else {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   282
					symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   283
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   284
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   285
				if (this.ts.look(1).is("JSDOC")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   286
					var inlineReturn = ""+this.ts.look(1).data;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   287
					inlineReturn = inlineReturn.replace(/(^\/\*\* *| *\*\/$)/g, "");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   288
					symbol.type = inlineReturn;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   289
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   290
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   291
				JSDOC.Parser.addSymbol(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   292
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   293
				this.namescope.push(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   294
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   295
				var matching = this.ts.getMatchingToken("LEFT_CURLY");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   296
				if (matching) matching.popNamescope = name;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   297
				else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   298
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   299
			// foo = {}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   300
			else if (this.ts.look(1).is("ASSIGN") && this.ts.look(2).is("LEFT_CURLY")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   301
				var isInner;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   302
				if (this.ts.look(-1).is("VAR") || this.isInner) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   303
					name = this.namescope.last().alias+"-"+name
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   304
					if (!this.namescope.last().is("GLOBAL")) isInner = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   305
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   306
				else if (name.indexOf("this.") == 0) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   307
					name = this.resolveThis(name);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   308
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   309
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   310
				if (this.lastDoc) doc = this.lastDoc;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   311
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   312
				symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   313
				if (isInner) symbol.isInner = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   314
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   315
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   316
				if (doc) JSDOC.Parser.addSymbol(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   317
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   318
				this.namescope.push(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   319
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   320
				var matching = this.ts.getMatchingToken("LEFT_CURLY");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   321
				if (matching) matching.popNamescope = name;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   322
				else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   323
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   324
			// var foo;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   325
			else if (this.ts.look(1).is("SEMICOLON")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   326
				var isInner;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   327
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   328
				if (this.ts.look(-1).is("VAR") || this.isInner) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   329
					name = this.namescope.last().alias+"-"+name
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   330
					if (!this.namescope.last().is("GLOBAL")) isInner = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   331
					
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   332
					if (this.lastDoc) doc = this.lastDoc;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   333
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   334
					symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   335
					if (isInner) symbol.isInner = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   336
					
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   337
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   338
					if (doc) JSDOC.Parser.addSymbol(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   339
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   340
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   341
			// foo = x
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   342
			else if (this.ts.look(1).is("ASSIGN")) {				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   343
				var isInner;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   344
				if (this.ts.look(-1).is("VAR") || this.isInner) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   345
					name = this.namescope.last().alias+"-"+name
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   346
					if (!this.namescope.last().is("GLOBAL")) isInner = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   347
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   348
				else if (name.indexOf("this.") == 0) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   349
					name = this.resolveThis(name);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   350
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   351
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   352
				if (this.lastDoc) doc = this.lastDoc;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   353
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   354
				symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   355
				if (isInner) symbol.isInner = true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   356
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   357
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   358
				if (doc) JSDOC.Parser.addSymbol(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   359
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   360
			// foo: {}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   361
			else if (this.ts.look(1).is("COLON") && this.ts.look(2).is("LEFT_CURLY")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   362
				name = (this.namescope.last().alias+"."+name).replace("#.", "#");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   363
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   364
				if (this.lastDoc) doc = this.lastDoc;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   365
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   366
				symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   367
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   368
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   369
				if (doc) JSDOC.Parser.addSymbol(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   370
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   371
				this.namescope.push(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   372
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   373
				var matching = this.ts.getMatchingToken("LEFT_CURLY");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   374
				if (matching) matching.popNamescope = name;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   375
				else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   376
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   377
			// foo: x
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   378
			else if (this.ts.look(1).is("COLON")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   379
				name = (this.namescope.last().alias+"."+name).replace("#.", "#");;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   380
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   381
				if (this.lastDoc) doc = this.lastDoc;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   382
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   383
				symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   384
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   385
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   386
				if (doc) JSDOC.Parser.addSymbol(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   387
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   388
			// foo(...)
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   389
			else if (this.ts.look(1).is("LEFT_PAREN")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   390
				if (typeof JSDOC.PluginManager != "undefined") {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   391
					var functionCall = {name: name};
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   392
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   393
					var cursor = this.ts.cursor;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   394
					params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   395
					this.ts.cursor = cursor;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   396
					
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   397
					for (var i = 0; i < params.length; i++)
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   398
						functionCall["arg" + (i + 1)] = params[i].name;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   399
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   400
					JSDOC.PluginManager.run("onFunctionCall", functionCall);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   401
					if (functionCall.doc) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   402
						this.ts.insertAhead(new JSDOC.Token(functionCall.doc, "COMM", "JSDOC"));
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   403
					}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   404
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   405
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   406
			this.lastDoc = null;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   407
		}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   408
		else if (this.token.is("FUNCTION")) { // it's an anonymous function
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   409
			if (
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   410
				(!this.ts.look(-1).is("COLON") || !this.ts.look(-1).is("ASSIGN"))
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   411
				&& !this.ts.look(1).is("NAME")
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   412
			) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   413
				if (this.lastDoc) doc = this.lastDoc;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   414
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   415
				name = "$anonymous";
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   416
				name = this.namescope.last().alias+"-"+name
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   417
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   418
				params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   419
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   420
				symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   421
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   422
				JSDOC.Parser.addSymbol(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   423
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   424
				this.namescope.push(symbol);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   425
				
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   426
				var matching = this.ts.getMatchingToken("LEFT_CURLY");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   427
				if (matching) matching.popNamescope = name;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   428
				else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   429
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   430
		}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   431
	}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   432
	return true;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   433
}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   434
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   435
/**
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   436
	Resolves what "this." means when it appears in a name.
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   437
	@param name The name that starts with "this.".
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   438
	@returns The name with "this." resolved.
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   439
 */
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   440
JSDOC.Walker.prototype.resolveThis = function(name) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   441
	name.match(/^this\.(.+)$/)
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   442
	var nameFragment = RegExp.$1;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   443
	if (!nameFragment) return name;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   444
	
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   445
	var symbol = this.namescope.last();
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   446
	var scopeType = symbol.scopeType || symbol.isa;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   447
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   448
	// if we are in a constructor function, `this` means the instance
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   449
	if (scopeType == "CONSTRUCTOR") {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   450
		name = symbol.alias+"#"+nameFragment;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   451
	}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   452
	
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   453
	// if we are in an anonymous constructor function, `this` means the instance
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   454
	else if (scopeType == "INSTANCE") {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   455
		name = symbol.alias+"."+nameFragment;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   456
	}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   457
	
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   458
	// if we are in a function, `this` means the container (possibly the global)
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   459
	else if (scopeType == "FUNCTION") {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   460
		// in a method of a prototype, so `this` means the constructor
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   461
		if (symbol.alias.match(/(^.*)[#.-][^#.-]+/)) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   462
			var parentName = RegExp.$1;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   463
			var parent = JSDOC.Parser.symbols.getSymbol(parentName);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   464
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   465
			if (!parent) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   466
				if (JSDOC.Lang.isBuiltin(parentName)) parent = JSDOC.Parser.addBuiltin(parentName);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   467
				else {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   468
					if (symbol.alias.indexOf("$anonymous") < 0) // these will be ignored eventually
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   469
						LOG.warn("Trying to document "+symbol.alias+" without first documenting "+parentName+".");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   470
				}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   471
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   472
			if (parent) name = parentName+(parent.is("CONSTRUCTOR")?"#":".")+nameFragment;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   473
		}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   474
		else {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   475
			parent = this.namescope.last(1);
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   476
			name = parent.alias+(parent.is("CONSTRUCTOR")?"#":".")+nameFragment;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   477
		}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   478
	}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   479
	// otherwise it means the global
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   480
	else {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   481
		name = nameFragment;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   482
	}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   483
	
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   484
	return name;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   485
}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   486
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   487
JSDOC.Walker.onParamList = function(/**Array*/paramTokens) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   488
	if (!paramTokens) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   489
		LOG.warn("Malformed parameter list. Can't parse code.");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   490
		return [];
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   491
	}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   492
	var params = [];
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   493
	for (var i = 0, l = paramTokens.length; i < l; i++) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   494
		if (paramTokens[i].is("JSDOC")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   495
			var paramType = paramTokens[i].data.replace(/(^\/\*\* *| *\*\/$)/g, "");
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   496
			
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   497
			if (paramTokens[i+1] && paramTokens[i+1].is("NAME")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   498
				i++;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   499
				params.push({type: paramType, name: paramTokens[i].data});
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   500
			}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   501
		}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   502
		else if (paramTokens[i].is("NAME")) {
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   503
			params.push({name: paramTokens[i].data});
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   504
		}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   505
	}
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   506
	return params;
fe008e95a716 added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff changeset
   507
}