Home » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199206b.adf » June92 » !AWJune92/Goodies/AllAtC/work/h/lexical

!AWJune92/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 » Recent acquisitions » Acorn ADFS disks » adfs_ArchimedesWorld_199206b.adf » June92
Filename: !AWJune92/Goodies/AllAtC/work/h/lexical
Read OK:
File size: 02F2 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

#ifndef TRUE                  /* Define TRUE and FALSE if not done. */
#define FALSE   0
#define TRUE   !FALSE         /* i.e. Not false.  */
#endif

/* Variable type definitions.  */

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


/* Function declarations.      */

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

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 0a 23 69 66 6e 64  |NULL    0..#ifnd|
000000e0  65 66 20 54 52 55 45 20  20 20 20 20 20 20 20 20  |ef TRUE         |
000000f0  20 20 20 20 20 20 20 20  20 2f 2a 20 44 65 66 69  |         /* Defi|
00000100  6e 65 20 54 52 55 45 20  61 6e 64 20 46 41 4c 53  |ne TRUE and FALS|
00000110  45 20 69 66 20 6e 6f 74  20 64 6f 6e 65 2e 20 2a  |E if not done. *|
00000120  2f 0a 23 64 65 66 69 6e  65 20 46 41 4c 53 45 20  |/.#define FALSE |
00000130  20 20 30 0a 23 64 65 66  69 6e 65 20 54 52 55 45  |  0.#define TRUE|
00000140  20 20 20 21 46 41 4c 53  45 20 20 20 20 20 20 20  |   !FALSE       |
00000150  20 20 2f 2a 20 69 2e 65  2e 20 4e 6f 74 20 66 61  |  /* i.e. Not fa|
00000160  6c 73 65 2e 20 20 2a 2f  0a 23 65 6e 64 69 66 0a  |lse.  */.#endif.|
00000170  0a 2f 2a 20 56 61 72 69  61 62 6c 65 20 74 79 70  |./* Variable typ|
00000180  65 20 64 65 66 69 6e 69  74 69 6f 6e 73 2e 20 20  |e definitions.  |
00000190  2a 2f 0a 0a 74 79 70 65  64 65 66 20 63 68 61 72  |*/..typedef char|
000001a0  20 73 74 72 69 6e 67 5b  53 54 52 4c 45 4e 2b 31  | string[STRLEN+1|
000001b0  5d 3b 0a 74 79 70 65 64  65 66 20 73 74 72 75 63  |];.typedef struc|
000001c0  74 20 77 6f 72 64 5f 73  74 72 75 63 74 20 2a 77  |t word_struct *w|
000001d0  6f 72 64 3b 0a 0a 0a 2f  2a 20 46 75 6e 63 74 69  |ord;.../* Functi|
000001e0  6f 6e 20 64 65 63 6c 61  72 61 74 69 6f 6e 73 2e  |on declarations.|
000001f0  20 20 20 20 20 20 2a 2f  0a 0a 65 78 74 65 72 6e  |      */..extern|
00000200  20 76 6f 69 64 20 54 6f  55 70 70 65 72 43 61 73  | void ToUpperCas|
00000210  65 28 20 63 68 61 72 20  2a 77 6f 72 64 20 29 3b  |e( char *word );|
00000220  0a 65 78 74 65 72 6e 20  76 6f 69 64 20 54 6f 4c  |.extern void ToL|
00000230  6f 77 65 72 43 61 73 65  28 20 63 68 61 72 20 2a  |owerCase( char *|
00000240  77 6f 72 64 20 29 3b 0a  65 78 74 65 72 6e 20 69  |word );.extern i|
00000250  6e 74 20 20 47 65 74 57  6f 72 64 28 20 63 68 61  |nt  GetWord( cha|
00000260  72 20 2a 62 75 66 66 65  72 2c 20 69 6e 74 20 6c  |r *buffer, int l|
00000270  65 6e 67 74 68 2c 20 46  49 4c 45 20 2a 73 74 72  |ength, FILE *str|
00000280  65 61 6d 20 29 3b 0a 65  78 74 65 72 6e 20 76 6f  |eam );.extern vo|
00000290  69 64 20 53 74 6f 72 65  57 6f 72 64 28 20 63 68  |id StoreWord( ch|
000002a0  61 72 20 2a 73 74 72 2c  20 77 6f 72 64 20 2a 6c  |ar *str, word *l|
000002b0  69 73 74 20 29 3b 0a 65  78 74 65 72 6e 20 76 6f  |ist );.extern vo|
000002c0  69 64 20 4c 69 73 74 57  6f 72 64 73 28 20 46 49  |id ListWords( FI|
000002d0  4c 45 20 2a 66 2c 20 77  6f 72 64 20 6c 69 73 74  |LE *f, word list|
000002e0  2c 20 69 6e 74 20 72 65  70 65 61 74 73 20 29 3b  |, int repeats );|
000002f0  0a 0a                                             |..|
000002f2