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

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 3343 of file fortranscanner.l.

3344 : p(std::make_unique<Private>(format))
3345{
3346}
std::unique_ptr< Private > p

References p.

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

◆ ~FortranOutlineParser()

FortranOutlineParser::~FortranOutlineParser ( )
override

Definition at line 3348 of file fortranscanner.l.

3349{
3350 fortranscannerYYlex_destroy(p->yyscanner);
3351}

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 3366 of file fortranscanner.l.

3367{
3368 return extension!=extension.lower(); // use preprocessor only for upper case extensions
3369}
QCString lower() const
Definition qcstring.h:234

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 3353 of file fortranscanner.l.

3357{
3358 struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
3359 yyextra->thisParser = this;
3360
3361 DebugLex debugLex(Debug::Lex_fortranscanner, __FILE__, qPrint(fileName));
3362
3363 ::parseMain(p->yyscanner,fileName,fileBuf,root,p->format);
3364}
@ Lex_fortranscanner
Definition debug.h:60
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_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 3371 of file fortranscanner.l.

3372{
3373 struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
3374 pushBuffer(p->yyscanner,text);
3375 yyextra->parsingPrototype = TRUE;
3376 BEGIN(Prototype);
3377 fortranscannerYYlex(p->yyscanner);
3378 yyextra->parsingPrototype = FALSE;
3379 popBuffer(p->yyscanner);
3380}
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: