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< Private > p

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 996 of file lexscanner.l.

996 : p(std::make_unique<LexOutlineParser::Private>())
997{
998 lexscannerYYlex_init_extra(&p->state,&p->yyscanner);
999#ifdef FLEX_DEBUG
1000 lexscannerYYset_debug(Debug::isFlagSet(Debug::Lex_lexscanner)?1:0,p->yyscanner);
1001#endif
1002}
@ 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 1004 of file lexscanner.l.

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

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 1009 of file lexscanner.l.

1013{
1014 struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
1015
1016 yyextra->fileName = fileName;
1017 DebugLex debugLex(Debug::Lex_lexscanner, __FILE__, qPrint(fileName));
1018
1019 ::parseMain(p->yyscanner,fileName,fileBuf,root,clangParser);
1020}
#define yyguts_t
Definition code.l:23
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:937

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

◆ 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: