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