NaturalDocs::Languages::Tcl |
A subclass to handle the language variations of Tcl.
NaturalDocs:: | A subclass to handle the language variations of Tcl. |
Variables | |
pastFirstBrace | Whether we’ve past the first brace in a function prototype or not. |
Functions | |
OnCode | This is just overridden to reset pastFirstBrace. |
OnPrototypeEnd | Tcl’s function syntax is shown below. |
ParsePrototype | Parses the prototype and returns it as a NaturalDocs::Languages::Prototype object. |
ParseParameterLine | Parses a prototype parameter line and returns it as a NaturalDocs::Languages::Prototype::Parameter object. |
sub OnCode #( ... )
This is just overridden to reset pastFirstBrace.
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.
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 ParsePrototype #( type, prototype )
Parses the prototype and returns it as a NaturalDocs::Languages::Prototype object.
type | The TopicType. |
prototype | The text prototype. |
A NaturalDocs::Languages::Prototype object.
sub ParseParameterLine #( line )
Parses a prototype parameter line and returns it as a NaturalDocs::Languages::Prototype::Parameter object.
Whether we’ve past the first brace in a function prototype or not.
my $pastFirstBrace
This is just overridden to reset pastFirstBrace.
sub OnCode #( ... )
Tcl’s function syntax is shown below.
sub OnPrototypeEnd #( type, prototypeRef, ender )
Parses the prototype and returns it as a NaturalDocs::Languages::Prototype object.
sub ParsePrototype #( type, prototype )
Parses a prototype parameter line and returns it as a NaturalDocs::Languages::Prototype::Parameter object.
sub ParseParameterLine #( line )