Natural Docs Version 1.2 |
NaturalDocs:: ParserA package that coordinates source file parsing between the NaturalDocs::Languages::Base-derived objects and its own sub-packages such as NaturalDocs::Parser::Native. Also handles sending symbols to NaturalDocs::SymbolTable and other generic topic processing. Usage and Dependencies
Summary
parsedFile
An array of NaturalDocs::Parser::ParsedTopic objects. parsingForInformation
Whether ParseForInformation() was called. If false, then ParseForBuild() was called. ParseForInformation
Parses the input file for information. Will update the information about the file in NaturalDocs::SymbolTable and NaturalDocs::Project. Parameters
ParseForBuild
Parses the input file for building, returning it as a NaturalDocs::Parser::ParsedTopic arrayref. Note that all new and changed files should be parsed for symbols via ParseForInformation() before calling this function on any file. The reason is that NaturalDocs::SymbolTable needs to know about all the symbol definitions and references to resolve them properly. Parameters
ReturnsAn arrayref of the source file as NaturalDocs::Parser::ParsedTopic objects. OnComment
The function called by NaturalDocs::Languages::Base-derived objects when their parsers encounter a comment suitable for documentation. Parameters
ReturnsThe number of topics created by this comment, or zero if none. OnClass
A function called by NaturalDocs::Languages::Base-derived objects when their parsers encounter a class declaration. Parameters
OnClassParent
A function called by NaturalDocs::Languages::Base-derived objects when their parsers encounter a declaration of inheritance. Parameters
Parse
Opens the source file and parses process. Most of the actual parsing is done in NaturalDocs::Languages::Base->ParseFile() and OnComment(), though. Do not call externally. Rather, call ParseForInformation() or ParseForBuild(). ReturnsThe default menu title of the file. Will be the file name if nothing better is found. CleanComment
Removes any extraneous formatting and whitespace from the comment. Eliminates comment boxes, horizontal lines, leading and trailing line breaks, trailing whitespace from lines, and expands all tab characters. It keeps leading whitespace, though, since it may be needed for example code, and multiple blank lines, since the original line numbers are needed. Parameters
MakeAutoGroupsFor
Creates group topics for sections of files that do not have them. A support function for MakeAutoGroups(). Parameters
ReturnsThe number of group topics added. RepairScope
Recalculates the scope for all comment topics using the auto-topics and the scope record. Call this before calling MergeAutoTopics(). Parameters
AddToClassHierarchy
Adds any class topics to the class hierarchy, since they may not have been called with OnClass() if they didn’t match up to an auto-topic. MergeAutoTopics
Merges the automatically generated topics into the file. If an auto-topic matches an existing topic, it will be deleted and, if appropriate, have it’s prototype, class, and scope transferred. If it doesn’t, the auto-topic will be inserted into the list unless NaturalDocs::Settings->DocumentedOnly() is set. Parameters
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
my $sourceFile |
my @parsedFile |
my $parsingForInformation |
sub ParseForInformation #(file) |
sub ParseForBuild #(file) |
| ||||||||||
sub OnClass #(class) |
| |||||||||||||||
sub Parse |
sub CleanComment #(commentLines) |
sub MakeAutoGroups |
| ||||||||||
| ||||||||||
sub AddToClassHierarchy |
| ||||||||||
sub AddScopeDelineators |
sub DocumentedOnly |