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

Python Language parser using state-based lexical scanning. More...

#include <src/pyscanner.h>

Inheritance diagram for PythonOutlineParser:
Collaboration diagram for PythonOutlineParser:

Classes

struct  Private

Public Member Functions

 PythonOutlineParser ()
 ~PythonOutlineParser () 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.

Private Attributes

std::unique_ptr< Privatep

Detailed Description

Python Language parser using state-based lexical scanning.

This is the Python language parser for doxygen.

Definition at line 34 of file pyscanner.h.

Constructor & Destructor Documentation

◆ PythonOutlineParser()

PythonOutlineParser::PythonOutlineParser ( )

Definition at line 2453 of file pyscanner.l.

2453 : p(std::make_unique<PythonOutlineParser::Private>())
2454{
2455 pyscannerYYlex_init_extra(&p->state,&p->yyscanner);
2456#ifdef FLEX_DEBUG
2457 pyscannerYYset_debug(Debug::isFlagSet(Debug::Lex_pyscanner)?1:0,p->yyscanner);
2458#endif
2459}
@ Lex_pyscanner
Definition debug.h:66
static bool isFlagSet(const DebugMask mask)
Definition debug.cpp:132
std::unique_ptr< Private > p
Definition pyscanner.h:48

References Debug::isFlagSet(), Debug::Lex_pyscanner, and p.

◆ ~PythonOutlineParser()

PythonOutlineParser::~PythonOutlineParser ( )
override

Definition at line 2461 of file pyscanner.l.

2462{
2463 pyscannerYYlex_destroy(p->yyscanner);
2464}

References p.

Member Function Documentation

◆ needsPreprocessing()

bool PythonOutlineParser::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 2481 of file pyscanner.l.

2482{
2483 return FALSE;
2484}
#define FALSE
Definition qcstring.h:34

References FALSE.

◆ parseInput()

void PythonOutlineParser::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 2467 of file pyscanner.l.

2471{
2472 struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
2473 yyextra->thisParser = this;
2474 DebugLex debugLex(Debug::Lex_pyscanner, __FILE__, qPrint(fileName));
2475 ::parseMain(p->yyscanner, fileName,fileBuf,root);
2476
2477 // May print the AST for debugging purposes
2478 // printAST(global_root);
2479}
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:687

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

◆ parsePrototype()

void PythonOutlineParser::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 2486 of file pyscanner.l.

2487{
2488 ::parsePrototype(p->yyscanner,text);
2489}
void parsePrototype(const QCString &text) override
Callback function called by the comment block scanner.
Definition pyscanner.l:2486

References p.

Member Data Documentation

◆ p

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

Definition at line 48 of file pyscanner.h.

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


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