Doxygen
Loading...
Searching...
No Matches
LexOutlineParser Class Referencefinal

Lex language parser using state-based lexical scanning. More...

#include <src/lexscanner.h>

Inheritance diagram for LexOutlineParser:
Collaboration diagram for LexOutlineParser:

Classes

struct  Private

Public Member Functions

 LexOutlineParser ()
 ~LexOutlineParser () override
void parseInput (const DString &fileName, const char *fileBuf, const std::shared_ptr< Entry > &root, ClangTUParser *clangParser) override
 Parses a single input file with the goal to build an Entry tree.
bool needsPreprocessing (const DString &) const override
 Returns true if the language identified by extension needs the C preprocessor to be run before feed the result to the input parser.
void parsePrototype (const DString &) override
 Callback function called by the comment block scanner.

Private Attributes

std::unique_ptr< Privatep

Detailed Description

Lex language parser using state-based lexical scanning.

This is the Lex language parser for doxygen.

Definition at line 25 of file lexscanner.h.

Constructor & Destructor Documentation

◆ LexOutlineParser()

LexOutlineParser::LexOutlineParser ( )

Definition at line 995 of file lexscanner.l.

995 : p(std::make_unique<LexOutlineParser::Private>())
996{
997 lexscannerYYlex_init_extra(&p->state,&p->yyscanner);
998#ifdef FLEX_DEBUG
999 lexscannerYYset_debug(Debug::isFlagSet(Debug::Lex_lexscanner)?1:0,p->yyscanner);
1000#endif
1001}
@ Lex_lexscanner
Definition debug.h:65
static bool isFlagSet(const DebugMask mask)
Definition debug.cpp:132
std::unique_ptr< Private > p
Definition lexscanner.h:40

References Debug::isFlagSet(), Debug::Lex_lexscanner, LexOutlineParser(), and p.

Referenced by LexOutlineParser().

◆ ~LexOutlineParser()

LexOutlineParser::~LexOutlineParser ( )
override

Definition at line 1003 of file lexscanner.l.

1004{
1005 lexscannerYYlex_destroy(p->yyscanner);
1006}

References p.

Member Function Documentation

◆ needsPreprocessing()

bool LexOutlineParser::needsPreprocessing ( const DString & extension) const
inlineoverridevirtual

Returns true if the language identified by extension needs the C preprocessor to be run before feed the result to the input parser.

See also
parseInput()

Implements OutlineParserInterface.

Definition at line 35 of file lexscanner.h.

35{ return true; }

◆ parseInput()

void LexOutlineParser::parseInput ( const DString & fileName,
const char * fileBuf,
const std::shared_ptr< Entry > & root,
ClangTUParser * clangParser )
overridevirtual

Parses a single input file with the goal to build an Entry tree.

Parameters
[in]fileNameThe full name of the file.
[in]fileBufThe contents of the file (zero terminated).
[in,out]rootThe root of the tree of Entry *nodes representing the information extracted from the file.
[in]clangParserThe clang translation unit parser object or nullptr if disabled.

Implements OutlineParserInterface.

Definition at line 1008 of file lexscanner.l.

1012{
1013 struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
1014
1015 yyextra->fileName = fileName;
1016 DebugLex debugLex(Debug::Lex_lexscanner, __FILE__, qPrint(fileName));
1017
1018 ::parseMain(p->yyscanner,fileName,fileBuf,root,clangParser);
1019}
const char * qPrint(const char *s)
Definition dstring.h:783
static void parseMain(yyscan_t yyscanner, const DString &fileName, const char *fileBuf, const std::shared_ptr< Entry > &rt, ClangTUParser *clangParser)
Definition lexscanner.l:936

References Debug::Lex_lexscanner, p, parseMain(), and qPrint().

◆ parsePrototype()

void LexOutlineParser::parsePrototype ( const DString & text)
inlineoverridevirtual

Callback function called by the comment block scanner.

It provides a string text containing the prototype of a function or variable. The parser should parse this and store the information in the Entry node that corresponds with the node for which the comment block parser was invoked.

Implements OutlineParserInterface.

Definition at line 36 of file lexscanner.h.

36{}

Member Data Documentation

◆ p

std::unique_ptr<Private> LexOutlineParser::p
private

Definition at line 40 of file lexscanner.h.

Referenced by LexOutlineParser(), parseInput(), and ~LexOutlineParser().


The documentation for this class was generated from the following files: