Skip to main content

The PythonOutlineParser Class Reference

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

Declaration

class PythonOutlineParser { ... }

Included Headers

#include <src/pyscanner.h>

Base class

classOutlineParserInterface

Abstract interface for outline parsers. More...

Public Constructors Index

PythonOutlineParser ()

Public Destructor Index

~PythonOutlineParser () override

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

Python Language parser using state-based lexical scanning.

This is the Python language parser for doxygen.

Definition at line 34 of file pyscanner.h.

Public Constructors

PythonOutlineParser()

PythonOutlineParser::PythonOutlineParser ()

Declaration at line 37 of file pyscanner.h, definition at line 2343 of file pyscanner.l.

2344{
2345 pyscannerYYlex_init_extra(&p->state,&p->yyscanner);
2346#ifdef FLEX_DEBUG
2347 pyscannerYYset_debug(Debug::isFlagSet(Debug::Lex_pyscanner)?1:0,p->yyscanner);
2348#endif
2349}

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

Referenced by PythonOutlineParser.

Public Destructor

~PythonOutlineParser()

PythonOutlineParser::~PythonOutlineParser ()

Declaration at line 38 of file pyscanner.h, definition at line 2351 of file pyscanner.l.

2352{
2353 pyscannerYYlex_destroy(p->yyscanner);
2354}

Reference p.

Public Member Functions

needsPreprocessing()

bool PythonOutlineParser::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 44 of file pyscanner.h, definition at line 2371 of file pyscanner.l.

2372{
2373 return FALSE;
2374}

Reference FALSE.

parseInput()

void PythonOutlineParser::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 40 of file pyscanner.h, definition at line 2357 of file pyscanner.l.

2358 const char *fileBuf,
2359 const std::shared_ptr<Entry> &root,
2360 ClangTUParser * /*clangParser*/)
2361{
2362 struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
2363 yyextra->thisParser = this;
2364 DebugLex debugLex(Debug::Lex_pyscanner, __FILE__, qPrint(fileName));
2365 ::parseMain(p->yyscanner, fileName,fileBuf,root);
2366
2367 // May print the AST for debugging purposes
2368 // printAST(global_root);
2369}

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

parsePrototype()

void PythonOutlineParser::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 45 of file pyscanner.h, definition at line 2376 of file pyscanner.l.

2377{
2378 ::parsePrototype(p->yyscanner,text);
2379}

References p and parsePrototype.

Referenced by parsePrototype.

Private Member Attributes

p

std::unique_ptr<Private> PythonOutlineParser::p

Definition at line 48 of file pyscanner.h.

48 std::unique_ptr<Private> p;

Referenced by parseInput, parsePrototype, PythonOutlineParser and ~PythonOutlineParser.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.