| 90 | class TernaryOperator; |
| 91 | |
| 92 | class Operator final { |
| 93 | public: |
| 94 | ABSL_ATTRIBUTE_PURE_FUNCTION static TernaryOperator Conditional(); |
| 95 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator LogicalAnd(); |
| 96 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator LogicalOr(); |
| 97 | ABSL_ATTRIBUTE_PURE_FUNCTION static UnaryOperator LogicalNot(); |
| 98 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator Equals(); |
| 99 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator NotEquals(); |
| 100 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator Less(); |
| 101 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator LessEquals(); |
| 102 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator Greater(); |
| 103 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator GreaterEquals(); |
| 104 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator Add(); |
| 105 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator Subtract(); |
| 106 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator Multiply(); |
| 107 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator Divide(); |
| 108 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator Modulo(); |
| 109 | ABSL_ATTRIBUTE_PURE_FUNCTION static UnaryOperator Negate(); |
| 110 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator Index(); |
| 111 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator In(); |
| 112 | ABSL_ATTRIBUTE_PURE_FUNCTION static UnaryOperator NotStrictlyFalse(); |
| 113 | ABSL_ATTRIBUTE_PURE_FUNCTION static BinaryOperator OldIn(); |
| 114 | ABSL_ATTRIBUTE_PURE_FUNCTION static UnaryOperator OldNotStrictlyFalse(); |
| 115 | |
| 116 | ABSL_ATTRIBUTE_PURE_FUNCTION static absl::optional<Operator> FindByName( |
| 117 | absl::string_view input); |
| 118 | |
| 119 | ABSL_ATTRIBUTE_PURE_FUNCTION static absl::optional<Operator> |
| 120 | FindByDisplayName(absl::string_view input); |
| 121 | |
| 122 | Operator() = delete; |
| 123 | Operator(const Operator&) = default; |
| 124 | Operator(Operator&&) = default; |
| 125 | Operator& operator=(const Operator&) = default; |
| 126 | Operator& operator=(Operator&&) = default; |
| 127 | |
| 128 | constexpr OperatorId id() const { return data_->id; } |
| 129 | |
| 130 | // Returns the name of the operator. This is the managed representation of the |
| 131 | // operator, for example "_&&_". |
| 132 | constexpr absl::string_view name() const { return data_->name; } |
| 133 | |
| 134 | // Returns the source text representation of the operator. This is the |
| 135 | // unmanaged text representation of the operator, for example "&&". |
| 136 | // |
| 137 | // Note that this will be empty for operators like Conditional() and Index(). |
| 138 | constexpr absl::string_view display_name() const { |
| 139 | return data_->display_name; |
| 140 | } |
| 141 | |
| 142 | constexpr int precedence() const { return data_->precedence; } |
| 143 | |
| 144 | constexpr Arity arity() const { return static_cast<Arity>(data_->arity); } |
| 145 | |
| 146 | private: |
| 147 | friend class UnaryOperator; |
| 148 | friend class BinaryOperator; |
| 149 | friend class TernaryOperator; |
no outgoing calls