Doxygen
Loading...
Searching...
No Matches
COutlineParser Class Reference

C-like language parser using state-based lexical scanning. More...

#include <src/scanner.h>

+ Inheritance diagram for COutlineParser:
+ Collaboration diagram for COutlineParser:

Classes

struct  Private
 

Public Member Functions

 COutlineParser ()
 
 COutlineParser (const COutlineParser &)=delete
 
COutlineParseroperator= (COutlineParser &)=delete
 
 COutlineParser (COutlineParser &&)=delete
 
COutlineParseroperator= (COutlineParser &&)=delete
 
 ~COutlineParser () override
 
void parseInput (const QCString &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 QCString &extension) 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 QCString &text) override
 Callback function called by the comment block scanner.
 
- Public Member Functions inherited from OutlineParserInterface

Private Attributes

std::unique_ptr< Privatep
 

Detailed Description

C-like language parser using state-based lexical scanning.

This is the language parser for doxygen. It is somewhat fuzzy and supports C++ and various languages that are closely related to C++, such as C, C#, Objective-C, Java, PHP, and IDL.

Definition at line 29 of file scanner.h.

Constructor & Destructor Documentation

◆ COutlineParser() [1/3]

COutlineParser::COutlineParser ( )

Definition at line 8334 of file scanner.l.

8334 : p(std::make_unique<COutlineParser::Private>())
8335{
8336 scannerYYlex_init_extra(&p->state,&p->yyscanner);
8337#ifdef FLEX_DEBUG
8338 scannerYYset_debug(Debug::isFlagSet(Debug::Lex_scanner)?1:0,p->yyscanner);
8339#endif
8340}
std::unique_ptr< Private > p
Definition scanner.h:46
@ Lex_scanner
Definition debug.h:66
static bool isFlagSet(const DebugMask mask)
Definition debug.cpp:135

References COutlineParser(), Debug::isFlagSet(), Debug::Lex_scanner, and p.

Referenced by COutlineParser(), COutlineParser(), COutlineParser(), operator=(), and operator=().

◆ COutlineParser() [2/3]

COutlineParser::COutlineParser ( const COutlineParser & )
delete

References COutlineParser().

◆ COutlineParser() [3/3]

COutlineParser::COutlineParser ( COutlineParser && )
delete

References COutlineParser().

◆ ~COutlineParser()

COutlineParser::~COutlineParser ( )
override

Definition at line 8342 of file scanner.l.

8343{
8344 scannerYYlex_destroy(p->yyscanner);
8345}

References p.

Member Function Documentation

◆ needsPreprocessing()

bool COutlineParser::needsPreprocessing ( const QCString & extension) const
overridevirtual

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 8362 of file scanner.l.

8363{
8364 QCString fe=extension.lower();
8365 SrcLangExt lang = getLanguageFromFileName(extension);
8366 return (SrcLangExt::Cpp == lang) || (SrcLangExt::Lex == lang) ||
8367 !( fe==".java" || fe==".as" || fe==".d" || fe==".php" ||
8368 fe==".php4" || fe==".inc" || fe==".phtml"|| fe==".php5"
8369 );
8370}
QCString lower() const
Definition qcstring.h:234
SrcLangExt
Language as given by extension.
Definition types.h:42
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5549

References Cpp, getLanguageFromFileName(), Lex, and QCString::lower().

◆ operator=() [1/2]

COutlineParser & COutlineParser::operator= ( COutlineParser && )
delete

References COutlineParser().

◆ operator=() [2/2]

COutlineParser & COutlineParser::operator= ( COutlineParser & )
delete

References COutlineParser().

◆ parseInput()

void COutlineParser::parseInput ( const QCString & 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 8347 of file scanner.l.

8351{
8352 AUTO_TRACE();
8353 struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
8354 yyextra->thisParser = this;
8355
8356 DebugLex debugLex(Debug::Lex_scanner, __FILE__, qPrint(fileName));
8357
8358 ::parseMain(p->yyscanner,fileName,fileBuf,root,clangParser);
8359}
#define AUTO_TRACE(...)
Definition docnode.cpp:46
static void parseMain(yyscan_t yyscanner, const QCString &fileName, const char *fileBuf, const std::shared_ptr< Entry > &rt, FortranFormat format)
const char * qPrint(const char *s)
Definition qcstring.h:661

References AUTO_TRACE, Debug::Lex_scanner, p, parseMain(), and qPrint().

◆ parsePrototype()

void COutlineParser::parsePrototype ( const QCString & text)
overridevirtual

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 8372 of file scanner.l.

8373{
8374 ::parsePrototype(p->yyscanner,text);
8375}
void parsePrototype(const QCString &text) override
Callback function called by the comment block scanner.
Definition scanner.l:8372

References p, and parsePrototype().

Referenced by parsePrototype().

Member Data Documentation

◆ p

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

Definition at line 46 of file scanner.h.

Referenced by COutlineParser(), parseInput(), parsePrototype(), and ~COutlineParser().


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