bixbite 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README.markdown +49 -0
- data/VERSION +1 -0
- data/bin/bixbite +73 -0
- data/lib/bixbite.rb +13 -0
- data/lib/bixbite/command.rb +14 -0
- data/lib/bixbite/create.rb +76 -0
- data/template/Rakefile +25 -0
- data/template/assets/bixbite/Rakefile.rb +297 -0
- data/template/assets/naturaldocs/NaturalDocs/Config/Languages.txt +286 -0
- data/template/assets/naturaldocs/NaturalDocs/Config/Topics.txt +382 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/customizinglanguages.html +52 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/customizingtopics.html +74 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/documenting.html +58 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/documenting/reference.html +146 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/documenting/walkthrough.html +180 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/example/Default.css +528 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/example/NaturalDocs.js +204 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/examples.css +90 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/background.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/leftside.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/logo.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/overbody.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/overbodybg.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/overleftmargin.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/overmenu.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/overmenubg.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/header/rightside.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/logo.gif +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/about.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/background.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/bottomleft.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/bottomright.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/community.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/customizing.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/using.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/index.html +9 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/javascript/BrowserStyles.js +77 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/javascript/PNGHandling.js +72 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/keywords.html +38 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/languages.html +32 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/menu.html +79 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/output.html +84 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/running.html +40 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/styles.css +290 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/styles.html +52 -0
- data/template/assets/naturaldocs/NaturalDocs/Help/troubleshooting.html +18 -0
- data/template/assets/naturaldocs/NaturalDocs/Info/CSSGuide.txt +947 -0
- data/template/assets/naturaldocs/NaturalDocs/Info/File Parsing.txt +83 -0
- data/template/assets/naturaldocs/NaturalDocs/Info/HTMLTestCases.pm +269 -0
- data/template/assets/naturaldocs/NaturalDocs/Info/Languages.txt +107 -0
- data/template/assets/naturaldocs/NaturalDocs/Info/NDMarkup.txt +91 -0
- data/template/assets/naturaldocs/NaturalDocs/Info/Symbol Management.txt +59 -0
- data/template/assets/naturaldocs/NaturalDocs/Info/images/Logo.png +0 -0
- data/template/assets/naturaldocs/NaturalDocs/JavaScript/NaturalDocs.js +836 -0
- data/template/assets/naturaldocs/NaturalDocs/License-GPL.txt +341 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/BinaryFile.pm +294 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Builder.pm +280 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Builder/Base.pm +348 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Builder/FramedHTML.pm +345 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Builder/HTML.pm +398 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Builder/HTMLBase.pm +3693 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ClassHierarchy.pm +860 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ClassHierarchy/Class.pm +412 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ClassHierarchy/File.pm +157 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ConfigFile.pm +497 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Constants.pm +165 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/DefineMembers.pm +100 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Error.pm +305 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/File.pm +540 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ImageReferenceTable.pm +383 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ImageReferenceTable/Reference.pm +44 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ImageReferenceTable/String.pm +110 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages.pm +1475 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/ActionScript.pm +1473 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Ada.pm +38 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Advanced.pm +828 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Advanced/Scope.pm +95 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Advanced/ScopeChange.pm +70 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Base.pm +832 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/CSharp.pm +1484 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/PLSQL.pm +319 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Pascal.pm +143 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Perl.pm +1370 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Prototype.pm +92 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Prototype/Parameter.pm +87 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Simple.pm +503 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Tcl.pm +219 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Menu.pm +3406 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Menu/Entry.pm +201 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/NDMarkup.pm +76 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Parser.pm +1331 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Parser/JavaDoc.pm +464 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Parser/Native.pm +1060 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Parser/ParsedTopic.pm +253 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Project.pm +1402 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Project/ImageFile.pm +160 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Project/SourceFile.pm +113 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ReferenceString.pm +334 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Settings.pm +1418 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Settings/BuildTarget.pm +66 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB.pm +678 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB/Extension.pm +84 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB/File.pm +129 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB/Item.pm +201 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB/ItemDefinition.pm +45 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB/WatchedFileDefinitions.pm +159 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/StatusMessage.pm +102 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolString.pm +212 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable.pm +1984 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/File.pm +186 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/IndexElement.pm +522 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/Reference.pm +273 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/ReferenceTarget.pm +97 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/Symbol.pm +428 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/SymbolDefinition.pm +96 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Topics.pm +1319 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Topics/Type.pm +151 -0
- data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Version.pm +384 -0
- data/template/assets/naturaldocs/NaturalDocs/NaturalDocs +400 -0
- data/template/assets/naturaldocs/NaturalDocs/NaturalDocs.bat +17 -0
- data/template/assets/naturaldocs/NaturalDocs/Styles/Default.css +767 -0
- data/template/assets/naturaldocs/NaturalDocs/Styles/Roman.css +765 -0
- data/template/assets/naturaldocs/NaturalDocs/Styles/Small.css +763 -0
- data/template/assets/utilities/pngout +0 -0
- data/template/deploy/public_html/.htaccess +0 -0
- data/template/documentation/js/.htaccess +0 -0
- data/template/src/html/.htaccess +76 -0
- data/template/src/html/css/cmn/global.css +96 -0
- data/template/src/html/css/cmn/ie.css +15 -0
- data/template/src/html/css/cmn/ie6.css +15 -0
- data/template/src/html/images/cmn/.htaccess +0 -0
- data/template/src/html/images/tmp/.htaccess +0 -0
- data/template/src/html/includes/debug.inc +5 -0
- data/template/src/html/includes/footer.inc +52 -0
- data/template/src/html/includes/header.inc +61 -0
- data/template/src/html/includes/html.inc +3 -0
- data/template/src/html/includes/namespace.inc +19 -0
- data/template/src/html/includes/page.inc +151 -0
- data/template/src/html/index.html +35 -0
- data/template/src/html/js/cmn/bootstrap.js +74 -0
- data/template/src/html/js/cmn/global.js +142 -0
- data/template/src/html/js/cmn/lib/LAB.js +348 -0
- data/template/src/html/min/.htaccess +4 -0
- data/template/src/html/min/MinifyCLI.php +19 -0
- data/template/src/html/min/README.txt +132 -0
- data/template/src/html/min/builder/_index.js +242 -0
- data/template/src/html/min/builder/bm.js +36 -0
- data/template/src/html/min/builder/index.php +182 -0
- data/template/src/html/min/builder/ocCheck.php +36 -0
- data/template/src/html/min/builder/rewriteTest.js +1 -0
- data/template/src/html/min/config.php +187 -0
- data/template/src/html/min/groupsConfig.php +34 -0
- data/template/src/html/min/index.php +66 -0
- data/template/src/html/min/lib/FirePHP.php +1370 -0
- data/template/src/html/min/lib/HTTP/ConditionalGet.php +348 -0
- data/template/src/html/min/lib/HTTP/Encoder.php +326 -0
- data/template/src/html/min/lib/JSMin.php +314 -0
- data/template/src/html/min/lib/JSMinPlus.php +1872 -0
- data/template/src/html/min/lib/Minify.php +532 -0
- data/template/src/html/min/lib/Minify/Build.php +103 -0
- data/template/src/html/min/lib/Minify/CSS.php +83 -0
- data/template/src/html/min/lib/Minify/CSS/Compressor.php +250 -0
- data/template/src/html/min/lib/Minify/CSS/UriRewriter.php +270 -0
- data/template/src/html/min/lib/Minify/Cache/APC.php +130 -0
- data/template/src/html/min/lib/Minify/Cache/File.php +125 -0
- data/template/src/html/min/lib/Minify/Cache/Memcache.php +137 -0
- data/template/src/html/min/lib/Minify/ClosureCompiler.php +85 -0
- data/template/src/html/min/lib/Minify/CommentPreserver.php +90 -0
- data/template/src/html/min/lib/Minify/Controller/Base.php +202 -0
- data/template/src/html/min/lib/Minify/Controller/Files.php +78 -0
- data/template/src/html/min/lib/Minify/Controller/Groups.php +94 -0
- data/template/src/html/min/lib/Minify/Controller/MinApp.php +132 -0
- data/template/src/html/min/lib/Minify/Controller/Page.php +82 -0
- data/template/src/html/min/lib/Minify/Controller/Version1.php +118 -0
- data/template/src/html/min/lib/Minify/HTML.php +245 -0
- data/template/src/html/min/lib/Minify/ImportProcessor.php +157 -0
- data/template/src/html/min/lib/Minify/Lines.php +131 -0
- data/template/src/html/min/lib/Minify/Logger.php +45 -0
- data/template/src/html/min/lib/Minify/Packer.php +37 -0
- data/template/src/html/min/lib/Minify/Source.php +187 -0
- data/template/src/html/min/lib/Minify/YUICompressor.php +139 -0
- data/template/src/html/min/lib/Solar/Dir.php +199 -0
- data/template/src/html/min/lib/closure-compiler.jar +0 -0
- data/template/src/html/min/lib/yuicompressor-2.4.2.jar +0 -0
- data/template/src/html/min/utils.php +90 -0
- data/template/src/templates/css/template.css +7 -0
- data/template/src/templates/js/template.js +72 -0
- data/template/src/templates/template.html +18 -0
- data/template/src/yaml/config.yml +46 -0
- data/template/src/yaml/deploy.yml +35 -0
- data/test/bixbite_test.rb +7 -0
- data/test/test_helper.rb +10 -0
- metadata +278 -0
@@ -0,0 +1,319 @@
|
|
1
|
+
###############################################################################
|
2
|
+
#
|
3
|
+
# Class: NaturalDocs::Languages::PLSQL
|
4
|
+
#
|
5
|
+
###############################################################################
|
6
|
+
#
|
7
|
+
# A subclass to handle the language variations of PL/SQL.
|
8
|
+
#
|
9
|
+
###############################################################################
|
10
|
+
|
11
|
+
# This file is part of Natural Docs, which is Copyright (C) 2003-2008 Greg Valure
|
12
|
+
# Natural Docs is licensed under the GPL
|
13
|
+
|
14
|
+
use strict;
|
15
|
+
use integer;
|
16
|
+
|
17
|
+
package NaturalDocs::Languages::PLSQL;
|
18
|
+
|
19
|
+
use base 'NaturalDocs::Languages::Simple';
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# Function: OnPrototypeEnd
|
24
|
+
#
|
25
|
+
# Microsoft's SQL specifies parameters as shown below.
|
26
|
+
#
|
27
|
+
# > CREATE PROCEDURE Test @as int, @foo int AS ...
|
28
|
+
#
|
29
|
+
# Having a parameter @is or @as is perfectly valid even though those words are also used to end the prototype. We need to
|
30
|
+
# ignore text-based enders preceded by an at sign. Also note that it does not have parenthesis for parameter lists. We need to
|
31
|
+
# skip all commas if the prototype doesn't have parenthesis but does have @ characters.
|
32
|
+
#
|
33
|
+
# Identifiers such as function names may contain the characters $, #, and _, so if "as" or "is" appears directly after one of them
|
34
|
+
# we need to ignore the ender there as well.
|
35
|
+
#
|
36
|
+
# > FUNCTION Something_is_something ...
|
37
|
+
#
|
38
|
+
# Parameters:
|
39
|
+
#
|
40
|
+
# type - The <TopicType> of the prototype.
|
41
|
+
# prototypeRef - A reference to the prototype so far, minus the ender in dispute.
|
42
|
+
# ender - The ender symbol.
|
43
|
+
#
|
44
|
+
# Returns:
|
45
|
+
#
|
46
|
+
# ENDER_ACCEPT - The ender is accepted and the prototype is finished.
|
47
|
+
# ENDER_IGNORE - The ender is rejected and parsing should continue. Note that the prototype will be rejected as a whole
|
48
|
+
# if all enders are ignored before reaching the end of the code.
|
49
|
+
# ENDER_ACCEPT_AND_CONTINUE - The ender is accepted so the prototype may stand as is. However, the prototype might
|
50
|
+
# also continue on so continue parsing. If there is no accepted ender between here and
|
51
|
+
# the end of the code this version will be accepted instead.
|
52
|
+
# ENDER_REVERT_TO_ACCEPTED - The expedition from ENDER_ACCEPT_AND_CONTINUE failed. Use the last accepted
|
53
|
+
# version and end parsing.
|
54
|
+
#
|
55
|
+
sub OnPrototypeEnd #(type, prototypeRef, ender)
|
56
|
+
{
|
57
|
+
my ($self, $type, $prototypeRef, $ender) = @_;
|
58
|
+
|
59
|
+
# _ should be handled already.
|
60
|
+
if ($ender =~ /^[a-z]+$/i && substr($$prototypeRef, -1) =~ /^[\@\$\#]$/)
|
61
|
+
{ return ::ENDER_IGNORE(); }
|
62
|
+
|
63
|
+
elsif ($type eq ::TOPIC_FUNCTION() && $ender eq ',')
|
64
|
+
{
|
65
|
+
if ($$prototypeRef =~ /^[^\(]*\@/)
|
66
|
+
{ return ::ENDER_IGNORE(); }
|
67
|
+
else
|
68
|
+
{ return ::ENDER_ACCEPT(); };
|
69
|
+
}
|
70
|
+
|
71
|
+
else
|
72
|
+
{ return ::ENDER_ACCEPT(); };
|
73
|
+
};
|
74
|
+
|
75
|
+
|
76
|
+
#
|
77
|
+
# Function: ParsePrototype
|
78
|
+
#
|
79
|
+
# Overridden to handle Microsoft's parenthesisless version. Otherwise just throws to the parent.
|
80
|
+
#
|
81
|
+
# Parameters:
|
82
|
+
#
|
83
|
+
# type - The <TopicType>.
|
84
|
+
# prototype - The text prototype.
|
85
|
+
#
|
86
|
+
# Returns:
|
87
|
+
#
|
88
|
+
# A <NaturalDocs::Languages::Prototype> object.
|
89
|
+
#
|
90
|
+
sub ParsePrototype #(type, prototype)
|
91
|
+
{
|
92
|
+
my ($self, $type, $prototype) = @_;
|
93
|
+
|
94
|
+
my $noParenthesisParameters = ($type eq ::TOPIC_FUNCTION() && $prototype =~ /^[^\(]*\@/);
|
95
|
+
|
96
|
+
if ($prototype !~ /\(.*[^ ].*\)/ && !$noParenthesisParameters)
|
97
|
+
{ return $self->SUPER::ParsePrototype($type, $prototype); };
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
my ($beforeParameters, $afterParameters, $isAfterParameters);
|
102
|
+
|
103
|
+
if ($noParenthesisParameters)
|
104
|
+
{
|
105
|
+
($beforeParameters, $prototype) = split(/\@/, $prototype, 2);
|
106
|
+
$prototype = '@' . $prototype;
|
107
|
+
};
|
108
|
+
|
109
|
+
my @tokens = $prototype =~ /([^\(\)\[\]\{\}\<\>\'\"\,]+|.)/g;
|
110
|
+
|
111
|
+
my $parameter;
|
112
|
+
my @parameterLines;
|
113
|
+
|
114
|
+
my @symbolStack;
|
115
|
+
|
116
|
+
foreach my $token (@tokens)
|
117
|
+
{
|
118
|
+
if ($isAfterParameters)
|
119
|
+
{ $afterParameters .= $token; }
|
120
|
+
|
121
|
+
elsif ($symbolStack[-1] eq '\'' || $symbolStack[-1] eq '"')
|
122
|
+
{
|
123
|
+
if ($noParenthesisParameters || $symbolStack[0] eq '(')
|
124
|
+
{ $parameter .= $token; }
|
125
|
+
else
|
126
|
+
{ $beforeParameters .= $token; };
|
127
|
+
|
128
|
+
if ($token eq $symbolStack[-1])
|
129
|
+
{ pop @symbolStack; };
|
130
|
+
}
|
131
|
+
|
132
|
+
elsif ($token =~ /^[\(\[\{\<\'\"]$/)
|
133
|
+
{
|
134
|
+
if ($noParenthesisParameters || $symbolStack[0] eq '(')
|
135
|
+
{ $parameter .= $token; }
|
136
|
+
else
|
137
|
+
{ $beforeParameters .= $token; };
|
138
|
+
|
139
|
+
push @symbolStack, $token;
|
140
|
+
}
|
141
|
+
|
142
|
+
elsif ( ($token eq ')' && $symbolStack[-1] eq '(') ||
|
143
|
+
($token eq ']' && $symbolStack[-1] eq '[') ||
|
144
|
+
($token eq '}' && $symbolStack[-1] eq '{') ||
|
145
|
+
($token eq '>' && $symbolStack[-1] eq '<') )
|
146
|
+
{
|
147
|
+
if (!$noParenthesisParameters && $token eq ')' && scalar @symbolStack == 1 && $symbolStack[0] eq '(')
|
148
|
+
{
|
149
|
+
$afterParameters .= $token;
|
150
|
+
$isAfterParameters = 1;
|
151
|
+
}
|
152
|
+
else
|
153
|
+
{ $parameter .= $token; };
|
154
|
+
|
155
|
+
pop @symbolStack;
|
156
|
+
}
|
157
|
+
|
158
|
+
elsif ($token eq ',')
|
159
|
+
{
|
160
|
+
if (!scalar @symbolStack)
|
161
|
+
{
|
162
|
+
if ($noParenthesisParameters)
|
163
|
+
{
|
164
|
+
push @parameterLines, $parameter . $token;
|
165
|
+
$parameter = undef;
|
166
|
+
}
|
167
|
+
else
|
168
|
+
{
|
169
|
+
$beforeParameters .= $token;
|
170
|
+
};
|
171
|
+
}
|
172
|
+
else
|
173
|
+
{
|
174
|
+
if (scalar @symbolStack == 1 && $symbolStack[0] eq '(' && !$noParenthesisParameters)
|
175
|
+
{
|
176
|
+
push @parameterLines, $parameter . $token;
|
177
|
+
$parameter = undef;
|
178
|
+
}
|
179
|
+
else
|
180
|
+
{
|
181
|
+
$parameter .= $token;
|
182
|
+
};
|
183
|
+
};
|
184
|
+
}
|
185
|
+
|
186
|
+
else
|
187
|
+
{
|
188
|
+
if ($noParenthesisParameters || $symbolStack[0] eq '(')
|
189
|
+
{ $parameter .= $token; }
|
190
|
+
else
|
191
|
+
{ $beforeParameters .= $token; };
|
192
|
+
};
|
193
|
+
};
|
194
|
+
|
195
|
+
push @parameterLines, $parameter;
|
196
|
+
|
197
|
+
foreach my $item (\$beforeParameters, \$afterParameters)
|
198
|
+
{
|
199
|
+
$$item =~ s/^ //;
|
200
|
+
$$item =~ s/ $//;
|
201
|
+
}
|
202
|
+
|
203
|
+
my $prototypeObject = NaturalDocs::Languages::Prototype->New($beforeParameters, $afterParameters);
|
204
|
+
|
205
|
+
|
206
|
+
# Parse the actual parameters.
|
207
|
+
|
208
|
+
foreach my $parameterLine (@parameterLines)
|
209
|
+
{
|
210
|
+
$prototypeObject->AddParameter( $self->ParseParameterLine($parameterLine) );
|
211
|
+
};
|
212
|
+
|
213
|
+
return $prototypeObject;
|
214
|
+
};
|
215
|
+
|
216
|
+
|
217
|
+
#
|
218
|
+
# Function: ParseParameterLine
|
219
|
+
#
|
220
|
+
# Parses a prototype parameter line and returns it as a <NaturalDocs::Languages::Prototype::Parameter> object.
|
221
|
+
#
|
222
|
+
sub ParseParameterLine #(line)
|
223
|
+
{
|
224
|
+
my ($self, $line) = @_;
|
225
|
+
|
226
|
+
$line =~ s/^ //;
|
227
|
+
$line =~ s/ $//;
|
228
|
+
|
229
|
+
my @tokens = $line =~ /([^\(\)\[\]\{\}\<\>\'\"\:\=\ ]+|\:\=|.)/g;
|
230
|
+
|
231
|
+
my ($name, $type, $defaultValue, $defaultValuePrefix, $inType, $inDefaultValue);
|
232
|
+
|
233
|
+
|
234
|
+
my @symbolStack;
|
235
|
+
|
236
|
+
foreach my $token (@tokens)
|
237
|
+
{
|
238
|
+
if ($inDefaultValue)
|
239
|
+
{ $defaultValue .= $token; }
|
240
|
+
|
241
|
+
elsif ($symbolStack[-1] eq '\'' || $symbolStack[-1] eq '"')
|
242
|
+
{
|
243
|
+
if ($inType)
|
244
|
+
{ $type .= $token; }
|
245
|
+
else
|
246
|
+
{ $name .= $token; };
|
247
|
+
|
248
|
+
if ($token eq $symbolStack[-1])
|
249
|
+
{ pop @symbolStack; };
|
250
|
+
}
|
251
|
+
|
252
|
+
elsif ($token =~ /^[\(\[\{\<\'\"]$/)
|
253
|
+
{
|
254
|
+
if ($inType)
|
255
|
+
{ $type .= $token; }
|
256
|
+
else
|
257
|
+
{ $name .= $token; };
|
258
|
+
|
259
|
+
push @symbolStack, $token;
|
260
|
+
}
|
261
|
+
|
262
|
+
elsif ( ($token eq ')' && $symbolStack[-1] eq '(') ||
|
263
|
+
($token eq ']' && $symbolStack[-1] eq '[') ||
|
264
|
+
($token eq '}' && $symbolStack[-1] eq '{') ||
|
265
|
+
($token eq '>' && $symbolStack[-1] eq '<') )
|
266
|
+
{
|
267
|
+
if ($inType)
|
268
|
+
{ $type .= $token; }
|
269
|
+
else
|
270
|
+
{ $name .= $token; };
|
271
|
+
|
272
|
+
pop @symbolStack;
|
273
|
+
}
|
274
|
+
|
275
|
+
elsif ($token eq ' ')
|
276
|
+
{
|
277
|
+
if ($inType)
|
278
|
+
{ $type .= $token; }
|
279
|
+
elsif (!scalar @symbolStack)
|
280
|
+
{ $inType = 1; }
|
281
|
+
else
|
282
|
+
{ $name .= $token; };
|
283
|
+
}
|
284
|
+
|
285
|
+
elsif ($token eq ':=' || $token eq '=')
|
286
|
+
{
|
287
|
+
if (!scalar @symbolStack)
|
288
|
+
{
|
289
|
+
$defaultValuePrefix = $token;
|
290
|
+
$inDefaultValue = 1;
|
291
|
+
}
|
292
|
+
elsif ($inType)
|
293
|
+
{ $type .= $token; }
|
294
|
+
else
|
295
|
+
{ $name .= $token; };
|
296
|
+
}
|
297
|
+
|
298
|
+
else
|
299
|
+
{
|
300
|
+
if ($inType)
|
301
|
+
{ $type .= $token; }
|
302
|
+
else
|
303
|
+
{ $name .= $token; };
|
304
|
+
};
|
305
|
+
};
|
306
|
+
|
307
|
+
foreach my $part (\$type, \$defaultValue)
|
308
|
+
{
|
309
|
+
$$part =~ s/ $//;
|
310
|
+
};
|
311
|
+
|
312
|
+
return NaturalDocs::Languages::Prototype::Parameter->New($type, undef, $name, undef, $defaultValue, $defaultValuePrefix);
|
313
|
+
};
|
314
|
+
|
315
|
+
|
316
|
+
sub TypeBeforeParameter
|
317
|
+
{ return 0; };
|
318
|
+
|
319
|
+
1;
|
@@ -0,0 +1,143 @@
|
|
1
|
+
###############################################################################
|
2
|
+
#
|
3
|
+
# Class: NaturalDocs::Languages::Pascal
|
4
|
+
#
|
5
|
+
###############################################################################
|
6
|
+
#
|
7
|
+
# A subclass to handle the language variations of Pascal and Delphi.
|
8
|
+
#
|
9
|
+
###############################################################################
|
10
|
+
|
11
|
+
# This file is part of Natural Docs, which is Copyright (C) 2003-2008 Greg Valure
|
12
|
+
# Natural Docs is licensed under the GPL
|
13
|
+
|
14
|
+
use strict;
|
15
|
+
use integer;
|
16
|
+
|
17
|
+
package NaturalDocs::Languages::Pascal;
|
18
|
+
|
19
|
+
use base 'NaturalDocs::Languages::Simple';
|
20
|
+
|
21
|
+
|
22
|
+
#
|
23
|
+
# hash: prototypeDirectives
|
24
|
+
#
|
25
|
+
# An existence hash of all the directives that can appear after a function prototype and will be included. The keys are the all
|
26
|
+
# lowercase keywords.
|
27
|
+
#
|
28
|
+
my %prototypeDirectives = ( 'overload' => 1,
|
29
|
+
'override' => 1,
|
30
|
+
'virtual' => 1,
|
31
|
+
'abstract' => 1,
|
32
|
+
'reintroduce' => 1,
|
33
|
+
'export' => 1,
|
34
|
+
'public' => 1,
|
35
|
+
'interrupt' => 1,
|
36
|
+
'register' => 1,
|
37
|
+
'pascal' => 1,
|
38
|
+
'cdecl' => 1,
|
39
|
+
'stdcall' => 1,
|
40
|
+
'popstack' => 1,
|
41
|
+
'saveregisters' => 1,
|
42
|
+
'inline' => 1,
|
43
|
+
'safecall' => 1 );
|
44
|
+
|
45
|
+
#
|
46
|
+
# hash: longPrototypeDirectives
|
47
|
+
#
|
48
|
+
# An existence hash of all the directives with parameters that can appear after a function prototype and will be included. The
|
49
|
+
# keys are the all lowercase keywords.
|
50
|
+
#
|
51
|
+
my %longPrototypeDirectives = ( 'alias' => 1,
|
52
|
+
'external' => 1 );
|
53
|
+
|
54
|
+
#
|
55
|
+
# bool: checkingForDirectives
|
56
|
+
#
|
57
|
+
# Set after the first function semicolon, which means we're in directives mode.
|
58
|
+
#
|
59
|
+
my $checkingForDirectives;
|
60
|
+
|
61
|
+
|
62
|
+
#
|
63
|
+
# Function: OnCode
|
64
|
+
#
|
65
|
+
# Just overridden to reset <checkingForDirectives>.
|
66
|
+
#
|
67
|
+
sub OnCode #(...)
|
68
|
+
{
|
69
|
+
my ($self, @parameters) = @_;
|
70
|
+
|
71
|
+
$checkingForDirectives = 0;
|
72
|
+
|
73
|
+
return $self->SUPER::OnCode(@parameters);
|
74
|
+
};
|
75
|
+
|
76
|
+
|
77
|
+
#
|
78
|
+
# Function: OnPrototypeEnd
|
79
|
+
#
|
80
|
+
# Pascal's syntax has directives after the prototype that should be included.
|
81
|
+
#
|
82
|
+
# > function MyFunction ( param1: type ); virtual; abstract;
|
83
|
+
#
|
84
|
+
# Parameters:
|
85
|
+
#
|
86
|
+
# type - The <TopicType> of the prototype.
|
87
|
+
# prototypeRef - A reference to the prototype so far, minus the ender in dispute.
|
88
|
+
# ender - The ender symbol.
|
89
|
+
#
|
90
|
+
# Returns:
|
91
|
+
#
|
92
|
+
# ENDER_ACCEPT - The ender is accepted and the prototype is finished.
|
93
|
+
# ENDER_IGNORE - The ender is rejected and parsing should continue. Note that the prototype will be rejected as a whole
|
94
|
+
# if all enders are ignored before reaching the end of the code.
|
95
|
+
# ENDER_ACCEPT_AND_CONTINUE - The ender is accepted so the prototype may stand as is. However, the prototype might
|
96
|
+
# also continue on so continue parsing. If there is no accepted ender between here and
|
97
|
+
# the end of the code this version will be accepted instead.
|
98
|
+
# ENDER_REVERT_TO_ACCEPTED - The expedition from ENDER_ACCEPT_AND_CONTINUE failed. Use the last accepted
|
99
|
+
# version and end parsing.
|
100
|
+
#
|
101
|
+
sub OnPrototypeEnd #(type, prototypeRef, ender)
|
102
|
+
{
|
103
|
+
my ($self, $type, $prototypeRef, $ender) = @_;
|
104
|
+
|
105
|
+
if ($type eq ::TOPIC_FUNCTION() && $ender eq ';')
|
106
|
+
{
|
107
|
+
if (!$checkingForDirectives)
|
108
|
+
{
|
109
|
+
$checkingForDirectives = 1;
|
110
|
+
return ::ENDER_ACCEPT_AND_CONTINUE();
|
111
|
+
}
|
112
|
+
elsif ($$prototypeRef =~ /;[ \t]*([a-z]+)([^;]*)$/i)
|
113
|
+
{
|
114
|
+
my ($lastDirective, $extra) = (lc($1), $2);
|
115
|
+
|
116
|
+
if (exists $prototypeDirectives{$lastDirective} && $extra =~ /^[ \t]*$/)
|
117
|
+
{ return ::ENDER_ACCEPT_AND_CONTINUE(); }
|
118
|
+
elsif (exists $longPrototypeDirectives{$lastDirective})
|
119
|
+
{ return ::ENDER_ACCEPT_AND_CONTINUE(); }
|
120
|
+
else
|
121
|
+
{ return ::ENDER_REVERT_TO_ACCEPTED(); };
|
122
|
+
}
|
123
|
+
else
|
124
|
+
{ return ::ENDER_REVERT_TO_ACCEPTED(); };
|
125
|
+
}
|
126
|
+
else
|
127
|
+
{ return ::ENDER_ACCEPT(); };
|
128
|
+
};
|
129
|
+
|
130
|
+
|
131
|
+
sub ParseParameterLine #(...)
|
132
|
+
{
|
133
|
+
my ($self, @params) = @_;
|
134
|
+
return $self->SUPER::ParsePascalParameterLine(@params);
|
135
|
+
};
|
136
|
+
|
137
|
+
sub TypeBeforeParameter
|
138
|
+
{
|
139
|
+
return 0;
|
140
|
+
};
|
141
|
+
|
142
|
+
|
143
|
+
1;
|