Subversion Repositories tendra.SVN

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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 HASH_INCLUDED
32
#define HASH_INCLUDED
33
 
34
 
35
/*
36
    HASH TABLE DECLARATIONS
37
 
38
    The routines in this module are concerned with the look-up of identifiers
39
    in the hash table.
40
*/
41
 
42
extern HASHID lookup_name PROTO_S ( ( string, unsigned long, int, int ) ) ;
43
extern HASHID lookup_conv PROTO_S ( ( TYPE ) ) ;
44
extern HASHID lookup_constr PROTO_S ( ( TYPE, IDENTIFIER ) ) ;
45
extern HASHID lookup_destr PROTO_S ( ( TYPE, IDENTIFIER ) ) ;
46
extern HASHID lookup_anon PROTO_S ( ( void ) ) ;
47
extern HASHID expand_name PROTO_S ( ( HASHID, CLASS_TYPE ) ) ;
48
extern HASHID next_expand_name PROTO_S ( ( HASHID ) ) ;
49
extern void prime_name PROTO_S ( ( IDENTIFIER ) ) ;
50
 
51
extern int find_hashid PROTO_S ( ( HASHID ) ) ;
52
extern void init_hash PROTO_S ( ( void ) ) ;
53
extern IDENTIFIER underlying_id PROTO_S ( ( IDENTIFIER ) ) ;
54
extern void set_hashid_loc PROTO_S ( ( IDENTIFIER, IDENTIFIER ) ) ;
55
extern unsigned long hash PROTO_S ( ( string ) ) ;
56
extern IDENTIFIER underlying_op ;
57
extern HASHID *hash_ops_table ;
58
extern HASHID hash_keyword [] ;
59
extern HASHID *hash_table ;
60
 
61
 
62
/*
63
    LOOK UP AN OVERLOADED OPERATOR FUNCTION NAME
64
 
65
    This macro returns the hash table entry for the overloaded operator
66
    function name corresponding to the lexical token number T.  Note that
67
    the ISO keywords and digraphs have already been mapped onto their
68
    primary representations.
69
*/
70
 
71
#define lookup_op( T )		( hash_ops_table [ ( T ) ] )
72
 
73
 
74
/*
75
    HASH TABLE SIZES
76
 
77
    These macros give the sizes of various hash tables.
78
*/
79
 
80
#define HASH_SIZE		( ( unsigned long ) 4096 )
81
#define HASH_POWER		( ( unsigned long ) 37 )
82
#define HASH_TYPE_SIZE		( ( unsigned long ) 256 )
83
 
84
 
85
/*
86
    KEYWORD HASH TABLE ENTRIES
87
 
88
    The macro KEYWORD gives a convenient method of accessing the table
89
    hash_keyword.
90
*/
91
 
92
#define KEYWORD( T )		( hash_keyword [ ( T ) - lex_auto ] )
93
#define EQ_KEYWORD( N, T )	EQ_hashid ( ( N ), KEYWORD ( T ) )
94
 
95
 
96
#endif