this.hints = { };
this.ident = lastIdent;
this.gid = Scope.gid++;
-
+ this.token = token;
//print("ADD SCOPE(" + this.gid + ") TO "+ (parent ? this.parent.gid : 'TOP') + ' : ' +
// (token ? token.toString() : ''));
munged : false,
protectedVars : {}, // only used by to parent..
- declareIdentifier : function(symbol, token) {
+
+ /**
+ * dump the scope to StdOut...
+ *
+ */
+ dump : function(indent)
+ {
+ indent = indent || '';
+ print(
+ indent + "Scope: " + this.id + "\n" +
+ indent + "Started: " + ( this.token ? this.token.line : 'TOP' ) + "\n" +
+ indent + "- " + XObject.keys(this.identifiers).join(", ") + "\n"
+ );
+ this.subScopes.forEach(function(s) {
+ s.dump(indent + ' ');
+ });
+
+
+ },
+
+
+ declareIdentifier : function(symbol, token)
+ {
//print("SCOPE : " + this.gid + " :SYM: " + symbol + " " + token.toString()+"");