value_category.h 749 B

12345678910111213141516171819202122
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #ifndef EXECUTABLE_SEMANTICS_AST_VALUE_CATEGORY_H_
  5. #define EXECUTABLE_SEMANTICS_AST_VALUE_CATEGORY_H_
  6. namespace Carbon {
  7. // The value category of a Carbon expression indicates whether it evaluates
  8. // to a variable or a value. A variable can be mutated, and can have its
  9. // address taken, whereas a value cannot.
  10. enum class ValueCategory {
  11. // A variable. This roughly corresponds to a C/C++ lvalue.
  12. Var,
  13. // A value. This roughly corresponds to a C/C++ rvalue.
  14. Let,
  15. };
  16. } // namespace Carbon
  17. #endif // EXECUTABLE_SEMANTICS_AST_VALUE_CATEGORY_H_