BUILD 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. package(default_visibility = ["//executable_semantics:__subpackages__"])
  5. cc_library(
  6. name = "ast",
  7. hdrs = ["ast.h"],
  8. deps = [
  9. ":declaration",
  10. ":library_name",
  11. ],
  12. )
  13. cc_library(
  14. name = "ast_node",
  15. srcs = ["ast_node.cpp"],
  16. hdrs = [
  17. "ast_node.h",
  18. "ast_rtti.h",
  19. ],
  20. deps = [
  21. ":source_location",
  22. ],
  23. )
  24. genrule(
  25. name = "ast_rtti",
  26. srcs = ["ast_rtti.txt"],
  27. outs = ["ast_rtti.h"],
  28. cmd = "./$(location //executable_semantics:gen_rtti)" +
  29. " $(location ast_rtti.txt) > \"$@\"",
  30. tools = ["//executable_semantics:gen_rtti"],
  31. )
  32. cc_library(
  33. name = "ast_test_matchers",
  34. testonly = 1,
  35. srcs = [
  36. "ast_test_matchers_internal.cpp",
  37. "ast_test_matchers_internal.h",
  38. ],
  39. hdrs = ["ast_test_matchers.h"],
  40. deps = [
  41. ":ast",
  42. ":ast_node",
  43. ":declaration",
  44. ":expression",
  45. ":statement",
  46. "@com_google_googletest//:gtest",
  47. "@llvm-project//llvm:Support",
  48. ],
  49. )
  50. cc_test(
  51. name = "ast_test_matchers_test",
  52. srcs = ["ast_test_matchers_test.cpp"],
  53. deps = [
  54. ":ast_test_matchers",
  55. ":declaration",
  56. ":expression",
  57. ":pattern",
  58. ":statement",
  59. "//executable_semantics/common:arena",
  60. "@com_google_googletest//:gtest_main",
  61. ],
  62. )
  63. cc_library(
  64. name = "declaration",
  65. srcs = ["declaration.cpp"],
  66. hdrs = [
  67. "declaration.h",
  68. ],
  69. deps = [
  70. ":ast_node",
  71. ":member",
  72. ":pattern",
  73. ":source_location",
  74. ":statement",
  75. ":static_scope",
  76. ":value_category",
  77. "//common:ostream",
  78. "//executable_semantics/common:nonnull",
  79. "@llvm-project//llvm:Support",
  80. ],
  81. )
  82. cc_library(
  83. name = "expression",
  84. srcs = ["expression.cpp"],
  85. hdrs = ["expression.h"],
  86. deps = [
  87. ":ast_node",
  88. ":paren_contents",
  89. ":static_scope",
  90. ":value_category",
  91. "//common:indirect_value",
  92. "//common:ostream",
  93. "//executable_semantics/common:arena",
  94. "//executable_semantics/common:error",
  95. "@llvm-project//llvm:Support",
  96. ],
  97. )
  98. cc_test(
  99. name = "expression_test",
  100. srcs = ["expression_test.cpp"],
  101. deps = [
  102. ":expression",
  103. ":paren_contents",
  104. "@com_google_googletest//:gtest_main",
  105. ],
  106. )
  107. cc_library(
  108. name = "member",
  109. srcs = ["member.cpp"],
  110. hdrs = ["member.h"],
  111. deps = [
  112. ":pattern",
  113. ":source_location",
  114. "//common:ostream",
  115. ],
  116. )
  117. cc_library(
  118. name = "library_name",
  119. hdrs = ["library_name.h"],
  120. )
  121. cc_library(
  122. name = "paren_contents",
  123. hdrs = ["paren_contents.h"],
  124. deps = [
  125. ":source_location",
  126. "//executable_semantics/common:error",
  127. ],
  128. )
  129. cc_library(
  130. name = "pattern",
  131. srcs = ["pattern.cpp"],
  132. hdrs = ["pattern.h"],
  133. deps = [
  134. ":ast_node",
  135. ":expression",
  136. ":source_location",
  137. ":static_scope",
  138. ":value_category",
  139. "//common:ostream",
  140. "//executable_semantics/common:arena",
  141. "//executable_semantics/common:error",
  142. "@llvm-project//llvm:Support",
  143. ],
  144. )
  145. cc_test(
  146. name = "pattern_test",
  147. srcs = ["pattern_test.cpp"],
  148. deps = [
  149. ":paren_contents",
  150. ":pattern",
  151. "@com_google_googletest//:gtest_main",
  152. "@llvm-project//llvm:Support",
  153. ],
  154. )
  155. cc_library(
  156. name = "static_scope",
  157. srcs = ["static_scope.cpp"],
  158. hdrs = ["static_scope.h"],
  159. deps = [
  160. ":ast_node",
  161. ":source_location",
  162. ":value_category",
  163. "//executable_semantics/common:arena",
  164. "//executable_semantics/common:error",
  165. ],
  166. )
  167. cc_library(
  168. name = "source_location",
  169. hdrs = ["source_location.h"],
  170. deps = [
  171. "//common:ostream",
  172. "//executable_semantics/common:nonnull",
  173. ],
  174. )
  175. cc_library(
  176. name = "statement",
  177. srcs = ["statement.cpp"],
  178. hdrs = ["statement.h"],
  179. deps = [
  180. ":ast_node",
  181. ":expression",
  182. ":pattern",
  183. ":source_location",
  184. ":value_category",
  185. "//common:check",
  186. "//common:ostream",
  187. "//executable_semantics/common:arena",
  188. "@llvm-project//llvm:Support",
  189. ],
  190. )
  191. cc_library(
  192. name = "value_category",
  193. hdrs = ["value_category.h"],
  194. )