This file is indexed.

/usr/share/doc/HOWTO/ja-html/Lex-YACC-HOWTO-7.html is in doc-linux-ja-html 2006.05.25-1.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
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
150
151
152
153
154
155
156
157
158
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.21">
 <TITLE>Lex and YACC primer/HOWTO: $B%G%P%C%0(B</TITLE>
 <LINK HREF="Lex-YACC-HOWTO-8.html" REL=next>
 <LINK HREF="Lex-YACC-HOWTO-6.html" REL=previous>
 <LINK HREF="Lex-YACC-HOWTO.html#toc7" REL=contents>
</HEAD>
<BODY>
<A HREF="Lex-YACC-HOWTO-8.html">$B<!$N%Z!<%8(B</A>
<A HREF="Lex-YACC-HOWTO-6.html">$BA0$N%Z!<%8(B</A>
<A HREF="Lex-YACC-HOWTO.html#toc7">$BL\<!$X(B</A>
<HR>
<H2><A NAME="s7">7.</A> <A HREF="Lex-YACC-HOWTO.html#toc7">$B%G%P%C%0(B</A></H2>


<P>$B%W%m%0%i%`$r!"F0$+$7$J$,$i3X$V$h$&$J;~$OFC$K!"%G%P%C%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!<%H%^%7%s(B' $B$H$$$&$b$N$r(B
$B<B9T$7$F$$$^$9!#L>A0$,<($9$h$&$K!"$3$l$O!"$$$/$D$+$N%9%F!<%H!J>uBV!K$r(B
$B$H$jF@$k%^%7%s!J5!3#!K$N$3$H$G$9!#$I$N%9%F!<%H$+$i$I$N%9%F!<%H$XA+0\$9(B
$B$k$+$r7hDj$9$k5,B'!"$H$$$&$N$bB8:_$7$^$9!#A4$F$OI.<T$,A0=R$7$?!"$$$o$f(B
$B$k(B 'root' $B5,B'$,5/E@$H$J$j$^$9!#(B</P>

<P>Example 7 $B$N(B y.output $B$+$i$N=PNO$r0zMQ$9$k$H(B -</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
state 0

    ZONETOK     , and go to state 1

    $default    reduce using rule 1 (commands)

    commands    go to state 29
    command     go to state 2
    zone_set    go to state 3
</PRE>
</CODE></BLOCKQUOTE>
</P>

<P>$B$3$N%9%F!<%H$O!"%G%U%)%k%H$G$O(B 'commands' $B5,B'$rMQ$$$F4T85$7$^$9!#$3$l(B
$B$O!"A0=R$7$?:F5"$K4X$9$k5,B'$G$"$j!"8D!9$N%3%^%s%IJ8!"%;%_%3%m%s!"99$K(B
$BB3$/%3%^%s%I$+$i9=@.$5$l$k(B 'commands' $B$rDj5A$7$F$$$^$9!#(B</P>

<P>$B$3$N%9%F!<%H$O!"2r<a$G$-$k%H!<%/%s(B - $B$3$N>l9g(B ZONETOK $BB($A(B 'zone' $B$H$$(B
$B$&C18l(B - $B$KE~C#$9$k$^$G4T85$7$^$9!#$=$l$+$i!"%9%F!<%H(B 1 $B$XA+0\$7!"(Bzone 
$B%3%^%s%I$r$5$i$K>\$7$/=hM}$7$^$9!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
state 1

    zone_set  ->  ZONETOK . quotedname zonecontent   (rule 4)

    QUOTE       , and go to state 4

    quotedname  go to state 5
</PRE>
</CODE></BLOCKQUOTE>
</P>

<P>$B:G=i$N9T$O8=:_$N>l=j$r<($9(B '.' $B$r4^$s$G$$$^$9(B - ZONETOK $B$O4{$K8+$D$+$C(B
$B$?$N$G!"<!$K(B 'quotedname' $B$rC5$7$F$$$^$9!#(Bquotedname $B$O(B QUOTE $B$G;O$^$k(B
$B$N$G!"%9%F!<%H(B 4 $B$KA+0\$9$k$3$H$K$J$j$^$9!#(B</P>

<P>$B0J>e$K$D$$$F$b$&>/$77!$j2<$2$?$$J}$O!"(BExample 7 $B$r%G%P%C%0$N>O$G?($l$?(B
$B%U%i%0$rIU$1$F%3%s%Q%$%k$7$F$_$F$/$@$5$$!#(B</P>

<H2><A NAME="ss7.2">7.2</A> <A HREF="Lex-YACC-HOWTO.html#toc7.2">$B%3%s%U%j%/%H(B: 'shift/reduce', 'reduce/reduce' </A>
</H2>


<P>YACC $B$,%3%s%U%j%/%H$K$D$$$F7Y9p$r=P$9;~$O!"2?$+LdBj$,$"$k;~$G$7$g$&!#(B
$B%3%s%U%j%/%H$r2r7h$9$k:n6H$K$O!"$H$-$K?&?M7]$N$h$&$JFC<l$5$,$"$j!"$"$J(B
$B$?$N;HMQ$7$F$$$k8@8l$K$D$$$FB?$/$N$3$H$r65$($F$/$l$k$3$H$G$7$g$&(B - $B$=(B
$B$l$b$"$J$?$,CN$j$?$+$C$?$3$H0J>e$N$3$H$r!#(B</P>

<P>$BLdBj$O!"O"B3$9$k%H!<%/%s$r$I$&2r<a$9$k$+!"$H$$$&E@$rCf?4$K5/$3$j$^$9!#(B
$B0J2<$NFs$D$N%3%^%s%I$r<u$1IU$1$kI,MW$,$"$k8@8l$r!"Dj5A$9$k$H$7$^$7$g$&!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
        delete heater all
        delete heater number1
</PRE>
</CODE></BLOCKQUOTE>
</P>

<P>$B$3$l$r$9$k$K$O!"0J2<$NJ8K!Dj5A$,I,MW$G$9!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
        delete_heaters:
                TOKDELETE TOKHEATER mode
                {
                        deleteheaters($3);
                }
        
        mode:   WORD

        delete_a_heater:
                TOKDELETE TOKHEATER WORD
                {
                        delete($3);
                }
</PRE>
</CODE></BLOCKQUOTE>
</P>

<P>$B$b$&LdBj$N=-$$$,$7$F$-$^$7$?$M!#%9%F!<%H%^%7%s$O(B 'delete' $B$H$$$&C18l$r(B
$BFI$`$3$H$+$i;O$a$F!"<!$N%H!<%/%s$,2?$G$"$k$+$K$h$C$F!"A+0\@h$r7hDj$9$k(B
$BI,MW$,$"$j$^$9!#<!$N%H!<%/%s$H$$$&$N$O!"%R!<%?!<$N:o=|J}K!$r;XDj$9$k%b!<(B
$B%I!"$b$7$/$O:o=|$9$Y$-%R!<%?!<$NL>A0$G$9!#(B</P>

<P>$BLdBj$ON>J}$N%3%^%s%I$K$H$C$F!"<!$N%H!<%/%s$,(B WORD $B$K$J$k$H$$$&$3$H$G$9!#(B
YACC $B$O!"$3$N>l9g$I$&$7$FNI$$$+$o$+$j$^$;$s!#$3$l$,(B 'reduce/reduce'$B!"(B
$B99$K$O(B 'delete_a_heater' $B%N!<%I$K7h$7$FC#$9$k$3$H$,$J$$!"$H$$$&7Y9p$K(B
$B$J$j$^$9!#(B</P>

<P>$B$3$N>l9g$N%3%s%U%j%/%H$O!"4JC1$K2r7h$G$-$^$9$,!J:G=i$N%3%^%s%IL>$r(B'
delete heaters all' $B$KJQ99$7$?$j!"(B'all' $B$rFHN)$7$?%H!<%/%s$H$7$FDj5A$9(B
$B$k$J$I!K!"$b$C$HJ#;($K$J$k$3$H$b$"$j$^$9!#(B--verbose $B%U%i%0$r(B
$BIU2C$7$F(Byacc$B$rDL$9$H@8@.$5$l$k(B y.output $B%U%!%$%k$O!"$=$s$J;~$KHs>o$K=u(B
$B$1$H$J$j$^$9!#(B</P>

<HR>
<A HREF="Lex-YACC-HOWTO-8.html">$B<!$N%Z!<%8(B</A>
<A HREF="Lex-YACC-HOWTO-6.html">$BA0$N%Z!<%8(B</A>
<A HREF="Lex-YACC-HOWTO.html#toc7">$BL\<!$X(B</A>
</BODY>
</HTML>