X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=language.rst;fp=language.rst;h=82f0ceec4577bcf44ea3139a97e98bafc68e1199;hb=40ea86f13da8bce01a4c8ed57b4c08652905edcd;hp=c07b5d6ea55252ce348419ec58ff592b5d825555;hpb=44a4ed758dc510c571e8a2b7336c94f63d60de7c;p=omake-japanese%2Fomake_trans.git diff --git a/language.rst b/language.rst index c07b5d6..82f0cee 100644 --- a/language.rst +++ b/language.rst @@ -2,7 +2,7 @@ .. _label4: -4. OMake言語の概要と構文 +OMake言語の概要と構文 ================================== .. Projects are specified to omake with OMakefiles. The OMakefile has a format similar to a Makefile. An OMakefile has three main kinds of syntactic objects: variable definitions, function definitions, and rule definitions. @@ -12,7 +12,7 @@ single: 変数 .. _label4.1: -4.1 変数 +変数 ------------- .. Variables are defined with the following syntax. The name is any sequence of alphanumeric characters, underscore _, and hyphen -. @@ -46,7 +46,7 @@ .. _label4.2: -4.2 変数に値を追加 +変数に値を追加 --------------------- .. Variables definitions may also use the += operator, which adds the new text to an existing definition. The following two definitions are equivalent. @@ -62,7 +62,7 @@ single: 配列 .. _label4.3: -4.3 配列 +配列 --------------------- .. Arrays can be defined by appending the [] sequence to the variable name and defining initial values for the elements as separate lines. Whitespace is significant on each line. The following code sequence prints c d e. @@ -80,7 +80,7 @@ single: クオーティング .. _label4.4: -4.4 特殊文字とクオート +特殊文字とクオート ----------------------- .. The following characters are special to omake: $():,=#\. To treat any of these characters as normal text, they should be escaped with the backslash character \. @@ -117,7 +117,7 @@ single: value .. _label4.5: -4.5 関数定義 +関数定義 ---------------- .. Functions are defined using the following syntax. @@ -180,7 +180,7 @@ single: コメント .. _label4.6: -4.6 コメント +コメント ---------------- .. Comments begin with the # character and continue to the end of the line. @@ -191,7 +191,7 @@ single: open .. _label4.7: -4.7 ファイルのインクルード +ファイルのインクルード ----------------------------- .. Files may be included with the include or open form. The included file must use the same syntax as an OMakefile. @@ -218,7 +218,7 @@ single: export .. _label4.8: -4.8 スコーピング、セクション +スコーピング、セクション ------------------------------- .. Scopes in omake are defined by indentation level. When indentation is increased, such as in the body of a function, a new scope is introduced. @@ -276,7 +276,7 @@ omakeのスコープはインデントのレベルで定義されます。イン single: if .. _label4.9: -4.9 条件分岐 +条件分岐 ---------------- .. Top level conditionals have the following form. @@ -327,7 +327,7 @@ omakeのスコープはインデントのレベルで定義されます。イン single: 正規表現 .. _label4.10: -4.10 マッチング +マッチング ------------------- .. Pattern matching is performed with the switch and match forms. @@ -390,7 +390,7 @@ omakeのスコープはインデントのレベルで定義されます。イン single: メソッド .. _label4.11: -4.11 オブジェクト +オブジェクト --------------------- .. OMake is an object-oriented language. Generally speaking, an object is a value that contains fields and methods. An object is defined with a . suffix for a variable. For example, the following object might be used to specify a point (1, 5) on the two-dimensional plane. @@ -417,7 +417,7 @@ OMakeはオブジェクト指向言語です。一般的に、オブジェクト single: class .. _label4.12: -4.12 クラス +クラス --------------- .. We can also define classes. For example, suppose we wish to define a generic Point class with some methods to create, move, and print a point. A class is really just an object with a name, defined with the class directive. @@ -462,7 +462,7 @@ OMakeはオブジェクト指向言語です。一般的に、オブジェクト single: 継承 .. _label4.13: -4.13 継承 +継承 --------------- .. Classes and objects support inheritance (including multiple inheritance) with the extends directive. The following definition of Point3D defines a point with x, y, and z fields. The new object inherits all of the methods and fields of the parent classes/objects. @@ -491,7 +491,7 @@ OMakeはオブジェクト指向言語です。一般的に、オブジェクト single: ConfMsgResult() .. _label4.14: -4.14 static. +static. --------------- .. The static. object is used to specify values that are persistent across runs of OMake. They are frequently used for configuring a project. Configuring a project can be expensive, so the static. object ensure that the configuration is performed just once. In the following (somewhat trivial) example, a static section is used to determine if the LATEX command is available. The $(where latex) function returns the full pathname for latex, or false if the command is not found. @@ -526,7 +526,7 @@ OMakeの標準ライブラリを用いると第14章( :ref:`label14` )にある single: awk() .. _label4.14.1: -4.14.1 .STATIC +.STATIC ^^^^^^^^^^^^^^^^^^ .. This feature was introduced in version 0.9.8.5. @@ -587,7 +587,7 @@ OMakeの標準ライブラリを用いると第14章( :ref:`label14` )にある single: .MEMO .. _label4.14.1.1: -4.14.1.1 .MEMO +.MEMO """""""""""""""""" .. A .MEMO rule is just like a .STATIC rule, except that the results are not saved between independent runs of omake. @@ -599,7 +599,7 @@ OMakeの標準ライブラリを用いると第14章( :ref:`label14` )にある single: 再帰関数 .. _label4.14.1.2: -4.14.1.2 :key: +\:key: """""""""""""""""" .. The .STATIC and .MEMO rules also accept a :key: value, which specifies a “key” associated with the values being computed. It is useful to think of a .STATIC rule as a dictionary that associates keys with their values. When a .STATIC rule is evaluated, the result is saved in the table with the :key: defined by the rule (if a :key: is not specified, a default key is used instead). In other words, a rule is like a function. The :key: specifies the function “argument”, and the rule body computes the result. @@ -693,7 +693,7 @@ OMakeの標準ライブラリを用いると第14章( :ref:`label14` )にある single: パーサ .. _label4.15: -4.15 定数 +定数 ----------------- .. Internally, OMake represents values in several forms, which we list here.