Skip to main content

The COutlineParser Class Reference

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

Declaration

class COutlineParser { ... }

Included Headers

#include <src/scanner.h>

Base class

classOutlineParserInterface

Abstract interface for outline parsers. More...

Public Constructors Index

COutlineParser ()
COutlineParser (const COutlineParser &)=delete
COutlineParser (COutlineParser &&)=delete

Public Destructor Index

~COutlineParser () override

Public Operators Index

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

Public Member Functions Index

voidparseInput (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. More...

boolneedsPreprocessing (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. More...

voidparsePrototype (const QCString &text) override

Callback function called by the comment block scanner. More...

Private Member Attributes Index

std::unique_ptr< Private >p

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.

Public Constructors

COutlineParser()

COutlineParser::COutlineParser ()

Declaration at line 32 of file scanner.h, definition at line 8403 of file scanner.l.

8404{
8405 scannerYYlex_init_extra(&p->state,&p->yyscanner);
8406#ifdef FLEX_DEBUG
8407 scannerYYset_debug(Debug::isFlagSet(Debug::Lex_scanner)?1:0,p->yyscanner);
8408#endif
8409}

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

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

COutlineParser()

COutlineParser::COutlineParser (const COutlineParser &)
delete

Definition at line 33 of file scanner.h.

Reference COutlineParser.

COutlineParser()

COutlineParser::COutlineParser (COutlineParser &&)
delete

Definition at line 35 of file scanner.h.

Reference COutlineParser.

Public Destructor

~COutlineParser()

COutlineParser::~COutlineParser ()

Declaration at line 37 of file scanner.h, definition at line 8411 of file scanner.l.

8412{
8413 scannerYYlex_destroy(p->yyscanner);
8414}

Reference p.

Public Operators

operator=()

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

Definition at line 34 of file scanner.h.

Reference COutlineParser.

operator=()

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

Definition at line 36 of file scanner.h.

Reference COutlineParser.

Public Member Functions

needsPreprocessing()

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

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()

Declaration at line 42 of file scanner.h, definition at line 8431 of file scanner.l.

8432{
8433 QCString fe=extension.lower();
8434 SrcLangExt lang = getLanguageFromFileName(extension);
8435 return (SrcLangExt::Cpp == lang) || (SrcLangExt::Lex == lang) ||
8436 !( fe==".java" || fe==".as" || fe==".d" || fe==".php" ||
8437 fe==".php4" || fe==".inc" || fe==".phtml"|| fe==".php5"
8438 );
8439}

References getLanguageFromFileName and QCString::lower.

parseInput()

void COutlineParser::parseInput (const QCString & fileName, const char * fileBuf, const std::shared_ptr< Entry > & root, ClangTUParser * clangParser)
virtual

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

Parameters
[in] fileName

The full name of the file.

[in] fileBuf

The contents of the file (zero terminated).

[inout] root

The root of the tree of Entry *nodes representing the information extracted from the file.

[in] clangParser

The clang translation unit parser object or nullptr if disabled.

Declaration at line 38 of file scanner.h, definition at line 8416 of file scanner.l.

8417 const char *fileBuf,
8418 const std::shared_ptr<Entry> &root,
8419 ClangTUParser *clangParser)
8420{
8421 AUTO_TRACE();
8422 struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
8423 yyextra->thisParser = this;
8424
8425 DebugLex debugLex(Debug::Lex_scanner, __FILE__, qPrint(fileName));
8426
8427 ::parseMain(p->yyscanner,fileName,fileBuf,root,clangParser);
8428}

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

parsePrototype()

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

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.

Declaration at line 43 of file scanner.h, definition at line 8441 of file scanner.l.

8442{
8443 ::parsePrototype(p->yyscanner,text);
8444}

References p and parsePrototype.

Referenced by parsePrototype.

Private Member Attributes

p

std::unique_ptr<Private> COutlineParser::p

Definition at line 46 of file scanner.h.

46 std::unique_ptr<Private> p;

Referenced by COutlineParser, parseInput, parsePrototype and ~COutlineParser.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.