svn: /phpdoc/ja/trunk/reference/tokenizer/ book.xml functions/token-get-all.xml functions/token-name.xml phptoken/construct.xml phptoken/getTokenName.xml phptoken/is.xml phptoken/isIgnorable.xml phptoken/toString.xml phptoken/tokenize.xml phptoken.xml

[email protected] (Yoshinari Takaoka) Wed, 09 Dec 2020 13:16:00 +0000
Newsgroups php.doc.ja
Message-ID <[email protected]>
mumumu                                   Wed, 09 Dec 2020 13:16:00 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=351970

Log:
Add PhpToken reference

Closes GH-272.

Changed paths:
    U   phpdoc/ja/trunk/reference/tokenizer/book.xml
    U   phpdoc/ja/trunk/reference/tokenizer/functions/token-get-all.xml
    U   phpdoc/ja/trunk/reference/tokenizer/functions/token-name.xml
    A   phpdoc/ja/trunk/reference/tokenizer/phptoken/
    A   phpdoc/ja/trunk/reference/tokenizer/phptoken/construct.xml
    A   phpdoc/ja/trunk/reference/tokenizer/phptoken/getTokenName.xml
    A   phpdoc/ja/trunk/reference/tokenizer/phptoken/is.xml
    A   phpdoc/ja/trunk/reference/tokenizer/phptoken/isIgnorable.xml
    A   phpdoc/ja/trunk/reference/tokenizer/phptoken/toString.xml
    A   phpdoc/ja/trunk/reference/tokenizer/phptoken/tokenize.xml
    A   phpdoc/ja/trunk/reference/tokenizer/phptoken.xml
svn-diffs-351970.txt (text/x-diff, 27.3 KB)
Modified: phpdoc/ja/trunk/reference/tokenizer/book.xml
===================================================================
--- phpdoc/ja/trunk/reference/tokenizer/book.xml	2020-12-09 12:23:36 UTC (rev 351969)
+++ phpdoc/ja/trunk/reference/tokenizer/book.xml	2020-12-09 13:16:00 UTC (rev 351970)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision$ -->
-<!-- EN-Revision: 344870 Maintainer: takagi Status: ready -->
-<!-- CREDITS: hirokawa -->
+<!-- EN-Revision: 351961 Maintainer: takagi Status: ready -->
+<!-- CREDITS: hirokawa,mumumu -->

 <book xml:id="book.tokenizer" xmlns="http://docbook.org/ns/docbook">
  <?phpdoc extension-membership="bundled" ?>
@@ -23,6 +23,9 @@
  &reference.tokenizer.setup;
  &reference.tokenizer.constants;
  &reference.tokenizer.examples;
+
+ &reference.tokenizer.phptoken;
+
  &reference.tokenizer.reference;

 </book>

Modified: phpdoc/ja/trunk/reference/tokenizer/functions/token-get-all.xml
===================================================================
--- phpdoc/ja/trunk/reference/tokenizer/functions/token-get-all.xml	2020-12-09 12:23:36 UTC (rev 351969)
+++ phpdoc/ja/trunk/reference/tokenizer/functions/token-get-all.xml	2020-12-09 13:16:00 UTC (rev 351970)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision$ -->
-<!-- EN-Revision: 351416 Maintainer: hirokawa Status: ready -->
+<!-- EN-Revision: 351961 Maintainer: hirokawa Status: ready -->
 <!-- Credits: mumumu -->
 <refentry xml:id="function.token-get-all" xmlns="http://docbook.org/ns/docbook">
  <refnamediv>
@@ -176,6 +176,7 @@
   &reftitle.seealso;
   <para>
    <simplelist>
+    <member><function>PhpToken::tokenize</function></member>
     <member><function>token_name</function></member>
    </simplelist>
   </para>

Modified: phpdoc/ja/trunk/reference/tokenizer/functions/token-name.xml
===================================================================
--- phpdoc/ja/trunk/reference/tokenizer/functions/token-name.xml	2020-12-09 12:23:36 UTC (rev 351969)
+++ phpdoc/ja/trunk/reference/tokenizer/functions/token-name.xml	2020-12-09 13:16:00 UTC (rev 351970)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision$ -->
-<!-- EN-Revision: 351416 Maintainer: hirokawa Status: ready -->
+<!-- EN-Revision: 351961 Maintainer: hirokawa Status: ready -->
 <!-- Credits: mumumu -->
 <refentry xml:id="function.token-name" xmlns="http://docbook.org/ns/docbook">
  <refnamediv>
@@ -66,6 +66,13 @@
    </simplelist>
   </para>
  </refsect1>
+
+ <refsect1 role="seealso">
+  &reftitle.seealso;
+  <simplelist>
+   <member><function>PhpToken::getTokenName</function></member>
+  </simplelist>
+ </refsect1>
 </refentry>
 <!-- Keep this comment at the end of the file
 Local variables:

Added: phpdoc/ja/trunk/reference/tokenizer/phptoken/construct.xml
===================================================================
--- phpdoc/ja/trunk/reference/tokenizer/phptoken/construct.xml	                        (rev 0)
+++ phpdoc/ja/trunk/reference/tokenizer/phptoken/construct.xml	2020-12-09 13:16:00 UTC (rev 351970)
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+<!-- EN-Revision: 351961 Maintainer: mumumu Status: ready -->
+
+<refentry xml:id="phptoken.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+  <refname>PhpToken::__construct</refname>
+  <refpurpose>新しい PhpToken オブジェクトを返す</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+  &reftitle.description;
+  <constructorsynopsis>
+   <modifier>final</modifier> <modifier>public</modifier> <methodname>PhpToken::__construct</methodname>
+   <methodparam><type>int</type><parameter>id</parameter></methodparam>
+   <methodparam><type>string</type><parameter>text</parameter></methodparam>
+   <methodparam choice="opt"><type>int</type><parameter>line</parameter><initializer>-1</initializer></methodparam>
+   <methodparam choice="opt"><type>int</type><parameter>pos</parameter><initializer>-1</initializer></methodparam>
+  </constructorsynopsis>
+  <para>
+   新しい PhpToken オブジェクトを返します。
+  </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+  &reftitle.parameters;
+  <variablelist>
+   <varlistentry>
+    <term><parameter>id</parameter></term>
+    <listitem>
+     <para>
+      T_* 定数(<xref linkend="tokens"/> を参照) のうちのひとつ。
+      または、
+      一文字のトークンを表す ASCII コードポイント。
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><parameter>text</parameter></term>
+    <listitem>
+     <para>
+      トークンの内容を示すテキスト
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><parameter>line</parameter></term>
+    <listitem>
+     <para>
+      トークンが始まる行番号(1から始まります)
+     </para>
+    </listitem>
+   </varlistentry>
+   <varlistentry>
+    <term><parameter>pos</parameter></term>
+    <listitem>
+     <para>
+      トークン化された文字列内での開始位置(0から始まります)
+     </para>
+    </listitem>
+   </varlistentry>
+  </variablelist>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+  &reftitle.returnvalues;
+  <para>
+   新しい PhpToken のインスタンスを返します。
+  </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+  &reftitle.seealso;
+  <simplelist>
+   <member><function>PhpToken::tokenize</function></member>
+  </simplelist>
+ </refsect1>
+</refentry>
+<!-- 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:"~/.phpdoc/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
+-->
+


Property changes on: phpdoc/ja/trunk/reference/tokenizer/phptoken/construct.xml
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
\ No newline at end of property
Added: phpdoc/ja/trunk/reference/tokenizer/phptoken/getTokenName.xml
===================================================================
--- phpdoc/ja/trunk/reference/tokenizer/phptoken/getTokenName.xml	                        (rev 0)
+++ phpdoc/ja/trunk/reference/tokenizer/phptoken/getTokenName.xml	2020-12-09 13:16:00 UTC (rev 351970)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+<!-- EN-Revision: 351961 Maintainer: mumumu Status: ready -->
+
+<refentry xml:id="phptoken.gettokenname" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+  <refname>PhpToken::getTokenName</refname>
+  <refpurpose>トークンの名前を返す</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+  &reftitle.description;
+  <methodsynopsis>
+   <modifier>public</modifier> <type class="union"><type>string</type><type>null</type></type> <methodname>PhpToken::getTokenName</methodname>
+   <void />
+  </methodsynopsis>
+  <para>
+   トークンの名前を返します。
+  </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+  &reftitle.parameters;
+  &no.function.parameters;
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+  &reftitle.returnvalues;
+  <para>
+   一文字のトークンを示す ASCII 文字。
+   または、既知のトークンの名前を示す T_* 定数(<xref linkend="tokens"/> を参照)。
+   不明なトークンの場合は &null; を返します。
+  </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+  &reftitle.examples;
+  <example>
+   <title><function>PhpToken::getTokenName</function> の例</title>
+   <programlisting role="php">
+<![CDATA[
+<?php
+// 既知のトークンの場合
+$token = new PhpToken(T_ECHO, 'echo');
+var_dump($token->getTokenName());   // -> string(6) "T_ECHO"
+
+// 一文字のトークンの場合
+$token = new PhpToken(ord(';'), ';');
+var_dump($token->getTokenName());   // -> string(1) ";"
+
+// 不明なトークンの場合
+$token = new PhpToken(10000 , "\0");
+var_dump($token->getTokenName());   // -> NULL
+]]>
+   </programlisting>
+  </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+  &reftitle.seealso;
+  <simplelist>
+   <member><function>PhpToken::tokenize</function></member>
+   <member><function>token_name</function></member>
+  </simplelist>
+ </refsect1>
+</refentry>
+<!-- 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:"~/.phpdoc/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
+-->


Property changes on: phpdoc/ja/trunk/reference/tokenizer/phptoken/getTokenName.xml
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
\ No newline at end of property
Added: phpdoc/ja/trunk/reference/tokenizer/phptoken/is.xml
===================================================================
--- phpdoc/ja/trunk/reference/tokenizer/phptoken/is.xml	                        (rev 0)
+++ phpdoc/ja/trunk/reference/tokenizer/phptoken/is.xml	2020-12-09 13:16:00 UTC (rev 351970)
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+<!-- EN-Revision: 351961 Maintainer: mumumu Status: ready -->
+
+<refentry xml:id="phptoken.is" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+  <refname>PhpToken::is</refname>
+  <refpurpose>指定された種類のトークンかを調べる</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+  &reftitle.description;
+  <methodsynopsis>
+   <modifier>public</modifier> <type>bool</type> <methodname>PhpToken::is</methodname>
+   <methodparam><type class="union"><type>int</type><type>string</type><type>array</type></type><parameter>kind</parameter></methodparam>
+  </methodsynopsis>
+  <para>
+   トークンが指定された <parameter>kind</parameter> であるかを判定します。
+  </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+  &reftitle.parameters;
+  <variablelist>
+   <varlistentry>
+     <term><parameter>kind</parameter></term>
+     <listitem>
+      <para>
+       トークンのID、またはテキスト表現に一致するスカラー値、または配列
+      </para>
+     </listitem>
+    </varlistentry>
+  </variablelist>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+  &reftitle.returnvalues;
+  <para>
+   トークンが指定された種類かを boolean で返します。
+  </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+  &reftitle.examples;
+  <example>
+   <title><function>PhpToken::is</function> の例</title>
+   <programlisting role="php">
+<![CDATA[
+<?php
+$token = new PhpToken(T_ECHO, 'echo');
+var_dump($token->is(T_ECHO));        // -> bool(true)
+var_dump($token->is('echo'));        // -> bool(true)
+var_dump($token->is(T_FOREACH));     // -> bool(false)
+var_dump($token->is('foreach'));     // -> bool(false)
+]]>
+   </programlisting>
+  </example>
+  <example>
+   <title>Usage with array</title>
+   <programlisting role="php">
+<![CDATA[
+<?php
+function isClassType(PhpToken $token): bool {
+    return $token->is([T_CLASS, T_INTERFACE, T_TRAIT]);
+}
+
+$interface = new PhpToken(T_INTERFACE, 'interface');
+var_dump(isClassType($interface));   // -> bool(true)
+
+$function = new PhpToken(T_FUNCTION, 'function');
+var_dump(isClassType($function));    // -> bool(false)
+]]>
+   </programlisting>
+  </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+  &reftitle.seealso;
+  <simplelist>
+   <member><function>token_name</function></member>
+  </simplelist>
+ </refsect1>
+</refentry>
+<!-- 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:"~/.phpdoc/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
+-->


Property changes on: phpdoc/ja/trunk/reference/tokenizer/phptoken/is.xml
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
\ No newline at end of property
Added: phpdoc/ja/trunk/reference/tokenizer/phptoken/isIgnorable.xml
===================================================================
--- phpdoc/ja/trunk/reference/tokenizer/phptoken/isIgnorable.xml	                        (rev 0)
+++ phpdoc/ja/trunk/reference/tokenizer/phptoken/isIgnorable.xml	2020-12-09 13:16:00 UTC (rev 351970)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+<!-- EN-Revision: 351961 Maintainer: mumumu Status: ready -->
+
+<refentry xml:id="phptoken.isignorable" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+  <refname>PhpToken::isIgnorable</refname>
+  <refpurpose>トークンがPHPパーサから無視されるかを調べる</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+  &reftitle.description;
+  <methodsynopsis>
+   <modifier>public</modifier> <type>bool</type> <methodname>PhpToken::isIgnorable</methodname>
+   <void />
+  </methodsynopsis>
+  <para>
+   トークンがPHPパーサから無視されるかを判定します。
+  </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+  &reftitle.parameters;
+  &no.function.parameters;
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+  &reftitle.returnvalues;
+  <para>
+   A boolean value whether the token would be ignored by the PHP parser (such as whitespace or comments).
+  </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+  &reftitle.examples;
+  <example>
+   <title><function>PhpToken::isIgnorable</function> example</title>
+   <programlisting role="php">
+<![CDATA[
+<?php
+$echo = new PhpToken(T_ECHO, 'echo');
+var_dump($echo->isIgnorable());   // -> bool(false)
+
+$space = new PhpToken(T_WHITESPACE, ' ');
+var_dump($space->isIgnorable());  // -> bool(true)
+]]>
+   </programlisting>
+  </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+  &reftitle.seealso;
+  <simplelist>
+   <member><function>PhpToken::tokenize</function></member>
+  </simplelist>
+ </refsect1>
+</refentry>
+<!-- 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:"~/.phpdoc/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
+-->


Property changes on: phpdoc/ja/trunk/reference/tokenizer/phptoken/isIgnorable.xml
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
\ No newline at end of property
Added: phpdoc/ja/trunk/reference/tokenizer/phptoken/toString.xml
===================================================================
--- phpdoc/ja/trunk/reference/tokenizer/phptoken/toString.xml	                        (rev 0)
+++ phpdoc/ja/trunk/reference/tokenizer/phptoken/toString.xml	2020-12-09 13:16:00 UTC (rev 351970)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+<!-- EN-Revision: 351961 Maintainer: mumumu Status: ready -->
+
+<refentry xml:id="phptoken.tostring" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+  <refname>PhpToken::__toString</refname>
+  <refpurpose>トークンの文字列表現を返す</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+  &reftitle.description;
+  <methodsynopsis>
+   <modifier>public</modifier> <type>string</type> <methodname>PhpToken::__toString</methodname>
+   <void />
+  </methodsynopsis>
+  <para>
+   トークンの文字列表現を返します。
+  </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+  &reftitle.parameters;
+  &no.function.parameters;
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+  &reftitle.returnvalues;
+  <para>
+   トークンの文字列表現を返します。
+  </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+  &reftitle.examples;
+  <example>
+   <title><function>PhpToken::__toString</function> の例</title>
+   <programlisting role="php">
+<![CDATA[
+<?php
+$token = new PhpToken(T_ECHO, 'echo');
+echo $token;
+]]>
+   </programlisting>
+   &examples.outputs;
+   <screen>
+<![CDATA[
+echo
+]]>
+   </screen>
+  </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+  &reftitle.seealso;
+  <simplelist>
+   <member><function>token_name</function></member>
+  </simplelist>
+ </refsect1>
+</refentry>
+<!-- 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:"~/.phpdoc/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
+-->


Property changes on: phpdoc/ja/trunk/reference/tokenizer/phptoken/toString.xml
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
\ No newline at end of property
Added: phpdoc/ja/trunk/reference/tokenizer/phptoken/tokenize.xml
===================================================================
--- phpdoc/ja/trunk/reference/tokenizer/phptoken/tokenize.xml	                        (rev 0)
+++ phpdoc/ja/trunk/reference/tokenizer/phptoken/tokenize.xml	2020-12-09 13:16:00 UTC (rev 351970)
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+<!-- EN-Revision: 351961 Maintainer: mumumu Status: ready -->
+
+<refentry xml:id="phptoken.tokenize" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+  <refname>PhpToken::tokenize</refname>
+  <refpurpose>ソースコードを PhpToken オブジェクトで表現されたトークンに分割する</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+  &reftitle.description;
+  <methodsynopsis>
+   <modifier>public</modifier> <modifier>static</modifier> <type>array</type> <methodname>PhpToken::tokenize</methodname>
+   <methodparam><type>string</type><parameter>code</parameter></methodparam>
+   <methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
+  </methodsynopsis>
+  <para>
+   与えられた <parameter>code</parameter> を表現する
+   PhpToken オブジェクトの配列を返します。
+  </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+  &reftitle.parameters;
+  <variablelist>
+   <varlistentry>
+     <term><parameter>code</parameter></term>
+     <listitem>
+      <para>
+       パースする PHP のコード。
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><parameter>flags</parameter></term>
+     <listitem>
+      <para>
+       有効なフラグ:
+       <itemizedlist>
+        <listitem>
+         <simpara>
+          <constant>TOKEN_PARSE</constant> - 特定のコンテクストで予約語を認識します。
+         </simpara>
+        </listitem>
+       </itemizedlist>
+      </para>
+     </listitem>
+    </varlistentry>
+  </variablelist>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+  &reftitle.returnvalues;
+  <para>
+   PhpToken、またはそのサブクラスで表現される、PHPトークンの配列を返します。
+   このメソッドの返り値は、PhpToken をシームレスに拡張できるように、
+   <type>static[]</type> 型になっています。
+  </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+  &reftitle.examples;
+  <example>
+   <title><function>PhpToken::tokenize</function> の例</title>
+   <programlisting role="php">
+<![CDATA[
+<?php
+$tokens = PhpToken::tokenize('<?php echo; ?>');
+
+foreach ($tokens as $token) {
+    echo "Line {$token->line}: {$token->getTokenName()} ('{$token->text}')", PHP_EOL;
+}
+]]>
+   </programlisting>
+   &examples.outputs;
+   <screen>
+<![CDATA[
+Line 1: T_OPEN_TAG ('<?php ')
+Line 1: T_ECHO ('echo')
+Line 1: ; (';')
+Line 1: T_WHITESPACE (' ')
+Line 1: T_CLOSE_TAG ('?>')
+]]>
+   </screen>
+  </example>
+  <example>
+   <title>Extending PhpToken</title>
+   <programlisting role="php">
+<![CDATA[
+<?php
+
+class MyPhpToken extends PhpToken {
+    public function getUpperText() {
+        return strtoupper($this->text);
+    }
+}
+
+$tokens = MyPhpToken::tokenize('<?php echo; ?>');
+echo "'{$tokens[0]->getUpperText()}'";
+]]>
+   </programlisting>
+   &examples.outputs;
+   <screen>
+<![CDATA[
+'<?PHP '
+]]>
+   </screen>
+  </example>
+ </refsect1>
+
+ <refsect1 role="seealso">
+  &reftitle.seealso;
+  <simplelist>
+   <member><function>token_get_all</function></member>
+  </simplelist>
+ </refsect1>
+</refentry>
+<!-- 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:"~/.phpdoc/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
+-->


Property changes on: phpdoc/ja/trunk/reference/tokenizer/phptoken/tokenize.xml
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
\ No newline at end of property
Added: phpdoc/ja/trunk/reference/tokenizer/phptoken.xml
===================================================================
--- phpdoc/ja/trunk/reference/tokenizer/phptoken.xml	                        (rev 0)
+++ phpdoc/ja/trunk/reference/tokenizer/phptoken.xml	2020-12-09 13:16:00 UTC (rev 351970)
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+<!-- EN-Revision: 351961 Maintainer: mumumu Status: ready -->
+
+<phpdoc:classref xml:id="class.phptoken" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
+
+ <title>PhpToken クラス</title>
+ <titleabbrev>PhpToken</titleabbrev>
+
+ <partintro>
+
+<!-- {{{ PhpToken intro -->
+  <section xml:id="phptoken.intro">
+   &reftitle.intro;
+   <para>
+    このクラスは、<function>token_get_all</function> 関数の代替です。
+    <function>token_get_all</function> 関数は、トークンを示す一文字、
+    またはトークンのIDの配列、トークンのテキスト、行番号からなる配列を返します。
+    <function>PhpToken::tokenize</function> は、
+    全てのトークンを PhpToken オブジェクトに正規化します。
+    これによって、トークンの操作を行うコードのメモリ使用量が少なくなり、
+    コードが読みやすくなります。
+   </para>
+  </section>
+<!-- }}} -->
+
+  <section xml:id="phptoken.synopsis">
+   &reftitle.classsynopsis;
+
+<!-- {{{ Synopsis -->
+   <classsynopsis>
+    <ooclass><classname>PhpToken</classname></ooclass>
+
+<!-- {{{ Class synopsis -->
+    <classsynopsisinfo>
+     <ooclass>
+      <classname>PhpToken</classname>
+     </ooclass>
+    </classsynopsisinfo>
+<!-- }}} -->
+
+    <classsynopsisinfo role="comment">&Properties;</classsynopsisinfo>
+    <fieldsynopsis>
+     <modifier>public</modifier>
+     <type>int</type>
+     <varname linkend="phptoken.props.id">id</varname>
+    </fieldsynopsis>
+    <fieldsynopsis>
+     <modifier>public</modifier>
+     <type>string</type>
+     <varname linkend="phptoken.props.text">text</varname>
+    </fieldsynopsis>
+    <fieldsynopsis>
+     <modifier>public</modifier>
+     <type>int</type>
+     <varname linkend="phptoken.props.line">line</varname>
+    </fieldsynopsis>
+    <fieldsynopsis>
+     <modifier>public</modifier>
+     <type>int</type>
+     <varname linkend="phptoken.props.pos">pos</varname>
+    </fieldsynopsis>
+
+    <classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
+    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.phptoken')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis)">
+     <xi:fallback />
+    </xi:include>
+    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.phptoken')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis)">
+     <xi:fallback />
+    </xi:include>
+
+   </classsynopsis>
+<!-- }}} -->
+
+  </section>
+
+  <section xml:id="phptoken.props">
+   &reftitle.properties;
+   <variablelist>
+    <varlistentry xml:id="phptoken.props.id">
+     <term><varname>id</varname></term>
+     <listitem>
+      <para>
+      T_* 定数のうちのひとつ。
+      または、
+      一文字のトークンを表す ASCII コードポイント。
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry xml:id="phptoken.props.text">
+     <term><varname>text</varname></term>
+     <listitem>
+      <para>
+      トークンの内容を示すテキスト
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry xml:id="phptoken.props.line">
+     <term><varname>line</varname></term>
+     <listitem>
+      <para>
+      トークンが始まる行番号(1から始まります)
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry xml:id="phptoken.props.pos">
+     <term><varname>pos</varname></term>
+     <listitem>
+      <para>
+       トークン化された文字列内での開始位置(0から始まります)
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </section>
+
+ </partintro>
+
+ &reference.tokenizer.entities.phptoken;
+
+</phpdoc:classref>
+<!-- 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:"~/.phpdoc/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
+-->


Property changes on: phpdoc/ja/trunk/reference/tokenizer/phptoken.xml
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
\ No newline at end of property