semantics_node_kind.def 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. //
  5. // Note that this is an X-macro header.
  6. //
  7. // It does not use `#include` guards, and instead is designed to be `#include`ed
  8. // after the x-macro is defined in order for its inclusion to expand to the
  9. // desired output. The x-macro for this header is `CARBON_PARSE_NODE_KIND`. The
  10. // definition provided will be removed at the end of this file to clean up.
  11. #ifndef CARBON_SEMANTICS_NODE_KIND
  12. #error "Must define the x-macro to use this file."
  13. #endif
  14. // No args.
  15. CARBON_SEMANTICS_NODE_KIND(Invalid, no_args)
  16. // Two nodes: lhs and rhs.
  17. CARBON_SEMANTICS_NODE_KIND(BinaryOperatorAdd, two_nodes)
  18. // No args.
  19. CARBON_SEMANTICS_NODE_KIND(CodeBlockStart, no_args)
  20. // No args.
  21. CARBON_SEMANTICS_NODE_KIND(CodeBlockEnd, no_args)
  22. // One node: the name.
  23. // TODO: Add a declaration scope as a second arg.
  24. CARBON_SEMANTICS_NODE_KIND(FunctionDeclaration, one_node)
  25. // One node: the FunctionDeclaration.
  26. CARBON_SEMANTICS_NODE_KIND(FunctionDefinitionStart, one_node)
  27. // No args.
  28. CARBON_SEMANTICS_NODE_KIND(FunctionDefinitionEnd, no_args)
  29. // The decalred IdentifierId.
  30. CARBON_SEMANTICS_NODE_KIND(Identifier, identifier)
  31. // The declared IntegerLiteralId.
  32. CARBON_SEMANTICS_NODE_KIND(IntegerLiteral, integer_literal)
  33. // No args.
  34. CARBON_SEMANTICS_NODE_KIND(Return, no_args)
  35. // One node: the return expression.
  36. CARBON_SEMANTICS_NODE_KIND(ReturnExpression, one_node)
  37. #undef CARBON_SEMANTICS_NODE_KIND