xref: /netbsd-src/usr.bin/rpcgen/rpc_scan.h (revision 2a399c6883d870daece976daec6ffa7bb7f934ce)
1 /*	$NetBSD: rpc_scan.h,v 1.4 1997/10/11 21:01:50 christos Exp $	*/
2 /*
3  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
4  * unrestricted use provided that this legend is included on all tape
5  * media and as a part of the software program in whole or part.  Users
6  * may copy or modify Sun RPC without charge, but are not authorized
7  * to license or distribute it to anyone else except as part of a product or
8  * program developed by the user or with the express written consent of
9  * Sun Microsystems, Inc.
10  *
11  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
12  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
13  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
14  *
15  * Sun RPC is provided with no support and without any obligation on the
16  * part of Sun Microsystems, Inc. to assist in its use, correction,
17  * modification or enhancement.
18  *
19  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
20  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
21  * OR ANY PART THEREOF.
22  *
23  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
24  * or profits or other special, indirect and consequential damages, even if
25  * Sun has been advised of the possibility of such damages.
26  *
27  * Sun Microsystems, Inc.
28  * 2550 Garcia Avenue
29  * Mountain View, California  94043
30  */
31 
32 /*      @(#)rpc_scan.h  1.3  90/08/29  (C) 1987 SMI   */
33 
34 /*
35  * rpc_scan.h, Definitions for the RPCL scanner
36  */
37 
38 /*
39  * kinds of tokens
40  */
41 enum tok_kind {
42 	TOK_IDENT,
43 	TOK_CHARCONST,
44 	TOK_STRCONST,
45 	TOK_LPAREN,
46 	TOK_RPAREN,
47 	TOK_LBRACE,
48 	TOK_RBRACE,
49 	TOK_LBRACKET,
50 	TOK_RBRACKET,
51 	TOK_LANGLE,
52 	TOK_RANGLE,
53 	TOK_STAR,
54 	TOK_COMMA,
55 	TOK_EQUAL,
56 	TOK_COLON,
57 	TOK_SEMICOLON,
58 	TOK_CONST,
59 	TOK_STRUCT,
60 	TOK_UNION,
61 	TOK_SWITCH,
62 	TOK_CASE,
63 	TOK_DEFAULT,
64 	TOK_ENUM,
65 	TOK_TYPEDEF,
66 	TOK_INT,
67 	TOK_SHORT,
68 	TOK_LONG,
69 	TOK_UNSIGNED,
70 	TOK_FLOAT,
71 	TOK_DOUBLE,
72 	TOK_OPAQUE,
73 	TOK_CHAR,
74 	TOK_STRING,
75 	TOK_BOOL,
76 	TOK_VOID,
77 	TOK_PROGRAM,
78 	TOK_VERSION,
79 	TOK_EOF
80 };
81 typedef enum tok_kind tok_kind;
82 
83 /*
84  * a token
85  */
86 struct token {
87 	tok_kind kind;
88 	char *str;
89 };
90 typedef struct token token;
91 
92 
93 /*
94  * routine interface
95  */
96 void scan __P((tok_kind, token *));
97 void scan2 __P((tok_kind, tok_kind, token *));
98 void scan3 __P((tok_kind, tok_kind, tok_kind, token *));
99 void scan_num __P((token *));
100 void peek __P((token *));
101 int peekscan __P((tok_kind, token *));
102 void get_token __P((token *));
103