NaturalDocs::Languages::Tcl

NaturalDocs::Languages::Tcl

A subclass to handle the language variations of Tcl.

Summary
NaturalDocs::Languages::TclA subclass to handle the language variations of Tcl.
Variables
pastFirstBraceWhether we’ve past the first brace in a function prototype or not.
Functions
OnCodeThis is just overridden to reset pastFirstBrace.
OnPrototypeEndTcl’s function syntax is shown below.
ParsePrototypeParses the prototype and returns it as a NaturalDocs::Languages::Prototype object.
ParseParameterLineParses a prototype parameter line and returns it as a NaturalDocs::Languages::Prototype::Parameter object.

Variables

pastFirstBrace

my $pastFirstBrace

Whether we’ve past the first brace in a function prototype or not.

Functions

OnCode

sub OnCode #(...)

This is just overridden to reset pastFirstBrace.

OnPrototypeEnd

sub OnPrototypeEnd #(type,
prototypeRef,
ender)

Tcl’s function syntax is shown below.

proc [name] { [params] } { [code] }

The opening brace is one of the prototype enders.  We need to allow the first opening brace because it contains the parameters.

Also, the parameters may have braces within them.  I’ve seen one that used { seconds 20 } as a parameter.

Parameters

typeThe TopicType of the prototype.
prototypeRefA reference to the prototype so far, minus the ender in dispute.
enderThe ender symbol.

Returns

ENDER_ACCEPTThe ender is accepted and the prototype is finished.
ENDER_IGNOREThe 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_CONTINUEThe 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_ACCEPTEDThe expedition from ENDER_ACCEPT_AND_CONTINUE failed.  Use the last accepted version and end parsing.

ParsePrototype

sub ParsePrototype #(type,
prototype)

Parses the prototype and returns it as a NaturalDocs::Languages::Prototype object.

Parameters

typeThe TopicType.
prototypeThe text prototype.

Returns

A NaturalDocs::Languages::Prototype object.

ParseParameterLine

sub ParseParameterLine #(line)

Parses a prototype parameter line and returns it as a NaturalDocs::Languages::Prototype::Parameter object.

A class containing the characteristics of a particular programming language for basic support within Natural Docs.
my $pastFirstBrace
Whether we’ve past the first brace in a function prototype or not.
sub OnCode #(...)
This is just overridden to reset pastFirstBrace.
sub OnPrototypeEnd #(type,
prototypeRef,
ender)
Tcl’s function syntax is shown below.
sub ParsePrototype #(type,
prototype)
Parses the prototype and returns it as a NaturalDocs::Languages::Prototype object.
A data class for storing parsed prototypes.
sub ParseParameterLine #(line)
Parses a prototype parameter line and returns it as a NaturalDocs::Languages::Prototype::Parameter object.
A data class for storing parsed prototype parameters.
A string representing a topic type as defined in Topics.txt.
Close