|
|
1.1 root 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 [email protected]
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: * Author: David B. Golub, Carnegie Mellon University
28: * Date: 7/90
29: */
30: /*
31: * Lexical analyzer.
32: */
33:
1.1.1.3 ! root 34: #ifndef _DDB_DB_LEX_H_
! 35: #define _DDB_DB_LEX_H_
! 36:
1.1 root 37: #define TOK_STRING_SIZE 64
38: #define DB_LEX_LINE_SIZE 256
39:
40: struct db_lex_context {
41: int l_char; /* peek char */
42: int l_token; /* peek token */
43: char *l_ptr; /* line pointer */
44: char *l_eptr; /* line end pointer */
45: };
46:
1.1.1.2 root 47: extern int db_lex(void);
1.1.1.3 ! root 48: extern int db_read_line(const char *rep_str);
1.1.1.2 root 49: extern void db_flush_line(void);
50: extern int db_read_char(void);
51: extern void db_unread_char(int c);
52: extern int db_read_token(void);
53: extern void db_unread_token(int t);
54: extern void db_flush_lex(void);
55: extern void db_switch_input(char *, int);
56: extern void db_save_lex_context(struct db_lex_context *);
1.1.1.3 ! root 57: extern void db_restore_lex_context(const struct db_lex_context *);
1.1.1.2 root 58: extern void db_skip_to_eol(void);
1.1 root 59:
60: extern db_expr_t db_tok_number;
61: extern char db_tok_string[TOK_STRING_SIZE];
62: extern db_expr_t db_radix;
63:
64: #define tEOF (-1)
65: #define tEOL 1
66: #define tNUMBER 2
67: #define tIDENT 3
68: #define tPLUS 4
69: #define tMINUS 5
70: #define tDOT 6
71: #define tSTAR 7
72: #define tSLASH 8
73: #define tEQ 9
74: #define tLPAREN 10
75: #define tRPAREN 11
76: #define tPCT 12
77: #define tHASH 13
78: #define tCOMMA 14
79: #define tQUOTE 15
80: #define tDOLLAR 16
81: #define tEXCL 17
82: #define tSHIFT_L 18
83: #define tSHIFT_R 19
84: #define tDOTDOT 20
85: #define tSEMI_COLON 21
86: #define tLOG_EQ 22
87: #define tLOG_NOT_EQ 23
88: #define tLESS 24
89: #define tLESS_EQ 25
90: #define tGREATER 26
91: #define tGREATER_EQ 27
92: #define tBIT_AND 28
93: #define tBIT_OR 29
94: #define tLOG_AND 30
95: #define tLOG_OR 31
96: #define tSTRING 32
97: #define tQUESTION 33
1.1.1.3 ! root 98:
! 99: #endif /* _DDB_DB_LEX_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.