2 |
7u83 |
1 |
/*
|
|
|
2 |
Crown Copyright (c) 1997
|
|
|
3 |
|
|
|
4 |
This TenDRA(r) Computer Program is subject to Copyright
|
|
|
5 |
owned by the United Kingdom Secretary of State for Defence
|
|
|
6 |
acting through the Defence Evaluation and Research Agency
|
|
|
7 |
(DERA). It is made available to Recipients with a
|
|
|
8 |
royalty-free licence for its use, reproduction, transfer
|
|
|
9 |
to other parties and amendment for any purpose not excluding
|
|
|
10 |
product development provided that any such use et cetera
|
|
|
11 |
shall be deemed to be acceptance of the following conditions:-
|
|
|
12 |
|
|
|
13 |
(1) Its Recipients shall ensure that this Notice is
|
|
|
14 |
reproduced upon any copies or amended versions of it;
|
|
|
15 |
|
|
|
16 |
(2) Any amended version of it shall be clearly marked to
|
|
|
17 |
show both the nature of and the organisation responsible
|
|
|
18 |
for the relevant amendment or amendments;
|
|
|
19 |
|
|
|
20 |
(3) Its onward transfer from a recipient to another
|
|
|
21 |
party shall be deemed to be that party's acceptance of
|
|
|
22 |
these conditions;
|
|
|
23 |
|
|
|
24 |
(4) DERA gives no warranty or assurance as to its
|
|
|
25 |
quality or suitability for any purpose and DERA accepts
|
|
|
26 |
no liability whatsoever in relation to any use to which
|
|
|
27 |
it may be put.
|
|
|
28 |
*/
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
#ifndef CHAR_INCLUDED
|
|
|
32 |
#define CHAR_INCLUDED
|
|
|
33 |
|
|
|
34 |
|
|
|
35 |
/*
|
|
|
36 |
TYPE REPRESENTING A CHARACTER
|
|
|
37 |
|
|
|
38 |
A character consists of a single letter (which may have associated
|
|
|
39 |
data) plus pointers to the next character and to a list of alternative
|
|
|
40 |
characters.
|
|
|
41 |
*/
|
|
|
42 |
|
|
|
43 |
typedef unsigned int letter ;
|
|
|
44 |
|
|
|
45 |
typedef struct character_tag {
|
|
|
46 |
letter ch ;
|
|
|
47 |
char *defn ;
|
|
|
48 |
char *args ;
|
|
|
49 |
char *cond ;
|
|
|
50 |
struct character_tag *opt ;
|
|
|
51 |
struct character_tag *next ;
|
|
|
52 |
} character ;
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
/*
|
|
|
56 |
TYPE REPRESENTING A CHARACTER GROUP
|
|
|
57 |
|
|
|
58 |
A character group is a named array of letters.
|
|
|
59 |
*/
|
|
|
60 |
|
|
|
61 |
typedef struct {
|
|
|
62 |
char *name ;
|
|
|
63 |
letter *defn ;
|
|
|
64 |
} char_group ;
|
|
|
65 |
|
|
|
66 |
|
|
|
67 |
/*
|
|
|
68 |
TYPE REPRESENTING A KEYWORD
|
|
|
69 |
|
|
|
70 |
A keyword consists of a name plus some associated data. All keywords
|
|
|
71 |
are formed into a list using the next field. done is a flag used in
|
|
|
72 |
the output routines.
|
|
|
73 |
*/
|
|
|
74 |
|
|
|
75 |
typedef struct keyword_tag {
|
|
|
76 |
char *name ;
|
|
|
77 |
char *defn ;
|
|
|
78 |
char *args ;
|
|
|
79 |
char *cond ;
|
|
|
80 |
int done ;
|
|
|
81 |
struct keyword_tag *next ;
|
|
|
82 |
} keyword ;
|
|
|
83 |
|
|
|
84 |
|
|
|
85 |
/*
|
|
|
86 |
PARAMETERS
|
|
|
87 |
*/
|
|
|
88 |
|
|
|
89 |
#define MAX_GROUPS 15
|
|
|
90 |
|
|
|
91 |
|
|
|
92 |
/*
|
|
|
93 |
SPECIAL LETTERS
|
|
|
94 |
*/
|
|
|
95 |
|
|
|
96 |
#define SIMPLE_LETTER ( ( letter ) 0x0100 )
|
|
|
97 |
#define EOF_LETTER ( ( letter ) 0x0100 )
|
|
|
98 |
#define LAST_LETTER ( ( letter ) 0x0101 )
|
|
|
99 |
#define WHITE_LETTER ( ( letter ) 0x0102 )
|
|
|
100 |
#define GROUP_LETTER ( ( letter ) 0x0103 )
|
|
|
101 |
|
|
|
102 |
|
|
|
103 |
/*
|
|
|
104 |
DECLARATIONS FOR CHARACTER ROUTINES
|
|
|
105 |
*/
|
|
|
106 |
|
|
|
107 |
extern letter *white_space ;
|
|
|
108 |
extern character *pre_pass ;
|
|
|
109 |
extern character *main_pass ;
|
|
|
110 |
extern char_group groups [] ;
|
|
|
111 |
extern int no_groups ;
|
|
|
112 |
extern keyword *keywords ;
|
|
|
113 |
extern void add_char PROTO_S ( ( character *, letter *, char ** ) ) ;
|
|
|
114 |
extern void make_group PROTO_S ( ( char *, letter * ) ) ;
|
|
|
115 |
extern int in_group PROTO_S ( ( letter *, letter ) ) ;
|
|
|
116 |
extern letter *make_string PROTO_S ( ( char * ) ) ;
|
|
|
117 |
extern letter find_escape PROTO_S ( ( int ) ) ;
|
|
|
118 |
extern void add_keyword PROTO_S ( ( char *, char ** ) ) ;
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
#endif
|