lex.h 838 B

123456789101112131415161718192021222324
  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/value_store.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, SourceBuffer& source,
  16. DiagnosticConsumer& consumer) -> TokenizedBuffer;
  17. } // namespace Carbon::Lex
  18. #endif // CARBON_TOOLCHAIN_LEX_LEX_H_