cvs: phpdoc-pl /reference/tokenizer/functions token-get-all.xml
| From: | Leszek Krupinski | Date: | Tue, 24 Feb 2004 02:07:58 +0000 |
| Subject: | cvs: phpdoc-pl /reference/tokenizer/functions token-get-all.xml | ||
| Groups: | php.doc.pl | ||
| Request: | Send a blank email to doc-pl+get-304@lists.php.net to get a copy of this message | ||
leszek Mon Feb 23 21:07:58 2004 EDT
Added files:
/phpdoc-pl/reference/tokenizer/functions token-get-all.xml
Log:
http://cvs.php.net/co.php/phpdoc-pl/reference/tokenizer/functions/token-get-all.xml?r=1.1&p=1
Index: phpdoc-pl/reference/tokenizer/functions/token-get-all.xml
+++ phpdoc-pl/reference/tokenizer/functions/token-get-all.xml
<?xml version="1.0" encoding="iso-8859-2"?>
<!-- EN-Revision: 1.7 Maintainer: dombal Staus: ready -->
<!-- $Revision: 1.1 $ -->
<refentry id="function.token-get-all">
<refnamediv>
<refname>token_get_all</refname>
<refpurpose>Dzieli zadane ¼ród³o na tokeny PHP</refpurpose>
</refnamediv>
<refsect1>
<title>Opis</title>
<methodsynopsis>
<type>array</type><methodname>token_get_all</methodname>
<methodparam><type>string</type><parameter>¼ród³o</parameter></methodparam>
</methodsynopsis>
<simpara>
<function>token_get_all</function> parsuje zadane
<parameter>¼ród³o</parameter>, czyli ci±g znaków zawieraj±cy kod PHP,
zamieniaj±c je na tokeny jêzyka PHP przy u¿yciu analizy leksykalnej
silnika Zend. Funkcja ta zwraca tablicê identyfikatorów tokenów. Ka¿dy
identyfikator tokena jest allbo pojedynczym znakiem (np.:
<constant>;</constant>, <constant>.</constant>,
<constant>></constant>, <constant>!</constant>, itd...), albo
dwuelementow± tablic± zawieraj±c± indeks tokena w elemencie 0, i
zawarto¶æ oryginalengo tokena w postaci ci±gu znakowego w elemencie 1.
</simpara>
<simpara>
Listê tokenów identyfikowanych przez parser znajdziesz w <xref
linkend="tokens"/>, mo¿esz tak¿e u¿yæ funkcji
<function>token_name</function> by przet³umaczyæ warto¶æ tokena na jego
nazwê.
</simpara>
<example>
<title>Przyk³ady u¿ycia <function>token_get_all</function></title>
<programlisting role="php">
<![CDATA[
<?php
$tokeny = token_get_all('<?php'); // => array(array(T_OPEN_TAG,
'<?'));
$tokeny = token_get_all('<?php echo; ?>'); /* => array(
array(T_OPEN_TAG, '<?php'),
array(T_ECHO, 'echo'),
';',
array(T_CLOSE_TAG, '?>') ); */