public override object Visit(Program that, object value = null) { _symbols = that.Symbols; foreach (Module module in that.Modules) module.Visit(this); _symbols = null; return that; }
/** Walks the \c Module nodes defined inside the \c Program node. */ public override object Visit(Program that, object value = null) { /** Assign the value of the "class global variable" \c _symbols as the remaining methods make use of it. */ /** \note We \b could pass in the symbol table as the \c value parameter, but this is easier and just as fast. */ _symbols = that.Symbols; // Process each module in input order. foreach (Module module in that.Modules) module.Visit(this); /** Clear the "class global variable" \c _symbols after use. */ _symbols = null; return that; }