Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 39121eaa6e08c828e313b57261e3f286 > files > 184

antlr-C++-doc-2.7.7-15.fc14.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>ANTLR Support Libraries 2.7.1+: antlr/LexerSharedInputState.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">ANTLR Support Libraries 2.7.1+</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>antlr/LexerSharedInputState.hpp</h1>  </div>
</div>
<div class="contents">
<a href="LexerSharedInputState_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef INC_LexerSharedInputState_hpp__</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define INC_LexerSharedInputState_hpp__</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="comment">/* ANTLR Translator Generator</span>
<a name="l00005"></a>00005 <span class="comment"> * Project led by Terence Parr at http://www.jGuru.com</span>
<a name="l00006"></a>00006 <span class="comment"> * Software rights: http://www.antlr.org/license.html</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/antlr/LexerSharedInputState.hpp#2 $</span>
<a name="l00009"></a>00009 <span class="comment"> */</span>
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;antlr/config.hpp&gt;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;antlr/InputBuffer.hpp&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;antlr/RefCount.hpp&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;antlr/CharBuffer.hpp&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 <span class="preprocessor">#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="keyword">namespace </span>antlr {
<a name="l00019"></a>00019 <span class="preprocessor">#endif</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00026"></a><a class="code" href="classLexerInputState.html">00026</a> <span class="keyword">class </span><a class="code" href="config_8hpp.html#ad583892c7af76867441115e41aa1ce52">ANTLR_API</a> <a class="code" href="classLexerInputState.html">LexerInputState</a> {
<a name="l00027"></a>00027 <span class="keyword">public</span>:
<a name="l00032"></a><a class="code" href="classLexerInputState.html#a761a7986cdf2c596da605d414d6b0acc">00032</a>    <a class="code" href="classLexerInputState.html">LexerInputState</a>(<a class="code" href="classInputBuffer.html">InputBuffer</a>* inbuf)
<a name="l00033"></a>00033    : column(1)
<a name="l00034"></a>00034    , line(1)
<a name="l00035"></a>00035    , tokenStartColumn(1)
<a name="l00036"></a>00036    , tokenStartLine(1)
<a name="l00037"></a>00037    , guessing(0)
<a name="l00038"></a>00038    , filename(<span class="stringliteral">&quot;&quot;</span>)
<a name="l00039"></a>00039    , input(inbuf)
<a name="l00040"></a>00040    , inputResponsible(true)
<a name="l00041"></a>00041    {
<a name="l00042"></a>00042    }
<a name="l00043"></a>00043 
<a name="l00047"></a><a class="code" href="classLexerInputState.html#ab55fe1d85ad0cfbd73de8792e82df3ba">00047</a>    <a class="code" href="classLexerInputState.html">LexerInputState</a>(<a class="code" href="classInputBuffer.html">InputBuffer</a>&amp; inbuf)
<a name="l00048"></a>00048    : column(1)
<a name="l00049"></a>00049    , line(1)
<a name="l00050"></a>00050    , tokenStartColumn(1)
<a name="l00051"></a>00051    , tokenStartLine(1)
<a name="l00052"></a>00052    , guessing(0)
<a name="l00053"></a>00053    , filename(<span class="stringliteral">&quot;&quot;</span>)
<a name="l00054"></a>00054    , input(&amp;inbuf)
<a name="l00055"></a>00055    , inputResponsible(false)
<a name="l00056"></a>00056    {
<a name="l00057"></a>00057    }
<a name="l00058"></a>00058 
<a name="l00063"></a><a class="code" href="classLexerInputState.html#a5b1dc4dd262ec9020e83838568f341e1">00063</a>    <a class="code" href="classLexerInputState.html">LexerInputState</a>(<a class="code" href="config_8hpp.html#ad1e4025d0db4046e6e85a46c92b7ff77">ANTLR_USE_NAMESPACE</a>(std)istream&amp; in)
<a name="l00064"></a>00064    : column(1)
<a name="l00065"></a>00065    , line(1)
<a name="l00066"></a>00066    , tokenStartColumn(1)
<a name="l00067"></a>00067    , tokenStartLine(1)
<a name="l00068"></a>00068    , guessing(0)
<a name="l00069"></a>00069    , filename(<span class="stringliteral">&quot;&quot;</span>)
<a name="l00070"></a>00070    , input(new <a class="code" href="classCharBuffer.html">CharBuffer</a>(in))
<a name="l00071"></a>00071    , inputResponsible(true)
<a name="l00072"></a>00072    {
<a name="l00073"></a>00073    }
<a name="l00074"></a>00074 
<a name="l00080"></a><a class="code" href="classLexerInputState.html#a5c4a4117843bd9c8de74aa01e35d1cf3">00080</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> initialize( <a class="code" href="config_8hpp.html#ad1e4025d0db4046e6e85a46c92b7ff77">ANTLR_USE_NAMESPACE</a>(std)istream&amp; in, <span class="keyword">const</span> <span class="keywordtype">char</span>* file = <span class="stringliteral">&quot;&quot;</span> )
<a name="l00081"></a>00081    {
<a name="l00082"></a>00082       column = 1;
<a name="l00083"></a>00083       line = 1;
<a name="l00084"></a>00084       tokenStartColumn = 1;
<a name="l00085"></a>00085       tokenStartLine = 1;
<a name="l00086"></a>00086       guessing = 0;
<a name="l00087"></a>00087       filename = file;
<a name="l00088"></a>00088 
<a name="l00089"></a>00089       <span class="keywordflow">if</span>( input &amp;&amp; inputResponsible )
<a name="l00090"></a>00090          <span class="keyword">delete</span> input;
<a name="l00091"></a>00091 
<a name="l00092"></a>00092       input = <span class="keyword">new</span> <a class="code" href="classCharBuffer.html">CharBuffer</a>(in);
<a name="l00093"></a>00093       inputResponsible = <span class="keyword">true</span>;
<a name="l00094"></a>00094    }
<a name="l00095"></a>00095 
<a name="l00099"></a><a class="code" href="classLexerInputState.html#a90031004476b4038df477a296a58e1d9">00099</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> reset( <span class="keywordtype">void</span> )
<a name="l00100"></a>00100    {
<a name="l00101"></a>00101       column = 1;
<a name="l00102"></a>00102       line = 1;
<a name="l00103"></a>00103       tokenStartColumn = 1;
<a name="l00104"></a>00104       tokenStartLine = 1;
<a name="l00105"></a>00105       guessing = 0;
<a name="l00106"></a>00106       input-&gt;reset();
<a name="l00107"></a>00107    }
<a name="l00108"></a>00108 
<a name="l00113"></a><a class="code" href="classLexerInputState.html#a88da82742fede7394126a594f9091718">00113</a>    <span class="keywordtype">void</span> setPosition( <span class="keywordtype">int</span> line_, <span class="keywordtype">int</span> column_ )
<a name="l00114"></a>00114    {
<a name="l00115"></a>00115       line = line_;
<a name="l00116"></a>00116       column = column_;
<a name="l00117"></a>00117    }
<a name="l00118"></a>00118 
<a name="l00119"></a><a class="code" href="classLexerInputState.html#a242bf81a50c2ec322e055a5d8f630e45">00119</a>    <span class="keyword">virtual</span> ~<a class="code" href="classLexerInputState.html">LexerInputState</a>()
<a name="l00120"></a>00120    {
<a name="l00121"></a>00121       <span class="keywordflow">if</span> (inputResponsible)
<a name="l00122"></a>00122          <span class="keyword">delete</span> input;
<a name="l00123"></a>00123    }
<a name="l00124"></a>00124 
<a name="l00125"></a><a class="code" href="classLexerInputState.html#a95755ff2a0553db02185f5ac9be2e685">00125</a>    <span class="keywordtype">int</span> <a class="code" href="classLexerInputState.html#a95755ff2a0553db02185f5ac9be2e685">column</a>;
<a name="l00126"></a><a class="code" href="classLexerInputState.html#afeeef67d7ee619e132725e0edc7c746d">00126</a>    <span class="keywordtype">int</span> <a class="code" href="classLexerInputState.html#afeeef67d7ee619e132725e0edc7c746d">line</a>;
<a name="l00127"></a><a class="code" href="classLexerInputState.html#a630cdd779d3603629749c21d124c0415">00127</a>    <span class="keywordtype">int</span> <a class="code" href="classLexerInputState.html#a630cdd779d3603629749c21d124c0415">tokenStartColumn</a>;
<a name="l00128"></a><a class="code" href="classLexerInputState.html#a05c430823bae52a5b33d82d64c6c20b6">00128</a>    <span class="keywordtype">int</span> <a class="code" href="classLexerInputState.html#a05c430823bae52a5b33d82d64c6c20b6">tokenStartLine</a>;
<a name="l00129"></a><a class="code" href="classLexerInputState.html#a9d5c90f3b64b88abdc255d19e6a8cd62">00129</a>    <span class="keywordtype">int</span> <a class="code" href="classLexerInputState.html#a9d5c90f3b64b88abdc255d19e6a8cd62">guessing</a>;
<a name="l00131"></a><a class="code" href="classLexerInputState.html#aa1985b4b16fe3c6d80db85c157e3b6ed">00131</a>    <a class="code" href="config_8hpp.html#ad1e4025d0db4046e6e85a46c92b7ff77">ANTLR_USE_NAMESPACE</a>(std)string filename;
<a name="l00132"></a>00132    <a class="code" href="classInputBuffer.html">InputBuffer</a>&amp; getInput();
<a name="l00133"></a>00133 private:
<a name="l00135"></a><a class="code" href="classLexerInputState.html#ab0d7f9674fe51205e75a3f5b96b2ff8c">00135</a>    <a class="code" href="classInputBuffer.html">InputBuffer</a>* input;
<a name="l00137"></a><a class="code" href="classLexerInputState.html#aaa6b4786114c7e2cab97e9c0f6f030df">00137</a>    <span class="keywordtype">bool</span> inputResponsible;
<a name="l00138"></a>00138 
<a name="l00139"></a>00139    <span class="comment">// we don&#39;t want these:</span>
<a name="l00140"></a>00140    <a class="code" href="classLexerInputState.html">LexerInputState</a>(const <a class="code" href="classLexerInputState.html">LexerInputState</a>&amp;);
<a name="l00141"></a>00141    LexerInputState&amp; operator=(const LexerInputState&amp;);
<a name="l00142"></a>00142 };
<a name="l00143"></a>00143 
<a name="l00144"></a><a class="code" href="classLexerInputState.html#a4963d26ec751799e5d9125c8a43a0a4c">00144</a> inline <a class="code" href="classInputBuffer.html">InputBuffer</a>&amp; LexerInputState::getInput()
<a name="l00145"></a>00145 {
<a name="l00146"></a>00146    <span class="keywordflow">return</span> *input;
<a name="l00147"></a>00147 }
<a name="l00148"></a>00148 
<a name="l00150"></a><a class="code" href="LexerSharedInputState_8hpp.html#af84d4346fa6445c82d06ffa3f10dd9b3">00150</a> <span class="keyword">typedef</span> <a class="code" href="classRefCount.html">RefCount&lt;LexerInputState&gt;</a> <a class="code" href="LexerSharedInputState_8hpp.html#af84d4346fa6445c82d06ffa3f10dd9b3" title="A reference counted LexerInputState object.">LexerSharedInputState</a>;
<a name="l00151"></a>00151 
<a name="l00152"></a>00152 <span class="preprocessor">#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE</span>
<a name="l00153"></a>00153 <span class="preprocessor"></span>}
<a name="l00154"></a>00154 <span class="preprocessor">#endif</span>
<a name="l00155"></a>00155 <span class="preprocessor"></span>
<a name="l00156"></a>00156 <span class="preprocessor">#endif //INC_LexerSharedInputState_hpp__</span>
</pre></div></div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated on Fri Mar 25 2011 for ANTLR Support Libraries 2.7.1+ by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>