//===--- LiteralSupport.h ---------------------------------------*- 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 NumericLiteralParser, CharLiteralParser, and // StringLiteralParser interfaces. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_LEX_LITERALSUPPORT_H #define LLVM_CLANG_LEX_LITERALSUPPORT_H #include "clang/Basic/CharInfo.h" #include "clang/Basic/LLVM.h" #include "clang/Basic/TokenKinds.h" #include "llvm/ADT/APFloat.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/DataTypes.h" namespace clang { class DiagnosticsEngine; class Preprocessor; class Token; class SourceLocation; class TargetInfo; class SourceManager; class LangOptions; /// Copy characters from Input to Buf, expanding any UCNs. void expandUCNs(SmallVectorImpl<char> &Buf, StringRef Input); /// Return true if the token corresponds to a function local predefined macro, /// which expands to a string literal, that can be concatenated with other /// string literals (only in Microsoft mode). bool isFunctionLocalStringLiteralMacro(tok::TokenKind K, const LangOptions &LO); /// Return true if the token is a string literal, or a function local /// predefined macro, which expands to a string literal. bool tokenIsLikeStringLiteral(const Token &Tok, const LangOptions &LO); /// NumericLiteralParser - This performs strict semantic analysis of the content /// of a ppnumber, classifying it as either integer, floating, or erroneous, /// determines the radix of the value and can convert it to a useful value. class NumericLiteralParser { … }; /// CharLiteralParser - Perform interpretation and semantic analysis of a /// character literal. class CharLiteralParser { … }; enum class StringLiteralEvalMethod { … }; /// StringLiteralParser - This decodes string escape characters and performs /// wide string analysis and Translation Phase #6 (concatenation of string /// literals) (C99 5.1.1.2p1). class StringLiteralParser { … }; } // end namespace clang #endif