BUILD 5.5 KB

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