summaryrefslogtreecommitdiff
path: root/devel/aegis/files/patch-libaegis_sub_expr_gram_y
blob: 694a988abbf69de84ff318eee3e35114daaae121 (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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
--- libaegis/sub/expr_gram.y.orig	2020-06-17 17:51:38.214116000 -0400
+++ libaegis/sub/expr_gram.y	2020-06-17 17:52:02.149971000 -0400
@@ -1,22 +1,24 @@
 /*
- *	aegis - project change supervisor
- *	Copyright (C) 1996, 1999, 2002, 2003, 2005-2008 Peter Miller
+ * aegis - project change supervisor
+ * Copyright (C) 1996, 1999, 2002, 2003, 2005-2008 Peter Miller
+ * Copyright (C) 2020 Aryeh M. Friedman
  *
- *	This program is free software; you can redistribute it and/or modify
- *	it under the terms of the GNU General Public License as published by
- *	the Free Software Foundation; either version 3 of the License, or
- *	(at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
  *
- *	This program is distributed in the hope that it will be useful,
- *	but WITHOUT ANY WARRANTY; without even the implied warranty of
- *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *	GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *	You should have received a copy of the GNU General Public License
- *	along with this program. If not, see
- *	<http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
  */
 
+%define api.prefix {sub_expr_gram_}
 %{
 
 #include <common/ac/stdarg.h>
@@ -57,7 +59,7 @@
 
 %union
 {
-	long	lv_number;
+ long lv_number;
 }
 
 %type <lv_number> NUMBER expr
@@ -94,7 +96,7 @@
 
     trace(("}\n"));
     if (bad)
-	return "";
+ return "";
     return nstring::format("%ld", result);
 }
 
@@ -112,21 +114,21 @@
 /*
  * jiggery-pokery for yacc
  *
- *	Replace all calls to printf with a call to trace_printf.  The
- *	trace_where_ is needed to set the location, and is safe, because
- *	yacc only invokes the printf with an if (be careful, the printf
- *	is not in a compound statement).
+ * Replace all calls to printf with a call to trace_printf.  The
+ * trace_where_ is needed to set the location, and is safe, because
+ * yacc only invokes the printf with an if (be careful, the printf
+ * is not in a compound statement).
  */
 #define printf trace_where_, trace_printf
 
 /*
  * jiggery-pokery for bison
  *
- *	Replace all calls to fprintf with a call to yydebugger.  Ignore
- *	the first argument, it will be "stderr".  The trace_where_ is
- *	needed to set the location, and is safe, because bison only
- *	invokes the printf with an if (be careful, the fprintf is not in
- *	a compound statement).
+ * Replace all calls to fprintf with a call to yydebugger.  Ignore
+ * the first argument, it will be "stderr".  The trace_where_ is
+ * needed to set the location, and is safe, because bison only
+ * invokes the printf with an if (be careful, the fprintf is not in
+ * a compound statement).
  */
 #define fprintf trace_where_, yydebugger
 
@@ -151,40 +153,41 @@
 
 grammar:
     expr
-	{ result = $1; }
+ { result = $1; }
     ;
 
 expr
     : LP expr RP
-	{ $$ = $2; trace(("$$ = %ld;\n", $$)); }
+ { $$ = $2; trace(("$$ = %ld;\n", $$)); }
     | NUMBER
-	{ $$ = $1; trace(("$$ = %ld;\n", $$)); }
+ { $$ = $1; trace(("$$ = %ld;\n", $$)); }
     | MINUS expr
-	%prec UNARY
-	{ $$ = -$2; trace(("$$ = %ld;\n", $$)); }
+ %prec UNARY
+ { $$ = -$2; trace(("$$ = %ld;\n", $$)); }
     | expr PLUS expr
-	{ $$ = $1 + $3; trace(("$$ = %ld;\n", $$)); }
+ { $$ = $1 + $3; trace(("$$ = %ld;\n", $$)); }
     | expr MINUS expr
-	{ $$ = $1 - $3; trace(("$$ = %ld;\n", $$)); }
+ { $$ = $1 - $3; trace(("$$ = %ld;\n", $$)); }
     | expr MUL expr
-	{ $$ = $1 * $3; trace(("$$ = %ld;\n", $$)); }
+ { $$ = $1 * $3; trace(("$$ = %ld;\n", $$)); }
     | expr DIV expr
-	{ $$ = $3 ? $1 / $3 : 0; trace(("$$ = %ld;\n", $$)); }
+ { $$ = $3 ? $1 / $3 : 0; trace(("$$ = %ld;\n", $$)); }
     | expr MOD expr
-	{ $$ = $3 ? $1 % $3 : 0; trace(("$$ = %ld;\n", $$)); }
+ { $$ = $3 ? $1 % $3 : 0; trace(("$$ = %ld;\n", $$)); }
     | expr EQ expr
-	{ $$ = ($1 == $3); trace(("$$ = %ld;\n", $$)); }
+ { $$ = ($1 == $3); trace(("$$ = %ld;\n", $$)); }
     | expr NE expr
-	{ $$ = ($1 != $3); trace(("$$ = %ld;\n", $$)); }
+ { $$ = ($1 != $3); trace(("$$ = %ld;\n", $$)); }
     | expr LT expr
-	{ $$ = ($1 < $3); trace(("$$ = %ld;\n", $$)); }
+ { $$ = ($1 < $3); trace(("$$ = %ld;\n", $$)); }
     | expr LE expr
-	{ $$ = ($1 <= $3); trace(("$$ = %ld;\n", $$)); }
+ { $$ = ($1 <= $3); trace(("$$ = %ld;\n", $$)); }
     | expr GT expr
-	{ $$ = ($1 > $3); trace(("$$ = %ld;\n", $$)); }
+ { $$ = ($1 > $3); trace(("$$ = %ld;\n", $$)); }
     | expr GE expr
-	{ $$ = ($1 >= $3); trace(("$$ = %ld;\n", $$)); }
+ { $$ = ($1 >= $3); trace(("$$ = %ld;\n", $$)); }
     | NOT expr
-	%prec UNARY
-	{ $$ = (!$2); trace(("$$ = %ld;\n", $$)); }
+ %prec UNARY
+ { $$ = (!$2); trace(("$$ = %ld;\n", $$)); }
     ;
+// vim: set ts=8 sw=4 et :