11897Swollman/*
299979Salfred * $FreeBSD$
399979Salfred */
499979Salfred/*
51897Swollman * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
61897Swollman * unrestricted use provided that this legend is included on all tape
71897Swollman * media and as a part of the software program in whole or part.  Users
81897Swollman * may copy or modify Sun RPC without charge, but are not authorized
91897Swollman * to license or distribute it to anyone else except as part of a product or
101897Swollman * program developed by the user.
11100441Scharnier *
121897Swollman * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
131897Swollman * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
141897Swollman * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
15100441Scharnier *
161897Swollman * Sun RPC is provided with no support and without any obligation on the
171897Swollman * part of Sun Microsystems, Inc. to assist in its use, correction,
181897Swollman * modification or enhancement.
19100441Scharnier *
201897Swollman * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
211897Swollman * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
221897Swollman * OR ANY PART THEREOF.
23100441Scharnier *
241897Swollman * In no event will Sun Microsystems, Inc. be liable for any lost revenue
251897Swollman * or profits or other special, indirect and consequential damages, even if
261897Swollman * Sun has been advised of the possibility of such damages.
27100441Scharnier *
281897Swollman * Sun Microsystems, Inc.
291897Swollman * 2550 Garcia Avenue
301897Swollman * Mountain View, California  94043
311897Swollman */
3299979Salfred/* #pragma ident   "@(#)rpc_scan.h 1.11     94/05/15 SMI" */
331897Swollman
3412798Swpaul/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
3512798Swpaul/*	  All Rights Reserved  	*/
3612798Swpaul
3712798Swpaul/*	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T	*/
3812798Swpaul/*	The copyright notice above does not evidence any   	*/
3912798Swpaul/*	actual or intended publication of such source code.	*/
4012798Swpaul
4112798Swpaul
4212798Swpaul
4312798Swpaul/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4412798Swpaul*	PROPRIETARY NOTICE (Combined)
4512798Swpaul*
4612798Swpaul* This source code is unpublished proprietary information
4712798Swpaul* constituting, or derived under license from AT&T's UNIX(r) System V.
4812798Swpaul* In addition, portions of such source code were derived from Berkeley
4912798Swpaul* 4.3 BSD under license from the Regents of the University of
5012798Swpaul* California.
5112798Swpaul*
5212798Swpaul*
5312798Swpaul*
54100441Scharnier*	Copyright Notice
5512798Swpaul*
56100441Scharnier* Notice of copyright on this source code product does not indicate
5712798Swpaul*  publication.
5812798Swpaul*
5912798Swpaul*	(c) 1986,1987,1988.1989  Sun Microsystems, Inc
6012798Swpaul*	(c) 1983,1984,1985,1986,1987,1988,1989  AT&T.
6112798Swpaul*          All rights reserved.
62100441Scharnier*/
6312798Swpaul
6412798Swpaul/*      @(#)rpc_scan.h  1.3  90/08/29  (C) 1987 SMI   */
6512798Swpaul
661897Swollman/*
67100441Scharnier * rpc_scan.h, Definitions for the RPCL scanner
681897Swollman */
691897Swollman
701897Swollman/*
71100441Scharnier * kinds of tokens
721897Swollman */
731897Swollmanenum tok_kind {
741897Swollman	TOK_IDENT,
7512798Swpaul	TOK_CHARCONST,
761897Swollman	TOK_STRCONST,
771897Swollman	TOK_LPAREN,
781897Swollman	TOK_RPAREN,
791897Swollman	TOK_LBRACE,
801897Swollman	TOK_RBRACE,
811897Swollman	TOK_LBRACKET,
821897Swollman	TOK_RBRACKET,
831897Swollman	TOK_LANGLE,
841897Swollman	TOK_RANGLE,
851897Swollman	TOK_STAR,
861897Swollman	TOK_COMMA,
871897Swollman	TOK_EQUAL,
881897Swollman	TOK_COLON,
891897Swollman	TOK_SEMICOLON,
901897Swollman	TOK_CONST,
911897Swollman	TOK_STRUCT,
921897Swollman	TOK_UNION,
931897Swollman	TOK_SWITCH,
941897Swollman	TOK_CASE,
951897Swollman	TOK_DEFAULT,
961897Swollman	TOK_ENUM,
971897Swollman	TOK_TYPEDEF,
981897Swollman	TOK_INT,
991897Swollman	TOK_SHORT,
1001897Swollman	TOK_LONG,
10112798Swpaul	TOK_HYPER,
1021897Swollman	TOK_UNSIGNED,
1031897Swollman	TOK_FLOAT,
1041897Swollman	TOK_DOUBLE,
10512798Swpaul	TOK_QUAD,
1061897Swollman	TOK_OPAQUE,
1071897Swollman	TOK_CHAR,
1081897Swollman	TOK_STRING,
1091897Swollman	TOK_BOOL,
1101897Swollman	TOK_VOID,
1111897Swollman	TOK_PROGRAM,
1121897Swollman	TOK_VERSION,
1131897Swollman	TOK_EOF
1141897Swollman};
1151897Swollmantypedef enum tok_kind tok_kind;
1161897Swollman
1171897Swollman/*
118100441Scharnier * a token
1191897Swollman */
1201897Swollmanstruct token {
1211897Swollman	tok_kind kind;
122152398Sdwmalone	const char *str;
1231897Swollman};
1241897Swollmantypedef struct token token;
1251897Swollman
1261897Swollman
1271897Swollman/*
128100441Scharnier * routine interface
1291897Swollman */
130149682Sstefanfvoid scan(tok_kind expect, token *tokp);
131149682Sstefanfvoid scan2(tok_kind expect1, tok_kind expect2, token *tokp);
132149682Sstefanfvoid scan3(tok_kind expect1, tok_kind expect2, tok_kind expect3, token *tokp);
133149682Sstefanfvoid scan_num(token *tokp);
134149682Sstefanfvoid peek(token *tokp);
135149682Sstefanfint peekscan(tok_kind expect, token *tokp);
136149682Sstefanfvoid get_token(token *tokp);
137