1 // this walks through the code, and tries to find patterns that match documentable elements..
11 public class Walker : Object
14 Gee.ArrayList<string> warnings;
15 Gee.ArrayList<Scope> scopes;
16 Gee.HashMap<int,Scope> indexedScopes;
17 Gee.HashMap<string,Symbol> symbols;
18 Gee.HashMap<string,string> aliases;
22 WalkerMode mode = WalkerMode.XXX; //"BUILDING_SYMBOL_TREE",
25 DocComment? currentDoc = null;
29 public Walker(TokenStream ts)
32 this.warnings= new Gee.ArrayList<string>();
33 this.scopes = new Gee.ArrayList<Scope>();
34 this.indexedScopes = new Gee.HashMap<int,Scope>();
35 this.symbols = new Gee.HashMap<string,Symbol>();
36 this.aliases = new Gee.HashMap<string,string>();
37 this.braceNesting = 0;
41 //this.warnings.push(s);
42 // print("WARNING:" + htmlescape(s) + "<BR>");
44 // defaults should not be initialized here =- otherwise they get duped on new, rather than initalized..
51 public void buildSymbolTree()
56 this.braceNesting = 0;
57 this.scopes = new Gee.ArrayList<Scope>();;
58 this.aliases = new Gee.HashMap<string,string>();
60 this.globalScope = new Scope(-1, null, -1, "$global$", null);
61 this.indexedScopes = new Gee.HashMap<int,Scope>();
62 this.indexedScopes.set( 0, this.globalScope );
64 this.mode = WalkerMode.BUILDING_SYMBOL_TREE;
65 this.parseScope(this.globalScope,this.emptyAlias());
68 Gee.HashMap<string,string> emptyAlias()
70 return new Gee.HashMap<string,string> ();
75 string fixAlias (Gee.HashMap<string,string>aliases, string str, bool nomore = false)
77 var ar = str.split(".");
80 //print(str +"?=" +aliases.toSource());
81 if (!aliases.has_key(m)) {
84 ar[0] = aliases.get(m);
86 var ret = string.joinv(".", ar);
88 ret = this.fixAlias(aliases, ret, true);
97 void parseScope (Scope in_scope, Gee.HashMap<string,string> ealiases) // parse a token stream..
99 //this.timerPrint("parseScope EnterScope");
101 var scope = in_scope;
103 var aliases = new Gee.HashMap<string,string>();
105 foreach(var i in ealiases.keys) {
106 aliases.set(i, ealiases.get(i));
109 //print("STARTING SCOPE WITH: " + ealiases.toSource());
111 var expressionBraceNesting = this.braceNesting;
112 var bracketNesting = 0;
113 var parensNesting = 0;
116 var l1 = "", l2 = "";
120 var locBraceNest = 0;
121 // determines if we are in object literals...
123 var isObjectLitAr = new Gee.ArrayList<bool>();
124 isObjectLitAr.add(false);
125 //print("SCOPE: ------------------START ----------------");
127 this.scopesIn(scope);
128 var scopeLen = this.scopes.size;
130 if (this.ts.cursor < 1) {
131 // this.ts.cursor--; // hopeflly this kludge will work
135 //print(JSON.stringify(this.ts, null, 4)); Seed.quit();
137 while (null != ( token = this.ts.next())) {
138 //GLib.debug("TOK %s", token.asString());
139 // this.timerPrint("parseScope AFTER lookT: " + token.toString());
141 if (token.isType(TokenType.COMM)) {
144 if (!token.isName(TokenName.JSDOC)) {
145 //print("Walker2 : spce is not JSDOC");
148 if (this.currentDoc != null) {
149 // add it to the current scope????
151 this.addSymbol("", true);
152 GLib.debug("Call addSymbol EMPTY");
153 //print ( "Unconsumed Doc: " + token.toString())
154 //throw "Unconsumed Doc (TOKwhitespace): " + this.currentDoc.toSource();
157 // print ( "NEW COMMENT: " + token.toString())
158 var newDoc = new DocComment(token.data);
160 // it"s a scope changer..
162 if (newDoc.getTag(DocTagTitle.SCOPE).size > 0) {
163 //print("Walker2 : doctag changes scope");
165 scope.ident = "$private$|" + newDoc.getTag(DocTagTitle.SCOPE).get(0).desc;
169 // it"s a scope changer..
170 if (newDoc.getTag(DocTagTitle.SCOPEALIAS).size > 0) {
171 //print(newDoc.getTag("scopeAlias").toSource());
173 //print("Walker2 : doctag changes scope (alias)");
174 var sal = newDoc.getTag(DocTagTitle.SCOPEALIAS).get(0).desc.split("=");
175 aliases[sal[0].strip()] = sal[1].strip();
181 /// got a doc comment..
182 //token.data might be this.??? (not sure though)
183 //print("Walker2 : setting currentDoc");
184 this.currentDoc = newDoc;
188 // catch the various issues .. - scoe changes or doc actions..
192 // things that stop comments carrying on...??
194 if (this.currentDoc != null && (
196 token.data == "}")) {
198 GLib.debug("Call addSymbol EMPTY");
199 this.addSymbol("", true);
201 //throw "Unconsumed Doc ("+ token.toString() +"): " + this.currentDoc.toSource();
205 // the rest are scoping issues...
209 if (token.isName(TokenName.VAR) &&
211 this.ts.lookTok(1).isType(TokenType.NAME) &&
212 this.ts.lookTok(2).data == "=" &&
213 this.ts.lookTok(3).isType(TokenType.NAME) &&
214 this.ts.lookTok(4).data == ";"
218 //print("SET ALIAS:" + this.ts.lookTok(1).data +"=" + this.ts.lookTok(3).data);
220 aliases.set(this.ts.lookTok(1).data, this.ts.lookTok(3).data);
224 if ((token.data == "eval") || /\.eval$/.match(token.data)) {
225 this.currentDoc = null;
229 // extends scoping *** not sure if the can be x = Roo.apply(....)
230 // xxx.extends(a,b, {
231 // $this$=b|b.prototype
236 if (token.isType(TokenType.NAME) ) {
238 //print("TOK(ident)"+ token.toString());
240 if (/\.extend$/.match(token.data) &&
241 this.ts.lookTok(1).data == "(" &&
242 this.ts.lookTok(2).isType(TokenType.NAME) &&
243 this.ts.lookTok(3).data == "," &&
244 this.ts.lookTok(4).isType(TokenType.NAME) &&
245 this.ts.lookTok(5).data == "," &&
246 this.ts.lookTok(6).data == "{"
249 // ignore test for ( a and ,
250 this.ts.nextTok(); /// (
251 token = this.ts.nextTok(); // a
252 scopeName = token.data;
254 if (this.currentDoc != null) {
255 GLib.debug("Call addSymbol %s", scopeName);
256 this.addSymbol(scopeName,false,"OBJECT");
259 this.ts.nextTok(); // ,
260 this.ts.nextTok(); // b
263 this.ts.nextTok(); // ,
264 token = this.ts.nextTok(); // {
266 scopeName = this.fixAlias(aliases, scopeName);
268 var fnScope = new Scope(this.braceNesting, scope, token.id, // was token.n?
269 "$this$=" + scopeName + "|"+scopeName+".prototype", null
273 this.indexedScopes.set(this.ts.cursor, fnScope);
275 this.scopesIn(fnScope);
278 //print(">>" +locBraceNest);
279 continue; // no more processing..
283 // a = Roo.extend(parentname, {
285 if (/\.extend$/.match(token.data) &&
286 this.ts.lookTok(-2).isType(TokenType.NAME) &&
287 this.ts.lookTok(-1).data == "=" &&
288 this.ts.lookTok(1).data == "(" &&
289 this.ts.lookTok(2).isType(TokenType.NAME) &&
290 this.ts.lookTok(3).data == "," &&
291 this.ts.lookTok(4).data == "{"
293 // ignore test for ( a and ,
294 token = this.ts.lookTok(-2);
295 scopeName = token.data;
296 if (this.currentDoc != null) {
297 GLib.debug("Call addSymbol %s", scopeName);
298 this.addSymbol(scopeName,false,"OBJECT");
301 this.ts.nextTok(); /// (
302 this.ts.nextTok(); // parent
304 this.ts.nextTok(); // ,
305 token = this.ts.nextTok(); // {
308 scopeName = this.fixAlias(aliases,scopeName);
309 var fnScope = new Scope(this.braceNesting, scope, token.id, // was token.n?
310 "$this$=" + scopeName + "|"+scopeName+".prototype",
315 this.indexedScopes.set(this.ts.cursor, fnScope);
317 this.scopesIn(fnScope);
320 //print(">>" +locBraceNest);
321 continue; // no more processing..
328 print(JSON.stringify([
330 this.ts.lookTok(1).data ,
331 this.ts.lookTok(2).type ,
332 this.ts.lookTok(3).data ,
333 this.ts.lookTok(4).data
337 if (/\.(applyIf|apply)$/.match(token.data) &&
338 this.ts.lookTok(1).data == "(" &&
339 this.ts.lookTok(2).isType(TokenType.NAME) &&
340 this.ts.lookTok(3).data == "," &&
341 this.ts.lookTok(4).data == "{"
344 this.ts.nextTok(); /// (
346 //print("GOT : applyIF!");
348 token = this.ts.nextTok(); // b
349 scopeName = token.data;
352 if (this.currentDoc != null) {
353 GLib.debug("Call addSymbol %s", scopeName);
354 this.addSymbol(scopeName,false,"OBJECT");
359 this.ts.nextTok(); /// ,
360 this.ts.nextTok(); // {
361 scopeName = this.fixAlias(aliases,scopeName);
362 var fnScope = new Scope(this.braceNesting, scope, token.id, // was token.n?
366 this.indexedScopes.set(this.ts.cursor, fnScope);
368 this.scopesIn(fnScope);
371 //print(">>" +locBraceNest);
372 continue; // no more processing..
378 // change scope to xxxx
380 print(JSON.stringify([
381 this.ts.lookTok(1).data ,
382 this.ts.lookTok(2).name ,
383 this.ts.lookTok(3).type ,
384 this.ts.lookTok(4).data ,
385 this.ts.lookTok(5).data
388 if ( this.ts.lookTok(1).data == "=" &&
389 this.ts.lookTok(2).isName(TokenName.NEW) &&
390 this.ts.lookTok(3).isType(TokenType.NAME)&&
391 this.ts.lookTok(4).data == "(" &&
392 this.ts.lookTok(5).data == "{"
394 scopeName = token.data;
395 if (this.currentDoc != null) {
396 GLib.debug("Call addSymbol %s", scopeName);
397 this.addSymbol(scopeName,false,"OBJECT");
401 this.ts.nextTok(); /// =
402 this.ts.nextTok(); /// new
403 this.ts.nextTok(); /// yyy
404 this.ts.nextTok(); /// (
405 this.ts.nextTok(); /// {
407 scopeName = this.fixAlias(aliases,scopeName);
408 var fnScope = new Scope(this.braceNesting, scope, token.id, // was token.n?
411 this.indexedScopes.set(this.ts.cursor, fnScope);
413 this.scopesIn(fnScope);
416 //print(">>" +locBraceNest);
418 continue; // no more processing..
427 // eval can be prefixed with a hint hider for the compresser..
430 if (this.currentDoc != null) {
431 //print(token.toString());
433 // ident : function ()
434 // ident = function ()
435 // this.ident = function()
436 var atype = "OBJECT";
438 if (((this.ts.lookTok(1).data == ":" )|| (this.ts.lookTok(1).data == "=")) &&
439 (this.ts.lookTok(2).isName(TokenName.FUNCTION))
441 // this.ts.nextTok();
442 // this.ts.nextTok();
446 //print("ADD SYM:" + atype + ":" + token.toString() + this.ts.lookTok(1).toString() + this.ts.lookTok(2).toString());
447 var tname = this.ts.lookTok(-1).data == "." ? token.data : this.fixAlias(aliases,token.data);
449 if (/^this\./.match(tname)) {
450 tname = tname.substring(5);
452 GLib.debug("Call addSymbol %s", tname);
453 this.addSymbol( tname, false, atype);
456 this.currentDoc = null;
466 continue; // dont care about other idents..
470 //print ("NOT NAME");
473 if (token.isType(TokenType.STRN)) { // THIS WILL NOT HAPPEN HERE?!!?
474 if (this.currentDoc != null) {
475 GLib.debug("Call addSymbol %s", token.data.substring(1,token.data.length-1));
476 this.addSymbol(token.data.substring(1,token.data.length-1),false,"OBJECT");
480 // really we only have to deal with object constructs and function calls that change the scope...
483 if (token.isName(TokenName.FUNCTION)) {
484 GLib.debug("Got Function");
485 //print("GOT FUNCTION");
486 // see if we have an unconsumed doc...
488 if (this.currentDoc != null) {
489 GLib.error("Unhandled doc (TOKfunction) %s", token.asString());
496 /// foo = function() {} << really it set"s the "this" scope to foo.prototype
497 //$this$=foo.prototype|$private$|foo.prototype
500 (this.ts.lookTok(-1).data == "=") &&
501 (this.ts.lookTok(-2).isType(TokenType.NAME))
504 scopeName = this.ts.lookTok(-2).data;
505 GLib.debug("Got %s = Function", scopeName);
506 this.ts.balance(TokenName.LEFT_PAREN);
507 token = this.ts.nextTok(); // should be {
508 //print("FOO=FUNCITON() {}" + this.ts.context() + "\n" + token.toString());
511 scopeName = this.fixAlias(aliases, scopeName);
513 var fnScope = new Scope(this.braceNesting, scope, token.id, // was token.n?
514 "$this$="+scopeName+".prototype|$private$|"+scopeName+".prototype",
518 this.indexedScopes.set(this.ts.cursor, fnScope);
520 // this.scopesIn(fnScope);
521 this.parseScope(fnScope, aliases);
526 //print(">>" +locBraceNest);
527 continue; // no more processing..
533 // foo = new function() {}
534 // is this actually used much!?!?! --
538 (this.ts.lookTok(-1).isName(TokenName.NEW)) &&
539 (this.ts.lookTok(-2).data == "=") &&
540 (this.ts.lookTok(-3).isName(TokenName.FUNCTION))
542 //scopeName = this.ts.look(-3).data;
543 this.ts.balance(TokenName.LEFT_PAREN);
544 token = this.ts.nextTok(); // should be {
545 scopeName = this.fixAlias(aliases, scopeName);
546 var fnScope = new Scope(this.braceNesting, scope, token.id, // was token.n?
551 this.indexedScopes.set(this.ts.cursor, fnScope);
553 // this.scopesIn(fnScope);
554 this.parseScope(fnScope, aliases);
557 //print(">>" +locBraceNest);
558 continue; // no more processing..
564 ///==== check/set isObjectLitAr ??
567 // foo: function() {}
568 // no change to scoping..
570 //print("checking for : function() {");
571 //print( [this.ts.lookTok(-3).type , this.ts.lookTok(-2).type , this.ts.lookTok(-1).type ].join(":"));
573 (this.ts.lookTok(-1).data == ":") &&
574 (this.ts.lookTok(-2).isType(TokenType.NAME)) &&
575 (this.ts.lookTok(-3).data == "(" || this.ts.lookTok(-3).data== ",")
577 //print("got for : function() {");
579 //scopeName = this.ts.look(-3).data;
580 this.ts.balance(TokenName.LEFT_PAREN);
581 //print(token.toString())
582 token = this.ts.nextTok(); // should be {
583 //print(token.toString())
585 scopeName = this.fixAlias(aliases, scopeName);
586 var fnScope = new Scope(this.braceNesting, scope, token.id, // was token.n?
590 this.indexedScopes.set(this.ts.cursor, fnScope);
592 // this.scopesIn(fnScope);
593 this.parseScope(fnScope, aliases);
595 //print(">>" +locBraceNest);
596 continue; // no more processing..
599 /// function foo() {} << really it set"s the "this" scope to foo.prototype
600 //$this$=foo|$private$
604 (this.ts.lookTok(1).isType(TokenType.NAME))
606 //scopeName = this.ts.look(-3).data;
607 this.ts.balance(TokenName.LEFT_PAREN);
608 token = this.ts.nextTok(); // should be {
609 var fnScope = new Scope(this.braceNesting, scope, token.id, // was token.n?
613 this.indexedScopes.set(this.ts.cursor, fnScope);
615 // this.scopesIn(fnScope);
616 this.parseScope(fnScope, aliases);
618 //print(">>" +locBraceNest);
619 continue; // no more processing..
625 // this is used in Roo.util.JSON
626 // XXXX = new (function() {
629 (this.ts.lookTok(-1).data == "(") &&
630 (this.ts.lookTok(-2).data == "new" ) &&
631 (this.ts.lookTok(-3).data == "=") &&
632 (this.ts.lookTok(-4).isType(TokenType.NAME))
636 scopeName = this.ts.lookTok(-4).data;
637 this.ts.balance(TokenName.LEFT_PAREN);
638 token = this.ts.nextTok(); // should be {
639 var fnScope = new Scope(this.braceNesting, scope, token.id, // was token.n?
640 "$this$="+scopeName+".prototype|$private$|"+scopeName+".prototype",null
643 this.indexedScopes.set(this.ts.cursor, fnScope);
645 // this.scopesIn(fnScope);
646 this.parseScope(fnScope, aliases);
648 //print(">>" +locBraceNest);
649 continue; // no more processing..
654 // foo = new (function() { }
656 // RETURN function(...) {
659 // (this.ts.lookTok(-1).tokN == Script.TOKlparen) &&
660 (!this.ts.lookTok(1).isType(TokenType.NAME))
662 // (this.ts.lookTok(-2).tokN == Script.TOKnew) &&
663 // (this.ts.lookTok(-3).tokN == Script.TOKassign) &&
664 // (this.ts.lookTok(-4).tokN == Script.TOKidentifier)
667 //scopeName = this.ts.look(-3).data;
668 this.ts.balance(TokenName.LEFT_PAREN);
669 token = this.ts.nextTok(); // should be {
670 var fnScope = new Scope(this.braceNesting, scope, token.id, // was token.n?
674 this.indexedScopes.set(this.ts.cursor, fnScope);
676 // this.scopesIn(fnScope);
677 this.parseScope(fnScope, aliases);
679 //print(">>" +locBraceNest);
680 continue; // no more processing..
685 GLib.error( "dont know how to handle function syntax??\n %s" +
695 } // end checking for TOKfunction
697 if (token.data == "{") {
699 // foo = { // !var!!!
704 (this.ts.lookTok(-1).data == "=") &&
705 (this.ts.lookTok(-2).isType(TokenType.NAME)) &&
706 (!this.ts.lookTok(-3).isName(TokenName.VAR))
709 scopeName = this.ts.lookTok(-2).data;
711 scopeName = this.fixAlias(aliases, scopeName);
712 GLib.debug("got %s = {", scopeName);
714 //print(this.scopes.length);
715 var fnScope = new Scope(this.braceNesting, scope, token.id, // was token.n?
716 "$this$=" + scopeName +"|"+scopeName, null
719 this.indexedScopes.set(this.ts.cursor, fnScope);
721 // push the same scope onto the stack..
722 this.scopesIn(fnScope);
723 // this.scopesIn(this.scopes[this.scopes.length-1]);
727 //print(">>" +locBraceNest);
728 continue; // no more processing..
733 //print("GOT LBRACE : check for :");
735 (this.ts.lookTok(-1).data == ":") &&
736 (this.ts.lookTok(-2).isType(TokenType.NAME)) &&
737 (!this.ts.lookTok(-3).isName(TokenName.VAR))
740 scopeName = this.ts.lookTok(-2).data;
741 scopeName = this.fixAlias(aliases, scopeName);
742 var fnScope = new Scope(this.braceNesting, scope, token.id, // was token.n?
746 this.indexedScopes.set(this.ts.cursor, fnScope);
748 this.scopesIn(fnScope);
751 //print(">>" +locBraceNest);
752 continue; // no more processing..
754 var fnScope = new Scope(this.braceNesting, scope, token.id, // was token.n?
758 this.indexedScopes.set(this.ts.cursor, fnScope);
760 this.scopesIn(fnScope);
763 //print(">>" +locBraceNest);
767 if (token.data == "}") {
770 if (this.currentDoc != null) {
771 GLib.debug("Call addSymbol EMPTY");
772 this.addSymbol("", true);
774 //throw "Unconsumed Doc: (TOKrbrace)" + this.currentDoc.toSource();
780 //assert braceNesting >= scope.getBraceNesting();
781 var closescope = this.scopeOut();
783 scope = this.scopes.get(this.scopes.size-1);
785 //print("<<:" + locBraceNest)
786 //print("<<<<<< " + locBraceNest );
787 if (locBraceNest < 0) {
788 // print("POPED OF END OF SCOPE!");
790 // var ls = this.scopeOut();
791 // ls.getUsedSymbols();
804 void addSymbol(string in_lastIdent, bool appendIt = false, string atype = "OBJECT")
807 GLib.debug("addSymbol %s", in_lastIdent);
808 var lastIdent = in_lastIdent;
809 if (this.currentDoc.getTag(DocTagTitle.PRIVATE).size > 0) {
812 //print(this.currentDoc.toSource());
813 this.currentDoc = null;
814 //print("SKIP ADD SYM: it"s private");
818 var token = this.ts.lookTok(0);
820 // print(this.currentDoc.toSource(););
821 if (this.currentDoc.getTag(DocTagTitle.EVENT).size > 0) {
822 //?? why does it end up in desc - and not name/...
823 //print(this.currentDoc.getTag("event")[0]);
824 lastIdent = "*" + this.currentDoc.getTag(DocTagTitle.EVENT).get(0).desc;
825 //lastIdent = "*" + lastIdent ;
827 if (lastIdent.length < 1 && this.currentDoc.getTag(DocTagTitle.PROPERTY).size > 0) {
828 lastIdent = this.currentDoc.getTag(DocTagTitle.PROPERTY).get(0).name;
829 //lastIdent = "*" + lastIdent ;
833 if (!/\./.match(_s)) {
835 //print("WALKER ADDsymbol: " + lastIdent);
838 GLib.debug("Checking Scopes %d", this.scopes.size);
839 for (var i = 0; i < this.scopes.size;i++) {
840 GLib.debug("Scope %s", this.scopes.get(i).ident);
841 var adds = this.scopes.get(i).ident;
847 GLib.debug("FULLSCOPE: '%s'" , string.joinv("', '", s));
850 s = string.joinv("|", s).split("|");
851 //print("FULLSCOPE: " + s);
852 // print("Walker:ADDSymbol: " + s.join("|") );
857 for (var i = 0; i < s.length;i++) {
859 if (s[i].length < 1) {
862 if ((s[i] == "$private$") || (s[i] == "$global$")) {
866 if (s[i].length > 5 && s[i].substring(0,6) == "$this$") {
867 var ts = s[i].split("=");
869 _s = ""; // ??? VERY QUESTIONABLE!!!
872 // when to use $this$ (probabl for events)
873 _s += _s.length > 0 ? "." : "";
876 GLib.debug("FULLSCOPE: _s=%s (append = %s)" , _s, appendIt? "YES": "no");
879 //print("ADDING SYMBOL: "+ s.join("|") +"\n"+ _s + "\n" +Script.prettyDump(this.currentDoc.toSource()));
880 //print("Walker.addsymbol - add : " + _s);
883 if (appendIt && lastIdent.length < 1) {
885 // append, and no symbol???
887 // see if it"s a @class
888 if (this.currentDoc.getTag(DocTagTitle.CLASS).size > 0) {
889 _s = this.currentDoc.getTag(DocTagTitle.CLASS).get(0).desc;
890 var symbol = new Symbol.new_populate_with_args(_s, new Gee.ArrayList<string>(),
891 "CONSTRUCTOR", this.currentDoc);
893 DocParser.addSymbol(symbol);
894 this.symbols[_s] = symbol;
898 // if (this.currentDoc.getTag("property").length) {
899 // print(Script.pretStringtyDump(this.currentDoc.toSource));
900 // throw "Add Prop?";
903 _s = /\.prototype.*$/.replace(_s, _s.length,0, "");
905 if (!this.symbols.has_key(_s)) {
906 //print("Symbol:" + _s);
907 //print(this.currentDoc.src);
910 // name: "ArgumentError",
911 // message: "Trying to append symbol "" + _s + "", but no doc available\n" +
912 // this.ts.lookTok(0).toString()
914 this.currentDoc = null;
918 GLib.debug("add to symbol _s=%s " , _s);
919 for (var i =0; i < this.currentDoc.tags.size;i++) {
920 this.symbols.get(_s).addDocTag(this.currentDoc.tags.get(i));
922 this.currentDoc = null;
926 //print("Walker.addsymbol - chkdup: " + _s);
927 if (this.symbols.has_key(_s)) {
929 if (this.symbols.get(_s).comment.hasTags) {
930 // then existing comment doesnt has tags
932 // name: "ArgumentError",
933 // message:"DUPLICATE Symbol " + _s + "\n" + token.toString()
937 // otherwise existing comment has tags - overwrite..
941 //print("Walker.addsymbol - ATYPE: " + _s);
946 //print("Walker.addsymbol - add : ");
947 var symbol = new Symbol.new_populate_with_args(
948 _s, new Gee.ArrayList<string>(), atype, this.currentDoc);
950 DocParser.addSymbol(symbol);
951 this.symbols[_s] = symbol;
953 this.currentDoc = null;
960 void scopesIn (Scope s)
963 //print(">>>" + this.ts.context() + "\n>>>"+this.scopes.length+":" +this.scopeListToStr());
969 // print("<<<" + this.ts.context() + "\n<<<"+this.scopes.length+":" +this.scopeListToStr());
970 return this.scopes.remove_at(this.scopes.size -1 );
974 string scopeListToStr ()
977 for (var i = 0; i < this.scopes.size;i++) {
978 s +=(this.scopes[i].ident);
980 return string.joinv("\n\t",s);