1 /*        $NetBSD: rpc_scan.h,v 1.10 2015/05/09 21:44:47 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 #if HAVE_NBTOOL_CONFIG_H
35 #include "nbtool_config.h"
36 #endif
37 
38 /*
39  * rpc_scan.h, Definitions for the RPCL scanner
40  */
41 
42 /*
43  * kinds of tokens
44  */
45 enum tok_kind {
46           TOK_IDENT,
47           TOK_CHARCONST,
48           TOK_STRCONST,
49           TOK_LPAREN,
50           TOK_RPAREN,
51           TOK_LBRACE,
52           TOK_RBRACE,
53           TOK_LBRACKET,
54           TOK_RBRACKET,
55           TOK_LANGLE,
56           TOK_RANGLE,
57           TOK_STAR,
58           TOK_COMMA,
59           TOK_EQUAL,
60           TOK_COLON,
61           TOK_SEMICOLON,
62           TOK_CONST,
63           TOK_STRUCT,
64           TOK_UNION,
65           TOK_SWITCH,
66           TOK_CASE,
67           TOK_DEFAULT,
68           TOK_ENUM,
69           TOK_TYPEDEF,
70           TOK_INT,
71           TOK_SHORT,
72           TOK_LONG,
73           TOK_HYPER,
74           TOK_UNSIGNED,
75           TOK_FLOAT,
76           TOK_DOUBLE,
77           TOK_QUAD,
78           TOK_OPAQUE,
79           TOK_CHAR,
80           TOK_STRING,
81           TOK_BOOL,
82           TOK_VOID,
83           TOK_PROGRAM,
84           TOK_VERSION,
85           TOK_EOF
86 };
87 typedef enum tok_kind tok_kind;
88 
89 /*
90  * a token
91  */
92 struct token {
93           tok_kind kind;
94           const char *str;
95 };
96 typedef struct token token;
97 
98 
99 /*
100  * routine interface
101  */
102 void scan(tok_kind, token *);
103 void scan2(tok_kind, tok_kind, token *);
104 void scan3(tok_kind, tok_kind, tok_kind, token *);
105 void scan_num(token *);
106 void peek(token *);
107 int peekscan(tok_kind, token *);
108 void get_token(token *);
109