BUILD 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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. ":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. "//executable_semantics/common:arena",
  62. "@com_google_googletest//:gtest_main",
  63. ],
  64. )
  65. cc_library(
  66. name = "generic_binding",
  67. hdrs = [
  68. "generic_binding.h",
  69. ],
  70. deps = [
  71. ":ast_node",
  72. ":source_location",
  73. ":value_category",
  74. "//common:check",
  75. "//common:ostream",
  76. "//executable_semantics/common:nonnull",
  77. "@llvm-project//llvm:Support",
  78. ],
  79. )
  80. cc_library(
  81. name = "declaration",
  82. srcs = ["declaration.cpp"],
  83. hdrs = [
  84. "declaration.h",
  85. ],
  86. deps = [
  87. ":ast_node",
  88. ":generic_binding",
  89. ":pattern",
  90. ":return_term",
  91. ":source_location",
  92. ":statement",
  93. ":static_scope",
  94. ":value_category",
  95. "//common:ostream",
  96. "//executable_semantics/common:nonnull",
  97. "@llvm-project//llvm:Support",
  98. ],
  99. )
  100. cc_library(
  101. name = "return_term",
  102. hdrs = ["return_term.h"],
  103. deps = [
  104. ":expression",
  105. ":source_location",
  106. "//common:check",
  107. "//common:ostream",
  108. "//executable_semantics/common:nonnull",
  109. "@llvm-project//llvm:Support",
  110. ],
  111. )
  112. cc_library(
  113. name = "expression",
  114. srcs = ["expression.cpp"],
  115. hdrs = ["expression.h"],
  116. deps = [
  117. ":ast_node",
  118. ":generic_binding",
  119. ":paren_contents",
  120. ":source_location",
  121. ":static_scope",
  122. ":value_category",
  123. "//common:indirect_value",
  124. "//common:ostream",
  125. "//executable_semantics/common:arena",
  126. "//executable_semantics/common:error",
  127. "@llvm-project//llvm:Support",
  128. ],
  129. )
  130. cc_test(
  131. name = "expression_test",
  132. srcs = ["expression_test.cpp"],
  133. deps = [
  134. ":expression",
  135. ":paren_contents",
  136. "//executable_semantics/common:arena",
  137. "@com_google_googletest//:gtest_main",
  138. "@llvm-project//llvm:Support",
  139. ],
  140. )
  141. cc_library(
  142. name = "library_name",
  143. hdrs = ["library_name.h"],
  144. )
  145. cc_library(
  146. name = "paren_contents",
  147. hdrs = ["paren_contents.h"],
  148. deps = [
  149. ":source_location",
  150. "//executable_semantics/common:error",
  151. ],
  152. )
  153. cc_library(
  154. name = "pattern",
  155. srcs = ["pattern.cpp"],
  156. hdrs = ["pattern.h"],
  157. deps = [
  158. ":ast_node",
  159. ":expression",
  160. ":source_location",
  161. ":static_scope",
  162. ":value_category",
  163. "//common:ostream",
  164. "//executable_semantics/common:arena",
  165. "//executable_semantics/common:error",
  166. "@llvm-project//llvm:Support",
  167. ],
  168. )
  169. cc_test(
  170. name = "pattern_test",
  171. srcs = ["pattern_test.cpp"],
  172. deps = [
  173. ":expression",
  174. ":paren_contents",
  175. ":pattern",
  176. "//executable_semantics/common:arena",
  177. "@com_google_googletest//:gtest_main",
  178. "@llvm-project//llvm:Support",
  179. ],
  180. )
  181. cc_library(
  182. name = "static_scope",
  183. srcs = ["static_scope.cpp"],
  184. hdrs = ["static_scope.h"],
  185. deps = [
  186. ":ast_node",
  187. ":source_location",
  188. ":value_category",
  189. "//common:check",
  190. "//executable_semantics/common:error",
  191. "//executable_semantics/common:nonnull",
  192. ],
  193. )
  194. cc_library(
  195. name = "source_location",
  196. hdrs = ["source_location.h"],
  197. deps = [
  198. "//common:ostream",
  199. "//executable_semantics/common:nonnull",
  200. ],
  201. )
  202. cc_library(
  203. name = "statement",
  204. srcs = ["statement.cpp"],
  205. hdrs = ["statement.h"],
  206. deps = [
  207. ":ast_node",
  208. ":expression",
  209. ":pattern",
  210. ":return_term",
  211. ":source_location",
  212. ":static_scope",
  213. ":value_category",
  214. "//common:check",
  215. "//common:ostream",
  216. "//executable_semantics/common:arena",
  217. "@llvm-project//llvm:Support",
  218. ],
  219. )
  220. cc_library(
  221. name = "value_category",
  222. hdrs = ["value_category.h"],
  223. )