OSDN Git Service

原文すべての章に追加.並びに未翻訳部分、ミスで訳していなかった部分の追加.ひとまず終了.
authorrezoo <rezoolab@gmail.com>
Thu, 31 Dec 2009 17:22:22 +0000 (02:22 +0900)
committerrezoo <rezoolab@gmail.com>
Thu, 31 Dec 2009 17:22:22 +0000 (02:22 +0900)
autoconf.rst
build.rst
osh.rst
pervasives.rst
shell.rst
system.rst

index 29a02b1..c674e27 100644 (file)
@@ -4,14 +4,20 @@
 
 14. 自動設定用の変数と関数
 ==================================
+.. OMake standard library provides a number of functions and variables intended to help one write build specifications that need to be capable of autoconfiguring itself to adjust to different build environments.
+
 OMakeの標準ライブラリでは、異なったビルド環境下でのビルドを調整するための、自動設定用のコードを書くことを手助けする、数多くの関数や変数を提供しています。
 
 .. _label14.1:
 
 14.1 汎用的な自動設定関数
 ----------------------------------
+.. The following general-purpose functions can be used to discover the properties of your build environment in a fashion similar to the one used by GNU autoconf tool you may be familiar with. It is recommended that these function be used from an appropriate static. block (see Section 4.14 for more information).
+
 以下にリストしてある汎用的な関数では、あなたの『ビルド環境(the properties of your build environment)』について調べることができます。これらの関数の中には、恐らくあなたがよく知っているであろうGNU autoconfツールによく似ているものも含まれています。また、これらの関数は適切な ``static.`` ブロックで使うことを推奨しています(詳細は ":ref:`label4.14`" を参照してください)。
 
+.. In order to use the following general-purpose functions, you need to have the line included in your OMakefile or OMakeroot. 
+
 以下の汎用的な関数を使うためには、まずあなたの ``OMakeroot`` あるいは ``OMakefile`` ファイルに、以下の一行を追加してください。 ::
 
   open configure/Configure
@@ -29,8 +35,12 @@ OMakeの標準ライブラリでは、異なったビルド環境下でのビル
   ...
   ConfMsgResult(<msg>)
 
+.. The ConfMsgChecking function output message of the form --- Checking <msg>... without any trailing newline. After the test advertized by ConfMsgChecking is performed, the ConfMsgResult function should be used to output the result.
+
 ``ConfMsgChecking`` 関数は ``--- Checking <msg>...`` のような形のメッセージを *改行なしで* 出力します。 ``ConfMsgChecking`` が実行されて、後にテストが終わったときには、 ``ConfMsgResult`` 関数を使って結果を出力すべきです。
 
+.. In certain cases users may want to redefine these function — for example, to use a different output formatting and/or to copy the messages to a log file.
+
 これらの関数を再定義したいという場合があるかもしれません。例えば、出力の形式を異なったものにしたいという場合や、メッセージをログファイルにコピーしたいというような場合です。
 
 例::
@@ -52,6 +62,8 @@ OMakeの標準ライブラリでは、異なったビルド環境下でのビル
   ConfMsgWarn(<msg>)
   ConfMsgError(<msg>)
 
+.. Print a warning or an error message respectively. ConfMsgError would then abort OMake. 
+
 警告やエラーメッセージをそれぞれ表示します。 ``ConfMsgError`` はOMakeを中断させます。
 
 .. index::
@@ -66,8 +78,12 @@ OMakeの標準ライブラリでは、異なったビルド環境下でのビル
   flag = $(ConfMsgYesNo <bool expr>)
   flag = $(ConfMsgFound <bool expr>)
 
+.. The ConfMsgFound function expects to receive a boolean flag describing whether a test previously announced using the ConfMsgChecking function found what it was looking for. ConfMsgFound will output the appropriate result (“found” or “NOT found”) using the ConfMsgResult function and return its argument back.
+
 ``ConfMsgFound`` 関数を使う前にまず ``ConfMsgChecking`` 関数を用いて「コマンドが使用できるかどうか調べます」ということをユーザに伝えます。その後、その結果を真偽値で ``ConfMsgFound`` 関数に渡します。 ``ConfMsgFound`` は結果を適切な形("found"あるいは"NOT found")に直し、 ``ConfMsgResult`` 関数を使って出力します。また引数として渡された結果を、加工しないでそのまま返します。
 
+.. The ConfMsgYesNo function is similar, outputting a simple (“yes” or “NO”). 
+
 ``ConfMsgYesNo`` 関数は ``ConfMsgFound`` と似ていますが、出力がシンプルです("yes"あるいは"NO")。
 
 .. index::
@@ -84,10 +100,16 @@ OMakeの標準ライブラリでは、異なったビルド環境下でのビル
   success = $(TryLinkC <prog_text>)
   success = $(TryRunC <prog_text>)
 
+.. Given the text of a C program, the TryCompileC, TryLinkC, and TryRunC functions would try to compile / compile and link / compile, link, and run, the given program and return a boolean flag indicating whether the attempt was successful.
+
 Cプログラムの *コード* を引数として渡します。 ``TryCompileC`` , ``TryLinkC`` , ``TryRunC`` 関数は与えられた引数を『コンパイル/コンパイルとリンク/コンパイルとリンクと実行』できるかどうか試します。テストが成功した場合、この関数は真を返します。一方で、失敗した場合は偽を返します。
 
+.. TryCompileC will use the CC, CFLAGS and INCLUDES variables to run the C compiler. TryLinkC and TryRunC will also use the LDFLAGS variable to run the C compiler and linker. However, the flags like /WX, -Werror and -warn-error will be not be passed to the compiler, even if they occur in CFLAGS.
+
 ``TryCompileC`` はCコンパイラを実行するときに ``CC`` , ``CFLAGS`` , ``INCLUDES`` 変数を使用します。 ``TryLinkC`` と ``TryRunC`` はそれに加えて ``LDFLAGS`` 変数を、Cコンパイラとリンカを実行するときに使用します。しかし、 ``/WX`` , ``-Werror`` , ``-warn-error`` のようなフラグは、たとえ ``CFLAGS`` 変数に含まれていたとしても、コンパイラに渡されることはありません。
 
+.. These functions are silent and should normally be used with an appropriate ConfMsgChecking … ConfMsgResult. 
+
 これらの関数は結果を表示しません。また、通常の場合は適切な ``ConfMsgChecking`` ~ ``ConfMsgResult`` 間で使用すべきです。
 
 .. index::
@@ -100,6 +122,8 @@ Cプログラムの *コード* を引数として渡します。 ``TryCompileC`
 
   output = $(RunCProg <prog>)
 
+.. RunCProg is similar to the RunCProg function, except that it returns the output of the function (will return false if the program fails to compile or run). 
+
 ``RunCProg`` 関数は ``TryRunC`` 関数と似ていますが、この関数はプログラムの出力を返します(プログラムのコンパイルや実行に失敗した場合は ``false`` が返されます)。
 
 (訳注: 原文では "RunCProg is similar to the RunCProg function, ..." となっていましたが、恐らくこれはTryRunCの間違いではないかと思われます)
@@ -116,8 +140,12 @@ Cプログラムの *コード* を引数として渡します。 ``TryCompileC`
   success = $(CheckCHeader <files>)
   success = $(VerboseCheckCHeader <files>)
 
+.. Use the TryCompileC function to check whether your C compiler can locate and process the specified headers files. Will incude <stdio.h> before including the header files.
+
 ``TryCompileC`` 関数を用いることで、あなたのCコンパイラが指定したヘッダファイルの位置をつきとめ、さらに処理できるかどうか調べることができます。 ``TryCompileC`` 関数はヘッダファイルをインクルードする前に ``<stdio.h>`` をインクルードします。
 
+.. Both functions return a boolean value. The CheckCHeader function is silent; the VerboseCheckCHeader function will use the ConfMsgChecking and ConfMsgResult functions to describe the test and the outcome.
+
 両方の関数は真偽値を返します。 ``CheckCHeader`` 関数は結果を表示しません。 ``VerboseCheckCHeader`` 関数はテストと結果を表示するのに ``ConfMsgChecking`` と ``ConfMsgResult`` 関数を使います。
 
 例::
@@ -137,8 +165,12 @@ Cプログラムの *コード* を引数として渡します。 ``TryCompileC`
   success = $(CheckCLib <libs>, <functions>)
   success = $(VerboseCheckCLib <libs>, <functions>)
 
+.. Use the TryLinkC function to check whether your C compiler and linker can find the named functions when linking with the named libraries. Will pass the <libs> to the compiler using the -l flag.
+
 ``TryLinkC`` 関数を用いることで、与えられたライブラリのリンク時に、あなたのCコンパイラとリンカが、与えられた関数を見つけられるかどうか調べることができます。 ``TryLinkC`` 関数は ``-l`` フラグを使ってコンパイラに ``<libs>`` を渡します。
 
+.. Both functions return a boolean value. The CheckCLib function is silent; the VerboseCheckCHeader function will use the ConfMsgChecking and ConfMsgResult functions to describe the test and the outcome.
+
 両方の関数は真偽値を返します。 ``CheckCLib`` 関数は結果を表示しません。 ``VerboseCheckCLib`` 関数はテストと結果を表示するのに ``ConfMsgChecking`` と ``ConfMsgResult`` 関数を使います。
 
 例::
@@ -156,6 +188,8 @@ Cプログラムの *コード* を引数として渡します。 ``TryCompileC`
 
   success = $(CheckProg <prog>)
 
+.. Checks whether the program <prog> exists in your path. Will use the ConfMsgChecking and ConfMsgResult functions to describe the test and the outcome.
+
 あなたのパス中に ``<prog>`` が存在しているかどうかを調べます。この関数はテストと結果を表示するのに ``ConfMsgChecking`` と ``ConfMsgResult`` 関数を使います。
 
 .. index::
@@ -170,8 +204,18 @@ Cプログラムの *コード* を引数として渡します。 ``TryCompileC`
 
 14.2 ``autoconf`` スクリプトをOMake用に翻訳する
 --------------------------------------------------
+.. Some of the functions described above are very similar to the ones present in autoconf. Below is a brief translation table for such functions. 
+
 上の関数のいくつかは、 ``autoconf`` に存在しているものと非常に似ています。以下はそのような関数のための簡単な翻訳テーブルです。
 
+.. AC_MSG_CHECKING is very similar to ConfMsgChecking function. 
+   AC_MSG_RESULT is very similar to ConfMsgResult function. 
+   AC_MSG_WARN is very similar to ConfMsgWarn function. 
+   AC_MSG_ERROR is very similar to ConfMsgError function. 
+   AC_TRY_COMPILE is somewhat similar to TryCompileC function, except the TryCompileC function returns a boolean value and only works for C. Similarly,
+   AC_TRY_LINK is approximated by TryLinkC function, and 
+   AC_TRY_RUN is approximated by TryRunC function. 
+
 * ``AC_MSG_CHECKING`` は ``ConfMsgChecking`` 関数と非常に似ています。
 * ``AC_MSG_RESULT`` は ``ConfMsgResult`` 関数と非常に似ています。
 * ``AC_MSG_WARN`` は ``ConfMsgWarn`` 関数と非常に似ています。
@@ -184,6 +228,8 @@ Cプログラムの *コード* を引数として渡します。 ``TryCompileC`
 
 14.3 事前に用意された設定テスト
 ------------------------------------------
+.. A number of configuration tests are already included in the standard library. In order to use them in your project, simply open (see Section 4.7) the corresponding build file in your OMakefile and the tests will run the first time OMake is executed. Note that it is not a problem to open these files from more than one place in your project — if you do that, the test will still run only once. 
+
 OMakeでは数多くの設定テスト(configuration tests)が標準ライブラリに含まれています。あなたのプロジェクトでこれらを使うためには、単純に対象の ``OMakefile`` に、設定テストを記述したビルドファイルを『 ``open`` (詳細は ":ref:`label4.7`" を参照してください)』するだけです。そうすれば、OMakeを初めて実行した時点で設定テストが実行されます。これは、あなたのプロジェクト上で二回以上設定テストが ``open`` されるわけではない点に注意してください。たとえ二回以上呼び出したとしても、このテストは一回だけしか実行されません。
 
 .. index::
@@ -195,22 +241,32 @@ OMakeでは数多くの設定テスト(configuration tests)が標準ライブラ
 
 14.3.1 NCursesライブラリの設定
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. Add open configure/ncurses line to your OMakefile to get access to the following autoconfiguration variables. 
+
 あなたの ``OMakefile`` に ``open configure/ncurses`` を加えることで、以下の自動設定変数を利用できます。
 
 * **NCURSES_AVAILABLE**
   
+  .. A boolean flag that would be set when both the curses.h header, the term.h header, and the ncurses library very found.
+  
   ``curses.h`` , ``term.h`` ヘッダファイルと ``ncurses`` ライブラリが見つかった場合に真となる真偽値
 
 * **NCURSES_TERMH_IN_NCURSES**
   
+  .. A boolean flag that would be set when term.h has to be included as <ncurses/term.h> instead of <term.h>.
+  
   ``term.h`` が ``<term.h>`` の代わりに ``<ncurses/term.h>`` としてインクルードされていた場合に真となる真偽値
 
 * **NCURSES_CFLAGS**
   
+  .. The CFLAGS to use when compiling ncurses code. Will include -DNCURSES and -DTERMH_IN_NCURSES, respectively when NCURSES_AVAILABLE and NCURSES_TERMH_IN_NCURSES are true.
+  
   ncursesコードをコンパイルする際に用いる ``CFLAGS`` の値。 ``NCURSES_AVAILABLE`` と ``NCURSES_TERMH_IN_NCURSES`` がそれぞれ真である場合には ``-DNCURSES`` と ``-DTERMH_IN_NCURSES`` が含まれます。
 
 * **NCURSES_CLIBS**
   
+  .. The LDFLAGS to use when linking ncurses code. Will normally contain -lncurses when ncurses is found and remain empty otherwise. 
+  
   ncursesコードをリンクする際に用いる ``LDFLAGS`` の値。ncursesが見つかって、それ以外が空のままである場合には通常 ``-lncurses`` が含まれます。
 
 .. index::
@@ -222,22 +278,32 @@ OMakeでは数多くの設定テスト(configuration tests)が標準ライブラ
 
 14.3.2 ReadLineライブラリの設定
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. Add open configure/readline line to your OMakefile to get access to the following autoconfiguration variables. 
+
 あなたの ``OMakefile`` に ``open configure/readline`` を加えることで、以下の自動設定変数を利用できます。
 
 * **READLINE_AVAILABLE**
   
+  .. A boolean flag that would be set when both the readline/readline.h header, the readline/history.h header, and the readline library very found.
+  
   ``readline/readline.h`` , ``readline/history.h`` ヘッダと ``readline`` ライブラリが見つかった場合に真となる真偽値
 
 * **READLINE_GNU**
   
+  .. A boolean flag that would be set when the GNU version of the readline library is found (as opposed to the BSD one).
+  
   readlineライブラリのGNUバージョン(BSDバージョンではなく)が見つかった場合に真となる真偽値
 
 * **READLINE_CFLAGS**
   
+  .. The CFLAGS to use when compiling readline code. Will include -DREADLINE_ENABLED and -DREADLINE_GNU, respectively when READLINE_AVAILABLE and READLINE_GNU are true.
+  
   readlineコードをコンパイルする際に用いる ``CFLAGS`` の値。 ``READLINE_AVAILABLE`` と ``READLINE_GNU`` がそれぞれ真である場合には ``-DREADLINE_ENABLED`` と ``-DREADLINE_GNU`` が含まれます。
 
 * **READLINE_CLIBS**
   
+  .. The LDFLAGS to use when linking readline code. Will normally contain -lncurses -lreadline when readline is found and remain empty otherwise. 
+  
   readlineコードをリンクする際に用いる ``LDFLAGS`` の値。readlineが見つかって、それ以外が空である場合には通常 ``-lncurses -lreadline`` が含まれます。
 
 .. index::
@@ -246,8 +312,12 @@ OMakeでは数多くの設定テスト(configuration tests)が標準ライブラ
 
 14.3.3 Snprintfの設定
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. Add open configure/snprintf line to your OMakefile to get access to the following autoconfiguration variables.
+
 あなたの ``OMakefile`` に ``open configure/snprintf`` を加えることで、以下の自動設定変数を利用できます。
 
 * **SNPRINTF_AVAILABLE**
   
+  .. A boolean flag telling whether the snprintf function is available in the standard C library.
+  
   標準Cライブラリでsnprintf関数が利用可能であるかどうかを示す真偽値
index 611b9a9..3c19c2c 100644 (file)
--- a/build.rst
+++ b/build.rst
 
 13.1 ビルドイン .PHONY ターゲット
 --------------------------------------
+.. The complete set of builtin .PHONY targets include the following.
+
 以下にビルドイン ``.PHONY`` ターゲットの完全なリストを示します。
 
 * **.PHONY**
-
+  
+  .. Declares new phony targets (Section 8.10). 
+  
   新しいphonyターゲットを宣言します。(:ref:`label8.10`)
 
 * **.DEFAULT**
   
+  .. Declare the default build targets (Section 8.7). 
+  
   デフォルトのビルドターゲットを宣言します。(:ref:`label8.7`)
 
 * **.SUBDIRS**
   
+  .. Include a directory as part of the project (Section 8.8). 
+  
+  プロジェクトの一部としてディレクトリをインクルードします。(:ref:`label8.8`)
+
+* **.SCANNER**
+  
+  .. Define a dependency scanner (Section 8.8). 
+  
   依存関係のスキャナを定義します。(:ref:`label8.8`)
 
+* **.INCLUDE**
+  
+  .. Include a file (Section 8.9). 
+  
+  ファイルをインクルードします。(:ref:`label8.9`)
+
 * **.ORDER**
   
+  .. Define a file-dependency ordering rule (Section 10.3.6).
+  
   ファイルの依存関係ルールの順番を定義します。(:ref:`label10.3.6`)
 
 * **.BUILD_BEGIN**
   
+  .. Commands to be executed at the beginning of a build. 
+  
   ビルド開始時に実行されるコマンド
 
 * **.BUILD_SUCCESS**
   
+  .. Commands to be executed if the build is successful. 
+  
   ビルドが成功したときに実行されるコマンド
 
 * **.BUILD_FAILURE**
   
+  .. Commands to be executed if the build fails. 
+  
   ビルドが失敗したときに実行されるコマンド
 
+.. The .BUILD targets can be used to specify commands to be executed at the beginning and end of the build. The .BUILD_BEGIN target is built at the beginning of a project build, and one of .BUILD_FAILURE or .BUILD_SUCCESS is executed when the build terminates.
+
 ``.BUILD`` ターゲットはビルドの開始と終了時に実行されるコマンドを指定するために用いられます。 ``.BUILD_BEGIN`` ターゲットはプロジェクトをビルドする前に実行され、 ``.BUILD_FAILURE`` または ``.BUILD_SUCCESS`` はビルドが終了したときに実行されます。
 
+.. For example, the following set of rules simply print additional messages about the status of the build.
+
 例えば、以下のルールの集合はビルドの状況について、簡単なメッセージを表示します。 ::
 
    .BUILD_BEGIN:
    .BUILD_FAILURE:
        println($"The build failed: $(length $(find-build-targets Failed)) targets could not be built")
 
+.. Another common use is to define notifications to be performed when the build completes. For example, the following rule will create a new X terminal displaying the summary of the build (using the BUILD_SUMMARY variable).
+
 通常用いる別の使い方としては、ビルドが完了したときに通知するように定義するという方法があります。例えば、以下のルールでは(BUILD_SUMMARY変数を使うことで)ビルドの要約を新しいXターミナル上に表示します。 ::
 
     .BUILD_FAILURE:
         xterm -e vi $(BUILD_SUMMARY)
 
+.. If you do not wish to add these rules directly to your project (which is probably a good idea if you work with others), you can define them in your .omakerc (see Section A.8).
+
 あなたがプロジェクトに直接これらのルールを追加したくない場合(もしあなたが他の場所で実行するなら、これはよいアイデアです)、あなたはこれらのルールを ``.omakerc`` に定義することができます(詳細はA.8を参照してください)。
 
+.. The find-build-targets function is useful for obtaining a firther summary of the build. Note that when output diversions are in effect (with the --output-* options — see Chapter A), any output produced by the commands is copied to a file. The name of the file is specified by the output-file field of the Target object. You may find this useful in defining custom build summaries. 
+
 ``find-build-targets`` 関数はさらに具体的なビルドの状況を取得したいときに有用です。 ``--output-*`` オプションを使って出力先を変更している場合、コマンドによって生成された出力はファイルにコピーされることに注意してください。ファイル名は ``Target`` オブジェクトの ``output-file`` プロパティによって指定されます。あなたはビルドの状況をカスタマイズしたいときに、この方法を試してみてください。
 
 .. _label13.2:
    OMakeFlags(options)
       options : String
 
+.. The OMakeFlags function is used to set omake options from within OMakefiles. The options have exactly the same format as options on the command line.
+
 ``OMakeFlags`` 関数はOMakefileの内部で ``omake`` のオプションを設定したいときに用いられます。オプションはコマンドライン上でのオプション指定と全く同じフォーマットで指定します。
 
+.. For example, the following code displays the progress bar unless the VERBOSE environment variable is defined.
+
 例えば、以下のコードは ``VERBOSE`` 環境変数が定義されるまで、プログレスバーを表示し続けます。 ::
 
     if $(not $(defined-env VERBOSE))
    OMakeVersion(version1, version2)
       version1, version2 : String
 
+.. The OMakeVersion function is used for version checking in OMakefiles. It takes one or two arguments.
+
 ``OMakeVersion`` 関数はOMakefileのバージョンをチェックするときに用いられます。この関数は1つ、または2つの引数を取ります。
 
+.. In the one argument form, if the omake version number is less than <version1>, then an exception is raised. In the two argument form, the version must lie between version1 and version2.
+
 1つの引数をとる形では、omakeのバージョン番号が ``<version1>`` よりも低いときに例外を送出します。2つ引数をとる形では、omakeのバージョン番号は ``version1`` と ``version2`` の間になければなりません。
 
 .. index::
    $(cmp-versions version1, version2)
       version1, version2 : String
 
+.. The cmp-versions\ functions can be used to compare arbitrary version strings. It returns 0 when the two version strings are equal, a negative number when the first string represents an earlier version, and a positive number otherwise. 
+
 ``cmp-versions`` 関数は任意のバージョン文字列を比較することができます。2つのバージョン文字列が等しいときには、この関数は0を返します。一方で、最初の文字列が2番めよりも若いバージョンであるときには負の値を返し、そのいづれでもないときには正の値を返します。
 
 .. index::
 
    DefineCommandVars()
 
+.. The DefineCommandVars function redefines the variables passed on the commandline. Variables definitions are passed on the command line in the form name=value. This function is primarily for internal use by omake to define these variables for the first time. 
+
 ``DefineCommandVars`` 関数はコマンドライン上から受け渡した変数を再定義します。変数定義はコマンドラインから ``name=value`` の形で受け渡されます。この関数は、これらの変数を最初の時点で定義するため、omakeが内部で使用します。
 
 .. _label13.3:
       targets : File Array
    raises RuntimeException
 
+.. The dependencies function returns the set of immediate dependencies of the given targets. This function can only be used within a rule body and all the arguments to the dependency function must also be dependencies of this rule. This restriction ensures that all the dependencies are known when this function is executed.
+
 ``dependencies`` 関数は与えられたターゲットの明示的な依存関係の集合を返します。この関数はルールの本体だけに使うことができます。さらに、 ``dependency`` 関数のすべての引数は、このルールの依存先でなければいけません。この制約は、関数が実行されたときにすべての依存関係が解析されていることを保証してくれます。
 
+.. The dependencies-all function is similar, but it expands the dependencies recursively, returning all of the dependencies of a target, not just the immediate ones.
+
 ``dependencies-all`` 関数は似ていますが、この関数は依存関係を再帰的に展開し、明示的な依存関係だけでなくターゲットの依存関係すべてを返してくれます。
 
+.. The dependencies-proper function returns all recursive dependencies, except the dependencies that are leaf targets. A leaf target is a target that has no dependencies and no build commands; a leaf target corresponds to a source file in the current project.
+
 ``dependencies-proper`` 関数は『末端』となる依存先を除く、すべての依存関係を再帰的に返します。『末端』のターゲットは依存先やビルドコマンドが存在しないターゲット、つまり、現在のプロジェクト上にあるソースファイルの集合を指しています。
 
+.. In all three functions, files that are not part of the current project are silently discarded. All three functions will return phony and scanner targets along with the “real” ones.
+
 この3つの関数では、現在のプロジェクトの一部でないファイルは無視されます。また、3つの関数はすべて『実際のファイル』に関連しているphonyやscannerターゲットも返します。
 
+.. One purpose of the dependencies-proper function is for “clean” targets. For example, one way to delete all intermediate files in a build is with a rule that uses the dependencies-proper. Note however, that the rule requires building the project before it can be deleted.
+
 ``dependencies-proper`` 関数を使う一つの目的としては"clean"ターゲットを実装することが挙げられます。例えば、ビルドしたすべての明示的なファイルを削除する一つの方法としては、 ``dependencies-proper`` をルール部分に使うことです。しかしながら、このルールでは消去する前にプロジェクトをビルドすることが必要となってきます。 ::
 
     .PHONY: clean
     clean: $(APP)
        rm -f $(dependencies-proper $(APP))
 
+.. Also note that the dependencies-proper function will return the phony and scanner targets in addition to real one.
+
 ``dependencies-proper`` 関数はまた、実際のファイルに加えてphonyやscannerターゲットも返してしまうことに注意してください。
 
+.. For other (possibly better) alternatives, see Section 10.3.3 and filter-proper-targets function. 
+
 (さらにより良く実装している)別のサンプルについては、 :ref:`label10.3.3` か ``filter-proper-targets`` 関数を参照してください。
 
 .. index::
       targets : File Sequence
    raises RuntimeException
 
+.. The target function returns the Target object associated with each of the targets. See the Target object for more information. 
+
 ``target`` 関数はそれぞれのターゲットに関連しているTargetオブジェクトを返します。詳細な情報は ``Target`` オブジェクトを参照してください。
 
 .. index::
     $(find-build-targets tag) : Target Array
        tag : Succeeded | Failed
 
+.. The find-build-targets allow the results of the build to be examined. The tag must specifies which targets are to be returned; the comparison is case-insensitive.
+
 ``find-build-targets`` はビルドの実行結果を返します。 ``tag`` では、どのターゲットを返すべきなのかについて指定します。結果は ``tag`` の場合によって異なります。
 
 * **Succeeded**
   
+  .. The list of targets that were built successfully. 
+  
   ビルドが成功したターゲットのリスト
 
 * **Failed**
   
+  .. The list of targets that could not be built. 
+  
   ビルドできなかったターゲットのリスト
 
+.. These are used mainly in conjuction with the .BUILD_SUCCESS (Section 13.1) and .BUILD_FAILURE (Section 13.1) phony targets. For example, adding the following to your project OMakefile will print the number of targets that failed (if the build failed).
+
 これらは主に ``.BUILD_SUCCESS`` や ``.BUILD_FAILURE`` phonyターゲットと一緒に使われます。例えば、あなたのプロジェクトの ``OMakefile`` に以下を加えることで、(ビルドが失敗したときに)失敗したターゲットの数を表示します。 ::
 
     .BUILD_FAILURE:
 
    $(project-directories) : Dir Array
 
+.. The project-directories function returns the list of all directories that are considered to be part of the project.
+
 ``project-directories`` 関数はプロジェクトの一部であると考えられる、すべてのディレクトリのリストを返します。
 
+.. To get the complete directory list, this function should be called from within a rule body. 
+
 完全なディレクトリのリストを取得するためには、この関数をルールの本体で呼び出すべきです。
 
 .. index::
 
 13.3.5 rule
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. The rule function is called whenever a build rule is defined. It is unlikely that you will need to redefine this function, except in very exceptional cases.
+
 ``rule`` 関数はビルドルールが定義されたときにいつでも呼び出されます。非常に特別なケースを除いて、あなたはこの関数を再定義すべきではありません。 ::
 
    rule(multiple, target, pattern, sources, options, body) : Rule
       options  : Array
       body     : Body
 
+.. The rule function is called when a rule is evaluated.
+
 ``rule`` 関数はルールが評価されたときに呼び出されます。
 
 * **multiple**
   
+  .. A Boolean value indicating whether the rule was defined with a double colon ::. 
+  
   ルールがダブルコロン ``::`` を用いて定義されているかどうかを示しています。
 
 * **target**
   
+  .. The sequence of target names. 
+  
   ターゲット名のシーケンスです。
 
 * **pattern**
-
+  
+  .. The sequence of patterns. This sequence will be empty for two-part rules. 
+  
   パターンのシーケンスです。このシーケンスは通常の2パートのルール定義のときには空となります。
 
 * **sources**
-
+  
+  .. The sequence of dependencies. 
+  
   依存関係のシーケンスです。
 
 * **options**
-
+  
+  .. An array of options. Each option is represented as a Map object associating each specified option with a value. 
+  
   オプションの配列です。各々のオプションは、オプション名と値が関連付けられている ``Map`` (辞書型の)オブジェクトとして表現されます。
 
 * **body**
-
+  
+  .. The body expression of the rule. 
+  
   ルールの内容を表しています。
 
+.. Consider the following rule.
+
 以下のルールを考えてみましょう。 ::
 
    target: pattern: sources :name1: option1 :name2: option2
       expr1
       expr2
 
+.. This expression represents the following function call, where square brackets are used to indicate arrays, and the curly brackets represent a Map object.
+
 上の式はまず以下の関数の呼び出しに置き換えられ、[]は配列を指定するために用いられ、さらに{}はMapオブジェクトに置き換わります。 ::
 
    rule(false, target, pattern, sources,
 
     build(targets : File Array) : bool
 
+.. Build the given targets. The value is true iff the build was successful. This function can be used only in osh. 
+
 与えられたターゲットをビルドします。ビルドが成功した場合、この関数は真を返します。この関数は ``osh`` 上でのみ使うことができます。
 
 .. _label13.4:
 
 13.4 OMakerootファイル
 --------------------------------------
+.. The standard OMakeroot file defines the functions are rules for building standard projects.
+
 標準のOMakerootファイルでは、普通のプロジェクトをビルドするためのルール関数を定義しています。
 
 .. index::
 
 13.4.1 変数
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-* **ROOT** : 現在のプロジェクトのルートディレクトリ
-* **CWD** : カレント作業ディレクトリ(このディレクトリは、プロジェクトにある各々のOMakefileの集合です)
-* **EMPTY** : 空文字列
-* **STDROOT** : 標準でインストールされているOMakerootのファイル名
-* **ABORT_ON_COMMAND_ERROR** : trueに設定した場合、たとえコマンドの一つがビルドに失敗したとしても、ターゲットはそれを無視します。デフォルトの値はtrueで、通常はそのままにしておくべきです。
+* **ROOT**
+  
+  .. The root directory of the current project. 
+  
+  現在のプロジェクトのルートディレクトリ
+
+* **CWD**
+  
+  .. The current working directory (the directory is set for each OMakefile in the project). 
+  
+  カレント作業ディレクトリ(このディレクトリは、プロジェクトにある各々のOMakefileの集合です)
+
+* **EMPTY**
+  
+  .. The empty string. 
+  
+  空文字列
+
+* **STDROOT**
+  
+  .. The name of the standard installed OMakeroot file. 
+  
+  標準でインストールされているOMakerootのファイル名
+
+* **ABORT_ON_COMMAND_ERROR**
+  
+  .. If set to true, the construction of a target should be aborted whenever one of the commands to build it fail. This defaults to true, and should normally be left that way.
+  
+  trueに設定した場合、たとえコマンドの一つがビルドに失敗したとしても、ターゲットはそれを無視します。デフォルトの値はtrueで、通常はそのままにしておくべきです。
+
 * **SCANNER_MODE**
   
+  .. This variable should be defined as one of four values (defaults to enabled). 
+  
   この変数は以下の4つの値のうちの1つを選んで定義する必要があります(デフォルトは ``enabled`` です)。
   
   * **enabled**
     
+    .. Allow the use of default .SCANNER rules. Whenever a rule does not specify a :scanner: dependency explicitly, try to find a .SCANNER with the same target name. 
+    
     デフォルトの ``.SCANNER`` ルールを使うことを許可します。たとえルールが明示的に ``:scanner:`` 依存関係を指定していなくても、omakeは同じ名前のターゲットから ``.SCANNER`` を検索します。
   
   * **disabled**
     
+    .. Never use default .SCANNER rules. 
+    
     デフォルトの ``.SCANNER`` ルールを使いません。
   
   * **warning**
     
+    .. Allow the use of default .SCANNER rules, but print a warning whenever one is selected. 
+    
     デフォルトの ``.SCANNER`` ルールを使うことを許可しますが、そのうちの一つを使うことになったとき、omakeは常に警告を表示します。
   
   * **error**
     
+    .. Do not allow the use of default .SCANNER rules. If a rule does not specify a :scanner: dependency, and there is a default .SCANNER rule, the build will terminate abnormally. 
+    
     デフォルトの ``.SCANNER`` ルールを使うことを許可しません。もしルールが明示的に ``:scanner:`` 依存関係をしておらず、さらにデフォルトの ``.SCANNER`` を使うことになったとき、このルールのビルドは異常終了します。
 
 .. index::
 
 13.4.2 システム変数
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. The command to install a program (install on Unix, cp on Win32). 
+   The normal path separator (: on Unix, ; on Win32). 
+   The normal directory separator (/ on Unix, \ on Win32). 
+   File suffix for an object file (default is .o on Unix, and .obj on Win32).
+   File suffix for a static library (default is .a on Unix, and .lib on Win32). 
+   File suffix for a shared library (default is .so on Unix, and .dll on Win32).
+   File suffix for an assembly file (default is .s on Unix, and .asm on Win32).
+   File suffix for executables (default is empty for Unix, and .exe on Win32 and Cygwin).
+
 * **INSTALL** : プログラムをインストールするためのコマンド( ``Unix`` は ``install`` 、 ``Win32`` は ``cp``)
 * **PATHSEP** : 通常用いるパスのセパレータ( ``Unix`` は ``:`` 、 ``Win32`` は ``;``)
 * **DIRSEP** : 通常用いるディレクトリのセパレータ( ``Unix`` は ``/`` 、 ``Win32`` は ``\``)
 
 13.5 C/C++コードのビルド
 --------------------------------------
+.. OMake provides extensive support for building C and C++ programs. In order to use the functions defined in this section, you need to make sure the line is present in your OMakeroot file.
+
 OMakeではCやC++のプログラムのビルドを広範囲にわたってサポートする機能を提供しています。このセクションで列挙している関数を使うためには、まずあなたの ``OMakeroot`` ファイルに、以下の一行を追加してください。 ::
 
   open build/C
@@ -373,10 +521,16 @@ OMakeではCやC++のプログラムのビルドを広範囲にわたってサ
 
 13.5.1 自動設定変数(Autoconfiguration variables)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. These variables will get defined based on the “autoconf-style” static. tests executed when you run OMake for the first time. You can use them to configure your project accordingly, and you should not redefine them.
+
 これらの変数はまず最初にOMakeを実行した時点で『自動設定スタイル(autoconf-style)』 ``static.`` が実行され、その結果を元に決定されます。あなたのプロジェクトを調和の取れた状態にするためには、これらの変数を使用してください。また、あなたはこれらの変数を再定義すべきではありません。
 
+.. You can use the --configure command line option (Section A.3.9) to force re-execution of all the tests.
+
 あなたは強制的にすべてのテストを実行させるために、 ``--configure`` コマンドラインオプション(A.3.9を参照)を使うことができます。
 
+.. A different set of autoconfiguration tests is performed depending on the build environment involved — one set of tests would be performed in a Win32 environment, and another — in a Unix-like environment (including Linux, OS X and Cygwin).
+
 これらの自動設定変数の値はビルドする環境に依存します。これらの変数の一部は ``Win32`` の環境下と、(Linux, OS X, Cygwinを含む)Unixライクな環境下では異なるふるまいをします。
 
 .. index::
@@ -386,6 +540,9 @@ OMakeではCやC++のプログラムのビルドを広範囲にわたってサ
 
 13.5.1.1 Unixライクなシステム
 """"""""""""""""""""""""""""""""""""""
+.. A boolean flag specifying whether the gcc binary was found in your path. 
+   A boolean flag specifying whether the g++ binary was found in your path.
+
 * **GCC_FOUND** : ``gcc`` バイナリを発見したかどうかを示す真偽値
 * **GXX_FOUND** : ``g++`` バイナリを発見したかどうかを示す真偽値
 
@@ -396,6 +553,9 @@ OMakeではCやC++のプログラムのビルドを広範囲にわたってサ
 
 13.5.1.2 Win32
 """"""""""""""""""""""""""""""""""""""
+.. A boolean flag specifying whether the cl binary was found in your path. 
+   A boolean flag specifying whether the lib binary was found in your path.
+
 * **CL_FOUND** : ``cl`` バイナリを発見したかどうかを示す真偽値
 * **LIB_FOUND** : ``lib`` バイナリを発見したかどうかを示す真偽値
 
@@ -422,82 +582,124 @@ OMakeではCやC++のプログラムのビルドを広範囲にわたってサ
 
 13.5.2 C/C++用の設定変数
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-* **CC**
+.. The following variables can be redefined in your project.
 
+以下の変数があなたのプロジェクト上で定義されています。
+
+* **CC**
+  
+  .. The name of the C compiler (on Unix it defaults to gcc when gcc is present and to cc otherwise; on Win32 defaults to cl /nologo).
+  
   Cコンパイラの名前( ``Unix`` では ``gcc`` が発見されたときはデフォルトの値として ``gcc`` が使われます。そうでない場合は ``cc`` が使われます。 ``Win32`` ではデフォルトの値は ``cl /nologo`` です。)
 
 * **CXX**
   
+  .. The name of the C++ compiler (on Unix it defaults to gcc when gcc is present and to c++ otherwise; on Win32 defaults to cl /nologo). 
+  
   C++コンパイラの名前( ``Unix`` では ``gcc`` が発見されたときはデフォルトの値として ``gcc`` が使われます。そうでない場合は ``c++`` が使われます。 ``Win32`` ではデフォルトの値は ``cl /nologo`` です。)
 
 * **CPP**
   
+  .. The name of the C preprocessor (defaults to cpp on Unix, and cl /E on Win32). 
+  
   Cプリプロセッサの名前( ``Unix`` ではデフォルトの値は ``cpp`` 、 ``Win32`` の場合は ``cl /E`` )
 
 * **CFLAGS**
-
+  
+  .. Compilation flags to pass to the C compiler (default empty on Unix, and /DWIN32 on Win32). 
+  
   Cコンパイラに渡すコンパイルフラグ( ``Unix`` ではデフォルトの値は空文字列、 ``Win32`` の場合は ``/DWIN32`` )
 
 * **CXXFLAGS**
   
+  .. Compilation flags to pass to the C++ compiler (default empty on Unix, and /DWIN32 on Win32). 
+  
   C++コンパイラに渡すコンパイルフラグ( ``Unix`` ではデフォルトの値は空文字列、 ``Win32`` の場合は ``/DWIN32`` )
 
 * **INCLUDES**
-
+  
+  .. Additional directories that specify the search path to the C and C++ compilers (default is .). The directories are passed to the C and C++ compilers with the -I option. The include path with -I prefixes is defined in the PREFIXED_INCLUDES variable. 
+  
   C/C++コンパイラに渡す、追加する検索パスを指定しているディレクトリの値(デフォルトの値は ``.`` )。これらのディレクトリは ``-I`` オプションを追加してC/C++コンパイラに受け渡されます。また、 ``-I`` 接頭辞を追加したインクルードパスは ``PREFIXED_INCLUDES`` 変数で定義されます。
 
 * **LIBS**
   
+  .. Additional libraries needed when building a program (default is empty). 
+  
   プログラムをビルドするときに必要となる追加ライブラリ(デフォルトの値は空文字列)
 
 * **CCOUT**
   
+  .. The option to use for specifying the output file in C and C++ compilers (defaults to -o on Unix and /Fo on Win32). 
+  
   C/C++コンパイラの出力ファイルの場所を指定するオプション( ``Unix`` ではデフォルトの値は ``-o`` 、 ``Win32`` の場合は ``/Fo`` )
 
 * **AS**
   
+  .. The name of the assembler (defaults to as on Unix, and ml on Win32)
+  
   アセンブラの名前( ``Unix`` ではデフォルトの値は ``as`` 、 ``Win32`` の場合は ``ml`` )
 
 * **ASFLAGS**
   
+  .. Flags to pass to the assembler (default is empty on Unix, and /c /coff on Win32). 
+  
   アセンブラに渡すフラグ( ``Unix`` ではデフォルトの値は空文字列、 ``Win32`` の場合は ``/c /coff`` )
 
 * **ASOUT**
   
+  .. The option string that specifies the output file for AS (defaults to -o on Unix and /Fo on Win32). 
+  
   ``AS`` の出力ファイルの場所を指定するオプション文字列( ``Unix`` ではデフォルトの値は ``-o`` 、 ``Win32`` の場合は ``/Fo`` )
 
 * **AR**
   
+  .. The name of the program to create static libraries (defaults to ar cq on Unix, and lib on Win32). 
+  
   静的ライブラリを生成するためのプログラム名( ``Unix`` ではデフォルトの値は ``ar cq`` 、 ``Win32`` の場合は ``lib`` )
 
 * **LD**
   
+  .. The name of the linker (defaults to ld on Unix, and cl on Win32). 
+  
   リンカの名前( ``Unix`` ではデフォルトの値は ``ld`` 、 ``Win32`` の場合は ``cl`` )
 
 * **LDFLAGS**
   
+  .. Options to pass to the linker (default is empty). 
+  
   リンカに渡すオプション(デフォルトの値は空文字列)
 
 * **LDFLAGS_DLL**
   
+  .. Options to pass to the linker when compiling a shared library (defaults to -shared on Unix and /DLL on Win32). 
+  
   共有ライブラリをコンパイルするときにリンカに受け渡すオプション( ``Unix`` ではデフォルトの値は ``-shared`` 、 ``Win32`` の場合は ``/DLL`` )
 
 * **LDOUT**
   
+  .. The option to use for specifying the output file in C and C++ linkers (defaults to -o on Unix and /Fe on Win32).
+  
   C/C++リンカが生成する出力ファイルの場所を指定するオプション( ``Unix`` ではデフォルトの値は ``-o`` 、 ``Win32`` の場合は ``/Fe`` )
 
 * **YACC**
   
+  .. The name of the yacc parser generator (default is yacc on Unix, empty on Win32). 
+  
   ``yacc`` パーサジェネレータの名前( ``Unix`` ではデフォルトの値は ``yacc`` 、 ``Win32`` の場合は空文字列)
 
 * **LEX**
   
+  .. The name of the lex lexer generator (default is lex on Unix, empty on Win32). 
+  
   ``lex`` レキサジェネレータの名前( ``Unix`` ではデフォルトの値は ``lex`` 、 ``Win32`` の場合は空文字列)
 
 .. _label13.5.3:
 
 13.5.3 Cファイルの生成
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. Because the C scanners do not normally know anything about generated source files (such as generated header files), these files may need to be created before running the scanner. 
+
 Cのスキャナは(生成されたヘッダファイルのような)生成されたソースファイルについては何も知りません。よって、これらのファイルはスキャナが実行される前に生成される必要があります。
 
 .. index::
@@ -512,10 +714,14 @@ Cのスキャナは(生成されたヘッダファイルのような)生成さ
   CGeneratedFiles(files)
   LocalCGeneratedFiles(files)
 
+.. The CGeneratedFiles and LocalCGeneratedFiles functions specify files that need to be generated before any C files are scanned for dependencies. For example, if config.h and inputs.h are both generated files, specify:
+
 ``CGeneratedFiles`` と ``LocalCGeneratedFiles`` 関数は、Cファイルについての依存関係をスキャンする前に生成される必要があるファイルを指定します。例えば、 ``config.h`` と ``inputs.h`` が両方とも生成されるファイルである場合、以下のように指定します。 ::
 
   CGeneratedFiles(config.h inputs.h)
 
+.. The CGeneratedFiles function is global — its arguments will be generated before any C files anywhere in the project are scanned for dependencies. The LocalCGeneratedFiles function follows the normal scoping rules of OMake.
+
 ``CGeneratedFiles`` 関数は *グローバル* です。この関数で指定したファイルは、任意の場所にある任意のCファイルの依存関係をスキャンする前に生成されます。 ``LocalCGeneratedFiles`` 関数はOMakeの通常のスコープルールに従います。
 
 .. _label13.5.4:
@@ -534,15 +740,23 @@ Cのスキャナは(生成されたヘッダファイルのような)生成さ
 
 13.5.4.1 StaticCLibrary, DynamicCLibrary
 """""""""""""""""""""""""""""""""""""""""""""""
+.. The StaticCLibrary builds a static library and the DynamicCLibrary function builds a shared library (DLL).
+
 ``StaticCLibrary`` は静的ライブラリをビルドし、 ``DynamicCLibrary`` 関数は共有ライブラリ(DLL)をビルドします。 ::
 
   StaticCLibrary(<target>, <files>)
   DynamicCLibrary(<target>, <files>)
 
+.. The <target> does not include the library suffix, and The <files> list does not include the object suffix. These are obtained from the EXT_LIB (EXT_DLL) and EXT_OBJ variables.
+
 ``<target>`` にライブラリの拡張子は *含めません* 。また、同様にして ``<files>`` のリストにもオブジェクトの拡張子は含めません。これらの拡張子は ``EXT_LIB`` ( ``EXT_DLL`` )や ``EXT_OBJ`` 変数によって決定されます。
 
+.. This function returns the library filename.
+
 この関数はライブラリのファイル名を返します。
 
+.. The following command builds the library libfoo.a from the files a.o b.o c.o on Unix, or the library libfoo.lib from the files a.obj b.obj c.obj on Win32.
+
 以下のコマンドは ``Unix`` 上のファイル ``a.o b.o c.o`` からライブラリ ``libfoo.a`` をビルドします。あるいは、 ``Win32`` 上のファイル ``a.obj b.obj c.obj`` からライブラリ ``libfoo.lib`` をビルドします。 ::
 
   StaticCLibrary(libfoo, a b c)
@@ -550,6 +764,8 @@ Cのスキャナは(生成されたヘッダファイルのような)生成さ
 
 **CDLL_IMPLIES_STATIC**
 
+.. If the CDLL_IMPLIES_STATIC variable is enabled (this is default on Win32), all the DynamicC functions would assume that creating a shared library automatically created a static one. 
+
 もし ``CDLL_IMPLIES_STATIC`` 変数が真である( ``Win32`` 上でこれはデフォルトの値です)ならば、すべての ``DynamicC`` 関数は共有ライブラリを自動的に生成し、さらに静的ライブラリを生成することを保障してくれます。
 
 .. index::
@@ -559,15 +775,23 @@ Cのスキャナは(生成されたヘッダファイルのような)生成さ
 
 13.5.4.2 StaticCLibraryCopy, DynamicCLibraryCopy
 """""""""""""""""""""""""""""""""""""""""""""""""""""
+.. The StaticCLibraryCopy and DynamicCLibraryCopy functions copy a library to an install location.
+
 ``StaticCLibraryCopy`` と ``DynamicCLibraryCopy`` 関数はインストール先にライブラリをコピーします。 ::
 
   StaticCLibraryCopy(<tag>, <dir>, <lib>)
   DynamicCLibraryCopy(<tag>, <dir>, <lib>)
 
+.. The <tag> is the name of a target (typically a .PHONY target); the <dir> is the installation directory, and <lib> is the library to be copied (without the library suffix).
+
 ``<tag>`` はターゲットの名前を指定します(大抵は ``.PHONY`` ターゲットです)。 ``<dir>`` はインストール先のディレクトリで、 ``<lib>`` はコピーするライブラリ(拡張子は除く)を指定します。
 
+.. This function returns the filename of the library in the target directory.
+
 この関数はターゲットディレクトリ内でのライブラリのファイル名を返します。
 
+.. For example, the following code copies the library libfoo.a to the /usr/lib directory.
+
 例えば、以下のコードではライブラリ ``libfoo.a`` を ``/usr/lib`` ディレクトリにコピーします。 ::
 
   .PHONY: install
@@ -581,6 +805,8 @@ Cのスキャナは(生成されたヘッダファイルのような)生成さ
 
 13.5.4.3 StaticCLibraryInstall, DynamicCLibraryInstall
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.. The StaticCLibraryInstall and DynamicCLibraryInstall functions build a library, and set the install location in one step. Return the filename of the library in the target directory.
+
 ``StaticCLibraryInstall`` と ``DynamicCLibraryInstall`` 関数はライブラリをビルドし、さらに出力先にインストール先を指定します。これらの関数はターゲットディレクトリ内でのライブラリのファイル名を返します。 ::
 
   StaticCLibraryInstall(<tag>, <dir>, <libname>, <files>)
@@ -598,6 +824,8 @@ Cのスキャナは(生成されたヘッダファイルのような)生成さ
 
 13.5.4.4 StaticCObject, StaticCObjectCopy, StaticCObjectInstall
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.. These functions mirror the StaticCLibrary, StaticCLibraryCopy, and StaticCLibraryInstall functions, but they build an object file (a .o file on Unix, and a .obj file on Win32).
+
 これらの関数は ``StaticCLibrary`` , ``StaticCLibraryCopy`` , ``StaticCLibraryInstall`` 関数と似ていますが、これらは *オブジェクト* ファイルをビルドします( ``Unix`` では ``.o`` ファイル、 ``Win32`` では ``.obj`` ファイル)。
 
 .. index::
@@ -609,18 +837,30 @@ Cのスキャナは(生成されたヘッダファイルのような)生成さ
 
 13.5.4.5 CProgram
 """""""""""""""""""""""""
+.. The CProgram function builds a C program from a set of object files and libraries.
+
 ``CProgram`` 関数はオブジェクトファイルやライブラリの集合からCプログラムをビルドします。 ::
 
   CProgram(<name>, <files>)
 
+.. The <name> argument specifies the name of the program to be built; the <files> argument specifies the files to be linked. The function returns the filename of the executable.
+
 ``<name>`` にはビルドするプログラムの名前を指定します。 ``<files>`` にはリンクするファイル名を指定します。この関数は実行可能なファイル名を返します。
 
+.. Additional options can be passed through the following variables. 
+
 オプションは以下の変数を受け渡すことで指定できます。
 
+.. Flags used by the C compiler during the link step. 
+   Flags to pass to the loader. 
+   Additional libraries to be linked.
+
 * **CFLAGS** : リンクする際にCコンパイラに受け渡すフラグ
 * **LDFLAGS** : ローダー(loader)に受け渡すフラグ
 * **LIBS** : リンクするための追加ライブラリ
 
+.. For example, the following code specifies that the program foo is to be produced by linking the files bar.o and baz.o and libraries libfoo.a.
+
 例えば、以下のコードはプログラム ``foo`` がファイル ``bar.o`` と ``baz.o`` 、そしてライブラリ ``libfoo.a`` をリンクすることによって生成します。 ::
 
   section
@@ -634,6 +874,8 @@ Cのスキャナは(生成されたヘッダファイルのような)生成さ
 
 13.5.4.6 CProgramCopy
 """"""""""""""""""""""""""""""""""""""
+.. The CProgramCopy function copies a file to an install location.
+
 ``CProgramCopy`` 関数はインストール先にファイルをコピーします。 ::
 
   CProgramCopy(<tag>, <dir>, <program>)
@@ -646,6 +888,8 @@ Cのスキャナは(生成されたヘッダファイルのような)生成さ
 
 13.5.4.7 CProgramInstall
 """"""""""""""""""""""""""""""""""""""
+.. The CProgramInstall function specifies a program to build, and a location to install, simultaneously.
+
 ``CProgramInstall`` 関数は同様にプログラムをビルドし、さらに出力先にインストール先を指定します。 ::
 
   CProgramInstall(<tag>, <dir>, <name>, <files>)
@@ -664,6 +908,8 @@ Cのスキャナは(生成されたヘッダファイルのような)生成さ
 
 13.5.4.8 CXXProgram, CXXProgramInstall
 """"""""""""""""""""""""""""""""""""""""""
+.. The CXXProgram and CXXProgramInstall functions are equivalent to their C counterparts, except that would use $(CXX) and $(CXXFLAGS) for linking instead of $(CC) and $(CFLAGS). 
+
 ``CXXProgram`` と ``CXXProgramInstall`` 関数は ``$(CC)`` や ``$(CFLAGS)`` の代わりに ``$(CXX)`` と ``$(CXXFLAGS)`` を使う点を除いて、対応するCの関数と等価です。
 
 .. index::
@@ -677,12 +923,16 @@ Cのスキャナは(生成されたヘッダファイルのような)生成さ
 
 13.5.4.9 StaticCXXLibrary, StaticCXXLibraryCopy, StaticCXXLibraryInstall, DynamicCXXLibrary, DynamicCXXLibraryCopy, DynamicCXXLibararyInstall
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.. Similarly, the six CXXLibrary functions the C++ equivalents of the corresponding CLibrary functions.
+
 同様にして、6つの ``CXXLibrary`` 関数は関連する ``CLibrary`` 関数と等価です。
 
 .. _label13.6:
 
 13.6 OCamlコードのビルド
 --------------------------------------
+.. OMake provides extensive support for building OCaml code, including support for tools like ocamlfind, ocamlyacc and menhir. In order to use the functions defined in this section, you need to make sure the line
+
 OMakeではOCamlコードをビルドするための、広範的なサポートを提供しています。このサポートには ``ocamlfind`` 、 ``ocamlyacc`` 、 ``menhir`` のようなツールへのサポートも含まれています。このセクションで列挙している関数を使うためには、まずあなたの ``OMakeroot`` ファイルに、以下の一行を追加してください。 ::
 
   open build/OCaml
@@ -696,24 +946,36 @@ OMakeではOCamlコードをビルドするための、広範的なサポート
 
 13.6.1 OCamlコンパイルに用いる自動設定用の変数
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. These variables will get defined based on the “autoconf-style” tests executed when you run OMake for the first time. You can use them to configure your project accordingly, and you should not redefine them.
+
 これらの変数はまず最初にOMakeを実行した時点で『自動設定スタイル(autoconf-style)』が実行され、その結果を元に決定されます。あなたのプロジェクトを調和の取れた状態にするためには、これらの変数を使用してください。また、あなたはこれらの変数を再定義すべきではありません。
 
+.. You can use the --configure command line option (Section A.3.9) to force re-execution of all the tests.
+
 あなたは強制的にすべてのテストを実行させるために、 ``--configure`` コマンドラインオプション(A.3.9を参照)を使うことができます。
 
 * **OCAMLOPT_EXISTS**
   
+  .. True when ocamlopt (or ocamlopt.opt) is available on your machine. 
+  
   あなたのマシン上で ``ocamlopt`` (あるいは ``ocamlopt.opt`` )が利用可能である場合は真となります。
 
 * **OCAMLFIND_EXISTS**
   
+  .. True when the ocamlfind is available on your machines. 
+  
   あなたのマシン上で ``ocamlfind`` が利用可能である場合は真となります。
 
 * **OCAMLDEP_MODULES_AVAILABLE**
   
+  .. True when a version of ocamldep that understands the -modules option is available on your machine. 
+  
   あなたのマシン上で ``-modules`` オプションが理解できるバージョンの ``ocamldep`` が利用可能である場合は真となります。
 
 * **MENHIR_AVAILABLE**
   
+  .. True when the Menhir parser-generator is available on your machine.
+  
   あなたのマシン上でMenhirパーサジェネレータが利用可能である場合は真となります。
 
 .. index::
@@ -742,86 +1004,134 @@ OMakeではOCamlコードをビルドするための、広範的なサポート
 
 13.6.2 OCamlコンパイルに用いる設定用の変数
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. The following variables can be redefined in your project. 
+
 以下の変数はあなたのプロジェクト上で再定義可能な変数です。
 
 * **USE_OCAMLFIND**
   
+  .. Whether to use the ocamlfind utility (default false) 
+  
   ``ocamlfind`` ユーティリティを利用するかどうか(デフォルトは ``false`` )
 
 * **OCAMLC**
   
+  .. The OCaml bytecode compiler (default ocamlc.opt if it exists and USE_OCAMLFIND is not set, otherwise ocamlc). 
+  
   OCamlバイトコードコンパイラ( ``ocamlc.opt`` が存在していてかつ ``USE_OCAMLFIND`` が設定されていない場合は ``ocamlc.opt`` 。そうでない場合は ``ocamlc`` )
 
 * **OCAMLOPT**
   
+  .. The OCaml native-code compiler (default ocamlopt.opt if it exists and USE_OCAMLFIND is not set, otherwise ocamlopt). 
+  
   OCamlネイティブコードコンパイラ( ``ocamlc.opt`` が存在していてかつ ``USE_OCAMLFIND`` が設定されていない場合は ``ocamlc.opt`` 。そうでない場合は ``ocamlopt`` )
 
 * **CAMLP4**
   
+  .. The camlp4 preprocessor (default camlp4). 
+  
   ``camlp4`` プリプロセッサ(デフォルトは ``camlp4`` )
 
 * **OCAMLLEX**
   
+  .. The OCaml lexer generator (default ocamllex). 
+  
   OCamlレキサジェネレータ(デフォルトは ``ocamllex`` )
 
 * **OCAMLLEXFLAGS**
-
+  
+  .. The flags to pass to ocamllex (default -q). 
+  
   ``ocamllex`` に渡すフラグ(デフォルトは ``-q`` )
 
 * **OCAMLYACC**
   
+  .. The OCaml parser generator (default ocamlyacc). 
+  
+  OCamlパーサジェネレータ(デフォルトは ``ocamlyacc`` )
+
+* **OCAMLYACCFLAGS**
+  
+  .. Additional options to pass to $(OCAMLYACC). 
+  
   ``$(OCAMLYACC)`` に渡す追加オプション
 
 * **OCAMLDEP**
   
+  .. The OCaml dependency analyzer (default ocamldep). 
+  
   OCaml依存関係解析器(dependency analyzer)(デフォルトは ``ocamldep`` )
 
 * **OCAMLDEP_MODULES**
   
+  .. The OCaml dependency analyzer that understands the -module option (default ocamldep, if ocamldep -modules works, or ocamlrun ocamldep-omake, if ocamlrun ocamldep-omake -modules works, and empty when neither works).
+  
   ``-module`` オプションが理解できるOCaml依存解析器(デフォルトの値は ``ocamldep`` 、ただし ``ocamldep`` が ``-modules`` で動いた場合のみ。 ``ocamlrun ocamldep-omake -module`` が動く場合は ``ocamlrun ocamldep-omake`` が使われる。どちらでもない場合は空となる)
 
 * **OCAMLDEP_MODULES_ENABLED**
   
+  .. Instead of using OCAMLDEP in a traditional make-style fashion, run $(OCAMLDEP_MODULES) -modules and then postprocess the output internally to discover all the relevant generated .ml and .mli files. See Section 13.6.5 for more information on interactions between OMake, OCAMLDEP and generated files. Set to $(OCAMLDEP_MODULES_AVAILABLE) by default. 
+  
   従来の伝統的な ``make -style`` の形で ``OCAMLDEP`` を使う代わりに ``$(OCAMLDEP_MODULES) -modules`` を走らせて、 関連しているすべての ``.ml`` と ``.mli`` ファイルを探しだし、その出力を内部で後処理します。OMakeと、 ``OCAMLDEP`` や生成されたファイルの相互間の動作に関して、より詳しく知りたい方は13.6.5を参照してください。
 
 * **OCAMLMKTOP**
-
+  
+  .. The OCaml toploop compiler (default ocamlmktop). 
+  
   OCamlトップループコンパイラ(デフォルトは ``ocamlmktop`` )
 
 * **OCAMLLINK**
   
+  .. The OCaml bytecode linker (default $(OCAMLC)). 
+  
   OCamlバイトコードリンカ(デフォルトは ``$(OCAMLC)`` )
 
 * **OCAMLOPTLINK**
   
+  .. The OCaml native-code linker (default $(OCAMLOPT)). 
+  
   OCamlネイティブコードリンカ(デフォルトは ``$(OCAMLOPT)`` )
 
 * **OCAMLINCLUDES**
   
+  .. Search path to pass to the OCaml compilers (default .). The search path with the -I prefix is defined by the PREFIXED_OCAMLINCLUDES variable. 
+  
   OCamlコンパイラに受け渡す検索パス(デフォルトは ``.`` )。 ``-I`` 接頭辞を加えた検索パスについては、 ``PREFIXED_OCAMLINCLUDES`` 変数で定義されています。
 
 * **OCAMLFIND**
   
+  .. The ocamlfind utility (default ocamlfind if USE_OCAMLFIND is set, otherwise empty). 
+  
   ``ocamlfind`` ユーティリティ( ``USE_OCAMLFIND`` が設定されている場合は ``ocamlfind`` 。そうでない場合は空文字)
 
 * **OCAMLFINDFLAGS**
   
+  .. The flags to pass to ocamlfind (default empty, USE_OCAMLFIND must be set). 
+  
   ``ocamlfind`` に渡すフラグ(デフォルトは空文字で、 ``USE_OCAMLFIND`` が設定されていなければならない)
 
 * **OCAMLPACKS**
   
+  .. Package names to pass to ocamlfind (USE_OCAMLFIND must be set). 
+  
   ``ocamlfind`` に渡すパッケージ名( ``USE_OCAMLFIND`` が設定されていなければならない)
 
 * **BYTE_ENABLED**
   
+  .. Flag indicating whether to use the bytecode compiler (default true, when no ocamlopt found, false otherwise).
+  
   バイトコードコンパイラを使用するかどうかを示すフラグ( ``ocamlopt`` が見つからない場合は ``true`` 。そうでない場合は ``false`` )
 
 * **NATIVE_ENABLED**
   
+  .. Flag indicating whether to use the native-code compiler (default true, when ocamlopt is found, false otherwise). Both BYTE_ENABLED and NATIVE_ENABLED can be set to true; at least one should be set to true.
+  
   ネイティブコードコンパイラを使用するかどうかを示すフラグ( ``ocamlopt`` が見つかる場合は ``true`` 。そうでない場合は ``false`` )。 ``BYTE_ENABLED`` と ``NATIVE_ENABLED`` の両方はどちらとも真にすることができます。また、最低でも一つの変数は真であるべきです。
 
 * **MENHIR_ENABLED**
   
+  .. Define this as true if you wish to use menhir instead of ocamlyacc (default false). 
+  
   ``ocamlyacc`` の代わりに ``menhir`` を使いたい場合は ``true`` に設定してください(デフォルトは ``false`` )。
 
 .. index::
@@ -838,38 +1148,62 @@ OMakeではOCamlコードをビルドするための、広範的なサポート
 
 13.6.3 OCamlコマンドフラグ
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. The following variables specify additional options to be passed to the OCaml tools. 
+
 以下の変数はOCamlのツールに渡す *追加* オプションを示しています。
 
 * **OCAMLDEPFLAGS**
   
+  .. Flags to pass to OCAMLDEP and OCAMLDEP_MODULES. 
+  
   ``OCAMLDEP`` と ``OCAMLDEP_MODULES`` に渡すフラグ
 
 * **OCAMLPPFLAGS**
   
+  .. Flags to pass to CAMLP4. 
+  
   ``CAMLP4`` に渡すフラグ
 
 * **OCAMLCFLAGS**
   
+  .. Flags to pass to the byte-code compiler (default -g). 
+  
   バイトコードコンパイラに渡すフラグ(デフォルトは ``-g`` )
 
 * **OCAMLOPTFLAGS**
   
+  .. Flags to pass to the native-code compiler (default empty). 
+  
   ネイティブコードコンパイラに渡すフラグ(デフォルトは空)
 
+* **OCAMLFLAGS**
+  
+  .. Flags to pass to either compiler (default -warn-error A). 
+  
+  両方のコンパイラに渡すフラグ(デフォルトは ``-warn-error A`` )
+
 * **OCAML_BYTE_LINK_FLAGS**
   
+  .. Flags to pass to the byte-code linker (default empty). 
+  
   バイトコードリンカに渡すフラグ(デフォルトは空)
 
 * **OCAML_NATIVE_LINK_FLAGS**
   
+  .. Flags to pass to the native-code linker (default empty).
+  
   ネイティブコードリンカに渡すフラグ(デフォルトは空)
 
 * **OCAML_LINK_FLAGS**
   
+  .. Flags to pass to either linker. 
+  
   両方のリンカに渡すフラグ
 
 * **MENHIR_FLAGS**
   
+  .. Additional flags to pass to menhir.
+  
   ``menhir`` に渡す追加フラグ
 
 .. index::
@@ -882,39 +1216,57 @@ OMakeではOCamlコードをビルドするための、広範的なサポート
 
 13.6.4 ライブラリ変数
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-以下の変数はリンクの際に用いられます。
+.. The following variables are used during linking.
+
+以下の変数がリンクの際に用いられます。
 
 * **OCAML_LIBS**
   
+  .. Libraries to pass to the linker. These libraries become dependencies of the link step. 
+  
   リンカに渡すライブラリ。これらのライブラリはリンク作業時に依存先となります。
 
 * **OCAML_OTHER_LIBS**
   
+  .. Additional libraries to pass to the linker. These libraries are not included as dependencies to the link step. Typical use is for the OCaml standard libraries like unix or str. 
+  
   リンカに渡す追加ライブラリ。これらのライブラリはリンク作業時に依存先には *含まれません* 。一般的な使用方法としては、OCamlの ``unix`` や ``str`` のような標準ライブラリに用いられます。
 
 * **OCAML_CLIBS**
   
+  .. C libraries to pass to the linker. 
+  
   リンカに渡すCライブラリ
 
 * **OCAML_LIB_FLAGS**
   
+  .. Extra flags for the library linker. 
+  
   ライブラリリンカに渡すその他のフラグ
 
 * **ABORT_ON_DEPENDENCY_ERRORS**
   
+  .. OCaml linker requires the OCaml files to be listed in dependency order. Normally, all the functions presented in this section will automatically sort the list of OCaml modules passed in as the <files> argument. However, this variable is set to true, the order of the files passed into these function will be left as is, but OMake will abort with an error message if the order is illegal.
+  
   OCamlのリンカは依存する順番でリストされたOCamlのファイルを必要としています。通常、このセクションにあるすべての関数は ``<files>`` 引数として渡したOCamlのモジュールリストを自動的にソートします。しかし、この変数が ``true`` に設定してある場合、これらの関数に受け渡されたファイルの順番はそのままになります。また、OMakeはこの順番が正しくなかったとしても、生じたエラーメッセージを無視します。
 
 .. _label13.6.5:
 
 13.6.5 OCamlファイルを生成
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. As of OCaml version 3.09.2, the standard ocamldep scanner is “broken”. The main issue is that it finds only those dependencies that already exist. If foo.ml contains a dependency on Bar, 
+
 OCaml バージョン 3.09.2に関しては、標準の ``ocamldep`` スキャナは『壊れています』。これに関しての主な問題は、既に存在している依存関係しか検索しないという点です。例えば、 ``foo.ml`` が ``Bar`` に依存しているものとしましょう。 ::
 
   foo.ml:
      open Bar
 
+.. then the default ocamldep will only find the dependency if a file bar.ml or bar.ml exists in the include path. It will not find (or print) the dependency if, for example, only bar.mly exists at the time ocamldep is run, even though bar.ml and bar.mli can be generated from bar.mly.
+
 この場合、ファイル ``bar.ml`` あるいはインクルードパス上の ``bar.ml`` が存在しているときには、デフォルトの ``ocamldep`` はそのファイルの依存関係しか調べません。つまり、もし ``ocamldep`` を走らせた時点では ``bar.mly`` しか存在しなかったとしたら、たとえ ``bar.ml`` と ``bar.mli`` が ``bar.mly`` から生成されたとしても、これらの依存関係は調べない(あるいは出力しない)のです。
 
+.. OMake currently provides two methods for addressing this problem — one that requires manually specifying the generated files, and an experimental method for discovering such “hidden” dependencies automatically. The OCAMLDEP_MODULES_ENABLED variable controls which method is going to be used. When this variable is false, the manual specifications are expected and when it is true, the automated discovery will be attempted.
+
 現状のOMakeでは、この問題を解決するための2つの方法を提供しています。一つは生成されるファイルを手動で指定してあげることです。二つめは実験的な方法ですが、自動的に『隠れた』依存関係を調査することです。 ``OCAMLDEP_MODULES_ENABLED`` 変数はどちらの方法を使うのか、制御する変数です。この変数が偽であるときには、手動で指定するという方法が期待されます。また、真であるときには、自動的な調査を試みます。
 
 .. index::
@@ -929,22 +1281,34 @@ OCaml バージョン 3.09.2に関しては、標準の ``ocamldep`` スキャ
   OCamlGeneratedFiles(files)
   LocalOCamlGeneratedFiles(files)
 
+.. When the OCAMLDEP_MODULES_ENABLED variable variable is set to false, the OCamlGeneratedFiles and LocalOCamlGeneratedFiles functions specify files that need to be generated before any OCaml files are scanned for dependencies. For example, if parser.ml and lexer.ml are both generated files, specify: 
+
 ``OCAMLDEP_MODULES_ENABLED`` 変数が ``false`` に設定してある場合、 ``OCamlGeneratedFiles`` と ``LocalOCamlGeneratedFiles`` 関数は任意のOCamlファイルが依存関係をスキャンする前に、生成される必要のあるファイルを指定します。例えば、 ``parser.ml`` と ``lexer.ml`` の両方が生成されるファイルであった場合、以下のように指定します。 ::
 
   OCamlGeneratedFiles(parser.ml lexer.ml)
 
+.. The OCamlGeneratedFiles function is global — its arguments will be generated before any OCaml files anywhere in the project are scanned for dependencies. The LocalOCamlGeneratedFiles function follows the normal scoping rules of OMake.
+
 ``OCamlGeneratedFiles`` 関数は *グローバル* です。この関数の引数は、プロジェクト上の任意の場所にある任意のOCamlファイルの依存関係をスキャンする前に生成されます。 ``LocalOCamlGeneratedFiles`` 関数はOMakeの通常のスコープルールに従います。
 
+.. These functions have no effect when the OCAMLDEP_MODULES_ENABLED variable is true.
+
 これらの関数は ``OCAMLDEP_MODULES_ENABLED`` 変数が真であるときにはなんの影響も与えません。
 
 .. _label13.6.5.2:
 
 13.6.5.2 依存関係の解析中に生成されるファイルを自動的に調査
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.. Having to specify the generated files manualy when OMake could discover them automatically is obviously suboptimal. To address this, we tell ocamldep to only find the free module names in a file and then post-process the results internally.
+
 OMakeが自動的に調査してくれるときに、いちいち手動で生成されるファイルを指定してあげるのは明らかに最適とは言えません。まずこれについて話すために、ファイルの自由なモジュール名 *のみ* を探しだす ``ocamldep`` について話し、その後内部でその結果を後処理することを伝えました。
 
+.. This automated functionality is enabled when the OCAMLDEP_MODULES_ENABLED variable is set to true. By default, OCAMLDEP_MODULES_ENABLED variable will be set to $(OCAMLDEP_MODULES_AVAILABLE).
+
 この自動的な機構は ``OCAMLDEP_MODULES_ENABLED`` 変数が ``true`` に設定されているときに許可されます。通常、 ``OCAMLDEP_MODULES_ENABLED`` 変数は ``$(OCAMLDEP_MODULES_AVAILABLE)`` に設定されています。
 
+.. Note that the ocamldep functionality this relies upon is only included in the OCaml version 3.10 and higher. Temporarily, we distribute a bytecode version ocamldep-omake of the appropriately modified ocamldep. The appropriate ocamldep will be discovered automatically — see and the OCAMLDEP_MODULES_AVAILABLE and OCAMLDEP_MODULES variables will be set accordingly.
+
 この処理に依存している ``ocamldep`` の機構はバージョン3.10のOCamlかそれ以降のみに含まれています。一時的に、私たちは ``ocamldep`` を似せて修正したバイトコードバージョンの ``ocamldep-omake`` を用意しました。この似せて作った ``ocamldep`` は自動的に依存関係を調査してくれます。詳細は ``OCAMLDEP_MODULES_AVAILABLE`` と ``OCAMLDEP_MODULES`` 変数の項を参照し、さらにこれらの変数を正しく設定し、利用してください。
 
 .. index::
@@ -953,8 +1317,15 @@ OMakeが自動的に調査してくれるときに、いちいち手動で生成
 
 13.6.6 Menhirパーサジェネレータを使用
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. Menhir is a parser generator that is mostly compatible with ocamlyacc, but with many improvements. A few of these are listed here (excerpted from the Menhir home page http://cristal.inria.fr/~fpottier/menhir/).
+
 Menhirは ``ocamlyacc`` とほとんど互換性がとれており、かつ様々な改良がなされているパーサジェネレータです。機能の一部を以下にリストします(さらに知りたい方はMenhirのホームページ http://cristal.inria.fr/~fpottier/menhir/ を参照してください)。
 
+.. Menhir's explanations are believed to be understandable by mere humans. 
+   Menhir allows grammar specifications to be split over multiple files. It also allows several grammars to share a single set of tokens. 
+   Menhir is able to produce parsers that are parameterized by Objective Caml modules. 
+   Added by jyh With the --infer option, Menhir can typecheck the semantic actions in your grammar at generation time. 
+
 * Menhirの解釈(explanations)は、多くの人間が分かりやすくなるように改良されています。
 * Menhirは複数のファイルにわたって文法を記述できます。これはまた、トークンの集合を複数のgrammerが共有できることを意味しています。
 * MenhirはObjective Camlモジュールによって記述されたパーサを提供することができます。
@@ -962,23 +1333,36 @@ Menhirは ``ocamlyacc`` とほとんど互換性がとれており、かつ様
 
 (訳注: 見ての通り、訳が安定していません。すいませんがあまり信用しないでください)
 
+.. What do you need to do to use Menhir instead of ocamlyacc? 
+
 どのようにして ``ocamlyacc`` の代わりにMenhirを使用できるのでしょうか?
 
+.. Place the following definition before the relevant section of your project (or at the top of your project OMakefile if you want to use Menhir everywhere).
+
 1. あなたのプロジェクトの適切な位置(Menhirをどこでも使いたいのならプロジェクトトップの ``OMakefile`` )に、以下の定義を追加してください。 ::
 
      MENHIR_ENABLED = true
+
+.. Optionally, add any desired Menhir options to the MENHIR_FLAGS variable.
+
 2. 必要ならば、Menhirに追加させたいオプションを ``MENHIR_FLAGS`` に追加してください。 ::
 
      MENHIR_FLAGS += --infer
 
+.. With this setup, any file with a .mly suffix will be compiled with Menhir.
+
 このセットアップによって、任意の ``.mly`` 拡張子のファイルはMenhirでコンパイルされます。
 
+.. If your grammar is split across several files, you need to specify it explicitly, using the MenhirMulti function.
+
 もしあなたの文法(grammar)がいくつかのファイルにわたって分割されているのなら、あなたは ``MenhirMulti`` 関数を用いて、そのことを明示的に指定してあげる必要があります。 ::
 
     MenhirMulti(target, sources)
         target : 拡張子を除いたファイル名
         sources : 拡張子を除いた、文法を定義しているファイル群
 
+.. For example, if you want to generate the parser files parse.ml and parse.mli, from the grammar specified in files a.mly and b.mly, you would use the following.
+
 例えば、文法を指定しているファイル ``a.mly`` と ``b.mly`` からパーサファイル ``parse.ml`` と ``parse.mli`` を生成したい場合は、以下のように記述します。 ::
 
     MenhirMulti(parse, a b)
@@ -989,14 +1373,22 @@ Menhirは ``ocamlyacc`` とほとんど互換性がとれており、かつ様
 
 13.6.6.1 OCamlLibrary
 """"""""""""""""""""""""""""""""""""""
+.. The OCamlLibrary function builds an OCaml library.
+
 ``OCamlLibrary`` 関数はOCamlライブラリをビルドします。 ::
 
   OCamlLibrary(<libname>, <files>)
 
+.. The <libname> and <files> are listed without suffixes.
+
 ``<libname>`` と ``<files>`` は拡張子を *付けないで* 指定してください。
 
+.. This function returns the list of all the targets that it defines the rules for (including the $(name)$(EXT_LIB) file when NATIVE_ENABLED is set).
+
 この関数はルールを定義しているすべてのターゲットのリスト( ``NATIVE_ENABLED`` が設定されているときは ``$(name)$(EXT_LIB)`` を含む)を返します。
 
+.. The following code builds the libfoo.cmxa library from the files foo.cmx and bar.cmx (if NATIVE_ENABLED is set), and libfoo.cma from foo.cmo and bar.cmo (if BYTE_ENABLED is set).
+
 以下のコードは( ``NATIVE_ENABLED`` が設定されている場合は) ``foo.cmx`` と ``bar.cmx`` から ``libfoo.cmxa`` ライブラリをビルドし、( ``BYTE_ENABLED`` が設定されている場合は) ``foo.cmo`` と ``bar.cmo`` から ``libfoo.cma`` をビルドします。 ::
 
   OCamlLibrary(libfoo, foo bar)
@@ -1007,14 +1399,22 @@ Menhirは ``ocamlyacc`` とほとんど互換性がとれており、かつ様
 
 13.6.6.2 OCamlPackage
 """"""""""""""""""""""""""""""""""""""
+.. The OCamlPackage function builds an OCaml package.
+
 ``OCamlPackage`` 関数はOCamlパッケージをビルドします。 ::
 
   OCamlPackage(<name>, <files>)
 
+.. The <name> and <files> are listed without suffixes. The <files> must have been compiled with the -for-pack <ident> flag to the OCaml compiler.
+
 ``<name>`` と ``<files>`` は拡張子を *付けないで* 指定してください。 ``<files>`` はOCamlコンパイラに ``-for-pack <ident>`` フラグを加えた状態でコンパイルされます。
 
+.. This function returns the list of all the targets that it defines the rules for (including the $(name)$(EXT_LIB) file when NATIVE_ENABLED is set).
+
 この関数はルールを定義しているすべてのターゲットのリスト( ``NATIVE_ENABLED`` が設定されているときは ``$(name)$(EXT_LIB)`` を含む)を返します。
 
+.. The following code builds the libfoo.cmx package from the files package.cmx and bar.cmx (if NATIVE_ENABLED is set), and package.cmo from foo.cmo and bar.cmo (if BYTE_ENABLED is set).
+
 以下のコードは( ``NATIVE_ENABLED`` が設定されている場合は) ``foo.cmx`` と ``bar.cmx`` から ``package.cmx`` パッケージをビルドし、( ``BYTE_ENABLED`` が設定されている場合は) ``foo.cmo`` と ``bar.cmo`` から ``package.cmo`` をビルドします。 :: 
 
   OCamlPackage(package, foo bar)
@@ -1025,10 +1425,14 @@ Menhirは ``ocamlyacc`` とほとんど互換性がとれており、かつ様
 
 13.6.6.3 OCamlLibraryCopy
 """"""""""""""""""""""""""""""""""""""
+.. The OCamlLibraryCopy function copies a library to an install location.
+
 ``OCamlLibraryCopy`` 関数はライブラリをインストール先にコピーします。 ::
 
   OCamlLibraryCopy(<tag>, <libdir>, <libname>, <interface-files>)
 
+.. The <interface-files> specify additional interface files to be copied if the INSTALL_INTERFACES variable is true.
+
 ``<interface-files>`` では ``INSTALL_INTERFACES`` 変数が真である場合にコピーする、追加のインターフェイスファイルを指定します。
 
 .. index::
@@ -1037,6 +1441,8 @@ Menhirは ``ocamlyacc`` とほとんど互換性がとれており、かつ様
 
 13.6.6.4 OCamlLibraryInstall
 """"""""""""""""""""""""""""""""""""""
+.. The OCamlLibraryInstall function builds a library and copies it to an install location in one step.
+
 ``OCamlLibraryInstall`` 関数はライブラリをビルドし、加えてインストール先にコピーします。 ::
 
   OCamlLibraryInstall(<tag>, <libdir>, <libname>, <files>)
@@ -1053,30 +1459,50 @@ Menhirは ``ocamlyacc`` とほとんど互換性がとれており、かつ様
 
 13.6.6.5 OCamlProgram
 """"""""""""""""""""""""""""""""""""""
+.. The OCamlProgram function builds an OCaml program. It returns the array with all the targets for which it has defined the rules ($(name)$(EXE) and $(name).run and/or $(name).opt, depending on the NATIVE_ENABLED and BYTE_ENABLED variables).
+
 ``OCamlProgram`` 関数はOCamlプログラムをビルドします。この関数はルールを定義している、すべてのターゲットの配列を返します( ``$(name)$(EXE)`` , ``$(name).run`` ``$(name).opt`` は ``NATIVE_ENABLED`` と ``BYTE_ENABLED`` 変数の値に依存しています)。 ::
 
   OCamlProgram(<name>, <files>)
 
+.. Additional variables used:
+
 以下の変数が利用されます。
 
 * **OCAML_LIBS**
-
+  
+  .. Additional libraries passed to the linker, without suffix. These files become dependencies of the target program. 
+  
   リンカに渡す追加ライブラリ(拡張子を除く)。これらのファイルは対象のプログラムの依存先となります。
 
 * **OCAML_OTHER_LIBS**
   
+  .. Additional libraries passed to the linker, without suffix. These files do not become dependencies of the target program. 
+  
   リンカに渡す追加ライブラリ(拡張子を除く)。これらのファイルは対象のプログラムの依存先に *なりません* 。
 
 * **OCAML_CLIBS**
   
+  .. C libraries to pass to the linker. 
+  
   リンカに渡すCライブラリ
 
 * **OCAML_BYTE_LINK_FLAGS**
   
-  ネイティブコードリンカに渡すフラグ
+  .. Flags to pass to the bytecode linker. 
+  
+  バイトコードリンカに渡すフラグ
 
+* **OCAML_NATIVE_LINK_FLAGS**
+  
+  .. Flags to pass to the native code linker. 
+  
+  ネイティブコードリンカに渡すフラグ
+  
 * **OCAML_LINK_FLAGS**
   
+  .. Flags to pass to both linkers. 
+  
   両方のリンカに渡すフラグ
 
 .. index::
@@ -1086,14 +1512,20 @@ Menhirは ``ocamlyacc`` とほとんど互換性がとれており、かつ様
 
 13.6.6.6 OCamlProgramCopy
 """"""""""""""""""""""""""""""""""""""
+.. The OCamlProgramCopy function copies an OCaml program to an install location.
+
 ``OCamlProgramInstall`` 関数はOCamlプログラムをインストール先にコピーします。 ::
 
   OCamlProgramCopy(<tag>, <bindir>, <name>)
 
+.. Additional variables used: 
+
 以下の変数が利用されます。
 
 * **NATIVE_ENABLED**
   
+  .. If the NATIVE_ENABLED variable is set, the native-code executable is copied; otherwise the byte-code executable is copied. 
+  
   ``NATIVE_ENABLED`` 変数が設定されている場合、ネイティブコードの実行形式がコピーされます。そうでない場合はバイトコードの実行形式がコピーされます。
 
 .. index::
@@ -1102,6 +1534,8 @@ Menhirは ``ocamlyacc`` とほとんど互換性がとれており、かつ様
 
 13.6.6.7 OCamlProgramInstall
 """"""""""""""""""""""""""""""""""""""
+.. The OCamlProgramInstall function builds a programs and copies it to an install location in one step.
+
 ``OCamlProgramInstall`` 関数はプログラムをビルドし、加えてインストール先にコピーします。 ::
 
   OCamlProgramInstall(<tag>, <bindir>, <name>, <files>)
@@ -1110,6 +1544,8 @@ Menhirは ``ocamlyacc`` とほとんど互換性がとれており、かつ様
 
 13.7 LaTeXファイルのビルド
 --------------------------------------
+.. OMake provides support for building LATEX documents, including support for automatically running BiBTex and for producing PostScript and PDF files. In order to use the functions defined in this section, you need to make sure the line is present in your OMakeroot file.
+
 OMakeではLaTeXドキュメントのビルドをサポートします。このサポートには自動的にBiBTexを実行させ、PostScriptやPDFファイルを生成するためのサポートも含まれます。このセクションで列挙している関数を使うためには、まずあなたの ``OMakeroot`` ファイルに、以下の一行を追加してください。 ::
 
   open build/LaTeX
@@ -1131,54 +1567,80 @@ OMakeではLaTeXドキュメントのビルドをサポートします。この
 
 13.7.1 設定用の変数
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. The following variables can be modified in your project. 
+
 以下の変数があなたのプロジェクト上で編集できます。
 
 * **LATEX**
   
+  .. The LATEX command (default latex). 
+  
   LaTeXコマンド(デフォルトは ``latex`` )
 
 * **TETEX2_ENABLED**
   
+  .. Flag indicating whether to use advanced LATEX options present in TeTeX v.2 (default value is determined the first time omake reads LaTeX.src and depends on the version of LATEX you have installed). 
+  
   TeTeX v.2にある、発展的なLaTeXオプションを利用するかどうかを示すフラグです(デフォルトの値は最初にomakeが ``LaTeX.src`` を読み込むことで決定され、さらにインストールしてあるLaTeXのバージョンに依存します)。
 
 * **LATEXFLAGS**
   
+  .. The LATEX flags (defaults depend on the TETEX2_ENABLED variable) 
+  
   LaTexのフラグ(デフォルトの値は ``TETEX2_ENABLED`` 変数に依存する)
 
 * **BIBTEX**
   
+  .. The BibTeX command (default bibtex). 
+  
   BibTeXコマンド(デフォルトは ``bibtex`` )
 
 * **MAKEINDEX**
   
+  .. The command to build an index (default makeindex).   
+  
   索引をビルドするコマンド(デフォルトは ``makeindex`` )
 
 * **DVIPS**
   
+  .. The .dvi to PostScript converter (default dvips). 
+  
   ``.dvi`` からPostScriptに変換するコンバータ(デフォルトは ``dvips`` )
 
 * **DVIPSFLAGS**
   
+  .. Flags to pass to dvips (default -t letter). 
+  
   ``dvips`` に渡すフラグ(デフォルトは ``-t letter`` )
 
 * **DVIPDFM**
   
+  .. The .dvi to .pdf converter (default dvipdfm). 
+  
   ``.dvi`` から ``.pdf`` に変換するコンバータ(デフォルトは ``dvipdfm`` )
 
 * **DVIPDFMFLAGS**
   
+  .. Flags to pass to dvipdfm (default -p letter).
+  
   ``dvipdfm`` に渡すフラグ(デフォルトは ``-p letter`` )
 
 * **PDFLATEX**
   
+  .. The .latex to .pdf converter (default pdflatex). 
+  
   ``.latex`` から ``.pdf`` に変換するコンバータ(デフォルトは ``pdflatex`` )
 
 * **PDFLATEXFLAGS**
   
+  .. Flags to pass to pdflatex (default is $`(LATEXFLAGS)).
+  
   ``pdflatex`` に渡すフラグ(デフォルトは ``$`(LATEXFLAGS)`` )
 
 * **USEPDFLATEX**
   
+  .. Flag indicating whether to use pdflatex instead of dvipdfm to generate the .pdf document (default false). 
+  
   ``.pdf`` ドキュメントを生成するのにdvipdfmではなくpdflatexを使うかどうかを示すフラグ(デフォルトは ``false`` )
 
 .. _label13.7.2:
@@ -1195,24 +1657,36 @@ OMakeではLaTeXドキュメントのビルドをサポートします。この
 
 13.7.2.1 LaTeXDocument
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.. The LaTeXDocument produces a LATEX document.
+
 ``LaTeXDocument`` 関数はLaTeXドキュメントを生成します。 ::
 
   LaTeXDocument(<name>, <texfiles>)
 
+.. The document <name> and <texfiles> are listed without suffixes. This function returns the filenames for the generated .ps and .pdf files.
+
 ``<name>`` と ``<texfiles>`` には拡張子を *付けないで* 指定してください。この関数は生成された ``.ps`` と ``.pdf`` ファイルのファイル名を返します。
 
+.. Additional variables used: 
+
 以下の変数が利用されます。
 
 * **TEXINPUTS**
   
+  .. The LATEX search path (an array of directories, default is taken from the TEXINPUTS environment variable). 
+  
   LaTeXの検索パス(ディレクトリの配列で、デフォルトは ``TEXINPUTS`` 環境変数から取得される)
 
 * **TEXDEPS**
   
+  .. Additional files this document depends on. 
+  
   このドキュメントに依存している追加ファイル
 
 * **TEXVARS**
   
+  .. An array of names of the environment variables that are to be updated based on the value of OMake's TEXINPUTS variable. Defaults to TEXINPUTS BIBINPUTS BSTINPUTS. 
+  
   OMakeの ``TEXINPUTS`` 変数の値に基づいてアップデートすることになっている、環境変数の名前の配列。デフォルトは ``TEXINPUTS BIBINPUTS BSTINPUTS`` 。
 
 .. index::
@@ -1227,10 +1701,14 @@ OMakeではLaTeXドキュメントのビルドをサポートします。この
   TeXGeneratedFiles(files)
   LocalTeXGeneratedFiles(files)
 
+.. The TeXGeneratedFiles and LocalTeXGeneratedFiles functions specify files that need to be generated before any LATEXfiles are scanned for dependencies. For example, if config.tex and inputs.tex are both generated files, specify: 
+
 ``TeXGeneratedFiles`` と ``LocalTeXGeneratedFiles`` 関数は任意のLaTeXファイルの依存関係をスキャンする前に生成される必要のあるファイルを指定します。例えば、 ``config.tex`` と ``inputs.tex`` が両方とも生成されるファイルであった場合、以下のように指定します。 ::
 
     TeXGeneratedFiles(config.tex inputs.tex)
 
+.. The TeXGeneratedFiles function is global — its arguments will be generated before any TeX files anywhere in the project are scanned for dependencies. The LocalTeXGeneratedFiles function follows the normal scoping rules of OMake.
+
 ``TeXGeneratedFiles`` 関数は *グローバル* です。この関数で指定したファイルは、任意の場所にある任意のTeXファイルの依存関係をスキャンする前に生成されます。 ``LocalTeXGeneratedFiles`` 関数はOMakeの通常のスコープルールに従います。
 
 .. index::
@@ -1239,10 +1717,14 @@ OMakeではLaTeXドキュメントのビルドをサポートします。この
 
 13.7.2.3 LaTeXDocumentCopy
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.. The LaTeXDocumentCopy copies the document to an install location.
+
 ``LaTeXDocumentCopy`` 関数はインストール先にドキュメントをコピーします。 ::
 
   LaTeXDocumentCopy(<tag>, <libdir>, <installname>, <docname>)
 
+.. This function copies just the .pdf and .ps files.
+
 この関数は ``.pdf`` と ``.ps`` ファイルだけコピーします。
 
 .. index::
@@ -1251,6 +1733,8 @@ OMakeではLaTeXドキュメントのビルドをサポートします。この
 
 13.7.2.4 LaTeXDocumentInstall
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+.. The LaTeXDocumentInstall builds a document and copies it to an install location in one step.
+
 ``LaTeXDocumentInstall`` 関数はドキュメントをビルドし、加えてインストール先にドキュメントをコピーします。 ::
 
   LaTeXDocumentInstall(<tag>, <libdir>, <installname>, <docname>, <files>)
diff --git a/osh.rst b/osh.rst
index 9ac61eb..b50719a 100644 (file)
--- a/osh.rst
+++ b/osh.rst
@@ -4,6 +4,8 @@
 
 15. OSHシェル
 ==================================
+.. OMake also includes a standalone command-line interpreter osh that can be used as an interactive shell. The shell uses the same syntax, and provides the same features on all platforms omake supports, including Win32.
+
 OMakeはまた、独立して動くコマンドラインインタープリタ ``osh`` を含んでいます。これはインタラクティブなシェルとして使うことができます。このシェルはomakeと同様の文法で使うことができ、さらにWin32を含む、omakeがサポートしているすべてのプラットフォーム上で同様の機能を提供します。
 
 .. index::
@@ -13,24 +15,34 @@ OMakeはまた、独立して動くコマンドラインインタープリタ ``
 
 15.1 起動時
 ----------------------------------
+.. On startup, osh reads the file ~/.oshrc if it exists. The syntax of this file is the same as an OMakefile. The following additional variables are significant.
+
 起動時に、oshは存在しているのであれば ``~/.oshrc`` を読み込みます。このファイルの文法は ``OMakefile`` と同様です。また、以下の追加された変数は、osh上で重要な意味を持ちます。
 
 * **prompt**
   
+  .. The prompt variable specifies the command-line prompt. It can be a simple string.
+  
   ``prompt`` 変数はコマンドラインプロンプトを指定します。この変数は単純な文字列を指定できます。 ::
   
       prompt = osh>
   
+  .. Or you may choose to define it as a function of no arguments.
+  
   あるいは、引数をもたない関数として定義することもできます。 ::
   
       prompt() =
           return $"<$(USER):$(HOST) $(homename $(CWD))>"
   
+  .. An example of the latter prompt is as follows.
+  
   後者のプロンプトの例は以下のようになります。 ::
 
       <jyh:kenai.yapper.org ~>cd links/omake
       <jyh:kenai.yapper.org ~/links/omake>
   
+  .. If you include any "invisible" text in the prompt (such as various terminal escape sequences), they must be wrapped using the prompt-invisible function. For example, to create a bold prompt on terminals that support it, you can use the following.
+  
   プロンプト上にターミナルのエスケープ文字のような『見えない』文字を含ませたい場合は、 ``prompt-invisible`` 関数( :ref:`label10.11.26` )を使ってラップさせなければなりません。例えば、サポートしているターミナル上でプロンプトを太字にしたい場合、以下のように書くことができます。 ::
 
         prompt =
@@ -40,6 +52,8 @@ OMakeはまた、独立して動くコマンドラインインタープリタ ``
 
 * **ignoreeof**
   
+  .. If the ignoreeof is true, then osh will not exit on a terminal end-of-file (usually ^D on Unix systems).
+  
   ``ignoreeof`` が ``true`` の場合、 ``osh`` はターミナルの"end-of-file(EOF)"で終了しません(Unixシステム上では通常 ``^D`` となります)。
 
 .. index::
@@ -48,18 +62,24 @@ OMakeはまた、独立して動くコマンドラインインタープリタ ``
 
 15.2 エイリアス
 ----------------------------------
+.. Command aliases are defined by adding functions to the Shell. object. The following alias adds the -AF option to the ls command.
+
 コマンドのエイリアスは ``Shell.`` オブジェクトに関数を追加することによって定義できます。以下のエイリアスは ``-AF`` オプションを ``ls`` コマンドに追加します。 ::
 
     Shell. +=
        ls(argv) =
           "ls" -AF $(argv)
 
+.. Quoted commands do not undergo alias expansion. The quotation "ls" prevents the alias from being recursive.
+
 クオートされたコマンドはエイリアス展開の影響を受けません。 ``"ls"`` のようにクオーテーションをつけることで、再帰的にエイリアスとなることを防ぎます。
 
 .. _label15.3:
 
 15.3 インタラクティブな文法(syntax)
 -------------------------------------
+.. The interactive syntax in osh is the same as the syntax of an OMakefile, with one exception in regard to indentation. The line before an indented block must have a colon at the end of the line. A block is terminated with a . on a line by itself, or ^D. In the following example, the first line if true has no body, because there is no colon.
+
 ``osh`` でのインタラクティブな文法はインデントという一つの例外を除いて、 ``OMakefile`` の文法と同様です。まず、インデントされたブロックの前にある行は、必ず行の終わりにコロン:をつける必要があります。次に、 ``.`` を行の終わりにつけるか ``^D`` を使うことで、対象のブロックを終了させます。以下の例では、最初の行の ``if true`` はコロンをつけていないため、内容のブロックを持つことはできません。 ::
 
    # 以下のifは内容を持ちません
@@ -71,6 +91,10 @@ OMakeはまた、独立して動くコマンドラインインタープリタ ``
    if>          .
    Hello world
 
+.. Note that osh makes some effort to modify the prompt while in an indented body, and it auto-indents the text.
+
 インデントされたブロックの中にいる際には、プロンプトをいくらか修正する必要があり、かつ ``osh`` は自動的にテキストをインデントすることに注意してください。
 
+.. The colon signifier is also allowed in files, although it is not required.
+
 また、コロン修飾子はファイルにも適用できますが、必須ではありません。
index 1b0178f..be0d373 100644 (file)
@@ -4,6 +4,8 @@
 
 12. 標準的なオブジェクト群
 ==================================
+.. Pervasives defines the objects that are defined in all programs. The following objects are defined.
+
 ここでの『広く使われている』は、すべてのプログラムで使われているオブジェクトを意味しています。以下のオブジェクトが定義されています。
 
 .. _label12.1:
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : 無し
 
+.. The Object object is the root object. Every class is a subclass of Object.
+
 ``Object`` オブジェクトはルートとなるオブジェクトです。すべてのクラスは ``Object`` のサブクラスです。
 
+.. It provides the following fields:
+
 以下のプロパティやメソッドを提供します。
 
+.. the number of fields and methods in the object. 
+   returns true iff the <var> is a field or method of the object.
+   adds the field to the object, returning a new object. 
+   fetches the field or method from the object; it is equivalent to $(o.<var>), but the variable can be non-constant. 
+   maps a function over the object. The function should take two arguments; the first is a field name, the second is the value of that field. The result is a new object constructed from the values returned by the function. 
+   the object-foreach form is equivalent to object-map, but with altered syntax.
+
 * ``$(o.object-length)`` : オブジェクトのメソッドとプロパティの総数
 * ``$(o.object-mem <var>)`` : <var>がオブジェクトのプロパティやメソッドであった場合は ``true`` を返します。
 * ``$(o.object-add <var, <value>)`` : オブジェクトにプロパティを追加した新しいオブジェクトを返します。
 
      o.object-foreach(<var1>, <var2>)
         <body>
-
+  
+  .. For example, the following function prints all the fields of an object o.
+  
   例えば、以下の関数はオブジェクト ``o`` のすべてのプロパティを表示します。 ::
 
        PrintObject(o) =
         o.object-foreach(v, x)
            println($(v) = $(x))
 
+  .. The export form is valid in a object-foreach body. The following function collects just the field names of an object.
+
   ``export`` 文は ``object-foreach`` の内部に適用できます。以下の関数ではオブジェクトのプロパティ名を収集します。 ::
   
      FieldNames(o) =
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Object``
 
+.. A Map object is a dictionary from values to values. The <key> values are restricted to simple values: integers, floating-point numbers, strings, files, directories, and arrays of simple values.
+
 ``Map`` オブジェクトは値から値を返す辞書です。 ``<key>`` の値は単純な型のみが使用できます。具体的には、整数型、浮動小数点型、文字列型、ファイル型、辞書型、そして単純な型で構成された配列です。
 
+.. The Map object provides the following methods.
+
 Mapオブジェクトは以下のメソッドを提供します。
 
+.. the number of items in the map. 
+   returns true iff the <key> is defined in the map. 
+   adds the field to the map, returning a new map. 
+   fetches the field from the map. 
+   fetches an array of all the keys in the map, in alphabetical order. 
+   fetches an array of all the values in the map, in the alphabetical order of the corresponding keys.
+   maps a function over the map. The function should take two arguments; the first is a field name, the second is the value of that field. The result is a new object constructed from the values returned by the function. 
+   the foreach form is equivalent to map, but with altered syntax.
+
 * ``$(o.length)`` : 辞書に格納されているアイテムの総数
 * ``$(o.mem <key>)`` : ``<key>`` が辞書に定義されている場合は ``true`` を返します。
 * ``$(o.add <key>, <value>)`` : 辞書にプロパティを追加した、新しい辞書を返します。
@@ -71,13 +101,17 @@ Mapオブジェクトは以下のメソッドを提供します。
 
      o.foreach(<var1>, <var2>)
         <body>
-
+  
+  .. For example, the following function prints all the fields of an object o.
+  
   例えば、以下の関数はオブジェクト ``o`` のすべてのプロパティを表示します。 ::
 
      PrintObject(o) =
         o.foreach(v, x)
            println($(v) = $(x))
-           
+  
+  .. The export form is valid in a foreach body. The following function collects just the field names of the map.
+   
   ``export`` 文は ``object-foreach`` の内部に適用できます。以下の関数では辞書のプロパティ名を収集します。 ::
 
      FieldNames(o) =
@@ -87,12 +121,16 @@ Mapオブジェクトは以下のメソッドを提供します。
            export
         return $(names)
 
+.. There is also simpler syntax when the key is a string. The table can be defined using definitions with the form $|key| (the number of pipe symbols | is allowed to vary).
+
 キーが文字列である場合には単純な記法が用意されています。キー-値のテーブルは ``$|key|`` の文を用いて定義することができます(パイプシンボル ``|`` の数は、多様性のためにいくらでも使うことができます)。 ::
 
     $|key 1| = value1
     $||key1|key2|| = value2    # キーは key1|key2
     X = $|key 1|               # Xにプロパティの値 $|key 1| を定義
 
+.. The usual modifiers are also allowed. The expression $`|key| represents lazy evaluation of the key, and $,|key| is normal evaluation.
+
 通常用いる修飾子も適用できます。式 ``$`|key|`` はキーの遅延評価として解釈され、また式 ``$,|key|`` は通常の評価を行います。
 
 .. index::
@@ -103,6 +141,8 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Object``
 
+.. The Number object is the parent object for integers and floating-point numbers. 
+
 ``Number`` オブジェクトは整数や浮動小数点の親オブジェクトです。
 
 .. index::
@@ -113,6 +153,8 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Number``
 
+.. The Int object represents integer values. 
+
 ``Int`` オブジェクトは整数を表現します。
 
 .. index::
@@ -123,6 +165,8 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Number``
 
+.. The Float object represents floating-point numbers. 
+
 ``Float`` オブジェクトは浮動小数点を表現します。
 
 .. index::
@@ -133,21 +177,31 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Object``
 
+.. The Sequence object represents a generic object containing sequential elements. It provides the following methods.
+
 ``Sequence`` オブジェクトは一次元的に成分が格納されている、一般的なオブジェクトを表現します。このオブジェクトは以下のメソッドを提供しています。
 
+.. the number of elements in the sequence. 
+   maps a function over the fields in the sequence. The function should take one argument. The result is a new sequence constructed from the values returned by the function.
+   the foreach form is equivalent to map, but with altered syntax.
+
 * ``$(s.length)`` : シーケンスの長さを返します。
 * ``$(s.map <fun>)`` : シーケンスのプロパティ全体に対して関数を適用します。この関数は一つの引数を取ります。結果は関数によって返される値からなる、新しいシーケンスを返します。
 * ``$(s.foreach)`` : ``foreach`` 文は ``map`` と等価ですが、別の文法を適用できます。 ::
 
      s.foreach(<var>)
         <body>
-
+  
+  .. For example, the following function prints all the elements of the sequence.
+  
   例えば、以下の関数ではシーケンスのすべての成分を表示します。 ::
 
      PrintSequence(s) =
         s.foreach(x)
            println(Elem = $(x))
-
+  
+  .. The export form is valid in a foreach body. The following function counts the number of zeros in the sequence.
+  
   ``export`` 文は ``foreach`` の内部に適用できます。以下の関数はシーケンスの0の数を数えます。 ::
   
      Zeros(s) =
@@ -159,8 +213,16 @@ Mapオブジェクトは以下のメソッドを提供します。
            export
         return $(count)
 
+.. tests whether each element of the sequence satifies a predicate. 
+
 * ``$(s.forall <fun>)`` : シーケンスの各々の成分が、与えられた関数の評価を満足しているかどうか調べます。
+
+.. tests whether the sequence contains an element that satisfies a predicate. 
+
 * ``$(s.exists <fun>)`` : シーケンスに与えられた関数の評価を満足するような成分があるかどうか調べます。
+
+.. sorts a sequence. The <fun> is a comparison function. It takes two elements (x, y) of the sequence, compares them, and returns a negative number if x < y, a positive number if x > y, and zero if the two elements are equal.
+
 * ``$(s.sort <fun>)`` : シーケンスをソートします。 ``<fun>`` は比較用の関数です。この関数は二つの成分 ``(x, y)`` を持つシーケンスを引数に取り、x,yを比較して、もし x < y であったのなら負の値を返し、 x > y であったなら正の値を返し、二つの成分が等価であったなら0を返します。 ::
 
     osh> items = $(int 0 3 -2)
@@ -180,8 +242,13 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Sequence``
 
+.. The Array is a random-access sequence. It provides the following additional methods.
+
 ``Array`` は自由にアクセスできるシーケンスです。このオブジェクトは以下の追加メソッドを提供しています。
 
+.. returns element i of the sequence. 
+   returns the reversed sequence. 
+
 * ``$(s.nth <i>)`` : シーケンスの ``i`` 番めの成分を返します。
 * ``$(s.rev <i>)`` : 逆転させたシーケンスを返します。
 
@@ -201,8 +268,12 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Object``
 
+.. The Fun object provides the following methods. 
+
 ``Fun`` オブジェクトは以下のメソッドを提供しています。
 
+.. the arity if the function. 
+
 * ``$(f.arity)`` : 関数の場合はアリティ(関数が取る引数の個数)を返します。
 
 .. index::
@@ -213,6 +284,8 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Object``
 
+.. The Rule object represents a build rule. It does not currently have any methods. 
+
 ``Rule`` オブジェクトはビルドルールを表現します。これは現在なんのメソッドも持っていません。
 
 .. index::
@@ -223,8 +296,19 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Object``
 
+.. The Target object contains information collected for a specific target file.
+
 ``Target`` オブジェクトは指定したターゲットファイルの情報を収集しているオブジェクトです。
 
+.. the target file. 
+   the files that may be modified by a side-effect when this target is built. 
+   static dependencies that must be built before this target can be scanned. 
+   statically-defined build dependencies of this target. 
+   all the build dependencies for the target, including static and scanned dependencies. 
+   all the value dependencies associated with the build.
+   the commands to build the target. 
+   if output was diverted to a file, with one of the --output-* options A, this field names that file. Otherwise it is false. 
+
 * ``target`` : ターゲットファイル
 * ``effects`` : ターゲットがビルドされたときに、副次的に修正されるであろうファイル群
 * ``scanner_deps`` : ターゲットがスキャンできるようになる前にビルドしなければならない静的な依存関係
@@ -234,11 +318,18 @@ Mapオブジェクトは以下のメソッドを提供します。
 * ``build-commands`` : ターゲットをビルドするためのコマンド
 * ``output-file`` : ``--output-*`` オプション(A.を参照)を用いて、出力が適当なファイルに書き込まれるような場合、このプロパティはファイル名を表します。そうでない場合は ``false`` を示します。
 
+.. The object supports the following methods.
+
 このオブジェクトは以下のメソッドをサポートしています。
 
+.. returns a Target object for the given file. Raises a RuntimeException if the specified target is not part of the project. 
+   returns a Target object for the given file, or false if the file is not part of the project. 
+
 * ``find(file)`` : 与えられたファイルのターゲットオブジェクトを返します。指定したターゲットがプロジェクトの一部でない場合は ``RuntimeException`` を送出します。
 * ``find-optional(file)`` : 与えられたファイルのターゲットオブジェクトを返します。指定したターゲットがプロジェクトの一部でない場合は ``false`` を返します。
 
+.. NOTE: the information for a target is constructed dynamically, so it is possible that the Target object for a node will contain different values in different contexts. The easiest way to make sure that the Target information is complete is to compute it within a rule body, where the rule depends on the target file, or the dependencies of the target file.
+
 .. note::
   ターゲットの情報は動的に構築されるので、あるノードの ``Target`` オブジェクトは異なる箇所で異なった値を含む場合があります。 ``Target`` の情報が完全にするためのもっとも簡単な方法は、対象のターゲットファイルに依存しているルール中、もしくは対象のターゲットファイルの依存関係の中で ``Target`` オブジェクトを計算することです。
 
@@ -250,8 +341,19 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Object``
 
+.. The Node object is the parent object for files and directories. It supports the following operations. 
+
 ``Node`` オブジェクトはファイルやディレクトリの親オブジェクトです。このオブジェクトは以下の操作をサポートしています。
 
+.. returns a stat object for the file. If the file is a symbolic link, the stat information is for the destination of the link, not the link itself.
+   returns a stat object for the file or symbolic link.
+   removes the file. 
+   renames the file. 
+   creates a hard link <dst> to this file. 
+   create a symbolic link <dst> to this file. 
+   change the permission of this file. 
+   change the owner and group id of this file. 
+
 * ``$(node.stat)`` : ファイルの ``stat`` オブジェクトを返します。もしファイルがシンボリックリンクであったなら、 ``stat`` の情報はリンク先になります。リンク自身ではありません。
 * ``$(node.lstat)`` : ファイルか、シンボリックリンクの ``stat`` オブジェクトを返します。
 * ``$(node.unlink)`` : ファイルを消去します。
@@ -269,6 +371,8 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Node``
 
+.. The file object represents the name of a file. 
+
 ``File`` オブジェクトはファイル名を表現します。
 
 .. index::
@@ -279,6 +383,8 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Node``
 
+.. The Dir object represents the name of a directory. 
+
 ``Dir`` オブジェクトはディレクトリ名を表現します。
 
 .. index::
@@ -289,8 +395,13 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Object``
 
+.. A Channel is a generic IO channel. It provides the following methods. 
+
 ``Channel`` オブジェクトは一般的なIOチャネルを表現します。このオブジェクトは以下のメソッドを提供しています。
 
+.. close the channel. 
+   returns the file name associated with the channel. 
+
 * ``$(o.close)`` : チャネルを閉じます。
 * ``$(o.name)`` : チャネルに関係しているファイル名を返します。
 
@@ -302,10 +413,19 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Channel``
 
+.. A InChannel is an input channel. The variable stdin is the standard input channel.
+
 ``InChannel`` は入力チャネルです。変数 ``stdin`` は標準入力チャネルです。
 
+.. It provides the following methods. 
+
 このオブジェクトは以下のメソッドを提供しています。
 
+.. open a new input channel. 
+   open a new input channel, using a string as input. 
+   reads the given number of characters from the channel 
+   reads a line from the channel 
+
 * ``$(InChannel.fopen <file>)`` : 新しい入力チャネルを開きます。
 * ``$(InChannel.of-string <string>)`` : 文字列を入力として、新しい入力チャネルを開きます。
 * ``$(o.read <number>)`` : チャネルから、与えられた数だけ文字を読み込みます。
@@ -319,10 +439,22 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Channel``
 
+.. A OutChannel is an output channel. The variables stdout and stderr are the standard output and error channels.
+
 ``OutChannel`` は出力チャネルです。変数 ``stdout`` と ``stderr`` は標準出力とエラーチャネルです。
 
+.. It provides the following methods. 
+
 このオブジェクトは以下のメソッドを提供しています。
 
+.. open a new output channel. 
+   open a new output channel, writing to a string. 
+   get the current string of output, for an output channel created as OutChannel.open-string. 
+   opens a new output channel, appending to the file. 
+   flush the output channel. 
+   print a string to the channel. 
+   print a string to the channel, followed by a line terminator. 
+
 * ``$(OutChannel.fopen <file>)`` : 新しい出力チャネルを開きます。
 * ``$(OutChannel.string)`` : 文字列を書き込む、新しい出力チャネルを開きます。
 * ``$(OutChannel.to-string)`` : 出力チャネルの現在の文字列を取得し、出力チャネルは ``OutChannel.open-string`` として生成します???
@@ -339,6 +471,8 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Location``
 
+.. The Location object represents a location in a file. 
+
 ``Location`` オブジェクトはファイルの位置を表現します。
 
 .. index::
@@ -349,6 +483,8 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Object``
 
+.. The Exception object is used as the base object for exceptions. It has no fields. 
+
 ``Exception`` オブジェクトは例外の基底となるオブジェクトとして用いられます。このオブジェクトはなんのプロパティやメソッドを持ちません。
 
 .. index::
@@ -359,8 +495,13 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Exception``
 
+.. The RuntimeException object represents an exception from the runtime system. It has the following fields.
+
 ``RuntimeException`` オブジェクトはランタイムシステムからの例外を表現します。このオブジェクトは以下のプロパティを持ちます。
 
+.. a string representing the location where the exception was raised.
+   a string containing the exception message. 
+
 * ``position`` : 例外が送出された位置を表現している文字列
 * ``message`` : 例外のメッセージを保持している文字列
 
@@ -372,8 +513,13 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Exception``
 
+.. The UnbuildableException object should be used to signal that a target is not buildable. It will be caught by functions such as target-exists. This exception has the following fields:
+
 ``UnbuildableException`` オブジェクトはターゲットがビルドできないことを知らせるために用いられます。このオブジェクトは ``target-exists()`` のような関数を使った場合に捕えられます。この例外は以下のプロパティを持ちます。
 
+.. indicates which target is not buildable. 
+   a string containing the exception message. 
+
 * ``target`` : どのターゲットがビルドできないのかを示します。
 * ``message`` : 例外のメッセージを含んでいる文字列
 
@@ -385,20 +531,30 @@ Mapオブジェクトは以下のメソッドを提供します。
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 親オブジェクト : ``Object``
 
+.. The Shell object contains the collection of builtin functions available as shell commands.
+
 ``Shell`` オブジェクトはシェルコマンドとして利用できるビルドイン関数のコレクションを含んでいます。
 
+.. You can define aliases by extending this object with additional methods. All methods in this class are called with one argument: a single array containing an argument list.
+
 あなたはこのオブジェクトにメソッドを追加し拡張することで、エイリアスを定義することができます。このクラスの中にあるすべてのメソッドは一つの引数をとる必要があります。引数には引数のリストが含まれた、単純な配列が与えられます。
 
 * ``echo``
-
+  
+  .. The echo function prints its arguments to the standard output channel. 
+  
   ``echo`` 関数は引数を標準出力チャネルに表示します。
 
 * ``jobs``
+  
+  .. The jobs method prints the status of currently running commands. 
 
   ``jobs`` メソッドは現在実行しているコマンドの状態を表示します。
   
 * ``cd``
-
+  
+  .. The cd function changes the current directory. Note that the current directory follows the usual scoping rules. For example, the following program lists the files in the foo directory, but the current directory is not changed.
+  
   ``cd`` 関数はカレントディレクトリを変更します。カレントディレクトリは現在のスコーピングルールに従うことに注意してください。例えば、以下のプログラムでは ``foo`` ディレクトリのファイルをリストしていますが、カレントディレクトリは変更されません。 ::
   
      section
@@ -410,70 +566,104 @@ Mapオブジェクトは以下のメソッドを提供します。
      ls
 
 * ``bg``
-
+  
+  .. The bg method places a job in the background. The job is resumed if it has been suspended. 
+  
   ``bg`` メソッドはバックグラウンドにジョブを移します。ジョブが中断(suspended)されている場合、そのジョブは再開されます。
 
 * ``fg``
-
+  
+  .. The fg method brings a job to the foreground. The job is resumed if it has been suspended. 
+  
   ``fg`` メソッドはジョブをフォアグラウンドに持っていきます。ジョブが中断されている場合、そのジョブは再開されます。
   
 * ``stop``
-
+  
+  .. The stop method suspends a running job. 
+  
   ``stop`` 関数は実行しているジョブを中断します。
 
 * ``wait``
-
+  
+  .. The wait function waits for a running job to terminate. It is not possible to wait for a suspended job.
+  
   ``wait`` 関数は実行しているジョブが終了するまで待機します。この関数は、中断しているジョブを待機することができません。
   
+  .. The job is not brought to the foreground. If the wait is interrupted, the job continues to run in the background. 
+  
   ジョブをフォアグラウンドに持っていくことはしません。また、 ``wait`` が割り込まれた場合、ジョブはバックグラウンド上で実行し続けます。
 
 * ``kill``
   
+  .. The kill function signal a job.
+  
   ``kill`` 関数はジョブにシグナルを送ります。 ::
   
     kill [signal] <pid...>.
   
+  .. The signals are either numeric, or symbolic. The symbolic signals are named as follows.
+  
   シグナルは数値かシンボリックのどちらでも構いません。シンボリックシグナルは以下のように命名されています。
   
   ABRT, ALRM, HUP, ILL, KILL, QUIT, SEGV, TERM, USR1, USR2, CHLD, STOP, TSTP, TTIN, TTOU, VTALRM, PROF
 
 * ``exit``
-
+  
+  .. The exit function terminates the current session. 
+  
   ``exit`` 関数は現在のセッションを終了します。
 
 * ``which`` , ``where``
-
+  
+  .. See the documentation for the corresponding functions. 
+  
   相当する関数のドキュメントを参照します。
 
 * ``rehash``
-
+  
+  .. Reset the search path. 
+  
   検索パスをリセットします。
 
 * ``ln-or-cp`` *src dst*
-
+  
+  .. Links or copies src to dst, overwriting dst. Namely, ln-or-cp would first delete the dst file (unless it is a directory), if it exists. Next it would try to create a symbolic link dst poiting to src (it will make all the necessary adjustmnents of relative paths). If symbolic link can not be created (e.g. the OS or the filesystem does not support symbolic links), it will try to create a hard link. If that fails too, it will try to forcibly copy src to dst. 
+  
   *src* を *dst* にリンクもしくはコピーします。 *dst* は上書きされます。通常、 ``ln-or-cp`` は初めに出力先のファイルを(存在している場合は)消去します。次にこの関数は入力先のファイルを指し示しているシンボリックリンクを出力先に生成します(パスはできる限り相対パスとして設定されます)。シンボリックリンクが生成できない場合(例. OSやファイルシステムがシンボリックリンクをサポートしていない場合)、この関数はハードリンクを生成しようと試みます。もしこの試みも失敗したのなら、強制的に入力先のファイルを出力先にコピーしようとするでしょう。
 
 * ``history``
-
+  
+  .. Print the current command-line history. 
+  
   現在のコマンドライン履歴を表示します。
 
 * ``digest``
   
+  .. Print the digests of the given files. 
+  
   与えられたファイルの要約を出力します。
 
 * Win32 関数群
-
+  
+  .. Win32 doesn't provide very many programs for scripting, except for the functions that are builtin to the DOS cmd.exe. The following functions are defined on Win32 and only on Win32. On other systems, it is expected that these programs already exist.
+  
   Win32ではスクリプトのために使える、多くのプログラム(DOS ``cmd.exe`` に含まれている関数を除く)を提供しています。以下の関数はWin32で定義されており、Win32上でしか使えません。他のシステム上では、この関数はすでに存在している他のプログラムに置き換わることになるでしょう。
   
   * ``grep``
     ::
 
        grep [-q] [-n] pattern files...
-
+    
+    .. The grep function calls the omake grep function. 
+    
     ``grep`` 関数はomakeの ``grep`` 関数を呼び出します。
 
-* omake内部の標準システムコマンド
+.. Internal versions of standard system commands.
 
+* omake内部の標準システムコマンド
+  
+  .. By default, omake uses internal versions of the following commands: cp, mv, cat, rm, mkdir, chmod, test, find. If you really want to use the standard system versions of these commands, set the USE_SYSTEM_COMMANDS as one of the first definitions in your OMakeroot file.
+  
   通常、以下のコマンドはomakeが内部に保有している関数を使います: ``cp`` , ``mv`` , ``cat`` , ``rm`` , ``mkdir`` , ``chmod`` , ``test`` , ``find`` 。もしあなたがどうしてもこれらのコマンドを、システムが標準で使っているコマンドで呼び出したいのなら、 ``USE_SYSTEM_COMMANDS`` を ``OMakeroot`` ファイルの先頭に設定してください。
   
   * ``pwd``
@@ -481,6 +671,8 @@ Mapオブジェクトは以下のメソッドを提供します。
     
         pwd
     
+    .. The pwd alias would print the absolute path to current directory.
+    
     ``pwd`` エイリアスはカレントディレクトリの絶対パスを表示します。
   
   * ``mkdir``
@@ -488,6 +680,8 @@ Mapオブジェクトは以下のメソッドを提供します。
     
         mkdir [-m <mode>] [-p] files
     
+    .. The mkdir function is used to create directories. The -verb+-m+ option can be used to specify the permission mode of the created directory. If the -p option is specified, the full path is created. 
+    
     ``mkdir`` 関数はディレクトリを生成します。-verb+-m+ オプションには生成されるディレクトリのパーミッションを指定します。 ``-p`` オプションが指定された場合、存在しない親ディレクトリもまとめて生成します。
   
   * ``cp``
@@ -500,18 +694,26 @@ Mapオブジェクトは以下のメソッドを提供します。
         mv [-f] [-i] [-v] src dst
         mv [-f] [-i] [-v] files dst
     
+    .. The cp function copies a src file to a dst file, overwriting it if it already exists. If more than one source file is specified, the final file must be a directory, and the source files are copied into the directory.
+    
     ``cp`` 関数は ``src`` ファイルを ``dst`` ファイルにコピーします。出力先のファイルが存在している場合は上書きします。一つ以上の入力ファイルが指定された場合、最後のファイルはディレクトリでなければならず、入力ファイルはそのディレクトリの内部にコピーされます。
 
     * **-f**
       
+      .. Copy files forcibly, do not prompt. 
+      
       確認せずに、強制的にファイルをコピーします。
     
     * **-i**
-    
+      
+      .. Prompt before removing destination files. 
+      
       出力先のファイルを消去する前に確認します。
     
     * **-v**
-    
+      
+      .. Explain what is happening. 
+      
       実際になにが行われているのか表示します。
   
   * ``rm``
@@ -520,24 +722,34 @@ Mapオブジェクトは以下のメソッドを提供します。
        rm [-f] [-i] [-v] [-r] files
        rmdir [-f] [-i] [-v] [-r] dirs
     
+    .. The rm function removes a set of files. No warnings are issued if the files do not exist, or if they cannot be removed.
+    
     ``rm`` 関数はファイルの集合を消去します。ファイルが存在しなかった場合、もしくはファイルが消去できなかった場合、なんの警告も表示しません。
     
     オプション:
     
     * **-f**
       
+      .. Forcibly remove files, do not prompt. 
+      
       確認せずに、強制的にファイルを消去します。
     
     * **-i**
       
+      .. Prompt before removal. 
+      
       ファイルを消去する前に確認します。
     
     * **-v**
       
+      .. Explain what is happening. 
+      
       実際になにが行われているのか表示します。
     
     * **-r**
-    
+      
+      .. Remove contents of directories recursively. 
+      
       再帰的にディレクトリの内容を消去します。
   
   * ``chmod``
@@ -545,20 +757,28 @@ Mapオブジェクトは以下のメソッドを提供します。
     
         chmod [-r] [-v] [-f] mode files
     
+    .. The chmod function changes the permissions on a set of files or directories. This function does nothing on Win32. The mode may be specified as an octal number, or in symbolic form [ugoa]*[-=][rwxXstugo]+. See the man page for chmod for details.
+    
     ``chmod`` 関数はファイルの集合やディレクトリのパーミッションを変更します。この関数はWin32上ではなにも行いません。 ``mode`` には8進数か、シンボリックフォーム ``[ugoa]*[-=][rwxXstugo]+`` を指定します。詳細は ``chmod`` のmanを参照してください。
     
     オプション:
     
     * **-r**
-    
+      
+      .. Change permissions of all files in a directory recursively. 
+      
       ディレクトリ内のすべてのファイルのパーミッションを再帰的に変更します。
     
     * **-v**
-    
+      
+      .. Explain what is happening. 
+      
       実際になにが行われているのか表示します。
       
     * **-f**
       
+      .. Continue on errors. 
+      
       エラーが生じても実行し続けます。
   
   * ``cat``
@@ -566,6 +786,8 @@ Mapオブジェクトは以下のメソッドを提供します。
     
        cat files...
     
+    .. The cat function prints the contents of the files to stdout 
+    
     ``cat`` 関数はファイルの内容をstdoutに出力します。
   
   * ``test``
@@ -576,11 +798,15 @@ Mapオブジェクトは以下のメソッドを提供します。
       [ --help
       [ --version
     
-    詳細は ``test`` 関数のドキュメントを参照してください。
+    .. See the documentation for the test function.
+    
+    詳細は ":ref:`label10.7.1`" を参照してください。
   
   * ``find``
     ::
     
       find expression
     
-    詳細は ``find`` 関数のドキュメントを参照してください。
+    .. See the documentation for the find function.
+    
+    詳細は ":ref:`label10.7.2`" を参照してください。
index d114764..2926c2d 100644 (file)
--- a/shell.rst
+++ b/shell.rst
@@ -4,8 +4,12 @@
 
 11. シェルコマンド
 ==================================
+.. Shell commands (commands to be executed by the operating system) can be freely mixed with other code.
+
 シェルコマンド(OSによって実行されるコマンド)は自由に他のコードとミックスすることができます。
 
+.. NOTE: the syntax and shell usage is identical on all platforms, including Win32. To avoid portability problems on Win32, it is recommended that you avoid the use of the native shell interpreter cmd.
+
 .. note::
     文法とシェルの使い方はすべてのプラットフォーム(Win32を含む)において同一です。Win32上に移植した場合の問題を避けるために、ネイティブのインタープリター ``cmd`` を使わないことをおすすめします。 ::
 
@@ -17,6 +21,8 @@
 
 11.1 簡単なコマンド
 ----------------------------------
+.. The syntax of shell commands is similar to the syntax used by the Unix shell bash. In general, a command is a pipeline. A basic command is part of a pipeline. It is specified with the name of an executable and some arguments. Here are some examples.
+
 シェルコマンドの文法はUnixシェル ``bash`` を使うときの文法と似ています。
 通常、コマンドは *パイプライン* となっています。通常のコマンドはパイプラインの一部です。コマンドを実行するためには、実行可能なコマンド名といくつかの引数を指定する必要があります。以下はいくつかの例です。 ::
 
     ls -AF .
     echo Hello world
 
+.. The command is found using the current search path in the variable PATH[], which should define an array of directories containing executables.
+
 コマンドは実行可能コマンドが格納されているディレクトリの配列 ``PATH[]`` 変数の値を用いて探します。
 
+.. A command may also be prefixed by environment variable definitions.
+
 コマンドは環境変数の定義によって修正されることがあります。 ::
 
     # "Hello world" と出力
@@ -37,6 +47,8 @@
 
 11.2 検索
 ----------------------------------
+.. Commands may contain wildcard patterns. A pattern specifies a set of files through a limited kind of regular expression. Patterns are expanded before the function is executed.
+
 コマンドにはワイルドカードパターンを含めることができます。パターンには制限された正規表現を用いたファイルの集合を指定します。パターンは関数が実行される前に展開されます。 ::
 
    # .c 拡張子のファイルをすべてリスト
 
    # hello.mlファイルをfoo.mlにリネーム
    mv {hello,foo}.ml
-   
+
+.. A comprehensive description of OMake glob patterns is given in Section 10.4.
+
 Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えられます。
 
 .. _label11.3:
 
 11.3 バックグラウンドでのジョブ
 ----------------------------------
+.. The command may also be placed in the background by placing an ampersand after the command. Control returns to the shell without waiting for the job to complete. The job continues to run in the background.
+
 コマンドはまたアンパサンド&をコマンドの後に付与することで、バックグラウンド上で実行されます。ユーザへの制御は、ジョブが完了するまで待つことなく返されます。ジョブはバックグラウンド上で走り続けます。 ::
 
     gcc -o hugeprogram *.c &
@@ -64,6 +80,8 @@ Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えら
 
 11.4 ファイルのリダイレクション
 ----------------------------------
+.. Input and output can be redirected to files by using the <, >, and >& directives after the command.
+
 入力と出力は ``<`` , ``>`` , ``>&`` をコマンドの後に付与することによって、ファイルにリダイレクトすることができます。 ::
 
     # "foo" ファイルに書き込み
@@ -81,6 +99,8 @@ Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えら
 
 11.5 パイプライン
 ----------------------------------
+.. Pipelines are sequences of commands, where the output from each command is sent to the next. Pipelines are defined with the | and |& syntax. With | the output is redirected, but errors are not. With |& both output and errors are redirected.
+
 パイプラインはコマンドのシーケンスで、各々のコマンドの出力は次のコマンドへ送られます。パイプは ``|`` と ``|&`` で定義されます。 ``|`` は出力はリダイレクトされますが、エラーはされません。 ``|&`` は出力とエラーの両方がリダイレクトされます。 ::
 
    # lsコマンドの出力をプリンターに送る
@@ -95,6 +115,8 @@ Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えら
 
 11.6 実行の条件分岐
 ----------------------------------
+.. Commands may also be composed though conditional evaluation using the || and && syntax. Every command has an integer exit code, which may be zero or some other integer. A command is said to succeed if its exit code is zero. The expression command1 && command2 executes command2 only if command1 succeeds. The expression command1 || command2 executes command2 only if command1 fails.
+
 コマンドは ``||`` と ``&&`` の条件分岐を使うことで複雑に組み合わせることができます。すべてのコマンドは0か他の整数の終了コードを返します。コマンドは終了コードが0であった場合、成功したと宣言します。式 ``command1 && command2`` は、 ``command1`` が成功した場合のみ ``command2`` が実行されます。式 ``command1 || command2`` は、 ``command1`` が失敗した場合のみ ``command2`` が実行されます。 ::
 
    # 可能な場合のみx/yファイルを表示する
@@ -109,6 +131,8 @@ Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えら
 
 11.7 グループ化
 ----------------------------------
+.. Parenthesis are used for grouping in a pipeline or conditional command. In the following expression, the test function is used to test whether the foo.exe file is executable. If it is, the foo.exe file is executed. If the file is not executable (or if the foo.exe command fails), the message "foo.exe is not executable" is printed.
+
 パイプラインをグループ化したり、条件分岐をさせる場合には括弧を使います。以下の式では、 ``test`` 関数は ``foo.exe`` ファイルが実行可能であるかどうか試し、もしそうであったのなら、 ``foo.exe`` ファイルが実行されます。もし実行可能でなかったのなら(あるいは ``foo.exe`` コマンドが失敗したのなら)、メッセージ ``"foo.exe is not executable"`` が表示されます。 ::
 
    # foo.exeを実行するか、エラーメッセージを表示する
@@ -118,8 +142,15 @@ Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えら
 
 11.8 シェルコマンドとは何か?
 ----------------------------------
+.. Syntactially, shell commands are any line that is not one of the following
+
 文法的には、シェルコマンドは以下のうち一つも該当していない任意の行を指します。
 
+.. A variable definition of the form VAR=string
+   A function call f(...) or method call o.f(...)
+   A rule definition containing a colon string: ...
+   A special command, including the following: 
+
 * ``VAR=string`` の形の変数定義
 * 関数の呼び出し ``f(...)`` かメソッドの呼び出し ``o.f(...)``
 * コロン:を含んだルールの定義 ``string: ...``
@@ -130,6 +161,8 @@ Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えら
     * ``section ...``
     * ``return ...``
 
+.. Commands may also be builtin (aliases). See the documentation for the Shell object for more information.
+
 コマンドはまたビルドイン(エイリアス)でもあります。さらなる情報はShellオブジェクトのドキュメントを参照してください。
 
 .. _label11.9:
@@ -143,6 +176,8 @@ Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えら
 
 11.9.1 echo
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. The echo function prints a string.
+
 ``echo`` 関数は文字列を表示します。 ::
 
   $(echo <args>)
@@ -154,23 +189,33 @@ Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えら
 
 11.9.2 cd
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. The cd function changes the current directory.
+
 ``cd`` 関数はカレントディレクトリを変更します。 ::
 
     cd(dir)
        dir : Dir
 
+.. The cd function also supports a 2-argument form:
+
 ``cd`` 関数は2つの引数を取ることもできます。 ::
 
     $(cd dir, e)
        dir : Dir
        e : expression
 
+.. In the two-argument form, expression e is evaluated in the directory dir. The current directory is not changed otherwise.
+
 2つ引数を取る形では、式 ``e`` がディレクトリ ``dir`` 上で評価されます。カレントディレクトリは変更されません。
 
+.. The behavior of the cd function can be changed with the CDPATH variable, which specifies a search path for directories. This is normally useful only in the osh command interpreter.
+
 ``cd`` 関数のふるまいはディレクトリの検索パスを指定している ``CDPATH`` 変数を用いて変更できます。これは通常、oshコマンドインタープリタ上でのみ有効です。 ::
 
     CDPATH : Dir Sequence
 
+.. For example, the following will change directory to the first directory ./foo, ~/dir1/foo, ~/dir2/foo.
+
 例えば、以下の式ではディレクトリを最初のディレクトリ ``./foo`` , ``~/dir1/foo`` , ``~/dir2/foo`` に変更します。 ::
 
     CDPATH[] =
@@ -190,6 +235,8 @@ Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えら
 
 11.10.1 jobs
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. The jobs function prints a list of jobs.
+
 ``jobs`` 関数はジョブのリストを表示します。 ::
 
   jobs
@@ -200,6 +247,8 @@ Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えら
 
 11.10.2 bg
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. The bg function places a job in the background.
+
 ``bg`` 関数はバックグラウンド上にジョブを配置します。 ::
 
   bg <pid...>
@@ -210,6 +259,8 @@ Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えら
 
 11.10.3 fg
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. The fg function brings a job to the foreground.
+
 ``fg`` 関数はジョブをフォアグラウンドに持っていきます。 ::
 
   fg <pid...>
@@ -220,6 +271,8 @@ Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えら
 
 11.10.4 stop
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. The stop function suspends a job.
+
 ``stop`` 関数はジョブを停止(suspends)します。 ::
 
   stop <pid...>
@@ -230,6 +283,8 @@ Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えら
 
 11.10.5 wait
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. The wait function waits for a job to finish. If no process identifiers are given, the shell waits for all jobs to complete.
+
 ``wait`` 関数はジョブが完了するまで待機します。プロセス固有の値が指定されなかった場合、シェルはすべてのジョブが完了するまで待機します。 ::
 
   wait <pid...>
@@ -240,6 +295,8 @@ Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えら
 
 11.10.6 kill
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. The kill function signals a job.
+
 ``kill`` 関数はジョブにシグナルを送ります。 ::
 
   kill [signal] <pid...>
@@ -262,10 +319,18 @@ Omakeのglobパターンのさらなる説明は ":ref:`label10.4`" で与えら
     history-file : File
     history-length : Int
 
+.. The history variables manage the command-line history in osh. They have no effect in omake.
+
 ヒストリ変数はosh上のコマンドライン履歴を管理します。これらの変数はomakeに影響を及ぼしません。
 
+.. The history-index variable is the current index into the command-line history. The history variable is the current command-line history.
+
 ``history-index`` 変数はコマンドライン履歴における、現在のインデックスを表します。 ``history`` 変数は現在のコマンドライン履歴を表します。
 
+.. The history-file variable can be redefined if you want the command-line history to be saved. The default value is ~/.omake/osh_history.
+
 コマンドライン履歴を保存したいと思った場合、あなたは ``history-file`` 変数を再定義することができます。デフォルトの値は ``~/.omake/osh_history`` です。
 
+.. The history-length variable can be redefined to specify the maximum number of lines in the history that you want saved. The default value is 100. 
+
 コマンドライン履歴の行数の最大値を指定したい場合、あなたは ``history-length`` 変数を再定義することができます。デフォルトの値は ``100`` です。
index 1fc22f4..77abd6e 100644 (file)
@@ -2996,11 +2996,11 @@ omakeでは、字句の解析は ``Lexer`` クラスを継承することによ
 
 .. Next, the productions in the grammar are listed as rules. The name of the production is listed before the colon, and a sequence of variables is listed to the right of the colon. The body is a semantic action to be evaluated when the production is recognized as part of the input.
 
-次ã\81«ã\80\81æ\96\87æ³\95ã\81®ä¸­ã\81®ç\9f­æ\96\87(productions)ã\81¯ã\83«ã\83¼ã\83«ã\81«å¾\93ã\81£ã\81¦ä¸¦ã\81¹ã\82\89ã\82\8cã\81¾ã\81\99ã\80\82ç\9f­æ\96\87ã\81®å\90\8då\89\8dã\81¯ã\82³ã\83­ã\83³ã\81®å\89\8dã\81«æ\8c\87å®\9aã\81\97ã\80\81å¤\89æ\95°ã\81®ã\82·ã\83¼ã\82±ã\83³ã\82¹ã\81¯ã\82³ã\83­ã\83³ã\81®å¾\8cã\81«æ\8c\87å®\9aã\81\97ã\81¾ã\81\99ã\80\82å\86\85容é\83¨ã\81«ã\81¯ã\80\81ç\9f­æ\96\87が入力の一部として解釈された場合における、意味論的な行動(semantic action)を指定します。
+次ã\81«ã\80\81æ\96\87æ³\95ã\81®ä¸­ã\81®ç\94\9fæ\88\90é\83¨(productions)ã\81¯ã\83«ã\83¼ã\83«ã\81«å¾\93ã\81£ã\81¦ä¸¦ã\81¹ã\82\89ã\82\8cã\81¾ã\81\99ã\80\82ç\94\9fæ\88\90é\83¨ã\81®å\90\8då\89\8dã\81¯ã\82³ã\83­ã\83³ã\81®å\89\8dã\81«æ\8c\87å®\9aã\81\97ã\80\81å¤\89æ\95°ã\81®ã\82·ã\83¼ã\82±ã\83³ã\82¹ã\81¯ã\82³ã\83­ã\83³ã\81®å¾\8cã\81«æ\8c\87å®\9aã\81\97ã\81¾ã\81\99ã\80\82å\86\85容é\83¨ã\81«ã\81¯ã\80\81ç\94\9fæ\88\90é\83¨が入力の一部として解釈された場合における、意味論的な行動(semantic action)を指定します。
 
 .. In this example, these are the productions for the arithmetic expressions recognized by the desktop calculator. The semantic action performs the calculation. The variables ``$1, $2, ...`` correspond to the values associated with each of the variables on the right-hand-side of the production.
 
-ä»\8aå\9b\9eã\81®ä¾\8bã\81§ã\81¯ã\80\81ã\83\87ã\82¹ã\82¯ã\83\88ã\83\83ã\83\97ã\81®è¨\88ç®\97æ©\9fã\81«ã\82\88ã\81£ã\81¦è§£æ\9e\90ã\81\95ã\82\8cã\81\9fç®\97è¡\93å¼\8fã\82\92ç\94\9fæ\88\90ã\81\97ã\81¦ã\81\84ã\81¾ã\81\99ã\80\82ä»\8aå\9b\9eã\81®å ´å\90\88ã\80\81ã\80\8eæ\84\8få\91³è«\96ç\9a\84ã\81ªè¡\8cå\8b\95ã\80\8fã\81¯æ\95°å\80¤è¨\88ç®\97ã\81¨ã\81\97ã\81¦ã\81µã\82\8bã\81¾ã\81\84ã\81¾ã\81\99ã\80\82å¤\89æ\95° ``$1, $2, ...`` ã\81¯ç\9f­æ\96\87の右から順に、各々の変数に関連付けられた値として扱われます。
+ä»\8aå\9b\9eã\81®ä¾\8bã\81§ã\81¯ã\80\81ã\83\87ã\82¹ã\82¯ã\83\88ã\83\83ã\83\97ã\81®è¨\88ç®\97æ©\9fã\81«ã\82\88ã\81£ã\81¦è§£æ\9e\90ã\81\95ã\82\8cã\81\9fç®\97è¡\93å¼\8fã\82\92ç\94\9fæ\88\90ã\81\97ã\81¦ã\81\84ã\81¾ã\81\99ã\80\82ä»\8aå\9b\9eã\81®å ´å\90\88ã\80\81ã\80\8eæ\84\8få\91³è«\96ç\9a\84ã\81ªè¡\8cå\8b\95ã\80\8fã\81¯æ\95°å\80¤è¨\88ç®\97ã\81¨ã\81\97ã\81¦ã\81µã\82\8bã\81¾ã\81\84ã\81¾ã\81\99ã\80\82å¤\89æ\95° ``$1, $2, ...`` ã\81¯ç\94\9fæ\88\90é\83¨の右から順に、各々の変数に関連付けられた値として扱われます。
 
 .. _label10.11.14:
 
@@ -3016,19 +3016,31 @@ omakeでは、字句の解析は ``Lexer`` クラスを継承することによ
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 .. The parser generator generates a pushdown automation based on LALR(1) tables. As usual, if the grammar is ambiguous, this may generate shift/reduce or reduce/reduce conflicts. These conflicts are printed to standard output when the automaton is generated.
 
-By default, the automaton is not constructed until the parser is first used.
+パーサの生成器はLALR(1)テーブルをベースにした、『先読み後出しのオートメーション(pushdown automation)』を生成します。通常、文法が曖昧である場合には、このオートメーションは『移動してから減らすのか』あるいは『減らしてからさらに減らすのか』で衝突することになります。これらの衝突はオートメーションが生成された時点で、標準出力に表示されます。
 
-The ``build(debug)`` method forces the construction of the automaton. While not required, it is wise to finish each complete parser with a call to the ``build(debug)`` method. If the ``debug`` variable is set, this also prints with parser table together with any conflicts.
+.. By default, the automaton is not constructed until the parser is first used.
 
-The ``loc`` variable is defined within action bodies, and represents the input range for all tokens on the right-hand-side of the production.
+通常は、オートメーションはパーサが始めて使われることになるまで構築されません。
+
+.. The ``build(debug)`` method forces the construction of the automaton. While not required, it is wise to finish each complete parser with a call to the ``build(debug)`` method. If the ``debug`` variable is set, this also prints with parser table together with any conflicts.
+
+``build(debug)`` メソッドはオートメーションの構築を強制的に行います。 ``build(debug)`` メソッドを呼び出すことによって、各々のパーサが要求されなくなるまで完全に構築させるというのは賢い方法です。 ``debug`` 変数が設定されている場合、このメソッドはパーサテーブルの任意の衝突をそれぞれ出力します。
+
+.. The ``loc`` variable is defined within action bodies, and represents the input range for all tokens on the right-hand-side of the production.
+
+``loc`` 変数は行動部(action bodies)の内部で定義されます。また、生成部の右側にある、すべてのトークンの入力範囲を表現します。
 
 .. _label10.11.16:
 
 10.11.16 拡張したパーサ
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-Parsers may also be extended by inheritance. For example, let's extend the grammar so that it also recognizes the ``<<`` and ``>>`` shift operations.
+.. Parsers may also be extended by inheritance. For example, let's extend the grammar so that it also recognizes the ``<<`` and ``>>`` shift operations.
 
-First, we extend the lexer so that it recognizes these tokens. This time, we choose to leave ``lexer1`` intact, instead of using the += operator. ::
+パーサはまた継承することで拡張できます。例えば、文法を拡張することでシフト演算 ``<<`` と ``>>`` を理解できるようにしてみましょう。
+
+.. First, we extend the lexer so that it recognizes these tokens. This time, we choose to leave ``lexer1`` intact, instead of using the += operator.
+
+初めに、私たちはレキサを拡張することで、これらのトークンを理解できるようにします。今回、私たちは += 演算子を使う代わりに、既存の ``lexer1`` を完全なものにすることを選びました。 ::
 
    lexer2. =
       extends $(lexer1)
@@ -3039,7 +3051,9 @@ First, we extend the lexer so that it recognizes these tokens. This time, we cho
       asr: $">>"
          Token.unit($(loc), asr)
 
-Next, we extend the parser to handle these new operators. We intend that the bitwise operators have lower precedence than the other arithmetic operators. The two-argument form of the ``left`` method accomplishes this. ::
+.. Next, we extend the parser to handle these new operators. We intend that the bitwise operators have lower precedence than the other arithmetic operators. The two-argument form of the ``left`` method accomplishes this. ::
+
+次に、私たちはこれらの新しい演算子を扱うように、既存のパーサを拡張しました。ビット演算子は既存の算術演算子よりも低い優先順位にするつもりです。今回は二つの引数をとる ``left`` メソッドを使うことで実現しました。 ::
 
    parser2. =
       extends $(parser1)
@@ -3054,7 +3068,9 @@ Next, we extend the parser to handle these new operators. We intend that the bit
       exp: exp asr exp
          asr($1, $3)
 
-In this case, we use the new lexer ``lexer2``, and we add productions for the new shift operations. 
+.. In this case, we use the new lexer ``lexer2``, and we add productions for the new shift operations. 
+
+今回の場合、私たちは新しいレキサ ``lexer2`` を使用して、さらに新しいシフト演算子の生成部を追加しました。
 
 .. index::
    single: Passwd
@@ -3062,8 +3078,18 @@ In this case, we use the new lexer ``lexer2``, and we add productions for the ne
 
 10.11.17 Passwd
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. The Passwd object represents an entry in the system's user database. It contains the following fields.
+
 ``Passwd`` オブジェクトはシステムユーザのデータベース上にあるエントリを表現します。このオブジェクトは以下のプロパティを持っています。
 
+.. the login name. 
+   the encrypted password. 
+   user id of the user. 
+   group id of the user. 
+   the user name or comment field. 
+   the user's home directory. 
+   the user's default shell. 
+
 * ``pw_name`` : ログインネーム
 * ``pw_passwd`` : 暗号化されたパスワード
 * ``pw_uid`` : ユーザのユーザID
@@ -3072,6 +3098,8 @@ In this case, we use the new lexer ``lexer2``, and we add productions for the ne
 * ``pw_dir`` : ユーザのホームディレクトリ
 * ``pw_shell`` : ユーザが通常使うシェル
 
+.. Not all the fields will have meaning on all operating systems.
+
 すべてのプロパティがすべてのOS上で意味をもつわけではないことに注意してください。
 
 .. index::
@@ -3089,6 +3117,8 @@ In this case, we use the new lexer ``lexer2``, and we add productions for the ne
        uid : Int
     raises RuntimeException
 
+.. The getpwnam function looks up an entry by the user's login and the getpwuid function looks up an entry by user's numerical id (uid). If no entry is found, an exception will be raised.
+
 ``getpwnam`` 関数はユーザのログイン名からエントリを探しだします。 ``getpwuid`` 関数はユーザID(numerical id, uid)からエントリを探し出します。もしエントリが見つからなかった場合、例外が送出されます。
 
 .. index::
@@ -3101,6 +3131,8 @@ In this case, we use the new lexer ``lexer2``, and we add productions for the ne
 
     $(getpwents) : Array
 
+.. The getpwents function returns an array of Passwd objects, one for every user fund in the system user database. Note that depending on the operating system and on the setup of the user database, the returned array may be incomplete or even empty. 
+
 ``getpwents`` 関数は ``Passwd`` オブジェクトの配列を返します。すべてのユーザは、システムユーザのデータベースによって用意されます。この関数はOSやユーザデータベースの状況に依存し、返される配列は完全でなかったり、空である可能性もある点に注意してください。
 
 .. index::
@@ -3109,13 +3141,22 @@ In this case, we use the new lexer ``lexer2``, and we add productions for the ne
 
 10.11.20 Group
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-``Group`` オブジェクトはシステムのユーザグループに関するデータベースのエントリを表現します。このオブジェクトは以下のプロパティを含んでいます。 ::
+.. The Group object represents an entry in the system's user group database. It contains the following fields.
+
+``Group`` オブジェクトはシステムのユーザグループに関するデータベースのエントリを表現します。このオブジェクトは以下のプロパティを含んでいます。
+
+.. the group name. 
+   the encrypted password. 
+   group id of the group. 
+   the group member's user names. 
 
 * ``gr_name`` : グループ名
 * ``gr_group`` : 暗号化されたパスワード
 * ``gr_gid`` : グループのグループID
 * ``gr_mem`` : グループメンバのユーザ名
 
+.. Not all the fields will have meaning on all operating systems.
+
 すべてのプロパティがすべてのOSで意味を持つわけでは無い点に注意してください。
 
 .. index::
@@ -3133,6 +3174,8 @@ In this case, we use the new lexer ``lexer2``, and we add productions for the ne
        gid : Int
     raises RuntimeException
 
+.. The getgrnam function looks up a group entry by the group's name and the getgrgid function looks up an entry by groups's numerical id (gid). If no entry is found, an exception will be raised.
+
 ``getgrnam`` 関数はグループ名からグループエントリを探しだし、 ``getgrgid`` 関数はグループID(gid)からエントリを探し出します。何も見つからなかった場合は例外が送出されます。
 
 .. index::
@@ -3146,8 +3189,12 @@ In this case, we use the new lexer ``lexer2``, and we add productions for the ne
    $(tgetstr id) : String
       id : String
 
+.. The tgetstr function looks up the terminal capability with the indicated id. This assumes the terminfo to lookup is given in the TERM environment variable. This function returns an empty value if the given terminal capability is not defined.
+
 ``tgetstr`` 関数は指定された ``id`` を用いて『端末の能力(terminal capability, termcap)』を調べます。これは、"terminfo"の調査が ``TERM`` 環境変数によって与えられることを保証しています。もし与えられた"terminal capability"が定義されていなかった場合、この関数は空の値を返します。
 
+.. Note: if you intend to use the value returned by tgetstr inside the shell prompt, you need to wrap it using the prompt-invisible function.
+
 .. note::
   シェルプロンプト内部の ``tgetstr`` によって返された値を使用したい場合、あなたは ``prompt-invisible`` 関数を用いてラップする必要があります。
 
@@ -3163,8 +3210,12 @@ In this case, we use the new lexer ``lexer2``, and we add productions for the ne
    $(xterm-escape-begin) : String
    $(xterm-escape-end) : String
 
+.. The xterm-escape-begin and xterm-escape-end functions return the escape sequences that can be used to set the XTerm window title. Will return empty values if this capability is not available.
+
 ``xterm-escape-begin`` と ``xterm-escape-end`` 関数はXTermのウィンドウタイトルを設定したい場合に用いることができる、エスケープのシーケンスを返します。この機能が使えない場合、この関数は空の値を返します。
 
+.. Note: if you intend to use these strings inside the shell prompt, you need to use $(prompt_invisible_begin)$(xterm-escape-begin) and $(xterm-escape-end)$(prompt_invisible_end). 
+
 .. note::
   シェルプロンプト内部の値を用いるようにしたい場合、あなたは ``$(prompt_invisible_begin)$(xterm-escape-begin)`` と ``$(xterm-escape-end)$(prompt_invisible_end)`` を使う必要があります。
 
@@ -3178,8 +3229,12 @@ In this case, we use the new lexer ``lexer2``, and we add productions for the ne
 
    $(xterm-escape s) : Sequence
 
+.. When the TERM environment variable indicates that the XTerm title setting capability is available, $(xterm-escape s) is equivalent to $(xterm-escape-begin)s$(xterm-escape-end). Otherwise, it returns an empty value.
+
 ``TERM`` 環境変数が『XTermのタイトルを設定する機能が利用できる』ことを表していた場合、 ``$(xterm-escape s)`` は ``$(xterm-escape-begin)s$(xterm-escape-end)`` と等価です。そうでない場合、この関数は空の値を返します。
 
+.. Note: if you intend to use the value returned by xterm-escape inside the shell prompt, you need to wrap it using the prompt-invisible function.
+
 .. note::
   シェルプロンプト内部の ``xterm-escape`` によって返された値を用いるようにしたい場合、あなたは ``prompt-invisible`` 関数を使ってラップする必要があります。
 
@@ -3195,6 +3250,8 @@ In this case, we use the new lexer ``lexer2``, and we add productions for the ne
    $(prompt-invisible-begin) : String
    $(prompt-invisible-end) : String
 
+.. The prompt-invisible-begin and prompt-invisible-end functions return the escape sequences that must used to mark the “invisible” sections of the shell prompt (such as various escape sequences). 
+
 ``prompt-invisible-begin`` と ``prompt-invisible-end`` 関数は、シェルプロンプトに『見えない』セクション(様々なエスケープシーケンスのような)を設定するために用いる必要のある、エスケープのシーケンスを返します。
 
 .. index::
@@ -3207,6 +3264,8 @@ In this case, we use the new lexer ``lexer2``, and we add productions for the ne
 
    $(prompt-invisible s) : Sequence
 
+.. The prompt-invisible will wrap its argument with $(prompt-invisible-begin) and $(prompt-invisible-end). All the `invisible” sections of the shell prompt (such as various escape sequences) must be wrapped this way. 
+
 ``prompt-invisible`` は指定された引数を ``$(prompt-invisible-begin)`` と ``$(prompt-invisible-end)`` でラップします。シェルプロンプトに『見えない』すべてのセクション(様々なエスケープシーケンスのような)はこの方法でラップしなければなりません。
 
 .. index::
@@ -3219,4 +3278,6 @@ In this case, we use the new lexer ``lexer2``, and we add productions for the ne
 
    $(gettimeofday) : Float
 
+.. The gettimeofday function returns the time of day in seconds since January 1, 1970.
+
 ``gettimeofday`` 関数は1970年1月1日から始まる、現在までの秒数を返します。