Skip to main content

The FortranOutlineParser Class Reference

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

Declaration

class FortranOutlineParser { ... }

Included Headers

Base class

classOutlineParserInterface

Abstract interface for outline parsers. More...

Derived Classes

classFortranOutlineParserFixed
classFortranOutlineParserFree

Public Constructors Index

FortranOutlineParser (FortranFormat format=FortranFormat::Unknown)

Public Destructor Index

~FortranOutlineParser () 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

Fortran language parser using state-based lexical scanning.

This is the Fortran language parser for doxygen.

Definition at line 27 of file fortranscanner.h.

Public Constructors

FortranOutlineParser()

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

Declaration at line 30 of file fortranscanner.h, definition at line 3343 of file fortranscanner.l.

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

Reference p.

Referenced by FortranOutlineParserFixed::FortranOutlineParserFixed and FortranOutlineParserFree::FortranOutlineParserFree.

Public Destructor

~FortranOutlineParser()

FortranOutlineParser::~FortranOutlineParser ()

Declaration at line 31 of file fortranscanner.h, definition at line 3348 of file fortranscanner.l.

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

Reference p.

Public Member Functions

needsPreprocessing()

bool FortranOutlineParser::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 37 of file fortranscanner.h, definition at line 3366 of file fortranscanner.l.

3367{
3368 return extension!=extension.lower(); // use preprocessor only for upper case extensions
3369}

Reference QCString::lower.

parseInput()

void FortranOutlineParser::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 33 of file fortranscanner.h, definition at line 3353 of file fortranscanner.l.

3354 const char *fileBuf,
3355 const std::shared_ptr<Entry> &root,
3356 ClangTUParser * /*clangParser*/)
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}

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

parsePrototype()

void FortranOutlineParser::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 38 of file fortranscanner.h, 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}

References FALSE, p, popBuffer, pushBuffer and TRUE.

Private Member Attributes

p

std::unique_ptr<Private> FortranOutlineParser::p

Definition at line 42 of file fortranscanner.h.

42 std::unique_ptr<Private> p;

Referenced by FortranOutlineParser, parseInput, parsePrototype and ~FortranOutlineParser.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.