Skip to content

Parser

class Parser

C++ source parser.

Variables

Name Description
defines Defines.
parser C++ parser.
query C++ query.

Functions

Name Description
Parser Constructor.
~Parser Destructor.
parse Parse C++ source.
preprocess Preprocess C++ source, replacing preprocessor macros as defined in the config file and attempting to recover from any parse errors.
report Report errors after preprocessing.
translate Translate documentation comment.

Variable Details

defines

std::unordered_map<std::string,std::string> defines

Defines.

parser

TSParser* parser

C++ parser.

query

TSQuery* query

C++ query.

Function Details

Parser

Parser(const std::unordered_map<std::string,std::string>& defines)

Constructor.

parse

void parse(const std::string& file, Entity& global)

Parse C++ source.

file
C++ source file name.
global
Global namespace.

preprocess

std::string preprocess(const std::string& file)

Preprocess C++ source, replacing preprocessor macros as defined in the config file and attempting to recover from any parse errors. This is silent and does not report uncorrectable errors, these are reported later.

file
C++ source file name.
Return
Preprocessed source.

report

void report(const std::string& file, const std::string& in, TSTree* tree)

Report errors after preprocessing.

file
C++ source file name.
in
Preprocessed source.
tree
Parse tree for file.

translate

void translate(const std::string_view& comment, Entity& entity)

Translate documentation comment.

comment
Documentation comment.
entity
Entity to document.

~Parser

~Parser()

Destructor.