Subversion Repositories tendra.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
7 7u83 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
 */
31
/*
2 7u83 32
    		 Crown Copyright (c) 1997
7 7u83 33
 
2 7u83 34
    This TenDRA(r) Computer Program is subject to Copyright
35
    owned by the United Kingdom Secretary of State for Defence
36
    acting through the Defence Evaluation and Research Agency
37
    (DERA).  It is made available to Recipients with a
38
    royalty-free licence for its use, reproduction, transfer
39
    to other parties and amendment for any purpose not excluding
40
    product development provided that any such use et cetera
41
    shall be deemed to be acceptance of the following conditions:-
7 7u83 42
 
2 7u83 43
        (1) Its Recipients shall ensure that this Notice is
44
        reproduced upon any copies or amended versions of it;
7 7u83 45
 
2 7u83 46
        (2) Any amended version of it shall be clearly marked to
47
        show both the nature of and the organisation responsible
48
        for the relevant amendment or amendments;
7 7u83 49
 
2 7u83 50
        (3) Its onward transfer from a recipient to another
51
        party shall be deemed to be that party's acceptance of
52
        these conditions;
7 7u83 53
 
2 7u83 54
        (4) DERA gives no warranty or assurance as to its
55
        quality or suitability for any purpose and DERA accepts
56
        no liability whatsoever in relation to any use to which
57
        it may be put.
58
*/
59
 
60
 
61
#ifndef LEX_INCLUDED
62
#define LEX_INCLUDED
63
 
64
 
65
/*
66
    LEXICAL ANALYSIS DECLARATIONS
67
 
68
    The routines in this module are concerned with the lexical analysis
69
    of the input, including its decomposition into preprocessing tokens
70
    using the routine read_token.
71
*/
72
 
7 7u83 73
extern void init_lex(void);
74
extern void init_char(void);
75
extern void process_file(void);
76
extern IDENTIFIER make_keyword(HASHID, int, IDENTIFIER);
77
extern void init_keywords(void);
78
extern int read_token(void);
79
extern int read_string(int, int);
80
extern int peek_char(int, int *);
81
extern int skip_to_end(void);
82
extern unsigned long skip_white(int);
83
extern void patch_white(unsigned long);
84
extern int get_digraph(int);
85
extern int primary_form(int);
86
extern int is_white_char(unsigned long);
87
extern int is_alpha_char(unsigned long);
88
extern int is_legal_char(unsigned long);
89
extern void set_char_lookup(int, int);
90
extern void set_character(EXP, EXP);
2 7u83 91
 
92
 
93
/*
94
    LEXICAL TOKEN INFORMATION
95
 
96
    These variables are used by read_token to hold information about the
97
    current lexical token.
98
*/
99
 
7 7u83 100
extern BUFFER token_buff;
101
extern HASHID token_hashid;
102
extern CONST char *token_names[];
2 7u83 103
 
104
 
105
/*
106
    LEXICAL ANALYSIS OPTIONS
107
 
108
    These variables are used to configure the lexical analysis routines.
109
*/
110
 
7 7u83 111
extern int allow_trigraphs;
112
extern int allow_digraphs;
113
extern int allow_unicodes;
114
extern int allow_multibyte;
115
extern int allow_cpp_comments;
116
extern int allow_dos_newline;
117
extern int allow_extra_symbols;
118
extern int allow_iso_keywords;
119
extern int analyse_comments;
120
extern unsigned long max_id_length;
2 7u83 121
 
122
 
123
/*
124
    TOKEN NAME LOOK-UP
125
 
126
    The macro token_name is used to look up the name associated with the
127
    lexical token number T.
128
*/
129
 
7 7u83 130
#define token_name(T)		(ustrlit(token_names[(T)]))
2 7u83 131
 
132
 
133
/*
134
    WHITE-SPACE INDICATORS
135
 
136
    These macros are used by skip_white to indicate the form of the white-
137
    space characters skipped.
138
*/
139
 
7 7u83 140
#define WHITE_SPACE		((unsigned long)0x01)
141
#define WHITE_NEWLINE		((unsigned long)0x02)
142
#define WHITE_ESC_NEWLINE	((unsigned long)0x04)
143
#define WHITE_MASK		(WHITE_SPACE | WHITE_NEWLINE)
2 7u83 144
 
145
 
146
#endif