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.
 
- Public Member Functions inherited from OutlineParserInterface

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 2334 of file pyscanner.l.

2334 : p(std::make_unique<PythonOutlineParser::Private>())
2335{
2336 pyscannerYYlex_init_extra(&p->state,&p->yyscanner);
2337#ifdef FLEX_DEBUG
2338 pyscannerYYset_debug(Debug::isFlagSet(Debug::Lex_pyscanner)?1:0,p->yyscanner);
2339#endif
2340}
@ Lex_pyscanner
Definition debug.h:65
static bool isFlagSet(const DebugMask mask)
Definition debug.cpp:135
std::unique_ptr< Private > p
Definition pyscanner.h:48

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

Referenced by PythonOutlineParser().

◆ ~PythonOutlineParser()

PythonOutlineParser::~PythonOutlineParser ( )
override

Definition at line 2342 of file pyscanner.l.

2343{
2344 pyscannerYYlex_destroy(p->yyscanner);
2345}

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 2362 of file pyscanner.l.

2363{
2364 return FALSE;
2365}
#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 2348 of file pyscanner.l.

2352{
2353 struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
2354 yyextra->thisParser = this;
2355 DebugLex debugLex(Debug::Lex_pyscanner, __FILE__, qPrint(fileName));
2356 ::parseMain(p->yyscanner, fileName,fileBuf,root);
2357
2358 // May print the AST for debugging purposes
2359 // printAST(global_root);
2360}
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:672

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 2367 of file pyscanner.l.

2368{
2369 ::parsePrototype(p->yyscanner,text);
2370}
void parsePrototype(const QCString &text) override
Callback function called by the comment block scanner.
Definition pyscanner.l:2367

References p, and parsePrototype().

Referenced by parsePrototype().

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: