- Added Sander's list of lexer tokens

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@81915 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Derick Rethans 2002-05-12 10:52:30 +00:00
parent 2f7966f92e
commit 6284d3f261

597
appendices/tokens.xml Normal file
View file

@ -0,0 +1,597 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<appendix id="tokens">
<title>List of Parser Tokens</title>
<para>
Various parts of the PHP language are represented internally by stuff like
T_SR. PHP outputs identifiers like this one in parse errors, like "Parse
error: unexpected T_SR, expecting ',' or ';' in script.php on line 10."
</para>
<para>
You're supposed to know that T_SR means >>. For everybody who doesn't
know that, here is a table with those identifiers, PHP-syntax and
references to the appropriate places in the manual.
</para>
<table>
<title>Tokens</title>
<tgroup cols="3">
<thead>
<row>
<entry>Token</entry>
<entry>Syntax</entry>
<entry>Reference</entry>
</row>
</thead>
<tbody>
<row>
<entry>T_AND_EQUAL</entry>
<entry>&=</entry>
<entry><link linkend="language.operators.assignment">assignment
operators</link></entry>
</row>
<row>
<entry>T_ARRAY</entry>
<entry>array()</entry>
<entry><function>array</function>, <link
linkend="language.types.array.syntax">array syntax</link></entry>
</row>
<row>
<entry>T_ARRAY_CAST</entry>
<entry>(array)</entry>
<entry><link linkend="language.types.typecasting">type-casting</link></entry>
</row>
<row>
<entry>T_AS</entry>
<entry>as</entry>
<entry><link linkend="control-structures.foreach">foreach</link></entry>
</row>
<row>
<entry>T_BAD_CHARACTER</entry>
<entry></entry>
<entry>anything below ASCII 32 except \t (0x09), \n (0x0a) and \r (0x0d)</entry>
</row>
<row>
<entry>T_BOOLEAN_AND</entry>
<entry>&&</entry>
<entry><link linkend="language.operators.logical">logical operators</link></entry>
</row>
<row>
<entry>T_BOOLEAN_OR</entry>
<entry>||</entry>
<entry><link linkend="language.operators.logical">logical operators</link></entry>
</row>
<row>
<entry>T_BOOL_CAST</entry>
<entry>(bool) or (boolean)</entry>
<entry><link linkend="language.types.typecasting">type-casting</link></entry>
</row>
<row>
<entry>T_BREAK</entry>
<entry>break;</entry>
<entry><link linkend="control-structures.break">break</link></entry>
</row>
<row>
<entry>T_CASE</entry>
<entry>case</entry>
<entry><link linkend="control-structures.switch">switch</link></entry>
</row>
<row>
<entry>T_CHARACTER</entry>
<entry></entry>
<entry></entry>
</row>
<row>
<entry>T_CLASS</entry>
<entry>class</entry>
<entry><link linkend="language.oop">classes and objects</link></entry>
</row>
<row>
<entry>T_CLOSE_TAG</entry>
<entry>?> or %></entry>
<entry></entry>
</row>
<row>
<entry>T_COMMENT</entry>
<entry>// or #</entry>
<entry><link linkend="language.basic-syntax.comments">comments</link></entry>
</row>
<row>
<entry>T_CONCAT_EQUAL</entry>
<entry>.=</entry>
<entry><link linkend="language.operators.assignment">assignment
operators</link></entry>
</row>
<row>
<entry>T_CONST</entry>
<entry>const</entry>
<entry></entry>
</row>
<row>
<entry>T_CONSTANT_ENCAPSED_STRING</entry>
<entry>"foo" or 'bar'</entry>
<entry><link linkend="language.types.string.syntax">string syntax</link></entry>
</row>
<row>
<entry>T_CONTINUE</entry>
<entry>continue</entry>
<entry></entry>
</row>
<row>
<entry>T_CURLY_OPEN</entry>
<entry></entry>
<entry></entry>
</row>
<row>
<entry>T_DEC</entry>
<entry>--</entry>
<entry><link
linkend="language.operators.increment">incrementing/decrementing
operators</link></entry>
</row>
<row>
<entry>T_DECLARE</entry>
<entry>declare</entry>
<entry><link linkend="control-structures.declare">declare</link></entry>
</row>
<row>
<entry>T_DEFAULT</entry>
<entry>default</entry>
<entry><link linkend="control-structures.switch">switch</link></entry>
</row>
<row>
<entry>T_DIV_EQUAL</entry>
<entry>/=</entry>
<entry><link linkend="language.operators.assignment">assignment
operators</link></entry>
</row>
<row>
<entry>T_DNUMBER</entry>
<entry>0.12, etc</entry>
<entry><link linkend="language.types.float">floating point numbers</link></entry>
</row>
<row>
<entry>T_DO</entry>
<entry>do</entry>
<entry><link linkend="control-structures.do.while">do..while</link></entry>
</row>
<row>
<entry>T_DOLLAR_OPEN_CURLY_BRACES</entry>
<entry>${</entry>
<entry><link linkend="language.types.string.parsing.complex">complex
variable parsed syntax</link></entry>
</row>
<row>
<entry>T_DOUBLE_ARROW</entry>
<entry>=></entry>
<entry><link linkend="language.types.array.syntax">array syntax</link></entry>
</row>
<row>
<entry>T_DOUBLE_CAST</entry>
<entry>(real), (double) or (float)</entry>
<entry><link linkend="language.types.typecasting">type-casting</link></entry>
</row>
<row>
<entry>T_ECHO</entry>
<entry>echo</entry>
<entry><function>echo</function></entry>
</row>
<row>
<entry>T_ELSE</entry>
<entry>else</entry>
<entry><link linkend="control-structures.else">else</link></entry>
</row>
<row>
<entry>T_ELSEIF</entry>
<entry>elseif</entry>
<entry><link linkend="control-structures.elseif">elseif</link></entry>
</row>
<row>
<entry>T_EMPTY</entry>
<entry>empty</entry>
<entry><function>empty</function></entry>
</row>
<row>
<entry>T_ENCAPSED_AND_WHITESPACE</entry>
<entry></entry>
<entry></entry>
</row>
<row>
<entry>T_ENDDECLARE</entry>
<entry>enddeclare</entry>
<entry><link linkend="control-structures.declare">declare</link>, <link
linkend="control-structures.alternative-syntax">alternative syntax</link></entry>
</row>
<row>
<entry>T_ENDFOR</entry>
<entry>endfor</entry>
<entry><link linkend="control-structures.for">for</link>, <link
linkend="control-structures.alternative-syntax">alternative syntax</link></entry>
</row>
<row>
<entry>T_ENDFOREACH</entry>
<entry>endforeach</entry>
<entry><link linkend="control-structures.foreach">foreach</link>, <link
linkend="control-structures.alternative-syntax">alternative syntax</link></entry>
</row>
<row>
<entry>T_ENDIF</entry>
<entry>endif</entry>
<entry><link linkend="control-structures.if">if</link>, <link
linkend="control-structures.alternative-syntax">alternative syntax</link></entry>
</row>
<row>
<entry>T_ENDSWITCH</entry>
<entry>endswitch</entry>
<entry><link linkend="control-structures.switch">switch</link>, <link
linkend="control-structures.alternative-syntax">alternative syntax</link></entry>
</row>
<row>
<entry>T_ENDWHILE</entry>
<entry>endwhile</entry>
<entry><link linkend="control-structures.while">while</link>, <link
linkend="control-structures.alternative-syntax">alternative syntax</link></entry>
</row>
<row>
<entry>T_END_HEREDOC</entry>
<entry></entry>
<entry><link linkend="language.types.string.syntax.heredoc">heredoc
syntax</link></entry>
</row>
<row>
<entry>T_EVAL</entry>
<entry>eval()</entry>
<entry><function>eval</function></entry>
</row>
<row>
<entry>T_EXIT</entry>
<entry>exit or die</entry>
<entry><function>exit</function>, <function>die</function></entry>
</row>
<row>
<entry>T_EXTENDS</entry>
<entry>extends</entry>
<entry><link linkend="keyword.extends">extends</link>, <link
linkend="language.oop">classes and objects</link></entry>
</row>
<row>
<entry>T_FILE</entry>
<entry>__FILE__</entry>
<entry><link linkend="language.constants">constants</link></entry>
</row>
<row>
<entry>T_FOR</entry>
<entry>for</entry>
<entry><link linkend="control-structures.for">for</link></entry>
</row>
<row>
<entry>T_FOREACH</entry>
<entry>foreach</entry>
<entry><link linkend="control-structures.foreach">foreach</link></entry>
</row>
<row>
<entry>T_FUNCTION</entry>
<entry>function or cfunction</entry>
<entry><link linkend="functions">functions</link></entry>
</row>
<row>
<entry>T_GLOBAL</entry>
<entry>global</entry>
<entry><link linkend="language.variables.scope">variable scope</link></entry>
</row>
<row>
<entry>T_IF</entry>
<entry>if</entry>
<entry><link linkend="control-structures.if">if</link></entry>
</row>
<row>
<entry>T_INC</entry>
<entry>++</entry>
<entry><link
linkend="language.operators.increment">incrementing/decrementing
operators</link></entry>
</row>
<row>
<entry>T_INCLUDE</entry>
<entry>include()</entry>
<entry><function>include</function></entry>
</row>
<row>
<entry>T_INCLUDE_ONCE</entry>
<entry>include_once()</entry>
<entry><function>include_once</function></entry>
</row>
<row>
<entry>T_INLINE_HTML</entry>
<entry></entry>
<entry></entry>
</row>
<row>
<entry>T_INT_CAST</entry>
<entry>(int) or (integer)</entry>
<entry><link linkend="language.types.typecasting">type-casting</link></entry>
</row>
<row>
<entry>T_ISSET</entry>
<entry>isset()</entry>
<entry><function>isset</function></entry>
</row>
<row>
<entry>T_IS_EQUAL</entry>
<entry>==</entry>
<entry><link linkend="language.operators.comparison">comparison operators</link></entry>
</row>
<row>
<entry>T_IS_GREATER_OR_EQUAL</entry>
<entry>>=</entry>
<entry><link linkend="language.operators.comparison">comparison operators</link></entry>
</row>
<row>
<entry>T_IS_IDENTICAL</entry>
<entry>===</entry>
<entry><link linkend="language.operators.comparison">comparison operators</link></entry>
</row>
<row>
<entry>T_IS_NOT_EQUAL</entry>
<entry>!= or &lt;></entry>
<entry><link linkend="language.operators.comparison">comparison operators</link></entry>
</row>
<row>
<entry>T_IS_NOT_IDENTICAL</entry>
<entry>!==</entry>
<entry><link linkend="language.operators.comparison">comparison operators</link></entry>
</row>
<row>
<entry>T_SMALLER_OR_EQUAL</entry>
<entry>&lt;=</entry>
<entry><link linkend="language.operators.comparison">comparison operators</link></entry>
</row>
<row>
<entry>T_LINE</entry>
<entry>__LINE__</entry>
<entry><link linkend="language.constants">constants</link></entry>
</row>
<row>
<entry>T_LIST</entry>
<entry>list()</entry>
<entry><function>list</function></entry>
</row>
<row>
<entry>T_LNUMBER</entry>
<entry>123, 012, 0x1ac, etc</entry>
<entry><link linkend="language.types.integer">integers</link></entry>
</row>
<row>
<entry>T_LOGICAL_AND</entry>
<entry>and</entry>
<entry><link linkend="language.operators.logical">logical operators</link></entry>
</row>
<row>
<entry>T_LOGICAL_OR</entry>
<entry>or</entry>
<entry><link linkend="language.operators.logical">logical operators</link></entry>
</row>
<row>
<entry>T_LOGICAL_XOR</entry>
<entry>xor</entry>
<entry><link linkend="language.operators.logical">logical operators</link></entry>
</row>
<row>
<entry>T_MINUS_EQUAL</entry>
<entry>-=</entry>
<entry><link linkend="language.operators.assignment">assignment
operators</link></entry>
</row>
<row>
<entry>T_ML_COMMENT</entry>
<entry>/* and */</entry>
<entry><link linkend="language.basic-syntax.comments">comments</link></entry>
</row>
<row>
<entry>T_MOD_EQUAL</entry>
<entry>%=</entry>
<entry><link linkend="language.operators.assignment">assignment
operators</link></entry>
</row>
<row>
<entry>T_MUL_EQUAL</entry>
<entry>*=</entry>
<entry><link linkend="language.operators.assignment">assignment
operators</link></entry>
</row>
<row>
<entry>T_NEW</entry>
<entry>new</entry>
<entry><link linkend="language.oop">classes and objects</link></entry>
</row>
<row>
<entry>T_NUM_STRING</entry>
<entry></entry>
<entry></entry>
</row>
<row>
<entry>T_OBJECT_CAST</entry>
<entry>(object)</entry>
<entry><link linkend="language.types.typecasting">type-casting</link></entry>
</row>
<row>
<entry>T_OBJECT_OPERATOR</entry>
<entry>-></entry>
<entry><link linkend="language.oop">classes and objects</link></entry>
</row>
<row>
<entry>T_OLD_FUNCTION</entry>
<entry>old_function</entry>
<entry><link linkend="functions.old-syntax">old_function</link></entry>
</row>
<row>
<entry>T_OPEN_TAG</entry>
<entry>&lt;?php, &lt;? or &lt%</entry>
<entry><link linkend="language.basic-syntax.phpmode">escaping
from HTML</link></entry>
</row>
<row>
<entry>T_OPEN_TAG_WITH_ECHO</entry>
<entry>&lt;?= or &lt%=</entry>
<entry><link linkend="language.basic-syntax.phpmode">escaping
from HTML</link></entry>
</row>
<row>
<entry>T_OR_EQUAL</entry>
<entry>|=</entry>
<entry><link linkend="language.operators.assignment">assignment
operators</link></entry>
</row>
<row>
<entry>T_PAAMAYIM_NEKUDOTAYIM</entry>
<entry>::</entry>
<entry><link linkend="keyword.paamayim-nekudotayim">::</link></entry>
</row>
<row>
<entry>T_PLUS_EQUAL</entry>
<entry>+=</entry>
<entry><link linkend="language.operators.assignment">assignment
operators</link></entry>
</row>
<row>
<entry>T_PRINT</entry>
<entry>print()</entry>
<entry><function>print</function></entry>
</row>
<row>
<entry>T_REQUIRE</entry>
<entry>require()</entry>
<entry><function>require</function></entry>
</row>
<row>
<entry>T_REQUIRE_ONCE</entry>
<entry>require_once()</entry>
<entry><function>require_once</function></entry>
</row>
<row>
<entry>T_RETURN</entry>
<entry>return</entry>
<entry><link linkend="functions.returning-values">returing values</link></entry>
</row>
<row>
<entry>T_SL</entry>
<entry>&lt;&lt;</entry>
<entry><link linkend="language.operators.bitwise">bitwise
operators</link></entry>
</row>
<row>
<entry>T_SL_EQUAL</entry>
<entry>&lt;&lt;=</entry>
<entry><link linkend="language.operators.assignment">assignment
operators</link></entry>
</row>
<row>
<entry>T_SR</entry>
<entry>>></entry>
<entry><link linkend="language.operators.bitwise">bitwise
operators</link></entry>
</row>
<row>
<entry>T_SR_EQUAL</entry>
<entry>>>=</entry>
<entry><link linkend="language.operators.assignment">assignment
operators</link></entry>
</row>
<row>
<entry>T_START_HEREDOC</entry>
<entry>&lt;&lt;&lt;</entry>
<entry><link linkend="language.types.string.syntax.heredoc">heredoc
syntax</link></entry>
</row>
<row>
<entry>T_STATIC</entry>
<entry>static</entry>
<entry><link linkend="language.variables.scope">variable scope</link></entry>
</row>
<row>
<entry>T_STRING</entry>
<entry></entry>
<entry></entry>
</row>
<row>
<entry>T_STRING_CAST</entry>
<entry>(string)</entry>
<entry><link linkend="language.types.typecasting">type-casting</link></entry>
</row>
<row>
<entry>T_STRING_VARNAME</entry>
<entry></entry>
<entry></entry>
</row>
<row>
<entry>T_SWITCH</entry>
<entry>switch</entry>
<entry><link linkend="control-structures.switch">switch</link></entry>
</row>
<row>
<entry>T_UNSET</entry>
<entry>unset()</entry>
<entry><function>unset</function></entry>
</row>
<row>
<entry>T_UNSET_CAST</entry>
<entry>(unset)</entry>
<entry>(not documented; casts to &null;)</entry>
</row>
<row>
<entry>T_USE</entry>
<entry>use</entry>
<entry>(not implemented)</entry>
</row>
<row>
<entry>T_VAR</entry>
<entry>var</entry>
<entry><link linkend="language.oop">classes and objects</link></entry>
</row>
<row>
<entry>T_VARIABLE</entry>
<entry>$foo</entry>
<entry><link linkend="language.variables">variables</link></entry>
</row>
<row>
<entry>T_WHILE</entry>
<entry>while</entry>
<entry><link linkend="control-structures.while">while</link>, <link
linkend="control-structures.do.while">do..while</link></entry>
</row>
<row>
<entry>T_WHITESPACE</entry>
<entry></entry>
<entry></entry>
</row>
<row>
<entry>T_XOR_EQUAL</entry>
<entry>^=</entry>
<entry><link linkend="language.operators.assignment">assignment
operators</link></entry>
</row>
</tbody>
</tgroup>
</table>
</appendix>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->