1218466Sjilles/*-
2218466Sjilles * Copyright (c) 1993
3218466Sjilles *	The Regents of the University of California.  All rights reserved.
4218466Sjilles * Copyright (c) 2007
5218466Sjilles *	Herbert Xu <herbert@gondor.apana.org.au>.  All rights reserved.
6218466Sjilles *
7218466Sjilles * This code is derived from software contributed to Berkeley by
8218466Sjilles * Kenneth Almquist.
9218466Sjilles *
10218466Sjilles * Redistribution and use in source and binary forms, with or without
11218466Sjilles * modification, are permitted provided that the following conditions
12218466Sjilles * are met:
13218466Sjilles * 1. Redistributions of source code must retain the above copyright
14218466Sjilles *    notice, this list of conditions and the following disclaimer.
15218466Sjilles * 2. Redistributions in binary form must reproduce the above copyright
16218466Sjilles *    notice, this list of conditions and the following disclaimer in the
17218466Sjilles *    documentation and/or other materials provided with the distribution.
18218466Sjilles * 3. Neither the name of the University nor the names of its contributors
19218466Sjilles *    may be used to endorse or promote products derived from this software
20218466Sjilles *    without specific prior written permission.
21218466Sjilles *
22218466Sjilles * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23218466Sjilles * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24218466Sjilles * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25218466Sjilles * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26218466Sjilles * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27218466Sjilles * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28218466Sjilles * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29218466Sjilles * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30218466Sjilles * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31218466Sjilles * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32218466Sjilles * SUCH DAMAGE.
33218466Sjilles *
34218466Sjilles * $FreeBSD$
35218466Sjilles */
36218466Sjilles
37218466Sjilles#define ARITH_ASS 1
38218466Sjilles
39218466Sjilles#define ARITH_OR 2
40218466Sjilles#define ARITH_AND 3
41218466Sjilles#define ARITH_BAD 4
42218466Sjilles#define ARITH_NUM 5
43218466Sjilles#define ARITH_VAR 6
44218466Sjilles#define ARITH_NOT 7
45218466Sjilles
46218466Sjilles#define ARITH_BINOP_MIN 8
47218466Sjilles#define ARITH_LE 8
48218466Sjilles#define ARITH_GE 9
49218466Sjilles#define ARITH_LT 10
50218466Sjilles#define ARITH_GT 11
51218466Sjilles#define ARITH_EQ 12
52218466Sjilles#define ARITH_REM 13
53218466Sjilles#define ARITH_BAND 14
54218466Sjilles#define ARITH_LSHIFT 15
55218466Sjilles#define ARITH_RSHIFT 16
56218466Sjilles#define ARITH_MUL 17
57218466Sjilles#define ARITH_ADD 18
58218466Sjilles#define ARITH_BOR 19
59218466Sjilles#define ARITH_SUB 20
60218466Sjilles#define ARITH_BXOR 21
61218466Sjilles#define ARITH_DIV 22
62218466Sjilles#define ARITH_NE 23
63218466Sjilles#define ARITH_BINOP_MAX 24
64218466Sjilles
65218466Sjilles#define ARITH_ASS_MIN 24
66218466Sjilles#define ARITH_REMASS 24
67218466Sjilles#define ARITH_BANDASS 25
68218466Sjilles#define ARITH_LSHIFTASS 26
69218466Sjilles#define ARITH_RSHIFTASS 27
70218466Sjilles#define ARITH_MULASS 28
71218466Sjilles#define ARITH_ADDASS 29
72218466Sjilles#define ARITH_BORASS 30
73218466Sjilles#define ARITH_SUBASS 31
74218466Sjilles#define ARITH_BXORASS 32
75218466Sjilles#define ARITH_DIVASS 33
76218466Sjilles#define ARITH_ASS_MAX 34
77218466Sjilles
78218466Sjilles#define ARITH_LPAREN 34
79218466Sjilles#define ARITH_RPAREN 35
80218466Sjilles#define ARITH_BNOT 36
81218466Sjilles#define ARITH_QMARK 37
82218466Sjilles#define ARITH_COLON 38
83218466Sjilles
84218466Sjillesunion yystype {
85218466Sjilles	arith_t val;
86218466Sjilles	char *name;
87218466Sjilles};
88218466Sjilles
89218466Sjillesextern union yystype yylval;
90218466Sjilles
91218466Sjillesint yylex(void);
92