FreeBSD/Linux Kernel Cross Reference
sys/ddb/db_lex.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1991,1990 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: db_lex.h,v $
29 * Revision 2.6 93/01/14 17:25:13 danner
30 * 64bit cleanup.
31 * [92/11/30 af]
32 *
33 * Revision 2.5 91/10/09 16:00:48 af
34 * Revision 2.4.3.1 91/10/05 13:06:34 jeffreyh
35 * Added db_lex_context structure and some routine declarations
36 * for macro and conditinal command.
37 * Added relational operator tokens etc. for condition expression.
38 * Changed TOK_STRING_SIZE from 120 to 64, and defined
39 * DB_LEX_LINE_SIZE as 256 which was previously embedded
40 * in db_lex.c as 120.
41 * [91/08/29 tak]
42 * Revision 2.4.1 91/07/15 09:30:00 tak
43 * Added db_lex_context for macro support
44 * Added some lexical constants to support logical expression etc.
45 * [91/05/15 13:55:00 tak]
46 *
47 * Revision 2.4.3.1 91/10/05 13:06:34 jeffreyh
48 * Added db_lex_context structure and some routine declarations
49 * for macro and conditinal command.
50 * Added relational operator tokens etc. for condition expression.
51 * Changed TOK_STRING_SIZE from 120 to 64, and defined
52 * DB_LEX_LINE_SIZE as 256 which was previously embedded
53 * in db_lex.c as 120.
54 * [91/08/29 tak]
55 *
56 * Revision 2.4.1 91/07/15 09:30:00 tak
57 * Added db_lex_context for macro support
58 * Added some lexical constants to support logical expression etc.
59 * [91/05/15 13:55:00 tak]
60 *
61 * Revision 2.4 91/05/14 15:34:38 mrt
62 * Correcting copyright
63 *
64 * Revision 2.3 91/02/05 17:06:41 mrt
65 * Changed to new Mach copyright
66 * [91/01/31 16:18:28 mrt]
67 *
68 * Revision 2.2 90/08/27 21:51:16 dbg
69 * Add 'dotdot' token.
70 * [90/08/22 dbg]
71 * Export db_flush_lex.
72 * [90/08/07 dbg]
73 * Created.
74 * [90/07/25 dbg]
75 *
76 */
77 /*
78 * Author: David B. Golub, Carnegie Mellon University
79 * Date: 7/90
80 */
81 /*
82 * Lexical analyzer.
83 */
84
85 #define TOK_STRING_SIZE 64
86 #define DB_LEX_LINE_SIZE 256
87
88 struct db_lex_context {
89 int l_char; /* peek char */
90 int l_token; /* peek token */
91 char *l_ptr; /* line pointer */
92 char *l_eptr; /* line end pointer */
93 };
94
95 extern int db_read_line(/* char *rep_str */);
96 extern void db_flush_line();
97 extern int db_read_char();
98 extern void db_unread_char(/* char c */);
99 extern int db_read_token();
100 extern void db_unread_token(/* int t */);
101 extern void db_flush_lex();
102 extern void db_switch_input(/* char *, int */);
103 extern void db_save_lex_context(/* struct db_lex_context * */);
104 extern void db_restore_lex_context(/* struct db_lex_context * */);
105 extern void db_skip_to_eol();
106
107 extern db_expr_t db_tok_number;
108 extern char db_tok_string[TOK_STRING_SIZE];
109 extern db_expr_t db_radix;
110
111 #define tEOF (-1)
112 #define tEOL 1
113 #define tNUMBER 2
114 #define tIDENT 3
115 #define tPLUS 4
116 #define tMINUS 5
117 #define tDOT 6
118 #define tSTAR 7
119 #define tSLASH 8
120 #define tEQ 9
121 #define tLPAREN 10
122 #define tRPAREN 11
123 #define tPCT 12
124 #define tHASH 13
125 #define tCOMMA 14
126 #define tQUOTE 15
127 #define tDOLLAR 16
128 #define tEXCL 17
129 #define tSHIFT_L 18
130 #define tSHIFT_R 19
131 #define tDOTDOT 20
132 #define tSEMI_COLON 21
133 #define tLOG_EQ 22
134 #define tLOG_NOT_EQ 23
135 #define tLESS 24
136 #define tLESS_EQ 25
137 #define tGREATER 26
138 #define tGREATER_EQ 27
139 #define tBIT_AND 28
140 #define tBIT_OR 29
141 #define tLOG_AND 30
142 #define tLOG_OR 31
143 #define tSTRING 32
144 #define tQUESTION 33
Cache object: 62f690eab0d9456e6469c90927f21687
|