forked from carbon-language/carbon-lang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexpression_category.h
27 lines (20 loc) · 909 Bytes
/
expression_category.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef CARBON_EXPLORER_AST_EXPRESSION_CATEGORY_H_
#define CARBON_EXPLORER_AST_EXPRESSION_CATEGORY_H_
#include "llvm/ADT/StringRef.h"
namespace Carbon {
// The category of a Carbon expression indicates whether it evaluates
// to a value, reference, or initialization.
enum class ExpressionCategory {
// A "value expression" produces a value (with no associated location).
Value,
// A "reference expression" produces a location of an existing value.
Reference,
// An "initializing expression" takes a location and initialize it.
Initializing,
};
auto ExpressionCategoryToString(ExpressionCategory cat) -> llvm::StringRef;
} // namespace Carbon
#endif // CARBON_EXPLORER_AST_EXPRESSION_CATEGORY_H_