1 /* 2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 3 * unrestricted use provided that this legend is included on all tape 4 * media and as a part of the software program in whole or part. Users 5 * may copy or modify Sun RPC without charge, but are not authorized 6 * to license or distribute it to anyone else except as part of a product or 7 * program developed by the user. 8 * 9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 10 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 12 * 13 * Sun RPC is provided with no support and without any obligation on the 14 * part of Sun Microsystems, Inc. to assist in its use, correction, 15 * modification or enhancement. 16 * 17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 19 * OR ANY PART THEREOF. 20 * 21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue 22 * or profits or other special, indirect and consequential damages, even if 23 * Sun has been advised of the possibility of such damages. 24 * 25 * Sun Microsystems, Inc. 26 * 2550 Garcia Avenue 27 * Mountain View, California 94043 28 * 29 * @(#)rpc_scan.h 1.11 94/05/15 SMI; 1.3 90/08/29 (C) 1987 SMI 30 * $FreeBSD: src/usr.bin/rpcgen/rpc_scan.h,v 1.7 2005/11/13 21:17:24 dwmalone Exp $ 31 */ 32 33 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 34 /* All Rights Reserved */ 35 36 /* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */ 37 /* The copyright notice above does not evidence any */ 38 /* actual or intended publication of such source code. */ 39 40 41 42 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 43 * PROPRIETARY NOTICE (Combined) 44 * 45 * This source code is unpublished proprietary information 46 * constituting, or derived under license from AT&T's UNIX(r) System V. 47 * In addition, portions of such source code were derived from Berkeley 48 * 4.3 BSD under license from the Regents of the University of 49 * California. 50 * 51 * 52 * 53 * Copyright Notice 54 * 55 * Notice of copyright on this source code product does not indicate 56 * publication. 57 * 58 * (c) 1986,1987,1988.1989 Sun Microsystems, Inc 59 * (c) 1983,1984,1985,1986,1987,1988,1989 AT&T. 60 * All rights reserved. 61 */ 62 63 /* 64 * rpc_scan.h, Definitions for the RPCL scanner 65 */ 66 67 #ifndef _RPC_SCAN_H_ 68 #define _RPC_SCAN_H_ 69 70 /* 71 * kinds of tokens 72 */ 73 enum tok_kind { 74 TOK_IDENT, 75 TOK_CHARCONST, 76 TOK_STRCONST, 77 TOK_LPAREN, 78 TOK_RPAREN, 79 TOK_LBRACE, 80 TOK_RBRACE, 81 TOK_LBRACKET, 82 TOK_RBRACKET, 83 TOK_LANGLE, 84 TOK_RANGLE, 85 TOK_STAR, 86 TOK_COMMA, 87 TOK_EQUAL, 88 TOK_COLON, 89 TOK_SEMICOLON, 90 TOK_CONST, 91 TOK_STRUCT, 92 TOK_UNION, 93 TOK_SWITCH, 94 TOK_CASE, 95 TOK_DEFAULT, 96 TOK_ENUM, 97 TOK_TYPEDEF, 98 TOK_INT, 99 TOK_SHORT, 100 TOK_LONG, 101 TOK_HYPER, 102 TOK_UNSIGNED, 103 TOK_FLOAT, 104 TOK_DOUBLE, 105 TOK_QUAD, 106 TOK_OPAQUE, 107 TOK_CHAR, 108 TOK_STRING, 109 TOK_BOOL, 110 TOK_VOID, 111 TOK_PROGRAM, 112 TOK_VERSION, 113 TOK_EOF 114 }; 115 typedef enum tok_kind tok_kind; 116 117 /* 118 * a token 119 */ 120 struct token { 121 tok_kind kind; 122 const char *str; 123 }; 124 typedef struct token token; 125 126 127 /* 128 * routine interface 129 */ 130 void scan(tok_kind, token *); 131 void scan2(tok_kind, tok_kind, token *); 132 void scan3(tok_kind, tok_kind, tok_kind, token *); 133 void scan_num(token *); 134 void peek(token *); 135 int peekscan(tok_kind, token *); 136 void get_token(token *); 137 138 #endif /* _RPC_SCAN_H_ */ 139