/usr/share/doc/flex-old-doc/flex_15.html is in flex-old-doc 2.5.4a-10ubuntu1.
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 | html2
<html>
<!-- Created on February 6, 2012 by texi2html 1.82
texi2html was written by:
Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>Flex - a scanner generator: 15. Values available to the user</title>
<meta name="description" content="Flex - a scanner generator: 15. Values available to the user">
<meta name="keywords" content="Flex - a scanner generator: 15. Values available to the user">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.82">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.roman {font-family:serif; font-weight:normal;}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="User-variables"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="flex_14.html#Miscellaneous" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="flex_16.html#YACC-interface" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="flex_14.html#Miscellaneous" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="flex.html#Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="flex_16.html#YACC-interface" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="flex.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="flex_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="flex_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Values-available-to-the-user"></a>
<h1 class="chapter">15. Values available to the user</h1>
<p>This section summarizes the various values available to
the user in the rule actions.
</p>
<ul class="toc">
<li> -
‘<samp>char *yytext</samp>’ holds the text of the current token.
It may be modified but not lengthened (you cannot
append characters to the end).
<p>If the special directive ‘<samp>%array</samp>’ appears in the
first section of the scanner description, then
<code>yytext</code> is instead declared ‘<samp>char yytext[YYLMAX]</samp>’,
where <code>YYLMAX</code> is a macro definition that you can
redefine in the first section if you don’t like the
default value (generally 8KB). Using ‘<samp>%array</samp>’
results in somewhat slower scanners, but the value
of <code>yytext</code> becomes immune to calls to ‘<samp>input()</samp>’ and
‘<samp>unput()</samp>’, which potentially destroy its value when
<code>yytext</code> is a character pointer. The opposite of
‘<samp>%array</samp>’ is ‘<samp>%pointer</samp>’, which is the default.
</p>
<p>You cannot use ‘<samp>%array</samp>’ when generating C++ scanner
classes (the ‘<samp>-+</samp>’ flag).
</p>
</li><li> -
‘<samp>int yyleng</samp>’ holds the length of the current token.
</li><li> -
‘<samp>FILE *yyin</samp>’ is the file which by default <code>flex</code> reads
from. It may be redefined but doing so only makes
sense before scanning begins or after an EOF has
been encountered. Changing it in the midst of
scanning will have unexpected results since <code>flex</code>
buffers its input; use ‘<samp>yyrestart()</samp>’ instead. Once
scanning terminates because an end-of-file has been
seen, you can assign <code>yyin</code> at the new input file and
then call the scanner again to continue scanning.
</li><li> -
‘<samp>void yyrestart( FILE *new_file )</samp>’ may be called to
point <code>yyin</code> at the new input file. The switch-over
to the new file is immediate (any previously
buffered-up input is lost). Note that calling
‘<samp>yyrestart()</samp>’ with <code>yyin</code> as an argument thus throws
away the current input buffer and continues
scanning the same input file.
</li><li> -
‘<samp>FILE *yyout</samp>’ is the file to which ‘<samp>ECHO</samp>’ actions are
done. It can be reassigned by the user.
</li><li> -
<code>YY_CURRENT_BUFFER</code> returns a <code>YY_BUFFER_STATE</code> handle
to the current buffer.
</li><li> -
<code>YY_START</code> returns an integer value corresponding to
the current start condition. You can subsequently
use this value with <code>BEGIN</code> to return to that start
condition.
</li></ul>
<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="flex_14.html#Miscellaneous" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="flex_16.html#YACC-interface" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="flex.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="flex_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[Index]</td>
<td valign="middle" align="left">[<a href="flex_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
<font size="-1">
This document was generated by <em>Build Daemon user</em> on <em>February 6, 2012</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
</font>
<br>
</p>
</body>
</html>
|