diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-08-02 08:21:29 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-08-02 08:21:29 +0000 |
| commit | 61bfe2d70cae6be8c4086a210a5451135ccca9ea (patch) | |
| tree | 62bf7808b1b2bfe5f56fe1e329871fb0991d0687 /docs/tool/Modules/NaturalDocs/SymbolTable/SymbolDefinition.pm | |
| parent | a13b94f9e0bca8ea892311d9d9e0c0bc48616ea7 (diff) | |
| download | zcatch-61bfe2d70cae6be8c4086a210a5451135ccca9ea.tar.gz zcatch-61bfe2d70cae6be8c4086a210a5451135ccca9ea.zip | |
added doc tool
Diffstat (limited to 'docs/tool/Modules/NaturalDocs/SymbolTable/SymbolDefinition.pm')
| -rw-r--r-- | docs/tool/Modules/NaturalDocs/SymbolTable/SymbolDefinition.pm | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/docs/tool/Modules/NaturalDocs/SymbolTable/SymbolDefinition.pm b/docs/tool/Modules/NaturalDocs/SymbolTable/SymbolDefinition.pm new file mode 100644 index 00000000..3992e1d1 --- /dev/null +++ b/docs/tool/Modules/NaturalDocs/SymbolTable/SymbolDefinition.pm @@ -0,0 +1,96 @@ +############################################################################### +# +# Package: NaturalDocs::SymbolTable::SymbolDefinition +# +############################################################################### +# +# A class representing a symbol definition. This does not store the definition symbol, class, or file. +# +############################################################################### + +# This file is part of Natural Docs, which is Copyright (C) 2003-2008 Greg Valure +# Natural Docs is licensed under the GPL + +use strict; +use integer; + +package NaturalDocs::SymbolTable::SymbolDefinition; + + +############################################################################### +# Group: Implementation + +# +# Constants: Members +# +# The class is implemented as a blessed arrayref. The following constants are its members. +# +# TYPE - The symbol <TopicType>. +# PROTOTYPE - The symbol's prototype, if applicable. Will be undef otherwise. +# SUMMARY - The symbol's summary, if applicable. Will be undef otherwise. +# +use constant TYPE => 0; +use constant PROTOTYPE => 1; +use constant SUMMARY => 2; +# New depends on the order of the constants. + + +############################################################################### +# Group: Functions + +# +# Function: New +# +# Creates and returns a new object. +# +# Parameters: +# +# type - The symbol <TopicType>. +# prototype - The symbol prototype, if applicable. Undef otherwise. +# summary - The symbol's summary, if applicable. Undef otherwise. +# +sub New #(type, prototype, summary) + { + # This depends on the parameter list being the same as the constant order. + + my $package = shift; + + my $object = [ @_ ]; + bless $object, $package; + + return $object; + }; + + +# Function: Type +# Returns the definition's <TopicType>. +sub Type + { return $_[0]->[TYPE]; }; + +# Function: SetType +# Changes the <TopicType>. +sub SetType #(type) + { $_[0]->[TYPE] = $_[1]; }; + +# Function: Prototype +# Returns the definition's prototype, or undef if it doesn't have one. +sub Prototype + { return $_[0]->[PROTOTYPE]; }; + +# Function: SetPrototype +# Changes the prototype. +sub SetPrototype #(prototype) + { $_[0]->[PROTOTYPE] = $_[1]; }; + +# Function: Summary +# Returns the definition's summary, or undef if it doesn't have one. +sub Summary + { return $_[0]->[SUMMARY]; }; + +# Function: SetSummary +# Changes the summary. +sub SetSummary #(summary) + { $_[0]->[SUMMARY] = $_[1]; }; + + +1; |