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

Fortran language parser using state-based lexical scanning. More...

#include <src/fortranscanner.h>

Inheritance diagram for FortranOutlineParser:
Collaboration diagram for FortranOutlineParser:

Classes

struct  Private

Public Member Functions

 FortranOutlineParser (FortranFormat format=FortranFormat::Unknown)
 ~FortranOutlineParser () 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

Fortran language parser using state-based lexical scanning.

This is the Fortran language parser for doxygen.

Definition at line 27 of file fortranscanner.h.

Constructor & Destructor Documentation

◆ FortranOutlineParser()

FortranOutlineParser::FortranOutlineParser ( FortranFormat format = FortranFormat::Unknown)

Definition at line 3354 of file fortranscanner.l.

3355 : p(std::make_unique<Private>(format))
3356{
3357}
std::unique_ptr< Private > p

References p.

Referenced by FortranOutlineParserFixed::FortranOutlineParserFixed(), and FortranOutlineParserFree::FortranOutlineParserFree().

◆ ~FortranOutlineParser()

FortranOutlineParser::~FortranOutlineParser ( )
override

Definition at line 3359 of file fortranscanner.l.

3360{
3361 fortranscannerYYlex_destroy(p->yyscanner);
3362}

References p.

Member Function Documentation

◆ needsPreprocessing()

bool FortranOutlineParser::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 3377 of file fortranscanner.l.

3378{
3379 return extension!=extension.lower(); // use preprocessor only for upper case extensions
3380}
QCString lower() const
Definition qcstring.h:249

References QCString::lower().

◆ parseInput()

void FortranOutlineParser::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 3364 of file fortranscanner.l.

3368{
3369 struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
3370 yyextra->thisParser = this;
3371
3372 DebugLex debugLex(Debug::Lex_fortranscanner, __FILE__, qPrint(fileName));
3373
3374 ::parseMain(p->yyscanner,fileName,fileBuf,root,p->format);
3375}
@ Lex_fortranscanner
Definition debug.h:62
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_fortranscanner, p, parseMain(), and qPrint().

◆ parsePrototype()

void FortranOutlineParser::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 3382 of file fortranscanner.l.

3383{
3384 struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
3385 pushBuffer(p->yyscanner,text);
3386 yyextra->parsingPrototype = TRUE;
3387 BEGIN(Prototype);
3388 fortranscannerYYlex(p->yyscanner);
3389 yyextra->parsingPrototype = FALSE;
3390 popBuffer(p->yyscanner);
3391}
static void popBuffer(yyscan_t yyscanner)
static void pushBuffer(yyscan_t yyscanner, const QCString &buffer)
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34

References FALSE, p, popBuffer(), pushBuffer(), and TRUE.

Member Data Documentation

◆ p

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

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