summary refs log tree commit diff
path: root/bin/1sh/arith_yacc.h
blob: 2dc43526d0b00fa81263057fb9e45ce349538f6c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*-
 * Copyright (c) 1993
 *	The Regents of the University of California.  All rights reserved.
 * Copyright (c) 2007
 *	Herbert Xu <herbert@gondor.apana.org.au>.  All rights reserved.
 *
 * This code is derived from software contributed to Berkeley by
 * Kenneth Almquist.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * $FreeBSD: releng/12.0/bin/sh/arith_yacc.h 279503 2015-03-01 21:46:55Z jilles $
 */

#define ARITH_ASS 1

#define ARITH_OR 2
#define ARITH_AND 3
#define ARITH_BAD 4
#define ARITH_NUM 5
#define ARITH_VAR 6
#define ARITH_NOT 7

#define ARITH_BINOP_MIN 8
#define ARITH_LE 8
#define ARITH_GE 9
#define ARITH_LT 10
#define ARITH_GT 11
#define ARITH_EQ 12
#define ARITH_REM 13
#define ARITH_BAND 14
#define ARITH_LSHIFT 15
#define ARITH_RSHIFT 16
#define ARITH_MUL 17
#define ARITH_ADD 18
#define ARITH_BOR 19
#define ARITH_SUB 20
#define ARITH_BXOR 21
#define ARITH_DIV 22
#define ARITH_NE 23
#define ARITH_BINOP_MAX 24

#define ARITH_ASS_MIN 24
#define ARITH_REMASS 24
#define ARITH_BANDASS 25
#define ARITH_LSHIFTASS 26
#define ARITH_RSHIFTASS 27
#define ARITH_MULASS 28
#define ARITH_ADDASS 29
#define ARITH_BORASS 30
#define ARITH_SUBASS 31
#define ARITH_BXORASS 32
#define ARITH_DIVASS 33
#define ARITH_ASS_MAX 34

#define ARITH_LPAREN 34
#define ARITH_RPAREN 35
#define ARITH_BNOT 36
#define ARITH_QMARK 37
#define ARITH_COLON 38

extern const char *arith_buf;

union yystype {
	arith_t val;
	char *name;
};

extern union yystype yylval;

int yylex(void);
pan class='column1'>| | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> * filters: import more modern scriptsJason A. Donenfeld2013-05-27 | | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> * syntax-highlighting.sh: Fix command injection.Jason A. Donenfeld2012-10-27 | | | | | | | | | By not quoting the argument, an attacker with the ability to add files to the repository could pass arbitrary arguments to the highlight command, in particular, the --plug-in argument which can lead to arbitrary command execution. This patch adds simple argument quoting. * syntax-highlight: when the file has no extension, assume textFerry Huberts2012-10-09 | | | | | | | | | | There are 2 situations: 1- empty extension: assuming text is better than highlight producing no output because of a missing argument. 2- no extension at all: assuming text is better than setting the extension to the filename, which is what now happens. Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl> * Revert "filters/syntax-highlighting.sh: work around highlight --force bug"Ferry Huberts2012-10-09 | | | | | | | | | This reverts commit f50be7fda0a7ab57009169dd5905fcbab8eb5166. An update with the latest highlight landed in EPEL. This new version doesn't have the --force bug, so the workaround can now be removed. Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl> * Merge branch 'stable'Lars Hjemli2012-03-18 |\ | * filters/syntax-highlighting.sh: work around highlight --force bugFerry Huberts2012-03-18 | | | * filters/highlight.sh: manually support highlight version 2 and 3Ferry Huberts2012-03-18 | | * | commit-links.sh: improve regular expressionsFerry Huberts2011-07-19 | | | | | | | | | | | | | | | | | | | | | | The default length for sha1 abbreviations in git is 7. A '#num' at the beginning of the commit message is now recognised, a ':#num' as well, etc.: a '#num' anywhere is now converted to a link. Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl> Signed-off-by: Lars Hjemli <hjemli@gmail.com> * | filters: document environment variables in filter scriptsFerry Huberts2011-03-26 |/ | | | | Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl> Signed-off-by: Lars Hjemli <hjemli@gmail.com> * commit-links.sh: Seperate the expressions for filtering commit messages.Jeff Smith2010-07-22 | | | | | This allows for putting descriptions closer to their expressions. It should also make it clearer how to apply an expression conditionally. * syntax highlighting for all formats supported by "highlight"Georg Lukas2009-11-19 | | | | | | | | | | | | | | | | | | The highlight tool can be given any of the supported file extensions as its -S parameter. This patch replaces the case-switch by extracting the extension from the supplied file name and passing it to highlight. However, this requires a shell supporting the ${var##pattern} syntax, like dash or bash. Unknown extensions cause a fall-back to plain text using the --force switch. Error messages are redirected to /dev/null. A special case maps Makefile and Makefile.* to the "mk" extension. The total overhead is reduced by calling "exec highlight". No forks are needed during script execution. Signed-off-by: Georg Lukas <georg@op-co.de> * Add some example filter scriptsLars Hjemli2009-08-09 Signed-off-by: Lars Hjemli <hjemli@gmail.com>