expression.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  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 EXPLORER_AST_EXPRESSION_H_
  5. #define EXPLORER_AST_EXPRESSION_H_
  6. #include <map>
  7. #include <optional>
  8. #include <string>
  9. #include <variant>
  10. #include <vector>
  11. #include "common/ostream.h"
  12. #include "explorer/ast/ast_node.h"
  13. #include "explorer/ast/paren_contents.h"
  14. #include "explorer/ast/static_scope.h"
  15. #include "explorer/ast/value_category.h"
  16. #include "explorer/common/arena.h"
  17. #include "explorer/common/source_location.h"
  18. #include "llvm/ADT/ArrayRef.h"
  19. #include "llvm/Support/Compiler.h"
  20. namespace Carbon {
  21. class Value;
  22. class VariableType;
  23. class ImplBinding;
  24. class Expression : public AstNode {
  25. public:
  26. ~Expression() override = 0;
  27. void Print(llvm::raw_ostream& out) const override;
  28. void PrintID(llvm::raw_ostream& out) const override;
  29. static auto classof(const AstNode* node) {
  30. return InheritsFromExpression(node->kind());
  31. }
  32. // Returns the enumerator corresponding to the most-derived type of this
  33. // object.
  34. auto kind() const -> ExpressionKind {
  35. return static_cast<ExpressionKind>(root_kind());
  36. }
  37. // The static type of this expression. Cannot be called before typechecking.
  38. auto static_type() const -> const Value& {
  39. CARBON_CHECK(static_type_.has_value());
  40. return **static_type_;
  41. }
  42. // Sets the static type of this expression. Can only be called once, during
  43. // typechecking.
  44. void set_static_type(Nonnull<const Value*> type) {
  45. CARBON_CHECK(!static_type_.has_value());
  46. static_type_ = type;
  47. }
  48. // The value category of this expression. Cannot be called before
  49. // typechecking.
  50. auto value_category() const -> ValueCategory { return *value_category_; }
  51. // Sets the value category of this expression. Can be called multiple times,
  52. // but the argument must have the same value each time.
  53. void set_value_category(ValueCategory value_category) {
  54. CARBON_CHECK(!value_category_.has_value() ||
  55. value_category == *value_category_);
  56. value_category_ = value_category;
  57. }
  58. protected:
  59. // Constructs an Expression representing syntax at the given line number.
  60. // `kind` must be the enumerator corresponding to the most-derived type being
  61. // constructed.
  62. Expression(AstNodeKind kind, SourceLocation source_loc)
  63. : AstNode(kind, source_loc) {}
  64. private:
  65. std::optional<Nonnull<const Value*>> static_type_;
  66. std::optional<ValueCategory> value_category_;
  67. };
  68. // A FieldInitializer represents the initialization of a single struct field.
  69. class FieldInitializer {
  70. public:
  71. FieldInitializer(std::string name, Nonnull<Expression*> expression)
  72. : name_(std::move(name)), expression_(expression) {}
  73. auto name() const -> const std::string& { return name_; }
  74. auto expression() const -> const Expression& { return *expression_; }
  75. auto expression() -> Expression& { return *expression_; }
  76. private:
  77. // The field name. Cannot be empty.
  78. std::string name_;
  79. // The expression that initializes the field.
  80. Nonnull<Expression*> expression_;
  81. };
  82. enum class Operator {
  83. Add,
  84. AddressOf,
  85. And,
  86. Deref,
  87. Eq,
  88. Mul,
  89. Neg,
  90. Not,
  91. Or,
  92. Sub,
  93. Ptr,
  94. };
  95. // Returns the lexical representation of `op`, such as "+" for `Add`.
  96. auto ToString(Operator op) -> std::string_view;
  97. class IdentifierExpression : public Expression {
  98. public:
  99. explicit IdentifierExpression(SourceLocation source_loc, std::string name)
  100. : Expression(AstNodeKind::IdentifierExpression, source_loc),
  101. name_(std::move(name)) {}
  102. static auto classof(const AstNode* node) -> bool {
  103. return InheritsFromIdentifierExpression(node->kind());
  104. }
  105. auto name() const -> const std::string& { return name_; }
  106. // Returns the ValueNodeView this identifier refers to. Cannot be called
  107. // before name resolution.
  108. auto value_node() const -> const ValueNodeView& { return *value_node_; }
  109. // Sets the value returned by value_node. Can be called only once,
  110. // during name resolution.
  111. void set_value_node(ValueNodeView value_node) {
  112. CARBON_CHECK(!value_node_.has_value());
  113. value_node_ = std::move(value_node);
  114. }
  115. private:
  116. std::string name_;
  117. std::optional<ValueNodeView> value_node_;
  118. };
  119. class FieldAccessExpression : public Expression {
  120. public:
  121. explicit FieldAccessExpression(SourceLocation source_loc,
  122. Nonnull<Expression*> aggregate,
  123. std::string field)
  124. : Expression(AstNodeKind::FieldAccessExpression, source_loc),
  125. aggregate_(aggregate),
  126. field_(std::move(field)) {}
  127. static auto classof(const AstNode* node) -> bool {
  128. return InheritsFromFieldAccessExpression(node->kind());
  129. }
  130. auto aggregate() const -> const Expression& { return *aggregate_; }
  131. auto aggregate() -> Expression& { return *aggregate_; }
  132. auto field() const -> const std::string& { return field_; }
  133. // If `aggregate` has a generic type, returns the `ImplBinding` that
  134. // identifies its witness table. Otherwise, returns `std::nullopt`. Should not
  135. // be called before typechecking.
  136. auto impl() const -> std::optional<Nonnull<const ImplBinding*>> {
  137. return impl_;
  138. }
  139. // Can only be called once, during typechecking.
  140. void set_impl(Nonnull<const ImplBinding*> impl) {
  141. CARBON_CHECK(!impl_.has_value());
  142. impl_ = impl;
  143. }
  144. private:
  145. Nonnull<Expression*> aggregate_;
  146. std::string field_;
  147. std::optional<Nonnull<const ImplBinding*>> impl_;
  148. };
  149. class IndexExpression : public Expression {
  150. public:
  151. explicit IndexExpression(SourceLocation source_loc,
  152. Nonnull<Expression*> aggregate,
  153. Nonnull<Expression*> offset)
  154. : Expression(AstNodeKind::IndexExpression, source_loc),
  155. aggregate_(aggregate),
  156. offset_(offset) {}
  157. static auto classof(const AstNode* node) -> bool {
  158. return InheritsFromIndexExpression(node->kind());
  159. }
  160. auto aggregate() const -> const Expression& { return *aggregate_; }
  161. auto aggregate() -> Expression& { return *aggregate_; }
  162. auto offset() const -> const Expression& { return *offset_; }
  163. auto offset() -> Expression& { return *offset_; }
  164. private:
  165. Nonnull<Expression*> aggregate_;
  166. Nonnull<Expression*> offset_;
  167. };
  168. class IntLiteral : public Expression {
  169. public:
  170. explicit IntLiteral(SourceLocation source_loc, int value)
  171. : Expression(AstNodeKind::IntLiteral, source_loc), value_(value) {}
  172. static auto classof(const AstNode* node) -> bool {
  173. return InheritsFromIntLiteral(node->kind());
  174. }
  175. auto value() const -> int { return value_; }
  176. private:
  177. int value_;
  178. };
  179. class BoolLiteral : public Expression {
  180. public:
  181. explicit BoolLiteral(SourceLocation source_loc, bool value)
  182. : Expression(AstNodeKind::BoolLiteral, source_loc), value_(value) {}
  183. static auto classof(const AstNode* node) -> bool {
  184. return InheritsFromBoolLiteral(node->kind());
  185. }
  186. auto value() const -> bool { return value_; }
  187. private:
  188. bool value_;
  189. };
  190. class StringLiteral : public Expression {
  191. public:
  192. explicit StringLiteral(SourceLocation source_loc, std::string value)
  193. : Expression(AstNodeKind::StringLiteral, source_loc),
  194. value_(std::move(value)) {}
  195. static auto classof(const AstNode* node) -> bool {
  196. return InheritsFromStringLiteral(node->kind());
  197. }
  198. auto value() const -> const std::string& { return value_; }
  199. private:
  200. std::string value_;
  201. };
  202. class StringTypeLiteral : public Expression {
  203. public:
  204. explicit StringTypeLiteral(SourceLocation source_loc)
  205. : Expression(AstNodeKind::StringTypeLiteral, source_loc) {}
  206. static auto classof(const AstNode* node) -> bool {
  207. return InheritsFromStringTypeLiteral(node->kind());
  208. }
  209. };
  210. class TupleLiteral : public Expression {
  211. public:
  212. explicit TupleLiteral(SourceLocation source_loc)
  213. : TupleLiteral(source_loc, {}) {}
  214. explicit TupleLiteral(SourceLocation source_loc,
  215. std::vector<Nonnull<Expression*>> fields)
  216. : Expression(AstNodeKind::TupleLiteral, source_loc),
  217. fields_(std::move(fields)) {}
  218. static auto classof(const AstNode* node) -> bool {
  219. return InheritsFromTupleLiteral(node->kind());
  220. }
  221. auto fields() const -> llvm::ArrayRef<Nonnull<const Expression*>> {
  222. return fields_;
  223. }
  224. auto fields() -> llvm::ArrayRef<Nonnull<Expression*>> { return fields_; }
  225. private:
  226. std::vector<Nonnull<Expression*>> fields_;
  227. };
  228. // A non-empty literal value of a struct type.
  229. //
  230. // It can't be empty because the syntax `{}` is a struct type literal as well
  231. // as a literal value of that type, so for consistency we always represent it
  232. // as a StructTypeLiteral rather than let it oscillate unpredictably between
  233. // the two.
  234. class StructLiteral : public Expression {
  235. public:
  236. explicit StructLiteral(SourceLocation loc,
  237. std::vector<FieldInitializer> fields)
  238. : Expression(AstNodeKind::StructLiteral, loc),
  239. fields_(std::move(fields)) {
  240. CARBON_CHECK(!fields_.empty())
  241. << "`{}` is represented as a StructTypeLiteral, not a StructLiteral.";
  242. }
  243. static auto classof(const AstNode* node) -> bool {
  244. return InheritsFromStructLiteral(node->kind());
  245. }
  246. auto fields() const -> llvm::ArrayRef<FieldInitializer> { return fields_; }
  247. auto fields() -> llvm::MutableArrayRef<FieldInitializer> { return fields_; }
  248. private:
  249. std::vector<FieldInitializer> fields_;
  250. };
  251. // A literal representing a struct type.
  252. //
  253. // Code that handles this type may sometimes need to have special-case handling
  254. // for `{}`, which is a struct value in addition to being a struct type.
  255. class StructTypeLiteral : public Expression {
  256. public:
  257. explicit StructTypeLiteral(SourceLocation loc) : StructTypeLiteral(loc, {}) {}
  258. explicit StructTypeLiteral(SourceLocation loc,
  259. std::vector<FieldInitializer> fields)
  260. : Expression(AstNodeKind::StructTypeLiteral, loc),
  261. fields_(std::move(fields)) {}
  262. static auto classof(const AstNode* node) -> bool {
  263. return InheritsFromStructTypeLiteral(node->kind());
  264. }
  265. auto fields() const -> llvm::ArrayRef<FieldInitializer> { return fields_; }
  266. auto fields() -> llvm::MutableArrayRef<FieldInitializer> { return fields_; }
  267. private:
  268. std::vector<FieldInitializer> fields_;
  269. };
  270. class PrimitiveOperatorExpression : public Expression {
  271. public:
  272. explicit PrimitiveOperatorExpression(
  273. SourceLocation source_loc, Operator op,
  274. std::vector<Nonnull<Expression*>> arguments)
  275. : Expression(AstNodeKind::PrimitiveOperatorExpression, source_loc),
  276. op_(op),
  277. arguments_(std::move(arguments)) {}
  278. static auto classof(const AstNode* node) -> bool {
  279. return InheritsFromPrimitiveOperatorExpression(node->kind());
  280. }
  281. auto op() const -> Operator { return op_; }
  282. auto arguments() const -> llvm::ArrayRef<Nonnull<Expression*>> {
  283. return arguments_;
  284. }
  285. auto arguments() -> llvm::MutableArrayRef<Nonnull<Expression*>> {
  286. return arguments_;
  287. }
  288. private:
  289. Operator op_;
  290. std::vector<Nonnull<Expression*>> arguments_;
  291. };
  292. class GenericBinding;
  293. using BindingMap =
  294. std::map<Nonnull<const GenericBinding*>, Nonnull<const Value*>>;
  295. using ImplExpMap = std::map<Nonnull<const ImplBinding*>, Nonnull<Expression*>>;
  296. class CallExpression : public Expression {
  297. public:
  298. explicit CallExpression(SourceLocation source_loc,
  299. Nonnull<Expression*> function,
  300. Nonnull<Expression*> argument)
  301. : Expression(AstNodeKind::CallExpression, source_loc),
  302. function_(function),
  303. argument_(argument) {}
  304. static auto classof(const AstNode* node) -> bool {
  305. return InheritsFromCallExpression(node->kind());
  306. }
  307. auto function() const -> const Expression& { return *function_; }
  308. auto function() -> Expression& { return *function_; }
  309. auto argument() const -> const Expression& { return *argument_; }
  310. auto argument() -> Expression& { return *argument_; }
  311. // Maps each of `function`'s impl bindings to an expression
  312. // that constructs a witness table.
  313. // Should not be called before typechecking, or if `function` is not
  314. // a generic function.
  315. auto impls() const -> const ImplExpMap& { return impls_; }
  316. // Can only be called once, during typechecking.
  317. void set_impls(const ImplExpMap& impls) {
  318. CARBON_CHECK(impls_.empty());
  319. impls_ = impls;
  320. }
  321. auto deduced_args() const -> const BindingMap& { return deduced_args_; }
  322. void set_deduced_args(const BindingMap& deduced_args) {
  323. deduced_args_ = deduced_args;
  324. }
  325. private:
  326. Nonnull<Expression*> function_;
  327. Nonnull<Expression*> argument_;
  328. ImplExpMap impls_;
  329. BindingMap deduced_args_;
  330. };
  331. class FunctionTypeLiteral : public Expression {
  332. public:
  333. explicit FunctionTypeLiteral(SourceLocation source_loc,
  334. Nonnull<Expression*> parameter,
  335. Nonnull<Expression*> return_type)
  336. : Expression(AstNodeKind::FunctionTypeLiteral, source_loc),
  337. parameter_(parameter),
  338. return_type_(return_type) {}
  339. static auto classof(const AstNode* node) -> bool {
  340. return InheritsFromFunctionTypeLiteral(node->kind());
  341. }
  342. auto parameter() const -> const Expression& { return *parameter_; }
  343. auto parameter() -> Expression& { return *parameter_; }
  344. auto return_type() const -> const Expression& { return *return_type_; }
  345. auto return_type() -> Expression& { return *return_type_; }
  346. private:
  347. Nonnull<Expression*> parameter_;
  348. Nonnull<Expression*> return_type_;
  349. };
  350. class BoolTypeLiteral : public Expression {
  351. public:
  352. explicit BoolTypeLiteral(SourceLocation source_loc)
  353. : Expression(AstNodeKind::BoolTypeLiteral, source_loc) {}
  354. static auto classof(const AstNode* node) -> bool {
  355. return InheritsFromBoolTypeLiteral(node->kind());
  356. }
  357. };
  358. class IntTypeLiteral : public Expression {
  359. public:
  360. explicit IntTypeLiteral(SourceLocation source_loc)
  361. : Expression(AstNodeKind::IntTypeLiteral, source_loc) {}
  362. static auto classof(const AstNode* node) -> bool {
  363. return InheritsFromIntTypeLiteral(node->kind());
  364. }
  365. };
  366. class ContinuationTypeLiteral : public Expression {
  367. public:
  368. explicit ContinuationTypeLiteral(SourceLocation source_loc)
  369. : Expression(AstNodeKind::ContinuationTypeLiteral, source_loc) {}
  370. static auto classof(const AstNode* node) -> bool {
  371. return InheritsFromContinuationTypeLiteral(node->kind());
  372. }
  373. };
  374. class TypeTypeLiteral : public Expression {
  375. public:
  376. explicit TypeTypeLiteral(SourceLocation source_loc)
  377. : Expression(AstNodeKind::TypeTypeLiteral, source_loc) {}
  378. static auto classof(const AstNode* node) -> bool {
  379. return InheritsFromTypeTypeLiteral(node->kind());
  380. }
  381. };
  382. class IntrinsicExpression : public Expression {
  383. public:
  384. enum class Intrinsic {
  385. Print,
  386. };
  387. // Returns the enumerator corresponding to the intrinsic named `name`,
  388. // or raises a fatal compile error if there is no such enumerator.
  389. static auto FindIntrinsic(std::string_view name, SourceLocation source_loc)
  390. -> ErrorOr<Intrinsic>;
  391. explicit IntrinsicExpression(Intrinsic intrinsic, Nonnull<TupleLiteral*> args,
  392. SourceLocation source_loc)
  393. : Expression(AstNodeKind::IntrinsicExpression, source_loc),
  394. intrinsic_(intrinsic),
  395. args_(args) {}
  396. static auto classof(const AstNode* node) -> bool {
  397. return InheritsFromIntrinsicExpression(node->kind());
  398. }
  399. auto intrinsic() const -> Intrinsic { return intrinsic_; }
  400. auto args() const -> const TupleLiteral& { return *args_; }
  401. auto args() -> TupleLiteral& { return *args_; }
  402. private:
  403. Intrinsic intrinsic_;
  404. Nonnull<TupleLiteral*> args_;
  405. };
  406. class IfExpression : public Expression {
  407. public:
  408. explicit IfExpression(SourceLocation source_loc,
  409. Nonnull<Expression*> condition,
  410. Nonnull<Expression*> then_expression,
  411. Nonnull<Expression*> else_expression)
  412. : Expression(AstNodeKind::IfExpression, source_loc),
  413. condition_(condition),
  414. then_expression_(then_expression),
  415. else_expression_(else_expression) {}
  416. static auto classof(const AstNode* node) -> bool {
  417. return InheritsFromIfExpression(node->kind());
  418. }
  419. auto condition() const -> const Expression& { return *condition_; }
  420. auto condition() -> Expression& { return *condition_; }
  421. auto then_expression() const -> const Expression& {
  422. return *then_expression_;
  423. }
  424. auto then_expression() -> Expression& { return *then_expression_; }
  425. auto else_expression() const -> const Expression& {
  426. return *else_expression_;
  427. }
  428. auto else_expression() -> Expression& { return *else_expression_; }
  429. private:
  430. Nonnull<Expression*> condition_;
  431. Nonnull<Expression*> then_expression_;
  432. Nonnull<Expression*> else_expression_;
  433. };
  434. // Instantiate a generic impl.
  435. class InstantiateImpl : public Expression {
  436. public:
  437. using ImplementsCarbonValueNode = void;
  438. explicit InstantiateImpl(SourceLocation source_loc,
  439. Nonnull<Expression*> generic_impl,
  440. const BindingMap& type_args, const ImplExpMap& impls)
  441. : Expression(AstNodeKind::InstantiateImpl, source_loc),
  442. generic_impl_(generic_impl),
  443. type_args_(type_args),
  444. impls_(impls) {}
  445. static auto classof(const AstNode* node) -> bool {
  446. return InheritsFromInstantiateImpl(node->kind());
  447. }
  448. auto generic_impl() const -> Nonnull<Expression*> { return generic_impl_; }
  449. auto type_args() const -> const BindingMap& { return type_args_; }
  450. // Maps each of the impl bindings to an expression that constructs
  451. // the witness table for that impl.
  452. auto impls() const -> const ImplExpMap& { return impls_; }
  453. private:
  454. Nonnull<Expression*> generic_impl_;
  455. BindingMap type_args_;
  456. ImplExpMap impls_;
  457. };
  458. // An expression whose semantics have not been implemented. This can be used
  459. // as a placeholder during development, in order to implement and test parsing
  460. // of a new expression syntax without having to implement its semantics.
  461. class UnimplementedExpression : public Expression {
  462. public:
  463. // Constructs an UnimplementedExpression with the given label and the given
  464. // children, which must all be convertible to Nonnull<AstNode*>. The label
  465. // should correspond roughly to the name of the class that will eventually
  466. // replace this usage of UnimplementedExpression.
  467. template <typename... Children>
  468. UnimplementedExpression(SourceLocation source_loc, std::string label,
  469. Children... children)
  470. : Expression(AstNodeKind::UnimplementedExpression, source_loc),
  471. label_(std::move(label)) {
  472. AddChildren(children...);
  473. }
  474. static auto classof(const AstNode* node) -> bool {
  475. return InheritsFromUnimplementedExpression(node->kind());
  476. }
  477. auto label() const -> std::string_view { return label_; }
  478. auto children() const -> llvm::ArrayRef<Nonnull<const AstNode*>> {
  479. return children_;
  480. }
  481. private:
  482. void AddChildren() {}
  483. template <typename... Children>
  484. void AddChildren(Nonnull<AstNode*> child, Children... children) {
  485. children_.push_back(child);
  486. AddChildren(children...);
  487. }
  488. std::string label_;
  489. std::vector<Nonnull<AstNode*>> children_;
  490. };
  491. // A literal representing a statically-sized array type.
  492. class ArrayTypeLiteral : public Expression {
  493. public:
  494. // Constructs an array type literal which uses the given expressions to
  495. // represent the element type and size.
  496. ArrayTypeLiteral(SourceLocation source_loc,
  497. Nonnull<Expression*> element_type_expression,
  498. Nonnull<Expression*> size_expression)
  499. : Expression(AstNodeKind::ArrayTypeLiteral, source_loc),
  500. element_type_expression_(element_type_expression),
  501. size_expression_(size_expression) {}
  502. static auto classof(const AstNode* node) -> bool {
  503. return InheritsFromArrayTypeLiteral(node->kind());
  504. }
  505. auto element_type_expression() const -> const Expression& {
  506. return *element_type_expression_;
  507. }
  508. auto element_type_expression() -> Expression& {
  509. return *element_type_expression_;
  510. }
  511. auto size_expression() const -> const Expression& {
  512. return *size_expression_;
  513. }
  514. auto size_expression() -> Expression& { return *size_expression_; }
  515. private:
  516. Nonnull<Expression*> element_type_expression_;
  517. Nonnull<Expression*> size_expression_;
  518. };
  519. // Converts paren_contents to an Expression, interpreting the parentheses as
  520. // grouping if their contents permit that interpretation, or as forming a
  521. // tuple otherwise.
  522. auto ExpressionFromParenContents(
  523. Nonnull<Arena*> arena, SourceLocation source_loc,
  524. const ParenContents<Expression>& paren_contents) -> Nonnull<Expression*>;
  525. // Converts paren_contents to an Expression, interpreting the parentheses as
  526. // forming a tuple.
  527. auto TupleExpressionFromParenContents(
  528. Nonnull<Arena*> arena, SourceLocation source_loc,
  529. const ParenContents<Expression>& paren_contents) -> Nonnull<TupleLiteral*>;
  530. } // namespace Carbon
  531. #endif // EXPLORER_AST_EXPRESSION_H_