<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta name="generator" content="PHPDoctor 2RC4 (http://phpdoctor.sourceforge.net/)"> <meta name="when" content="Wed, 14 Apr 2010 15:12:03 +0000"> <link rel="stylesheet" type="text/css" href="../../stylesheet.css"> <link rel="start" href="../../overview-summary.html"> <title>Lexer (Doctrine)</title> </head> <body id="definition" onload="parent.document.title=document.title;"> <div class="header"> <h1>Doctrine</h1> <ul> <li><a href="../../overview-summary.html">Overview</a></li> <li><a href="../../doctrine/common/package-summary.html">Namespace</a></li> <li class="active">Class</li> <li><a href="../../doctrine/common/package-tree.html">Tree</a></li> <li><a href="../../deprecated-list.html">Deprecated</a></li> <li><a href="../../index-all.html">Index</a></li> </ul> </div> <div class="small_links"> <a href="../../index.html" target="_top">Frames</a> <a href="../../doctrine/common/lexer.html" target="_top">No frames</a> </div> <div class="small_links"> Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a> Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a> </div> <hr> <div class="qualifiedName">Doctrine\Common\Lexer</div> <div class="location">/Doctrine/Common/Lexer.php at line 35</div> <h1>Class Lexer</h1> <pre class="tree"><strong>Lexer</strong><br /></pre> <hr> <p class="signature">public abstract class <strong>Lexer</strong></p> <div class="comment" id="overview_description"><p>Simple generic lexical scanner.</p></div> <dl> <dt>License:</dt> <dd>http://www.opensource.org/licenses/lgpl-license.php LGPL</dd> <dt>See Also:</dt> <dd><code>www.doctrine-project.org</code></dd> <dt>Since:</dt> <dd>2.0</dd> <dt>Version:</dt> <dd>$Revision: 3938 $</dd> <dt>Author:</dt> <dd>Guilherme Blanco <guilhermeblanco@hotmail.com></dd> <dd>Jonathan Wage <jonwage@gmail.com></dd> <dd>Roman Borschel <roman@code-factory.org></dd> </dl> <hr> <table id="summary_field"> <tr><th colspan="2">Field Summary</th></tr> <tr> <td class="type"> array The next token in the query string.</td> <td class="description"><p class="name"><a href="#lookahead">$lookahead</a></p><p class="description"></p></td> </tr> <tr> <td class="type"> array The last matched/seen token.</td> <td class="description"><p class="name"><a href="#token">$token</a></p><p class="description"></p></td> </tr> </table> <table id="summary_method"> <tr><th colspan="2">Method Summary</th></tr> <tr> <td class="type">protected abstract array</td> <td class="description"><p class="name"><a href="#getCatchablePatterns()">getCatchablePatterns</a>()</p><p class="description">Lexical catchable patterns</p></td> </tr> <tr> <td class="type"> string</td> <td class="description"><p class="name"><a href="#getLiteral()">getLiteral</a>(integer token)</p><p class="description">Gets the literal for a given token.</p></td> </tr> <tr> <td class="type">protected abstract array</td> <td class="description"><p class="name"><a href="#getNonCatchablePatterns()">getNonCatchablePatterns</a>()</p><p class="description">Lexical non-catchable patterns</p></td> </tr> <tr> <td class="type"> array|null</td> <td class="description"><p class="name"><a href="#glimpse()">glimpse</a>()</p><p class="description">Peeks at the next token, returns it and immediately resets the peek.</p></td> </tr> <tr> <td class="type"> boolean</td> <td class="description"><p class="name"><a href="#isA()">isA</a>(mixed value, integer token)</p><p class="description">Checks if given value is identical to the given token</p></td> </tr> <tr> <td class="type"> boolean</td> <td class="description"><p class="name"><a href="#isNextToken()">isNextToken</a>(integer|string token)</p><p class="description">Checks whether a given token matches the current lookahead.</p></td> </tr> <tr> <td class="type"> array|null</td> <td class="description"><p class="name"><a href="#moveNext()">moveNext</a>()</p><p class="description">Moves to the next token in the input string. </p></td> </tr> <tr> <td class="type"> array</td> <td class="description"><p class="name"><a href="#peek()">peek</a>()</p><p class="description">Moves the lookahead token forward.</p></td> </tr> <tr> <td class="type"> void</td> <td class="description"><p class="name"><a href="#reset()">reset</a>()</p><p class="description">Resets the scanner</p></td> </tr> <tr> <td class="type"> void</td> <td class="description"><p class="name"><a href="#resetPeek()">resetPeek</a>()</p><p class="description">Resets the peek pointer to 0</p></td> </tr> <tr> <td class="type"> void</td> <td class="description"><p class="name"><a href="#resetPosition()">resetPosition</a>(integer position)</p><p class="description">Resets the lexer position on the input to the given position</p></td> </tr> <tr> <td class="type"> void</td> <td class="description"><p class="name"><a href="#setInput()">setInput</a>(string input)</p><p class="description">Inputs data to be tokenized</p></td> </tr> <tr> <td class="type"> void</td> <td class="description"><p class="name"><a href="#skipUntil()">skipUntil</a>(mixed type, $type The)</p><p class="description">Tells the lexer to skip input tokens until it sees a token with the given value.</p></td> </tr> </table> <h2 id="detail_field">Field Detail</h2> <div class="location">/Doctrine/Common/Lexer.php at line 55</div> <h3 id="lookahead">lookahead</h3> <code class="signature">public array The next token in the query string. <strong>$lookahead</strong></code> <div class="details"> <p></p></div> <hr> <div class="location">/Doctrine/Common/Lexer.php at line 60</div> <h3 id="token">token</h3> <code class="signature">public array The last matched/seen token. <strong>$token</strong></code> <div class="details"> <p></p></div> <hr> <h2 id="detail_method">Method Detail</h2> <div class="location">/Doctrine/Common/Lexer.php at line 242</div> <h3 id="getCatchablePatterns()">getCatchablePatterns</h3> <code class="signature">protected abstract array <strong>getCatchablePatterns</strong>()</code> <div class="details"> <p>Lexical catchable patterns</p></div> <hr> <div class="location">/Doctrine/Common/Lexer.php at line 222</div> <h3 id="getLiteral()">getLiteral</h3> <code class="signature">public string <strong>getLiteral</strong>(integer token)</code> <div class="details"> <p>Gets the literal for a given token.</p></div> <hr> <div class="location">/Doctrine/Common/Lexer.php at line 249</div> <h3 id="getNonCatchablePatterns()">getNonCatchablePatterns</h3> <code class="signature">protected abstract array <strong>getNonCatchablePatterns</strong>()</code> <div class="details"> <p>Lexical non-catchable patterns</p></div> <hr> <div class="location">/Doctrine/Common/Lexer.php at line 180</div> <h3 id="glimpse()">glimpse</h3> <code class="signature">public array|null <strong>glimpse</strong>()</code> <div class="details"> <p>Peeks at the next token, returns it and immediately resets the peek.</p><dl> <dt>Returns:</dt> <dd>The next token or NULL if there are no more tokens ahead.</dd> </dl> </div> <hr> <div class="location">/Doctrine/Common/Lexer.php at line 156</div> <h3 id="isA()">isA</h3> <code class="signature">public boolean <strong>isA</strong>(mixed value, integer token)</code> <div class="details"> <p>Checks if given value is identical to the given token</p></div> <hr> <div class="location">/Doctrine/Common/Lexer.php at line 111</div> <h3 id="isNextToken()">isNextToken</h3> <code class="signature">public boolean <strong>isNextToken</strong>(integer|string token)</code> <div class="details"> <p>Checks whether a given token matches the current lookahead.</p></div> <hr> <div class="location">/Doctrine/Common/Lexer.php at line 127</div> <h3 id="moveNext()">moveNext</h3> <code class="signature">public array|null <strong>moveNext</strong>()</code> <div class="details"> <p>Moves to the next token in the input string.</p><p>A token is an associative array containing three items: - 'value' : the string value of the token in the input string - 'type' : the type of the token (identifier, numeric, string, input parameter, none) - 'position' : the position of the token in the input string</p><dl> <dt>Returns:</dt> <dd>the next token; null if there is no more tokens left</dd> </dl> </div> <hr> <div class="location">/Doctrine/Common/Lexer.php at line 166</div> <h3 id="peek()">peek</h3> <code class="signature">public array <strong>peek</strong>()</code> <div class="details"> <p>Moves the lookahead token forward.</p><dl> <dt>Returns:</dt> <dd>| null The next token or NULL if there are no more tokens ahead.</dd> </dl> </div> <hr> <div class="location">/Doctrine/Common/Lexer.php at line 78</div> <h3 id="reset()">reset</h3> <code class="signature">public void <strong>reset</strong>()</code> <div class="details"> <p>Resets the scanner</p></div> <hr> <div class="location">/Doctrine/Common/Lexer.php at line 90</div> <h3 id="resetPeek()">resetPeek</h3> <code class="signature">public void <strong>resetPeek</strong>()</code> <div class="details"> <p>Resets the peek pointer to 0</p></div> <hr> <div class="location">/Doctrine/Common/Lexer.php at line 100</div> <h3 id="resetPosition()">resetPosition</h3> <code class="signature">public void <strong>resetPosition</strong>(integer position)</code> <div class="details"> <p>Resets the lexer position on the input to the given position</p><dl> <dt>Parameters:</dt> <dd>position - Position to place the lexical scanner</dd> </dl> </div> <hr> <div class="location">/Doctrine/Common/Lexer.php at line 67</div> <h3 id="setInput()">setInput</h3> <code class="signature">public void <strong>setInput</strong>(string input)</code> <div class="details"> <p>Inputs data to be tokenized</p><dl> <dt>Parameters:</dt> <dd>input - input to be tokenized</dd> </dl> </div> <hr> <div class="location">/Doctrine/Common/Lexer.php at line 142</div> <h3 id="skipUntil()">skipUntil</h3> <code class="signature">public void <strong>skipUntil</strong>(mixed type, $type The)</code> <div class="details"> <p>Tells the lexer to skip input tokens until it sees a token with the given value.</p><dl> <dt>Parameters:</dt> <dd>The - token type to skip until.</dd> </dl> </div> <hr> <div class="header"> <h1>Doctrine</h1> <ul> <li><a href="../../overview-summary.html">Overview</a></li> <li><a href="../../doctrine/common/package-summary.html">Namespace</a></li> <li class="active">Class</li> <li><a href="../../doctrine/common/package-tree.html">Tree</a></li> <li><a href="../../deprecated-list.html">Deprecated</a></li> <li><a href="../../index-all.html">Index</a></li> </ul> </div> <div class="small_links"> <a href="../../index.html" target="_top">Frames</a> <a href="../../doctrine/common/lexer.html" target="_top">No frames</a> </div> <div class="small_links"> Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a> Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a> </div> <hr> <p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p> </body> </html>