//===- Lexer.h - C Language Family Lexer ------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file defines the Lexer interface. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_LEX_LEXER_H #define LLVM_CLANG_LEX_LEXER_H #include "clang/Basic/LangOptions.h" #include "clang/Basic/SourceLocation.h" #include "clang/Basic/TokenKinds.h" #include "clang/Lex/DependencyDirectivesScanner.h" #include "clang/Lex/PreprocessorLexer.h" #include "clang/Lex/Token.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include <cassert> #include <cstdint> #include <optional> #include <string> namespace llvm { class MemoryBufferRef; } // namespace llvm namespace clang { class DiagnosticBuilder; class Preprocessor; class SourceManager; class LangOptions; /// ConflictMarkerKind - Kinds of conflict marker which the lexer might be /// recovering from. enum ConflictMarkerKind { … }; /// Describes the bounds (start, size) of the preamble and a flag required by /// PreprocessorOptions::PrecompiledPreambleBytes. /// The preamble includes the BOM, if any. struct PreambleBounds { … }; /// Lexer - This provides a simple interface that turns a text buffer into a /// stream of tokens. This provides no support for file reading or buffering, /// or buffering/seeking of tokens, only forward lexing is supported. It relies /// on the specified Preprocessor object to handle preprocessor directives, etc. class Lexer : public PreprocessorLexer { … }; } // namespace clang #endif // LLVM_CLANG_LEX_LEXER_H