This file is indexed.

/usr/share/doc/bison-doc/html/Location-Default-Action.html is in bison-doc 1:2.5-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
<html lang="en">
<head>
<title>Location Default Action - Bison 2.5</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Bison 2.5">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Locations.html#Locations" title="Locations">
<link rel="prev" href="Actions-and-Locations.html#Actions-and-Locations" title="Actions and Locations">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This manual (14 May 2011) is for GNU Bison (version
2.5), the GNU parser generator.

Copyright (C) 1988-1993, 1995, 1998-2011 Free Software
Foundation, Inc.

     Permission is granted to copy, distribute and/or modify this
     document under the terms of the GNU Free Documentation License,
     Version 1.3 or any later version published by the Free Software
     Foundation; with no Invariant Sections, with the Front-Cover texts
     being ``A GNU Manual,'' and with the Back-Cover Texts as in (a)
     below.  A copy of the license is included in the section entitled
     ``GNU Free Documentation License.''

     (a) The FSF's Back-Cover Text is: ``You have the freedom to copy
     and modify this GNU manual.  Buying copies from the FSF supports
     it in developing GNU and promoting software freedom.''
   -->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="Location-Default-Action"></a>
<p>
Previous:&nbsp;<a rel="previous" accesskey="p" href="Actions-and-Locations.html#Actions-and-Locations">Actions and Locations</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Locations.html#Locations">Locations</a>
<hr>
</div>

<h4 class="subsection">3.6.3 Default Action for Locations</h4>

<p><a name="index-YYLLOC_005fDEFAULT-162"></a><a name="index-GLR-parsers-and-_0040code_007bYYLLOC_005fDEFAULT_007d-163"></a>
Actually, actions are not the best place to compute locations.  Since
locations are much more general than semantic values, there is room in
the output parser to redefine the default action to take for each
rule.  The <code>YYLLOC_DEFAULT</code> macro is invoked each time a rule is
matched, before the associated action is run.  It is also invoked
while processing a syntax error, to compute the error's location. 
Before reporting an unresolvable syntactic ambiguity, a GLR
parser invokes <code>YYLLOC_DEFAULT</code> recursively to compute the location
of that ambiguity.

   <p>Most of the time, this macro is general enough to suppress location
dedicated code from semantic actions.

   <p>The <code>YYLLOC_DEFAULT</code> macro takes three parameters.  The first one is
the location of the grouping (the result of the computation).  When a
rule is matched, the second parameter identifies locations of
all right hand side elements of the rule being matched, and the third
parameter is the size of the rule's right hand side. 
When a GLR parser reports an ambiguity, which of multiple candidate
right hand sides it passes to <code>YYLLOC_DEFAULT</code> is undefined. 
When processing a syntax error, the second parameter identifies locations
of the symbols that were discarded during error processing, and the third
parameter is the number of discarded symbols.

   <p>By default, <code>YYLLOC_DEFAULT</code> is defined this way:

<pre class="smallexample">     # 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;        \
             }                                                               \
           else                                                              \
             {                                                               \
               (Current).first_line   = (Current).last_line   =              \
                 YYRHSLOC(Rhs, 0).last_line;                                 \
               (Current).first_column = (Current).last_column =              \
                 YYRHSLOC(Rhs, 0).last_column;                               \
             }                                                               \
         while (0)
</pre>
   <p>where <code>YYRHSLOC (rhs, k)</code> is the location of the <var>k</var>th symbol
in <var>rhs</var> when <var>k</var> is positive, and the location of the symbol
just before the reduction when <var>k</var> and <var>n</var> are both zero.

   <p>When defining <code>YYLLOC_DEFAULT</code>, you should consider that:

     <ul>
<li>All arguments are free of side-effects.  However, only the first one (the
result) should be modified by <code>YYLLOC_DEFAULT</code>.

     <li>For consistency with semantic actions, valid indexes within the
right hand side range from 1 to <var>n</var>.  When <var>n</var> is zero, only 0 is a
valid index, and it refers to the symbol just before the reduction. 
During error processing <var>n</var> is always positive.

     <li>Your macro should parenthesize its arguments, if need be, since the
actual arguments may not be surrounded by parentheses.  Also, your
macro should expand to something that can be used as a single
statement when it is followed by a semicolon. 
</ul>

   </body></html>