FreeBSD/Linux Kernel Cross Reference
sys/ddb/db_lex.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1993,1992,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.7 93/11/17 16:23:06 dbg
30 * Enabled prototypes.
31 * [93/10/06 dbg]
32 *
33 * Revision 2.6 93/01/14 17:25:13 danner
34 * 64bit cleanup.
35 * [92/11/30 af]
36 *
37 * Revision 2.5 91/10/09 16:00:48 af
38 * Added db_lex_context structure and some routine declarations
39 * for macro and conditional command.
40 * Added relational operator tokens etc. for condition expression.
41 * Changed TOK_STRING_SIZE from 120 to 64, and defined
42 * DB_LEX_LINE_SIZE as 256 which was previously embedded
43 * in db_lex.c as 120.
44 * [91/08/29 tak]
45 *
46 * Added db_lex_context for macro support
47 * Added some lexical constants to support logical expression etc.
48 * [91/05/15 13:55:00 tak]
49 *
50 * Revision 2.4 91/05/14 15:34:38 mrt
51 * Correcting copyright
52 *
53 * Revision 2.3 91/02/05 17:06:41 mrt
54 * Changed to new Mach copyright
55 * [91/01/31 16:18:28 mrt]
56 *
57 * Revision 2.2 90/08/27 21:51:16 dbg
58 * Add 'dotdot' token.
59 * [90/08/22 dbg]
60 * Export db_flush_lex.
61 * [90/08/07 dbg]
62 * Created.
63 * [90/07/25 dbg]
64 *
65 */
66 /*
67 * Author: David B. Golub, Carnegie Mellon University
68 * Date: 7/90
69 */
70 /*
71 * Lexical analyzer.
72 */
73
74 #define TOK_STRING_SIZE 64
75 #define DB_LEX_LINE_SIZE 256
76
77 struct db_lex_context {
78 int l_char; /* peek char */
79 int l_token; /* peek token */
80 char *l_ptr; /* line pointer */
81 char *l_eptr; /* line end pointer */
82 };
83
84 extern int db_read_line(char *repeat_last);
85 extern void db_flush_line(void);
86 extern int db_read_char(void);
87 extern void db_unread_char(int c);
88 extern int db_read_token(void);
89 extern void db_unread_token(int t);
90 extern void db_flush_lex(void);
91 extern void db_switch_input(char *buffer, int size);
92 extern void db_save_lex_context(struct db_lex_context *);
93 extern void db_restore_lex_context(struct db_lex_context *);
94 extern void db_skip_to_eol(void);
95
96 extern db_expr_t db_tok_number;
97 extern char db_tok_string[TOK_STRING_SIZE];
98 extern db_expr_t db_radix;
99
100 #define tEOF (-1)
101 #define tEOL 1
102 #define tNUMBER 2
103 #define tIDENT 3
104 #define tPLUS 4
105 #define tMINUS 5
106 #define tDOT 6
107 #define tSTAR 7
108 #define tSLASH 8
109 #define tEQ 9
110 #define tLPAREN 10
111 #define tRPAREN 11
112 #define tPCT 12
113 #define tHASH 13
114 #define tCOMMA 14
115 #define tQUOTE 15
116 #define tDOLLAR 16
117 #define tEXCL 17
118 #define tSHIFT_L 18
119 #define tSHIFT_R 19
120 #define tDOTDOT 20
121 #define tSEMI_COLON 21
122 #define tLOG_EQ 22
123 #define tLOG_NOT_EQ 23
124 #define tLESS 24
125 #define tLESS_EQ 25
126 #define tGREATER 26
127 #define tGREATER_EQ 27
128 #define tBIT_AND 28
129 #define tBIT_OR 29
130 #define tLOG_AND 30
131 #define tLOG_OR 31
132 #define tSTRING 32
133 #define tQUESTION 33
Cache object: eaf78bf10d4ee1c5800e6a8301e03a1f
|