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 DString &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 DString &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 DString &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 25 of file fortranscanner.h.

Constructor & Destructor Documentation

◆ FortranOutlineParser()

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

Definition at line 3437 of file fortranscanner.l.

3438 : p(std::make_unique<Private>(format))
3439{
3440}
std::unique_ptr< Private > p

References p.

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

◆ ~FortranOutlineParser()

FortranOutlineParser::~FortranOutlineParser ( )
overridedefault

Member Function Documentation

◆ needsPreprocessing()

bool FortranOutlineParser::needsPreprocessing ( const DString & 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 3457 of file fortranscanner.l.

3458{
3459 return extension!=extension.lower(); // use preprocessor only for upper case extensions
3460}
DString lower() const
Definition dstring.h:330

References DString::lower().

Referenced by ~FortranOutlineParser().

◆ parseInput()

void FortranOutlineParser::parseInput ( const DString & 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 3444 of file fortranscanner.l.

3448{
3449 struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
3450 yyextra->thisParser = this;
3451
3452 DebugLex debugLex(Debug::Lex_fortranscanner, __FILE__, qPrint(fileName));
3453
3454 ::parseMain(p->yyscanner,fileName,fileBuf,root,p->format);
3455}
@ Lex_fortranscanner
Definition debug.h:63
const char * qPrint(const char *s)
Definition dstring.h:787
static void parseMain(yyscan_t yyscanner, const DString &fileName, const char *fileBuf, const std::shared_ptr< Entry > &rt, FortranFormat format)

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

Referenced by ~FortranOutlineParser().

◆ parsePrototype()

void FortranOutlineParser::parsePrototype ( const DString & 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 3462 of file fortranscanner.l.

3463{
3464 struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
3465 pushBuffer(p->yyscanner,text);
3466 yyextra->parsingPrototype = true;
3467 BEGIN(Prototype);
3468 fortranscannerYYlex(p->yyscanner);
3469 yyextra->parsingPrototype = false;
3470 popBuffer(p->yyscanner);
3471}
static void pushBuffer(yyscan_t yyscanner, const DString &buffer)
static void popBuffer(yyscan_t yyscanner)

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

Referenced by ~FortranOutlineParser().

Member Data Documentation

◆ p

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

Definition at line 40 of file fortranscanner.h.

Referenced by FortranOutlineParser(), parseInput(), and parsePrototype().


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