public void VisitVariableExpr(VariableExpr expr)
        {
            if (scopes.Count > 0)
            {
                var scope = scopes.Peek();
                if (scope.ContainsKey(expr.Name.Lexeme) && scope[expr.Name.Lexeme].Defined == false)
                {
                    Lox.Error(expr.Name, "Cannot read local variable in its own initializer.");
                }
            }

            ResolveLocal(expr, expr.Name);
        }
 public string VisitVariableExpr(VariableExpr expr)
 {
     return(Parenthesize("var", expr));
 }
 public ClassStmt(Token Name, VariableExpr SuperClass, List <FunctionStmt> Methods)
 {
     this.Name       = Name;
     this.SuperClass = SuperClass;
     this.Methods    = Methods;
 }
 public object VisitVariableExpr(VariableExpr expr)
 {
     return(LookUpVariable(expr.Name, expr));
 }