28#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_DIRECTIVETREE_H
29#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_DIRECTIVETREE_H
32#include "clang/Basic/TokenKinds.h"
68 clang::tok::PPKeywordKind Kind = clang::tok::pp_not_keyword;
79 std::vector<std::pair<Directive, DirectiveTree>> Branches;
86 std::optional<unsigned> Taken;
90 using Chunk = std::variant<Code, Directive, Conditional>;
91 std::vector<Chunk> Chunks;
94 static DirectiveTree parse(
const TokenStream &);
100 TokenStream stripDirectives(
const TokenStream &)
const;
102llvm::raw_ostream &
operator<<(llvm::raw_ostream &,
const DirectiveTree &);
103llvm::raw_ostream &
operator<<(llvm::raw_ostream &,
const DirectiveTree::Code &);
104llvm::raw_ostream &
operator<<(llvm::raw_ostream &,
105 const DirectiveTree::Directive &);
106llvm::raw_ostream &
operator<<(llvm::raw_ostream &,
107 const DirectiveTree::Conditional &);
A complete sequence of Tokens representing a source file.
FIXME: Skip testing on windows temporarily due to the different escaping code mode.
std::vector< Token::Range > pairDirectiveRanges(const DirectiveTree &Tree, const TokenStream &Code)
Pairs preprocessor conditional directives and computes their token ranges.
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const CodeCompletion &C)
void chooseConditionalBranches(DirectiveTree &Tree, const TokenStream &Code)
Describes the structure of a source file, as seen by the preprocessor.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//