lex.h 883 B

12345678910111213141516171819202122232425
  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 CARBON_TOOLCHAIN_LEX_LEX_H_
  5. #define CARBON_TOOLCHAIN_LEX_LEX_H_
  6. #include "toolchain/base/shared_value_stores.h"
  7. #include "toolchain/diagnostics/diagnostic_emitter.h"
  8. #include "toolchain/lex/tokenized_buffer.h"
  9. #include "toolchain/source/source_buffer.h"
  10. namespace Carbon::Lex {
  11. // Lexes a buffer of source code into a tokenized buffer.
  12. //
  13. // The provided source buffer must outlive any returned `TokenizedBuffer`
  14. // which will refer into the source.
  15. auto Lex(SharedValueStores& value_stores,
  16. SourceBuffer& source [[clang::lifetimebound]],
  17. Diagnostics::Consumer& consumer) -> TokenizedBuffer;
  18. } // namespace Carbon::Lex
  19. #endif // CARBON_TOOLCHAIN_LEX_LEX_H_