Back to index

glibc  2.9
rpc_scan.h
Go to the documentation of this file.
00001 /*
00002  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
00003  * unrestricted use provided that this legend is included on all tape
00004  * media and as a part of the software program in whole or part.  Users
00005  * may copy or modify Sun RPC without charge, but are not authorized
00006  * to license or distribute it to anyone else except as part of a product or
00007  * program developed by the user or with the express written consent of
00008  * Sun Microsystems, Inc.
00009  *
00010  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
00011  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
00012  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
00013  *
00014  * Sun RPC is provided with no support and without any obligation on the
00015  * part of Sun Microsystems, Inc. to assist in its use, correction,
00016  * modification or enhancement.
00017  *
00018  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
00019  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
00020  * OR ANY PART THEREOF.
00021  *
00022  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
00023  * or profits or other special, indirect and consequential damages, even if
00024  * Sun has been advised of the possibility of such damages.
00025  *
00026  * Sun Microsystems, Inc.
00027  * 2550 Garcia Avenue
00028  * Mountain View, California  94043
00029  */
00030 
00031 /*      @(#)rpc_scan.h  1.3  90/08/29  (C) 1987 SMI   */
00032 
00033 /*
00034  * rpc_scan.h, Definitions for the RPCL scanner 
00035  */
00036 
00037 /*
00038  * kinds of tokens 
00039  */
00040 enum tok_kind {
00041        TOK_IDENT,
00042        TOK_CHARCONST,
00043        TOK_STRCONST,
00044        TOK_LPAREN,
00045        TOK_RPAREN,
00046        TOK_LBRACE,
00047        TOK_RBRACE,
00048        TOK_LBRACKET,
00049        TOK_RBRACKET,
00050        TOK_LANGLE,
00051        TOK_RANGLE,
00052        TOK_STAR,
00053        TOK_COMMA,
00054        TOK_EQUAL,
00055        TOK_COLON,
00056        TOK_SEMICOLON,
00057        TOK_CONST,
00058        TOK_STRUCT,
00059        TOK_UNION,
00060        TOK_SWITCH,
00061        TOK_CASE,
00062        TOK_DEFAULT,
00063        TOK_ENUM,
00064        TOK_TYPEDEF,
00065        TOK_INT,
00066        TOK_SHORT,
00067        TOK_LONG,
00068        TOK_HYPER,
00069        TOK_UNSIGNED,
00070        TOK_FLOAT,
00071        TOK_DOUBLE,
00072        TOK_OPAQUE,
00073        TOK_CHAR,
00074        TOK_STRING,
00075        TOK_BOOL,
00076        TOK_VOID,
00077        TOK_PROGRAM,
00078        TOK_VERSION,
00079        TOK_EOF
00080 };
00081 typedef enum tok_kind tok_kind;
00082 
00083 /*
00084  * a token 
00085  */
00086 struct token {
00087        tok_kind kind;
00088        const char *str;
00089 };
00090 typedef struct token token;
00091 
00092 
00093 /*
00094  * routine interface 
00095  */
00096 void scan(tok_kind expect, token *tokp);
00097 void scan2(tok_kind expect1, tok_kind expect2, token *tokp);
00098 void scan3(tok_kind expect1, tok_kind expect2, tok_kind expect3, token *tokp);
00099 void scan_num(token *tokp);
00100 void peek(token *tokp);
00101 int peekscan(tok_kind expect, token *tokp);
00102 void get_token(token *tokp);
00103 void expected1(tok_kind exp1) __attribute__ ((noreturn));
00104 void expected2(tok_kind exp1, tok_kind exp2)  __attribute__ ((noreturn));
00105 void expected3(tok_kind exp1, tok_kind exp2, tok_kind exp3)
00106      __attribute__ ((noreturn));
00107