A class containing the characteristics of a particular programming language for basic support within Natural Docs. Also serves as a base class for languages that break from general conventions, such as not having parameter lists use parenthesis and commas.
Creates and returns a new object.
|name||The name of the language.|
Returns an arrayref of symbols that start a line comment, or undef if none.
Replaces the arrayref of symbols that start a line comment.
Returns an arrayref of start/end symbol pairs that specify a block comment, or undef if none. Pairs are specified with two consecutive array entries.
Replaces the arrayref of start/end symbol pairs that specify a block comment. Pairs are specified with two consecutive array entries.
Returns the symbol to ignore a line break in languages where line breaks are significant.
Replaces the symbol to ignore a line break in languages where line breaks are significant.
|sub SetPackageSeparator #(||separator||)|
Returns the package separator symbol.
Returns whether the package separator symbol was ever changed from the default.
Replaces the language’s package separator string.
|sub SetEnumValues #(||EnumValuesType ||newBehavior||)|
Returns the EnumValuesType that describes how the language handles enums.
Returns whether EnumValues was ever changed from the default.
Replaces the EnumValuesType that describes how the language handles enums.
|sub PrototypeEndersFor #(||type||)|
Returns an arrayref of prototype ender symbols for the passed TopicType, or undef if none.
|sub SetPrototypeEndersFor #(||type,|
Replaces the arrayref of prototype ender symbols for the passed TopicType.
|sub ParseFile #(||sourceFile,|
Parses the passed source file, sending comments acceptable for documentation to NaturalDocs::Parser->OnComment() and all other sections to OnCode().
Since this class cannot automatically document the code or generate a scope record, it always returns ( undef, undef ).
|sub OnCode #(||codeLines,|
Called whenever a section of code is encountered by the parser. Is used to find the prototype of the last topic created.
|codeLines||The source code as an arrayref of lines.|
|codeLineNumber||The line number of the first line of code.|
|topicList||A reference to the list of NaturalDocs::Parser::ParsedTopics being built by the file.|
|lastCommentTopicCount||The number of Natural Docs topics that were created by the last comment.|
|sub OnPrototypeEnd #(||type,|
Called whenever the end of a prototype is found so that there’s a chance for derived classes to mark false positives.
|type||The TopicType of the prototype.|
|prototypeRef||A reference to the prototype so far, minus the ender in dispute.|
|ender||The ender symbol.|
|ENDER_ACCEPT||The ender is accepted and the prototype is finished.|
|ENDER_IGNORE||The ender is rejected and parsing should continue. Note that the prototype will be rejected as a whole if all enders are ignored before reaching the end of the code.|
|ENDER_ACCEPT_AND_CONTINUE||The ender is accepted so the prototype may stand as is. However, the prototype might also continue on so continue parsing. If there is no accepted ender between here and the end of the code this version will be accepted instead.|
|ENDER_REVERT_TO_ACCEPTED||The expedition from ENDER_ACCEPT_AND_CONTINUE failed. Use the last accepted version and end parsing.|
|sub RemoveLineExtender #(||line||)|
If the passed line has a line extender, returns it without the extender or the line break that follows. If it doesn’t, or there are no line extenders defined, returns the passed line unchanged.