expression_category.h 909 B

123456789101112131415161718192021222324252627
  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 CARBON_EXPLORER_AST_EXPRESSION_CATEGORY_H_
  5. #define CARBON_EXPLORER_AST_EXPRESSION_CATEGORY_H_
  6. #include "llvm/ADT/StringRef.h"
  7. namespace Carbon {
  8. // The category of a Carbon expression indicates whether it evaluates
  9. // to a value, reference, or initialization.
  10. enum class ExpressionCategory {
  11. // A "value expression" produces a value (with no associated location).
  12. Value,
  13. // A "reference expression" produces a location of an existing value.
  14. Reference,
  15. // An "initializing expression" takes a location and initialize it.
  16. Initializing,
  17. };
  18. auto ExpressionCategoryToString(ExpressionCategory cat) -> llvm::StringRef;
  19. } // namespace Carbon
  20. #endif // CARBON_EXPLORER_AST_EXPRESSION_CATEGORY_H_