1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 * 22 * Copyright 2001 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 26 /* All Rights Reserved */ 27 /* 28 * University Copyright- Copyright (c) 1982, 1986, 1988 29 * The Regents of the University of California 30 * All Rights Reserved 31 * 32 * University Acknowledgment- Portions of this document are derived from 33 * software developed by the University of California, Berkeley, and its 34 * contributors. 35 */ 36 37 #pragma ident "%Z%%M% %I% %E% SMI" 38 39 /* 40 * rpc_scan.h, Definitions for the RPCL scanner 41 */ 42 43 /* 44 * kinds of tokens 45 */ 46 enum tok_kind { 47 TOK_IDENT, 48 TOK_CHARCONST, 49 TOK_STRCONST, 50 TOK_LPAREN, 51 TOK_RPAREN, 52 TOK_LBRACE, 53 TOK_RBRACE, 54 TOK_LBRACKET, 55 TOK_RBRACKET, 56 TOK_LANGLE, 57 TOK_RANGLE, 58 TOK_STAR, 59 TOK_COMMA, 60 TOK_EQUAL, 61 TOK_COLON, 62 TOK_SEMICOLON, 63 TOK_CONST, 64 TOK_STRUCT, 65 TOK_UNION, 66 TOK_SWITCH, 67 TOK_CASE, 68 TOK_DEFAULT, 69 TOK_ENUM, 70 TOK_TYPEDEF, 71 TOK_INT, 72 TOK_SHORT, 73 TOK_LONG, 74 TOK_HYPER, 75 TOK_UNSIGNED, 76 TOK_FLOAT, 77 TOK_DOUBLE, 78 TOK_QUAD, 79 TOK_OPAQUE, 80 TOK_CHAR, 81 TOK_STRING, 82 TOK_BOOL, 83 TOK_VOID, 84 TOK_ONEWAY, 85 TOK_PROGRAM, 86 TOK_VERSION, 87 TOK_EOF 88 }; 89 typedef enum tok_kind tok_kind; 90 91 /* 92 * a token 93 */ 94 struct token { 95 tok_kind kind; 96 char *str; 97 }; 98 typedef struct token token; 99 100 101 /* 102 * routine interface 103 */ 104 void scan(); 105 void scan2(); 106 void scan3(); 107 void scan_num(); 108 void peek(); 109 int peekscan(); 110 void get_token(); 111