summaryrefslogtreecommitdiff
path: root/cad/covered/patches/patch-ab
blob: 72d2a598439436a24a9f729a38b1ed2f6a7fba30 (plain)
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
$NetBSD: patch-ab,v 1.2 2006/08/22 17:00:24 joerg Exp $

--- src/parser.y.orig	2004-03-16 05:45:43.000000000 +0000
+++ src/parser.y
@@ -61,12 +61,26 @@ int yydebug = 1; 
    YYLLOC_DEFAULT macro that makes up a yylloc value from existing
    values. I need to supply an explicit version to account for the
    text field, that otherwise won't be copied. */
-# define YYLLOC_DEFAULT(Current, Rhs, N)         \
-  Current.first_line   = Rhs[1].first_line;      \
-  Current.first_column = Rhs[1].first_column;    \
-  Current.last_line    = Rhs[N].last_line;       \
-  Current.last_column  = Rhs[N].last_column;     \
-  Current.text         = Rhs[1].text;
+
+# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
+    do                                                                  \
+      if (N)                                                            \
+        {                                                               \
+          (Current).first_line   = YYRHSLOC(Rhs, 1).first_line;         \
+          (Current).first_column = YYRHSLOC(Rhs, 1).first_column;       \
+          (Current).last_line    = YYRHSLOC(Rhs, N).last_line;          \
+          (Current).last_column  = YYRHSLOC(Rhs, N).last_column;        \
+          (Current).text         = YYRHSLOC(Rhs, 1).text;               \
+        }                                                               \
+      else                                                              \
+        {                                                               \
+          (Current).first_line   = (Current).last_line   =              \
+            YYRHSLOC(Rhs, 0).last_line;                                 \
+          (Current).first_column = (Current).last_column =              \
+            YYRHSLOC(Rhs, 0).last_column;                               \
+          (Current).text         = YYRHSLOC(Rhs, 0).text;               \
+        }                                                               \
+    while (0)
 
 %}
 
@@ -75,7 +89,7 @@ int yydebug = 1; 
   int	          integer;
   vector*         number;
   double          realtime;
-  signal*         sig;
+  signal_s*         sig;
   expression*     expr;
   statement*      state;
   static_expr*    statexp;
@@ -3025,7 +3039,7 @@ dr_strength1
 event_control
   : '@' IDENTIFIER
     {
-      signal*     sig;
+      signal_s*     sig;
       expression* tmp;
       if( ignore_mode == 0 ) {
         sig = db_find_signal( $2 );