//===--- Token.h - Token interface ------------------------------*- 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 Token interface. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_LEX_TOKEN_H #define LLVM_CLANG_LEX_TOKEN_H #include "clang/Basic/SourceLocation.h" #include "clang/Basic/TokenKinds.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringRef.h" #include <cassert> namespace clang { class IdentifierInfo; class LangOptions; /// Token - This structure provides full information about a lexed token. /// It is not intended to be space efficient, it is intended to return as much /// information as possible about each returned token. This is expected to be /// compressed into a smaller form if memory footprint is important. /// /// The parser can create a special "annotation token" representing a stream of /// tokens that were parsed and semantically resolved, e.g.: "foo::MyClass<int>" /// can be represented by a single typename annotation token that carries /// information about the SourceRange of the tokens and the type object. class Token { … }; /// Information about the conditional stack (\#if directives) /// currently active. struct PPConditionalInfo { … }; // Extra information needed for annonation tokens. struct PragmaLoopHintInfo { … }; } // end namespace clang #endif // LLVM_CLANG_LEX_TOKEN_H