// Path: iodevice/src/org/luaj/vm2/ast/Stat.java
// public static class Assign extends Stat {
// 	public final List vars;
// 	public final List exps;
// 		
// 	public Assign(List vars, List exps) {
// 		this.vars = vars;
// 		this.exps = exps;
// 	}
// 
// 	public void accept(Visitor visitor) {
// 		visitor.visit(this);
// 	}
// 
// }
// 
// Path: iodevice/src/org/luaj/vm2/ast/Stat.java
// public static class FuncDef extends Stat {
// 	public final FuncName name;
// 	public final FuncBody body;
// 	public FuncDef(FuncName name, FuncBody body) {
// 		this.name = name;
// 		this.body = body;
// 	}
// 
// 	public void accept(Visitor visitor) {
// 		visitor.visit( this );
// 	}
// }
// 
// Path: iodevice/src/org/luaj/vm2/ast/Stat.java
// public static class GenericFor extends Stat {
// 	public List names;
// 	public List exps;
// 	public Block block;
// 	public NameScope scope;
// 	public GenericFor(List names, List exps, Block block) {
// 		this.names = names;
// 		this.exps = exps;
// 		this.block = block;
// 	}
// 
// 	public void accept(Visitor visitor) {
// 		visitor.visit( this );
// 	}
// }
// 
// Path: iodevice/src/org/luaj/vm2/ast/Stat.java
// public static class LocalAssign extends Stat {
// 	public final List names;
// 	public final List values;
// 	public LocalAssign(List names, List values) {
// 		this.names = names;
// 		this.values = values;
// 	}
// 
// 	public void accept(Visitor visitor) {
// 		visitor.visit( this );
// 	}
// }
// 
// Path: iodevice/src/org/luaj/vm2/ast/Stat.java
// public static class LocalFuncDef extends Stat {
// 	public final Name name;
// 	public final FuncBody body;
// 	public LocalFuncDef(String name, FuncBody body) {
// 		this.name = new Name(name);
// 		this.body = body;
// 	}
// 
// 	public void accept(Visitor visitor) {
// 		visitor.visit( this );
// 	}
// }
// 
// Path: iodevice/src/org/luaj/vm2/ast/Stat.java
// public static class NumericFor extends Stat {
// 	public final Name name;
// 	public final Exp initial,limit,step;
// 	public final Block block;
// 	public NameScope scope;
// 	public NumericFor(String name, Exp initial, Exp limit, Exp step, Block block) {
// 		this.name = new Name(name);
// 		this.initial = initial;
// 		this.limit = limit;
// 		this.step = step;
// 		this.block = block;
// 	}
// 
// 	public void accept(Visitor visitor) {
// 		visitor.visit( this );
// 	}
// }


import java.util.List;
import org.luaj.vm2.LuaValue;
import org.luaj.vm2.ast.Exp.Constant;
import org.luaj.vm2.ast.Exp.NameExp;
import org.luaj.vm2.ast.Exp.VarExp;
import org.luaj.vm2.ast.Stat.Assign;
import org.luaj.vm2.ast.Stat.FuncDef;
import org.luaj.vm2.ast.Stat.GenericFor;
import org.luaj.vm2.ast.Stat.LocalAssign;
import org.luaj.vm2.ast.Stat.LocalFuncDef;
import org.luaj.vm2.ast.Stat.NumericFor;
		super.visit(body);
		popScope();
	}
	
	public void visit(LocalFuncDef stat) {
		defineLocalVar(stat.name);
		super.visit(stat);
	}

	public void visit(NumericFor stat) {
		pushScope();
		stat.scope = scope;
		defineLocalVar(stat.name);
		super.visit(stat);
		popScope();
	}

	public void visit(GenericFor stat) {
		pushScope();
		stat.scope = scope;
		defineLocalVars( stat.names );
		super.visit(stat);
		popScope();
	}

	public void visit(NameExp exp) {
		exp.name.variable = resolveNameReference(exp.name);
		super.visit(exp);
	}
	
// Path: iodevice/src/org/luaj/vm2/ast/Stat.java
// public static class Assign extends Stat {
// 	public final List vars;
// 	public final List exps;
// 		
// 	public Assign(List vars, List exps) {
// 		this.vars = vars;
// 		this.exps = exps;
// 	}
// 
// 	public void accept(Visitor visitor) {
// 		visitor.visit(this);
// 	}
// 
// }
// 
// Path: iodevice/src/org/luaj/vm2/ast/Stat.java
// public static class FuncDef extends Stat {
// 	public final FuncName name;
// 	public final FuncBody body;
// 	public FuncDef(FuncName name, FuncBody body) {
// 		this.name = name;
// 		this.body = body;
// 	}
// 
// 	public void accept(Visitor visitor) {
// 		visitor.visit( this );
// 	}
// }
// 
// Path: iodevice/src/org/luaj/vm2/ast/Stat.java
// public static class GenericFor extends Stat {
// 	public List names;
// 	public List exps;
// 	public Block block;
// 	public NameScope scope;
// 	public GenericFor(List names, List exps, Block block) {
// 		this.names = names;
// 		this.exps = exps;
// 		this.block = block;
// 	}
// 
// 	public void accept(Visitor visitor) {
// 		visitor.visit( this );
// 	}
// }
// 
// Path: iodevice/src/org/luaj/vm2/ast/Stat.java
// public static class LocalAssign extends Stat {
// 	public final List names;
// 	public final List values;
// 	public LocalAssign(List names, List values) {
// 		this.names = names;
// 		this.values = values;
// 	}
// 
// 	public void accept(Visitor visitor) {
// 		visitor.visit( this );
// 	}
// }
// 
// Path: iodevice/src/org/luaj/vm2/ast/Stat.java
// public static class LocalFuncDef extends Stat {
// 	public final Name name;
// 	public final FuncBody body;
// 	public LocalFuncDef(String name, FuncBody body) {
// 		this.name = new Name(name);
// 		this.body = body;
// 	}
// 
// 	public void accept(Visitor visitor) {
// 		visitor.visit( this );
// 	}
// }
// 
// Path: iodevice/src/org/luaj/vm2/ast/Stat.java
// public static class NumericFor extends Stat {
// 	public final Name name;
// 	public final Exp initial,limit,step;
// 	public final Block block;
// 	public NameScope scope;
// 	public NumericFor(String name, Exp initial, Exp limit, Exp step, Block block) {
// 		this.name = new Name(name);
// 		this.initial = initial;
// 		this.limit = limit;
// 		this.step = step;
// 		this.block = block;
// 	}
// 
// 	public void accept(Visitor visitor) {
// 		visitor.visit( this );
// 	}
// }


// Path: iodevice/src/org/luaj/vm2/ast/NameResolver.java
import java.util.List;
import org.luaj.vm2.LuaValue;
import org.luaj.vm2.ast.Exp.Constant;
import org.luaj.vm2.ast.Exp.NameExp;
import org.luaj.vm2.ast.Exp.VarExp;
import org.luaj.vm2.ast.Stat.Assign;
import org.luaj.vm2.ast.Stat.FuncDef;
import org.luaj.vm2.ast.Stat.GenericFor;
import org.luaj.vm2.ast.Stat.LocalAssign;
import org.luaj.vm2.ast.Stat.LocalFuncDef;
import org.luaj.vm2.ast.Stat.NumericFor;

		super.visit(body);
		popScope();
	}
	
	public void visit(LocalFuncDef stat) {
		defineLocalVar(stat.name);
		super.visit(stat);
	}

	public void visit(NumericFor stat) {
		pushScope();
		stat.scope = scope;
		defineLocalVar(stat.name);
		super.visit(stat);
		popScope();
	}

	public void visit(GenericFor stat) {
		pushScope();
		stat.scope = scope;
		defineLocalVars( stat.names );
		super.visit(stat);
		popScope();
	}

	public void visit(NameExp exp) {
		exp.name.variable = resolveNameReference(exp.name);
		super.visit(exp);
	}
	
	public void visit(FuncDef stat) {