//Eval recursively traverses the ast and returns the associated Expr form of the ast
Eval recursively traverses the ast and returns the associated Expr form of the ast
// Eval recursively traverses the ast and returns the associated Expr form of the ast
func (s *Solver) Eval(exp ast.Expr) Expr {
	switch exp := exp.(type) {
	case *ast.ParenExpr:
		return s.Eval(exp.X)
	case *ast.UnaryExpr:
		return s.EvalUnaryExpr(exp)
	case *ast.BinaryExpr:
		return s.EvalBinaryExpr(exp)
	case *ast.BasicLit:
		switch exp.Kind {
		case token.INT:
			i, _ := strconv.ParseUint(exp.Value, 10, int(s.width))
			return s.BvConstExprFromInt(int(s.width), uint(i))
		}
	case *ast.Ident:
		return Expr(s.vecs[exp.Name])
	}
	return Expr(nil)
}
func ( s * Solver ) Eval ( exp ast . Expr ) Expr { switch exp := exp . ( type ) { case * ast . ParenExpr : return s . Eval ( exp . X ) case * ast . UnaryExpr : return s . EvalUnaryExpr ( exp ) case * ast . BinaryExpr : return s . EvalBinaryExpr ( exp ) case * ast . BasicLit : switch exp . Kind { case token . INT : i , _ := strconv . ParseUint ( exp . Value , 10 , int ( s . width ) ) return s . BvConstExprFromInt ( int ( s . width ) , uint ( i ) ) } case * ast . Ident : return Expr ( s . vecs [ exp . Name ] ) } return Expr ( nil ) }
Eval recursively traverses the ast and returns the associated Expr form of the ast
Eval recursively traverses the ast and returns the associated Expr form of the ast