doxygen
Public Member Functions | List of all members
CodeParserInterface Class Referenceabstract

Abstract interface for code parsers. More...

#include <parserintf.h>

Inheritance diagram for CodeParserInterface:
Inheritance graph
[legend]

Public Member Functions

virtual void parseCode (OutputCodeList &codeOutList, const QCString &scopeName, const QCString &input, SrcLangExt lang, bool isExampleBlock, const QCString &exampleName=QCString(), const FileDef *fileDef=nullptr, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, const MemberDef *memberDef=nullptr, bool showLineNumbers=TRUE, const Definition *searchCtx=nullptr, bool collectXRefs=TRUE)=0
 Parses a source file or fragment with the goal to produce highlighted and cross-referenced output. More...
 
virtual void resetCodeParserState ()=0
 Resets the state of the code parser. More...
 

Detailed Description

Abstract interface for code parsers.

By implementing the methods of this interface one can add a new language parser to doxygen. This interface is used for syntax highlighting, but also to extract cross references and call graphs.

Member Function Documentation

◆ parseCode()

virtual void CodeParserInterface::parseCode ( OutputCodeList codeOutList,
const QCString scopeName,
const QCString input,
SrcLangExt  lang,
bool  isExampleBlock,
const QCString exampleName = QCString(),
const FileDef fileDef = nullptr,
int  startLine = -1,
int  endLine = -1,
bool  inlineFragment = FALSE,
const MemberDef memberDef = nullptr,
bool  showLineNumbers = TRUE,
const Definition searchCtx = nullptr,
bool  collectXRefs = TRUE 
)
pure virtual

Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.

Parameters
[in]codeOutListinterface for writing the result.
[in]scopeNameName of scope to which the code belongs.
[in]inputActual code in the form of a string
[in]langThe programming language of the code fragment.
[in]isExampleBlockTRUE iff the code is part of an example.
[in]exampleNameName of the example.
[in]fileDefFile definition to which the code is associated.
[in]startLineStarting line in case of a code fragment.
[in]endLineEnding line of the code fragment.
[in]inlineFragmentCode fragment that is to be shown inline as part of the documentation.
[in]memberDefMember definition to which the code is associated (non null in case of an inline fragment for a member).
[in]showLineNumbersif set to TRUE and also fileDef is not 0, line numbers will be added to the source fragment
[in]searchCtxcontext under which search data has to be stored.
[in]collectXRefscollect cross-reference relations.

Implemented in PythonCodeParser, XMLCodeParser, FortranCodeParser, LexCodeParser, SQLCodeParser, CCodeParser, VHDLCodeParser, and FileCodeParser.

◆ resetCodeParserState()

virtual void CodeParserInterface::resetCodeParserState ( )
pure virtual

Resets the state of the code parser.

Since multiple code fragments can together form a single example, an explicit function is used to reset the code parser state.

See also
parseCode()

Implemented in PythonCodeParser, XMLCodeParser, FortranCodeParser, LexCodeParser, SQLCodeParser, CCodeParser, VHDLCodeParser, and FileCodeParser.


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