]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/ddb/db_lex.h
2e58eb0b130cb87f0b824eaebb37884257c87d34
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
29 * Revision 1.1.1.1 1998/09/22 21:05:48 wsanchez
30 * Import of Mac OS X kernel (~semeria)
32 * Revision 1.1.1.1 1998/03/07 02:26:09 wsanchez
33 * Import of OSF Mach kernel (~mburg)
35 * Revision 1.1.11.2 1995/01/06 19:10:24 devrcs
36 * mk6 CR668 - 1.3b26 merge
38 * [1994/10/14 03:39:54 dwm]
40 * Revision 1.1.11.1 1994/09/23 01:20:10 ezf
41 * change marker to not FREE
42 * [1994/09/22 21:10:18 ezf]
44 * Revision 1.1.4.3 1993/07/27 18:27:40 elliston
45 * Add ANSI prototypes. CR #9523.
46 * [1993/07/27 18:12:19 elliston]
48 * Revision 1.1.4.2 1993/06/02 23:11:33 jeffc
49 * Added to OSF/1 R1.3 from NMK15.0.
50 * [1993/06/02 20:56:37 jeffc]
52 * Revision 1.1 1992/09/30 02:24:17 robert
59 * Revision 2.5 91/10/09 16:00:48 af
60 * Revision 2.4.3.1 91/10/05 13:06:34 jeffreyh
61 * Added db_lex_context structure and some routine declarations
62 * for macro and conditinal command.
63 * Added relational operator tokens etc. for condition expression.
64 * Changed TOK_STRING_SIZE from 120 to 64, and defined
65 * DB_LEX_LINE_SIZE as 256 which was previously embedded
68 * Revision 2.4.1 91/07/15 09:30:00 tak
69 * Added db_lex_context for macro support
70 * Added some lexical constants to support logical expression etc.
71 * [91/05/15 13:55:00 tak]
73 * Revision 2.4.3.1 91/10/05 13:06:34 jeffreyh
74 * Added db_lex_context structure and some routine declarations
75 * for macro and conditinal command.
76 * Added relational operator tokens etc. for condition expression.
77 * Changed TOK_STRING_SIZE from 120 to 64, and defined
78 * DB_LEX_LINE_SIZE as 256 which was previously embedded
82 * Revision 2.4.1 91/07/15 09:30:00 tak
83 * Added db_lex_context for macro support
84 * Added some lexical constants to support logical expression etc.
85 * [91/05/15 13:55:00 tak]
87 * Revision 2.4 91/05/14 15:34:38 mrt
88 * Correcting copyright
90 * Revision 2.3 91/02/05 17:06:41 mrt
91 * Changed to new Mach copyright
92 * [91/01/31 16:18:28 mrt]
94 * Revision 2.2 90/08/27 21:51:16 dbg
97 * Export db_flush_lex.
105 * Mach Operating System
106 * Copyright (c) 1991,1990 Carnegie Mellon University
107 * All Rights Reserved.
109 * Permission to use, copy, modify and distribute this software and its
110 * documentation is hereby granted, provided that both the copyright
111 * notice and this permission notice appear in all copies of the
112 * software, derivative works or modified versions, and any portions
113 * thereof, and that both notices appear in supporting documentation.
115 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
116 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
117 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
119 * Carnegie Mellon requests users of this software to return to
121 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
122 * School of Computer Science
123 * Carnegie Mellon University
124 * Pittsburgh PA 15213-3890
126 * any improvements or extensions that they make and grant Carnegie Mellon
127 * the rights to redistribute these changes.
132 * Author: David B. Golub, Carnegie Mellon University
139 #ifndef _DDB_DB_LEX_H_
140 #define _DDB_DB_LEX_H_
142 #include <machine/db_machdep.h> /* For db_expr_t */
144 #define TOK_STRING_SIZE 64
145 #define DB_LEX_LINE_SIZE 256
147 struct db_lex_context
{
148 int l_char
; /* peek char */
149 int l_token
; /* peek token */
150 char *l_ptr
; /* line pointer */
151 char *l_eptr
; /* line end pointer */
154 extern db_expr_t db_tok_number
;
155 extern char db_tok_string
[TOK_STRING_SIZE
];
156 extern db_expr_t db_radix
;
179 #define tSEMI_COLON 21
181 #define tLOG_NOT_EQ 23
185 #define tGREATER_EQ 27
193 /* Prototypes for functions exported by this module.
195 int db_read_line(char *repeat_last
);
197 void db_switch_input(
201 void db_save_lex_context(struct db_lex_context
*lp
);
203 void db_restore_lex_context(struct db_lex_context
*lp
);
205 int db_read_char(void);
207 void db_unread_token(int t
);
209 int db_read_token(void);
211 void db_flush_lex(void);
213 void db_skip_to_eol(void);
217 #endif /* !_DDB_DB_LEX_H_ */