/usr/share/doc/gnat-gps/tutorial.html is in gnat-gps-doc 5.0-16.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 2002-2010 AdaCore.
This document is free; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This document is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, see http://www.gnu.org/licenses/.
A copy of the license is included in the section entitled
"GNU General Public License". -->
<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNAT Programming Studio Tutorial</title>
<meta name="description" content="GNAT Programming Studio Tutorial">
<meta name="keywords" content="GNAT Programming Studio Tutorial">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="#Introduction" rel="start" title="Introduction">
<link href="#SEC_Contents" rel="contents" title="Table of Contents">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<h1 class="settitle" align="center">GNAT Programming Studio Tutorial</h1>
<a name="SEC_Contents"></a>
<h2 class="contents-heading">Table of Contents</h2>
<div class="contents">
<ul class="no-bullet">
<li><a name="toc-Introduction-1" href="#Introduction">1 Introduction</a></li>
<li><a name="toc-Quick-overview-of-the-GPS-areas-1" href="#Quick-overview-of-the-GPS-areas">2 Quick overview of the GPS areas</a></li>
<li><a name="toc-Editing-sources-1" href="#Editing-sources">3 Editing sources</a></li>
<li><a name="toc-Building-applications-1" href="#Building-applications">4 Building applications</a></li>
<li><a name="toc-Source-Navigation-1" href="#Source-Navigation">5 Source Navigation</a></li>
<li><a name="toc-Search-Dialog-1" href="#Search-Dialog">6 Search Dialog</a></li>
<li><a name="toc-Project-View-_0028entities_0029-1" href="#Project-View-_0028entities_0029">7 Project View (entities)</a></li>
<li><a name="toc-Back-to-Source-Navigation-1" href="#Back-to-Source-Navigation">8 Back to Source Navigation</a></li>
<li><a name="toc-Code-Completion-1" href="#Code-Completion">9 Code Completion</a></li>
<li><a name="toc-Run-1" href="#Run">10 Run</a></li>
<li><a name="toc-Debug-1" href="#Debug">11 Debug</a></li>
<li><a name="toc-Call-Graph-1" href="#Call-Graph">12 Call Graph</a></li>
<li><a name="toc-Locations-View-1" href="#Locations-View">13 Locations View</a></li>
<li><a name="toc-Projects-1" href="#Projects">14 Projects</a>
<ul class="no-bullet">
<li><a name="toc-Project-Wizard-1" href="#Project-Wizard">14.1 Project Wizard</a></li>
<li><a name="toc-Project-properties-1" href="#Project-properties">14.2 Project properties</a></li>
<li><a name="toc-Variable-editor-1" href="#Variable-editor">14.3 Variable editor</a></li>
<li><a name="toc-Switch-editor-1" href="#Switch-editor">14.4 Switch editor</a></li>
<li><a name="toc-Source-dependencies-1" href="#Source-dependencies">14.5 Source dependencies</a></li>
<li><a name="toc-Project-dependencies-1" href="#Project-dependencies">14.6 Project dependencies</a></li>
</ul></li>
<li><a name="toc-Epilogue-1" href="#Epilogue">15 Epilogue</a></li>
<li><a name="toc-GNU-General-Public-License-1" href="#GNU-General-Public-License">Appendix A GNU General Public License</a></li>
</ul>
</div>
<a name="Introduction"></a>
<a name="Introduction-1"></a>
<h2 class="chapter">1 Introduction</h2>
<p>This document provides a guide through the major capabilities
of the GNAT Programming Studio by working on a code example: sdc, a simple
desktop calculator.
</p>
<p>It is important to realize that the features that you are about to
experiment with are available on multiple platforms, using the same user
interface and capabilities, providing a user-friendly environment
with a tight integration between the tools.
</p>
<p>Start GPS in the directory containing the tutorial files, or if the directory
is read-only, copy the <samp>tutorial</samp> directory and its subdirectories in a
local (writable) area, and start GPS from the <samp>tutorial</samp> directory, so
that GPS will load the right context.
</p>
<p>By default, the tutorial sources can be found under
<code><prefix>/share/examples/gps/tutorial</code>, where <code><prefix></code> is the
prefix directory of the GPS installation.
</p>
<p>Alternatively, if you have already started GPS in another directory, you
can load the project <code>sdc.gpr</code> by using the menu <code>Project->Open...</code>
</p>
<hr>
<a name="Quick-overview-of-the-GPS-areas"></a>
<a name="Quick-overview-of-the-GPS-areas-1"></a>
<h2 class="chapter">2 Quick overview of the GPS areas</h2>
<p>Having launched GPS, you should now have access to a main window composed of
several areas:
</p>
<ul>
<li> a menu bar at the top
</li><li> a tool bar under the menu bar
</li><li> a scenario view under the tool bar, on the left side
</li><li> a project view under the scenario view, on the left side
</li><li> a working area on the right of the project view
</li><li> a messages window under the working area
</li></ul>
<hr>
<a name="Editing-sources"></a>
<a name="Editing-sources-1"></a>
<h2 class="chapter">3 Editing sources</h2>
<p>In the project view, open the <code>common</code> directory by clicking
on the <code>[+]</code> sign (a triangle under unix systems) on the left of
<code>common</code>.
This will open the directory and display a list of source files located
in this directory.
</p>
<p>Now, double click on <samp>sdc.adb</samp>: this will open a source editor on this
file. The source code is syntax-highlighted: keywords, comments, strings and
characters have different colors.
</p>
<p>As with many other properties, colors are configurable in GPS:
</p>
<p>Select the menu <code>Edit->Preferences</code>. This will open a preferences
dialog window.
</p>
<p>Select the <code>Editor->Fonts & Colors</code> page by clicking on the cross next to
the item <code>Editor</code> and then selecting the <code>Fonts & Colors</code> item.
</p>
<p>As you go over the various lines and labels, you will notice that by
holding the mouse over a label, a tool tip pops up displaying on-line help
about the selected item.
</p>
<p>Change the background color of the <code>Keywords</code> by clicking on the last
button, at the right of the <code>Keywords</code> line.
</p>
<p>Choose a color, e.g a light green. When you’re done with the color
selection, click on <code>OK</code> in the color selection dialog.
</p>
<p>Click on the <code>Apply</code> button and look at the effects in the source
editor. If you like the new display, click on <code>OK</code> to confirm the
changes, otherwise clicking on <code>Cancel</code> will revert to the previous
color.
</p>
<hr>
<a name="Building-applications"></a>
<a name="Building-applications-1"></a>
<h2 class="chapter">4 Building applications</h2>
<p>Select the icon <code>Build Main: sdc.adb</code> on the toolbar (third icon
from the right): this will launch
a complete build of the <i>sdc</i> application. Note also that you can use a
key binding directly instead of this tool bar button (<tt class="key">F4</tt>), or use the
corresponding menu item <code>Build->Project->sdc.adb</code>. If you use the menu
item, an extra intermediate dialog is displayed showing the actual command
line that will be used by GPS. Pressing <tt class="key">Enter</tt> will launch also the build.
</p>
<p>The build has generated a number of errors in a new window: the <i>Locations</i>
tree, displayed in the bottom area. The errors are also highlighted in the
corresponding source editor.
</p>
<p>GPS has automatically jumped to the first error message
(<i>sdc.adb, 28:6 : (style) bad indentation</i>),
at the line (28) and column (6) of the error.
</p>
<p>Fix the error by hand by inserting a space.
</p>
<p>Now you can fix the next error by moving the cursor to the line 30 (press
the <tt class="key">down</tt> arrow twice), and by using <tt class="key">Ctrl-Tab</tt> (press first the
<tt class="key">Control</tt> key, and then the <tt class="key">Tab</tt> key on your keyboard): this key
combination asks the source editor to automatically re-indent the current
line.
</p>
<p>Note that on some window managers or desktop environments,
<tt class="key">Ctrl-Tab</tt> is already defined. If this is the case, you can change this
shortcut from the key shortcuts dialog (menu <code>Edit->Key shortcuts</code>,
<code>Menus</code> section, <code>/Edit/Format Selection</code> item).
</p>
<p>You can then fix all the remaining errors by selecting the whole block
(from line 28 to line 40) and pressing <tt class="key">Ctrl-Tab</tt>. To select a block,
you can either click on the left mouse button and select the area while
holding the button, or using the keyboard by pressing the <tt class="key">Shift</tt> key
and moving the cursor using the <tt class="key">Up</tt> or <tt class="key">Down</tt> keys.
</p>
<p>Press the <tt class="key">F4</tt> key to build again. GPS will automatically save the
modified files, and start a build. This behavior (automatic saving of files
before building) can be configured in the preferences dialog.
</p>
<p>If you look at the bottom right of the GPS window, you will notice that a
progress bar has appeared, displaying the current number of files compiled,
and the number of remaining files. This progress bar disappears when the
build is finished.
</p>
<p>This should now report a successful build.
</p>
<hr>
<a name="Source-Navigation"></a>
<a name="Source-Navigation-1"></a>
<h2 class="chapter">5 Source Navigation</h2>
<p>Now let’s try to understand a little bit about how the program is working by
looking at the <samp>sdc.adb</samp> editor: there’s a loop, the main processing is
done by the functions Process and Next (at line 30).
</p>
<p>Click around line 30, move the mouse over <code>Process</code> and let a tool tip
appear (<code>Tokens.Process global procedure declared at tokens.ads:19</code>): this
gives information about the kind of entity and the location (file and line) of
the declaration of this procedure, the profile of the parameters, and
documentation for this function, as extracted from the comments surrounding
the procedure declaration.
</p>
<p>Do the same for <code>Next</code> (<code>Tokens.Next global function declared at
tokens.ads:15</code>).
</p>
<p>Keeping the mouse over <code>Next</code>, display the contextual menu by clicking on
the right mouse button,
then click on <code>Goto declaration of Next</code>: we’re now in the package
<code>Tokens</code>, in file <samp>tokens.ads</samp>; but where is this file in the project?
</p>
<hr>
<a name="Search-Dialog"></a>
<a name="Search-Dialog-1"></a>
<h2 class="chapter">6 Search Dialog</h2>
<p>Select the menu <code>Navigate->Find or Replace...</code>: this will open a search
dialog.
In the <code>Search for:</code> text entry type <samp>tokens.ads</samp>. Then
select <code>Project view</code> in the <code>Look in:</code> area. The search
area provides an easy way to search for text or regular expressions in
several contexts including the current file, the project view, …
</p>
<p>Now click on <code>Find</code>. The file <samp>tokens.ads</samp>, in directory <code>struct</code>
is highlighted.
</p>
<p>Close the search dialog by clicking on the <code>Close</code> button.
</p>
<p>Note that in this specific case, a simpler way to locate a file in the
project view is to use the contextual menu from the source editor:
<code>Locate in Project View: tokens.ads</code>.
</p>
<hr>
<a name="Project-View-_0028entities_0029"></a>
<a name="Project-View-_0028entities_0029-1"></a>
<h2 class="chapter">7 Project View (entities)</h2>
<p>Click on the <code>[+]</code> sign (or triangle) to open <samp>tokens.ads</samp> entities.
When you click on a file in the project view, you get
language sensitive information about the file, such as
<code>packages</code>, <code>subprograms</code>, <code>tasks</code>, ... for <code>Ada</code>.
</p>
<p>Open the <code>subprogram</code> category, click on <code>Process</code>: this
will open <samp>tokens.ads</samp> and move the cursor on the first line
corresponding to the procedure <code>Process</code>.
</p>
<p>Similarly, click on <code>Next</code>, and move your mouse on <code>Next</code>
in the source editor.
</p>
<hr>
<a name="Back-to-Source-Navigation"></a>
<a name="Back-to-Source-Navigation-1"></a>
<h2 class="chapter">8 Back to Source Navigation</h2>
<p>Move the mouse over the <code>Next</code> identifier in <samp>tokens.ads</samp> editor,
and then hold the <tt class="key">Control</tt> key: while you’re holding the key, move the
mouse over entities: these entities now become clickable hyperlinks. Clicking
on the first mouse button will go to the declaration of the entity highlighted
(or the body if you are already on the declaration), and clicking on the
middle mouse button will go to the body directly: move
the mouse back to <code>Next</code> and click. Alternatively, you can use the
the contextual menu and select <code>Goto body of Next</code>; then
scroll through the procedure <code>Next</code>, move the mouse on
<code>Instructions.Read</code> at line 46, hold <tt class="key">control</tt> again and
click with the middle mouse button (or from the contextual menu, select
<code>Goto body of Read</code>).
</p>
<p>We’ve now navigated quite a bit through the application source code,
which you can verify by clicking on the left arrow in the tool bar, to go
back to the previous locations visited.
</p>
<p>Repeat the operation until you’re back in <samp>sdc.adb</samp>.
As with the undo/redo capability in the source editor, the
<code>goto previous/next location</code> is infinite.
</p>
<hr>
<a name="Code-Completion"></a>
<a name="Code-Completion-1"></a>
<h2 class="chapter">9 Code Completion</h2>
<p>Go on the line 38 of sdc.adb. You can see that there is a null instruction for
the case of Stack.Overflow. We are going to add some code here, using the
code assist capabilities.
</p>
<p>Type <tt class="key">enter</tt> to create a new line, and then <code>Scr</code>, and hit
<tt class="key">Ctrl+Space</tt>.
A completion popup will be displayed, showing all the entities of the project
begining with <code>Scr</code>. Select <code>Screen_Output</code>. The code will be
automatically completed in the editor. Then add a dot in your code. The
completion popup will be automatically triggered, and will offer you to
complete your code with the entities contained in the <code>Screen_Output</code>
package. Select <code>Msg</code>, add a space, and then an open parenthesis. Once
again, the completion windows will pop up, and show you the possible parameters
for msg. If you choose the first entry of the completion list
("params of Msg"), the call will
be automatically completed by a list of named parameters. Complete the list by
giving e.g. <code>"The stack is full."</code> for <code>S1</code>, <code>""</code> for <code>S2</code>,
and <code>True</code> for <code>End_Line</code>.
</p>
<p>Don’t forget to add a semicolon at the end of the instruction. Then hit <tt class="key">F4</tt>
in order to rebuild the application.
</p>
<hr>
<a name="Run"></a>
<a name="Run-1"></a>
<h2 class="chapter">10 Run</h2>
<p>It is now time to run the application: select the menu
<code>Build->Run->sdc</code>, which will open a dialog window.
Type <code>input.txt</code> in the text entry: this is the name of a text
file that will be passed as argument to the <i>sdc</i> program.
</p>
<p>Now click on <code>OK</code>: a new window titled <code>Run: sdc input.txt</code>
is created at the bottom of the main window where the sdc application
runs and displays an unexpected internal error: this is a good opportunity
to use the integrated debugger.
</p>
<p>Close the execution window by clicking on the x icon on the top right
corner of this window.
</p>
<hr>
<a name="Debug"></a>
<a name="Debug-1"></a>
<h2 class="chapter">11 Debug</h2>
<p>Open the preferences dialog (menu <code>Edit->Preferences</code>) and
click on the <code>Debugger</code> item on the left; set the button
<code>Break on exceptions</code> to <i>Enabled</i>: this will enable by default a special
breakpoint every time an exception is raised. Click on <code>OK</code> to confirm your
change.
</p>
<p>Now select the menu <code>Debug->Initialize->sdc</code>: a new window is
created: this is the debugger console.
You can also look at the various debug menu item and tool bar buttons which are
now activated.
</p>
<p>Use the menu <code>Debug->Data->Call Stack</code>: this opens a new window on the
right of the source editors. If you select the contextual menu in the call
stack, various pieces of information can be displayed or
removed in the call stack. From this contextual menu, add the
<code>Frame Number</code> info by clicking on it.
</p>
<p>Now select the menu <code>Debug->Run...</code>. Notice that <code>input.txt</code> has
been filled automatically for you since the two menus <code>Build->Run...</code> and
<code>Debug->Run...</code> are synchronized. Click on <code>OK</code>: the debugger should
stop on an exception (<code>Constraint_Error</code> in the file <samp>stack.adb</samp>, at
line 49).
</p>
<p>Go up in the call stack by clicking on the <code>tokens.process</code> line
(frame number 6 or 7, depending on your GNAT version).
</p>
<p>If you move the mouse over the parameter <code>T</code> at line 64, a tool tip is
displayed showing the value of <code>T</code>. You have probably noticed that
tool tips, like menus, are contextual: depending on the current session and
on the entity selected, different information is displayed.
</p>
<p>Select the contextual menu <code>Debug->Display T</code>: this will open a new
window: the data window, with a box displaying graphically the contents
of the different fields of <code>T</code>, each clearly separated.
</p>
<p>On <code>T</code> data display, select the contextual menu
<code>Display->Show Value + Type</code>: this displays for all fields both their
type and value.
</p>
<p>Special colors are used in the data display: blue for pointers that can be
dereferenced by a double-click (double click on <code>T.val</code>); red for fields
that have been modified since last step.
</p>
<p>From the T box, right-click to display the contextual menu and
select <code>View memory at address of T</code>: a memory view is opened.
Use the <code>up</code> and <code>down</code> arrows on the right to visit memory.
</p>
<p>Click in the memory dump, and modify it by typing numbers. Notice the
red color for modified values;
click on <code>Undo Changes</code> to cancel the modifications;
click on <code>Close</code> to close the memory window.
</p>
<p>In the call stack, go back to <code>stack.push</code> frame (num 4 or 5).
Move the mouse over <code>Last</code> and let the debugger display its value: 0.
From the contextual menu, select <code>Goto declaration of Last</code>: this
will jump to the line 16 of <samp>stack.adb</samp>, where you can see that
<code>Last</code> is a <code>Natural</code>. Now click on the <code>Goto Previous Location</code>
button in the tool bar: we’re now back at line 49 where we can see that for a
<code>Push</code> procedure, <code>Last</code> should be incremented, and not decremented.
</p>
<p>Fix the line to <code>Last := Last + 1;</code>
</p>
<p>Save the file (<tt class="key">Ctrl-S</tt>);
End the debug session: menu <code>Debug->Terminate</code>;
Rebuild (press <tt class="key">F4</tt> key);
Rerun (menu <code>Build->Run->sdc</code>, click on <code>OK</code>): the program now
completes as expected. Close the execution window.
</p>
<hr>
<a name="Call-Graph"></a>
<a name="Call-Graph-1"></a>
<h2 class="chapter">12 Call Graph</h2>
<p>Now go back to the file <samp>sdc.adb</samp>, move the mouse over the procedure
<i>sdc</i> at line 8, select the contextual menu
<code>Browsers->Sdc calls</code>: this will open a new window titled
<i>Call graph browser</i>.
</p>
<p>Note that there is also a top level contextual menu (<code>Sdc calls</code>)
which provides a tree view of the callers/callees.
</p>
<p>In the call graph, click on the right arrow of <code>Process</code> (one of the
first items on the top). Also click on the right arrow of <code>error_msg</code>.
</p>
<p>Select <code>Orthogonal links</code> in the contextual menu of the graph to change the
way links are displayed in the graph.
You may then play with the zoom (<tt class="key">=</tt> and <tt class="key">-</tt> keys).
</p>
<p>If you select <code>Hide links</code> from <code>error_msg</code> contextual menu, this
will hide all the links that are related to this item: the link between the
callers and callees of <code>error_msg</code> are no longer displayed. This can
be useful when the graph becomes complex, to hide some parts. If you go back to
the contextual menu, you can now select <code>Show links</code> to show the links
again.
</p>
<p>Click on right arrow of <code>process</code> (<code>(Decl) instructions.ads:12</code>).
</p>
<p>The items can also be moved: move e.g <code>msg</code> item around.
</p>
<p>You can also recompute the layout of all the current items by using
the browser’s contextual menu <code>Refresh layout</code> (move the mouse on the
browser’s background, with no box underneath, and right click).
</p>
<p>Click on left arrow of <code>msg</code>
to display who is calling <code>msg</code>. Notice that <code>view</code> calls <code>msg</code>.
</p>
<p>Click on left arrow of <code>view</code>: the arrow disappears, and no
new items are created, which means that <code>view</code> isn’t called by anyone,
so we’re now going to remove this procedure.
</p>
<hr>
<a name="Locations-View"></a>
<a name="Locations-View-1"></a>
<h2 class="chapter">13 Locations View</h2>
<p>From <i>view</i>, click on the blue link: <code>stack.ads:32</code>, this will open
the file <samp>stack.ads</samp> at line 32.
Then from the source editor (file <samp>stack.ads</samp>), select the contextual
menu <code>References->Find all references to View</code>: this highlights the
<code>Locations</code> tree which now contains all the references for <code>view</code>,
grouped by files (<samp>stack.ads</samp> and <samp>stack.adb</samp>).
</p>
<p>The first location is highlighted automatically: this is the spec of the
procedure <code>View</code>. Now click in the tree on the <code>+</code> sign (or
triangle) at the left
of <samp>stack.adb</samp>: two locations are listed, at line 90 and 97.
Click on each of these locations: they correspond to the procedure body.
</p>
<p>The <code>Find all references</code> capability is another way to list all the uses of
an entity, and it confirms that <code>View</code> isn’t called in our project.
</p>
<p>Remove <i>View</i> body by e.g selecting it, and pressing the <tt class="key">Delete</tt> key,
then save the file (<tt class="key">Ctrl-S</tt>).
</p>
<p>Do the same for the spec, save the file.
</p>
<p>Close the <samp>stack.ads</samp> and <samp>stack.adb</samp> files (menu File->Close,
or using the shortcut <tt class="key">Ctrl-W</tt>).
Rebuild by pressing the <tt class="key">F4</tt> key.
</p>
<p>Let’s now see how to create a project corresponding to the <i>sdc</i>
project we’ve used in this tutorial.
</p>
<hr>
<a name="Projects"></a>
<a name="Projects-1"></a>
<h2 class="chapter">14 Projects</h2>
<hr>
<a name="Project-Wizard"></a>
<a name="Project-Wizard-1"></a>
<h3 class="section">14.1 Project Wizard</h3>
<p>Go to the menu <code>Project->New...</code>: this is a standard wizard, with various
steps listed on the left area of the window.
</p>
<p>The first page of the wizard allows you to select what kind of project you
want to build, depending on the information you have. Select the default
choice <code>Single Project</code>, and press <code>Forward</code>.
</p>
<p>Type <i>sdc2</i> in the project name field.
</p>
<p>Click on <code>Forward</code>: we are now on the language selection page.
It is possible to create a multi-language project by e.g. selecting the C or C++
check box.
</p>
<p>Click on <code>Forward</code>: we are now on the <code>VCS page</code>. <i>VCS</i> stands
for <i>Version Control System</i>.
GPS provides a generic framework for <i>VCS</i> which allows it to support
new systems easily. Systems supported by default are CVS, ClearCase,
Subversion and GIT. Select <code>Auto</code>, which means that GPS will automatically
detect the version control system used, if any.
</p>
<p>Click on <code>Forward</code>: this is the source directories selection,
used to specify the project’s sources. Click on the <code>Add</code> button,
and select the <code>struct</code> directory, then click on <code>OK</code> to validate.
</p>
<p>Click on <code>Forward</code>: this is the <code>Build</code> and <code>Exec</code> directory
selection, used to store object, ali files, ...
</p>
<p>Click on the first <code>Browse</code> button, then click on
<code>obj</code>, and finally click on <code>OK</code>.
</p>
<p>Click on <code>Forward</code>: this is the main units selection, used mainly for
building executables and debugging.
</p>
<p>Click on <code>Add</code>, open the <code>common</code> directory and select
<code>sdc.adb</code>.
</p>
<p>Click on <code>Forward</code>: this is the naming scheme editor.
GNAT is very flexible and can use any kind of naming scheme for Ada files.
In particular, you can easily set the default file
extensions (e.g by using one of the predefined schemes) and you
can also specify exceptions that use non standard file names.
</p>
<p>Click on <code>Forward</code>: we’re now in the switch selector.
Select <code>Recompile if switches changed</code>.
</p>
<p>Click on <code>Ada</code> page.
</p>
<p>Select <code>Full errors</code> and <code>Overflow checking</code>.
The boxes and the command line (the text entry at the
bottom of the page) are fully synchronized, e.g if you click on the
command line, and change <code>-gnatf</code> to <code>-gnat</code>, the
<code>Full errors</code> check box is unselected; now type <code>a</code> to get
<code>-gnata</code>, and notice that <code>Enable assertions</code> is now selected.
</p>
<p>We’ve now created a project similar to the one used in this tutorial.
</p>
<p>Click on <code>Cancel</code> to close the wizard.
</p>
<p>Clicking on <code>Apply</code> instead would have created the project file
and loaded it in GPS.
</p>
<hr>
<a name="Project-properties"></a>
<a name="Project-properties-1"></a>
<h3 class="section">14.2 Project properties</h3>
<p>In the project view, on the project <i>sdc</i>, use the contextual menu
<code>Project->Properties</code>.
All the properties set in the project wizard can be found here as well.
You can switch between pages by clicking on the tabs located along the
left side of the window.
</p>
<p>Once you’re done exploring the property pages, click on the <code>Cancel</code>
button to close the properties window.
</p>
<hr>
<a name="Variable-editor"></a>
<a name="Variable-editor-1"></a>
<h3 class="section">14.3 Variable editor</h3>
<p>Select the window titled "Scenario". If not available, you can open it
using the menu <code>Tools->Views->Scenario</code>.
This window contains a <code>Build</code> label.
</p>
<p>This is a configuration variable. With GPS and the GNAT
project facility, you can define as many configuration variables as you want,
and modify any project settings (e.g. switches, sources, ...) based on the
values of configuration variables. These variables can also take any
number of different values.
</p>
<p>The <code>Build</code> variable demonstrates a typical <code>Debug/Production</code>
configuration where we’ve set different switches for the two modes.
</p>
<p>Click on the button at the left (<code>Edit variable properties</code>): this
is the variable editor, where values can be added or renamed.
Close the variable editor by clicking on the <code>Cancel</code> button.
</p>
<p>Now, let’s take a look at the switches set in the project.
</p>
<hr>
<a name="Switch-editor"></a>
<a name="Switch-editor-1"></a>
<h3 class="section">14.4 Switch editor</h3>
<p>Select the menu item <code>Project->Edit File Switches</code>: a global
switch editor is displayed in the working area, showing the
switches associated with each file in the <code>sdc</code> project.
</p>
<p>The editor lists the switches associated with each file in the project.
Gray entries indicate default (global) switches. Notice that
<samp>screen_output.adb</samp> has specific switches, which are highlighted
using a different font.
</p>
<p>Switch between <code>Debug</code> and <code>Production</code> mode in the <code>Build</code>
combo box: the switches are updated automatically.
</p>
<p>Back to our project, let’s now examine the dependencies between sources.
</p>
<hr>
<a name="Source-dependencies"></a>
<a name="Source-dependencies-1"></a>
<h3 class="section">14.5 Source dependencies</h3>
<p>Select <samp>sdc.adb</samp> in the <code>Project View</code> and then the contextual menu
item <code>Show dependencies for sdc.adb</code>: this will open a new graph showing
the dependencies between sources of the project.
</p>
<p>Click on the right arrow of <samp>tokens.ads</samp> to display the files that
<samp>tokens.ads</samp> depends on. Similarly, click on the right arrow of
<samp>stack.ads</samp>.
</p>
<hr>
<a name="Project-dependencies"></a>
<a name="Project-dependencies-1"></a>
<h3 class="section">14.6 Project dependencies</h3>
<p>Back in the project view, on the <i>Sdc</i> project, select the contextual
menu <code>Project->Dependencies</code>, then on the <code>Add From File</code>,
then open the <i>tutorial</i>
directory and click on the <code>projects</code> subdirectory. Select the file
<code>prj1.gpr</code>. Click on <code>Apply</code> to validate the change.
</p>
<p>You can see the new dependency added in the project view, as a tree of
projects. In particular, project dependencies are duplicated: if you open
the <code>prj1</code> icon by clicking on the <code>[+]</code> sign (or triangle), and then
similarly open the <code>prj2</code> icon, you will notice that the project
<code>prj4</code> is displayed twice: once as a dependency of <code>prj2</code>, and
once as a dependency of <code>prj1</code>.
</p>
<p>GPS can also display the graph of dependencies between projects: on <i>Sdc</i>
project, use the contextual menu
<code>Show projects imported by Sdc</code>: this will open a project hierarchy
browser.
</p>
<p>On the <code>Sdc.gpr</code> project, select the contextual menu
<code>Show projects imported by Sdc recursively</code>.
</p>
<p>In the browser, you can move the project items, and select them to highlight
the dependencies.
</p>
<hr>
<a name="Epilogue"></a>
<a name="Epilogue-1"></a>
<h2 class="chapter">15 Epilogue</h2>
<p>This terminates our tour of GPS, the GNAT Programming Studio.
We hope this tutorial gave you a good overview of the general capabilities
available with GPS. A non exhaustive list of the features not mentioned in
this document includes:
</p>
<ul>
<li> Documentation generation
</li><li> Automatic generation of body files
</li><li> Pretty printing
</li><li> Visual comparison of files
</li><li> Version control
</li><li> Flexible multiple document interface
</li><li> Code coverage
</li></ul>
<p>For more information, please look at the <i>User’s Guide</i> (<a href="gps.html">gps.html</a>),
and also look at the <code>Tools</code> menu which gives access to most of these
capabilities.
</p>
<hr>
<a name="GNU-General-Public-License"></a>
<a name="GNU-General-Public-License-1"></a>
<h2 class="appendix">Appendix A GNU General Public License</h2>
<a name="index-GNU-General-Public-License"></a>
<a name="index-License_002c-GNU-General-Public-License"></a>
<pre class="verbatim"> GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
</pre>
<hr>
</body>
</html>
|