Subversion Repositories tendra.SVN

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 7
Line -... Line 1...
-
 
1
/*
-
 
2
 * Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>.
-
 
3
 * All rights reserved.
-
 
4
 *
-
 
5
 * Redistribution and use in source and binary forms, with or without
-
 
6
 * modification, are permitted provided that the following conditions are met:
-
 
7
 *
-
 
8
 * 1. Redistributions of source code must retain the above copyright notice,
-
 
9
 *    this list of conditions and the following disclaimer.
-
 
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
-
 
11
 *    this list of conditions and the following disclaimer in the documentation
-
 
12
 *    and/or other materials provided with the distribution.
-
 
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
-
 
14
 *    may be used to endorse or promote products derived from this software
-
 
15
 *    without specific, prior written permission.
-
 
16
 *
-
 
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
-
 
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-
 
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-
 
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
-
 
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-
 
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-
 
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-
 
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-
 
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-
 
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-
 
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 
28
 *
-
 
29
 * $Id$
-
 
30
 */
1
/*
31
/*
2
    		 Crown Copyright (c) 1997
32
    		 Crown Copyright (c) 1997
3
    
33
 
4
    This TenDRA(r) Computer Program is subject to Copyright
34
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
35
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
36
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
37
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
38
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
39
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
40
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
41
    shall be deemed to be acceptance of the following conditions:-
12
    
42
 
13
        (1) Its Recipients shall ensure that this Notice is
43
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
44
        reproduced upon any copies or amended versions of it;
15
    
45
 
16
        (2) Any amended version of it shall be clearly marked to
46
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
47
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
48
        for the relevant amendment or amendments;
19
    
49
 
20
        (3) Its onward transfer from a recipient to another
50
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
51
        party shall be deemed to be that party's acceptance of
22
        these conditions;
52
        these conditions;
23
    
53
 
24
        (4) DERA gives no warranty or assurance as to its
54
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
55
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
56
        no liability whatsoever in relation to any use to which
27
        it may be put.
57
        it may be put.
28
*/
58
*/
Line 34... Line 64...
34
 
64
 
35
/*
65
/*
36
    TABLES OF CONSTRUCTS
66
    TABLES OF CONSTRUCTS
37
*/
67
*/
38
 
68
 
39
extern construct **cons_table ;
69
extern construct **cons_table;
40
extern construct **var_table ;
70
extern construct **var_table;
41
extern construct **cons_hash_tables ;
71
extern construct **cons_hash_tables;
42
 
72
 
43
 
73
 
44
/*
74
/*
45
    TABLES OF SORT INFORMATION
75
    TABLES OF SORT INFORMATION
46
*/
76
*/
47
 
77
 
48
typedef node *( *decode_func ) PROTO_S ( ( void ) ) ;
78
typedef node *(*decode_func)(void);
49
typedef node *( *read_func ) PROTO_S ( ( long ) ) ;
79
typedef node *(*read_func)(long);
50
extern long *sort_count ;
80
extern long *sort_count;
51
extern char *sort_letters ;
81
extern char *sort_letters;
52
extern int *sort_encoding ;
82
extern int *sort_encoding;
53
extern int *sort_extension ;
83
extern int *sort_extension;
54
extern long *sort_tokens ;
84
extern long *sort_tokens;
55
extern long *sort_conds ;
85
extern long *sort_conds;
56
extern long *sort_removed ;
86
extern long *sort_removed;
57
extern decode_func *sort_decode ;
87
extern decode_func *sort_decode;
58
extern read_func *sort_read ;
88
extern read_func *sort_read;
59
 
89
 
60
 
90
 
61
/*
91
/*
62
    SPECIAL CONSTRUCTS
92
    SPECIAL CONSTRUCTS
63
*/
93
*/
64
 
94
 
65
extern construct bytestream_cons ;
95
extern construct bytestream_cons;
66
extern construct false_cons ;
96
extern construct false_cons;
67
extern construct optional_cons ;
97
extern construct optional_cons;
68
extern construct string_cons ;
98
extern construct string_cons;
69
extern construct token_cons ;
99
extern construct token_cons;
70
extern construct true_cons ;
100
extern construct true_cons;
71
extern construct unknown_cons ;
101
extern construct unknown_cons;
72
extern construct exp_shape ;
102
extern construct exp_shape;
73
extern construct shape_of ;
103
extern construct shape_of;
74
 
104
 
75
 
105
 
76
/*
106
/*
77
    OUTPUT FLAGS
107
    OUTPUT FLAGS
78
*/
108
*/
79
 
109
 
80
extern boolean show_tokdecs ;
110
extern boolean show_tokdecs;
81
extern boolean show_tokdefs ;
111
extern boolean show_tokdefs;
82
extern boolean show_aldecs ;
112
extern boolean show_aldecs;
83
extern boolean show_aldefs ;
113
extern boolean show_aldefs;
84
extern boolean show_tagdecs ;
114
extern boolean show_tagdecs;
85
extern boolean show_tagdefs ;
115
extern boolean show_tagdefs;
86
 
116
 
87
 
117
 
88
/*
118
/*
89
    TABLE MANIPULATION ROUTINES
119
    TABLE MANIPULATION ROUTINES
90
*/
120
*/
91
 
121
 
92
extern void init_tables PROTO_S ( ( void ) ) ;
122
extern void init_tables(void);
93
extern construct *add_to_cons_hash PROTO_S ( ( construct *, sortname ) ) ;
123
extern construct *add_to_cons_hash(construct *, sortname);
94
extern construct *search_cons_hash PROTO_S ( ( char *, sortname ) ) ;
124
extern construct *search_cons_hash(char *, sortname);
95
extern construct *add_to_var_hash PROTO_S ( ( construct *, sortname ) ) ;
125
extern construct *add_to_var_hash(construct *, sortname);
96
extern construct *search_var_hash PROTO_S ( ( char *, sortname ) ) ;
126
extern construct *search_var_hash(char *, sortname);
97
extern void remove_var_hash PROTO_S ( ( char *, sortname ) ) ;
127
extern void remove_var_hash(char *, sortname);
98
extern construct *removals ;
128
extern construct *removals;
99
 
129
 
100
 
130
 
101
/*
131
/*
102
    TABLE UTILITY ROUTINES
132
    TABLE UTILITY ROUTINES
103
*/
133
*/
104
 
134
 
105
extern boolean order_names ;
135
extern boolean order_names;
106
typedef void ( *apply_func ) PROTO_S ( ( construct * ) ) ;
136
typedef void(*apply_func)(construct *);
107
extern char *sort_name PROTO_S ( ( sortname ) ) ;
137
extern char *sort_name(sortname);
108
extern void sort_table PROTO_S ( ( construct **, sortname ) ) ;
138
extern void sort_table(construct **, sortname);
109
extern void sort_all PROTO_S ( ( void ) ) ;
139
extern void sort_all(void);
110
extern void apply_to_all PROTO_S ( ( apply_func, sortname ) ) ;
140
extern void apply_to_all(apply_func, sortname);
111
 
141
 
112
 
142
 
113
/*
143
/*
114
    AUXILLIARY TABLE ROUTINES
144
    AUXILLIARY TABLE ROUTINES
115
*/
145
*/
116
 
146
 
117
extern void new_sort PROTO_S ( ( sortname, int ) ) ;
147
extern void new_sort(sortname, int);
118
extern void new_cons PROTO_S ( ( char *, sortname, int, char * ) ) ;
148
extern void new_cons(char *, sortname, int, char *);
119
 
149
 
120
 
150
 
121
/*
151
/*
122
    MACRO FOR ACCESSING CONSTRUCTS
152
    MACRO FOR ACCESSING CONSTRUCTS
123
*/
153
*/
124
 
154
 
125
#define cons_no( X, Y )		( cons_table [ ( X ) ] + ( Y ) )
155
#define cons_no(X, Y)		(cons_table[(X)] + (Y))
126
 
156
 
127
 
157
 
128
#endif
158
#endif