Home » Archimedes archive » Archimedes World » AW-1991-10.adf » October91 » !AWOct91/Goodies/AllAtC/work/h/lexical

!AWOct91/Goodies/AllAtC/work/h/lexical

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Archimedes World » AW-1991-10.adf » October91
Filename: !AWOct91/Goodies/AllAtC/work/h/lexical
Read OK:
File size: 026B bytes
Load address: 0000
Exec address: 0000
File contents
/*  Lexical Functions Header File.        */
/*  Archimedes World, October 1991.       */

/*  Header files required.     */

#include <stdio.h>


/* Constant Definitions.       */

#define STRLEN 16
#define NULL    0
#define FALSE   0
#define TRUE   !FALSE         /* i.e. Not false.  */


/* Variable type definitions.  */

typedef char string[STRLEN+1];
typedef struct word_struct *word;


/* Function declarations.      */

void ToUpperCase( char *word );
void ToLowerCase( char *word );
void GetWord( char *buffer, int length, FILE *stream );
void StoreWord( char *str, word *list );
void ListWords( word list );

00000000  2f 2a 20 20 4c 65 78 69  63 61 6c 20 46 75 6e 63  |/*  Lexical Func|
00000010  74 69 6f 6e 73 20 48 65  61 64 65 72 20 46 69 6c  |tions Header Fil|
00000020  65 2e 20 20 20 20 20 20  20 20 2a 2f 0a 2f 2a 20  |e.        */./* |
00000030  20 41 72 63 68 69 6d 65  64 65 73 20 57 6f 72 6c  | Archimedes Worl|
00000040  64 2c 20 4f 63 74 6f 62  65 72 20 31 39 39 31 2e  |d, October 1991.|
00000050  20 20 20 20 20 20 20 2a  2f 0a 0a 2f 2a 20 20 48  |       */../*  H|
00000060  65 61 64 65 72 20 66 69  6c 65 73 20 72 65 71 75  |eader files requ|
00000070  69 72 65 64 2e 20 20 20  20 20 2a 2f 0a 0a 23 69  |ired.     */..#i|
00000080  6e 63 6c 75 64 65 20 3c  73 74 64 69 6f 2e 68 3e  |nclude <stdio.h>|
00000090  0a 0a 0a 2f 2a 20 43 6f  6e 73 74 61 6e 74 20 44  |.../* Constant D|
000000a0  65 66 69 6e 69 74 69 6f  6e 73 2e 20 20 20 20 20  |efinitions.     |
000000b0  20 20 2a 2f 0a 0a 23 64  65 66 69 6e 65 20 53 54  |  */..#define ST|
000000c0  52 4c 45 4e 20 31 36 0a  23 64 65 66 69 6e 65 20  |RLEN 16.#define |
000000d0  4e 55 4c 4c 20 20 20 20  30 0a 23 64 65 66 69 6e  |NULL    0.#defin|
000000e0  65 20 46 41 4c 53 45 20  20 20 30 0a 23 64 65 66  |e FALSE   0.#def|
000000f0  69 6e 65 20 54 52 55 45  20 20 20 21 46 41 4c 53  |ine TRUE   !FALS|
00000100  45 20 20 20 20 20 20 20  20 20 2f 2a 20 69 2e 65  |E         /* i.e|
00000110  2e 20 4e 6f 74 20 66 61  6c 73 65 2e 20 20 2a 2f  |. Not false.  */|
00000120  0a 0a 0a 2f 2a 20 56 61  72 69 61 62 6c 65 20 74  |.../* Variable t|
00000130  79 70 65 20 64 65 66 69  6e 69 74 69 6f 6e 73 2e  |ype definitions.|
00000140  20 20 2a 2f 0a 0a 74 79  70 65 64 65 66 20 63 68  |  */..typedef ch|
00000150  61 72 20 73 74 72 69 6e  67 5b 53 54 52 4c 45 4e  |ar string[STRLEN|
00000160  2b 31 5d 3b 0a 74 79 70  65 64 65 66 20 73 74 72  |+1];.typedef str|
00000170  75 63 74 20 77 6f 72 64  5f 73 74 72 75 63 74 20  |uct word_struct |
00000180  2a 77 6f 72 64 3b 0a 0a  0a 2f 2a 20 46 75 6e 63  |*word;.../* Func|
00000190  74 69 6f 6e 20 64 65 63  6c 61 72 61 74 69 6f 6e  |tion declaration|
000001a0  73 2e 20 20 20 20 20 20  2a 2f 0a 0a 76 6f 69 64  |s.      */..void|
000001b0  20 54 6f 55 70 70 65 72  43 61 73 65 28 20 63 68  | ToUpperCase( ch|
000001c0  61 72 20 2a 77 6f 72 64  20 29 3b 0a 76 6f 69 64  |ar *word );.void|
000001d0  20 54 6f 4c 6f 77 65 72  43 61 73 65 28 20 63 68  | ToLowerCase( ch|
000001e0  61 72 20 2a 77 6f 72 64  20 29 3b 0a 76 6f 69 64  |ar *word );.void|
000001f0  20 47 65 74 57 6f 72 64  28 20 63 68 61 72 20 2a  | GetWord( char *|
00000200  62 75 66 66 65 72 2c 20  69 6e 74 20 6c 65 6e 67  |buffer, int leng|
00000210  74 68 2c 20 46 49 4c 45  20 2a 73 74 72 65 61 6d  |th, FILE *stream|
00000220  20 29 3b 0a 76 6f 69 64  20 53 74 6f 72 65 57 6f  | );.void StoreWo|
00000230  72 64 28 20 63 68 61 72  20 2a 73 74 72 2c 20 77  |rd( char *str, w|
00000240  6f 72 64 20 2a 6c 69 73  74 20 29 3b 0a 76 6f 69  |ord *list );.voi|
00000250  64 20 4c 69 73 74 57 6f  72 64 73 28 20 77 6f 72  |d ListWords( wor|
00000260  64 20 6c 69 73 74 20 29  3b 0a 0a                 |d list );..|
0000026b