xref: /netbsd-src/usr.bin/rpcgen/rpc_scan.h (revision 8cde9e3d9bdd15b5358c28e62faa0527d6c20f9f)
1*8cde9e3dSchristos /*	$NetBSD: rpc_scan.h,v 1.10 2015/05/09 21:44:47 christos Exp $	*/
28f0abce1Sglass /*
38f0abce1Sglass  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
48f0abce1Sglass  * unrestricted use provided that this legend is included on all tape
58f0abce1Sglass  * media and as a part of the software program in whole or part.  Users
68f0abce1Sglass  * may copy or modify Sun RPC without charge, but are not authorized
78f0abce1Sglass  * to license or distribute it to anyone else except as part of a product or
871a0fb45Spk  * program developed by the user or with the express written consent of
971a0fb45Spk  * Sun Microsystems, Inc.
108f0abce1Sglass  *
118f0abce1Sglass  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
128f0abce1Sglass  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
138f0abce1Sglass  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
148f0abce1Sglass  *
158f0abce1Sglass  * Sun RPC is provided with no support and without any obligation on the
168f0abce1Sglass  * part of Sun Microsystems, Inc. to assist in its use, correction,
178f0abce1Sglass  * modification or enhancement.
188f0abce1Sglass  *
198f0abce1Sglass  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
208f0abce1Sglass  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
218f0abce1Sglass  * OR ANY PART THEREOF.
228f0abce1Sglass  *
238f0abce1Sglass  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
248f0abce1Sglass  * or profits or other special, indirect and consequential damages, even if
258f0abce1Sglass  * Sun has been advised of the possibility of such damages.
268f0abce1Sglass  *
278f0abce1Sglass  * Sun Microsystems, Inc.
288f0abce1Sglass  * 2550 Garcia Avenue
298f0abce1Sglass  * Mountain View, California  94043
308f0abce1Sglass  */
318f0abce1Sglass 
3271a0fb45Spk /*      @(#)rpc_scan.h  1.3  90/08/29  (C) 1987 SMI   */
3371a0fb45Spk 
34171d6532Slukem #if HAVE_NBTOOL_CONFIG_H
35171d6532Slukem #include "nbtool_config.h"
36a328e341Stv #endif
37a328e341Stv 
388f0abce1Sglass /*
398f0abce1Sglass  * rpc_scan.h, Definitions for the RPCL scanner
408f0abce1Sglass  */
418f0abce1Sglass 
428f0abce1Sglass /*
438f0abce1Sglass  * kinds of tokens
448f0abce1Sglass  */
458f0abce1Sglass enum tok_kind {
468f0abce1Sglass 	TOK_IDENT,
4771a0fb45Spk 	TOK_CHARCONST,
488f0abce1Sglass 	TOK_STRCONST,
498f0abce1Sglass 	TOK_LPAREN,
508f0abce1Sglass 	TOK_RPAREN,
518f0abce1Sglass 	TOK_LBRACE,
528f0abce1Sglass 	TOK_RBRACE,
538f0abce1Sglass 	TOK_LBRACKET,
548f0abce1Sglass 	TOK_RBRACKET,
558f0abce1Sglass 	TOK_LANGLE,
568f0abce1Sglass 	TOK_RANGLE,
578f0abce1Sglass 	TOK_STAR,
588f0abce1Sglass 	TOK_COMMA,
598f0abce1Sglass 	TOK_EQUAL,
608f0abce1Sglass 	TOK_COLON,
618f0abce1Sglass 	TOK_SEMICOLON,
628f0abce1Sglass 	TOK_CONST,
638f0abce1Sglass 	TOK_STRUCT,
648f0abce1Sglass 	TOK_UNION,
658f0abce1Sglass 	TOK_SWITCH,
668f0abce1Sglass 	TOK_CASE,
678f0abce1Sglass 	TOK_DEFAULT,
688f0abce1Sglass 	TOK_ENUM,
698f0abce1Sglass 	TOK_TYPEDEF,
708f0abce1Sglass 	TOK_INT,
718f0abce1Sglass 	TOK_SHORT,
728f0abce1Sglass 	TOK_LONG,
733cad8d1dSginsbach 	TOK_HYPER,
748f0abce1Sglass 	TOK_UNSIGNED,
758f0abce1Sglass 	TOK_FLOAT,
768f0abce1Sglass 	TOK_DOUBLE,
773cad8d1dSginsbach 	TOK_QUAD,
788f0abce1Sglass 	TOK_OPAQUE,
798f0abce1Sglass 	TOK_CHAR,
808f0abce1Sglass 	TOK_STRING,
818f0abce1Sglass 	TOK_BOOL,
828f0abce1Sglass 	TOK_VOID,
838f0abce1Sglass 	TOK_PROGRAM,
848f0abce1Sglass 	TOK_VERSION,
858f0abce1Sglass 	TOK_EOF
868f0abce1Sglass };
878f0abce1Sglass typedef enum tok_kind tok_kind;
888f0abce1Sglass 
898f0abce1Sglass /*
908f0abce1Sglass  * a token
918f0abce1Sglass  */
928f0abce1Sglass struct token {
938f0abce1Sglass 	tok_kind kind;
94e9067f11Sdholland 	const char *str;
958f0abce1Sglass };
968f0abce1Sglass typedef struct token token;
978f0abce1Sglass 
988f0abce1Sglass 
998f0abce1Sglass /*
1008f0abce1Sglass  * routine interface
1018f0abce1Sglass  */
102*8cde9e3dSchristos void scan(tok_kind, token *);
103*8cde9e3dSchristos void scan2(tok_kind, tok_kind, token *);
104*8cde9e3dSchristos void scan3(tok_kind, tok_kind, tok_kind, token *);
105*8cde9e3dSchristos void scan_num(token *);
106*8cde9e3dSchristos void peek(token *);
107*8cde9e3dSchristos int peekscan(tok_kind, token *);
108*8cde9e3dSchristos void get_token(token *);
109