
Nassi Tutorial, Lection 4
[ Lecture 1 | Lecture 2 | Lecture 3 | Lecture 4 ]

Select local+global and save the file as tut1mod.c. It will look like this:
/* a demo program that does nothing useful,
but contains all Nassi-Shneiderman structure elements
*/
#include <stdlib.h>
#include <stdio.h>
/* NSC-GLOBAL:
KEY_FONT_COLOR="black"
MIN_WIDTH="0.15"
SHOW_REPEAT="YES"
REPEAT_TEXT="! "
*/
char *function_nr1(char *draw_hints);
void main() {
printf("result = '%s'\n",function_nr1("some parameter"));
}
char *function_nr1(char *parameter) {
/* NSC: HIDE="YES" */
char *dummy1,dummy2[100];
/* NSC: HIDE="YES" */
int i;
do {
for(dummy1=parameter,i=0; dummy1; dummy1++) {
printf("%c",*dummy1);
/* NSC: ALTERNATE_SWITCH="YES" */
switch(*dummy1) {
case 'a':
fprintf(stderr,"Too bad, it was an a\n");
/* NSC: FILL_COLOR="red" KEY_FONT_COLOR="yellow" */
return function_nr1(dummy1);
case 'b':
fprintf(stderr,"Thank god, I found a b\n");
return dummy1;
default:
/* NSC: EXCLUDE="YES" EXCLUDETEXT="check parameter" */
if(dummy1 == parameter) {
printf("- First cut -");
} else {
dummy2[i++] = *dummy1;
}
break;
}
}
return parameter+i;
} while(TRUE);
}
|
The global changes are placed in a comment at the top of the file that starts with the keyword 'NSC-GLOBAL:'. The local changes are placed in comments just in front of the structure elements to which they apply and start with the keyword 'NSC:' (Nassi Special Comment).
If you like, you can insert these comments in the source yourself, using your favorite text editor. A complete list of possible parameters and values can be found in the appendix of the documentation.
Global changes can also be saved in profiles. When nassi starts up, it searches for a file named .nassirc in your current working directory and in your home directory and eventually loads the first one, that it finds. The format of the profile is the same as of the NSCs. Select 'Save Option to Profile' from the 'File' pulldown menu, to create a profile, that contains all of your global changes.
Our future plans for nassi are - of course - bug fixes and small enhancements whenever the need for them arises. Such improvements might be support for non-german locals and a better control over the text layout (e.g. finer granularity of font/color selection).
We will probably not be funded for doing larger extensions like parsers for other programming languages or a source code editor - unless thousands of you are willing to pay for it :-)
[ Lecture 1 | Lecture 2 | Lecture 3 | Lecture 4 ]