public void visitVariable(Variable d) { if (capturingFormalArgs()) { _formalArgs.Add(d); } else { _currentScope.add(d); visitChildren(d); } //_currentScope.add(d); // visitChildren(d); }
public void visitComponent(Component c) { // add the component declaration to this scope (global scope) c.variable.accept(this); // visit the extension (if any) if (c.isExtension()) { c.extends.accept(this); } // create the component's scope Scope parentScope = _currentScope; _currentScope = new Scope(parentScope); c.scope = _currentScope; // build the component's scope c.importList.accept(this); c.functionList.accept(this); // now that we've finished with the statement list return to the previous scope _currentScope = parentScope; // add the component to this scope (which should be global scope) _currentScope.add(c); }