Skip to content

Commit aa7345d

Browse files
committed
Translate Interpreter
1 parent 597beeb commit aa7345d

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

README-ja-jp.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ _このドキュメントは[AngularJS in Patterns](https://github.com/mgechev/a
2626
* [傍受フィルタ](#傍受フィルタ)
2727
* [ディレクティブ](#ディレクティブ-1)
2828
* [コンポジット](#コンポジット)
29-
* [Interpreter](#interpreter)
29+
* [インタープリタ](#インタープリタ)
3030
* [Template View](#template-view)
3131
* [Scope](#scope-1)
3232
* [Observer](#observer)
@@ -662,32 +662,32 @@ myModule.directive('zippy', function () {
662662

663663
2番目のJavaScriptの例から、ディレクティブの `template` プロパティは `ng-transclude` ディレクティブが付加されたマークアップを見つけることができます。 `zippy` ディレクティブの中で別のディレクティブである `ng-transclude` を持つことを意味しています。つまり、ディレクティブのコンポジションです。理論上はコンポーネントは末節のノードまで無限にネストすることができます。
664664

665-
### Interpreter
665+
### インタープリタ
666666

667-
>In computer programming, the interpreter pattern is a design pattern that specifies how to evaluate sentences in a language. The basic idea is to have a class for each symbol (terminal or nonterminal) in a specialized computer language. The syntax tree of a sentence in the language is an instance of the composite pattern and is used to evaluate (interpret) the sentence.
667+
>コンピュータプログラミングではインタープリタ・パターンはある言語の文をどのように評価するかを決めるデザイン・パターンです。言語に特化したそれぞれのシンボル(オペレータであるかそうでないかは関係なく)に対する分類を持つというのが基本的な考え方です。文のシンタックス・ツリーはコンポジットパターンのインスタンスです。そして、それは分を評価(解釈)する際に使われます。
668668
669669
![Interpreter](https://rawgit.com/mgechev/angularjs-in-patterns/master/images/interpreter.svg "Fig. 6")
670670

671-
Behind its `$parse` service, AngularJS provides its own implementation of interpreter of a DSL (Domain Specific Language). The used DSL is simplified and modified version of JavaScript.
672-
The main differences between the JavaScript expressions and AngularJS expressions that AngularJS expressions:
671+
`$parse` サービスの背後では、AngularJSは独自のDSL(Domain Specific Language)記法のインタープリタを実装しています。DSLはシンプルに変更されたJavaScriptです。
672+
JavaScript記法とAngularJS機能の主な違いとして、AngularJS記法は:
673673

674-
- may contain filters with UNIX like pipe syntax
675-
- don't throw any errors
676-
- don't have any control flow statements (exceptions, loops, if statements although you can use the ternary operator)
677-
- are evaluated in given context (the context of the current `$scope`)
674+
- UNIX的なパイプ・シンタックスを含んでいること
675+
- エラーを投げないこと
676+
- コントロール・フロー文をもたないこと(オペレータは使えるが、例外、ループ、if文は持たない)
677+
- 所与のコンテクスト内で評価されること(現在の `$scope` のコンテクスト)
678678

679-
Inside the `$parse` service are defined two main components:
679+
`$parse` サービスのの内部では2つの主なコンポーネントが定義されています:
680680

681681
```JavaScript
682-
//Responsible for converting given string into tokens
682+
//与えられた文字列をトークンに変換する責務を追う
683683
var Lexer;
684-
//Responsible for parsing the tokens and evaluating the expression
684+
//トークンをパースして式を評価する責務を追う
685685
var Parser;
686686
```
687687

688-
Once given expression have been tokenized it is cached internally, because of performance concerns.
688+
式がトークン化されると、パフォーマンスのために内部にキャッシュされます。
689689

690-
The terminal expressions in the AngularJS DSL are defined as follows:
690+
AngularJS DSLではオペレータは下記のように定義されています:
691691

692692
```JavaScript
693693
var OPERATORS = {
@@ -720,14 +720,14 @@ var OPERATORS = {
720720
};
721721
```
722722

723-
We can think of the function associated with each terminal as implementation of the `AbstractExpression`'s interface.
723+
それぞれのオペレータに関連付けられた関数を `AbstractExpression` のインターフェイス実装と考えることができます。
724724

725-
Each `Client` interprets given AngularJS expression in a specific context - specific scope.
725+
それぞれの `Client` は与えられたAngularJSの式を固有のコンテキスト - 固有のスコープで解釈します。
726726

727-
Few sample AngularJS expressions are:
727+
AngularJSのサンプルの式です:
728728

729729
```JavaScript
730-
// toUpperCase filter is applied to the result of the expression
730+
// toUpperCase フィルタは式の結果に対して適用されます
731731
// (foo) ? bar : baz
732732
(foo) ? bar : baz | toUpperCase
733733
```

0 commit comments

Comments
 (0)