ParserInterface Class Reference

Abstract interface for programming language parsers. More...

#include <parserintf.h>

Inheritance diagram for ParserInterface:

CLanguageScanner FortranLanguageScanner PythonLanguageScanner VHDLLanguageScanner List of all members.

Public Member Functions

virtual ~ParserInterface ()
virtual void parseInput (const char *fileName, const char *fileBuf, Entry *root)=0
virtual bool needsPreprocessing (const QCString &extension)=0
virtual void parseCode (CodeOutputInterface &codeOutIntf, const char *scopeName, const QCString &input, bool isExampleBlock, const char *exampleName=0, FileDef *fileDef=0, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, MemberDef *memberDef=0)=0
virtual void resetCodeParserState ()=0
virtual void parsePrototype (const char *text)=0

Detailed Description

Abstract interface for programming language parsers.

By implementing the methods of this interface one can add a new language parser to doxygen. The parser can make use of the comment block parser to parse the contents of special comment blocks.

Definition at line 34 of file parserintf.h.


Constructor & Destructor Documentation

virtual ParserInterface::~ParserInterface (  )  [inline, virtual]

Definition at line 37 of file parserintf.h.


Member Function Documentation

virtual void ParserInterface::parseInput ( const char *  fileName,
const char *  fileBuf,
Entry root 
) [pure 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).
[in,out] root The root of the tree of Entry *nodes representing the information extracted from the file.

Implemented in FortranLanguageScanner, PythonLanguageScanner, CLanguageScanner, and VHDLLanguageScanner.

virtual bool ParserInterface::needsPreprocessing ( const QCString &  extension  )  [pure 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()

Implemented in FortranLanguageScanner, PythonLanguageScanner, CLanguageScanner, and VHDLLanguageScanner.

virtual void ParserInterface::parseCode ( CodeOutputInterface codeOutIntf,
const char *  scopeName,
const QCString &  input,
bool  isExampleBlock,
const char *  exampleName = 0,
FileDef fileDef = 0,
int  startLine = -1,
int  endLine = -1,
bool  inlineFragment = FALSE,
MemberDef memberDef = 0 
) [pure virtual]

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

Parameters:
[in] codeOutIntf Abstract interface for writing the result.
[in] scopeName Name of scope to which the code belongs.
[in] input Actual code in the form of a string
[in] isExampleBlock TRUE iff the code is part of an example.
[in] exampleName Name of the example.
[in] fileDef File definition to which the code is associated.
[in] startLine Starting line in case of a code fragment.
[in] endLine Ending line of the code fragment.
[in] inlineFragment Code fragment that is to be shown inline as part of the documentation.
[in] memberDef Member definition to which the code is associated (non null in case of an inline fragment for a member).

Implemented in FortranLanguageScanner, PythonLanguageScanner, CLanguageScanner, and VHDLLanguageScanner.

Referenced by FileDef::parseSource(), XmlDocVisitor::visit(), RTFDocVisitor::visit(), ManDocVisitor::visit(), LatexDocVisitor::visit(), HtmlDocVisitor::visit(), MemberDef::writeDocumentation(), Definition::writeInlineCode(), FileDef::writeSource(), and writeXMLCodeBlock().

virtual void ParserInterface::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 FortranLanguageScanner, PythonLanguageScanner, CLanguageScanner, and VHDLLanguageScanner.

Referenced by FileDef::parseSource(), MemberDef::writeDocumentation(), Definition::writeInlineCode(), FileDef::writeSource(), and writeXMLCodeBlock().

virtual void ParserInterface::parsePrototype ( const char *  text  )  [pure 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.

Implemented in FortranLanguageScanner, PythonLanguageScanner, CLanguageScanner, and VHDLLanguageScanner.


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



Generated on Mon Mar 31 10:59:02 2008 by  doxygen 1.5.1